@aibyzero/cm-workflow 0.16.9 → 0.17.0
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/.codex-plugin/plugin.json +1 -1
- package/CHANGELOG.md +12 -0
- package/README.md +9 -1
- package/VERSION +1 -1
- package/docs/cm-control-policy-v2.md +331 -0
- package/docs/execution-optimizations.md +1 -1
- package/docs/external-models.md +3 -3
- package/docs/human-correction.md +5 -5
- package/docs/installation.md +1 -1
- package/docs/js-workflow-control.md +101 -84
- package/docs/next-steps.md +11 -0
- package/docs/untested-branches.md +2 -3
- package/docs/user-guide.md +3 -3
- package/package.json +1 -1
- package/runtime/js/cm-ai/cm-ai-conversation-entry.mjs +13 -69
- package/runtime/js/cm-ai/cm-ai-qa-log.mjs +10 -5
- package/runtime/js/cm-ai/control-policy.mjs +111 -0
- package/runtime/js/cm-ai/drive-bootstrap.mjs +11 -8
- package/runtime/js/cm-ai/durable-runner-state.mjs +32 -126
- package/runtime/js/cm-ai/gate-bridge.mjs +4 -4
- package/runtime/js/cm-ai/host-conversation-execution.mjs +22 -20
- package/runtime/js/cm-ai/host-qa-fix-owner.mjs +11 -2
- package/runtime/js/cm-ai/host-qa-policy.mjs +63 -21
- package/runtime/js/cm-ai/host-review-authority.mjs +2 -2
- package/runtime/js/cm-ai/host-review-file.mjs +1 -1
- package/runtime/js/cm-ai/host-tool-bridge.mjs +3 -0
- package/runtime/js/cm-ai/host-workflow-capabilities.mjs +21 -10
- package/runtime/js/cm-ai/host.mjs +1 -2
- package/runtime/js/cm-ai/operator-guidance.mjs +1 -24
- package/runtime/js/cm-ai/review-package.mjs +16 -4
- package/runtime/js/cm-ai/reviewed-deliveries.mjs +1 -1
- package/runtime/js/cm-ai/task-runner.mjs +36 -99
- package/runtime/js/cm-init/review-evidence.mjs +3 -1
- package/runtime/js/cm-prd/review-host.mjs +1 -1
- package/runtime/js/cm-prd/review-publication.mjs +5 -3
- package/runtime/js/cm-refactor/workflow.mjs +1 -1
- package/runtime/js/notify-send.mjs +15 -14
- package/runtime/js/notify.mjs +27 -4
- package/runtime/js/policy-binding-compat.mjs +2 -1
- package/runtime/review.md +52 -7
- package/runtime/task-gates.md +107 -9
- package/scripts/cm-ai-abandon-effect-position.test.mjs +1 -8
- package/scripts/cm-ai-answer-gap-driver.test.mjs +12 -12
- package/scripts/cm-ai-answer-gap-fixture.mjs +1 -8
- package/scripts/cm-ai-batch-drive.mjs +50 -31
- package/scripts/cm-ai-batch-drive.test.mjs +62 -19
- package/scripts/cm-ai-batch-host.mjs +39 -20
- package/scripts/cm-ai-batch-host.test.mjs +62 -38
- package/scripts/cm-ai-batch-run-fixture.mjs +6 -53
- package/scripts/cm-ai-batch-run-member-stops.test.mjs +0 -12
- package/scripts/cm-ai-batch-run.mjs +34 -8
- package/scripts/cm-ai-bootstrap-flow.test.mjs +1 -7
- package/scripts/cm-ai-bootstrap.test.mjs +2 -3
- package/scripts/cm-ai-control-launch.test.mjs +219 -0
- package/scripts/cm-ai-control-policy.test.mjs +124 -0
- package/scripts/cm-ai-control-v2-drive.test.mjs +270 -0
- package/scripts/cm-ai-develop-answer-invalid.test.mjs +1 -8
- package/scripts/cm-ai-develop-call-timeout.test.mjs +1 -8
- package/scripts/cm-ai-develop-driver-gaps.test.mjs +33 -20
- package/scripts/cm-ai-direct-review.test.mjs +348 -0
- package/scripts/cm-ai-documentation-sync-gap.test.mjs +3 -3
- package/scripts/cm-ai-drive-bootstrap-rules.test.mjs +54 -25
- package/scripts/cm-ai-drive.mjs +96 -54
- package/scripts/cm-ai-drive.test.mjs +43 -84
- package/scripts/cm-ai-fix-integration.test.mjs +3 -5
- package/scripts/cm-ai-fix-later-delivery.test.mjs +3 -6
- package/scripts/cm-ai-fix-run-delivery.test.mjs +3 -6
- package/scripts/cm-ai-host-cli-workflow.test.mjs +6 -10
- package/scripts/cm-ai-host-fixture.mjs +38 -10
- package/scripts/cm-ai-host-protected.test.mjs +35 -33
- package/scripts/cm-ai-host.mjs +103 -93
- package/scripts/cm-ai-host.test.mjs +19 -18
- package/scripts/cm-ai-launch-diagnostics.test.mjs +5 -3
- package/scripts/cm-ai-legacy-history.test.mjs +53 -0
- package/scripts/cm-ai-light-modules.test.mjs +4 -7
- package/scripts/cm-ai-multi-root.test.mjs +4 -4
- package/scripts/cm-ai-nested-execution.test.mjs +16 -19
- package/scripts/cm-ai-progress.test.mjs +10 -8
- package/scripts/cm-ai-project-qa-gate.test.mjs +37 -10
- package/scripts/cm-ai-protected-scope.test.mjs +1 -2
- package/scripts/cm-ai-qa-config-revision.test.mjs +1 -9
- package/scripts/cm-ai-qa-fingerprint-config.test.mjs +12 -9
- package/scripts/cm-ai-qa-fix-cross-session.test.mjs +18 -3
- package/scripts/cm-ai-qa-fixed-log.test.mjs +41 -0
- package/scripts/cm-ai-qa-recovery-args.test.mjs +7 -0
- package/scripts/cm-ai-qa-rerun-timeouts.test.mjs +3 -4
- package/scripts/cm-ai-review-drift-precedence.test.mjs +1 -1
- package/scripts/cm-ai-review-failure.test.mjs +13 -19
- package/scripts/cm-ai-review-timeout-config.test.mjs +3 -1
- package/scripts/cm-ai-review-timeout.test.mjs +15 -128
- package/scripts/cm-ai-run.mjs +78 -24
- package/scripts/cm-ai-run.test.mjs +11 -38
- package/scripts/cm-ai-selection-guard.test.mjs +2 -2
- package/scripts/cm-ai-session-chain.test.mjs +18 -15
- package/scripts/cm-ai-spec-rebind.test.mjs +14 -18
- package/scripts/cm-ai-supersede.test.mjs +3 -10
- package/scripts/cm-blocked-reason.test.mjs +2 -3
- package/scripts/cm-capability-gate.test.mjs +33 -1
- package/scripts/cm-check-drive-files.mjs +1 -1
- package/scripts/cm-check-runtime.sh +1 -1
- package/scripts/cm-claude-worker.test.mjs +5 -3
- package/scripts/cm-controlled-correction.test.mjs +469 -0
- package/scripts/cm-external-batch-host.test.mjs +30 -11
- package/scripts/cm-external-model-host.test.mjs +1 -1
- package/scripts/cm-external-model-recovery.test.mjs +3 -9
- package/scripts/cm-external-qa-fix.test.mjs +1 -1
- package/scripts/cm-external-review-reconciliation.test.mjs +6 -24
- package/scripts/cm-fix-review-recovery.test.mjs +1 -1
- package/scripts/cm-host-qa-executor.test.mjs +1 -2
- package/scripts/cm-host-qa-policy.test.mjs +43 -16
- package/scripts/cm-host-review-authority.test.mjs +0 -31
- package/scripts/cm-knowledge-closeout.test.mjs +3 -3
- package/scripts/cm-notify-command.test.mjs +54 -18
- package/scripts/cm-notify-read-drift.test.mjs +69 -4
- package/scripts/cm-notify.mjs +16 -4
- package/scripts/cm-notify.test.mjs +91 -19
- package/scripts/cm-patrol.test.mjs +3 -2
- package/scripts/cm-task-gate-correction.test.mjs +69 -16
- package/scripts/cm-task-gate.mjs +368 -34
- package/scripts/cm-task-gate.py +2 -0
- package/scripts/cm-task-gate.test.mjs +252 -4
- package/scripts/fixtures/bootstrap-review-runner.mjs +1 -7
- package/scripts/fixtures/native-gate-fixture.mjs +18 -0
- package/scripts/policy-binding-compat.test.mjs +4 -0
- package/skills/cm-ai/SKILL.md +8 -6
- package/skills/cm-ai/references/N3-execute-task.md +17 -2
- package/skills/cm-ai/references/N4-review.md +11 -21
- package/skills/cm-ai/references/N5-mark-done.md +1 -1
- package/skills/cm-ai/references/N6-qa-eval.md +49 -21
- package/skills/cm-ai/references/js-host-modes.md +35 -14
- package/skills/cm-ai/references/js-host-qa-recovery.md +60 -12
- package/skills/cm-ai/references/js-host-recovery.md +95 -47
- package/skills/cm-ai/references/js-host.md +65 -28
- package/skills/cm-fix/SKILL.md +12 -0
- package/skills/cm-init/references/js-host.md +1 -1
- package/skills/cm-prd/references/js-host.md +1 -1
- package/skills/cm-refactor/SKILL.md +12 -0
- package/runtime/js/cm-ai/review-dispatch-limits.mjs +0 -18
- package/scripts/cm-ai-review-dispatch-exit.test.mjs +0 -475
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import fs from 'node:fs';
|
|
4
|
+
import os from 'node:os';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import {spawnSync} from 'node:child_process';
|
|
7
|
+
import {fileURLToPath} from 'node:url';
|
|
8
|
+
import {openControlRun,controlLaunchTarget} from './cm-ai-run.mjs';
|
|
9
|
+
import {readLaunchControlFile} from './cm-ai-host.mjs';
|
|
10
|
+
import {buildManifest} from './cm-spec-manifest.mjs';
|
|
11
|
+
import {createHostCheck} from '../runtime/js/cm-ai/host-check.mjs';
|
|
12
|
+
import {createHostQaExecutor} from '../runtime/js/cm-ai/host-qa-executor.mjs';
|
|
13
|
+
import {readExecutionSnapshot} from '../runtime/js/cm-ai/execution-snapshot.mjs';
|
|
14
|
+
import {configFingerprint} from '../runtime/js/cm-ai/codex-config.mjs';
|
|
15
|
+
|
|
16
|
+
const policy={version:2,development:'conversation',bootstrap:'disabled',qa:'run',qaFix:'disabled'};
|
|
17
|
+
const cli=fileURLToPath(new URL('./cm-ai-host.mjs',import.meta.url));
|
|
18
|
+
function fixture(t,{legacy=false}={}){
|
|
19
|
+
const root=fs.realpathSync(fs.mkdtempSync(path.join(os.tmpdir(),'cm-control-launch-')));
|
|
20
|
+
t.after(()=>fs.rmSync(root,{recursive:true,force:true}));
|
|
21
|
+
const codeProject=path.join(root,'code'),specsDir=path.join(root,'specs'),feature='1.work';
|
|
22
|
+
fs.mkdirSync(codeProject);fs.mkdirSync(path.join(specsDir,feature),{recursive:true});
|
|
23
|
+
fs.writeFileSync(path.join(codeProject,'a.mjs'),'export const a=1;\n');
|
|
24
|
+
fs.writeFileSync(path.join(codeProject,'requirements.md'),'fixture');
|
|
25
|
+
for(const file of ['requirements.md','design.md'])fs.writeFileSync(path.join(specsDir,feature,file),'# fixture\n');
|
|
26
|
+
fs.writeFileSync(path.join(specsDir,feature,'tasks.md'),'- [ ] T-001: implement a\n- [ ] T-002: implement b\n');
|
|
27
|
+
const approve=()=>fs.writeFileSync(path.join(specsDir,'.cm-specs-status'),JSON.stringify({status:'approved',features:[feature],specFiles:buildManifest(specsDir)}));
|
|
28
|
+
approve();
|
|
29
|
+
const identity={repositoryId:'launch-fixture',runId:'launch-run-0001',taskId:'T-001',attempt:1};
|
|
30
|
+
const definition={version:1,specsDir,codeProject,feature,identity,scope:['a.mjs'],requirements:['requirements.md']};
|
|
31
|
+
const execution={configuration:{kind:'synthetic-launch-v1',hostContextId:'main',...(legacy?{}:{controlPolicy:policy})},
|
|
32
|
+
timeoutMs:1000,excludedContexts:['main'],developer:{provider:'codex',requestedModel:'fixture',contextId:'developer',run:()=>{throw new Error('must not execute');}},
|
|
33
|
+
reviewers:[{id:'reviewer',adapterId:'codex-review-adapter',provider:'codex',requestedModel:'fixture',allowed:true,available:true,
|
|
34
|
+
contexts:['review-1','review-2'],run:()=>{throw new Error('must not review');}}],
|
|
35
|
+
reviewInvocation:{developerThreadId:'author',excludedThreadIds:['main']},
|
|
36
|
+
check:createHostCheck({cwd:codeProject,commands:[{id:'syntax',command:[process.execPath,'--check','a.mjs']}]})};
|
|
37
|
+
const qa={commands:[],environment:{kind:'web',carrier:'browser',target:'fixture',scope:'local'}};
|
|
38
|
+
execution.qaLogHome=path.join(root,'logs');
|
|
39
|
+
execution.qaDecisionProvider={timeoutMs:1000,decide:()=>{throw new Error('must not assess');}};
|
|
40
|
+
const configure=qa=>{
|
|
41
|
+
execution.configuration.workflow={qa,documentationPaths:[],applicableAgentFiles:[]};
|
|
42
|
+
execution.qaExecutor=createHostQaExecutor({codeProject,specsDir,feature,requirements:['requirements.md'],runtime:'codex',
|
|
43
|
+
...qa,timeoutMs:60000,logHome:execution.qaLogHome});
|
|
44
|
+
};configure(qa);
|
|
45
|
+
const storeIdentity={repositoryId:identity.repositoryId,runId:identity.runId};
|
|
46
|
+
const snapshot=()=>readExecutionSnapshot({specsRoot:specsDir,identity:storeIdentity});
|
|
47
|
+
const stateFile=path.join(specsDir,'.reviews','.execution',identity.runId,'state.json');
|
|
48
|
+
return {root,codeProject,specsDir,feature,identity,definition,execution,qa,configure,approve,snapshot,stateFile};
|
|
49
|
+
}
|
|
50
|
+
async function initialize(f){const run=await openControlRun(f.definition,'create',f.execution);run.close();return controlLaunchTarget(f.snapshot());}
|
|
51
|
+
|
|
52
|
+
test('v2 startup recovery refuses every missing target before durable records change',async t=>{
|
|
53
|
+
const f=fixture(t);await initialize(f);const before=fs.readFileSync(f.stateFile);
|
|
54
|
+
for(const options of [{specRebindReason:'same task'}, {rerunUnknownQa:true}, {rerunBlockedQa:true},
|
|
55
|
+
{qaConfigRevision:{previousWorkflow:f.execution.configuration.workflow,reason:'explicit revision'}}]){
|
|
56
|
+
await assert.rejects(openControlRun(f.definition,'resume',f.execution,options),{code:'invalid_input'});
|
|
57
|
+
assert.deepEqual(fs.readFileSync(f.stateFile),before);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
test('writer-held replay rejects stale revision, state, code and package instead of refreshing preview',async t=>{
|
|
62
|
+
const f=fixture(t),target=await initialize(f),before=fs.readFileSync(f.stateFile);
|
|
63
|
+
for(const drift of [{revision:'0'.repeat(64)},{state:'fixture_completed'},{code:'qa_result_blocked'},{packageDigest:'1'.repeat(64)}]){
|
|
64
|
+
await assert.rejects(openControlRun(f.definition,'resume',f.execution,{specRebindReason:'same task',expectedControl:{...target,...drift}}),
|
|
65
|
+
{code:'snapshot_changed'});
|
|
66
|
+
assert.deepEqual(fs.readFileSync(f.stateFile),before);
|
|
67
|
+
}
|
|
68
|
+
assert.deepEqual(controlLaunchTarget(f.snapshot()),target);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
test('valid launch preview permits specification rebind and preserves its concrete reason',async t=>{
|
|
72
|
+
const f=fixture(t),target=await initialize(f);
|
|
73
|
+
fs.writeFileSync(path.join(f.specsDir,f.feature,'tasks.md'),'- [ ] T-001: implement a\n- [ ] T-002: implement b with another output\n');f.approve();
|
|
74
|
+
const reason='Only T-002 changed; keep the original T-001 contract.';
|
|
75
|
+
const run=await openControlRun(f.definition,'resume',f.execution,{specRebindReason:reason,expectedControl:target});run.close();
|
|
76
|
+
const rows=f.snapshot().records.filter(row=>row.payload.type==='specification-rebound');
|
|
77
|
+
assert.equal(rows.length,1);assert.equal(rows[0].payload.record.reason,reason);
|
|
78
|
+
await assert.rejects(openControlRun(f.definition,'resume',f.execution,{specRebindReason:reason,expectedControl:target}),{code:'snapshot_changed'});
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
test('QA configuration revision verifies the old preview before append and retains the reason',async t=>{
|
|
82
|
+
const f=fixture(t),target=await initialize(f),previousWorkflow=structuredClone(f.execution.configuration.workflow),before=fs.readFileSync(f.stateFile);
|
|
83
|
+
f.configure({...f.qa,commands:[{id:'syntax',command:[process.execPath,'--check','a.mjs'],caseIds:[]}]});
|
|
84
|
+
const reason='Add the originally omitted syntax check.';
|
|
85
|
+
const options={qaConfigRevision:{previousWorkflow,reason}};
|
|
86
|
+
await assert.rejects(openControlRun(f.definition,'resume',f.execution,{...options,expectedControl:{...target,revision:'0'.repeat(64)}}),{code:'snapshot_changed'});
|
|
87
|
+
assert.deepEqual(fs.readFileSync(f.stateFile),before);
|
|
88
|
+
const run=await openControlRun(f.definition,'resume',f.execution,{...options,expectedControl:target});run.close();
|
|
89
|
+
const revision=f.snapshot().records.find(row=>row.payload.type==='qa-config-revised');
|
|
90
|
+
assert.equal(revision.payload.record.reason,reason);assert.equal(revision.payload.record.qaRound,0);
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
test('QA rerun flags accept a valid explicit target without manufacturing a QA outcome',async t=>{
|
|
94
|
+
const f=fixture(t),target=await initialize(f),before=fs.readFileSync(f.stateFile);
|
|
95
|
+
for(const options of [{rerunUnknownQa:true},{rerunBlockedQa:true,qaEnvironmentFailure:'Observed fixture environment failure.'}]){
|
|
96
|
+
const run=await openControlRun(f.definition,'resume',f.execution,{...options,expectedControl:target});run.close();
|
|
97
|
+
assert.deepEqual(fs.readFileSync(f.stateFile),before);
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
test('v1 recovery retains its original no-target and fingerprint behavior',async t=>{
|
|
102
|
+
const f=fixture(t,{legacy:true});await initialize(f);
|
|
103
|
+
fs.writeFileSync(path.join(f.specsDir,f.feature,'tasks.md'),'- [ ] T-001: implement a\n- [ ] T-002: another unchanged dependency\n');f.approve();
|
|
104
|
+
const run=await openControlRun(f.definition,'resume',f.execution,{specRebindReason:'Legacy explicit reason.'});run.close();
|
|
105
|
+
assert.equal(f.snapshot().records.find(row=>row.payload.type==='specification-rebound').payload.record.reason,'Legacy explicit reason.');
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
test('target file rejects unknown fields, malformed targets, symlinks and hardlinks',async t=>{
|
|
109
|
+
const f=fixture(t),target=await initialize(f),file=path.join(f.root,'target.json');
|
|
110
|
+
fs.writeFileSync(file,JSON.stringify(target));assert.deepEqual(readLaunchControlFile(file),target);
|
|
111
|
+
fs.writeFileSync(file,JSON.stringify({...target,extra:true}));assert.throws(()=>readLaunchControlFile(file));
|
|
112
|
+
fs.writeFileSync(file,JSON.stringify({...target,revision:'invalid'}));assert.throws(()=>readLaunchControlFile(file));
|
|
113
|
+
fs.writeFileSync(file,JSON.stringify(target).replace('"version":2','"version":1,"version":2'));
|
|
114
|
+
assert.throws(()=>readLaunchControlFile(file),{code:'duplicate_model_json_key'});
|
|
115
|
+
fs.writeFileSync(file,JSON.stringify(target));const alias=path.join(f.root,'alias');fs.linkSync(file,alias);
|
|
116
|
+
assert.throws(()=>readLaunchControlFile(file),{code:'invalid_input'});fs.unlinkSync(alias);
|
|
117
|
+
fs.renameSync(file,alias);fs.symlinkSync(alias,file);assert.throws(()=>readLaunchControlFile(file),{code:'invalid_input'});
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
test('real v2 CLI publishes a launch target, refuses a stale target and rebinds with the saved target',t=>{
|
|
121
|
+
const f=fixture(t),config=path.join(f.root,'run.json'),control=path.join(f.root,'control.json'),
|
|
122
|
+
review=path.join(f.root,'review.json'),workflow=path.join(f.root,'workflow.json'),targetFile=path.join(f.root,'target.json');
|
|
123
|
+
fs.writeFileSync(config,JSON.stringify(f.definition));fs.writeFileSync(control,JSON.stringify(policy));
|
|
124
|
+
fs.writeFileSync(workflow,JSON.stringify(f.execution.configuration.workflow));
|
|
125
|
+
fs.writeFileSync(review,JSON.stringify({model:'fixture',preflight:{passed:true,cli_model:'fixture',prompt_transport:'stdin',
|
|
126
|
+
config_fingerprint:configFingerprint({cwd:f.codeProject,model:'fixture'})}}));
|
|
127
|
+
const serve=(mode,extra=[])=>{
|
|
128
|
+
const result=spawnSync(process.execPath,[cli,'serve','--config',config,'--mode',mode,'--host-context','main',
|
|
129
|
+
'--control-config',control,'--review-config',review,'--workflow-config',workflow,...extra],
|
|
130
|
+
{encoding:'utf8',timeout:20000,input:JSON.stringify({version:2,requestId:'status',operation:'status',identity:f.identity})+'\n',
|
|
131
|
+
env:{...process.env,CM_WORKFLOW_HOME:path.join(f.root,'home'),CM_WORKFLOW_LOG_HOME:path.join(f.root,'logs')}});
|
|
132
|
+
return {...result,rows:result.stdout.trim().split('\n').filter(Boolean).map(JSON.parse)};
|
|
133
|
+
};
|
|
134
|
+
const created=serve('create');assert.equal(created.status,0,created.stderr);
|
|
135
|
+
const original=created.rows.find(row=>row.requestId==='status').result;
|
|
136
|
+
assert.deepEqual(original.launchControlTarget,controlLaunchTarget(f.snapshot()));
|
|
137
|
+
fs.writeFileSync(path.join(f.specsDir,f.feature,'tasks.md'),'- [ ] T-001: implement a\n- [ ] T-002: add another output\n');f.approve();
|
|
138
|
+
const preview=serve('resume');assert.equal(preview.status,0,preview.stderr);
|
|
139
|
+
const current=preview.rows.find(row=>row.requestId==='status').result;
|
|
140
|
+
assert.equal(current.controlTarget.code,'spec_drift');
|
|
141
|
+
assert.deepEqual(current.launchControlTarget,original.launchControlTarget,'live spec drift does not refresh the durable launch preview');
|
|
142
|
+
const before=fs.readFileSync(f.stateFile),reason='Only another task changed; preserve T-001.';
|
|
143
|
+
const extra=['--rebind-spec-material','--spec-rebind-reason',reason,'--expected-control',targetFile];
|
|
144
|
+
fs.writeFileSync(targetFile,JSON.stringify({...original.launchControlTarget,revision:'0'.repeat(64)}));
|
|
145
|
+
const refused=serve('resume',extra);assert.equal(refused.status,1);assert.match(refused.stderr,/snapshot_changed/);
|
|
146
|
+
assert.match(refused.stderr,/launchControlTarget/);assert.deepEqual(fs.readFileSync(f.stateFile),before);
|
|
147
|
+
fs.writeFileSync(targetFile,JSON.stringify(original.launchControlTarget));
|
|
148
|
+
const recovered=serve('resume',extra);assert.equal(recovered.status,0,recovered.stderr);
|
|
149
|
+
assert.equal(recovered.rows.find(row=>row.requestId==='status').result.code,null);
|
|
150
|
+
assert.equal(f.snapshot().records.find(row=>row.payload.type==='specification-rebound').payload.record.reason,reason);
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
test('v2 argv requires target for startup recovery and refuses external allow flags or create supersession',t=>{
|
|
154
|
+
const f=fixture(t),config=path.join(f.root,'run.json'),control=path.join(f.root,'control.json');
|
|
155
|
+
fs.writeFileSync(config,JSON.stringify(f.definition));fs.writeFileSync(control,JSON.stringify(policy));
|
|
156
|
+
const args=['serve','--config',config,'--mode','resume','--host-context','main','--control-config',control];
|
|
157
|
+
for(const extra of [['--rebind-spec-material','--spec-rebind-reason','fixture'],['--rerun-blocked-qa'],
|
|
158
|
+
['--revise-qa-config','previous.json','--qa-config-revision-reason','fixture']]){
|
|
159
|
+
const result=spawnSync(process.execPath,[cli,...args,...extra],{encoding:'utf8'});
|
|
160
|
+
assert.equal(result.status,1);assert.match(result.stderr,/invalid_input/);
|
|
161
|
+
}
|
|
162
|
+
for(const flag of ['--allow-qa','--allow-unknown']){
|
|
163
|
+
const result=spawnSync(process.execPath,[cli,...args,flag],{encoding:'utf8'});
|
|
164
|
+
assert.equal(result.status,1);assert.match(result.stderr,/invalid_arguments/);
|
|
165
|
+
}
|
|
166
|
+
const create=[...args];create[4]='create';
|
|
167
|
+
const result=spawnSync(process.execPath,[cli,...create,'--supersede-reviewed-evidence','--supersede-reason','fixture'],{encoding:'utf8'});
|
|
168
|
+
assert.equal(result.status,1);assert.match(result.stderr,/supersede_unavailable/);
|
|
169
|
+
assert.equal(fs.existsSync(path.join(f.specsDir,'.reviews','.execution')),false);
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
test('v2 manual QA Fix loads status with a simple owner without unused review or authoring adapters',t=>{
|
|
173
|
+
const f=fixture(t),config=path.join(f.root,'run.json'),control=path.join(f.root,'control.json'),
|
|
174
|
+
review=path.join(f.root,'review.json'),workflow=path.join(f.root,'workflow.json'),fix=path.join(f.root,'fix.json');
|
|
175
|
+
fs.writeFileSync(config,JSON.stringify(f.definition));fs.writeFileSync(control,JSON.stringify({...policy,qaFix:'manual'}));
|
|
176
|
+
fs.writeFileSync(workflow,JSON.stringify(f.execution.configuration.workflow));
|
|
177
|
+
fs.writeFileSync(review,JSON.stringify({model:'fixture',preflight:{passed:true,cli_model:'fixture',prompt_transport:'stdin',
|
|
178
|
+
config_fingerprint:configFingerprint({cwd:f.codeProject,model:'fixture'})}}));
|
|
179
|
+
fs.writeFileSync(fix,JSON.stringify({specsRoot:f.specsDir,identity:{...f.identity,runId:'simple-child'},configuration:{
|
|
180
|
+
hostContextId:'main',runtime:'codex',reproduction:{cwd:f.codeProject},
|
|
181
|
+
qaSource:{identity:f.identity,feature:f.feature,packageDigest:'a'.repeat(64),testRunId:'fixture-qa'}}}));
|
|
182
|
+
const args=[cli,'serve','--config',config,'--mode','create','--host-context','main','--control-config',control,
|
|
183
|
+
'--review-config',review,'--workflow-config',workflow,'--qa-fix-owner-config',fix];
|
|
184
|
+
const input=[{version:2,requestId:'status',operation:'status',identity:f.identity},
|
|
185
|
+
{version:2,requestId:'fix_status',operation:'fix_status',identity:f.identity,packageDigest:'a'.repeat(64),testRunId:'fixture-qa'}]
|
|
186
|
+
.map(JSON.stringify).join('\n')+'\n';
|
|
187
|
+
const result=spawnSync(process.execPath,args,{input,encoding:'utf8',timeout:20000,
|
|
188
|
+
env:{...process.env,CM_WORKFLOW_HOME:path.join(f.root,'home'),CM_WORKFLOW_LOG_HOME:path.join(f.root,'logs')}});
|
|
189
|
+
assert.equal(result.status,0,result.stderr);
|
|
190
|
+
const rows=result.stdout.trim().split('\n').map(JSON.parse);
|
|
191
|
+
assert.equal(rows[0].type,'host_ready');assert.equal(rows.find(row=>row.requestId==='status').result.state,'ready');
|
|
192
|
+
assert.ok(rows.find(row=>row.requestId==='fix_status'),'fix_status reaches the original owner; this ready fixture has no matching QA failure');
|
|
193
|
+
assert.doesNotMatch(result.stderr,/test_author_configuration_required|repair_configuration_required|review_configuration_required/);
|
|
194
|
+
const missingReview=spawnSync(process.execPath,args.filter((value,index)=>value!=='--review-config'&&args[index-1]!=='--review-config'),
|
|
195
|
+
{encoding:'utf8'});
|
|
196
|
+
assert.equal(missingReview.status,1);assert.match(missingReview.stderr,/review_configuration_required/);assert.match(missingReview.stderr,/--review-config/);
|
|
197
|
+
assert.doesNotMatch(missingReview.stderr,/allow-review-attempt/);
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
test('resume with missing stored evidence preserves the owner refusal for v1 and v2',async t=>{
|
|
201
|
+
for(const legacy of [false,true])for(const depth of [0,2,3]){
|
|
202
|
+
const f=fixture(t,{legacy});let dir=f.specsDir;
|
|
203
|
+
for(const part of ['.reviews','.execution',f.identity.runId].slice(0,depth)){
|
|
204
|
+
dir=path.join(dir,part);fs.mkdirSync(dir,{mode:0o700});
|
|
205
|
+
}
|
|
206
|
+
await assert.rejects(openControlRun(f.definition,'resume',f.execution),{code:depth===3?'store_layout_legacy':'store_missing'});
|
|
207
|
+
assert.equal(fs.existsSync(f.stateFile),false);
|
|
208
|
+
assert.equal(fs.existsSync(path.join(f.specsDir,'.reviews','.execution',f.identity.runId,'writer.sqlite')),false);
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
test('missing state in an existing writer layout is left for the owner without replacement',async t=>{
|
|
213
|
+
for(const legacy of [false,true]){
|
|
214
|
+
const f=fixture(t,{legacy});await initialize(f);fs.unlinkSync(f.stateFile);
|
|
215
|
+
await assert.rejects(openControlRun(f.definition,'resume',f.execution),{code:'ENOENT'});
|
|
216
|
+
assert.equal(fs.existsSync(f.stateFile),false);
|
|
217
|
+
assert.equal(fs.statSync(path.join(path.dirname(f.stateFile),'writer.sqlite')).isFile(),true);
|
|
218
|
+
}
|
|
219
|
+
});
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import fs from 'node:fs';
|
|
4
|
+
import os from 'node:os';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import {buildManifest} from './cm-spec-manifest.mjs';
|
|
7
|
+
import {openControlRun} from './cm-ai-run.mjs';
|
|
8
|
+
import {createConversationExecution} from '../runtime/js/cm-ai/host-conversation-execution.mjs';
|
|
9
|
+
import {configFingerprint} from '../runtime/js/cm-ai/codex-config.mjs';
|
|
10
|
+
import {readExecutionSnapshot} from '../runtime/js/cm-ai/execution-snapshot.mjs';
|
|
11
|
+
import {digest} from '../runtime/js/cm-ai/effect-contract.mjs';
|
|
12
|
+
import {readControlPolicy,readControlPolicyFile,assertControlEntry,controlTarget,withControlPolicyHost}
|
|
13
|
+
from '../runtime/js/cm-ai/control-policy.mjs';
|
|
14
|
+
|
|
15
|
+
const policy={version:2,development:'conversation',bootstrap:'disabled',qa:'disabled',qaFix:'disabled'};
|
|
16
|
+
const identity={repositoryId:'control-fixture',runId:'control-fixture-run',taskId:'T-001',attempt:1};
|
|
17
|
+
const snapshot=(revision=digest('a'))=>({revision,records:[{payload:{type:'init',config:{controlPolicy:policy}}}]});
|
|
18
|
+
const status={identity,state:'unknown',code:'execution_error',packageDigest:digest('package')};
|
|
19
|
+
const wire=(operation,extra={})=>({version:2,operation,requestId:'control-request',identity,...extra});
|
|
20
|
+
function temp(t){const root=fs.realpathSync(fs.mkdtempSync(path.join(os.tmpdir(),'cm-control-policy-')));
|
|
21
|
+
t.after(()=>fs.rmSync(root,{recursive:true,force:true}));return root;}
|
|
22
|
+
|
|
23
|
+
test('control choices are strict and cannot turn data presence into execution permission',()=>{
|
|
24
|
+
assert.deepEqual(readControlPolicy(policy),policy);
|
|
25
|
+
for(const value of [{...policy,allow:true},{...policy,version:1},{...policy,development:'auto'},
|
|
26
|
+
{...policy,qaFix:'auto'},{...policy,qa:'skip'},{...policy,bootstrap:'yes'}])assert.throws(()=>readControlPolicy(value));
|
|
27
|
+
assert.deepEqual(readControlPolicy({...policy,qa:'run',qaFix:'manual'}).qaFix,'manual');
|
|
28
|
+
});
|
|
29
|
+
test('policy file rejects duplicate keys, invalid UTF8 and symbolic links',t=>{
|
|
30
|
+
const root=temp(t),file=path.join(root,'control.json');
|
|
31
|
+
fs.writeFileSync(file,JSON.stringify(policy));assert.deepEqual(readControlPolicyFile(file),policy);
|
|
32
|
+
fs.writeFileSync(file,JSON.stringify(policy).replace('"version":2','"version":1,"version":2'));
|
|
33
|
+
assert.throws(()=>readControlPolicyFile(file),{code:'duplicate_model_json_key'});
|
|
34
|
+
fs.writeFileSync(file,Buffer.from([0xff]));assert.throws(()=>readControlPolicyFile(file),{code:'invalid_input'});
|
|
35
|
+
const link=path.join(root,'link.json');fs.symlinkSync(file,link);
|
|
36
|
+
assert.throws(()=>readControlPolicyFile(link),{code:'invalid_input'});
|
|
37
|
+
});
|
|
38
|
+
test('legacy and current entries cannot silently cross or change bound choices',()=>{
|
|
39
|
+
const legacy={records:[{payload:{type:'init',config:{version:3}}}]};
|
|
40
|
+
assert.doesNotThrow(()=>assertControlEntry(legacy,null));assert.doesNotThrow(()=>assertControlEntry(snapshot(),policy));
|
|
41
|
+
assert.throws(()=>assertControlEntry(legacy,policy),{code:'fingerprint_mismatch'});
|
|
42
|
+
assert.throws(()=>assertControlEntry(snapshot(),null),{code:'fingerprint_mismatch'});
|
|
43
|
+
assert.throws(()=>assertControlEntry(snapshot(),{...policy,bootstrap:'write'}),{code:'fingerprint_mismatch'});
|
|
44
|
+
});
|
|
45
|
+
test('only an exact current preview can invoke recovery; repeated/stale previews never mutate',async()=>{
|
|
46
|
+
let current=snapshot(),mutations=0;
|
|
47
|
+
const host=withControlPolicyHost({async handle(request){
|
|
48
|
+
if(request.operation==='status')return status;
|
|
49
|
+
mutations++;current=snapshot(digest(String(mutations)));return {outcome:'blocked',code:'develop_interrupted'};
|
|
50
|
+
}},{identity,snapshot:()=>current});
|
|
51
|
+
assert.equal((await host.handle(wire('abandon_effect'))).code,'invalid_input');
|
|
52
|
+
const preview=(await host.handle(wire('status'))).controlTarget;
|
|
53
|
+
assert.equal((await host.handle(wire('abandon_effect',{expectedControl:preview}))).code,'develop_interrupted');
|
|
54
|
+
assert.equal((await host.handle(wire('abandon_effect',{expectedControl:preview}))).code,'snapshot_changed');
|
|
55
|
+
assert.equal((await host.handle(wire('abandon_effect',{expectedControl:{...preview,identity:{...identity,attempt:2}}}))).code,'snapshot_changed');
|
|
56
|
+
assert.equal(mutations,1);
|
|
57
|
+
assert.equal((await host.handle({...wire('advance'),version:1})).code,'fingerprint_mismatch');
|
|
58
|
+
assert.equal((await host.handle(wire('advance',{expectedControl:preview}))).code,'invalid_input');
|
|
59
|
+
});
|
|
60
|
+
test('ordinary flow is automatic; recovery cannot queue behind an in-flight mutation',async()=>{
|
|
61
|
+
let release;const finished=new Promise(resolve=>release=resolve);
|
|
62
|
+
const host=withControlPolicyHost({async handle(request){return request.operation==='status'?status:finished;}},
|
|
63
|
+
{identity,snapshot});
|
|
64
|
+
const running=host.handle(wire('advance'));
|
|
65
|
+
assert.equal((await host.handle(wire('abandon_effect',{expectedControl:controlTarget(status,snapshot())}))).code,'host_busy');
|
|
66
|
+
const busyStatus=await host.handle(wire('status'));assert.equal(busyStatus.controlTarget,undefined);
|
|
67
|
+
release(status);assert.deepEqual(await running,status);
|
|
68
|
+
assert.ok((await host.handle(wire('status'))).controlTarget);
|
|
69
|
+
});
|
|
70
|
+
test('QA-fix recovery binds the child preview as well as parent state',async()=>{
|
|
71
|
+
const child={runId:'qa-child',revision:digest('child'),stage:'unknown'};let forwarded;
|
|
72
|
+
const host=withControlPolicyHost({async handle(request){
|
|
73
|
+
if(request.operation==='status')return status;
|
|
74
|
+
if(request.operation==='fix_status')return {code:'qa_fix_incomplete',childControlTarget:child};
|
|
75
|
+
forwarded=request;return {code:'fix_step_interrupted'};
|
|
76
|
+
}},{identity,snapshot});
|
|
77
|
+
const target=(await host.handle(wire('fix_status'))).controlTarget;
|
|
78
|
+
assert.deepEqual(target.child,child);
|
|
79
|
+
const recovery={fixOperation:'abandon_step',reason:'Synthetic interrupted child'};
|
|
80
|
+
assert.equal((await host.handle(wire('fix_action',{...recovery,expectedControl:controlTarget(status,snapshot())}))).code,'invalid_input');
|
|
81
|
+
await host.handle(wire('fix_action',{...recovery,expectedControl:target}));
|
|
82
|
+
assert.deepEqual(forwarded.expectedFixControl,child);assert.equal(forwarded.expectedControl,undefined);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
test('real owned journals keep legacy bytes and reject cross-entry resumes before writes',async t=>{
|
|
86
|
+
const root=temp(t),codeProject=path.join(root,'code'),specsDir=path.join(root,'specs');
|
|
87
|
+
fs.mkdirSync(codeProject);fs.mkdirSync(path.join(specsDir,'1.work'),{recursive:true});
|
|
88
|
+
fs.writeFileSync(path.join(codeProject,'.cm-workflow.json'),JSON.stringify({version:1,policies:{delivery:'diff'}}));
|
|
89
|
+
for(const name of ['requirements.md','design.md'])fs.writeFileSync(path.join(specsDir,'1.work',name),'# Fixture\n');
|
|
90
|
+
fs.writeFileSync(path.join(specsDir,'1.work/tasks.md'),'- [ ] T-001: fixture\n');
|
|
91
|
+
fs.writeFileSync(path.join(specsDir,'.cm-specs-status'),JSON.stringify({status:'approved',features:['1.work'],specFiles:buildManifest(specsDir)}));
|
|
92
|
+
const definition={version:1,specsDir,codeProject,feature:'1.work',identity,scope:['target.mjs'],requirements:[]};
|
|
93
|
+
const review={model:'fixture',disabledSkills:[],preflight:{passed:true,cli_model:'fixture',prompt_transport:'stdin',
|
|
94
|
+
config_fingerprint:configFingerprint({cwd:codeProject,model:'fixture'})}};
|
|
95
|
+
const execution=control=>createConversationExecution(definition,'control-fixture-host',{call(){assert.fail('no provider dispatch');}},
|
|
96
|
+
review,null,null,false,'codex',control?{controlPolicy:policy}:{});
|
|
97
|
+
let run=await openControlRun(definition,'create',execution(false));assert.equal(run.blocked,undefined,JSON.stringify(run.blocked));run.close();
|
|
98
|
+
const file=path.join(specsDir,'.reviews/.execution',identity.runId,'state.json'),before=fs.readFileSync(file);
|
|
99
|
+
await assert.rejects(openControlRun(definition,'resume',execution(true)),{code:'fingerprint_mismatch'});
|
|
100
|
+
assert.deepEqual(fs.readFileSync(file),before);
|
|
101
|
+
run=await openControlRun(definition,'resume',execution(false));
|
|
102
|
+
assert.equal((await run.host.handle({...wire('status'),version:1})).state,'ready');run.close();
|
|
103
|
+
assert.deepEqual(fs.readFileSync(file),before);
|
|
104
|
+
definition.identity={...identity,runId:'control-current-run'};
|
|
105
|
+
run=await openControlRun(definition,'create',execution(true));
|
|
106
|
+
const saved=readExecutionSnapshot({specsRoot:specsDir,identity:{repositoryId:identity.repositoryId,runId:definition.identity.runId}});
|
|
107
|
+
assert.deepEqual(saved.records[0].payload.config.controlPolicy,policy);run.close();
|
|
108
|
+
const newFile=path.join(specsDir,'.reviews/.execution',definition.identity.runId,'state.json'),newBytes=fs.readFileSync(newFile);
|
|
109
|
+
await assert.rejects(openControlRun(definition,'resume',execution(false)),{code:'fingerprint_mismatch'});
|
|
110
|
+
assert.deepEqual(fs.readFileSync(newFile),newBytes);
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
test('reused error codes do not swallow failures from the underlying host',async()=>{
|
|
115
|
+
for(const operation of ['advance','abandon_effect'])for(const code of ['invalid_input','snapshot_changed','fingerprint_mismatch']){
|
|
116
|
+
const failure=Object.assign(new Error('Underlying host failure'),{code});
|
|
117
|
+
const host=withControlPolicyHost({async handle(request){
|
|
118
|
+
if(request.operation==='status'&&operation==='advance')return status;
|
|
119
|
+
throw failure;
|
|
120
|
+
}},{identity,snapshot});
|
|
121
|
+
await assert.rejects(host.handle(wire(operation,operation==='abandon_effect'
|
|
122
|
+
?{expectedControl:controlTarget(status,snapshot())}:{})),error=>error===failure);
|
|
123
|
+
}
|
|
124
|
+
});
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import fs from 'node:fs';
|
|
4
|
+
import os from 'node:os';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import {spawnSync} from 'node:child_process';
|
|
7
|
+
import {fileURLToPath} from 'node:url';
|
|
8
|
+
import {buildManifest} from './cm-spec-manifest.mjs';
|
|
9
|
+
import {configFingerprint} from '../runtime/js/cm-ai/codex-config.mjs';
|
|
10
|
+
import {readDriverControl,controlDevelopAttempts,buildCmAiDriveHostArgs,buildCmAiDriveRequest} from './cm-ai-drive.mjs';
|
|
11
|
+
import {batchDevelopAttempts,buildCmAiBatchDriveHostArgs,buildCmAiBatchDriveRequest} from './cm-ai-batch-drive.mjs';
|
|
12
|
+
import {inspectDriverBootstrap} from '../runtime/js/cm-ai/drive-bootstrap.mjs';
|
|
13
|
+
import {createHostWorkflowCapabilities} from '../runtime/js/cm-ai/host-workflow-capabilities.mjs';
|
|
14
|
+
|
|
15
|
+
const SINGLE=fileURLToPath(new URL('./cm-ai-drive.mjs',import.meta.url));
|
|
16
|
+
const BATCH=fileURLToPath(new URL('./cm-ai-batch-drive.mjs',import.meta.url));
|
|
17
|
+
const REVIEW=fileURLToPath(new URL('./fixtures/codex-review-process.mjs',import.meta.url));
|
|
18
|
+
const policy={version:2,development:'conversation',bootstrap:'disabled',qa:'disabled',qaFix:'disabled'};
|
|
19
|
+
const identity={repositoryId:'v2-drive-fixture',runId:'v2-drive-run',taskId:'T-001',attempt:1};
|
|
20
|
+
const key='1.work/T-001';
|
|
21
|
+
const answer={status:'succeeded',value:{outcome:'implemented',application:{status:'no_relevant_lesson',note:null},
|
|
22
|
+
retrospective:{status:'no_new_lesson',candidates:[],reason:null}},edits:{'target.mjs':'target.txt'}};
|
|
23
|
+
function fixture(t,batch=false,qaRun=false){
|
|
24
|
+
const root=fs.realpathSync(fs.mkdtempSync(path.join(os.tmpdir(),'cm-v2-drive-')));
|
|
25
|
+
t.after(()=>fs.rmSync(root,{recursive:true,force:true}));
|
|
26
|
+
const specsDir=path.join(root,'specs5'),codeProject=path.join(root,'app'),bin=path.join(root,'bin');
|
|
27
|
+
fs.mkdirSync(path.join(specsDir,'1.work'),{recursive:true});fs.mkdirSync(codeProject);fs.mkdirSync(bin);
|
|
28
|
+
for(const name of ['requirements.md','design.md'])fs.writeFileSync(path.join(specsDir,'1.work',name),'# Fixture\n');
|
|
29
|
+
fs.writeFileSync(path.join(specsDir,'1.work/tasks.md'),'- [ ] T-001: fixture\n');
|
|
30
|
+
fs.writeFileSync(path.join(specsDir,'.cm-specs-status'),JSON.stringify({status:'approved',features:['1.work'],specFiles:buildManifest(specsDir)}));
|
|
31
|
+
fs.writeFileSync(path.join(codeProject,'requirements.md'),'# Fixture\n');
|
|
32
|
+
if(batch)for(const args of [['init','-b','main'],['config','user.name','Fixture'],['config','user.email','fixture@example.invalid'],['add','-A'],['commit','-m','baseline']]){
|
|
33
|
+
const r=spawnSync('git',['-C',codeProject,...args],{encoding:'utf8'});assert.equal(r.status,0,r.stderr);
|
|
34
|
+
}
|
|
35
|
+
const definition={version:1,specsDir,codeProject,feature:'1.work',identity,scope:['target.mjs'],requirements:['requirements.md']};
|
|
36
|
+
const config=batch?{batch:{version:1,repositoryId:identity.repositoryId,batchId:'v2-batch-drive-run',specsDir,codeProject,
|
|
37
|
+
tasks:[{feature:'1.work',taskId:'T-001',scope:['target.mjs'],requirements:['requirements.md']}]},
|
|
38
|
+
workflows:{[key]:{qa:qaRun?{commands:[{id:'value',caseIds:[],command:[process.execPath,'-e',
|
|
39
|
+
"import('./target.mjs').then(m=>{if(m.value!==43)process.exit(1)})"]}],
|
|
40
|
+
environment:{kind:'web',carrier:'browser',target:'fixture-target',scope:'local'}}:null,
|
|
41
|
+
documentationPaths:[],applicableAgentFiles:[]}}}:definition;
|
|
42
|
+
fs.writeFileSync(path.join(root,'run.json'),JSON.stringify(config));
|
|
43
|
+
fs.writeFileSync(path.join(root,'control.json'),JSON.stringify({...policy,...(qaRun?{qa:'run'}:{})}));
|
|
44
|
+
fs.writeFileSync(path.join(root,'review.json'),JSON.stringify({model:'fixture',preflight:{passed:true,cli_model:'fixture',
|
|
45
|
+
prompt_transport:'stdin',config_fingerprint:configFingerprint({cwd:codeProject,model:'fixture'})}}));
|
|
46
|
+
const answers=path.join(root,'answers',...(batch?['1.work','T-001']:[]));fs.mkdirSync(answers,{recursive:true});
|
|
47
|
+
fs.writeFileSync(path.join(answers,'develop.json'),JSON.stringify(answer));
|
|
48
|
+
fs.writeFileSync(path.join(answers,'target.txt'),'export const value = 42;\n');
|
|
49
|
+
fs.writeFileSync(path.join(answers,'documentation-inspect.json'),JSON.stringify({status:'completed',reason:'Fixture inspected'}));
|
|
50
|
+
fs.writeFileSync(path.join(answers,'qa-assess.json'),JSON.stringify({confirmed:true}));
|
|
51
|
+
const review=verdict=>{
|
|
52
|
+
let source=fs.readFileSync(REVIEW,'utf8');
|
|
53
|
+
if(verdict==='changes_requested')source=source.replace("verdict:'approved'","verdict:'changes_requested'")
|
|
54
|
+
.replace('findings:[]',"findings:[{id:'F1',severity:'P2',path:'target.mjs',message:'Revise value',evidence:'Fixture finding'}]");
|
|
55
|
+
fs.writeFileSync(path.join(bin,'codex'),source,{mode:0o700});
|
|
56
|
+
};review('changes_requested');
|
|
57
|
+
const plan=extra=>{
|
|
58
|
+
const file=path.join(root,`plan-${Math.random().toString(36).slice(2)}.json`);
|
|
59
|
+
fs.writeFileSync(file,JSON.stringify({config:'run.json',mode:'create',hostContext:'v2-fixture-host',controlConfig:'control.json',
|
|
60
|
+
permissions:['--review-config','review.json'],answers:'answers',
|
|
61
|
+
checks:batch?{[key]:[{id:'syntax',command:[process.execPath,'--check','target.mjs']}]}:[{id:'syntax',command:[process.execPath,'--check','target.mjs']}],...extra}));
|
|
62
|
+
return file;
|
|
63
|
+
};
|
|
64
|
+
const drive=(file,operation='advance')=>spawnSync(process.execPath,[batch?BATCH:SINGLE,'--plan',file,operation],{encoding:'utf8',timeout:60000,
|
|
65
|
+
env:{...process.env,PATH:bin+path.delimiter+process.env.PATH,CM_WORKFLOW_HOME:path.join(root,'home'),CM_WORKFLOW_LOG_HOME:path.join(root,'logs')}});
|
|
66
|
+
return {root,codeProject,specsDir,answers,plan,drive,review};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
test('v2 launch arguments replace the development grant and leave legacy launch intact',()=>{
|
|
70
|
+
const plan={mode:'create',hostContext:'host',controlConfig:'policy.json'};
|
|
71
|
+
assert.deepEqual(buildCmAiDriveHostArgs(plan,[],'run.json','/fixture/policy.json').slice(0,9),
|
|
72
|
+
['serve','--config','run.json','--mode','create','--host-context','host','--control-config','/fixture/policy.json']);
|
|
73
|
+
assert.deepEqual(buildCmAiBatchDriveHostArgs(plan,[],'batch.json','/fixture/policy.json').slice(0,9),
|
|
74
|
+
['serve','--config','batch.json','--mode','create','--host-context','host','--control-config','/fixture/policy.json']);
|
|
75
|
+
assert.ok(buildCmAiDriveHostArgs({mode:'create',hostContext:'host'},[],'run.json').includes('--allow-development'));
|
|
76
|
+
assert.deepEqual(buildCmAiBatchDriveHostArgs({mode:'create',hostContext:'host'},[],'run.json'),
|
|
77
|
+
['serve','--config','run.json','--host-context','host','--allow-development']);
|
|
78
|
+
});
|
|
79
|
+
test('v2 batch accepts direct policy launch with or without mode',t=>{
|
|
80
|
+
const host=fileURLToPath(new URL('./cm-ai-batch-host.mjs',import.meta.url));
|
|
81
|
+
for(const mode of [null,'create','resume']){
|
|
82
|
+
const f=fixture(t,true),context='direct-v2-'+(mode??'no-mode');
|
|
83
|
+
const args=['serve','--config',path.join(f.root,'run.json'),
|
|
84
|
+
...(mode?['--mode',mode]:[]),'--host-context',context,'--control-config',path.join(f.root,'control.json'),
|
|
85
|
+
'--review-config',path.join(f.root,'review.json')];
|
|
86
|
+
const request={version:2,operation:'status',requestId:'direct-status'};
|
|
87
|
+
const result=spawnSync(process.execPath,[host,...args],{encoding:'utf8',timeout:20000,
|
|
88
|
+
input:JSON.stringify(request)+'\n',env:{...process.env,CM_WORKFLOW_HOME:path.join(f.root,'home'),
|
|
89
|
+
CM_WORKFLOW_LOG_HOME:path.join(f.root,'logs')}});
|
|
90
|
+
assert.equal(result.status,0,result.stderr);
|
|
91
|
+
const rows=result.stdout.trim().split('\n').map(JSON.parse);
|
|
92
|
+
assert.equal(rows[0].type,'host_ready');
|
|
93
|
+
const response=rows.find(row=>row.requestId==='direct-status');assert.ok(response,result.stdout);
|
|
94
|
+
assert.notEqual(response.result.outcome,'rejected',result.stdout);
|
|
95
|
+
assert.ok(response.result.state,result.stdout);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
test('v2 policy determines both rounds independently of legacy grant flags',()=>{
|
|
100
|
+
assert.deepEqual(controlDevelopAttempts({state:'ready',attempt:1},'advance').attempts,[1,2]);
|
|
101
|
+
assert.deepEqual(controlDevelopAttempts({state:'awaiting_review',attempt:1},'advance').attempts,[2]);
|
|
102
|
+
assert.deepEqual(controlDevelopAttempts({state:'changes_requested',attempt:2},'advance').attempts,[2]);
|
|
103
|
+
assert.deepEqual(batchDevelopAttempts({state:'ready',attempt:1},key,[],policy),[1,2]);
|
|
104
|
+
assert.deepEqual(batchDevelopAttempts({state:'ready',attempt:1},key,[],{...policy,development:'provider'}),[]);
|
|
105
|
+
assert.match(inspectDriverBootstrap({advance:true,definition:{},permissions:['--bootstrap-config','unused.json'],controlPolicy:policy}).gap,
|
|
106
|
+
/invalid_arguments.*bootstrap disabled/,'disabled bootstrap refuses its configured writer without reading it');
|
|
107
|
+
});
|
|
108
|
+
test('v2 recovery preserves the caller target while ordinary advance needs no target',t=>{
|
|
109
|
+
const f=fixture(t),base={controlConfig:'control.json',mode:'resume',permissions:[]};
|
|
110
|
+
assert.deepEqual(readDriverControl(base,f.root,'advance').policy,policy);
|
|
111
|
+
assert.throws(()=>readDriverControl(base,f.root,'develop_redo'),/expectedControl/);
|
|
112
|
+
const target={version:2,identity,state:'unknown',revision:'preview-bound'};
|
|
113
|
+
const p={...base,expectedControl:target};
|
|
114
|
+
assert.equal(buildCmAiDriveRequest('develop_redo',p,{identity}).expectedControl,target);
|
|
115
|
+
assert.equal(buildCmAiDriveRequest('advance',p,{identity}).expectedControl,undefined);
|
|
116
|
+
assert.equal(buildCmAiDriveRequest('advance',p,{identity}).version,2);
|
|
117
|
+
assert.equal(buildCmAiDriveRequest('advance',{},{identity}).version,1);
|
|
118
|
+
const attempt2={...p,expectedControl:{...target,identity:{...identity,attempt:2}}};
|
|
119
|
+
assert.equal(buildCmAiDriveRequest('develop_redo',attempt2,{identity},identity).identity.attempt,2,
|
|
120
|
+
'recovery uses the preview identity rather than the definition or a new journal read');
|
|
121
|
+
const batchTarget={version:2,batchId:'batch',taskKey:key,member:target,batchDigest:'preview'};
|
|
122
|
+
assert.equal(buildCmAiBatchDriveRequest('develop_redo',{...p,taskKey:key,expectedControl:batchTarget}).expectedControl,batchTarget);
|
|
123
|
+
assert.throws(()=>readDriverControl({...p,mode:'create'},f.root,'advance'),/create 禁止/);
|
|
124
|
+
});
|
|
125
|
+
test('v2 always separates QA disposition from execution while qa:null keeps legacy behavior',()=>{
|
|
126
|
+
const options={definition:{specsDir:'/fixture/specs',codeProject:'/fixture/code',feature:'1.work',requirements:[]},
|
|
127
|
+
configuration:{qa:null,documentationPaths:[],applicableAgentFiles:[]},bridge:{call:async()=>{}},allowQa:false};
|
|
128
|
+
const old=createHostWorkflowCapabilities(options);
|
|
129
|
+
assert.equal(old.qaDecisionProvider,undefined);assert.equal(old.qaExecutor,undefined);
|
|
130
|
+
const v2=createHostWorkflowCapabilities({...options,controlPolicy:policy});
|
|
131
|
+
assert.equal(typeof v2.qaDecisionProvider.decide,'function');assert.equal(v2.qaExecutor,undefined);
|
|
132
|
+
const configured={...options,configuration:{...options.configuration,qa:{commands:[{id:'local',caseIds:[],command:[process.execPath,'-e','0']}],
|
|
133
|
+
environment:{kind:'web',carrier:'browser',target:'fixture-target',scope:'local'}}}};
|
|
134
|
+
assert.equal(createHostWorkflowCapabilities({...configured,controlPolicy:policy}).qaExecutor,undefined,
|
|
135
|
+
'a stored execution recipe does not enable a disabled executor');
|
|
136
|
+
assert.throws(()=>createHostWorkflowCapabilities(configured),{code:'qa_authorization_required'},
|
|
137
|
+
'legacy configured QA still requires its original authorization');
|
|
138
|
+
});
|
|
139
|
+
test('v2 rejects every allow flag as a migration error before opening a run',t=>{
|
|
140
|
+
const f=fixture(t);
|
|
141
|
+
for(const flag of ['--allow-development','--allow-review-attempt','--allow-unrecognized']){
|
|
142
|
+
const r=f.drive(f.plan({permissions:[flag,'1']}));assert.equal(r.status,2,r.stderr);
|
|
143
|
+
assert.match(r.stderr,/迁移错误.*--allow-\*/);
|
|
144
|
+
assert.equal(fs.existsSync(path.join(f.specsDir,'.reviews/.execution')),false);
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
test('disabled bootstrap and QA Fix refuse configured capabilities before reading their files',t=>{
|
|
148
|
+
const f=fixture(t);
|
|
149
|
+
for(const flag of ['--bootstrap-config','--qa-fix-owner-config','--qa-fix-template-config','--protected-config']){
|
|
150
|
+
const r=f.drive(f.plan({permissions:[flag,'missing.json']}));
|
|
151
|
+
assert.equal(r.status,2,r.stderr);assert.match(r.stderr,/invalid_arguments/);
|
|
152
|
+
assert.doesNotMatch(r.stderr,/文件不存在|ENOENT/);
|
|
153
|
+
assert.equal(fs.existsSync(path.join(f.specsDir,'.reviews/.execution')),false);
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
for(const batch of [false,true])test(`v2 ${batch?'batch':'single'} explicit recovery refuses missing preview before host launch`,t=>{
|
|
157
|
+
const f=fixture(t,batch);
|
|
158
|
+
const r=f.drive(f.plan({mode:'resume',originalHostContext:'v2-fixture-host',taskKey:key,reason:'Fixture stopped'}),'develop_redo');
|
|
159
|
+
assert.equal(r.status,2,r.stderr);assert.match(r.stderr,/expectedControl/);
|
|
160
|
+
assert.equal(fs.existsSync(path.join(f.specsDir,'.reviews/.execution')),false);
|
|
161
|
+
});
|
|
162
|
+
for(const batch of [false,true])test(`v2 ${batch?'batch':'single'} real host holds absent a2 and resumes with its own second-round answer`,t=>{
|
|
163
|
+
const f=fixture(t,batch,batch),first=f.drive(f.plan());
|
|
164
|
+
assert.equal(first.status,0,first.stderr);
|
|
165
|
+
const result=JSON.parse(first.stdout).result;
|
|
166
|
+
assert.equal(result.code,'revision_answer_required',first.stdout);
|
|
167
|
+
assert.match(first.stderr,/应答 develop/);assert.match(first.stderr,/develop-a2\.json/);
|
|
168
|
+
assert.equal(fs.readFileSync(path.join(f.codeProject,'target.mjs'),'utf8'),'export const value = 42;\n');
|
|
169
|
+
fs.writeFileSync(path.join(f.answers,'develop-a2.json'),JSON.stringify({...answer,edits:{'target.mjs':'second.txt'}}));
|
|
170
|
+
fs.writeFileSync(path.join(f.answers,'second.txt'),'export const value = 43;\n');f.review('approved');
|
|
171
|
+
const second=f.drive(f.plan({mode:'resume',originalHostContext:'v2-fixture-host'}));
|
|
172
|
+
assert.equal(second.status,0,second.stderr);
|
|
173
|
+
assert.equal(fs.readFileSync(path.join(f.codeProject,'target.mjs'),'utf8'),'export const value = 43;\n');
|
|
174
|
+
let result2=JSON.parse(second.stdout).result;
|
|
175
|
+
if(batch)for(let n=0;n<4&&result2.state!=='run_done';n++){
|
|
176
|
+
const next=f.drive(f.plan({mode:'resume',originalHostContext:'v2-fixture-host'}));
|
|
177
|
+
assert.equal(next.status,0,next.stderr);result2=JSON.parse(next.stdout).result;
|
|
178
|
+
}
|
|
179
|
+
assert.equal(result2.state,batch?'run_done':'fixture_completed',second.stdout);
|
|
180
|
+
if(batch){
|
|
181
|
+
assert.match(second.stderr,/应答 qa_assess/);
|
|
182
|
+
assert.match(second.stderr,/检查结束.*value.*passed/,'actual QA command supplies the passed result');
|
|
183
|
+
const rows=fs.readFileSync(path.join(f.specsDir,'运行日志.jsonl'),'utf8').trim().split('\n').map(JSON.parse);
|
|
184
|
+
assert.ok(rows.some(row=>row.node==='N6'&&row.event==='test_run'&&row.phase==='complete'&&row.result==='PASS'));
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
test('v2 protected provider real host dispatches two fresh independent reviews after a rejected first round',t=>{
|
|
189
|
+
const f=fixture(t),bin=path.join(f.root,'bin'),witness=path.join(f.root,'protected-dispatch.jsonl');
|
|
190
|
+
fs.writeFileSync(path.join(f.root,'control.json'),JSON.stringify({...policy,development:'provider'}));
|
|
191
|
+
fs.writeFileSync(path.join(f.codeProject,'.cm-workflow.json'),JSON.stringify({version:1,runtimes:{available:'codex'},
|
|
192
|
+
roles:{coder:{adapter:'codex-cli'},reviewer:{adapter:'codex-cli'}}}));
|
|
193
|
+
fs.writeFileSync(path.join(f.root,'protected.json'),JSON.stringify({model:'fixture',timeoutMs:5000,
|
|
194
|
+
checkCommands:[{id:'syntax',command:[process.execPath,'--check','target.mjs']}]}));
|
|
195
|
+
// Only fixture Node processes run. The sandbox shim verifies the formal
|
|
196
|
+
// profile/command arguments; this witness does not test native OS isolation.
|
|
197
|
+
fs.writeFileSync(path.join(bin,'codex'),`#!${process.execPath}
|
|
198
|
+
const fs=require('node:fs'),cp=require('node:child_process'),assert=require('node:assert/strict');
|
|
199
|
+
const args=process.argv.slice(2),witness=${JSON.stringify(witness)};
|
|
200
|
+
const record=row=>fs.appendFileSync(witness,JSON.stringify(row)+'\\n');
|
|
201
|
+
if(args[0]==='sandbox'){
|
|
202
|
+
assert.equal(args[args.indexOf('-P')+1],'cm-specs');assert(args.includes('--include-managed-config'));
|
|
203
|
+
const settings=args.filter((_,index)=>args[index-1]==='-c');
|
|
204
|
+
assert(settings.includes('default_permissions="cm-specs"'));
|
|
205
|
+
assert(settings.some(value=>value.startsWith('permissions.cm-specs=')&&value.includes('network={enabled=false}')));
|
|
206
|
+
const command=args.slice(args.indexOf('--')+1);assert.deepEqual(command,[${JSON.stringify(process.execPath)},'--check','target.mjs']);
|
|
207
|
+
record({type:'check'});const checked=cp.spawnSync(command[0],command.slice(1),{cwd:process.cwd(),encoding:'utf8'});
|
|
208
|
+
process.stdout.write(checked.stdout??'');process.stderr.write(checked.stderr??'');process.exit(checked.status??1);
|
|
209
|
+
}
|
|
210
|
+
let prompt='';process.stdin.on('data',part=>prompt+=part);process.stdin.on('end',()=>{
|
|
211
|
+
let value,thread;
|
|
212
|
+
if(prompt.includes('<cm-developer-data-json>')){
|
|
213
|
+
const data=JSON.parse(prompt.split('<cm-developer-data-json>\\n')[1].split('\\n')[0]),attempt=data.identity.attempt;
|
|
214
|
+
assert.deepEqual(data.scope,['target.mjs']);assert.equal(data.specification.task.id,'T-001');
|
|
215
|
+
const settings=args.filter((_,index)=>args[index-1]==='-c');assert(settings.includes('default_permissions="cm-specs"'));
|
|
216
|
+
assert(args.includes('--output-schema'));record({type:'develop',attempt});
|
|
217
|
+
fs.writeFileSync('target.mjs','export const value = '+(41+attempt)+';\\n');
|
|
218
|
+
value={outcome:'implemented',application:{status:'no_relevant_lesson',note:null},
|
|
219
|
+
retrospective:{status:'no_new_lesson',candidates:[],reason:null}};thread='fixture-protected-author-'+attempt;
|
|
220
|
+
}else{
|
|
221
|
+
const data=JSON.parse(prompt.split('<cm-review-data-json>\\n')[1]),attempt=data.reviewPackage.identity.attempt;
|
|
222
|
+
assert.equal(args[args.indexOf('--sandbox')+1],'read-only');
|
|
223
|
+
if(attempt===2)assert.equal(data.priorReview.verdict,'changes_requested');
|
|
224
|
+
thread='fixture-protected-independent-review-'+attempt;
|
|
225
|
+
value={verdict:attempt===1?'changes_requested':'approved',packageDigest:data.reviewPackage.packageDigest,
|
|
226
|
+
examinedPaths:data.examinedPaths,findings:attempt===1?[{id:'F1',severity:'P2',path:'target.mjs',
|
|
227
|
+
message:'Use the revised constant',evidence:'First synthetic review rejects 42'}]:[],summary:'Synthetic independent review'};
|
|
228
|
+
record({type:'review',attempt,thread,verdict:value.verdict,packageDigest:value.packageDigest});
|
|
229
|
+
}
|
|
230
|
+
for(const event of [{type:'thread.started',thread_id:thread},{type:'turn.started'},
|
|
231
|
+
{type:'item.completed',item:{type:'agent_message',text:JSON.stringify(value)}},{type:'turn.completed'}])
|
|
232
|
+
process.stdout.write(JSON.stringify(event)+'\\n');
|
|
233
|
+
});
|
|
234
|
+
`,{mode:0o700});
|
|
235
|
+
const result=f.drive(f.plan({permissions:['--review-config','review.json','--protected-config','protected.json']}));
|
|
236
|
+
assert.equal(result.status,0,result.stderr);assert.equal(JSON.parse(result.stdout).result.state,'fixture_completed',result.stdout);
|
|
237
|
+
const dispatched=fs.readFileSync(witness,'utf8').trim().split('\n').map(JSON.parse),reviews=dispatched.filter(row=>row.type==='review');
|
|
238
|
+
assert.deepEqual(dispatched.filter(row=>row.type==='develop').map(row=>row.attempt),[1,2]);
|
|
239
|
+
assert.deepEqual(reviews.map(row=>[row.attempt,row.verdict]),[[1,'changes_requested'],[2,'approved']]);
|
|
240
|
+
assert.equal(new Set(reviews.map(row=>row.thread)).size,2);assert.notEqual(reviews[0].packageDigest,reviews[1].packageDigest);
|
|
241
|
+
assert.ok(dispatched.filter(row=>row.type==='check').length>=3,'both rounds and completion run the real syntax command');
|
|
242
|
+
assert.equal(fs.readFileSync(path.join(f.codeProject,'target.mjs'),'utf8'),'export const value = 43;\n');
|
|
243
|
+
assert.match(fs.readFileSync(path.join(f.specsDir,'1.work/tasks.md'),'utf8'),/\[x\] T-001/);
|
|
244
|
+
const state=JSON.parse(fs.readFileSync(path.join(f.specsDir,'.reviews','.execution',identity.runId,'state.json')));
|
|
245
|
+
const registrations=state.records.filter(row=>row.payload.type==='review-invocation-registered');
|
|
246
|
+
assert.deepEqual(registrations.map(row=>row.payload.binding.identity.attempt),[1,2]);
|
|
247
|
+
assert.equal(new Set(registrations.map(row=>row.payload.binding.invocationId)).size,2);
|
|
248
|
+
for(const row of registrations){assert.equal(Object.hasOwn(row.payload,'grant'),false);assert.equal(Object.hasOwn(row.payload,'authorizationAt'),false);}
|
|
249
|
+
assert.equal(state.records[0].payload.config.controlPolicy.development,'provider','v2 is bound in the actual durable run');
|
|
250
|
+
});
|
|
251
|
+
test('v2 disabled QA still assesses mandatory feature completion and cannot report run_done or passed',t=>{
|
|
252
|
+
const f=fixture(t,true);f.review('approved');
|
|
253
|
+
let r=f.drive(f.plan());assert.equal(r.status,0,r.stderr);
|
|
254
|
+
let result=JSON.parse(r.stdout).result,combined=r.stderr;
|
|
255
|
+
for(let n=0;n<3&&result.code!=='qa_triggered';n++){
|
|
256
|
+
r=f.drive(f.plan({mode:'resume',originalHostContext:'v2-fixture-host'}));assert.equal(r.status,0,r.stderr);
|
|
257
|
+
result=JSON.parse(r.stdout).result;combined+=r.stderr;
|
|
258
|
+
}
|
|
259
|
+
assert.match(combined,/应答 qa_assess/);
|
|
260
|
+
assert.equal(result.code,'qa_triggered',JSON.stringify(result));assert.equal(result.pendingAction,'qa_execution');
|
|
261
|
+
assert.notEqual(result.state,'run_done');
|
|
262
|
+
const rows=fs.readFileSync(path.join(f.specsDir,'运行日志.jsonl'),'utf8').trim().split('\n').map(JSON.parse);
|
|
263
|
+
assert.ok(rows.some(row=>row.event==='qa'&&row.status==='triggered'&&row.reason==='feature_complete'));
|
|
264
|
+
assert.equal(rows.some(row=>row.node==='N6'&&row.event==='test_run'&&row.phase==='complete'&&row.result==='PASS'),false);
|
|
265
|
+
});
|
|
266
|
+
test('batch refuses unavailable QA Fix mode before starting the host',t=>{
|
|
267
|
+
const f=fixture(t,true);fs.writeFileSync(path.join(f.root,'control.json'),JSON.stringify({...policy,qa:'run',qaFix:'auto'}));
|
|
268
|
+
const r=f.drive(f.plan());assert.equal(r.status,2,r.stderr);assert.match(r.stderr,/invalid_arguments/);
|
|
269
|
+
assert.equal(fs.existsSync(path.join(f.specsDir,'.reviews/.execution')),false);
|
|
270
|
+
});
|