@aibyzero/cm-workflow 0.16.5 → 0.16.7
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/AGENTS.md +14 -0
- package/CHANGELOG.md +19 -1
- package/README.md +17 -4
- package/THIRD_PARTY_NOTICES.md +9 -0
- package/VERSION +1 -1
- package/docs/architecture.md +43 -0
- package/docs/execution-optimizations.md +33 -0
- package/docs/external-models.md +114 -0
- package/docs/fixes/.reviews/20260929-bootstrap-unchanged-review-r1.md +7 -0
- package/docs/fixes/.reviews/20260930-develop-package-limit-recovery-r4.md +9 -0
- package/docs/fixes/20260929-bootstrap-rule-refresh-conflict.md +22 -0
- package/docs/fixes/20260929-bootstrap-unchanged-review.md +26 -0
- package/docs/fixes/20260930-develop-package-limit-recovery.md +65 -0
- package/docs/human-correction.md +31 -0
- package/docs/installation.md +28 -7
- package/docs/js-workflow-control.md +96 -6
- package/docs/live-evidence-drivers.md +62 -0
- package/docs/next-steps.md +15 -10
- package/docs/untested-branches.md +27 -4
- package/docs/user-guide.md +23 -8
- package/install-codex.sh +28 -11
- package/package.json +1 -1
- package/runtime/js/cm-ai/claude-review-adapter.mjs +7 -4
- package/runtime/js/cm-ai/claude-tool-preview.mjs +4 -4
- package/runtime/js/cm-ai/cm-ai-admission.mjs +34 -10
- package/runtime/js/cm-ai/cm-ai-context-refresh.mjs +9 -5
- package/runtime/js/cm-ai/cm-ai-conversation-entry.mjs +111 -34
- package/runtime/js/cm-ai/cm-ai-qa-log.mjs +93 -31
- package/runtime/js/cm-ai/cm-ai-run-finalizer.mjs +13 -57
- package/runtime/js/cm-ai/codex-config.mjs +3 -2
- package/runtime/js/cm-ai/codex-review-adapter.mjs +34 -15
- package/runtime/js/cm-ai/committed-rule-basis.mjs +76 -0
- package/runtime/js/cm-ai/developer-adapter.mjs +8 -5
- package/runtime/js/cm-ai/drive-bootstrap.mjs +22 -12
- package/runtime/js/cm-ai/drive-core.mjs +9 -3
- package/runtime/js/cm-ai/durable-runner-state.mjs +146 -14
- package/runtime/js/cm-ai/effect-contract.mjs +1 -1
- package/runtime/js/cm-ai/execution-policy.mjs +58 -0
- package/runtime/js/cm-ai/external-group-models.mjs +53 -0
- package/runtime/js/cm-ai/external-model-launch.mjs +23 -0
- package/runtime/js/cm-ai/external-models.mjs +52 -0
- package/runtime/js/cm-ai/external-run-guard.mjs +96 -0
- package/runtime/js/cm-ai/host-bootstrap.mjs +70 -20
- package/runtime/js/cm-ai/host-check.mjs +30 -4
- package/runtime/js/cm-ai/host-conversation-execution.mjs +59 -17
- package/runtime/js/cm-ai/host-documentation.mjs +2 -2
- package/runtime/js/cm-ai/host-progress.mjs +80 -0
- package/runtime/js/cm-ai/host-project-execution.mjs +16 -11
- package/runtime/js/cm-ai/host-qa-executor.mjs +54 -8
- package/runtime/js/cm-ai/host-qa-fix-owner.mjs +22 -5
- package/runtime/js/cm-ai/host-session.mjs +1 -1
- package/runtime/js/cm-ai/host-workflow-capabilities.mjs +3 -1
- package/runtime/js/cm-ai/knowledge-closeout.mjs +56 -0
- package/runtime/js/cm-ai/legacy-model-run-preview.mjs +24 -0
- package/runtime/js/cm-ai/legacy-model-settings.mjs +59 -0
- package/runtime/js/cm-ai/live-evidence.mjs +96 -0
- package/runtime/js/cm-ai/log-rows.mjs +36 -0
- package/runtime/js/cm-ai/model-configuration-file.mjs +63 -0
- package/runtime/js/cm-ai/model_configuration_write.py +214 -0
- package/runtime/js/cm-ai/native-usage-log.mjs +26 -0
- package/runtime/js/cm-ai/operator-guidance.mjs +89 -0
- package/runtime/js/cm-ai/owned-process-cleanup.mjs +22 -0
- package/runtime/js/cm-ai/provider-review-observation.mjs +15 -0
- package/runtime/js/cm-ai/provider-usage.mjs +39 -0
- package/runtime/js/cm-ai/review-package.mjs +11 -0
- package/runtime/js/cm-ai/review-presentation.mjs +45 -0
- package/runtime/js/cm-ai/review-reconciliation.mjs +20 -0
- package/runtime/js/cm-ai/status-projection.mjs +93 -0
- package/runtime/js/cm-ai/task-runner.mjs +176 -25
- package/runtime/js/cm-ai/tool-preview.mjs +8 -4
- package/runtime/js/cm-ai/worker-claude-developer.mjs +16 -7
- package/runtime/js/cm-ai/worker-claude.mjs +63 -19
- package/runtime/js/cm-ai/worker-codex-developer.mjs +15 -9
- package/runtime/js/cm-ai/worker-codex.mjs +45 -19
- package/runtime/js/cm-fix/cause-evidence.mjs +5 -3
- package/runtime/js/cm-fix/cause-invocation.mjs +6 -3
- package/runtime/js/cm-fix/cause-package.mjs +10 -1
- package/runtime/js/cm-fix/execution.mjs +183 -40
- package/runtime/js/cm-fix/final-review.mjs +18 -10
- package/runtime/js/cm-fix/finish.mjs +2 -19
- package/runtime/js/cm-fix/host-review.mjs +25 -6
- package/runtime/js/cm-fix/host.mjs +4 -1
- package/runtime/js/cm-fix/layout.mjs +1 -1
- package/runtime/js/cm-fix/log-events.mjs +29 -0
- package/runtime/js/cm-fix/metrics.mjs +3 -2
- package/runtime/js/cm-fix/progress.mjs +4 -0
- package/runtime/js/cm-fix/review-reconciliation.mjs +64 -0
- package/runtime/js/cm-prd/analysis.mjs +5 -2
- package/runtime/js/cm-prd/response-recovery.mjs +23 -0
- package/runtime/js/cm-prd/review-host.mjs +2 -1
- package/runtime/js/cm-prd/review-publication.mjs +23 -13
- package/runtime/js/cm-prd/review-time.mjs +29 -0
- package/runtime/js/cm-prd/session.mjs +53 -6
- package/runtime/js/cm-security/finalize.mjs +32 -0
- package/runtime/js/cm-test/recovery.mjs +4 -4
- package/runtime/review.md +5 -0
- package/runtime/task-gates.md +6 -0
- package/runtime/workflow-config.md +10 -1
- package/scripts/cm-ai-admission.mjs +14 -3
- package/scripts/cm-ai-batch-drive.mjs +52 -23
- package/scripts/cm-ai-batch-drive.test.mjs +47 -2
- package/scripts/cm-ai-batch-host.mjs +44 -16
- package/scripts/cm-ai-batch-run.mjs +77 -29
- package/scripts/cm-ai-bootstrap-flow.test.mjs +3 -2
- package/scripts/cm-ai-bootstrap-merge.test.mjs +118 -1
- package/scripts/cm-ai-bootstrap.test.mjs +80 -87
- package/scripts/cm-ai-conversation-entry-ops.test.mjs +15 -0
- package/scripts/cm-ai-develop-driver-gaps.test.mjs +102 -0
- package/scripts/cm-ai-drive-bootstrap-rules.test.mjs +2 -2
- package/scripts/cm-ai-drive.mjs +73 -28
- package/scripts/cm-ai-drive.test.mjs +119 -1
- package/scripts/cm-ai-feature-selection.test.mjs +178 -0
- package/scripts/cm-ai-host.mjs +79 -27
- package/scripts/cm-ai-host.test.mjs +88 -0
- package/scripts/cm-ai-operator-guidance.test.mjs +94 -0
- package/scripts/cm-ai-progress.test.mjs +521 -0
- package/scripts/cm-ai-protected-scope.test.mjs +194 -0
- package/scripts/cm-ai-qa-config-revision.test.mjs +21 -0
- package/scripts/cm-ai-review-failure.test.mjs +71 -11
- package/scripts/cm-ai-run.mjs +94 -19
- package/scripts/cm-ai-run.test.mjs +2 -1
- package/scripts/cm-bootstrap-review-recovery.test.mjs +70 -0
- package/scripts/cm-check-drive.test.mjs +1 -0
- package/scripts/cm-check-runtime.sh +11 -0
- package/scripts/cm-claude-install-layout.test.mjs +26 -0
- package/scripts/cm-claude-probe.test.mjs +1 -1
- package/scripts/cm-codex-plugin-metadata.py +83 -0
- package/scripts/cm-codex-plugin-metadata.test.mjs +55 -0
- package/scripts/cm-efficiency-checks.test.mjs +37 -0
- package/scripts/cm-efficiency-diagnostics.test.mjs +74 -0
- package/scripts/cm-efficiency-offline.mjs +35 -0
- package/scripts/cm-efficiency-policy.test.mjs +48 -0
- package/scripts/cm-efficiency-presentation.test.mjs +35 -0
- package/scripts/cm-efficiency-response.test.mjs +117 -0
- package/scripts/cm-efficiency-usage.test.mjs +148 -0
- package/scripts/cm-external-batch-host.test.mjs +157 -0
- package/scripts/cm-external-fix-host.test.mjs +281 -0
- package/scripts/cm-external-fix-reconciliation.test.mjs +105 -0
- package/scripts/cm-external-group-models.test.mjs +60 -0
- package/scripts/cm-external-model-host.test.mjs +180 -0
- package/scripts/cm-external-model-recovery.test.mjs +108 -0
- package/scripts/cm-external-models.test.mjs +89 -0
- package/scripts/cm-external-process-cleanup.test.mjs +71 -0
- package/scripts/cm-external-qa-fix.test.mjs +170 -0
- package/scripts/cm-external-review-reconciliation.test.mjs +314 -0
- package/scripts/cm-fix-drive.mjs +28 -13
- package/scripts/cm-fix-final-review.test.mjs +11 -6
- package/scripts/cm-fix-host.mjs +17 -10
- package/scripts/cm-fix-large-log.test.mjs +113 -0
- package/scripts/cm-fix-protected-edits.test.mjs +12 -0
- package/scripts/cm-fix-rediagnosis.test.mjs +168 -0
- package/scripts/cm-fix-review-budget.test.mjs +7 -1
- package/scripts/cm-host-qa-executor.test.mjs +329 -3
- package/scripts/cm-knowledge-closeout.test.mjs +160 -0
- package/scripts/cm-live-evidence.test.mjs +64 -0
- package/scripts/cm-log-event.mjs +34 -7
- package/scripts/cm-log-event.py +15 -0
- package/scripts/cm-model-setup.mjs +79 -0
- package/scripts/cm-prd-drive.mjs +32 -11
- package/scripts/cm-prd-drive.test.mjs +15 -0
- package/scripts/cm-prd-host.mjs +26 -6
- package/scripts/cm-prd-host.test.mjs +4 -0
- package/scripts/cm-prd-review-host.test.mjs +17 -0
- package/scripts/cm-prd-session-recovery.test.mjs +44 -2
- package/scripts/cm-prd-task-grouping.test.mjs +206 -0
- package/scripts/cm-release-smoke.sh +5 -1
- package/scripts/cm-review-scope-recovery.test.mjs +5 -3
- package/scripts/cm-runtime-i18n.mjs +15 -4
- package/scripts/cm-runtime-install.mjs +8 -4
- package/scripts/cm-runtime.mjs +116 -23
- package/scripts/cm-runtime.test.mjs +121 -12
- package/scripts/cm-security.test.mjs +32 -0
- package/scripts/cm-task-gate-correction.test.mjs +117 -0
- package/scripts/cm-task-gate.mjs +146 -10
- package/scripts/cm-task-gate.py +1 -0
- package/scripts/cm-test-branch-impact.test.mjs +11 -0
- package/scripts/cm-test-drive.mjs +10 -4
- package/scripts/cm-test-drive.test.mjs +14 -1
- package/scripts/cm-tool-preview-context.test.mjs +12 -0
- package/scripts/cm-usage-report.py +22 -3
- package/scripts/cm-workflow-config.mjs +10 -1
- package/scripts/fixtures/bootstrap-review-runner.mjs +102 -0
- package/scripts/fixtures/live-evidence-driver.mjs +35 -0
- package/scripts/fixtures/process-cleanup.mjs +3 -1
- package/scripts/test-cm-native-usage.py +62 -0
- package/scripts/test-external-model-setup.py +91 -0
- package/scripts/test-model-configuration-write.py +201 -0
- package/scripts/test-npm-install.py +10 -1
- package/skills/cm-ai/SKILL.md +2 -2
- package/skills/cm-ai/references/N1-init.md +1 -1
- package/skills/cm-ai/references/N8-finish.md +5 -0
- package/skills/cm-ai/references/js-host.md +16 -7
- package/skills/cm-ai/references/knowledge-closeout.md +90 -0
- package/skills/cm-fix/SKILL.md +1 -1
- package/skills/cm-fix/references/js-host.md +30 -2
- package/skills/cm-prd/SKILL.md +5 -4
- package/skills/cm-prd/references/spec-self-check.md +3 -1
- package/skills/cm-runtime/SKILL.md +29 -6
- package/skills/cm-security/SKILL.md +4 -2
- package/skills/cm-security/references/scan-contract.md +1 -0
- package/templates/cm-workflow.yml +1 -1
|
@@ -7,7 +7,7 @@ import {captureReviewBaseline,createReviewPackage} from '../runtime/js/cm-ai/rev
|
|
|
7
7
|
import {createHostHandoff} from '../runtime/js/cm-ai/host-handoff.mjs';
|
|
8
8
|
import {createHostReviewAuthority} from '../runtime/js/cm-ai/host-review-authority.mjs';
|
|
9
9
|
import {createCodexReviewRun} from '../runtime/js/cm-ai/codex-review-adapter.mjs';
|
|
10
|
-
import {createFixFinalReview,inspectFixFinalResult,inspectFixRepairReview,fixRevisionReviewConfiguration} from '../runtime/js/cm-fix/final-review.mjs';
|
|
10
|
+
import {createFixFinalReview,inspectFixFinalResult,inspectFixRepairReview,fixRevisionReviewConfiguration,fixFinalReviewConfiguration} from '../runtime/js/cm-fix/final-review.mjs';
|
|
11
11
|
import {prepareFixRepair} from '../runtime/js/cm-fix/repair.mjs';
|
|
12
12
|
import {createFixRedTest} from '../runtime/js/cm-fix/red-test.mjs';
|
|
13
13
|
import {createFixBaseline} from '../runtime/js/cm-fix/baseline.mjs';
|
|
@@ -25,10 +25,15 @@ test('final review uses existing grant, prompt and normalized inspection without
|
|
|
25
25
|
const handoffPath=path.join(temp,'fix-demo-T-FIX-demo-a1-handoff.json');
|
|
26
26
|
createHostHandoff({root,baseline,checks,handoffPath,evidence:['learning: no_relevant_lesson','learning: retrospective no_new_lesson']});
|
|
27
27
|
const pkg=createReviewPackage({root,baseline,checks,handoffPath});
|
|
28
|
-
for(const mode of ['approved','changes_requested','denied','excluded','lost','timeout']){
|
|
28
|
+
for(const mode of ['approved','changes_requested','denied','excluded','excluded-prior-cause','excluded-revised-cause','lost','timeout']){
|
|
29
29
|
const reviewer={reviewerId:'final-reviewer',adapterId:'codex-review-adapter',provider:'codex',requestedModel:'synthetic',contextId:'logical-review',excludedThreadIds:mode==='excluded'?['actual-review']:mode==='changes_requested'?[...Array.from({length:32},(_,index)=>`configured-${index}`),'cause-reviewer']:[]};
|
|
30
|
-
const configuration=
|
|
31
|
-
|
|
30
|
+
const configuration=['changes_requested','excluded-prior-cause','excluded-revised-cause'].includes(mode)
|
|
31
|
+
?fixFinalReviewConfiguration({hostContextId:'actual-host',causeReview:{...reviewer,
|
|
32
|
+
excludedThreadIds:mode==='changes_requested'?Array.from({length:32},(_,index)=>`configured-${index}`):[]}},
|
|
33
|
+
mode==='excluded-prior-cause'?['actual-review','revised-cause']:
|
|
34
|
+
mode==='excluded-revised-cause'?['prior-cause','actual-review']:['prior-cause','revised-cause'])
|
|
35
|
+
:{hostContextId:'actual-host',reviewer};let registered=null,started=null,calls=0;
|
|
36
|
+
const authority=createHostReviewAuthority({hostContextId:configuration.hostContextId,reviewerId:configuration.reviewer.reviewerId,adapterId:configuration.reviewer.adapterId,
|
|
32
37
|
decide:async()=>mode==='denied'?{status:'denied',code:'permission_denied'}:{status:'approved'}});
|
|
33
38
|
await authority.hostDecisionProvider.decide({identity,packageDigest:pkg.packageDigest},new AbortController().signal);
|
|
34
39
|
const run=createCodexReviewRun(async({prompt},{onEvent})=>{
|
|
@@ -77,7 +82,7 @@ test('final review uses existing grant, prompt and normalized inspection without
|
|
|
77
82
|
const nextPackage=createReviewPackage({root,baseline:nextBaseline,checks,handoffPath:nextHandoff});
|
|
78
83
|
const nextConfiguration=fixRevisionReviewConfiguration(feedback,next);
|
|
79
84
|
assert(nextConfiguration.reviewer.excludedThreadIds.includes('actual-review'));
|
|
80
|
-
assert.equal(nextConfiguration.reviewer.excludedThreadIds.length,
|
|
85
|
+
assert.equal(nextConfiguration.reviewer.excludedThreadIds.length,35);
|
|
81
86
|
for(const thread of ['actual-review','fresh-second-review']){
|
|
82
87
|
await authority.hostDecisionProvider.decide({identity:next,packageDigest:nextPackage.packageDigest},signal);
|
|
83
88
|
const nextRun=createFixFinalReview({reviewPackage:nextPackage,configuration:nextConfiguration,timeoutMs:2000},{authorize:authority.authorize,run:async(request,{onEvent})=>{
|
|
@@ -113,7 +118,7 @@ test('final review uses existing grant, prompt and normalized inspection without
|
|
|
113
118
|
assert.equal(result.inspection.completionEligible,false);
|
|
114
119
|
}
|
|
115
120
|
if(mode==='denied'){assert.equal(calls,0);assert.equal(registered,null);}
|
|
116
|
-
if(mode
|
|
121
|
+
if(mode.startsWith('excluded'))assert.equal(started,null);
|
|
117
122
|
if(mode==='timeout'){
|
|
118
123
|
assert.equal(result.reason,'timeout');
|
|
119
124
|
assert.deepEqual(result.diagnostic,{phase:'transport',code:'timeout'});
|
package/scripts/cm-fix-host.mjs
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// Opt-in fix stages; cause review dispatch needs explicit launch authority and matching diagnostics.
|
|
3
|
+
import {readFixExecutionPolicy} from '../runtime/js/cm-ai/execution-policy.mjs';
|
|
4
|
+
import {readFixExternalModels} from '../runtime/js/cm-ai/external-group-models.mjs';
|
|
3
5
|
import fs from 'node:fs';
|
|
4
6
|
import {fileURLToPath} from 'node:url';
|
|
5
7
|
import {openFixExecution} from '../runtime/js/cm-fix/execution.mjs';
|
|
@@ -11,14 +13,16 @@ import {id,json,need,shape,digest} from '../runtime/js/cm-ai/effect-contract.mjs
|
|
|
11
13
|
import {readConversationReviewConfiguration} from './cm-ai-host.mjs';
|
|
12
14
|
import {createFixReviewHost} from '../runtime/js/cm-fix/host-review.mjs';
|
|
13
15
|
|
|
14
|
-
const usage='cm-fix-host.mjs serve --config PATH --mode create|resume --host-context ID --allow-reproduction [--original-host-context ID] [--runtime codex|claude] [--input-limit BYTES] [--review-config PATH] [--allow-cause-review] [--allow-final-review] [--allow-test-author] [--allow-red-test] [--allow-baseline] [--allow-repair] [--allow-regression] [--allow-learning-writeback]\nCodex or Claude current-host operations: prepare_revision, revision_test_check, advance, cause_review_package, cause_review, author_tests, red_test, baseline, repair, regression, retrospective, learning_writeback, handoff, final_review_package, final_review, publish_review, check_n5, post_review_regression, status, cancel. Runtime defaults to codex; claude uses its own matching diagnostic receipt and cannot reuse Codex preflight or disabledSkills settings. Runtime selection is bound to recovery; switching providers requires a separate run. This selects existing adapters, not permission to call them. Each write/check needs its respective launch flag and configuration. Test authoring, repair, cause and final review dispatch require matching existing stdin diagnostics; diagnostic alone is not authorization. Passing regression stops at handoff_required. The read-only retrospective operation yields handoff_ready or learning_writeback_required. learning_writeback requires its own flag, preserves project instructions and includes AGENTS.md in the review scope; it does not authorize provider calls. handoff publishes the fixed specs-local handoff with Learning evidence and moves to final_review_required; no provider is called and no task is completed. final_review_package is read-only and returns the final content-bound review package. final_review requires its own flag and matching diagnostics; observations do not complete the task. publish_review projects the registered result into the existing review file; it does not dispatch or complete tasks. check_n5 runs the original Learning-aware gate; post_review_regression requires --allow-regression and reaches closeout_required, not completion.';
|
|
16
|
+
const usage='cm-fix-host.mjs serve --config PATH --mode create|resume --host-context ID --allow-reproduction [--original-host-context ID] [--execution-optimizations] [--external-models [--external-models-config PATH]] [--runtime codex|claude] [--input-limit BYTES] [--review-config PATH] [--allow-cause-review] [--allow-rediagnosis] [--allow-final-review] [--allow-test-author] [--allow-red-test] [--allow-baseline] [--allow-repair] [--allow-regression] [--allow-learning-writeback]\nCodex or Claude current-host operations: rediagnose, prepare_revision, revision_test_check, advance, cause_review_package, cause_review, author_tests, red_test, baseline, repair, regression, retrospective, learning_writeback, handoff, final_review_package, final_review, publish_review, check_n5, post_review_regression, status, cancel. Runtime defaults to codex; claude uses its own matching diagnostic receipt and cannot reuse Codex preflight or disabledSkills settings. Runtime selection is bound to recovery; switching providers requires a separate run. This selects existing adapters, not permission to call them. Each write/check needs its respective launch flag and configuration. Test authoring, repair, cause and final review dispatch require matching existing stdin diagnostics; diagnostic alone is not authorization. Passing regression stops at handoff_required. The read-only retrospective operation yields handoff_ready or learning_writeback_required. learning_writeback requires its own flag, preserves project instructions and includes AGENTS.md in the review scope; it does not authorize provider calls. handoff publishes the fixed specs-local handoff with Learning evidence and moves to final_review_required; no provider is called and no task is completed. final_review_package is read-only and returns the final content-bound review package. final_review requires its own flag and matching diagnostics; observations do not complete the task. publish_review projects the registered result into the existing review file; it does not dispatch or complete tasks. check_n5 runs the original Learning-aware gate; post_review_regression requires --allow-regression and reaches closeout_required, not completion.';
|
|
15
17
|
|
|
16
18
|
export async function main(argv=process.argv.slice(2),{input=process.stdin,output=process.stdout,error=process.stderr,reviewWorkerFactory=null}={}){
|
|
19
|
+
if(argv.length===1&&['--help','-h'].includes(argv[0]))output.write('Optional --execution-optimizations freezes policy v1 for new runs only; recovery retains the original policy and legacy runs reject retrofit. See docs/execution-optimizations.md.\n');
|
|
17
20
|
if(argv.length===1&&['--help','-h'].includes(argv[0]))output.write('Design-change escalation: approved cause_review reaches design_change_required when redTest is configured (test_author_required first if needed); author_tests/red_test keep their original flags and evidence checks. Confirmed red reaches escalation_required, never baseline/repair/regression. Non-visual runs without redTest reach escalation_required directly after approval and record why no failing test exists. Visual runs require a matching visual redTest with testFiles:[] and must complete the visual red step before escalation; opening without it fails with fix_visual_configuration_required. publish_dossier saves an 升级立项 dossier; finish requires --allow-finish, records run_done phase escalation/result escalated and closes the owner with escalationRunEnded:true. Retained tests become acceptance checks for the suggested $cm-prd --change. Resume the same run after a crash; conflicting exits fail with fix_escalation_exit_conflict. Terminal escalated is not completed: no task_done, metrics, repair or parent QA completion.\n');
|
|
18
21
|
if(argv.length===1&&['--help','-h'].includes(argv[0]))output.write('Omit specsRoot or use null for a bare project: the same owner stores archives in docs/fixes and reviews in docs/fixes/.reviews, uses the original no-specs log mode, and skips METRICS. No specs skeleton is created. Visual-only reproduction/redTest may use kind:visual with cwd, timeoutMs, before:{path,sha256,kind:screenshot|video,description}, reason explaining why automated red cannot be written, environment, steps and expected; redTest also has testFiles:[]. No testAuthor or fake red/green command. Repair/regression/review/finish permissions remain mandatory. qa_browser returns actual after carrier metadata; missing evidence blocks.\n');
|
|
19
|
-
if(argv.length===1&&['--help','-h'].includes(argv[0]))output.write('Optional startup configuration protectSpecs:true uses the existing Codex native sandbox for reproduction, red/baseline/regression/walkthrough commands and fixed text edits, without a model call. Requires the local sandbox executable; it does not change the current Codex/Claude host or reviewer identity. Original action permissions remain required. fix_test_author/fix_repair with editMode=protected-text-v1 require {outcome,edits:[{path,beforeSha256,content}]} using the supplied scope/expected hashes; never write directly. Content is full UTF-8 text or null for deletion, blocked requires edits:[].
|
|
22
|
+
if(argv.length===1&&['--help','-h'].includes(argv[0]))output.write('Optional startup configuration protectSpecs:true uses the existing Codex native sandbox for reproduction, red/baseline/regression/walkthrough commands and fixed text edits, without a model call. Requires the local sandbox executable; it does not change the current Codex/Claude host or reviewer identity. Original action permissions remain required. fix_test_author/fix_repair with editMode=protected-text-v1 require {outcome,edits:[{path,beforeSha256,content}]} using the supplied scope/expected hashes; never write directly. Content is full UTF-8 text or null for deletion, blocked requires edits:[]. Default 64KiB response limit applies; --input-limit may explicitly raise transport to 4MiB, while protected text proposal limits remain 1MiB. Drift or failed writes retain the original unknown boundary; no automatic retry/rollback or protection-mode switching on resume.\n');
|
|
20
23
|
if(argv.length===1&&['--help','-h'].includes(argv[0]))output.write('completion_evidence is read-only and available only after the original finish has completed and current evidence still validates. It returns the selected attempt, original reviewed package, handoff/review digests, completion event IDs and optional qaSource from the original owner. It does not complete or resume a parent task; JSON evidence alone is not authority.\n');
|
|
21
24
|
if(argv.length===1&&['--help','-h'].includes(argv[0]))output.write('recover_final_review requires --allow-final-review-recovery and exact latest invocationId/packageDigest, previousInvocationStopped:true, and a nonempty reason. The legacy first continuation remains once-only. A further continuation additionally requires a fresh startup --final-review-recovery-invocation ID matching the latest unknown invocation, authorizing exactly one new call. Confirm the previous process stopped; this is a trusted host acknowledgment, not an automatic liveness check. Preparation dispatches nothing. Later final_review requires recovery permission and --allow-final-review; additional cycles require the same invocation binding after restart. Old records, task attempt, reviewed package and the original Review/N5/finish remain unchanged. No automatic retry, cancelled/complete-verdict recovery, missing-thread recovery, business-revision recovery or source-drift bypass. status adds a read-only progress projection, not authorization or current-source verification.\n');
|
|
25
|
+
if(argv.length===1&&['--help','-h'].includes(argv[0]))output.write('rediagnose requires --allow-rediagnosis, the original resumed run at rediagnosis_required and a nonempty single-line reason up to 1000 UTF-8 bytes. It appends one history-bound diagnosis without repeating reproduction or overwriting cause-r1. A fresh cause review must publish cause-r2 even for a revised single-layer cause. Second rejection reaches rediagnosis_review_limit_reached. Interrupted rediagnosis or its review is not automatically retried or abandoned. Standalone only.\n');
|
|
22
26
|
if(argv.length===1&&['--help','-h'].includes(argv[0]))output.write('abandon_step requires --allow-abandon, stage unknown, an eligible local pending kind, and a nonempty single-line reason up to 1000 UTF-8 bytes. It records the abandoned intent and returns to the required stage; a later separate action redoes the step. At most eight abandonments per run. Review, Learning writeback and handoff remain unavailable.\n');
|
|
23
27
|
if(argv.length===1&&['--help','-h'].includes(argv[0]))output.write('abandon_review requires its own --allow-abandon-review flag (not --allow-abandon) and the same reason rules. Each run may abandon the cause review once and the second-round final review once, only while that registered review has no review result (interrupted, timed out, disconnected or cancelled); confirm the old reviewer stopped first. It records the abandoned invocation and returns to the review stage; the retry needs the original review flag, a fresh grant and a new reviewer thread. Reviews wait for the review configuration timeoutMs (default 900000), not the reproduction timeout.\n');
|
|
24
28
|
if(argv.length===1&&['--help','-h'].includes(argv[0]))output.write('N6 child configuration may include qaSource {feature, identity, packageDigest, testRunId, handoffDigest}; derive the separate fixed child identity with qaFixIdentity. It requires --allow-qa-fix in addition to existing action flags. Close the parent host first: the original specs-wide owner lock is shared. Creation/resume rechecks the current failed round, project, report and policy; the source is bound to the original fix configuration. This does not resume the parent or automatically rerun QA, and does not authorize provider calls, installation or Git.\n');
|
|
@@ -32,8 +36,8 @@ export async function main(argv=process.argv.slice(2),{input=process.stdin,outpu
|
|
|
32
36
|
need(['create','resume'].includes(argv[4]),'invalid_arguments');id(argv[6]);
|
|
33
37
|
const extra=new Map();
|
|
34
38
|
for(let index=8;index<argv.length;index++){
|
|
35
|
-
const flag=argv[index];need(!extra.has(flag)&&['--runtime','--input-limit','--review-config','--original-host-context','--final-review-recovery-invocation','--allow-qa-fix','--allow-cause-review','--allow-final-review','--allow-final-review-recovery','--allow-abandon','--allow-abandon-review','--allow-red-test','--allow-baseline','--allow-test-author','--allow-repair','--allow-regression','--allow-learning-writeback','--allow-walkthrough','--allow-finish'].includes(flag),'invalid_arguments');
|
|
36
|
-
if(flag.startsWith('--allow-'))extra.set(flag,true);
|
|
39
|
+
const flag=argv[index];need(!extra.has(flag)&&['--execution-optimizations','--external-models','--external-models-config','--runtime','--input-limit','--review-config','--original-host-context','--final-review-recovery-invocation','--allow-qa-fix','--allow-rediagnosis','--allow-cause-review','--allow-final-review','--allow-final-review-recovery','--allow-abandon','--allow-abandon-review','--allow-red-test','--allow-baseline','--allow-test-author','--allow-repair','--allow-regression','--allow-learning-writeback','--allow-walkthrough','--allow-finish'].includes(flag),'invalid_arguments');
|
|
40
|
+
if(flag.startsWith('--allow-')||flag==='--external-models'||flag==='--execution-optimizations')extra.set(flag,true);
|
|
37
41
|
else{need(typeof argv[index+1]==='string'&&!argv[index+1].startsWith('--'),'invalid_arguments');extra.set(flag,argv[++index]);}
|
|
38
42
|
}
|
|
39
43
|
// A run created in an earlier session keeps that session in its durable record.
|
|
@@ -46,10 +50,7 @@ export async function main(argv=process.argv.slice(2),{input=process.stdin,outpu
|
|
|
46
50
|
const runtime=extra.get('--runtime')??'codex';need(['codex','claude'].includes(runtime),'invalid_runtime');
|
|
47
51
|
// Transport only, like the cm-ai hosts: lines and tool replies share one limit.
|
|
48
52
|
const inputLimit=parseHostInputLimit(extra.get('--input-limit'));
|
|
49
|
-
|
|
50
|
-
need(runtime!=='claude'||!review||review.disabledSkills.length===0,'invalid_review_config');
|
|
51
|
-
need(!extra.has('--allow-cause-review')||review!==null,'review_configuration_required');
|
|
52
|
-
need(!extra.has('--allow-final-review')||review!==null,'review_configuration_required');
|
|
53
|
+
let review;
|
|
53
54
|
const stat=fs.lstatSync(argv[2]);
|
|
54
55
|
need(stat.isFile()&&!stat.isSymbolicLink()&&stat.size<=64*1024,'invalid_fix_config');
|
|
55
56
|
const config=json(JSON.parse(fs.readFileSync(argv[2],'utf8')),64*1024);
|
|
@@ -58,6 +59,12 @@ export async function main(argv=process.argv.slice(2),{input=process.stdin,outpu
|
|
|
58
59
|
...(Object.hasOwn(config,'qaSource')?['qaSource']:[]),
|
|
59
60
|
...(Object.hasOwn(config,'redTest')?['redTest']:[]),...(Object.hasOwn(config,'baseline')?['baseline']:[]),
|
|
60
61
|
...(Object.hasOwn(config,'testAuthor')?['testAuthor']:[]),...(Object.hasOwn(config,'repair')?['repair']:[]),...(Object.hasOwn(config,'walkthrough')?['walkthrough']:[])]);
|
|
62
|
+
const executionPolicy=readFixExecutionPolicy({config,mode:argv[4],enabled:extra.has('--execution-optimizations')});
|
|
63
|
+
const externalModels=readFixExternalModels({config,mode:argv[4],enabled:extra.has('--external-models'),inputFile:extra.get('--external-models-config'),runtime});
|
|
64
|
+
review=extra.has('--review-config')?readConversationReviewConfiguration(extra.get('--review-config'),externalModels?.providers[runtime]??null):null;
|
|
65
|
+
need(runtime!=='claude'||!review||review.disabledSkills.length===0,'invalid_review_config');
|
|
66
|
+
need(!extra.has('--allow-cause-review')||review!==null,'review_configuration_required');
|
|
67
|
+
need(!extra.has('--allow-final-review')||review!==null,'review_configuration_required');
|
|
61
68
|
need(!extra.has('--allow-walkthrough')||config.walkthrough,'walkthrough_configuration_required');
|
|
62
69
|
need(!Object.hasOwn(config,'qaSource')||extra.has('--allow-qa-fix'),'qa_fix_authorization_required');
|
|
63
70
|
need(!extra.has('--allow-qa-fix')||Object.hasOwn(config,'qaSource'),'qa_fix_source_required');
|
|
@@ -68,11 +75,11 @@ export async function main(argv=process.argv.slice(2),{input=process.stdin,outpu
|
|
|
68
75
|
need(!extra.has('--allow-regression')||(config.repair&&config.redTest&&config.baseline),'regression_configuration_required');
|
|
69
76
|
const {reviewer,authority,finalAuthority,execution:reviewExecution}=createFixReviewHost({
|
|
70
77
|
codeProject:config.reproduction.cwd,hostContextId:argv[6],runtime,review,
|
|
71
|
-
permissions:[...extra.keys()],workerFactory:reviewWorkerFactory});
|
|
78
|
+
permissions:[...extra.keys()],workerFactory:reviewWorkerFactory,externalModels,executionPolicy,specsDir:config.specsRoot??null});
|
|
72
79
|
bridge=createHostToolBridge({responseLimit:inputLimit});
|
|
73
80
|
owner=openFixExecution({specsRoot:config.specsRoot??null,identity:config.identity,create:argv[4]==='create',
|
|
74
81
|
hostContextId:argv[6],
|
|
75
|
-
configuration:{hostContextId:originalHostContext??argv[6],defect:config.defect,reproduction:config.reproduction,
|
|
82
|
+
configuration:{...(executionPolicy?{executionPolicy}:{}),...(externalModels?{externalModels}:{}),hostContextId:originalHostContext??argv[6],defect:config.defect,reproduction:config.reproduction,
|
|
76
83
|
...(Object.hasOwn(config,'protectSpecs')?{protectSpecs:config.protectSpecs}:{}),
|
|
77
84
|
...(Object.hasOwn(config,'qaSource')?{qaSource:config.qaSource}:{}),
|
|
78
85
|
...(runtime==='claude'?{runtime}:{}),
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
// A project's 运行日志.jsonl only grows. Past 1 MiB, cm-fix read it whole under
|
|
2
|
+
// the review-material limit and every fix run failed at its completion
|
|
3
|
+
// projection, including each later resume (2026-10-07, AI潮
|
|
4
|
+
// api-native-reading-fix-story-return: check_n5 limit_exceeded, then every resume).
|
|
5
|
+
import test from 'node:test';
|
|
6
|
+
import assert from 'node:assert/strict';
|
|
7
|
+
import fs from 'node:fs';
|
|
8
|
+
import os from 'node:os';
|
|
9
|
+
import path from 'node:path';
|
|
10
|
+
import {openFixExecution} from '../runtime/js/cm-fix/execution.mjs';
|
|
11
|
+
import {createFixHost} from '../runtime/js/cm-fix/host.mjs';
|
|
12
|
+
import {createFixReviewHost} from '../runtime/js/cm-fix/host-review.mjs';
|
|
13
|
+
import {eventsAt} from '../runtime/js/cm-fix/finish.mjs';
|
|
14
|
+
import {configFingerprint} from '../runtime/js/cm-ai/codex-config.mjs';
|
|
15
|
+
import {digest} from '../runtime/js/cm-ai/effect-contract.mjs';
|
|
16
|
+
import {readReviewSourceFiles} from '../runtime/js/cm-ai/review-package.mjs';
|
|
17
|
+
|
|
18
|
+
const MiB=1024*1024;
|
|
19
|
+
// Valid rows of other runs and workflows, as a long-lived project accumulates.
|
|
20
|
+
function growLog(file,bytes){
|
|
21
|
+
const filler='x'.repeat(900);let written=0,index=0;
|
|
22
|
+
const lines=[];
|
|
23
|
+
while(written<bytes){
|
|
24
|
+
const line=JSON.stringify({schema_version:1,workflow:index%2?'cm-ai':'cm-prd',event:'progress',phase:'start',
|
|
25
|
+
run_id:`other-run-${index}`,at:'2026-10-01T00:00:00Z',detail:filler})+'\n';
|
|
26
|
+
lines.push(line);written+=Buffer.byteLength(line);index++;
|
|
27
|
+
}
|
|
28
|
+
fs.appendFileSync(file,lines.join(''));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
test('cm-fix completes check_n5, post_review_regression, walkthrough and finish with a run log above 1 MiB',{timeout:120000},async t=>{
|
|
32
|
+
const root=fs.realpathSync(fs.mkdtempSync(path.join(os.tmpdir(),'cm-fix-large-log-')));
|
|
33
|
+
const cwd=path.join(root,'code'),specsRoot=path.join(root,'specs');fs.mkdirSync(cwd);fs.mkdirSync(specsRoot);
|
|
34
|
+
const logHome=process.env.CM_WORKFLOW_LOG_HOME;process.env.CM_WORKFLOW_LOG_HOME=path.join(root,'mirror');
|
|
35
|
+
t.after(()=>{if(logHome===undefined)delete process.env.CM_WORKFLOW_LOG_HOME;else process.env.CM_WORKFLOW_LOG_HOME=logHome;
|
|
36
|
+
fs.rmSync(root,{recursive:true,force:true});});
|
|
37
|
+
fs.writeFileSync(path.join(cwd,'value.mjs'),'export const value=1;');
|
|
38
|
+
fs.writeFileSync(path.join(cwd,'red.mjs'),"import {value} from './value.mjs';if(value!==2){console.error('BUG');process.exit(1)}");
|
|
39
|
+
fs.writeFileSync(path.join(cwd,'existing.mjs'),"import {value} from './value.mjs';if(typeof value!=='number')process.exit(1)");
|
|
40
|
+
fs.writeFileSync(path.join(cwd,'.cm-workflow.json'),JSON.stringify({version:1,policies:{delivery:'diff'}}));
|
|
41
|
+
const config={identity:{repositoryId:'fixture',runId:'large-log',taskId:'T-FIX-large-log',attempt:1},defect:'Wrong value',
|
|
42
|
+
reproduction:{cwd,command:[process.execPath,'red.mjs'],expectedFailure:{exitCode:1,outputIncludes:'BUG'},timeoutMs:2000},
|
|
43
|
+
redTest:{cwd,testFiles:['red.mjs'],command:[process.execPath,'red.mjs'],expectedFailure:{exitCode:1,outputIncludes:'BUG'},timeoutMs:2000},
|
|
44
|
+
baseline:{cwd,testFiles:['existing.mjs'],commands:[{id:'existing',command:[process.execPath,'existing.mjs']}],timeoutMs:2000},
|
|
45
|
+
repair:{scope:['value.mjs'],requirements:['value.mjs']},
|
|
46
|
+
walkthrough:{timeoutMs:2000,flows:[{id:'value',modules:['value'],steps:['Read value'],expected:['value is 2'],kind:'commands',command:[process.execPath,'red.mjs']}]}};
|
|
47
|
+
const permissions=['--allow-reproduction','--allow-red-test','--allow-baseline','--allow-repair','--allow-regression','--allow-final-review','--allow-walkthrough','--allow-finish'];
|
|
48
|
+
const model='synthetic',review={model,disabledSkills:[],preflight:{passed:true,cli_model:model,prompt_transport:'stdin',config_fingerprint:configFingerprint({cwd,model,disabledSkills:[]})}};
|
|
49
|
+
let calls=0;
|
|
50
|
+
const workerFactory=()=>async({prompt},{onEvent})=>{
|
|
51
|
+
calls++;const data=JSON.parse(prompt.split('<cm-review-data-json>\n')[1]);
|
|
52
|
+
onEvent({event:'thread.started',provider_thread:`thread-${calls}`});
|
|
53
|
+
for(const event of [{event:'turn.started',item_type:null},{event:'item.completed',item_type:'agent_message'},
|
|
54
|
+
{event:'turn.completed',item_type:null},{event:'process_closed',exit_code:0,signal:null,timed_out:false}])onEvent(event);
|
|
55
|
+
return {status:'succeeded',value:{verdict:'approved',packageDigest:data.reviewPackage.packageDigest,examinedPaths:data.examinedPaths,findings:[],summary:'Synthetic'}};
|
|
56
|
+
};
|
|
57
|
+
const reviewHost=createFixReviewHost({codeProject:cwd,hostContextId:'fixture-host',review,permissions,workerFactory});
|
|
58
|
+
const configuration={hostContextId:'fixture-host',...config,causeReview:reviewHost.reviewer};delete configuration.identity;
|
|
59
|
+
const learning={contextDigest:digest([]),files:[],application:{contextDigest:digest([]),status:'no_relevant_lesson',summary:'No fixture instructions'}};
|
|
60
|
+
const bridge={async call(kind){
|
|
61
|
+
if(kind==='fix_diagnose')return {status:'diagnosed',rootCause:'Wrong value',plan:'Correct value',affectedPaths:['value.mjs'],affectedModules:['value'],crossLayer:false,investigation:{discardedAlternatives:[],boundaryAnalysis:null}};
|
|
62
|
+
if(kind==='fix_repair'){fs.writeFileSync(path.join(cwd,'value.mjs'),'export const value=2;');return {outcome:'repaired'};}
|
|
63
|
+
if(kind==='fix_retrospective')return {status:'no_new_lesson',candidates:[],reason:null};
|
|
64
|
+
throw Error(kind);
|
|
65
|
+
}};
|
|
66
|
+
const options={specsRoot,identity:config.identity,configuration,create:true};
|
|
67
|
+
const execution={...reviewHost.execution,bridge,prepare:async()=>learning};
|
|
68
|
+
let owner=openFixExecution(options,execution);t.after(()=>owner.close());
|
|
69
|
+
const hostFor=current=>createFixHost({owner:current,config:{...config,specsRoot},permissions,authority:reviewHost.authority,finalAuthority:reviewHost.finalAuthority});
|
|
70
|
+
let host=hostFor(owner);
|
|
71
|
+
const run=async operation=>{const result=await host.handle({requestId:operation,operation});assert(!result?.error,`${operation}: ${JSON.stringify(result)}`);return result;};
|
|
72
|
+
for(const operation of ['advance','red_test','baseline','repair','regression','retrospective','handoff','final_review','publish_review'])await run(operation);
|
|
73
|
+
const log=path.join(specsRoot,'运行日志.jsonl');
|
|
74
|
+
growLog(log,MiB+256*1024);
|
|
75
|
+
assert(fs.statSync(log).size>MiB);
|
|
76
|
+
// The old whole-file read: exactly the limit this run would have hit.
|
|
77
|
+
assert.throws(()=>readReviewSourceFiles(specsRoot,['运行日志.jsonl']),{code:'limit_exceeded'});
|
|
78
|
+
const ownRows=eventsAt(specsRoot).filter(row=>row.run_id===config.identity.runId);
|
|
79
|
+
assert(ownRows.length>0&&eventsAt(specsRoot).every(row=>row.workflow==='cm-fix'));
|
|
80
|
+
await run('check_n5');
|
|
81
|
+
// A resume opens the owner and projects completion from the log again.
|
|
82
|
+
owner.close();owner=openFixExecution({...options,create:false},execution);host=hostFor(owner);
|
|
83
|
+
for(const operation of ['post_review_regression','walkthrough'])await run(operation);
|
|
84
|
+
growLog(log,64*1024);
|
|
85
|
+
const finished=await run('finish');
|
|
86
|
+
assert.equal(finished.stage??finished.result?.stage,'completed',JSON.stringify(finished));
|
|
87
|
+
owner.close();owner=openFixExecution({...options,create:false},execution);
|
|
88
|
+
assert.equal(owner.status().stage,'completed');
|
|
89
|
+
// Completion still binds this run only: the dossier row and the completion events are its own.
|
|
90
|
+
const done=eventsAt(specsRoot).filter(row=>row.run_id===config.identity.runId&&['task_done','run_done'].includes(row.event));
|
|
91
|
+
assert.deepEqual(done.map(row=>row.event),['task_done','run_done']);
|
|
92
|
+
assert(calls>=1);
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
test('the streamed log reader keeps the single-link, no-symlink and plain-JSON guarantees of the old reader',async t=>{
|
|
96
|
+
const {readStableLogRows}=await import('../runtime/js/cm-ai/log-rows.mjs');
|
|
97
|
+
const root=fs.realpathSync(fs.mkdtempSync(path.join(os.tmpdir(),'cm-stable-log-')));t.after(()=>fs.rmSync(root,{recursive:true,force:true}));
|
|
98
|
+
const log=path.join(root,'运行日志.jsonl');
|
|
99
|
+
// An accepted historical row of another workflow nested deeper than the host
|
|
100
|
+
// object normalizer allows (40): it must not block a cm-fix read.
|
|
101
|
+
let deep={};for(let index=0;index<60;index++)deep={nested:deep};
|
|
102
|
+
fs.writeFileSync(log,[{workflow:'cm-prd',run_id:'other',data:deep},{workflow:'cm-fix',run_id:'mine',n:1},{workflow:'cm-fix',run_id:'mine',n:2}]
|
|
103
|
+
.map(row=>JSON.stringify(row)).join('\n')+'\n\n');
|
|
104
|
+
const pick=row=>row.workflow==='cm-fix';
|
|
105
|
+
assert.deepEqual(readStableLogRows(log,pick,'fix_log_failed').map(row=>row.n),[1,2]);
|
|
106
|
+
const link=path.join(root,'hard.jsonl');fs.linkSync(log,link);
|
|
107
|
+
assert.throws(()=>readStableLogRows(log,pick,'fix_log_failed'),{code:'fix_log_failed'});
|
|
108
|
+
fs.unlinkSync(link);
|
|
109
|
+
const symlink=path.join(root,'symlink.jsonl');fs.symlinkSync(log,symlink);
|
|
110
|
+
assert.throws(()=>readStableLogRows(symlink,pick,'fix_log_failed'),{code:'fix_log_failed'});
|
|
111
|
+
fs.appendFileSync(log,'{not json\n');
|
|
112
|
+
assert.throws(()=>readStableLogRows(log,pick,'fix_log_failed'),{code:'fix_log_failed'});
|
|
113
|
+
});
|
|
@@ -52,3 +52,15 @@ test('protected test-author response uses native edits and rejects late bytes, w
|
|
|
52
52
|
await assert.rejects(bridge.call('fix_test_author',payload,controller.signal),{code:'cancelled'});
|
|
53
53
|
}finally{fs.rmSync(cwd,{recursive:true,force:true});}
|
|
54
54
|
});
|
|
55
|
+
|
|
56
|
+
// Real protected bridge and native sandbox, not just the file helper.
|
|
57
|
+
test('protected bridge commits a lock-sized text proposal above 64KiB',async()=>{
|
|
58
|
+
const cwd=fs.realpathSync(fs.mkdtempSync(path.join(os.tmpdir(),'cm-edit-large-'))),specsRoot=path.join(cwd,'specs');
|
|
59
|
+
fs.mkdirSync(specsRoot);
|
|
60
|
+
const content=JSON.stringify({lockfileVersion:3,fixture:'x'.repeat(640000)});
|
|
61
|
+
const bridge=protectedFixBridge({cwd,specsRoot,timeoutMs:10000,bridge:{call:async(kind,payload)=>({outcome:'repaired',edits:[{path:'package-lock.json',beforeSha256:payload.expected['package-lock.json'],content}]})}});
|
|
62
|
+
try{
|
|
63
|
+
await bridge.call('fix_repair',{identity:{repositoryId:'test',runId:'large-edits',taskId:'T-FIX-large',attempt:1},codeProject:cwd,scope:['package-lock.json'],instructions:'Synthetic lock.'},new AbortController().signal);
|
|
64
|
+
assert.equal(fs.readFileSync(path.join(cwd,'package-lock.json'),'utf8'),content);
|
|
65
|
+
}finally{fs.rmSync(cwd,{recursive:true,force:true});}
|
|
66
|
+
});
|
|
@@ -0,0 +1,168 @@
|
|
|
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 {openFixExecution} from '../runtime/js/cm-fix/execution.mjs';
|
|
7
|
+
import {createHostReviewAuthority} from '../runtime/js/cm-ai/host-review-authority.mjs';
|
|
8
|
+
import {createCauseReviewRun} from '../runtime/js/cm-ai/codex-review-adapter.mjs';
|
|
9
|
+
import {createFixHost} from '../runtime/js/cm-fix/host.mjs';
|
|
10
|
+
import {serveCmAiHost} from '../runtime/js/cm-ai/host-session.mjs';
|
|
11
|
+
import {PassThrough,Writable} from 'node:stream';
|
|
12
|
+
import {digest} from '../runtime/js/cm-ai/effect-contract.mjs';
|
|
13
|
+
import {preflight} from './cm-fix-drive.mjs';
|
|
14
|
+
import {spawnSync} from 'node:child_process';
|
|
15
|
+
|
|
16
|
+
async function fixture(t,fn,{secondVerdict='approved',secondThread='fresh-review-2',prepare=null,redTest=false}={}){
|
|
17
|
+
const root=fs.realpathSync(fs.mkdtempSync(path.join(os.tmpdir(),'fix-rediagnosis-')));
|
|
18
|
+
t.after(()=>fs.rmSync(root,{recursive:true,force:true}));
|
|
19
|
+
const code=path.join(root,'code'),specsRoot=path.join(root,'specs');fs.mkdirSync(code);fs.mkdirSync(specsRoot);
|
|
20
|
+
fs.writeFileSync(path.join(code,'value.mjs'),'export const value=1;');
|
|
21
|
+
const identity={repositoryId:'fixture',runId:'rediagnosis-run',taskId:'T-FIX-rediagnosis',attempt:1};
|
|
22
|
+
const reviewer={reviewerId:'cause-reviewer',adapterId:'codex-review-adapter',provider:'codex',requestedModel:'synthetic',contextId:'independent-review',excludedThreadIds:[]};
|
|
23
|
+
const options={specsRoot,identity,create:true,configuration:{hostContextId:'fixture-host',defect:'Fixture mismatch',causeReview:reviewer,
|
|
24
|
+
reproduction:{cwd:code,command:[process.execPath,'-e',"require('node:fs').appendFileSync('visits','1');process.stderr.write('BUG');process.exit(3)"],expectedFailure:{exitCode:3,outputIncludes:'BUG'},timeoutMs:1000}}};
|
|
25
|
+
if(redTest)options.configuration.redTest={...options.configuration.reproduction,testFiles:['value.mjs']};
|
|
26
|
+
const authority=createHostReviewAuthority({hostContextId:'fixture-host',reviewerId:reviewer.reviewerId,adapterId:reviewer.adapterId,decide:async()=>({status:'approved'})});
|
|
27
|
+
let calls=0,diagnoses=0;const diagnosis={status:'diagnosed',rootCause:'Fixture old cause',plan:'Fixture plan',affectedPaths:['value.mjs'],affectedModules:['value'],crossLayer:true};
|
|
28
|
+
const causeReview={authorize:authority.authorize,run:createCauseReviewRun(async({prompt},{onEvent})=>{
|
|
29
|
+
const data=JSON.parse(prompt.split('<cm-review-data-json>\n')[1]);calls++;
|
|
30
|
+
for(const event of [{event:'thread.started',provider_thread:calls===1?'fresh-review-1':secondThread},{event:'turn.started',item_type:null},
|
|
31
|
+
{event:'item.completed',item_type:'agent_message'},{event:'turn.completed',item_type:null},{event:'process_closed',exit_code:0,signal:null,timed_out:false}])assert.equal(onEvent(event),true);
|
|
32
|
+
return {status:'succeeded',value:{verdict:calls===1?'changes_requested':secondVerdict,packageDigest:data.reviewPackage.packageDigest,
|
|
33
|
+
examinedPaths:['value.mjs'],findings:(calls===1||secondVerdict==='changes_requested')?[{id:'F1',severity:'P2',path:'value.mjs',message:'Cause is incomplete',evidence:'Fixture finding'}]:[],summary:'Fixture independent review'}};
|
|
34
|
+
},'codex')};
|
|
35
|
+
const bridge={async call(kind,payload){assert.equal(kind,'fix_diagnose');diagnoses++;
|
|
36
|
+
if(diagnoses>1){assert.equal(payload.reviewFeedback.verdict,'changes_requested');return {...diagnosis,rootCause:'Fixture revised cause',crossLayer:false};}
|
|
37
|
+
return diagnosis;}};
|
|
38
|
+
let owner=openFixExecution(options,{bridge,causeReview,prepare});
|
|
39
|
+
const state=path.join(specsRoot,'.reviews/.execution',identity.runId,'state.json');
|
|
40
|
+
const review=async()=>{const pkg=owner.causeReviewPackage();await authority.hostDecisionProvider.decide({identity,packageDigest:pkg.packageDigest},new AbortController().signal);return owner.reviewCause();};
|
|
41
|
+
const reopen=(overrides={})=>{owner.close();owner=openFixExecution({...options,create:false},{bridge,causeReview,prepare,...overrides});return owner;};
|
|
42
|
+
try{await owner.advance({authorized:true});await review();assert.equal(owner.status().stage,'rediagnosis_required');
|
|
43
|
+
await fn({root,code,specsRoot,identity,options,authority,bridge,causeReview,state,review,reopen,owner:()=>owner,counts:()=>({calls,diagnoses})});
|
|
44
|
+
}finally{owner.close();}
|
|
45
|
+
}
|
|
46
|
+
test('original run rediagnoses after cause rejection, preserves history, and requires fresh independent review',async t=>fixture(t,async f=>{
|
|
47
|
+
const old=JSON.parse(fs.readFileSync(f.state)).records;
|
|
48
|
+
const first=fs.readFileSync(path.join(f.specsRoot,'.reviews/fix-rediagnosis-cause-r1.md'));
|
|
49
|
+
let owner=f.reopen();await assert.rejects(owner.rediagnose({reason:'Address F1'}),{code:'fix_rediagnosis_authorization_required'});
|
|
50
|
+
const host=createFixHost({owner,config:{...f.options.configuration,...f.options},permissions:['--allow-rediagnosis']});
|
|
51
|
+
const input=new PassThrough();let output='';
|
|
52
|
+
const sink=new Writable({write(chunk,encoding,done){output+=chunk;done();}});
|
|
53
|
+
input.end(JSON.stringify({requestId:'redo',operation:'rediagnose',reason:'Address F1'})+'\n');
|
|
54
|
+
await serveCmAiHost({host,input,output:sink});
|
|
55
|
+
const changed=JSON.parse(output).result;
|
|
56
|
+
assert.equal(changed.stage,'cause_review_required');assert.equal(changed.completionEligible,false);
|
|
57
|
+
const next=JSON.parse(fs.readFileSync(f.state)).records;assert.deepEqual(next.slice(0,old.length),old);
|
|
58
|
+
assert.equal(fs.readFileSync(path.join(f.code,'visits'),'utf8'),'1');
|
|
59
|
+
owner=f.reopen();assert.equal(owner.status().stage,'cause_review_required');assert.equal(owner.status().diagnosis.rootCause,'Fixture revised cause');
|
|
60
|
+
assert.equal((await f.review()).stage,'red_test_required');
|
|
61
|
+
assert.deepEqual(fs.readFileSync(path.join(f.specsRoot,'.reviews/fix-rediagnosis-cause-r1.md')),first);
|
|
62
|
+
assert.match(fs.readFileSync(path.join(f.specsRoot,'.reviews/fix-rediagnosis-cause-r2.md'),'utf8'),/round: 2\nverdict: approved/);
|
|
63
|
+
owner=f.reopen();assert.equal(owner.status().stage,'red_test_required');
|
|
64
|
+
await assert.rejects(owner.rediagnose({authorized:true,reason:'Again'}),{code:'fix_rediagnosis_unavailable'});
|
|
65
|
+
assert.deepEqual(f.counts(),{calls:2,diagnoses:2});
|
|
66
|
+
}));
|
|
67
|
+
test('interrupted rediagnosis replays unknown and never repeats original reproduction or diagnosis',async t=>fixture(t,async f=>{
|
|
68
|
+
const before=JSON.parse(fs.readFileSync(f.state)).records;
|
|
69
|
+
f.bridge.call=async()=>{throw Error('Fixture lost result');};
|
|
70
|
+
const result=await f.owner().rediagnose({authorized:true,reason:'Address F1'});
|
|
71
|
+
assert.equal(result.stage,'unknown');assert.equal(result.pending,'rediagnosis');
|
|
72
|
+
const owner=f.reopen();assert.equal(owner.status().pending,'rediagnosis');
|
|
73
|
+
assert.equal((await owner.advance({authorized:true})).stage,'unknown');
|
|
74
|
+
await assert.rejects(owner.rediagnose({authorized:true,reason:'Retry'}),{code:'fix_rediagnosis_unavailable'});
|
|
75
|
+
assert.deepEqual(JSON.parse(fs.readFileSync(f.state)).records.slice(0,before.length),before);
|
|
76
|
+
assert.equal(fs.readFileSync(path.join(f.code,'visits'),'utf8'),'1');
|
|
77
|
+
}));
|
|
78
|
+
for(const failure of ['source','evidence','reason'])test(`rediagnosis refuses ${failure} before registering a new effect`,async t=>fixture(t,async f=>{
|
|
79
|
+
const before=fs.readFileSync(f.state);
|
|
80
|
+
if(failure==='source')fs.writeFileSync(path.join(f.code,'value.mjs'),'export const value=2;');
|
|
81
|
+
if(failure==='evidence')fs.writeFileSync(path.join(f.specsRoot,'.reviews/fix-rediagnosis-cause-r2.md'),'Other evidence');
|
|
82
|
+
await assert.rejects(f.owner().rediagnose({authorized:true,reason:failure==='reason'?'bad\nreason':'Address F1'}),
|
|
83
|
+
{code:failure==='source'?'fix_rediagnosis_source_changed':failure==='evidence'?'fix_rediagnosis_evidence_conflict':'fix_rediagnosis_reason_invalid'});
|
|
84
|
+
assert.deepEqual(fs.readFileSync(f.state),before);
|
|
85
|
+
}));
|
|
86
|
+
|
|
87
|
+
test('a second cause rejection reaches a durable limit without allowing a third diagnosis or review',async t=>fixture(t,async f=>{
|
|
88
|
+
await f.owner().rediagnose({authorized:true,reason:'Address F1'});
|
|
89
|
+
assert.equal((await f.review()).stage,'rediagnosis_review_limit_reached');
|
|
90
|
+
const before=fs.readFileSync(f.state),owner=f.reopen();
|
|
91
|
+
assert.equal(owner.status().stage,'rediagnosis_review_limit_reached');
|
|
92
|
+
await assert.rejects(owner.rediagnose({authorized:true,reason:'Again'}),{code:'fix_rediagnosis_unavailable'});
|
|
93
|
+
await assert.rejects(f.review());
|
|
94
|
+
assert.deepEqual(fs.readFileSync(f.state),before);assert.deepEqual(f.counts(),{calls:2,diagnoses:2});
|
|
95
|
+
},{secondVerdict:'changes_requested'}));
|
|
96
|
+
test('the original reviewer thread cannot be reused as the revised cause review',async t=>fixture(t,async f=>{
|
|
97
|
+
await f.owner().rediagnose({authorized:true,reason:'Address F1'});
|
|
98
|
+
const result=await f.review();assert.notEqual(result.stage,'red_test_required');assert.equal(result.completionEligible,false);
|
|
99
|
+
const owner=f.reopen();assert.notEqual(owner.status().stage,'red_test_required');
|
|
100
|
+
assert.equal(fs.existsSync(path.join(f.specsRoot,'.reviews/fix-rediagnosis-cause-r2.md')),false);
|
|
101
|
+
},{secondThread:'fresh-review-1'}));
|
|
102
|
+
|
|
103
|
+
const learningFor=summary=>{const contextDigest=digest([]);return {contextDigest,files:[],application:{contextDigest,status:'no_relevant_lesson',summary}};};
|
|
104
|
+
test('driver resumes with recorded application after real Learning writeback without an answer file',async t=>{
|
|
105
|
+
const root=fs.realpathSync(fs.mkdtempSync(path.join(os.tmpdir(),'fix-drive-writeback-')));
|
|
106
|
+
t.after(()=>fs.rmSync(root,{recursive:true,force:true}));
|
|
107
|
+
const cwd=path.join(root,'code'),specsRoot=path.join(root,'specs'),answers=path.join(root,'answers');
|
|
108
|
+
for(const dir of [cwd,specsRoot,answers])fs.mkdirSync(dir);
|
|
109
|
+
fs.writeFileSync(path.join(cwd,'value.mjs'),'export const value=1;');
|
|
110
|
+
fs.writeFileSync(path.join(cwd,'red.mjs'),"import {value} from './value.mjs';if(value!==2){console.error('BUG');process.exit(1)}");
|
|
111
|
+
fs.writeFileSync(path.join(cwd,'existing.mjs'),"import {value} from './value.mjs';if(typeof value!=='number')process.exit(1)");
|
|
112
|
+
const identity={repositoryId:'fixture',runId:'writeback-run',taskId:'T-FIX-writeback',attempt:1};
|
|
113
|
+
const reproduction={cwd,command:[process.execPath,'red.mjs'],expectedFailure:{exitCode:1,outputIncludes:'BUG'},timeoutMs:2000};
|
|
114
|
+
const owner=openFixExecution({identity,specsRoot,create:true,configuration:{hostContextId:'fixture-host',defect:'Wrong constant',reproduction,
|
|
115
|
+
redTest:{...reproduction,testFiles:['red.mjs']},baseline:{cwd,testFiles:['existing.mjs'],commands:[{id:'existing',command:[process.execPath,'existing.mjs']}],timeoutMs:2000},
|
|
116
|
+
repair:{scope:['value.mjs'],requirements:['value.mjs']}}},{prepare:async()=>learningFor('Current application'),assertReviewReady(){},bridge:{async call(kind){
|
|
117
|
+
if(kind==='fix_diagnose')return {status:'diagnosed',rootCause:'Wrong constant',affectedPaths:['value.mjs'],affectedModules:['one'],crossLayer:false,plan:'Correct constant'};
|
|
118
|
+
if(kind==='fix_repair'){fs.writeFileSync(path.join(cwd,'value.mjs'),'export const value=2;');return {outcome:'repaired'};}
|
|
119
|
+
if(kind==='fix_retrospective')return {status:'lesson_candidate',candidates:[{classification:'structured',trigger:'Wrong constant',action:'Keep regression check',evidence:['red.mjs']}],reason:null};
|
|
120
|
+
throw Error(kind);
|
|
121
|
+
}}});
|
|
122
|
+
t.after(()=>owner.close());
|
|
123
|
+
await owner.advance({authorized:true});await owner.runRedTest({authorized:true});await owner.captureBaseline({authorized:true});
|
|
124
|
+
await owner.repair({authorized:true});await owner.runRegression({authorized:true});await owner.retrospect();owner.writeLearning({authorized:true});
|
|
125
|
+
assert.equal(owner.status().stage,'handoff_ready');
|
|
126
|
+
const state=path.join(specsRoot,'.reviews/.execution',identity.runId,'state.json'),before=fs.readFileSync(state);
|
|
127
|
+
const rows=JSON.parse(before).records;assert.ok(rows.some(row=>row.id==='fix-learning-writeback-result'&&!row.payload.application));
|
|
128
|
+
const config=path.join(root,'config.json');fs.writeFileSync(config,JSON.stringify({specsRoot,identity,reproduction}));
|
|
129
|
+
const script=`import {preflight} from ${JSON.stringify(new URL('./cm-fix-drive.mjs',import.meta.url).href)};console.log(JSON.stringify(preflight(${JSON.stringify({operation:'post_review_regression',plan:{cwd,mode:'resume'},paths:{config,answers}})}).answers));`;
|
|
130
|
+
const result=spawnSync(process.execPath,['--input-type=module','-e',script],{encoding:'utf8'});
|
|
131
|
+
assert.equal(result.status,0,result.stderr);
|
|
132
|
+
assert.deepEqual(JSON.parse(result.stdout).learning,owner.status().learning.application);
|
|
133
|
+
assert.equal(fs.existsSync(path.join(answers,'learning.json')),false);
|
|
134
|
+
assert.deepEqual(fs.readFileSync(state),before);
|
|
135
|
+
});
|
|
136
|
+
test('driver continuation after revised cause approval uses current Learning and reaches the real red gate',async t=>fixture(t,async f=>{
|
|
137
|
+
let owner=f.reopen({prepare:async()=>learningFor('Revised application after F1')});
|
|
138
|
+
await owner.rediagnose({authorized:true,reason:'Address F1'});await f.review();
|
|
139
|
+
assert.equal(owner.status().stage,'red_test_required');
|
|
140
|
+
const config=path.join(f.root,'driver-config.json'),answers=path.join(f.root,'answers');fs.mkdirSync(answers);
|
|
141
|
+
fs.writeFileSync(config,JSON.stringify({specsRoot:f.specsRoot,identity:f.identity,reproduction:f.options.configuration.reproduction}));
|
|
142
|
+
const selected=preflight({operation:'red_test',plan:{cwd:f.code,mode:'resume'},paths:{config,answers}});
|
|
143
|
+
assert.equal(selected.answers.learning.summary,owner.status().learning.application.summary);
|
|
144
|
+
owner=f.reopen({prepare:async()=>learningFor(selected.answers.learning.summary)});
|
|
145
|
+
assert.equal((await owner.runRedTest({authorized:true})).stage,'baseline_required');
|
|
146
|
+
assert.equal(fs.readFileSync(path.join(f.code,'visits'),'utf8'),'11');
|
|
147
|
+
},{prepare:async()=>learningFor('Original application'),redTest:true}));
|
|
148
|
+
for(const failure of ['source','evidence','symlink'])test(`rediagnosis rechecks ${failure} after awaited preparation and preserves its continuation`,async t=>fixture(t,async f=>{
|
|
149
|
+
const before=fs.readFileSync(f.state),r1=fs.readFileSync(path.join(f.specsRoot,'.reviews/fix-rediagnosis-cause-r1.md'));
|
|
150
|
+
const owner=f.reopen({prepare:async()=>{
|
|
151
|
+
await Promise.resolve();
|
|
152
|
+
if(failure==='source')fs.writeFileSync(path.join(f.code,'value.mjs'),'export const value=999;');
|
|
153
|
+
else if(failure==='symlink')fs.symlinkSync('missing-review',path.join(f.specsRoot,'.reviews/fix-rediagnosis-cause-r2.md'));
|
|
154
|
+
else fs.writeFileSync(path.join(f.specsRoot,'.reviews/fix-rediagnosis-cause-r2.md'),'Occupied during preparation');
|
|
155
|
+
return learningFor('Fresh application');
|
|
156
|
+
}});
|
|
157
|
+
await assert.rejects(owner.rediagnose({authorized:true,reason:'Address F1'}),
|
|
158
|
+
{code:failure==='source'?'fix_rediagnosis_source_changed':'fix_rediagnosis_evidence_conflict'});
|
|
159
|
+
assert.deepEqual(fs.readFileSync(f.state),before);assert.equal(owner.status().stage,'rediagnosis_required');
|
|
160
|
+
assert.deepEqual(fs.readFileSync(path.join(f.specsRoot,'.reviews/fix-rediagnosis-cause-r1.md')),r1);
|
|
161
|
+
assert.equal(fs.readFileSync(path.join(f.code,'visits'),'utf8'),'1');
|
|
162
|
+
assert.deepEqual(f.counts(),{calls:1,diagnoses:1});
|
|
163
|
+
if(failure==='source')fs.writeFileSync(path.join(f.code,'value.mjs'),'export const value=1;');
|
|
164
|
+
else fs.unlinkSync(path.join(f.specsRoot,'.reviews/fix-rediagnosis-cause-r2.md'));
|
|
165
|
+
const retry=f.reopen({prepare:async()=>learningFor('Fresh application')});
|
|
166
|
+
assert.equal((await retry.rediagnose({authorized:true,reason:'Address F1 after conflict cleared'})).stage,'cause_review_required');
|
|
167
|
+
assert.deepEqual(f.counts(),{calls:1,diagnoses:2});
|
|
168
|
+
}));
|
|
@@ -12,6 +12,7 @@ import {createHostReviewAuthority} from '../runtime/js/cm-ai/host-review-authori
|
|
|
12
12
|
import {createCauseReviewRun} from '../runtime/js/cm-ai/codex-review-adapter.mjs';
|
|
13
13
|
import {createFixReviewHost} from '../runtime/js/cm-fix/host-review.mjs';
|
|
14
14
|
import {configFingerprint} from '../runtime/js/cm-ai/codex-config.mjs';
|
|
15
|
+
import {EXECUTION_POLICY_V1} from '../runtime/js/cm-ai/execution-policy.mjs';
|
|
15
16
|
import {buildCmAiDriveRequest} from './cm-ai-drive.mjs';
|
|
16
17
|
|
|
17
18
|
const isolated=fs.mkdtempSync(path.join(os.tmpdir(),'cm-fix-review-budget-'));
|
|
@@ -122,7 +123,7 @@ test('#15 the shipped review host hands its review budget to the owner and the r
|
|
|
122
123
|
const review=timeoutMs=>({model:'synthetic',disabledSkills:[],...(timeoutMs?{timeoutMs}:{}),preflight:{passed:true,cli_model:'synthetic',prompt_transport:'stdin',
|
|
123
124
|
config_fingerprint:configFingerprint({cwd:codeProject,model:'synthetic',disabledSkills:[],promptTransport:'stdin'})}});
|
|
124
125
|
const seen=[];
|
|
125
|
-
const host=timeoutMs=>createFixReviewHost({codeProject,hostContextId:'host',review:review(timeoutMs),permissions:['--allow-cause-review'],
|
|
126
|
+
const host=(timeoutMs,executionPolicy=null)=>createFixReviewHost({codeProject,hostContextId:'host',review:review(timeoutMs),executionPolicy,permissions:['--allow-cause-review'],
|
|
126
127
|
workerFactory:options=>{seen.push(options.timeoutMs);return async()=>({status:'failed',code:'unused'});}});
|
|
127
128
|
const configured=host(1234).execution;
|
|
128
129
|
assert.equal(configured.causeReview.timeoutMs,1234);assert.equal(configured.finalReview.timeoutMs,1234);
|
|
@@ -131,6 +132,11 @@ test('#15 the shipped review host hands its review budget to the owner and the r
|
|
|
131
132
|
// The worker is built with the budget before the adapter validates the request.
|
|
132
133
|
assert.throws(()=>configured.causeReview.run({},{signal:new AbortController().signal,onEvent:()=>true}),{code:'invalid_input'});
|
|
133
134
|
assert.deepEqual(seen,[1234]);
|
|
135
|
+
const optimized=host(1234,EXECUTION_POLICY_V1).execution;
|
|
136
|
+
assert.throws(()=>optimized.causeReview.run({},{signal:new AbortController().signal,onEvent:()=>true}),{code:'invalid_input'});
|
|
137
|
+
assert.throws(()=>optimized.finalReview.run({},{signal:new AbortController().signal,onEvent:()=>true}),{code:'invalid_input'});
|
|
138
|
+
assert.deepEqual(seen,[1234,1234,1234]);
|
|
139
|
+
assert.equal(fs.existsSync(path.join(isolated,'logs')),false);
|
|
134
140
|
});
|
|
135
141
|
|
|
136
142
|
test('#15 the cm-ai driver forwards the QA-fix abandon_review reason inside fix_action',()=>{
|