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

r15-dev-isolation-review.md

FACTORY_OUTCOME: COMPLETED

Сводка для владельца

Итог: FAIL — DEV пригоден как исходная копия для проверки, но изоляция и готовность к выпуску не подтверждены.
Проблемы: наследование env и доступ к host-путям/сокетам; неполная fake-маршрутизация; Factory не переведена на DEV; падают ABC-проверки; доказанного отката нет.
Решение: оставить активацию закрытой; разрешить отдельную задачу устранения блокеров и повторную проверку до согласования окна выпуска.

Verdict and scope

Independent review of task 259 report r15-dev-isolation.md, performed 2026-11-29. FAIL for autonomous DEV isolation/readiness and PROD release safety. PASS for the 295-file baseline parity and archive checksums only. This review is complete; a negative readiness verdict does not require an owner checkpoint to deliver the report.

No source repairs, real executor launches, production DB writes, service changes/restarts, production migration or activation were performed. Only this report was written in PROD; test snapshots/results are under /tmp/r15-review-x93dsfkn. Test activation calls, where present, operate exclusively on temporary test databases. DEV Git working tree remained clean. No secret values were collected.

Independent evidence

CheckResult and qualification
Pristine tagccd1bd428d2d64709558ed6fd0c3e4436c4b5648 (dev-baseline-0-pristine-unverified)
Isolated tag/HEADe7891e3cabf9f093da865de929def60c85964bc3 (dev-baseline-1-isolated-unverified)
ParityRecomputed SHA256 for all 295 PROD_PARITY.sha256 entries against current PROD and git show ccd1bd4:<path>: zero mismatches in either comparison. This covers the manifest, not excluded data, secrets, workspaces or dependency environment.
DEV deltaIndependently inspected Git diff: 37 files, +134/-40; path rewrites, executor-directory override, exit-78 handling, dev tools/fakes/test.
ArchiveBoth source.tar.gz and factory.db match backups/runtime-pre-recovery-hardening-20261129-125343/SHA256SUMS. Compared tar members without extraction: 234 current files identical; only dispatcher and two docs differ. New recovery libraries are already in the archive.
DEV links/dependenciesNo symlinks found within DEV. Shared venv Python resolves to /usr/bin/python3; pyvenv.cfg specifies Python 3.12.3, no system site packages; no .pth files found. Dependency reproducibility is not established by these checks.
Runtime visibilitysystemctl show denied access to bus; ss denied netlink; current process namespace does not expose host services. Live PIDs, listeners, RAM and start times in task 259 are historical claims, not independently reconfirmed. Unit files were read directly.

Blocking isolation findings

  1. Inherited environment and excessive host visibility. dev_tools/run_sandboxed.sh uses --ro-bind / / and overrides a few variables, but never clears the environment. API tokens, proxy configuration, PYTHONPATH, loader settings and agent/socket locations can survive. HOME=/tmp/home is not credential removal. providers/openrouter.py:26 explicitly consumes OPENROUTER_API_KEY. The masks cover /home/iovon, /tmp, /etc/ai-factory, /var/www; other home roots, /etc, /opt, /srv, /run and /var remain exposed subject to host permissions. Read-only filesystem mounts prevent ordinary file writes, not disclosure or communication through reachable pathname Unix sockets. /run/dbus/system_bus_socket exists and is readable on this host; no connection was attempted. Socket authorization/exploitability is not proven. Require an environment allowlist and minimal filesystem mounts, including removal of host runtime sockets, before calling this a credential-isolated sandbox.
  2. Fake routing is partial and opt-in. DEV load_executor checks name not in BUILTIN before consulting AI_FACTORY_EXECUTOR_DIR; registry aliases call executors/openrouter_registry.py::Executor.run → real openrouter.run_text. Legacy dispatcher/direct executor imports also do not use that override. AI_FACTORY_DEV=1 alone enforces nothing. PATH shims cover only claude and codex, can be bypassed by absolute binaries, and do not cover provider HTTP calls. Network unsharing helps only while the runner actually runs. Require fail-closed routing for every entry point/alias plus a coverage test. Fake success strings are not proof of artifact delivery or ABC completion.
  3. No enforced future Factory-to-DEV routing. PROD dispatcher/control_plane_dispatcher.py:116 defaults codex/claude-code workspace to PROD ROOT; lines 225–233 pass that workspace to the executor. The installed dispatcher unit still points to PROD and contains no DEV wrapper. Searches of production control_plane/dispatcher/config/deploy found no ai-factory-dev, run_sandboxed or AI_FACTORY_DEV routing. A manually supplied workspace can alter cwd but does not enforce a sandbox or fake execution. Current task's declared dispatcher workspace is also PROD. Merely creating DEV does not route future development there. Task-specific live DB assignments were not inspected; there is no demonstrated general routing policy.
  4. Writable shared DEV and unpinned venv. Runner binds the entire DEV tree read-write, including .git and runner/fakes; tests can mutate the reviewed checkout. The venv is mounted read-only inside the proposed sandbox, which protects it from sandbox writes, but host package updates can change DEV and PROD simultaneously. No frozen independent environment or dependency-hash attestation is supplied. Use disposable writable test state and immutable reviewed source/dependencies for reproducible acceptance.

