harness-everything 1.3.0 → 1.3.2

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 (216) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/AGENTS.md +1 -1
  4. package/CHANGELOG.md +14 -0
  5. package/behavioral-evals/ledger-pairs/README.md +53 -0
  6. package/behavioral-evals/ledger-pairs/arm.js +359 -0
  7. package/behavioral-evals/ledger-pairs/fixture.js +138 -0
  8. package/behavioral-evals/ledger-pairs/preflight.js +96 -0
  9. package/behavioral-evals/ledger-pairs/score.js +155 -0
  10. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/README.md +108 -0
  11. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/agy/pair-1-baseline/arm-plan.json +14 -0
  12. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/agy/pair-1-baseline/arm-result.json +35 -0
  13. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/agy/pair-1-treatment/arm-plan.json +14 -0
  14. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/agy/pair-1-treatment/arm-result.json +35 -0
  15. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/agy/pair-2-baseline/arm-plan.json +14 -0
  16. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/agy/pair-2-baseline/arm-result.json +35 -0
  17. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/agy/pair-2-treatment/arm-plan.json +14 -0
  18. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/agy/pair-2-treatment/arm-result.json +35 -0
  19. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/agy/pair-3-baseline/arm-plan.json +14 -0
  20. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/agy/pair-3-baseline/arm-result.json +35 -0
  21. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/agy/pair-3-treatment/arm-plan.json +14 -0
  22. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/agy/pair-3-treatment/arm-result.json +35 -0
  23. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/agy/pair-4-baseline/arm-plan.json +14 -0
  24. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/agy/pair-4-baseline/arm-result.json +28 -0
  25. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/agy/pair-4-treatment/arm-plan.json +14 -0
  26. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/agy/pair-4-treatment/arm-result.json +35 -0
  27. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/codex/pair-1-baseline/arm-plan.json +13 -0
  28. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/codex/pair-1-baseline/arm-result.json +56 -0
  29. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/codex/pair-1-treatment/arm-plan.json +13 -0
  30. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/codex/pair-1-treatment/arm-result.json +56 -0
  31. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/codex/pair-2-baseline/arm-plan.json +13 -0
  32. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/codex/pair-2-baseline/arm-result.json +56 -0
  33. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/codex/pair-2-treatment/arm-plan.json +13 -0
  34. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/codex/pair-2-treatment/arm-result.json +56 -0
  35. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/codex/pair-3-baseline/arm-plan.json +13 -0
  36. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/codex/pair-3-baseline/arm-result.json +49 -0
  37. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/codex/pair-3-treatment/arm-plan.json +13 -0
  38. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/codex/pair-3-treatment/arm-result.json +49 -0
  39. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/codex/pair-4-baseline/arm-plan.json +13 -0
  40. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/codex/pair-4-baseline/arm-result.json +49 -0
  41. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/codex/pair-4-treatment/arm-plan.json +13 -0
  42. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/codex/pair-4-treatment/arm-result.json +56 -0
  43. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-1-baseline/arm-plan.json +14 -0
  44. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-1-baseline/arm-result.json +44 -0
  45. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-1-baseline/receipt.jsonl +17 -0
  46. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-1-treatment/arm-plan.json +14 -0
  47. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-1-treatment/arm-result.json +41 -0
  48. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-1-treatment/receipt.jsonl +58 -0
  49. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-2-baseline/arm-plan.json +14 -0
  50. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-2-baseline/arm-result.json +50 -0
  51. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-2-baseline/receipt.jsonl +101 -0
  52. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-2-treatment/arm-plan.json +14 -0
  53. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-2-treatment/arm-result.json +44 -0
  54. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-2-treatment/receipt.jsonl +29 -0
  55. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-3-baseline/arm-plan.json +14 -0
  56. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-3-baseline/arm-result.json +44 -0
  57. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-3-baseline/receipt.jsonl +23 -0
  58. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-3-treatment/arm-plan.json +14 -0
  59. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-3-treatment/arm-result.json +34 -0
  60. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-3-treatment/receipt.jsonl +24 -0
  61. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-4-baseline/arm-plan.json +14 -0
  62. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-4-baseline/arm-result.json +47 -0
  63. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-4-baseline/receipt.jsonl +69 -0
  64. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-4-treatment/arm-plan.json +14 -0
  65. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-4-treatment/arm-result.json +44 -0
  66. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-4-treatment/receipt.jsonl +65 -0
  67. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/run-order.sh +18 -0
  68. package/benchmarks/results/live-host/ledger-pairs-2026-11-28/score.json +1032 -0
  69. package/benchmarks/results/live-host/opencode-2026-11-28-397-turn-export/README.md +50 -0
  70. package/benchmarks/results/live-host/opencode-2026-11-28-397-turn-export/collect-rerun.txt +3 -0
  71. package/benchmarks/results/live-host/opencode-2026-11-28-397-turn-export/export-report.json +22 -0
  72. package/benchmarks/results/live-host/opencode-2026-11-28-397-turn-export/host-version.txt +1 -0
  73. package/benchmarks/results/live-host/opencode-2026-11-28-397-turn-export/import-report-1.json +18 -0
  74. package/benchmarks/results/live-host/opencode-2026-11-28-397-turn-export/import-report-2.json +18 -0
  75. package/benchmarks/results/live-host/opencode-2026-11-28-397-turn-export/labels-observed-excerpt.jsonl +2 -0
  76. package/benchmarks/results/live-host/opencode-2026-11-28-397-turn-export/observations-index-excerpt.json +26 -0
  77. package/benchmarks/results/live-host/opencode-2026-11-28-397-turn-export/plugin-load-lines.txt +1 -0
  78. package/benchmarks/results/live-host/opencode-2026-11-28-450-steering-trace/README.md +46 -0
  79. package/benchmarks/results/live-host/opencode-2026-11-28-450-steering-trace/observations-index-excerpt.json +16 -0
  80. package/benchmarks/results/live-host/opencode-2026-11-28-450-steering-trace/plugin-load-lines.txt +2 -0
  81. package/benchmarks/results/live-host/opencode-2026-11-28-450-steering-trace/run-marks.txt +6 -0
  82. package/benchmarks/results/live-host/opencode-2026-11-28-450-steering-trace/steering-probe.js +16 -0
  83. package/benchmarks/results/live-host/opencode-2026-11-28-450-steering-trace/steering-trace.jsonl +167 -0
  84. package/ci/archive/325-prep/README.md +9 -2
  85. package/ci/archive/325-prep/doc-reconciliation-red.js +34 -8
  86. package/ci/fixtures/553-t2a/body-edit/base/.agents/harness-everything/project-docs.json +11 -0
  87. package/ci/fixtures/553-t2a/body-edit/base/docs/a.md +6 -0
  88. package/ci/fixtures/553-t2a/body-edit/base/docs/b.md +1 -0
  89. package/ci/fixtures/553-t2a/body-edit/candidate/docs/a.md +6 -0
  90. package/ci/fixtures/553-t2c/derived-regenerate-must/base/docs/adr/EVID-001-verify-all-evidence.md +11 -0
  91. package/ci/fixtures/553-t2c/derived-regenerate-must/base/docs/governed-index.md +19 -0
  92. package/ci/fixtures/553-t2c/derived-regenerate-must/candidate/docs/adr/EVID-001-verify-all-evidence.md +11 -0
  93. package/ci/fixtures/553-t2c/derived-regenerate-must/candidate/docs/governed-index.md +19 -0
  94. package/ci/fixtures/553-t2c/derived-regenerate-must/config.json +17 -0
  95. package/ci/fixtures/doc-obligations/derive/regression-pins.json +153 -0
  96. package/ci/fixtures/state-persist-post-tool-use/harness.js +206 -0
  97. package/ci/fixtures/state-persist-post-tool-use/off-handoff-golden.json +16 -0
  98. package/ci/fixtures/state-persist-post-tool-use/payload-post-tool-use-success.json +13 -0
  99. package/ci/fixtures/stop/fail-session-writes.js +109 -0
  100. package/ci/fixtures/workflow-contract/cases.json +3355 -0
  101. package/ci/fixtures/workflow-contract/wiring-cases.json +560 -0
  102. package/ci/lib/doc-reconciliation-prep-fixtures.js +4 -9
  103. package/ci/mechanism-2an-workflow-replay.test.js +324 -0
  104. package/ci/mechanism-2ax-doc-lifecycle.test.js +132 -0
  105. package/ci/mechanism-325-3a-doc-evidence.test.js +73 -0
  106. package/ci/mechanism-325-3a-doc-obligations.test.js +61 -0
  107. package/ci/mechanism-325-3b-preparation.test.js +208 -49
  108. package/ci/mechanism-325-3b-s1-review.test.js +20 -828
  109. package/ci/mechanism-325-3b-s3-providers.test.js +59 -0
  110. package/ci/mechanism-325-f3-derived-views.test.js +140 -0
  111. package/ci/mechanism-332-fable-directive.test.js +180 -0
  112. package/ci/mechanism-341-opencode-lane.test.js +164 -284
  113. package/ci/mechanism-35-verification-contract.test.js +246 -0
  114. package/ci/mechanism-365-step-edit-accounting.test.js +5 -6
  115. package/ci/mechanism-383-doc-glob-line-terminators.test.js +0 -30
  116. package/ci/mechanism-397-opencode-observations.test.js +151 -18
  117. package/ci/mechanism-552-ledger-pairs.test.js +159 -0
  118. package/ci/mechanism-553-e1-unhook-credit.test.js +328 -0
  119. package/ci/mechanism-553-p2a-claude-hooks.test.js +98 -0
  120. package/ci/mechanism-553-p3-plan-start.test.js +212 -0
  121. package/ci/mechanism-553-state-persist-post-tool-use.test.js +307 -0
  122. package/ci/mechanism-553-stop.test.js +427 -0
  123. package/ci/mechanism-553-t2a-derive.test.js +110 -0
  124. package/ci/mechanism-553-t2c-derive.test.js +94 -0
  125. package/ci/mechanism-e1-derived-regenerate.test.js +45 -206
  126. package/ci/mechanism-outline-sanitizer.test.js +0 -8
  127. package/ci/mechanism-pr-a-conflict-check.test.js +38 -305
  128. package/ci/mechanism-prb-outline-review.test.js +101 -3283
  129. package/ci/router-workflow-plan.test.js +61 -21
  130. package/docs/adr/DOCS-006-reconciliation-pilot.md +4 -2
  131. package/docs/adr/DOCS-008-obligation-abstraction-bounded-consumer.md +3 -3
  132. package/docs/doc-workflow-reconciliation.md +17 -2
  133. package/docs/document-lifecycle.md +6 -2
  134. package/docs/platform-capabilities.md +63 -16
  135. package/docs/platform-compatibility.json +5 -5
  136. package/harness-everything/SKILL.md +1 -1
  137. package/harness-everything/scripts/routing-keywords.json +0 -2
  138. package/harness-everything/scripts/tier-router.js +105 -11
  139. package/hooks/hooks.json +0 -46
  140. package/hooks/scripts/lib/workflow-obligations.js +0 -55
  141. package/hooks/scripts/state-persist.js +7 -95
  142. package/hooks/scripts/workflow-disposition.js +0 -2
  143. package/hooks/scripts/workflow-stop-gate.js +17 -30
  144. package/opencode-plugin/index.mjs +6 -70
  145. package/opencode-plugin/plugin.json +1 -1
  146. package/package.json +1 -1
  147. package/plugins/harness-everything/.antigravity-plugin/plugin.json +1 -1
  148. package/plugins/harness-everything/.codex-plugin/plugin.json +1 -1
  149. package/plugins/harness-everything/hooks/scripts/lib/workflow-obligations.js +0 -55
  150. package/plugins/harness-everything/hooks/scripts/state-persist.js +7 -95
  151. package/plugins/harness-everything/hooks/scripts/workflow-disposition.js +0 -2
  152. package/plugins/harness-everything/hooks/scripts/workflow-stop-gate.js +17 -30
  153. package/plugins/harness-everything/plugin.json +1 -1
  154. package/plugins/harness-everything/rules/AGENTS.md +1 -1
  155. package/plugins/harness-everything/skills/harness-everything/SKILL.md +1 -1
  156. package/plugins/harness-everything/skills/harness-everything/scripts/routing-keywords.json +0 -2
  157. package/plugins/harness-everything/skills/harness-everything/scripts/tier-router.js +105 -11
  158. package/sbom.cdx.json +7 -7
  159. package/ci/fixtures/doc-obligations/reconciliation-s1/cases.json +0 -6854
  160. package/ci/fixtures/doc-obligations/reconciliation-s1/fail-session-writes.js +0 -116
  161. package/ci/fixtures/doc-obligations/reconciliation-s2a/harness.js +0 -507
  162. package/ci/fixtures/doc-obligations/reconciliation-s2a/run13-workflow-requirements.json +0 -42
  163. package/ci/fixtures/doc-obligations/reconciliation-s2a/vectors.json +0 -617
  164. package/ci/fixtures/doc-obligations/reconciliation-s2b/capture/harness.js +0 -415
  165. package/ci/fixtures/doc-obligations/reconciliation-s2b/capture/payload-post-tool-use-success-minimal.json +0 -9
  166. package/ci/fixtures/doc-obligations/reconciliation-s2b/capture/payload-subagent-start.json +0 -7
  167. package/ci/fixtures/doc-obligations/reconciliation-s2b/capture/payload-subagent-stop-freetext-reject.json +0 -11
  168. package/ci/fixtures/doc-obligations/reconciliation-s2b/capture/payload-subagent-stop-reject.json +0 -11
  169. package/ci/fixtures/doc-obligations/reconciliation-s2b/capture/payload-subagent-stop.json +0 -11
  170. package/ci/fixtures/doc-obligations/reconciliation-s2b/capture/payload-task-result.json +0 -19
  171. package/ci/fixtures/doc-obligations/reconciliation-s2b/corpus/off-capture-only.json +0 -99
  172. package/ci/fixtures/doc-obligations/reconciliation-s2b/corpus/off-legacy.json +0 -67
  173. package/ci/fixtures/doc-obligations/reconciliation-s2b/corpus/on-concurrent-writers.json +0 -62
  174. package/ci/fixtures/doc-obligations/reconciliation-s2b/corpus/on-lookalikes-runtime-mutations.json +0 -67
  175. package/ci/fixtures/doc-obligations/reconciliation-s2b/corpus/on-malformed.json +0 -85
  176. package/ci/fixtures/doc-obligations/reconciliation-s2b/corpus/on-normal-session.json +0 -74
  177. package/ci/fixtures/doc-obligations/reconciliation-s2b/corpus/on-runtime-drift-later-npm-test.json +0 -58
  178. package/ci/fixtures/doc-obligations/reconciliation-s2b/corpus/on-valid-direct-quoted-review.json +0 -85
  179. package/ci/fixtures/doc-obligations/reconciliation-s2b/f4/cases.json +0 -2267
  180. package/ci/fixtures/doc-obligations/reconciliation-s2b/wiring/cases.json +0 -1110
  181. package/ci/lib/doc-reconciliation-file-spy.js +0 -23
  182. package/ci/lib/doc-reconciliation-qualification-preload.js +0 -37
  183. package/ci/lib/doc-reconciliation-replay.js +0 -104
  184. package/ci/lib/doc-reconciliation-staged-tree.js +0 -102
  185. package/ci/mechanism-325-3b-h1-qualification.test.js +0 -206
  186. package/ci/mechanism-325-3b-s1.test.js +0 -188
  187. package/ci/mechanism-325-3b-s2a-core.test.js +0 -840
  188. package/ci/mechanism-325-3b-s2a-producer.test.js +0 -564
  189. package/ci/mechanism-325-3b-s2b-capture.test.js +0 -566
  190. package/ci/mechanism-325-3b-s2b-wiring.test.js +0 -679
  191. package/ci/mechanism-325-f4-invariants.test.js +0 -606
  192. package/ci/mechanism-325-f4-projections.test.js +0 -392
  193. package/ci/mechanism-325-f4-qualification.test.js +0 -228
  194. package/ci/mechanism-325-f4-trust-boundary.test.js +0 -880
  195. package/ci/mechanism-e1-dependency-artifact-scope.test.js +0 -657
  196. package/hooks/scripts/lib/doc-reconciliation-capture.sanitized.jsonl +0 -26
  197. package/hooks/scripts/lib/doc-reconciliation-core.js +0 -336
  198. package/hooks/scripts/lib/doc-reconciliation-events.js +0 -292
  199. package/hooks/scripts/lib/doc-reconciliation-outline-capture.sanitized.jsonl +0 -24
  200. package/hooks/scripts/lib/doc-reconciliation-pilot.js +0 -482
  201. package/hooks/scripts/lib/doc-reconciliation-producer.js +0 -468
  202. package/hooks/scripts/lib/doc-reconciliation-provider.js +0 -3304
  203. package/hooks/scripts/lib/doc-reconciliation-qualification.json +0 -54
  204. package/hooks/scripts/w6-state-operations.js +0 -239
  205. package/plugins/harness-everything/hooks/scripts/lib/doc-reconciliation-capture.sanitized.jsonl +0 -26
  206. package/plugins/harness-everything/hooks/scripts/lib/doc-reconciliation-core.js +0 -336
  207. package/plugins/harness-everything/hooks/scripts/lib/doc-reconciliation-events.js +0 -292
  208. package/plugins/harness-everything/hooks/scripts/lib/doc-reconciliation-outline-capture.sanitized.jsonl +0 -24
  209. package/plugins/harness-everything/hooks/scripts/lib/doc-reconciliation-pilot.js +0 -482
  210. package/plugins/harness-everything/hooks/scripts/lib/doc-reconciliation-producer.js +0 -468
  211. package/plugins/harness-everything/hooks/scripts/lib/doc-reconciliation-provider.js +0 -3304
  212. package/plugins/harness-everything/hooks/scripts/lib/doc-reconciliation-qualification.json +0 -54
  213. package/plugins/harness-everything/hooks/scripts/w6-state-operations.js +0 -239
  214. package/scripts/system-one-eval-laya.js +0 -112
  215. /package/ci/fixtures/{doc-obligations/reconciliation-s2b/capture → state-persist-post-tool-use}/payload-post-tool-use-failure.json +0 -0
  216. /package/ci/fixtures/{doc-obligations/reconciliation-s2b/wiring → workflow-contract}/legacy-off-golden.json +0 -0
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
3
 
