Files
mtusi2026lab4/evidence/attachments/smoke.md
T
ricoromaandClaude Opus 5.5 8dc925e8ca docs: add attachments evidence and report
- re-capture coverage-exclusion evidence on the lab 4 stand: cache,
  auth storage, replay after API recreate, test-persistence,
  attachment-failover (stop, kill), attachment-storage
- green evidence/tests: student_test via LB, test_isolated,
  failure_checks; smoke, slow transfer, test-failover per replica
- bench_rollout label attachments: e1161f7 -> schema with attachments
  under load, no errors, messages = keys
- REPORT.md: attachments architecture, write order, defense answers,
  level 3/4 evidence rows, limitations; PLAN.md stage 2

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 01:50:10 +03:00

65 lines
3.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Вложения: публичный smoke и ручная проверка драйвером
- Дата: 2026-10-20, 22:33:47–22:33:50 UTC.
- Commit: `d56b892` (код приложения — `116d8d3`, change `attachments`).
- Стенд: рабочий `mtusi-lab4` — HAProxy на `127.0.0.1:8080`, две
реплики API, PostgreSQL, Valkey, S3.
- Рубрика «3» лабы 4: загрузка PNG с `201 Attachment` (`ready`),
побайтный download через API участнику, 404 постороннему.
## `make test`
Публичный сценарий лабы 4 (`tests/smoke.py`) загружает
`tests/fixtures/sample.png`, отправляет сообщение с `attachment_ids`,
скачивает оригинал и сверяет SHA-256, проверяет 404 постороннему.
```
$ make test
python3 tests/smoke.py --base-url "http://localhost:8080"
PASS: lab4 public API scenario; infrastructure and grading evidence remain separate.
exit=0
```
## `driver.py upload` / `download`
Синтетические Алиса и Боб — участники чата, Ева — посторонняя. Токены в
выводе заменены на `<…-token>`, путь к fixture — относительный.
```
$ python3 .claude/skills/run-mtusi-messenger/driver.py --port 8080 upload --token <alice-token> --chat 3bf818d6-6536-4c5a-9c9c-d74d1193e1c8 --file tests/fixtures/sample.png
201 x-instance-id: 5f5d4ac50d9a
{
"id": "6757bc3a-66b5-4243-9ca1-ec942381ba7e",
"chat_id": "3bf818d6-6536-4c5a-9c9c-d74d1193e1c8",
"owner_id": "c0cf8ccb-ab83-4c51-90f8-74bcd4e3e0cf",
"filename": "sample.png",
"content_type": "image/png",
"size_bytes": 111817,
"sha256": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75",
"status": "ready",
"variants": [],
"error_code": null,
"created_at": "2026-10-20T22:33:48.827582Z",
"updated_at": "2026-10-20T22:33:48.832614Z"
}
file: 111817 bytes, sha256 99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75
sha256 matches: True
exit=0
$ python3 .claude/skills/run-mtusi-messenger/driver.py --port 8080 download --token <bob-token> --attachment 6757bc3a-66b5-4243-9ca1-ec942381ba7e
200 x-instance-id: 847ad74efd7c content-type: image/png content-length: 111817
received: 111817 bytes, sha256 99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75
exit=0
$ python3 .claude/skills/run-mtusi-messenger/driver.py --port 8080 download --token <eve-token> --attachment 6757bc3a-66b5-4243-9ca1-ec942381ba7e
404 x-instance-id: 5f5d4ac50d9a content-type: application/json content-length: 100
{"error":{"code":"not_found","message":"Not found","request_id":"0008c43dbac945a2b6bf659917a31580"}}
exit=2
GET /api/v1/attachments/6757bc3a-66b5-4243-9ca1-ec942381ba7e as eve -> 404 not_found
```
- Загрузку принял `5f5d4ac50d9a`, оригинал Бобу отдал `847ad74efd7c`:
байты из S3, а не с диска принявшей реплики. SHA-256 совпадает с
файлом и с `tests/fixtures/README.md`.
- `Content-Type` скачивания — `image/png` без параметров,
`Content-Length` — размер оригинала.
- Ева (не участник) получает одинаковый 404 на метаданные и байты.