harness-everything 1.2.2 → 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 (147) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +29 -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/468-dispatch/agy-quota-PROVENANCE.md +19 -0
  7. package/ci/fixtures/468-dispatch/agy-quota-direct-individual.stderr +2 -0
  8. package/ci/fixtures/468-dispatch/agy-quota-direct-third-party.stderr +2 -0
  9. package/ci/fixtures/468-dispatch/agy-quota-exec-individual.log +3 -0
  10. package/ci/fixtures/553-t2a/body-edit/base/.agents/harness-everything/project-docs.json +11 -0
  11. package/ci/fixtures/553-t2a/body-edit/base/docs/a.md +6 -0
  12. package/ci/fixtures/553-t2a/body-edit/base/docs/b.md +1 -0
  13. package/ci/fixtures/553-t2a/body-edit/candidate/docs/a.md +6 -0
  14. package/ci/fixtures/553-t2c/derived-regenerate-must/base/docs/adr/EVID-001-verify-all-evidence.md +11 -0
  15. package/ci/fixtures/553-t2c/derived-regenerate-must/base/docs/governed-index.md +19 -0
  16. package/ci/fixtures/553-t2c/derived-regenerate-must/candidate/docs/adr/EVID-001-verify-all-evidence.md +11 -0
  17. package/ci/fixtures/553-t2c/derived-regenerate-must/candidate/docs/governed-index.md +19 -0
  18. package/ci/fixtures/553-t2c/derived-regenerate-must/config.json +17 -0
  19. package/ci/fixtures/doc-obligations/derive/regression-pins.json +153 -0
  20. package/ci/fixtures/state-persist-post-tool-use/harness.js +206 -0
  21. package/ci/fixtures/state-persist-post-tool-use/off-handoff-golden.json +16 -0
  22. package/ci/fixtures/state-persist-post-tool-use/payload-post-tool-use-success.json +13 -0
  23. package/ci/fixtures/stop/fail-session-writes.js +109 -0
  24. package/ci/fixtures/workflow-contract/cases.json +3355 -0
  25. package/ci/fixtures/workflow-contract/wiring-cases.json +560 -0
  26. package/ci/lib/doc-reconciliation-prep-fixtures.js +4 -9
  27. package/ci/mechanism-2an-workflow-replay.test.js +324 -0
  28. package/ci/mechanism-2ax-doc-lifecycle.test.js +132 -0
  29. package/ci/mechanism-325-3a-doc-evidence.test.js +73 -0
  30. package/ci/mechanism-325-3a-doc-obligations.test.js +61 -0
  31. package/ci/mechanism-325-3b-preparation.test.js +208 -49
  32. package/ci/mechanism-325-3b-s1-review.test.js +20 -828
  33. package/ci/mechanism-325-3b-s3-providers.test.js +59 -0
  34. package/ci/mechanism-325-f3-derived-views.test.js +140 -0
  35. package/ci/mechanism-341-opencode-lane.test.js +164 -284
  36. package/ci/mechanism-35-verification-contract.test.js +246 -0
  37. package/ci/mechanism-365-step-edit-accounting.test.js +5 -6
  38. package/ci/mechanism-383-doc-glob-line-terminators.test.js +0 -30
  39. package/ci/mechanism-397-opencode-observations.test.js +151 -18
  40. package/ci/mechanism-468-dispatch-cli.test.js +1496 -4
  41. package/ci/mechanism-548-bigint-identity.test.js +531 -0
  42. package/ci/mechanism-553-e1-unhook-credit.test.js +328 -0
  43. package/ci/mechanism-553-p2a-claude-hooks.test.js +98 -0
  44. package/ci/mechanism-553-p3-plan-start.test.js +212 -0
  45. package/ci/mechanism-553-state-persist-post-tool-use.test.js +307 -0
  46. package/ci/mechanism-553-stop.test.js +427 -0
  47. package/ci/mechanism-553-t2a-derive.test.js +110 -0
  48. package/ci/mechanism-553-t2c-derive.test.js +94 -0
  49. package/ci/mechanism-e1-derived-regenerate.test.js +45 -206
  50. package/ci/mechanism-error-ledger-oracle.test.js +786 -3
  51. package/ci/mechanism-error-ledger-scan.test.js +981 -0
  52. package/ci/mechanism-outline-sanitizer.test.js +0 -8
  53. package/ci/mechanism-pr-a-conflict-check.test.js +38 -305
  54. package/ci/mechanism-prb-outline-review.test.js +101 -3283
  55. package/ci/mechanism-report-writer.test.js +45 -0
  56. package/docs/adr/DOCS-006-reconciliation-pilot.md +4 -2
  57. package/docs/adr/DOCS-008-obligation-abstraction-bounded-consumer.md +3 -3
  58. package/docs/doc-workflow-reconciliation.md +17 -2
  59. package/docs/document-lifecycle.md +6 -2
  60. package/docs/error-handling/details/c8-dispatch-cli.md +109 -13
  61. package/docs/platform-capabilities.md +35 -5
  62. package/error-ledger-bootstrap/SKILL.md +1 -1
  63. package/error-ledger-bootstrap/references/workflow.md +42 -7
  64. package/error-ledger-bootstrap/scripts/promote.js +8 -6
  65. package/error-ledger-bootstrap/scripts/scan.js +525 -12
  66. package/hooks/hooks.json +0 -46
  67. package/hooks/scripts/lib/workflow-obligations.js +0 -55
  68. package/hooks/scripts/state-persist.js +7 -95
  69. package/hooks/scripts/workflow-disposition.js +0 -2
  70. package/hooks/scripts/workflow-stop-gate.js +17 -30
  71. package/opencode-plugin/index.mjs +6 -70
  72. package/opencode-plugin/plugin.json +1 -1
  73. package/package.json +1 -1
  74. package/plugins/harness-everything/.antigravity-plugin/plugin.json +1 -1
  75. package/plugins/harness-everything/.codex-plugin/plugin.json +1 -1
  76. package/plugins/harness-everything/hooks/scripts/lib/workflow-obligations.js +0 -55
  77. package/plugins/harness-everything/hooks/scripts/state-persist.js +7 -95
  78. package/plugins/harness-everything/hooks/scripts/workflow-disposition.js +0 -2
  79. package/plugins/harness-everything/hooks/scripts/workflow-stop-gate.js +17 -30
  80. package/plugins/harness-everything/plugin.json +1 -1
  81. package/plugins/harness-everything/skills/error-ledger-bootstrap/SKILL.md +1 -1
  82. package/plugins/harness-everything/skills/error-ledger-bootstrap/references/workflow.md +42 -7
  83. package/plugins/harness-everything/skills/error-ledger-bootstrap/scripts/promote.js +8 -6
  84. package/plugins/harness-everything/skills/error-ledger-bootstrap/scripts/scan.js +525 -12
  85. package/sbom.cdx.json +7 -7
  86. package/scripts/dispatch.js +499 -87
  87. package/scripts/error-ledger-oracle.js +521 -27
  88. package/scripts/errors-sync.js +4 -3
  89. package/scripts/report-writer.js +4 -3
  90. package/ci/fixtures/doc-obligations/reconciliation-s1/cases.json +0 -6854
  91. package/ci/fixtures/doc-obligations/reconciliation-s1/fail-session-writes.js +0 -116
  92. package/ci/fixtures/doc-obligations/reconciliation-s2a/harness.js +0 -507
  93. package/ci/fixtures/doc-obligations/reconciliation-s2a/run13-workflow-requirements.json +0 -42
  94. package/ci/fixtures/doc-obligations/reconciliation-s2a/vectors.json +0 -617
  95. package/ci/fixtures/doc-obligations/reconciliation-s2b/capture/harness.js +0 -415
  96. package/ci/fixtures/doc-obligations/reconciliation-s2b/capture/payload-post-tool-use-success-minimal.json +0 -9
  97. package/ci/fixtures/doc-obligations/reconciliation-s2b/capture/payload-subagent-start.json +0 -7
  98. package/ci/fixtures/doc-obligations/reconciliation-s2b/capture/payload-subagent-stop-freetext-reject.json +0 -11
  99. package/ci/fixtures/doc-obligations/reconciliation-s2b/capture/payload-subagent-stop-reject.json +0 -11
  100. package/ci/fixtures/doc-obligations/reconciliation-s2b/capture/payload-subagent-stop.json +0 -11
  101. package/ci/fixtures/doc-obligations/reconciliation-s2b/capture/payload-task-result.json +0 -19
  102. package/ci/fixtures/doc-obligations/reconciliation-s2b/corpus/off-capture-only.json +0 -99
  103. package/ci/fixtures/doc-obligations/reconciliation-s2b/corpus/off-legacy.json +0 -67
  104. package/ci/fixtures/doc-obligations/reconciliation-s2b/corpus/on-concurrent-writers.json +0 -62
  105. package/ci/fixtures/doc-obligations/reconciliation-s2b/corpus/on-lookalikes-runtime-mutations.json +0 -67
  106. package/ci/fixtures/doc-obligations/reconciliation-s2b/corpus/on-malformed.json +0 -85
  107. package/ci/fixtures/doc-obligations/reconciliation-s2b/corpus/on-normal-session.json +0 -74
  108. package/ci/fixtures/doc-obligations/reconciliation-s2b/corpus/on-runtime-drift-later-npm-test.json +0 -58
  109. package/ci/fixtures/doc-obligations/reconciliation-s2b/corpus/on-valid-direct-quoted-review.json +0 -85
  110. package/ci/fixtures/doc-obligations/reconciliation-s2b/f4/cases.json +0 -2267
  111. package/ci/fixtures/doc-obligations/reconciliation-s2b/wiring/cases.json +0 -1110
  112. package/ci/lib/doc-reconciliation-file-spy.js +0 -23
  113. package/ci/lib/doc-reconciliation-qualification-preload.js +0 -37
  114. package/ci/lib/doc-reconciliation-replay.js +0 -104
  115. package/ci/lib/doc-reconciliation-staged-tree.js +0 -102
  116. package/ci/mechanism-325-3b-h1-qualification.test.js +0 -206
  117. package/ci/mechanism-325-3b-s1.test.js +0 -188
  118. package/ci/mechanism-325-3b-s2a-core.test.js +0 -840
  119. package/ci/mechanism-325-3b-s2a-producer.test.js +0 -564
  120. package/ci/mechanism-325-3b-s2b-capture.test.js +0 -566
  121. package/ci/mechanism-325-3b-s2b-wiring.test.js +0 -679
  122. package/ci/mechanism-325-f4-invariants.test.js +0 -606
  123. package/ci/mechanism-325-f4-projections.test.js +0 -392
  124. package/ci/mechanism-325-f4-qualification.test.js +0 -228
  125. package/ci/mechanism-325-f4-trust-boundary.test.js +0 -880
  126. package/ci/mechanism-e1-dependency-artifact-scope.test.js +0 -657
  127. package/hooks/scripts/lib/doc-reconciliation-capture.sanitized.jsonl +0 -26
  128. package/hooks/scripts/lib/doc-reconciliation-core.js +0 -336
  129. package/hooks/scripts/lib/doc-reconciliation-events.js +0 -292
  130. package/hooks/scripts/lib/doc-reconciliation-outline-capture.sanitized.jsonl +0 -24
  131. package/hooks/scripts/lib/doc-reconciliation-pilot.js +0 -482
  132. package/hooks/scripts/lib/doc-reconciliation-producer.js +0 -468
  133. package/hooks/scripts/lib/doc-reconciliation-provider.js +0 -3304
  134. package/hooks/scripts/lib/doc-reconciliation-qualification.json +0 -54
  135. package/hooks/scripts/w6-state-operations.js +0 -239
  136. package/plugins/harness-everything/hooks/scripts/lib/doc-reconciliation-capture.sanitized.jsonl +0 -26
  137. package/plugins/harness-everything/hooks/scripts/lib/doc-reconciliation-core.js +0 -336
  138. package/plugins/harness-everything/hooks/scripts/lib/doc-reconciliation-events.js +0 -292
  139. package/plugins/harness-everything/hooks/scripts/lib/doc-reconciliation-outline-capture.sanitized.jsonl +0 -24
  140. package/plugins/harness-everything/hooks/scripts/lib/doc-reconciliation-pilot.js +0 -482
  141. package/plugins/harness-everything/hooks/scripts/lib/doc-reconciliation-producer.js +0 -468
  142. package/plugins/harness-everything/hooks/scripts/lib/doc-reconciliation-provider.js +0 -3304
  143. package/plugins/harness-everything/hooks/scripts/lib/doc-reconciliation-qualification.json +0 -54
  144. package/plugins/harness-everything/hooks/scripts/w6-state-operations.js +0 -239
  145. package/scripts/system-one-eval-laya.js +0 -112
  146. /package/ci/fixtures/{doc-obligations/reconciliation-s2b/capture → state-persist-post-tool-use}/payload-post-tool-use-failure.json +0 -0
  147. /package/ci/fixtures/{doc-obligations/reconciliation-s2b/wiring → workflow-contract}/legacy-off-golden.json +0 -0
