@aibyzero/cm-workflow 0.17.1 → 0.18.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/AGENTS.md +23 -0
- package/CHANGELOG.md +224 -0
- package/README.md +14 -3
- package/THIRD_PARTY_NOTICES.md +13 -0
- package/VERSION +1 -1
- package/compat/claude-commands/cm-challenge.md +3 -0
- package/docs/architecture.md +11 -0
- package/docs/cm-control-policy-v2.md +127 -9
- package/docs/installation.md +310 -4
- package/docs/js-workflow-control.md +150 -15
- package/docs/live-evidence-drivers.md +28 -4
- package/docs/out-of-scope/README.md +25 -0
- package/docs/out-of-scope/background-supervisor.md +32 -0
- package/docs/reviewed-integration.md +48 -0
- package/docs/user-guide.md +50 -21
- package/install-codex.sh +331 -18
- package/install.ps1 +28 -2
- package/install.sh +321 -17
- package/package.json +2 -1
- package/runtime/js/cm-ai/batch-location.mjs +55 -0
- package/runtime/js/cm-ai/batch-plan.mjs +242 -0
- package/runtime/js/cm-ai/checkpoint-package-material.mjs +162 -0
- package/runtime/js/cm-ai/claude-developer-proposal.schema.json +55 -1
- package/runtime/js/cm-ai/claude-review-stream.mjs +83 -14
- package/runtime/js/cm-ai/claude-tool-preview.mjs +11 -9
- package/runtime/js/cm-ai/cm-ai-admission.mjs +18 -12
- package/runtime/js/cm-ai/cm-ai-conversation-entry.mjs +91 -6
- package/runtime/js/cm-ai/cm-ai-qa-log.mjs +5 -1
- package/runtime/js/cm-ai/codex-config.mjs +6 -2
- package/runtime/js/cm-ai/codex-developer-basic-output.schema.json +3 -2
- package/runtime/js/cm-ai/codex-developer-output.schema.json +2 -1
- package/runtime/js/cm-ai/codex-reconnect-notice.mjs +6 -0
- package/runtime/js/cm-ai/codex-review-adapter.mjs +27 -7
- package/runtime/js/cm-ai/control-policy.mjs +21 -4
- package/runtime/js/cm-ai/developer-adapter.mjs +19 -5
- package/runtime/js/cm-ai/drive-core.mjs +114 -11
- package/runtime/js/cm-ai/drive-rate-limit.mjs +105 -0
- package/runtime/js/cm-ai/durable-runner-state.mjs +234 -33
- package/runtime/js/cm-ai/effect-contract.mjs +11 -2
- package/runtime/js/cm-ai/execution-policy.mjs +3 -1
- package/runtime/js/cm-ai/execution-snapshot.mjs +4 -2
- package/runtime/js/cm-ai/execution-store-limits.mjs +14 -7
- package/runtime/js/cm-ai/execution-store.mjs +60 -17
- package/runtime/js/cm-ai/fix-code-association.mjs +73 -2
- package/runtime/js/cm-ai/host-check.mjs +11 -5
- package/runtime/js/cm-ai/host-conversation-execution.mjs +70 -28
- package/runtime/js/cm-ai/host-qa-executor.mjs +38 -5
- package/runtime/js/cm-ai/host-qa-fix-owner.mjs +2 -2
- package/runtime/js/cm-ai/host-qa-policy.mjs +19 -2
- package/runtime/js/cm-ai/host-replay.mjs +148 -0
- package/runtime/js/cm-ai/host-session.mjs +1 -1
- package/runtime/js/cm-ai/host-workflow-capabilities.mjs +19 -2
- package/runtime/js/cm-ai/host.mjs +1 -1
- package/runtime/js/cm-ai/implicit-qa-decision.mjs +5 -0
- package/runtime/js/cm-ai/integration-snapshots.mjs +50 -0
- package/runtime/js/cm-ai/live-evidence.mjs +28 -6
- package/runtime/js/cm-ai/operator-guidance.mjs +9 -2
- package/runtime/js/cm-ai/owned-process-cleanup.mjs +27 -9
- package/runtime/js/cm-ai/process-group-exit.mjs +46 -0
- package/runtime/js/cm-ai/provider-review-observation.mjs +3 -2
- package/runtime/js/cm-ai/qa-attachment.mjs +22 -0
- package/runtime/js/cm-ai/qa-config-revision.mjs +7 -2
- package/runtime/js/cm-ai/requirement-evidence.mjs +102 -0
- package/runtime/js/cm-ai/review-package.mjs +79 -7
- package/runtime/js/cm-ai/review-presentation-delta.mjs +166 -0
- package/runtime/js/cm-ai/review-presentation.mjs +177 -8
- package/runtime/js/cm-ai/reviewed-evidence-supersede.mjs +70 -2
- package/runtime/js/cm-ai/reviewed-integration.mjs +260 -0
- package/runtime/js/cm-ai/scope-revision.mjs +38 -0
- package/runtime/js/cm-ai/specification-material.mjs +2 -2
- package/runtime/js/cm-ai/task-runner.mjs +242 -39
- package/runtime/js/cm-ai/verification-auto.mjs +38 -0
- package/runtime/js/cm-ai/worker-claude-developer.mjs +39 -15
- package/runtime/js/cm-ai/worker-claude.mjs +35 -13
- package/runtime/js/cm-ai/worker-codex-developer.mjs +43 -17
- package/runtime/js/cm-ai/worker-codex.mjs +41 -7
- package/runtime/js/cm-fix/cause-invocation.mjs +16 -2
- package/runtime/js/cm-fix/cause-package.mjs +46 -1
- package/runtime/js/cm-fix/command-correction.mjs +37 -0
- package/runtime/js/cm-fix/cooperative.mjs +12 -0
- package/runtime/js/cm-fix/dossier.mjs +8 -2
- package/runtime/js/cm-fix/execution.mjs +578 -100
- package/runtime/js/cm-fix/final-review.mjs +39 -8
- package/runtime/js/cm-fix/finish.mjs +15 -11
- package/runtime/js/cm-fix/host-review.mjs +65 -10
- package/runtime/js/cm-fix/host.mjs +35 -12
- package/runtime/js/cm-fix/jest-command-correction.mjs +69 -0
- package/runtime/js/cm-fix/metrics.mjs +18 -5
- package/runtime/js/cm-fix/regression-evidence.mjs +3 -2
- package/runtime/js/cm-fix/regression.mjs +16 -7
- package/runtime/js/cm-fix/repair.mjs +29 -8
- package/runtime/js/cm-fix/review-verification-command.mjs +135 -0
- package/runtime/js/cm-fix/review-verification-contract.mjs +54 -0
- package/runtime/js/cm-fix/review-verification-diagnostic.mjs +75 -0
- package/runtime/js/cm-fix/review-verification-recovery.mjs +44 -0
- package/runtime/js/cm-fix/review-verification-server.mjs +38 -0
- package/runtime/js/cm-fix/review-verification.mjs +214 -0
- package/runtime/js/cm-fix/source-correction-recovery.mjs +65 -0
- package/runtime/js/cm-fix/start.mjs +6 -3
- package/runtime/js/cm-fix/test-type-correction.mjs +86 -0
- package/runtime/js/cm-fix/test-type-recovery.mjs +51 -0
- package/runtime/js/cm-fix/type-import-correction.mjs +89 -0
- package/runtime/js/cm-prd/accepted-design.mjs +8 -0
- package/runtime/js/cm-prd/analysis.mjs +13 -9
- package/runtime/js/cm-prd/change.mjs +37 -16
- package/runtime/js/cm-prd/draft-save.mjs +13 -6
- package/runtime/js/cm-prd/draft.mjs +31 -3
- package/runtime/js/cm-prd/failed-correction.mjs +19 -3
- package/runtime/js/cm-prd/inputs-replaced.mjs +3 -0
- package/runtime/js/cm-prd/review-correction.mjs +6 -4
- package/runtime/js/cm-prd/review-disposition.mjs +7 -1
- package/runtime/js/cm-prd/self-check-revision.mjs +2 -2
- package/runtime/js/cm-prd/self-check.mjs +125 -6
- package/runtime/js/cm-prd/session.mjs +30 -1
- package/runtime/js/cm-prd/summary.mjs +11 -5
- package/runtime/js/cm-prd/task-scope-record.mjs +97 -0
- package/runtime/js/cm-prd/tree-digest.mjs +34 -0
- package/runtime/js/cm-prd/validation-reason.mjs +8 -4
- package/runtime/js/cm-security/scan.mjs +1 -1
- package/runtime/js/commander/decision.mjs +44 -0
- package/runtime/js/commander/dispatch-registry.mjs +110 -0
- package/runtime/js/commander/ledger.mjs +265 -0
- package/runtime/js/commander/preflight.mjs +107 -0
- package/runtime/js/notify-later.mjs +13 -0
- package/runtime/js/notify-send.mjs +6 -2
- package/runtime/js/notify.mjs +570 -63
- package/runtime/js/review-findings.mjs +38 -0
- package/runtime/js/session-boundary.mjs +56 -0
- package/runtime/js/session-handoff.mjs +68 -0
- package/runtime/js/spec-task-line.mjs +27 -13
- package/runtime/js/specs-status.mjs +1 -1
- package/runtime/js/task-scope.mjs +197 -0
- package/runtime/logging.md +6 -1
- package/runtime/model-efficiency.md +69 -10
- package/runtime/orchestration.md +3 -1
- package/runtime/project-learning.md +2 -0
- package/runtime/review.md +3 -2
- package/runtime/test-contract.md +1 -0
- package/scripts/ci-test-weights.json +3 -0
- package/scripts/cm-ai-admission.mjs +11 -5
- package/scripts/cm-ai-admission.test.mjs +23 -2
- package/scripts/cm-ai-batch-drive.mjs +79 -18
- package/scripts/cm-ai-batch-drive.test.mjs +169 -3
- package/scripts/cm-ai-batch-host.mjs +38 -9
- package/scripts/cm-ai-batch-host.test.mjs +6 -5
- package/scripts/cm-ai-batch-learning-merge.test.mjs +36 -0
- package/scripts/cm-ai-batch-location.test.mjs +57 -0
- package/scripts/cm-ai-batch-plan.mjs +52 -0
- package/scripts/cm-ai-batch-plan.test.mjs +397 -0
- package/scripts/cm-ai-batch-run-fixture.mjs +446 -35
- package/scripts/cm-ai-batch-run-member-stops.test.mjs +16 -0
- package/scripts/cm-ai-batch-run-parallel.test.mjs +28 -1
- package/scripts/cm-ai-batch-run.mjs +471 -57
- package/scripts/cm-ai-batch-run.test.mjs +23 -4
- package/scripts/cm-ai-batch-session-e2e.test.mjs +235 -0
- package/scripts/cm-ai-batch-session-member.test.mjs +293 -0
- package/scripts/cm-ai-batch-session-recovery.test.mjs +423 -0
- package/scripts/cm-ai-check-recheck-cancellation.test.mjs +247 -0
- package/scripts/cm-ai-checklist-coverage.test.mjs +4 -2
- package/scripts/cm-ai-checkpoint-package-material.test.mjs +221 -0
- package/scripts/cm-ai-checkpoint-package-owner.test.mjs +193 -0
- package/scripts/cm-ai-control-launch.test.mjs +21 -0
- package/scripts/cm-ai-control-policy.test.mjs +14 -0
- package/scripts/cm-ai-control-v2-drive.test.mjs +398 -3
- package/scripts/cm-ai-control-v2-supersede-race.mjs +25 -0
- package/scripts/cm-ai-control-v2-supersede.test.mjs +318 -0
- package/scripts/cm-ai-develop-driver-gaps.test.mjs +163 -0
- package/scripts/cm-ai-development-rework.test.mjs +423 -0
- package/scripts/cm-ai-drive.mjs +73 -17
- package/scripts/cm-ai-drive.test.mjs +34 -2
- package/scripts/cm-ai-execution-store-legacy-probe.test.mjs +84 -0
- package/scripts/cm-ai-host.mjs +60 -19
- package/scripts/cm-ai-integration-adoption.test.mjs +223 -0
- package/scripts/cm-ai-integration-independence.test.mjs +23 -0
- package/scripts/cm-ai-integration-launch.test.mjs +240 -0
- package/scripts/cm-ai-integration-preview.mjs +41 -0
- package/scripts/cm-ai-integration-snapshots.test.mjs +197 -0
- package/scripts/cm-ai-nested-execution.test.mjs +29 -1
- package/scripts/cm-ai-operator-guidance.test.mjs +16 -1
- package/scripts/cm-ai-prefinal-delivery.test.mjs +278 -0
- package/scripts/cm-ai-project-qa-gate.test.mjs +56 -0
- package/scripts/cm-ai-qa-fingerprint-config.test.mjs +28 -0
- package/scripts/cm-ai-qa-rerun-timeouts.test.mjs +36 -2
- package/scripts/cm-ai-requirement-evidence.test.mjs +65 -0
- package/scripts/cm-ai-review-failure.test.mjs +150 -5
- package/scripts/cm-ai-run.mjs +88 -21
- package/scripts/cm-ai-scope-revision.test.mjs +341 -0
- package/scripts/cm-ai-spec-rebind.test.mjs +13 -0
- package/scripts/cm-ai-supersede.test.mjs +28 -0
- package/scripts/cm-ai-verification-auto.test.mjs +99 -0
- package/scripts/cm-announce-hook.mjs +35 -8
- package/scripts/cm-announce-hook.test.mjs +25 -0
- package/scripts/cm-challenge.test.mjs +61 -0
- package/scripts/cm-check-drive-files.mjs +1 -1
- package/scripts/cm-check-runtime.sh +58 -1
- package/scripts/cm-claude-developer-worker.test.mjs +56 -7
- package/scripts/cm-claude-install-layout.test.mjs +1 -1
- package/scripts/cm-claude-review-diagnostics.test.mjs +235 -0
- package/scripts/cm-claude-review-stream.test.mjs +13 -0
- package/scripts/cm-codex-developer-reconnect-notice.test.mjs +98 -0
- package/scripts/cm-codex-developer-worker.test.mjs +120 -0
- package/scripts/cm-codex-install-local-edit-guard.test.mjs +436 -0
- package/scripts/cm-codex-prompt-input.test.mjs +153 -0
- package/scripts/cm-codex-reconnect-notice.test.mjs +167 -0
- package/scripts/cm-commander-ledger.test.mjs +260 -0
- package/scripts/cm-commander-p2.test.mjs +295 -0
- package/scripts/cm-commander-preflight.mjs +84 -0
- package/scripts/cm-commander.mjs +116 -0
- package/scripts/cm-config-lock.mjs +35 -0
- package/scripts/cm-controlled-correction.test.mjs +10 -1
- package/scripts/cm-developer-failure-code.test.mjs +62 -0
- package/scripts/cm-display-task-id.test.mjs +41 -0
- package/scripts/cm-efficiency-presentation-delta.test.mjs +218 -0
- package/scripts/cm-execution-snapshot-reuse.test.mjs +115 -0
- package/scripts/cm-external-batch-host.test.mjs +4 -3
- package/scripts/cm-external-process-cleanup.test.mjs +128 -0
- package/scripts/cm-external-qa-fix.test.mjs +89 -7
- package/scripts/cm-external-review-reconciliation.test.mjs +11 -0
- package/scripts/cm-failover.mjs +48 -10
- package/scripts/cm-failover.test.mjs +46 -0
- package/scripts/cm-fix-cause-invocation.test.mjs +19 -4
- package/scripts/cm-fix-command-correction.mjs +17 -0
- package/scripts/cm-fix-command-correction.test.mjs +211 -0
- package/scripts/cm-fix-cooperative-closeout.test.mjs +87 -0
- package/scripts/cm-fix-diagnosis-module-correction.test.mjs +217 -0
- package/scripts/cm-fix-drive.mjs +33 -5
- package/scripts/cm-fix-drive.test.mjs +49 -0
- package/scripts/cm-fix-host-review-assembly.test.mjs +197 -1
- package/scripts/cm-fix-host-review.test.mjs +21 -9
- package/scripts/cm-fix-host.mjs +26 -8
- package/scripts/cm-fix-monorepo-map.test.mjs +92 -0
- package/scripts/cm-fix-observation-task-id.test.mjs +122 -0
- package/scripts/cm-fix-regression-input-budget.test.mjs +111 -0
- package/scripts/cm-fix-repair-input-budget.test.mjs +119 -0
- package/scripts/cm-fix-review-file-paging.test.mjs +91 -0
- package/scripts/cm-fix-review-preflight.mjs +24 -0
- package/scripts/cm-fix-review-storage.test.mjs +233 -0
- package/scripts/cm-fix-review-verification-command.test.mjs +242 -0
- package/scripts/cm-fix-review-verification-evidence.test.mjs +218 -0
- package/scripts/cm-fix-review-verification-integration.test.mjs +81 -0
- package/scripts/cm-fix-review-verification-recovery.test.mjs +198 -0
- package/scripts/cm-fix-review-verification.test.mjs +146 -0
- package/scripts/cm-fix-revision-transport.test.mjs +81 -0
- package/scripts/cm-fix-source-correction.test.mjs +296 -0
- package/scripts/cm-fix-test-type-correction.mjs +18 -0
- package/scripts/cm-fix-test-type-correction.test.mjs +123 -0
- package/scripts/cm-fix-test-type-owner.test.mjs +208 -0
- package/scripts/cm-fix-test-type-verification-cost.test.mjs +66 -0
- package/scripts/cm-fix-type-import-correction.test.mjs +95 -0
- package/scripts/cm-fix-verification-diagnostic.test.mjs +200 -0
- package/scripts/cm-fix-verification-recovery.mjs +33 -0
- package/scripts/cm-host-qa-executor.test.mjs +77 -0
- package/scripts/cm-host-replay.test.mjs +176 -0
- package/scripts/cm-install-local-edit-guard.test.mjs +621 -0
- package/scripts/cm-install-manifest.sh +351 -0
- package/scripts/cm-live-evidence.test.mjs +59 -1
- package/scripts/cm-log-event.mjs +61 -10
- package/scripts/cm-log-event.test.mjs +121 -1
- package/scripts/cm-matt-skills.mjs +576 -0
- package/scripts/cm-matt-skills.test.mjs +550 -0
- package/scripts/cm-notify-command.test.mjs +42 -10
- package/scripts/cm-notify.mjs +14 -10
- package/scripts/cm-notify.test.mjs +575 -59
- package/scripts/cm-patrol.mjs +4 -1
- package/scripts/cm-patrol.test.mjs +23 -5
- package/scripts/cm-prd-answer-gaps.test.mjs +2 -2
- package/scripts/cm-prd-completion.test.mjs +56 -13
- package/scripts/cm-prd-design-phase.test.mjs +78 -8
- package/scripts/cm-prd-draft-save.test.mjs +12 -0
- package/scripts/cm-prd-draft.test.mjs +1 -1
- package/scripts/cm-prd-drive.mjs +13 -6
- package/scripts/cm-prd-drive.test.mjs +45 -1
- package/scripts/cm-prd-gate-diagnostic.test.mjs +2 -2
- package/scripts/cm-prd-host.mjs +10 -5
- package/scripts/cm-prd-host.test.mjs +4 -2
- package/scripts/cm-prd-inputs-replaced.test.mjs +1 -1
- package/scripts/cm-prd-review-disposition.test.mjs +124 -8
- package/scripts/cm-prd-revision.test.mjs +1 -1
- package/scripts/cm-prd-self-check-revision.test.mjs +1 -1
- package/scripts/cm-prd-self-check-rules.test.mjs +239 -0
- package/scripts/cm-prd-self-check.test.mjs +105 -5
- package/scripts/cm-prd-summary.test.mjs +24 -3
- package/scripts/cm-prd-task-grouping.test.mjs +6 -6
- package/scripts/cm-prd-tree-digest.test.mjs +74 -0
- package/scripts/cm-refactor-drive.mjs +2 -1
- package/scripts/cm-refactor-drive.test.mjs +9 -0
- package/scripts/cm-release-smoke.sh +1 -1
- package/scripts/cm-skill-hints-autowire.test.mjs +394 -0
- package/scripts/cm-skill-hints-exam.mjs +149 -0
- package/scripts/cm-skill-hints-install.test.mjs +168 -0
- package/scripts/cm-skill-hints.exam.json +706 -0
- package/scripts/cm-skill-hints.json +119 -0
- package/scripts/cm-skill-hints.mjs +669 -0
- package/scripts/cm-skill-hints.test.mjs +831 -0
- package/scripts/cm-skill-judge.mjs +181 -0
- package/scripts/cm-skill-judge.test.mjs +255 -0
- package/scripts/cm-specs-status.test.mjs +4 -2
- package/scripts/cm-start-check.mjs +208 -0
- package/scripts/cm-start-check.test.mjs +321 -0
- package/scripts/cm-task-gate.mjs +150 -29
- package/scripts/cm-task-gate.test.mjs +73 -1
- package/scripts/cm-task-id-grammar.test.mjs +66 -0
- package/scripts/cm-task-scope.test.mjs +308 -0
- package/scripts/cm-upgrade-compat-batch.test.mjs +172 -0
- package/scripts/cm-upgrade-compat.test.mjs +239 -0
- package/scripts/cm-workflow-config.mjs +12 -2
- package/scripts/fixtures/fix-verification-claude.mjs +44 -0
- package/scripts/fixtures/reviewed-integration.mjs +202 -0
- package/scripts/scan-public-safety.py +1 -0
- package/scripts/session-boundary.test.mjs +170 -0
- package/scripts/test-npm-install.py +14 -3
- package/scripts/test-shell-compat.sh +2 -0
- package/scripts/validate-public-repo.py +1 -0
- package/scripts/validate-test-cases.mjs +3 -2
- package/skills/cm-ai/SKILL.md +5 -2
- package/skills/cm-ai/references/N4-review.md +2 -1
- package/skills/cm-ai/references/N6-qa-eval.md +3 -1
- package/skills/cm-ai/references/N8-finish.md +22 -0
- package/skills/cm-ai/references/js-host-qa-recovery.md +1 -1
- package/skills/cm-ai/references/js-host-recovery.md +79 -3
- package/skills/cm-ai/references/js-host.md +56 -16
- package/skills/cm-challenge/SKILL.md +65 -0
- package/skills/cm-challenge/evals/README.md +18 -0
- package/skills/cm-challenge/evals/trigger-cases.json +20 -0
- package/skills/cm-challenge/evals/trigger-config.json +28 -0
- package/skills/cm-challenge/references/examples.md +15 -0
- package/skills/cm-check/SKILL.md +5 -0
- package/skills/cm-check/references/js-host.md +2 -0
- package/skills/cm-fix/SKILL.md +12 -3
- package/skills/cm-fix/references/command-correction.md +67 -0
- package/skills/cm-fix/references/isolated-review.md +54 -0
- package/skills/cm-fix/references/js-host.md +62 -2
- package/skills/cm-fix/references/test-type-correction.md +72 -0
- package/skills/cm-fix/references/verification-recovery.md +114 -0
- package/skills/cm-idea/SKILL.md +2 -0
- package/skills/cm-idea/references/js-host.md +2 -0
- package/skills/cm-notify/SKILL.md +2 -0
- package/skills/cm-prd/SKILL.md +12 -8
- package/skills/cm-prd/references/brownfield.md +8 -1
- package/skills/cm-prd/references/change-mode.md +6 -0
- package/skills/cm-prd/references/greenfield.md +4 -0
- package/skills/cm-prd/references/js-host.md +4 -2
- package/skills/cm-prd/references/spec-self-check.md +5 -1
- package/skills/cm-refactor/SKILL.md +8 -0
- package/skills/cm-refactor/references/js-host.md +2 -0
- package/skills/cm-test/SKILL.md +4 -0
- package/templates/dashboard/dashboard.html +2 -2
- package/templates/pixel/cm-pixel.html +1 -1
- package/templates/pixel/cm-pixel.sh +1 -1
- package/templates/pixel/dev/template.html +1 -1
- package/templates/statusline/cm-statusline.sh +1 -1
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
// Real owner/driver and local checks; reviewer output is synthetic protocol
|
|
2
|
+
// evidence, never independent review of this implementation. No Codex sandbox.
|
|
3
|
+
import test from 'node:test';
|
|
4
|
+
import assert from 'node:assert/strict';
|
|
5
|
+
import fs from 'node:fs';
|
|
6
|
+
import os from 'node:os';
|
|
7
|
+
import path from 'node:path';
|
|
8
|
+
import {spawn,spawnSync} from 'node:child_process';
|
|
9
|
+
import {fileURLToPath} from 'node:url';
|
|
10
|
+
import {buildManifest} from './cm-spec-manifest.mjs';
|
|
11
|
+
import {configFingerprint} from '../runtime/js/cm-ai/codex-config.mjs';
|
|
12
|
+
import {digest,JOURNAL_PAYLOAD_LIMIT,developCheckpointReserve} from '../runtime/js/cm-ai/effect-contract.mjs';
|
|
13
|
+
import {readRunnerHistory} from '../runtime/js/cm-ai/durable-runner-state.mjs';
|
|
14
|
+
import {reviewPaths} from '../runtime/js/cm-ai/review-runner.mjs';
|
|
15
|
+
import {readRunJournal,developPreview} from './cm-ai-drive.mjs';
|
|
16
|
+
const DRIVER=fileURLToPath(new URL('./cm-ai-drive.mjs',import.meta.url));
|
|
17
|
+
const HOST=fileURLToPath(new URL('./cm-ai-host.mjs',import.meta.url));
|
|
18
|
+
const REVIEWER=fileURLToPath(new URL('./fixtures/codex-review-process.mjs',import.meta.url));
|
|
19
|
+
const developValue={outcome:'implemented',application:{status:'no_relevant_lesson',note:null},
|
|
20
|
+
retrospective:{status:'no_new_lesson',candidates:[],reason:null}};
|
|
21
|
+
const policy={version:2,development:'conversation',bootstrap:'disabled',qa:'disabled',qaFix:'disabled'};
|
|
22
|
+
const size=value=>Buffer.byteLength(JSON.stringify(value??null));
|
|
23
|
+
const CONTENT='//'+'x'.repeat(594000)+'\n';
|
|
24
|
+
function fixture(t,{scope=['target.mjs'],runId='drive-gaps-run',files={}}={}){
|
|
25
|
+
const root=fs.realpathSync(fs.mkdtempSync(path.join(os.tmpdir(),'cm-drive-gaps-')));
|
|
26
|
+
t.after(()=>fs.rmSync(root,{recursive:true,force:true}));
|
|
27
|
+
const specsDir=path.join(root,'specs5'),codeProject=path.join(root,'app'),feature='1.work';
|
|
28
|
+
const identity={repositoryId:'drive-gaps',runId,taskId:'T-001',attempt:1};
|
|
29
|
+
fs.mkdirSync(path.join(specsDir,feature),{recursive:true});fs.mkdirSync(codeProject);
|
|
30
|
+
for(const name of ['requirements.md','design.md'])fs.writeFileSync(path.join(specsDir,feature,name),'# Fixture\n');
|
|
31
|
+
fs.writeFileSync(path.join(specsDir,feature,'tasks.md'),'- [ ] T-001: fixture\n');
|
|
32
|
+
fs.writeFileSync(path.join(specsDir,'.cm-specs-status'),JSON.stringify({status:'approved',features:[feature],specFiles:buildManifest(specsDir)}));
|
|
33
|
+
fs.writeFileSync(path.join(codeProject,'requirements.md'),'# Fixture\n');
|
|
34
|
+
for(const [file,content] of Object.entries(files)){
|
|
35
|
+
fs.mkdirSync(path.dirname(path.join(codeProject,file)),{recursive:true});
|
|
36
|
+
fs.writeFileSync(path.join(codeProject,file),content);fs.chmodSync(path.join(codeProject,file),0o644);
|
|
37
|
+
}
|
|
38
|
+
const config=path.join(root,'run.json');
|
|
39
|
+
fs.writeFileSync(config,JSON.stringify({version:1,specsDir,codeProject,feature,identity,scope,requirements:['requirements.md']}));
|
|
40
|
+
const answers=path.join(root,'answers');fs.mkdirSync(answers);
|
|
41
|
+
// create requires a bound review configuration; reviewer() replaces it with the
|
|
42
|
+
// same model and a real preflight, so the durable fingerprint is unchanged.
|
|
43
|
+
fs.writeFileSync(path.join(root,'review.json'),JSON.stringify({model:'fixture',preflight:{}}));
|
|
44
|
+
const bin=path.join(root,'bin');fs.mkdirSync(bin);
|
|
45
|
+
const env={...process.env,PATH:bin+path.delimiter+process.env.PATH,CM_WORKFLOW_HOME:path.join(root,'home'),
|
|
46
|
+
CM_WORKFLOW_LOG_HOME:path.join(root,'logs')};
|
|
47
|
+
const write=(name,value)=>fs.writeFileSync(path.join(answers,name),JSON.stringify(value));
|
|
48
|
+
const content=(name,bytes)=>fs.writeFileSync(path.join(answers,name),bytes);
|
|
49
|
+
const develop=(edits,name='develop.json')=>write(name,{status:'succeeded',value:developValue,edits});
|
|
50
|
+
const plan=(extra={})=>{const file=path.join(root,`plan-${Math.random().toString(36).slice(2)}.json`);
|
|
51
|
+
const value={config:'run.json',mode:'create',hostContext:'drive-host-a',
|
|
52
|
+
permissions:[],answers:'answers',checks:[{id:'noop',command:[process.execPath,'-e','0']}],...extra};
|
|
53
|
+
if(!value.permissions.includes('--review-config'))value.permissions=[...value.permissions,'--review-config','review.json'];
|
|
54
|
+
fs.writeFileSync(file,JSON.stringify(value));
|
|
55
|
+
return file;};
|
|
56
|
+
const drive=(file,operation,timeout=60000,umask=null)=>umask===null
|
|
57
|
+
?spawnSync(process.execPath,[DRIVER,'--plan',file,operation],{encoding:'utf8',timeout,env})
|
|
58
|
+
:spawnSync('/bin/sh',['-c',`umask ${umask}; exec "$0" "$@"`,process.execPath,DRIVER,'--plan',file,operation],{encoding:'utf8',timeout,env});
|
|
59
|
+
const store=path.join(specsDir,'.reviews','.execution',runId,'state.json');
|
|
60
|
+
const reviewer=verdict=>{
|
|
61
|
+
let fake=fs.readFileSync(REVIEWER,'utf8');
|
|
62
|
+
if(verdict==='changes_requested')fake=fake.replace("verdict:'approved'","verdict:data.reviewPackage.identity.attempt===1?'changes_requested':'approved'")
|
|
63
|
+
.replace('findings:[]',"findings:data.reviewPackage.identity.attempt===1?[{id:'F1',severity:'P2',path:'"+scope[0]+"',message:'Revise',evidence:'Fixture finding'}]:[]");
|
|
64
|
+
fs.writeFileSync(path.join(bin,'codex'),fake,{mode:0o700});
|
|
65
|
+
fs.writeFileSync(path.join(root,'review.json'),JSON.stringify({model:'fixture',preflight:{passed:true,
|
|
66
|
+
cli_model:'fixture',prompt_transport:'stdin',config_fingerprint:configFingerprint({cwd:codeProject,model:'fixture'})}}));
|
|
67
|
+
};
|
|
68
|
+
reviewer('approved');
|
|
69
|
+
return {root,specsDir,codeProject,config,answers,bin,env,identity,write,content,develop,plan,drive,store,reviewer};
|
|
70
|
+
}
|
|
71
|
+
const result=run=>JSON.parse(run.stdout).result;
|
|
72
|
+
const records=f=>JSON.parse(fs.readFileSync(f.store,'utf8')).records;
|
|
73
|
+
|
|
74
|
+
function capacityFixture(t){
|
|
75
|
+
const f=fixture(t,{files:{'target.mjs':'export const value = 1;\n'}});
|
|
76
|
+
fs.writeFileSync(path.join(f.root,'control.json'),JSON.stringify(policy));
|
|
77
|
+
f.content('target.txt',CONTENT);f.develop({'target.mjs':'target.txt'});
|
|
78
|
+
return f;
|
|
79
|
+
}
|
|
80
|
+
// SIGKILL the actual owner after its persisted reply, before host_close. Resume
|
|
81
|
+
// must release the stale writer and replay the same records without redoing work.
|
|
82
|
+
function developAndKill(f,{enabled=true}={}){
|
|
83
|
+
return new Promise((resolve,reject)=>{
|
|
84
|
+
const args=['serve','--config',f.config,'--mode','create','--host-context','drive-host-a',
|
|
85
|
+
...(enabled?['--control-config',path.join(f.root,'control.json')]:['--allow-development']),
|
|
86
|
+
'--review-config',path.join(f.root,'review.json')];
|
|
87
|
+
const child=spawn(process.execPath,[HOST,...args],{env:f.env,stdio:['pipe','pipe','pipe']});
|
|
88
|
+
let buffer='',stderr='',reply=null,failed=null;
|
|
89
|
+
const timer=setTimeout(()=>{failed=new Error('capacity owner timed out');child.kill('SIGKILL');},30000);
|
|
90
|
+
const send=row=>child.stdin.write(JSON.stringify(row)+'\n');
|
|
91
|
+
child.stderr.on('data',chunk=>{stderr+=chunk;});
|
|
92
|
+
child.on('error',error=>{clearTimeout(timer);reject(error);});
|
|
93
|
+
child.stdout.on('data',chunk=>{
|
|
94
|
+
buffer+=chunk;
|
|
95
|
+
try{let index;while((index=buffer.indexOf('\n'))>=0){
|
|
96
|
+
const line=buffer.slice(0,index);buffer=buffer.slice(index+1);if(!line)continue;const row=JSON.parse(line);
|
|
97
|
+
if(row.type==='host_ready')send({version:enabled?2:1,operation:'start',requestId:'capacity',identity:f.identity});
|
|
98
|
+
if(row.type==='host_request'){
|
|
99
|
+
let result;
|
|
100
|
+
if(row.kind==='develop'){fs.writeFileSync(path.join(f.codeProject,'target.mjs'),CONTENT);result={status:'succeeded',value:developValue};}
|
|
101
|
+
else{
|
|
102
|
+
assert.equal(row.kind,'check');
|
|
103
|
+
const command=[process.execPath,'--check',path.join(f.codeProject,'target.mjs')];
|
|
104
|
+
const checked=spawnSync(command[0],command.slice(1),{encoding:'utf8',timeout:3000});assert.equal(checked.status,0,checked.stderr);
|
|
105
|
+
result=[{id:'noop',command,outcome:'passed',exitCode:0,evidence:'Actual isolated syntax check passed'}];
|
|
106
|
+
}
|
|
107
|
+
send({type:'host_result',sessionId:row.sessionId,callId:row.callId,requestDigest:row.requestDigest,result});
|
|
108
|
+
}
|
|
109
|
+
if(row.requestId==='capacity'&&row.result){reply=row.result;child.kill('SIGKILL');}
|
|
110
|
+
}}catch(error){failed=error;child.kill('SIGKILL');}
|
|
111
|
+
});
|
|
112
|
+
child.on('close',(code,signal)=>{clearTimeout(timer);
|
|
113
|
+
if(failed)reject(failed);else if(!reply)reject(new Error('owner exited without reply: '+stderr));
|
|
114
|
+
else {assert.equal(signal,'SIGKILL');resolve(reply);}
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
test('review-capacity: eligible 800 KB-class delivery exceeds inline reserve, survives owner kill, review and completion',async t=>{
|
|
120
|
+
const f=capacityFixture(t),developed=await developAndKill(f);
|
|
121
|
+
t.diagnostic(JSON.stringify({state:developed.state,code:developed.code,reason:developed.reason}));
|
|
122
|
+
assert.equal(developed.state,'awaiting_review',JSON.stringify(developed));
|
|
123
|
+
const developedRows=records(f),material=developedRows.at(-1),checkpoint=material.payload.checkpoint;
|
|
124
|
+
assert.equal(material.payload.packageMaterial,true);
|
|
125
|
+
assert.equal(material.payload.type,'effect-checkpoint');
|
|
126
|
+
const pkg=checkpoint.reviewPackage,fullPackageBytes=JSON.stringify(pkg);
|
|
127
|
+
const reserve=developCheckpointReserve({examinedPathsBytes:size(reviewPaths(pkg)),receiptsBytes:size(checkpoint.receipts),
|
|
128
|
+
callsBytes:size(checkpoint.calls),writebackBytes:size(checkpoint.learningResult?.writeback)});
|
|
129
|
+
assert(size(material.payload)>JOURNAL_PAYLOAD_LIMIT-reserve);
|
|
130
|
+
assert(size(material.payload)<=JOURNAL_PAYLOAD_LIMIT);
|
|
131
|
+
assert.equal(Buffer.from(pkg.changes.find(c=>c.path==='target.mjs').after.contentBase64,'base64').toString(),CONTENT);
|
|
132
|
+
t.diagnostic(JSON.stringify({developBytes:size(material.payload),reserve,budget:JOURNAL_PAYLOAD_LIMIT-reserve}));
|
|
133
|
+
const resume={mode:'resume',controlConfig:'control.json',checks:undefined};
|
|
134
|
+
const status=f.drive(f.plan(resume),'status');assert.equal(status.status,0,status.stderr);
|
|
135
|
+
assert.equal(result(status).state,'awaiting_review');assert.deepEqual(records(f),developedRows);
|
|
136
|
+
const approved=f.drive(f.plan({...resume,packageDigest:developed.packageDigest}),'decision');
|
|
137
|
+
assert.equal(approved.status,0,approved.stderr);assert.equal(result(approved).state,'approved',approved.stdout);
|
|
138
|
+
const completed=f.drive(f.plan({...resume,packageDigest:developed.packageDigest,
|
|
139
|
+
checks:[{id:'noop',command:[process.execPath,'--check',path.join(f.codeProject,'target.mjs')]}]}),'complete');
|
|
140
|
+
assert.equal(completed.status,0,completed.stderr);assert.equal(result(completed).state,'fixture_completed',completed.stdout);
|
|
141
|
+
const completedRows=records(f),refs=completedRows.filter(row=>row.payload.packageRef);
|
|
142
|
+
assert(refs.length>=2);
|
|
143
|
+
for(const row of refs){assert.equal(row.payload.checkpoint.reviewPackage,null);
|
|
144
|
+
assert.deepEqual(row.payload.packageRef,{recordId:material.id,recordDigest:material.digest,packageDigest:pkg.packageDigest});}
|
|
145
|
+
for(const row of completedRows)assert(size(row.payload)<=JOURNAL_PAYLOAD_LIMIT);
|
|
146
|
+
assert.deepEqual(completedRows.slice(0,developedRows.length),developedRows);
|
|
147
|
+
const restored=readRunnerHistory(completedRows,completedRows[0].payload.config,3);
|
|
148
|
+
assert.equal(JSON.stringify(restored.state.reviewPackage),fullPackageBytes);
|
|
149
|
+
const final=f.drive(f.plan(resume),'status');assert.equal(final.status,0,final.stderr);
|
|
150
|
+
assert.equal(result(final).state,'fixture_completed');assert.deepEqual(records(f),completedRows);
|
|
151
|
+
t.diagnostic(JSON.stringify({maxPayloadBytes:Math.max(...completedRows.map(row=>size(row.payload))),referenceCount:refs.length}));
|
|
152
|
+
const damaged=structuredClone(completedRows),row=damaged.findLast(entry=>entry.payload.packageRef);
|
|
153
|
+
row.payload.packageRef.recordDigest='0'.repeat(64);
|
|
154
|
+
for(let i=0;i<damaged.length;i++){const {digest:discard,...body}=damaged[i];body.previousDigest=i?damaged[i-1].digest:null;damaged[i]={...body,digest:digest(body)};}
|
|
155
|
+
assert.throws(()=>readRunnerHistory(damaged,completedRows[0].payload.config,3),{code:'checkpoint_package_material_invalid'});
|
|
156
|
+
// Replay refuses the stored representation for a run that is not eligible. The
|
|
157
|
+
// prefix ends at the material checkpoint, so no later packageRef can fail first.
|
|
158
|
+
const forged=structuredClone(developedRows);forged[0].payload.config.controlPolicy.development='provider';
|
|
159
|
+
for(let i=0;i<forged.length;i++){const {digest:discard,...body}=forged[i];body.previousDigest=i?forged[i-1].digest:null;forged[i]={...body,digest:digest(body)};}
|
|
160
|
+
assert.throws(()=>readRunnerHistory(forged,forged[0].payload.config,3),{code:'checkpoint_package_material_invalid'});
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
test('review-capacity: ineligible legacy run with the identical delivery still blocks develop_package_too_large',async t=>{
|
|
164
|
+
const f=capacityFixture(t),blocked=await developAndKill(f,{enabled:false});
|
|
165
|
+
assert.equal(blocked.state,'blocked');assert.equal(blocked.code,'develop_package_too_large');
|
|
166
|
+
const [,bytes,budget]=/checkpoint would be (\d+) bytes, above (\d+)/.exec(blocked.reason).map(Number);
|
|
167
|
+
assert(bytes>budget&&bytes<=JOURNAL_PAYLOAD_LIMIT);
|
|
168
|
+
assert(records(f).every(row=>!Object.hasOwn(row.payload,'packageMaterial')&&!Object.hasOwn(row.payload,'packageRef')));
|
|
169
|
+
const restored=readRunnerHistory(records(f),records(f)[0].payload.config,3);
|
|
170
|
+
assert.equal(restored.state.code,'develop_package_too_large');
|
|
171
|
+
t.diagnostic(JSON.stringify({bytes,budget,code:blocked.code}));
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
test('review-capacity: resume driver and owner admit the same large eligible delivery',t=>{
|
|
175
|
+
const f=capacityFixture(t);
|
|
176
|
+
const created=f.drive(f.plan({controlConfig:'control.json'}),'status');assert.equal(created.status,0,created.stderr);
|
|
177
|
+
const started=f.drive(f.plan({mode:'resume',controlConfig:'control.json'}),'start');
|
|
178
|
+
assert.equal(started.status,0,started.stderr);assert.equal(result(started).state,'awaiting_review',started.stdout);
|
|
179
|
+
assert.equal(records(f).at(-1).payload.packageMaterial,true);
|
|
180
|
+
// The driver budgets an already archived package as a reference, so its digest
|
|
181
|
+
// must reach the preview from the real journal, not only exist in the store.
|
|
182
|
+
const definition=JSON.parse(fs.readFileSync(f.config,'utf8')),journal=readRunJournal(definition);
|
|
183
|
+
const archived=[records(f).at(-1).payload.checkpoint.reviewPackage.packageDigest];
|
|
184
|
+
assert.equal(journal.packageMaterialEnabled,true);assert.deepEqual(journal.archivedPackageDigests,archived);
|
|
185
|
+
assert.deepEqual(developPreview({definition,journal}).archivedPackageDigests,archived);
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
test('review-capacity: create driver and owner also admit the same eligible delivery without an existing journal',t=>{
|
|
190
|
+
const f=capacityFixture(t),started=f.drive(f.plan({controlConfig:'control.json'}),'start');
|
|
191
|
+
assert.equal(started.status,0,started.stderr);assert.equal(result(started).state,'awaiting_review',started.stdout);
|
|
192
|
+
assert.equal(records(f).at(-1).payload.packageMaterial,true);
|
|
193
|
+
});
|
|
@@ -12,6 +12,7 @@ import {createHostCheck} from '../runtime/js/cm-ai/host-check.mjs';
|
|
|
12
12
|
import {createHostQaExecutor} from '../runtime/js/cm-ai/host-qa-executor.mjs';
|
|
13
13
|
import {readExecutionSnapshot} from '../runtime/js/cm-ai/execution-snapshot.mjs';
|
|
14
14
|
import {configFingerprint} from '../runtime/js/cm-ai/codex-config.mjs';
|
|
15
|
+
import {markImplicitQaDecision} from '../runtime/js/cm-ai/implicit-qa-decision.mjs';
|
|
15
16
|
|
|
16
17
|
const policy={version:2,development:'conversation',bootstrap:'disabled',qa:'run',qaFix:'disabled'};
|
|
17
18
|
const cli=fileURLToPath(new URL('./cm-ai-host.mjs',import.meta.url));
|
|
@@ -105,6 +106,26 @@ test('v1 recovery retains its original no-target and fingerprint behavior',async
|
|
|
105
106
|
assert.equal(f.snapshot().records.find(row=>row.payload.type==='specification-rebound').payload.record.reason,'Legacy explicit reason.');
|
|
106
107
|
});
|
|
107
108
|
|
|
109
|
+
test('regression: a v2 run created before the implicit QA decision still resumes in its original form',async t=>{
|
|
110
|
+
const f=fixture(t);
|
|
111
|
+
// 修复前没有 workflow 配置的 v2 运行:没有 workflow、执行器,也没有 QA 判定。
|
|
112
|
+
delete f.execution.configuration.workflow;delete f.execution.qaExecutor;delete f.execution.qaDecisionProvider;
|
|
113
|
+
const original={...f.execution};
|
|
114
|
+
const created=await openControlRun(f.definition,'create',original);created.close();
|
|
115
|
+
const provider={timeoutMs:1000,decide:()=>{throw new Error('must not assess');}};
|
|
116
|
+
const implicit={...original,qaDecisionProvider:markImplicitQaDecision(provider)};
|
|
117
|
+
const resumed=await openControlRun(f.definition,'resume',implicit);resumed.close();
|
|
118
|
+
// 没有隐式标记的判定不能借这条兼容路径改变指纹。
|
|
119
|
+
await assert.rejects(openControlRun(f.definition,'resume',{...original,qaDecisionProvider:{...provider}}),/fingerprint_mismatch/);
|
|
120
|
+
// 修复后新建的运行带着隐式判定的指纹,按新形式正常恢复。
|
|
121
|
+
const g=fixture(t);
|
|
122
|
+
delete g.execution.configuration.workflow;delete g.execution.qaExecutor;
|
|
123
|
+
g.execution.qaDecisionProvider=markImplicitQaDecision({timeoutMs:1000,decide:()=>{throw new Error('must not assess');}});
|
|
124
|
+
const fresh=await openControlRun(g.definition,'create',g.execution);fresh.close();
|
|
125
|
+
const again=await openControlRun(g.definition,'resume',g.execution);again.close();
|
|
126
|
+
await assert.rejects(openControlRun(g.definition,'resume',(({qaDecisionProvider,...rest})=>rest)(g.execution)),/fingerprint_mismatch/);
|
|
127
|
+
});
|
|
128
|
+
|
|
108
129
|
test('target file rejects unknown fields, malformed targets, symlinks and hardlinks',async t=>{
|
|
109
130
|
const f=fixture(t),target=await initialize(f),file=path.join(f.root,'target.json');
|
|
110
131
|
fs.writeFileSync(file,JSON.stringify(target));assert.deepEqual(readLaunchControlFile(file),target);
|
|
@@ -29,6 +29,20 @@ test('control choices are strict and cannot turn data presence into execution pe
|
|
|
29
29
|
{...policy,qaFix:'auto'},{...policy,qa:'skip'},{...policy,bootstrap:'yes'}])assert.throws(()=>readControlPolicy(value));
|
|
30
30
|
assert.deepEqual(readControlPolicy({...policy,qa:'run',qaFix:'manual'}).qaFix,'manual');
|
|
31
31
|
});
|
|
32
|
+
test('verification is an optional policy choice that keeps older policies byte-identical',()=>{
|
|
33
|
+
// Absent is the policy every earlier run saved; its digest must not move.
|
|
34
|
+
assert.equal(digest(readControlPolicy(policy)),digest(policy));
|
|
35
|
+
assert.deepEqual(readControlPolicy({...policy,verification:'precheck'}),{...policy,verification:'precheck'});
|
|
36
|
+
assert.deepEqual(readControlPolicy({...policy,verification:'disabled'}),{...policy,verification:'disabled'});
|
|
37
|
+
assert.deepEqual(readControlPolicy({...policy,verification:'auto'}),{...policy,verification:'auto'});
|
|
38
|
+
for(const verification of ['on',true,null,'','PRECHECK','AUTO'])
|
|
39
|
+
assert.throws(()=>readControlPolicy({...policy,verification}),{code:'invalid_input'});
|
|
40
|
+
// The choice is part of the saved run: a launch cannot add or drop it.
|
|
41
|
+
assert.throws(()=>assertControlEntry(snapshot(),{...policy,verification:'precheck'}),{code:'fingerprint_mismatch'});
|
|
42
|
+
const saved={revision:digest('a'),records:[{payload:{type:'init',config:{controlPolicy:{...policy,verification:'precheck'}}}}]};
|
|
43
|
+
assert.throws(()=>assertControlEntry(saved,policy),{code:'fingerprint_mismatch'});
|
|
44
|
+
assertControlEntry(saved,{...policy,verification:'precheck'});
|
|
45
|
+
});
|
|
32
46
|
test('policy file rejects duplicate keys, invalid UTF8 and symbolic links',t=>{
|
|
33
47
|
const root=temp(t),file=path.join(root,'control.json');
|
|
34
48
|
fs.writeFileSync(file,JSON.stringify(policy));assert.deepEqual(readControlPolicyFile(file),policy);
|