DB, locks, ports and portability

control_plane/db.py derives ROOT from its source path and DB_PATH from ROOT/data/factory.db. Dispatcher global/project locks derive from ROOT/data; journals derive from the configured database. These defaults separate DEV from PROD when launched from DEV, and no DEV symlink bypass was found. This is conditional path separation, not an enforced boundary against arbitrary overrides or direct host execution. The pristine and isolated Git tags alone do not contain the schema-only DB needed by some console tests; bootstrap is separate.

Network namespace isolation would separate TCP port spaces. Ports 18110/18200 in the report are conventions, not verified reservations or enforced runtime configuration. This review cannot assert that they are free. No listener was started. Host pathname sockets are a separate issue from TCP isolation.

Do not promote isolated HEAD wholesale: hardcoded DEV paths include executors/providers, deployment scripts and supervisor unit; the latter points at /home/iovon/ai-factory-dev/.venv/bin/python, while DEV actually uses the PROD venv mount. Service names and privilege installers can still target real system administration. Porting requires an explicit reviewed patch: separate portable behavior changes from path/test harness changes, remove or constrain the executor override in production, restore production deployment paths, and compare a complete release manifest. Exit 78 is a portable behavior change but must be coordinated with service restart policy and observable alerting.

Offline tests, known failures and exclusions

Attempted the shipped runner with env -i, PATH and a synthetic sentinel only, invoking a read-only Python probe. It failed before the payload: bwrap: loopback: Failed to create NETLINK_ROUTE socket: Operation not permitted (exit 1). Consequently there is no independent dynamic validation of its mounts, environment, network or shared-venv read-only behavior in this review. The runner was not weakened to run broad suites outside isolation.

For narrowly scoped safe tests, exported exact Git tags into /tmp, used a cleared environment, disabled bytecode/cache and plugin autoload, and ran only the inspected offline temporary-DB/stub-executor recovery suites using the existing interpreter:

python -m pytest -p no:cacheprovider -q control_plane/tests/test_outcome_recovery.py control_plane/tests/test_recovery_harden.py

Independent results: pristine tag 25 passed, 4 subtests passed in 62.99 s; isolated tag 25 passed, 4 subtests passed in 53.67 s, both exit 0. These temporary-copy tests verify recovery logic only, not the shipped bubblewrap boundary or full ABC flow. Logs: /tmp/r15-review-x93dsfkn/dev-baseline-0-pristine-unverified.log and /tmp/r15-review-x93dsfkn/dev-baseline-1-isolated-unverified.log.

Full-suite evidence below is prior task evidence inspected and compared, not newly reproduced:

SuiteTask-259 resultIndependent assessment
control_plane15 failed / 219 passed / 76 subtestsParsed all FAILED node IDs from full-control-plane-strict.log; exact equality with the 15 IDs in harden-evidence/resume-full-failures.json.
Archive candidate control_plane15 failed / 219 passed reportedParsed rollback-candidate.log: same 15 IDs, no additions/removals. This does not make the archive stable.
dispatcher13 failed / 83 passedSaved summary confirms count; no safe fresh baseline comparison here. Do not equate all 13 with accepted twelve-test DeepSeek debt; recorded summary includes a Perplexity routing failure.
executors, excluding *0078*4 failed / 37 passedSaved summary confirms count; no fresh pristine-vs-DEV comparison. Real modules are imported directly by some tests, so blanket fake-routing claims do not apply.
tests/8 passedHistorical result only.

