← Назад к задаче

deliverables-review.md

Independent review: Task Deliverables & Downloads (2026-11-27)

Verdict: NO-GO for operational acceptance as-is. CONDITIONAL GO after fixing finding F1 (one small, contained fix). Core design is sound. Historical data is correct.

Scope: Codex implementation vs backups/deliverables-20261127, REPORT.md, the instruction, and 02-security.md. I reviewed and did not redo development. I changed no code. Production DB was only read via a SQLite backup copy (/tmp/rv_copy.db); I did not restart services or write to production.

Findings

#SeverityFinding
F1HIGH (regression)Pre-existing artifacts with kind='deliverable' now 404. Production has two legacy rows, task 108 / CBS-001 / execution 175 (artifact 321 CRYPTO_BACKUP_REPORT.md, 322 CRYPTO_BACKUP_PROVIDERS.csv). Their paths are data/artifacts/CBS-001/175/... and their metadata is {sha256,size_bytes} only. stored_bytes() requires deliverables/{task}/{exec}/{sha} for any kind=deliverable, so /artifacts/321, /artifacts/322, ?download=1, the task/execution route and the ZIP all return 404. They worked before the change (the old route served any file that existed). listing() also returns them as incomplete entries (no relative_path/mime/group). /artifacts/{id} is the only path to them today, since the old UI showed them as technical artifacts. test_legacy_artifact_compatibility_and_symlink_rejection did not catch this because it only covers non-deliverable kinds. Fix: apply the strict snapshot-path rule and the new routes/listing only to rows whose metadata contains provenance/relative_path. Serve other kind=deliverable rows through the legacy containment path (root + sha check when present). Add a regression test using the real shape of artifacts 321/322.
F2MEDIUMA directory declaration whose directory contains a subdirectory, or any dotfile, fails the whole verification (IsADirectoryError / "sensitive path"). Required sets then fail and optional sets abort. It fails closed, which is safe, but it is brittle for operators. Skip or ignore non-regular entries, or document it. Only immediate children are matched, and the glob cannot contain / or **.
F3LOWWhole files are read into memory (50 MB per file, 512 MB per ZIP, 500 files). That is acceptable for one owner. A 25 MB ZIP for task 209 builds fine. Consider streaming if bounds grow.
F4LOWZIP entry names carry the full workspace-relative path (e.g. data/project_materials/HRV-WORKSHOP/review/crop-review.pdf). This matches "preserve relative paths", but the paths are long for a human. This is a product decision.
F5LOW (process)Deployment and browser validation remain unperformed. Chromium and systemctl were blocked in the executor sandbox. The report says so honestly. Currently execution 307 (task 215) is RUNNING, so do not restart services now.
F6INFOacceptance is inferred in listing(): an accept event is mapped to the latest execution created before the event. It does not model a later reject/rework event. Wording on screen is "Accepted by owner" or "Acceptance not recorded for this attempt", which is not mislabeled. Tasks 209/210 each have one attempt and one accept, so the current data is correct. Latest is not shown as accepted unless an accept event maps to it.

Verified OK (with evidence)

Test results (isolated temp DBs; .venv/bin/python -m unittest)

SuiteResult
test_deliverables8 OK
test_verification16 OK
test_control_plane_dispatcher33 OK
test_console_cache5 OK
test_owner_decisions11 run, 2 FAIL + 2 ERROR (same four the report lists as pre-existing; Codex says they reproduce on backed-up templates; I did not re-prove this)
test_executor_policy14 run, 2 FAIL (test_creation_forms_and_visible_roadmap, test_inline_javascript_...). The report cites 13 OK earlier. The templates show the executor-settings panel with display:none, identical in backup and current project.html, so the cause is probably the earlier hidden-UI change and not this work. I could not run a baseline (the backup holds only two test files). Unconfirmed.

Probe (production DB copy, direct handler calls): artifacts 591/592 return 200 (PDF inline; JSON attachment). 321/322 return 404 (F1). The test client is unavailable (no httpx2), so no real HTTP or browser run.

GO / NO-GO

Next steps

  1. Fix F1 and add a test with rows shaped like 321/322. Optionally handle F2.
  2. Run SELECT id,path FROM artifacts WHERE kind='deliverable' AND path NOT LIKE '%/deliverables/%' and any artifact rows outside data/artifacts. Confirm they still open.
  3. Rerun the suites above. Triage the executor_policy failures against a clean baseline.
  4. Restart console and dispatcher once there is no RUNNING/QUEUED execution. Smoke-test /projects/HRV-WORKSHOP, task 209/210 ZIPs, and /artifacts/321.

Материалы