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

final-review.md

Factory Interface: independent final review (2026-11-28)

Task FI-FINAL-REVIEW-001 (execution 312). Reviewer did not edit implementation, restart services or write to the production DB.

Verdict

Method

Test evidence

Full unittest discover -s control_plane/tests: 147 run, 15 FAIL, 3 ERROR.

SuiteResultBaseline comparison
test_deliverables, test_verification, test_control_plane_dispatcher, test_console_cacheall passn/a
test_activity_sortall passn/a
test_owner_result8 of 8 pass in a copy whose root path was patched. As-is in my copy it fails 1 (test_report_relative_absolute_and_absent).Environment-bound, see L4. It is not a product failure on /home/iovon/ai-factory.
test_runtime (6), test_supervisor (4), test_approved_runtime (1)11 failIdentical 11 test names with the pre-change dispatcher and verification. Pre-existing, not a regression.
test_owner_decisions (4), test_executor_policy (2)4 FAIL, 2 ERRORIdentical 6 names with the pre-change console. They are stale markup and DOM-stub expectations. This agrees with the F1 and activity reports.

The 15 failures plus 3 errors are the 11 runtime-family, the 6 UI-suite, and 1 owner_result environment artefact, minus one overlap, so the sets match the baselines. There are no regressions attributable to this work.

Caveat: the 6 UI tests are red while the owner has accepted that UI (FI-OWNER-ACTION-001). The tests are stale and should be repaired or retired in a separate task.

Probe results

All probes ran against the read-only DB copy.

F1, legacy 321/322 — PASS.

F2 directory filtering — PASS. Probed on a temp workspace:

ZIP paths — PASS.

42 historical snapshots and acceptance — PASS.

Transactional registration — PASS (code review).

Activity ordering and cache — PASS.

Owner summary and report fallback — PASS.

Report file disclosure, symlink and path confinement.

Markdown XSS — PASS.

Authorised artifact routes — PASS.

Mobile markup, headless Chromium — PASS with a limit.

Findings

#SeverityFindingAction
M1MEDIUM (hardening)resolve_report accepts the first mentioned .md anywhere in the factory root (minus denied dirs). A prompt-injected executor result could surface another project's file to the owner. The page is owner-only, so there is no external exposure.Backlog. Consider allowing the task workspace, its project's data/project_materials/<key>, docs/, and a root allow-list.
L1LOWrender_markdown("\x000\x00") raises IndexError, so /tasks/{id}/report and /summary return 500 if a stored result contains NUL plus digits. It cannot be exploited for script injection.Strip \x00 before stashing.
L2LOWA URL containing **x** yields <strong> inside an href: broken markup only, no breakout. A protocol-relative //host link is allowed.Backlog.
L3LOWThe card preview shows the raw FACTORY_OUTCOME: COMPLETED … prefix and truncates at 400 characters. It does not use the structured summary, which is available only after the dispatcher restarts.Cosmetic. Strip the prefix in owner_preview.
L4LOWMD_PATH hardcodes /home/iovon/ai-factory/, so the owner_result test fails in any other checkout.Derive from ROOT.
L5LOWIn the fallback, the execution error is cut to 1500 characters in the "Проблемы" field.Acceptable. Know the limit.
L6INFOThe deliverables acceptance flag is still inferred (original F6). ZIPs are buffered in memory (F3), at 50 MB per file, 512 MB per ZIP, 500 files.No change.
L7INFOThe 6 stale UI tests and the 11 runtime/supervisor tests are red on baseline.Separate cleanup task.
L8INFOEmoji in the "Технический отчёт" link renders as a missing-glyph box in headless Chromium, which has no emoji font.Check on iPhone.

Blockers: none.

Documentation drift

  1. Task-Execution-Runbook.md §7 still says "ZIP all/group … retains full workspace-relative paths". The F2 report says it is superseded: names are now relative to a single shared root (project-material root, or common parent). Update before activation.
  2. docs/task-execution/ChatGPT-Context-Card.txt says "ZIP … preserving paths". It should say shortened, collision-safe relative paths.
  3. docs/implementation-evidence/deliverables-20261127/REPORT.md has the same old wording and the old test counts.
  4. The Runbook is missing:
  5. the /tasks/{id}/summary route and the ## Сводка для владельца executor contract;
  6. the /tasks/{id}/report fallback and path rules;
  7. activity ordering;
  8. the F1 rule: legacy kind=deliverable rows without provenance or relative_path use the legacy path through /artifacts/{id};
  9. the F2 directory rule: subdirectories, hidden entries and FIFOs are ignored, while a matching symlink fails.
  10. The owner_result report calls the test count "140 tests, 15 failing" and the activity report "35 tests, 29 passed". These are fine for their time. The current full count is 147 with 18 failing, all baseline.
  11. deliverables-fix-report.md and the original review say the 6 UI-suite failures are "baseline". That is true but the owner accepted that UI. Note the stale tests in docs/ so they are not read as a UI defect.

Activation checklist

Do not do these until no RUNNING or QUEUED execution exists, and the owner authorises the restart.

  1. Check idle:
   SELECT count(*) FROM executions WHERE status IN ('RUNNING','QUEUED');

This must return 0. Right now execution 312 is running.

  1. Back up data/factory.db using the SQLite backup API, not cp.
  2. Optionally fix L1 (NUL) and update the Runbook, Context Card and REPORT per the drift list. Re-run test_owner_result, test_deliverables and test_activity_sort.
  3. Restart the dispatcher (pid 1740798, started Nov 16). Only then does the structured owner-summary contract and the transactional register() apply to new executions. It currently runs the old code.
  4. Restart the console (uvicorn console.app:app, port 8110, started Nov 26). The new routes, owner_result, the activity ordering and the F1/F2 handlers are not live until then.
  5. Smoke tests, authenticated:
  6. / and /projects/FACTORY-INTERFACE return 200 with the activity-ordered list.
  7. /artifacts/321 and /artifacts/322 return 200 (42,209 and 22,755 bytes).
  8. ZIPs for 209/301 (36 entries) and 210/302 (6 entries), testzip() clean, names like review/crop-review.pdf.
  9. /tasks/{id}/summary and /tasks/{id}/report on one historical task, one empty-result task, and a task with no report file.
  10. One cross-task URL (209/302) returns 404.
  11. iPhone Safari, 390 px: check the project page, the Результат button, collapsed deliverables, and the ZIP download.
  12. After the next real task completes, confirm it records a ## Сводка для владельца block. Until then every historical task correctly shows the fallback.
  13. Rollback: restore the changed code files from backups/deliverables-* and restart. No DB rollback is needed. The historical rows are additive, and the pre-registration backup is backups/deliverables-20261127/factory-before-registration.db.

Remaining blockers

None for code acceptance. Open items:

Материалы