harness-everything 1.3.0 → 1.3.1

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 (125) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +6 -0
  4. package/ci/archive/325-prep/README.md +9 -2
  5. package/ci/archive/325-prep/doc-reconciliation-red.js +34 -8
  6. package/ci/fixtures/553-t2a/body-edit/base/.agents/harness-everything/project-docs.json +11 -0
  7. package/ci/fixtures/553-t2a/body-edit/base/docs/a.md +6 -0
  8. package/ci/fixtures/553-t2a/body-edit/base/docs/b.md +1 -0
  9. package/ci/fixtures/553-t2a/body-edit/candidate/docs/a.md +6 -0
  10. package/ci/fixtures/553-t2c/derived-regenerate-must/base/docs/adr/EVID-001-verify-all-evidence.md +11 -0
  11. package/ci/fixtures/553-t2c/derived-regenerate-must/base/docs/governed-index.md +19 -0
  12. package/ci/fixtures/553-t2c/derived-regenerate-must/candidate/docs/adr/EVID-001-verify-all-evidence.md +11 -0
  13. package/ci/fixtures/553-t2c/derived-regenerate-must/candidate/docs/governed-index.md +19 -0
  14. package/ci/fixtures/553-t2c/derived-regenerate-must/config.json +17 -0
  15. package/ci/fixtures/doc-obligations/derive/regression-pins.json +153 -0
  16. package/ci/fixtures/state-persist-post-tool-use/harness.js +206 -0
  17. package/ci/fixtures/state-persist-post-tool-use/off-handoff-golden.json +16 -0
  18. package/ci/fixtures/state-persist-post-tool-use/payload-post-tool-use-success.json +13 -0
  19. package/ci/fixtures/stop/fail-session-writes.js +109 -0
  20. package/ci/fixtures/workflow-contract/cases.json +3355 -0
  21. package/ci/fixtures/workflow-contract/wiring-cases.json +560 -0
  22. package/ci/lib/doc-reconciliation-prep-fixtures.js +4 -9
  23. package/ci/mechanism-2an-workflow-replay.test.js +324 -0
  24. package/ci/mechanism-2ax-doc-lifecycle.test.js +132 -0
  25. package/ci/mechanism-325-3a-doc-evidence.test.js +73 -0
  26. package/ci/mechanism-325-3a-doc-obligations.test.js +61 -0
  27. package/ci/mechanism-325-3b-preparation.test.js +208 -49
  28. package/ci/mechanism-325-3b-s1-review.test.js +20 -828
  29. package/ci/mechanism-325-3b-s3-providers.test.js +59 -0
  30. package/ci/mechanism-325-f3-derived-views.test.js +140 -0
  31. package/ci/mechanism-341-opencode-lane.test.js +164 -284
  32. package/ci/mechanism-35-verification-contract.test.js +246 -0
  33. package/ci/mechanism-365-step-edit-accounting.test.js +5 -6
  34. package/ci/mechanism-383-doc-glob-line-terminators.test.js +0 -30
  35. package/ci/mechanism-397-opencode-observations.test.js +151 -18
  36. package/ci/mechanism-553-e1-unhook-credit.test.js +328 -0
  37. package/ci/mechanism-553-p2a-claude-hooks.test.js +98 -0
  38. package/ci/mechanism-553-p3-plan-start.test.js +212 -0
  39. package/ci/mechanism-553-state-persist-post-tool-use.test.js +307 -0
  40. package/ci/mechanism-553-stop.test.js +427 -0
  41. package/ci/mechanism-553-t2a-derive.test.js +110 -0
  42. package/ci/mechanism-553-t2c-derive.test.js +94 -0
  43. package/ci/mechanism-e1-derived-regenerate.test.js +45 -206
  44. package/ci/mechanism-outline-sanitizer.test.js +0 -8
  45. package/ci/mechanism-pr-a-conflict-check.test.js +38 -305
  46. package/ci/mechanism-prb-outline-review.test.js +101 -3283
  47. package/docs/adr/DOCS-006-reconciliation-pilot.md +4 -2
  48. package/docs/adr/DOCS-008-obligation-abstraction-bounded-consumer.md +3 -3
  49. package/docs/doc-workflow-reconciliation.md +17 -2
  50. package/docs/document-lifecycle.md +6 -2
  51. package/docs/platform-capabilities.md +35 -5
  52. package/hooks/hooks.json +0 -46
  53. package/hooks/scripts/lib/workflow-obligations.js +0 -55
  54. package/hooks/scripts/state-persist.js +7 -95
  55. package/hooks/scripts/workflow-disposition.js +0 -2
  56. package/hooks/scripts/workflow-stop-gate.js +17 -30
  57. package/opencode-plugin/index.mjs +6 -70
  58. package/opencode-plugin/plugin.json +1 -1
  59. package/package.json +1 -1
  60. package/plugins/harness-everything/.antigravity-plugin/plugin.json +1 -1
  61. package/plugins/harness-everything/.codex-plugin/plugin.json +1 -1
  62. package/plugins/harness-everything/hooks/scripts/lib/workflow-obligations.js +0 -55
  63. package/plugins/harness-everything/hooks/scripts/state-persist.js +7 -95
  64. package/plugins/harness-everything/hooks/scripts/workflow-disposition.js +0 -2
  65. package/plugins/harness-everything/hooks/scripts/workflow-stop-gate.js +17 -30
  66. package/plugins/harness-everything/plugin.json +1 -1
  67. package/sbom.cdx.json +7 -7
  68. package/ci/fixtures/doc-obligations/reconciliation-s1/cases.json +0 -6854
  69. package/ci/fixtures/doc-obligations/reconciliation-s1/fail-session-writes.js +0 -116
  70. package/ci/fixtures/doc-obligations/reconciliation-s2a/harness.js +0 -507
  71. package/ci/fixtures/doc-obligations/reconciliation-s2a/run13-workflow-requirements.json +0 -42
  72. package/ci/fixtures/doc-obligations/reconciliation-s2a/vectors.json +0 -617
  73. package/ci/fixtures/doc-obligations/reconciliation-s2b/capture/harness.js +0 -415
  74. package/ci/fixtures/doc-obligations/reconciliation-s2b/capture/payload-post-tool-use-success-minimal.json +0 -9
  75. package/ci/fixtures/doc-obligations/reconciliation-s2b/capture/payload-subagent-start.json +0 -7
  76. package/ci/fixtures/doc-obligations/reconciliation-s2b/capture/payload-subagent-stop-freetext-reject.json +0 -11
  77. package/ci/fixtures/doc-obligations/reconciliation-s2b/capture/payload-subagent-stop-reject.json +0 -11
  78. package/ci/fixtures/doc-obligations/reconciliation-s2b/capture/payload-subagent-stop.json +0 -11
  79. package/ci/fixtures/doc-obligations/reconciliation-s2b/capture/payload-task-result.json +0 -19
  80. package/ci/fixtures/doc-obligations/reconciliation-s2b/corpus/off-capture-only.json +0 -99
  81. package/ci/fixtures/doc-obligations/reconciliation-s2b/corpus/off-legacy.json +0 -67
  82. package/ci/fixtures/doc-obligations/reconciliation-s2b/corpus/on-concurrent-writers.json +0 -62
  83. package/ci/fixtures/doc-obligations/reconciliation-s2b/corpus/on-lookalikes-runtime-mutations.json +0 -67
  84. package/ci/fixtures/doc-obligations/reconciliation-s2b/corpus/on-malformed.json +0 -85
  85. package/ci/fixtures/doc-obligations/reconciliation-s2b/corpus/on-normal-session.json +0 -74
  86. package/ci/fixtures/doc-obligations/reconciliation-s2b/corpus/on-runtime-drift-later-npm-test.json +0 -58
  87. package/ci/fixtures/doc-obligations/reconciliation-s2b/corpus/on-valid-direct-quoted-review.json +0 -85
  88. package/ci/fixtures/doc-obligations/reconciliation-s2b/f4/cases.json +0 -2267
  89. package/ci/fixtures/doc-obligations/reconciliation-s2b/wiring/cases.json +0 -1110
  90. package/ci/lib/doc-reconciliation-file-spy.js +0 -23
  91. package/ci/lib/doc-reconciliation-qualification-preload.js +0 -37
  92. package/ci/lib/doc-reconciliation-replay.js +0 -104
  93. package/ci/lib/doc-reconciliation-staged-tree.js +0 -102
  94. package/ci/mechanism-325-3b-h1-qualification.test.js +0 -206
  95. package/ci/mechanism-325-3b-s1.test.js +0 -188
  96. package/ci/mechanism-325-3b-s2a-core.test.js +0 -840
  97. package/ci/mechanism-325-3b-s2a-producer.test.js +0 -564
  98. package/ci/mechanism-325-3b-s2b-capture.test.js +0 -566
  99. package/ci/mechanism-325-3b-s2b-wiring.test.js +0 -679
  100. package/ci/mechanism-325-f4-invariants.test.js +0 -606
  101. package/ci/mechanism-325-f4-projections.test.js +0 -392
  102. package/ci/mechanism-325-f4-qualification.test.js +0 -228
  103. package/ci/mechanism-325-f4-trust-boundary.test.js +0 -880
  104. package/ci/mechanism-e1-dependency-artifact-scope.test.js +0 -657
  105. package/hooks/scripts/lib/doc-reconciliation-capture.sanitized.jsonl +0 -26
  106. package/hooks/scripts/lib/doc-reconciliation-core.js +0 -336
  107. package/hooks/scripts/lib/doc-reconciliation-events.js +0 -292
  108. package/hooks/scripts/lib/doc-reconciliation-outline-capture.sanitized.jsonl +0 -24
  109. package/hooks/scripts/lib/doc-reconciliation-pilot.js +0 -482
  110. package/hooks/scripts/lib/doc-reconciliation-producer.js +0 -468
  111. package/hooks/scripts/lib/doc-reconciliation-provider.js +0 -3304
  112. package/hooks/scripts/lib/doc-reconciliation-qualification.json +0 -54
  113. package/hooks/scripts/w6-state-operations.js +0 -239
  114. package/plugins/harness-everything/hooks/scripts/lib/doc-reconciliation-capture.sanitized.jsonl +0 -26
  115. package/plugins/harness-everything/hooks/scripts/lib/doc-reconciliation-core.js +0 -336
  116. package/plugins/harness-everything/hooks/scripts/lib/doc-reconciliation-events.js +0 -292
  117. package/plugins/harness-everything/hooks/scripts/lib/doc-reconciliation-outline-capture.sanitized.jsonl +0 -24
  118. package/plugins/harness-everything/hooks/scripts/lib/doc-reconciliation-pilot.js +0 -482
  119. package/plugins/harness-everything/hooks/scripts/lib/doc-reconciliation-producer.js +0 -468
  120. package/plugins/harness-everything/hooks/scripts/lib/doc-reconciliation-provider.js +0 -3304
  121. package/plugins/harness-everything/hooks/scripts/lib/doc-reconciliation-qualification.json +0 -54
  122. package/plugins/harness-everything/hooks/scripts/w6-state-operations.js +0 -239
  123. package/scripts/system-one-eval-laya.js +0 -112
  124. /package/ci/fixtures/{doc-obligations/reconciliation-s2b/capture → state-persist-post-tool-use}/payload-post-tool-use-failure.json +0 -0
  125. /package/ci/fixtures/{doc-obligations/reconciliation-s2b/wiring → workflow-contract}/legacy-off-golden.json +0 -0
