@aibyzero/cm-workflow 0.21.6 → 0.25.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 +58 -0
- package/README.md +18 -3
- package/VERSION +1 -1
- package/docs/architecture.md +9 -0
- package/docs/cm-acceptance-completion.md +3 -1
- package/docs/cm-control-policy-v2.md +35 -3
- package/docs/execution-optimizations.md +1 -1
- package/docs/external-models.md +1 -0
- package/docs/human-correction.md +1 -1
- package/docs/installation.md +42 -16
- package/docs/js-workflow-control.md +65 -30
- package/docs/next-steps.md +10 -0
- package/docs/runtime-failover.md +5 -3
- package/docs/user-guide.md +6 -6
- package/package.json +1 -1
- package/runtime/js/cm-ai/batch-location.mjs +14 -0
- package/runtime/js/cm-ai/batch-plan.mjs +6 -2
- package/runtime/js/cm-ai/checkpoint-package-material.mjs +9 -2
- package/runtime/js/cm-ai/cm-ai-admission.mjs +9 -3
- package/runtime/js/cm-ai/cm-ai-conversation-entry.mjs +51 -8
- package/runtime/js/cm-ai/cm-ai-qa-log.mjs +30 -4
- package/runtime/js/cm-ai/codex-review-adapter.mjs +2 -4
- package/runtime/js/cm-ai/delivery-evidence.mjs +3 -1
- package/runtime/js/cm-ai/developer-adapter.mjs +15 -1
- package/runtime/js/cm-ai/drive-core.mjs +50 -6
- package/runtime/js/cm-ai/drive-next-step.mjs +61 -0
- package/runtime/js/cm-ai/durable-runner-state.mjs +85 -23
- package/runtime/js/cm-ai/execution-snapshot.mjs +5 -2
- package/runtime/js/cm-ai/execution-store.mjs +21 -3
- package/runtime/js/cm-ai/external-run-guard.mjs +9 -1
- package/runtime/js/cm-ai/host-check.mjs +4 -2
- package/runtime/js/cm-ai/host-conversation-execution.mjs +23 -2
- package/runtime/js/cm-ai/host-handoff.mjs +7 -0
- package/runtime/js/cm-ai/host-progress.mjs +18 -0
- package/runtime/js/cm-ai/host-qa-executor.mjs +47 -15
- package/runtime/js/cm-ai/host-qa-fix-owner.mjs +11 -2
- package/runtime/js/cm-ai/host-qa-policy.mjs +24 -14
- package/runtime/js/cm-ai/host-session.mjs +1 -1
- package/runtime/js/cm-ai/host-workflow-capabilities.mjs +1 -1
- package/runtime/js/cm-ai/host.mjs +1 -1
- package/runtime/js/cm-ai/operator-guidance.mjs +126 -2
- package/runtime/js/cm-ai/project-qa-gate.mjs +13 -2
- package/runtime/js/cm-ai/provider-review-observation.mjs +7 -3
- package/runtime/js/cm-ai/qa-plan-notes.mjs +106 -0
- package/runtime/js/cm-ai/review-continuation.mjs +102 -0
- package/runtime/js/cm-ai/review-evidence-file.mjs +11 -0
- package/runtime/js/cm-ai/review-package.mjs +25 -4
- package/runtime/js/cm-ai/review-presentation.mjs +31 -14
- package/runtime/js/cm-ai/review-runner.mjs +5 -4
- package/runtime/js/cm-ai/review-verdict-rules.mjs +7 -0
- package/runtime/js/cm-ai/reviewed-evidence-supersede.mjs +30 -1
- package/runtime/js/cm-ai/task-commit-codec.mjs +11 -1
- package/runtime/js/cm-ai/task-commit.mjs +7 -4
- package/runtime/js/cm-ai/task-owner.mjs +5 -2
- package/runtime/js/cm-ai/task-runner.mjs +343 -52
- package/runtime/js/cm-ai/tool-preview.mjs +6 -0
- package/runtime/js/cm-fix/diagnosis.mjs +16 -3
- package/runtime/js/cm-fix/execution.mjs +47 -9
- package/runtime/js/cm-fix/finish.mjs +9 -1
- package/runtime/js/cm-fix/step-timing.mjs +222 -0
- package/runtime/js/cm-idea/session.mjs +22 -3
- package/runtime/js/cm-init/review-evidence.mjs +20 -7
- package/runtime/js/cm-prd/ai-draft.mjs +260 -0
- package/runtime/js/cm-prd/analysis.mjs +27 -9
- package/runtime/js/cm-prd/change.mjs +29 -8
- package/runtime/js/cm-prd/failed-correction.mjs +24 -4
- package/runtime/js/cm-prd/narrow-review.mjs +63 -3
- package/runtime/js/cm-prd/review-correction.mjs +65 -5
- package/runtime/js/cm-prd/review-disposition.mjs +10 -1
- package/runtime/js/cm-prd/self-check.mjs +121 -9
- package/runtime/js/cm-prd/session.mjs +55 -13
- package/runtime/js/cm-prd/summary.mjs +34 -6
- package/runtime/js/cm-prd/task-scope-record.mjs +40 -15
- package/runtime/js/cm-refactor/records.mjs +82 -11
- package/runtime/js/cm-refactor/workflow.mjs +3 -1
- package/runtime/js/executor-version.mjs +81 -0
- package/runtime/js/python-log-writer.mjs +15 -0
- package/runtime/js/run-analysis.mjs +136 -11
- package/runtime/logging.md +6 -0
- package/runtime/review.md +3 -1
- package/runtime/workflow-config.md +1 -1
- package/scripts/ci-test-weights.json +1 -0
- package/scripts/cm-ai-admission.mjs +27 -1
- package/scripts/cm-ai-admission.test.mjs +34 -2
- package/scripts/cm-ai-answer-gap-recheck.test.mjs +3 -2
- package/scripts/cm-ai-batch-drive.mjs +54 -17
- package/scripts/cm-ai-batch-drive.test.mjs +123 -6
- package/scripts/cm-ai-batch-host.mjs +55 -9
- package/scripts/cm-ai-batch-host.test.mjs +22 -3
- package/scripts/cm-ai-batch-location.test.mjs +22 -1
- package/scripts/cm-ai-batch-merge.mjs +102 -0
- package/scripts/cm-ai-batch-plan.mjs +55 -2
- package/scripts/cm-ai-batch-plan.test.mjs +228 -6
- package/scripts/cm-ai-batch-run-fixture.mjs +239 -15
- package/scripts/cm-ai-batch-run-parallel.test.mjs +23 -1
- package/scripts/cm-ai-batch-run.mjs +435 -33
- package/scripts/cm-ai-batch-session-member.test.mjs +85 -0
- package/scripts/cm-ai-check-recheck-cancellation.test.mjs +23 -2
- package/scripts/cm-ai-checkpoint-package-material.test.mjs +28 -0
- package/scripts/cm-ai-completion-summary.test.mjs +2 -1
- package/scripts/cm-ai-control-v2-drive.test.mjs +39 -9
- package/scripts/cm-ai-direct-review.test.mjs +1 -1
- package/scripts/cm-ai-disk-edits.test.mjs +229 -0
- package/scripts/cm-ai-drive-next-step.test.mjs +191 -0
- package/scripts/cm-ai-drive.mjs +66 -14
- package/scripts/cm-ai-drive.test.mjs +13 -3
- package/scripts/cm-ai-host-cli-workflow.test.mjs +4 -2
- package/scripts/cm-ai-host.mjs +16 -8
- package/scripts/cm-ai-host.test.mjs +12 -0
- package/scripts/cm-ai-operator-guidance.test.mjs +132 -1
- package/scripts/cm-ai-project-qa-gate.test.mjs +26 -0
- package/scripts/cm-ai-qa-fix-cross-session.test.mjs +18 -0
- package/scripts/cm-ai-review-continuation.test.mjs +335 -0
- package/scripts/cm-ai-review-failure.test.mjs +13 -10
- package/scripts/cm-ai-review-timeout.test.mjs +1 -1
- package/scripts/cm-ai-run.mjs +42 -11
- package/scripts/cm-ai-run.test.mjs +26 -0
- package/scripts/cm-ai-supersede.test.mjs +10 -2
- package/scripts/cm-capability-gate.test.mjs +1 -1
- package/scripts/cm-check-runtime.sh +9 -0
- package/scripts/cm-codex-clean-env.test.mjs +40 -0
- package/scripts/cm-codex-prompt-input.test.mjs +2 -1
- package/scripts/cm-developer-self-review.test.mjs +27 -0
- package/scripts/cm-efficiency-presentation-delta.test.mjs +4 -3
- package/scripts/cm-efficiency-response.test.mjs +2 -1
- package/scripts/cm-executor-version-draft.test.mjs +251 -0
- package/scripts/cm-executor-version-entries.test.mjs +93 -0
- package/scripts/cm-executor-version-prd.test.mjs +154 -0
- package/scripts/cm-executor-version-records.test.mjs +256 -0
- package/scripts/cm-executor-version.test.mjs +250 -0
- package/scripts/cm-external-model-host.test.mjs +6 -1
- package/scripts/cm-external-review-reconciliation.test.mjs +1 -1
- package/scripts/cm-fix-closeout-preflight.test.mjs +123 -0
- package/scripts/cm-fix-diagnosis-module-correction.test.mjs +5 -1
- package/scripts/cm-fix-drive.mjs +7 -2
- package/scripts/cm-fix-drive.test.mjs +45 -0
- package/scripts/cm-fix-entry.mjs +5 -2
- package/scripts/cm-fix-frozen-baseline.test.mjs +50 -0
- package/scripts/cm-fix-host.mjs +9 -2
- package/scripts/cm-fix-test-extension.test.mjs +30 -2
- package/scripts/cm-host-check.test.mjs +12 -0
- package/scripts/cm-host-qa-executor.test.mjs +172 -1
- package/scripts/cm-host-qa-policy.test.mjs +55 -1
- package/scripts/cm-idea-drive.mjs +5 -2
- package/scripts/cm-idea-entry.mjs +5 -2
- package/scripts/cm-idea-host.mjs +3 -1
- package/scripts/cm-init-drive.mjs +8 -5
- package/scripts/cm-init-entry.mjs +5 -2
- package/scripts/cm-init-host.mjs +6 -2
- package/scripts/cm-log-event.mjs +10 -2
- package/scripts/cm-log-event.test.mjs +29 -0
- package/scripts/cm-prd-ai-draft-fixture.mjs +18 -0
- package/scripts/cm-prd-ai-draft.test.mjs +505 -0
- package/scripts/cm-prd-answer-gaps.test.mjs +110 -5
- package/scripts/cm-prd-completion.test.mjs +67 -4
- package/scripts/cm-prd-design-phase.test.mjs +48 -13
- package/scripts/cm-prd-drive.mjs +89 -20
- package/scripts/cm-prd-drive.test.mjs +109 -4
- package/scripts/cm-prd-entry.mjs +5 -2
- package/scripts/cm-prd-host.mjs +89 -20
- package/scripts/cm-prd-host.test.mjs +17 -8
- package/scripts/cm-prd-narrow-review.test.mjs +49 -1
- package/scripts/cm-prd-review-disposition.test.mjs +94 -1
- package/scripts/cm-prd-review-gate.mjs +11 -4
- package/scripts/cm-prd-self-check-rules.test.mjs +175 -10
- package/scripts/cm-prd-self-check.test.mjs +1 -1
- package/scripts/cm-refactor-drive.mjs +10 -4
- package/scripts/cm-refactor-entry.mjs +5 -2
- package/scripts/cm-refactor-host.mjs +3 -1
- package/scripts/cm-run-analysis.test.mjs +373 -1
- package/scripts/cm-runtime-i18n.mjs +3 -3
- package/scripts/cm-runtime-install.mjs +19 -10
- package/scripts/cm-runtime.mjs +2 -4
- package/scripts/cm-runtime.test.mjs +55 -13
- package/scripts/cm-skill-hints-autowire.test.mjs +1 -1
- package/scripts/cm-skill-hints-exam.mjs +3 -1
- package/scripts/cm-skill-hints-install.test.mjs +1 -1
- package/scripts/cm-skill-hints.mjs +106 -10
- package/scripts/cm-skill-hints.test.mjs +162 -6
- package/scripts/cm-skill-judge.mjs +2 -1
- package/scripts/cm-statusline.test.mjs +54 -0
- package/scripts/cm-task-gate.mjs +88 -18
- package/scripts/cm-task-scope.test.mjs +1 -1
- package/scripts/cm-test-drive.mjs +13 -8
- package/scripts/cm-test-entry.mjs +5 -2
- package/scripts/cm-test-host.mjs +3 -1
- package/scripts/cm-upgrade-compat-batch.test.mjs +62 -9
- package/scripts/fixtures/fresh-completion-checks.mjs +8 -0
- package/scripts/fixtures/prd-review-gate-python-oracle.py +9 -0
- package/scripts/policy-binding-compat.test.mjs +3 -2
- package/scripts/test-cm-prd-review-gate.py +25 -0
- package/skills/cm-ai/SKILL.md +1 -1
- package/skills/cm-ai/references/N1-init.md +4 -3
- package/skills/cm-ai/references/N4-review.md +6 -3
- package/skills/cm-ai/references/N6-qa-eval.md +3 -1
- package/skills/cm-ai/references/js-host-recovery.md +4 -1
- package/skills/cm-ai/references/js-host.md +25 -5
- package/skills/cm-fix/references/js-host.md +20 -0
- package/skills/cm-fix/references/test-extension.md +1 -1
- package/skills/cm-prd/SKILL.md +8 -6
- package/skills/cm-prd/references/ai-draft.md +81 -0
- package/skills/cm-prd/references/change-mode.md +2 -0
- package/skills/cm-prd/references/greenfield.md +2 -0
- package/skills/cm-prd/references/js-change-recovery.md +2 -2
- package/skills/cm-prd/references/js-host.md +9 -6
- package/skills/cm-prd/references/light-mode.md +19 -0
- package/skills/cm-prd/references/requirement-grilling.md +2 -0
- package/skills/cm-prd/references/spec-self-check.md +1 -0
- package/skills/cm-prd/references/summary-card.md +1 -0
- package/skills/cm-runtime/SKILL.md +6 -6
- package/templates/statusline/cm-statusline.sh +63 -1
|
@@ -11,11 +11,12 @@ import {inspectCmAiAdmission,inspectCmAiQaTaskContext,identifyApprovedBootstrapF
|
|
|
11
11
|
import {createHostCheck,reportHostCheckProgress} from './host-check.mjs';
|
|
12
12
|
import {specsPermissionArgs} from './codex-config.mjs';
|
|
13
13
|
import {resolveCodeProjects,codeProjectPaths} from './code-projects.mjs';
|
|
14
|
-
import {findCmAiQaDecision,readCmAiQaRunRound,reportFile} from './cm-ai-qa-log.mjs';
|
|
14
|
+
import {findCmAiQaDecision,readCmAiQaRunRound,reportFile,QA_REPORT_NOTE_SECTIONS} from './cm-ai-qa-log.mjs';
|
|
15
15
|
import {captureReviewBaseline} from './review-package.mjs';
|
|
16
16
|
import {writeCmAiQaStatus} from './cm-ai-run-finalizer.mjs';
|
|
17
17
|
import {digest,freeze,hex,id,json,need,shape,text,validCallTimeout,validIdentity} from './effect-contract.mjs';
|
|
18
18
|
import {isQaEnvironmentCarrier,QA_ENVIRONMENT_SCOPES} from './qa-environment.mjs';
|
|
19
|
+
import {acceptanceCoverage,qaBlockedNeeds,composeQaReport} from './qa-plan-notes.mjs';
|
|
19
20
|
export const QA_DEVICE_UNVERIFIED_REASON='qa_device_unverified: 浏览器用例的宿主请求超时没有拿到应答,会话可能仍在操作设备(浏览器、模拟器或真机),'
|
|
20
21
|
+'宿主无法核实设备已释放,本次 QA 停在这里,不再派发后面的浏览器用例。先确认该会话已停止、设备已空闲,'
|
|
21
22
|
+'再用 --rerun-unknown-qa 重跑本轮(因宿主原因替代的轮次不占三轮预算)。';
|
|
@@ -39,7 +40,7 @@ const writer=fileURLToPath(new URL('../../../scripts/cm-log-event.py',import.met
|
|
|
39
40
|
const order={ 'cm-default':['logic','commands','browser'],
|
|
40
41
|
'java-backend':['commands','logic','browser'],'web-frontend':['commands','browser','logic'] };
|
|
41
42
|
|
|
42
|
-
function readPlan(configuration,selectCompleted=true) {
|
|
43
|
+
function readPlan(configuration,selectCompleted=true,periodic=false,onCoverage=null) {
|
|
43
44
|
const {codeProject,specsDir,feature,commands}=configuration;
|
|
44
45
|
const admission=inspectCmAiAdmission({specsDir,codeProject});
|
|
45
46
|
need(['ready','complete'].includes(admission.state),admission.reason??'qa_admission_required');
|
|
@@ -68,13 +69,19 @@ function readPlan(configuration,selectCompleted=true) {
|
|
|
68
69
|
const deferred=context.pending===0?[]:applicable.map(item=>({id:item.id,
|
|
69
70
|
taskIds:item.taskIds.filter(taskId=>!completed.has(taskId))})).filter(item=>item.taskIds.length>0);
|
|
70
71
|
const deferredIds=new Set(deferred.map(item=>item.id));
|
|
71
|
-
const
|
|
72
|
-
|
|
72
|
+
const ready=applicable.filter(item=>!deferredIds.has(item.id));
|
|
73
|
+
// A periodic QA (feature-v1, five_tasks_without_qa alone) defers browser cases to
|
|
74
|
+
// the feature-completion QA, unless that would leave it nothing to execute.
|
|
75
|
+
const periodicDeferred=periodic&&context.pending>0?ready.filter(item=>item.kind==='browser').map(item=>({id:item.id})):[];
|
|
76
|
+
let selected=ready.filter(item=>!periodicDeferred.some(other=>other.id===item.id));
|
|
73
77
|
// A command declared only for such cases is not run for them either.
|
|
74
78
|
const droppedCommands=commands.filter(item=>item.caseIds.length>0&&item.caseIds.every(caseId=>droppedIds.has(caseId)))
|
|
75
79
|
.map(item=>({id:item.id,caseIds:item.caseIds}));
|
|
76
|
-
const
|
|
77
|
-
|
|
80
|
+
const schedule=()=>{const wanted=new Set(selected.filter(item=>item.kind==='logic').map(item=>item.id));
|
|
81
|
+
return commands.filter(item=>!droppedCommands.some(other=>other.id===item.id)&&((config.policies.tests.includes('commands')
|
|
82
|
+
&&(context.pending===0||item.caseIds.length===0))||item.caseIds.some(caseId=>wanted.has(caseId))));};
|
|
83
|
+
let scheduled=schedule();
|
|
84
|
+
if(periodicDeferred.length&&selected.length===0&&scheduled.length===0){periodicDeferred.length=0;selected=ready;scheduled=schedule();}
|
|
78
85
|
for(const item of commands)for(const caseId of item.caseIds)
|
|
79
86
|
need(cases.some(candidate=>candidate.id===caseId&&candidate.kind==='logic'),'qa_command_mapping_invalid');
|
|
80
87
|
const modes=order[config.project.workflow].filter(mode=>mode==='commands'
|
|
@@ -82,8 +89,13 @@ function readPlan(configuration,selectCompleted=true) {
|
|
|
82
89
|
:selected.some(item=>item.kind===mode));
|
|
83
90
|
const noApplicableCases=context.pending>0&&selected.length===0&&scheduled.length===0;
|
|
84
91
|
if(noApplicableCases)modes.splice(0,modes.length,'commands');
|
|
92
|
+
// {coverage:true} (feature-v1 runs): each acceptance criterion and the cases bound to it,
|
|
93
|
+
// handed to the report only. The plan itself never carries it, so it costs no limit.
|
|
94
|
+
if(onCoverage&&selectCompleted)onCoverage(acceptanceCoverage({featureRoot,cases,
|
|
95
|
+
selectedIds:new Set(selected.map(item=>item.id)),applicableIds:new Set(applicable.map(item=>item.id)),droppedIds}));
|
|
85
96
|
return json({config,cases:selected,...(selectCompleted?{deferred_cases:deferred}:{}),commands:scheduled,modes,
|
|
86
97
|
...(noApplicableCases?{no_applicable_cases:true}:{}),...(droppedCases.length?{dropped_task_cases:droppedCases}:{}),
|
|
98
|
+
...(periodicDeferred.length?{periodic_deferred_cases:periodicDeferred}:{}),
|
|
87
99
|
...(droppedCommands.length?{dropped_task_commands:droppedCommands}:{})});
|
|
88
100
|
}
|
|
89
101
|
|
|
@@ -159,16 +171,28 @@ const notApplicable=plan=>[
|
|
|
159
171
|
...(plan.dropped_task_commands??[]).map(item=>({...item,kind:'commands',verdict:'NOT_APPLICABLE',
|
|
160
172
|
reason:`declared only for cases bound only to dropped tasks: ${item.caseIds.join(', ')}`}))];
|
|
161
173
|
|
|
162
|
-
|
|
174
|
+
const coverageLine=list=>{const ids=status=>list.filter(item=>item.status===status).map(item=>item.id);
|
|
175
|
+
return `Acceptance coverage at QA start: planned ${ids('planned').join(', ')||'none'}; later ${ids('later').join(', ')||'none'}; `
|
|
176
|
+
+`not selected ${ids('not_selected').join(', ')||'none'}; dropped ${ids('dropped').join(', ')||'none'}; `
|
|
177
|
+
+`no test case ${ids('no_case').join(', ')||'none'}\n\n`;};
|
|
178
|
+
function saveReport(configuration,binding,rows,summary,plan,notes=null) {
|
|
163
179
|
const reviews=path.join(configuration.specsDir,'.reviews'),stat=fs.lstatSync(reviews);
|
|
164
180
|
need(stat.isDirectory()&&!stat.isSymbolicLink()&&fs.realpathSync(reviews)===reviews,'qa_report_invalid');
|
|
165
181
|
const target=path.join(reviews,`${binding.testRunId}-execution.md`);
|
|
166
|
-
const
|
|
182
|
+
const head=`# CM QA execution report\n\nOverall: ${summary.result}\n\n`
|
|
167
183
|
+'Counts are declared command checks plus selected cases, not framework test totals.\n'
|
|
168
184
|
+'Static verdicts are retained separately; only observed command/browser evidence counts as PASS.\n\n'
|
|
169
|
-
|
|
185
|
+
// Header prose, not a `## ` section: readReportCases parses every section as a row.
|
|
186
|
+
+(plan.periodic_deferred_cases?`Periodic QA (five_tasks_without_qa only); browser cases deferred to feature completion: ${plan.periodic_deferred_cases.map(item=>item.id).join(', ')}\n\n`:'');
|
|
187
|
+
const coverage=notes?.coverage??null,needs=notes?.needs?.length?notes.needs:null;
|
|
188
|
+
const notesHead=(coverage?coverageLine(coverage):'')
|
|
189
|
+
+(needs?`Blocked because:\n${needs.map(item=>`- ${item.detail} (${item.cases.join(', ')})`).join('\n')}\n\n`:'');
|
|
190
|
+
const notesBody=(coverage?`## ${QA_REPORT_NOTE_SECTIONS.coverage}\n\n${JSON.stringify(coverage,null,2)}\n\n`:'')
|
|
191
|
+
+(needs?`## ${QA_REPORT_NOTE_SECTIONS.needs}\n\n${JSON.stringify(needs,null,2)}\n\n`:'');
|
|
192
|
+
const tail=`## deferred_cases\n\n${JSON.stringify(plan.deferred_cases,null,2)}\n\n`
|
|
170
193
|
+(notApplicable(plan).length?`## not_applicable\n\n${JSON.stringify(notApplicable(plan),null,2)}\n\n`:'')
|
|
171
|
-
+rows.map(row=>`## ${row.id}\n\n${JSON.stringify(row,null,2)}\n`).join('\n')
|
|
194
|
+
+rows.map(row=>`## ${row.id}\n\n${JSON.stringify(row,null,2)}\n`).join('\n');
|
|
195
|
+
const body=composeQaReport({head,notes:notesHead+notesBody,tail});
|
|
172
196
|
need(body.length<=1024*1024,'limit_exceeded');
|
|
173
197
|
const fd=fs.openSync(target,fs.constants.O_CREAT|fs.constants.O_EXCL|fs.constants.O_WRONLY|fs.constants.O_NOFOLLOW,0o600);
|
|
174
198
|
try{fs.writeFileSync(fd,body);fs.fsyncSync(fd);}finally{fs.closeSync(fd);}
|
|
@@ -220,8 +244,13 @@ export function createHostQaExecutor(options) {
|
|
|
220
244
|
};
|
|
221
245
|
// Preserve the historical configuration fingerprint across N5 and old-run
|
|
222
246
|
// resume. Selection is invocation data, frozen by prepare at N6 instead.
|
|
223
|
-
const initial=describe(readPlan(configuration,false));let prepared=null;
|
|
224
|
-
|
|
247
|
+
const initial=describe(readPlan(configuration,false));let prepared=null,periodic=false,coverage=false,acceptance=null;
|
|
248
|
+
// {periodic:true}: the entry's feature-v1 periodic QA (see readPlan).
|
|
249
|
+
// {coverage:true}: a feature-v1 run's acceptance coverage and blocked-needs notes.
|
|
250
|
+
const prepare=(choice={})=>{shape(choice,['periodic','coverage'].filter(key=>Object.hasOwn(choice,key)));
|
|
251
|
+
need([choice.periodic,choice.coverage].every(value=>value===undefined||value===true),'qa_plan_invalid');
|
|
252
|
+
periodic=choice.periodic===true;coverage=choice.coverage===true;acceptance=null;
|
|
253
|
+
prepared=describe(readPlan(configuration,true,periodic,coverage?value=>{acceptance=value;}:null));return freeze(prepared);};
|
|
225
254
|
return Object.freeze({...initial,timeoutMs:configuration.timeoutMs,prepare,
|
|
226
255
|
async run(rawBinding,signal){
|
|
227
256
|
const {mode,caseCount,configuration:{plan}}=prepared??prepare();
|
|
@@ -236,7 +265,7 @@ export function createHostQaExecutor(options) {
|
|
|
236
265
|
binding=json({...binding,qaRound});
|
|
237
266
|
need(['specsDir','codeProject','feature'].every(key=>binding[key]===configuration[key])
|
|
238
267
|
&&binding.mode===mode&&binding.caseCount===caseCount,'qa_execution_mismatch');
|
|
239
|
-
const unchanged=()=>need(digest(readPlan(configuration))===digest(plan),'qa_plan_changed');
|
|
268
|
+
const unchanged=()=>need(digest(readPlan(configuration,true,periodic))===digest(plan),'qa_plan_changed');
|
|
240
269
|
const notCancelled=()=>need(!signal.aborted,'cancelled');notCancelled();unchanged();
|
|
241
270
|
const snapshot=()=>captureReviewBaseline({root:configuration.codeProject,specsRoot:configuration.specsDir,
|
|
242
271
|
identity:binding.identity,...(allowSymlinks===true?{version:SYMLINK_BASELINE_VERSION}:{}),scope:configuration.bootstrap?.scope??(configuration.requirements.length?configuration.requirements:['AGENTS.md']),requirements:configuration.requirements,
|
|
@@ -244,7 +273,7 @@ export function createHostQaExecutor(options) {
|
|
|
244
273
|
?{specification:{specsRoot:configuration.specsDir,feature:configuration.feature}}:{}),
|
|
245
274
|
...(configuration.bootstrap?{bootstrapRequirements:configuration.bootstrap.requirements}:{}),
|
|
246
275
|
...(roots?{codeProjectPaths:codeProjectPaths(configuration.codeProject,resolveCodeProjects(configuration.codeProject,roots))}:{})});
|
|
247
|
-
const before=snapshot(),rows=[],commandResults=new Map();
|
|
276
|
+
const before=snapshot(),rows=[],commandResults=new Map(),reasons=new Map();
|
|
248
277
|
const route=role=>{
|
|
249
278
|
notCancelled();unchanged();
|
|
250
279
|
const result=resolveRole(loadConfig({projectRoot:configuration.codeProject}),role,configuration.runtime);
|
|
@@ -388,6 +417,8 @@ export function createHostQaExecutor(options) {
|
|
|
388
417
|
// answer; --rerun-unknown-qa reads it after a whole-call timeout.
|
|
389
418
|
...(verdict==='BLOCKED'?{host_request_timeout:hostRequestTimeout&&!answered}:{})},
|
|
390
419
|
'QA browser case finished');
|
|
420
|
+
// feature-v1: the executor's own reason, for the blocked-needs note only (never on the row).
|
|
421
|
+
if(coverage&&blockedReason)reasons.set(item.id,blockedReason);
|
|
391
422
|
// Q07: an unanswered browser request may leave the session driving the
|
|
392
423
|
// device. Never dispatch the next browser case on top of it: stop this
|
|
393
424
|
// call (no complete row), so the round waits for the operator to confirm
|
|
@@ -430,7 +461,8 @@ export function createHostQaExecutor(options) {
|
|
|
430
461
|
blocked=rows.filter(item=>item.verdict==='BLOCKED').length;
|
|
431
462
|
need(passed+failed+blocked===caseCount,'qa_result_invalid');
|
|
432
463
|
const summary={result:failed>0?'FAIL':blocked>0?'BLOCKED':'PASS',passed,failed,blocked};
|
|
433
|
-
const report=saveReport(configuration,binding,rows,summary,plan
|
|
464
|
+
const report=saveReport(configuration,binding,rows,summary,plan,
|
|
465
|
+
coverage?{coverage:acceptance,needs:qaBlockedNeeds(rows,environment,reasons)}:null);
|
|
434
466
|
return json({...summary,report});
|
|
435
467
|
}});
|
|
436
468
|
}
|
|
@@ -3,11 +3,13 @@ import {readExecutionPolicy} from './execution-policy.mjs';
|
|
|
3
3
|
// Serial child host. Existing owners retain lifecycle and action authority.
|
|
4
4
|
import fs from 'node:fs';
|
|
5
5
|
import path from 'node:path';
|
|
6
|
+
import {checkNewFixCloseoutPlan} from '../cm-fix/finish.mjs';
|
|
6
7
|
import {openFixExecution} from '../cm-fix/execution.mjs';
|
|
7
8
|
import {createFixHost} from '../cm-fix/host.mjs';
|
|
8
9
|
import {bindQaFixDefinition} from './qa-fix-definition.mjs';
|
|
9
10
|
import {digest,id,json,need,shape,validIdentity,hex} from './effect-contract.mjs';
|
|
10
11
|
import {readExecutionSnapshot} from './execution-snapshot.mjs';
|
|
12
|
+
import {EXECUTOR_REASON_CODES} from '../executor-version.mjs';
|
|
11
13
|
import {readFixControlTarget,CONTROL_FIX_RECOVERY_OPERATIONS} from './control-policy.mjs';
|
|
12
14
|
|
|
13
15
|
// Q23: the child's recovery operations, each with the original cm-fix flag the
|
|
@@ -110,8 +112,15 @@ export function createQaFixOwnerHost({parent,reopenParent,hostContextId,parentHo
|
|
|
110
112
|
const existing=fs.existsSync(path.join(definition.specsRoot,'.reviews','.execution',definition.identity.runId));
|
|
111
113
|
// Only a new store needs a creator check. Existing configuration is
|
|
112
114
|
// immutable and checked against its own stored fingerprint by cm-fix.
|
|
113
|
-
if(advancing&&!existing)
|
|
114
|
-
|
|
115
|
+
if(advancing&&!existing){
|
|
116
|
+
need([hostContextId,parentHostContextId].includes(definition.configuration.hostContextId),'qa_fix_host_mismatch');
|
|
117
|
+
checkNewFixCloseoutPlan(definition.configuration,permissions);
|
|
118
|
+
}
|
|
119
|
+
// A release refusal is the child's own answer (with its upgrade or reinstall
|
|
120
|
+
// exit), not an opaque host failure; the parent still reopens below.
|
|
121
|
+
try{child=openFixExecution({...definition,hostContextId,create:advancing&&!existing},advancing||acting?fixExecution:{});}
|
|
122
|
+
catch(error){if(!EXECUTOR_REASON_CODES.has(error?.code))throw error;
|
|
123
|
+
return json({outcome:'blocked',code:error.code,reason:error.reason});}
|
|
115
124
|
activeChild=child;
|
|
116
125
|
const childTarget=()=>readFixControlTarget({runId:definition.identity.runId,stage:child.status().stage,
|
|
117
126
|
revision:readExecutionSnapshot({specsRoot:definition.specsRoot,
|
|
@@ -7,12 +7,19 @@ import {digest,freeze,hex,id,json,need,shape,validIdentity} from './effect-contr
|
|
|
7
7
|
|
|
8
8
|
const key=(feature,task)=>`${feature}/${task}`;
|
|
9
9
|
|
|
10
|
+
export const QA_CADENCES=Object.freeze(['feature-v1']);
|
|
10
11
|
// unseen: completed tasks with no QA row at all; a triggered QA never clears them.
|
|
11
12
|
// since: tasks whose QA was not triggered after the last triggered one.
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
// feature-v1 (new runs): only the binding's feature counts, because N6 executes
|
|
14
|
+
// that feature's test-cases.json alone (wue dogfood: other features' rowless
|
|
15
|
+
// history kept the count at five forever). Its rowless tasks stay counted as
|
|
16
|
+
// before: when one was finished outside N6, relative to a QA, is unknown.
|
|
17
|
+
function unassessedParts(binding,context,cadence=null) {
|
|
18
|
+
const scoped=cadence==='feature-v1';
|
|
19
|
+
const counted=task=>!scoped||task.feature===binding.feature;
|
|
20
|
+
const completed=new Set(context.completed.filter(counted).map(task=>key(task.feature,task.id)));
|
|
14
21
|
const pendingFeatures=new Set(context.pendingFeatures);
|
|
15
|
-
const unseen=new Set(context.completed.filter(task=>pendingFeatures.has(task.feature))
|
|
22
|
+
const unseen=new Set(context.completed.filter(task=>pendingFeatures.has(task.feature)&&counted(task))
|
|
16
23
|
.map(task=>key(task.feature,task.id))),since=new Set();
|
|
17
24
|
const log=path.join(binding.specsDir,'运行日志.jsonl');
|
|
18
25
|
if(fs.existsSync(log))scanRows(log,row=>{
|
|
@@ -26,22 +33,24 @@ function unassessedParts(binding,context) {
|
|
|
26
33
|
});
|
|
27
34
|
return {unseen,since};
|
|
28
35
|
}
|
|
29
|
-
function unassessed(binding,context) {
|
|
30
|
-
const {unseen,since}=unassessedParts(binding,context);
|
|
36
|
+
function unassessed(binding,context,cadence) {
|
|
37
|
+
const {unseen,since}=unassessedParts(binding,context,cadence);
|
|
31
38
|
return new Set([...unseen,...since]);
|
|
32
39
|
}
|
|
33
|
-
function history(binding,context) {
|
|
40
|
+
function history(binding,context,cadence=null) {
|
|
34
41
|
// Missing historical QA rows are unknown coverage, never evidence of a reset.
|
|
35
42
|
// This callback only proposes a fresh decision. An older run/package for the
|
|
36
43
|
// same task cannot cover the current work; exact recovery happens in entry.
|
|
37
|
-
return new Set([...unassessed(binding,context),key(binding.feature,binding.identity.taskId)]).size;
|
|
44
|
+
return new Set([...unassessed(binding,context,cadence),key(binding.feature,binding.identity.taskId)]).size;
|
|
38
45
|
}
|
|
39
46
|
// Completed tasks counted toward five_tasks_without_qa right now (count), by the same
|
|
40
47
|
// log reading the decision uses, and how many of them a triggered QA leaves counted
|
|
41
|
-
// (floor). batch-plan.mjs predicts one-member groups from both
|
|
42
|
-
|
|
48
|
+
// (floor). batch-plan.mjs predicts one-member groups from both, by the cadence the
|
|
49
|
+
// batch's new member runs freeze.
|
|
50
|
+
export function qaUnassessedTaskCounts({specsDir,codeProject,feature,repositoryId,cadence=null}){
|
|
51
|
+
need(cadence===null||QA_CADENCES.includes(cadence),'qa_policy_unavailable');
|
|
43
52
|
const context=inspectCmAiQaTaskContext({specsDir,codeProject,feature});
|
|
44
|
-
const {unseen,since}=unassessedParts({specsDir,feature,identity:{repositoryId}},context);
|
|
53
|
+
const {unseen,since}=unassessedParts({specsDir,feature,identity:{repositoryId}},context,cadence);
|
|
45
54
|
return {count:new Set([...unseen,...since]).size,floor:unseen.size};
|
|
46
55
|
}
|
|
47
56
|
|
|
@@ -111,16 +120,17 @@ export function createHostQaDecisionProvider({assess,timeoutMs,criticalPaths={}}
|
|
|
111
120
|
return Object.freeze({timeoutMs,async decide(raw,signal){
|
|
112
121
|
const input=json(raw);
|
|
113
122
|
shape(input,['specsDir','codeProject','feature','identity','packageDigest',...(Object.hasOwn(input,'previousDecisionId')?['previousDecisionId']:[]),
|
|
114
|
-
...(Object.hasOwn(input,'changedFiles')?['changedFiles']:[])]);
|
|
123
|
+
...(Object.hasOwn(input,'changedFiles')?['changedFiles']:[]),...(Object.hasOwn(input,'qaCadence')?['qaCadence']:[])]);
|
|
115
124
|
// previousDecisionId names an older recorded decision that an explicit
|
|
116
125
|
// recovery supersedes; it only derives a distinct id, never the assessment.
|
|
117
|
-
const {previousDecisionId=null,changedFiles:rawFiles={paths:[],source:'unavailable'},...binding}=input;
|
|
126
|
+
const {previousDecisionId=null,changedFiles:rawFiles={paths:[],source:'unavailable'},qaCadence=null,...binding}=input;
|
|
127
|
+
need(qaCadence===null||QA_CADENCES.includes(qaCadence),'qa_policy_unavailable');
|
|
118
128
|
const changedFiles=readQaChangedFiles(rawFiles);
|
|
119
129
|
need(changedFiles.source!=='unavailable'||!Object.values(registry).some(patterns=>patterns.length),'qa_policy_unavailable');
|
|
120
130
|
if(previousDecisionId!==null)id(previousDecisionId);
|
|
121
131
|
validIdentity(binding.identity);hex(binding.packageDigest);
|
|
122
132
|
const context=inspectCmAiQaTaskContext({...binding,taskId:binding.identity.taskId});
|
|
123
|
-
const unassessedTasks=history(binding,context);
|
|
133
|
+
const unassessedTasks=history(binding,context,qaCadence);
|
|
124
134
|
need(!signal.aborted,'cancelled');
|
|
125
135
|
try{readQaAssessment(await assess(freeze({...binding,pending:context.pending,mergeEligible:context.mergeEligible,
|
|
126
136
|
unassessedTasks,changedFiles,criticalPaths:registry}),signal));}
|
|
@@ -134,7 +144,7 @@ export function createHostQaDecisionProvider({assess,timeoutMs,criticalPaths={}}
|
|
|
134
144
|
// Assessment is read-only. A task/log change while it was pending requires
|
|
135
145
|
// another decision; do not bind an answer to different policy inputs.
|
|
136
146
|
const current=inspectCmAiQaTaskContext({...binding,taskId:binding.identity.taskId});
|
|
137
|
-
need(digest(current)===digest(context)&&history(binding,current)===unassessedTasks,'stale_qa');
|
|
147
|
+
need(digest(current)===digest(context)&&history(binding,current,qaCadence)===unassessedTasks,'stale_qa');
|
|
138
148
|
const result=decideHostQaPolicy({changedFiles:changedFiles.paths,criticalPaths:registry,pending:context.pending,mergeEligible:context.mergeEligible,unassessedTasks});
|
|
139
149
|
const bound={identity:binding.identity,packageDigest:binding.packageDigest,...(previousDecisionId===null?{}:{previousDecisionId})};
|
|
140
150
|
return freeze({...result,decisionId:`qa-${digest(bound).slice(0,48)}`,
|
|
@@ -17,7 +17,7 @@ export function parseHostInputLimit(raw){
|
|
|
17
17
|
return value;
|
|
18
18
|
}
|
|
19
19
|
const operationNames=new Set(['prepare_diagnosis_module_correction','revision_test_check','prepare_test_type_correction','prepare_command_correction','prepare_verification_recovery','repair_review_response','reconcile_review','retry_review','rediagnose','replace_inputs','read_batch','recover_final_review','abandon_step','abandon_review','rerun_blocked_step','abandon_effect','bootstrap_review_recover','completion_rework','development_rework','revise_scope','develop_redo','advance','start','plan_design','promote_design','select_design_reviews','status','fix_status','fix_advance','fix_action','fix_run','decision','complete','qa','qa_result','prepare_revision','prepare_save',
|
|
20
|
-
'context_refresh','finish','completion_evidence','run_finalize','review_findings','review_disposition','save_draft','save_design','correct_findings','prepare_summary','publish_summary','inspect_correction','resume_correction','narrow_review','narrow_status','cancel','resume','prepare_judge_revision','cause_review_package','cause_review','red_test','baseline','author_tests','repair','regression','retrospective','learning_writeback','handoff','final_review_package','final_review','publish_review','check_n5','post_review_regression','publish_dossier','walkthrough']);
|
|
20
|
+
'context_refresh','finish','completion_evidence','run_finalize','review_findings','review_disposition','save_draft','save_design','correct_findings','prepare_summary','publish_summary','inspect_correction','resume_correction','narrow_review','narrow_status','narrow_user_decision','cancel','resume','prepare_judge_revision','cause_review_package','cause_review','red_test','baseline','author_tests','repair','regression','retrospective','learning_writeback','handoff','final_review_package','final_review','publish_review','check_n5','post_review_regression','publish_dossier','walkthrough']);
|
|
21
21
|
|
|
22
22
|
// Which contract codes may reach the peer is a deliberate boundary: the host
|
|
23
23
|
// exposes chosen ones as a blocked result with a reason and redacts the rest to
|
|
@@ -114,7 +114,7 @@ export function createHostWorkflowCapabilities({definition,configuration,bridge,
|
|
|
114
114
|
export function createParallelMemberQaDecisionProvider(){
|
|
115
115
|
return Object.freeze({timeoutMs:60000,async decide(raw,signal){
|
|
116
116
|
const binding=json(raw);shape(binding,['specsDir','codeProject','feature','identity','packageDigest',
|
|
117
|
-
...(Object.hasOwn(binding,'changedFiles')?['changedFiles']:[])]);
|
|
117
|
+
...(Object.hasOwn(binding,'changedFiles')?['changedFiles']:[]),...(Object.hasOwn(binding,'qaCadence')?['qaCadence']:[])]);
|
|
118
118
|
validIdentity(binding.identity);hex(binding.packageDigest);need(!signal.aborted,'cancelled');
|
|
119
119
|
return {decisionId:`qa-${digest({identity:binding.identity,packageDigest:binding.packageDigest}).slice(0,48)}`,
|
|
120
120
|
identity:binding.identity,packageDigest:binding.packageDigest,status:'skipped',
|
|
@@ -15,5 +15,5 @@ export function createCmAiHost(options) {
|
|
|
15
15
|
...(qaExecutor===undefined?{}:{qaExecutor}),
|
|
16
16
|
...(documentationProvider===undefined?{}:{documentationProvider}),
|
|
17
17
|
...(qaDecisionProvider===undefined?{}:{qaDecisionProvider})});
|
|
18
|
-
return Object.freeze({handle:entry.handle,inspectFixAssociation:runner.inspectFixAssociation,acceptCompletedFix:runner.acceptCompletedFix,acceptReviewedIntegration:runner.acceptReviewedIntegration,attachQa:runner.attachQa,reviseQa:runner.reviseQa,supersedeEvidence:runner.supersedeEvidence,rebindSpecification:runner.rebindSpecification,reviseScope:runner.reviseScope,reworkDevelopment:runner.reworkDevelopment});
|
|
18
|
+
return Object.freeze({handle:entry.handle,...(runner.preflightBatchCompletion?{preflightBatchCompletion:runner.preflightBatchCompletion}:{}),inspectFixAssociation:runner.inspectFixAssociation,acceptCompletedFix:runner.acceptCompletedFix,acceptReviewedIntegration:runner.acceptReviewedIntegration,attachQa:runner.attachQa,reviseQa:runner.reviseQa,supersedeEvidence:runner.supersedeEvidence,rebindSpecification:runner.rebindSpecification,reviseScope:runner.reviseScope,reworkDevelopment:runner.reworkDevelopment,authorizeReviewContinuation:runner.authorizeReviewContinuation});
|
|
19
19
|
}
|
|
@@ -8,6 +8,7 @@ const deliveryMessages={
|
|
|
8
8
|
check_output_out_of_scope:['检查产生了任务范围外的改动。','核对并处理检查产物;保留用户改动,不擅自扩大范围'],
|
|
9
9
|
develop_empty_changes:['交付没有产生可审查的实际改动。','核对任务要求并提供实际修改'],
|
|
10
10
|
develop_unchanged_after_review:['交付没有处理上一轮审查要求。','处理原审查 findings 后提供本轮修改'],
|
|
11
|
+
develop_continuation_scope_mismatch:['第三次受控审查的补正改动了第 2 轮已审文件以外的文件,或漏掉了其中的改动。','只在第 2 轮已审的同一批文件内补正(reason 列出多出 + 与缺少 - 的路径)'],
|
|
11
12
|
develop_requirement_missing:['交付后缺少要求保留的文件。','恢复 reason 指出的必要文件'],
|
|
12
13
|
bootstrap_verification_failed:['项目规则验证未通过。','根据规则验证证据修正草稿或检查环境'],
|
|
13
14
|
develop_answer_invalid:['开发应答未通过交付合同校验(如 application.note 过长),代码已保留、尚未进入审查。','按 reason 中的字段上限重新应答'],
|
|
@@ -103,6 +104,7 @@ export function projectOperatorGuidance(result,options={}){
|
|
|
103
104
|
const guidance=operatorGuidance(result,{...context,...options});
|
|
104
105
|
return guidance?{...result,guidance}:result;
|
|
105
106
|
}
|
|
107
|
+
const CONTINUATION_LAUNCH='只读 status,把 launchControlTarget 完整保存到文件,以原策略和配置 --mode resume 加 --expected-control FILE、--review-continuation 与单行 --review-continuation-reason 启动一次,追加授权后去掉这三项再 advance;snapshot_changed 时停止,不自动刷新。';
|
|
106
108
|
const fixedTarget='先只读 status,展示并核对 controlTarget 与恢复动作,按当前对话的具体决定完整固定为 expectedControl;发送 version:2 和单行 reason;snapshot_changed 时停止,不自动刷新目标重试';
|
|
107
109
|
function renderOperatorGuidance(result,{executionActive=false,protocol='legacy',surface='single'}={}){
|
|
108
110
|
const v2=protocol==='v2',batch=surface==='batch';
|
|
@@ -114,7 +116,8 @@ function renderOperatorGuidance(result,{executionActive=false,protocol='legacy',
|
|
|
114
116
|
+'原运行确无合法恢复出口时,用原配置只读 inspect-history 取得 supersedeTarget 并保存,向用户展示旧状态与重开原因;'
|
|
115
117
|
+'用户批准后按 v2 create 重开流程以新 runId 重开同一任务(docs/cm-control-policy-v2.md「卡死任务重开」)。目标与旧运行不符返回 snapshot_changed 时停止,不自动刷新。'
|
|
116
118
|
:'修好后按 reason 用 --supersede-reviewed-evidence 新建运行重做。';
|
|
117
|
-
const supersedePrerequisites=v2?['原运行记录与现有文件保留,不改写','重开须经用户批准且绑定已展示的 supersedeTarget','不改变原运行的协议、身份或恢复预算'
|
|
119
|
+
const supersedePrerequisites=v2?['原运行记录与现有文件保留,不改写','重开须经用户批准且绑定已展示的 supersedeTarget','不改变原运行的协议、身份或恢复预算',
|
|
120
|
+
SUPERSEDE_DRIFT_NOTE]
|
|
118
121
|
:['原运行记录保留,不改写','本运行留在盘上的改动需还原,或加 --accept-superseded-code-drift'];
|
|
119
122
|
if(result?.workflow!=='cm-ai'||!result.state||!result.identity)return null;
|
|
120
123
|
const {state,code,pendingAction:action,outcome}=result;
|
|
@@ -197,6 +200,15 @@ function renderOperatorGuidance(result,{executionActive=false,protocol='legacy',
|
|
|
197
200
|
if(state==='blocked'&&action==='complete')return explain('完成前复核受阻,已有审查结论不能直接当作任务完成。',
|
|
198
201
|
'核对 reason 中的检查或文件变化;满足原完成条件后,在原运行发送 complete,不重新开发。',
|
|
199
202
|
'complete',['原 run 与已审交接、范围和包绑定不变','使用当前 packageDigest;由宿主重新核对完成条件']);
|
|
203
|
+
if(state==='blocked'&&code==='review_limit'){
|
|
204
|
+
const continuation=result.reviewLimitCard?.exits?.find(e=>e.id==='review_continuation')?.available===true;
|
|
205
|
+
return explain('第 2 轮独立审查仍要求修改,本运行两轮审查已用完,任务没有完成。',
|
|
206
|
+
`先读决策卡,对照两轮审查意见、检查实跑结果和改动清单再定出口;本卡不放行,也不增加审查轮次。意见指向规格本身时,先按决策卡 spec_change 改规格再重开。${supersede}`
|
|
207
|
+
+(continuation&&v2&&!batch?`或者经用户批准使用本运行的第三次受控审查(每任务最多一次):${CONTINUATION_LAUNCH}`:''),
|
|
208
|
+
null,supersedePrerequisites);
|
|
209
|
+
}
|
|
210
|
+
if(state==='blocked'&&code==='review_continuation_rejected')return explain('第三次受控审查仍未通过,本任务的续审额度已用完,任务没有完成。',
|
|
211
|
+
`先读决策卡,对照三次审查意见;本运行不再开发或审查。意见指向规格本身时,先按决策卡 spec_change 改规格再重开。${supersede}`,null,supersedePrerequisites);
|
|
200
212
|
if(code==='review_redispatch_limit')return explain('本轮独立审查已无结论重派 2 次,不再重派;这不计为审查轮次。',
|
|
201
213
|
`先查清审查进程为何一直没有结论(登录、额度、网络或审查答复格式);${supersede}`,
|
|
202
214
|
null,supersedePrerequisites);
|
|
@@ -209,6 +221,32 @@ function renderOperatorGuidance(result,{executionActive=false,protocol='legacy',
|
|
|
209
221
|
v2?(batch?'先确认上一轮会话与设备已空闲;批次 v2 没有启动型 QA 重跑出口,保留批次与 QA 证据并核对 reason,不新建运行绕过。':'先确认上一轮的会话、浏览器或模拟器已停止、设备已空闲;只读 status,展示并核对 launchControlTarget 后完整固定到文件。以原策略与配置 --mode resume、--expected-control FILE 和 --rerun-unknown-qa 启动;snapshot_changed 时停止,不自动刷新目标。宿主拒绝时保留原运行与 QA 证据,不改走旧入口。')
|
|
210
222
|
:'先确认上一轮的会话、浏览器或模拟器已停止、设备已空闲;再用原配置 --mode resume 加 --rerun-unknown-qa 重跑本轮。宿主拒绝时按拒绝码处理:含原始 FAIL、未解决的 [需确认] 或无法归因的旧记录的轮次不能替代,改用 --supersede-reviewed-evidence 新建运行。',
|
|
211
223
|
null,['保留原运行与 QA 日志,只追加不改写','因宿主或应答原因替代的轮次不占三轮预算']);
|
|
224
|
+
// 2026-12-01 probe: a feature-end QA that has no executor stopped with no guidance at all.
|
|
225
|
+
if(state==='fixture_completed'&&action==='qa_execution'){
|
|
226
|
+
const summary='任务已完成,必需 QA 已触发(功能最后一个任务、连续五项未 QA 或登记的关键路径),但本运行没有挂 QA 执行器'
|
|
227
|
+
+'(策略 qa:"disabled",或工作流配置没有 qa 段),QA 没有执行;这不是 QA PASS,也不是 run_done。';
|
|
228
|
+
const kept=['任务完成记录与审查证据保留,不重新开发或审查','不把任务完成当作 QA 通过'];
|
|
229
|
+
// Batch members have no QA attach; the only redo is a superseding single-task run, whose
|
|
230
|
+
// gate refuses a task still checked in tasks.md (reviewed-evidence-supersede.mjs).
|
|
231
|
+
// The task's code is still on disk, so the redo also meets the supersede code-drift gate,
|
|
232
|
+
// which compares the whole code tree; kept files become existing code, not reviewed changes.
|
|
233
|
+
const redo='本功能要补做 QA 只能重开该任务(会重新开发与审查)。取消批次前先和用户定好怎么处理代码里的改动:'
|
|
234
|
+
+'重开会把整个代码树和旧任务开工时的基线逐文件比较(不只是该任务改过的文件),有差异就返回 supersede_code_drift 并在 reason 列出路径;'
|
|
235
|
+
+'要么按列出的路径还原,要么重开时加 --accept-superseded-code-drift 保留它们——保留的文件会被当成已有代码,不进新运行的审查改动,新运行须交付新的改动才能生成审查包。'
|
|
236
|
+
+'定好后取消本批次,把该任务在 tasks.md 改回 - [ ](重开门禁要求任务未勾选),';
|
|
237
|
+
if(batch)return explain(summary,'批次入口不能补开 QA,也不能用单任务入口打开批次成员补开。'
|
|
238
|
+
+`以后需要 QA 的功能,规划批次时用 cm-ai-batch-plan --workflow-config 生成带 qa 的配置${v2?',并用 qa:"run" 的策略':',启动时带 --allow-qa'}。`
|
|
239
|
+
+redo+(v2?'再用原配置只读 inspect-history 取得 supersedeTarget 并保存,向用户展示旧状态与重开原因;用户批准后按 v2 create 重开流程(docs/cm-control-policy-v2.md「卡死任务重开」),'
|
|
240
|
+
+'用 qa:"run" 的策略和含 qa 段的 --workflow-config 以新 runId 重开。目标与旧运行不符返回 snapshot_changed 时停止,不自动刷新。'
|
|
241
|
+
:'再用单任务宿主 cm-ai-host.mjs 以 --supersede-reviewed-evidence 和单行 --supersede-reason,带含 qa 段的 --workflow-config 与 --allow-qa 新建运行重做。'),
|
|
242
|
+
null,[...kept,'取消后本批次不能再恢复','重开须经用户批准,原运行记录保留、不改写']);
|
|
243
|
+
return explain(summary,v2
|
|
244
|
+
?'在原运行补挂 QA(skills/cm-ai/references/js-host-qa-recovery.md「补挂 QA」):以 --mode resume 启动,换一份只把 qa 改成 "run"、其余字段逐字不变的策略,'
|
|
245
|
+
+'并带含 qa 段的 --workflow-config;不带 --allow-* 或 --expected-control。宿主核对原指纹后追加 qa-attached,再按原 N6 门禁执行 QA。'
|
|
246
|
+
:'在原运行补挂 QA(skills/cm-ai/references/js-host-qa-recovery.md「补挂 QA」legacy 段):用原配置 --mode resume 启动,显式提供含 qa 段的 --workflow-config 与 --allow-qa;'
|
|
247
|
+
+'宿主核对原定义、身份、开发与审查配置后追加 qa-attached,再按原 N6 门禁执行 QA。',
|
|
248
|
+
null,[...kept,'补挂只能做一次,之后恢复保持同一份 QA 配置']);
|
|
249
|
+
}
|
|
212
250
|
// Q15: the read-only documentation check answered blocked.
|
|
213
251
|
if(state==='fixture_completed'&&code==='documentation_sync_blocked')return explain('文档核对判定文档尚未同步(reason 写明缺什么)。',
|
|
214
252
|
'按 reason 补齐 README 或功能文档;文档核对只读、可重复,用原配置 --mode resume 重启宿主后再发 finish 重新核对(同一宿主进程内结论已缓存)。',
|
|
@@ -227,6 +265,12 @@ function renderOperatorGuidance(result,{executionActive=false,protocol='legacy',
|
|
|
227
265
|
// Static instructions plus bounded host-formatted diagnostics; never raw
|
|
228
266
|
// provider output. The structured explanation does not authorize an operation.
|
|
229
267
|
export function guidanceText(result){
|
|
268
|
+
const text=baseGuidanceText(result);
|
|
269
|
+
if(text===null||!REVIEW_LIMIT_CARD_CODES.has(result.code)&&result.code!=='review_publication_required')return text;
|
|
270
|
+
const card=reviewLimitCardLines(result.reviewLimitCard);
|
|
271
|
+
return card.length?`${text}\n${card.join('\n')}`:text;
|
|
272
|
+
}
|
|
273
|
+
function baseGuidanceText(result){
|
|
230
274
|
if(result?.workflow!=='cm-ai')return null;
|
|
231
275
|
const guidance=result?.guidance;
|
|
232
276
|
const bounded=value=>safeLine(value)&&Buffer.byteLength(value,'utf8')<=2000;
|
|
@@ -292,6 +336,86 @@ function renderBatchOperatorGuidance(result,{taskKey=null,protocol='legacy'}={})
|
|
|
292
336
|
return g;
|
|
293
337
|
}
|
|
294
338
|
|
|
339
|
+
// review_limit decision card. Presentation of already replayed evidence only: it
|
|
340
|
+
// grants nothing, keeps the two-round limit, and names every missing fact.
|
|
341
|
+
export const REVIEW_LIMIT_CARD_CODES=new Set(['review_limit','review_continuation_rejected']);
|
|
342
|
+
const CARD_FINDINGS=8,CARD_CHANGES=20,CARD_TEXT=240;
|
|
343
|
+
const cardText=value=>{
|
|
344
|
+
const flat=String(value??'').replace(/[\x00-\x1f\x7f-\x9f--]+/g,' ').trim();
|
|
345
|
+
let text='';for(const char of flat){if(text.length>=CARD_TEXT){text+='…';break;}text+=char;}
|
|
346
|
+
return text;
|
|
347
|
+
};
|
|
348
|
+
// dogfood 2026-12-01(问题 20):旧运行写进代码根、与开工前基线不一致的文件会让重开报 supersede_code_drift。
|
|
349
|
+
const SUPERSEDE_DRIFT_NOTE='旧运行留在代码根、与它开工前基线不一致的文件会让重开报 supersede_code_drift:重开前把开工前已有的文件恢复到原路径和原内容,只有开工后新增的文件才可移出代码根(删除已有文件也算漂移);确需保留时,经用户确认后按该报错 reason 的说明重建(保留的文件算作已有代码,不进新运行的审查改动)';
|
|
350
|
+
const SPEC_CHANGE_EXIT='意见指向规格本身(要求做不到,或用户决定改要求)时:先用 cm-prd --change 改规格并重新批准,再 supersede 以新 runId 重开;审查只认已批准规格,对话里批准的例外不算';
|
|
351
|
+
const HUMAN_CORRECTION_NA='人工补正(docs/human-correction.md)与兼容受控补正只适用于兼容任务门禁,不能完成 cm-ai 运行';
|
|
352
|
+
export function reviewLimitCard(evidence,{continuation=null}={}){
|
|
353
|
+
const missing=[],valid=evidence&&typeof evidence==='object';
|
|
354
|
+
if(!valid)missing.push('运行回放证据(无法读取,以下各项均未确认)');
|
|
355
|
+
const receipts=valid&&Array.isArray(evidence.rounds)?evidence.rounds:[];
|
|
356
|
+
if(valid&&receipts.length<2)missing.push(`审查回执(只找到 ${receipts.length} 份,应有 2 份)`);
|
|
357
|
+
const round1Paths=new Set((receipts[0]?.findings??[]).map(f=>f.path));
|
|
358
|
+
const rounds=receipts.map((r,index)=>{
|
|
359
|
+
const findings=Array.isArray(r.findings)?r.findings:[];
|
|
360
|
+
return Object.freeze({round:index+1,attempt:r.attempt,verdict:r.verdict,summary:cardText(r.summary),
|
|
361
|
+
findingsTotal:findings.length,
|
|
362
|
+
findings:Object.freeze(findings.slice(0,CARD_FINDINGS).map(f=>Object.freeze({id:cardText(f.id),severity:f.severity,
|
|
363
|
+
path:cardText(f.path),message:cardText(f.message),...(index>0?{sameFileAsRound1:round1Paths.has(f.path)}:{})})))});
|
|
364
|
+
});
|
|
365
|
+
const checks=valid&&Array.isArray(evidence.checks)?evidence.checks:null;
|
|
366
|
+
const changes=valid&&Array.isArray(evidence.changes)?evidence.changes:null;
|
|
367
|
+
if(valid&&checks===null)missing.push('最后一轮审查包(检查实跑结果)');
|
|
368
|
+
if(valid&&changes===null)missing.push('最后一轮审查包(改动清单)');
|
|
369
|
+
const names={handoff:'交付记录 handoff',review:'审查报告',correction_record:'补正记录',receipt:'封存回执'};
|
|
370
|
+
for(const file of valid&&Array.isArray(evidence.files)?evidence.files:[])
|
|
371
|
+
if(!file.present)missing.push(file.round===3?`第三次受控审查的${names[file.kind]??file.kind}文件`
|
|
372
|
+
:`第 ${file.round} 轮${names[file.kind]??file.kind}文件`);
|
|
373
|
+
const exits=[
|
|
374
|
+
Object.freeze({id:'supersede',available:true,description:`保留本运行全部记录,经用户批准后以新 runId 重开同一任务;新运行从第 1 轮开始,第 2 轮意见只作参考带入;${SUPERSEDE_DRIFT_NOTE}`}),
|
|
375
|
+
// dogfood 2026-12-01:意见指向规格本身时,续审仍按已批准规格判,对话里批准的例外不算;直接指向规格变更。
|
|
376
|
+
Object.freeze({id:'spec_change',available:true,description:SPEC_CHANGE_EXIT}),
|
|
377
|
+
Object.freeze({id:'review_continuation',available:continuation?.available===true,
|
|
378
|
+
description:continuation?.available===true?'第三次受控审查:原文件范围内补正一次、重跑检查、再做一次 fresh 独立审查;每任务最多一次;只修实现,审查只认已批准规格'
|
|
379
|
+
:cardText(continuation?.reason??'当前运行未提供第三次受控审查(仅新版单任务运行)')}),
|
|
380
|
+
Object.freeze({id:'human_correction',available:false,description:HUMAN_CORRECTION_NA}),
|
|
381
|
+
];
|
|
382
|
+
return Object.freeze({version:1,kind:'review_limit_decision',readOnly:true,authorizationGranted:false,dispatchedCalls:0,
|
|
383
|
+
rounds:Object.freeze(rounds),
|
|
384
|
+
// Which review saw this package: the third controlled review keeps attempt 2.
|
|
385
|
+
checks:checks===null?null:Object.freeze({fromAttempt:evidence.packageAttempt??null,
|
|
386
|
+
fromReview:(()=>{const index=receipts.findLastIndex(r=>r.packageDigest===evidence.packageDigest);return index<0?null:index+1;})(),
|
|
387
|
+
items:Object.freeze(checks.map(c=>Object.freeze({id:cardText(c.id),outcome:c.outcome})))}),
|
|
388
|
+
changes:changes===null?null:Object.freeze({total:changes.length,
|
|
389
|
+
items:Object.freeze(changes.slice(0,CARD_CHANGES).map(c=>Object.freeze({path:cardText(c.path),kind:c.kind})))}),
|
|
390
|
+
missing:Object.freeze(missing),exits:Object.freeze(exits)});
|
|
391
|
+
}
|
|
392
|
+
const OUTCOME={passed:'PASS',failed:'FAIL',unavailable:'UNAVAILABLE'},KIND={created:'新增',modified:'修改',deleted:'删除'};
|
|
393
|
+
export function reviewLimitCardLines(card){
|
|
394
|
+
if(!card||card.version!==1||card.kind!=='review_limit_decision'||card.authorizationGranted!==false)return [];
|
|
395
|
+
const lines=['决策卡(只读,不放行,不改变两轮上限):'];
|
|
396
|
+
// Missing facts and exits first: long reviewer text must never crowd them out.
|
|
397
|
+
if(card.missing.length)lines.push(`缺少:${card.missing.join(';')}`);
|
|
398
|
+
lines.push(`可用出口:${card.exits.filter(e=>e.available).map(e=>`${e.id}(${e.description})`).join(';')||'无'}`);
|
|
399
|
+
lines.push(`不可用:${card.exits.filter(e=>!e.available).map(e=>`${e.id}(${e.description})`).join(';')}`);
|
|
400
|
+
// Every round's one-line comparison before checks, changes and detail, so truncation only drops detail.
|
|
401
|
+
const title=r=>`第 ${r.round} 次审查${r.round===3?'(第三次受控审查)':''}`;
|
|
402
|
+
for(const r of card.rounds){
|
|
403
|
+
const repeated=r.findings.filter(f=>f.sameFileAsRound1).length;
|
|
404
|
+
lines.push(`${title(r)} ${r.verdict},${r.findingsTotal} 条意见`+(r.round>1&&r.findings.length?`(${repeated}/${r.findings.length} 条落在第 1 次已指出的文件)`:'')+`:${r.summary}`);
|
|
405
|
+
}
|
|
406
|
+
lines.push(card.checks?`检查实跑(${card.checks.fromReview?`第 ${card.checks.fromReview} 次审查的审查包`:`第 ${card.checks.fromAttempt??'?'} 轮交付,未送审`}):${card.checks.items.map(c=>`${c.id} ${OUTCOME[c.outcome]??'UNKNOWN'}`).join(';')||'无'}`
|
|
407
|
+
:'检查实跑:UNKNOWN');
|
|
408
|
+
lines.push(card.changes?`改动文件 ${card.changes.total} 个:${card.changes.items.map(c=>`${c.path}(${KIND[c.kind]??'未知'})`).join('、')}${card.changes.total>card.changes.items.length?' 等':''}`
|
|
409
|
+
:'改动文件:UNKNOWN');
|
|
410
|
+
for(const r of card.rounds){
|
|
411
|
+
for(const f of r.findings)lines.push(` - ${title(r)} ${f.severity} ${f.path}:${f.message}`);
|
|
412
|
+
if(r.findingsTotal>r.findings.length)lines.push(` - ${title(r)}另有 ${r.findingsTotal-r.findings.length} 条,见原审查回执`);
|
|
413
|
+
}
|
|
414
|
+
let text='',out=[];
|
|
415
|
+
for(const line of lines){if(Buffer.byteLength(text+line,'utf8')>6000){out.push('…(其余见原运行记录)');break;}text+=line;out.push(line);}
|
|
416
|
+
return out;
|
|
417
|
+
}
|
|
418
|
+
|
|
295
419
|
// Pure formatting shared by all drivers, including partial check-only runtimes.
|
|
296
420
|
export function deliveryLines(value){
|
|
297
421
|
return [['productAcceptance','产品人工验收'],['deployment','发布/部署']].map(([field,label])=>{
|
|
@@ -306,7 +430,7 @@ const label={completed:'已完成',passed:'PASS',failed:'FAIL',blocked:'BLOCKED'
|
|
|
306
430
|
export function completionLines(summary){
|
|
307
431
|
if(!summary||summary.version!==1)return [];
|
|
308
432
|
const feature=summary.feature,project=summary.project;
|
|
309
|
-
const protection={contract_v1:'冻结合同 v1',legacy_unprotected:'
|
|
433
|
+
const protection={contract_v1:'冻结合同 v1',legacy_unprotected:'未启用必验合同(规格没写「必验:」等标记,或运行早于该合同;原有检查与独立审查照旧)',unknown:'验收保护 UNKNOWN'}[summary.task.acceptanceProtection];
|
|
310
434
|
return [`完成范围:task ${summary.binding.identity?.taskId??'未知'} ${label[summary.task.status]??'UNKNOWN'}(独立审查 ${label[summary.task.review?.status]??'UNKNOWN'})${protection?`;${protection}`:''}`,
|
|
311
435
|
`功能 ${summary.binding.feature??'未知'}:任务 ${feature.tasks?`${feature.tasks.completed}/${feature.tasks.total}`:'UNKNOWN'};QA ${label[feature.qa?.status]??'UNKNOWN'};当前资格 ${label[feature.status]??'UNKNOWN'}`,
|
|
312
436
|
`项目批准范围:${project.totalFeatures===undefined?'UNKNOWN':`${project.completedFeatures}/${project.totalFeatures} 个功能通过,${project.pendingTasks} 个待办`};${label[project.status]??'UNKNOWN'}`,
|
|
@@ -7,7 +7,8 @@ import {scanRows} from './log-rows.mjs';
|
|
|
7
7
|
|
|
8
8
|
const LABELS={qa_failed:'最新一轮 FAIL',qa_blocked:'最新一轮 BLOCKED',qa_decision_blocked:'QA 决策阻塞',
|
|
9
9
|
qa_not_run:'已触发但未执行',qa_execution_unknown:'执行结果未知',qa_pending:'旧结果已作废,待下一轮',
|
|
10
|
-
qa_missing:'任务已全部完成,但没有 QA 记录',qa_skipped:'任务已全部完成,但最新 QA 决策为跳过'
|
|
10
|
+
qa_missing:'任务已全部完成,但没有 QA 记录',qa_skipped:'任务已全部完成,但最新 QA 决策为跳过',
|
|
11
|
+
qa_periodic_only:'任务已全部完成,但最新 QA 是定期 QA,浏览器用例未执行'};
|
|
11
12
|
const cache=new Map();
|
|
12
13
|
|
|
13
14
|
// One pass: the latest decision per feature, and the test_run rows bound to it.
|
|
@@ -58,7 +59,16 @@ export function outstandingFeatureQa({specsDir,features,currentRunId=null,inspec
|
|
|
58
59
|
continue;
|
|
59
60
|
}
|
|
60
61
|
const {decision,runs}=entry;
|
|
61
|
-
|
|
62
|
+
// A periodic round deferred browser cases to a feature-completion QA that never ran
|
|
63
|
+
// (the last task finished outside N6): its PASS does not cover the feature, the
|
|
64
|
+
// caller's own run included.
|
|
65
|
+
const start=runs.filter(row=>row.phase==='start').at(-1);
|
|
66
|
+
const periodicOnly=terminal&&decision.status==='triggered'
|
|
67
|
+
&&Array.isArray(start?.periodic_deferred_cases)&&start.periodic_deferred_cases.length>0;
|
|
68
|
+
if(decision.run_id===currentRunId){
|
|
69
|
+
if(periodicOnly)outstanding.push({feature,runId:decision.run_id,taskId:decision.task,attempt:decision.attempt,status:'qa_periodic_only'});
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
62
72
|
let status;
|
|
63
73
|
if(decision.status==='skipped')status=terminal?'qa_skipped':null;
|
|
64
74
|
else if(decision.status!=='triggered')status='qa_decision_blocked';
|
|
@@ -73,6 +83,7 @@ export function outstandingFeatureQa({specsDir,features,currentRunId=null,inspec
|
|
|
73
83
|
:typeof error?.code==='string'&&/^[a-z][a-z0-9_]{0,63}$/.test(error.code)?error.code:'qa_result_invalid';
|
|
74
84
|
}
|
|
75
85
|
}
|
|
86
|
+
if(status===null&&periodicOnly)status='qa_periodic_only';
|
|
76
87
|
if(status!==null)outstanding.push({feature,runId:decision.run_id,taskId:decision.task,attempt:decision.attempt,status});
|
|
77
88
|
}
|
|
78
89
|
return outstanding;
|
|
@@ -57,6 +57,10 @@ export function inspectProviderReview(observationText,expectationText) {
|
|
|
57
57
|
need(arguments.length===2);
|
|
58
58
|
return inspect(observationText,expectationText,false);
|
|
59
59
|
}
|
|
60
|
+
export function inspectProviderReviewLive(observationText,expectationText) {
|
|
61
|
+
need(arguments.length===2);
|
|
62
|
+
return inspect(observationText,expectationText,false,{strictBlocked:true});
|
|
63
|
+
}
|
|
60
64
|
export function inspectProviderCauseReview(observationText,expectationText){
|
|
61
65
|
need(arguments.length===2);
|
|
62
66
|
return inspect(observationText,expectationText,true);
|
|
@@ -71,14 +75,14 @@ function readObservation(observationText,expectationText,cause) {
|
|
|
71
75
|
else {shape(r,['status','code']);need(['failed','cancelled'].includes(r.status));text(r.code);need(r.code.length<=256);}
|
|
72
76
|
return {observation,expected,...stream,r};
|
|
73
77
|
}
|
|
74
|
-
function inspect(observationText,expectationText,cause) {
|
|
78
|
+
function inspect(observationText,expectationText,cause,{strictBlocked=false}={}) {
|
|
75
79
|
try {
|
|
76
80
|
const {observation,expected,thread,terminal,close,r}=readObservation(observationText,expectationText,cause);
|
|
77
81
|
let observationStatus='unknown',code='transport_incomplete',review=null;
|
|
78
82
|
if(close?.timed_out===true||r.code==='timeout')code='transport_timeout';
|
|
79
83
|
else if(r.status==='cancelled'||r.code==='cancelled'){observationStatus='cancelled';code='transport_cancelled';}
|
|
80
84
|
else if(close?.exit_code===0&&close.signal===null&&terminal==='turn.completed'&&r.status==='succeeded'){
|
|
81
|
-
review=cause?reviewResultForPaths(r.value,expected.pkg,causeReviewPaths(expected.pkg)):reviewResult(r.value,expected.pkg);
|
|
85
|
+
review=cause?reviewResultForPaths(r.value,expected.pkg,causeReviewPaths(expected.pkg)):reviewResult(r.value,expected.pkg,{strictBlocked});
|
|
82
86
|
observationStatus='completed';code=null;
|
|
83
87
|
}
|
|
84
88
|
return json({version:1,kind:cause?'cm-provider-cause-review-inspection':'cm-provider-review-inspection',requestDigest:expected.request.requestDigest,
|
|
@@ -174,7 +178,7 @@ export function inspectProviderReviewFailure(observationText,expectationText){
|
|
|
174
178
|
category='provider';failure=REVIEWER_PROVIDER_FAILURES[r.code];
|
|
175
179
|
}else{
|
|
176
180
|
if(!(close.exit_code===0&&close.signal===null&&terminal==='turn.completed'&&r.status==='succeeded'))return null;
|
|
177
|
-
try{reviewResult(r.value,expected.pkg);return null;}
|
|
181
|
+
try{reviewResult(r.value,expected.pkg,{strictBlocked:true});return null;}
|
|
178
182
|
catch(error){if(!REVIEWER_VERDICT_FAILURES.includes(error?.code))return null;category='verdict';failure=error.code;}
|
|
179
183
|
}
|
|
180
184
|
return json({version:1,kind:'cm-provider-review-failure',requestDigest:expected.request.requestDigest,
|