@@ -261,6 +261,65 @@ for (const leg of LEGS) {
261
261
  }
262
262
  }
263
263
 
264
+ // ---- H1: A / B / omitted advisory provider judgment (moved from 325-3b-h1-qualification) ------------------------------
265
+ // Same three inputs and the same exact-array assertion as the retired H1 qualification suite.
266
+ const H1_PROVIDER_CASES = [
267
+ {
268
+ id: 'A',
269
+ input: {
270
+ activeStep: { id: 'verify-docs', stepType: 'verification' },
271
+ neededCapabilities: ['doc-lint'],
272
+ availableProviderMetadata: [
273
+ { providerId: 'fixture-lint-a', capabilities: ['doc-lint'], stepTypes: ['verification'], requiresHostCapabilities: ['execution-events'], locator: { kind: 'tool', id: 'fixture-lint-a' } }
274
+ ],
275
+ hostCapabilities: ['execution-events']
276
+ },
277
+ suggestions: [{ capability: 'doc-lint', providerId: 'fixture-lint-a', availability: 'available', reason: R_OK }],
278
+ unavailable: []
279
+ },
280
+ {
281
+ id: 'B',
282
+ input: {
283
+ activeStep: { id: 'verify-docs', stepType: 'verification' },
284
+ neededCapabilities: ['doc-lint'],
285
+ availableProviderMetadata: [
286
+ { providerId: 'fixture-lint-b', capabilities: ['doc-lint'], stepTypes: ['verification'], requiresHostCapabilities: ['execution-events'], locator: { kind: 'tool', id: 'fixture-lint-b' } }
287
+ ],
288
+ hostCapabilities: ['execution-events']
289
+ },
290
+ suggestions: [{ capability: 'doc-lint', providerId: 'fixture-lint-b', availability: 'available', reason: R_OK }],
291
+ unavailable: []
292
+ },
293
+ {
294
+ id: 'omitted',
295
+ input: {
296
+ activeStep: { id: 'verify-docs', stepType: 'verification' },
297
+ neededCapabilities: ['doc-lint'],
298
+ availableProviderMetadata: [],
299
+ hostCapabilities: []
300
+ },
301
+ suggestions: [],
302
+ unavailable: [{ capability: 'doc-lint', reason: NO_META }]
303
+ }
304
+ ];
305
+
306
+ for (const leg of LEGS) {
307
+ const { mod, error } = loadLeg(leg);
308
+ for (const item of H1_PROVIDER_CASES) {
309
+ const id = `H1.${leg.name}.${item.id}.provider-suggestion`;
310
+ if (error) { record('FAIL', id, leg.name, error); continue; }
311
+ try {
312
+ const out = mod.suggestDocProviders(cloneJson(item.input));
313
+ if (JSON.stringify(out.suggestions) !== JSON.stringify(item.suggestions) || JSON.stringify(out.unavailable) !== JSON.stringify(item.unavailable)) {
314
+ throw new Error(`suggestions=${stable(out.suggestions)}, unavailable=${stable(out.unavailable)}`);
315
+ }
316
+ record('PASS', id, leg.name);
317
+ } catch (error) {
318
+ record('FAIL', id, leg.name, error.message.split('\n')[0]);
319
+ }
320
+ }
321
+ }
322
+
264
323
  // ---- Output shape: no channel that could remove or waive a capability -----------------------------------------------
