harness-everything 0.16.0 → 0.16.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 +2 -2
- package/CHANGELOG.md +14 -0
- package/README.md +7 -7
- package/VERIFICATION.md +3 -3
- package/behavioral-evals/PAIRED-BENCHMARK.md +3 -3
- package/behavioral-evals/README.md +38 -32
- package/behavioral-evals/opencode-hardlock-live.js +6 -290
- package/behavioral-evals/opencode-reflection-gate-live.js +342 -0
- package/behavioral-evals/paired-benchmark.js +3 -3
- package/ci/consistency-check.js +20 -0
- package/ci/invariant-routing.test.js +58 -158
- package/ci/mechanism-2a-rule-of-3.test.js +73 -138
- package/ci/mechanism-2ac-atomic-commit-check.test.js +2 -2
- package/ci/mechanism-2af-worktree-isolation.test.js +38 -196
- package/ci/mechanism-2ah-workflow-lifecycle.test.js +20 -831
- package/ci/mechanism-2ai-workspace-fingerprint-batch.test.js +3 -4
- package/ci/mechanism-2b-boundary-guard.test.js +6 -16
- package/ci/mechanism-2e-scope-guard.test.js +8 -24
- package/ci/mechanism-2f-stop-gate.test.js +21 -75
- package/ci/mechanism-2n-opencode-plugin.test.js +13 -28
- package/ci/mechanism-31-opencode-hardlock-evidence.test.js +43 -99
- package/ci/openai-plugin-package.test.js +8 -8
- package/ci/openai-plugin-runtime.test.js +2 -2
- package/ci/router-workflow-plan.test.js +25 -6
- package/ci/self-evolve-loop.test.js +4 -1
- package/ci/workflow-execution-contract.test.js +51 -129
- package/ci/workflow-plan-consumers-edge.test.js +1 -1
- package/ci/workflow-plan-consumers.test.js +6 -6
- package/docs/architecture.md +21 -21
- package/docs/enforcement-locks.md +41 -102
- package/docs/mechanism-first-skill-mesh.md +2 -2
- package/docs/philosophy.md +2 -2
- package/docs/platform-capabilities.md +3 -3
- package/docs/routing.md +14 -14
- package/docs/workflow-runtime.md +80 -110
- package/evals/harness-everything/tasks/positive-tier1.yaml +1 -1
- package/evals/harness-everything/tasks/positive-tier2.yaml +1 -1
- package/evals/harness-everything/tasks/positive-tier3.yaml +1 -1
- package/evals/using-git-worktrees/tasks/positive-trigger.yaml +1 -1
- package/fable-mode/SKILL.md +1 -1
- package/fable-mode/agents/fable-orchestrator.md +7 -6
- package/fable-mode/execution-guardrails/SKILL.md +1 -1
- package/fable-mode/fable-haiku/SKILL.md +1 -1
- package/fable-mode/fable-opus/SKILL.md +1 -1
- package/fable-mode/fable-sonnet/SKILL.md +1 -1
- package/fable-mode/scripts/workflow-plan-consumer.js +4 -3
- package/harness-everything/SKILL.md +11 -11
- package/harness-everything/references/router-workflow-plan.md +2 -2
- package/harness-everything/references/triage-and-tiers.md +11 -11
- package/harness-everything/scripts/kernel-router-core.js +5 -5
- package/harness-everything/scripts/kernel-router.js +16 -21
- package/harness-everything/scripts/router-contract-core.js +1 -1
- package/hooks/hooks.json +10 -23
- package/hooks/scripts/atomic-commit-check.js +1 -1
- package/hooks/scripts/boundary-guard.js +4 -4
- package/hooks/scripts/contract-test.js +8 -11
- package/hooks/scripts/depth-guard.js +2 -2
- package/hooks/scripts/lib/workflow-runtime.js +24 -402
- package/hooks/scripts/rule-of-3-tracker.js +28 -31
- package/hooks/scripts/rule-of-3.js +4 -28
- package/hooks/scripts/state-persist.js +36 -136
- package/hooks/scripts/stop-gate.js +15 -48
- package/hooks/scripts/subagent-scope-guard.js +8 -8
- package/hooks/scripts/workflow-disposition.js +2 -10
- package/hooks/scripts/workflow-gate.js +33 -84
- package/hooks/scripts/workflow-mutation-denied.js +3 -15
- package/hooks/scripts/workflow-stop-gate.js +23 -38
- package/opencode-plugin/README.md +10 -13
- package/opencode-plugin/index.mjs +14 -30
- package/opencode-plugin/plugin.json +1 -1
- package/package.json +3 -2
- package/plugins/harness-everything/.codex-plugin/plugin.json +1 -1
- package/plugins/harness-everything/hooks/hooks.json +3 -3
- package/plugins/harness-everything/hooks/scripts/atomic-commit-check.js +1 -1
- package/plugins/harness-everything/hooks/scripts/boundary-guard.js +4 -4
- package/plugins/harness-everything/hooks/scripts/contract-test.js +8 -11
- package/plugins/harness-everything/hooks/scripts/depth-guard.js +2 -2
- package/plugins/harness-everything/hooks/scripts/lib/workflow-runtime.js +24 -402
- package/plugins/harness-everything/hooks/scripts/rule-of-3-tracker.js +28 -31
- package/plugins/harness-everything/hooks/scripts/rule-of-3.js +4 -28
- package/plugins/harness-everything/hooks/scripts/state-persist.js +36 -136
- package/plugins/harness-everything/hooks/scripts/stop-gate.js +15 -48
- package/plugins/harness-everything/hooks/scripts/subagent-scope-guard.js +8 -8
- package/plugins/harness-everything/hooks/scripts/workflow-disposition.js +2 -10
- package/plugins/harness-everything/hooks/scripts/workflow-gate.js +33 -84
- package/plugins/harness-everything/hooks/scripts/workflow-mutation-denied.js +3 -15
- package/plugins/harness-everything/hooks/scripts/workflow-stop-gate.js +23 -38
- package/plugins/harness-everything/plugin.json +1 -1
- package/plugins/harness-everything/scripts/lib/advisory-text.js +16 -29
- package/plugins/harness-everything/skills/fable-mode/SKILL.md +1 -1
- package/plugins/harness-everything/skills/fable-mode/agents/fable-orchestrator.md +7 -6
- package/plugins/harness-everything/skills/fable-mode/execution-guardrails/SKILL.md +1 -1
- package/plugins/harness-everything/skills/fable-mode/fable-haiku/SKILL.md +1 -1
- package/plugins/harness-everything/skills/fable-mode/fable-opus/SKILL.md +1 -1
- package/plugins/harness-everything/skills/fable-mode/fable-sonnet/SKILL.md +1 -1
- package/plugins/harness-everything/skills/fable-mode/scripts/workflow-plan-consumer.js +4 -3
- package/plugins/harness-everything/skills/harness-everything/SKILL.md +11 -11
- package/plugins/harness-everything/skills/harness-everything/references/router-workflow-plan.md +2 -2
- package/plugins/harness-everything/skills/harness-everything/references/triage-and-tiers.md +11 -11
- package/plugins/harness-everything/skills/harness-everything/scripts/kernel-router-core.js +5 -5
- package/plugins/harness-everything/skills/harness-everything/scripts/kernel-router.js +16 -21
- package/plugins/harness-everything/skills/harness-everything/scripts/router-contract-core.js +1 -1
- package/plugins/harness-everything/skills/using-git-worktrees/SKILL.md +5 -5
- package/plugins/harness-everything/skills/zoom-out/SKILL.md +3 -3
- package/plugins/harness-everything/skills/zoom-out/references/circuit-breaker.md +4 -4
- package/scripts/lib/advisory-text.js +16 -29
- package/using-git-worktrees/SKILL.md +5 -5
- package/zoom-out/SKILL.md +3 -3
- package/zoom-out/references/circuit-breaker.md +4 -4
|
@@ -202,10 +202,9 @@ try {
|
|
|
202
202
|
const workflowFile = path.join(state.getSessionDir(repo, sessionId), 'workflow-run.json');
|
|
203
203
|
const workflow = JSON.parse(fs.readFileSync(workflowFile, 'utf8'));
|
|
204
204
|
check(workflow.state === 'running' &&
|
|
205
|
-
workflow.budget?.counters
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
'#169 fingerprint-limit fallback records one auditable conservative mutation');
|
|
205
|
+
!workflow.budget?.counters &&
|
|
206
|
+
!fs.existsSync(path.join(state.getSessionDir(repo, sessionId), 'mutation-probes')),
|
|
207
|
+
'#190 shell admission no longer creates conservative budget/probe state');
|
|
209
208
|
|
|
210
209
|
console.log('PASS: batched workspace fingerprint (' + passed + ' assertions, 1000-file ' + elapsedMs.toFixed(1) + 'ms)');
|
|
211
210
|
} finally {
|
|
@@ -1,16 +1,6 @@
|
|
|
1
|
-
const fs
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
fs.writeFileSync(bigFile, 'x'.repeat(600 * 1024));
|
|
8
|
-
const boundaryResult = helper.runHook('boundary-guard.js', { tool_name: 'Read', tool_input: { file_path: bigFile } });
|
|
9
|
-
helper.check(
|
|
10
|
-
'2b. Blocks a 600KB Read without limit/offset (exit=2, BLOCKED)',
|
|
11
|
-
boundaryResult.code === 2 && boundaryResult.stderr.includes('[Boundary Guard] BLOCKED'),
|
|
12
|
-
`Got exit=${boundaryResult.code}, stderr="${boundaryResult.stderr.slice(0, 200)}"`
|
|
13
|
-
);
|
|
14
|
-
fs.unlinkSync(bigFile);
|
|
15
|
-
|
|
16
|
-
helper.finish();
|
|
1
|
+
const fs=require('fs'),path=require('path'),{spawnSync}=require('child_process'),helper=require('./test-helper');
|
|
2
|
+
console.log('\n[2b] Boundary reminder...');
|
|
3
|
+
const bigFile=helper.tempFile('.mechanism-test-big.tmp');fs.writeFileSync(bigFile,'x'.repeat(600*1024));
|
|
4
|
+
const result=spawnSync(process.execPath,[path.join(helper.hooksDir,'boundary-guard.js')],{input:JSON.stringify({tool_name:'Read',tool_input:{file_path:bigFile}}),encoding:'utf8'});
|
|
5
|
+
helper.check('2b. Large read emits a reminder but remains available',result.status===0&&/Boundary Reminder/i.test(result.stderr),`exit=${result.status}, stderr=${result.stderr.slice(0,200)}`);
|
|
6
|
+
fs.unlinkSync(bigFile);helper.finish();
|
|
@@ -1,24 +1,8 @@
|
|
|
1
|
-
const fs
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
helper.
|
|
8
|
-
|
|
9
|
-
});
|
|
10
|
-
const scopeFile = helper.tempFile('.mechanism-test-scope.tmp');
|
|
11
|
-
fs.writeFileSync(scopeFile, 'unexpected change');
|
|
12
|
-
const scopeResult = helper.runHook('subagent-scope-guard.js', {
|
|
13
|
-
session_id: helper.SESSION_ID, tool_name: 'Task', hook_event_name: 'PostToolUse', tool_input: {},
|
|
14
|
-
});
|
|
15
|
-
helper.check(
|
|
16
|
-
'2e. Flags the newly-created file after a Task burst (exit=2, lists filename)',
|
|
17
|
-
scopeResult.code === 2 &&
|
|
18
|
-
scopeResult.stderr.includes('Subagent Scope Guard') &&
|
|
19
|
-
scopeResult.stderr.includes(path.basename(scopeFile)),
|
|
20
|
-
`Got exit=${scopeResult.code}, stderr="${scopeResult.stderr.slice(0, 300)}"`
|
|
21
|
-
);
|
|
22
|
-
fs.unlinkSync(scopeFile);
|
|
23
|
-
|
|
24
|
-
helper.finish();
|
|
1
|
+
const fs=require('fs'),path=require('path'),{spawnSync}=require('child_process'),helper=require('./test-helper');
|
|
2
|
+
console.log('\n[2e] Subagent scope reminder...');
|
|
3
|
+
function run(payload){return spawnSync(process.execPath,[path.join(helper.hooksDir,'subagent-scope-guard.js')],{input:JSON.stringify(payload),encoding:'utf8'});}
|
|
4
|
+
run({session_id:helper.SESSION_ID,tool_name:'Task',hook_event_name:'PreToolUse',tool_input:{}});
|
|
5
|
+
const scopeFile=helper.tempFile('.mechanism-test-scope.tmp');fs.writeFileSync(scopeFile,'unexpected change');
|
|
6
|
+
const result=run({session_id:helper.SESSION_ID,tool_name:'Task',hook_event_name:'PostToolUse',tool_input:{}});
|
|
7
|
+
helper.check('2e. Scope drift is reported without blocking',result.status===0&&result.stderr.includes(path.basename(scopeFile)),`exit=${result.status}, stderr=${result.stderr.slice(0,300)}`);
|
|
8
|
+
fs.unlinkSync(scopeFile);helper.finish();
|
|
@@ -1,76 +1,22 @@
|
|
|
1
|
-
const fs
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
);
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
);
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
console.log('\n[2f] workflow-stop-gate (iterative-single) verification signal...');
|
|
24
|
-
|
|
25
|
-
const now = Date.now();
|
|
26
|
-
|
|
27
|
-
// Bug reproduction (issue #153): a verify-classified command that genuinely
|
|
28
|
-
// succeeded but whose host never reported a numeric exit code (observed on
|
|
29
|
-
// at least one live host - state-persist.js writes lastVerifyExitCode: null
|
|
30
|
-
// for any non-failing command when the PostToolUse payload has no numeric
|
|
31
|
-
// exitCode) must not be treated as unverified.
|
|
32
|
-
helper.writeState('workflow-run.json', {
|
|
33
|
-
schemaVersion: 1, sessionId: helper.SESSION_ID, strategy: 'iterative-single',
|
|
34
|
-
state: 'running', lastMutationAt: now - 5000,
|
|
35
|
-
});
|
|
36
|
-
helper.writeState('handoff-state.json', {
|
|
37
|
-
status: 'idle', lastEditAt: now - 5000, lastVerifyAt: now, lastVerifyExitCode: null,
|
|
38
|
-
});
|
|
39
|
-
const hostExitCodeUnavailable = helper.runHook('workflow-stop-gate.js', { session_id: helper.SESSION_ID });
|
|
40
|
-
helper.check(
|
|
41
|
-
'2f. workflow-stop-gate resolves when verify ran after edit even without a numeric exit code',
|
|
42
|
-
hostExitCodeUnavailable.code === 0 && helper.readState('workflow-run.json').state === 'satisfied',
|
|
43
|
-
`Got exit=${hostExitCodeUnavailable.code}, stderr="${hostExitCodeUnavailable.stderr.slice(0, 300)}"`
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
// Regression guard: explicit exit 0 (host does report it) must still resolve.
|
|
47
|
-
helper.writeState('workflow-run.json', {
|
|
48
|
-
schemaVersion: 1, sessionId: helper.SESSION_ID, strategy: 'iterative-single',
|
|
49
|
-
state: 'running', lastMutationAt: now - 5000,
|
|
50
|
-
});
|
|
51
|
-
helper.writeState('handoff-state.json', {
|
|
52
|
-
status: 'idle', lastEditAt: now - 5000, lastVerifyAt: now, lastVerifyExitCode: 0,
|
|
53
|
-
});
|
|
54
|
-
const hostExitCodeReported = helper.runHook('workflow-stop-gate.js', { session_id: helper.SESSION_ID });
|
|
55
|
-
helper.check(
|
|
56
|
-
'2f. workflow-stop-gate still resolves when the host does report exit code 0',
|
|
57
|
-
hostExitCodeReported.code === 0 && helper.readState('workflow-run.json').state === 'satisfied',
|
|
58
|
-
`Got exit=${hostExitCodeReported.code}`
|
|
59
|
-
);
|
|
60
|
-
|
|
61
|
-
// Negative control: no verification ran after the edit at all -> stays blocked.
|
|
62
|
-
helper.writeState('workflow-run.json', {
|
|
63
|
-
schemaVersion: 1, sessionId: helper.SESSION_ID, strategy: 'iterative-single',
|
|
64
|
-
state: 'running', lastMutationAt: now,
|
|
65
|
-
});
|
|
66
|
-
helper.writeState('handoff-state.json', {
|
|
67
|
-
status: 'idle', lastEditAt: now, lastVerifyAt: now - 5000, lastVerifyExitCode: null,
|
|
68
|
-
});
|
|
69
|
-
const staleVerify = helper.runHook('workflow-stop-gate.js', { session_id: helper.SESSION_ID });
|
|
70
|
-
helper.check(
|
|
71
|
-
'2f. workflow-stop-gate still blocks when no verification ran after the edit',
|
|
72
|
-
staleVerify.code === 2 && staleVerify.stderr.includes('verification-after-edit-missing'),
|
|
73
|
-
`Got exit=${staleVerify.code}, stderr="${staleVerify.stderr.slice(0, 300)}"`
|
|
74
|
-
);
|
|
75
|
-
|
|
1
|
+
const fs=require('fs'),path=require('path'),{spawnSync}=require('child_process'),helper=require('./test-helper');
|
|
2
|
+
console.log('\n[2f] Verification reminders...');
|
|
3
|
+
function run(script,payload){return spawnSync(process.execPath,[path.join(helper.hooksDir,script)],{input:JSON.stringify(payload),encoding:'utf8'});}
|
|
4
|
+
helper.writeState('handoff-state.json',{status:'idle',lastEditAt:Date.now(),lastVerifyAt:0});
|
|
5
|
+
const dirty=helper.tempFile('.mechanism-test-dirty.tmp');fs.writeFileSync(dirty,'dirty');
|
|
6
|
+
const reminder=run('stop-gate.js',{session_id:helper.SESSION_ID});
|
|
7
|
+
helper.check('2f. Unverified dirty Stop emits reminder and exits 0',reminder.status===0&&/Verification Reminder/i.test(reminder.stderr),`exit=${reminder.status}, stderr=${reminder.stderr.slice(0,200)}`);
|
|
8
|
+
helper.check('2f. Stop reminder creates no lock/throttle state',!helper.stateExists('stop-gate-state.json'),'unexpected stop-gate-state.json');
|
|
9
|
+
fs.unlinkSync(dirty);
|
|
10
|
+
|
|
11
|
+
const now=Date.now();
|
|
12
|
+
helper.writeState('workflow-run.json',{schemaVersion:1,sessionId:helper.SESSION_ID,strategy:'iterative-single',state:'running',lastMutationAt:now-5000});
|
|
13
|
+
helper.writeState('handoff-state.json',{status:'idle',lastEditAt:now-5000,lastVerifyAt:now,lastVerifyExitCode:null});
|
|
14
|
+
const verified=run('workflow-stop-gate.js',{session_id:helper.SESSION_ID});
|
|
15
|
+
helper.check('2f. Observed verification can mark workflow satisfied',verified.status===0&&helper.readState('workflow-run.json').state==='satisfied',verified.stderr);
|
|
16
|
+
|
|
17
|
+
helper.writeState('workflow-run.json',{schemaVersion:1,sessionId:helper.SESSION_ID,strategy:'iterative-single',state:'running',lastMutationAt:now});
|
|
18
|
+
helper.writeState('handoff-state.json',{status:'idle',lastEditAt:now,lastVerifyAt:now-5000,lastVerifyExitCode:null});
|
|
19
|
+
const stale=run('workflow-stop-gate.js',{session_id:helper.SESSION_ID});
|
|
20
|
+
helper.check('2f. Missing verification is reminder-only',stale.status===0&&/verification-after-edit-missing/i.test(stale.stderr),`exit=${stale.status}, stderr=${stale.stderr.slice(0,300)}`);
|
|
21
|
+
helper.check('2f. Missing verification does not create blocked state',helper.readState('workflow-run.json').state==='running',JSON.stringify(helper.readState('workflow-run.json')));
|
|
76
22
|
helper.finish();
|
|
@@ -158,7 +158,7 @@ helper.check(
|
|
|
158
158
|
const sig = Object.keys(breaker.failures)[0];
|
|
159
159
|
helper.check(
|
|
160
160
|
'2n. two failures on the same signature: still allowed, not yet tripped',
|
|
161
|
-
breaker.failures[sig].count === 2 && breaker.hardLock ===
|
|
161
|
+
breaker.failures[sig].count === 2 && breaker.hardLock === undefined,
|
|
162
162
|
JSON.stringify(breaker)
|
|
163
163
|
);
|
|
164
164
|
helper.check('2n. each failed verification sends exactly one follow-up prompt', promptCalls.length === 2, `${promptCalls.length} prompt(s) sent`);
|
|
@@ -235,8 +235,8 @@ helper.check(
|
|
|
235
235
|
);
|
|
236
236
|
breaker = JSON.parse(fs.readFileSync(breakerFile, 'utf8'));
|
|
237
237
|
helper.check(
|
|
238
|
-
'2n. apply_patch reflection completes the lifecycle and persists lastReflection',
|
|
239
|
-
Number.isFinite(breaker.lastReflection) && breaker.lastReflection > 0 && breaker.reflectionPending === false,
|
|
238
|
+
'2n. apply_patch reflection completes the lifecycle, resets the signature count, and persists lastReflection',
|
|
239
|
+
Number.isFinite(breaker.lastReflection) && breaker.lastReflection > 0 && breaker.reflectionPending === false && breaker.failures[sig].count === 0,
|
|
240
240
|
JSON.stringify(breaker)
|
|
241
241
|
);
|
|
242
242
|
|
|
@@ -330,42 +330,27 @@ helper.check(
|
|
|
330
330
|
}
|
|
331
331
|
helper.check('2n. mixed apply_patch cannot bypass a pending reflection', mixedPatchBlocked, 'unrelated files were accepted with the reflection artifact');
|
|
332
332
|
|
|
333
|
-
// A
|
|
333
|
+
// A fresh failure after reflection starts a new three-failure cycle.
|
|
334
334
|
await hooks['tool.execute.after']({ tool: 'edit', sessionID: 's1', callID: 'c5' }, { title: '', output: '', metadata: {} });
|
|
335
335
|
await hooks.event({ event: { type: 'session.idle', properties: { sessionID: 's1' } } });
|
|
336
336
|
breaker = JSON.parse(fs.readFileSync(breakerFile, 'utf8'));
|
|
337
|
-
helper.check('2n.
|
|
338
|
-
|
|
339
|
-
'2n. the hard-lock prompt says locked',
|
|
340
|
-
/lock/i.test(promptCalls[promptCalls.length - 1].body.parts[0].text),
|
|
341
|
-
promptCalls[promptCalls.length - 1].body.parts[0].text
|
|
342
|
-
);
|
|
343
|
-
|
|
344
|
-
// --- circuit breaker enforcement (tool.execute.before) ---
|
|
345
|
-
let blocked = false;
|
|
337
|
+
helper.check('2n. first post-reflection failure starts again at count=1', breaker.failures[sig].count === 1 && breaker.reflectionPending === false, JSON.stringify(breaker));
|
|
338
|
+
let postReflectionEditAllowed = true;
|
|
346
339
|
try {
|
|
347
340
|
await hooks['tool.execute.before']({ tool: 'edit', sessionID: 's1', callID: 'c6' }, { args: {} });
|
|
348
341
|
} catch {
|
|
349
|
-
|
|
350
|
-
}
|
|
351
|
-
helper.check('2n. hard-locked breaker throws on the next edit attempt', blocked, 'tool.execute.before did not throw');
|
|
352
|
-
|
|
353
|
-
let readBlocked = false;
|
|
354
|
-
try {
|
|
355
|
-
await hooks['tool.execute.before']({ tool: 'read', sessionID: 's1', callID: 'c7' }, { args: {} });
|
|
356
|
-
} catch {
|
|
357
|
-
readBlocked = true;
|
|
342
|
+
postReflectionEditAllowed = false;
|
|
358
343
|
}
|
|
359
|
-
helper.check('2n.
|
|
344
|
+
helper.check('2n. no permanent post-reflection hard lock remains', postReflectionEditAllowed, 'tool.execute.before unexpectedly blocked after one fresh failure');
|
|
360
345
|
|
|
361
346
|
// The same workspace can host independent sessions. Session s2 starts with
|
|
362
|
-
// a fresh breaker and cannot inherit s1
|
|
347
|
+
// a fresh breaker and cannot inherit s1 state.
|
|
363
348
|
await hooks['tool.execute.after']({ tool: 'edit', sessionID: 's2', callID: 's2-c1', args: {} }, { title: '', output: '', metadata: {} });
|
|
364
349
|
await hooks.event({ event: { type: 'session.idle', properties: { sessionID: 's2' } } });
|
|
365
350
|
const secondBreaker = JSON.parse(fs.readFileSync(path.join(secondSessionDir, 'circuit-breaker.json'), 'utf8'));
|
|
366
351
|
helper.check(
|
|
367
352
|
'2n. a second session has an independent breaker stream',
|
|
368
|
-
secondBreaker.hardLock ===
|
|
353
|
+
secondBreaker.hardLock === undefined && Object.values(secondBreaker.failures).some((entry) => entry.count === 1),
|
|
369
354
|
JSON.stringify(secondBreaker)
|
|
370
355
|
);
|
|
371
356
|
|
|
@@ -382,9 +367,9 @@ helper.check(
|
|
|
382
367
|
corruptStateMessage = String(error && error.message ? error.message : error);
|
|
383
368
|
}
|
|
384
369
|
helper.check(
|
|
385
|
-
'2n. corrupt breaker state fails
|
|
386
|
-
corruptStateBlocked
|
|
387
|
-
corruptStateMessage || '
|
|
370
|
+
'2n. corrupt breaker state fails open instead of becoming a cognitive lock',
|
|
371
|
+
!corruptStateBlocked,
|
|
372
|
+
corruptStateMessage || 'corrupt state was ignored as expected'
|
|
388
373
|
);
|
|
389
374
|
|
|
390
375
|
// A prompt transport failure is retryable without re-running verification
|
|
@@ -3,14 +3,16 @@ const path = require('path');
|
|
|
3
3
|
const helper = require('./test-helper');
|
|
4
4
|
const {
|
|
5
5
|
BLOCKED_MARKER,
|
|
6
|
-
|
|
6
|
+
FIRST_CYCLE_MARKERS,
|
|
7
7
|
INSTALLED_PLUGIN_NAME,
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
PRE_REFLECTION_MARKER,
|
|
9
|
+
PROBE_CONTRACT,
|
|
10
|
+
REFLECTION_REQUIRED_MESSAGE,
|
|
11
|
+
RETRIP_MARKERS,
|
|
10
12
|
verifyEvidence,
|
|
11
|
-
} = require('../behavioral-evals/opencode-
|
|
13
|
+
} = require('../behavioral-evals/opencode-reflection-gate-live');
|
|
12
14
|
|
|
13
|
-
console.log('\n[31] opencode live
|
|
15
|
+
console.log('\n[31] opencode live Rule-of-3 reflection evidence contract...');
|
|
14
16
|
|
|
15
17
|
function writeJson(file, value) {
|
|
16
18
|
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
@@ -18,121 +20,63 @@ function writeJson(file, value) {
|
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
function makeEvidence() {
|
|
21
|
-
const dir = helper.tempDir('.mechanism-test-opencode-live-evidence');
|
|
23
|
+
const dir = helper.tempDir('.mechanism-test-opencode-live-reflection-evidence');
|
|
22
24
|
fs.mkdirSync(path.join(dir, 'workspace'), { recursive: true });
|
|
23
25
|
fs.mkdirSync(path.join(dir, 'state'), { recursive: true });
|
|
24
26
|
const pluginHash = 'a'.repeat(64);
|
|
25
27
|
writeJson(path.join(dir, 'metadata.json'), {
|
|
26
|
-
schemaVersion:
|
|
27
|
-
|
|
28
|
-
installedPluginName: INSTALLED_PLUGIN_NAME,
|
|
29
|
-
pluginSha256: pluginHash,
|
|
30
|
-
installedPluginSha256: pluginHash,
|
|
31
|
-
});
|
|
32
|
-
const toolEvent = (input) => JSON.stringify({
|
|
33
|
-
type: 'tool',
|
|
34
|
-
part: { tool: 'edit', state: { input } },
|
|
28
|
+
schemaVersion: 2, probeContract: PROBE_CONTRACT, stateIsolated: true,
|
|
29
|
+
installedPluginName: INSTALLED_PLUGIN_NAME, pluginSha256: pluginHash, installedPluginSha256: pluginHash,
|
|
35
30
|
});
|
|
31
|
+
const toolEvent = (input) => JSON.stringify({ type: 'tool', part: { tool: 'edit', state: { input } } });
|
|
36
32
|
fs.writeFileSync(path.join(dir, 'transcript.jsonl'), [
|
|
37
|
-
toolEvent({ filePath: 'probe.txt', text:
|
|
38
|
-
toolEvent({ filePath: 'probe.txt', text:
|
|
33
|
+
toolEvent({ filePath: 'probe.txt', text: PRE_REFLECTION_MARKER }),
|
|
34
|
+
...FIRST_CYCLE_MARKERS.map((marker) => toolEvent({ filePath: 'probe.txt', text: marker })),
|
|
39
35
|
toolEvent({ filePath: 'probe.txt', text: BLOCKED_MARKER }),
|
|
40
|
-
|
|
41
|
-
'',
|
|
36
|
+
...RETRIP_MARKERS.map((marker) => toolEvent({ filePath: 'probe.txt', text: marker })),
|
|
37
|
+
JSON.stringify({ type: 'text', part: { text: REFLECTION_REQUIRED_MESSAGE } }), '',
|
|
42
38
|
].join('\n'));
|
|
43
39
|
fs.writeFileSync(path.join(dir, 'stderr.txt'), '', 'utf8');
|
|
44
|
-
fs.writeFileSync(path.join(dir, 'workspace', 'probe.txt'),
|
|
40
|
+
fs.writeFileSync(path.join(dir, 'workspace', 'probe.txt'), ['baseline', PRE_REFLECTION_MARKER, ...FIRST_CYCLE_MARKERS, ...RETRIP_MARKERS, ''].join('\n'), 'utf8');
|
|
41
|
+
const signature = 'npm test: HARNESS_LIVE_PROBE_RED';
|
|
45
42
|
writeJson(path.join(dir, 'state', 'circuit-breaker.json'), {
|
|
46
|
-
failures: {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
reflectionPending: false,
|
|
53
|
-
reflectionRequestedAt: null,
|
|
54
|
-
reflectionToken: null,
|
|
55
|
-
reflectionSignature: null,
|
|
43
|
+
failures: { [signature]: { count: 3, firstSeen: 5, lastSeen: 8 } },
|
|
44
|
+
lastReflection: 4, lastReflectionSignature: signature, reflectionPending: true,
|
|
45
|
+
reflectionRequestedAt: 8, reflectionToken: 'second456', reflectionSignature: signature,
|
|
46
|
+
});
|
|
47
|
+
writeJson(path.join(dir, 'state', 'compliance.json'), {
|
|
48
|
+
sessionStart: 1, totalEdits: 6, verifiedEdits: 0, circuitBreakerTrips: 2, reflectionsForced: 2,
|
|
56
49
|
});
|
|
57
50
|
fs.writeFileSync(path.join(dir, 'state', 'zoom-out-report.md'), [
|
|
58
|
-
'## Goal',
|
|
59
|
-
'
|
|
60
|
-
'##
|
|
61
|
-
'three controlled failures',
|
|
62
|
-
'## Verified Facts',
|
|
63
|
-
'the verification fixture intentionally stays red',
|
|
64
|
-
'## Diagnosis',
|
|
65
|
-
'this is a live enforcement probe',
|
|
66
|
-
'## Decision',
|
|
67
|
-
'RESUME: reproduce the same failure once after reflection',
|
|
68
|
-
'Reflection token: abc123',
|
|
69
|
-
'',
|
|
51
|
+
'## Goal','exercise the Rule-of-3 reflection gate','## Failed Attempts','three controlled failures',
|
|
52
|
+
'## Verified Facts','the verification fixture intentionally stays red','## Diagnosis','this is a live enforcement probe',
|
|
53
|
+
'## Decision','RESUME: reproduce the same three-failure cycle after reflection','Reflection token: first123','',
|
|
70
54
|
].join('\n'));
|
|
71
55
|
return dir;
|
|
72
56
|
}
|
|
73
57
|
|
|
74
58
|
try {
|
|
75
|
-
const valid
|
|
76
|
-
|
|
77
|
-
helper.check('31. complete attributed hard-lock evidence passes', result.passed, JSON.stringify(result.checks.filter((entry) => !entry.pass)));
|
|
59
|
+
const valid=makeEvidence(); let result=verifyEvidence(valid);
|
|
60
|
+
helper.check('31. complete attributed reflection/re-trip evidence passes',result.passed,JSON.stringify(result.checks.filter((entry)=>!entry.pass)));
|
|
78
61
|
|
|
79
|
-
const wrongPlugin =
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
metadata.installedPluginSha256 = 'b'.repeat(64);
|
|
83
|
-
writeJson(metadataFile, metadata);
|
|
84
|
-
result = verifyEvidence(wrongPlugin);
|
|
85
|
-
helper.check(
|
|
86
|
-
'31. evidence fails when the installed plugin hash differs from the canonical source hash',
|
|
87
|
-
!result.passed && result.checks.some((entry) => entry.name === 'installed plugin is byte-identical to the recorded canonical source' && !entry.pass),
|
|
88
|
-
JSON.stringify(result.checks),
|
|
89
|
-
);
|
|
62
|
+
const wrongPlugin=makeEvidence(); const mf=path.join(wrongPlugin,'metadata.json'); const md=JSON.parse(fs.readFileSync(mf,'utf8'));
|
|
63
|
+
md.installedPluginSha256='b'.repeat(64); writeJson(mf,md); result=verifyEvidence(wrongPlugin);
|
|
64
|
+
helper.check('31. evidence fails when the installed plugin hash differs from the canonical source hash',!result.passed&&result.checks.some((e)=>e.name==='installed plugin is byte-identical to the recorded canonical source'&&!e.pass),JSON.stringify(result.checks));
|
|
90
65
|
|
|
91
|
-
const landed
|
|
92
|
-
|
|
93
|
-
result = verifyEvidence(landed);
|
|
94
|
-
helper.check(
|
|
95
|
-
'31. negative control fails if the blocked marker reached the filesystem',
|
|
96
|
-
!result.passed && result.checks.some((entry) => entry.name === 'blocked marker did not reach the filesystem' && !entry.pass),
|
|
97
|
-
JSON.stringify(result.checks),
|
|
98
|
-
);
|
|
66
|
+
const landed=makeEvidence(); fs.appendFileSync(path.join(landed,'workspace','probe.txt'),`${BLOCKED_MARKER}\n`); result=verifyEvidence(landed);
|
|
67
|
+
helper.check('31. reflection gate fails if the blocked marker reached the filesystem',!result.passed&&result.checks.some((e)=>e.name==='reflection-pending blocked marker did not reach the filesystem'&&!e.pass),JSON.stringify(result.checks));
|
|
99
68
|
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
const breaker = JSON.parse(fs.readFileSync(breakerFile, 'utf8'));
|
|
103
|
-
breaker.hardLock = false;
|
|
104
|
-
writeJson(breakerFile, breaker);
|
|
105
|
-
result = verifyEvidence(unlocked);
|
|
106
|
-
helper.check(
|
|
107
|
-
'31. evidence fails without a pre-reset hard-lock snapshot',
|
|
108
|
-
!result.passed && result.checks.some((entry) => entry.name === 'pre-reset breaker snapshot is hard-locked' && !entry.pass),
|
|
109
|
-
JSON.stringify(result.checks),
|
|
110
|
-
);
|
|
69
|
+
const retired=makeEvidence(); const bf=path.join(retired,'state','circuit-breaker.json'); const bs=JSON.parse(fs.readFileSync(bf,'utf8')); bs.hardLock=true; writeJson(bf,bs); result=verifyEvidence(retired);
|
|
70
|
+
helper.check('31. current evidence rejects the retired hardLock field',!result.passed&&result.checks.some((e)=>e.name==='snapshot has no retired hardLock field'&&!e.pass),JSON.stringify(result.checks));
|
|
111
71
|
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
.split(/\r?\n/)
|
|
115
|
-
.filter((line) => !line.includes(BLOCKED_MARKER))
|
|
116
|
-
.join('\n');
|
|
117
|
-
fs.writeFileSync(path.join(noAttempt, 'transcript.jsonl'), transcript);
|
|
118
|
-
result = verifyEvidence(noAttempt);
|
|
119
|
-
helper.check(
|
|
120
|
-
'31. evidence fails when the final blocked edit was never observed as a structured tool attempt',
|
|
121
|
-
!result.passed && result.checks.some((entry) => entry.name === 'structured tool trace contains the final blocked edit attempt' && !entry.pass),
|
|
122
|
-
JSON.stringify(result.checks),
|
|
123
|
-
);
|
|
72
|
+
const noRetrip=makeEvidence(); const rf=path.join(noRetrip,'state','circuit-breaker.json'); const rs=JSON.parse(fs.readFileSync(rf,'utf8')); rs.reflectionPending=false; rs.reflectionToken=null; rs.reflectionSignature=null; writeJson(rf,rs); result=verifyEvidence(noRetrip);
|
|
73
|
+
helper.check('31. evidence fails without a second Rule-of-3 reflection request',!result.passed&&result.checks.some((e)=>e.name==='three more matching failures request a second reflection instead of a permanent lock'&&!e.pass),JSON.stringify(result.checks));
|
|
124
74
|
|
|
125
|
-
const
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
!result.passed && result.checks.some((entry) => entry.name === 'reflection artifact is valid and preserved' && !entry.pass),
|
|
131
|
-
JSON.stringify(result.checks),
|
|
132
|
-
);
|
|
75
|
+
const noAttempt=makeEvidence(); const tf=path.join(noAttempt,'transcript.jsonl'); fs.writeFileSync(tf,fs.readFileSync(tf,'utf8').split(/\r?\n/).filter((line)=>!line.includes(BLOCKED_MARKER)).join('\n')); result=verifyEvidence(noAttempt);
|
|
76
|
+
helper.check('31. evidence fails when no structured edit was attempted during reflectionPending',!result.passed&&result.checks.some((e)=>e.name==='structured tool trace contains the edit attempt blocked by reflectionPending'&&!e.pass),JSON.stringify(result.checks));
|
|
77
|
+
|
|
78
|
+
const noReflection=makeEvidence(); fs.rmSync(path.join(noReflection,'state','zoom-out-report.md')); result=verifyEvidence(noReflection);
|
|
79
|
+
helper.check('31. evidence fails without the preserved first reflection artifact',!result.passed&&result.checks.some((e)=>e.name==='first reflection artifact is valid and preserved'&&!e.pass),JSON.stringify(result.checks));
|
|
133
80
|
|
|
134
81
|
helper.finish();
|
|
135
|
-
} catch (error)
|
|
136
|
-
helper.check('31. OpenCode hard-lock live evidence contract', false, error.stack);
|
|
137
|
-
helper.finish();
|
|
138
|
-
}
|
|
82
|
+
} catch(error) { helper.check('31. OpenCode Rule-of-3 reflection live evidence contract',false,error.stack); helper.finish(); }
|
|
@@ -162,8 +162,8 @@ assert.ok(hooks.hooks.Stop?.length, 'Stop hook missing');
|
|
|
162
162
|
const hookText = JSON.stringify(hooks);
|
|
163
163
|
assert.match(hookText, /PLUGIN_ROOT/, 'plugin hooks must resolve from PLUGIN_ROOT');
|
|
164
164
|
assert.match(hookText, /commandWindows/, 'plugin hooks need a Windows command override');
|
|
165
|
-
assert.match(hookText, /workflow-gate\.js/, 'plugin hooks must package workflow
|
|
166
|
-
assert.match(hookText, /workflow-stop-gate\.js/, 'plugin hooks must package workflow completion
|
|
165
|
+
assert.match(hookText, /workflow-gate\.js/, 'plugin hooks must package workflow guidance');
|
|
166
|
+
assert.match(hookText, /workflow-stop-gate\.js/, 'plugin hooks must package workflow completion reminders');
|
|
167
167
|
|
|
168
168
|
const session = spawnSync(process.execPath, [path.join(PLUGIN, 'hooks', 'session-start.js')], { encoding: 'utf8' });
|
|
169
169
|
assert.strictEqual(session.status, 0, session.stderr);
|
|
@@ -190,15 +190,15 @@ assert.strictEqual(second.status, 0, second.stderr);
|
|
|
190
190
|
assert.strictEqual(first.stdout, second.stdout, 'identical routing input must produce identical output');
|
|
191
191
|
assert.match(first.stdout, /RECOMMENDED TIER:\s*Tier 2/i);
|
|
192
192
|
assert.match(first.stdout, /REQUIRED HARNESS INVARIANTS/);
|
|
193
|
-
assert.match(first.stdout, /WORKFLOW SKILLS \(EVALUATE APPLICABILITY .*SELECTED WORKFLOW IS
|
|
193
|
+
assert.match(first.stdout, /WORKFLOW SKILLS \(EVALUATE APPLICABILITY .*SELECTED WORKFLOW IS GUIDANCE\)/);
|
|
194
194
|
assert.match(first.stdout, /evaluate-suggestions-before-skip/);
|
|
195
195
|
assert.match(first.stdout, /read its complete SKILL\.md entry/);
|
|
196
196
|
assert.doesNotMatch(first.stdout, /BASE EXECUTION LOOP/);
|
|
197
|
-
assert.match(first.stdout, /ORCHESTRATION POLICY:
|
|
198
|
-
assert.match(first.stdout, /WORKFLOW
|
|
197
|
+
assert.match(first.stdout, /ORCHESTRATION POLICY: Selected topology is planning guidance/);
|
|
198
|
+
assert.match(first.stdout, /WORKFLOW GUIDANCE \(ADVISORY WHEN SELECTED\)/);
|
|
199
199
|
assert.match(first.stdout, /Selected workflow: iterative-single/);
|
|
200
|
-
assert.match(first.stdout, /
|
|
201
|
-
assert.doesNotMatch(first.stdout, /
|
|
200
|
+
assert.match(first.stdout, /Before claiming completion, review unresolved workflow evidence and objective verification/);
|
|
201
|
+
assert.doesNotMatch(first.stdout, /budget-exhausted|reset-budget/);
|
|
202
202
|
|
|
203
203
|
const trivial = route('Update one README typo');
|
|
204
204
|
assert.strictEqual(trivial.status, 0, trivial.stderr);
|
|
@@ -213,4 +213,4 @@ assert.match(unmatched.stdout, /RECOMMENDED TIER:\s*Unclassified/i);
|
|
|
213
213
|
assert.match(unmatched.stdout, /"tier":"unclassified"/i);
|
|
214
214
|
assert.doesNotMatch(unmatched.stdout, /RECOMMENDED TIER:\s*Tier 1/i);
|
|
215
215
|
|
|
216
|
-
console.log(`OpenAI plugin package verified: ${skillNames.length} skills, publication metadata, hooks, marketplace, deterministic
|
|
216
|
+
console.log(`OpenAI plugin package verified: ${skillNames.length} skills, publication metadata, hooks, marketplace, deterministic guidance-first routing.`);
|
|
@@ -169,7 +169,7 @@ const subagentStop = runHook('hooks/scripts/subagent-stop.js', {
|
|
|
169
169
|
cwd: fixture,
|
|
170
170
|
agent_type: 'worker'
|
|
171
171
|
}, stateHome);
|
|
172
|
-
assert.strictEqual(subagentStop.status,
|
|
173
|
-
assert.match(subagentStop.stderr, /Subagent Scope
|
|
172
|
+
assert.strictEqual(subagentStop.status, 0, subagentStop.stderr);
|
|
173
|
+
assert.match(subagentStop.stderr, /Subagent Scope Reminder/);
|
|
174
174
|
|
|
175
175
|
console.log('OpenAI plugin runtime compatibility verified.');
|
|
@@ -75,12 +75,12 @@ if (validContract(iterative, 'iterative-single')) {
|
|
|
75
75
|
const plan = iterative.contract.workflowPlan;
|
|
76
76
|
check(plan.tier === 'tier2', 'ordinary test-first bug fix is tier2');
|
|
77
77
|
check(plan.strategy === 'iterative-single', 'ordinary bug fix selects iterative-single');
|
|
78
|
-
check(plan.limits.maxIterations === ITERATIVE_MAX_ITERATIONS, 'iterative-single
|
|
79
|
-
check(plan.limits.maxRevisionRounds === WORKFLOW_MAX_REVISION_ROUNDS, 'workflow exposes
|
|
80
|
-
check(plan.limits.maxReplans === FABLE_MAX_REPLANS, 'workflow exposes
|
|
81
|
-
check(plan.limits.maxWorkers === FABLE_MAX_WORKERS, 'workflow exposes
|
|
78
|
+
check(plan.limits.maxIterations === ITERATIVE_MAX_ITERATIONS, 'iterative-single retains an advisory iteration guidance value');
|
|
79
|
+
check(plan.limits.maxRevisionRounds === WORKFLOW_MAX_REVISION_ROUNDS, 'workflow exposes an advisory revision guidance value');
|
|
80
|
+
check(plan.limits.maxReplans === FABLE_MAX_REPLANS, 'workflow exposes an advisory replan guidance value');
|
|
81
|
+
check(plan.limits.maxWorkers === FABLE_MAX_WORKERS, 'workflow exposes an advisory worker guidance value');
|
|
82
82
|
check(plan.requiredInvariants.includes('objective-verification'), 'iterative-single carries objective verification invariant');
|
|
83
|
-
check(plan.requiredInvariants.includes('loop-
|
|
83
|
+
check(plan.requiredInvariants.includes('loop-awareness'), 'iterative-single carries loop-awareness guidance');
|
|
84
84
|
check(plan.suggestedSkills.includes('tdd'), 'TDD stays advisory rather than an invariant');
|
|
85
85
|
check(plan.memory.write === 'none', 'ordinary iterative work cannot write durable memory');
|
|
86
86
|
check(!plan.requiredInvariants.includes('tdd'), 'suggested skills are separated from mandatory invariants');
|
|
@@ -262,12 +262,31 @@ check(kernelUnknown.stdout.includes('ROUTER WORKFLOW PLAN (JSON)'), 'kernel emit
|
|
|
262
262
|
check(kernelUnknown.stdout.includes('"strategySelection":"deferred"'), 'kernel exposes deferred unclassified selection');
|
|
263
263
|
check(!/RECOMMENDED TIER:\s*Tier 1/i.test(kernelUnknown.stdout), 'kernel does not expose a silent Tier 1 fallback for unmatched prompts');
|
|
264
264
|
|
|
265
|
+
const notificationStateHome = fs.mkdtempSync(path.join(os.tmpdir(), 'harness-router-notification-fail-open-'));
|
|
266
|
+
const notificationStateFile = path.join(notificationStateHome, 'not-a-directory');
|
|
267
|
+
fs.writeFileSync(notificationStateFile, 'x', 'utf8');
|
|
268
|
+
const kernelNotificationPersistFailure = spawnSync(process.execPath, [kernelRouter], {
|
|
269
|
+
cwd: ROOT,
|
|
270
|
+
encoding: 'utf8',
|
|
271
|
+
input: JSON.stringify({
|
|
272
|
+
session_id: 'router-host-notification-fail-open',
|
|
273
|
+
cwd: ROOT,
|
|
274
|
+
hook_event_name: 'UserPromptSubmit',
|
|
275
|
+
prompt: '<task-notification><task-id>background-1</task-id><status>completed</status></task-notification>',
|
|
276
|
+
}),
|
|
277
|
+
env: { ...process.env, HARNESS_STATE_HOME: notificationStateFile, HARNESS_WORKSPACE_ROOT: ROOT },
|
|
278
|
+
});
|
|
279
|
+
check(kernelNotificationPersistFailure.status === 0, 'host notification persistence failure stays fail-open');
|
|
280
|
+
check(kernelNotificationPersistFailure.stdout.includes('Host notification — no active execution contract; ignored for routing.'), 'host notification remains a routing no-op when state persistence fails');
|
|
281
|
+
check(kernelNotificationPersistFailure.stderr.includes('routing state was not persisted'), 'host notification persistence failure remains visible as a reminder');
|
|
282
|
+
fs.rmSync(notificationStateHome, { recursive: true, force: true });
|
|
283
|
+
|
|
265
284
|
const kernelIterative = spawnSync(process.execPath, [kernelRouter, 'Fix this checkout bug and add a regression test.'], {
|
|
266
285
|
cwd: ROOT,
|
|
267
286
|
encoding: 'utf8',
|
|
268
287
|
});
|
|
269
288
|
check(kernelIterative.stdout.includes('"strategy":"iterative-single"'), 'kernel consumes strategy from structured plan');
|
|
270
|
-
check(kernelIterative.stdout.includes('loop-
|
|
289
|
+
check(kernelIterative.stdout.includes('loop-awareness:'), 'kernel prints dynamic plan guidance');
|
|
271
290
|
check(kernelIterative.stdout.includes(' - tdd'), 'kernel prints advisory skills separately');
|
|
272
291
|
|
|
273
292
|
for (const schemaPath of [
|
|
@@ -168,7 +168,10 @@ try {
|
|
|
168
168
|
tool_use_id: 'verify-fail-1',
|
|
169
169
|
tool_response: { exitCode: 1, stderr: 'fixture assertion failed' },
|
|
170
170
|
});
|
|
171
|
-
check(firstFail.status ===
|
|
171
|
+
check(firstFail.status === 0, 'first verifier failure remains authoritative without blocking the hook');
|
|
172
|
+
|
|
173
|
+
const failedContract = JSON.parse(fs.readFileSync(path.join(prepared.runRoot, 'contracts', 'verify-recovery.json'), 'utf8'));
|
|
174
|
+
check(failedContract.status === 'fail', 'failed verifier evidence remains authoritative in the stage contract');
|
|
172
175
|
|
|
173
176
|
const laterPass = run(contractHook, {
|
|
174
177
|
...basePayload,
|