4
- // Deterministic mechanism evidence: these checks use synthetic host envelopes,
5
- // not a live Claude capture. The packet's throwaway-clone witness covers pilot.assess.
4
+ // Deterministic mechanism evidence: exercises the surviving doc-check.js and doc-lifecycle.js
5
+ // CLI paths for --derived-view generation, comparison, and plain-check firebreak.
6
6
  const assert = require('node:assert/strict');
7
7
  const crypto = require('node:crypto');
8
8
  const fs = require('node:fs');
@@ -19,11 +19,6 @@ const VIEW = 'docs/governed-index.md';
19
19
  const GENERATOR = 'node harness-everything/scripts/doc-lifecycle.js index --workspace . --config ' + CONFIG + ' --all';
20
20
  const roots = [];
21
21
  const sha = bytes => crypto.createHash('sha256').update(bytes).digest('hex');
22
- const provider = () => require(path.join(ROOT, 'hooks/scripts/lib/doc-reconciliation-provider.js'));
23
- const producer = () => require(path.join(ROOT, 'hooks/scripts/lib/doc-reconciliation-producer.js'));
24
- const events = () => require(path.join(ROOT, 'hooks/scripts/lib/doc-reconciliation-events.js'));
25
- const core = () => require(path.join(ROOT, 'hooks/scripts/lib/doc-reconciliation-core.js'));
26
- const pilot = () => require(path.join(ROOT, 'hooks/scripts/lib/doc-reconciliation-pilot.js'));
27
22
 