@@ -10,7 +10,7 @@
10
10
  "name": "harness-everything",
11
11
  "source": "./",
12
12
  "description": "Harness OS: an orchestrated agent operating system — tier routing, circuit breaker guardrails, verification gates, WAL session memory, and self-evolving workspace rules.",
13
- "version": "1.3.0",
13
+ "version": "1.3.1",
14
14
  "author": {
15
15
  "name": "Miya Daniel"
16
16
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "harness-everything",
3
3
  "description": "Harness OS: an orchestrated agent operating system — tier routing, circuit breaker guardrails, verification gates, WAL session memory, and self-evolving workspace rules.",
4
- "version": "1.3.0",
4
+ "version": "1.3.1",
5
5
  "author": {
6
6
  "name": "Miya Daniel"
7
7
  },
package/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  All notable changes to this project are documented in this file.
4
4
 
5
+ ## [1.3.1](https://github.com/dyphn1/Harness-everything/compare/v1.3.0...v1.3.1) (2026-11-28)
6
+
5
7
  ## [1.3.0](https://github.com/dyphn1/Harness-everything/compare/v1.2.2...v1.3.0) (2026-11-26)
6
8
 
7
9
  ### Features
@@ -294,6 +296,10 @@ Claude-Session: https://claude.ai/code/session_01RPz4xUrN12wGoL19istZUE
294
296
 
295
297
  ## [Unreleased]
296
298
 
299
+ ### E1 pilot retirement
300
+
301
+ * **e1:** the E1 doc-reconciliation pilot is retired (#553). Its runtime modules and the W6 `inventory`/`seal` CLI (`hooks/scripts/w6-state-operations.js`) have been removed, and every `HARNESS_DOC_RECONCILIATION_PILOT` value is now ignored. Finish in-flight E1 work on the previous release, or end it and open a new session to redo review and verification. Recorded evidence stays in place; `doc-check` and document governance are unchanged.
302
+
297
303
  ### BREAKING CHANGES
298
304
 
299
305
  * **opencode:** support OpenCode V2 plugin API only; OpenCode 1.x / V1 is unsupported (#453). Removed the public `HarnessEnforcement` named V1 factory export, host `session.idle`, and legacy session-id event fallbacks; the V2 default export (`{ id, setup(ctx) }`) is now the only public surface. Historical OpenCode 1.18.31 evidence is retained for provenance only and does not establish V2 support.
@@ -4,7 +4,8 @@ Historical evidence only. Nothing here is a GREEN gate.
4
4
 
5
5
  - **Not discovered:** `ci/mechanism-test.js` runs only top-level `ci/mechanism-*.test.js`, so nothing in this directory runs in `npm run test:mechanism`.
6
6
  - **Owner clause (T2, 2026-10-22):** "only archive the prep fingerprint and the RED-plan gates as historical evidence, and tag tests with `locks: <anchor clause>`. List the unmapped tests, but don't delete them."
7
- - **Revision of the historical results:** `0308386058ad942e2764475d48fd65a013910e1e`. The registry was captured at `c271249a8a99d7e0320288af8cb086bb03f8fa1a`.
7
+ - **Original replay SHA (historical results):** `0308386058ad942e2764475d48fd65a013910e1e`. The registry was captured at `c271249a8a99d7e0320288af8cb086bb03f8fa1a`.
8
+ - **T2 source-trace SHA:** `360183f49fe3e41f454cebf8671c0dc15a4d4797` (the original runner was confirmed to stop before replay when the pilot fingerprint file was missing).
8
9
 
9
10
  ## Manifest
10
11
 
@@ -24,7 +25,7 @@ Code changes against the original runner (sha256 `5e85af19…7849c`) are limited
24
25
  - The fixtures `require` path is `../../lib/doc-reconciliation-prep-fixtures`.
25
26
  - The printed re-capture command names `ci/archive/325-prep/doc-reconciliation-red.js`.
26
27
 
27
- The header comment also gained an archive note. Logic, the registry path and the fingerprint files are unchanged.
28
+ The header comment also gained an archive note. At the original relocation, logic, registry path and fingerprint files were unchanged; the later T2-P compatibility adjustment is documented below.
28
29
 
29
30
  ## Commands
30
31
 
@@ -39,6 +40,12 @@ node ci/archive/325-prep/historical-qualification.test.js # 4 FAIL, 6 P
39
40
  - `ci/mechanism-325-3b-preparation.test.js` still runs the archived runner, but only for its infrastructure path (exit 2, child deadline, output bound). Those checks are live.
40
41
  - The live suite no longer reads the registry for qualification.
41
42
 
43
+ ### Archived runner compatibility after pilot retirement
44
+
45
+ The archive fingerprint still covers the three surviving workflow files and the historical pilot file. If and only if `hooks/scripts/lib/doc-reconciliation-pilot.js` is missing with `ENOENT`, the runner reports `runtimeFingerprintAvailable: false` and continues through the real replay and infrastructure classifier. An infrastructure result remains infrastructure; every non-infrastructure result fails with zero qualified gaps. This unavailable state does not print a recapture command, and candidate recapture is refused. Missing or unreadable files elsewhere retain the original infrastructure-error behavior. The live scratch-tree regression removes the source and packaged pilot files and exercises real source/package Stop-gate subprocesses without runtime stubs.
46
+
47
+ This compatibility path keeps the archived infrastructure checks runnable after R2 removes the pilot module. It does not restore qualification as a live GREEN gate or change the recorded historical registry, hashes, fixture, or results.
48
+
42
49
  ## Coordinator disposition (pending)
43
50
 
44
51
  The WA pending-probe gate (`P-ignore-missing-expected-must`, WA report 28–30) is superseded for WB by the coordinator's disposition. The coordinator records that disposition. It is not recorded here.
@@ -37,11 +37,13 @@ const ENTRY_KEYS = ['caseId', 'assertionId', 'distribution', 'baselineSha', 'act
37
37
  // Shared runtime files whose bytes define what the registry describes. Every P01-P08 replay loads the first
38
38
  // three (verified by a preload probe, see h3.md). doc-evidence.js is not loaded by any replay, so it is excluded:
39
39
  // #341 0B refactors it, and including it would turn this suite red for an unrelated reason.
40
+ // R2 retires the pilot module; only its absence is tolerated by this historical runner.
41
+ const RETIRED_PILOT_FINGERPRINT_FILE = 'hooks/scripts/lib/doc-reconciliation-pilot.js';
40
42
  const FINGERPRINT_FILES = [
41
43
  'hooks/scripts/lib/workflow-obligations.js',
42
44
  'hooks/scripts/workflow-disposition.js',
43
45
  'hooks/scripts/workflow-stop-gate.js',
44
- 'hooks/scripts/lib/doc-reconciliation-pilot.js'
46
+ RETIRED_PILOT_FINGERPRINT_FILE
45
47
  ];
46
48
  const CANDIDATE_FILE = 'ci/fixtures/doc-obligations/reconciliation-prep/pending-red.candidate.json';
47
49
  const UNREVIEWED_REASON = 'needs-reason';
@@ -50,12 +52,23 @@ class RegistryError extends Error {}
50
52
 
51
53
  function fingerprint() {
52
54
  const hash = crypto.createHash('sha256');
55
+ let unavailable = false;
53
56
  for (const rel of FINGERPRINT_FILES) {
54
57
  hash.update(`${rel}\0`);
55
- hash.update(fs.readFileSync(path.join(ROOT, rel)));
58
+ let bytes;
59
+ try {
60
+ bytes = fs.readFileSync(path.join(ROOT, rel));
61
+ } catch (error) {
62
+ if (rel === RETIRED_PILOT_FINGERPRINT_FILE && error.code === 'ENOENT') {
63
+ unavailable = true;
64
+ continue;
65
+ }
66
+ throw error;
67
+ }
68
+ hash.update(bytes);
56
69
  hash.update('\0');
57
70
  }
58
- return hash.digest('hex');
71
+ return unavailable ? null : hash.digest('hex');
59
72
  }
60
73
 
61
74
  // Read-only: the commit named in the re-capture command. Falls back to a visible placeholder.
@@ -272,13 +285,16 @@ function run(args) {
272
285
  const registry = loadRegistry(args.registryFile);
273
286
  validateRegistry(registry, corpus);
274
287
  const runtime = fingerprint();
288
+ const runtimeFingerprintAvailable = runtime !== null;
289
+ const runtimeFingerprintMatches = runtimeFingerprintAvailable && registry.runtimeFingerprint === runtime;
275
290
  const cases = corpus.cases.filter(item => args.cases.length === 0 || args.cases.includes(item.id));
276
291
  if (args.cases.length && cases.length !== args.cases.length) throw new RegistryError('a --case names no corpus case');
277
292
  const report = {
278
293
  schemaVersion: 1,
279
294
  mode: args.mode,
280
295
  baselineSha: registry.baselineSha,
281
- runtimeFingerprintMatches: registry.runtimeFingerprint === runtime,
296
+ runtimeFingerprintAvailable,
297
+ runtimeFingerprintMatches,
282
298
  pilotCredit: false,
283
299
  replaysRun: 0,
284
300
  cases: []
@@ -286,8 +302,14 @@ function run(args) {
286
302
  for (const [index, item] of cases.entries()) {
287
303
  const replays = replayAll(item);
288
304
  report.replaysRun += countReplays(replays);
289
- const result = classifyCase(item, replays, registry.entries.filter(entry => entry.caseId === item.id));
290
- if (registry.runtimeFingerprint !== runtime && result.status !== 'INFRASTRUCTURE') {
305
+ const entries = runtimeFingerprintAvailable
306
+ ? registry.entries.filter(entry => entry.caseId === item.id)
307
+ : [];
308
+ const result = classifyCase(item, replays, entries);
309
+ if (!runtimeFingerprintAvailable && result.status !== 'INFRASTRUCTURE') {
310
+ result.status = 'FAIL';
311
+ result.reason = 'runtime fingerprint unavailable because the retired pilot file is missing';
312
+ } else if (!runtimeFingerprintMatches && result.status !== 'INFRASTRUCTURE') {
291
313
  result.status = 'FAIL';
292
314
  result.reason = 'runtime fingerprint differs from the registry capture';
293
315
  }
@@ -298,7 +320,7 @@ function run(args) {
298
320
  break;
299
321
  }
300
322
  }
301
- if (!report.runtimeFingerprintMatches) report.recaptureCommand = recaptureCommand(currentCommit());
323
+ if (runtimeFingerprintAvailable && !runtimeFingerprintMatches) report.recaptureCommand = recaptureCommand(currentCommit());
302
324
  return report;
303
325
  }
304
326
 
@@ -306,6 +328,10 @@ function run(args) {
306
328
  // Reason codes carry over by identity; a gap that is new to the registry gets the unreviewed marker.
307
329
  function recapture(args) {
308
330
  const corpus = fx.readCaseCorpus(args.casesFile);
331
+ const runtimeFingerprint = fingerprint();
332
+ if (runtimeFingerprint === null) {
333
+ throw new RegistryError('runtime fingerprint unavailable because the retired pilot file is missing');
334
+ }
309
335
  const existing = fs.existsSync(args.registryFile) ? loadRegistry(args.registryFile).entries || [] : [];
310
336
  const known = new Map(existing.map(entry => [`${entry.assertionId}|${entry.distribution}`, entry.reasonCode]));
311
337
  const entries = [];
@@ -338,7 +364,7 @@ function recapture(args) {
338
364
  if (problems.length) return { ok: false, problems };
339
365
  return {
340
366
  ok: true,
341
- candidate: { schemaVersion: 1, phase: '325-3b-H2', baselineSha: args.baselineSha, runtimeFingerprint: fingerprint(), entries }
367
+ candidate: { schemaVersion: 1, phase: '325-3b-H2', baselineSha: args.baselineSha, runtimeFingerprint, entries }
342
368
  };
343
369
  }
344
370
 
@@ -0,0 +1,11 @@
1
+ {
2
+ "governed": [
3
+ {
4
+ "path": "docs/a.md",
5
+ "role": "reference"
6
+ }
7
+ ],
8
+ "domains": [
9
+ "GRPH"
10
+ ]
11
+ }
@@ -0,0 +1,6 @@
1
+ ---
2
+ role: reference
3
+ status: active
4
+ ---
5
+
6
+ The checkout retries once. See [b](b.md).
@@ -0,0 +1,6 @@
1
+ ---
2
+ role: reference
3
+ status: active
4
+ ---
5
+
6
+ The checkout retries twice. See [b](b.md).
@@ -0,0 +1,11 @@
1
+ ---
2
+ id: EVID-001
3
+ role: adr
4
+ status: proposed
5
+ ---
6
+
7
+ # EVID-001
8
+
9
+ ## Decision
10
+
11
+ Baseline evidence identity.
@@ -0,0 +1,19 @@
1
+ # Document lifecycle index
2
+
3
+ ## Active documents
4
+
5
+ - `EVID-001` — `docs/adr/EVID-001-verify-all-evidence.md` (role: adr; status: proposed)
6
+
7
+ ## PRD revision chains
8
+
9
+ _None._
10
+
11
+
12
+ ## Legacy documents
13
+
14
+ _None._
15
+
16
+
17
+ ## Unresolved
18
+
19
+ _None._
@@ -0,0 +1,11 @@
1
+ ---
2
+ id: EVID-001
3
+ role: adr
4
+ status: accepted
5
+ ---
6
+
7
+ # EVID-001
8
+
9
+ ## Decision
10
+
11
+ Candidate evidence identity.
@@ -0,0 +1,19 @@
1
+ # Document lifecycle index
2
+
3
+ ## Active documents
4
+
5
+ - `EVID-001` — `docs/adr/EVID-001-verify-all-evidence.md` (role: adr; status: accepted)
6
+
7
+ ## PRD revision chains
8
+
9
+ _None._
10
+
11
+
12
+ ## Legacy documents
13
+
14
+ _None._
15
+
16
+
17
+ ## Unresolved
18
+
19
+ _None._
@@ -0,0 +1,17 @@
1
+ {
2
+ "governed": [
3
+ {
4
+ "path": "docs/adr/*.md",
5
+ "role": "adr"
6
+ }
7
+ ],
8
+ "domains": [
9
+ "EVID"
10
+ ],
11
+ "derived": [
12
+ {
13
+ "path": "docs/governed-index.md",
14
+ "generator": "node harness-everything/scripts/doc-lifecycle.js index --workspace . --config .agents/harness-everything/project-docs.json --all"
15
+ }
16
+ ]
17
+ }
@@ -0,0 +1,153 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "description": "Fixed regression pins for unchanged deriveDocFacts, deriveDocObligations and checkDocObligations outputs across the four canonical vectors (moved from reconciliation-s2a/vectors.json in #553 T2-D without recapturing digests).",
4
+ "deriveConfig": "ci/fixtures/doc-obligations/derive/config.json",
5
+ "vectors": {
6
+ "normative": {
7
+ "deriveCase": "missing-approval"
8
+ },
9
+ "nonnormative": {
10
+ "deriveCase": "docs-only"
11
+ },
12
+ "code-only": {
13
+ "deriveCase": "code-only"
14
+ },
15
+ "nondocument": {
16
+ "files": {
17
+ "base": {
18
+ "assets/notes.txt": "Release notes draft.\n"
19
+ },
20
+ "candidate": {
21
+ "assets/notes.txt": "Release notes draft, revised.\n"
22
+ }
23
+ }
24
+ }
25
+ },
26
+ "pins": {
27
+ "normative": {
28
+ "deriveFactsSha256": "c78d208ccba00c5e47bd5d72abc595b05f7f340a005da0a14b598cd5c4743437",
29
+ "deriveObligationsSha256": "5ff5fcfe1edaf939a2b8b526b2bff131de1253319f3cbe97b3c4c60f75480deb",
30
+ "checkerResultsSha256": "3a55b457ee4f8eb918fcfeda1f12236e57817d0fd4db185799ffb73b9c162b9a",
31
+ "mustApplicability": [
32
+ [
33
+ "doc-change:doc-lint",
34
+ "applicable"
35
+ ],
36
+ [
37
+ "doc-change:link-check",
38
+ "applicable"
39
+ ],
40
+ [
41
+ "doc-change:derived-regenerate",
42
+ "N/A"
43
+ ],
44
+ [
45
+ "doc-change:quality-review",
46
+ "applicable"
47
+ ],
48
+ [
49
+ "doc-change:conflict-check",
50
+ "applicable"
51
+ ],
52
+ [
53
+ "doc-change:requirement-sync",
54
+ "N/A"
55
+ ]
56
+ ]
57
+ },
58
+ "nonnormative": {
59
+ "deriveFactsSha256": "72659ade94266aa542198aed0ada2dfa243297520f70e40b86b5896592d8a457",
60
+ "deriveObligationsSha256": "ece5929fd7bec6d836312dbc2b90c4c8eabc7f82fc1b49605f7f342b9eb7071d",
61
+ "checkerResultsSha256": "74a20d2e250c40c7dfad7025bfcad080345667e7d558a33f615452c40597854d",
62
+ "mustApplicability": [
63
+ [
64
+ "doc-change:doc-lint",
65
+ "applicable"
66
+ ],
67
+ [
68
+ "doc-change:link-check",
69
+ "applicable"
70
+ ],
71
+ [
72
+ "doc-change:derived-regenerate",
73
+ "N/A"
74
+ ],
75
+ [
76
+ "doc-change:quality-review",
77
+ "N/A"
78
+ ],
79
+ [
80
+ "doc-change:conflict-check",
81
+ "N/A"
82
+ ],
83
+ [
84
+ "doc-change:requirement-sync",
85
+ "N/A"
86
+ ]
87
+ ]
88
+ },
89
+ "code-only": {
90
+ "deriveFactsSha256": "1134fae14ea8f888f12f5dff1bd32b8a2788ba09e91299e7ce3d2a9dc81d0d1f",
91
+ "deriveObligationsSha256": "b8ece9008764bad6e015d99252dd73570164684b768449d89d4ff0de98def44e",
92
+ "checkerResultsSha256": "3080bfcaafb7f330f4d26f4087a60a9a76c7a5154b7581209fc26e365333edcb",
93
+ "mustApplicability": [
94
+ [
95
+ "doc-change:doc-lint",
96
+ "N/A"
97
+ ],
98
+ [
99
+ "doc-change:link-check",
100
+ "N/A"
101
+ ],
102
+ [
103
+ "doc-change:derived-regenerate",
104
+ "N/A"
105
+ ],
106
+ [
107
+ "doc-change:quality-review",
108
+ "N/A"
109
+ ],
110
+ [
111
+ "doc-change:conflict-check",
112
+ "N/A"
113
+ ],
114
+ [
115
+ "doc-change:requirement-sync",
116
+ "unknown"
117
+ ]
118
+ ]
119
+ },
120
+ "nondocument": {
121
+ "deriveFactsSha256": "5ba5a35c74165a94deff0e935799f93b7d5efa1eb554e4fad9717560e0828d43",
122
+ "deriveObligationsSha256": "0cfb1cbd5ebb220a3c174d716dcba67c46b0d58e87bfebf0a930e8e0be9f843b",
123
+ "checkerResultsSha256": "25026cdafe353e58bdc3a74e8b1db6feb1a2f180f9cce04f81527e96d57c251a",
124
+ "mustApplicability": [
125
+ [
126
+ "doc-change:doc-lint",
127
+ "N/A"
128
+ ],
129
+ [
130
+ "doc-change:link-check",
131
+ "N/A"
132
+ ],
133
+ [
134
+ "doc-change:derived-regenerate",
135
+ "N/A"
136
+ ],
137
+ [
138
+ "doc-change:quality-review",
139
+ "N/A"
140
+ ],
141
+ [
142
+ "doc-change:conflict-check",
143
+ "N/A"
144
+ ],
145
+ [
146
+ "doc-change:requirement-sync",
147
+ "N/A"
148
+ ]
149
+ ]
150
+ }
151
+ },
152
+ "pinNote": "sha256 of stable JSON (sorted keys) of the current unchanged outputs; recorded at R2a RED."
153
+ }
@@ -0,0 +1,206 @@
1
+ 'use strict';
2
+
3
+ // Test-only harness for the general state-persist PostToolUse compatibility
4
+ // controls. Copies the capture fixture's two-leg loader/driver contract so the
5
+ // moved controls keep the same input, same assertion and both real hook legs
6
+ // (canonical hooks/scripts + packaged plugins/harness-everything copy).
7
+ // No runtime module is required at load time; R2 may retire the E1 modules
8
+ // without affecting these controls.
9
+
10
+ const fs = require('fs');
11
+ const os = require('os');
12
+ const path = require('path');
13
+ const { spawnSync } = require('child_process');
14
+
15
+ const HERE = __dirname;
16
+ const ROOT = path.resolve(HERE, '..', '..', '..');
17
+
18
+ const LEGS = [
19
+ {
20
+ name: 'source',
21
+ hooksScripts: path.join(ROOT, 'hooks', 'scripts'),
22
+ hooksManifest: path.join(ROOT, 'hooks', 'hooks.json'),
23
+ lib: path.join(ROOT, 'hooks', 'scripts', 'lib'),
24
+ },
25
+ {
26
+ name: 'packaged',
27
+ hooksScripts: path.join(ROOT, 'plugins', 'harness-everything', 'hooks', 'scripts'),
28
+ hooksManifest: path.join(ROOT, 'plugins', 'harness-everything', 'hooks', 'hooks.json'),
29
+ lib: path.join(ROOT, 'plugins', 'harness-everything', 'hooks', 'scripts', 'lib'),
30
+ },
31
+ ];
32
+
33
+ class InfraError extends Error {}
34
+
35
+ const CAPTURE_EVENT_NAMES = ['PostToolUse', 'PostToolUseFailure', 'SubagentStart', 'SubagentStop'];
36
+ const CAPTURE_BASE_REQUIRED = ['event', 'command', 'cwd', 'tool_use_id', 'session_id', 'responseDigest', 'responseRef'];
37
+
38
+ function payload(name) {
39
+ return JSON.parse(fs.readFileSync(path.join(HERE, name), 'utf8'));
40
+ }
41
+
42
+ function golden() {
43
+ return JSON.parse(fs.readFileSync(path.join(HERE, 'off-handoff-golden.json'), 'utf8'));
44
+ }
45
+
46
+ const moduleCache = new Map();
47
+ function loadModule(leg, file) {
48
+ const key = `${leg.name}:${file}`;
49
+ if (moduleCache.has(key)) return moduleCache.get(key);
50
+ const abs = path.join(leg.lib, file);
51
+ const rel = path.relative(ROOT, abs);
52
+ let result;
53
+ if (!fs.existsSync(abs)) {
54
+ result = { error: `module-missing: ${rel} does not exist` };
55
+ } else {
56
+ try {
57
+ result = { mod: require(abs) };
58
+ } catch (error) {
59
+ result = { error: `load-error: ${rel}: ${String(error && error.message).split('\n')[0]}` };
60
+ }
61
+ }
62
+ moduleCache.set(key, result);
63
+ return result;
64
+ }
65
+
66
+ function requirementsMet(leg, requirements) {
67
+ const mods = {};
68
+ for (const req of requirements || []) {
69
+ const loaded = loadModule(leg, req.file);
70
+ if (loaded.error) return { error: loaded.error };
71
+ for (const name of req.exports || []) {
72
+ if (typeof loaded.mod[name] !== 'function') {
73
+ return { error: `export-missing: ${req.file} does not export ${name}` };
74
+ }
75
+ }
76
+ mods[req.file] = loaded.mod;
77
+ }
78
+ return { mods };
79
+ }
80
+
81
+ function createRunner(label) {
82
+ const rows = [];
83
+ const counts = { PASS: 0, FAIL: 0, INFRA: 0 };
84
+ function emit(status, id, leg, detail) {
85
+ counts[status] += 1;
86
+ rows.push({ status, id, leg, detail: detail || '' });
87
+ console.log(` ${status} ${id}${leg ? ` [${leg}]` : ''}${detail ? ` — ${detail}` : ''}`);
88
+ }
89
+ function run(id, requirements, fn) {
90
+ for (const leg of LEGS) {
91
+ const met = requirementsMet(leg, requirements);
92
+ if (met.error) { emit('FAIL', id, leg.name, met.error); continue; }
93
+ try {
94
+ fn(met.mods, leg);
95
+ emit('PASS', id, leg.name);
96
+ } catch (error) {
97
+ if (error instanceof InfraError) emit('INFRA', id, leg.name, String(error && error.message).split('\n')[0]);
98
+ else emit('FAIL', id, leg.name, String(error && error.message).split('\n')[0]);
99
+ }
100
+ }
101
+ }
102
+ function summary() {
103
+ console.log(`\n${label} summary: ${counts.PASS} PASS, ${counts.FAIL} FAIL, ${counts.INFRA} INFRA across ${rows.length} assertion-legs`);
104
+ return counts;
105
+ }
106
+ return { run, summary, counts, rows, emit };
107
+ }
108
+
109
+ function sessionDirectoryNameSafe(sessionId) {
110
+ return String(sessionId || 'default').replace(/[^A-Za-z0-9._-]+/g, '_').replace(/^\.+/, '');
111
+ }
112
+
113
+ function snapshotSessionTree(stateHome, sessionId) {
114
+ const dirName = sessionDirectoryNameSafe(sessionId);
115
+ const hits = [];
116
+ (function walk(dir) {
117
+ if (!fs.existsSync(dir)) return;
118
+ for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
119
+ const abs = path.join(dir, entry.name);
120
+ if (entry.isDirectory()) walk(abs);
121
+ else if (abs.split(path.sep).includes(dirName)) hits.push(abs);
122
+ }
123
+ })(stateHome);
124
+ const files = {};
125
+ for (const abs of hits) files[path.relative(stateHome, abs).replace(/\\/g, '/')] = fs.readFileSync(abs, 'utf8');
126
+ return files;
127
+ }
128
+
129
+ function driveStatePersist(leg, baseName, overrides = {}, options = {}) {
130
+ const home = fs.mkdtempSync(path.join(os.tmpdir(), 'state-persist-post-'));
131
+ const wsRoot = path.join(home, 'ws');
132
+ fs.mkdirSync(wsRoot, { recursive: true });
133
+ const stateHome = path.join(home, 'state-home');
134
+ fs.mkdirSync(stateHome, { recursive: true });
135
+ const driven = JSON.parse(JSON.stringify(payload(baseName)));
136
+ for (const [k, v] of Object.entries(overrides)) {
137
+ if (v === undefined) delete driven[k];
138
+ else driven[k] = v;
139
+ }
140
+ driven.cwd = wsRoot;
141
+ const env = {
142
+ ...process.env,
143
+ CLAUDE: '1',
144
+ HARNESS_STATE_HOME: stateHome,
145
+ HARNESS_WORKSPACE_ROOT: wsRoot,
146
+ ...(options.env || {}),
147
+ };
148
+ let result;
149
+ try {
150
+ result = spawnSync('node', [path.join(leg.hooksScripts, 'state-persist.js')], {
151
+ input: JSON.stringify(driven),
152
+ encoding: 'utf8',
153
+ env,
154
+ timeout: 30000,
155
+ });
156
+ } catch (error) {
157
+ throw new InfraError(`state-persist subprocess could not be started: ${error.message}`);
158
+ }
159
+ if (result.error) throw new InfraError(`state-persist subprocess error: ${String(result.error.message || result.error)}`);
160
+ const out = {
161
+ code: result.status,
162
+ stdout: result.stdout || '',
163
+ stderr: result.stderr || '',
164
+ files: snapshotSessionTree(stateHome, driven.session_id),
165
+ filesRoot: stateHome,
166
+ wsRoot,
167
+ payload: driven,
168
+ };
169
+ try { fs.rmSync(home, { recursive: true, force: true }); } catch { /* best effort */ }
170
+ return out;
171
+ }
172
+
173
+ function deepScan(value, visit) {
174
+ if (value && typeof value === 'object') {
175
+ visit(value);
176
+ if (Array.isArray(value)) for (const item of value) deepScan(item, visit);
177
+ else for (const key of Object.keys(value)) deepScan(value[key], visit);
178
+ }
179
+ }
180
+
181
+ function findCaptureRecords(files) {
182
+ const found = [];
183
+ for (const content of Object.values(files)) {
184
+ let parsed;
185
+ try { parsed = JSON.parse(content); } catch { continue; }
186
+ deepScan(parsed, node => {
187
+ if (node && CAPTURE_EVENT_NAMES.includes(node.event)
188
+ && CAPTURE_BASE_REQUIRED.every(k => Object.prototype.hasOwnProperty.call(node, k))) {
189
+ found.push(node);
190
+ }
191
+ });
192
+ }
193
+ return found;
194
+ }
195
+
196
+ module.exports = {
197
+ ROOT,
198
+ LEGS,
199
+ InfraError,
200
+ payload,
201
+ golden,
202
+ createRunner,
203
+ requirementsMet,
204
+ driveStatePersist,
205
+ findCaptureRecords,
206
+ };
@@ -0,0 +1,16 @@
1
+ {
2
+ "expectedFiles": [
3
+ "handoff-state.json"
4
+ ],
5
+ "keys": [
6
+ "lastEditAt",
7
+ "lastVerifyAt",
8
+ "lastVerifyExitCode",
9
+ "status",
10
+ "timestamp"
11
+ ],
12
+ "values": {
13
+ "status": "idle",
14
+ "lastVerifyExitCode": null
15
+ }
16
+ }