@intentius/chant 0.124.46 → 0.124.49
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/__golden__/wave-loop/op-by-apply-after-fails.json +10 -0
- package/dist/__golden__/wave-loop/op-by-apply-hold.json +10 -0
- package/dist/__golden__/wave-loop/op-by-apply-ignored.json +10 -0
- package/dist/__golden__/wave-loop/op-by-apply-pass.json +10 -0
- package/dist/__golden__/wave-loop/op-by-apply-skip.json +10 -0
- package/dist/__golden__/wave-loop/op-cost-member-clash.json +6 -0
- package/dist/__golden__/wave-loop/op-cost-member.json +13 -0
- package/dist/__golden__/wave-loop/op-denied-source.json +16 -0
- package/dist/__golden__/wave-loop/op-denied.json +16 -0
- package/dist/__golden__/wave-loop/op-discover-rest-short.json +6 -0
- package/dist/__golden__/wave-loop/op-discover-rest-stops.json +13 -0
- package/dist/__golden__/wave-loop/op-discover-rest.json +26 -0
- package/dist/__golden__/wave-loop/op-discover-wide.json +26 -0
- package/dist/__golden__/wave-loop/op-held-on-again.json +16 -0
- package/dist/__golden__/wave-loop/op-held-on-before-apply.json +16 -0
- package/dist/__golden__/wave-loop/op-held-on.json +16 -0
- package/dist/__golden__/wave-loop/op-hooks-apply-fails.json +13 -0
- package/dist/__golden__/wave-loop/op-hooks-fail-after-apply.json +13 -0
- package/dist/__golden__/wave-loop/op-hooks-fail-before-apply.json +13 -0
- package/dist/__golden__/wave-loop/op-hooks-fail-before-plan.json +13 -0
- package/dist/__golden__/wave-loop/op-hooks-held.json +13 -0
- package/dist/__golden__/wave-loop/op-hooks-hold-before-apply.json +13 -0
- package/dist/__golden__/wave-loop/op-hooks-pass.json +13 -0
- package/dist/__golden__/wave-loop/op-hooks-refused-at-base.json +13 -0
- package/dist/__golden__/wave-loop/op-hooks-share.json +33 -0
- package/dist/__golden__/wave-loop/op-outcome-held.json +10 -0
- package/dist/__golden__/wave-loop/op-outcome-replan-approved.json +10 -0
- package/dist/__golden__/wave-loop/op-outcome-replan-forever.json +10 -0
- package/dist/__golden__/wave-loop/op-outcome-replan.json +10 -0
- package/dist/__golden__/wave-loop/op-outcome-stood-down.json +10 -0
- package/dist/__golden__/wave-loop/op-outcome-unreadable.json +10 -0
- package/dist/__golden__/wave-loop/op-overridden.json +16 -0
- package/dist/__golden__/wave-loop/op-per-run.json +20 -0
- package/dist/__golden__/wave-loop/op-point.json +13 -0
- package/dist/__golden__/wave-loop/op-pr-review.json +10 -0
- package/dist/__golden__/wave-loop/op-sealed.json +10 -0
- package/dist/__golden__/wave-loop/op-spend-change-only.json +10 -0
- package/dist/__golden__/wave-loop/op-spend.json +10 -0
- package/dist/__golden__/wave-loop/op-wave-commands.json +55 -0
- package/dist/__golden__/wave-loop/op-wide-refused.json +26 -0
- package/dist/__golden__/wave-loop/op-wide-waiting.json +29 -0
- package/dist/__golden__/wave-loop/op-wide.json +39 -0
- package/dist/action-pins.d.ts +61 -0
- package/dist/action-pins.d.ts.map +1 -0
- package/dist/action-pins.js +77 -0
- package/dist/cli/commands/carve.d.ts +3 -0
- package/dist/cli/commands/carve.d.ts.map +1 -1
- package/dist/cli/commands/carve.js +36 -7
- package/dist/cli/commands/import-report.d.ts +26 -0
- package/dist/cli/commands/import-report.d.ts.map +1 -0
- package/dist/cli/commands/import-report.js +65 -0
- package/dist/cli/commands/import.d.ts +11 -1
- package/dist/cli/commands/import.d.ts.map +1 -1
- package/dist/cli/commands/import.js +22 -3
- package/dist/cli/commands/migrate.d.ts +13 -1
- package/dist/cli/commands/migrate.d.ts.map +1 -1
- package/dist/cli/commands/migrate.js +134 -10
- package/dist/cli/handlers/approve.d.ts.map +1 -1
- package/dist/cli/handlers/approve.js +41 -14
- package/dist/cli/handlers/build.d.ts.map +1 -1
- package/dist/cli/handlers/build.js +6 -1
- package/dist/cli/handlers/graph-reader.d.ts +26 -0
- package/dist/cli/handlers/graph-reader.d.ts.map +1 -0
- package/dist/cli/handlers/graph-reader.js +41 -0
- package/dist/cli/handlers/graph.d.ts.map +1 -1
- package/dist/cli/handlers/graph.js +14 -0
- package/dist/cli/handlers/ledger.d.ts +3 -0
- package/dist/cli/handlers/ledger.d.ts.map +1 -0
- package/dist/cli/handlers/ledger.js +55 -0
- package/dist/cli/handlers/migrate.d.ts.map +1 -1
- package/dist/cli/handlers/migrate.js +18 -11
- package/dist/cli/handlers/misc.d.ts.map +1 -1
- package/dist/cli/handlers/misc.js +12 -1
- package/dist/cli/handlers/pr-env.js +2 -2
- package/dist/cli/handlers/pr.d.ts +15 -1
- package/dist/cli/handlers/pr.d.ts.map +1 -1
- package/dist/cli/handlers/pr.js +183 -40
- package/dist/cli/handlers/query.d.ts +7 -2
- package/dist/cli/handlers/query.d.ts.map +1 -1
- package/dist/cli/handlers/query.js +16 -4
- package/dist/cli/handlers/release.d.ts.map +1 -1
- package/dist/cli/handlers/release.js +6 -3
- package/dist/cli/handlers/search.d.ts +2 -4
- package/dist/cli/handlers/search.d.ts.map +1 -1
- package/dist/cli/handlers/search.js +13 -39
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +87 -14
- package/dist/cli/parse-args.d.ts.map +1 -1
- package/dist/cli/parse-args.js +47 -2
- package/dist/cli/registry.d.ts +22 -4
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/components/builders.d.ts +5 -1
- package/dist/components/builders.d.ts.map +1 -1
- package/dist/components/builders.js +5 -0
- package/dist/components/capability-plugin-loader.d.ts.map +1 -1
- package/dist/components/capability-plugin-loader.js +16 -1
- package/dist/components/capability-plugin.d.ts +14 -0
- package/dist/components/capability-plugin.d.ts.map +1 -1
- package/dist/components/pr-hooks.d.ts +21 -1
- package/dist/components/pr-hooks.d.ts.map +1 -1
- package/dist/components/pr-hooks.js +72 -4
- package/dist/components/pr-pipeline.d.ts +45 -10
- package/dist/components/pr-pipeline.d.ts.map +1 -1
- package/dist/components/pr-pipeline.js +47 -14
- package/dist/components/pr-policy.d.ts +36 -0
- package/dist/components/pr-policy.d.ts.map +1 -1
- package/dist/components/pr-policy.js +36 -0
- package/dist/components/pr-run.d.ts +3 -0
- package/dist/components/pr-run.d.ts.map +1 -1
- package/dist/components/pr-run.js +1 -0
- package/dist/components/starter-plugin.d.ts +1 -0
- package/dist/components/starter-plugin.d.ts.map +1 -1
- package/dist/components/starter-plugin.js +5 -1
- package/dist/components/verbs/index.d.ts +2 -0
- package/dist/components/verbs/index.d.ts.map +1 -1
- package/dist/components/verbs/index.js +2 -0
- package/dist/components/verbs/publish-artifact.d.ts +65 -0
- package/dist/components/verbs/publish-artifact.d.ts.map +1 -0
- package/dist/components/verbs/publish-artifact.js +74 -0
- package/dist/components/verbs/publish-image.d.ts +129 -0
- package/dist/components/verbs/publish-image.d.ts.map +1 -0
- package/dist/components/verbs/publish-image.js +145 -0
- package/dist/config-environments.d.ts +20 -0
- package/dist/config-environments.d.ts.map +1 -1
- package/dist/config-environments.js +12 -0
- package/dist/config.d.ts +25 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +10 -2
- package/dist/gate-decision.d.ts +20 -2
- package/dist/gate-decision.d.ts.map +1 -1
- package/dist/gate-decision.js +30 -3
- package/dist/graph-ir.d.ts +25 -0
- package/dist/graph-ir.d.ts.map +1 -1
- package/dist/graph-walk.d.ts +66 -0
- package/dist/graph-walk.d.ts.map +1 -0
- package/dist/graph-walk.js +70 -0
- package/dist/import/parser.d.ts +19 -0
- package/dist/import/parser.d.ts.map +1 -1
- package/dist/lexicon.d.ts +94 -6
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lifecycle/gate-ledger.d.ts +11 -0
- package/dist/lifecycle/gate-ledger.d.ts.map +1 -1
- package/dist/lifecycle/git.d.ts +2 -5
- package/dist/lifecycle/git.d.ts.map +1 -1
- package/dist/lifecycle/ledger-read.d.ts +65 -0
- package/dist/lifecycle/ledger-read.d.ts.map +1 -0
- package/dist/lifecycle/ledger-read.js +160 -0
- package/dist/lifecycle/release-workstation.d.ts +7 -0
- package/dist/lifecycle/release-workstation.d.ts.map +1 -1
- package/dist/lifecycle/release-workstation.js +25 -0
- package/dist/lifecycle/run-ledger.d.ts +4 -3
- package/dist/lifecycle/run-ledger.d.ts.map +1 -1
- package/dist/lifecycle/run-ledger.js +1 -0
- package/dist/lint/discover.js +3 -1
- package/dist/lint/post-synth.d.ts +127 -1
- package/dist/lint/post-synth.d.ts.map +1 -1
- package/dist/lint/post-synth.js +84 -2
- package/dist/lint/rules/op/index.d.ts +1 -0
- package/dist/lint/rules/op/index.d.ts.map +1 -1
- package/dist/lint/rules/op/index.js +2 -0
- package/dist/lint/rules/op/ops019-workspace-op-target.d.ts +32 -0
- package/dist/lint/rules/op/ops019-workspace-op-target.d.ts.map +1 -0
- package/dist/lint/rules/op/ops019-workspace-op-target.js +63 -0
- package/dist/op/activities/activity-contracts.d.ts +9 -6
- package/dist/op/activities/activity-contracts.d.ts.map +1 -1
- package/dist/op/activities/activity-contracts.js +5 -2
- package/dist/op/activities/index.d.ts +2 -2
- package/dist/op/activities/index.d.ts.map +1 -1
- package/dist/op/activities/index.js +1 -1
- package/dist/op/activities/review-agent.d.ts +90 -4
- package/dist/op/activities/review-agent.d.ts.map +1 -1
- package/dist/op/activities/review-agent.js +217 -19
- package/dist/op/activities/work-evidence.d.ts +8 -1
- package/dist/op/activities/work-evidence.d.ts.map +1 -1
- package/dist/op/activities/work-evidence.js +1 -0
- package/dist/op/builders.d.ts +9 -5
- package/dist/op/builders.d.ts.map +1 -1
- package/dist/op/builders.js +9 -5
- package/dist/op/composites/apply-op.d.ts +29 -2
- package/dist/op/composites/apply-op.d.ts.map +1 -1
- package/dist/op/composites/apply-op.js +20 -1
- package/dist/op/gate-approval-base.d.ts +25 -0
- package/dist/op/gate-approval-base.d.ts.map +1 -0
- package/dist/op/gate-approval-base.js +71 -0
- package/dist/op/gate-approval.d.ts +18 -9
- package/dist/op/gate-approval.d.ts.map +1 -1
- package/dist/op/gate-approval.js +13 -31
- package/dist/op/gate-name.d.ts +13 -0
- package/dist/op/gate-name.d.ts.map +1 -1
- package/dist/op/gate-name.js +14 -1
- package/dist/op/gate-quorum.d.ts +100 -3
- package/dist/op/gate-quorum.d.ts.map +1 -1
- package/dist/op/gate-quorum.js +108 -6
- package/dist/op/gate-review.d.ts +9 -0
- package/dist/op/gate-review.d.ts.map +1 -1
- package/dist/op/gate-review.js +13 -0
- package/dist/op/gate.d.ts +47 -5
- package/dist/op/gate.d.ts.map +1 -1
- package/dist/op/gate.js +25 -4
- package/dist/op/index.d.ts +3 -3
- package/dist/op/index.d.ts.map +1 -1
- package/dist/op/index.js +1 -1
- package/dist/op/local-executor.d.ts +45 -3
- package/dist/op/local-executor.d.ts.map +1 -1
- package/dist/op/local-executor.js +68 -7
- package/dist/op/op-waves-run.d.ts +26 -1
- package/dist/op/op-waves-run.d.ts.map +1 -1
- package/dist/op/op-waves-run.js +259 -13
- package/dist/op/op-waves.d.ts +72 -5
- package/dist/op/op-waves.d.ts.map +1 -1
- package/dist/op/op-waves.js +110 -15
- package/dist/op/runtime.d.ts +11 -0
- package/dist/op/runtime.d.ts.map +1 -1
- package/dist/op/schedule-overdue.d.ts +16 -0
- package/dist/op/schedule-overdue.d.ts.map +1 -1
- package/dist/op/schedule-overdue.js +36 -0
- package/dist/op/stage-hooks.d.ts +9 -2
- package/dist/op/stage-hooks.d.ts.map +1 -1
- package/dist/op/stage-hooks.js +7 -5
- package/dist/op/workspace-run-env.d.ts +22 -0
- package/dist/op/workspace-run-env.d.ts.map +1 -0
- package/dist/op/workspace-run-env.js +21 -0
- package/dist/pr-forge.d.ts +24 -0
- package/dist/pr-forge.d.ts.map +1 -1
- package/dist/pr-forge.js +47 -0
- package/dist/pr-loop.d.ts +10 -0
- package/dist/pr-loop.d.ts.map +1 -1
- package/dist/pr-loop.js +4 -0
- package/dist/pr-migrations.d.ts +62 -0
- package/dist/pr-migrations.d.ts.map +1 -0
- package/dist/pr-migrations.js +50 -0
- package/dist/pr-post.d.ts +42 -0
- package/dist/pr-post.d.ts.map +1 -1
- package/dist/pr-post.js +68 -2
- package/dist/read-filter.d.ts +65 -0
- package/dist/read-filter.d.ts.map +1 -0
- package/dist/read-filter.js +179 -0
- package/dist/run-event.d.ts +1 -1
- package/dist/run-event.d.ts.map +1 -1
- package/dist/terraform/carve.d.ts +24 -3
- package/dist/terraform/carve.d.ts.map +1 -1
- package/dist/terraform/carve.js +32 -14
- package/dist/terraform/cuts.d.ts +97 -0
- package/dist/terraform/cuts.d.ts.map +1 -0
- package/dist/terraform/cuts.js +138 -0
- package/dist/terraform/folds.d.ts +26 -0
- package/dist/terraform/folds.d.ts.map +1 -0
- package/dist/terraform/folds.js +38 -0
- package/dist/terraform/graph.d.ts.map +1 -1
- package/dist/terraform/graph.js +10 -0
- package/dist/terraform/reach.d.ts +140 -0
- package/dist/terraform/reach.d.ts.map +1 -0
- package/dist/terraform/reach.js +170 -0
- package/dist/terraform/score.d.ts +14 -0
- package/dist/terraform/score.d.ts.map +1 -1
- package/dist/terraform/score.js +14 -31
- package/dist/terraform/state.d.ts.map +1 -1
- package/dist/terraform/state.js +4 -2
- package/dist/terraform/types.d.ts +8 -0
- package/dist/terraform/types.d.ts.map +1 -1
- package/dist/wave-blocked.d.ts +10 -1
- package/dist/wave-blocked.d.ts.map +1 -1
- package/dist/wave-blocked.js +31 -3
- package/dist/wave-runtime.mjs +264 -254
- package/dist/workspace/check.schema.json +13 -2
- package/dist/workspace/checks/ci-branch.d.ts +44 -0
- package/dist/workspace/checks/ci-branch.d.ts.map +1 -0
- package/dist/workspace/checks/ci-branch.js +133 -0
- package/dist/workspace/checks/gate-approval.d.ts +58 -0
- package/dist/workspace/checks/gate-approval.d.ts.map +1 -0
- package/dist/workspace/checks/gate-approval.js +103 -0
- package/dist/workspace/checks/links.d.ts +3 -0
- package/dist/workspace/checks/links.d.ts.map +1 -1
- package/dist/workspace/checks/links.js +12 -1
- package/dist/workspace/checks/org.d.ts +48 -0
- package/dist/workspace/checks/org.d.ts.map +1 -0
- package/dist/workspace/checks/org.js +156 -0
- package/dist/workspace/checks.d.ts +12 -1
- package/dist/workspace/checks.d.ts.map +1 -1
- package/dist/workspace/checks.js +63 -7
- package/dist/workspace/ci-branches.d.ts +16 -0
- package/dist/workspace/ci-branches.d.ts.map +1 -1
- package/dist/workspace/ci-branches.js +27 -0
- package/dist/workspace/ci-green-cli.js +7 -7
- package/dist/workspace/ci-green-workflow.d.ts +1 -1
- package/dist/workspace/ci-green-workflow.d.ts.map +1 -1
- package/dist/workspace/ci-green-workflow.js +13 -8
- package/dist/workspace/ci-green.d.ts +14 -0
- package/dist/workspace/ci-green.d.ts.map +1 -1
- package/dist/workspace/ci-green.js +44 -11
- package/dist/workspace/ci-run.d.ts +9 -1
- package/dist/workspace/ci-run.d.ts.map +1 -1
- package/dist/workspace/ci-run.js +67 -6
- package/dist/workspace/ci-serve.d.ts +9 -0
- package/dist/workspace/ci-serve.d.ts.map +1 -1
- package/dist/workspace/ci-serve.js +114 -76
- package/dist/workspace/compose-graph.d.ts +14 -0
- package/dist/workspace/compose-graph.d.ts.map +1 -1
- package/dist/workspace/composites.d.ts +4 -1
- package/dist/workspace/composites.d.ts.map +1 -1
- package/dist/workspace/composites.js +5 -2
- package/dist/workspace/composites.schema.json +22 -0
- package/dist/workspace/conformance/__writer_fixture__/work/work.schema.json +105 -1
- package/dist/workspace/cross-root-lint.d.ts +56 -0
- package/dist/workspace/cross-root-lint.d.ts.map +1 -0
- package/dist/workspace/cross-root-lint.js +111 -0
- package/dist/workspace/dbt-models-reader.d.ts +44 -0
- package/dist/workspace/dbt-models-reader.d.ts.map +1 -0
- package/dist/workspace/dbt-models-reader.js +356 -0
- package/dist/workspace/dbt-project-common.d.ts +40 -0
- package/dist/workspace/dbt-project-common.d.ts.map +1 -0
- package/dist/workspace/dbt-project-common.js +106 -0
- package/dist/workspace/dbt-project-reader.d.ts +4 -3
- package/dist/workspace/dbt-project-reader.d.ts.map +1 -1
- package/dist/workspace/dbt-project-reader.js +14 -108
- package/dist/workspace/decision-rank.d.ts +26 -0
- package/dist/workspace/decision-rank.d.ts.map +1 -0
- package/dist/workspace/decision-rank.js +16 -0
- package/dist/workspace/declaration.d.ts +50 -2
- package/dist/workspace/declaration.d.ts.map +1 -1
- package/dist/workspace/declaration.js +57 -11
- package/dist/workspace/declaration.schema.json +166 -24
- package/dist/workspace/environments.d.ts +26 -2
- package/dist/workspace/environments.d.ts.map +1 -1
- package/dist/workspace/environments.js +26 -2
- package/dist/workspace/exit-cli.d.ts +44 -0
- package/dist/workspace/exit-cli.d.ts.map +1 -0
- package/dist/workspace/exit-cli.js +198 -0
- package/dist/workspace/exit.d.ts +159 -0
- package/dist/workspace/exit.d.ts.map +1 -0
- package/dist/workspace/exit.js +480 -0
- package/dist/workspace/exit.schema.json +257 -0
- package/dist/workspace/flyway-dir.d.ts +39 -0
- package/dist/workspace/flyway-dir.d.ts.map +1 -0
- package/dist/workspace/flyway-dir.js +104 -0
- package/dist/workspace/flyway-layout.d.ts +96 -0
- package/dist/workspace/flyway-layout.d.ts.map +1 -0
- package/dist/workspace/flyway-layout.js +308 -0
- package/dist/workspace/graph-cache.d.ts +3 -1
- package/dist/workspace/graph-cache.d.ts.map +1 -1
- package/dist/workspace/graph-cache.js +12 -1
- package/dist/workspace/graph-cli.d.ts.map +1 -1
- package/dist/workspace/graph-cli.js +26 -8
- package/dist/workspace/graph.schema.json +34 -0
- package/dist/workspace/import-fetch.d.ts +38 -0
- package/dist/workspace/import-fetch.d.ts.map +1 -0
- package/dist/workspace/import-fetch.js +99 -0
- package/dist/workspace/import-init.d.ts +26 -0
- package/dist/workspace/import-init.d.ts.map +1 -0
- package/dist/workspace/import-init.js +130 -0
- package/dist/workspace/import-source.d.ts +147 -0
- package/dist/workspace/import-source.d.ts.map +1 -0
- package/dist/workspace/import-source.js +370 -0
- package/dist/workspace/init.d.ts +4 -0
- package/dist/workspace/init.d.ts.map +1 -1
- package/dist/workspace/init.js +70 -3
- package/dist/workspace/intent.d.ts +2 -3
- package/dist/workspace/intent.d.ts.map +1 -1
- package/dist/workspace/intent.js +5 -9
- package/dist/workspace/kind-link-readers.d.ts +59 -2
- package/dist/workspace/kind-link-readers.d.ts.map +1 -1
- package/dist/workspace/kind-link-readers.js +17 -1
- package/dist/workspace/kind-readers.d.ts +6 -0
- package/dist/workspace/kind-readers.d.ts.map +1 -1
- package/dist/workspace/kind-readers.js +18 -0
- package/dist/workspace/kinds.d.ts +90 -3
- package/dist/workspace/kinds.d.ts.map +1 -1
- package/dist/workspace/kinds.js +161 -7
- package/dist/workspace/ledger.schema.json +158 -0
- package/dist/workspace/lexicon-outputs.d.ts +20 -1
- package/dist/workspace/lexicon-outputs.d.ts.map +1 -1
- package/dist/workspace/lexicon-outputs.js +102 -10
- package/dist/workspace/lineage-check.d.ts +3 -0
- package/dist/workspace/lineage-check.d.ts.map +1 -1
- package/dist/workspace/lineage-check.js +23 -4
- package/dist/workspace/lineage-upgrade.d.ts.map +1 -1
- package/dist/workspace/lineage-upgrade.js +13 -4
- package/dist/workspace/links.d.ts +8 -1
- package/dist/workspace/links.d.ts.map +1 -1
- package/dist/workspace/links.js +25 -1
- package/dist/workspace/ls.d.ts +8 -0
- package/dist/workspace/ls.d.ts.map +1 -1
- package/dist/workspace/ls.js +7 -1
- package/dist/workspace/ls.schema.json +7 -0
- package/dist/workspace/member-commands.d.ts.map +1 -1
- package/dist/workspace/member-commands.js +54 -5
- package/dist/workspace/migrate-links.d.ts +45 -0
- package/dist/workspace/migrate-links.d.ts.map +1 -0
- package/dist/workspace/migrate-links.js +100 -0
- package/dist/workspace/migration-dirs.d.ts +74 -0
- package/dist/workspace/migration-dirs.d.ts.map +1 -0
- package/dist/workspace/migration-dirs.js +254 -0
- package/dist/workspace/new-migrations.d.ts +47 -0
- package/dist/workspace/new-migrations.d.ts.map +1 -0
- package/dist/workspace/new-migrations.js +91 -0
- package/dist/workspace/pr-report.schema.json +46 -0
- package/dist/workspace/promote.d.ts +96 -0
- package/dist/workspace/promote.d.ts.map +1 -0
- package/dist/workspace/promote.js +263 -0
- package/dist/workspace/reason-codes.d.ts +21 -0
- package/dist/workspace/reason-codes.d.ts.map +1 -1
- package/dist/workspace/reason-codes.js +25 -0
- package/dist/workspace/records-cli.d.ts +11 -0
- package/dist/workspace/records-cli.d.ts.map +1 -1
- package/dist/workspace/records-cli.js +57 -5
- package/dist/workspace/records.schema.json +5 -0
- package/dist/workspace/release-candidates.d.ts +2 -0
- package/dist/workspace/release-candidates.d.ts.map +1 -1
- package/dist/workspace/release-candidates.js +5 -2
- package/dist/workspace/release-train.d.ts +53 -0
- package/dist/workspace/release-train.d.ts.map +1 -0
- package/dist/workspace/release-train.js +134 -0
- package/dist/workspace/release-workflow.d.ts.map +1 -1
- package/dist/workspace/release-workflow.js +4 -3
- package/dist/workspace/repo-ref.d.ts +45 -0
- package/dist/workspace/repo-ref.d.ts.map +1 -0
- package/dist/workspace/repo-ref.js +114 -0
- package/dist/workspace/run-event.schema.json +2 -2
- package/dist/workspace/runs-cli.d.ts +9 -0
- package/dist/workspace/runs-cli.d.ts.map +1 -1
- package/dist/workspace/runs-cli.js +48 -3
- package/dist/workspace/runs.schema.json +7 -0
- package/dist/workspace/search-contract.d.ts +1 -1
- package/dist/workspace/search-contract.d.ts.map +1 -1
- package/dist/workspace/status-decisions.d.ts +37 -0
- package/dist/workspace/status-decisions.d.ts.map +1 -0
- package/dist/workspace/status-decisions.js +147 -0
- package/dist/workspace/status-gates.d.ts +9 -0
- package/dist/workspace/status-gates.d.ts.map +1 -1
- package/dist/workspace/status.d.ts +4 -0
- package/dist/workspace/status.d.ts.map +1 -1
- package/dist/workspace/status.js +14 -2
- package/dist/workspace/status.schema.json +6 -0
- package/dist/workspace/work-cli.d.ts.map +1 -1
- package/dist/workspace/work-cli.js +5 -3
- package/dist/workspace/work-evidence-ops.d.ts +83 -0
- package/dist/workspace/work-evidence-ops.d.ts.map +1 -0
- package/dist/workspace/work-evidence-ops.js +169 -0
- package/dist/workspace/work-evidence.d.ts +12 -2
- package/dist/workspace/work-evidence.d.ts.map +1 -1
- package/dist/workspace/work-evidence.js +21 -3
- package/dist/workspace/work-evidence.schema.json +49 -2
- package/dist/workspace/workspace-gates.d.ts +110 -0
- package/dist/workspace/workspace-gates.d.ts.map +1 -0
- package/dist/workspace/workspace-gates.js +140 -0
- package/dist/workspace/workspace-kinds.schema.json +108 -10
- package/dist/workspace/workspace-ledger.d.ts +76 -0
- package/dist/workspace/workspace-ledger.d.ts.map +1 -0
- package/dist/workspace/workspace-ledger.js +91 -0
- package/dist/workspace/workspace-run.d.ts +112 -0
- package/dist/workspace/workspace-run.d.ts.map +1 -0
- package/dist/workspace/workspace-run.js +432 -0
- package/package.json +1 -1
- package/src/__golden__/wave-loop/op-by-apply-after-fails.json +10 -0
- package/src/__golden__/wave-loop/op-by-apply-hold.json +10 -0
- package/src/__golden__/wave-loop/op-by-apply-ignored.json +10 -0
- package/src/__golden__/wave-loop/op-by-apply-pass.json +10 -0
- package/src/__golden__/wave-loop/op-by-apply-skip.json +10 -0
- package/src/__golden__/wave-loop/op-cost-member-clash.json +6 -0
- package/src/__golden__/wave-loop/op-cost-member.json +13 -0
- package/src/__golden__/wave-loop/op-denied-source.json +16 -0
- package/src/__golden__/wave-loop/op-denied.json +16 -0
- package/src/__golden__/wave-loop/op-discover-rest-short.json +6 -0
- package/src/__golden__/wave-loop/op-discover-rest-stops.json +13 -0
- package/src/__golden__/wave-loop/op-discover-rest.json +26 -0
- package/src/__golden__/wave-loop/op-discover-wide.json +26 -0
- package/src/__golden__/wave-loop/op-held-on-again.json +16 -0
- package/src/__golden__/wave-loop/op-held-on-before-apply.json +16 -0
- package/src/__golden__/wave-loop/op-held-on.json +16 -0
- package/src/__golden__/wave-loop/op-hooks-apply-fails.json +13 -0
- package/src/__golden__/wave-loop/op-hooks-fail-after-apply.json +13 -0
- package/src/__golden__/wave-loop/op-hooks-fail-before-apply.json +13 -0
- package/src/__golden__/wave-loop/op-hooks-fail-before-plan.json +13 -0
- package/src/__golden__/wave-loop/op-hooks-held.json +13 -0
- package/src/__golden__/wave-loop/op-hooks-hold-before-apply.json +13 -0
- package/src/__golden__/wave-loop/op-hooks-pass.json +13 -0
- package/src/__golden__/wave-loop/op-hooks-refused-at-base.json +13 -0
- package/src/__golden__/wave-loop/op-hooks-share.json +33 -0
- package/src/__golden__/wave-loop/op-outcome-held.json +10 -0
- package/src/__golden__/wave-loop/op-outcome-replan-approved.json +10 -0
- package/src/__golden__/wave-loop/op-outcome-replan-forever.json +10 -0
- package/src/__golden__/wave-loop/op-outcome-replan.json +10 -0
- package/src/__golden__/wave-loop/op-outcome-stood-down.json +10 -0
- package/src/__golden__/wave-loop/op-outcome-unreadable.json +10 -0
- package/src/__golden__/wave-loop/op-overridden.json +16 -0
- package/src/__golden__/wave-loop/op-per-run.json +20 -0
- package/src/__golden__/wave-loop/op-point.json +13 -0
- package/src/__golden__/wave-loop/op-pr-review.json +10 -0
- package/src/__golden__/wave-loop/op-sealed.json +10 -0
- package/src/__golden__/wave-loop/op-spend-change-only.json +10 -0
- package/src/__golden__/wave-loop/op-spend.json +10 -0
- package/src/__golden__/wave-loop/op-wave-commands.json +55 -0
- package/src/__golden__/wave-loop/op-wide-refused.json +26 -0
- package/src/__golden__/wave-loop/op-wide-waiting.json +29 -0
- package/src/__golden__/wave-loop/op-wide.json +39 -0
- package/src/action-pins.test.ts +78 -0
- package/src/action-pins.ts +92 -0
- package/src/cli/commands/carve-score-once.test.ts +99 -0
- package/src/cli/commands/carve.ts +37 -6
- package/src/cli/commands/check-lexicon.test.ts +2 -2
- package/src/cli/commands/import-report.ts +71 -0
- package/src/cli/commands/import.ts +33 -3
- package/src/cli/commands/migrate-dialect.test.ts +145 -0
- package/src/cli/commands/migrate.ts +132 -11
- package/src/cli/handlers/__snapshots__/build-member.test.ts.snap +4 -4
- package/src/cli/handlers/approve.ts +33 -4
- package/src/cli/handlers/build.ts +7 -1
- package/src/cli/handlers/graph-reader.test.ts +31 -0
- package/src/cli/handlers/graph-reader.ts +51 -0
- package/src/cli/handlers/graph.ts +14 -0
- package/src/cli/handlers/ledger.ts +54 -0
- package/src/cli/handlers/migrate.ts +21 -12
- package/src/cli/handlers/misc.ts +10 -1
- package/src/cli/handlers/pr-env.ts +2 -2
- package/src/cli/handlers/pr.ts +176 -37
- package/src/cli/handlers/query.ts +16 -4
- package/src/cli/handlers/release.ts +6 -3
- package/src/cli/handlers/search.ts +13 -34
- package/src/cli/main.test.ts +17 -0
- package/src/cli/main.ts +87 -14
- package/src/cli/parse-args.ts +35 -2
- package/src/cli/registry.ts +22 -4
- package/src/components/builders.ts +8 -0
- package/src/components/capability-plugin-loader.ts +13 -1
- package/src/components/capability-plugin.ts +16 -0
- package/src/components/pr-env-run-bundle.test.ts +1 -0
- package/src/components/pr-hooks.test.ts +73 -5
- package/src/components/pr-hooks.ts +95 -5
- package/src/components/pr-pipeline.ts +64 -16
- package/src/components/pr-policy.test.ts +64 -1
- package/src/components/pr-policy.ts +53 -0
- package/src/components/pr-run.ts +4 -0
- package/src/components/registry.test.ts +1 -1
- package/src/components/starter-plugin.ts +6 -0
- package/src/components/verbs/index.ts +2 -0
- package/src/components/verbs/publish-artifact.test.ts +60 -0
- package/src/components/verbs/publish-artifact.ts +122 -0
- package/src/components/verbs/publish-image.test.ts +101 -0
- package/src/components/verbs/publish-image.ts +265 -0
- package/src/config-environments.ts +28 -1
- package/src/config.ts +24 -1
- package/src/gate-decision-bundle.test.ts +5 -2
- package/src/gate-decision-identity.test.ts +20 -0
- package/src/gate-decision.ts +46 -3
- package/src/graph-ir.ts +27 -0
- package/src/graph-walk.test.ts +44 -0
- package/src/graph-walk.ts +102 -0
- package/src/import/parser.ts +20 -0
- package/src/lexicon.ts +98 -6
- package/src/lifecycle/gate-ledger.ts +8 -0
- package/src/lifecycle/git.ts +2 -2
- package/src/lifecycle/ledger-read.test.ts +107 -0
- package/src/lifecycle/ledger-read.ts +195 -0
- package/src/lifecycle/release-workstation.ts +24 -0
- package/src/lifecycle/run-ledger.ts +5 -2
- package/src/lint/cross-root.test.ts +122 -0
- package/src/lint/discover.ts +3 -1
- package/src/lint/post-synth.ts +212 -2
- package/src/lint/rules/op/index.ts +2 -0
- package/src/lint/rules/op/ops019-workspace-op-target.ts +89 -0
- package/src/op/activities/activity-contracts.ts +5 -2
- package/src/op/activities/index.ts +2 -2
- package/src/op/activities/review-agent.test.ts +221 -4
- package/src/op/activities/review-agent.ts +265 -22
- package/src/op/activities/work-evidence.ts +9 -1
- package/src/op/builders.ts +9 -5
- package/src/op/composites/apply-op.test.ts +108 -0
- package/src/op/composites/apply-op.ts +37 -2
- package/src/op/gate-approval-at-base.test.ts +97 -0
- package/src/op/gate-approval-base.ts +72 -0
- package/src/op/gate-approval.test.ts +6 -1
- package/src/op/gate-approval.ts +22 -27
- package/src/op/gate-name.ts +16 -1
- package/src/op/gate-quorum-at-base.test.ts +211 -0
- package/src/op/gate-quorum.ts +156 -8
- package/src/op/gate-review.ts +14 -0
- package/src/op/gate.ts +69 -9
- package/src/op/index.ts +3 -2
- package/src/op/local-executor.ts +91 -11
- package/src/op/op-waves-depends-on.test.ts +81 -0
- package/src/op/op-waves-hook-targets.test.ts +4 -2
- package/src/op/op-waves-quorum-product.test.ts +158 -0
- package/src/op/op-waves-run.ts +288 -14
- package/src/op/op-waves.ts +143 -14
- package/src/op/runtime.ts +8 -0
- package/src/op/schedule-overdue.ts +33 -0
- package/src/op/stage-hooks.ts +13 -5
- package/src/op/workspace-run-env.ts +29 -0
- package/src/pr-forge-bundle.test.ts +2 -2
- package/src/pr-forge.test.ts +47 -0
- package/src/pr-forge.ts +68 -0
- package/src/pr-loop-bundle.test.ts +3 -2
- package/src/pr-loop.test.ts +52 -0
- package/src/pr-loop.ts +12 -0
- package/src/pr-migrations.ts +97 -0
- package/src/pr-post-open.e2e.test.ts +36 -0
- package/src/pr-post.test.ts +102 -3
- package/src/pr-post.ts +90 -2
- package/src/read-filter.test.ts +54 -0
- package/src/read-filter.ts +193 -0
- package/src/run-event.ts +1 -1
- package/src/stage-hooks-bundle.test.ts +1 -0
- package/src/terraform/carve.ts +52 -15
- package/src/terraform/cuts.test.ts +173 -0
- package/src/terraform/cuts.ts +188 -0
- package/src/terraform/folds.ts +44 -0
- package/src/terraform/graph.ts +9 -0
- package/src/terraform/radius.test.ts +90 -0
- package/src/terraform/reach.test.ts +146 -0
- package/src/terraform/reach.ts +247 -0
- package/src/terraform/score.ts +27 -29
- package/src/terraform/state.ts +3 -1
- package/src/terraform/types.ts +8 -0
- package/src/wave-blocked.ts +28 -3
- package/src/wave-loop-golden.test.ts +4 -3
- package/src/workspace/__fixtures__/import/spacelift.json +9 -0
- package/src/workspace/__fixtures__/import/tfc.json +13 -0
- package/src/workspace/behold-kinds.test.ts +2 -1
- package/src/workspace/check-contract.test.ts +8 -6
- package/src/workspace/check.schema.json +13 -2
- package/src/workspace/checks/ci-branch.test.ts +128 -0
- package/src/workspace/checks/ci-branch.ts +141 -0
- package/src/workspace/checks/gate-approval.test.ts +77 -0
- package/src/workspace/checks/gate-approval.ts +121 -0
- package/src/workspace/checks/links.ts +12 -1
- package/src/workspace/checks/org.ts +169 -0
- package/src/workspace/checks.ts +68 -7
- package/src/workspace/ci-branches.ts +31 -0
- package/src/workspace/ci-green-branches.test.ts +153 -0
- package/src/workspace/ci-green-cli.ts +7 -7
- package/src/workspace/ci-green-workflow.test.ts +4 -3
- package/src/workspace/ci-green-workflow.ts +13 -9
- package/src/workspace/ci-green.ts +49 -12
- package/src/workspace/ci-run.test.ts +72 -1
- package/src/workspace/ci-run.ts +68 -8
- package/src/workspace/ci-serve.test.ts +95 -0
- package/src/workspace/ci-serve.ts +106 -65
- package/src/workspace/component-environments.test.ts +25 -2
- package/src/workspace/compose-graph.ts +9 -2
- package/src/workspace/composites.schema.json +22 -0
- package/src/workspace/composites.test.ts +39 -8
- package/src/workspace/composites.ts +6 -2
- package/src/workspace/conformance/__writer_fixture__/work/work.schema.json +105 -1
- package/src/workspace/cross-root-lint.test.ts +90 -0
- package/src/workspace/cross-root-lint.ts +126 -0
- package/src/workspace/dbt-kind.test.ts +3 -2
- package/src/workspace/dbt-models-reader.ts +362 -0
- package/src/workspace/dbt-models.test.ts +248 -0
- package/src/workspace/dbt-project-common.ts +113 -0
- package/src/workspace/dbt-project-reader.ts +29 -112
- package/src/workspace/decision-rank.ts +40 -0
- package/src/workspace/declaration.schema.json +166 -24
- package/src/workspace/declaration.ts +101 -15
- package/src/workspace/environments.ts +40 -4
- package/src/workspace/exit-cli.ts +219 -0
- package/src/workspace/exit.schema.json +257 -0
- package/src/workspace/exit.test.ts +185 -0
- package/src/workspace/exit.ts +560 -0
- package/src/workspace/flyway-dir.ts +113 -0
- package/src/workspace/flyway-layout.ts +337 -0
- package/src/workspace/graph-cache.ts +12 -2
- package/src/workspace/graph-cli.ts +25 -10
- package/src/workspace/graph-contract.test.ts +4 -2
- package/src/workspace/graph.schema.json +34 -0
- package/src/workspace/identity.test.ts +29 -2
- package/src/workspace/import-fetch.ts +151 -0
- package/src/workspace/import-init.ts +147 -0
- package/src/workspace/import-source.test.ts +183 -0
- package/src/workspace/import-source.ts +462 -0
- package/src/workspace/init.test.ts +55 -1
- package/src/workspace/init.ts +66 -4
- package/src/workspace/intent.ts +6 -14
- package/src/workspace/kind-link-readers.ts +68 -3
- package/src/workspace/kind-readers.test.ts +36 -0
- package/src/workspace/kind-readers.ts +18 -1
- package/src/workspace/kinds.test.ts +35 -7
- package/src/workspace/kinds.ts +212 -11
- package/src/workspace/ledger.schema.json +158 -0
- package/src/workspace/lexicon-outputs.ts +132 -13
- package/src/workspace/lineage-check.ts +30 -7
- package/src/workspace/lineage-upgrade.test.ts +20 -0
- package/src/workspace/lineage-upgrade.ts +16 -7
- package/src/workspace/links.ts +24 -1
- package/src/workspace/ls-contract.test.ts +1 -1
- package/src/workspace/ls.schema.json +7 -0
- package/src/workspace/ls.ts +10 -1
- package/src/workspace/member-commands.ts +60 -2
- package/src/workspace/member-file-schema.test.ts +124 -0
- package/src/workspace/migrate-links.test.ts +99 -0
- package/src/workspace/migrate-links.ts +108 -0
- package/src/workspace/migration-dirs.test.ts +272 -0
- package/src/workspace/migration-dirs.ts +267 -0
- package/src/workspace/new-migrations.test.ts +98 -0
- package/src/workspace/new-migrations.ts +109 -0
- package/src/workspace/org-scope.test.ts +238 -0
- package/src/workspace/pr-report.schema.json +46 -0
- package/src/workspace/promote.test.ts +114 -0
- package/src/workspace/promote.ts +302 -0
- package/src/workspace/reason-codes.test.ts +10 -1
- package/src/workspace/reason-codes.ts +25 -0
- package/src/workspace/records-cli.ts +58 -5
- package/src/workspace/records.schema.json +5 -0
- package/src/workspace/release-candidates.ts +7 -2
- package/src/workspace/release-train.ts +157 -0
- package/src/workspace/release-workflow.ts +4 -3
- package/src/workspace/repo-ref.ts +113 -0
- package/src/workspace/run-event.schema.json +2 -2
- package/src/workspace/runs-cli.ts +48 -4
- package/src/workspace/runs.schema.json +7 -0
- package/src/workspace/status-contract.test.ts +46 -1
- package/src/workspace/status-decisions.test.ts +100 -0
- package/src/workspace/status-decisions.ts +151 -0
- package/src/workspace/status-gates.ts +9 -0
- package/src/workspace/status.schema.json +6 -0
- package/src/workspace/status.ts +17 -3
- package/src/workspace/where-filters.test.ts +39 -0
- package/src/workspace/work-cli.ts +5 -3
- package/src/workspace/work-evidence-ops.test.ts +176 -0
- package/src/workspace/work-evidence-ops.ts +189 -0
- package/src/workspace/work-evidence.schema.json +49 -2
- package/src/workspace/work-evidence.ts +22 -3
- package/src/workspace/workspace-gates.ts +200 -0
- package/src/workspace/workspace-kinds.schema.json +108 -10
- package/src/workspace/workspace-ledger.ts +130 -0
- package/src/workspace/workspace-run.test.ts +322 -0
- package/src/workspace/workspace-run.ts +461 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release-candidates.d.ts","sourceRoot":"","sources":["../../src/workspace/release-candidates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAUH,eAAO,MAAM,mCAAmC,IAAI,CAAC;A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AAG,IAAI,CAGlF;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,SAAS,eAAe,EAAE,GAAG,cAAc,EAAE,CAclF;AAED,gEAAgE;AAChE,wBAAsB,yBAAyB,CAAC,KAAK,EAAE,sBAAsB,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAuIjH"}
|
|
@@ -38,7 +38,7 @@ import { latestPerComponent, readReleaseLedger } from "../lifecycle/release-ledg
|
|
|
38
38
|
import { readAllReleases, readCuts } from "../lifecycle/release-store.js";
|
|
39
39
|
import { resolveMemberLedger } from "../lifecycle/member-ledger.js";
|
|
40
40
|
import { readBlobFromPath } from "../lifecycle/git.js";
|
|
41
|
-
import { readerVersion } from "./declaration.js";
|
|
41
|
+
import { greenBranches, readerVersion } from "./declaration.js";
|
|
42
42
|
export const RELEASE_CANDIDATES_CONTRACT_VERSION = 1;
|
|
43
43
|
export const RELEASE_CANDIDATES_SCHEMA_ID = "https://intentius.io/chant/schemas/workspace/release-candidates/v1/release-candidates.schema.json";
|
|
44
44
|
/** Why the read stopped. Closed; each code is in `reason-codes.ts`. */
|
|
@@ -113,7 +113,10 @@ export async function releaseCandidatesDocument(query) {
|
|
|
113
113
|
const { commitDetails } = await import("./intent.js");
|
|
114
114
|
const source = scopeSource(cwd);
|
|
115
115
|
const green = source.declaration?.ci?.green ?? null;
|
|
116
|
-
|
|
116
|
+
if (query.branch !== undefined && !(green && greenBranches(green).includes(query.branch))) {
|
|
117
|
+
throw new Error(`--branch ${query.branch} is not a branch ci.green judges${green ? ` (${greenBranches(green).join(", ")})` : ", and the declaration has no ci.green"}`);
|
|
118
|
+
}
|
|
119
|
+
const trunk = resolveTrunk(top, query.branch ?? green?.branch ?? null);
|
|
117
120
|
const tip = tryGit(top, ["rev-parse", "--verify", "--quiet", `refs/remotes/${trunk.remote}/${trunk.branch}^{commit}`]) ??
|
|
118
121
|
tryGit(top, ["rev-parse", "--verify", "--quiet", `refs/heads/${trunk.branch}^{commit}`]);
|
|
119
122
|
const ledger = await resolveMemberLedger(cwd);
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Release trains (#2554, #2524 D19, ws-043): one record that pins a release
|
|
3
|
+
* of every `chant` member, so several members move together.
|
|
4
|
+
*
|
|
5
|
+
* Releases stay per member (ws-043): each is a digest over its artifacts and
|
|
6
|
+
* a git commit, written to the member's own ledger by `chant release cut`. A
|
|
7
|
+
* train names one of them per member: by default the newest cut release, or
|
|
8
|
+
* the one `--pin <member>=<label|digest>` picks. It refuses unless every
|
|
9
|
+
* `chant` member of the declaration has a release, so a train never leaves a
|
|
10
|
+
* member out. It is written to `_members/_workspace/<env>/trains.jsonl`.
|
|
11
|
+
*/
|
|
12
|
+
import type { CommandContext } from "../cli/registry.js";
|
|
13
|
+
export interface TrainMember {
|
|
14
|
+
member: string;
|
|
15
|
+
releaseDigest: string;
|
|
16
|
+
/** The release's git commit. */
|
|
17
|
+
commit: string;
|
|
18
|
+
/** The label its newest cut gave it, or null. */
|
|
19
|
+
label: string | null;
|
|
20
|
+
}
|
|
21
|
+
export interface ReleaseTrainRecord {
|
|
22
|
+
version: 1;
|
|
23
|
+
id: string;
|
|
24
|
+
env: string;
|
|
25
|
+
timestamp: string;
|
|
26
|
+
actor: string;
|
|
27
|
+
/** Every `chant` member, by name. */
|
|
28
|
+
members: TrainMember[];
|
|
29
|
+
}
|
|
30
|
+
/** What one member offers a train: its releases, newest cut first. */
|
|
31
|
+
export interface MemberReleases {
|
|
32
|
+
member: string;
|
|
33
|
+
releases: TrainMember[];
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Pick each member's release, pure. `pins` maps a member to a label or a
|
|
37
|
+
* digest; a member with no pin takes its newest. Returns the members, or
|
|
38
|
+
* the problems that stop the train.
|
|
39
|
+
*/
|
|
40
|
+
export declare function pickTrain(members: readonly MemberReleases[], pins?: ReadonlyMap<string, string>): {
|
|
41
|
+
members: TrainMember[];
|
|
42
|
+
} | {
|
|
43
|
+
problems: string[];
|
|
44
|
+
};
|
|
45
|
+
/** Every `chant` member's releases, newest cut first, read from its ledger. */
|
|
46
|
+
export declare function readMemberReleases(cwd: string): Promise<MemberReleases[]>;
|
|
47
|
+
export declare function readReleaseTrains(cwd: string, env: string): Promise<{
|
|
48
|
+
records: ReleaseTrainRecord[];
|
|
49
|
+
malformed: number;
|
|
50
|
+
}>;
|
|
51
|
+
export declare function appendReleaseTrain(cwd: string, record: ReleaseTrainRecord): Promise<string>;
|
|
52
|
+
export declare function runWorkspaceTrain(ctx: CommandContext): Promise<number>;
|
|
53
|
+
//# sourceMappingURL=release-train.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release-train.d.ts","sourceRoot":"","sources":["../../src/workspace/release-train.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAMtD,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,gCAAgC;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,iDAAiD;IACjD,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,CAAC,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,qCAAqC;IACrC,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB;AAID,sEAAsE;AACtE,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,WAAW,EAAE,CAAC;CACzB;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,SAAS,cAAc,EAAE,EAAE,IAAI,GAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAa,GAAG;IAAE,OAAO,EAAE,WAAW,EAAE,CAAA;CAAE,GAAG;IAAE,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CAgBhK;AAED,+EAA+E;AAC/E,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAkB/E;AAOD,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CAE/H;AAED,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAEjG;AAID,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAiD5E"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Release trains (#2554, #2524 D19, ws-043): one record that pins a release
|
|
3
|
+
* of every `chant` member, so several members move together.
|
|
4
|
+
*
|
|
5
|
+
* Releases stay per member (ws-043): each is a digest over its artifacts and
|
|
6
|
+
* a git commit, written to the member's own ledger by `chant release cut`. A
|
|
7
|
+
* train names one of them per member: by default the newest cut release, or
|
|
8
|
+
* the one `--pin <member>=<label|digest>` picks. It refuses unless every
|
|
9
|
+
* `chant` member of the declaration has a release, so a train never leaves a
|
|
10
|
+
* member out. It is written to `_members/_workspace/<env>/trains.jsonl`.
|
|
11
|
+
*/
|
|
12
|
+
import { randomUUID } from "node:crypto";
|
|
13
|
+
import { resolve } from "node:path";
|
|
14
|
+
import { formatError } from "../cli/format.js";
|
|
15
|
+
import { readAllReleases, readCuts } from "../lifecycle/release-store.js";
|
|
16
|
+
import { readDeclaration, WorkspaceReadError } from "./declaration.js";
|
|
17
|
+
import { locateWorkspace } from "./which-chant.js";
|
|
18
|
+
import { appendWorkspaceLine, readWorkspaceLines } from "./workspace-ledger.js";
|
|
19
|
+
const TRAINS_FILE = "trains.jsonl";
|
|
20
|
+
/**
|
|
21
|
+
* Pick each member's release, pure. `pins` maps a member to a label or a
|
|
22
|
+
* digest; a member with no pin takes its newest. Returns the members, or
|
|
23
|
+
* the problems that stop the train.
|
|
24
|
+
*/
|
|
25
|
+
export function pickTrain(members, pins = new Map()) {
|
|
26
|
+
const problems = [];
|
|
27
|
+
const picked = [];
|
|
28
|
+
for (const name of pins.keys()) {
|
|
29
|
+
if (!members.some((m) => m.member === name))
|
|
30
|
+
problems.push(`--pin ${name}: not a chant member of the workspace`);
|
|
31
|
+
}
|
|
32
|
+
for (const m of members) {
|
|
33
|
+
const pin = pins.get(m.member);
|
|
34
|
+
const r = pin === undefined ? m.releases[0] : m.releases.find((x) => x.releaseDigest === pin || x.label === pin);
|
|
35
|
+
if (!r) {
|
|
36
|
+
problems.push(pin === undefined ? `member ${m.member} has no release; cut one with chant release cut in its directory` : `member ${m.member} has no release ${pin}`);
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
picked.push(r);
|
|
40
|
+
}
|
|
41
|
+
return problems.length > 0 ? { problems } : { members: picked };
|
|
42
|
+
}
|
|
43
|
+
/** Every `chant` member's releases, newest cut first, read from its ledger. */
|
|
44
|
+
export async function readMemberReleases(cwd) {
|
|
45
|
+
const located = locateWorkspace(cwd);
|
|
46
|
+
const declaration = readDeclaration(located.tree, "", { rootChant: true });
|
|
47
|
+
const out = [];
|
|
48
|
+
for (const m of declaration.members) {
|
|
49
|
+
if (m.kind !== "chant")
|
|
50
|
+
continue;
|
|
51
|
+
const loc = { cwd: located.rootOnDisk, member: m.dir === "." ? "." : m.name };
|
|
52
|
+
const { releases } = await readAllReleases(loc);
|
|
53
|
+
const { cuts } = await readCuts(loc);
|
|
54
|
+
const newest = (digest) => cuts.filter((c) => c.releaseDigest === digest).map((c) => c.timestamp).sort().at(-1) ?? "";
|
|
55
|
+
const label = (digest) => cuts.filter((c) => c.releaseDigest === digest && c.label !== null).sort((a, b) => (a.timestamp < b.timestamp ? -1 : 1)).at(-1)?.label ?? null;
|
|
56
|
+
const list = releases
|
|
57
|
+
.filter((r) => newest(r.releaseDigest) !== "")
|
|
58
|
+
.sort((a, b) => (newest(b.releaseDigest) < newest(a.releaseDigest) ? -1 : newest(b.releaseDigest) > newest(a.releaseDigest) ? 1 : 0))
|
|
59
|
+
.map((r) => ({ member: m.name, releaseDigest: r.releaseDigest, commit: r.commit, label: label(r.releaseDigest) }));
|
|
60
|
+
out.push({ member: m.name, releases: list });
|
|
61
|
+
}
|
|
62
|
+
return out;
|
|
63
|
+
}
|
|
64
|
+
function isTrain(v) {
|
|
65
|
+
const t = v;
|
|
66
|
+
return typeof t === "object" && t !== null && t.version === 1 && typeof t.id === "string" && typeof t.env === "string" && Array.isArray(t.members);
|
|
67
|
+
}
|
|
68
|
+
export async function readReleaseTrains(cwd, env) {
|
|
69
|
+
return readWorkspaceLines(cwd, env, TRAINS_FILE, isTrain);
|
|
70
|
+
}
|
|
71
|
+
export async function appendReleaseTrain(cwd, record) {
|
|
72
|
+
return appendWorkspaceLine(cwd, record.env, TRAINS_FILE, record, `Release train: ${record.env} ${record.id}`);
|
|
73
|
+
}
|
|
74
|
+
const USAGE = "chant workspace train <env> [--pin <member>=<label|digest>]... [--dry-run] [--json] | chant workspace train list <env> [--json]";
|
|
75
|
+
export async function runWorkspaceTrain(ctx) {
|
|
76
|
+
const words = ctx.args.positionals ?? [];
|
|
77
|
+
const rest = words[0] === "train" ? words.slice(1) : words;
|
|
78
|
+
const listing = rest[0] === "list";
|
|
79
|
+
const env = listing ? rest[1] : rest[0];
|
|
80
|
+
if (!env) {
|
|
81
|
+
console.error(formatError({ message: "chant workspace train needs an environment", hint: USAGE }));
|
|
82
|
+
return 1;
|
|
83
|
+
}
|
|
84
|
+
const cwd = resolve(".");
|
|
85
|
+
try {
|
|
86
|
+
if (listing) {
|
|
87
|
+
const root = locateWorkspace(cwd).rootOnDisk;
|
|
88
|
+
const { records } = await readReleaseTrains(root, env);
|
|
89
|
+
if (ctx.args.json)
|
|
90
|
+
console.log(JSON.stringify({ env, trains: records }, null, 2));
|
|
91
|
+
else if (records.length === 0)
|
|
92
|
+
console.log(`No release train recorded for ${env}.`);
|
|
93
|
+
else
|
|
94
|
+
for (const t of records)
|
|
95
|
+
console.log(`${t.timestamp} ${t.id} ${t.members.map((m) => `${m.member}@${m.label ?? m.releaseDigest.slice(0, 19)}`).join(" ")}`);
|
|
96
|
+
return 0;
|
|
97
|
+
}
|
|
98
|
+
const pins = new Map();
|
|
99
|
+
for (const p of ctx.args.pins ?? []) {
|
|
100
|
+
const at = p.indexOf("=");
|
|
101
|
+
if (at <= 0) {
|
|
102
|
+
console.error(formatError({ message: `--pin ${p}: expected <member>=<label|digest>`, hint: USAGE }));
|
|
103
|
+
return 1;
|
|
104
|
+
}
|
|
105
|
+
pins.set(p.slice(0, at), p.slice(at + 1));
|
|
106
|
+
}
|
|
107
|
+
const root = locateWorkspace(cwd).rootOnDisk;
|
|
108
|
+
const picked = pickTrain(await readMemberReleases(root), pins);
|
|
109
|
+
if ("problems" in picked) {
|
|
110
|
+
console.error(formatError({ message: `no release train for ${env}: every chant member needs a release`, hint: USAGE }));
|
|
111
|
+
for (const p of picked.problems)
|
|
112
|
+
console.error(` ${p}`);
|
|
113
|
+
return 1;
|
|
114
|
+
}
|
|
115
|
+
const actor = ctx.args.actor ?? process.env.GITHUB_ACTOR ?? process.env.GITLAB_USER_LOGIN ?? process.env.USER ?? "unknown";
|
|
116
|
+
const record = { version: 1, id: `train-${randomUUID()}`, env, timestamp: new Date().toISOString(), actor, members: picked.members };
|
|
117
|
+
if (!ctx.args.dryRun)
|
|
118
|
+
await appendReleaseTrain(root, record);
|
|
119
|
+
if (ctx.args.json)
|
|
120
|
+
console.log(JSON.stringify({ ...record, written: !ctx.args.dryRun }, null, 2));
|
|
121
|
+
else {
|
|
122
|
+
console.log(`${ctx.args.dryRun ? "Would record" : "Recorded"} release train ${record.id} for ${env}:`);
|
|
123
|
+
for (const m of record.members)
|
|
124
|
+
console.log(` ${m.member.padEnd(24)} ${m.label ?? "(no label)"} ${m.releaseDigest} ${m.commit.slice(0, 12)}`);
|
|
125
|
+
}
|
|
126
|
+
return 0;
|
|
127
|
+
}
|
|
128
|
+
catch (err) {
|
|
129
|
+
if (!(err instanceof WorkspaceReadError))
|
|
130
|
+
throw err;
|
|
131
|
+
console.error(formatError({ message: `${err.code}: ${err.describe()}`, hint: USAGE }));
|
|
132
|
+
return 1;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release-workflow.d.ts","sourceRoot":"","sources":["../../src/workspace/release-workflow.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"release-workflow.d.ts","sourceRoot":"","sources":["../../src/workspace/release-workflow.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,eAAO,MAAM,uBAAuB,YAAI,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAU,CAAC;AAChF,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5E,uFAAuF;AACvF,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,oBAAoB,EAAE,MAAM,CAKvE,CAAC;AAEF,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,oBAAoB,CAAC;IAC5B,+DAA+D;IAC/D,MAAM,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC;IACnC,wEAAwE;IACxE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,yFAAyF;IACzF,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0EAA0E;IAC1E,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,+DAA+D;AAC/D,wBAAgB,YAAY,CAAC,MAAM,EAAE,WAAW,CAAC,aAAa,CAAC,GAAG,MAAM,EAAE,CAEzE;AAED,iEAAiE;AACjE,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,oBAAoB,GAAG,MAAM,CAwDzE;AAED,wFAAwF;AACxF,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED;;;;GAIG;AACH,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,OAAO,iBAAiB,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA8CvG"}
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
* there: it costs nothing, and with it what the job uploads carries
|
|
17
17
|
* provenance whether or not the group requires it.
|
|
18
18
|
*/
|
|
19
|
+
import { ACTION_PINS, tagComments, usesRef } from "../action-pins.js";
|
|
19
20
|
import { GENERATED_MARKER } from "../discovery/files.js";
|
|
20
21
|
export const RELEASE_WORKFLOW_FORGES = ["github", "forgejo", "gitlab"];
|
|
21
22
|
/** Where each forge's publish workflow is written, relative to the repository root. */
|
|
@@ -71,10 +72,10 @@ export function renderReleaseWorkflow(input) {
|
|
|
71
72
|
" runs-on: ubuntu-latest",
|
|
72
73
|
...(root ? [" defaults:", " run:", ` working-directory: ${root}`] : []),
|
|
73
74
|
" steps:",
|
|
74
|
-
|
|
75
|
+
` - uses: ${usesRef(ACTION_PINS.checkout4)}`,
|
|
75
76
|
" with:",
|
|
76
77
|
" fetch-depth: 0",
|
|
77
|
-
|
|
78
|
+
` - uses: ${usesRef(ACTION_PINS.setupNode4)}`,
|
|
78
79
|
" with:",
|
|
79
80
|
" node-version: 24",
|
|
80
81
|
" registry-url: https://registry.npmjs.org",
|
|
@@ -85,7 +86,7 @@ export function renderReleaseWorkflow(input) {
|
|
|
85
86
|
...(verify ? [` - run: ${chant} release verify ${label}`] : []),
|
|
86
87
|
` - run: ${chant} release publish ${label} ${flags}`,
|
|
87
88
|
];
|
|
88
|
-
return `${lines.join("\n")}\n
|
|
89
|
+
return tagComments(`${lines.join("\n")}\n`);
|
|
89
90
|
}
|
|
90
91
|
/** The header that marks the file generated, naming the command that regenerates it. */
|
|
91
92
|
export function releaseWorkflowHeader(command) {
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Another repository's workspace, named by URL and pinned revision (#3168).
|
|
3
|
+
*
|
|
4
|
+
* A member of kind `repo` is read the way a nested `workspace` member is
|
|
5
|
+
* (./nested-graph.ts): through that repository's own `chant workspace graph`,
|
|
6
|
+
* at the pinned revision, and nothing is ever written there. To have a tree
|
|
7
|
+
* to run that read in, chant fetches the revision into the user's cache
|
|
8
|
+
* directory, never under the workspace: one clone per URL, and one detached
|
|
9
|
+
* worktree per revision, which is immutable once made, so two reads of one
|
|
10
|
+
* revision share it and a read never moves another's checkout.
|
|
11
|
+
*
|
|
12
|
+
* This is the only place `chant workspace graph` reaches a remote, and only
|
|
13
|
+
* for repo members. `chant workspace check` never fetches.
|
|
14
|
+
*
|
|
15
|
+
* The read contract's identity names the repository a document came from
|
|
16
|
+
* (`workspace.repo`): the URL of the `origin` remote, credentials removed.
|
|
17
|
+
*/
|
|
18
|
+
import type { RepoRef } from "./declaration.js";
|
|
19
|
+
/** A URL with any user name and password removed; scp-style and local paths are returned as they are. */
|
|
20
|
+
export declare function redactUrl(url: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* The repository a workspace on disk came from (#3168): its git repository's
|
|
23
|
+
* `origin` URL, redacted, or null without git or an origin. Reads local git
|
|
24
|
+
* config only; never reaches the remote.
|
|
25
|
+
*/
|
|
26
|
+
export declare function repoIdentity(dir: string): string | null;
|
|
27
|
+
/** Where fetched repositories live: `<cache>/repos`, with the cache dir as the graph cache finds it. */
|
|
28
|
+
export declare function repoCacheDir(env?: NodeJS.ProcessEnv): string;
|
|
29
|
+
/** The URL git is handed: a relative local path is resolved from the workspace root, since git runs in the cache. */
|
|
30
|
+
export declare function fetchUrl(url: string, workspaceRoot: string): string;
|
|
31
|
+
export type RepoFetch = {
|
|
32
|
+
ok: true;
|
|
33
|
+
dir: string;
|
|
34
|
+
worktree: string;
|
|
35
|
+
} | {
|
|
36
|
+
ok: false;
|
|
37
|
+
message: string;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Make `ref`'s revision available in the cache, fetching it when the cache
|
|
41
|
+
* doesn't hold it, and return the directory of its workspace root there.
|
|
42
|
+
* Never throws; a failure says why.
|
|
43
|
+
*/
|
|
44
|
+
export declare function fetchRepoAt(ref: RepoRef, workspaceRoot: string, env?: NodeJS.ProcessEnv): RepoFetch;
|
|
45
|
+
//# sourceMappingURL=repo-ref.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repo-ref.d.ts","sourceRoot":"","sources":["../../src/workspace/repo-ref.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AASH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7C,yGAAyG;AACzG,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAW7C;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAOvD;AAED,wGAAwG;AACxG,wBAAgB,YAAY,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAGzE;AAED,qHAAqH;AACrH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,CAInE;AAED,MAAM,MAAM,SAAS,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAcrG;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,SAAS,CAyBhH"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Another repository's workspace, named by URL and pinned revision (#3168).
|
|
3
|
+
*
|
|
4
|
+
* A member of kind `repo` is read the way a nested `workspace` member is
|
|
5
|
+
* (./nested-graph.ts): through that repository's own `chant workspace graph`,
|
|
6
|
+
* at the pinned revision, and nothing is ever written there. To have a tree
|
|
7
|
+
* to run that read in, chant fetches the revision into the user's cache
|
|
8
|
+
* directory, never under the workspace: one clone per URL, and one detached
|
|
9
|
+
* worktree per revision, which is immutable once made, so two reads of one
|
|
10
|
+
* revision share it and a read never moves another's checkout.
|
|
11
|
+
*
|
|
12
|
+
* This is the only place `chant workspace graph` reaches a remote, and only
|
|
13
|
+
* for repo members. `chant workspace check` never fetches.
|
|
14
|
+
*
|
|
15
|
+
* The read contract's identity names the repository a document came from
|
|
16
|
+
* (`workspace.repo`): the URL of the `origin` remote, credentials removed.
|
|
17
|
+
*/
|
|
18
|
+
import { execFileSync } from "node:child_process";
|
|
19
|
+
import { createHash } from "node:crypto";
|
|
20
|
+
import { existsSync, mkdirSync } from "node:fs";
|
|
21
|
+
import { homedir } from "node:os";
|
|
22
|
+
import { isAbsolute, join, resolve } from "node:path";
|
|
23
|
+
import { CACHE_DIR_ENV } from "./graph-cache.js";
|
|
24
|
+
import { urlCredential } from "./checks/org.js";
|
|
25
|
+
/** A URL with any user name and password removed; scp-style and local paths are returned as they are. */
|
|
26
|
+
export function redactUrl(url) {
|
|
27
|
+
if (!/^[a-z][a-z0-9+.-]*:\/\//i.test(url))
|
|
28
|
+
return url;
|
|
29
|
+
try {
|
|
30
|
+
const u = new URL(url);
|
|
31
|
+
if (u.username === "" && u.password === "")
|
|
32
|
+
return url;
|
|
33
|
+
u.username = "";
|
|
34
|
+
u.password = "";
|
|
35
|
+
return u.toString();
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
return url;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* The repository a workspace on disk came from (#3168): its git repository's
|
|
43
|
+
* `origin` URL, redacted, or null without git or an origin. Reads local git
|
|
44
|
+
* config only; never reaches the remote.
|
|
45
|
+
*/
|
|
46
|
+
export function repoIdentity(dir) {
|
|
47
|
+
try {
|
|
48
|
+
const url = execFileSync("git", ["-C", dir, "config", "--get", "remote.origin.url"], { encoding: "utf-8", stdio: ["ignore", "pipe", "ignore"] }).trim();
|
|
49
|
+
return url ? redactUrl(url) : null;
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/** Where fetched repositories live: `<cache>/repos`, with the cache dir as the graph cache finds it. */
|
|
56
|
+
export function repoCacheDir(env = process.env) {
|
|
57
|
+
const base = env[CACHE_DIR_ENV] || join(env.XDG_CACHE_HOME || join(homedir(), ".cache"), "chant");
|
|
58
|
+
return join(base, "repos");
|
|
59
|
+
}
|
|
60
|
+
/** The URL git is handed: a relative local path is resolved from the workspace root, since git runs in the cache. */
|
|
61
|
+
export function fetchUrl(url, workspaceRoot) {
|
|
62
|
+
if (/^[a-z][a-z0-9+.-]*:\/\//i.test(url))
|
|
63
|
+
return url;
|
|
64
|
+
if (/^(?:[^@/\s]+@)?[^:/\s]+:(?!\/\/)/.test(url) && !isAbsolute(url) && !/^[a-z]:[\\/]/i.test(url))
|
|
65
|
+
return url;
|
|
66
|
+
return resolve(workspaceRoot, url);
|
|
67
|
+
}
|
|
68
|
+
const GIT_ENV = { ...process.env, GIT_TERMINAL_PROMPT: "0" };
|
|
69
|
+
function git(args, cwd) {
|
|
70
|
+
try {
|
|
71
|
+
const out = execFileSync("git", args, { cwd, encoding: "utf-8", env: GIT_ENV, stdio: ["ignore", "pipe", "pipe"], timeout: 120000 });
|
|
72
|
+
return { ok: true, out };
|
|
73
|
+
}
|
|
74
|
+
catch (err) {
|
|
75
|
+
const e = err;
|
|
76
|
+
return { ok: false, out: String(e.stderr ?? e.message).trim().split("\n").slice(-3).join("; ") };
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Make `ref`'s revision available in the cache, fetching it when the cache
|
|
81
|
+
* doesn't hold it, and return the directory of its workspace root there.
|
|
82
|
+
* Never throws; a failure says why.
|
|
83
|
+
*/
|
|
84
|
+
export function fetchRepoAt(ref, workspaceRoot, env = process.env) {
|
|
85
|
+
if (urlCredential(ref.url))
|
|
86
|
+
return { ok: false, message: `the repo url carries a credential, which chant refuses to use (WSP016)` };
|
|
87
|
+
const url = fetchUrl(ref.url, workspaceRoot);
|
|
88
|
+
const clone = join(repoCacheDir(env), createHash("sha256").update(url).digest("hex").slice(0, 24));
|
|
89
|
+
const worktree = join(clone, "at", ref.rev);
|
|
90
|
+
const dir = ref.workspace === "." ? worktree : join(worktree, ...ref.workspace.split("/"));
|
|
91
|
+
if (existsSync(join(worktree, ".git")))
|
|
92
|
+
return { ok: true, dir, worktree };
|
|
93
|
+
if (!existsSync(join(clone, ".git"))) {
|
|
94
|
+
mkdirSync(clone, { recursive: true });
|
|
95
|
+
const init = git(["init", "-q", clone]);
|
|
96
|
+
if (!init.ok)
|
|
97
|
+
return { ok: false, message: `could not make the cache clone in ${clone}: ${init.out}` };
|
|
98
|
+
git(["-C", clone, "remote", "add", "origin", url]);
|
|
99
|
+
}
|
|
100
|
+
const has = () => git(["-C", clone, "cat-file", "-e", `${ref.rev}^{commit}`]).ok;
|
|
101
|
+
if (!has()) {
|
|
102
|
+
// A pinned commit by id first; a server that refuses unadvertised ids gets a full fetch.
|
|
103
|
+
const byId = git(["-C", clone, "fetch", "-q", "origin", ref.rev]);
|
|
104
|
+
if (!has()) {
|
|
105
|
+
const all = git(["-C", clone, "fetch", "-q", "origin", "+refs/heads/*:refs/remotes/origin/*", "+refs/tags/*:refs/tags/*"]);
|
|
106
|
+
if (!has())
|
|
107
|
+
return { ok: false, message: `could not fetch ${ref.rev} from ${redactUrl(ref.url)}: ${all.ok ? (byId.ok ? "the repository has no such commit" : byId.out) : all.out}` };
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
const add = git(["-C", clone, "worktree", "add", "-q", "--detach", worktree, ref.rev]);
|
|
111
|
+
if (!add.ok && !existsSync(join(worktree, ".git")))
|
|
112
|
+
return { ok: false, message: `could not check out ${ref.rev} in the cache: ${add.out}` };
|
|
113
|
+
return { ok: true, dir, worktree };
|
|
114
|
+
}
|
|
@@ -296,8 +296,8 @@
|
|
|
296
296
|
"resolvedBy": { "type": "string", "description": "Who approved it." },
|
|
297
297
|
"resolvedAt": { "type": "string", "description": "When the approval was recorded, ISO-8601." },
|
|
298
298
|
"via": {
|
|
299
|
-
"enum": ["quorum", "policy", "point", "alias", "empty", null],
|
|
300
|
-
"description": "How the approval passed when it was more than one person's approval of this gate: a quorum, a policy permit, a decision point's answer, or an approval recorded under one of the gate's aliases. empty (added within contract 1 by #4045, chant 0.124.28 and newer): a release gate passed over an empty change set with no approval, on the resolution the promote wrote, whose resolvedBy is the actor running it."
|
|
299
|
+
"enum": ["quorum", "policy", "point", "alias", "empty", "workspace", null],
|
|
300
|
+
"description": "How the approval passed when it was more than one person's approval of this gate: a quorum, a policy permit, a decision point's answer, or an approval recorded under one of the gate's aliases. empty (added within contract 1 by #4045, chant 0.124.28 and newer): a release gate passed over an empty change set with no approval, on the resolution the promote wrote, whose resolvedBy is the actor running it. workspace (added within contract 1 by #2554, chant 0.124.47 and newer): a workspace gate's approval stood in for this member gate, because the member opts in at base and the approval covers this plan."
|
|
301
301
|
},
|
|
302
302
|
"url": { "type": "string", "description": "Where the approval was made, when known." }
|
|
303
303
|
}
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
*/
|
|
24
24
|
import type { CommandContext } from "../cli/registry.js";
|
|
25
25
|
import { type RunLedgerWrite, type RunView } from "./runs.js";
|
|
26
|
+
import { type FilterFields } from "../read-filter.js";
|
|
26
27
|
import { type DsseEnvelope } from "./trust/dsse.js";
|
|
27
28
|
import { type BaseSource } from "./trust/provenance.js";
|
|
28
29
|
import type { TrustPolicy } from "./trust/policy.js";
|
|
@@ -84,6 +85,13 @@ export interface RunsQuery {
|
|
|
84
85
|
base?: string;
|
|
85
86
|
/** Follow squash merges on HEAD to their pull requests' original commits, fetching missing pull request refs (#3035). */
|
|
86
87
|
followSquash?: boolean;
|
|
88
|
+
/** Typed filters (#4363), each `<field><op><value>` over {@link RUN_FILTER_FIELDS}; every one has to hold. Applied before the totals. */
|
|
89
|
+
where?: readonly string[];
|
|
90
|
+
}
|
|
91
|
+
/** The fields `runs --where` filters on (#4363). */
|
|
92
|
+
export declare const RUN_FILTER_FIELDS: FilterFields;
|
|
93
|
+
/** Thrown for a `--where` that can't be applied: a usage error, before the ledger is read. */
|
|
94
|
+
export declare class RunsFilterError extends Error {
|
|
87
95
|
}
|
|
88
96
|
export interface RunsReason {
|
|
89
97
|
code: RunsReasonCode;
|
|
@@ -129,6 +137,7 @@ export type RunsDocument = {
|
|
|
129
137
|
by: string | null;
|
|
130
138
|
since: string | null;
|
|
131
139
|
followSquash?: boolean;
|
|
140
|
+
where?: string[];
|
|
132
141
|
};
|
|
133
142
|
/** The trust policy the run statements are judged by (#3192). */
|
|
134
143
|
trust: RunsTrust;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runs-cli.d.ts","sourceRoot":"","sources":["../../src/workspace/runs-cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAMtD,OAAO,EAaL,KAAK,cAAc,EACnB,KAAK,OAAO,EAEb,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"runs-cli.d.ts","sourceRoot":"","sources":["../../src/workspace/runs-cli.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AAC;IAAC,KAAK,EAAE;QAAE,IAAI,EAAE,qBAAqB,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAAC;AAMvJ,0GAA0G;AAC1G,wBAAsB,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAezG;AAED;;;;GAIG;AACH,wBAAsB,UAAU,CAAC,KAAK,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,QAAQ,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC,CA4CtI;AASD,sCAAsC;AACtC,wBAAgB,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,YAAY,EAAE;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC,GAAG,MAAM,CAchF;AASD,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA6C3E;AAuCD,2CAA2C;AAC3C,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,CAAC,oBAAoB,EAAE;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC,GAAG,MAAM,CAU9G"}
|
|
@@ -30,6 +30,7 @@ import { loadRecordKind, RecordReadError } from "./records.js";
|
|
|
30
30
|
import { queryRecords } from "./records-cli.js";
|
|
31
31
|
import { appendRunStatement, commitsByRunTrailer, endRun, foldRun, joinPatchIdCommits, joinSquashCommits, joinTrailerCommits, LEDGER_BRANCH, readRuns, recordRun, RunWriteError, startRun, } from "./runs.js";
|
|
32
32
|
import { RUN_TRAILER } from "./trailers.js";
|
|
33
|
+
import { FilterError, matchesWhere, parseWhere } from "../read-filter.js";
|
|
33
34
|
import { locateWorkspace } from "./which-chant.js";
|
|
34
35
|
import { idList } from "./work.js";
|
|
35
36
|
import { AGENT_ENV } from "./write-scope.js";
|
|
@@ -46,7 +47,7 @@ export const RUNS_WRITE_SCHEMA_ID = "https://intentius.io/chant/schemas/workspac
|
|
|
46
47
|
/** `$id` of the JSON Schema for what `runs statement` and `runs verify` print (#3192). */
|
|
47
48
|
export const RUN_STATEMENT_SCHEMA_ID = "https://intentius.io/chant/schemas/workspace/run-statement/v1/run-statement.schema.json";
|
|
48
49
|
const USAGE = [
|
|
49
|
-
"chant workspace runs [--unit <id>] [--decision <id>] [--by <principal>] [--since <rev>] [--follow-squash] [--json]",
|
|
50
|
+
"chant workspace runs [--unit <id>] [--decision <id>] [--by <principal>] [--since <rev>] [--where <field><op><value>]... [--follow-squash] [--json]",
|
|
50
51
|
"chant workspace runs start --from <file|->",
|
|
51
52
|
"chant workspace runs end <run id> [--from <file|->]",
|
|
52
53
|
"chant workspace runs record --from <file|->",
|
|
@@ -116,6 +117,31 @@ function groupBy(runs, keys) {
|
|
|
116
117
|
(out.get(k) ?? out.set(k, []).get(k)).push(r);
|
|
117
118
|
return out;
|
|
118
119
|
}
|
|
120
|
+
/** The fields `runs --where` filters on (#4363). */
|
|
121
|
+
export const RUN_FILTER_FIELDS = {
|
|
122
|
+
id: "text",
|
|
123
|
+
state: "text",
|
|
124
|
+
startedAt: "time",
|
|
125
|
+
endedAt: "time",
|
|
126
|
+
outcome: "text",
|
|
127
|
+
by: "text",
|
|
128
|
+
agent: "text",
|
|
129
|
+
model: "text",
|
|
130
|
+
provider: "text",
|
|
131
|
+
lease: "text",
|
|
132
|
+
"harness.name": "text",
|
|
133
|
+
"harness.version": "text",
|
|
134
|
+
"unit.id": "text",
|
|
135
|
+
"unit.kind": "text",
|
|
136
|
+
"cost.amount": "number",
|
|
137
|
+
"cost.currency": "text",
|
|
138
|
+
"usage.inputTokens": "number",
|
|
139
|
+
"usage.outputTokens": "number",
|
|
140
|
+
ledger: "text",
|
|
141
|
+
};
|
|
142
|
+
/** Thrown for a `--where` that can't be applied: a usage error, before the ledger is read. */
|
|
143
|
+
export class RunsFilterError extends Error {
|
|
144
|
+
}
|
|
119
145
|
/** The policy at base for run statements, and its summary. */
|
|
120
146
|
export function runsTrust(top, base) {
|
|
121
147
|
const resolved = resolveBase(top, base);
|
|
@@ -185,6 +211,15 @@ function tryGit(top, args) {
|
|
|
185
211
|
/** Read the run ledger and build the document. Never throws a {@link WorkspaceReadError}. */
|
|
186
212
|
export async function workspaceRuns(query) {
|
|
187
213
|
const head = { $schema: RUNS_OUTPUT_SCHEMA_ID, contract: RUNS_CONTRACT_VERSION, chant: readerVersion() };
|
|
214
|
+
let clauses;
|
|
215
|
+
try {
|
|
216
|
+
clauses = parseWhere(query.where ?? [], RUN_FILTER_FIELDS);
|
|
217
|
+
}
|
|
218
|
+
catch (err) {
|
|
219
|
+
if (err instanceof FilterError)
|
|
220
|
+
throw new RunsFilterError(err.message);
|
|
221
|
+
throw err;
|
|
222
|
+
}
|
|
188
223
|
try {
|
|
189
224
|
const located = locateWorkspace(query.cwd);
|
|
190
225
|
const declaration = readDeclaration(located.tree, "", { rootChant: true });
|
|
@@ -226,6 +261,7 @@ export async function workspaceRuns(query) {
|
|
|
226
261
|
.filter((r) => wantDecision === undefined || r.decisions.some((d) => d === wantDecision || d.slice(d.indexOf("/") + 1) === wantDecision))
|
|
227
262
|
.filter((r) => query.by === undefined || r.by === query.by)
|
|
228
263
|
.filter((r) => !since || r.commits.some((c) => since.commits.has(c.sha)) || Date.parse(r.startedAt) > since.date)
|
|
264
|
+
.filter((r) => matchesWhere(r, clauses))
|
|
229
265
|
.sort((a, b) => (a.startedAt < b.startedAt ? 1 : a.startedAt > b.startedAt ? -1 : a.id < b.id ? 1 : -1));
|
|
230
266
|
const byUnit = [...groupBy(selected, (r) => [r.unit?.id ?? null])].map(([unit, rs]) => ({ unit, ...totalRuns(rs) }));
|
|
231
267
|
const byDecision = [...groupBy(selected, (r) => r.decisions)].map(([decision, rs]) => ({ decision: decision, ...totalRuns(rs) }));
|
|
@@ -234,7 +270,7 @@ export async function workspaceRuns(query) {
|
|
|
234
270
|
...head,
|
|
235
271
|
workspace: { name: declaration.name, root: located.root },
|
|
236
272
|
ledger: { branch: LEDGER_BRANCH, dir, commit: tip },
|
|
237
|
-
filter: { unit: query.unit ?? null, decision: query.decision ?? null, by: query.by ?? null, since: query.since ?? null, followSquash: query.followSquash === true },
|
|
273
|
+
filter: { unit: query.unit ?? null, decision: query.decision ?? null, by: query.by ?? null, since: query.since ?? null, followSquash: query.followSquash === true, ...(query.where && query.where.length > 0 ? { where: [...query.where] } : {}) },
|
|
238
274
|
trust,
|
|
239
275
|
runs: selected,
|
|
240
276
|
totals: { all: totalRuns(selected), byUnit, byDecision, byPrincipal },
|
|
@@ -512,7 +548,16 @@ export async function runWorkspaceRuns(ctx) {
|
|
|
512
548
|
console.error(formatError({ message: "runs is a read and takes no --from; write with runs start, end or record", hint: USAGE }));
|
|
513
549
|
return 1;
|
|
514
550
|
}
|
|
515
|
-
|
|
551
|
+
let doc;
|
|
552
|
+
try {
|
|
553
|
+
doc = await workspaceRuns({ cwd, unit: args.unit, decision: args.decision, by: args.by, since: args.since, base: args.base, followSquash: args.followSquash, where: args.where });
|
|
554
|
+
}
|
|
555
|
+
catch (err) {
|
|
556
|
+
if (!(err instanceof RunsFilterError))
|
|
557
|
+
throw err;
|
|
558
|
+
console.error(formatError({ message: err.message, hint: USAGE }));
|
|
559
|
+
return 1;
|
|
560
|
+
}
|
|
516
561
|
if (args.json)
|
|
517
562
|
console.log(JSON.stringify(doc, null, 2));
|
|
518
563
|
else if ("error" in doc)
|
|
@@ -111,6 +111,13 @@
|
|
|
111
111
|
"followSquash": {
|
|
112
112
|
"type": "boolean",
|
|
113
113
|
"description": "Whether --follow-squash was given (#3035). Added within version 1."
|
|
114
|
+
},
|
|
115
|
+
"where": {
|
|
116
|
+
"type": "array",
|
|
117
|
+
"items": {
|
|
118
|
+
"type": "string"
|
|
119
|
+
},
|
|
120
|
+
"description": "Each --where clause, <field><op><value>, as given (#4363); every one held for each run listed, and the totals count only those runs. Absent without --where. Added within version 1."
|
|
114
121
|
}
|
|
115
122
|
}
|
|
116
123
|
},
|