feat(D4+D5): executor-owned artifact targets + cognitive-stage mutation boundary #317

Merged
conductor merged 1 commits from d4d5-artifact-contract into master 2026-09-10 00:00:05 +01:00
1 Commits
Author SHA1 Message Date
Nick a997a0ae4c feat(D4+D5): executor-owned artifact targets + cognitive-stage mutation boundary (closes #298 scope)
CI Pipeline / best-practices (push) Successful in 6s
CI Pipeline / documentation (push) Successful in 3s
Auto-label / priority-gate (pull_request) Skipped
Auto-label / auto-label (pull_request) Successful in 3s
CI Pipeline / canary (push) Successful in 34s
CI Pipeline / lint (push) Successful in 42s
CI Pipeline / type-check (push) Successful in 30s
CI Pipeline / unit-tests (push) Successful in 58s
CI Pipeline / gitea-offline (push) Successful in 15s
CI Pipeline / best-practices (pull_request) Successful in 3s
CI Pipeline / documentation (pull_request) Successful in 3s
CI Pipeline / lint (pull_request) Successful in 38s
CI Pipeline / canary (pull_request) Successful in 31s
Spec gate (headless) / spec-gate (pull_request) Successful in 6s
CI Pipeline / required-checks (push) Successful in 1s
CI Pipeline / type-check (pull_request) Successful in 30s
CI Pipeline / unit-tests (pull_request) Successful in 53s
CI Pipeline / gitea-offline (pull_request) Successful in 15s
CI Pipeline / required-checks (pull_request) Successful in 1s
Auto-version and Release / release (pull_request) Successful in 37s
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.
2026-09-09 23:57:59 +01:00