dev-failures.json contains 18 entries from an earlier run; it is not the final 15-failure baseline. Use the strict log and named resume baseline. test_all.sh does not preserve reliable aggregate failure status: no pipefail, pytest pipelines end in tail, and the final passing directory can leave a success exit code. Consumers must inspect results rather than treating runner exit 0 as acceptance.

Exclusions: 0078 tests depend on omitted workspace scripts and fail collection without them; their exclusion leaves that activation/privilege integration unverified. Same-basename test_materializer.py collection collisions require per-directory runs. No real executor, service restart, migration, power-loss, load, hostile sandbox escape, mixed-version or current live ABC test was run.

ABC remains a release blocker. The retained failures include test_abc_transient_retry_fallback_and_artifact_continuity (B READY instead of COMPLETED) and supervisor ABC (B REVIEW with downstream WAITING). Repeated fallback, workspace continuity and owner-stop assertions also fail. Accepted FR-EXECUTOR-VERIFY proves a previous controlled flow, not current-tag regression safety. Matching failure IDs establishes persistence, not harmlessness or root cause. Require an isolated current-tag ABC test with explicit routing, retry/fallback, artifact continuity, dependency release and checkpoint assertions; separately justify every accepted legacy failure. Do not waive all 15/13/4 as one debt category.

Restart, pin/rollback and safe release decision

Production receipt data/factory.db.recovery-activation.json is absent. Current source calls require_active() before init/dispatch and catches ActivationRefused through generic Exception in the main loop, then sleeps 10 seconds. Installed unit uses Restart=on-failure, RestartSec=5, no RestartPreventExitStatus. If restarted with this disk code and no receipt, dispatcher loops without dispatching while appearing alive. This is a source/config conclusion; host process state and active unit overrides are not visible here. DEV exit 78 makes refusal explicit but with that unit policy causes repeated restart attempts, not a completed rollout. Console/supervisor restarts also load changed disk modules.

The checksum-verified archive is an unverified recovery candidate, not a stable release or reconstruction of pre-change running code. Current Python processes can lazily import changed files, so “all old code in memory” is itself too strong without module provenance. A source tag/checksum does not pin the dependency environment, database compatibility or process-loaded code.

A separate release directory is technically feasible only after resolving all ROOT-derived state paths: DB, locks, journals, artifacts, receipt, workspaces and deployment references. A shared data symlink might preserve state/lock identity but requires tests and explicit permission boundaries; changing ExecStart alone is insufficient. Backups do not prove restore compatibility. Removing a receipt does not undo schema/data effects, and replaying retained journals under older code must be validated. Never restore an old DB just to roll back code, since that can discard later accepted work.

Proposed future sequence (documented only; none executed):

  1. Repair isolation/routing in a separately authorized task; rerun dynamic boundary tests and full pristine/DEV comparisons in a host capable of the intended sandbox. Resolve ABC and classify every remaining failure.
  2. Build immutable release and rollback candidates with source and dependency manifests. Rehearse both against offline consistent DB copies and retained journals, including failure after activation. Establish the rollback boundary and observable restart refusal; obtain independent acceptance.
  3. Owner authorizes an explicit maintenance window only after these gates. Disable all launch sources, drain RUNNING/QUEUED work globally, inventory scoped/legacy workers and timers, stop relevant processes, take a consistent SQLite backup and source/config/dependency snapshot. Do not copy a live main DB file while ignoring WAL.
  4. Deploy one reviewed version, verify common lock/state paths and absence of old workers, perform authorized activation, then start and observe components in a controlled order. Receipt currently binds a constant VERSION and DB path plus operator statements, not code hashes or process proof; supplement with recorded release identity and real inventory.
  5. On failure, stop new launch sources/workers before rollback; revoke authorization as appropriate, use only the rehearsed compatible candidate, preserve journals, restore DB only under an explicit data-recovery decision. If no validated candidate exists, keep dispatch parked and escalate rather than claiming safe rollback.

Do not approve the task-259 suggestion to pin the 12:53 archive as “old/known” without qualification. Owner acceptance of downtime can acknowledge restart risk, but cannot replace technical release acceptance.

Evidence fingerprints and limitations

Saved log SHA256:

No live database read was needed for the verdict. Archive DB integrity was not rerun; its checksum was. Restricted bus/netlink/process visibility limits live-state conclusions. These limits are explicit unresolved evidence gaps, not evidence of successful isolation.

Материалы