d4d5-artifact-contract
master
D4 — ARTIFACT TARGET CONTRACT IS EXECUTOR-OWNED: - _declared_artifact_path(stage): absolute path computed from artifact_dir + STAGE_ARTIFACT_FILES[stage]; injected verbatim into every worker prompt (APPLICABILITY/ADVERSARIAL/SYNTHESIS/INNOVATION/OUTWARD/QUALIFY) - Worker never derives its own path — producer and consumer share one authoritative output location (the B3-v2 root cause: worker's prompt said research/issue-162/ but executor's artifact_dir was research/issue-162-b3v2/) - Acceptance: nonstandard artifact_dir (issue-162-b3v2) now gets the correct path injected D5 — COGNITIVE_STAGE_MUTATION_BOUNDARY: - mutation_boundary.py: capture_worktree_state (status porcelain + HEAD) before cognitive stages; verify_no_source_mutation after; new changes outside declared artifact paths → UNAUTHORIZED_STAGE_MUTATION - HEAD movement detected (cognitive stages must never commit) - allowed paths: declared artifact + telemetry + consumed markers - Wired into execute(): cognitive stages only (ISSUE/IMPLEMENT skip); failure → STAGE_FAILED, no advancement - Tests: clean stage passes; source mutation detected → FAILED + no advancement + mutation visible for human review BLE001 narrowed in mutation_boundary (git errors are OSErrors). 1164 tests pass; ruff clean.