harness-everything 0.50.0 → 0.52.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.github/workflows/ci.yml +23 -0
  4. package/CHANGELOG.md +174 -115
  5. package/benchmarks/results/doc-evidence-e1/cycle-2026-11-11-a-evid-001.md +123 -0
  6. package/benchmarks/results/doc-evidence-e1/cycle-2026-11-11-b-route-001.md +130 -0
  7. package/ci/mechanism-2am-observations-session-import.test.js +4 -1
  8. package/ci/mechanism-34-observations.test.js +127 -23
  9. package/ci/mechanism-349-ci-change-scope.test.js +260 -0
  10. package/ci/mechanism-handoff-file.test.js +121 -0
  11. package/ci/mechanism-prb-outline-review.test.js +783 -107
  12. package/ci/mechanism-system-one-contract.test.js +9 -2
  13. package/ci/mechanism-system-one-curves.test.js +206 -0
  14. package/ci/mechanism-system-one-cycle.test.js +585 -0
  15. package/ci/mechanism-system-one-evaluation.test.js +32 -5
  16. package/ci/mechanism-system-one-handoff-input.test.js +208 -0
  17. package/ci/mechanism-system-one-install.test.js +202 -77
  18. package/ci/mechanism-system-one-live.test.js +361 -0
  19. package/ci/mechanism-system-one-relevance.test.js +11 -1
  20. package/ci/mechanism-system-one-train.test.js +136 -53
  21. package/ci/release-unreleased-heading.test.js +24 -0
  22. package/ci/system-one-adapter-test.py +331 -0
  23. package/ci/system-one-train-test.py +116 -24
  24. package/docs/adr/EVID-001.md +123 -0
  25. package/docs/adr/ROUTE-001-error-lesson-delivery.md +305 -0
  26. package/docs/doc-workflow-reconciliation.md +29 -16
  27. package/docs/governed-index.md +2 -0
  28. package/docs/platform-capabilities.md +2 -0
  29. package/docs/routing.md +2 -2
  30. package/docs/system-one-cycle.md +68 -0
  31. package/docs/system-one-observations.md +9 -8
  32. package/docs/system-one-routing.md +163 -115
  33. package/docs/system-one-suggestion-gates.md +6 -8
  34. package/docs/system-one-training.md +44 -7
  35. package/docs/workflow-runtime.md +19 -0
  36. package/harness-everything/SKILL.md +1 -1
  37. package/harness-everything/scripts/kernel-router.js +2 -1
  38. package/harness-everything/scripts/system-one/contract.js +19 -15
  39. package/harness-everything/scripts/system-one/cua_adapter.py +211 -17
  40. package/harness-everything/scripts/system-one/evaluate.js +4 -9
  41. package/harness-everything/scripts/system-one/handoff-input.js +76 -0
  42. package/harness-everything/scripts/system-one/install.js +281 -113
  43. package/harness-everything/scripts/system-one/manifest.js +58 -0
  44. package/harness-everything/scripts/system-one/provider.js +96 -2
  45. package/harness-everything/scripts/system-one/resident.js +47 -1
  46. package/harness-everything/scripts/system-one/router.js +80 -1
  47. package/harness-everything/scripts/tier-router.js +21 -6
  48. package/hooks/scripts/lib/doc-reconciliation-pilot.js +12 -0
  49. package/hooks/scripts/lib/doc-reconciliation-provider.js +575 -12
  50. package/hooks/scripts/lib/observations.js +43 -4
  51. package/hooks/scripts/lib/workflow-obligations.js +8 -4
  52. package/hooks/scripts/state-persist.js +26 -7
  53. package/hooks/scripts/w6-state-operations.js +239 -0
  54. package/opencode-plugin/plugin.json +1 -1
  55. package/package.json +2 -2
  56. package/plugins/harness-everything/.codex-plugin/plugin.json +1 -1
  57. package/plugins/harness-everything/hooks/scripts/lib/doc-reconciliation-pilot.js +12 -0
  58. package/plugins/harness-everything/hooks/scripts/lib/doc-reconciliation-provider.js +575 -12
  59. package/plugins/harness-everything/hooks/scripts/lib/observations.js +43 -4
  60. package/plugins/harness-everything/hooks/scripts/lib/workflow-obligations.js +8 -4
  61. package/plugins/harness-everything/hooks/scripts/state-persist.js +26 -7
  62. package/plugins/harness-everything/hooks/scripts/w6-state-operations.js +239 -0
  63. package/plugins/harness-everything/plugin.json +1 -1
  64. package/plugins/harness-everything/scripts/handoff-file.js +223 -0
  65. package/plugins/harness-everything/skills/harness-everything/SKILL.md +1 -1
  66. package/plugins/harness-everything/skills/harness-everything/scripts/kernel-router.js +2 -1
  67. package/plugins/harness-everything/skills/harness-everything/scripts/system-one/contract.js +19 -15
  68. package/plugins/harness-everything/skills/harness-everything/scripts/system-one/cua_adapter.py +211 -17
  69. package/plugins/harness-everything/skills/harness-everything/scripts/system-one/evaluate.js +4 -9
  70. package/plugins/harness-everything/skills/harness-everything/scripts/system-one/handoff-input.js +76 -0
  71. package/plugins/harness-everything/skills/harness-everything/scripts/system-one/install.js +281 -113
  72. package/plugins/harness-everything/skills/harness-everything/scripts/system-one/manifest.js +58 -0
  73. package/plugins/harness-everything/skills/harness-everything/scripts/system-one/provider.js +96 -2
  74. package/plugins/harness-everything/skills/harness-everything/scripts/system-one/resident.js +47 -1
  75. package/plugins/harness-everything/skills/harness-everything/scripts/system-one/router.js +80 -1
  76. package/plugins/harness-everything/skills/harness-everything/scripts/tier-router.js +21 -6
  77. package/sbom.cdx.json +7 -7
  78. package/scripts/ci-change-scope.js +59 -0
  79. package/scripts/handoff-file.js +223 -0
  80. package/scripts/sync-openai-plugin.js +4 -0
  81. package/scripts/system-one-calibrate.js +108 -41
  82. package/scripts/system-one-curves.js +332 -0
  83. package/scripts/system-one-cycle/adjudication-input.js +65 -0
  84. package/scripts/system-one-cycle/build.js +165 -0
  85. package/scripts/system-one-cycle/collect.js +50 -0
  86. package/scripts/system-one-cycle/common.js +137 -0
  87. package/scripts/system-one-cycle/engines.js +62 -0
  88. package/scripts/system-one-cycle/evaluate.js +70 -0
  89. package/scripts/system-one-cycle/judge.js +106 -0
  90. package/scripts/system-one-cycle/label.js +59 -0
  91. package/scripts/system-one-cycle/package.js +173 -0
  92. package/scripts/system-one-cycle/score.py +111 -0
  93. package/scripts/system-one-cycle/train.js +136 -0
  94. package/scripts/system-one-cycle.js +131 -0
  95. package/scripts/system-one-observations-export.js +29 -6
  96. package/scripts/system-one-observations-review.js +4 -5
  97. package/scripts/system-one-train.py +117 -61
