@rpamis/comet 0.4.0-beta.11 → 0.4.0-beta.12
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/README.md +1 -1
- package/assets/manifest.json +1 -1
- package/assets/skills/comet/SKILL.md +8 -4
- package/assets/skills/comet/reference/classic-layout.md +2 -2
- package/assets/skills/comet/rules/comet-workflow-guard.en.md +4 -3
- package/assets/skills/comet/rules/comet-workflow-guard.md +4 -3
- package/assets/skills/comet/scripts/comet-entry-runtime.mjs +144 -144
- package/assets/skills/comet/scripts/comet-hook-router.mjs +174 -156
- package/assets/skills/comet/scripts/comet-runtime.mjs +161 -183
- package/assets/skills/comet-native/SKILL.md +19 -21
- package/assets/skills/comet-native/reference/artifacts.md +0 -7
- package/assets/skills/comet-native/reference/clarification.md +1 -1
- package/assets/skills/comet-native/reference/commands.md +64 -64
- package/assets/skills/comet-native/reference/recovery.md +9 -1
- package/assets/skills/comet-native/scripts/comet-native-runtime.mjs +2315 -5157
- package/assets/skills-zh/comet/SKILL.md +8 -4
- package/assets/skills-zh/comet/reference/classic-layout.md +2 -2
- package/assets/skills-zh/comet-native/SKILL.md +19 -21
- package/assets/skills-zh/comet-native/reference/artifacts.md +0 -7
- package/assets/skills-zh/comet-native/reference/clarification.md +1 -1
- package/assets/skills-zh/comet-native/reference/commands.md +64 -64
- package/assets/skills-zh/comet-native/reference/recovery.md +9 -1
- package/dist/app/commands/classic.js +2 -2
- package/dist/app/commands/classic.js.map +1 -1
- package/dist/app/commands/dashboard.d.ts.map +1 -1
- package/dist/app/commands/dashboard.js +2 -1
- package/dist/app/commands/dashboard.js.map +1 -1
- package/dist/app/commands/doctor.d.ts.map +1 -1
- package/dist/app/commands/doctor.js +9 -3
- package/dist/app/commands/doctor.js.map +1 -1
- package/dist/config/repository-layout.json +1 -4
- package/dist/domains/comet-classic/classic-root-command.d.ts +4 -1
- package/dist/domains/comet-classic/classic-root-command.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-root-command.js +159 -49
- package/dist/domains/comet-classic/classic-root-command.js.map +1 -1
- package/dist/domains/comet-classic/classic-root-move.d.ts +0 -1
- package/dist/domains/comet-classic/classic-root-move.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-root-move.js +24 -121
- package/dist/domains/comet-classic/classic-root-move.js.map +1 -1
- package/dist/domains/comet-entry/current-selection-repair.js +1 -1
- package/dist/domains/comet-entry/current-selection-repair.js.map +1 -1
- package/dist/domains/comet-entry/hook-router.d.ts +12 -2
- package/dist/domains/comet-entry/hook-router.d.ts.map +1 -1
- package/dist/domains/comet-entry/hook-router.js +40 -14
- package/dist/domains/comet-entry/hook-router.js.map +1 -1
- package/dist/domains/comet-native/native-acceptance.d.ts +1 -2
- package/dist/domains/comet-native/native-acceptance.d.ts.map +1 -1
- package/dist/domains/comet-native/native-acceptance.js +5 -29
- package/dist/domains/comet-native/native-acceptance.js.map +1 -1
- package/dist/domains/comet-native/native-cli.d.ts.map +1 -1
- package/dist/domains/comet-native/native-cli.js +5 -448
- package/dist/domains/comet-native/native-cli.js.map +1 -1
- package/dist/domains/comet-native/native-continuation.d.ts.map +1 -1
- package/dist/domains/comet-native/native-continuation.js +18 -5
- package/dist/domains/comet-native/native-continuation.js.map +1 -1
- package/dist/domains/comet-native/native-evidence-retention.d.ts.map +1 -1
- package/dist/domains/comet-native/native-evidence-retention.js +5 -21
- package/dist/domains/comet-native/native-evidence-retention.js.map +1 -1
- package/dist/domains/comet-native/native-evidence-storage.d.ts +2 -8
- package/dist/domains/comet-native/native-evidence-storage.d.ts.map +1 -1
- package/dist/domains/comet-native/native-evidence-storage.js +2 -23
- package/dist/domains/comet-native/native-evidence-storage.js.map +1 -1
- package/dist/domains/comet-native/native-findings.d.ts.map +1 -1
- package/dist/domains/comet-native/native-findings.js +6 -4
- package/dist/domains/comet-native/native-findings.js.map +1 -1
- package/dist/domains/comet-native/native-repair-integration.d.ts +1 -3
- package/dist/domains/comet-native/native-repair-integration.d.ts.map +1 -1
- package/dist/domains/comet-native/native-repair-integration.js +12 -15
- package/dist/domains/comet-native/native-repair-integration.js.map +1 -1
- package/dist/domains/comet-native/native-repair-runtime.d.ts +0 -1
- package/dist/domains/comet-native/native-repair-runtime.d.ts.map +1 -1
- package/dist/domains/comet-native/native-repair-runtime.js +3 -10
- package/dist/domains/comet-native/native-repair-runtime.js.map +1 -1
- package/dist/domains/comet-native/native-repair-stagnation.d.ts +1 -9
- package/dist/domains/comet-native/native-repair-stagnation.d.ts.map +1 -1
- package/dist/domains/comet-native/native-repair-stagnation.js +4 -14
- package/dist/domains/comet-native/native-repair-stagnation.js.map +1 -1
- package/dist/domains/comet-native/native-snapshot.d.ts.map +1 -1
- package/dist/domains/comet-native/native-snapshot.js +0 -40
- package/dist/domains/comet-native/native-snapshot.js.map +1 -1
- package/dist/domains/comet-native/native-transition-evidence.d.ts.map +1 -1
- package/dist/domains/comet-native/native-transition-evidence.js +0 -10
- package/dist/domains/comet-native/native-transition-evidence.js.map +1 -1
- package/dist/domains/comet-native/native-transitions.d.ts.map +1 -1
- package/dist/domains/comet-native/native-transitions.js +3 -31
- package/dist/domains/comet-native/native-transitions.js.map +1 -1
- package/dist/domains/comet-native/native-types.d.ts +0 -6
- package/dist/domains/comet-native/native-types.d.ts.map +1 -1
- package/dist/domains/comet-native/native-verification-evidence.d.ts +2 -48
- package/dist/domains/comet-native/native-verification-evidence.d.ts.map +1 -1
- package/dist/domains/comet-native/native-verification-evidence.js +13 -301
- package/dist/domains/comet-native/native-verification-evidence.js.map +1 -1
- package/dist/domains/comet-native/native-verification-receipt-runtime.d.ts +2 -138
- package/dist/domains/comet-native/native-verification-receipt-runtime.d.ts.map +1 -1
- package/dist/domains/comet-native/native-verification-receipt-runtime.js +103 -769
- package/dist/domains/comet-native/native-verification-receipt-runtime.js.map +1 -1
- package/dist/domains/comet-native/native-verification-receipt.d.ts +3 -89
- package/dist/domains/comet-native/native-verification-receipt.d.ts.map +1 -1
- package/dist/domains/comet-native/native-verification-receipt.js +19 -350
- package/dist/domains/comet-native/native-verification-receipt.js.map +1 -1
- package/dist/domains/comet-native/native-verification-runtime.d.ts +1 -4
- package/dist/domains/comet-native/native-verification-runtime.d.ts.map +1 -1
- package/dist/domains/comet-native/native-verification-runtime.js +14 -209
- package/dist/domains/comet-native/native-verification-runtime.js.map +1 -1
- package/dist/domains/dashboard/web/assets/{arc-BXWNV2Qv.js → arc-BXDAG6Qx.js} +1 -1
- package/dist/domains/dashboard/web/assets/{architectureDiagram-3BPJPVTR-CjVHPivo.js → architectureDiagram-3BPJPVTR-R2JyCv0i.js} +1 -1
- package/dist/domains/dashboard/web/assets/{blockDiagram-GPEHLZMM-P2PGImSM.js → blockDiagram-GPEHLZMM-STNPWdDl.js} +1 -1
- package/dist/domains/dashboard/web/assets/{c4Diagram-AAUBKEIU-fTj6Xhs1.js → c4Diagram-AAUBKEIU-Bh-rUIcJ.js} +1 -1
- package/dist/domains/dashboard/web/assets/channel-XR_5gd6D.js +1 -0
- package/dist/domains/dashboard/web/assets/{chunk-2J33WTMH-BjFDZ5yo.js → chunk-2J33WTMH-BRhFNAFH.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-4BX2VUAB-BAUkbZdT.js → chunk-4BX2VUAB-CwA3zkFS.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-55IACEB6-DBmuiYme.js → chunk-55IACEB6-C1tqAl_E.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-727SXJPM-Do9ufCgY.js → chunk-727SXJPM-DDefBoUS.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-AQP2D5EJ-qRQWlB5d.js → chunk-AQP2D5EJ-Dq-0Yi9D.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-FMBD7UC4-BzDzeJ4_.js → chunk-FMBD7UC4-DC-MVNgk.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-ND2GUHAM-OQcAmIvL.js → chunk-ND2GUHAM-BLWZ8zWd.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-QZHKN3VN-BiRfH4d2.js → chunk-QZHKN3VN-DaK5rvZu.js} +1 -1
- package/dist/domains/dashboard/web/assets/classDiagram-4FO5ZUOK-CG_TnucZ.js +1 -0
- package/dist/domains/dashboard/web/assets/classDiagram-v2-Q7XG4LA2-CG_TnucZ.js +1 -0
- package/dist/domains/dashboard/web/assets/{cose-bilkent-S5V4N54A-CZk37fGn.js → cose-bilkent-S5V4N54A-DCPgAyMU.js} +1 -1
- package/dist/domains/dashboard/web/assets/{cynefin-VYW2F7L2-B3F-qRTJ.js → cynefin-VYW2F7L2-CBaY4KFj.js} +1 -1
- package/dist/domains/dashboard/web/assets/{dagre-BM42HDAG-D5BQ0eqN.js → dagre-BM42HDAG-CLKQ6BQM.js} +1 -1
- package/dist/domains/dashboard/web/assets/{diagram-2AECGRRQ-33mXstha.js → diagram-2AECGRRQ-DCup336F.js} +1 -1
- package/dist/domains/dashboard/web/assets/{diagram-5GNKFQAL-BWHCMFvD.js → diagram-5GNKFQAL-DgpDOFTE.js} +1 -1
- package/dist/domains/dashboard/web/assets/{diagram-KO2AKTUF-DrPGimEt.js → diagram-KO2AKTUF-BZcengGf.js} +1 -1
- package/dist/domains/dashboard/web/assets/{diagram-LMA3HP47-BBlsg7jG.js → diagram-LMA3HP47-DSECilBo.js} +1 -1
- package/dist/domains/dashboard/web/assets/{diagram-OG6HWLK6-CsaFSpHi.js → diagram-OG6HWLK6-3FuzANXW.js} +1 -1
- package/dist/domains/dashboard/web/assets/{erDiagram-TEJ5UH35-CoB0mzhk.js → erDiagram-TEJ5UH35-BBrwULhs.js} +1 -1
- package/dist/domains/dashboard/web/assets/{flowDiagram-I6XJVG4X-lT53XfSE.js → flowDiagram-I6XJVG4X-DiNn0Yzp.js} +1 -1
- package/dist/domains/dashboard/web/assets/{ganttDiagram-6RSMTGT7-D1SQ56fl.js → ganttDiagram-6RSMTGT7-DcvbTHnu.js} +1 -1
- package/dist/domains/dashboard/web/assets/{gitGraphDiagram-PVQCEYII-D4oDMS5x.js → gitGraphDiagram-PVQCEYII-CgCY3MJo.js} +1 -1
- package/dist/domains/dashboard/web/assets/index-BR3wUr2k.css +1 -0
- package/dist/domains/dashboard/web/assets/{index-Msce_H_q.js → index-CovQUq5W.js} +4 -4
- package/dist/domains/dashboard/web/assets/{infoDiagram-5YYISTIA-BeICn98s.js → infoDiagram-5YYISTIA-hzBGAEue.js} +1 -1
- package/dist/domains/dashboard/web/assets/{ishikawaDiagram-YF4QCWOH-Dkspu33d.js → ishikawaDiagram-YF4QCWOH-DCPPspol.js} +1 -1
- package/dist/domains/dashboard/web/assets/{journeyDiagram-JHISSGLW-C-EM1sZl.js → journeyDiagram-JHISSGLW-C_v8b1Os.js} +1 -1
- package/dist/domains/dashboard/web/assets/{kanban-definition-UN3LZRKU-BTbB0IO2.js → kanban-definition-UN3LZRKU-CgpE9lG7.js} +1 -1
- package/dist/domains/dashboard/web/assets/{linear-Cp0UrqDr.js → linear-jSddcREx.js} +1 -1
- package/dist/domains/dashboard/web/assets/{mermaid.core-CucmqsLW.js → mermaid.core-5Ibr28Ig.js} +4 -4
- package/dist/domains/dashboard/web/assets/{mindmap-definition-RKZ34NQL-CjEshF1X.js → mindmap-definition-RKZ34NQL-XPCohX0x.js} +1 -1
- package/dist/domains/dashboard/web/assets/{pieDiagram-4H26LBE5-DrwFnX1b.js → pieDiagram-4H26LBE5-DvhxgQWl.js} +1 -1
- package/dist/domains/dashboard/web/assets/{quadrantDiagram-W4KKPZXB-CjG6pBR2.js → quadrantDiagram-W4KKPZXB-CCUxdF-S.js} +1 -1
- package/dist/domains/dashboard/web/assets/{requirementDiagram-4Y6WPE33-BpUQVqCV.js → requirementDiagram-4Y6WPE33-FS3TCmdX.js} +1 -1
- package/dist/domains/dashboard/web/assets/{sankeyDiagram-5OEKKPKP-BeGkEvzR.js → sankeyDiagram-5OEKKPKP-r129rscN.js} +1 -1
- package/dist/domains/dashboard/web/assets/{sequenceDiagram-3UESZ5HK-sSTU3MCO.js → sequenceDiagram-3UESZ5HK--DCY0bvU.js} +1 -1
- package/dist/domains/dashboard/web/assets/{stateDiagram-AJRCARHV-CcFBc6qh.js → stateDiagram-AJRCARHV-yHkUByrT.js} +1 -1
- package/dist/domains/dashboard/web/assets/stateDiagram-v2-BHNVJYJU-XHzDdqcm.js +1 -0
- package/dist/domains/dashboard/web/assets/{timeline-definition-PNZ67QCA-DCN7NjEs.js → timeline-definition-PNZ67QCA-NlqCuFuo.js} +1 -1
- package/dist/domains/dashboard/web/assets/{vennDiagram-CIIHVFJN-DZAN1_rr.js → vennDiagram-CIIHVFJN-B4W_d1Nq.js} +1 -1
- package/dist/domains/dashboard/web/assets/{wardleyDiagram-YWT4CUSO-FfkJfr4C.js → wardleyDiagram-YWT4CUSO-Bex-_jWd.js} +1 -1
- package/dist/domains/dashboard/web/assets/{xychartDiagram-2RQKCTM6-CD8B-EmR.js → xychartDiagram-2RQKCTM6-CmxeVM2Z.js} +1 -1
- package/dist/domains/dashboard/web/index.html +2 -2
- package/eval/local/tasks/comet-native-workflow/instruction.md +4 -16
- package/eval/local/tasks/comet-native-workflow/validation/test_native_workflow.py +21 -231
- package/eval/local/tests/conftest.py +0 -193
- package/eval/local/tests/scaffold/test_native_wave_evaluations.py +0 -148
- package/eval/local/tests/scaffold/test_tasks.py +1 -8
- package/eval/local/tests/scaffold/test_utils.py +4 -7
- package/eval/scaffold/shell/docker.sh +2 -95
- package/package.json +1 -1
- package/dist/domains/comet-native/native-controller-trust.d.ts +0 -21
- package/dist/domains/comet-native/native-controller-trust.d.ts.map +0 -1
- package/dist/domains/comet-native/native-controller-trust.js +0 -140
- package/dist/domains/comet-native/native-controller-trust.js.map +0 -1
- package/dist/domains/comet-native/native-independent-review.d.ts +0 -28
- package/dist/domains/comet-native/native-independent-review.d.ts.map +0 -1
- package/dist/domains/comet-native/native-independent-review.js +0 -134
- package/dist/domains/comet-native/native-independent-review.js.map +0 -1
- package/dist/domains/comet-native/native-review-contract.d.ts +0 -6
- package/dist/domains/comet-native/native-review-contract.d.ts.map +0 -1
- package/dist/domains/comet-native/native-review-contract.js +0 -6
- package/dist/domains/comet-native/native-review-contract.js.map +0 -1
- package/dist/domains/comet-native/native-review-identity.d.ts +0 -50
- package/dist/domains/comet-native/native-review-identity.d.ts.map +0 -1
- package/dist/domains/comet-native/native-review-identity.js +0 -209
- package/dist/domains/comet-native/native-review-identity.js.map +0 -1
- package/dist/domains/comet-native/native-review-signer.d.ts +0 -24
- package/dist/domains/comet-native/native-review-signer.d.ts.map +0 -1
- package/dist/domains/comet-native/native-review-signer.js +0 -125
- package/dist/domains/comet-native/native-review-signer.js.map +0 -1
- package/dist/domains/comet-native/native-review-trust.d.ts +0 -35
- package/dist/domains/comet-native/native-review-trust.d.ts.map +0 -1
- package/dist/domains/comet-native/native-review-trust.js +0 -176
- package/dist/domains/comet-native/native-review-trust.js.map +0 -1
- package/dist/domains/dashboard/web/assets/channel--JtnhJr8.js +0 -1
- package/dist/domains/dashboard/web/assets/classDiagram-4FO5ZUOK-BRGmx8Iz.js +0 -1
- package/dist/domains/dashboard/web/assets/classDiagram-v2-Q7XG4LA2-BRGmx8Iz.js +0 -1
- package/dist/domains/dashboard/web/assets/index-D-AGxvI4.css +0 -1
- package/dist/domains/dashboard/web/assets/stateDiagram-v2-BHNVJYJU-D5zZYi4x.js +0 -1
- package/eval/local/tasks/comet-native-workflow/environment/.include-trusted-native-review-fixture +0 -1
- package/eval/scaffold/shell/native-review-signer-daemon.mjs +0 -144
- package/eval/scaffold/shell/native-review-verifier-daemon.mjs +0 -178
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { promises as fs } from 'node:fs';
|
|
2
1
|
import path from 'path';
|
|
3
2
|
import { RaceSafeReadError, readFileRaceSafe } from '../../platform/fs/race-safe-read.js';
|
|
4
3
|
import { archiveNativeChange, NativeArchivePreflightError, NativeSpecConflictError, } from './native-archive.js';
|
|
5
|
-
import { atomicWriteJson } from './native-atomic-file.js';
|
|
6
4
|
import { serializeNativeVerificationMachineBlock } from './native-acceptance.js';
|
|
7
5
|
import { inspectNativeArchivePreflight } from './native-archive-inspection.js';
|
|
8
6
|
import { createNativeChange, inspectNativeChange, NativeChangeRevisionConflictError, NativeBaselineIncompleteError, NativeRuntimeCompatibilityError, nativeChangeDir, readNativeChange, } from './native-change.js';
|
|
@@ -12,19 +10,14 @@ import { doctorNativeProject } from './native-doctor.js';
|
|
|
12
10
|
import { checkNativeChange } from './native-check.js';
|
|
13
11
|
import { checkpointNativeChange } from './native-progress-checkpoint.js';
|
|
14
12
|
import { nativeContinuation } from './native-continuation.js';
|
|
15
|
-
import { discoverNativeProject, ensureNativeDirectories, nativeProjectPaths, normalizeArtifactRootRef,
|
|
16
|
-
import { withNativeMutationLock } from './native-mutation-lock.js';
|
|
13
|
+
import { discoverNativeProject, ensureNativeDirectories, nativeProjectPaths, normalizeArtifactRootRef, } from './native-paths.js';
|
|
17
14
|
import { moveNativeRoot } from './native-root-move.js';
|
|
18
15
|
import { selectNativeChange } from './native-selection.js';
|
|
19
16
|
import { markNativeSpecRemoval, readNativeProposedSpecs, rebaseNativeSpecChanges, } from './native-specs.js';
|
|
20
17
|
import { readNativeBoundedTextFile } from './native-bounded-file.js';
|
|
21
18
|
import { NATIVE_CONTRACT_FILE_LIMITS } from './native-contract-files.js';
|
|
22
19
|
import { MAX_NATIVE_IMPLEMENTATION_EVIDENCE_DOCUMENT_BYTES } from './native-verification-scope.js';
|
|
23
|
-
import {
|
|
24
|
-
import { approveNativeIndependentReviewPreparation, finalizeNativeImplementationAttestation, finalizeNativeIndependentReviewReceipt, issueNativeAutomatedCheckReceipt, issueNativeManualEvidenceReceipt, issueNativeWaiverReceipt, MAX_NATIVE_AUTOMATED_COMMAND_TIMEOUT_MS, prepareNativeIndependentReview, prepareNativeImplementationAttestation, } from './native-verification-receipt-runtime.js';
|
|
25
|
-
import { generateNativeReviewKeyPair, nativeReviewIdentityFromPrivateKey, nativeReviewPrivateKeyFilePersistenceSupported, parseNativeReviewIdentity, parseNativeReviewSignature, } from './native-review-identity.js';
|
|
26
|
-
import { buildNativeReviewTrustPolicy, NATIVE_REVIEW_TRUST_POLICY_REF, } from './native-review-trust.js';
|
|
27
|
-
import { parseNativeImplementationPreparation, parseNativeIndependentReviewApproval, signNativeImplementationPreparation, signNativeIndependentReviewApproval, } from './native-review-signer.js';
|
|
20
|
+
import { issueNativeAutomatedCheckReceipt, issueNativeManualEvidenceReceipt, MAX_NATIVE_AUTOMATED_COMMAND_TIMEOUT_MS, } from './native-verification-receipt-runtime.js';
|
|
28
21
|
import { advanceNativeChange } from './native-transitions.js';
|
|
29
22
|
import { inspectNativeHookGuard, readNativeHookRequest } from './native-hook-guard.js';
|
|
30
23
|
const NATIVE_SHOW_MAX_SERIALIZED_BYTES = 10 * 1024 * 1024;
|
|
@@ -40,27 +33,15 @@ Commands:
|
|
|
40
33
|
new <change-name> [--language en|zh-CN]
|
|
41
34
|
spec remove <change-name> <capability>
|
|
42
35
|
spec rebase <change-name> --summary <text>
|
|
43
|
-
list [--cursor <token>]
|
|
44
36
|
show <change-name>
|
|
45
37
|
status [<change-name>] [--cursor <token>] [--details [--acceptance-cursor <token>]]
|
|
46
38
|
select <change-name>
|
|
47
39
|
checkpoint <change-name> --summary <text> --next-action <text> [--artifact <project-relative>] [--expect-revision <n>]
|
|
48
40
|
check <change-name>
|
|
49
41
|
evidence format [--entries <path>]
|
|
50
|
-
|
|
51
|
-
trust identity --private-key-env <name> --identity <path>
|
|
52
|
-
trust policy --implementation-identity <path> --reviewer-identity <path> --waiver-identity <path> --controller-private-key-env <name>
|
|
53
|
-
receipt manual <change-name> --acceptance <id> --responsible <text> --step <text> --observation <text> --confirmed
|
|
42
|
+
receipt manual <change-name> --acceptance <id> --step <text> --observation <text>
|
|
54
43
|
receipt automated <change-name> --acceptance <id> [--timeout-ms <n>] -- <executable> [args...]
|
|
55
|
-
|
|
56
|
-
receipt implement sign --preparation <path> --identity <path> --private-key-env <name> --output <path>
|
|
57
|
-
receipt implement <change-name> finalize --preparation <path> --attestation <path> --confirmed
|
|
58
|
-
receipt review <change-name> prepare --implementation-receipt <ref> --report <path> --required-receipt <ref> --identity <path> [--unified-io-receipt <ref> --adversarial-paths-receipt <ref> --generated-assets-receipt <ref> --lifecycle-eval-receipt <ref>] --output <path>
|
|
59
|
-
receipt review <change-name> approve --preparation <path> --attest-manual <ref> [--findings <path>] --checked-acceptance-applicability --output <path>
|
|
60
|
-
receipt review sign --approval <path> --identity <path> --private-key-env <name> --output <path>
|
|
61
|
-
receipt review <change-name> finalize --preparation <path> --approval <path> --attestation <path> --confirmed
|
|
62
|
-
receipt waive <change-name> --acceptance <id> --blocked-receipt <ref> --reason <text> --risk <text> --alternative-receipt <ref> --identity <path> --private-key-env <name> --confirmed
|
|
63
|
-
next <change-name> --summary <text> [--confirmed] [--artifact <path>] [--no-code-reason <text>] [--allow-partial-scope <sha256> --partial-reason <text>] [--result pass|fail] [--report <path>] [--receipt <required-ref>] [--evidence-receipt <ref>] [--waiver <ref>] [--independent-review-receipt <ref>] [--failure-category <token>] [--failed-check <token>] [--override-repair <sha256> --override-summary <text>]
|
|
44
|
+
next <change-name> --summary <text> [--confirmed] [--artifact <path>] [--no-code-reason <text>] [--allow-partial-scope <sha256> --partial-reason <text>] [--result pass|fail] [--report <path>] [--override-repair <sha256> --override-summary <text>]
|
|
64
45
|
archive <change-name> --dry-run
|
|
65
46
|
archive <change-name> --expect-preflight <sha256> [--confirmed]
|
|
66
47
|
doctor [<change-name>] [--repair] [--strategy continue|rollback]
|
|
@@ -186,106 +167,6 @@ async function readBoundedEvidenceStdin(maxBytes) {
|
|
|
186
167
|
}
|
|
187
168
|
return Buffer.concat(chunks).toString('utf8');
|
|
188
169
|
}
|
|
189
|
-
async function readEvidenceJson(filePath, label) {
|
|
190
|
-
const raw = await readBoundedEvidenceFile(path.resolve(filePath), MAX_NATIVE_IMPLEMENTATION_EVIDENCE_DOCUMENT_BYTES);
|
|
191
|
-
try {
|
|
192
|
-
return JSON.parse(raw);
|
|
193
|
-
}
|
|
194
|
-
catch (error) {
|
|
195
|
-
throw new Error(`${label} must be valid JSON: ${error.message}`, {
|
|
196
|
-
cause: error,
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
function privateKeyFromEnvironment(name) {
|
|
201
|
-
if (!/^[A-Za-z_][A-Za-z0-9_]*$/u.test(name)) {
|
|
202
|
-
throw new NativeUsageError('--private-key-env must be an environment variable name');
|
|
203
|
-
}
|
|
204
|
-
const value = process.env[name];
|
|
205
|
-
if (!value)
|
|
206
|
-
throw new NativeUsageError(`Private key environment variable ${name} is not set`);
|
|
207
|
-
delete process.env[name];
|
|
208
|
-
return value;
|
|
209
|
-
}
|
|
210
|
-
function pathIsInside(parent, target) {
|
|
211
|
-
const relative = path.relative(parent, target);
|
|
212
|
-
return (relative === '' ||
|
|
213
|
-
(!path.isAbsolute(relative) && relative !== '..' && !relative.startsWith(`..${path.sep}`)));
|
|
214
|
-
}
|
|
215
|
-
async function assertPrivateKeyOutsideProject(projectRoot, file) {
|
|
216
|
-
const relative = path.relative(projectRoot, file);
|
|
217
|
-
if (relative === '' ||
|
|
218
|
-
(relative !== '..' && !relative.startsWith(`..${path.sep}`) && !path.isAbsolute(relative))) {
|
|
219
|
-
throw new NativeUsageError('--private-key must resolve outside the Native project');
|
|
220
|
-
}
|
|
221
|
-
const physicalProjectRoot = await fs.realpath(projectRoot);
|
|
222
|
-
const parsed = path.parse(path.resolve(path.dirname(file)));
|
|
223
|
-
let cursor = parsed.root;
|
|
224
|
-
for (const segment of path
|
|
225
|
-
.relative(parsed.root, path.resolve(path.dirname(file)))
|
|
226
|
-
.split(path.sep)
|
|
227
|
-
.filter(Boolean)) {
|
|
228
|
-
cursor = path.join(cursor, segment);
|
|
229
|
-
let stat;
|
|
230
|
-
try {
|
|
231
|
-
stat = await fs.lstat(cursor);
|
|
232
|
-
}
|
|
233
|
-
catch (error) {
|
|
234
|
-
if (error.code === 'ENOENT')
|
|
235
|
-
continue;
|
|
236
|
-
throw error;
|
|
237
|
-
}
|
|
238
|
-
if (!stat.isDirectory() || stat.isSymbolicLink()) {
|
|
239
|
-
throw new NativeUsageError('--private-key parent chain must not contain symlinks, junctions, or non-directories');
|
|
240
|
-
}
|
|
241
|
-
if (pathIsInside(physicalProjectRoot, await fs.realpath(cursor))) {
|
|
242
|
-
throw new NativeUsageError('--private-key parent resolves inside the Native project');
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
async function writeExclusiveFile(file, content, mode) {
|
|
247
|
-
await fs.mkdir(path.dirname(file), { recursive: true });
|
|
248
|
-
const handle = await fs.open(file, 'wx', mode);
|
|
249
|
-
try {
|
|
250
|
-
await handle.writeFile(content, 'utf8');
|
|
251
|
-
}
|
|
252
|
-
finally {
|
|
253
|
-
await handle.close();
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
async function writeExclusivePrivateKeyFile(projectRoot, file, content) {
|
|
257
|
-
if (!nativeReviewPrivateKeyFilePersistenceSupported()) {
|
|
258
|
-
throw new NativeUsageError('trust keygen cannot persist private keys on Windows because owner-only ACLs cannot be verified; generate the identity in an external secret store and provide signing keys through --private-key-env');
|
|
259
|
-
}
|
|
260
|
-
await fs.mkdir(path.dirname(file), { recursive: true });
|
|
261
|
-
await assertPrivateKeyOutsideProject(projectRoot, file);
|
|
262
|
-
const handle = await fs.open(file, 'wx', 0o600);
|
|
263
|
-
let secure = false;
|
|
264
|
-
try {
|
|
265
|
-
await handle.writeFile(content, 'utf8');
|
|
266
|
-
await handle.chmod(0o600);
|
|
267
|
-
const stat = await handle.stat();
|
|
268
|
-
if ((stat.mode & 0o077) !== 0) {
|
|
269
|
-
throw new Error('Native review private key file permissions are not owner-only');
|
|
270
|
-
}
|
|
271
|
-
const [physicalProjectRoot, physicalFile, target] = await Promise.all([
|
|
272
|
-
fs.realpath(projectRoot),
|
|
273
|
-
fs.realpath(file),
|
|
274
|
-
fs.lstat(file),
|
|
275
|
-
]);
|
|
276
|
-
if (!target.isFile() ||
|
|
277
|
-
target.isSymbolicLink() ||
|
|
278
|
-
pathIsInside(physicalProjectRoot, physicalFile)) {
|
|
279
|
-
throw new Error('Native review private key resolved inside the project during write');
|
|
280
|
-
}
|
|
281
|
-
secure = true;
|
|
282
|
-
}
|
|
283
|
-
finally {
|
|
284
|
-
await handle.close();
|
|
285
|
-
if (!secure)
|
|
286
|
-
await fs.rm(file, { force: true });
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
170
|
async function dispatch(rawArgs, explicitProjectRoot) {
|
|
290
171
|
if (rawArgs.length === 0 || rawArgs[0] === '--help' || rawArgs[0] === 'help') {
|
|
291
172
|
return { command: rawArgs[0] ?? null, exitCode: 0, data: { usage: USAGE }, text: USAGE };
|
|
@@ -428,17 +309,6 @@ async function dispatch(rawArgs, explicitProjectRoot) {
|
|
|
428
309
|
}
|
|
429
310
|
throw new NativeUsageError(`Unknown spec command: ${subcommand}`);
|
|
430
311
|
}
|
|
431
|
-
if (command === 'list') {
|
|
432
|
-
const cursor = takeOption(rawArgs, '--cursor');
|
|
433
|
-
assertNoArguments(rawArgs);
|
|
434
|
-
const { config, paths } = await configuredPaths(projectRoot);
|
|
435
|
-
const page = await listNativeStatusPage(paths, {
|
|
436
|
-
...(cursor ? { cursor } : {}),
|
|
437
|
-
clarificationMode: config.native.clarification_mode,
|
|
438
|
-
maxVerifyFailures: config.native.max_verify_failures,
|
|
439
|
-
});
|
|
440
|
-
return success('list', page);
|
|
441
|
-
}
|
|
442
312
|
if (command === 'show') {
|
|
443
313
|
const name = requiredPositional(rawArgs, 'change name');
|
|
444
314
|
assertNoArguments(rawArgs);
|
|
@@ -608,178 +478,21 @@ async function dispatch(rawArgs, explicitProjectRoot) {
|
|
|
608
478
|
}
|
|
609
479
|
throw new NativeUsageError(`Unknown evidence command: ${subcommand}`);
|
|
610
480
|
}
|
|
611
|
-
if (command === 'trust') {
|
|
612
|
-
const subcommand = requiredPositional(rawArgs, 'trust subcommand');
|
|
613
|
-
if (subcommand === 'identity') {
|
|
614
|
-
const identityPathValue = takeOption(rawArgs, '--identity');
|
|
615
|
-
const privateKeyEnv = takeOption(rawArgs, '--private-key-env');
|
|
616
|
-
if (!identityPathValue || !privateKeyEnv) {
|
|
617
|
-
throw new NativeUsageError('trust identity requires --identity and --private-key-env');
|
|
618
|
-
}
|
|
619
|
-
assertNoArguments(rawArgs);
|
|
620
|
-
const identityPath = path.resolve(identityPathValue);
|
|
621
|
-
const identity = nativeReviewIdentityFromPrivateKey(privateKeyFromEnvironment(privateKeyEnv));
|
|
622
|
-
await writeExclusiveFile(identityPath, `${JSON.stringify(identity, null, 2)}\n`, 0o644);
|
|
623
|
-
return success('trust identity', { identityPath, keyId: identity.keyId, privateKeyPrinted: false }, `Native review identity ${identity.keyId} created from external private key material\n`);
|
|
624
|
-
}
|
|
625
|
-
if (subcommand === 'keygen') {
|
|
626
|
-
const identityPathValue = takeOption(rawArgs, '--identity');
|
|
627
|
-
const privateKeyPathValue = takeOption(rawArgs, '--private-key');
|
|
628
|
-
if (!identityPathValue || !privateKeyPathValue) {
|
|
629
|
-
throw new NativeUsageError('trust keygen requires --identity and --private-key');
|
|
630
|
-
}
|
|
631
|
-
assertNoArguments(rawArgs);
|
|
632
|
-
const identityPath = path.resolve(identityPathValue);
|
|
633
|
-
const privateKeyPath = path.resolve(privateKeyPathValue);
|
|
634
|
-
await assertPrivateKeyOutsideProject(projectRoot, privateKeyPath);
|
|
635
|
-
if (identityPath === privateKeyPath) {
|
|
636
|
-
throw new NativeUsageError('--identity and --private-key must be different files');
|
|
637
|
-
}
|
|
638
|
-
const keyPair = generateNativeReviewKeyPair();
|
|
639
|
-
await writeExclusivePrivateKeyFile(projectRoot, privateKeyPath, `${keyPair.privateKey}\n`);
|
|
640
|
-
await writeExclusiveFile(identityPath, `${JSON.stringify(keyPair.identity, null, 2)}\n`, 0o644);
|
|
641
|
-
return success('trust keygen', {
|
|
642
|
-
identityPath,
|
|
643
|
-
privateKeyPath,
|
|
644
|
-
keyId: keyPair.identity.keyId,
|
|
645
|
-
privateKeyPrinted: false,
|
|
646
|
-
}, `Native review identity ${keyPair.identity.keyId} created; private key written only to ${privateKeyPath}\n`);
|
|
647
|
-
}
|
|
648
|
-
if (subcommand === 'policy') {
|
|
649
|
-
const implementationIdentityPath = takeOption(rawArgs, '--implementation-identity');
|
|
650
|
-
const reviewerIdentityPaths = takeMany(rawArgs, '--reviewer-identity');
|
|
651
|
-
const waiverIdentityPaths = takeMany(rawArgs, '--waiver-identity');
|
|
652
|
-
const controllerPrivateKeyEnv = takeOption(rawArgs, '--controller-private-key-env');
|
|
653
|
-
if (!implementationIdentityPath ||
|
|
654
|
-
reviewerIdentityPaths.length === 0 ||
|
|
655
|
-
waiverIdentityPaths.length === 0 ||
|
|
656
|
-
!controllerPrivateKeyEnv) {
|
|
657
|
-
throw new NativeUsageError('trust policy requires --implementation-identity, --reviewer-identity, --waiver-identity, and --controller-private-key-env');
|
|
658
|
-
}
|
|
659
|
-
assertNoArguments(rawArgs);
|
|
660
|
-
const { paths } = await configuredPaths(projectRoot);
|
|
661
|
-
const implementationIdentity = parseNativeReviewIdentity(await readEvidenceJson(implementationIdentityPath, 'Implementation identity'));
|
|
662
|
-
const trustedReviewers = await Promise.all(reviewerIdentityPaths.map(async (file) => parseNativeReviewIdentity(await readEvidenceJson(file, 'Reviewer identity'))));
|
|
663
|
-
const trustedWaiverSigners = await Promise.all(waiverIdentityPaths.map(async (file) => parseNativeReviewIdentity(await readEvidenceJson(file, 'Waiver signer identity'))));
|
|
664
|
-
const controllerTrust = await readNativeControllerTrustProject(projectRoot);
|
|
665
|
-
if (!controllerTrust) {
|
|
666
|
-
throw new Error('Native project has no controller-owned trust root');
|
|
667
|
-
}
|
|
668
|
-
const policy = buildNativeReviewTrustPolicy({
|
|
669
|
-
controllerIdentity: controllerTrust.controllerIdentity,
|
|
670
|
-
controllerPrivateKey: privateKeyFromEnvironment(controllerPrivateKeyEnv),
|
|
671
|
-
implementationKeyId: implementationIdentity.keyId,
|
|
672
|
-
trustedReviewers,
|
|
673
|
-
trustedWaiverSigners,
|
|
674
|
-
});
|
|
675
|
-
const policyPath = path.join(projectRoot, ...NATIVE_REVIEW_TRUST_POLICY_REF.split('/'));
|
|
676
|
-
await withNativeMutationLock(paths, 'create review trust policy', async () => {
|
|
677
|
-
await resolveContainedNativePath(projectRoot, policyPath);
|
|
678
|
-
await atomicWriteJson(policyPath, policy, {
|
|
679
|
-
containedRoot: projectRoot,
|
|
680
|
-
exclusive: true,
|
|
681
|
-
});
|
|
682
|
-
});
|
|
683
|
-
return success('trust policy', { ref: NATIVE_REVIEW_TRUST_POLICY_REF, policy }, `Native review trust policy created: ${NATIVE_REVIEW_TRUST_POLICY_REF}\n`);
|
|
684
|
-
}
|
|
685
|
-
throw new NativeUsageError(`Unknown trust command: ${subcommand}`);
|
|
686
|
-
}
|
|
687
481
|
if (command === 'receipt') {
|
|
688
482
|
const subcommand = requiredPositional(rawArgs, 'receipt subcommand');
|
|
689
|
-
if (subcommand === 'implement' && rawArgs[0] === 'sign') {
|
|
690
|
-
rawArgs.shift();
|
|
691
|
-
const preparationPath = takeOption(rawArgs, '--preparation');
|
|
692
|
-
const identityPath = takeOption(rawArgs, '--identity');
|
|
693
|
-
const privateKeyEnv = takeOption(rawArgs, '--private-key-env');
|
|
694
|
-
const outputPathValue = takeOption(rawArgs, '--output');
|
|
695
|
-
if (!preparationPath || !identityPath || !privateKeyEnv || !outputPathValue) {
|
|
696
|
-
throw new NativeUsageError('receipt implement sign requires --preparation, --identity, --private-key-env, and --output');
|
|
697
|
-
}
|
|
698
|
-
assertNoArguments(rawArgs);
|
|
699
|
-
const attestation = signNativeImplementationPreparation({
|
|
700
|
-
preparation: await readEvidenceJson(preparationPath, 'Native implementation preparation'),
|
|
701
|
-
identity: parseNativeReviewIdentity(await readEvidenceJson(identityPath, 'Implementation identity')),
|
|
702
|
-
privateKey: privateKeyFromEnvironment(privateKeyEnv),
|
|
703
|
-
});
|
|
704
|
-
const outputPath = path.resolve(outputPathValue);
|
|
705
|
-
await atomicWriteJson(outputPath, attestation);
|
|
706
|
-
return success('receipt implement sign', { outputPath, attestation }, `Native implementation attestation written to ${outputPath}\n`);
|
|
707
|
-
}
|
|
708
|
-
if (subcommand === 'review' && rawArgs[0] === 'sign') {
|
|
709
|
-
rawArgs.shift();
|
|
710
|
-
const approvalPath = takeOption(rawArgs, '--approval');
|
|
711
|
-
const identityPath = takeOption(rawArgs, '--identity');
|
|
712
|
-
const privateKeyEnv = takeOption(rawArgs, '--private-key-env');
|
|
713
|
-
const outputPathValue = takeOption(rawArgs, '--output');
|
|
714
|
-
if (!approvalPath || !identityPath || !privateKeyEnv || !outputPathValue) {
|
|
715
|
-
throw new NativeUsageError('receipt review sign requires --approval, --identity, --private-key-env, and --output');
|
|
716
|
-
}
|
|
717
|
-
assertNoArguments(rawArgs);
|
|
718
|
-
const attestation = signNativeIndependentReviewApproval({
|
|
719
|
-
approval: await readEvidenceJson(approvalPath, 'Native review approval'),
|
|
720
|
-
identity: parseNativeReviewIdentity(await readEvidenceJson(identityPath, 'Reviewer identity')),
|
|
721
|
-
privateKey: privateKeyFromEnvironment(privateKeyEnv),
|
|
722
|
-
});
|
|
723
|
-
const outputPath = path.resolve(outputPathValue);
|
|
724
|
-
await atomicWriteJson(outputPath, attestation);
|
|
725
|
-
return success('receipt review sign', { outputPath, attestation }, `Native review attestation written to ${outputPath}\n`);
|
|
726
|
-
}
|
|
727
483
|
const name = requiredPositional(rawArgs, 'change name');
|
|
728
484
|
const { paths } = await configuredPaths(projectRoot);
|
|
729
|
-
if (subcommand === 'implement') {
|
|
730
|
-
const implementationPhase = requiredPositional(rawArgs, 'implementation phase');
|
|
731
|
-
if (implementationPhase === 'prepare') {
|
|
732
|
-
const identityPath = takeOption(rawArgs, '--identity');
|
|
733
|
-
const outputPathValue = takeOption(rawArgs, '--output');
|
|
734
|
-
if (!identityPath || !outputPathValue) {
|
|
735
|
-
throw new NativeUsageError('receipt implement prepare requires --identity and --output');
|
|
736
|
-
}
|
|
737
|
-
assertNoArguments(rawArgs);
|
|
738
|
-
const preparation = await prepareNativeImplementationAttestation({
|
|
739
|
-
paths,
|
|
740
|
-
name,
|
|
741
|
-
implementationIdentity: parseNativeReviewIdentity(await readEvidenceJson(identityPath, 'Implementation identity')),
|
|
742
|
-
});
|
|
743
|
-
const outputPath = path.resolve(outputPathValue);
|
|
744
|
-
await atomicWriteJson(outputPath, preparation);
|
|
745
|
-
return success('receipt implement prepare', { outputPath, preparation }, `Native implementation preparation written to ${outputPath}\n`);
|
|
746
|
-
}
|
|
747
|
-
if (implementationPhase === 'finalize') {
|
|
748
|
-
const preparationPath = takeOption(rawArgs, '--preparation');
|
|
749
|
-
const attestationPath = takeOption(rawArgs, '--attestation');
|
|
750
|
-
const confirmed = takeFlag(rawArgs, '--confirmed');
|
|
751
|
-
if (!preparationPath || !attestationPath) {
|
|
752
|
-
throw new NativeUsageError('receipt implement finalize requires --preparation and --attestation');
|
|
753
|
-
}
|
|
754
|
-
assertNoArguments(rawArgs);
|
|
755
|
-
const issued = await finalizeNativeImplementationAttestation({
|
|
756
|
-
paths,
|
|
757
|
-
name,
|
|
758
|
-
preparation: parseNativeImplementationPreparation(await readEvidenceJson(preparationPath, 'Native implementation preparation')),
|
|
759
|
-
attestation: parseNativeReviewSignature(await readEvidenceJson(attestationPath, 'Native implementation attestation')),
|
|
760
|
-
confirmed,
|
|
761
|
-
});
|
|
762
|
-
return success('receipt implement finalize', issued, `Native implementation attestation: ${issued.ref}\n`);
|
|
763
|
-
}
|
|
764
|
-
throw new NativeUsageError(`Unknown receipt implementation phase: ${implementationPhase}`);
|
|
765
|
-
}
|
|
766
485
|
if (subcommand === 'manual') {
|
|
767
486
|
const acceptanceIds = takeMany(rawArgs, '--acceptance');
|
|
768
|
-
const responsible = takeOption(rawArgs, '--responsible');
|
|
769
487
|
const steps = takeMany(rawArgs, '--step');
|
|
770
488
|
const observations = takeMany(rawArgs, '--observation');
|
|
771
|
-
const confirmed = takeFlag(rawArgs, '--confirmed');
|
|
772
|
-
if (!responsible)
|
|
773
|
-
throw new NativeUsageError('--responsible is required');
|
|
774
489
|
assertNoArguments(rawArgs);
|
|
775
490
|
const issued = await issueNativeManualEvidenceReceipt({
|
|
776
491
|
paths,
|
|
777
492
|
name,
|
|
778
493
|
acceptanceIds,
|
|
779
|
-
responsible,
|
|
780
494
|
steps,
|
|
781
495
|
observations,
|
|
782
|
-
confirmed,
|
|
783
496
|
});
|
|
784
497
|
return success('receipt manual', issued, `Native manual receipt: ${issued.ref}\n`);
|
|
785
498
|
}
|
|
@@ -818,128 +531,6 @@ async function dispatch(rawArgs, explicitProjectRoot) {
|
|
|
818
531
|
text: `Native automated receipt ${issued.receipt.status}: ${issued.ref}\n`,
|
|
819
532
|
};
|
|
820
533
|
}
|
|
821
|
-
if (subcommand === 'review') {
|
|
822
|
-
const reviewPhase = requiredPositional(rawArgs, 'review phase');
|
|
823
|
-
if (reviewPhase === 'prepare') {
|
|
824
|
-
const implementationReceiptRef = takeOption(rawArgs, '--implementation-receipt');
|
|
825
|
-
const reportRef = takeOption(rawArgs, '--report');
|
|
826
|
-
const requiredReceiptRefs = takeMany(rawArgs, '--required-receipt');
|
|
827
|
-
const identityPath = takeOption(rawArgs, '--identity');
|
|
828
|
-
const outputPathValue = takeOption(rawArgs, '--output');
|
|
829
|
-
const checkedEvidence = {
|
|
830
|
-
unifiedIo: takeOption(rawArgs, '--unified-io-receipt') ?? null,
|
|
831
|
-
adversarialPaths: takeOption(rawArgs, '--adversarial-paths-receipt') ?? null,
|
|
832
|
-
generatedAssets: takeOption(rawArgs, '--generated-assets-receipt') ?? null,
|
|
833
|
-
lifecycleEval: takeOption(rawArgs, '--lifecycle-eval-receipt') ?? null,
|
|
834
|
-
};
|
|
835
|
-
if (!implementationReceiptRef ||
|
|
836
|
-
!reportRef ||
|
|
837
|
-
requiredReceiptRefs.length === 0 ||
|
|
838
|
-
!identityPath ||
|
|
839
|
-
!outputPathValue) {
|
|
840
|
-
throw new NativeUsageError('receipt review prepare requires --implementation-receipt, --report, at least one --required-receipt, --identity, and --output');
|
|
841
|
-
}
|
|
842
|
-
assertNoArguments(rawArgs);
|
|
843
|
-
const preparation = await prepareNativeIndependentReview({
|
|
844
|
-
paths,
|
|
845
|
-
name,
|
|
846
|
-
implementationReceiptRef,
|
|
847
|
-
reportRef,
|
|
848
|
-
requiredReceiptRefs,
|
|
849
|
-
reviewerIdentity: parseNativeReviewIdentity(await readEvidenceJson(identityPath, 'Reviewer identity')),
|
|
850
|
-
checkedEvidence,
|
|
851
|
-
});
|
|
852
|
-
const outputPath = path.resolve(outputPathValue);
|
|
853
|
-
await atomicWriteJson(outputPath, preparation);
|
|
854
|
-
return success('receipt review prepare', { outputPath, preparation }, `Native review preparation written to ${outputPath}\n`);
|
|
855
|
-
}
|
|
856
|
-
if (reviewPhase === 'approve') {
|
|
857
|
-
const preparationPath = takeOption(rawArgs, '--preparation');
|
|
858
|
-
const outputPathValue = takeOption(rawArgs, '--output');
|
|
859
|
-
const manualAttestationRefs = takeMany(rawArgs, '--attest-manual');
|
|
860
|
-
const findingsPath = takeOption(rawArgs, '--findings');
|
|
861
|
-
const acceptanceApplicability = takeFlag(rawArgs, '--checked-acceptance-applicability');
|
|
862
|
-
if (!preparationPath || !outputPathValue) {
|
|
863
|
-
throw new NativeUsageError('receipt review approve requires --preparation and --output');
|
|
864
|
-
}
|
|
865
|
-
assertNoArguments(rawArgs);
|
|
866
|
-
const rawFindings = findingsPath
|
|
867
|
-
? await readEvidenceJson(findingsPath, 'Independent review findings')
|
|
868
|
-
: [];
|
|
869
|
-
if (!Array.isArray(rawFindings)) {
|
|
870
|
-
throw new Error('Independent review findings must be a JSON array');
|
|
871
|
-
}
|
|
872
|
-
const preparation = (await readEvidenceJson(preparationPath, 'Native review preparation'));
|
|
873
|
-
const approval = await approveNativeIndependentReviewPreparation({
|
|
874
|
-
paths,
|
|
875
|
-
name,
|
|
876
|
-
preparation,
|
|
877
|
-
acceptanceApplicability,
|
|
878
|
-
manualAttestationRefs,
|
|
879
|
-
findings: rawFindings,
|
|
880
|
-
});
|
|
881
|
-
const outputPath = path.resolve(outputPathValue);
|
|
882
|
-
await atomicWriteJson(outputPath, approval);
|
|
883
|
-
return success('receipt review approve', { outputPath, approval }, `Native review approval written to ${outputPath}\n`);
|
|
884
|
-
}
|
|
885
|
-
if (reviewPhase === 'finalize') {
|
|
886
|
-
const preparationPath = takeOption(rawArgs, '--preparation');
|
|
887
|
-
const approvalPath = takeOption(rawArgs, '--approval');
|
|
888
|
-
const attestationPath = takeOption(rawArgs, '--attestation');
|
|
889
|
-
const confirmed = takeFlag(rawArgs, '--confirmed');
|
|
890
|
-
if (!preparationPath || !approvalPath || !attestationPath) {
|
|
891
|
-
throw new NativeUsageError('receipt review finalize requires --preparation, --approval, and --attestation');
|
|
892
|
-
}
|
|
893
|
-
assertNoArguments(rawArgs);
|
|
894
|
-
const issued = await finalizeNativeIndependentReviewReceipt({
|
|
895
|
-
paths,
|
|
896
|
-
name,
|
|
897
|
-
preparation: (await readEvidenceJson(preparationPath, 'Native review preparation')),
|
|
898
|
-
approval: parseNativeIndependentReviewApproval(await readEvidenceJson(approvalPath, 'Native review approval')),
|
|
899
|
-
attestation: parseNativeReviewSignature(await readEvidenceJson(attestationPath, 'Native review attestation')),
|
|
900
|
-
confirmed,
|
|
901
|
-
});
|
|
902
|
-
return {
|
|
903
|
-
command: 'receipt review finalize',
|
|
904
|
-
exitCode: issued.receipt.status === 'passed' ? 0 : 1,
|
|
905
|
-
data: issued,
|
|
906
|
-
text: `Native review receipt ${issued.receipt.status}: ${issued.ref}\n`,
|
|
907
|
-
};
|
|
908
|
-
}
|
|
909
|
-
throw new NativeUsageError(`Unknown receipt review phase: ${reviewPhase}`);
|
|
910
|
-
}
|
|
911
|
-
if (subcommand === 'waive') {
|
|
912
|
-
const acceptanceId = takeOption(rawArgs, '--acceptance');
|
|
913
|
-
const blockedReceiptRef = takeOption(rawArgs, '--blocked-receipt');
|
|
914
|
-
const reason = takeOption(rawArgs, '--reason');
|
|
915
|
-
const risk = takeOption(rawArgs, '--risk');
|
|
916
|
-
const alternativeReceiptRefs = takeMany(rawArgs, '--alternative-receipt');
|
|
917
|
-
const identityPath = takeOption(rawArgs, '--identity');
|
|
918
|
-
const privateKeyEnv = takeOption(rawArgs, '--private-key-env');
|
|
919
|
-
const confirmed = takeFlag(rawArgs, '--confirmed');
|
|
920
|
-
if (!acceptanceId ||
|
|
921
|
-
!blockedReceiptRef ||
|
|
922
|
-
!reason ||
|
|
923
|
-
!risk ||
|
|
924
|
-
!identityPath ||
|
|
925
|
-
!privateKeyEnv) {
|
|
926
|
-
throw new NativeUsageError('receipt waive requires --acceptance, --blocked-receipt, --reason, --risk, --identity, and --private-key-env');
|
|
927
|
-
}
|
|
928
|
-
assertNoArguments(rawArgs);
|
|
929
|
-
const issued = await issueNativeWaiverReceipt({
|
|
930
|
-
paths,
|
|
931
|
-
name,
|
|
932
|
-
acceptanceId,
|
|
933
|
-
blockedReceiptRef,
|
|
934
|
-
reason,
|
|
935
|
-
risk,
|
|
936
|
-
alternativeReceiptRefs,
|
|
937
|
-
signerIdentity: parseNativeReviewIdentity(await readEvidenceJson(identityPath, 'Waiver signer identity')),
|
|
938
|
-
privateKey: privateKeyFromEnvironment(privateKeyEnv),
|
|
939
|
-
confirmed,
|
|
940
|
-
});
|
|
941
|
-
return success('receipt waive', issued, `Native waiver receipt: ${issued.ref}\n`);
|
|
942
|
-
}
|
|
943
534
|
throw new NativeUsageError(`Unknown receipt command: ${subcommand}`);
|
|
944
535
|
}
|
|
945
536
|
if (command === 'next') {
|
|
@@ -954,14 +545,6 @@ async function dispatch(rawArgs, explicitProjectRoot) {
|
|
|
954
545
|
const partialReason = takeOption(rawArgs, '--partial-reason');
|
|
955
546
|
const verificationResult = takeOption(rawArgs, '--result');
|
|
956
547
|
const verificationReport = takeOption(rawArgs, '--report');
|
|
957
|
-
const verificationReceipt = takeOption(rawArgs, '--receipt');
|
|
958
|
-
const hasVerificationReceiptRefs = rawArgs.includes('--evidence-receipt');
|
|
959
|
-
const hasVerificationWaiverRefs = rawArgs.includes('--waiver');
|
|
960
|
-
const verificationReceiptRefs = takeMany(rawArgs, '--evidence-receipt');
|
|
961
|
-
const verificationWaiverRefs = takeMany(rawArgs, '--waiver');
|
|
962
|
-
const independentReviewReceiptRef = takeOption(rawArgs, '--independent-review-receipt');
|
|
963
|
-
const repairFailureCategories = takeMany(rawArgs, '--failure-category');
|
|
964
|
-
const repairFailedCheckIds = takeMany(rawArgs, '--failed-check');
|
|
965
548
|
const repairOverrideSignature = takeOption(rawArgs, '--override-repair');
|
|
966
549
|
const repairOverrideSummary = takeOption(rawArgs, '--override-summary');
|
|
967
550
|
if (verificationResult !== undefined &&
|
|
@@ -978,22 +561,6 @@ async function dispatch(rawArgs, explicitProjectRoot) {
|
|
|
978
561
|
if (allowPartialScopeHash && !confirmed) {
|
|
979
562
|
throw new NativeUsageError('--allow-partial-scope requires --confirmed');
|
|
980
563
|
}
|
|
981
|
-
if ((repairFailureCategories.length > 0 || repairFailedCheckIds.length > 0) &&
|
|
982
|
-
verificationResult !== 'fail') {
|
|
983
|
-
throw new NativeUsageError('--failure-category and --failed-check require --result fail');
|
|
984
|
-
}
|
|
985
|
-
if (verificationReceipt && verificationResult === undefined) {
|
|
986
|
-
throw new NativeUsageError('--receipt requires --result');
|
|
987
|
-
}
|
|
988
|
-
if ((verificationReceiptRefs.length > 0 ||
|
|
989
|
-
verificationWaiverRefs.length > 0 ||
|
|
990
|
-
independentReviewReceiptRef) &&
|
|
991
|
-
verificationResult === undefined) {
|
|
992
|
-
throw new NativeUsageError('--evidence-receipt, --waiver, and --independent-review-receipt require --result');
|
|
993
|
-
}
|
|
994
|
-
if (independentReviewReceiptRef && verificationResult !== 'pass') {
|
|
995
|
-
throw new NativeUsageError('--independent-review-receipt requires --result pass');
|
|
996
|
-
}
|
|
997
564
|
if ((repairOverrideSignature === undefined) !== (repairOverrideSummary === undefined)) {
|
|
998
565
|
throw new NativeUsageError('--override-repair and --override-summary must be provided together');
|
|
999
566
|
}
|
|
@@ -1014,16 +581,6 @@ async function dispatch(rawArgs, explicitProjectRoot) {
|
|
|
1014
581
|
...(partialReason ? { partialReason } : {}),
|
|
1015
582
|
...(verificationResult ? { verificationResult } : {}),
|
|
1016
583
|
...(verificationReport ? { verificationReport } : {}),
|
|
1017
|
-
...(verificationReceipt ? { verificationReceipt } : {}),
|
|
1018
|
-
...(verificationResult && hasVerificationReceiptRefs
|
|
1019
|
-
? {
|
|
1020
|
-
verificationReceiptRefs,
|
|
1021
|
-
}
|
|
1022
|
-
: {}),
|
|
1023
|
-
...(verificationResult && hasVerificationWaiverRefs ? { verificationWaiverRefs } : {}),
|
|
1024
|
-
...(independentReviewReceiptRef ? { independentReviewReceiptRef } : {}),
|
|
1025
|
-
...(repairFailureCategories.length > 0 ? { repairFailureCategories } : {}),
|
|
1026
|
-
...(repairFailedCheckIds.length > 0 ? { repairFailedCheckIds } : {}),
|
|
1027
584
|
...(repairOverrideSignature ? { repairOverrideSignature } : {}),
|
|
1028
585
|
...(repairOverrideSummary ? { repairOverrideSummary } : {}),
|
|
1029
586
|
};
|
|
@@ -1186,7 +743,7 @@ function errorResult(command, error) {
|
|
|
1186
743
|
policyHash: error.policyHash,
|
|
1187
744
|
configPath: '.comet/config.yaml',
|
|
1188
745
|
supportedFixes: [
|
|
1189
|
-
'increase native.snapshot.max_total_bytes or native.snapshot.max_duration_ms',
|
|
746
|
+
'increase native.snapshot.max_files, native.snapshot.max_total_bytes, or native.snapshot.max_duration_ms',
|
|
1190
747
|
'add an explicit native.snapshot.exclude pattern for data outside implementation scope',
|
|
1191
748
|
],
|
|
1192
749
|
requiredAction: 'resolve-native-baseline',
|