@intentius/chant 0.79.0 → 0.81.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/audit/core.d.ts.map +1 -1
- package/dist/audit/discover.d.ts +30 -0
- package/dist/audit/discover.d.ts.map +1 -1
- package/dist/audit/report-html.d.ts +5 -0
- package/dist/audit/report-html.d.ts.map +1 -1
- package/dist/audit/report-model.d.ts +13 -0
- package/dist/audit/report-model.d.ts.map +1 -1
- package/dist/audit/terraform-state.d.ts +13 -0
- package/dist/audit/terraform-state.d.ts.map +1 -1
- package/dist/cli/command-group.d.ts +6 -0
- package/dist/cli/command-group.d.ts.map +1 -1
- package/dist/cli/commands/audit.d.ts +44 -3
- package/dist/cli/commands/audit.d.ts.map +1 -1
- package/dist/cli/commands/check-lexicon-examples.d.ts.map +1 -1
- package/dist/cli/commands/check-lexicon.d.ts +8 -0
- package/dist/cli/commands/check-lexicon.d.ts.map +1 -1
- package/dist/cli/commands/doctor.d.ts.map +1 -1
- package/dist/cli/commands/import-agents.d.ts.map +1 -1
- package/dist/cli/commands/init.d.ts +6 -0
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/lint.d.ts.map +1 -1
- package/dist/cli/commands/onboard.d.ts.map +1 -1
- package/dist/cli/commands/update.d.ts +6 -0
- package/dist/cli/commands/update.d.ts.map +1 -1
- package/dist/cli/commands/vendor.d.ts +5 -0
- package/dist/cli/commands/vendor.d.ts.map +1 -1
- package/dist/cli/conflict-check.d.ts +6 -0
- package/dist/cli/conflict-check.d.ts.map +1 -1
- package/dist/cli/handlers/build.d.ts.map +1 -1
- package/dist/cli/handlers/components.d.ts.map +1 -1
- package/dist/cli/handlers/dev.d.ts.map +1 -1
- package/dist/cli/handlers/fan-out.d.ts.map +1 -1
- package/dist/cli/handlers/init.d.ts.map +1 -1
- package/dist/cli/handlers/lifecycle.d.ts.map +1 -1
- package/dist/cli/handlers/misc.d.ts.map +1 -1
- package/dist/cli/handlers/operator.d.ts +7 -0
- package/dist/cli/handlers/operator.d.ts.map +1 -1
- package/dist/cli/handlers/promote.d.ts +20 -0
- package/dist/cli/handlers/promote.d.ts.map +1 -0
- package/dist/cli/handlers/run-generate.d.ts +39 -0
- package/dist/cli/handlers/run-generate.d.ts.map +1 -0
- package/dist/cli/handlers/run.d.ts +4 -1
- package/dist/cli/handlers/run.d.ts.map +1 -1
- package/dist/cli/handlers/vendor.d.ts +8 -3
- package/dist/cli/handlers/vendor.d.ts.map +1 -1
- package/dist/cli/main.d.ts +12 -0
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/mcp/op-tools.d.ts.map +1 -1
- package/dist/cli/plugins.d.ts +14 -0
- package/dist/cli/plugins.d.ts.map +1 -1
- package/dist/cli/registry.d.ts +46 -1
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/codegen/fetch.d.ts +10 -0
- package/dist/codegen/fetch.d.ts.map +1 -1
- package/dist/components/capability-plugin-loader.d.ts.map +1 -1
- package/dist/components/cli-support.d.ts +3 -1
- package/dist/components/cli-support.d.ts.map +1 -1
- package/dist/components/discover.d.ts.map +1 -1
- package/dist/components/driver.d.ts +16 -2
- package/dist/components/driver.d.ts.map +1 -1
- package/dist/components/fan-out-support.d.ts.map +1 -1
- package/dist/components/gate-plan.d.ts +40 -0
- package/dist/components/gate-plan.d.ts.map +1 -0
- package/dist/components/pilots/alb-ecs.pilot.d.ts +7 -1
- package/dist/components/pilots/alb-ecs.pilot.d.ts.map +1 -1
- package/dist/components/presets/ecs-fargate.d.ts +10 -4
- package/dist/components/presets/ecs-fargate.d.ts.map +1 -1
- package/dist/components/promote.d.ts +264 -0
- package/dist/components/promote.d.ts.map +1 -0
- package/dist/components/sandbox/driver.d.ts.map +1 -1
- package/dist/components/sandbox/run.d.ts.map +1 -1
- package/dist/components/verbs/build-archive.d.ts +22 -11
- package/dist/components/verbs/build-archive.d.ts.map +1 -1
- package/dist/components/verbs/run-agent.d.ts.map +1 -1
- package/dist/config-static.d.ts +59 -0
- package/dist/config-static.d.ts.map +1 -0
- package/dist/config.d.ts +104 -5
- package/dist/config.d.ts.map +1 -1
- package/dist/content-digest.d.ts +17 -0
- package/dist/content-digest.d.ts.map +1 -0
- package/dist/discovery/files.d.ts +48 -4
- package/dist/discovery/files.d.ts.map +1 -1
- package/dist/discovery/fold-import.d.ts +32 -1
- package/dist/discovery/fold-import.d.ts.map +1 -1
- package/dist/discovery/index.d.ts.map +1 -1
- package/dist/discovery/sandbox/driver.d.ts +20 -0
- package/dist/discovery/sandbox/driver.d.ts.map +1 -1
- package/dist/discovery/sandbox/fork.d.ts +20 -0
- package/dist/discovery/sandbox/fork.d.ts.map +1 -1
- package/dist/discovery/walk.d.ts +119 -0
- package/dist/discovery/walk.d.ts.map +1 -0
- package/dist/graph-ir.d.ts +17 -1
- package/dist/graph-ir.d.ts.map +1 -1
- package/dist/join-key.d.ts +31 -0
- package/dist/join-key.d.ts.map +1 -0
- package/dist/lexicon-module.d.ts +110 -0
- package/dist/lexicon-module.d.ts.map +1 -0
- package/dist/lexicon.d.ts +82 -1
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lifecycle/build-ledger-store.d.ts.map +1 -1
- package/dist/lifecycle/digest.d.ts +5 -1
- package/dist/lifecycle/digest.d.ts.map +1 -1
- package/dist/lifecycle/gate-ledger.d.ts +20 -5
- package/dist/lifecycle/gate-ledger.d.ts.map +1 -1
- package/dist/lifecycle/git.d.ts +64 -0
- package/dist/lifecycle/git.d.ts.map +1 -1
- package/dist/lifecycle/lease.d.ts +8 -1
- package/dist/lifecycle/lease.d.ts.map +1 -1
- package/dist/lifecycle/legacy-digest.d.ts +59 -0
- package/dist/lifecycle/legacy-digest.d.ts.map +1 -0
- package/dist/lifecycle/member-ledger.d.ts +67 -0
- package/dist/lifecycle/member-ledger.d.ts.map +1 -0
- package/dist/lifecycle/plan-digest.d.ts +4 -3
- package/dist/lifecycle/plan-digest.d.ts.map +1 -1
- package/dist/lifecycle/release-ledger.d.ts +42 -1
- package/dist/lifecycle/release-ledger.d.ts.map +1 -1
- package/dist/lifecycle/status.d.ts +90 -5
- package/dist/lifecycle/status.d.ts.map +1 -1
- package/dist/lint/rules/comp/comp003-mutating-no-rollback.d.ts +2 -3
- package/dist/lint/rules/comp/comp003-mutating-no-rollback.d.ts.map +1 -1
- package/dist/op/activities/activity-contracts.d.ts +32 -0
- package/dist/op/activities/activity-contracts.d.ts.map +1 -1
- package/dist/op/activities/index.d.ts +2 -0
- package/dist/op/activities/index.d.ts.map +1 -1
- package/dist/op/activities/propose-upgrade.d.ts +75 -0
- package/dist/op/activities/propose-upgrade.d.ts.map +1 -0
- package/dist/op/activity-contract-registry.d.ts.map +1 -1
- package/dist/op/activity-registry.d.ts.map +1 -1
- package/dist/op/discover.d.ts.map +1 -1
- package/dist/op/gate-approval.d.ts.map +1 -1
- package/dist/op/gate-name.d.ts +7 -0
- package/dist/op/gate-name.d.ts.map +1 -1
- package/dist/op/gate-summary.d.ts +16 -0
- package/dist/op/gate-summary.d.ts.map +1 -1
- package/dist/op/gate.d.ts +16 -2
- package/dist/op/gate.d.ts.map +1 -1
- package/dist/op/generate-pipeline.d.ts.map +1 -1
- package/dist/op/runtimes/local.d.ts.map +1 -1
- package/dist/project-root.d.ts +26 -0
- package/dist/project-root.d.ts.map +1 -1
- package/dist/workspace/__fixtures__/contract-repo.d.ts +37 -0
- package/dist/workspace/__fixtures__/contract-repo.d.ts.map +1 -0
- package/dist/workspace/__fixtures__/two-member-workspace.d.ts +11 -0
- package/dist/workspace/__fixtures__/two-member-workspace.d.ts.map +1 -0
- package/dist/workspace/checks/generated.d.ts +156 -0
- package/dist/workspace/checks/generated.d.ts.map +1 -0
- package/dist/workspace/checks/ledgers.d.ts +78 -0
- package/dist/workspace/checks/ledgers.d.ts.map +1 -0
- package/dist/workspace/checks/links.d.ts +25 -0
- package/dist/workspace/checks/links.d.ts.map +1 -0
- package/dist/workspace/checks/pipelines.d.ts +76 -0
- package/dist/workspace/checks/pipelines.d.ts.map +1 -0
- package/dist/workspace/checks.d.ts +161 -0
- package/dist/workspace/checks.d.ts.map +1 -0
- package/dist/workspace/compose-graph.d.ts +115 -0
- package/dist/workspace/compose-graph.d.ts.map +1 -0
- package/dist/workspace/compose-reports.d.ts +68 -0
- package/dist/workspace/compose-reports.d.ts.map +1 -0
- package/dist/workspace/declaration.d.ts +220 -0
- package/dist/workspace/declaration.d.ts.map +1 -0
- package/dist/workspace/declaration.schema.json +434 -0
- package/dist/workspace/generated-files.d.ts +65 -0
- package/dist/workspace/generated-files.d.ts.map +1 -0
- package/dist/workspace/glob.d.ts +13 -0
- package/dist/workspace/glob.d.ts.map +1 -0
- package/dist/workspace/graph-cli.d.ts +75 -0
- package/dist/workspace/graph-cli.d.ts.map +1 -0
- package/dist/workspace/init.d.ts +96 -0
- package/dist/workspace/init.d.ts.map +1 -0
- package/dist/workspace/jsonc.d.ts +38 -0
- package/dist/workspace/jsonc.d.ts.map +1 -0
- package/dist/workspace/kinds.d.ts +192 -0
- package/dist/workspace/kinds.d.ts.map +1 -0
- package/dist/workspace/lineage-check.d.ts +84 -0
- package/dist/workspace/lineage-check.d.ts.map +1 -0
- package/dist/workspace/lineage-cli.d.ts +31 -0
- package/dist/workspace/lineage-cli.d.ts.map +1 -0
- package/dist/workspace/lineage-init.d.ts +101 -0
- package/dist/workspace/lineage-init.d.ts.map +1 -0
- package/dist/workspace/lineage-lock.d.ts +258 -0
- package/dist/workspace/lineage-lock.d.ts.map +1 -0
- package/dist/workspace/lineage-merge.d.ts +14 -0
- package/dist/workspace/lineage-merge.d.ts.map +1 -0
- package/dist/workspace/lineage-migrations.d.ts +178 -0
- package/dist/workspace/lineage-migrations.d.ts.map +1 -0
- package/dist/workspace/lineage-update.d.ts +59 -0
- package/dist/workspace/lineage-update.d.ts.map +1 -0
- package/dist/workspace/lineage-upgrade-cli.d.ts +40 -0
- package/dist/workspace/lineage-upgrade-cli.d.ts.map +1 -0
- package/dist/workspace/lineage-upgrade.d.ts +146 -0
- package/dist/workspace/lineage-upgrade.d.ts.map +1 -0
- package/dist/workspace/lineage-vendor.d.ts +63 -0
- package/dist/workspace/lineage-vendor.d.ts.map +1 -0
- package/dist/workspace/lineage-version.d.ts +32 -0
- package/dist/workspace/lineage-version.d.ts.map +1 -0
- package/dist/workspace/links.d.ts +150 -0
- package/dist/workspace/links.d.ts.map +1 -0
- package/dist/workspace/ls.d.ts +99 -0
- package/dist/workspace/ls.d.ts.map +1 -0
- package/dist/workspace/member-commands.d.ts +139 -0
- package/dist/workspace/member-commands.d.ts.map +1 -0
- package/dist/workspace/member-handles.d.ts +54 -0
- package/dist/workspace/member-handles.d.ts.map +1 -0
- package/dist/workspace/member-pipeline.d.ts +143 -0
- package/dist/workspace/member-pipeline.d.ts.map +1 -0
- package/dist/workspace/member-run.d.ts +67 -0
- package/dist/workspace/member-run.d.ts.map +1 -0
- package/dist/workspace/reason-codes.d.ts +65 -0
- package/dist/workspace/reason-codes.d.ts.map +1 -0
- package/dist/workspace/record-source.d.ts +22 -0
- package/dist/workspace/record-source.d.ts.map +1 -0
- package/dist/workspace/records-cli.d.ts +81 -0
- package/dist/workspace/records-cli.d.ts.map +1 -0
- package/dist/workspace/records.d.ts +118 -0
- package/dist/workspace/records.d.ts.map +1 -0
- package/dist/workspace/root-refusal.d.ts +53 -0
- package/dist/workspace/root-refusal.d.ts.map +1 -0
- package/dist/workspace/status.d.ts +150 -0
- package/dist/workspace/status.d.ts.map +1 -0
- package/dist/workspace/template-manifest.d.ts +90 -0
- package/dist/workspace/template-manifest.d.ts.map +1 -0
- package/dist/workspace/tree.d.ts +36 -0
- package/dist/workspace/tree.d.ts.map +1 -0
- package/dist/workspace/trust/attestor.d.ts +67 -0
- package/dist/workspace/trust/attestor.d.ts.map +1 -0
- package/dist/workspace/trust/policy.d.ts +111 -0
- package/dist/workspace/trust/policy.d.ts.map +1 -0
- package/dist/workspace/trust/provenance.d.ts +67 -0
- package/dist/workspace/trust/provenance.d.ts.map +1 -0
- package/dist/workspace/trust/ssh-commit.d.ts +43 -0
- package/dist/workspace/trust/ssh-commit.d.ts.map +1 -0
- package/dist/workspace/trust/test-repo.d.ts +42 -0
- package/dist/workspace/trust/test-repo.d.ts.map +1 -0
- package/dist/workspace/trust/verify-cli.d.ts +9 -0
- package/dist/workspace/trust/verify-cli.d.ts.map +1 -0
- package/dist/workspace/trust/verify.d.ts +66 -0
- package/dist/workspace/trust/verify.d.ts.map +1 -0
- package/dist/workspace/which-chant.d.ts +58 -0
- package/dist/workspace/which-chant.d.ts.map +1 -0
- package/dist/workspace/workspace-kinds.schema.json +133 -0
- package/package.json +4 -3
- package/src/audit/core.ts +13 -2
- package/src/audit/discover.ts +102 -36
- package/src/audit/report-html.ts +3 -1
- package/src/audit/report-model.ts +14 -1
- package/src/audit/terraform-state.test.ts +81 -1
- package/src/audit/terraform-state.ts +25 -0
- package/src/cli/command-group.ts +7 -0
- package/src/cli/commands/audit-truncation.test.ts +167 -0
- package/src/cli/commands/audit.ts +132 -29
- package/src/cli/commands/check-lexicon-examples.ts +2 -1
- package/src/cli/commands/check-lexicon.ts +24 -0
- package/src/cli/commands/doctor.test.ts +30 -0
- package/src/cli/commands/doctor.ts +21 -0
- package/src/cli/commands/import-agents.ts +15 -4
- package/src/cli/commands/init.ts +76 -25
- package/src/cli/commands/lint.test.ts +52 -1
- package/src/cli/commands/lint.ts +41 -71
- package/src/cli/commands/onboard.ts +15 -0
- package/src/cli/commands/update.ts +18 -5
- package/src/cli/commands/vendor.ts +11 -6
- package/src/cli/conflict-check.test.ts +18 -1
- package/src/cli/conflict-check.ts +13 -0
- package/src/cli/discovery-skip.test.ts +168 -0
- package/src/cli/handlers/__snapshots__/build-member.test.ts.snap +38 -0
- package/src/cli/handlers/build-member.test.ts +127 -0
- package/src/cli/handlers/build.test.ts +11 -0
- package/src/cli/handlers/build.ts +35 -1
- package/src/cli/handlers/components.test.ts +127 -0
- package/src/cli/handlers/components.ts +70 -8
- package/src/cli/handlers/dev.ts +6 -1
- package/src/cli/handlers/fan-out.ts +9 -2
- package/src/cli/handlers/graph.test.ts +20 -0
- package/src/cli/handlers/graph.ts +4 -2
- package/src/cli/handlers/init.ts +54 -1
- package/src/cli/handlers/lifecycle.ts +2 -1
- package/src/cli/handlers/misc.ts +16 -0
- package/src/cli/handlers/operator.test.ts +68 -0
- package/src/cli/handlers/operator.ts +39 -10
- package/src/cli/handlers/promote.test.ts +377 -0
- package/src/cli/handlers/promote.ts +391 -0
- package/src/cli/handlers/run-generate-member.test.ts +83 -0
- package/src/cli/handlers/run-generate.test.ts +158 -0
- package/src/cli/handlers/run-generate.ts +168 -0
- package/src/cli/handlers/run.test.ts +47 -0
- package/src/cli/handlers/run.ts +41 -6
- package/src/cli/handlers/vendor.ts +147 -43
- package/src/cli/main.test.ts +137 -1
- package/src/cli/main.ts +290 -24
- package/src/cli/mcp/op-tools.ts +2 -1
- package/src/cli/path-lexicon-messages.test.ts +152 -0
- package/src/cli/plugins.ts +43 -5
- package/src/cli/registry.ts +46 -1
- package/src/cli/static-config-read.test.ts +208 -0
- package/src/codegen/fetch.test.ts +63 -1
- package/src/codegen/fetch.ts +30 -1
- package/src/components/__fixtures__/alb-ecs-service.json +0 -8
- package/src/components/capability-plugin-loader.ts +3 -1
- package/src/components/cli-support.ts +9 -3
- package/src/components/discover.test.ts +27 -57
- package/src/components/discover.ts +20 -51
- package/src/components/driver.test.ts +90 -12
- package/src/components/driver.ts +43 -5
- package/src/components/fan-out-support.ts +2 -1
- package/src/components/gate-plan.ts +53 -0
- package/src/components/pilots/README.md +1 -1
- package/src/components/pilots/alb-ecs.pilot.ts +7 -7
- package/src/components/presets/ecs-fargate.ts +10 -5
- package/src/components/promote.test.ts +645 -0
- package/src/components/promote.ts +641 -0
- package/src/components/sandbox/driver.ts +8 -8
- package/src/components/sandbox/run.ts +4 -1
- package/src/components/verbs/build-archive.ts +27 -21
- package/src/components/verbs/run-agent.ts +3 -5
- package/src/config-static.test.ts +136 -0
- package/src/config-static.ts +232 -0
- package/src/config.test.ts +40 -0
- package/src/config.ts +161 -11
- package/src/content-digest.test.ts +120 -0
- package/src/content-digest.ts +21 -0
- package/src/discovery/files.test.ts +127 -1
- package/src/discovery/files.ts +91 -59
- package/src/discovery/fold-import.ts +127 -9
- package/src/discovery/index.ts +1 -0
- package/src/discovery/sandbox/driver.ts +73 -35
- package/src/discovery/sandbox/fork-diagnostic.test.ts +136 -13
- package/src/discovery/sandbox/fork.ts +83 -43
- package/src/discovery/sandbox/path-lexicon-multifile.test.ts +285 -0
- package/src/discovery/sandbox/path-lexicon-parity.test.ts +162 -0
- package/src/discovery/walk.test.ts +263 -0
- package/src/discovery/walk.ts +334 -0
- package/src/effect-receipt.ts +2 -2
- package/src/graph-ir.ts +18 -1
- package/src/join-key.test.ts +25 -0
- package/src/join-key.ts +39 -0
- package/src/lexicon-module.test.ts +203 -0
- package/src/lexicon-module.ts +215 -0
- package/src/lexicon.ts +105 -1
- package/src/lifecycle/build-ledger-store.ts +13 -2
- package/src/lifecycle/digest.ts +9 -5
- package/src/lifecycle/gate-ledger.test.ts +20 -0
- package/src/lifecycle/gate-ledger.ts +28 -6
- package/src/lifecycle/git.test.ts +13 -1
- package/src/lifecycle/git.ts +221 -176
- package/src/lifecycle/lease.ts +25 -10
- package/src/lifecycle/legacy-digest.test.ts +206 -0
- package/src/lifecycle/legacy-digest.ts +103 -0
- package/src/lifecycle/member-ledger.test.ts +319 -0
- package/src/lifecycle/member-ledger.ts +145 -0
- package/src/lifecycle/plan-digest.ts +7 -7
- package/src/lifecycle/release-ledger.test.ts +20 -0
- package/src/lifecycle/release-ledger.ts +53 -3
- package/src/lifecycle/status.test.ts +151 -1
- package/src/lifecycle/status.ts +228 -7
- package/src/lint/rules/comp/comp003-mutating-no-rollback.ts +2 -3
- package/src/op/activities/activity-contracts.ts +37 -0
- package/src/op/activities/index.ts +10 -0
- package/src/op/activities/propose-upgrade.ts +206 -0
- package/src/op/activity-contract-registry.ts +18 -4
- package/src/op/activity-registry.ts +26 -0
- package/src/op/discover.test.ts +14 -4
- package/src/op/discover.ts +19 -23
- package/src/op/gate-approval.ts +3 -1
- package/src/op/gate-name.ts +8 -0
- package/src/op/gate-summary.test.ts +14 -0
- package/src/op/gate-summary.ts +25 -2
- package/src/op/gate.ts +36 -7
- package/src/op/generate-pipeline.test.ts +14 -5
- package/src/op/generate-pipeline.ts +2 -1
- package/src/op/runtimes/local.ts +2 -1
- package/src/project-root.test.ts +66 -1
- package/src/project-root.ts +48 -0
- package/src/workspace/__fixtures__/contract-repo.ts +100 -0
- package/src/workspace/__fixtures__/two-member-workspace.ts +35 -0
- package/src/workspace/behold-kinds.test.ts +162 -0
- package/src/workspace/check-contract.test.ts +127 -0
- package/src/workspace/check.schema.json +347 -0
- package/src/workspace/checks/generated.test.ts +287 -0
- package/src/workspace/checks/generated.ts +475 -0
- package/src/workspace/checks/ledgers.test.ts +139 -0
- package/src/workspace/checks/ledgers.ts +246 -0
- package/src/workspace/checks/links.ts +183 -0
- package/src/workspace/checks/pipelines.test.ts +133 -0
- package/src/workspace/checks/pipelines.ts +225 -0
- package/src/workspace/checks-repo.test.ts +71 -0
- package/src/workspace/checks.test.ts +450 -0
- package/src/workspace/checks.ts +461 -0
- package/src/workspace/compose-graph.test.ts +146 -0
- package/src/workspace/compose-graph.ts +228 -0
- package/src/workspace/compose-reports.test.ts +109 -0
- package/src/workspace/compose-reports.ts +186 -0
- package/src/workspace/declaration.schema.json +434 -0
- package/src/workspace/declaration.test.ts +347 -0
- package/src/workspace/declaration.ts +623 -0
- package/src/workspace/generated-files.test.ts +114 -0
- package/src/workspace/generated-files.ts +94 -0
- package/src/workspace/glob.ts +49 -0
- package/src/workspace/graph-cli.ts +220 -0
- package/src/workspace/graph-contract.test.ts +204 -0
- package/src/workspace/graph.schema.json +662 -0
- package/src/workspace/init.test.ts +223 -0
- package/src/workspace/init.ts +585 -0
- package/src/workspace/jsonc.test.ts +65 -0
- package/src/workspace/jsonc.ts +231 -0
- package/src/workspace/kinds.test.ts +288 -0
- package/src/workspace/kinds.ts +506 -0
- package/src/workspace/lineage-check.ts +264 -0
- package/src/workspace/lineage-cli.ts +114 -0
- package/src/workspace/lineage-init.test.ts +231 -0
- package/src/workspace/lineage-init.ts +365 -0
- package/src/workspace/lineage-lock.test.ts +224 -0
- package/src/workspace/lineage-lock.ts +357 -0
- package/src/workspace/lineage-merge.ts +44 -0
- package/src/workspace/lineage-migrations.test.ts +178 -0
- package/src/workspace/lineage-migrations.ts +343 -0
- package/src/workspace/lineage-update.ts +160 -0
- package/src/workspace/lineage-upgrade-cli.ts +151 -0
- package/src/workspace/lineage-upgrade.test.ts +474 -0
- package/src/workspace/lineage-upgrade.ts +624 -0
- package/src/workspace/lineage-vendor.test.ts +126 -0
- package/src/workspace/lineage-vendor.ts +215 -0
- package/src/workspace/lineage-version.ts +127 -0
- package/src/workspace/links.test.ts +344 -0
- package/src/workspace/links.ts +331 -0
- package/src/workspace/ls-contract.test.ts +200 -0
- package/src/workspace/ls.schema.json +190 -0
- package/src/workspace/ls.ts +254 -0
- package/src/workspace/member-commands.e2e.test.ts +244 -0
- package/src/workspace/member-commands.test.ts +217 -0
- package/src/workspace/member-commands.ts +540 -0
- package/src/workspace/member-handles.test.ts +76 -0
- package/src/workspace/member-handles.ts +228 -0
- package/src/workspace/member-pipeline.test.ts +135 -0
- package/src/workspace/member-pipeline.ts +317 -0
- package/src/workspace/member-run.ts +146 -0
- package/src/workspace/read-contract.test.ts +129 -0
- package/src/workspace/reason-codes.test.ts +113 -0
- package/src/workspace/reason-codes.ts +81 -0
- package/src/workspace/record-source.ts +117 -0
- package/src/workspace/records-cli.ts +198 -0
- package/src/workspace/records-contract.test.ts +93 -0
- package/src/workspace/records.schema.json +150 -0
- package/src/workspace/records.test.ts +243 -0
- package/src/workspace/records.ts +384 -0
- package/src/workspace/root-refusal.ts +97 -0
- package/src/workspace/status-contract.test.ts +308 -0
- package/src/workspace/status.schema.json +210 -0
- package/src/workspace/status.ts +412 -0
- package/src/workspace/template-manifest.test.ts +79 -0
- package/src/workspace/template-manifest.ts +221 -0
- package/src/workspace/tree.ts +132 -0
- package/src/workspace/trust/attestor.ts +93 -0
- package/src/workspace/trust/policy.ts +306 -0
- package/src/workspace/trust/provenance.ts +181 -0
- package/src/workspace/trust/ssh-commit.ts +138 -0
- package/src/workspace/trust/test-repo.ts +138 -0
- package/src/workspace/trust/trust.test.ts +397 -0
- package/src/workspace/trust/verify-cli.ts +56 -0
- package/src/workspace/trust/verify.ts +194 -0
- package/src/workspace/which-chant.test.ts +117 -0
- package/src/workspace/which-chant.ts +151 -0
- package/src/workspace/workspace-kinds.schema.json +133 -0
package/src/cli/main.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { formatSuccess, formatError } from "./format";
|
|
|
6
6
|
import { loadPlugins, resolveProjectLexicons } from "./plugins";
|
|
7
7
|
import { resolveCommand, type CommandDef, type ParsedArgs } from "./registry";
|
|
8
8
|
import { loadChantConfigUpward } from "../config";
|
|
9
|
+
import { findProjectRoot, findWorkspaceRoot } from "../project-root";
|
|
9
10
|
import { validateLexiconConfig, formatLexiconConfigProblems } from "../lexicon-config";
|
|
10
11
|
import { armSandboxConfigEvaluation } from "../config-sandbox";
|
|
11
12
|
import { armSandboxPolicyExecution } from "../lint/policy-import";
|
|
@@ -27,6 +28,7 @@ import { runCarveStatus } from "./handlers/carve-status";
|
|
|
27
28
|
import { runLifecycleSnapshot, runLifecycleShow, runLifecycleDiff, runLifecycleRollback, runLifecyclePlan, runLifecycleAffected, runLifecycleLog, runLifecycleTeardown, runLifecycleWhoami, runLifecycleUnknown } from "./handlers/lifecycle";
|
|
28
29
|
import { runComponentsStatus, runComponentsReleaseRecord, runComponentsExport, runComponentsUnknown } from "./handlers/components";
|
|
29
30
|
import { runComponentsFanOut } from "./handlers/fan-out";
|
|
31
|
+
import { runComponentsPromote, runComponentsRollback, runComponentsRedeploy } from "./handlers/promote";
|
|
30
32
|
import { runScenarioCheck, runScenarioUnknown } from "./handlers/scenario";
|
|
31
33
|
import { runGraph } from "./handlers/graph";
|
|
32
34
|
import { runExplain } from "./handlers/explain";
|
|
@@ -93,6 +95,10 @@ const BOOLEAN_FLAGS = new Set([
|
|
|
93
95
|
"--fail-on-drift",
|
|
94
96
|
"--durable-requests",
|
|
95
97
|
"--skip-mcp",
|
|
98
|
+
"--current",
|
|
99
|
+
"--allow-code",
|
|
100
|
+
"--root-only",
|
|
101
|
+
"--generated",
|
|
96
102
|
]);
|
|
97
103
|
|
|
98
104
|
/**
|
|
@@ -205,8 +211,9 @@ export function parseArgs(args: string[]): ParsedArgs {
|
|
|
205
211
|
if (v !== "source" && v !== "live") throw new Error(`--overlay-anchor must be 'source' or 'live', got '${v}'`);
|
|
206
212
|
result.overlayAnchor = v;
|
|
207
213
|
} else if (arg === "--from") {
|
|
208
|
-
// Shared by `migrate --from <lexicon
|
|
209
|
-
//
|
|
214
|
+
// Shared by `migrate --from <lexicon>`, `import --from <env>`,
|
|
215
|
+
// `components promote --from <env>` and `init --from <repo>@<ref>`;
|
|
216
|
+
// the commands never run together, so one field carries all four.
|
|
210
217
|
result.migrateFrom = args[++i];
|
|
211
218
|
} else if (arg === "--kustomize") {
|
|
212
219
|
// `chant import --kustomize <dir>` (#1548): render the overlay, import
|
|
@@ -265,6 +272,9 @@ export function parseArgs(args: string[]): ParsedArgs {
|
|
|
265
272
|
result.src = args[++i];
|
|
266
273
|
} else if (arg === "--env") {
|
|
267
274
|
result.env = args[++i];
|
|
275
|
+
} else if (arg === "--promote-to") {
|
|
276
|
+
result.promoteTo = args[++i];
|
|
277
|
+
if (!result.promoteTo || result.promoteTo.startsWith("-")) throw new Error("--promote-to needs an environment: --promote-to <env>");
|
|
268
278
|
} else if (arg === "--tier") {
|
|
269
279
|
result.tier = args[++i];
|
|
270
280
|
} else if (arg === "--agents") {
|
|
@@ -277,6 +287,9 @@ export function parseArgs(args: string[]): ParsedArgs {
|
|
|
277
287
|
result.runtime = args[++i];
|
|
278
288
|
} else if (arg === "--fail-on") {
|
|
279
289
|
result.failOn = args[++i];
|
|
290
|
+
} else if (arg === "--max-files") {
|
|
291
|
+
// Validated by the audit handler, like `--limit` below.
|
|
292
|
+
result.maxFiles = Number(args[++i]);
|
|
280
293
|
} else if (arg === "--theme") {
|
|
281
294
|
result.theme = args[++i];
|
|
282
295
|
} else if (arg === "--stacks") {
|
|
@@ -285,8 +298,12 @@ export function parseArgs(args: string[]): ParsedArgs {
|
|
|
285
298
|
result.components = true;
|
|
286
299
|
} else if (arg === "--generate") {
|
|
287
300
|
result.generate = args[++i];
|
|
301
|
+
} else if (arg === "--spec") {
|
|
302
|
+
result.opsSpec = args[++i];
|
|
288
303
|
} else if (arg === "--dump-outputs") {
|
|
289
304
|
result.dumpOutputs = args[++i];
|
|
305
|
+
} else if (arg === "--digest-file") {
|
|
306
|
+
result.digestFile = args[++i];
|
|
290
307
|
} else if (arg === "--seed-outputs") {
|
|
291
308
|
(result.seedOutputs ??= []).push(args[++i]);
|
|
292
309
|
} else if (arg === "--detail") {
|
|
@@ -342,6 +359,16 @@ export function parseArgs(args: string[]): ParsedArgs {
|
|
|
342
359
|
result.deep = true;
|
|
343
360
|
} else if (arg === "--at") {
|
|
344
361
|
result.at = args[++i];
|
|
362
|
+
} else if (arg === "--kind") {
|
|
363
|
+
// `chant workspace records --kind <kind file>` (#2546)
|
|
364
|
+
result.kind = args[++i];
|
|
365
|
+
if (!result.kind || result.kind.startsWith("-")) throw new Error("--kind needs a kind file: --kind <path>");
|
|
366
|
+
} else if (arg === "--current") {
|
|
367
|
+
result.current = true;
|
|
368
|
+
} else if (arg === "--require") {
|
|
369
|
+
// `chant workspace records|verify --require attested` (#2547)
|
|
370
|
+
result.require = args[++i];
|
|
371
|
+
if (!result.require || result.require.startsWith("-")) throw new Error("--require needs a provenance level: --require attested");
|
|
345
372
|
} else if (arg === "--ambient") {
|
|
346
373
|
result.ambient = true;
|
|
347
374
|
} else if (arg === "--check-live") {
|
|
@@ -362,6 +389,7 @@ export function parseArgs(args: string[]): ParsedArgs {
|
|
|
362
389
|
result.component = args[++i];
|
|
363
390
|
} else if (arg === "--digest") {
|
|
364
391
|
result.digest = args[++i];
|
|
392
|
+
if (result.digest !== undefined) (result.digests ??= []).push(result.digest);
|
|
365
393
|
} else if (arg === "--git-sha") {
|
|
366
394
|
result.gitSha = args[++i];
|
|
367
395
|
} else if (arg === "--run-id") {
|
|
@@ -428,6 +456,24 @@ export function parseArgs(args: string[]): ParsedArgs {
|
|
|
428
456
|
} else if (arg === "--agent") {
|
|
429
457
|
// #2508 — record the approval as an agent's rather than a person's.
|
|
430
458
|
result.agent = true;
|
|
459
|
+
} else if (arg === "--allow-code") {
|
|
460
|
+
// #2550 — `chant workspace upgrade` runs a template's code migrations
|
|
461
|
+
// only when asked to.
|
|
462
|
+
result.allowCode = true;
|
|
463
|
+
} else if (arg === "--root-only") {
|
|
464
|
+
// #2537 — `chant build` and `chant lint` at a declared workspace root
|
|
465
|
+
// run on the root project alone instead of refusing with WSP000.
|
|
466
|
+
result.rootOnly = true;
|
|
467
|
+
} else if (arg === "--generated") {
|
|
468
|
+
// #2641 — `chant workspace check --generated` runs each declared
|
|
469
|
+
// generator and compares its output with the file in the tree.
|
|
470
|
+
result.generated = true;
|
|
471
|
+
} else if (arg === "--member") {
|
|
472
|
+
// #2537 — `chant workspace build|lint|audit|graph --member <name>`.
|
|
473
|
+
// Repeatable, and a comma list works too.
|
|
474
|
+
const value = args[++i];
|
|
475
|
+
if (!value || value.startsWith("-")) throw new Error("--member needs a member or group name: --member <name>");
|
|
476
|
+
result.members = [...(result.members ?? []), ...value.split(",").map((m) => m.trim()).filter(Boolean)];
|
|
431
477
|
} else if (arg === "--allow-same-origin") {
|
|
432
478
|
// chant#2384 — record a resolution the same-origin rule would refuse,
|
|
433
479
|
// deliberately. Flagged on the record, not just accepted quietly.
|
|
@@ -471,6 +517,19 @@ export function parseArgs(args: string[]): ParsedArgs {
|
|
|
471
517
|
i++;
|
|
472
518
|
}
|
|
473
519
|
|
|
520
|
+
// #2603 — `--promote-to` (#2575) adds a job to the pipeline that generate
|
|
521
|
+
// mode synthesizes; no other command or mode reads it. Checked here, once
|
|
522
|
+
// the whole command line is known, rather than in the build handler, so
|
|
523
|
+
// `chant build --promote-to prod` and `chant run --promote-to prod` both
|
|
524
|
+
// fail instead of running as if the flag were absent. A lexicon-mounted
|
|
525
|
+
// command that takes its own `--promote-to` still gets it: `main` tries the
|
|
526
|
+
// plugin commands before rethrowing a parse error.
|
|
527
|
+
if (result.promoteTo && !(result.command === "build" && result.components && result.generate)) {
|
|
528
|
+
throw new Error(
|
|
529
|
+
"--promote-to needs build --components --generate <lexicon>: it adds a promote job to the generated CI pipeline, and only generate mode emits one.",
|
|
530
|
+
);
|
|
531
|
+
}
|
|
532
|
+
|
|
474
533
|
return result;
|
|
475
534
|
}
|
|
476
535
|
|
|
@@ -489,13 +548,21 @@ Usage:
|
|
|
489
548
|
|
|
490
549
|
Commands:
|
|
491
550
|
init Initialize a new chant project
|
|
551
|
+
(--from <repo>@<ref>[#<member>] copies a template
|
|
552
|
+
repository and records its lineage; --param
|
|
553
|
+
<name>=<value> sets a parameter the template's
|
|
554
|
+
chant.template.json declares, repeatable)
|
|
492
555
|
init lexicon <name> Scaffold a new lexicon plugin project
|
|
493
556
|
build Build infrastructure from specification files
|
|
494
|
-
(--components --generate gitlab:
|
|
495
|
-
|
|
496
|
-
discovered component's
|
|
497
|
-
instead of a normal
|
|
557
|
+
(--components --generate github|gitlab|forgejo:
|
|
558
|
+
generate mode (#563), which synthesizes a thin CI
|
|
559
|
+
pipeline that triggers each discovered component's
|
|
560
|
+
own deploy in wave order, instead of a normal
|
|
561
|
+
lexicon build)
|
|
562
|
+
At a declared workspace root it refuses with WSP000;
|
|
563
|
+
--root-only builds the root project alone
|
|
498
564
|
lint Check specifications for issues
|
|
565
|
+
(at a declared workspace root: WSP000 unless --root-only)
|
|
499
566
|
list List discovered entities
|
|
500
567
|
describe Show the effective config for one component
|
|
501
568
|
explain Summarize discovered entities (--format markdown|json|okf;
|
|
@@ -503,13 +570,16 @@ Commands:
|
|
|
503
570
|
concept per entity + index.md; -o <dir> writes the
|
|
504
571
|
bundle tree, otherwise JSON path→content on stdout)
|
|
505
572
|
vendor Pull pinned, checksummed patterns into your repo
|
|
573
|
+
(pull [name] | check | migrate; migrate moves
|
|
574
|
+
vendor.json into .chant/workspace.lock.json)
|
|
506
575
|
import Import external template into TypeScript
|
|
507
576
|
(--agents re-expresses this machine's agent config as
|
|
508
577
|
chant code instead of reading a template file)
|
|
509
578
|
audit [path|url] Audit a repo's CI YAML for security issues
|
|
510
579
|
(--format stylish|json|sarif|markdown|html, -o <file>,
|
|
511
580
|
--tier merge-worthy|all, --fail-on merge-worthy|warning|error|none,
|
|
512
|
-
--template <file> / --theme <file> for the html report
|
|
581
|
+
--template <file> / --theme <file> for the html report,
|
|
582
|
+
--max-files <n> to walk more than 1000 files)
|
|
513
583
|
--agents audits this machine's agent configuration —
|
|
514
584
|
instruction files, MCP servers, skills, plugins,
|
|
515
585
|
permissions — instead of a repository
|
|
@@ -556,6 +626,11 @@ Ops:
|
|
|
556
626
|
run approve <op> <gate> Record a gate's resolution and wake the runtime
|
|
557
627
|
run cancel <name> Cancel the active run (requires --force)
|
|
558
628
|
run log <name> Show run history for an Op
|
|
629
|
+
run --generate <provider> Write one CI pipeline file per scheduled Op for
|
|
630
|
+
github, gitlab or forgejo (#2533), from every Op that
|
|
631
|
+
declares a schedule or from --spec <file.json>.
|
|
632
|
+
Files go to the forge's own directory unless
|
|
633
|
+
--output <dir>; --format json prints them instead
|
|
559
634
|
run --components <name|all> Run discovered Component(s) through the interpret
|
|
560
635
|
driver on the local executor (--env <env>; #585).
|
|
561
636
|
On success, auto-emits a release-ledger record per
|
|
@@ -615,6 +690,76 @@ Ops:
|
|
|
615
690
|
predicts the account. The level reaches the engine
|
|
616
691
|
verbatim; without the flag nothing is asked (#2377)
|
|
617
692
|
|
|
693
|
+
Workspace (level 1, #2524):
|
|
694
|
+
workspace init [dir] Propose a chant.workspace.json from the projects and
|
|
695
|
+
packages already in the repository, print it with the
|
|
696
|
+
directories that would leave the root project, and
|
|
697
|
+
write it only on confirmation (--yes writes without
|
|
698
|
+
asking; --name <name> names the workspace; --verbose
|
|
699
|
+
lists every file leaving the root project)
|
|
700
|
+
workspace ls [dir] List the declaration's members and example groups.
|
|
701
|
+
A member that can't be read is listed with a reason
|
|
702
|
+
code and still exits 0. --at <rev> reads a commit's
|
|
703
|
+
git objects; --json prints the read-contract document
|
|
704
|
+
workspace status <env> [dir] [--compare-to <env>] [--json]
|
|
705
|
+
Each member's latest release in <env>, as digest and
|
|
706
|
+
git SHA, read from its ledger on the local
|
|
707
|
+
chant/lifecycle branch (_members/<member>/ or the flat
|
|
708
|
+
layout). --compare-to <env> shows a second environment
|
|
709
|
+
beside it and marks the members whose digests differ.
|
|
710
|
+
Read only; never fetches. --json prints the
|
|
711
|
+
read-contract document
|
|
712
|
+
workspace records --kind <kind file> [--current] [--at <rev>] [--base <rev>] [--require attested] [--json]
|
|
713
|
+
Read the records a record kind locates, validated
|
|
714
|
+
against its schema, with reason codes for invalid
|
|
715
|
+
ones. --current leaves out superseded records; --at
|
|
716
|
+
reads a commit's git objects. Needs no workspace file.
|
|
717
|
+
Each record reports its provenance level, judged by
|
|
718
|
+
the signers at --base (default: the target branch);
|
|
719
|
+
--require attested exits 2 if any record is not
|
|
720
|
+
attested
|
|
721
|
+
workspace verify [--base <rev>] [--head <rev>] [--require attested]
|
|
722
|
+
Check the commits in base..head against the signers
|
|
723
|
+
and roles read from base. A change to the signers file
|
|
724
|
+
or .chant/trust.json needs a signature by a signer
|
|
725
|
+
trusted at base. Does nothing without a signers file
|
|
726
|
+
workspace lineage [--json]
|
|
727
|
+
Show each scope in .chant/workspace.lock.json: its
|
|
728
|
+
template and pin, locally edited files and open
|
|
729
|
+
manual steps. Needs no workspace file
|
|
730
|
+
workspace lineage resolve <path>
|
|
731
|
+
Close a manual step once the file is merged by hand
|
|
732
|
+
workspace upgrade [<scope>] [--to <ref>] [--allow-code] [--dry-run] [--output <file>]
|
|
733
|
+
Bring a lineage scope to a newer template version: fetch
|
|
734
|
+
it, migrate and merge per file in a worktree, run build,
|
|
735
|
+
lint and workspace check there, then gate on the digest
|
|
736
|
+
of the patch (chant approve workspace-upgrade <scope>).
|
|
737
|
+
A second run with the approval applies the patch
|
|
738
|
+
workspace check [--at <rev>] [--json] [--format stylish|json|sarif] [--generated]
|
|
739
|
+
Fail on an unreadable lineage lock or an open manual
|
|
740
|
+
step, and, in a declared workspace, on a WSP check of
|
|
741
|
+
the declaration, member ledgers, pipelines or
|
|
742
|
+
generated files. --generated runs declared generators
|
|
743
|
+
and compares their output. Needs no workspace file.
|
|
744
|
+
--at reads a commit's git objects; --format json
|
|
745
|
+
prints the read-contract document
|
|
746
|
+
workspace build [dir] [--member <name>] [-o <dir>] [--dry-run]
|
|
747
|
+
Build every chant member and example project, each with
|
|
748
|
+
its own chant, one process per toolchain. -o <dir>
|
|
749
|
+
writes <dir>/<member>.json; --member narrows the run;
|
|
750
|
+
--dry-run prints which chant runs which project
|
|
751
|
+
workspace lint [dir] [--format stylish|json|sarif] [--member <name>]
|
|
752
|
+
Lint every chant member and example project with its
|
|
753
|
+
own chant; sarif writes one run per member
|
|
754
|
+
workspace audit [dir] [--json] [--member <name>]
|
|
755
|
+
Audit each chant member with its own .chant-audit.json;
|
|
756
|
+
every finding carries a member field
|
|
757
|
+
workspace graph [dir] [--at <rev>] [--member <name>] [-o <file>]
|
|
758
|
+
Compose each chant member's chant graph into one IR,
|
|
759
|
+
with <member>/<id> ids and groups.byMember: the
|
|
760
|
+
read-contract document. --at <rev> runs each member's
|
|
761
|
+
source as it was at that commit
|
|
762
|
+
|
|
618
763
|
Lifecycle (alias: lc):
|
|
619
764
|
lifecycle snapshot <env> Query API, save metadata to orphan branch
|
|
620
765
|
--deep: also record each resource's property tree,
|
|
@@ -670,6 +815,19 @@ Component release ledger + status:
|
|
|
670
815
|
[--digest <manifestDigest>] -o <dir> [--json]);
|
|
671
816
|
copies every image/template/asset/sbom entry
|
|
672
817
|
byte-for-byte plus a self-describing manifest.json
|
|
818
|
+
components promote Deploy the digests one environment's release
|
|
819
|
+
ledger records to another, without a build
|
|
820
|
+
(--from <env> --to <env> [--component <name>
|
|
821
|
+
[--digest <sha256:...>]]; --dry-run prints the
|
|
822
|
+
plan; the target's gates still apply)
|
|
823
|
+
components rollback <env> Redeploy an earlier release of an environment
|
|
824
|
+
from its recorded digest (--component <name>
|
|
825
|
+
[--digest <sha256:...>]; defaults to the release
|
|
826
|
+
before the current one; --dry-run prints the plan)
|
|
827
|
+
components redeploy <env> Redeploy the release an environment's ledger
|
|
828
|
+
records as current, after a deploy that failed
|
|
829
|
+
partway (--component <name> [--digest <sha256:...>];
|
|
830
|
+
--dry-run prints the plan; gates still apply)
|
|
673
831
|
|
|
674
832
|
Lexicon development:
|
|
675
833
|
dev generate Generate lexicon artifacts (+ validate + coverage)
|
|
@@ -712,7 +870,8 @@ Options:
|
|
|
712
870
|
re-evaluates for that environment (build + graph), and
|
|
713
871
|
drives organizational policy. Must be in chant.config
|
|
714
872
|
\`environments\` when declared.
|
|
715
|
-
-t, --template <name> Init template (e.g. node-pipeline, docker-build)
|
|
873
|
+
-t, --template <name> Init template (e.g. node-pipeline, docker-build);
|
|
874
|
+
records its lineage in .chant/workspace.lock.json
|
|
716
875
|
--skill <name> Init: install only this skill from the lexicon
|
|
717
876
|
--skip-mcp Init: scaffold without writing the project's .mcp.json
|
|
718
877
|
--fix Auto-fix fixable issues (lint command)
|
|
@@ -744,9 +903,14 @@ Options:
|
|
|
744
903
|
--use-composites Rewrite to composite calls when patterns match (migrate)
|
|
745
904
|
--components Target discovered Component declarations instead of
|
|
746
905
|
lexicon resources (list, describe, graph, build, run)
|
|
747
|
-
--generate <lexicon> Generate mode
|
|
748
|
-
|
|
749
|
-
|
|
906
|
+
--generate <lexicon> Generate mode: synthesize CI YAML for <lexicon> (github,
|
|
907
|
+
gitlab or forgejo) instead of running. build
|
|
908
|
+
--components: one pipeline for the components; run:
|
|
909
|
+
one pipeline file per scheduled Op
|
|
910
|
+
--spec <file> (run --generate) JSON Op specs: an array, or
|
|
911
|
+
{ ops, options }
|
|
912
|
+
--promote-to <env> (build --components --generate) Add a job that
|
|
913
|
+
promotes the deployed releases to <env>
|
|
750
914
|
--no-release-record Skip auto-emitting a release-ledger record after a
|
|
751
915
|
successful \`run --components\` deploy (default: on;
|
|
752
916
|
also settable via chant.config.ts's
|
|
@@ -778,19 +942,24 @@ Options:
|
|
|
778
942
|
project source; network egress is NOT blocked (see
|
|
779
943
|
docs). Default: off (also settable via
|
|
780
944
|
chant.config.ts's build.sandbox: true; #1045)
|
|
781
|
-
--param <name=value> (build, graph, run --components, components fan-out
|
|
782
|
-
|
|
783
|
-
|
|
945
|
+
--param <name=value> (build, graph, run --components, components fan-out,
|
|
946
|
+
components promote, components rollback,
|
|
947
|
+
components redeploy) Bind a
|
|
948
|
+
declared build-time parameter (chant.config.ts's buildParams)
|
|
784
949
|
to a value, for source to read as params.<name>
|
|
785
950
|
(#1064) instead of process.env — repeatable.
|
|
786
951
|
Distinct from the AWS lexicon's deploy-time
|
|
787
952
|
Parameter(): this resolves before synthesis, so it
|
|
788
953
|
can change which resources are produced at all.
|
|
789
|
-
Highest precedence.
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
954
|
+
Highest precedence. With init --from, it sets a
|
|
955
|
+
template parameter that the template's
|
|
956
|
+
chant.template.json declares instead (#2627).
|
|
957
|
+
--params-file <path> (build, graph, run --components, components fan-out,
|
|
958
|
+
components promote, components rollback,
|
|
959
|
+
components redeploy) JSON file
|
|
960
|
+
of { "name": value } build-time parameter values
|
|
793
961
|
(#1064). Second precedence, after --param.
|
|
962
|
+
init --from refuses it: pass --param instead.
|
|
794
963
|
|
|
795
964
|
Examples:
|
|
796
965
|
chant build ./infra/
|
|
@@ -800,6 +969,7 @@ Examples:
|
|
|
800
969
|
chant build ./infra/ --fold
|
|
801
970
|
chant build ./infra/ --components --generate gitlab
|
|
802
971
|
chant build ./infra/ --components --generate gitlab --output .gitlab-ci.yml
|
|
972
|
+
chant run --generate github
|
|
803
973
|
chant run --components search-service --env staging
|
|
804
974
|
chant run --components all --env production
|
|
805
975
|
chant components export prod --component search-service -o ./dist/search-service
|
|
@@ -923,6 +1093,47 @@ async function loadPluginsOrExit(path: string): Promise<import("../lexicon").Lex
|
|
|
923
1093
|
return plugins;
|
|
924
1094
|
}
|
|
925
1095
|
|
|
1096
|
+
/** Whether `def` must run without evaluating the project's `chant.config.ts` (chant#2591). */
|
|
1097
|
+
function commandRunsNoConfig(def: CommandDef, args: ParsedArgs): boolean {
|
|
1098
|
+
return typeof def.runsNoConfig === "function" ? def.runsNoConfig(args) : def.runsNoConfig === true;
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
/**
|
|
1102
|
+
* Run one level-0 command line in this process and return its exit code
|
|
1103
|
+
* (#2537). `chant workspace member-run` calls it once per member, from inside
|
|
1104
|
+
* the member's directory, so each member is built, linted, audited or graphed
|
|
1105
|
+
* as `chant <verb> .` would do it there, while members that share a toolchain
|
|
1106
|
+
* share one process. It is main()'s dispatch without the help, the root
|
|
1107
|
+
* refusal and the lexicon command groups: the config is loaded, `--env` is
|
|
1108
|
+
* checked, plugins are loaded when the command needs them, and the handler
|
|
1109
|
+
* runs. A `process.exit` inside (loadPluginsOrExit's, say) is the caller's to
|
|
1110
|
+
* catch.
|
|
1111
|
+
*/
|
|
1112
|
+
export async function runCommandInProcess(argv: string[]): Promise<number> {
|
|
1113
|
+
const args = parseArgs(argv);
|
|
1114
|
+
const match = resolveCommand(args, commandRegistry);
|
|
1115
|
+
if (!match) {
|
|
1116
|
+
console.error(formatError({ message: `Unknown command: ${args.command}` }));
|
|
1117
|
+
return 1;
|
|
1118
|
+
}
|
|
1119
|
+
if (args.env) process.env[ENV_VAR] = args.env;
|
|
1120
|
+
let loadedConfig;
|
|
1121
|
+
try {
|
|
1122
|
+
// chant#2618 — `workspace audit` reaches `audit` through here, once per
|
|
1123
|
+
// member. A `runsNoConfig` command skips the load, as it does in main().
|
|
1124
|
+
if (!commandRunsNoConfig(match.def, args)) loadedConfig = await loadChantConfigUpward(resolve(args.path));
|
|
1125
|
+
} catch {
|
|
1126
|
+
// A project with no config is the handler's to report, as in main().
|
|
1127
|
+
}
|
|
1128
|
+
const envErr = unknownEnvError(args.env, loadedConfig?.config.environments);
|
|
1129
|
+
if (envErr) {
|
|
1130
|
+
console.error(formatError({ message: envErr, hint: "Declare it in chant.config `environments`, or omit --env." }));
|
|
1131
|
+
return 1;
|
|
1132
|
+
}
|
|
1133
|
+
const plugins = match.def.requiresPlugins ? await loadPluginsOrExit(match.compound ? "." : args.path) : [];
|
|
1134
|
+
return match.def.handler({ args, plugins, serializers: plugins.map((p) => p.serializer) });
|
|
1135
|
+
}
|
|
1136
|
+
|
|
926
1137
|
// ── Command registry ──────────────────────────────────────────────
|
|
927
1138
|
|
|
928
1139
|
/**
|
|
@@ -943,8 +1154,10 @@ export const commandRegistry: CommandDef[] = [
|
|
|
943
1154
|
{ name: "describe", handler: runDescribe },
|
|
944
1155
|
{ name: "explain", handler: runExplain },
|
|
945
1156
|
{ name: "search", handler: runSearch },
|
|
946
|
-
|
|
947
|
-
|
|
1157
|
+
// chant#2591 — `import --agents` and `audit` read chant.config statically
|
|
1158
|
+
// and never evaluate it (chant#2589 for audit, which audits code it must not run).
|
|
1159
|
+
{ name: "import", handler: runImport, runsNoConfig: (args) => args.agents === true },
|
|
1160
|
+
{ name: "audit", handler: runAudit, runsNoConfig: true },
|
|
948
1161
|
{ name: "migrate", handler: runMigrate },
|
|
949
1162
|
// Read-only Terraform peelability advisor (#214). Compound so "advise" lands
|
|
950
1163
|
// in args.path; the estate dir comes from --from. No plugins, no project.
|
|
@@ -963,7 +1176,7 @@ export const commandRegistry: CommandDef[] = [
|
|
|
963
1176
|
// Status read over a tree of carve manifests (#2038): the contract a
|
|
964
1177
|
// renderer replaces its own walk-and-guess discovery with. Read-only.
|
|
965
1178
|
{ name: "carve status", handler: runCarveStatus },
|
|
966
|
-
{ name: "init", handler: runInit },
|
|
1179
|
+
{ name: "init", handler: runInit, runsNoConfig: true },
|
|
967
1180
|
{ name: "init lexicon", handler: runInitLexicon },
|
|
968
1181
|
{ name: "update", handler: runUpdate },
|
|
969
1182
|
{ name: "doctor", handler: runDoctor },
|
|
@@ -971,7 +1184,7 @@ export const commandRegistry: CommandDef[] = [
|
|
|
971
1184
|
// Dev subcommands
|
|
972
1185
|
{ name: "dev generate", requiresPlugins: true, handler: runDevGenerate },
|
|
973
1186
|
{ name: "dev publish", requiresPlugins: true, handler: runDevPublish },
|
|
974
|
-
{ name: "dev onboard", handler: runDevOnboard },
|
|
1187
|
+
{ name: "dev onboard", handler: runDevOnboard, runsNoConfig: true },
|
|
975
1188
|
{ name: "dev check-lexicon", handler: runDevCheckLexicon },
|
|
976
1189
|
{ name: "dev surface-diff", handler: runDevSurfaceDiff },
|
|
977
1190
|
{ name: "dev pinned-upgrade", handler: runDevPinnedUpgrade },
|
|
@@ -994,6 +1207,27 @@ export const commandRegistry: CommandDef[] = [
|
|
|
994
1207
|
{ name: "graph", handler: runGraph },
|
|
995
1208
|
{ name: "vendor", handler: runVendor },
|
|
996
1209
|
|
|
1210
|
+
// Workspace reads (#2524). Imported on first use, so a level-0 command never
|
|
1211
|
+
// loads anything under workspace/ (#2525 rule 5, pinned by #2526's goldens).
|
|
1212
|
+
{ name: "workspace records", handler: async (ctx) => (await import("../workspace/records-cli")).runWorkspaceRecords(ctx) },
|
|
1213
|
+
{ name: "workspace init", handler: async (ctx) => (await import("../workspace/init")).runWorkspaceInit(ctx) },
|
|
1214
|
+
{ name: "workspace ls", handler: async (ctx) => (await import("../workspace/ls")).runWorkspaceLs(ctx) },
|
|
1215
|
+
{ name: "workspace status", handler: async (ctx) => (await import("../workspace/status")).runWorkspaceStatus(ctx) },
|
|
1216
|
+
{ name: "workspace lineage", handler: async (ctx) => (await import("../workspace/lineage-cli")).runWorkspaceLineage(ctx) },
|
|
1217
|
+
{ name: "workspace upgrade", handler: async (ctx) => (await import("../workspace/lineage-upgrade-cli")).runWorkspaceUpgrade(ctx) },
|
|
1218
|
+
// #2641 — workspace check reads member configs statically and never runs one.
|
|
1219
|
+
{ name: "workspace check", runsNoConfig: true, handler: async (ctx) => (await import("../workspace/lineage-check")).runWorkspaceCheck(ctx) },
|
|
1220
|
+
// #2537 — per-member commands. Each member runs under its own chant, one
|
|
1221
|
+
// process per toolchain identity; `member-run` is that process's entry.
|
|
1222
|
+
{ name: "workspace build", handler: async (ctx) => (await import("../workspace/member-commands")).runWorkspaceMembers(ctx, "build") },
|
|
1223
|
+
{ name: "workspace lint", handler: async (ctx) => (await import("../workspace/member-commands")).runWorkspaceMembers(ctx, "lint") },
|
|
1224
|
+
// chant#2618 — audit runs no project code, at the workspace level too.
|
|
1225
|
+
{ name: "workspace audit", runsNoConfig: true, handler: async (ctx) => (await import("../workspace/member-commands")).runWorkspaceMembers(ctx, "audit") },
|
|
1226
|
+
{ name: "workspace graph", handler: async (ctx) => (await import("../workspace/member-commands")).runWorkspaceMembers(ctx, "graph") },
|
|
1227
|
+
// Each unit decides for itself whether its config is loaded (runCommandInProcess).
|
|
1228
|
+
{ name: "workspace member-run", runsNoConfig: true, handler: async (ctx) => (await import("../workspace/member-run")).runWorkspaceMemberRun(ctx, runCommandInProcess) },
|
|
1229
|
+
{ name: "workspace verify", handler: async (ctx) => (await import("../workspace/trust/verify-cli")).runWorkspaceVerify(ctx) },
|
|
1230
|
+
|
|
997
1231
|
// State subcommands
|
|
998
1232
|
{ name: "lifecycle snapshot", requiresPlugins: true, handler: runLifecycleSnapshot },
|
|
999
1233
|
{ name: "lifecycle show", handler: runLifecycleShow },
|
|
@@ -1015,6 +1249,9 @@ export const commandRegistry: CommandDef[] = [
|
|
|
1015
1249
|
{ name: "components status", requiresPlugins: true, handler: runComponentsStatus },
|
|
1016
1250
|
{ name: "components release", handler: runComponentsReleaseRecord },
|
|
1017
1251
|
{ name: "components export", handler: runComponentsExport },
|
|
1252
|
+
{ name: "components promote", handler: runComponentsPromote },
|
|
1253
|
+
{ name: "components rollback", handler: runComponentsRollback },
|
|
1254
|
+
{ name: "components redeploy", handler: runComponentsRedeploy },
|
|
1018
1255
|
|
|
1019
1256
|
// Local emulators of configured lexicons (#920). Compound so the action word
|
|
1020
1257
|
// lands in args.path (not consumed as a project dir) and projectPath is forced ".".
|
|
@@ -1034,6 +1271,7 @@ export const commandRegistry: CommandDef[] = [
|
|
|
1034
1271
|
{ name: "dev", handler: runDevUnknown },
|
|
1035
1272
|
{ name: "serve", handler: runServeUnknown },
|
|
1036
1273
|
{ name: "components", handler: runComponentsUnknown },
|
|
1274
|
+
{ name: "workspace", handler: async (ctx) => (await import("../workspace/records-cli")).runWorkspaceUnknown(ctx) },
|
|
1037
1275
|
];
|
|
1038
1276
|
|
|
1039
1277
|
/**
|
|
@@ -1094,10 +1332,16 @@ async function main(): Promise<void> {
|
|
|
1094
1332
|
// subdirectory build/command (`chant build src/<stack> --env prod`) the
|
|
1095
1333
|
// declared `environments` almost always live in the root `chant.config.ts`,
|
|
1096
1334
|
// not `args.path` itself.
|
|
1335
|
+
//
|
|
1336
|
+
// chant#2591 — a command marked `runsNoConfig` skips this load: it must not
|
|
1337
|
+
// run the project's `chant.config.ts` (see `CommandDef.runsNoConfig`). Such a
|
|
1338
|
+
// command gets no `--env` check against the declared environments either.
|
|
1339
|
+
const earlyMatch = resolveCommand(args, commandRegistry);
|
|
1340
|
+
const runsNoConfig = earlyMatch != null && commandRunsNoConfig(earlyMatch.def, args);
|
|
1097
1341
|
const projectPath0 = resolve(args.path === "." ? "." : args.path);
|
|
1098
1342
|
let loadedConfig;
|
|
1099
1343
|
try {
|
|
1100
|
-
loadedConfig = await loadChantConfigUpward(projectPath0);
|
|
1344
|
+
if (!runsNoConfig) loadedConfig = await loadChantConfigUpward(projectPath0);
|
|
1101
1345
|
initRuntime();
|
|
1102
1346
|
} catch {
|
|
1103
1347
|
// Config may not exist yet (e.g. `chant init`)
|
|
@@ -1111,7 +1355,7 @@ async function main(): Promise<void> {
|
|
|
1111
1355
|
process.exit(1);
|
|
1112
1356
|
}
|
|
1113
1357
|
|
|
1114
|
-
const match =
|
|
1358
|
+
const match = earlyMatch;
|
|
1115
1359
|
if (!match) {
|
|
1116
1360
|
// chant #1078 — not one of core's own commands; check whether a lexicon
|
|
1117
1361
|
// mounted a command group under this name before giving up. This is the
|
|
@@ -1129,6 +1373,28 @@ async function main(): Promise<void> {
|
|
|
1129
1373
|
process.exit(1);
|
|
1130
1374
|
}
|
|
1131
1375
|
|
|
1376
|
+
// #2537 (#2524 D0) — at the root of a declared workspace, `build` and
|
|
1377
|
+
// `lint` refuse with WSP000 unless `--root-only` or `rootOnly: true` says
|
|
1378
|
+
// to run on the root project alone. Both lookups only test whether files
|
|
1379
|
+
// exist; the workspace code loads only when this project is a declared root.
|
|
1380
|
+
if (match.def.name === "build" || match.def.name === "lint") {
|
|
1381
|
+
const target = resolve(args.path);
|
|
1382
|
+
const workspace = findWorkspaceRoot(target);
|
|
1383
|
+
if (workspace && findProjectRoot(target) === workspace.dir) {
|
|
1384
|
+
const { guardRootCommand } = await import("../workspace/root-refusal");
|
|
1385
|
+
const refused = guardRootCommand({
|
|
1386
|
+
verb: match.def.name,
|
|
1387
|
+
target,
|
|
1388
|
+
workspaceDir: workspace.dir,
|
|
1389
|
+
rootOnly: args.rootOnly === true || loadedConfig?.config.rootOnly === true,
|
|
1390
|
+
});
|
|
1391
|
+
if (refused !== undefined) {
|
|
1392
|
+
await flushAndExit(refused);
|
|
1393
|
+
return;
|
|
1394
|
+
}
|
|
1395
|
+
}
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1132
1398
|
// For compound commands (e.g. "run list", "lifecycle plan <env>"), the first
|
|
1133
1399
|
// positional is a subcommand argument — an environment, op, or lexicon name —
|
|
1134
1400
|
// not a project path. Plugins always load from the cwd; the handler reads its
|
package/src/cli/mcp/op-tools.ts
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* run.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
+
import { lexiconNames } from "../../lexicon-module";
|
|
17
18
|
import { resolve } from "node:path";
|
|
18
19
|
import { discoverOps } from "../../op/discover";
|
|
19
20
|
import { createLocalOpRuntime } from "../../op/runtimes/local";
|
|
@@ -39,7 +40,7 @@ async function runtimeFor(name: unknown): Promise<OpRuntimeProvider> {
|
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
const configured = await loadChantConfig(resolve("."))
|
|
42
|
-
.then(({ config }) => config.lexicons ?? [])
|
|
43
|
+
.then(({ config }) => lexiconNames(config.lexicons ?? []))
|
|
43
44
|
.catch(() => [] as string[]);
|
|
44
45
|
if (!configured.includes(wanted)) {
|
|
45
46
|
throw new Error(
|