@@ -0,0 +1,123 @@
1
+ ---
2
+ id: EVID-001
3
+ status: proposed
4
+ ---
5
+
6
+ # EVID-001 — `verify:all` gate: verification-evidence record (row 17)
7
+
8
+ > Inventory row 17, owner-approved: [#325](https://github.com/dyphn1/Harness-everything/issues/325).
9
+ > Cycle definition: [#421 comment 6785927033](https://github.com/dyphn1/Harness-everything/issues/421#issuecomment-6785927033) §5.
10
+ > This is a **retrospective** ADR for the **shipped** `verify:all` gate; it records observed evidence and exact limits, it does not change the gate. Every behavioural claim below is bound to `scripts/verify-all.js` or the direct contract test at repository state `52fb8098326bf1b4f9dca812320959eccd13ee89`.
11
+
12
+ ## Decision
13
+
14
+ - **Identity and purpose.** `npm run verify:all` maps to `node scripts/verify-all.js` (`package.json`). The module docblock names it "Local CI-mirror gate runner": it runs the local gate set in CI order, from the working tree or a clean detached checkout of HEAD, and prints a Markdown table that is paste-ready for PR evidence (`scripts/verify-all.js`, docblock).
15
+ - **The full gate plan.** `FULL_PLAN` (`scripts/verify-all.js`) has 12 top-level rows, in CI order, each command being an npm script; four are marked `fast: true`:
16
+
17
+ | # | Row label | Command | `fast` |
18
+ | --- | --- | --- | --- |
19
+ | 1 | self-regression (hermetic + mechanism + routing contracts) | `npm test` | yes |
20
+ | 2 | mutation checks | `npm run test:mutations` | yes |
21
+ | 3 | consistency (docs, manifests, repo contract, prompt contracts) | `npm run test:consistency` | yes |
22
+ | 4 | references resolve | `npm run test:references` | no |
23
+ | 5 | release consistency | `npm run test:release` | no |
24
+ | 6 | skill description collision | `npm run test:collision` | no |
25
+ | 7 | skill routing coverage | `npm run test:routing:skills` | no |
26
+ | 8 | routing invariants | `npm run test:routing:invariants` | no |
27
+ | 9 | openai plugin package | `npm run test:plugin:openai` | no |
28
+ | 10 | openai public submission | `npm run test:plugin:submission` | no |
29
+ | 11 | platform compatibility matrix | `npm run test:platform:compatibility` | no |
30
+ | 12 | test-source portability | `npm run test:portability` | yes |
31
+
32
+ - **Aggregate commands and nested checks.** `npm test` and `test:consistency` are aggregate commands; the 12 rows above are the runner's top-level rows. `test:mechanism` is reached inside `npm test` (`self-evolve/scripts/self-regression.js` line 122 runs `ci/mechanism-test.js`), and `test:repo-contract` / `test:docs:capabilities` are components of the `test:consistency` chain (`package.json`). `ci/mechanism-38-verify-all.test.js` is the direct contract test for the runner itself: plan membership in every mode, UNCHECKED reasons and reporting, waza in fast mode, and the launcher policy.
33
+ - **Exact `--fast` behaviour.** With `--fast`, the four `fast: true` rows run; each of the other eight `FULL_PLAN` rows is reported `UNCHECKED (not in the --fast subset)`. Waza is **independent of `--fast`**: `buildPlan` leaves it enabled regardless of the fast flag, so with defaults and waza available, fast mode runs five commands (the four `fast` rows plus waza). The contract test asserts "waza runs by default in fast mode too" (`ci/mechanism-38-verify-all.test.js`). Waza is `UNCHECKED` only when skipped with `--no-waza` (`skipped by --no-waza`) or when the tool is absent (`waza not found on PATH or ~/bin` — probed via `waza --version`, then `~/bin/waza`). `--no-waza` is the only way to force the four-row fast subset.
34
+ - **UNCHECKED reasons, exactly as implemented** (`scripts/verify-all.js`, `buildPlan` + `probeWazaEntry`):
35
+
36
+ | Row | UNCHECKED reason string |
37
+ | --- | --- |
38
+ | Non-fast `FULL_PLAN` rows under `--fast` | `not in the --fast subset` |
39
+ | Node 22 execution smoke tests without `--node22` | `not requested; add --node22` |
40
+ | Node 22 dependency install (always, locally) | `covered by the CI runtime-floor job; not replicated locally` |
41
+ | Waza with `--no-waza` | `skipped by --no-waza` |
42
+ | Waza when the tool is absent | `waza not found on PATH or ~/bin` |
43
+
44
+ - **Node 22 runtime-floor lanes, kept separate.** Locally, `--node22` adds only two execution smoke tests run under `npx -y node@22` (`self-evolve/scripts/self-regression.js`, `ci/installer-roundtrip.test.js`) using the host's existing `node_modules`. The Node 22 dependency install (`npm ci` under Node 22) never runs locally and is always `UNCHECKED` with the reason above (`NODE22_UNVERIFIED`). The hosted `runtime-floor` job (`.github/workflows/ci.yml`, Ubuntu, Node 22) runs `npm ci`, `npm test` and `ci/installer-roundtrip.test.js` under Node 22 — that is where install compatibility is actually exercised. The local smoke lane and the hosted install lane are different dispositions and the report keeps them separate.
45
+ - **Flags.** `--fast`, `--clean` (all gates in a fresh detached worktree of HEAD, with `npm ci --ignore-scripts` in the worktree unless `--no-install`), `--node22`, `--no-install`, `--no-waza`. The report header lists the exact flags, or `(defaults)` (`formatFlags`).
46
+ - **Exit and report contract for completed runs.** A completed run renders one row per known gate — `PASS`, `FAIL`, or `UNCHECKED (<reason>)` — plus a `Summary: N PASS, N FAIL, N UNCHECKED.` line (`renderReport`). A gate that did not run is `UNCHECKED` with its reason and never counts as passing evidence. The process exits 1 when any executed gate fails; `UNCHECKED` rows do not force exit 1. Separately: `--help` / `-h` prints usage and exits 0; an unknown argument prints `Unknown argument: <arg>` and exits 2 (`parseArgs`).
47
+ - **The report exists only for completed runs.** "Every known gate always appears in the report" holds once the run reaches the report stage. With `--clean`, a failed worktree creation or a failed `npm ci` in the worktree throws (`prepareCleanRoot`) before the row loop and report rendering, so no report and no summary are produced (`scripts/verify-all.js`).
48
+ - **What `verify:all` does not run.**
49
+ - Hosted-only jobs outside the plan: the `ci.yml` pilot, System One Windows, `release-semantics`, `skill-quality` and `installer-e2e` jobs are not `FULL_PLAN` rows (see Context).
50
+ - The hosted, base-owned document-governance guard is a separate workflow, not part of the local gate set (`FULL_PLAN`; `.github/workflows/doc-governance.yml` running `scripts/doc-governance-guard.js` from the validated base SHA). Its own UNCHECKED states: on any non-`pull_request` event (push, `workflow_call`), the wrapper reports `UNCHECKED` — "No externally selected PR base/head is available for event <event>; the base-owned guard was not executed." — and does not execute the guard; on a PR whose base tree has no `scripts/doc-governance-guard.js` it reports `BOOTSTRAP_UNCHECKED`. Only a PR with a full base/head SHA and a guard in the base tree executes the frozen base guard. Because `release.yml` triggers on push and calls the guard workflow via `workflow_call`, its `doc-governance` dependency alone does not prove the guard ran; the event makes the guard report `UNCHECKED`.
51
+
52
+ ## Context
53
+
54
+ - Why the gate exists: local runs skipped gate categories and failures surfaced only after push — PR #301 consistency/runtime-floor, PR #327 Windows self-regression (`scripts/verify-all.js`, docblock lines 7–11).
55
+ - Where the gate sits in the evidence rules: "Never report 'it works' from code reading"; verification includes the CI-equivalent gates, not only unit tests (`AGENTS.md`, § Verification Before You Claim Done; shared agent standard "Work order" verification clause).
56
+ - How the gate relates to hosted CI: **overlapping coverage, not parity.** The hosted workflow (`.github/workflows/ci.yml`) runs many of the same npm commands (`npm test`, `test:mutations`, `test:consistency`, `test:references`, `test:release`, `test:collision`, `test:plugin:openai`, `test:plugin:submission`, `test:platform:compatibility`, `test:portability`) but as discrete jobs — some across the ubuntu/windows/macos matrix (Node 24), some single-OS — and it also runs jobs with no `FULL_PLAN` row: `pilot-offline-evidence` (Python benchmark check), the System One Windows jobs, `release-semantics`, `skill-quality` (waza) and `installer-e2e`. The lists also differ at command level: the generated workflow table (`docs/repository-contract.md`, § Active workflows) names `test:release:semantics` and `waza:check` for `ci.yml`, while `FULL_PLAN` instead has `test:routing:skills` and `test:routing:invariants` as top-level rows. `release.yml` blocks on both `ci.yml` and `doc-governance.yml` via `workflow_call` (`.github/workflows/release.yml`, `gate` and `doc-governance` jobs).
57
+ - The runtime floor: minimum Node 22 (`package.json#engines.node`), primary dev/CI Node 24 (`.nvmrc`, `Dockerfile`) (`docs/repository-contract.md`, § Runtime — generated by `scripts/repository-contract.js`).
58
+ - Doc-governance placement of this ADR: ADRs are T1-strict; ordinary content revisions need no U5 review, but lifecycle, conflict and link checks apply; a new governed ADR triggers update-over-create and outline confirmation (MUST for ADR) (`docs/document-lifecycle.md`, § Governance tiers and placement (#401), T1 row; § D6.5 fact table, "New governed file" row).
59
+
60
+ ```mermaid
61
+ flowchart LR
62
+ A["Local change"] --> B["npm run verify:all<br/>(--fast subset or full)"]
63
+ B --> C{"Every executed gate PASS?"}
64
+ C -->|yes| D["Paste-ready PASS/UNCHECKED report<br/>is PR evidence"]
65
+ C -->|no| E["Exit 1; FAIL blocks the claim"]
66
+ B -. "gates not run (reason recorded)" .-> F["UNCHECKED rows<br/>never passing evidence"]
67
+ G["Hosted CI ci.yml jobs<br/>(overlapping coverage; OS matrix,<br/>Node 24 + 22 runtime-floor)"] -. "overlaps, not parity" .-> B
68
+ H["doc-governance.yml<br/>(base-owned guard; UNCHECKED<br/>on non-PR events)"] -. "separate; not in verify:all" .-> B
69
+ I["release.yml"] --> G
70
+ I --> H
71
+ ```
72
+
73
+ ## Evidence
74
+
75
+ Only observed results bound to an exact SHA and output are evidence; each names its layer. Local runner results and hosted CI are separate layers. Anything not run is stated as `UNCHECKED`, not inferred from plans.
76
+
77
+ - **Local full-gate run (observed, recorded).** `npm run verify:all` at HEAD `c170a96cf856295200d2d1a62c15a552c3cb2b37`, node v24.22.1, darwin, mode "full gate set", flags `(defaults)`: **13 PASS, 0 FAIL, 3 UNCHECKED** — the 12 `FULL_PLAN` rows all PASS, waza readiness PASS (7.0s), and the three Node 22 rows UNCHECKED with the reasons in the Decision. Full log SHA-256 `630159501b19d1d0178683262f0bfe7c0ec9cacb29a336057bb95094481129f4` (`benchmarks/results/codex-pr-metadata-2026-10-26/verification.md`). This record also shows how 13 passes arise from 12 plan rows plus the default-enabled waza row.
78
+ - **Historical recorded result (repository-recorded claim, unverified here).** E-0001 records `verify:all` 13 PASS / 0 FAIL at `4899fbb7cb60783117983772cb6ae3d1a2e2500c` (`.agents/harness-everything/errors/E-0001-doc-check-identity-split-decision.md`, episode `325-f4-checker-identity` round 4). The record has the run SHA but retains neither that run's row table nor any output, so this summary is **not bound to SHA + output and is not evidence here** (unverified); the exact row composition of that particular run is not asserted here.
79
+ - **Fast-subset runs: not run, stated UNCHECKED.** No observed fast-subset `verify:all` run bound to an exact SHA and output exists in the repository. The retained plan/report excerpts record a usage protocol ("after the H1–H4 set, run `npm run verify:all -- --fast`"), a later verification-limits row stating "Windows CI and full `verify:all` were not run", and a #376 verification instruction to freeze a candidate SHA and run the full gate (`docs/own-repo-governance-e1-plan-2026-10-25-2139.md`, lines 184, 225, 246). These establish that full `verify:all` was not run at that stage; they are not fast-run results and no fast-run result is claimed.
80
+ - **Hosted CI (separate evidence layer).** The full-gate CI run for `e5d22584e243d5b5e587ee0279625e97a9033160` ([run 39374474269](https://github.com/dyphn1/Harness-everything/actions/runs/39374474269), every job succeeded) and the resident-teardown retry on `main@75e04359ae5bf11a41739f8eb04d25a76ee8f3a7` ([run 39175240370](https://github.com/dyphn1/Harness-everything/actions/runs/39175240370); attempt 1 observed the historical Windows System One resident teardown, the run completed on attempt 2) (`docs/document-lifecycle.md`, § Scope of this slice).
81
+ - **Bounded environment note.** E-0009 records that `verify:all` (fast and full) could not complete inside some `codex exec -s workspace-write` sandboxes (loopback bind EPERM in System One suites, npm cache EPERM, workflow-state writes outside the writable roots), with the coordinator running the gate outside the sandbox. E-0009 also records a `5 PASS / 0 FAIL` fast run by the coordinator with neither a run SHA nor retained output: that summary is a repository-recorded claim, **not bound to SHA + output and not evidence here** (unverified). This is a dispatch-environment limit of specific sandboxes, not an intrinsic limit of `verify:all`; it is not generalised to all sandboxes (`.agents/harness-everything/errors/E-0009-one-shot-sandbox-env.md`).
82
+ - **Evidence-layer honesty rule.** Each recorded claim names its layer — package, deterministic mechanism, live host or behaviour (`AGENTS.md`, § Verification, last bullet; § Behavioral & Benchmark Evidence table). Every Evidence bullet cites a durable reference — a public issue/PR URL or a repository-relative path; working-packet paths are notes, not provenance (`.agents/harness-everything/errors/E-0010-packet-local-provenance-reference.md`, Lesson).
83
+ - Not run at this ADR's own state `52fb8098`: no fresh `verify:all` run is recorded for it, and this ADR does not claim that tree is green.
84
+
85
+ ## Open gates
86
+
87
+ - #325 (documentation family umbrella) is OPEN; shipped slices do not close it (`docs/adr/DOCS-001-project-docs-config.md`, § Open gates).
88
+ - #341 E1 remains OPEN: qualifying cycles not established; D1/D2 non-qualifying; E1 GO/REVISE/NO-GO gates expansion beyond the limited pilot (`docs/document-lifecycle.md`, § Phase 3b row 3b, and Phase 3b entry-gates bullet).
89
+ - This ADR's own status stays `proposed` until the owner accepts it; ADR status vocabulary is `proposed`/`accepted`/`rejected`/`superseded` (`docs/document-lifecycle.md`, § Roles and status (D6.1, D6.3)).
90
+
91
+ ## Related sources
92
+
93
+ Every doc and source path that describes the `verify:all` mechanism, with one line on what it says about the gate.
94
+
95
+ | Source | What it says about the gate |
96
+ | --- | --- |
97
+ | `scripts/verify-all.js` (`FULL_PLAN`, `NODE22_PLAN`, `NODE22_UNVERIFIED`, `WAZA_ENTRY`, `buildPlan`, `parseArgs`, `renderReport`, `main`) | The mechanism itself: 12-row CI-order plan, `--fast` = the four `fast: true` rows, waza independent of `--fast`, `--clean` fresh detached worktree, `--node22` two execution smoke tests via `npx node@22`, Node 22 `npm ci` always UNCHECKED locally, waza probed then UNCHECKED if absent, every unrun gate reported UNCHECKED with its reason, exit 1 on any FAIL, `--help` exit 0, unknown argument exit 2 |
98
+ | `ci/mechanism-38-verify-all.test.js` | Direct contract test: plan rows retained in every mode, `--fast` subset membership, waza runs by default in fast mode, `--no-waza` reason, UNCHECKED reasons, report self-describing (mode, flags, HEAD, runtime, OS), launcher policy (git shell-free; Windows `.cmd` shims via shell), spaced worktree paths survive |
99
+ | `package.json` (script `verify:all`; scripts it invokes) | `verify:all` maps to `node scripts/verify-all.js`; names each individual gate script (`test`, `test:mutations`, `test:consistency` (chains `consistency-check.js`, `doc-capability-consistency.test.js`, `repository-contract.test.js`, `mechanism-2ao-plugin-sync.test.js`, `prompt-contract-regressions.test.js`), `test:references`, `test:release`, `test:collision`, `test:routing:skills`, `test:routing:invariants`, `test:plugin:openai`, `test:plugin:submission`, `test:platform:compatibility`, `test:portability`, `test:mechanism`, `test:repo-contract`, `test:docs:capabilities`) |
100
+ | `AGENTS.md` § Verification Before You Claim Done | `verify:all` "runs every CI gate category and prints paste-ready evidence"; lists 15 individual gates including `test:mechanism`, `test:repo-contract`, `test:docs:capabilities`; `--fast` is the pre-push subset; Node 22 install compatibility stays UNCHECKED locally |
101
+ | `docs/repository-contract.md` (§ Runtime, § Active workflows, § Drift prevention; generated by `scripts/repository-contract.js`) | Node 22 minimum / Node 24 primary; its `ci.yml` workflow row names `test:release:semantics` and `waza:check` among the npm commands CI runs — a list that differs from `FULL_PLAN` (which has `test:routing:skills`/`test:routing:invariants` instead); `test:repo-contract` fails when runtime sources disagree, the Node 22 floor is no longer exercised, or this generated doc is stale |
102
+ | `.github/workflows/ci.yml` (jobs: `pilot-offline-evidence`, `self-regression`, `system-one-windows-node24-patched`, `system-one-windows-node-legacy-policy`, `runtime-floor`, `release-semantics`, `skill-quality`, `consistency`, `installer-e2e`) | Hosted CI runs gate-category commands as discrete jobs — `self-regression` and `consistency` across the ubuntu/windows/macos matrix on Node 24, others single-OS; also hosted-only jobs (`pilot-offline-evidence`, System One, `release-semantics`, `skill-quality` incl. waza, `installer-e2e`); `runtime-floor` (Ubuntu) installs on Node 22 (`npm ci`) and runs `npm test` + `ci/installer-roundtrip.test.js` |
103
+ | `.github/workflows/doc-governance.yml` (job `doc-governance`; runs `scripts/doc-governance-guard.js` from the validated base SHA) | The hosted document-governance guard is base-owned and runs as a separate workflow; on non-`pull_request` events it reports `UNCHECKED`, on a guard-less base `BOOTSTRAP_UNCHECKED`; it is not part of the `verify:all` gate set |
104
+ | `.github/workflows/release.yml` (jobs `gate`, `doc-governance`, `release`) | Release waits for the full CI matrix and document governance via `workflow_call` before publishing; because release runs on push, the guard dependency does not by itself prove the guard executed |
105
+ | `.nvmrc` (`24`) | Primary development/CI Node.js is 24; the 22 floor is a compatibility lane, not the dev runtime |
106
+ | `self-evolve/scripts/self-regression.js` (line 122: runs `ci/mechanism-test.js`) | `npm test` (the first `FULL_PLAN` row) executes the mechanism suite, so `test:mechanism` is exercised inside `verify:all` through `npm test` |
107
+ | `docs/doc-workflow-reconciliation.md` (line 520) | Requires the relevant deterministic gates plus `npm run verify:all -- --fast` for parity claims in the doc-reconciliation workflow |
108
+ | `docs/own-repo-governance-e1-plan-2026-10-25-2139.md` (lines 141, 184, 225, 236, 246, 254) | Usage protocol: focused command per packet, `verify:all -- --fast` after a packet set, coordinator runs full `verify:all` once after the final candidate is frozen; "Node 22 install/platform lanes not run locally remain UNCHECKED"; recorded instances where full `verify:all` was not run stay explicit |
109
+ | `benchmarks/results/codex-pr-metadata-2026-10-26/verification.md` | Observed full-gate local run bound to HEAD `c170a96` with command, environment, row-by-row results, summary and full-log SHA-256 |
110
+ | `docs/document-lifecycle.md` (§ Scope of this slice) | Hosted CI evidence: full-gate CI run for `e5d22584` (run 39374474269) and the resident-teardown retry on `main@75e0435` (run 39175240370) |
111
+ | `.agents/harness-everything/errors/E-0001-doc-check-identity-split-decision.md` (episode `325-f4-checker-identity` round 4) | Repository-recorded claim, unverified as a run result here; output not retained: `verify:all` 13 PASS / 0 FAIL at `4899fbb` (historical run at a pinned SHA; row table not retained) |
112
+ | `.agents/harness-everything/errors/E-0009-one-shot-sandbox-env.md` (episodes `341-e1-kit-repin-and-425-w6`) | `verify:all` (fast and full) did not complete inside some `codex exec -s workspace-write` sandboxes (loopback bind, npm cache, workflow-state EPERM); the coordinator ran it outside the sandbox and workers report the UNCHECKED/BLOCKED disposition |
113
+
114
+ ## Known inconsistencies
115
+
116
+ Each is stated as fact and left unresolved here.
117
+
118
+ - `AGENTS.md` § Verification says `verify:all` "runs every CI gate category", but `FULL_PLAN` has 12 npm gates while hosted `ci.yml` also runs `pilot-offline-evidence` (a Python benchmark check), the System One Windows runtime jobs, `release-semantics`, `skill-quality` (waza) and `installer-e2e` — none of which appear in `FULL_PLAN`. The wording issue is tracked in [#429](https://github.com/dyphn1/Harness-everything/issues/429); this ADR does not edit `AGENTS.md`.
119
+ - `AGENTS.md` names `test:mechanism`, `test:repo-contract` and `test:docs:capabilities` as "individual gates" of `verify:all`; `FULL_PLAN` has no such entries (`test:repo-contract` and `test:docs:capabilities` are components of the `test:consistency` chain per `package.json`; `self-regression.js` line 122 runs `ci/mechanism-test.js` inside `npm test`). Also tracked in [#429](https://github.com/dyphn1/Harness-everything/issues/429).
120
+ - Historical row count: E-0001 records a `verify:all` run of "13 PASS" at `4899fbb7cb60783117983772cb6ae3d1a2e2500c`; the current `FULL_PLAN` has 12 rows. The record lacks the run's row table, so whether that run's 13th pass was the waza row (as in the `c170a96` record) or an earlier plan shape is not reconciled here.
121
+ - Local vs hosted Node 22 coverage: locally `--node22` runs only the two execution smoke tests; the Node 22 dependency install (`npm ci`) is always UNCHECKED locally (`NODE22_UNVERIFIED`) and is only covered by the hosted `runtime-floor` job — two separate dispositions.
122
+ - Gate-list wording in generated docs: the `docs/repository-contract.md` `ci.yml` row lists `test:release:semantics` and `waza:check`, which have no `FULL_PLAN` row, while `FULL_PLAN` has `test:routing:skills` and `test:routing:invariants`, which have no row in that generated list. Overlapping, not matching.
123
+ - Dispatch environment: E-0009 records that `verify:all` could not complete inside some sandboxed worker environments; the gate's evidence therefore depends on where it is executed. Stated as a limit, not resolved.
@@ -0,0 +1,305 @@
1
+ ---
2
+ id: ROUTE-001
3
+ status: proposed
4
+ ---
5
+
6
+ # ROUTE-001 — Error lesson delivery into active-step context
7
+
8
+ **This is a design ADR for a mechanism that is not shipped.** Nothing in this repository is modified
9
+ by this document; the follow-up implementation it defines does not exist yet. This ADR does **not** claim:
10
+
11
+ - that error handling improved, or that any behavior changed (no paired evidence exists);
12
+ - that the chosen error class is closed or its recurrence prevented;
13
+ - that any hook, skill, template or script named here has been, or will be, modified — no engine rewrite
14
+ ([#402 comment 6785928296](https://github.com/dyphn1/Harness-everything/issues/402#issuecomment-6785928296));
15
+ - that this is a retrospective record of past incidents: it is a forward-looking design ADR; the existing
16
+ error-ledger record inventory stays untouched
17
+ ([#402 comment 6786069987](https://github.com/dyphn1/Harness-everything/issues/402#issuecomment-6786069987));
18
+ - that injecting one record replaces the owner's standard of reading the full ledger before dispatched work.
19
+
20
+ ## Decision
21
+
22
+ - **Chosen error class: `E-0002` (`report-protocol` — reports ending without a plain column-zero
23
+ terminal `STATUS` line).** The generated ledger index has no rank field; E-0002 is not the most
24
+ frequent class (E-0009 has 7 episodes, E-0002 and E-0003 have 5 each — counts freshly verified by
25
+ `node scripts/errors-sync.js --check` at this SHA). E-0002 is chosen because it fits #402's stated
26
+ concern — "invalid commit/report formats, and missing review/packet outcomes" — and because its lesson
27
+ was followed by later recurrences: episodes `412-review13-label-after-status` (2026-11-08) and
28
+ `425-review2-label-after-status` (2026-11-11) occurred *after* the lesson existed, in packets that did
29
+ not state the terminal-line condition. Sources:
30
+ [#402 comment 6785928296](https://github.com/dyphn1/Harness-everything/issues/402#issuecomment-6785928296);
31
+ `.agents/harness-everything/errors/E-0002-report-missing-terminal-status.md`.
32
+ - **The existing ledger lesson (carried verbatim, not restated):** every report ends with one plain
33
+ column-zero `STATUS: DONE` or `STATUS: BLOCKED: <reason>` line; when a host rule also requires a
34
+ trailing line, the packet must state which line is terminal. The E-0002 record file is the content
35
+ authority for delivery; the generated index is only a locator and is never injected.
36
+ - **Domain: `ROUTE`.** This ADR decides how a relevant ledger lesson is *selected and delivered* into
37
+ active-step context. Declared in `.agents/harness-everything/project-docs.json`. Alternatives not chosen:
38
+
39
+ | Domain | Why not chosen |
40
+ | --- | --- |
41
+ | `GATE` | Implies a decision/lock; the A2 scope is a context carrier, not a decision maker ([#402](https://github.com/dyphn1/Harness-everything/issues/402), [#394](https://github.com/dyphn1/Harness-everything/issues/394)) |
42
+ | `EVID` | Fits only if the primary decision were the observation contract; here the primary decision is delivery |
43
+ | `DOCS` | Would classify the report format itself, not the delivery mechanism |
44
+ | `SONE` | System One domain; this decision does not change System One provider or routing internals |
45
+ | `DIST` | Distribution domain; this decision changes no packaging or distribution behavior |
46
+
47
+ - **Delivery channel: prompt context at `UserPromptSubmit`, through the existing `additionalContext`
48
+ seam (owner ruling A7.1).** No new hook file, no second router. On Claude Code the router already runs
49
+ at `UserPromptSubmit` (`hooks/hooks.json`, id `harness:pre:kernel-router`); on Codex,
50
+ `hooks/scripts/codex-user-prompt.js` pipes the whole hook payload to the router and wraps its stdout as
51
+ JSON `hookSpecificOutput.additionalContext` (`plugins/harness-everything/hooks/hooks.json`), because
52
+ Codex adds prompt-time context to the model only from that JSON field
53
+ ([system-one-observations.md](../system-one-observations.md#hosts)). The lesson rides in the context the
54
+ seam already sends; the hook stays a **context carrier, not a decision maker** (A2).
55
+
56
+ ```mermaid
57
+ flowchart LR
58
+ P["UserPromptSubmit payload<br/>(prompt text)"] --> S{"Literal marker<br/>report-status:E-0002 present?"}
59
+ S -->|"no"| N["Not selected:<br/>no injection, context unchanged"]
60
+ S -->|"yes"| R{"E-0002 record file<br/>readable?"}
61
+ R -->|"no"| U["Delivery unavailable;<br/>tools stay usable (fail-open)"]
62
+ R -->|"yes"| A["E-0002 record § Lesson text,<br/>verbatim, added to the<br/>existing prompt context"]
63
+ A --> W["Agent writes its report"]
64
+ W --> O["Observation: the report file's raw<br/>final line is column-zero STATUS —<br/>or it is not"]
65
+ ```
66
+
67
+ - **Relevance: an explicit report-required signal selects the E-0002 record only (owner ruling A7.2).**
68
+ The signal is defined concretely:
69
+ - *Source:* the prompt text of the `UserPromptSubmit` payload — `payload.prompt`, which the router
70
+ already reads (`harness-everything/scripts/kernel-router.js`: `const prompt = promptArg ||
71
+ (typeof payload?.prompt === 'string' ? payload.prompt : '')`). On Codex the full payload reaches the
72
+ router through `hooks/scripts/codex-user-prompt.js` `finish` (`spawnSync(process.execPath, [ROUTER],
73
+ { input, ... })`); on Claude Code the router is invoked directly with the same payload. The signal is
74
+ therefore really available at `UserPromptSubmit` on both wired hosts, before any routing output.
75
+ - *Format:* the literal marker string `report-status:E-0002` appearing anywhere in the prompt text.
76
+ A literal substring test only — no semantic classifier, no second router, no forcing every task to
77
+ produce a report.
78
+ - *Selection rule:* marker present **and** the E-0002 record file readable ⇒ the record's lesson text
79
+ is added once to the existing context. Marker absent ⇒ not selected, nothing delivered, no fallback.
80
+ - *Plain limit:* the marker is written by whoever authors the dispatch prompt or packet (a fixed
81
+ one-string convention). Prompts without it are not selected and are not delivered; the hook does not
82
+ infer report-requiredness from task content.
83
+ - Alternatives not chosen: matching the active step's recorded obligations
84
+ (`activeExecutionFor` → `activeStepSnapshot`) — defined only when a retained workflow with a loaded
85
+ obligation set exists, so it covers a subset of report work through a second selection surface; and
86
+ agent-side grep of the index at task start — no code change but depends on agent discipline, the
87
+ failure mode the ledger README already records.
88
+
89
+ - **Label vs STATUS (owner ruling A7.4), stated as decided:**
90
+ - A report **file** ends with its raw column-zero `STATUS:` line and carries no harness-label; the
91
+ **turn's** final message summarises or links the report and ends with the hidden harness-label line
92
+ (`docs/routing.md` § Turn label line).
93
+ - When the report *is* the turn's final message, the rule is a **report-turn exception to
94
+ label-last**. That exception is owned by `AGENTS.md` (applicability) and `docs/routing.md` (label
95
+ contract); making it is a follow-up change, **not made here** — those files are not edited by this ADR.
96
+ - E-0002's recorded episodes (including the label-after-status ones) stay as history; a
97
+ provenance-carrying correction of the lesson text is **#359's** follow-up. This ADR does not rewrite
98
+ the ledger record.
99
+ - **Success / failure observation, in three layers that are never merged into one PASS:**
100
+
101
+ | Layer | What is recorded | What is not claimed |
102
+ | --- | --- | --- |
103
+ | Delivered / received | Which task or step, which E-0002 record version, that the signal matched, and what context was actually sent. "Received" is stated only with host-side evidence that the context reached the model | Adapter stdout or a passing mechanism test is not a live receipt |
104
+ | Considered | Stated as **not directly observed**; no private reasoning is required or requested, no reflection token or report | Any acknowledgement the agent volunteers may be recorded as anecdote, never as the acceptance criterion |
105
+ | Used / output | The report file's raw final line under the A7.4 grammar (`STATUS: DONE` / `STATUS: BLOCKED: <reason>` at column zero, nothing after it): conformant or not. A one-run outcome | A conformant line does not prove the injection caused it, that recurrence fell, or that the error class is closed |
106
+
107
+ - Mixed cases stay separate: output conformant with delivery UNCHECKED; delivery observed with output
108
+ nonconformant. Neither is recorded as a single PASS.
109
+ - Any later behavior-improvement claim requires paired baseline/treatment evidence; this ADR's
110
+ observation contract does not provide it.
111
+ - **Smallest follow-up implementation acceptance (design only; nothing is implemented here):** one seam
112
+ (the `UserPromptSubmit` context assembly above), one minimal change (signal match ⇒ read
113
+ `.agents/harness-everything/errors/E-0002-report-missing-terminal-status.md` § Lesson and append it
114
+ verbatim to the existing context), with these controls:
115
+
116
+ | Control | Expected result | Evidence layer the check gives |
117
+ | --- | --- | --- |
118
+ | No marker in the prompt | No injection; context identical to today | Deterministic mechanism test |
119
+ | Marker present, record readable | The exact E-0002 lesson text delivered in context | Deterministic mechanism test, then one real-host task for receipt |
120
+ | Marker present, record unreadable or source stale | Delivery unavailable; tools stay usable; no fallback to the whole ledger | Deterministic mechanism test |
121
+ | Report produced | Final line conformant or not, recorded per the observation table | One real-host task (one-run outcome) |
122
+
123
+ - Explicitly forbidden: no fallback to the whole ledger, no fabricated receipt, no automatic rewrite of
124
+ the report, no error counter, no fixed recurrence threshold, no reflection tokens, no forced report,
125
+ no mutation lock, no automatic escalation or reset ritual (A2).
126
+ - Host evidence boundary: only the host seam chosen here (`UserPromptSubmit` context on Claude Code and
127
+ Codex) is covered by future checks. Other hosts and other lifecycle events are unverified; a file
128
+ existing in a package proves no host loaded it ([platform-capabilities.md](../platform-capabilities.md)).
129
+ - **Rule-of-3 boundary (owner ruling A7.5), stated exactly:** this cycle's lesson delivery adds, extends,
130
+ calls or depends on **no counter, lock or forced reflection**; the existing Rule-of-3 breaker
131
+ (`hooks/scripts/rule-of-3.js` `isTripped`/`blockForReflection`, `hooks/scripts/rule-of-3-tracker.js`,
132
+ `hooks/scripts/reset-circuit-breaker.js`, [docs/enforcement-locks.md](../enforcement-locks.md)) is not
133
+ modified in this cycle. Owner direction: no counting (that was tried and failed before); a hook hint is
134
+ enough. This ADR does **not** claim the existing breaker conforms to A2; whether A2 requires a separate
135
+ change to it is a separate item outside this ADR, unresolved for its owner. Host boundary, stated here
136
+ and kept consistent with the reading list and the known-inconsistencies entry below: this delivery
137
+ design covers only the selected Claude Code / Codex `UserPromptSubmit` path; the OpenCode plugin has its
138
+ own separate Rule-of-3 breaker (`opencode-plugin/index.mjs` — an independent counter, required
139
+ reflection, block on the covered edit tools), which this delivery neither uses nor modifies and which
140
+ this ADR does not claim conforms to A2. The OpenCode sources are reading-list evidence only: they do not
141
+ mean OpenCode was run and do not extend the hosts the lesson injection supports.
142
+ - **Non-goals (from A2 and the ownership boundary):** the hook stays a context carrier, not a decision
143
+ maker; this ADR does not duplicate #359 (Error Ledger), #394 (ledger context injection and
144
+ agent-initiated zoom-out) or #141 (candidate creation/evaluation); candidate creation/evaluation
145
+ (`hooks/scripts/lib/learning-opportunity.js` `createLearningOpportunity`,
146
+ `self-evolve/scripts/lesson-candidate.js`) and index generation (`scripts/errors-sync.js`) are not
147
+ delivery points; no claim that error handling improved without paired evidence.
148
+
149
+ ## Context
150
+
151
+ - **The problem:** agent mistakes recur even when a lesson is already recorded in the ledger — the
152
+ recording-to-application gap [#402 comment 6785928296](https://github.com/dyphn1/Harness-everything/issues/402#issuecomment-6785928296).
153
+ - **What exists today (each verified in this repository):**
154
+ - the ledger and generated index (`.agents/harness-everything/errors/README.md`, `index.jsonl`,
155
+ `E-*.md`) with a lookup convention (grep by write-set or signature); a convention, not a gate;
156
+ - hook context seams that carry *policy and routing* context but do not retrieve ledger records:
157
+ Claude Code runs `harness-everything/scripts/kernel-router.js` directly at `UserPromptSubmit`
158
+ (`hooks/hooks.json`); Codex wraps the same router through `hooks/scripts/codex-user-prompt.js`
159
+ (`plugins/harness-everything/hooks/hooks.json`); `hooks/scripts/openai-session-start.js` sends static
160
+ `POLICY` and failed-session `handoffContext` at session start;
161
+ - the generic Rule-of-3 tracker and blocker, which read session state, not the ledger
162
+ (`hooks/scripts/rule-of-3.js`, `hooks/scripts/rule-of-3-tracker.js`);
163
+ - candidate creation/evaluation machinery (`hooks/scripts/lib/learning-opportunity.js`,
164
+ `self-evolve/scripts/lesson-candidate.js`);
165
+ - zoom-out and self-evolve skills as agent-initiated reflection/evaluation paths (`zoom-out/SKILL.md`,
166
+ `self-evolve/SKILL.md`).
167
+ - No ledger-aware delivery seam exists today.
168
+ - **What zoom-out carries today (correction):** when an agent enters a repair-loop reflection, the
169
+ carried material is the acceptance anchor, links to the previous comparable report, prior finding IDs
170
+ and dispositions, the fix made since, and round counts per class in the error ledger
171
+ (`zoom-out/references/circuit-breaker.md`). It does **not** carry the static ledger lesson text; no
172
+ current seam delivers the E-0002 record.
173
+ - **Ownership boundary:** #359 owns the Error Ledger; #394 owns ledger context injection and
174
+ agent-initiated zoom-out; #141 owns candidate creation/evaluation
175
+ ([#402 comment 6785928296](https://github.com/dyphn1/Harness-everything/issues/402#issuecomment-6785928296)).
176
+ **Unverified:** current tracker state of #394 (no #394-specific implementation found on local `main`).
177
+
178
+ ## Evidence
179
+
180
+ - **E-0002 episode table** (counts freshly verified by `node scripts/errors-sync.js --check`, exit 0, at
181
+ this SHA) drawn from `.agents/harness-everything/errors/E-0002-report-missing-terminal-status.md` and
182
+ its index row:
183
+
184
+ | Episode | Date | Rounds | Closed |
185
+ | --- | --- | --- | --- |
186
+ | `325-f4-report-status` | 2026-10-22 | unknown | no |
187
+ | `341-e1-verdict-addendum` | 2026-10-29 | 1 | yes |
188
+ | `341-e1-writer-contract-review11` | 2026-11-07 | 0 | no |
189
+ | `412-review13-label-after-status` | 2026-11-08 | 1 | yes |
190
+ | `425-review2-label-after-status` | 2026-11-11 | 0 | no |
191
+
192
+ - **Seam inventory:** `hooks/hooks.json` (Claude Code `UserPromptSubmit` → `kernel-router.js`, id
193
+ `harness:pre:kernel-router`); `plugins/harness-everything/hooks/hooks.json` (Codex `UserPromptSubmit` →
194
+ `codex-user-prompt.js`); `hooks/scripts/codex-user-prompt.js` `finish` (wraps router stdout as JSON
195
+ `hookSpecificOutput.additionalContext`); `harness-everything/scripts/kernel-router.js` `route`,
196
+ `persistWorkflow`, `activeExecutionFor` (reads `payload.prompt`). Live-host receipt evidence exists for
197
+ the Codex user-hook `additionalContext` path on one retained Windows host
198
+ ([system-one-observations.md](../system-one-observations.md#hosts),
199
+ [platform-capabilities.md](../platform-capabilities.md)); the Claude Code `UserPromptSubmit` wiring is
200
+ mechanism-verified, with no live receipt for a lesson injection.
201
+ - **The rule conflict witness:** episode `412-review13-label-after-status` (a column-zero
202
+ `STATUS: DONE` followed by a hidden harness-label line) as the concrete observation that motivates the
203
+ label/STATUS decision above.
204
+ - **Candidate-class context:** the index has 14 records; only E-0003 carries a non-null `mechanism_ref`
205
+ (`.husky/commit-msg`). E-0002 has `mechanism_ref: null`.
206
+
207
+ ## Open gates
208
+
209
+ - **Owner acceptance of this ADR** (`status: proposed`); the follow-up implementation and its
210
+ verification (deterministic mechanism tests, then one real-host task) are not started.
211
+ - **`AGENTS.md` / `docs/routing.md` wording change** for the report-turn exception to label-last (A7.4)
212
+ is a follow-up owned by those files; not made here.
213
+ - **A provenance-carrying correction of the E-0002 lesson text** is a #359 follow-up.
214
+ - **Whether A2 requires a separate change to the existing Rule-of-3 breaker** — separate item outside
215
+ this ADR, unresolved for its owner (A7.5).
216
+ - **#394 tracker state** is unverified against the tracker; no #394-specific implementation exists on
217
+ local `main`.
218
+
219
+ ## Reading list
220
+
221
+ Every source describing error handling, the ledger, lesson delivery, zoom-out or self-evolve that this
222
+ Decision rests on. One line each.
223
+
224
+ | Source | What it says |
225
+ | --- | --- |
226
+ | `.agents/harness-everything/errors/README.md` | Ledger workflow: grep `index.jsonl` by signature or write-set, write/update records at failure time, `npm run errors:sync`; a convention, not a gate. |
227
+ | `.agents/harness-everything/errors/index.jsonl` | Generated per-class inventory: 14 records; E-0002 has 5 episodes and no mechanism. Locator only, never injected. |
228
+ | `.agents/harness-everything/errors/E-0002-report-missing-terminal-status.md` | The target lesson and content authority: plain column-zero terminal STATUS; packet must state the terminal line when a host rule adds a trailing line. |
229
+ | `.agents/harness-everything/errors/E-0001-doc-check-identity-split-decision.md` … `E-0014-lossy-cleanup.md` | The other 13 ledger records (classes, lessons, mechanism status). |
230
+ | `AGENTS.md` (rule 14) | Turn label line mandatory on every final message — the rule whose report-turn exception is a follow-up change. |
231
+ | `docs/routing.md` | Owns the label contract: the hidden label is the final line of every turn's final message, records post-work judgement, never gates routing; separates semantic contract, mechanism and live evidence. |
232
+ | `docs/system-one-observations.md` | Specification of the label line and turn observation; documents that Codex adds prompt-time context to the model only from JSON `hookSpecificOutput.additionalContext`, verified live on codex-cli 0.157.1. |
233
+ | `harness-everything/scripts/kernel-router.js` | The router the hooks run at `UserPromptSubmit`: `route`, `persistWorkflow`, `activeExecutionFor`; reads `payload.prompt`; prints the label contract last. |
234
+ | `hooks/scripts/codex-user-prompt.js` | Codex `UserPromptSubmit` adapter: `finish` pipes the whole hook payload into the router and wraps its stdout as `additionalContext`. |
235
+ | `scripts/sync-openai-plugin.js` | Packages `hooks/scripts` into `plugins/harness-everything/hooks/scripts`, so a change at the seam ships with the plugin — a packaging fact, not live-host evidence. |
236
+ | `docs/mechanism-first-skill-mesh.md` | Anti-goal: no mandatory response-template system; mechanisms are short, failable, bounded — the delivery adds context, not a template obligation. |
237
+ | `docs/platform-capabilities.md` | Repository-wide evidence boundary: statuses `Mechanism verified` vs `Live verified`; Codex user-hook capture live-verified for `UserPromptSubmit`/`Stop` on one Windows host only; a package file proves no host loaded it. |
238
+ | `docs/troubleshooting.md` | Operator view of the existing Rule-of-3: its session state file and manual `hooks/scripts/rule-of-3.js` runs — context for the A7.5 boundary. |
239
+ | `hooks/hooks.json` | Claude Code SessionStart, `UserPromptSubmit` (`harness:pre:kernel-router`, `harness:obs:observation-userpromptsubmit`) and PostToolUseFailure wiring; Rule-of-3 hooks live here; no ledger reference. |
240
+ | `plugins/harness-everything/hooks/hooks.json` | Packaged Codex hook wiring, including the `codex-user-prompt.js` entries. |
241
+ | `hooks/scripts/openai-session-start.js` | Session-start context seam: static `POLICY` plus failed-session `handoffContext`; no ledger retrieval. |
242
+ | `hooks/scripts/rule-of-3.js` | The existing generic three-failure blocker (`isTripped`, `blockForReflection`): a counter/lock this ADR must not extend or depend on. |
243
+ | `hooks/scripts/rule-of-3-tracker.js` | Tracks session tool-error signatures; may create a learning candidate after recovery; reads session state, not the ledger. |
244
+ | `hooks/scripts/reset-circuit-breaker.js` | The existing reset ritual for the generic breaker; kept out of scope by A2. |
245
+ | `hooks/scripts/lib/learning-opportunity.js` | `createLearningOpportunity`: session-local candidate creation for `rule-of-3-recovery` and `verifier-fail-pass` (#141). |
246
+ | `hooks/scripts/lib/telemetry.js` | Event recording used by the candidate/tracking machinery. |
247
+ | `scripts/errors-sync.js` | Builds `index.jsonl`; `--check` compares without writing; not wired into CI or hooks. |
248
+ | `scripts/lib/advisory-text.js` | Static advisory text delivery, including Rule-of-3 policy — precedent for context-only delivery. |
249
+ | `zoom-out/SKILL.md` | Agent-initiated zoom-out skill; treats repair-loop history and ledger rounds as reflection signals. |
250
+ | `zoom-out/references/circuit-breaker.md` | What zoom-out carries today: acceptance anchor, prior findings and dispositions, ledger round counts — not the static ledger lesson. |
251
+ | `zoom-out/templates/zoom-out-report.template.md` | Reflection-report template; not a delivery carrier in this design. |
252
+ | `docs/workflows/zoom-out.md` | Zoom-out workflow and packet-history requirements; its breaker is `hooks/scripts/rule-of-3.js`. |
253
+ | `docs/workflows/fable-mode.md`, `docs/workflows/fable-discipline.md`, `docs/workflows/tdd.md` | Workflow docs referencing Rule-of-3 as the mandatory reflection owner for three same-signature failures. |
254
+ | `self-evolve/SKILL.md` | Agents list, evaluate and promote lesson candidates; governed promotion, not automatic retrieval. |
255
+ | `self-evolve/references/memory-resolution.md` | Candidate evaluation and memory-resolution rules. |
256
+ | `self-evolve/scripts/lesson-candidate.js` | Candidate lifecycle implementation (#141). |
257
+ | `self-evolve/scripts/persist-memory.js` | Persistence of promoted lessons. |
258
+ | `docs/workflows/self-evolve.md` | The self-evolve workflow contract. |
259
+ | `docs/reflection.md` | Reflection/memory boundaries. |
260
+ | `docs/philosophy.md` | Contract strength (MUST/SHOULD/MAY) and mechanisms-over-mandates philosophy. |
261
+ | `docs/enforcement-locks.md` | Documents the existing generic lock behavior — the contradiction with A2 recorded below. |
262
+ | `fable-discipline/SKILL.md`, `tdd/SKILL.md`, `tdd/references/core-discipline.md` | Workflow disciplines that reference zoom-out on repetition. |
263
+ | `ci/mechanism-2a-rule-of-3.test.js` | Deterministic coverage of the existing Rule-of-3 mechanism. |
264
+ | `ci/self-evolve-loop.test.js`, `ci/mechanism-379-self-evolve-workspace.test.js` | Deterministic coverage of the self-evolve loop (#141/#379). |
265
+ | `evals/zoom-out/`, `evals/self-evolve/` | Routing evals for the two agent-initiated paths. |
266
+ | `behavioral-evals/cases/baseline-error-handling.yaml`, `pressure-skip-error-handling.yaml`, `breaker-zoom-out-after-3.yaml`, `self-evolve-retrieval-recurrence.yaml` | Behavior cases covering error handling and retrieval recurrence. |
267
+ | `plugins/harness-everything/skills/zoom-out/`, `plugins/harness-everything/skills/self-evolve/`, `plugins/harness-everything/hooks/hooks.json` | Packaged copies that must stay consistent with canonical sources if delivery ships. |
268
+ | `docs/workflows/harness-everything.md` | The cross-workflow contract: its re-plan checklist requires `zoom-out` completed after 3 same-signature failures before resuming — the mandatory reflection owner this delivery must not replace. |
269
+ | `docs/workflow-runtime.md` | Declares the two intentionally separate hard boundaries: Rule of 3 (the third matching failure pauses mutation until a zoom-out reflection is written) and user/host permission approval; a repeated cycle requests another reflection, not a permanent lock. |
270
+ | `docs/architecture.md` | Names the two mechanisms that still hard-block on the Claude Code hook path — `action-gate.js` and the Rule-of-3 zoom-out boundary — both explicitly scoped out of #190's downgrade to reminders. |
271
+ | `harness-everything/SKILL.md` | Invariants: zoom-out (MUST) after 3 same-signature failures; numeric planning never hard-stops — only Rule-of-3 reflection and explicit user/host permission boundaries may block. |
272
+ | `harness-everything/references/triage-and-tiers.md` | Architecture rule: semantic MUSTs may be reminder-observed; only Rule-of-3 reflection and explicit permission boundaries may hard-block. |
273
+ | `README.md` | States the one cognitive hard boundary (Rule of 3: three matching failures pause mutation for a zoom-out reflection), the guard's behavior, and the OpenCode plugin's breaker with its retained live-host limits. |
274
+ | `VERIFICATION.md` | Verification recipes plus the invariant that only Rule-of-3 and explicit permission boundaries may block. |
275
+ | `opencode-plugin/README.md` | The OpenCode plugin's own Rule-of-3 zoom-out boundary: the third matching verification failure forces a tokenized zoom-out report; a valid reflection resets the count; no permanent second-stage lock. |
276
+ | `opencode-plugin/index.mjs` | Implements that OpenCode breaker independently: `tripBreaker` counts matching verification failures and on the third sets `reflectionPending`; `tool.execute.before` throws for `EDIT_TOOLS` (`edit`, `write`, `apply_patch`) operations that are not the reflection write, until a valid reflection exists. |
277
+ | [#402](https://github.com/dyphn1/Harness-everything/issues/402) (comments 6785928296, 6786069987) | Scope anchor A1–A6: problem statement, context-carrier rule, ownership, cycle-B scope, design-not-retrospective; comment 6790477633 records the A7 rulings. |
278
+ | [#394](https://github.com/dyphn1/Harness-everything/issues/394) | Ledger context injection and agent-initiated zoom-out ownership. |
279
+ | [#359](https://github.com/dyphn1/Harness-everything/issues/359) | Error Ledger ownership. |
280
+ | [#141](https://github.com/dyphn1/Harness-everything/issues/141) | Candidate creation/evaluation ownership. |
281
+ | [#421 comment 6785927033](https://github.com/dyphn1/Harness-everything/issues/421#issuecomment-6785927033) | Cycle definition for this work. |
282
+
283
+ ### Known inconsistencies (stated as facts, not resolved by this ADR)
284
+
285
+ - **`AGENTS.md` rule 14 / `docs/routing.md` vs the E-0002 terminal rule:** the repository requires a
286
+ trailing hidden harness-label line on every final message; the ledger lesson requires `STATUS:` to be
287
+ the last line at column zero. Episode `412-review13-label-after-status` records the conflict. This ADR
288
+ states the A7.4 decision and its report-turn exception, but the wording change in `AGENTS.md` and
289
+ `docs/routing.md` is a follow-up; until it lands, the conflict stands as written.
290
+ - **Existing generic Rule-of-3 lock vs A2:** `hooks/scripts/rule-of-3.js` and
291
+ [docs/enforcement-locks.md](../enforcement-locks.md) describe a generic three-failure mutation lock with
292
+ a required reflection report; #402 prohibits exactly such mechanisms for ledger lesson handling. This
293
+ ADR adds, extends, calls or depends on none of them and does not modify the breaker; whether A2 requires
294
+ a separate change to the existing breaker stays unresolved for its owner. The OpenCode plugin's separate
295
+ breaker (`opencode-plugin/index.mjs`, [opencode-plugin/README.md](../../opencode-plugin/README.md)) is
296
+ likewise neither used nor modified by this delivery, and this ADR does not claim it conforms to A2.
297
+ - **Ledger README lookup rule vs the owner's full-read standard:** the README says grep `index.jsonl` for
298
+ the packet's write-set; the owner standard requires reading every record. Injecting one record does not
299
+ change that operational standard for packets.
300
+ - **#394 point-of-action proposals vs shipped code:** E-0002 and E-0003 propose point-of-action injection
301
+ in #394, but no #394-specific implementation exists on local `main` (**unverified** against the tracker).
302
+ - **Index freshness:** `scripts/errors-sync.js` is not wired into CI or hooks (its own source comment), so
303
+ the index can be stale; this design never injects index content — the E-0002 record file is the content
304
+ authority and the index is a locator. Counts cited in this ADR were verified by
305
+ `node scripts/errors-sync.js --check` at this SHA.
@@ -1240,21 +1240,26 @@ Status: **implemented behind the existing pilot switch; mechanism and package ch
1240
1240
 
1241
1241
  ```mermaid
1242
1242
  flowchart LR
1243
- B["Original baseline B<br/>task and config pinned"] --> O["Proposed outline O<br/>new target absent at B"]
1244
- I["Coordinator-pinned inventory"] --> R["Independent review<br/>exact O + cited row"]
1245
- O --> R
1246
- R --> H["Immutable handoff +<br/>exclusive writer lease"]
1247
- H --> P["Task/Agent PreToolUse<br/>exact prompt marker"]
1248
- P --> S["Synchronous seam<br/>clean worker root at O<br/>one-use token consumed"]
1249
- S --> W["Correlated worker start/result"]
1250
- W --> D["Final candidate D<br/>strict descendant of O"]
1251
- D --> A["Outline result and<br/>aggregate B→D MUSTs"]
1243
+ B["Original baseline B<br/>task and config pinned"] --> PL["Plan + start<br/>W6 state operations"]
1244
+ PL --> INV["Pinned inventory<br/>W6 producer"]
1245
+ INV --> O
1246
+ INV --> REV["Independent review<br/>exact O + cited row"]
1247
+ O --> REV
1248
+ REV --> HAND["Seal handoff +<br/>exclusive writer lease<br/>W3/W6"]
1249
+ HAND --> DISP["Task/Agent PreToolUse<br/>exact prompt marker"]
1250
+ DISP --> SEAM["Synchronous seam<br/>clean worker root at O<br/>one-use token consumed"]
1251
+ SEAM --> WORK["Correlated worker start/result"]
1252
+ WORK --> D["Final candidate D<br/>strict descendant of O"]
1253
+ D --> C["Completed worker result<br/>and Stop"]
1254
+ C --> F["Independent final review"]
1255
+ F --> Q["Ordered dispositions<br/>W6 state operations"]
1256
+ Q --> A["Outline result and<br/>aggregate B→D MUSTs"]
1252
1257
  ```
1253
1258
 
1254
1259
  | Evidence | Required binding |
1255
1260
  |---|---|
1256
1261
  | B and task | Keep the workflow-start B commit/root/tree and ordered requirement IDs for every attempt. Config scope must still match B. An attempt cannot reset B to O. |
1257
- | Inventory | The coordinator supplies exact bytes and `inventory-pin.json` outside the candidate tree. The pinned source is `report-inv.md`, SHA-256 `2741bd4514d2cd68f57d93a2b3ce94cbe597ca62d30e26f0ca58e882df5b03c6`, run `e1-inv-1`, input SHA `0ef0541c6cae550e8269ba712e03797e0e987dfb`, approval `#325` comment `6436207729`, decision 1. The trusted pin also records the owner-approved `VERI`→`EVID` mapping for rows 15–18 by reference to `../e1-feasibility-2026-10-28/owner-decision-veri-evid.md`; inventory bytes and digest stay unchanged. The provider rehashes the bytes and compares every pin field before resolving one row and domain. Missing, stale, duplicate, ambiguous, wrong-target or unavailable evidence is unresolved with no fallback. Synthetic test pins prove parser/mechanism binding only. |
1262
+ | Inventory | The coordinator supplies exact bytes and `inventory-pin.json` outside the candidate tree. The pinned source is `report-inv.md`, SHA-256 `2741bd4514d2cd68f57d93a2b3ce94cbe597ca62d30e26f0ca58e882df5b03c6`, run `e1-inv-1`, input SHA `0ef0541c6cae550e8269ba712e03797e0e987dfb`, approval `#325` comment `6436207729`, decision 1. The trusted pin records the owner-approved `VERI`→`EVID` mapping for rows 15–18, approved at [#325 comment 6706805112](https://github.com/dyphn1/Harness-everything/issues/325#issuecomment-6706805112); inventory bytes and digest stay unchanged. The provider rehashes the bytes and compares every pin field before resolving one row and domain. Missing, stale, duplicate, ambiguous, wrong-target or unavailable evidence is unresolved with no fallback. Synthetic test pins prove parser/mechanism binding only. |
1258
1263
  | O and review | O is bound to its commit, tree, target blobs and stored-byte digests. Its `proposed` ADR frontmatter cites one `Inventory row: <id>`, target and domain, with `id` equal to the target basename, and contains no completed Decision text. A host-captured `SubagentStop` review must approve those exact O bytes and the pinned inventory, with a distinct host `agent_id` and correlated Agent/Task result. |
1259
1264
  | Handoff and dispatch | One immutable attempt handoff binds B, O, scope, inventory, accepted review, coordinator principal, lease and one-use token. Agent/Task dispatch accepts exactly one `HARNESS_OUTLINE_DISPATCH_V1` block in `tool_input.prompt`, whose token must equal the handoff token; it does not search free-form text or use another field or cwd as a fallback. The outline anchor also requires explicit `run_in_background === false` and absence of any `isolation` key, including null or empty values. Before worker start, PreToolUse verifies the handoff, review, pin, exclusive lease, canonical root, HEAD/tree at O and clean index/worktree including untracked files; it creates a write-once handoff-digest seal, stores validation digests/reasons, then consumes the token by exclusive creation. Every predecessor seal, seam and token remains bound to the original handoff bytes, so an overwritten predecessor invalidates the chain. |
1260
1265
  | Worker and D | The dispatch key is `(session_id, tool_use_id)`. Exactly one matching Task/Agent result must carry `tool_response.status === 'completed'`; its observed `tool_response.agentId` must map to exactly one `SubagentStart` and one `SubagentStop` with the same `session_id` and `agent_id`. Require PreToolUse < SubagentStart < SubagentStop in journal order, but do not order the completed result against Stop. Both worker events need exact canonical `cwd === workerRoot`. `prompt_id` and `parent_tool_use_id` are not correlation keys; `interrupted` is not completion proof. Async launches, failures, cancellation, missing/duplicate events, replayed IDs, worktree isolation and root mismatch stay unresolved. D is checked against the current candidate separately from O. O must be a strict ancestor of D. A squash may retain the cycle only when a coordinator correspondence record proves identical target blobs between retained pre-merge D and the merged tree; changed bytes need fresh final quality review. |
@@ -1269,24 +1274,29 @@ Each captured writer record is decided by principal × phase × operation × tar
1269
1274
  ```mermaid
1270
1275
  flowchart LR
1271
1276
  R["captured writer record"] --> P{"journal phase"}
1272
- P -->|"before reviewer launch"| B["B→O: coordinator writes or git add/commit of the pinned target"]
1277
+ P -->|"before reviewer launch"| B["B→O target writes, plus W6 plan/start/inventory"]
1273
1278
  P -->|"reviewer launch to its Stop"| V["review: no writer"]
1274
- P -->|"review Stop to dispatch"| H["review→dispatch: no writer (W3 unverifiable)"]
1279
+ P -->|"review Stop to dispatch"| H["review→dispatch: W3 seal only"]
1275
1280
  P -->|"dispatch to worker Stop"| D["draft: correlated worker in its root"]
1276
- P -->|"after worker Stop"| A["after D: no writer"]
1281
+ P -->|"after final review"| A["three ordered W6 dispositions only"]
1277
1282
  B --> S["O commit must change exactly the pinned target(s) against B"]
1278
1283
  ```
1279
1284
 
1280
1285
  | Phase | Principal | Operation and target | Result |
1281
1286
  |---|---|---|---|
1287
+ | Before O | Coordinator: no `agent_id`, author `session_id` | Installed `workflow-disposition.js plan` for the row-17 `adr-evid` / `verify-row17` requirements and `iterative-single` topology | Allowed only for the existing planning transitions at clean B |
1288
+ | Before O | Coordinator: no `agent_id`, author `session_id` | Installed `workflow-disposition.js start` for the same pending plan | Allowed only for the existing pending-to-running transition at clean B |
1289
+ | Before O | Coordinator: no `agent_id`, author `session_id` | Installed `w6-state-operations.js inventory` | Allowed only for the unchanged inventory bytes, exact pin, and two pinned inventory destinations |
1282
1290
  | Before reviewer launch | Coordinator: no `agent_id`, author `session_id` | `Write`, `Edit` or `apply_patch` whose every path is a pinned target | Allowed |
1283
1291
  | Before reviewer launch | Coordinator | `git add [--] <literal pinned file>...` or `git commit -m <message>`; R11-1 (b): record before review, validate at dispatch; uncaptured/pre-B index effects are UNCHECKED | Allowed only under this grammar; unbound or unverified index effects receive no credit |
1284
1292
  | Before reviewer launch | Any | Any other write, chained or unknown shell command, or a path that is not the target | `outline-writer-activity-ambiguous` |
1285
1293
  | Review | Reviewer or any other agent | Any writer | Ambiguous |
1286
- | Review to dispatch | Coordinator | Any write, including handoff, lease, pin and merge-correspondence files | Ambiguous |
1294
+ | Review to dispatch | Coordinator: no `agent_id`, author `session_id` | One installed `w6-state-operations.js seal` after the approved O review and before dispatch | Allowed only for this attempt's validated lease and handoff |
1295
+ | Review to dispatch | Coordinator | Any other write, including a caller-selected destination, pin change or merge-correspondence file | `outline-writer-activity-ambiguous` |
1287
1296
  | Dispatch to worker Stop | Correlated worker, `cwd` equal to the worker root | Any writer | Allowed |
1288
1297
  | Dispatch to worker Stop | Other agent or coordinator | Any writer | Ambiguous; an overlapping same-root start is `outline-competing-writer-start` |
1289
- | After worker Stop | Any | Any writer | Ambiguous |
1298
+ | After worker Stop and completed independent final review | Coordinator: no `agent_id`, author `session_id` | `step adr-evid pass`, then `binding verify-row17 verification-loop loaded`, then `step verify-row17 pass` | Allowed only in this order and with current evidence |
1299
+ | After worker Stop | Any | Any other writer or disposition | Ambiguous |
1290
1300
 
1291
1301
  - The reviewer launch is the first journal record that is the reviewer's own, or the launch result sharing its `tool_use_id`. The review ends at the reviewer's `SubagentStop`.
1292
1302
  - Write-family records carry `writeTargets` (the `file_path`, or the `apply_patch` headers). A record without a target is ambiguous.
@@ -1304,7 +1314,10 @@ flowchart LR
1304
1314
  ```
1305
1315
 
1306
1316
  - Suggested contract wording (owner, #341 comment 6708822276): "Exact task and target-path binding, captured writer operations, and immutable Outline O Git commit/tree/artifact identity validated before independent review and revalidated at dispatch."
1307
- - **W3 stays rejected.** Handoff, lease, pin and merge-correspondence files are written outside capture and their content is not bound at capture time, so no coordinator state write is verifiable from evidence yet. The dispatch seam still validates those bytes; the writes themselves are rejected.
1317
+ - **W3/W6 are bounded state operations, not a coordinator exemption.** Every admitted operation has a correlated `tool_use_id`, session, canonical task root, workflow/revision, principal, phase, schema, and exact state destinations observed by the real Pre/Post hooks. Each capture carries `harness.w6-state-operation.v1` evidence with before/after session-state snapshots and Git identity. The shared provider validates the state transition and destination set; extra changed paths, symlink escapes, stale or failed results, missing correlation, replay, compound shell and unsupported commands withhold credit. State-only calls do not change `lastEditAt` or create a verification timestamp.
1318
+ - Before O, `plan` accepts only the row-17 `adr-evid` and `verify-row17` requirement set on `iterative-single`; `start` only materializes that plan. The installed `inventory` operation copies the unchanged pinned inventory bytes and pin after checking SHA-256 `2741bd4514d2cd68f57d93a2b3ce94cbe597ca62d30e26f0ca58e882df5b03c6`, row 17's `VERI`→`EVID` mapping, and durable approval [#325 comment 6706805112](https://github.com/dyphn1/Harness-everything/issues/325#issuecomment-6706805112). These transitions write only `workflow-run.json`, `workflow-obligations.json`, or the two pinned inventory files beneath the session state root.
1319
+ - After the approved O review and before dispatch, the installed `seal` operation derives the current task/attempt from the captured reviewer lifecycle and clean O, reuses the existing pin/review validators, and creates only `writer-lease.json` and `handoff.json` for that attempt. No caller-selected path, old-attempt rewrite, review substitution, or task-tree/Git write is accepted.
1320
+ - After the worker's completed result and unique Stop, and after an independent final review, only the ordered ADR pass, verification-loop binding, and verification pass are admitted. The verification `step` calls `pilot.assess()` synchronously before its own PostToolUse event; that internal report is marked pending with no retained credit. Final credit requires the completed host result and is recomputed by ordinary Stop reconciliation.
1308
1321
  - **W4 is unchanged.** Outline credit still needs a host-captured `SubagentStop` review and a correlated Task/Agent result from an agent distinct from the coordinator and worker. Only the Claude Code host is captured for outline credit; OpenCode and other reviewer providers are not.
1309
1322
  - Negative controls: the mechanism file injects each rejected case through the real hook, provider and `pilot.assess()` (`writer-policy negative controls`, `pre-review writer positive controls`).
1310
1323
 
@@ -12,6 +12,8 @@
12
12
  - `DOCS-006` — `docs/adr/DOCS-006-reconciliation-pilot.md` (role: adr; status: accepted)
13
13
  - `DOCS-007` — `docs/adr/DOCS-007-shared-doc-craft-derived-views.md` (role: adr; status: accepted)
14
14
  - `DOCS-008` — `docs/adr/DOCS-008-obligation-abstraction-bounded-consumer.md` (role: adr; status: accepted)
15
+ - `EVID-001` — `docs/adr/EVID-001.md` (role: adr; status: proposed)
16
+ - `ROUTE-001` — `docs/adr/ROUTE-001-error-lesson-delivery.md` (role: adr; status: proposed)
15
17
 
16
18
  ## PRD revision chains
17
19
 
@@ -224,6 +224,8 @@ Credited reconciliation for F4 (Claude Code only, pilot ON) is **implemented, wi
224
224
 
225
225
  PR-B adds a dedicated `outline-confirmation` evidence lane for Claude captures with separate B/O/D checks, a coordinator-sealed pre-dispatch handoff, pinned-inventory row binding, and an independent exact-O review. A separate sanitized capture now qualifies the **observed Claude Code 2.1.312 run8 profile**, recorded at main baseline `1bd0f805031c5577a6e7f72a9bc5b41618b71fc1`. This is retained field-mapping evidence, not runtime version enforcement or an E1 qualifying cycle. OpenCode, Codex and other Claude Code versions receive no outline qualification. Missing or ambiguous capture stays unresolved and host tools remain fail-open. The outline result does not replace the aggregate B→D MUST result or the existing exact-D `quality-review` contract.
226
226
 
227
+ W3/W6 adds only the closed workflow-state operations named in [the reconciliation contract](doc-workflow-reconciliation.md#writer-policy-phase-aware): plan/start and inventory before O, one seal after the approved O review, then three ordered dispositions after worker closure and final review. The installed producer exposes only `inventory` and `seal`; the real Pre/Post hook journal and provider validate invocation identity, phase, exact destinations, schema and transition. `state-persist` uses that same decision so verified state-only calls do not appear as task edits or verification evidence. The outline mechanism suite exercises source and packaged paths; this is deterministic mechanism/package evidence only. No live W6 host cycle or E1 qualification is claimed.
228
+
227
229
  ### Own-repository governance guard (PR #376)
228
230
 
229
231
  On `pull_request`, a standalone `doc-governance` job extracts `scripts/doc-governance-guard.js` from the event base commit and runs those bytes against the exact event base/head SHAs. Its nonzero result fails that job; `self-regression` and the other CI jobs run independently. The ordinary test suite may still run on GitHub's PR checkout SHA, which can be a synthetic merge commit; it is reported separately. The guard never falls back to the candidate copy. PR #376's reviewed base lacked the verifier; that historical bootstrap reported BOOTSTRAP_UNCHECKED without executing candidate bytes. Bases containing the guard (including main at 0ef0541c) execute the base-owned verifier. If a selected PR base lacks the guard, the wrapper retains the warning/step-summary-only bootstrap path with exit 0; this is unverified governance, not PASS. Every nonzero exit from an extracted verifier, including FAIL and BOOTSTRAP_UNCHECKED, fails the governance job. Other CI jobs run independently.
package/docs/routing.md CHANGED
@@ -70,10 +70,10 @@ This MUST is semantic rather than a hard runtime lock: hosts may observe/remind
70
70
  End the final message of **every** turn with one line that rendered Markdown hides. This includes short answers, lookups, and turns that end with a question back to the user; unlike the Harness Status, it is not limited to non-trivial work:
71
71
 
72
72
  ```
73
- <!-- harness-label {"v":1,"validity":"actionable","contextDependent":false,"tier":"tier2","intents":["fix","test"],"workflow":"iterative-single","skills":["tdd"]} -->
73
+ <!-- harness-label {"v":1,"validity":"actionable","tier":"tier2","intents":["fix","test"],"workflow":"iterative-single","skills":["tdd"]} -->
74
74
  ```
75
75
 
76
- It states the agent's own judgement after the work, not a copy of the router's suggestion: `validity` (`actionable` or `invalid`), `contextDependent` (the prompt text alone would not have been enough), `tier` under tier rules v2, up to three `intents`, the `workflow` strategy and the `skills` actually used. The observation collector stores it as training data ([system-one-observations.md](system-one-observations.md)). A missing or malformed line is recorded with a reason code; it never blocks a turn or changes routing.
76
+ It states the agent's own judgement after the work, not a copy of the router's suggestion. `invalid` means the prompt cannot be understood from its own text and needs conversation context; agent-written dispatches and worker instructions are ordinary prompts. The remaining keys record `tier` under tier rules v2, up to three `intents`, the `workflow` strategy and the `skills` actually used. The observation collector stores it as training data ([system-one-observations.md](system-one-observations.md)). A missing or malformed line is recorded with a reason code; it never blocks a turn or changes routing.
77
77
 
78
78
  Tier values:
79
79