265
324
  assertPerLeg('output:exact-key-shapes-and-no-removal-channel', suggest => {
266
325
  const outputs = [
@@ -830,6 +830,146 @@ if (process.argv.includes('--mutation-probes')) {
830
830
  }
831
831
  }
832
832
 
833
+ // =====================================================================================================================
834
+ // Appended block (packet T2-C #553) — surviving CLI --derived-view controls moved from
835
+ // ci/mechanism-e1-derived-regenerate.test.js (wholeSeamFixture plain/derived comparison, matching
836
+ // digests/coverage + plain-check firebreak, stale no-overwrite, unsupported no-arbitrary-execution)
837
+ // on both source and packaged legs.
838
+ // =====================================================================================================================
839
+
840
+ const T2C_SOURCE = 'docs/adr/EVID-001-verify-all-evidence.md';
841
+ const T2C_VIEW = 'docs/governed-index.md';
842
+ const T2C_GENERATOR = 'node harness-everything/scripts/doc-lifecycle.js index --workspace . --config ' + CONFIG + ' --all';
843
+
844
+ function t2cSha(bytes) {
845
+ return crypto.createHash('sha256').update(bytes).digest('hex');
846
+ }
847
+
848
+ function t2cGit(ws, args) {
849
+ const env = { ...process.env, GIT_CONFIG_NOSYSTEM: '1' };
850
+ for (const key of Object.keys(env)) if (key.startsWith('GIT_')) delete env[key];
851
+ const r = spawnSync('git', ['-C', ws, ...args], { env, encoding: 'utf8' });
852
+ if (r.status !== 0) throw new Error(`git ${args.join(' ')} failed: ${truncate(r.stderr)}`);
853
+ return r.stdout.trim();
854
+ }
855
+
856
+ function t2cGenerateIndex(ws) {
857
+ const r = spawnSync(process.execPath, [
858
+ path.join(ws, 'harness-everything', 'scripts', 'doc-lifecycle.js'),
859
+ 'index', '--workspace', ws, '--config', CONFIG, '--all'
860
+ ], { cwd: ws, encoding: 'utf8' });
861
+ if (r.status !== 0) throw new Error(`lifecycle index generation failed: ${truncate(r.stderr)}`);
862
+ writeDoc(ws, T2C_VIEW, r.stdout);
863
+ }
864
+
865
+ function t2cDerivedFixture(leg, generator = T2C_GENERATOR) {
866
+ const ws = fs.realpathSync(fs.mkdtempSync(path.join(os.tmpdir(), 'f3-t2c-derived-')));
867
+ tmpDirs.push(ws);
868
+ const config = {
869
+ governed: [{ path: 'docs/adr/*.md', role: 'adr' }],
870
+ domains: ['EVID'],
871
+ derived: [{ path: T2C_VIEW, generator }]
872
+ };
873
+ writeDoc(ws, CONFIG, JSON.stringify(config, null, 2) + '\n');
874
+ writeDoc(ws, T2C_SOURCE, '---\nid: EVID-001\nrole: adr\nstatus: proposed\n---\n\n# EVID-001\n\n## Decision\n\nRetain evidence identities for generated views.\n');
875
+ fs.mkdirSync(path.join(ws, 'harness-everything', 'scripts'), { recursive: true });
876
+ fs.copyFileSync(path.join(leg.dir, 'doc-lifecycle.js'), path.join(ws, 'harness-everything', 'scripts', 'doc-lifecycle.js'));
877
+ fs.copyFileSync(path.join(leg.dir, 'project-docs-resolver.js'), path.join(ws, 'harness-everything', 'scripts', 'project-docs-resolver.js'));
878
+ t2cGenerateIndex(ws);
879
+ return ws;
880
+ }
881
+
882
+ function t2cWholeSeamFixture(leg) {
883
+ const ws = fs.realpathSync(fs.mkdtempSync(path.join(os.tmpdir(), 'f3-t2c-whole-seam-')));
884
+ tmpDirs.push(ws);
885
+ const config = {
886
+ governed: [{ path: 'docs/adr/*.md', role: 'adr' }],
887
+ domains: ['EVID'],
888
+ derived: [{ path: T2C_VIEW, generator: T2C_GENERATOR }]
889
+ };
890
+ const source = (status, text) => `---\nid: EVID-001\nrole: adr\nstatus: ${status}\n---\n\n# EVID-001\n\n## Decision\n\n${text}\n`;
891
+ writeDoc(ws, CONFIG, JSON.stringify(config, null, 2) + '\n');
892
+ writeDoc(ws, T2C_SOURCE, source('proposed', 'Baseline evidence identity.'));
893
+ fs.mkdirSync(path.join(ws, 'harness-everything', 'scripts'), { recursive: true });
894
+ fs.copyFileSync(path.join(leg.dir, 'doc-lifecycle.js'), path.join(ws, 'harness-everything', 'scripts', 'doc-lifecycle.js'));
895
+ fs.copyFileSync(path.join(leg.dir, 'project-docs-resolver.js'), path.join(ws, 'harness-everything', 'scripts', 'project-docs-resolver.js'));
896
+ t2cGenerateIndex(ws);
897
+ t2cGit(ws, ['init', '-q']);
898
+ t2cGit(ws, ['add', '-A']);
899
+ t2cGit(ws, ['-c', 'user.name=e1-fixture', '-c', 'user.email=e1-fixture@invalid', '-c', 'commit.gpgsign=false', 'commit', '-q', '--no-verify', '-m', 'baseline']);
900
+ writeDoc(ws, T2C_SOURCE, source('accepted', 'Candidate evidence identity.'));
901
+ t2cGenerateIndex(ws);
902
+ return ws;
903
+ }
904
+
905
+ function t2cRunCheck(leg, ws, withView = true) {
906
+ const args = ['--changed-path', T2C_SOURCE];
907
+ if (withView) args.push('--derived-view', T2C_VIEW);
908
+ return spawnIt(leg.dir, 'check', ['--workspace', ws, '--config', CONFIG, ...args], { cwd: ws });
909
+ }
910
+
911
+ assertPerLeg('case-t2c-1:whole-seam-plain-and-derived-cli', leg => {
912
+ const ws = t2cWholeSeamFixture(leg);
913
+ const plain = t2cRunCheck(leg, ws, false);
914
+ same(plain.status, 0, 'plain-check positive control exit');
915
+ const plainReport = jsonOut(plain);
916
+ same(plainReport.capabilities['derived-regenerate'], undefined, 'plain-check omits derived-regenerate');
917
+
918
+ const checked = t2cRunCheck(leg, ws, true);
919
+ same(checked.status, 0, 'registered --derived-view check exit');
920
+ const report = jsonOut(checked);
921
+ const projection = report.capabilities['derived-regenerate'];
922
+ same(projection.state, 'pass', 'derived-regenerate state');
923
+ same(projection.checkedPaths, [T2C_VIEW], 'derived-regenerate checkedPaths');
924
+ });
925
+
926
+ assertPerLeg('case-t2c-2:derived-view-matching-digests-coverage-and-plain-firebreak', leg => {
927
+ const matching = t2cDerivedFixture(leg);
928
+ const matchingBytes = fs.readFileSync(path.join(matching, T2C_VIEW));
929
+ const matchingRun = t2cRunCheck(leg, matching, true);
930
+ same(matchingRun.status, 0, `matching check exit: ${truncate(matchingRun.stderr)}`);
931
+ const matchingReport = jsonOut(matchingRun);
932
+ const positive = matchingReport.capabilities['derived-regenerate'];
933
+ same(positive.state, 'pass', 'positive state');
934
+ same(positive.checkedPaths, [T2C_VIEW], 'positive checkedPaths');
935
+ same(positive.binding.generation.state, 'pass', 'generation state');
936
+ same(positive.binding.comparison.state, 'equal', 'comparison state');
937
+ same(positive.binding.generation.outputDigest, t2cSha(matchingBytes), 'outputDigest');
938
+ same(positive.binding.comparison.targetDigest, t2cSha(matchingBytes), 'targetDigest');
939
+ same(positive.binding.sourceCorpus.complete, true, 'sourceCorpus complete');
940
+ same(positive.binding.sourceCorpus.paths, [T2C_SOURCE], 'sourceCorpus paths');
941
+ same(positive.binding.config.digest, t2cSha(fs.readFileSync(path.join(matching, CONFIG))), 'config digest');
942
+ same(matchingReport.coverage.unsupported.some(item => item.path === T2C_VIEW), false, 'coverage unsupported excludes verified view');
943
+
944
+ const plain = t2cRunCheck(leg, matching, false);
945
+ same(plain.status, 0, `plain firebreak exit: ${truncate(plain.stderr)}`);
946
+ same(jsonOut(plain).capabilities['derived-regenerate'], undefined, 'plain firebreak omits derived-regenerate');
947
+ });
948
+
949
+ assertPerLeg('case-t2c-3:derived-view-stale-no-overwrite', leg => {
950
+ const stale = t2cDerivedFixture(leg);
951
+ const staleTarget = path.join(stale, T2C_VIEW);
952
+ fs.appendFileSync(staleTarget, '\nmanual stale edit\n');
953
+ const staleBefore = fs.readFileSync(staleTarget);
954
+ const staleRun = t2cRunCheck(leg, stale, true);
955
+ same(staleRun.status, 0, `stale check exit: ${truncate(staleRun.stderr)}`);
956
+ const staleProjection = jsonOut(staleRun).capabilities['derived-regenerate'];
957
+ same(staleProjection.state, 'stale', 'stale projection state');
958
+ same(staleProjection.binding.generation.state, 'pass', 'stale generation state');
959
+ same(staleProjection.binding.comparison.state, 'stale', 'stale comparison state');
960
+ if (!fs.readFileSync(staleTarget).equals(staleBefore)) throw new Error('stale target must not be rewritten');
961
+ });
962
+
963
+ assertPerLeg('case-t2c-4:derived-view-unsupported-no-arbitrary-exec', leg => {
964
+ const unsupportedMarker = 'GENERATOR_MUST_NOT_RUN';
965
+ const unsupportedGenerator = 'node -e ' + JSON.stringify('require("fs").writeFileSync("' + unsupportedMarker + '","ran")');
966
+ const unsupported = t2cDerivedFixture(leg, unsupportedGenerator);
967
+ const unsupportedRun = t2cRunCheck(leg, unsupported, true);
968
+ const unsupportedProjection = jsonOut(unsupportedRun).capabilities['derived-regenerate'];
969
+ same(unsupportedProjection.state, 'unsupported', 'unsupported projection state');
970
+ same(fs.existsSync(path.join(unsupported, unsupportedMarker)), false, 'configured text must never be executed');
971
+ });
972
+
833
973
  // ---- Final summary (authoritative totals incl. the appended block) ---------------------------------------------------
834
974
 
835
975
  console.log(`\nF3 derived-views summary: ${passed} PASS, ${failed} FAIL, ${skipped} SKIP${failed ? `\nFAILED assertions (${failures.length}):\n ${failures.join('\n ')}` : ''}${failed === 0 && skipped > 0 ? ' (skips are environment-gated cases only)' : ''}`);