feat(core): approval lifecycle, evidence-driven closure, artifact and rollback obligations (W2 of #2609) #2626

Open
conductor wants to merge 3 commits from feat/2609-go-interception-w2 into master
pull from: feat/2609-go-interception-w2
Owner

Summary

W2 of #2609, stacked on PR #2621 (W1 commit f5fbd376).

Commit: d220b6022425bd48ef40e32dffacb8504cc38381
Admitted contract: ADMIT-2609-go-interception-w2 (canonical classify → activate → admit; approval ref user:nick-self-hosting-law-2026-10-25; all staged paths verified green by Scaffold.check_scope).

This tranche adds durable approval resume and evidence-gated closure while keeping deterministic verdicts on the authority side of the measured process boundary. It adds no cgo and no Spine registration.

Per-item implementation and evidence

  1. Approval lifecycle — src/go/construction/approval.go adds a durable, cross-process-locked, expiring one-use mandate ledger. Construction authorization and effect approval are distinct kinds; work-presentation consent is not accepted into that ledger. Exact stored mutation requests carry operation/target digests, stable turn/call IDs, and serialized resume state. approval_mutation.go rehashes current targets and reauthorizes before returning a permit. rune-core/internal/runecore/approval.go and server.go replace the stub with real /v1/approvals/resolve resume. Tests prove fresh-engine resume, rejection, expiry, stale-target burn, one-use refusal, no duplicate mutation/observation/user message, and construction approval followed by a separate effect approval.

  2. Evidence-driven verification and closure — construction_closure.py validates independent git/test/build/working-tree/tool evidence, rejects model-final-answer evidence and failed test/build records, and binds READY verification to a digest of changed files plus evidence. Base close requires prior READY verification and nonempty evidence. Supervised completion uses repaired #2604 request_completion with non-builder authority/actor checks. closure.go collects measured Git diff/status and tool observations; process_closure.go keeps READY/closed verdicts across the process boundary. Direct and live process tests cover mutation → observation → verify → review → close.

  3. Artifact obligations — project creation requires README install/run evidence; structural features require ADR rationale; material features require a changelog. Typo-scale changes do not require a README. Hygiene checks account for added vs removed diff lines so pre-existing TODOs are not false positives, while newly introduced unlinked TODOs fail. Independent review includes dead-code confirmation. W2 itself ships docs/adr/0001-go-interception-w2.md and docs/architecture/go-interception-w2-changelog.md without hand-editing the tag-generated root changelog.

  4. Rollback and OPEN_GAP — verification measures git rev-parse HEAD and records an executable scoped git restore --source=<HEAD> path. Failed verification/closure records durable OPEN_GAP state; successful verification resolves prior gaps. Real Git fixtures cover restore points, failed builds, scope failures, artifact failures, and TODO hygiene.

  5. Independent review — record_review durably binds reviewer, builder, spec compliance, overclaim, dead-code checks, and evidence. Reviewer must differ from builder and contract origin and cannot be a known builder identity. Supervised close refuses missing/self review before it can discharge obligations.

  6. Capability-registration events — earned close emits idempotent CAPABILITY_REGISTRATION_EARNED JSONL events with stable entity IDs, evidence refs, linkage/eligibility, and earned maturity (PRESENT / EXERCISED / evidence-qualified LIVE_PROVEN). External projects emit only when explicitly eligible. No Spine absorption or registration is implemented here (W4).

  7. Research execution — pending decision routes execute once at admission. TARGETED_EVIDENCE_PROBE calls the real rune.evidence_probe.run_probe artifact workflow, feeds cited results into Build Basis, and blocks STILL_UNKNOWN/CONTRADICTED/failed outcomes. FULL_RESEARCH_PIPELINE launches scripts/research_stage_executor.py --stage ISSUE as a typed background job with PID, command, logs, and durable job evidence while holding the contract in research_required; it never claims pipeline completion. Mutation checks and Go admission both enforce the research hold.

Verification

  • go test ./... and go test -race ./...: green in construction, rune-core, local-tool-runtime, rune-entry, and tool-executor (all ten normal/race suites).
  • RUNE_PATHS_ENGINE=python PYTHONPATH=src python3 -m pytest -q tests/test_construction_interface.py tests/test_construction_authority_drills.py tests/test_construction_closure_w2.py tests/test_construction_research_w2.py: 89 passed. This includes migrated legacy closure fixtures and real canonical-process lifecycle smoke.
  • Ruff: all changed Python files pass. Go formatting checks are clean.
  • python3 scripts/check_domain_registry.py: GREEN (61 domains / 600 package paths).
  • Final staged Scaffold.check_scope: GREEN with no out-of-scope paths. check_landing.py --staged-only: GREEN. Commit hooks ran normally; no --no-verify.
  • Research sweep resolves ADMIT-2609-go-interception-w2 GREEN. The sweep still has the inherited ADMIT-release-reporting violation recorded by W1.
  • Staged Henxels also reports the three inherited repository-debt findings: docs/factory/domains.json file type, the two pre-existing oversized authority files, and the pre-existing construction_interface dichotomy facade. No new module was flagged. These were not hidden or bypassed.

Honest gaps for W3/W4 and later research lifecycle

  • W3 still owns native Rust decision port-forwarding and Python facade retirement. W2 deliberately keeps verdicts behind the measured Python authority process.
  • W4 owns Spine composition, registration/absorption, and TUI projection/viewer. W2 only emits the event data needed for that work; no interactive TUI flow is claimed.
  • Full research stage completion, reconciliation, and re-admission remain later work. W2 implements real dispatch and the hold, not a silent full-pipeline success. Tests use an injected probe runner and process launcher so no live model worker or shared Gitea research issue is mutated during verification.

Do not merge as part of this delivery.

## Summary W2 of #2609, **stacked on PR #2621** (W1 commit `f5fbd376`). Commit: `d220b6022425bd48ef40e32dffacb8504cc38381` Admitted contract: `ADMIT-2609-go-interception-w2` (canonical classify → activate → admit; approval ref `user:nick-self-hosting-law-2026-10-25`; all staged paths verified green by `Scaffold.check_scope`). This tranche adds durable approval resume and evidence-gated closure while keeping deterministic verdicts on the authority side of the measured process boundary. It adds no cgo and no Spine registration. ## Per-item implementation and evidence 1. **Approval lifecycle** — `src/go/construction/approval.go` adds a durable, cross-process-locked, expiring one-use mandate ledger. Construction authorization and effect approval are distinct kinds; work-presentation consent is not accepted into that ledger. Exact stored mutation requests carry operation/target digests, stable turn/call IDs, and serialized resume state. `approval_mutation.go` rehashes current targets and reauthorizes before returning a permit. `rune-core/internal/runecore/approval.go` and `server.go` replace the stub with real `/v1/approvals/resolve` resume. Tests prove fresh-engine resume, rejection, expiry, stale-target burn, one-use refusal, no duplicate mutation/observation/user message, and construction approval followed by a separate effect approval. 2. **Evidence-driven verification and closure** — `construction_closure.py` validates independent git/test/build/working-tree/tool evidence, rejects model-final-answer evidence and failed test/build records, and binds READY verification to a digest of changed files plus evidence. Base close requires prior READY verification and nonempty evidence. Supervised completion uses repaired #2604 `request_completion` with non-builder authority/actor checks. `closure.go` collects measured Git diff/status and tool observations; `process_closure.go` keeps READY/closed verdicts across the process boundary. Direct and live process tests cover mutation → observation → verify → review → close. 3. **Artifact obligations** — project creation requires README install/run evidence; structural features require ADR rationale; material features require a changelog. Typo-scale changes do not require a README. Hygiene checks account for added vs removed diff lines so pre-existing TODOs are not false positives, while newly introduced unlinked TODOs fail. Independent review includes dead-code confirmation. W2 itself ships `docs/adr/0001-go-interception-w2.md` and `docs/architecture/go-interception-w2-changelog.md` without hand-editing the tag-generated root changelog. 4. **Rollback and OPEN_GAP** — verification measures `git rev-parse HEAD` and records an executable scoped `git restore --source=<HEAD>` path. Failed verification/closure records durable OPEN_GAP state; successful verification resolves prior gaps. Real Git fixtures cover restore points, failed builds, scope failures, artifact failures, and TODO hygiene. 5. **Independent review** — `record_review` durably binds reviewer, builder, spec compliance, overclaim, dead-code checks, and evidence. Reviewer must differ from builder and contract origin and cannot be a known builder identity. Supervised close refuses missing/self review before it can discharge obligations. 6. **Capability-registration events** — earned close emits idempotent `CAPABILITY_REGISTRATION_EARNED` JSONL events with stable entity IDs, evidence refs, linkage/eligibility, and earned maturity (`PRESENT` / `EXERCISED` / evidence-qualified `LIVE_PROVEN`). External projects emit only when explicitly eligible. **No Spine absorption or registration is implemented here (W4).** 7. **Research execution** — pending decision routes execute once at admission. TARGETED_EVIDENCE_PROBE calls the real `rune.evidence_probe.run_probe` artifact workflow, feeds cited results into Build Basis, and blocks STILL_UNKNOWN/CONTRADICTED/failed outcomes. FULL_RESEARCH_PIPELINE launches `scripts/research_stage_executor.py --stage ISSUE` as a typed background job with PID, command, logs, and durable job evidence while holding the contract in `research_required`; it never claims pipeline completion. Mutation checks and Go admission both enforce the research hold. ## Verification - `go test ./...` and `go test -race ./...`: green in **construction, rune-core, local-tool-runtime, rune-entry, and tool-executor** (all ten normal/race suites). - `RUNE_PATHS_ENGINE=python PYTHONPATH=src python3 -m pytest -q tests/test_construction_interface.py tests/test_construction_authority_drills.py tests/test_construction_closure_w2.py tests/test_construction_research_w2.py`: **89 passed**. This includes migrated legacy closure fixtures and real canonical-process lifecycle smoke. - Ruff: all changed Python files pass. Go formatting checks are clean. - `python3 scripts/check_domain_registry.py`: GREEN (61 domains / 600 package paths). - Final staged `Scaffold.check_scope`: GREEN with no out-of-scope paths. `check_landing.py --staged-only`: GREEN. Commit hooks ran normally; no `--no-verify`. - Research sweep resolves `ADMIT-2609-go-interception-w2` GREEN. The sweep still has the inherited `ADMIT-release-reporting` violation recorded by W1. - Staged Henxels also reports the three inherited repository-debt findings: `docs/factory/domains.json` file type, the two pre-existing oversized authority files, and the pre-existing `construction_interface` dichotomy facade. No new module was flagged. These were not hidden or bypassed. ## Honest gaps for W3/W4 and later research lifecycle - W3 still owns native Rust decision port-forwarding and Python facade retirement. W2 deliberately keeps verdicts behind the measured Python authority process. - W4 owns Spine composition, registration/absorption, and TUI projection/viewer. W2 only emits the event data needed for that work; no interactive TUI flow is claimed. - Full research stage completion, reconciliation, and re-admission remain later work. W2 implements real dispatch and the hold, not a silent full-pipeline success. Tests use an injected probe runner and process launcher so no live model worker or shared Gitea research issue is mutated during verification. Do not merge as part of this delivery.
conductor added 3 commits 2026-10-26 03:22:34 +00:00
fix(scaffolding): surgical defect repairs (#2604)
deploy / deploy (push) Skipped
CI Pipeline / lint (push) Failing after 47s
CI Pipeline / unit-tests (push) Failing after 1m20s
CI Pipeline / go-surface (push) Failing after 33s
CI Pipeline / rust-surface (push) Failing after 9s
CI Pipeline / best-practices (push) Successful in 3s
CI Pipeline / documentation (push) Successful in 3s
CI Pipeline / gitea-offline (push) Canceled after 0s
CI Pipeline / required-checks (push) Canceled after 0s
CI Pipeline / CI Pipeline / notify-event-bridge (push) Canceled after 0s
CI Pipeline / canary (push) Canceled after 26s
CI Pipeline / type-check (push) Canceled after 25s
Local-Model First-Pass Review (#131) / first-pass-review (pull_request) Successful in 17s
Spec gate (headless) / spec-gate (pull_request) Successful in 22s
Auto-label / auto-label (pull_request) Successful in 1s
CI Pipeline / lint (pull_request) Failing after 40s
CI Pipeline / go-surface (pull_request) Failing after 23s
CI Pipeline / rust-surface (pull_request) Failing after 7s
CI Pipeline / unit-tests (pull_request) Failing after 1m15s
CI Pipeline / best-practices (pull_request) Successful in 3s
CI Pipeline / documentation (pull_request) Successful in 3s
CI Pipeline / type-check (pull_request) Failing after 38s
CI Pipeline / canary (pull_request) Failing after 59s
CI Pipeline / gitea-offline (pull_request) Successful in 15s
CI Pipeline / required-checks (pull_request) Failing after 1s
CI Pipeline / CI Pipeline / notify-event-bridge (pull_request) Failing after 4s
fb2830d8dd
Restore supervised completion and basis enforcement, preserve Need toolchain evidence and refusal semantics, bind active-contract discovery to canonical project/task lanes, stabilize obligation identifiers, and restore the MiMo mutation-boundary reference.
feat(core): native construction coordinator + mutation gates (ADMIT-2609-go-interception-w1)
deploy / deploy (push) Skipped
CI Pipeline / lint (push) Failing after 47s
CI Pipeline / go-surface (push) Failing after 22s
CI Pipeline / rust-surface (push) Failing after 7s
CI Pipeline / unit-tests (push) Failing after 1m19s
CI Pipeline / best-practices (push) Successful in 7s
CI Pipeline / documentation (push) Successful in 3s
CI Pipeline / type-check (push) Failing after 42s
CI Pipeline / canary (push) Failing after 1m2s
CI Pipeline / required-checks (push) Failing after 1s
CI Pipeline / CI Pipeline / notify-event-bridge (push) Failing after 6s
CI Pipeline / gitea-offline (push) Successful in 18s
Auto-label / auto-label (pull_request) Successful in 0s
CI Pipeline / go-surface (pull_request) Canceled after 0s
CI Pipeline / rust-surface (pull_request) Canceled after 0s
CI Pipeline / canary (pull_request) Canceled after 0s
CI Pipeline / best-practices (pull_request) Canceled after 0s
CI Pipeline / documentation (pull_request) Canceled after 0s
CI Pipeline / type-check (pull_request) Canceled after 0s
CI Pipeline / gitea-offline (pull_request) Canceled after 0s
CI Pipeline / required-checks (pull_request) Canceled after 0s
CI Pipeline / CI Pipeline / notify-event-bridge (pull_request) Canceled after 0s
CI Pipeline / lint (pull_request) Canceled after 26s
CI Pipeline / unit-tests (pull_request) Canceled after 26s
Local-Model First-Pass Review (#131) / first-pass-review (pull_request) Successful in 19s
Spec gate (headless) / spec-gate (pull_request) Successful in 23s
f5fbd37625
W1 of #2609: bound turn admission, per-door permits and observations, shell reconciliation, polyglot evidence, and the measured Python authority boundary. Contract: ADMIT-2609-go-interception-w1
feat(core): approval lifecycle, evidence-driven closure, artifact and rollback obligations (ADMIT-2609-go-interception-w2)
deploy / deploy (push) Skipped
CI Pipeline / unit-tests (push) Failing after 44s
CI Pipeline / lint (push) Failing after 44s
CI Pipeline / rust-surface (push) Failing after 14s
CI Pipeline / go-surface (push) Failing after 25s
CI Pipeline / best-practices (push) Successful in 2s
CI Pipeline / documentation (push) Successful in 3s
CI Pipeline / gitea-offline (push) Canceled after 0s
CI Pipeline / required-checks (push) Canceled after 0s
CI Pipeline / CI Pipeline / notify-event-bridge (push) Canceled after 0s
CI Pipeline / canary (push) Canceled after 50s
CI Pipeline / type-check (push) Canceled after 38s
Auto-label / auto-label (pull_request) Successful in 1s
Local-Model First-Pass Review (#131) / first-pass-review (pull_request) Successful in 23s
Spec gate (headless) / spec-gate (pull_request) Successful in 16s
CI Pipeline / lint (pull_request) Failing after 46s
CI Pipeline / unit-tests (pull_request) Failing after 37s
CI Pipeline / rust-surface (pull_request) Failing after 8s
CI Pipeline / go-surface (pull_request) Failing after 22s
CI Pipeline / best-practices (pull_request) Successful in 3s
CI Pipeline / documentation (pull_request) Successful in 3s
CI Pipeline / type-check (pull_request) Failing after 40s
CI Pipeline / canary (pull_request) Failing after 1m3s
CI Pipeline / gitea-offline (pull_request) Successful in 21s
CI Pipeline / required-checks (pull_request) Failing after 1s
CI Pipeline / CI Pipeline / notify-event-bridge (pull_request) Failing after 7s
d220b60224
W2 of #2609: durable construction/effect approvals, independent verification and supervised closure, artifact/rollback/OPEN_GAP gates, independent review, capability registration events, and research execution. Contract: ADMIT-2609-go-interception-w2

🤖 Headless spec gate (non-blocking, #204 first slice)

Spec-gate agent produced no text output — check runner logs.

Deterministic floors still govern the merge

This comment is advisory. Required checks (lint, tests, canaries, type-check, coverage, dependency lock, impact gate) remain the merge authority per docs/adversarial-review.md proportionality.

🤖 **Headless spec gate (non-blocking, #204 first slice)** Spec-gate agent produced no text output — check runner logs. <details><summary>Deterministic floors still govern the merge</summary> This comment is advisory. Required checks (lint, tests, canaries, type-check, coverage, dependency lock, impact gate) remain the merge authority per docs/adversarial-review.md proportionality.</details>
Some required checks failed
deploy / deploy (push) Skipped
CI Pipeline / unit-tests (push) Failing after 44s
CI Pipeline / lint (push) Failing after 44s
CI Pipeline / rust-surface (push) Failing after 14s
CI Pipeline / go-surface (push) Failing after 25s
CI Pipeline / best-practices (push) Successful in 2s
CI Pipeline / documentation (push) Successful in 3s
CI Pipeline / gitea-offline (push) Canceled after 0s
CI Pipeline / required-checks (push) Canceled after 0s
CI Pipeline / CI Pipeline / notify-event-bridge (push) Canceled after 0s
CI Pipeline / canary (push) Canceled after 50s
CI Pipeline / type-check (push) Canceled after 38s
Auto-label / auto-label (pull_request) Successful in 1s
Local-Model First-Pass Review (#131) / first-pass-review (pull_request) Successful in 23s
Spec gate (headless) / spec-gate (pull_request) Successful in 16s
CI Pipeline / lint (pull_request) Failing after 46s
CI Pipeline / unit-tests (pull_request) Failing after 37s
CI Pipeline / rust-surface (pull_request) Failing after 8s
CI Pipeline / go-surface (pull_request) Failing after 22s
CI Pipeline / best-practices (pull_request) Successful in 3s
CI Pipeline / documentation (pull_request) Successful in 3s
CI Pipeline / type-check (pull_request) Failing after 40s
CI Pipeline / canary (pull_request) Failing after 1m3s
CI Pipeline / gitea-offline (pull_request) Successful in 21s
CI Pipeline / required-checks (pull_request) Failing after 1s
Required
Details
CI Pipeline / CI Pipeline / notify-event-bridge (pull_request) Failing after 7s
This pull request has changes conflicting with the target branch.
  • store/scaffold/segments/observations.jsonl
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feat/2609-go-interception-w2:feat/2609-go-interception-w2
git checkout feat/2609-go-interception-w2
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: conductor/rune#2626