28
23
  function write(root, relative, bytes) {
29
24
  const file = path.join(root, relative);
@@ -61,35 +56,6 @@ function getReport(result) {
61
56
  return JSON.parse(result.stdout);
62
57
  }
63
58
 
64
- function capture(root, result) {
65
- const command = 'node ' + CHECK + ' check --workspace ' + root + ' --config ' + CONFIG
66
- + ' --changed-path ' + SOURCE + ' --derived-view ' + VIEW;
67
- const record = provider().buildCaptureRecord({
68
- cwd: root, session_id: 'synthetic-author', tool_name: 'Bash', tool_use_id: 'derived-check',
69
- tool_input: { command }, tool_response: { stdout: result.stdout, interrupted: false },
70
- }, 'PostToolUse', root);
71
- record.observedIdentity = { workflowId: 'e1-test', workflowRevision: 1,
72
- baselinePin: { commit: 'd'.repeat(40), root } };
73
- return record;
74
- }
75
-
76
- function resolveDerived(root, record) {
77
- const providerModule = provider();
78
- const identity = {
79
- workspaceId: 'ws-e1-test', sessionId: record.session_id, workflowId: 'e1-test', workflowRevision: 1,
80
- taskId: 'task-e1-test', taskScopeDigest: '1'.repeat(64), baselineDigest: '2'.repeat(64),
81
- candidateDigest: '3'.repeat(64), configDigest: '4'.repeat(64), prdRoot: 'docs/prd/',
82
- };
83
- const origin = providerModule.createClaudeOriginProvider({
84
- hostId: 'claude-code', sessionId: record.session_id, workspaceRoot: root,
85
- workflowId: identity.workflowId, workflowRevision: identity.workflowRevision, taskId: identity.taskId,
86
- principals: { author: record.session_id, executors: [record.session_id] },
87
- baseline: { commit: 'd'.repeat(40), root }, captures: [record],
88
- qualification: { source: 'fake-test-fixture', faked: true, ref: 'e1-test', toolUseIdPopulated: true, agentIdPopulated: true },
89
- });
90
- return origin.resolveEvent({ reference: record.ref + '#derived-regenerate', identity });
91
- }
92
-
93
59
  function git(root, args) {
94
60
  const result = spawnSync('git', ['-C', root, ...args], { encoding: 'utf8' });
95
61
  assert.equal(result.status, 0, 'temporary Git fixture setup must succeed');
@@ -140,93 +106,6 @@ function wholeSeam() {
140
106
  const projection = report.capabilities['derived-regenerate'];
141
107
  assert.equal(projection.state, 'pass');
142
108
  assert.deepEqual(projection.checkedPaths, [VIEW]);
143
-
144
- const providerModule = provider();
145
- const sessionId = 'synthetic-author';
146
- const workflowId = 'e1-whole-seam';
147
- const workflowRevision = 1;
148
- const taskId = 'task-req-e1-derived';
149
- const requirements = [{ id: 'req-e1-derived', summary: 'Regenerate the governed view', acceptance: 'the derived view matches the current source' }];
150
- const qualification = { source: 'fake-test-fixture', faked: true, ref: 'e1-whole-seam',
151
- toolUseIdPopulated: true, agentIdPopulated: true };
152
- const command = 'node ' + CHECK + ' check --workspace ' + project.root + ' --config ' + CONFIG
153
- + ' --changed-path ' + SOURCE + ' --derived-view ' + VIEW;
154
- const record = providerModule.buildCaptureRecord({
155
- cwd: project.root, session_id: sessionId, hook_event_name: 'PostToolUse', tool_name: 'Bash', tool_use_id: 'synthetic-derived-check',
156
- tool_input: { command }, tool_response: { stdout: checked.stdout, interrupted: false },
157
- }, 'PostToolUse', project.root);
158
- assert.ok(record, 'synthetic host envelope must yield a captured check record');
159
- record.observedIdentity = { workflowId, workflowRevision,
160
- baselinePin: { commit: project.baselineCommit, root: project.root } };
161
-
162
- const origin = providerModule.createClaudeOriginProvider({
163
- hostId: 'claude-code', sessionId, workspaceRoot: project.root, workflowId, workflowRevision, taskId,
164
- principals: { author: sessionId, executors: [sessionId] },
165
- baseline: { commit: project.baselineCommit, root: project.root }, captures: [record], qualification,
166
- });
167
- const produced = producer().produceDocSnapshot({
168
- workspaceRoot: project.root, baseline: { commit: project.baselineCommit, root: project.root },
169
- workflow: { workflowId, sessionId, workflowRevision }, task: { taskId, requirements },
170
- scope: { prdRoot: 'docs/prd/' }, activeHost: 'claude-code', prdRoot: 'docs/prd/',
171
- }, { originProvider: origin });
172
- assert.equal(produced.state, 'ready', 'production snapshot collector must produce a current snapshot');
173
- const snapshot = produced.snapshot;
174
- const obligation = snapshot.obligations.find(item => item.capability === 'derived-regenerate');
175
- assert.ok(obligation, 'derived-regenerate must derive from the real baseline and candidate bytes');
176
- assert.equal(obligation.id, 'doc-change:derived-regenerate');
177
- assert.equal(obligation.strength, 'MUST');
178
- assert.equal(obligation.applicability, 'applicable', 'derived-regenerate must not disappear as N/A');
179
- assert.deepEqual(obligation.scope, { paths: [VIEW] });
180
-
181
- const reference = record.ref + '#derived-regenerate';
182
- const accepted = events().acceptDocEvents({ snapshot, eventRefs: [reference] }, { originProvider: origin });
183
- assert.equal(accepted.state, 'ready', 'production adapter must accept the derived check reference');
184
- const acceptedRecord = accepted.acceptedIndex[reference];
185
- assert.ok(acceptedRecord, 'exact derived check reference must reach the adapter');
186
- assert.equal(acceptedRecord.obligationId, obligation.id);
187
- assert.deepEqual(acceptedRecord.paths, obligation.scope.paths);
188
- assert.deepEqual(acceptedRecord.identity, snapshot.identity, 'accepted reference must bind the current snapshot identity');
189
- assert.deepEqual(acceptedRecord.event.startIdentity, snapshot.identity);
190
- assert.deepEqual(acceptedRecord.event.endIdentity, snapshot.identity);
191
- assert.equal(acceptedRecord.event.derivedBinding.candidateDigest, snapshot.identity.candidateDigest);
192
-
193
- const checkedEvidence = core().checkAcceptedDocEvidence({ snapshot, accepted, mode: 'verification' });
194
- const derivedResult = checkedEvidence.results.find(item => item.obligationId === obligation.id);
195
- assert.ok(checkedEvidence.checkedMustIds.includes(obligation.id), 'the exact derived MUST must reach reconciliation');
196
- assert.equal(derivedResult.observation, 'observed');
197
- assert.equal(derivedResult.outcome, 'pass');
198
- assert.ok(derivedResult.recordRefs.includes(reference));
199
- assert.ok(!checkedEvidence.unsatisfied.some(item => item.obligationId === obligation.id));
200
-
201
- const sessionDir = fs.mkdtempSync(path.join(os.tmpdir(), 'e1-derived-session-'));
202
- roots.push(sessionDir);
203
- providerModule.writeImmutableEvent(sessionDir, record);
204
- providerModule.rebuildJournalView(sessionDir);
205
- const context = { root: project.root, sessionId, sessionDir, activeHost: 'claude-code', workflow: {
206
- workflowId, revision: workflowRevision, strategy: 'iterative-single', state: 'running',
207
- docReconciliationBaseline: { root: project.root, commit: project.baselineCommit, tree: project.baselineTree },
208
- } };
209
- const set = { strategy: 'iterative-single', stepBindingsEnabled: true, requirements };
210
- const previousSwitch = process.env.HARNESS_DOC_RECONCILIATION_PILOT;
211
- const originalFactory = providerModule.createClaudeOriginProvider;
212
- providerModule.createClaudeOriginProvider = input => originalFactory({ ...input, qualification });
213
- process.env.HARNESS_DOC_RECONCILIATION_PILOT = '1';
214
- try {
215
- const pilotResult = pilot().assess(context, set);
216
- assert.ok(pilotResult.report.expectedMustIds.includes(obligation.id), 'pilot must retain the exact derived MUST in its expected set');
217
- assert.ok(!pilotResult.report.unsatisfied.some(item => item.obligationId === obligation.id),
218
- 'pilot consumer must observe the passing derived MUST');
219
-
220
- fs.appendFileSync(path.join(project.root, VIEW), '\nmanual stale edit\n');
221
- const stalePilot = pilot().assess(context, set);
222
- assert.ok(stalePilot.report.expectedMustIds.includes(obligation.id), 'stale view must remain an expected derived MUST');
223
- assert.ok(stalePilot.report.unsatisfied.some(item => item.obligationId === obligation.id),
224
- 'consumer-level stale target negative must withhold the derived MUST');
225
- } finally {
226
- providerModule.createClaudeOriginProvider = originalFactory;
227
- if (previousSwitch === undefined) delete process.env.HARNESS_DOC_RECONCILIATION_PILOT;
228
- else process.env.HARNESS_DOC_RECONCILIATION_PILOT = previousSwitch;
229
- }
230
109
  }
231
110
 
232
111
  try {
@@ -244,89 +123,49 @@ try {
244
123
  const projection = getReport(derived).capabilities['derived-regenerate'];
245
124
  assert.equal(projection?.state, 'pass', 'pre-repair primary RED: derived result must reach the passing obligation assertion');
246
125
  } else {
247
- const providerModule = provider();
248
- const invocationCommand = 'node ' + CHECK + ' check --workspace ' + ROOT + ' --config ' + CONFIG
249
- + ' --changed-path docs/doc-workflow-reconciliation.md --derived-view ' + VIEW;
250
- const invocation = providerModule.resolveDocCheckInvocation(invocationCommand, ROOT);
251
- assert.equal(invocation.kind, 'accepted', 'registered derived invocation rejected: ' + invocation.reason);
252
- assert.equal(invocation.derivedView, VIEW);
253
-
254
- const matching = fixture();
255
- const matchingBytes = fs.readFileSync(path.join(matching, VIEW));
256
- const matchingRun = runCheck(matching);
257
- assert.equal(matchingRun.status, 0, matchingRun.stderr);
258
- const matchingReport = getReport(matchingRun);
259
- const positive = matchingReport.capabilities['derived-regenerate'];
260
- assert.equal(positive.state, 'pass');
261
- assert.deepEqual(positive.checkedPaths, [VIEW]);
262
- assert.equal(positive.binding.generation.state, 'pass');
263
- assert.equal(positive.binding.comparison.state, 'equal');
264
- assert.equal(positive.binding.generation.outputDigest, sha(matchingBytes));
265
- assert.equal(positive.binding.comparison.targetDigest, sha(matchingBytes));
266
- assert.equal(positive.binding.sourceCorpus.complete, true);
267
- assert.deepEqual(positive.binding.sourceCorpus.paths, [SOURCE]);
268
- assert.equal(positive.binding.config.digest, sha(fs.readFileSync(path.join(matching, CONFIG))));
269
- assert.equal(matchingReport.coverage.unsupported.some(item => item.path === VIEW), false);
270
- const captured = capture(matching, matchingRun);
271
- assert.equal(captured.implementationDigest, providerModule.SHIPPED_DOC_CHECK_DIGEST);
272
- assert.equal(captured.observedDerivedDigests[SOURCE], positive.binding.sourceCorpus.digests[SOURCE]);
273
- assert.equal(captured.observedDerivedDigests[VIEW], positive.binding.comparison.targetDigest);
274
- assert.deepEqual(captured.observedDerivedConfigSources, positive.binding.config.sources);
275
- const positiveResolution = resolveDerived(matching, captured);
276
- assert.equal(positiveResolution.status, 'accepted', JSON.stringify(positiveResolution.diagnostics));
277
-
278
- const stale = fixture();
279
- const staleTarget = path.join(stale, VIEW);
280
- fs.appendFileSync(staleTarget, '\nmanual stale edit\n');
281
- const staleBefore = fs.readFileSync(staleTarget);
282
- const staleRun = runCheck(stale);
283
- assert.equal(staleRun.status, 0, staleRun.stderr);
284
- const staleProjection = getReport(staleRun).capabilities['derived-regenerate'];
285
- assert.equal(staleProjection.state, 'stale');
286
- assert.equal(staleProjection.binding.generation.state, 'pass');
287
- assert.equal(staleProjection.binding.comparison.state, 'stale');
288
- assert.deepEqual(fs.readFileSync(staleTarget), staleBefore, 'stale target must not be rewritten');
289
-
290
- const unsupportedMarker = 'GENERATOR_MUST_NOT_RUN';
291
- const unsupportedGenerator = 'node -e ' + JSON.stringify('require("fs").writeFileSync("' + unsupportedMarker + '","ran")');
292
- const unsupported = fixture(unsupportedGenerator);
293
- const unsupportedRun = runCheck(unsupported);
294
- const unsupportedProjection = getReport(unsupportedRun).capabilities['derived-regenerate'];
295
- assert.equal(unsupportedProjection.state, 'unsupported');
296
- assert.equal(fs.existsSync(path.join(unsupported, unsupportedMarker)), false, 'configured text must never be executed');
297
-
298
- const changedAfterCheck = fixture();
299
- const changedRun = runCheck(changedAfterCheck);
300
- const changedBinding = getReport(changedRun).capabilities['derived-regenerate'].binding;
301
- fs.appendFileSync(path.join(changedAfterCheck, SOURCE), '\nchanged after check\n');
302
- const changedCapture = capture(changedAfterCheck, changedRun);
303
- assert.notEqual(changedCapture.observedDerivedDigests[SOURCE], changedBinding.sourceCorpus.digests[SOURCE]);
304
- const changedResponse = resolveDerived(changedAfterCheck, changedCapture);
305
- assert.equal(changedResponse.status, 'rejected');
306
- assert.ok(changedResponse.diagnostics.some(item => item.code === 'derived-input-changed-after-check'));
307
-
308
- const configChanged = fixture();
309
- const configRun = runCheck(configChanged);
310
- fs.appendFileSync(path.join(configChanged, CONFIG), '\n');
311
- const configCapture = capture(configChanged, configRun);
312
- const configResponse = resolveDerived(configChanged, configCapture);
313
- assert.equal(configResponse.status, 'rejected');
314
- assert.ok(configResponse.diagnostics.some(item => item.code === 'derived-input-changed-after-check'));
315
-
316
- const targetChanged = fixture();
317
- const targetRun = runCheck(targetChanged);
318
- fs.appendFileSync(path.join(targetChanged, VIEW), '\nchanged after check\n');
319
- const targetCapture = capture(targetChanged, targetRun);
320
- const targetResponse = resolveDerived(targetChanged, targetCapture);
321
- assert.equal(targetResponse.status, 'rejected');
322
- assert.ok(targetResponse.diagnostics.some(item => item.code === 'derived-input-changed-after-check'));
323
-
324
- const plain = runCheck(matching, false);
325
- assert.equal(plain.status, 0, plain.stderr);
326
- assert.equal(getReport(plain).capabilities['derived-regenerate'], undefined);
327
-
328
- wholeSeam();
329
- console.log('PASS E1 registered invocation, producer-to-pilot derived MUST seam, consumer stale negative, bound generation, provider negatives, and plain-check firebreak (deterministic mechanism evidence)');
126
+ const matching = fixture();
127
+ const matchingBytes = fs.readFileSync(path.join(matching, VIEW));
128
+ const matchingRun = runCheck(matching);
129
+ assert.equal(matchingRun.status, 0, matchingRun.stderr);
130
+ const matchingReport = getReport(matchingRun);
131
+ const positive = matchingReport.capabilities['derived-regenerate'];
132
+ assert.equal(positive.state, 'pass');
133
+ assert.deepEqual(positive.checkedPaths, [VIEW]);
134
+ assert.equal(positive.binding.generation.state, 'pass');
135
+ assert.equal(positive.binding.comparison.state, 'equal');
136
+ assert.equal(positive.binding.generation.outputDigest, sha(matchingBytes));
137
+ assert.equal(positive.binding.comparison.targetDigest, sha(matchingBytes));
138
+ assert.equal(positive.binding.sourceCorpus.complete, true);
139
+ assert.deepEqual(positive.binding.sourceCorpus.paths, [SOURCE]);
140
+ assert.equal(positive.binding.config.digest, sha(fs.readFileSync(path.join(matching, CONFIG))));
141
+ assert.equal(matchingReport.coverage.unsupported.some(item => item.path === VIEW), false);
142
+
143
+ const stale = fixture();
144
+ const staleTarget = path.join(stale, VIEW);
145
+ fs.appendFileSync(staleTarget, '\nmanual stale edit\n');
146
+ const staleBefore = fs.readFileSync(staleTarget);
147
+ const staleRun = runCheck(stale);
148
+ assert.equal(staleRun.status, 0, staleRun.stderr);
149
+ const staleProjection = getReport(staleRun).capabilities['derived-regenerate'];
150
+ assert.equal(staleProjection.state, 'stale');
151
+ assert.equal(staleProjection.binding.generation.state, 'pass');
152
+ assert.equal(staleProjection.binding.comparison.state, 'stale');
153
+ assert.deepEqual(fs.readFileSync(staleTarget), staleBefore, 'stale target must not be rewritten');
154
+
155
+ const unsupportedMarker = 'GENERATOR_MUST_NOT_RUN';
156
+ const unsupportedGenerator = 'node -e ' + JSON.stringify('require("fs").writeFileSync("' + unsupportedMarker + '","ran")');
157
+ const unsupported = fixture(unsupportedGenerator);
158
+ const unsupportedRun = runCheck(unsupported);
159
+ const unsupportedProjection = getReport(unsupportedRun).capabilities['derived-regenerate'];
160
+ assert.equal(unsupportedProjection.state, 'unsupported');
161
+ assert.equal(fs.existsSync(path.join(unsupported, unsupportedMarker)), false, 'configured text must never be executed');
162
+
163
+ const plain = runCheck(matching, false);
164
+ assert.equal(plain.status, 0, plain.stderr);
165
+ assert.equal(getReport(plain).capabilities['derived-regenerate'], undefined);
166
+
167
+ wholeSeam();
168
+ console.log('PASS E1 derived-regenerate CLI bound generation, stale/unsupported negatives, Git fixture plain/derived controls, and plain-check firebreak (deterministic mechanism evidence)');
330
169
  }
331
170
  } finally {
332
171
  for (const root of roots) fs.rmSync(root, { recursive: true, force: true });
@@ -6,7 +6,6 @@ const fs = require('node:fs');
6
6
  const os = require('node:os');
7
7
  const path = require('node:path');
8
8
  const { spawnSync } = require('node:child_process');
9
- const { _internals: providerInternals } = require('../hooks/scripts/lib/doc-reconciliation-provider');
10
9
 
11
10
  const ROOT = path.resolve(__dirname, '..');
12
11
  const SANITIZER = path.join(ROOT, 'benchmarks/results/live-host/claude-341-outline-dispatch-2026-10-28/sanitize-outline-capture.js');
@@ -66,13 +65,6 @@ try {
66
65
  assert.ok(mapped.every(token => token.length > 0 && !/\s/.test(token)), 'synthetic marker tokens must be nonempty and whitespace-free');
67
66
  assert.equal(mapped[0], mapped[1], 'equal originals must map to equal placeholders');
68
67
  assert.notEqual(mapped[0], mapped[2], 'different originals must map to distinct placeholders');
69
- for (const record of records) {
70
- for (const value of [record.tool_input?.prompt, record.tool_response?.stdout].filter(Boolean)) {
71
- for (const line of value.split(/\r?\n/).filter(line => line.startsWith('HARNESS_OUTLINE_DISPATCH_V1 '))) {
72
- assert.ok(providerInternals.parseOutlineDispatchPrompt(line), 'sanitized marker must retain the production parser grammar');
73
- }
74
- }
75
- }
76
68
  console.log('PASS sanitizer replaces repeated and overlapping marker tokens in nested exported strings');
77
69
  } finally {
78
70
  fs.rmSync(dir, { recursive: true, force: true });