@cassiomc1/forgeloop 1.14.0 → 2.0.0-rc.2
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/CONTRIBUTING.md +11 -7
- package/DOCS_INDEX.md +2 -1
- package/ENG/c-development-eng.md +2 -2
- package/ENG/cpp-development-eng.md +2 -2
- package/ENG/dotnet-aspnetcore-development-eng.md +7 -1
- package/ENG/flutter-development-eng.md +4 -2
- package/ENG/go-development-eng.md +2 -2
- package/ENG/java-development-eng.md +3 -3
- package/ENG/nodejs-backend-development-eng.md +8 -4
- package/ENG/php-development-eng.md +3 -3
- package/ENG/python-development-eng.md +205 -0
- package/ENG/rust-development-eng.md +42 -1
- package/ENG/sql-development-eng.md +4 -4
- package/ENG/swift-development-eng.md +5 -4
- package/ENG/test-code-eng.md +1 -1
- package/ENG/typescript-development-eng.md +4 -4
- package/GUIDE_ROUTER.md +6 -0
- package/LICENSE +133 -21
- package/LOOP_SYSTEM_DESIGN.md +10 -10
- package/README.md +28 -39
- package/THIRD_PARTY_NOTICES.md +3 -4
- package/completions/_forgeloop +11 -3
- package/completions/forgeloop.bash +19 -3
- package/completions/forgeloop.fish +61 -1
- package/docs/AGENT_PROTOCOL_SUMMARY.md +50 -40
- package/docs/ARTIFACT_REFERENCE.md +50 -37
- package/docs/CLI_REFERENCE.md +147 -3
- package/docs/DOCUMENTATION_GUIDE.md +6 -4
- package/docs/GETTING_STARTED.md +3 -3
- package/docs/PACKAGE_CONTENTS.md +14 -13
- package/docs/RELEASE_CHECKLIST.md +81 -10
- package/docs/SELF_HOSTED_TESTS.md +121 -0
- package/docs/documentation-manifest.json +25 -12
- package/package.json +15 -10
- package/schemas/task-bundle.schema.json +7 -2
- package/scripts/generate-agent-protocol-summary.mjs +2 -2
- package/scripts/run-mcp-clean-tests.mjs +30 -0
- package/src/adapters/agent-browser/provider.js +14 -11
- package/src/adapters/emulated-services/provider.js +11 -4
- package/src/adapters/temporary-paths.js +18 -0
- package/src/cli.js +146 -210
- package/src/commands/action-show.js +5 -2
- package/src/commands/advance.js +5 -1
- package/src/commands/baseline.js +13 -11
- package/src/commands/checkpoint-revalidate.js +24 -8
- package/src/commands/complete.js +19 -3
- package/src/commands/contract-create.js +3 -1
- package/src/commands/doctor.js +36 -13
- package/src/commands/gate-record.js +20 -31
- package/src/commands/gate-revalidate.js +11 -13
- package/src/commands/handoff-list.js +6 -1
- package/src/commands/handoff-show.js +6 -1
- package/src/commands/migrate-protocol.js +2 -2
- package/src/commands/model-route.js +9 -1
- package/src/commands/next.js +7 -1
- package/src/commands/policy-diff.js +25 -4
- package/src/commands/progress.js +17 -11
- package/src/commands/record-diagnosis.js +3 -0
- package/src/commands/semantic-plan.js +26 -2
- package/src/commands/status.js +6 -1
- package/src/commands/storage-backup.js +15 -0
- package/src/commands/storage-migrate.js +5 -0
- package/src/commands/storage-migration-resume.js +5 -0
- package/src/commands/storage-migration-status.js +44 -0
- package/src/commands/storage-restore-resume.js +7 -0
- package/src/commands/storage-restore.js +8 -0
- package/src/commands/task-abandon.js +1 -1
- package/src/commands/task-list.js +8 -43
- package/src/commands/task-migrate.js +3 -3
- package/src/commands/task-recover.js +10 -2
- package/src/commands/task-scope.js +18 -2
- package/src/commands/task-show.js +16 -2
- package/src/commands/validate-protocol.js +29 -14
- package/src/commands/validate-receipt.js +8 -1
- package/src/config/guides.json +4 -0
- package/src/core/action-ledger-projection.js +10 -3
- package/src/core/actions.js +38 -75
- package/src/core/activation.js +11 -3
- package/src/core/approvals.js +17 -51
- package/src/core/artifact-registry.js +59 -2
- package/src/core/artifacts.js +81 -27
- package/src/core/attachment-paths.js +45 -0
- package/src/core/attestation-coverage.js +6 -1
- package/src/core/attestation-verifier.js +21 -2
- package/src/core/attestation.js +17 -6
- package/src/core/audit.js +6 -1
- package/src/core/bundles.js +160 -66
- package/src/core/checkpoint-revalidation.js +12 -10
- package/src/core/cli-command-definitions.js +109 -7
- package/src/core/code-manifest.js +9 -3
- package/src/core/command-executors.js +182 -126
- package/src/core/command-input.js +21 -1
- package/src/core/completion-artifacts.js +71 -29
- package/src/core/completion-ownership.js +19 -8
- package/src/core/completion-recovery-rebind.js +11 -1
- package/src/core/completion.js +60 -9
- package/src/core/conformance.js +2 -1
- package/src/core/continuity-lint.js +13 -2
- package/src/core/continuity-reconciliation.js +16 -3
- package/src/core/continuity.js +16 -8
- package/src/core/contract-bootstrap-recovery.js +42 -41
- package/src/core/contract-revision.js +8 -9
- package/src/core/decision/artifact.js +2 -1
- package/src/core/decision/events.js +9 -6
- package/src/core/decision/resolver.js +19 -11
- package/src/core/decision/service.js +63 -38
- package/src/core/decision/task-bindings.js +6 -1
- package/src/core/diagnosis-model.js +11 -0
- package/src/core/diagnosis.js +10 -1
- package/src/core/diagnostic-projection.js +29 -12
- package/src/core/diagnostic-record.js +28 -3
- package/src/core/efficiency.js +6 -1
- package/src/core/events.js +316 -97
- package/src/core/execution-prerequisites.js +22 -13
- package/src/core/execution.js +26 -40
- package/src/core/filesystem.js +11 -0
- package/src/core/gate-artifact.js +105 -19
- package/src/core/gate-provenance.js +6 -5
- package/src/core/handoff.js +26 -14
- package/src/core/history.js +39 -35
- package/src/core/hypothesis-projection.js +32 -0
- package/src/core/information-gain-projection.js +104 -100
- package/src/core/inspect.js +12 -3
- package/src/core/integration-invocation-policy.js +10 -0
- package/src/core/integration-resources.js +41 -34
- package/src/core/ledger-event-collection.js +189 -0
- package/src/core/ledger-relations.js +23 -0
- package/src/core/native-storage.js +12 -0
- package/src/core/next-action-continuity.js +31 -9
- package/src/core/next-action-phases.js +1 -1
- package/src/core/next-action-review-phase.js +2 -2
- package/src/core/next-action-verification-phase.js +2 -1
- package/src/core/next-action.js +21 -2
- package/src/core/phase.js +138 -93
- package/src/core/policy-engine.js +12 -13
- package/src/core/preflight-consistency.js +72 -59
- package/src/core/preflight-loaders.js +19 -12
- package/src/core/preflight-model.js +6 -1
- package/src/core/preflight.js +29 -12
- package/src/core/progress.js +21 -10
- package/src/core/protocol-info.js +3 -0
- package/src/core/protocol-migration.js +7 -6
- package/src/core/reconcile-closure.js +162 -24
- package/src/core/recovery-history.js +66 -47
- package/src/core/reflection.js +72 -77
- package/src/core/responsibility.js +25 -13
- package/src/core/route-artifact.js +13 -3
- package/src/core/runtime-context.js +5 -0
- package/src/core/schema-validation.js +8 -3
- package/src/core/settlement.js +12 -1
- package/src/core/signing/bundle-file.js +53 -0
- package/src/core/signing/bundle-reference.js +15 -0
- package/src/core/signing/sigstore.js +60 -33
- package/src/core/signing/statement-file.js +27 -0
- package/src/core/storage-runtime-registry.js +41 -0
- package/src/core/structural-quality/artifacts.js +20 -14
- package/src/core/structural-quality/service.js +81 -56
- package/src/core/target-layout.js +1 -1
- package/src/core/task-claim-state.js +52 -18
- package/src/core/task-command.js +21 -1
- package/src/core/task-conflict-inspection.js +112 -107
- package/src/core/task-descriptor.js +29 -22
- package/src/core/task-discovery.js +288 -90
- package/src/core/task-lock.js +66 -306
- package/src/core/task-migration-validation.js +5 -5
- package/src/core/task-migration.js +17 -287
- package/src/core/task-snapshot.js +51 -8
- package/src/core/task-storage-migration.js +18 -0
- package/src/core/templates.js +20 -8
- package/src/core/test-intelligence/prune.js +5 -1
- package/src/core/trace.js +154 -99
- package/src/core/trajectory-evaluation.js +15 -3
- package/src/core/trajectory-metrics.js +47 -32
- package/src/core/transaction.js +16 -288
- package/src/core/verification-scope.js +20 -12
- package/src/core/work-state.js +100 -59
- package/src/repository-index/binary-manager.js +7 -5
- package/src/storage/artifact-bytes.js +22 -0
- package/src/storage/attachment-binding.js +11 -0
- package/src/storage/attachment-files.js +82 -0
- package/src/storage/attachment-references.js +36 -0
- package/src/storage/backup.js +53 -0
- package/src/storage/capabilities.js +31 -0
- package/src/storage/connection-owner.js +119 -0
- package/src/storage/connection.js +376 -0
- package/src/storage/existing-project-scope.js +45 -0
- package/src/storage/export-destination.js +44 -0
- package/src/storage/exporter.js +284 -0
- package/src/storage/file-durability.js +46 -0
- package/src/storage/importer.js +461 -0
- package/src/storage/index.js +74 -0
- package/src/storage/leases.js +63 -0
- package/src/storage/ledger-event-snapshot.js +150 -0
- package/src/storage/ledger-relations.js +220 -0
- package/src/storage/legacy-maintenance-boundary.js +18 -0
- package/src/storage/legacy-signature.js +115 -0
- package/src/storage/maintenance-handoff.js +129 -0
- package/src/storage/maintenance-owner.js +42 -0
- package/src/storage/maintenance.js +310 -0
- package/src/storage/metadata-json.js +35 -0
- package/src/storage/migration-activate.js +59 -0
- package/src/storage/migration-archive.js +57 -0
- package/src/storage/migration-attachment-root.js +61 -0
- package/src/storage/migration-candidate.js +398 -0
- package/src/storage/migration-publication.js +143 -0
- package/src/storage/migration-rollback-admission.js +54 -0
- package/src/storage/migration-rollback-preparation.js +132 -0
- package/src/storage/migration-rollback-publication.js +183 -0
- package/src/storage/migration-rollback-release.js +66 -0
- package/src/storage/migration-rollback-source-stage.js +103 -0
- package/src/storage/migration-rollback.js +43 -0
- package/src/storage/migration-source-partition.js +56 -0
- package/src/storage/migration-source.js +255 -0
- package/src/storage/migration-terminal.js +39 -0
- package/src/storage/migration-validation.js +75 -0
- package/src/storage/migration.js +43 -0
- package/src/storage/operational-attachments.js +49 -0
- package/src/storage/operational-context.js +50 -0
- package/src/storage/project-backup.js +98 -0
- package/src/storage/project-bootstrap.js +24 -0
- package/src/storage/project-boundary.js +79 -0
- package/src/storage/project-read-snapshot.js +18 -0
- package/src/storage/project-replacement.js +137 -0
- package/src/storage/project-restore.js +203 -0
- package/src/storage/record-definitions.js +45 -0
- package/src/storage/repository.js +507 -0
- package/src/storage/restore-journal.js +62 -0
- package/src/storage/restore-layout.js +30 -0
- package/src/storage/restore-preparation.js +84 -0
- package/src/storage/restore-replacement-archive.js +162 -0
- package/src/storage/restore-replacement-owner.js +31 -0
- package/src/storage/restore-replacement-preparation.js +128 -0
- package/src/storage/restore-replacement.js +142 -0
- package/src/storage/restore-terminal.js +32 -0
- package/src/storage/runtime.js +31 -0
- package/src/storage/schema.js +214 -0
- package/src/storage/singleton-import.js +84 -0
- package/src/storage/snapshot-continuity.js +16 -0
- package/src/storage/snapshot.js +36 -0
- package/src/storage/storage-marker.js +79 -0
- package/src/storage/task-guards.js +107 -0
- package/src/storage/topology.js +42 -0
- package/src/storage/transaction.js +179 -0
- package/src/storage/unit-of-work.js +663 -0
- package/src/storage/windows-process-incarnation.js +206 -0
- package/.forgeloop/forgeloop.gitignore +0 -4
- package/LICENSE-DOCS.md +0 -13
- package/src/core/transaction-maintenance.js +0 -70
|
@@ -58,6 +58,104 @@ export const CLI_TASK_OPTION = Object.freeze({
|
|
|
58
58
|
export const CLI_BOOTSTRAP_OPTIONS = CLI_COMMON_OPTIONS;
|
|
59
59
|
|
|
60
60
|
export const CLI_COMMAND_DEFINITIONS = Object.freeze({
|
|
61
|
+
"storage-restore-resume": Object.freeze({
|
|
62
|
+
name: "storage-restore-resume", category: "project-maintenance", mutation: "MUTATING",
|
|
63
|
+
options: Object.freeze({
|
|
64
|
+
...CLI_COMMON_OPTIONS,
|
|
65
|
+
"--operation": Object.freeze({ targetKey: "operationId", parseType: "string", takesValue: true, valueName: "uuid", missingValueMessage: "--operation requires a UUID", description: "exact retained restore journal operation UUID" }),
|
|
66
|
+
"--expected-owner": Object.freeze({ targetKey: "expectedOwnerId", parseType: "string", takesValue: true, valueName: "uuid", missingValueMessage: "--expected-owner requires a UUID", description: "exact retained maintenance owner UUID" }),
|
|
67
|
+
"--replace-active": Object.freeze({ targetKey: "replaceActive", parseType: "boolean", takesValue: false, description: "explicitly select active replacement with retained outgoing authority" }),
|
|
68
|
+
"--writers-quiesced": Object.freeze({ targetKey: "writersQuiesced", parseType: "boolean", takesValue: false, description: "assert that all writers have been externally stopped" }),
|
|
69
|
+
"--json": Object.freeze({ targetKey: "json", parseType: "boolean", takesValue: false, description: "emit restore recovery metadata" }),
|
|
70
|
+
}),
|
|
71
|
+
writes: [".forgeloop/storage-restores", ".forgeloop/state.sqlite", ".forgeloop/attachments", ".forgeloop/storage-version.json", ".forgeloop/.storage-maintenance", ".forgeloop/storage-maintenance-history"], removes: [], mayExecuteExternalProcess: false,
|
|
72
|
+
description: "Adopts an exact dead local maintenance owner and resumes restore. Incomplete snapshots and prior rebuild intents are retained before rebuilding from bound source; completed preparation requires source parity/domain validation. Use --replace-active for preparation or publication replacement recovery. Conflicting intents and retained handoff locks remain refused.",
|
|
73
|
+
}),
|
|
74
|
+
"storage-restore": Object.freeze({
|
|
75
|
+
name: "storage-restore", category: "project-maintenance", mutation: "MUTATING",
|
|
76
|
+
options: Object.freeze({
|
|
77
|
+
...CLI_COMMON_OPTIONS,
|
|
78
|
+
"--source": Object.freeze({ targetKey: "source", parseType: "string", takesValue: true, valueName: "path", missingValueMessage: "--source requires a path", description: "verified attachment-inclusive backup directory; absolute or relative to the target project" }),
|
|
79
|
+
"--replace-active": Object.freeze({ targetKey: "replaceActive", parseType: "boolean", takesValue: false, description: "explicitly select active replacement with retained outgoing authority" }),
|
|
80
|
+
"--writers-quiesced": Object.freeze({ targetKey: "writersQuiesced", parseType: "boolean", takesValue: false, description: "assert that all writers have been externally stopped" }),
|
|
81
|
+
"--json": Object.freeze({ targetKey: "json", parseType: "boolean", takesValue: false, description: "emit restore activation metadata" }),
|
|
82
|
+
}),
|
|
83
|
+
writes: [".forgeloop/storage-restores", ".forgeloop/state.sqlite", ".forgeloop/attachments", ".forgeloop/storage-version.json", ".forgeloop/.storage-maintenance"], removes: [], mayExecuteExternalProcess: false,
|
|
84
|
+
description: "Verifies and retains a backup before activating it in an operationally fresh project. Existing operational state requires explicit --replace-active, which independently retains and archives outgoing authority before activation; failed restore evidence and maintenance exclusion are retained.",
|
|
85
|
+
}),
|
|
86
|
+
"storage-migration-status": Object.freeze({
|
|
87
|
+
name: "storage-migration-status", category: "project-maintenance", mutation: "READ_ONLY",
|
|
88
|
+
options: Object.freeze({
|
|
89
|
+
...CLI_COMMON_OPTIONS,
|
|
90
|
+
"--json": Object.freeze({ targetKey: "json", parseType: "boolean", takesValue: false, description: "emit bootstrap storage layout and retained maintenance ownership" }),
|
|
91
|
+
}),
|
|
92
|
+
writes: [], removes: [], mayExecuteExternalProcess: false,
|
|
93
|
+
description: "Inspects storage layout and maintenance exclusion without opening or repairing a database.",
|
|
94
|
+
}),
|
|
95
|
+
"storage-migration-resume": Object.freeze({
|
|
96
|
+
name: "storage-migration-resume", category: "project-maintenance", mutation: "MUTATING",
|
|
97
|
+
options: Object.freeze({
|
|
98
|
+
...CLI_COMMON_OPTIONS,
|
|
99
|
+
"--destination": Object.freeze({ targetKey: "destination", parseType: "string", takesValue: true, valueName: "path", missingValueMessage: "--destination requires a path", description: "retained migration directory relative to the project" }),
|
|
100
|
+
"--expected-owner": Object.freeze({ targetKey: "expectedOwnerId", parseType: "string", takesValue: true, valueName: "uuid", missingValueMessage: "--expected-owner requires a UUID", description: "exact retained maintenance owner reported by storage-migration-status" }),
|
|
101
|
+
"--writers-quiesced": Object.freeze({ targetKey: "writersQuiesced", parseType: "boolean", takesValue: false, description: "assert that all writers, including older clients, have been externally stopped" }),
|
|
102
|
+
"--reconcile-unbound-handoff": Object.freeze({ targetKey: "acknowledgeUnboundHandoff", parseType: "boolean", takesValue: false, description: "preserve an unbound legacy handoff by atomic archival before resuming the exact dead owner" }),
|
|
103
|
+
"--json": Object.freeze({ targetKey: "json", parseType: "boolean", takesValue: false, description: "emit recovery verification metadata" }),
|
|
104
|
+
}),
|
|
105
|
+
writes: ["<destination>", ".forgeloop/state.sqlite", ".forgeloop/storage-version.json", ".forgeloop/.storage-maintenance", ".forgeloop/storage-maintenance-history"], removes: [], mayExecuteExternalProcess: false,
|
|
106
|
+
description: "Adopts an exact dead local owner and continues verified publication stages. Unrecorded capture and unbound candidate files remain refused; an unbound legacy handoff is archived opaquely only with explicit --reconcile-unbound-handoff acknowledgement.",
|
|
107
|
+
}),
|
|
108
|
+
"storage-rollback": Object.freeze({
|
|
109
|
+
name: "storage-rollback", category: "project-maintenance", mutation: "MUTATING",
|
|
110
|
+
options: Object.freeze({
|
|
111
|
+
...CLI_COMMON_OPTIONS,
|
|
112
|
+
"--destination": Object.freeze({ targetKey: "destination", parseType: "string", takesValue: true, valueName: "path", missingValueMessage: "--destination requires a path", description: "retained published migration directory relative to the project" }),
|
|
113
|
+
"--legacy-root": Object.freeze({ targetKey: "legacyRoot", parseType: "string", takesValue: true, valueName: "path", missingValueMessage: "--legacy-root requires a path", description: "clean supported pinned legacy checkout used for actual target validation" }),
|
|
114
|
+
"--writers-quiesced": Object.freeze({ targetKey: "writersQuiesced", parseType: "boolean", takesValue: false, description: "assert that all writers, including older clients, have been externally stopped and excluded" }),
|
|
115
|
+
"--native-writes-excluded": Object.freeze({ targetKey: "nativeWritesExcluded", parseType: "boolean", takesValue: false, description: "assert that native writes have been excluded since migration; snapshot equality alone does not prove this" }),
|
|
116
|
+
"--json": Object.freeze({ targetKey: "json", parseType: "boolean", takesValue: false, description: "emit restoration and target-validation metadata" }),
|
|
117
|
+
}),
|
|
118
|
+
writes: ["<destination>", "export-index.json", ".forgeloop/task-state", ".forgeloop/attachments", ".forgeloop/.storage-maintenance"],
|
|
119
|
+
removes: [".forgeloop/state.sqlite", ".forgeloop/storage-version.json"], mayExecuteExternalProcess: true,
|
|
120
|
+
description: "Conditionally restores preserved source before native writes, retaining original native bytes and validating every task with the supported pinned legacy target before release. Failures retain exclusion; post-write restoration is refused.",
|
|
121
|
+
}),
|
|
122
|
+
"storage-rollback-resume": Object.freeze({
|
|
123
|
+
name: "storage-rollback-resume", category: "project-maintenance", mutation: "MUTATING",
|
|
124
|
+
options: Object.freeze({
|
|
125
|
+
...CLI_COMMON_OPTIONS,
|
|
126
|
+
"--expected-owner": Object.freeze({ targetKey: "expectedOwnerId", parseType: "string", takesValue: true, valueName: "uuid", missingValueMessage: "--expected-owner requires a UUID", description: "exact retained dead local owner reported by storage-migration-status" }),
|
|
127
|
+
"--destination": Object.freeze({ targetKey: "destination", parseType: "string", takesValue: true, valueName: "path", missingValueMessage: "--destination requires a path", description: "retained migration with recorded rollback preparation, staging or publication" }),
|
|
128
|
+
"--legacy-root": Object.freeze({ targetKey: "legacyRoot", parseType: "string", takesValue: true, valueName: "path", missingValueMessage: "--legacy-root requires a path", description: "clean supported pinned legacy checkout used for actual target validation" }),
|
|
129
|
+
"--writers-quiesced": Object.freeze({ targetKey: "writersQuiesced", parseType: "boolean", takesValue: false, description: "assert that all writers, including older clients, have been externally stopped and excluded" }),
|
|
130
|
+
"--native-writes-excluded": Object.freeze({ targetKey: "nativeWritesExcluded", parseType: "boolean", takesValue: false, description: "assert that native writes have been excluded since migration; snapshot equality alone does not prove this" }),
|
|
131
|
+
"--json": Object.freeze({ targetKey: "json", parseType: "boolean", takesValue: false, description: "emit restoration and target-validation metadata" }),
|
|
132
|
+
}),
|
|
133
|
+
writes: ["<destination>", "export-index.json", ".forgeloop/task-state", ".forgeloop/attachments", ".forgeloop/.storage-maintenance"],
|
|
134
|
+
removes: [".forgeloop/state.sqlite", ".forgeloop/storage-version.json"], mayExecuteExternalProcess: true,
|
|
135
|
+
description: "Resumes recorded rollback preparation, staging or publication under exact dead-owner adoption, revalidates native/source locations, and validates every task with the pinned target before release. Unbound attempts remain refused.",
|
|
136
|
+
}),
|
|
137
|
+
"storage-migrate": Object.freeze({
|
|
138
|
+
name: "storage-migrate", category: "project-maintenance", mutation: "MUTATING",
|
|
139
|
+
options: Object.freeze({
|
|
140
|
+
...CLI_COMMON_OPTIONS,
|
|
141
|
+
"--destination": Object.freeze({ targetKey: "destination", parseType: "string", takesValue: true, valueName: "path", missingValueMessage: "--destination requires a path", description: "new retained migration directory relative to the project; missing parent directories are created" }),
|
|
142
|
+
"--writers-quiesced": Object.freeze({ targetKey: "writersQuiesced", parseType: "boolean", takesValue: false, description: "assert that all writers, including older clients, have been externally stopped" }),
|
|
143
|
+
"--json": Object.freeze({ targetKey: "json", parseType: "boolean", takesValue: false, description: "emit migration publication and verification metadata" }),
|
|
144
|
+
}),
|
|
145
|
+
writes: ["<destination>", ".forgeloop/state.sqlite", ".forgeloop/storage-version.json", ".forgeloop/.storage-maintenance"], removes: [], mayExecuteExternalProcess: false,
|
|
146
|
+
description: "Validates, retains and archives legacy state before activating SQLite. Failed attempts retain maintenance exclusion; resume requires the exact retained owner and a verified candidate.",
|
|
147
|
+
}),
|
|
148
|
+
"storage-backup": Object.freeze({
|
|
149
|
+
name: "storage-backup", category: "project-maintenance", mutation: "MUTATING",
|
|
150
|
+
options: Object.freeze({
|
|
151
|
+
...CLI_COMMON_OPTIONS,
|
|
152
|
+
"--destination": Object.freeze({ targetKey: "destination", parseType: "string", takesValue: true, valueName: "path", missingValueMessage: "--destination requires a path", description: "new backup file or attachment-inclusive directory relative to the project; parent directory must exist" }),
|
|
153
|
+
"--include-attachments": Object.freeze({ targetKey: "includeAttachments", parseType: "boolean", takesValue: false, description: "create a new backup directory including all canonically referenced attachment bytes" }),
|
|
154
|
+
"--json": Object.freeze({ targetKey: "json", parseType: "boolean", takesValue: false, description: "emit backup metadata" }),
|
|
155
|
+
}),
|
|
156
|
+
writes: ["<destination>"], removes: [], mayExecuteExternalProcess: false,
|
|
157
|
+
description: "Creates an exclusive native SQLite backup, optionally including canonically referenced attachments in a retained directory.",
|
|
158
|
+
}),
|
|
61
159
|
"protocol-info": Object.freeze({
|
|
62
160
|
name: "protocol-info",
|
|
63
161
|
category: "diagnostics",
|
|
@@ -1188,7 +1286,7 @@ export const CLI_COMMAND_DEFINITIONS = Object.freeze({
|
|
|
1188
1286
|
writes: [".forgeloop/task-state/<taskKey>/executions/exec-<id>.json", ".forgeloop/task-state/<taskKey>/work-state.json", ".forgeloop/task-state/<taskKey>/events.ndjson"],
|
|
1189
1287
|
removes: [],
|
|
1190
1288
|
mayExecuteExternalProcess: true,
|
|
1191
|
-
description: "Refreshes the work-state checkpoint of an EXECUTING, VERIFYING, or REVIEWING task whose objective is already satisfied in the current repository, after contract-bound executed evidence, so canonical completion can proceed.",
|
|
1289
|
+
description: "Refreshes the work-state checkpoint of an EXECUTING, VERIFYING, CORRECTING, or REVIEWING task whose objective is already satisfied in the current repository, after contract-bound executed evidence, so canonical completion can proceed.",
|
|
1192
1290
|
}),
|
|
1193
1291
|
"validate-receipt": Object.freeze({
|
|
1194
1292
|
name: "validate-receipt",
|
|
@@ -1311,13 +1409,15 @@ export const CLI_COMMAND_DEFINITIONS = Object.freeze({
|
|
|
1311
1409
|
mutation: "MUTATING",
|
|
1312
1410
|
options: Object.freeze({
|
|
1313
1411
|
...CLI_COMMON_OPTIONS,
|
|
1412
|
+
"--destination": Object.freeze({ targetKey: "destination", parseType: "string", takesValue: true, valueName: "path", description: "retained source and publication evidence destination" }),
|
|
1413
|
+
"--writers-quiesced": Object.freeze({ targetKey: "writersQuiesced", parseType: "boolean", takesValue: false, description: "confirm all legacy writers are stopped and excluded" }),
|
|
1314
1414
|
"--dry-run": Object.freeze({ targetKey: "dryRun", parseType: "boolean", takesValue: false, description: "show planned migration actions without moving files" }),
|
|
1315
1415
|
"--json": Object.freeze({ targetKey: "json", parseType: "boolean", takesValue: false, description: "emit structured output as JSON" }),
|
|
1316
1416
|
}),
|
|
1317
|
-
writes: [".forgeloop/
|
|
1417
|
+
writes: [".forgeloop/state.sqlite", ".forgeloop/storage-version.json", "<destination>/*"],
|
|
1318
1418
|
removes: [".forgeloop/current-contract.json", ".forgeloop/routing-result.json", ".forgeloop/work-state.json", ".forgeloop/preflight.json", ".forgeloop/execution-receipt.json", ".forgeloop/events.ndjson", ".forgeloop/continuity.json", ".forgeloop/gates", ".forgeloop/executions"],
|
|
1319
1419
|
mayExecuteExternalProcess: false,
|
|
1320
|
-
description: "Migrates
|
|
1420
|
+
description: "Migrates legacy singleton task state into SQLite with retained source and verified publication evidence.",
|
|
1321
1421
|
}),
|
|
1322
1422
|
"migrate-protocol": Object.freeze({
|
|
1323
1423
|
name: "migrate-protocol",
|
|
@@ -1325,11 +1425,13 @@ export const CLI_COMMAND_DEFINITIONS = Object.freeze({
|
|
|
1325
1425
|
mutation: "MUTATING",
|
|
1326
1426
|
options: Object.freeze({
|
|
1327
1427
|
...CLI_COMMON_OPTIONS,
|
|
1428
|
+
"--destination": Object.freeze({ targetKey: "destination", parseType: "string", takesValue: true, valueName: "path", description: "retained source and publication evidence destination" }),
|
|
1429
|
+
"--writers-quiesced": Object.freeze({ targetKey: "writersQuiesced", parseType: "boolean", takesValue: false, description: "confirm all legacy writers are stopped and excluded" }),
|
|
1328
1430
|
"--to": Object.freeze({ targetKey: "to", parseType: "string", takesValue: true, valueName: "protocolVersion", missingValueMessage: "--to requires a protocol version", description: "target supported protocol version" }),
|
|
1329
1431
|
"--dry-run": Object.freeze({ targetKey: "dryRun", parseType: "boolean", takesValue: false, description: "show migration actions without writing or deleting artifacts" }),
|
|
1330
1432
|
"--json": Object.freeze({ targetKey: "json", parseType: "boolean", takesValue: false, description: "emit structured migration result as JSON" }),
|
|
1331
1433
|
}),
|
|
1332
|
-
writes: [".forgeloop/
|
|
1434
|
+
writes: [".forgeloop/state.sqlite", ".forgeloop/storage-version.json", "<destination>/*"],
|
|
1333
1435
|
removes: [".forgeloop/current-contract.json", ".forgeloop/routing-result.json", ".forgeloop/work-state.json", ".forgeloop/preflight.json", ".forgeloop/execution-receipt.json", ".forgeloop/events.ndjson", ".forgeloop/continuity.json", ".forgeloop/gates", ".forgeloop/executions"],
|
|
1334
1436
|
mayExecuteExternalProcess: false,
|
|
1335
1437
|
description: "Safely migrates explicitly supported protocol state; unknown target versions fail without rewriting artifacts.",
|
|
@@ -1345,10 +1447,10 @@ export const CLI_COMMAND_DEFINITIONS = Object.freeze({
|
|
|
1345
1447
|
"--stale-only": Object.freeze({ targetKey: "staleOnly", parseType: "boolean", takesValue: false, description: "release only a lock whose lease is expired" }),
|
|
1346
1448
|
"--json": Object.freeze({ targetKey: "json", parseType: "boolean", takesValue: false, description: "emit structured output as JSON" }),
|
|
1347
1449
|
}),
|
|
1348
|
-
writes: [],
|
|
1349
|
-
removes: [
|
|
1450
|
+
writes: [".forgeloop/state.sqlite"],
|
|
1451
|
+
removes: [],
|
|
1350
1452
|
mayExecuteExternalProcess: false,
|
|
1351
|
-
description: "
|
|
1453
|
+
description: "Releases a canonical SQLite operation lease to recover an interrupted task.",
|
|
1352
1454
|
}),
|
|
1353
1455
|
"task-recover": Object.freeze({
|
|
1354
1456
|
name: "task-recover",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { withTaskTransaction } from "./transaction.js";
|
|
1
2
|
import { createHash } from "node:crypto";
|
|
2
3
|
import path from "node:path";
|
|
3
4
|
|
|
@@ -15,6 +16,7 @@ import {
|
|
|
15
16
|
taskCodeManifestHistoryPath,
|
|
16
17
|
} from "./task-paths.js";
|
|
17
18
|
import { ensureWithin, fileExists } from "./filesystem.js";
|
|
19
|
+
import { operationalArtifactExists } from "../storage/operational-context.js";
|
|
18
20
|
import { resolveRevisionProvider } from "./revision/provider.js";
|
|
19
21
|
import { REVISION_PROVIDERS } from "./revision/registry.js";
|
|
20
22
|
|
|
@@ -217,10 +219,14 @@ export async function readCodeManifest({ target, packageRoot = getPackageRoot(),
|
|
|
217
219
|
}
|
|
218
220
|
}
|
|
219
221
|
|
|
220
|
-
export async function writeCodeManifest(
|
|
222
|
+
export async function writeCodeManifest(options = {}) {
|
|
223
|
+
return withTaskTransaction({ target: options.target, taskId: options.taskId, packageRoot: options.packageRoot, operation: "code-manifest-capture" }, () => writeCodeManifestInTransaction(options));
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
async function writeCodeManifestInTransaction({ target, packageRoot = getPackageRoot(), taskId, manifest } = {}) {
|
|
221
227
|
const value = await validateCodeManifest(manifest, packageRoot);
|
|
222
228
|
const relativePath = taskCodeManifestPath(taskId);
|
|
223
|
-
if (await fileExists(ensureWithin(target, relativePath))) {
|
|
229
|
+
if (operationalArtifactExists(target, relativePath) ?? await fileExists(ensureWithin(target, relativePath))) {
|
|
224
230
|
let previous;
|
|
225
231
|
try {
|
|
226
232
|
previous = await readCodeManifest({ target, packageRoot, taskId });
|
|
@@ -232,7 +238,7 @@ export async function writeCodeManifest({ target, packageRoot = getPackageRoot()
|
|
|
232
238
|
throw manifestError("E_ATTESTATION_MANIFEST_INVALID", "Code manifest is immutable within a verification cycle", [relativePath]);
|
|
233
239
|
}
|
|
234
240
|
const historyPath = taskCodeManifestHistoryPath(taskId, previousCycle);
|
|
235
|
-
if (!(await fileExists(ensureWithin(target, historyPath)))) {
|
|
241
|
+
if (!(operationalArtifactExists(target, historyPath) ?? await fileExists(ensureWithin(target, historyPath)))) {
|
|
236
242
|
await writeJsonArtifact(target, historyPath, previous.value, "code-manifest", packageRoot, { taskId, operation: "code-manifest-history" });
|
|
237
243
|
}
|
|
238
244
|
}
|
|
@@ -1,113 +1,111 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
1
|
+
const runDoctor = async (...args) => (await import("../commands/doctor.js")).runDoctor(...args);
|
|
2
|
+
const runStatus = async (...args) => (await import("../commands/status.js")).runStatus(...args);
|
|
3
|
+
const runValidateState = async (...args) => (await import("../commands/validate-state.js")).runValidateState(...args);
|
|
4
|
+
const runClearState = async (...args) => (await import("../commands/clear-state.js")).runClearState(...args);
|
|
5
|
+
const runCheckpointRevalidate = async (...args) => (await import("../commands/checkpoint-revalidate.js")).runCheckpointRevalidate(...args);
|
|
6
|
+
const inspectTarget = async (...args) => (await import("../commands/inspect.js")).inspectTarget(...args);
|
|
7
|
+
const runInit = async (...args) => (await import("../commands/init.js")).runInit(...args);
|
|
8
|
+
const runRoute = async (...args) => (await import("../commands/route.js")).runRoute(...args);
|
|
9
|
+
const runValidateReceipt = async (...args) => (await import("../commands/validate-receipt.js")).runValidateReceipt(...args);
|
|
10
|
+
const runValidateProtocol = async (...args) => (await import("../commands/validate-protocol.js")).runValidateProtocol(...args);
|
|
11
|
+
const runUpdate = async (...args) => (await import("../commands/update.js")).runUpdate(...args);
|
|
12
|
+
const runActivate = async (...args) => (await import("../commands/activate.js")).runActivate(...args);
|
|
13
|
+
const runAdvance = async (...args) => (await import("../commands/advance.js")).runAdvance(...args);
|
|
14
|
+
const runPreflight = async (...args) => (await import("../commands/preflight.js")).runPreflight(...args);
|
|
15
|
+
const runQualityBaseline = async (...args) => (await import("../commands/quality-baseline.js")).runQualityBaseline(...args);
|
|
16
|
+
const runQualityVerify = async (...args) => (await import("../commands/quality-verify.js")).runQualityVerify(...args);
|
|
17
|
+
const runQualityStatus = async (...args) => (await import("../commands/quality-status.js")).runQualityStatus(...args);
|
|
18
|
+
const runComplete = async (...args) => (await import("../commands/complete.js")).runComplete(...args);
|
|
19
|
+
const runAudit = async (...args) => (await import("../commands/audit.js")).runAudit(...args);
|
|
20
|
+
const runReport = async (...args) => (await import("../commands/report.js")).runReport(...args);
|
|
21
|
+
const runPolicy = async (...args) => (await import("../commands/policy.js")).runPolicy(...args);
|
|
22
|
+
const runPolicyDiscover = async (...args) => (await import("../commands/policy-discover.js")).runPolicyDiscover(...args);
|
|
23
|
+
const runPolicyStatus = async (...args) => (await import("../commands/policy-status.js")).runPolicyStatus(...args);
|
|
24
|
+
const runPolicyDiff = async (...args) => (await import("../commands/policy-diff.js")).runPolicyDiff(...args);
|
|
25
|
+
const runRuleVerify = async (...args) => (await import("../commands/rule-verify.js")).runRuleVerify(...args);
|
|
26
|
+
const runBaseline = async (...args) => (await import("../commands/baseline.js")).runBaseline(...args);
|
|
27
|
+
const runProfileInterview = async (...args) => (await import("../commands/profile-interview.js")).runProfileInterview(...args);
|
|
28
|
+
const runBundle = async (...args) => (await import("../commands/bundle.js")).runBundle(...args);
|
|
29
|
+
const runPrepareCompletion = async (...args) => (await import("../commands/prepare-completion.js")).runPrepareCompletion(...args);
|
|
30
|
+
const runRecordCheck = async (...args) => (await import("../commands/record-check.js")).runRecordCheck(...args);
|
|
31
|
+
const runCheck = async (...args) => (await import("../commands/run-check.js")).runCheck(...args);
|
|
32
|
+
const runAction = async (...args) => (await import("../commands/run-action.js")).runAction(...args);
|
|
33
|
+
const runActionPropose = async (...args) => (await import("../commands/action-propose.js")).runActionPropose(...args);
|
|
34
|
+
const runActionRecord = async (...args) => (await import("../commands/action-record.js")).runActionRecord(...args);
|
|
35
|
+
const runActionShow = async (...args) => (await import("../commands/action-show.js")).runActionShow(...args);
|
|
36
|
+
const runActionAuthorize = async (...args) => (await import("../commands/action-authorize.js")).runActionAuthorize(...args);
|
|
37
|
+
const runActionVerify = async (...args) => (await import("../commands/action-verify.js")).runActionVerify(...args);
|
|
38
|
+
const runActionReconcile = async (...args) => (await import("../commands/action-reconcile.js")).runActionReconcile(...args);
|
|
39
|
+
const runMetrics = async (...args) => (await import("../commands/metrics.js")).runMetrics(...args);
|
|
40
|
+
const runUsageRecord = async (...args) => (await import("../commands/usage-record.js")).runUsageRecord(...args);
|
|
41
|
+
const runEfficiency = async (...args) => (await import("../commands/efficiency.js")).runEfficiency(...args);
|
|
42
|
+
const runEval = async (...args) => (await import("../commands/eval.js")).runEval(...args);
|
|
43
|
+
const runApprovalRequest = async (...args) => (await import("../commands/approval-request.js")).runApprovalRequest(...args);
|
|
44
|
+
const runApprovalResolve = async (...args) => (await import("../commands/approval-resolve.js")).runApprovalResolve(...args);
|
|
45
|
+
const reconcileClosure = async (...args) => (await import("../commands/reconcile-closure.js")).reconcileClosure(...args);
|
|
46
|
+
const runRecordTerminalResult = async (...args) => (await import("../commands/record-terminal-result.js")).runRecordTerminalResult(...args);
|
|
47
|
+
const runRecordDiagnosis = async (...args) => (await import("../commands/record-diagnosis.js")).runRecordDiagnosis(...args);
|
|
48
|
+
const runRecordIntervention = async (...args) => (await import("../commands/record-intervention.js")).runRecordIntervention(...args);
|
|
49
|
+
const runRecordHypothesisDisposition = async (...args) => (await import("../commands/record-hypothesis-disposition.js")).runRecordHypothesisDisposition(...args);
|
|
50
|
+
const runHistory = async (...args) => (await import("../commands/history.js")).runHistory(...args);
|
|
51
|
+
const runTrace = async (...args) => (await import("../commands/trace.js")).runTrace(...args);
|
|
52
|
+
const runReflect = async (...args) => (await import("../commands/reflect.js")).runReflect(...args);
|
|
53
|
+
const runProgress = async (...args) => (await import("../commands/progress.js")).runProgress(...args);
|
|
54
|
+
const runRecordDecisionCriterion = async (...args) => (await import("../commands/record-decision-criterion.js")).runRecordDecisionCriterion(...args);
|
|
55
|
+
const runNext = async (...args) => (await import("../commands/next.js")).runNext(...args);
|
|
56
|
+
const runContinuity = async (...args) => (await import("../commands/continuity.js")).runContinuity(...args);
|
|
57
|
+
const runRecordContinuity = async (...args) => (await import("../commands/record-continuity.js")).runRecordContinuity(...args);
|
|
58
|
+
const runReconcileContinuity = async (...args) => (await import("../commands/reconcile-continuity.js")).runReconcileContinuity(...args);
|
|
59
|
+
const runClearContinuity = async (...args) => (await import("../commands/clear-continuity.js")).runClearContinuity(...args);
|
|
60
|
+
const runTaskCreate = async (...args) => (await import("../commands/task-create.js")).runTaskCreate(...args);
|
|
61
|
+
const runDiscover = async (...args) => (await import("../commands/discover.js")).runDiscover(...args);
|
|
62
|
+
const runContractCreate = async (...args) => (await import("../commands/contract-create.js")).runContractCreate(...args);
|
|
63
|
+
const runContractRevise = async (...args) => (await import("../commands/contract-revise.js")).runContractRevise(...args);
|
|
64
|
+
const runGateRecord = async (...args) => (await import("../commands/gate-record.js")).runGateRecord(...args);
|
|
65
|
+
const runGateRevalidate = async (...args) => (await import("../commands/gate-revalidate.js")).runGateRevalidate(...args);
|
|
66
|
+
const runTaskList = async (...args) => (await import("../commands/task-list.js")).runTaskList(...args);
|
|
67
|
+
const runTaskShow = async (...args) => (await import("../commands/task-show.js")).runTaskShow(...args);
|
|
68
|
+
const runTaskScope = async (...args) => (await import("../commands/task-scope.js")).runTaskScope(...args);
|
|
69
|
+
const runTaskMigrate = async (...args) => (await import("../commands/task-migrate.js")).runTaskMigrate(...args);
|
|
70
|
+
const runMigrateProtocol = async (...args) => (await import("../commands/migrate-protocol.js")).runMigrateProtocol(...args);
|
|
71
|
+
const runTaskUnlock = async (...args) => (await import("../commands/task-unlock.js")).runTaskUnlock(...args);
|
|
72
|
+
const runTaskRecover = async (...args) => (await import("../commands/task-recover.js")).runTaskRecover(...args);
|
|
73
|
+
const runTaskAbandon = async (...args) => (await import("../commands/task-abandon.js")).runTaskAbandon(...args);
|
|
74
|
+
const runTaskResume = async (...args) => (await import("../commands/task-resume.js")).runTaskResume(...args);
|
|
75
|
+
const runTaskRepairLegacyRecovery = async (...args) => (await import("../commands/task-repair-legacy-recovery.js")).runTaskRepairLegacyRecovery(...args);
|
|
76
|
+
const runTaskRepairContractBootstrap = async (...args) => (await import("../commands/task-repair-contract-bootstrap.js")).runTaskRepairContractBootstrap(...args);
|
|
77
|
+
const runTaskMigrateContractBootstrapRepair = async (...args) => (await import("../commands/task-migrate-contract-bootstrap-repair.js")).runTaskMigrateContractBootstrapRepair(...args);
|
|
78
|
+
const runTaskLockStatus = async (...args) => (await import("../commands/task-lock-status.js")).runTaskLockStatus(...args);
|
|
79
|
+
const runProtocolInfo = async (...args) => (await import("../commands/protocol-info.js")).runProtocolInfo(...args);
|
|
80
|
+
const runDecisionStatus = async (...args) => (await import("../commands/decision-status.js")).runDecisionStatus(...args);
|
|
81
|
+
const runDecisionShow = async (...args) => (await import("../commands/decision-show.js")).runDecisionShow(...args);
|
|
82
|
+
const runContextPlan = async (...args) => (await import("../commands/context-plan.js")).runContextPlan(...args);
|
|
83
|
+
const runModelRoute = async (...args) => (await import("../commands/model-route.js")).runModelRoute(...args);
|
|
84
|
+
const runSemanticPlan = async (...args) => (await import("../commands/semantic-plan.js")).runSemanticPlan(...args);
|
|
85
|
+
const runTestInventory = async (...args) => (await import("../commands/test-inventory.js")).runTestInventory(...args);
|
|
86
|
+
const runTestUtility = async (...args) => (await import("../commands/test-utility.js")).runTestUtility(...args);
|
|
87
|
+
const runTestPrunePlan = async (...args) => (await import("../commands/test-prune-plan.js")).runTestPrunePlan(...args);
|
|
88
|
+
const runTestPruneProbe = async (...args) => (await import("../commands/test-prune-probe.js")).runTestPruneProbe(...args);
|
|
89
|
+
const runWorkspaceBind = async (...args) => (await import("../commands/workspace-bind.js")).runWorkspaceBind(...args);
|
|
90
|
+
const runWorkspaceStatus = async (...args) => (await import("../commands/workspace-status.js")).runWorkspaceStatus(...args);
|
|
91
|
+
const runHandoffCreate = async (...args) => (await import("../commands/handoff-create.js")).runHandoffCreate(...args);
|
|
92
|
+
const runHandoffList = async (...args) => (await import("../commands/handoff-list.js")).runHandoffList(...args);
|
|
93
|
+
const runHandoffShow = async (...args) => (await import("../commands/handoff-show.js")).runHandoffShow(...args);
|
|
94
|
+
const runHandoffAccept = async (...args) => (await import("../commands/handoff-accept.js")).runHandoffAccept(...args);
|
|
95
|
+
const runResponsibilitySet = async (...args) => (await import("../commands/responsibility-set.js")).runResponsibilitySet(...args);
|
|
96
|
+
const runResponsibilityStatus = async (...args) => (await import("../commands/responsibility-status.js")).runResponsibilityStatus(...args);
|
|
97
|
+
const runVerifyScope = async (...args) => (await import("../commands/verify-scope.js")).runVerifyScope(...args);
|
|
98
|
+
const runAttestationCreate = async (...args) => (await import("../commands/attestation-create.js")).runAttestationCreate(...args);
|
|
99
|
+
const runAttestationVerify = async (...args) => (await import("../commands/attestation-verify.js")).runAttestationVerify(...args);
|
|
100
|
+
const runAttestationStatus = async (...args) => (await import("../commands/attestation-status.js")).runAttestationStatus(...args);
|
|
101
|
+
const runAttestationVerifyRange = async (...args) => (await import("../commands/attestation-verify-range.js")).runAttestationVerifyRange(...args);
|
|
102
102
|
import { exitCodeForAttestationResult } from "./exit-codes.js";
|
|
103
|
-
import
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
runSearch,
|
|
110
|
-
} from "../commands/repository-index.js";
|
|
103
|
+
const runRepositoryIndexRebuild = async (...args) => (await import("../commands/repository-index.js")).runRepositoryIndexRebuild(...args);
|
|
104
|
+
const runRepositoryIndexSetup = async (...args) => (await import("../commands/repository-index.js")).runRepositoryIndexSetup(...args);
|
|
105
|
+
const runRepositoryIndexStart = async (...args) => (await import("../commands/repository-index.js")).runRepositoryIndexStart(...args);
|
|
106
|
+
const runRepositoryIndexStatus = async (...args) => (await import("../commands/repository-index.js")).runRepositoryIndexStatus(...args);
|
|
107
|
+
const runRepositoryIndexStop = async (...args) => (await import("../commands/repository-index.js")).runRepositoryIndexStop(...args);
|
|
108
|
+
const runSearch = async (...args) => (await import("../commands/repository-index.js")).runSearch(...args);
|
|
111
109
|
|
|
112
110
|
/**
|
|
113
111
|
* Canonical transport-neutral command executors.
|
|
@@ -120,7 +118,39 @@ import {
|
|
|
120
118
|
* The CLI renders these results; MCP and other integrations consume them
|
|
121
119
|
* directly. No ownership, recovery, or lifecycle logic may live here.
|
|
122
120
|
*/
|
|
123
|
-
|
|
121
|
+
const RAW_COMMAND_EXECUTORS = {
|
|
122
|
+
"storage-restore-resume": async ({ target, packageRoot, options }) => {
|
|
123
|
+
const { runStorageRestoreResume } = await import("../commands/storage-restore-resume.js");
|
|
124
|
+
return { result: await runStorageRestoreResume({ target, packageRoot, operationId: options.operationId, expectedOwnerId: options.expectedOwnerId, writersQuiesced: options.writersQuiesced, replaceActive: options.replaceActive }), exitCode: 0 };
|
|
125
|
+
},
|
|
126
|
+
"storage-restore": async ({ target, packageRoot, options }) => {
|
|
127
|
+
const { runStorageRestore } = await import("../commands/storage-restore.js");
|
|
128
|
+
return { result: await runStorageRestore({ target, packageRoot, source: options.source, writersQuiesced: options.writersQuiesced, replaceActive: options.replaceActive }), exitCode: 0 };
|
|
129
|
+
},
|
|
130
|
+
"storage-migration-status": async ({ target }) => {
|
|
131
|
+
const { runStorageMigrationStatus } = await import("../commands/storage-migration-status.js");
|
|
132
|
+
return { result: await runStorageMigrationStatus({ target }), exitCode: 0 };
|
|
133
|
+
},
|
|
134
|
+
"storage-migration-resume": async ({ target, packageRoot, options }) => {
|
|
135
|
+
const { runStorageMigrationResume } = await import("../commands/storage-migration-resume.js");
|
|
136
|
+
return { result: await runStorageMigrationResume({ target, packageRoot, destination: options.destination, expectedOwnerId: options.expectedOwnerId, writersQuiesced: options.writersQuiesced, acknowledgeUnboundHandoff: options.acknowledgeUnboundHandoff }), exitCode: 0 };
|
|
137
|
+
},
|
|
138
|
+
"storage-rollback-resume": async ({ target, packageRoot, options }) => {
|
|
139
|
+
const { resumeProjectStorageRollback } = await import("../storage/migration-rollback.js");
|
|
140
|
+
return { result: await resumeProjectStorageRollback(target, { packageRoot, destination: options.destination, legacyRoot: options.legacyRoot, expectedOwnerId: options.expectedOwnerId, writersQuiesced: options.writersQuiesced, nativeWritesExcluded: options.nativeWritesExcluded }), exitCode: 0 };
|
|
141
|
+
},
|
|
142
|
+
"storage-rollback": async ({ target, packageRoot, options }) => {
|
|
143
|
+
const { rollbackProjectStorage } = await import("../storage/migration-rollback.js");
|
|
144
|
+
return { result: await rollbackProjectStorage(target, { packageRoot, destination: options.destination, legacyRoot: options.legacyRoot, writersQuiesced: options.writersQuiesced, nativeWritesExcluded: options.nativeWritesExcluded }), exitCode: 0 };
|
|
145
|
+
},
|
|
146
|
+
"storage-migrate": async ({ target, packageRoot, options }) => {
|
|
147
|
+
const { runStorageMigrate } = await import("../commands/storage-migrate.js");
|
|
148
|
+
return { result: await runStorageMigrate({ target, packageRoot, destination: options.destination, writersQuiesced: options.writersQuiesced }), exitCode: 0 };
|
|
149
|
+
},
|
|
150
|
+
"storage-backup": async ({ target, options }) => {
|
|
151
|
+
const { runStorageBackup } = await import("../commands/storage-backup.js");
|
|
152
|
+
return { result: await runStorageBackup({ target, destination: options.destination, includeAttachments: options.includeAttachments }), exitCode: 0 };
|
|
153
|
+
},
|
|
124
154
|
discover: async ({ target, packageRoot, options }) => ({
|
|
125
155
|
result: await runDiscover({ target, packageRoot, taskId: options.taskId }),
|
|
126
156
|
exitCode: 0,
|
|
@@ -252,6 +282,7 @@ export const COMMAND_EXECUTORS = {
|
|
|
252
282
|
target,
|
|
253
283
|
packageRoot,
|
|
254
284
|
to: options.to,
|
|
285
|
+
persistence: runtimeContext?.forgeloopPersistence ?? null,
|
|
255
286
|
taskId: options.taskId,
|
|
256
287
|
authorityContext,
|
|
257
288
|
runtimeContext,
|
|
@@ -495,20 +526,24 @@ export const COMMAND_EXECUTORS = {
|
|
|
495
526
|
}),
|
|
496
527
|
exitCode: 0,
|
|
497
528
|
}),
|
|
498
|
-
"record-diagnosis": async ({ target, packageRoot, options }) =>
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
529
|
+
"record-diagnosis": async ({ target, packageRoot, options, runtimeContext }) => {
|
|
530
|
+
const persistence = runtimeContext?.forgeloopPersistence ?? null;
|
|
531
|
+
return {
|
|
532
|
+
result: await runRecordDiagnosis({
|
|
533
|
+
target,
|
|
534
|
+
packageRoot,
|
|
535
|
+
file: options.file ?? null,
|
|
536
|
+
hypothesis: options.hypothesis,
|
|
537
|
+
failureClass: options.failureClass,
|
|
538
|
+
evidenceRefs: options.evidenceRefs,
|
|
539
|
+
settledBy: options.settledBy,
|
|
540
|
+
nextSafeAction: options.nextSafeAction,
|
|
541
|
+
taskId: options.taskId,
|
|
542
|
+
persistence,
|
|
543
|
+
}),
|
|
544
|
+
exitCode: 0,
|
|
545
|
+
};
|
|
546
|
+
},
|
|
512
547
|
"record-intervention": async ({ target, packageRoot, options }) => ({
|
|
513
548
|
result: await runRecordIntervention({
|
|
514
549
|
target,
|
|
@@ -720,11 +755,11 @@ export const COMMAND_EXECUTORS = {
|
|
|
720
755
|
exitCode: 0,
|
|
721
756
|
}),
|
|
722
757
|
"task-migrate": async ({ target, packageRoot, options }) => ({
|
|
723
|
-
result: await runTaskMigrate({ target, packageRoot, dryRun: options.dryRun }),
|
|
758
|
+
result: await runTaskMigrate({ target, packageRoot, dryRun: options.dryRun, destination: options.destination, writersQuiesced: options.writersQuiesced }),
|
|
724
759
|
exitCode: 0,
|
|
725
760
|
}),
|
|
726
761
|
"migrate-protocol": async ({ target, packageRoot, options }) => ({
|
|
727
|
-
result: await runMigrateProtocol({ target, packageRoot, to: options.to, dryRun: options.dryRun }),
|
|
762
|
+
result: await runMigrateProtocol({ target, packageRoot, to: options.to, dryRun: options.dryRun, destination: options.destination, writersQuiesced: options.writersQuiesced }),
|
|
728
763
|
exitCode: 0,
|
|
729
764
|
}),
|
|
730
765
|
"task-unlock": async ({ target, packageRoot, options }) => ({
|
|
@@ -817,3 +852,24 @@ export const EXECUTOR_EXCEPTIONS = Object.freeze([
|
|
|
817
852
|
// Bootstrap/presentation-only behaviors intentionally without executors:
|
|
818
853
|
// none currently. Every canonical command definition must have an executor.
|
|
819
854
|
]);
|
|
855
|
+
|
|
856
|
+
export const COMMAND_EXECUTORS = Object.fromEntries(Object.entries(RAW_COMMAND_EXECUTORS).map(([name, executor]) => [name, async context => {
|
|
857
|
+
// Reject unsupported migration targets before fresh-project storage admission
|
|
858
|
+
// can allocate a database or obscure the protocol error with a storage error.
|
|
859
|
+
if (name === "migrate-protocol") {
|
|
860
|
+
const { assertSupportedProtocolMigrationTarget } = await import("./protocol-migration.js");
|
|
861
|
+
assertSupportedProtocolMigrationTarget(context.options?.to);
|
|
862
|
+
}
|
|
863
|
+
if (name === "advance" || name === "record-diagnosis") {
|
|
864
|
+
const { assertCanonicalPersistence } = await import("../storage/operational-context.js");
|
|
865
|
+
assertCanonicalPersistence(context.runtimeContext?.forgeloopPersistence);
|
|
866
|
+
}
|
|
867
|
+
if (!context.target || name === "task-migrate" || name === "migrate-protocol" || name === "storage-migration-status" || name === "storage-rollback-resume" || name === "storage-rollback" || name === "storage-migrate" || name === "storage-migration-resume" || name === "storage-restore" || name === "storage-restore-resume") return executor(context);
|
|
868
|
+
const { withProjectStorage } = await import("../storage/project-boundary.js");
|
|
869
|
+
const { CLI_COMMAND_DEFINITIONS } = await import("./cli-command-definitions.js");
|
|
870
|
+
// Backup writes its destination, not the source store. Doctor repairs only
|
|
871
|
+
// when explicitly requested; inspecting either must not migrate the source.
|
|
872
|
+
const readOnly = CLI_COMMAND_DEFINITIONS[name]?.mutation === "READ_ONLY"
|
|
873
|
+
|| context.options?.dryRun === true || name === "storage-backup" || (name === "doctor" && context.options?.fix !== true);
|
|
874
|
+
return withProjectStorage(context.target, () => executor(context), { readOnly, runtimeContext: context.runtimeContext });
|
|
875
|
+
}]));
|