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.
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/AGENTS.md +1 -1
- package/CHANGELOG.md +14 -0
- package/behavioral-evals/ledger-pairs/README.md +53 -0
- package/behavioral-evals/ledger-pairs/arm.js +359 -0
- package/behavioral-evals/ledger-pairs/fixture.js +138 -0
- package/behavioral-evals/ledger-pairs/preflight.js +96 -0
- package/behavioral-evals/ledger-pairs/score.js +155 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/README.md +108 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/agy/pair-1-baseline/arm-plan.json +14 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/agy/pair-1-baseline/arm-result.json +35 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/agy/pair-1-treatment/arm-plan.json +14 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/agy/pair-1-treatment/arm-result.json +35 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/agy/pair-2-baseline/arm-plan.json +14 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/agy/pair-2-baseline/arm-result.json +35 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/agy/pair-2-treatment/arm-plan.json +14 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/agy/pair-2-treatment/arm-result.json +35 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/agy/pair-3-baseline/arm-plan.json +14 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/agy/pair-3-baseline/arm-result.json +35 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/agy/pair-3-treatment/arm-plan.json +14 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/agy/pair-3-treatment/arm-result.json +35 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/agy/pair-4-baseline/arm-plan.json +14 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/agy/pair-4-baseline/arm-result.json +28 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/agy/pair-4-treatment/arm-plan.json +14 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/agy/pair-4-treatment/arm-result.json +35 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/codex/pair-1-baseline/arm-plan.json +13 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/codex/pair-1-baseline/arm-result.json +56 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/codex/pair-1-treatment/arm-plan.json +13 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/codex/pair-1-treatment/arm-result.json +56 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/codex/pair-2-baseline/arm-plan.json +13 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/codex/pair-2-baseline/arm-result.json +56 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/codex/pair-2-treatment/arm-plan.json +13 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/codex/pair-2-treatment/arm-result.json +56 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/codex/pair-3-baseline/arm-plan.json +13 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/codex/pair-3-baseline/arm-result.json +49 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/codex/pair-3-treatment/arm-plan.json +13 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/codex/pair-3-treatment/arm-result.json +49 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/codex/pair-4-baseline/arm-plan.json +13 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/codex/pair-4-baseline/arm-result.json +49 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/codex/pair-4-treatment/arm-plan.json +13 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/codex/pair-4-treatment/arm-result.json +56 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-1-baseline/arm-plan.json +14 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-1-baseline/arm-result.json +44 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-1-baseline/receipt.jsonl +17 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-1-treatment/arm-plan.json +14 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-1-treatment/arm-result.json +41 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-1-treatment/receipt.jsonl +58 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-2-baseline/arm-plan.json +14 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-2-baseline/arm-result.json +50 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-2-baseline/receipt.jsonl +101 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-2-treatment/arm-plan.json +14 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-2-treatment/arm-result.json +44 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-2-treatment/receipt.jsonl +29 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-3-baseline/arm-plan.json +14 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-3-baseline/arm-result.json +44 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-3-baseline/receipt.jsonl +23 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-3-treatment/arm-plan.json +14 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-3-treatment/arm-result.json +34 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-3-treatment/receipt.jsonl +24 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-4-baseline/arm-plan.json +14 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-4-baseline/arm-result.json +47 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-4-baseline/receipt.jsonl +69 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-4-treatment/arm-plan.json +14 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-4-treatment/arm-result.json +44 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/opencode/pair-4-treatment/receipt.jsonl +65 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/run-order.sh +18 -0
- package/benchmarks/results/live-host/ledger-pairs-2026-11-28/score.json +1032 -0
- package/benchmarks/results/live-host/opencode-2026-11-28-397-turn-export/README.md +50 -0
- package/benchmarks/results/live-host/opencode-2026-11-28-397-turn-export/collect-rerun.txt +3 -0
- package/benchmarks/results/live-host/opencode-2026-11-28-397-turn-export/export-report.json +22 -0
- package/benchmarks/results/live-host/opencode-2026-11-28-397-turn-export/host-version.txt +1 -0
- package/benchmarks/results/live-host/opencode-2026-11-28-397-turn-export/import-report-1.json +18 -0
- package/benchmarks/results/live-host/opencode-2026-11-28-397-turn-export/import-report-2.json +18 -0
- package/benchmarks/results/live-host/opencode-2026-11-28-397-turn-export/labels-observed-excerpt.jsonl +2 -0
- package/benchmarks/results/live-host/opencode-2026-11-28-397-turn-export/observations-index-excerpt.json +26 -0
- package/benchmarks/results/live-host/opencode-2026-11-28-397-turn-export/plugin-load-lines.txt +1 -0
- package/benchmarks/results/live-host/opencode-2026-11-28-450-steering-trace/README.md +46 -0
- package/benchmarks/results/live-host/opencode-2026-11-28-450-steering-trace/observations-index-excerpt.json +16 -0
- package/benchmarks/results/live-host/opencode-2026-11-28-450-steering-trace/plugin-load-lines.txt +2 -0
- package/benchmarks/results/live-host/opencode-2026-11-28-450-steering-trace/run-marks.txt +6 -0
- package/benchmarks/results/live-host/opencode-2026-11-28-450-steering-trace/steering-probe.js +16 -0
- package/benchmarks/results/live-host/opencode-2026-11-28-450-steering-trace/steering-trace.jsonl +167 -0
- package/ci/archive/325-prep/README.md +9 -2
- package/ci/archive/325-prep/doc-reconciliation-red.js +34 -8
- package/ci/fixtures/553-t2a/body-edit/base/.agents/harness-everything/project-docs.json +11 -0
- package/ci/fixtures/553-t2a/body-edit/base/docs/a.md +6 -0
- package/ci/fixtures/553-t2a/body-edit/base/docs/b.md +1 -0
- package/ci/fixtures/553-t2a/body-edit/candidate/docs/a.md +6 -0
- package/ci/fixtures/553-t2c/derived-regenerate-must/base/docs/adr/EVID-001-verify-all-evidence.md +11 -0
- package/ci/fixtures/553-t2c/derived-regenerate-must/base/docs/governed-index.md +19 -0
- package/ci/fixtures/553-t2c/derived-regenerate-must/candidate/docs/adr/EVID-001-verify-all-evidence.md +11 -0
- package/ci/fixtures/553-t2c/derived-regenerate-must/candidate/docs/governed-index.md +19 -0
- package/ci/fixtures/553-t2c/derived-regenerate-must/config.json +17 -0
- package/ci/fixtures/doc-obligations/derive/regression-pins.json +153 -0
- package/ci/fixtures/state-persist-post-tool-use/harness.js +206 -0
- package/ci/fixtures/state-persist-post-tool-use/off-handoff-golden.json +16 -0
- package/ci/fixtures/state-persist-post-tool-use/payload-post-tool-use-success.json +13 -0
- package/ci/fixtures/stop/fail-session-writes.js +109 -0
- package/ci/fixtures/workflow-contract/cases.json +3355 -0
- package/ci/fixtures/workflow-contract/wiring-cases.json +560 -0
- package/ci/lib/doc-reconciliation-prep-fixtures.js +4 -9
- package/ci/mechanism-2an-workflow-replay.test.js +324 -0
- package/ci/mechanism-2ax-doc-lifecycle.test.js +132 -0
- package/ci/mechanism-325-3a-doc-evidence.test.js +73 -0
- package/ci/mechanism-325-3a-doc-obligations.test.js +61 -0
- package/ci/mechanism-325-3b-preparation.test.js +208 -49
- package/ci/mechanism-325-3b-s1-review.test.js +20 -828
- package/ci/mechanism-325-3b-s3-providers.test.js +59 -0
- package/ci/mechanism-325-f3-derived-views.test.js +140 -0
- package/ci/mechanism-332-fable-directive.test.js +180 -0
- package/ci/mechanism-341-opencode-lane.test.js +164 -284
- package/ci/mechanism-35-verification-contract.test.js +246 -0
- package/ci/mechanism-365-step-edit-accounting.test.js +5 -6
- package/ci/mechanism-383-doc-glob-line-terminators.test.js +0 -30
- package/ci/mechanism-397-opencode-observations.test.js +151 -18
- package/ci/mechanism-552-ledger-pairs.test.js +159 -0
- package/ci/mechanism-553-e1-unhook-credit.test.js +328 -0
- package/ci/mechanism-553-p2a-claude-hooks.test.js +98 -0
- package/ci/mechanism-553-p3-plan-start.test.js +212 -0
- package/ci/mechanism-553-state-persist-post-tool-use.test.js +307 -0
- package/ci/mechanism-553-stop.test.js +427 -0
- package/ci/mechanism-553-t2a-derive.test.js +110 -0
- package/ci/mechanism-553-t2c-derive.test.js +94 -0
- package/ci/mechanism-e1-derived-regenerate.test.js +45 -206
- package/ci/mechanism-outline-sanitizer.test.js +0 -8
- package/ci/mechanism-pr-a-conflict-check.test.js +38 -305
- package/ci/mechanism-prb-outline-review.test.js +101 -3283
- package/ci/router-workflow-plan.test.js +61 -21
- package/docs/adr/DOCS-006-reconciliation-pilot.md +4 -2
- package/docs/adr/DOCS-008-obligation-abstraction-bounded-consumer.md +3 -3
- package/docs/doc-workflow-reconciliation.md +17 -2
- package/docs/document-lifecycle.md +6 -2
- package/docs/platform-capabilities.md +63 -16
- package/docs/platform-compatibility.json +5 -5
- package/harness-everything/SKILL.md +1 -1
- package/harness-everything/scripts/routing-keywords.json +0 -2
- package/harness-everything/scripts/tier-router.js +105 -11
- package/hooks/hooks.json +0 -46
- package/hooks/scripts/lib/workflow-obligations.js +0 -55
- package/hooks/scripts/state-persist.js +7 -95
- package/hooks/scripts/workflow-disposition.js +0 -2
- package/hooks/scripts/workflow-stop-gate.js +17 -30
- package/opencode-plugin/index.mjs +6 -70
- package/opencode-plugin/plugin.json +1 -1
- package/package.json +1 -1
- package/plugins/harness-everything/.antigravity-plugin/plugin.json +1 -1
- package/plugins/harness-everything/.codex-plugin/plugin.json +1 -1
- package/plugins/harness-everything/hooks/scripts/lib/workflow-obligations.js +0 -55
- package/plugins/harness-everything/hooks/scripts/state-persist.js +7 -95
- package/plugins/harness-everything/hooks/scripts/workflow-disposition.js +0 -2
- package/plugins/harness-everything/hooks/scripts/workflow-stop-gate.js +17 -30
- package/plugins/harness-everything/plugin.json +1 -1
- package/plugins/harness-everything/rules/AGENTS.md +1 -1
- package/plugins/harness-everything/skills/harness-everything/SKILL.md +1 -1
- package/plugins/harness-everything/skills/harness-everything/scripts/routing-keywords.json +0 -2
- package/plugins/harness-everything/skills/harness-everything/scripts/tier-router.js +105 -11
- package/sbom.cdx.json +7 -7
- package/ci/fixtures/doc-obligations/reconciliation-s1/cases.json +0 -6854
- package/ci/fixtures/doc-obligations/reconciliation-s1/fail-session-writes.js +0 -116
- package/ci/fixtures/doc-obligations/reconciliation-s2a/harness.js +0 -507
- package/ci/fixtures/doc-obligations/reconciliation-s2a/run13-workflow-requirements.json +0 -42
- package/ci/fixtures/doc-obligations/reconciliation-s2a/vectors.json +0 -617
- package/ci/fixtures/doc-obligations/reconciliation-s2b/capture/harness.js +0 -415
- package/ci/fixtures/doc-obligations/reconciliation-s2b/capture/payload-post-tool-use-success-minimal.json +0 -9
- package/ci/fixtures/doc-obligations/reconciliation-s2b/capture/payload-subagent-start.json +0 -7
- package/ci/fixtures/doc-obligations/reconciliation-s2b/capture/payload-subagent-stop-freetext-reject.json +0 -11
- package/ci/fixtures/doc-obligations/reconciliation-s2b/capture/payload-subagent-stop-reject.json +0 -11
- package/ci/fixtures/doc-obligations/reconciliation-s2b/capture/payload-subagent-stop.json +0 -11
- package/ci/fixtures/doc-obligations/reconciliation-s2b/capture/payload-task-result.json +0 -19
- package/ci/fixtures/doc-obligations/reconciliation-s2b/corpus/off-capture-only.json +0 -99
- package/ci/fixtures/doc-obligations/reconciliation-s2b/corpus/off-legacy.json +0 -67
- package/ci/fixtures/doc-obligations/reconciliation-s2b/corpus/on-concurrent-writers.json +0 -62
- package/ci/fixtures/doc-obligations/reconciliation-s2b/corpus/on-lookalikes-runtime-mutations.json +0 -67
- package/ci/fixtures/doc-obligations/reconciliation-s2b/corpus/on-malformed.json +0 -85
- package/ci/fixtures/doc-obligations/reconciliation-s2b/corpus/on-normal-session.json +0 -74
- package/ci/fixtures/doc-obligations/reconciliation-s2b/corpus/on-runtime-drift-later-npm-test.json +0 -58
- package/ci/fixtures/doc-obligations/reconciliation-s2b/corpus/on-valid-direct-quoted-review.json +0 -85
- package/ci/fixtures/doc-obligations/reconciliation-s2b/f4/cases.json +0 -2267
- package/ci/fixtures/doc-obligations/reconciliation-s2b/wiring/cases.json +0 -1110
- package/ci/lib/doc-reconciliation-file-spy.js +0 -23
- package/ci/lib/doc-reconciliation-qualification-preload.js +0 -37
- package/ci/lib/doc-reconciliation-replay.js +0 -104
- package/ci/lib/doc-reconciliation-staged-tree.js +0 -102
- package/ci/mechanism-325-3b-h1-qualification.test.js +0 -206
- package/ci/mechanism-325-3b-s1.test.js +0 -188
- package/ci/mechanism-325-3b-s2a-core.test.js +0 -840
- package/ci/mechanism-325-3b-s2a-producer.test.js +0 -564
- package/ci/mechanism-325-3b-s2b-capture.test.js +0 -566
- package/ci/mechanism-325-3b-s2b-wiring.test.js +0 -679
- package/ci/mechanism-325-f4-invariants.test.js +0 -606
- package/ci/mechanism-325-f4-projections.test.js +0 -392
- package/ci/mechanism-325-f4-qualification.test.js +0 -228
- package/ci/mechanism-325-f4-trust-boundary.test.js +0 -880
- package/ci/mechanism-e1-dependency-artifact-scope.test.js +0 -657
- package/hooks/scripts/lib/doc-reconciliation-capture.sanitized.jsonl +0 -26
- package/hooks/scripts/lib/doc-reconciliation-core.js +0 -336
- package/hooks/scripts/lib/doc-reconciliation-events.js +0 -292
- package/hooks/scripts/lib/doc-reconciliation-outline-capture.sanitized.jsonl +0 -24
- package/hooks/scripts/lib/doc-reconciliation-pilot.js +0 -482
- package/hooks/scripts/lib/doc-reconciliation-producer.js +0 -468
- package/hooks/scripts/lib/doc-reconciliation-provider.js +0 -3304
- package/hooks/scripts/lib/doc-reconciliation-qualification.json +0 -54
- package/hooks/scripts/w6-state-operations.js +0 -239
- package/plugins/harness-everything/hooks/scripts/lib/doc-reconciliation-capture.sanitized.jsonl +0 -26
- package/plugins/harness-everything/hooks/scripts/lib/doc-reconciliation-core.js +0 -336
- package/plugins/harness-everything/hooks/scripts/lib/doc-reconciliation-events.js +0 -292
- package/plugins/harness-everything/hooks/scripts/lib/doc-reconciliation-outline-capture.sanitized.jsonl +0 -24
- package/plugins/harness-everything/hooks/scripts/lib/doc-reconciliation-pilot.js +0 -482
- package/plugins/harness-everything/hooks/scripts/lib/doc-reconciliation-producer.js +0 -468
- package/plugins/harness-everything/hooks/scripts/lib/doc-reconciliation-provider.js +0 -3304
- package/plugins/harness-everything/hooks/scripts/lib/doc-reconciliation-qualification.json +0 -54
- package/plugins/harness-everything/hooks/scripts/w6-state-operations.js +0 -239
- package/scripts/system-one-eval-laya.js +0 -112
- /package/ci/fixtures/{doc-obligations/reconciliation-s2b/capture → state-persist-post-tool-use}/payload-post-tool-use-failure.json +0 -0
- /package/ci/fixtures/{doc-obligations/reconciliation-s2b/wiring → workflow-contract}/legacy-off-golden.json +0 -0
|
@@ -20,7 +20,6 @@ const ROOT = path.resolve(__dirname, '..');
|
|
|
20
20
|
const PREP_DIR = path.join(__dirname, 'fixtures', 'doc-obligations', 'reconciliation-prep');
|
|
21
21
|
const RUNNER = path.join(__dirname, 'archive', '325-prep', 'doc-reconciliation-red.js');
|
|
22
22
|
const corpus = fx.readCaseCorpus(path.join(PREP_DIR, 'cases.json'));
|
|
23
|
-
const registry = JSON.parse(fs.readFileSync(path.join(PREP_DIR, 'pending-red.json'), 'utf8'));
|
|
24
23
|
const workDir = fs.mkdtempSync(path.join(os.tmpdir(), 'doc-recon-prep-suite-'));
|
|
25
24
|
|
|
26
25
|
const ALLOWED_OPS = new Set(['route', 'plan', 'start', 'binding', 'step', 'obligation', 'stop', 'provideEvidence', 'mutateIdentity', 'timestampHints']);
|
|
@@ -30,7 +29,6 @@ const SHARED_FILES = [
|
|
|
30
29
|
['hooks/scripts/lib/workflow-obligations.js', 'plugins/harness-everything/hooks/scripts/lib/workflow-obligations.js'],
|
|
31
30
|
['hooks/scripts/workflow-disposition.js', 'plugins/harness-everything/hooks/scripts/workflow-disposition.js'],
|
|
32
31
|
['hooks/scripts/workflow-stop-gate.js', 'plugins/harness-everything/hooks/scripts/workflow-stop-gate.js'],
|
|
33
|
-
['hooks/scripts/lib/doc-reconciliation-pilot.js', 'plugins/harness-everything/hooks/scripts/lib/doc-reconciliation-pilot.js'],
|
|
34
32
|
];
|
|
35
33
|
|
|
36
34
|
let failed = 0;
|
|
@@ -44,6 +42,33 @@ function checkCase(name, runCase) {
|
|
|
44
42
|
function runRunner(args) {
|
|
45
43
|
return spawnSync(process.execPath, [RUNNER, ...args], { cwd: ROOT, encoding: 'utf8' });
|
|
46
44
|
}
|
|
45
|
+
const SCRATCH_COPY_PATHS = ['ci', 'hooks', 'harness-everything', 'plugins/harness-everything', 'scripts', '.agents/plugins', 'package.json'];
|
|
46
|
+
function copyScratchTree(destination) {
|
|
47
|
+
fs.mkdirSync(destination, { recursive: true });
|
|
48
|
+
for (const relative of SCRATCH_COPY_PATHS) {
|
|
49
|
+
const source = path.join(ROOT, relative);
|
|
50
|
+
const target = path.join(destination, relative);
|
|
51
|
+
fs.mkdirSync(path.dirname(target), { recursive: true });
|
|
52
|
+
fs.cpSync(source, target, { recursive: true, dereference: true });
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function scratchTreeSnapshot(root) {
|
|
56
|
+
const files = [];
|
|
57
|
+
const walk = dir => {
|
|
58
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true }).sort((left, right) => left.name.localeCompare(right.name))) {
|
|
59
|
+
const full = path.join(dir, entry.name);
|
|
60
|
+
if (entry.isDirectory()) walk(full);
|
|
61
|
+
else files.push([path.relative(root, full).split(path.sep).join('/'), crypto.createHash('sha256').update(fs.readFileSync(full)).digest('hex')]);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
walk(root);
|
|
65
|
+
return files;
|
|
66
|
+
}
|
|
67
|
+
function runScratchRunner(root, args) {
|
|
68
|
+
return spawnSync(process.execPath, [path.join(root, 'ci', 'archive', '325-prep', 'doc-reconciliation-red.js'), ...args], {
|
|
69
|
+
cwd: root, encoding: 'utf8', timeout: 90000, killSignal: 'SIGKILL'
|
|
70
|
+
});
|
|
71
|
+
}
|
|
47
72
|
|
|
48
73
|
console.log('=== #325 3b preparation: corpus, legacy controls and infrastructure bounds (H1+H2) ===');
|
|
49
74
|
|
|
@@ -69,24 +94,40 @@ checkCase('inventory: the H2 corpus covers P01-P07 with the L1 field shape', ()
|
|
|
69
94
|
}
|
|
70
95
|
});
|
|
71
96
|
|
|
72
|
-
// Infrastructure rule: an abnormal action result is never a qualified gap.
|
|
73
|
-
//
|
|
97
|
+
// Infrastructure rule: an abnormal action result is never a qualified gap. These controls start from one healthy OFF
|
|
98
|
+
// replay per P06 distribution and change only the route result.
|
|
74
99
|
const p01 = corpus.cases.find(item => item.id === 'P01');
|
|
75
|
-
const
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
100
|
+
const p06 = corpus.cases.find(item => item.id === 'P06');
|
|
101
|
+
const healthyP06 = {
|
|
102
|
+
off: {
|
|
103
|
+
source: fx.scrubReplay(fx.replayCase(p06, 'source')),
|
|
104
|
+
packaged: fx.scrubReplay(fx.replayCase(p06, 'packaged'))
|
|
105
|
+
},
|
|
106
|
+
on: {}
|
|
107
|
+
};
|
|
108
|
+
const injectIntoRoute = patch => {
|
|
109
|
+
const injected = JSON.parse(JSON.stringify(healthyP06));
|
|
110
|
+
for (const leg of ['source', 'packaged']) Object.assign(injected.off[leg].actions.route, patch);
|
|
80
111
|
return injected;
|
|
81
112
|
};
|
|
113
|
+
const assertRouteInfrastructure = (result, expected) => {
|
|
114
|
+
assert.strictEqual(result.status, 'INFRASTRUCTURE', `status ${result.status}`);
|
|
115
|
+
assert.deepStrictEqual(result.infrastructure, expected);
|
|
116
|
+
assert.deepStrictEqual(result.offending, {
|
|
117
|
+
leg: 'source', mode: 'off', actionId: 'route',
|
|
118
|
+
fault: expected[0].replace(/^source\.off\.route: /, '')
|
|
119
|
+
});
|
|
120
|
+
assert.deepStrictEqual(result.assertions, [], 'no assertion is qualified or classified for an infrastructure case');
|
|
121
|
+
assert.strictEqual(runner.exitCodeFor({ cases: [result] }, 'expect-red'), 2, 'expected-RED mode exits 2');
|
|
122
|
+
};
|
|
82
123
|
|
|
83
|
-
// locks: C — "unavailable observations ... cannot become a false PASS"; control:
|
|
84
|
-
checkCase('negative control: an abnormal route in
|
|
124
|
+
// locks: C — "unavailable observations ... cannot become a false PASS"; control: P06
|
|
125
|
+
checkCase('negative control: an abnormal OFF route in P06 is infrastructure while later plan/start/verify/Stop assertions stay unchanged', () => {
|
|
85
126
|
const injected = injectIntoRoute({ exitCode: 1 });
|
|
86
|
-
const later =
|
|
127
|
+
const later = p06.expectations.off.filter(assertion => /^(?:plan|start|verify|stop)-/.test(assertion.id));
|
|
87
128
|
for (const leg of ['source', 'packaged']) {
|
|
88
|
-
const before = fx.evaluateAll(
|
|
89
|
-
const after = fx.evaluateAll(injected.
|
|
129
|
+
const before = fx.evaluateAll(healthyP06.off[leg], later);
|
|
130
|
+
const after = fx.evaluateAll(injected.off[leg], later);
|
|
90
131
|
assert.deepStrictEqual(after.map(item => [item.id, item.pass, item.actual]), before.map(item => [item.id, item.pass, item.actual]),
|
|
91
132
|
`${leg}: the later assertions evaluate exactly as in the unmodified replay`);
|
|
92
133
|
for (const item of after) {
|
|
@@ -94,34 +135,42 @@ checkCase('negative control: an abnormal route in P01 is infrastructure, and --e
|
|
|
94
135
|
`${leg}: ${item.id} remains strict S1 GREEN, so only the infrastructure rule can stop the replay`);
|
|
95
136
|
}
|
|
96
137
|
}
|
|
97
|
-
const result = runner.classifyCase(
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
assert.strictEqual(runner.exitCodeFor({ cases: [result] }, 'expect-red'), 2, 'expected-RED mode exits nonzero');
|
|
138
|
+
const result = runner.classifyCase(p06, injected, []);
|
|
139
|
+
assertRouteInfrastructure(result, [
|
|
140
|
+
'source.off.route: exit 1 outside policy [0]',
|
|
141
|
+
'packaged.off.route: exit 1 outside policy [0]'
|
|
142
|
+
]);
|
|
103
143
|
});
|
|
104
144
|
|
|
105
|
-
// locks: C — "unavailable observations ... cannot become a false PASS"; control:
|
|
106
|
-
checkCase('negative control:
|
|
107
|
-
const result = runner.classifyCase(
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
145
|
+
// locks: C — "unavailable observations ... cannot become a false PASS"; control: P06
|
|
146
|
+
checkCase('negative control: an OFF route killed by a signal or without an exit status is infrastructure', () => {
|
|
147
|
+
const result = runner.classifyCase(p06, injectIntoRoute({ exitCode: null, signal: 'SIGTERM' }), []);
|
|
148
|
+
assertRouteInfrastructure(result, [
|
|
149
|
+
'source.off.route: terminated by signal SIGTERM',
|
|
150
|
+
'source.off.route: no exit status',
|
|
151
|
+
'packaged.off.route: terminated by signal SIGTERM',
|
|
152
|
+
'packaged.off.route: no exit status'
|
|
153
|
+
]);
|
|
111
154
|
});
|
|
112
155
|
|
|
113
|
-
// locks: C — "unavailable observations ... cannot become a false PASS"; control:
|
|
114
|
-
checkCase('negative control: a spawn error on the route is infrastructure', () => {
|
|
115
|
-
const result = runner.classifyCase(
|
|
116
|
-
|
|
117
|
-
|
|
156
|
+
// locks: C — "unavailable observations ... cannot become a false PASS"; control: P06
|
|
157
|
+
checkCase('negative control: a spawn error on the OFF route is infrastructure', () => {
|
|
158
|
+
const result = runner.classifyCase(p06, injectIntoRoute({ exitCode: null, error: 'spawnSync node ENOENT' }), []);
|
|
159
|
+
assertRouteInfrastructure(result, [
|
|
160
|
+
'source.off.route: spawn error spawnSync node ENOENT',
|
|
161
|
+
'source.off.route: no exit status',
|
|
162
|
+
'packaged.off.route: spawn error spawnSync node ENOENT',
|
|
163
|
+
'packaged.off.route: no exit status'
|
|
164
|
+
]);
|
|
118
165
|
});
|
|
119
166
|
|
|
120
|
-
// locks: C — "unavailable observations ... cannot become a false PASS"; control:
|
|
121
|
-
checkCase('negative control: an accepted route exit without the routing checkpoint is malformed required output', () => {
|
|
122
|
-
const result = runner.classifyCase(
|
|
123
|
-
|
|
124
|
-
|
|
167
|
+
// locks: C — "unavailable observations ... cannot become a false PASS"; control: P06
|
|
168
|
+
checkCase('negative control: an accepted OFF route exit without the routing checkpoint is malformed required output', () => {
|
|
169
|
+
const result = runner.classifyCase(p06, injectIntoRoute({ stdout: 'routing unavailable' }), []);
|
|
170
|
+
assertRouteInfrastructure(result, [
|
|
171
|
+
'source.off.route: malformed required output',
|
|
172
|
+
'packaged.off.route: malformed required output'
|
|
173
|
+
]);
|
|
125
174
|
});
|
|
126
175
|
|
|
127
176
|
// locks: C — "unavailable observations ... cannot become a false PASS"; control: P01
|
|
@@ -135,6 +184,129 @@ checkCase('--expect-red exits nonzero from the CLI when a real route exit falls
|
|
|
135
184
|
assert.ok(run.stdout.includes('INFRASTRUCTURE'), run.stdout);
|
|
136
185
|
});
|
|
137
186
|
|
|
187
|
+
// The scratch tree contains copied real source/package entries, not stubbed runtime modules. Missing only the retired
|
|
188
|
+
// pilot fingerprint file must still reach the replay child and the original infrastructure/classification path.
|
|
189
|
+
checkCase('the archived runner reaches real replay and fault classification when its retired pilot fingerprint is absent', () => {
|
|
190
|
+
const scratchRoot = path.join(workDir, 'missing-pilot-tree');
|
|
191
|
+
copyScratchTree(scratchRoot);
|
|
192
|
+
const scratchPrepDir = path.join(scratchRoot, 'ci', 'fixtures', 'doc-obligations', 'reconciliation-prep');
|
|
193
|
+
const casesFile = path.join(scratchPrepDir, 'scratch-cases.json');
|
|
194
|
+
const timeoutCasesFile = path.join(scratchPrepDir, 'scratch-timeout-cases.json');
|
|
195
|
+
const registryFile = path.join(scratchPrepDir, 'scratch-registry.json');
|
|
196
|
+
const stopOnly = {
|
|
197
|
+
...p01,
|
|
198
|
+
actions: [{ id: 'stop', op: 'stop' }],
|
|
199
|
+
expectations: {
|
|
200
|
+
off: [{ id: 'stop-exit', path: ['actions', 'stop', 'exitCode'], operator: 'equals', expected: 0 }],
|
|
201
|
+
on: [{ id: 'stop-exit', path: ['actions', 'stop', 'exitCode'], operator: 'equals', expected: 1 }]
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
const timeoutStopOnly = { ...stopOnly, childLimits: { timeoutMs: 1 } };
|
|
205
|
+
const historicalRegistry = JSON.parse(fs.readFileSync(path.join(PREP_DIR, 'pending-red.json'), 'utf8'));
|
|
206
|
+
const scratchRegistry = {
|
|
207
|
+
schemaVersion: 1,
|
|
208
|
+
baselineSha: historicalRegistry.baselineSha,
|
|
209
|
+
runtimeFingerprint: '0'.repeat(64), // syntactically valid scratch-only pin; the historical registry is untouched
|
|
210
|
+
entries: ['source', 'packaged'].map(distribution => ({
|
|
211
|
+
caseId: 'P01', assertionId: 'P01.on.stop-exit', distribution,
|
|
212
|
+
baselineSha: historicalRegistry.baselineSha, actual: 0, desired: 1,
|
|
213
|
+
blocker: '#341 E0', reasonCode: 'scratch-stop-control'
|
|
214
|
+
}))
|
|
215
|
+
};
|
|
216
|
+
fs.writeFileSync(casesFile, JSON.stringify({ cases: [stopOnly] }), 'utf8');
|
|
217
|
+
fs.writeFileSync(timeoutCasesFile, JSON.stringify({ cases: [timeoutStopOnly] }), 'utf8');
|
|
218
|
+
fs.writeFileSync(registryFile, JSON.stringify(scratchRegistry), 'utf8');
|
|
219
|
+
|
|
220
|
+
const sourcePilot = path.join(scratchRoot, 'hooks', 'scripts', 'lib', 'doc-reconciliation-pilot.js');
|
|
221
|
+
const packagedPilot = path.join(scratchRoot, 'plugins', 'harness-everything', 'hooks', 'scripts', 'lib', 'doc-reconciliation-pilot.js');
|
|
222
|
+
const sourceStopGate = path.join(scratchRoot, 'hooks', 'scripts', 'workflow-stop-gate.js');
|
|
223
|
+
const packagedStopGate = path.join(scratchRoot, 'plugins', 'harness-everything', 'hooks', 'scripts', 'workflow-stop-gate.js');
|
|
224
|
+
assert.deepStrictEqual(fs.readFileSync(sourceStopGate), fs.readFileSync(path.join(ROOT, 'hooks', 'scripts', 'workflow-stop-gate.js')));
|
|
225
|
+
assert.deepStrictEqual(fs.readFileSync(packagedStopGate), fs.readFileSync(path.join(ROOT, 'plugins', 'harness-everything', 'hooks', 'scripts', 'workflow-stop-gate.js')));
|
|
226
|
+
fs.rmSync(sourcePilot, { force: true });
|
|
227
|
+
fs.rmSync(packagedPilot, { force: true });
|
|
228
|
+
assert.ok(!fs.existsSync(sourcePilot) && !fs.existsSync(packagedPilot), 'both retired pilot files are absent in the scratch tree');
|
|
229
|
+
const beforeRuns = scratchTreeSnapshot(scratchRoot);
|
|
230
|
+
const args = ['--expect-red', '--json', '--cases', path.relative(scratchRoot, casesFile), '--registry', path.relative(scratchRoot, registryFile)];
|
|
231
|
+
|
|
232
|
+
const first = runScratchRunner(scratchRoot, args);
|
|
233
|
+
const second = runScratchRunner(scratchRoot, args);
|
|
234
|
+
for (const [index, run] of [first, second].entries()) {
|
|
235
|
+
assert.ok(!run.error, `run ${index + 1} spawned: ${run.error}`);
|
|
236
|
+
assert.strictEqual(run.signal, null, `run ${index + 1} exited without a signal`);
|
|
237
|
+
assert.strictEqual(run.status, 1, `run ${index + 1} fails closed after the real replay: status=${run.status}; stdout=${run.stdout.replace(/\s+/g, ' ')}; stderr=${run.stderr}`);
|
|
238
|
+
const report = JSON.parse(run.stdout);
|
|
239
|
+
const result = report.cases[0];
|
|
240
|
+
assert.strictEqual(report.runtimeFingerprintAvailable, false);
|
|
241
|
+
assert.strictEqual(report.runtimeFingerprintMatches, false);
|
|
242
|
+
assert.strictEqual(report.replaysRun, 4, 'source and packaged Stop-gate children ran in both modes');
|
|
243
|
+
assert.strictEqual(result.assertions.length, 4, 'the real Stop-gate action was classified in every replay');
|
|
244
|
+
assert.ok(result.assertions.every(entry => entry.actual === 0), 'all source/package Stop-gate children returned their real exit code');
|
|
245
|
+
assert.strictEqual(result.status, 'FAIL');
|
|
246
|
+
assert.strictEqual(result.qualifiedGaps, 0, 'the scratch registry entries cannot qualify without a fingerprint');
|
|
247
|
+
assert.strictEqual(result.parity, 'match', 'the un-stubbed source and packaged Stop gates agree');
|
|
248
|
+
assert.strictEqual(result.reason, 'runtime fingerprint unavailable because the retired pilot file is missing');
|
|
249
|
+
assert.ok(!result.assertions.some(entry => entry.status === 'gap-qualified'));
|
|
250
|
+
assert.strictEqual(result.assertions.filter(entry => entry.status === 'gap-unqualified').length, 2);
|
|
251
|
+
assert.strictEqual(report.pilotCredit, false);
|
|
252
|
+
assert.strictEqual(Object.hasOwn(report, 'recaptureCommand'), false, 'unavailable is not a recapture invitation');
|
|
253
|
+
assert.ok(!/recapture/i.test(run.stderr), run.stderr);
|
|
254
|
+
assert.deepStrictEqual(scratchTreeSnapshot(scratchRoot), beforeRuns, 'replays leave the scratch tree unchanged');
|
|
255
|
+
}
|
|
256
|
+
assert.deepStrictEqual(JSON.parse(second.stdout), JSON.parse(first.stdout), 'two clean equivalent replays have identical reports');
|
|
257
|
+
|
|
258
|
+
const faultArgs = [...args];
|
|
259
|
+
faultArgs[faultArgs.indexOf(path.relative(scratchRoot, casesFile))] = path.relative(scratchRoot, timeoutCasesFile);
|
|
260
|
+
const faultFirst = runScratchRunner(scratchRoot, faultArgs);
|
|
261
|
+
const faultSecond = runScratchRunner(scratchRoot, faultArgs);
|
|
262
|
+
for (const [index, run] of [faultFirst, faultSecond].entries()) {
|
|
263
|
+
assert.ok(!run.error, `fault run ${index + 1} spawned: ${run.error}`);
|
|
264
|
+
assert.strictEqual(run.signal, null, `fault run ${index + 1} exited without a signal`);
|
|
265
|
+
assert.strictEqual(run.status, 2, `fault run ${index + 1} is classified as infrastructure: ${run.stdout} ${run.stderr}`);
|
|
266
|
+
const report = JSON.parse(run.stdout);
|
|
267
|
+
const result = report.cases[0];
|
|
268
|
+
assert.strictEqual(report.replaysRun, 1, 'the real timed-out Stop-gate child is recorded');
|
|
269
|
+
assert.strictEqual(result.status, 'INFRASTRUCTURE');
|
|
270
|
+
assert.strictEqual(result.actionsRun, 1);
|
|
271
|
+
assert.deepStrictEqual(result.offending, {
|
|
272
|
+
leg: 'source', mode: 'off', actionId: 'stop', fault: 'timed out at the child deadline (ETIMEDOUT)'
|
|
273
|
+
});
|
|
274
|
+
assert.strictEqual(result.qualifiedGaps, 0);
|
|
275
|
+
assert.strictEqual(Object.hasOwn(report, 'recaptureCommand'), false);
|
|
276
|
+
assert.ok(!/recapture/i.test(run.stderr), run.stderr);
|
|
277
|
+
assert.deepStrictEqual(scratchTreeSnapshot(scratchRoot), beforeRuns, 'faulted replays leave the scratch tree unchanged');
|
|
278
|
+
}
|
|
279
|
+
assert.deepStrictEqual(JSON.parse(faultSecond.stdout), JSON.parse(faultFirst.stdout), 'two clean equivalent fault runs have identical reports');
|
|
280
|
+
|
|
281
|
+
const malformedRegistry = JSON.parse(JSON.stringify(scratchRegistry));
|
|
282
|
+
delete malformedRegistry.entries[0].reasonCode;
|
|
283
|
+
const malformedRegistryFile = path.join(scratchPrepDir, 'scratch-malformed-registry.json');
|
|
284
|
+
fs.writeFileSync(malformedRegistryFile, JSON.stringify(malformedRegistry), 'utf8');
|
|
285
|
+
const malformedArgs = [...args];
|
|
286
|
+
malformedArgs[malformedArgs.indexOf(path.relative(scratchRoot, registryFile))] = path.relative(scratchRoot, malformedRegistryFile);
|
|
287
|
+
const malformed = runScratchRunner(scratchRoot, malformedArgs);
|
|
288
|
+
assert.strictEqual(malformed.status, 2, 'malformed registry remains an infrastructure error');
|
|
289
|
+
assert.strictEqual(malformed.stdout, '', 'malformed registry fails before replay');
|
|
290
|
+
assert.ok(malformed.stderr.includes('must have exactly the keys'), malformed.stderr);
|
|
291
|
+
|
|
292
|
+
const candidateFile = path.join(scratchPrepDir, 'scratch-candidate.json');
|
|
293
|
+
const recapture = runScratchRunner(scratchRoot, [
|
|
294
|
+
'--recapture-candidate', path.relative(scratchRoot, candidateFile),
|
|
295
|
+
'--baseline-sha', historicalRegistry.baselineSha,
|
|
296
|
+
'--cases', path.relative(scratchRoot, casesFile)
|
|
297
|
+
]);
|
|
298
|
+
assert.strictEqual(recapture.status, 2, 'candidate recapture is refused without the fingerprint');
|
|
299
|
+
assert.ok(recapture.stderr.includes('runtime fingerprint unavailable'), recapture.stderr);
|
|
300
|
+
assert.ok(!fs.existsSync(candidateFile), 'no candidate registry is written');
|
|
301
|
+
|
|
302
|
+
const otherFingerprintFile = path.join(scratchRoot, 'hooks', 'scripts', 'lib', 'workflow-obligations.js');
|
|
303
|
+
fs.rmSync(otherFingerprintFile);
|
|
304
|
+
const otherIo = runScratchRunner(scratchRoot, args);
|
|
305
|
+
assert.strictEqual(otherIo.status, 2, 'a missing non-pilot fingerprint file remains an infrastructure error');
|
|
306
|
+
assert.strictEqual(otherIo.stdout, '', 'other fingerprint I/O errors fail before replay');
|
|
307
|
+
assert.ok(otherIo.stderr.includes('workflow-obligations.js') && otherIo.stderr.includes('ENOENT'), otherIo.stderr);
|
|
308
|
+
});
|
|
309
|
+
|
|
138
310
|
// Real process boundary: a substituted child (hung or flooding) under a short deadline runs through the CLI. The
|
|
139
311
|
// outer SIGKILL deadline turns a regression (the runner never returns) into a failed check instead of a hung suite.
|
|
140
312
|
const OUTER_DEADLINE_MS = 90000;
|
|
@@ -290,19 +462,6 @@ checkCase('F-a: Windows-shaped source and packaged paths normalize identically',
|
|
|
290
462
|
assert.strictEqual(sameAfterFold, sourceTmp, 'POSIX and Windows spellings of one path normalize identically');
|
|
291
463
|
});
|
|
292
464
|
|
|
293
|
-
// F-b: a per-action switch override must not reach an OFF replay.
|
|
294
|
-
// locks: unresolved — OFF replay carries no per-action switch; the I2 invariant is not in the A/B/C/R3 table
|
|
295
|
-
checkCase('F-b: an OFF replay of P05 carries no per-action switch; the ON replay keeps its overrides', () => {
|
|
296
|
-
const item = corpus.cases.find(candidate => candidate.id === 'P05');
|
|
297
|
-
const off = fx.replayCase(item, 'source');
|
|
298
|
-
for (const [id, action] of Object.entries(off.actions)) {
|
|
299
|
-
assert.strictEqual(action.pilot, undefined, `OFF replay action ${id} has no switch value`);
|
|
300
|
-
}
|
|
301
|
-
const on = fx.replayCase(item, 'source', { pilot: '1' });
|
|
302
|
-
assert.strictEqual(on.actions['stop-on-1'].pilot, '1', 'an ON replay keeps the ON action value');
|
|
303
|
-
assert.strictEqual(on.actions['stop-off'].pilot, '0', 'an ON replay keeps the explicit OFF action value');
|
|
304
|
-
});
|
|
305
|
-
|
|
306
465
|
fs.rmSync(workDir, { recursive: true, force: true });
|
|
307
466
|
console.log(failed ? `\n${failed} preparation check(s) failed` : '\nAll preparation checks passed');
|
|
308
467
|
process.exitCode = failed ? 1 : 0;
|