Orchestrata Ultimate › Plans › briefs › proper-install-5-4-implementation

Packet: proper-install §5.4 implementation + §5.3 staleness guard (codetools)

Source: plans/briefs/proper-install-5-4-implementation.md at 8a2cb42ad · last changed 2026-10-20 · first committed 2026-10-20 · 128 lines.

Prose pending.

Plan text

Packet: proper-install §5.4 implementation + §5.3 staleness guard (codetools)

Status: DISPATCH-READY · Repo: /home/mohamed/workspace/orchestrata.codetools (branch master) Authority: ADR-0120 (Accepted, Mohamed 2026-10-20) + the §5.3/§5.4 rulings logged in orchestrata session 272. DESIGN_WAIVER: ADR-0120 per ADR-0048 — the packet's entire scope executes the Accepted ADR and its rulings; scope beyond the deliverables below loses the waiver.

Context (measured, not assumed)

The proper install is live in codetools (00b1304, 9c583c85 in HEAD; PEP 610 editable:false). The coordinator measured the §5.4 coupling sites at HEAD:

ADR-0120 (verbatim decision): test-spawned subprocesses resolve the packages under test from the installed environment, never via sys.path/PYTHONPATH into the source tree; freshness is the runner-level staleness guard (the §5.3 ruling: versioned copy, never in-place, path never in the dev directory, hard fail when stale); production-entrypoint invocation wherever a child simulates production; -c shims stay only where the PID is structurally needed (these three kill-children qualify — keep the shim, drop only the path hack). The repoints and the staleness guard travel in the SAME packet, never alone.

Deliverables

D1 — repoint the three KILL_SCRIPT children (§5.4a, ADR-0120)

For each of tests/deploy/test_atomic_promote.py, tests/deploy/test_install.py, tests/bdd/steps_spec012_fixtures.py:

D2 — faithful deploy in the spec-012 CLI scenario (§5.4b)

In tests/bdd/steps_spec012_cli.py, the step "that release's interpreter runs codetools --version" must run codetools --version from a release interpreter that REALLY contains the installed package — no extra_pythonpath.

D3 — repoint PROLOG_DIR to the installed package (§5.4c)

In tests/bdd/test_spec_018.py: PROLOG_DIR = Path(codetools.__file__).resolve().parent / "prolog" (the exact COLLECT_PL precedent from tests/prolog/test_parity_base_id.py). First verify the .pl files ship in the installed artifact (ls .venv/lib/*/site-packages/codetools/prolog/ — paste the listing). Acceptance: the module passes; no parents[2] / "src" reference remains in it.

D4 — the §5.3 staleness guard (new)

New module src/codetools/testing/staleness_guard.py + startup wiring in scripts/run_tests_parallel.py + tests tests/testing/test_staleness_guard.py. Mirror the import_shadow.py pattern (pure stdlib path arithmetic, never imports the packages it guards, docstring with the incident + ruling + remediation):

D5 — verification lanes (verbatim outputs in the report)

PYTEST_DEBUG_TEMPROOT=/var/tmp .venv/bin/python scripts/run_tests_parallel.py tests/deploy/ -j 8
PYTEST_DEBUG_TEMPROOT=/var/tmp .venv/bin/python scripts/run_tests_parallel.py tests/bdd/ -j 8
PYTEST_DEBUG_TEMPROOT=/var/tmp .venv/bin/python scripts/run_tests_parallel.py tests/testing/ -j 8

No pytest-xdist ever. No full-tree runs.

Fence

ALLOWED (the only files you may write):

FORBIDDEN (named): src/codetools/review/** (the REV-3 lane is ACTIVE — gates.py is dirty), src/codetools/cli_version.py, pyproject.toml, uv.lock, deploy/**, tests/review/**, anything not in the allowlist. FOREIGN DIRT — do not touch, do not stage, do not "fix": src/codetools/review/gates.py (M), tests/review/test_review_ruff_lookup.py (??), plans/ast-*.json (M), kimi-export-*.md (??), plans/*.warmcache (??).

Conduct