@intentius/chant 0.124.87 → 0.124.89
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/action-pins.d.ts +1 -0
- package/dist/action-pins.d.ts.map +1 -1
- package/dist/action-pins.js +2 -0
- package/dist/actor.d.ts +47 -0
- package/dist/actor.d.ts.map +1 -0
- package/dist/actor.js +56 -0
- package/dist/bundle-check.d.ts +20 -5
- package/dist/bundle-check.d.ts.map +1 -1
- package/dist/bundle-check.js +20 -5
- package/dist/chant-install.d.ts +98 -0
- package/dist/chant-install.d.ts.map +1 -1
- package/dist/chant-install.js +203 -2
- package/dist/ci-base.d.ts +30 -0
- package/dist/ci-base.d.ts.map +1 -0
- package/dist/ci-base.js +33 -0
- package/dist/ci-comment-commands.d.ts +177 -0
- package/dist/ci-comment-commands.d.ts.map +1 -0
- package/dist/ci-comment-commands.js +325 -0
- package/dist/ci-comment-replies.d.ts +40 -0
- package/dist/ci-comment-replies.d.ts.map +1 -0
- package/dist/ci-comment-replies.js +59 -0
- package/dist/ci-commit.d.ts +1 -1
- package/dist/ci-commit.d.ts.map +1 -1
- package/dist/ci-commit.js +1 -2
- package/dist/ci-control.d.ts +1 -1
- package/dist/ci-control.d.ts.map +1 -1
- package/dist/ci-control.js +1 -1
- package/dist/ci-evidence-claims.d.ts +59 -0
- package/dist/ci-evidence-claims.d.ts.map +1 -0
- package/dist/ci-evidence-claims.js +87 -0
- package/dist/ci-evidence-from-job.d.ts +128 -0
- package/dist/ci-evidence-from-job.d.ts.map +1 -0
- package/dist/ci-evidence-from-job.js +203 -0
- package/dist/ci-evidence-jobs.d.ts +68 -4
- package/dist/ci-evidence-jobs.d.ts.map +1 -1
- package/dist/ci-evidence-jobs.js +82 -5
- package/dist/ci-handover.d.ts +12 -0
- package/dist/ci-handover.d.ts.map +1 -1
- package/dist/ci-handover.js +15 -3
- package/dist/ci-identity.d.ts +32 -6
- package/dist/ci-identity.d.ts.map +1 -1
- package/dist/ci-identity.js +40 -8
- package/dist/ci-image.d.ts +65 -10
- package/dist/ci-image.d.ts.map +1 -1
- package/dist/ci-image.js +101 -22
- package/dist/ci-jobs.d.ts +1 -1
- package/dist/ci-jobs.d.ts.map +1 -1
- package/dist/ci-jobs.js +7 -2
- package/dist/ci-login.d.ts +75 -13
- package/dist/ci-login.d.ts.map +1 -1
- package/dist/ci-login.js +89 -37
- package/dist/ci-note-commands.d.ts +63 -3
- package/dist/ci-note-commands.d.ts.map +1 -1
- package/dist/ci-note-commands.js +69 -35
- package/dist/ci-product-words.d.ts +62 -1
- package/dist/ci-product-words.d.ts.map +1 -1
- package/dist/ci-product-words.js +52 -1
- package/dist/ci-product.d.ts +52 -2
- package/dist/ci-product.d.ts.map +1 -1
- package/dist/ci-product.js +51 -2
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/build.js +29 -2
- package/dist/cli/handlers/approve-confirm.d.ts +14 -0
- package/dist/cli/handlers/approve-confirm.d.ts.map +1 -1
- package/dist/cli/handlers/approve-confirm.js +46 -0
- package/dist/cli/handlers/approve.d.ts.map +1 -1
- package/dist/cli/handlers/approve.js +2 -1
- package/dist/cli/handlers/build.d.ts +1 -1
- package/dist/cli/handlers/build.d.ts.map +1 -1
- package/dist/cli/handlers/build.js +22 -1
- package/dist/cli/handlers/ci-check.d.ts +1 -1
- package/dist/cli/handlers/ci-check.d.ts.map +1 -1
- package/dist/cli/handlers/ci-check.js +37 -7
- package/dist/cli/handlers/ci-evidence.d.ts.map +1 -1
- package/dist/cli/handlers/ci-evidence.js +255 -20
- package/dist/cli/handlers/ci-forge-check.d.ts.map +1 -1
- package/dist/cli/handlers/ci-forge-check.js +34 -17
- package/dist/cli/handlers/components.d.ts.map +1 -1
- package/dist/cli/handlers/components.js +3 -1
- package/dist/cli/handlers/generated-check.d.ts +11 -0
- package/dist/cli/handlers/generated-check.d.ts.map +1 -0
- package/dist/cli/handlers/generated-check.js +71 -0
- package/dist/cli/handlers/lifecycle.d.ts.map +1 -1
- package/dist/cli/handlers/lifecycle.js +3 -0
- package/dist/cli/handlers/local-chant.d.ts +13 -0
- package/dist/cli/handlers/local-chant.d.ts.map +1 -1
- package/dist/cli/handlers/local-chant.js +42 -1
- package/dist/cli/handlers/lock.d.ts.map +1 -1
- package/dist/cli/handlers/lock.js +121 -4
- package/dist/cli/handlers/pr-comment.d.ts +21 -0
- package/dist/cli/handlers/pr-comment.d.ts.map +1 -0
- package/dist/cli/handlers/pr-comment.js +112 -0
- package/dist/cli/handlers/pr-env.d.ts.map +1 -1
- package/dist/cli/handlers/pr-env.js +6 -3
- package/dist/cli/handlers/pr.d.ts +23 -1
- package/dist/cli/handlers/pr.d.ts.map +1 -1
- package/dist/cli/handlers/pr.js +97 -14
- package/dist/cli/handlers/promote.d.ts.map +1 -1
- package/dist/cli/handlers/promote.js +2 -1
- package/dist/cli/handlers/release.d.ts.map +1 -1
- package/dist/cli/handlers/release.js +11 -2
- package/dist/cli/handlers/run-wave.d.ts.map +1 -1
- package/dist/cli/handlers/run-wave.js +36 -2
- package/dist/cli/handlers/run.d.ts.map +1 -1
- package/dist/cli/handlers/run.js +2 -1
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +60 -4
- package/dist/cli/parse-args.d.ts.map +1 -1
- package/dist/cli/parse-args.js +82 -0
- package/dist/cli/registry.d.ts +35 -0
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/components/auto-release.d.ts.map +1 -1
- package/dist/components/auto-release.js +2 -1
- package/dist/components/check-hooks.d.ts +10 -0
- package/dist/components/check-hooks.d.ts.map +1 -1
- package/dist/components/check-hooks.js +18 -0
- package/dist/components/pr-checks.d.ts +169 -0
- package/dist/components/pr-checks.d.ts.map +1 -0
- package/dist/components/pr-checks.js +180 -0
- package/dist/components/pr-pipeline.d.ts +38 -0
- package/dist/components/pr-pipeline.d.ts.map +1 -1
- package/dist/components/pr-pipeline.js +6 -1
- package/dist/components/product-pipeline.d.ts +58 -2
- package/dist/components/product-pipeline.d.ts.map +1 -1
- package/dist/components/product-pipeline.js +76 -9
- package/dist/components/product-plan.d.ts +445 -7
- package/dist/components/product-plan.d.ts.map +1 -1
- package/dist/components/product-plan.js +426 -15
- package/dist/config.d.ts +10 -6
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +11 -6
- package/dist/control/consumers.d.ts +6 -0
- package/dist/control/consumers.d.ts.map +1 -1
- package/dist/control/consumers.js +6 -0
- package/dist/dead-guards.d.ts.map +1 -1
- package/dist/dead-guards.js +9 -6
- package/dist/discovery/files.d.ts +1 -1
- package/dist/discovery/files.js +1 -1
- package/dist/drift-issue.d.ts +20 -3
- package/dist/drift-issue.d.ts.map +1 -1
- package/dist/drift-issue.js +16 -0
- package/dist/drift-record.d.ts +52 -5
- package/dist/drift-record.d.ts.map +1 -1
- package/dist/drift-record.js +46 -6
- package/dist/floor-table.d.ts +6 -6
- package/dist/floor-table.d.ts.map +1 -1
- package/dist/floor-table.data.d.ts.map +1 -1
- package/dist/floor-table.data.js +81 -21
- package/dist/floor-table.js +10 -7
- package/dist/forge-check/contract.d.ts +19 -1
- package/dist/forge-check/contract.d.ts.map +1 -1
- package/dist/forge-check/contract.js +8 -2
- package/dist/forge-check/index.d.ts +4 -0
- package/dist/forge-check/index.d.ts.map +1 -1
- package/dist/forge-check/index.js +4 -0
- package/dist/forge-flags.d.ts +10 -0
- package/dist/forge-flags.d.ts.map +1 -1
- package/dist/forge-flags.js +31 -0
- package/dist/forge-remote.d.ts +47 -0
- package/dist/forge-remote.d.ts.map +1 -0
- package/dist/forge-remote.js +69 -0
- package/dist/gate-resume-run.d.ts +9 -1
- package/dist/gate-resume-run.d.ts.map +1 -1
- package/dist/gate-resume-run.js +26 -3
- package/dist/generated-check.d.ts +88 -0
- package/dist/generated-check.d.ts.map +1 -0
- package/dist/generated-check.js +248 -0
- package/dist/image-pins.d.ts +26 -0
- package/dist/image-pins.d.ts.map +1 -0
- package/dist/image-pins.js +19 -0
- package/dist/lexicon.d.ts +27 -0
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lifecycle/git.d.ts +11 -0
- package/dist/lifecycle/git.d.ts.map +1 -1
- package/dist/lifecycle/git.js +30 -3
- package/dist/lifecycle/publish-npm.d.ts +26 -0
- package/dist/lifecycle/publish-npm.d.ts.map +1 -1
- package/dist/lifecycle/publish-npm.js +76 -4
- package/dist/lifecycle/reach-locks.d.ts +131 -0
- package/dist/lifecycle/reach-locks.d.ts.map +1 -0
- package/dist/lifecycle/reach-locks.js +118 -0
- package/dist/lifecycle/release-cut.d.ts +3 -1
- package/dist/lifecycle/release-cut.d.ts.map +1 -1
- package/dist/lifecycle/release-cut.js +15 -0
- package/dist/lifecycle/release-images.d.ts +22 -1
- package/dist/lifecycle/release-images.d.ts.map +1 -1
- package/dist/lifecycle/release-images.js +26 -3
- package/dist/lifecycle/release-ledger.d.ts +4 -3
- package/dist/lifecycle/release-ledger.d.ts.map +1 -1
- package/dist/lifecycle/release-ledger.js +3 -2
- package/dist/local-chant.d.ts +57 -3
- package/dist/local-chant.d.ts.map +1 -1
- package/dist/local-chant.js +122 -13
- package/dist/notify-product.d.ts +12 -3
- package/dist/notify-product.d.ts.map +1 -1
- package/dist/notify-product.js +10 -6
- package/dist/op/activities/source-release.d.ts.map +1 -1
- package/dist/op/activities/source-release.js +2 -1
- package/dist/op/activities/source-rollback.d.ts.map +1 -1
- package/dist/op/activities/source-rollback.js +2 -1
- package/dist/op/index.d.ts +2 -0
- package/dist/op/index.d.ts.map +1 -1
- package/dist/op/index.js +1 -0
- package/dist/op/op-waves-evidence-jobs.d.ts +97 -0
- package/dist/op/op-waves-evidence-jobs.d.ts.map +1 -0
- package/dist/op/op-waves-evidence-jobs.js +118 -0
- package/dist/op/op-waves-evidence.d.ts +12 -1
- package/dist/op/op-waves-evidence.d.ts.map +1 -1
- package/dist/op/op-waves-evidence.js +23 -2
- package/dist/op/op-waves-render-spec.d.ts +100 -0
- package/dist/op/op-waves-render-spec.d.ts.map +1 -0
- package/dist/op/op-waves-render-spec.js +162 -0
- package/dist/op/op-waves-run.d.ts +14 -1
- package/dist/op/op-waves-run.d.ts.map +1 -1
- package/dist/op/op-waves-run.js +56 -4
- package/dist/op/op-waves.d.ts +12 -0
- package/dist/op/op-waves.d.ts.map +1 -1
- package/dist/op/op-waves.js +14 -1
- package/dist/op/schedule-overdue.d.ts +39 -2
- package/dist/op/schedule-overdue.d.ts.map +1 -1
- package/dist/op/schedule-overdue.js +148 -10
- package/dist/op/wave-stop.d.ts +64 -0
- package/dist/op/wave-stop.d.ts.map +1 -0
- package/dist/op/wave-stop.js +127 -0
- package/dist/planned-files.d.ts +76 -0
- package/dist/planned-files.d.ts.map +1 -0
- package/dist/planned-files.js +108 -0
- package/dist/pr-forge-job.d.ts +22 -0
- package/dist/pr-forge-job.d.ts.map +1 -0
- package/dist/pr-forge-job.js +46 -0
- package/dist/pr-forge-reads.d.ts +21 -1
- package/dist/pr-forge-reads.d.ts.map +1 -1
- package/dist/pr-forge-reads.js +19 -1
- package/dist/pr-forge.d.ts +7 -1
- package/dist/pr-forge.d.ts.map +1 -1
- package/dist/pr-forge.js +7 -2
- package/dist/pr-loop.d.ts +3 -6
- package/dist/pr-loop.d.ts.map +1 -1
- package/dist/pr-loop.js +4 -81
- package/dist/pr-plan-note.d.ts +121 -0
- package/dist/pr-plan-note.d.ts.map +1 -1
- package/dist/pr-plan-note.js +104 -1
- package/dist/pr-plan-record.d.ts +47 -0
- package/dist/pr-plan-record.d.ts.map +1 -0
- package/dist/pr-plan-record.js +89 -0
- package/dist/pr-post.d.ts +68 -3
- package/dist/pr-post.d.ts.map +1 -1
- package/dist/pr-post.js +218 -13
- package/dist/pr-requires.d.ts +8 -0
- package/dist/pr-requires.d.ts.map +1 -1
- package/dist/pr-requires.js +3 -1
- package/dist/pr-status.d.ts +16 -0
- package/dist/pr-status.d.ts.map +1 -0
- package/dist/pr-status.js +90 -0
- package/dist/ref-gate-init.d.ts +90 -0
- package/dist/ref-gate-init.d.ts.map +1 -0
- package/dist/ref-gate-init.js +155 -0
- package/dist/ref-gate-rules.d.ts +19 -0
- package/dist/ref-gate-rules.d.ts.map +1 -0
- package/dist/ref-gate-rules.js +17 -0
- package/dist/release-floors.d.ts +100 -16
- package/dist/release-floors.d.ts.map +1 -1
- package/dist/release-floors.js +101 -17
- package/dist/render-module.d.ts +15 -0
- package/dist/render-module.d.ts.map +1 -0
- package/dist/render-module.js +73 -0
- package/dist/state-migration.d.ts +24 -1
- package/dist/state-migration.d.ts.map +1 -1
- package/dist/state-migration.js +39 -4
- package/dist/state-unlock.d.ts +32 -1
- package/dist/state-unlock.d.ts.map +1 -1
- package/dist/state-unlock.js +31 -0
- package/dist/wave-runtime.mjs +307 -297
- package/dist/workspace/ci-green-cli.d.ts.map +1 -1
- package/dist/workspace/ci-green-cli.js +15 -8
- package/dist/workspace/drift-cli.d.ts +1 -1
- package/dist/workspace/drift-cli.d.ts.map +1 -1
- package/dist/workspace/drift-cli.js +5 -12
- package/dist/workspace/forge-work.d.ts +3 -2
- package/dist/workspace/forge-work.d.ts.map +1 -1
- package/dist/workspace/forge-work.js +7 -17
- package/dist/workspace/lexicon-outputs.js +2 -2
- package/dist/workspace/release-train.d.ts.map +1 -1
- package/dist/workspace/release-train.js +2 -1
- package/dist/workspace/release-workflow.d.ts +27 -3
- package/dist/workspace/release-workflow.d.ts.map +1 -1
- package/dist/workspace/release-workflow.js +52 -7
- package/dist/workspace/trust/check-evidence-report.d.ts +25 -2
- package/dist/workspace/trust/check-evidence-report.d.ts.map +1 -1
- package/dist/workspace/trust/check-evidence-report.js +28 -8
- package/dist/workspace/trust/check-evidence.d.ts +13 -1
- package/dist/workspace/trust/check-evidence.d.ts.map +1 -1
- package/dist/workspace/trust/check-evidence.js +8 -3
- package/dist/workspace/trust/evidence.d.ts +5 -0
- package/dist/workspace/trust/evidence.d.ts.map +1 -1
- package/dist/workspace/trust/evidence.js +5 -0
- package/dist/workspace/trust/open-evidence.d.ts +67 -0
- package/dist/workspace/trust/open-evidence.d.ts.map +1 -0
- package/dist/workspace/trust/open-evidence.js +92 -0
- package/dist/workspace/trust/ref-gate-cli.d.ts +10 -1
- package/dist/workspace/trust/ref-gate-cli.d.ts.map +1 -1
- package/dist/workspace/trust/ref-gate-cli.js +93 -11
- package/dist/workspace/trust/ref-gate.d.ts +61 -2
- package/dist/workspace/trust/ref-gate.d.ts.map +1 -1
- package/dist/workspace/trust/ref-gate.js +72 -7
- package/dist/workspace/workspace-run.d.ts.map +1 -1
- package/dist/workspace/workspace-run.js +2 -1
- package/package.json +1 -1
- package/src/action-pins.ts +2 -0
- package/src/actor.test.ts +78 -0
- package/src/actor.ts +79 -0
- package/src/bundle-check.test.ts +22 -0
- package/src/bundle-check.ts +33 -5
- package/src/chant-install.test.ts +108 -1
- package/src/chant-install.ts +242 -2
- package/src/ci-base.test.ts +41 -0
- package/src/ci-base.ts +43 -0
- package/src/ci-comment-commands.test.ts +376 -0
- package/src/ci-comment-commands.ts +389 -0
- package/src/ci-comment-replies.ts +78 -0
- package/src/ci-commit.test.ts +51 -6
- package/src/ci-commit.ts +1 -2
- package/src/ci-control.ts +1 -0
- package/src/ci-evidence-claims.ts +102 -0
- package/src/ci-evidence-from-job.test.ts +165 -0
- package/src/ci-evidence-from-job.ts +251 -0
- package/src/ci-evidence-jobs.ts +88 -6
- package/src/ci-handover.ts +16 -3
- package/src/ci-identity.test.ts +3 -3
- package/src/ci-identity.ts +51 -11
- package/src/ci-image.test.ts +187 -16
- package/src/ci-image.ts +157 -25
- package/src/ci-jobs.ts +7 -2
- package/src/ci-login.test.ts +131 -3
- package/src/ci-login.token-drop.test.ts +204 -0
- package/src/ci-login.ts +137 -39
- package/src/ci-note-commands.ts +104 -41
- package/src/ci-product-words.ts +89 -0
- package/src/ci-product.ts +62 -1
- package/src/cli/commands/__fixtures__/source-dir-root/migrations/0001-init/backfill.ts +3 -0
- package/src/cli/commands/build.test.ts +41 -0
- package/src/cli/commands/build.ts +27 -2
- package/src/cli/handlers/approve-confirm.test.ts +35 -0
- package/src/cli/handlers/approve-confirm.ts +44 -0
- package/src/cli/handlers/approve.ts +2 -1
- package/src/cli/handlers/build-source-dir.test.ts +4 -0
- package/src/cli/handlers/build.ts +20 -2
- package/src/cli/handlers/ci-check.ts +37 -7
- package/src/cli/handlers/ci-evidence-open.test.ts +164 -0
- package/src/cli/handlers/ci-evidence.ts +233 -18
- package/src/cli/handlers/ci-forge-check.ts +22 -9
- package/src/cli/handlers/components.ts +3 -1
- package/src/cli/handlers/generated-check.ts +69 -0
- package/src/cli/handlers/lifecycle.test.ts +20 -0
- package/src/cli/handlers/lifecycle.ts +4 -0
- package/src/cli/handlers/local-chant.ts +39 -1
- package/src/cli/handlers/lock-reach.test.ts +103 -0
- package/src/cli/handlers/lock.ts +100 -4
- package/src/cli/handlers/pr-comment.ts +104 -0
- package/src/cli/handlers/pr-env.ts +6 -3
- package/src/cli/handlers/pr-record.test.ts +1 -1
- package/src/cli/handlers/pr.ts +93 -15
- package/src/cli/handlers/promote.ts +2 -1
- package/src/cli/handlers/release.e2e.test.ts +35 -0
- package/src/cli/handlers/release.ts +14 -2
- package/src/cli/handlers/run-wave.ts +35 -2
- package/src/cli/handlers/run.ts +2 -1
- package/src/cli/main.ts +60 -4
- package/src/cli/parse-args.ts +58 -0
- package/src/cli/registry.ts +35 -0
- package/src/components/auto-release.ts +2 -1
- package/src/components/check-hooks.ts +22 -0
- package/src/components/check-report-summary.test.ts +78 -0
- package/src/components/pr-checks.ts +254 -0
- package/src/components/pr-pipeline.ts +43 -1
- package/src/components/product-pipeline.ts +113 -9
- package/src/components/product-plan.test.ts +140 -1
- package/src/components/product-plan.ts +707 -20
- package/src/config.ts +13 -8
- package/src/control/consumers.ts +7 -0
- package/src/dead-guards.test.ts +27 -5
- package/src/dead-guards.ts +9 -6
- package/src/discovery/files.ts +1 -1
- package/src/drift-issue.test.ts +29 -1
- package/src/drift-issue.ts +28 -3
- package/src/drift-record.test.ts +45 -0
- package/src/drift-record.ts +71 -6
- package/src/floor-table.data.ts +81 -21
- package/src/floor-table.ts +12 -9
- package/src/forge-check/contract.ts +23 -2
- package/src/forge-check/forge-check.test.ts +25 -0
- package/src/forge-check/index.ts +4 -0
- package/src/forge-flags.test.ts +25 -1
- package/src/forge-flags.ts +34 -0
- package/src/forge-remote.test.ts +37 -0
- package/src/forge-remote.ts +79 -0
- package/src/gate-resume-run.ts +27 -3
- package/src/generated-check.e2e.test.ts +118 -0
- package/src/generated-check.test.ts +170 -0
- package/src/generated-check.ts +310 -0
- package/src/image-pins.ts +31 -0
- package/src/lexicon.ts +28 -0
- package/src/lifecycle/git.test.ts +48 -0
- package/src/lifecycle/git.ts +27 -4
- package/src/lifecycle/publish-npm.ts +87 -4
- package/src/lifecycle/reach-locks.test.ts +87 -0
- package/src/lifecycle/reach-locks.ts +169 -0
- package/src/lifecycle/release-catalog.test.ts +2 -2
- package/src/lifecycle/release-cut.ts +17 -1
- package/src/lifecycle/release-images-dockerfile.test.ts +20 -0
- package/src/lifecycle/release-images.test.ts +100 -0
- package/src/lifecycle/release-images.ts +38 -3
- package/src/lifecycle/release-ledger.ts +4 -3
- package/src/local-chant.e2e.test.ts +81 -6
- package/src/local-chant.test.ts +22 -3
- package/src/local-chant.ts +130 -13
- package/src/notify-product.ts +19 -8
- package/src/op/activities/source-release.ts +2 -1
- package/src/op/activities/source-rollback.ts +2 -1
- package/src/op/gate-resume.test.ts +27 -0
- package/src/op/index.ts +10 -0
- package/src/op/op-waves-evidence-jobs.ts +140 -0
- package/src/op/op-waves-evidence.test.ts +36 -3
- package/src/op/op-waves-evidence.ts +23 -3
- package/src/op/op-waves-notify-words.test.ts +18 -0
- package/src/op/op-waves-render-spec.test.ts +160 -0
- package/src/op/op-waves-render-spec.ts +171 -0
- package/src/op/op-waves-run.ts +59 -3
- package/src/op/op-waves.ts +16 -2
- package/src/op/schedule-overdue.test.ts +126 -1
- package/src/op/schedule-overdue.ts +164 -12
- package/src/op/wave-stop.test.ts +72 -0
- package/src/op/wave-stop.ts +137 -0
- package/src/planned-files.test.ts +80 -0
- package/src/planned-files.ts +134 -0
- package/src/pr-forge-job.test.ts +53 -0
- package/src/pr-forge-job.ts +46 -0
- package/src/pr-forge-reads-compare.test.ts +2 -1
- package/src/pr-forge-reads.ts +37 -1
- package/src/pr-forge.ts +14 -3
- package/src/pr-loop-narrowed.test.ts +2 -1
- package/src/pr-loop-words.test.ts +2 -1
- package/src/pr-loop.test.ts +1 -2
- package/src/pr-loop.ts +4 -80
- package/src/pr-plan-note.ts +184 -3
- package/src/pr-plan-record.test.ts +75 -0
- package/src/pr-plan-record.ts +101 -0
- package/src/pr-post-plan-note.test.ts +60 -0
- package/src/pr-post-replan.test.ts +144 -0
- package/src/pr-post-subject.test.ts +230 -0
- package/src/pr-post.test.ts +32 -1
- package/src/pr-post.ts +254 -15
- package/src/pr-requires.test.ts +20 -0
- package/src/pr-requires.ts +10 -1
- package/src/pr-status.ts +91 -0
- package/src/ref-gate-init.ts +208 -0
- package/src/ref-gate-rules.ts +26 -0
- package/src/release-floors.ts +139 -17
- package/src/render-module.ts +73 -0
- package/src/state-migration-record.test.ts +89 -0
- package/src/state-migration.test.ts +1 -1
- package/src/state-migration.ts +52 -4
- package/src/state-unlock.test.ts +33 -1
- package/src/state-unlock.ts +49 -1
- package/src/workspace/ci-green-cli.ts +14 -7
- package/src/workspace/ci-green-workflow.test.ts +32 -1
- package/src/workspace/drift-cli.ts +6 -18
- package/src/workspace/forge-work.ts +7 -14
- package/src/workspace/lexicon-outputs.ts +2 -2
- package/src/workspace/release-train.ts +2 -1
- package/src/workspace/release-workflow.test.ts +104 -3
- package/src/workspace/release-workflow.ts +60 -9
- package/src/workspace/trust/check-evidence-report.ts +39 -8
- package/src/workspace/trust/check-evidence.test.ts +5 -0
- package/src/workspace/trust/check-evidence.ts +17 -5
- package/src/workspace/trust/evidence.ts +5 -0
- package/src/workspace/trust/open-evidence.ts +129 -0
- package/src/workspace/trust/ref-gate-cli.ts +88 -10
- package/src/workspace/trust/ref-gate-pieces.test.ts +220 -0
- package/src/workspace/trust/ref-gate.e2e.test.ts +17 -0
- package/src/workspace/trust/ref-gate.test.ts +10 -0
- package/src/workspace/trust/ref-gate.ts +87 -6
- package/src/workspace/workspace-run.ts +2 -1
package/src/config.ts
CHANGED
|
@@ -112,7 +112,8 @@ export const ChantConfigSchema = z.object({
|
|
|
112
112
|
images: z
|
|
113
113
|
.array(
|
|
114
114
|
z.union([
|
|
115
|
-
|
|
115
|
+
// #4876: `platforms`, what the command builds, for the release workflow's QEMU setup.
|
|
116
|
+
z.object({ name: z.string().min(1), build: z.string().min(1), archive: z.string().min(1), platforms: z.array(z.string().min(1)).min(1).optional() }).strict(),
|
|
116
117
|
// #4819: chant builds the Dockerfile as the reproducible OCI archive itself.
|
|
117
118
|
z
|
|
118
119
|
.object({
|
|
@@ -122,6 +123,8 @@ export const ChantConfigSchema = z.object({
|
|
|
122
123
|
platforms: z.array(z.string().min(1)).min(1).optional(),
|
|
123
124
|
archive: z.string().min(1).optional(),
|
|
124
125
|
prepare: z.string().min(1).optional(),
|
|
126
|
+
// #4908: build arguments beside the two chant passes.
|
|
127
|
+
args: z.record(z.string(), z.string()).optional(),
|
|
125
128
|
})
|
|
126
129
|
.strict(),
|
|
127
130
|
]),
|
|
@@ -422,8 +425,8 @@ export interface ChantConfig {
|
|
|
422
425
|
* digest and hands every digest to the build through `CHANT_RELEASE_DIGESTS`,
|
|
423
426
|
* so a package can pin the images it ships with. An `oci` target pushes
|
|
424
427
|
* the archive. An entry may name a `dockerfile` (with `context`,
|
|
425
|
-
* `platforms`, `archive` and `
|
|
426
|
-
* runs the reproducible build itself (#4819). See
|
|
428
|
+
* `platforms`, `archive`, `prepare` and `args`) in place of `build`, and
|
|
429
|
+
* chant runs the reproducible build itself (#4819, #4908). See
|
|
427
430
|
* ./lifecycle/release-images.ts.
|
|
428
431
|
*/
|
|
429
432
|
images?: import("./lifecycle/release-images").ReleaseImageDeclaration[];
|
|
@@ -758,13 +761,15 @@ export function resolveSourceDir(projectDir: string, config: { sourceDir?: unkno
|
|
|
758
761
|
/**
|
|
759
762
|
* The top-level directories a root build leaves out (#4794): a project with
|
|
760
763
|
* no `sourceDir`, built from its own root, does not load `scripts/`, where a
|
|
761
|
-
* script that runs on load (prints and exits) would take the build's place
|
|
762
|
-
*
|
|
763
|
-
*
|
|
764
|
-
*
|
|
764
|
+
* script that runs on load (prints and exits) would take the build's place,
|
|
765
|
+
* nor `migrations/` (#4921), whose `.sql` files are `ALTER`s of objects
|
|
766
|
+
* declared elsewhere and whose backfill scripts run on load too. Matched
|
|
767
|
+
* against the path relative to the project root, so only the project's own
|
|
768
|
+
* top-level directories are skipped. The config's `include` brings one back.
|
|
769
|
+
* Test and spec files are left out of every build already
|
|
765
770
|
* (`isSourceFileName`).
|
|
766
771
|
*/
|
|
767
|
-
export const ROOT_SOURCE_EXCLUDES: readonly string[] = ["scripts"];
|
|
772
|
+
export const ROOT_SOURCE_EXCLUDES: readonly string[] = ["scripts", "migrations"];
|
|
768
773
|
|
|
769
774
|
/** A project's discovery globs (#2519) and the directory they are relative to. */
|
|
770
775
|
export interface DiscoveryGlobs {
|
package/src/control/consumers.ts
CHANGED
|
@@ -22,6 +22,13 @@
|
|
|
22
22
|
import type { CatalogConsumer, CatalogConsumersInput } from "../lifecycle/release-catalog";
|
|
23
23
|
import type { ControlEntry } from "./records";
|
|
24
24
|
|
|
25
|
+
/**
|
|
26
|
+
* The first chant with the consumers join, {@link joinControlConsumers} and
|
|
27
|
+
* {@link readControlConsumers} on `@intentius/chant/ci-control` (#4600).
|
|
28
|
+
* #4916 declared it after the fact, for `chant dev dead-guards`.
|
|
29
|
+
*/
|
|
30
|
+
export const CONTROL_CONSUMERS_FLOOR = "0.124.55";
|
|
31
|
+
|
|
25
32
|
/** The file each project keeps its consumers in. */
|
|
26
33
|
export const CONSUMERS_FILE = "consumers.json";
|
|
27
34
|
/** The contract version of {@link ConsumersDocument}. */
|
package/src/dead-guards.test.ts
CHANGED
|
@@ -185,19 +185,41 @@ describe("findDeadGuards (#4792)", () => {
|
|
|
185
185
|
|
|
186
186
|
describe("the floor table (#4792)", () => {
|
|
187
187
|
it("resolves a floor not yet released to the next release", () => {
|
|
188
|
-
expect(floorVersion("FLOOR_TABLE_FLOOR")).toBe(
|
|
189
|
-
expect(chantMeets("0.124.84", "FLOOR_TABLE_FLOOR")).toBe(
|
|
188
|
+
expect(floorVersion("FLOOR_TABLE_FLOOR")).toBe("0.124.86");
|
|
189
|
+
expect(chantMeets("0.124.84", "FLOOR_TABLE_FLOOR")).toBe(false);
|
|
190
|
+
expect(chantMeets("0.124.86", "FLOOR_TABLE_FLOOR")).toBe(true);
|
|
190
191
|
});
|
|
191
192
|
|
|
192
|
-
it("answers a released floor, and
|
|
193
|
+
it("answers a released floor, and each name from its one declaration (#4916)", () => {
|
|
193
194
|
expect(floorVersion("CI_CHECK_HOOK_FLOOR")).toBe("0.124.55");
|
|
194
195
|
expect(chantMeets("0.124.84", "CI_CHECK_HOOK_FLOOR")).toBe(true);
|
|
195
196
|
expect(chantMeets("0.124.54", "CI_CHECK_HOOK_FLOOR")).toBe(false);
|
|
196
|
-
expect(FLOOR_TABLE.filter((r) => r.name === "RELEASE_VERSION_FLOOR").map((r) => r.version)
|
|
197
|
-
expect(floorVersion("
|
|
197
|
+
expect(FLOOR_TABLE.filter((r) => r.name === "RELEASE_VERSION_FLOOR").map((r) => r.version)).toEqual(["0.124.79"]);
|
|
198
|
+
expect(floorVersion("RELEASE_RECORD_VERSION_FLOOR")).toBe("0.124.55");
|
|
198
199
|
expect(floorVersion("NO_SUCH_FLOOR")).toBeUndefined();
|
|
199
200
|
});
|
|
200
201
|
|
|
202
|
+
// #4916: sql-yodeler's lazy load of chant's terminal confirmation, and a
|
|
203
|
+
// lexicon subpath loaded the same way, are checks on the table's floors.
|
|
204
|
+
it("finds a lazy load of approve-confirm and of a lexicon subpath", () => {
|
|
205
|
+
const src = `export async function chantConfirm() {
|
|
206
|
+
const specifier = "@intentius/chant/cli/handlers/approve-confirm";
|
|
207
|
+
try {
|
|
208
|
+
return await import(specifier);
|
|
209
|
+
} catch {
|
|
210
|
+
return undefined;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
export const catalog = () => import("@intentius/chant-lexicon-terraform/module-catalog").catch(() => undefined);
|
|
214
|
+
export const registry = () => import("@intentius/chant-lexicon-terraform/registry").catch(() => undefined);
|
|
215
|
+
`;
|
|
216
|
+
expect(guardsIn(src).map((g) => `${g.line} ${g.kind} ${g.floor} ${g.version}`)).toEqual([
|
|
217
|
+
"2 module @intentius/chant/cli/handlers/approve-confirm 0.124.55",
|
|
218
|
+
"9 module @intentius/chant-lexicon-terraform/module-catalog 0.124.55",
|
|
219
|
+
"10 module @intentius/chant-lexicon-terraform/registry 0.124.55",
|
|
220
|
+
]);
|
|
221
|
+
});
|
|
222
|
+
|
|
201
223
|
it("names the subpaths a product imports a floor from", () => {
|
|
202
224
|
const stand = FLOOR_TABLE.find((r) => r.name === "OP_WAVE_STAND_DOWN_FLOOR")!;
|
|
203
225
|
expect(stand.modules).toContain("@intentius/chant/op");
|
package/src/dead-guards.ts
CHANGED
|
@@ -19,10 +19,13 @@
|
|
|
19
19
|
* (`CI_CONTROL_FLOOR: string;`), or destructured from a dynamic import. A
|
|
20
20
|
* floor the file imports statically is the product using the part, so it
|
|
21
21
|
* is not a check.
|
|
22
|
-
* - `module`: a chant subpath
|
|
23
|
-
* (
|
|
24
|
-
*
|
|
25
|
-
*
|
|
22
|
+
* - `module`: a chant subpath, or a lexicon's
|
|
23
|
+
* (`@intentius/chant-lexicon-terraform/registry`, #4916), loaded with
|
|
24
|
+
* `import()` where a `catch` is near (`try { await import(specifier) }
|
|
25
|
+
* catch { return undefined }`, or `.catch(`), the shape of a chant-next.ts
|
|
26
|
+
* loader. Its floor is the lowest floor the subpath serves: a chant with
|
|
27
|
+
* that floor has the subpath. Lexicons release with chant at the same
|
|
28
|
+
* version, so a lexicon subpath is checked against the chant pin too.
|
|
26
29
|
* - `product-floor`: a product's own constant for the chant it needs,
|
|
27
30
|
* `const CHANT_CI_FLOOR = "0.124.67"`, whose checks the pin meets.
|
|
28
31
|
*
|
|
@@ -361,8 +364,8 @@ export function guardsIn(src: string, table: readonly FloorRow[] = FLOOR_TABLE):
|
|
|
361
364
|
push(at, "floor", name, version);
|
|
362
365
|
}
|
|
363
366
|
|
|
364
|
-
// module: a chant subpath loaded with import() inside a try, or with .catch( on the load.
|
|
365
|
-
for (const m of src.matchAll(/(["'`])(@intentius\/chant(?:\/[A-Za-z0-9_./-]+)?)\1/g)) {
|
|
367
|
+
// module: a chant or lexicon subpath loaded with import() inside a try, or with .catch( on the load.
|
|
368
|
+
for (const m of src.matchAll(/(["'`])(@intentius\/chant(?:-lexicon-[a-z0-9-]+)?(?:\/[A-Za-z0-9_./-]+)?)\1/g)) {
|
|
366
369
|
const at = m.index!;
|
|
367
370
|
const spec = m[2];
|
|
368
371
|
const version = modules.get(spec);
|
package/src/discovery/files.ts
CHANGED
|
@@ -105,7 +105,7 @@ export function isSourceFileName(name: string): boolean {
|
|
|
105
105
|
* discovery walk (`./walk.ts`, #2527): test and spec files, chant-generated
|
|
106
106
|
* files, skip-marked files and whatever the walk's rules and the project's
|
|
107
107
|
* globs skip are left out. Walked from the root of a project with no
|
|
108
|
-
* `sourceDir`, its top-level `scripts/`
|
|
108
|
+
* `sourceDir`, its top-level `scripts/` and `migrations/` are left out too (#4794, #4921,
|
|
109
109
|
* `ROOT_SOURCE_EXCLUDES`), unless `include` brings it back.
|
|
110
110
|
*/
|
|
111
111
|
export async function findInfraFiles(path: string, options?: FindInfraFilesOptions): Promise<string[]> {
|
package/src/drift-issue.test.ts
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { describe, expect, test } from "vitest";
|
|
7
|
-
import {
|
|
7
|
+
import { createHash } from "node:crypto";
|
|
8
|
+
import { driftIssueBody, driftIssueFingerprint, driftIssueMarker, driftRunFingerprint, keepDriftIssue, type DriftIssueInput, type DriftIssueRecord, type DriftIssueWords } from "./drift-issue";
|
|
8
9
|
import { forgejoForge, githubForge, gitlabForge, type ForgeFetch, type PrForge } from "./pr-forge";
|
|
9
10
|
|
|
10
11
|
interface FakeIssue {
|
|
@@ -204,3 +205,30 @@ describe("the drift issue's parts (#4790)", () => {
|
|
|
204
205
|
expect(driftIssueMarker("plywood", "a b-->c")).toBe("<!-- plywood:drift a_bc -->");
|
|
205
206
|
});
|
|
206
207
|
});
|
|
208
|
+
|
|
209
|
+
describe("driftRunFingerprint (#4896)", () => {
|
|
210
|
+
const other = record("urn:pulumi:staging::infra::aws:s3/bucket:Bucket::logs", "drifted", { member: "infra/staging", attributes: [{ path: "tags.owner", before: "ops", after: "qa" }] });
|
|
211
|
+
|
|
212
|
+
test("is each drifted stack's finding fingerprint, sorted and hashed, as plywood's notices had it", () => {
|
|
213
|
+
const stacks = [
|
|
214
|
+
{ stack: "staging", records: [other] },
|
|
215
|
+
{ stack: "prod", records: [bucket, queue, role] },
|
|
216
|
+
];
|
|
217
|
+
// plywood's runFingerprint before #4896, kept so a notice's fingerprint does not move.
|
|
218
|
+
const parts = [`prod\t${driftIssueFingerprint([bucket, queue, role])}`, `staging\t${driftIssueFingerprint([other])}`].sort();
|
|
219
|
+
expect(driftRunFingerprint(stacks)).toBe(createHash("sha256").update(parts.join("\n")).digest("hex").slice(0, 16));
|
|
220
|
+
expect(driftRunFingerprint([...stacks].reverse())).toBe(driftRunFingerprint(stacks));
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
test("a stack with no drift is left out, and a run with none has the empty run's fingerprint", () => {
|
|
224
|
+
const clean = { stack: "dev", records: [role] };
|
|
225
|
+
expect(driftRunFingerprint([{ stack: "prod", records: [bucket] }, clean])).toBe(driftRunFingerprint([{ stack: "prod", records: [bucket] }]));
|
|
226
|
+
expect(driftRunFingerprint([clean])).toBe(driftRunFingerprint([]));
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
test("statuses names what is drift, as for one stack", () => {
|
|
230
|
+
const gone = record("app.events", "pending");
|
|
231
|
+
expect(driftRunFingerprint([{ stack: "prod", records: [gone] }])).toBe(driftRunFingerprint([]));
|
|
232
|
+
expect(driftRunFingerprint([{ stack: "prod", records: [gone] }], ["pending"])).not.toBe(driftRunFingerprint([]));
|
|
233
|
+
});
|
|
234
|
+
});
|
package/src/drift-issue.ts
CHANGED
|
@@ -108,9 +108,11 @@ export interface DriftIssueInput {
|
|
|
108
108
|
match?: MarkerMatch;
|
|
109
109
|
/**
|
|
110
110
|
* The statuses that are drift. Default {@link DRIFT_ISSUE_STATUSES}. A
|
|
111
|
-
* read with no snapshot
|
|
112
|
-
*
|
|
113
|
-
*
|
|
111
|
+
* read with no snapshot gives a declared object the provider lacks as
|
|
112
|
+
* `pending`, not deployed yet, unless its lexicon says such an object is
|
|
113
|
+
* gone: the sql lexicon does since #4896, so its records say `missing`
|
|
114
|
+
* and the default covers them. A caller that passes `pending` here (SQL
|
|
115
|
+
* Yodeler did, for a chant before #4896) still gets the same issue.
|
|
114
116
|
*/
|
|
115
117
|
statuses?: readonly DriftStatus[];
|
|
116
118
|
}
|
|
@@ -163,6 +165,29 @@ export function driftIssueFingerprint(records: readonly DriftIssueRecord[], stat
|
|
|
163
165
|
return createHash("sha256").update(text, "utf8").digest("hex").slice(0, 16);
|
|
164
166
|
}
|
|
165
167
|
|
|
168
|
+
/** One stack's (or environment's) drift records, for {@link driftRunFingerprint}. */
|
|
169
|
+
export interface DriftRunStack {
|
|
170
|
+
stack: string;
|
|
171
|
+
records: readonly DriftIssueRecord[];
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* A run's fingerprint over several stacks (#4896), for the drift notice a
|
|
176
|
+
* run sends (`driftNotifyFields`'s `fingerprint` on
|
|
177
|
+
* `@intentius/chant/ci-product`): each stack that has drift, as its name and
|
|
178
|
+
* its {@link driftIssueFingerprint}, sorted and hashed. A stack with no
|
|
179
|
+
* drift record is left out, so a clean stack, or one whose read failed and
|
|
180
|
+
* gave no records, does not move it. 16 hex digits of a SHA-256, the value
|
|
181
|
+
* plywood's notices carried before chant computed it.
|
|
182
|
+
*/
|
|
183
|
+
export function driftRunFingerprint(stacks: readonly DriftRunStack[], statuses: readonly DriftStatus[] = DRIFT_ISSUE_STATUSES): string {
|
|
184
|
+
const parts = stacks
|
|
185
|
+
.filter((s) => driftIssueRecords(s.records, statuses).length > 0)
|
|
186
|
+
.map((s) => `${s.stack}\t${driftIssueFingerprint(s.records, statuses)}`)
|
|
187
|
+
.sort();
|
|
188
|
+
return createHash("sha256").update(parts.join("\n")).digest("hex").slice(0, 16);
|
|
189
|
+
}
|
|
190
|
+
|
|
166
191
|
/** The issue's body: the marker, the product's intro, the table, what could not be read, the notes, the advice, the run, the fingerprint. */
|
|
167
192
|
export function driftIssueBody(input: DriftIssueInput, fingerprint = driftIssueFingerprint(input.records, input.statuses)): string {
|
|
168
193
|
const { words } = input;
|
package/src/drift-record.test.ts
CHANGED
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
encodeDriftLine,
|
|
27
27
|
encodeDriftLines,
|
|
28
28
|
foldDriftLines,
|
|
29
|
+
lexiconDriftRecords,
|
|
29
30
|
liveDiffDriftRecords,
|
|
30
31
|
mapDriftToGraph,
|
|
31
32
|
mergeDeepDrift,
|
|
@@ -594,3 +595,47 @@ describe("component status, constructed shapes", () => {
|
|
|
594
595
|
roundTrip(records);
|
|
595
596
|
});
|
|
596
597
|
});
|
|
598
|
+
|
|
599
|
+
describe("one lexicon's section of lifecycle diff --live --json (#4896)", () => {
|
|
600
|
+
const resources = { missing: ["app.events"], orphan: [], runtimeChildren: [], disappeared: [], newlyObserved: [], driftedSinceSnapshot: [], unchanged: ["app.users", "app.orders"], unobserved: [{ name: "app.audit", reason: "no-credentials" }] } as LiveDiffResult;
|
|
601
|
+
const deep = { drifted: [{ name: "app.users", type: "Postgres::Table", changes: [{ path: "columns[1].type", kind: "changed", declared: "int", live: "bigint" }] }], unchanged: ["app.orders"], unobserved: [], undeclaredEntities: [] } as unknown as DeepDiffResult;
|
|
602
|
+
const base = { member: "prod", observedAt: AT };
|
|
603
|
+
|
|
604
|
+
test("absent: missing gives a declared object the server lacks as missing", () => {
|
|
605
|
+
expect(statusOf(liveDiffDriftRecords({ ...base, diff: resources, absent: "missing" }))["app.events"]).toBe("missing");
|
|
606
|
+
expect(statusOf(liveDiffDriftRecords({ ...base, diff: resources }))["app.events"]).toBe("pending");
|
|
607
|
+
});
|
|
608
|
+
|
|
609
|
+
test("the section's own absent, types and deep read make the records", () => {
|
|
610
|
+
const records = lexiconDriftRecords({ ...base, section: { resources, deep, absent: "missing", observed: { "app.users": { type: "Postgres::Table" } } } });
|
|
611
|
+
expect(statusOf(records)).toEqual({ "app.audit": "not-observed", "app.events": "missing", "app.orders": "in-sync", "app.users": "drifted" });
|
|
612
|
+
expect(records.find((r) => r.address === "app.users")!.attributes).toEqual([{ path: "columns[1].type", before: "int", after: "bigint" }]);
|
|
613
|
+
expect(records.find((r) => r.address === "app.users")!.resourceType).toBe("Postgres::Table");
|
|
614
|
+
roundTrip(records);
|
|
615
|
+
});
|
|
616
|
+
|
|
617
|
+
test("a section with no absent keeps pending, and one with no resources has no records", () => {
|
|
618
|
+
expect(statusOf(lexiconDriftRecords({ ...base, section: { resources } }))["app.events"]).toBe("pending");
|
|
619
|
+
expect(lexiconDriftRecords({ ...base, section: { deep } })).toEqual([]);
|
|
620
|
+
});
|
|
621
|
+
|
|
622
|
+
test("a deep read's pending changes are drift on the entities behind them (#4944)", () => {
|
|
623
|
+
const withPending = {
|
|
624
|
+
...deep,
|
|
625
|
+
pending: [
|
|
626
|
+
{ subject: "column app.orders.note", change: "drop column note text, which the declaration does not have", entities: ["app.orders"] },
|
|
627
|
+
{ subject: "column app.users.legacy", change: "drop column legacy text, which the declaration does not have", entities: ["app.users"] },
|
|
628
|
+
{ subject: "grants app", change: "REVOKE INSERT ON `shop`.`events` FROM `app`" },
|
|
629
|
+
],
|
|
630
|
+
} as DeepDiffResult;
|
|
631
|
+
const records = lexiconDriftRecords({ ...base, section: { resources, deep: withPending, absent: "missing" } });
|
|
632
|
+
expect(statusOf(records)).toEqual({ "app.audit": "not-observed", "app.events": "missing", "app.orders": "drifted", "app.users": "drifted", "grants app": "drifted" });
|
|
633
|
+
expect(records.find((r) => r.address === "app.orders")!.attributes).toEqual([{ path: "column app.orders.note", after: "drop column note text, which the declaration does not have" }]);
|
|
634
|
+
expect(records.find((r) => r.address === "app.users")!.attributes).toEqual([
|
|
635
|
+
{ path: "column app.users.legacy", after: "drop column legacy text, which the declaration does not have" },
|
|
636
|
+
{ path: "columns[1].type", before: "int", after: "bigint" },
|
|
637
|
+
]);
|
|
638
|
+
expect(records.find((r) => r.address === "grants app")!.attributes).toEqual([{ path: "grants app", after: "REVOKE INSERT ON `shop`.`events` FROM `app`" }]);
|
|
639
|
+
roundTrip(records);
|
|
640
|
+
});
|
|
641
|
+
});
|
package/src/drift-record.ts
CHANGED
|
@@ -43,7 +43,8 @@
|
|
|
43
43
|
*
|
|
44
44
|
* ## Adapters
|
|
45
45
|
*
|
|
46
|
-
* The chant ones are here: `lifecycle diff --live` ({@link liveDiffDriftRecords}
|
|
46
|
+
* The chant ones are here: `lifecycle diff --live` ({@link liveDiffDriftRecords},
|
|
47
|
+
* and {@link lexiconDriftRecords} for one lexicon's whole section, #4896),
|
|
47
48
|
* deep observe ({@link deepDiffDriftRecords}, {@link mergeDeepDrift}) and
|
|
48
49
|
* component status ({@link componentStatusDriftRecords}). The terraform and
|
|
49
50
|
* choudoufu ones live in the terraform lexicon's `drift-record` subpath,
|
|
@@ -1005,20 +1006,32 @@ function chantEvidence(input: DriftAdapterBase, command: string): DriftEvidence
|
|
|
1005
1006
|
return { tool: "chant", ...(input.version ? { version: input.version } : {}), command };
|
|
1006
1007
|
}
|
|
1007
1008
|
|
|
1009
|
+
/**
|
|
1010
|
+
* What a declared entity the provider confirmed absent (the live diff's
|
|
1011
|
+
* `missing`) is, when no snapshot says it was deployed (#4896). `pending`,
|
|
1012
|
+
* the default, reads it as not deployed yet. `missing` reads it as gone,
|
|
1013
|
+
* which is what a SQL server lacking a declared table means: the sql
|
|
1014
|
+
* lexicon declares it (`LexiconPlugin.liveAbsentStatus`), and
|
|
1015
|
+
* `chant lifecycle diff --live --json` writes it as the section's `absent`.
|
|
1016
|
+
*/
|
|
1017
|
+
export type LiveAbsentStatus = Extract<DriftStatus, "pending" | "missing">;
|
|
1018
|
+
|
|
1008
1019
|
export interface LiveDiffDriftInput extends DriftAdapterBase {
|
|
1009
1020
|
/** `chant lifecycle diff --live --json`, parsed. */
|
|
1010
1021
|
diff: LiveDiffResult;
|
|
1011
1022
|
/** Entity types by name, for the records whose diff row carries none. */
|
|
1012
1023
|
types?: Record<string, string>;
|
|
1024
|
+
/** The status of a `missing` entity, default `pending` ({@link LiveAbsentStatus}). */
|
|
1025
|
+
absent?: LiveAbsentStatus;
|
|
1013
1026
|
}
|
|
1014
1027
|
|
|
1015
1028
|
/**
|
|
1016
1029
|
* A chant member's records, from `lifecycle diff --live`: `unchanged` and
|
|
1017
1030
|
* `newlyObserved` are in-sync, `driftedSinceSnapshot` drifted (before is the
|
|
1018
|
-
* snapshot, after the read), `missing` pending
|
|
1019
|
-
* `orphan` undeclared, `runtimeChildren` runtime,
|
|
1020
|
-
* An entity in both `missing` and `disappeared`
|
|
1021
|
-
* so it is missing.
|
|
1031
|
+
* snapshot, after the read), `missing` pending (or `input.absent`),
|
|
1032
|
+
* `disappeared` missing, `orphan` undeclared, `runtimeChildren` runtime,
|
|
1033
|
+
* `unobserved` not-observed. An entity in both `missing` and `disappeared`
|
|
1034
|
+
* was deployed and is gone, so it is missing.
|
|
1022
1035
|
*/
|
|
1023
1036
|
export function liveDiffDriftRecords(input: LiveDiffDriftInput): DriftRecord[] {
|
|
1024
1037
|
const { diff } = input;
|
|
@@ -1042,7 +1055,7 @@ export function liveDiffDriftRecords(input: LiveDiffDriftInput): DriftRecord[] {
|
|
|
1042
1055
|
}, d.type);
|
|
1043
1056
|
}
|
|
1044
1057
|
for (const name of diff.disappeared ?? []) put(name, { status: "missing" });
|
|
1045
|
-
for (const name of diff.missing ?? []) put(name, { status: "pending" });
|
|
1058
|
+
for (const name of diff.missing ?? []) put(name, { status: input.absent ?? "pending" });
|
|
1046
1059
|
for (const name of diff.orphan ?? []) put(name, { status: "undeclared" });
|
|
1047
1060
|
for (const r of diff.runtimeChildren ?? []) put(r.name, { status: "runtime", ownership: { verdict: "foreign", ownedBy: r.owner } }, r.type);
|
|
1048
1061
|
for (const name of [...(diff.unchanged ?? []), ...(diff.newlyObserved ?? [])]) put(name, { status: "in-sync" });
|
|
@@ -1068,6 +1081,13 @@ export interface DeepDiffDriftInput extends DriftAdapterBase {
|
|
|
1068
1081
|
* `undeclaredEntities` undeclared. Accepted and held paths are not drift and
|
|
1069
1082
|
* are left out. To lay these over the thin read's records, so a deep hole
|
|
1070
1083
|
* stays on the attribute surface, use {@link mergeDeepDrift}.
|
|
1084
|
+
*
|
|
1085
|
+
* A pending change (`pending`: a privilege granted by hand, a column the
|
|
1086
|
+
* declaration does not have) is drift too (#4944), as `lifecycle diff
|
|
1087
|
+
* --live` counts it: an attribute on each entity behind it, its path the
|
|
1088
|
+
* change's subject and its after what an apply would do, the entity's record
|
|
1089
|
+
* drifted unless it is not-observed. A pending change that names no entity
|
|
1090
|
+
* is a drifted record of its own, addressed by its subject.
|
|
1071
1091
|
*/
|
|
1072
1092
|
export function deepDiffDriftRecords(input: DeepDiffDriftInput): DriftRecord[] {
|
|
1073
1093
|
const { diff } = input;
|
|
@@ -1094,6 +1114,15 @@ export function deepDiffDriftRecords(input: DeepDiffDriftInput): DriftRecord[] {
|
|
|
1094
1114
|
})),
|
|
1095
1115
|
});
|
|
1096
1116
|
}
|
|
1117
|
+
for (const p of diff.pending ?? []) {
|
|
1118
|
+
const attribute: DriftAttribute = { path: p.subject, after: p.change };
|
|
1119
|
+
for (const name of p.entities && p.entities.length > 0 ? p.entities : [p.subject]) {
|
|
1120
|
+
const had = out.get(name);
|
|
1121
|
+
if (had?.status === "not-observed") continue;
|
|
1122
|
+
if (had) out.set(name, driftRecord({ ...had, status: "drifted", attributes: [...(had.attributes ?? []), attribute] }));
|
|
1123
|
+
else put(name, { status: "drifted", attributes: [attribute] });
|
|
1124
|
+
}
|
|
1125
|
+
}
|
|
1097
1126
|
for (const name of diff.undeclaredEntities ?? []) put(name, { status: "undeclared" });
|
|
1098
1127
|
for (const name of diff.unchanged ?? []) put(name, { status: "in-sync" });
|
|
1099
1128
|
return [...out.values()].sort((a, b) => byString(a.address, b.address));
|
|
@@ -1126,6 +1155,42 @@ export function mergeDeepDrift(thin: Iterable<DriftRecord>, deep: Iterable<Drift
|
|
|
1126
1155
|
return [...out.values()].sort((a, b) => byString(key(a), key(b)));
|
|
1127
1156
|
}
|
|
1128
1157
|
|
|
1158
|
+
/**
|
|
1159
|
+
* One lexicon's section of `chant lifecycle diff --live --json`
|
|
1160
|
+
* (`lexicons.<name>`, or `stacks.<stack>.<name>`), as far as its drift
|
|
1161
|
+
* records read it.
|
|
1162
|
+
*/
|
|
1163
|
+
export interface LiveDiffLexiconSection {
|
|
1164
|
+
resources?: LiveDiffResult;
|
|
1165
|
+
/** The live state per entity; its `type` names a record's resource type. */
|
|
1166
|
+
observed?: Record<string, { type?: unknown }>;
|
|
1167
|
+
deep?: DeepDiffResult;
|
|
1168
|
+
/** What a confirmed-absent entity is, when the lexicon says (#4896). Left out, `pending`. */
|
|
1169
|
+
absent?: LiveAbsentStatus;
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
export interface LexiconDriftInput extends DriftAdapterBase {
|
|
1173
|
+
section: LiveDiffLexiconSection;
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
/**
|
|
1177
|
+
* One lexicon's drift records from its section of `lifecycle diff --live
|
|
1178
|
+
* --json` (#4896): {@link liveDiffDriftRecords} over `resources`, with the
|
|
1179
|
+
* types `observed` names and the section's `absent`, and the deep read laid
|
|
1180
|
+
* over it with {@link mergeDeepDrift}. `chant workspace drift` reads a chant
|
|
1181
|
+
* member this way, and a product that runs the diff itself (SQL Yodeler
|
|
1182
|
+
* reads `lexicons.sql`) gets the same records. A section with no
|
|
1183
|
+
* `resources` has none.
|
|
1184
|
+
*/
|
|
1185
|
+
export function lexiconDriftRecords(input: LexiconDriftInput): DriftRecord[] {
|
|
1186
|
+
const { section, ...base } = input;
|
|
1187
|
+
if (!section.resources) return [];
|
|
1188
|
+
const types: Record<string, string> = {};
|
|
1189
|
+
for (const [name, meta] of Object.entries(section.observed ?? {})) if (typeof meta?.type === "string") types[name] = meta.type;
|
|
1190
|
+
const thin = liveDiffDriftRecords({ ...base, diff: section.resources, types, ...(section.absent ? { absent: section.absent } : {}) });
|
|
1191
|
+
return section.deep ? mergeDeepDrift(thin, deepDiffDriftRecords({ ...base, diff: section.deep })) : thin;
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1129
1194
|
export interface ComponentStatusDriftInput extends DriftAdapterBase {
|
|
1130
1195
|
/** `chant components status [env] --json`'s rows. */
|
|
1131
1196
|
rows: readonly ComponentStatusRow[];
|