@intentius/chant 0.124.108 → 0.124.110
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/fan-out-applied.json +12 -6
- package/dist/__golden__/wave-loop/fan-out-apply-fails.json +8 -4
- package/dist/__golden__/wave-loop/fan-out-gated.json +4 -2
- package/dist/__golden__/wave-loop/fan-out-no-members.json +16 -8
- package/dist/__golden__/wave-loop/fan-out-plan-fails.json +8 -4
- package/dist/__golden__/wave-loop/fan-out-same-root.json +4 -2
- package/dist/agent-facts.d.ts +130 -0
- package/dist/agent-facts.js +196 -0
- package/dist/change-risk.d.ts +216 -0
- package/dist/change-risk.js +304 -0
- package/dist/change-set.d.ts +8 -0
- package/dist/ci-agent-alert.d.ts +139 -0
- package/dist/ci-agent-alert.js +342 -0
- package/dist/ci-agent-triggers.d.ts +152 -0
- package/dist/ci-agent-triggers.js +232 -0
- package/dist/ci-agent-verify-failed.d.ts +149 -0
- package/dist/ci-agent-verify-failed.js +191 -0
- package/dist/ci-agent.d.ts +136 -8
- package/dist/ci-agent.js +353 -26
- package/dist/ci-comment-commands.d.ts +8 -0
- package/dist/ci-comment-commands.js +17 -1
- package/dist/ci-comment-reject.d.ts +70 -0
- package/dist/ci-comment-reject.js +135 -0
- package/dist/ci-comment-replies.d.ts +3 -1
- package/dist/ci-comment-replies.js +6 -0
- package/dist/ci-estate/delivery.d.ts +25 -3
- package/dist/ci-estate/delivery.js +28 -9
- package/dist/ci-estate/page.d.ts +7 -3
- package/dist/ci-estate/page.js +19 -4
- package/dist/ci-estate/rows.d.ts +14 -2
- package/dist/ci-estate/rows.js +9 -1
- package/dist/ci-estate.d.ts +5 -2
- package/dist/ci-estate.js +3 -2
- package/dist/ci-handover.d.ts +2 -7
- package/dist/ci-handover.js +3 -20
- package/dist/ci-jobs.d.ts +6 -0
- package/dist/ci-jobs.js +17 -0
- package/dist/ci-note-commands.d.ts +2 -0
- package/dist/ci-note-commands.js +12 -1
- package/dist/ci-product-words.d.ts +151 -1
- package/dist/ci-product-words.js +1390 -3
- package/dist/ci-product.d.ts +100 -4
- package/dist/ci-product.js +99 -3
- package/dist/ci-respond-run.d.ts +9 -0
- package/dist/ci-respond-run.js +35 -4
- package/dist/ci-respond-summary-env.d.ts +56 -0
- package/dist/ci-respond-summary-env.js +81 -0
- package/dist/ci-respond-summary.d.ts +103 -0
- package/dist/ci-respond-summary.js +243 -0
- package/dist/ci-respond.d.ts +4 -2
- package/dist/ci-respond.js +4 -2
- package/dist/cli/command-group.js +1 -1
- package/dist/cli/commands/lint.js +21 -3
- package/dist/cli/handlers/agent.js +49 -4
- package/dist/cli/handlers/approve.js +3 -1
- package/dist/cli/handlers/build.d.ts +97 -1
- package/dist/cli/handlers/build.js +251 -3
- package/dist/cli/handlers/fan-out.js +55 -0
- package/dist/cli/handlers/graph.d.ts +14 -0
- package/dist/cli/handlers/graph.js +58 -3
- package/dist/cli/handlers/lifecycle-health.d.ts +7 -0
- package/dist/cli/handlers/lifecycle-health.js +47 -9
- package/dist/cli/handlers/lifecycle.js +4 -1
- package/dist/cli/handlers/notify-relay.d.ts +2 -2
- package/dist/cli/handlers/notify-relay.js +67 -7
- package/dist/cli/handlers/pipeline-agent.d.ts +30 -0
- package/dist/cli/handlers/pipeline-agent.js +255 -0
- package/dist/cli/handlers/pipeline-artifacts.d.ts +39 -0
- package/dist/cli/handlers/pipeline-artifacts.js +203 -0
- package/dist/cli/handlers/pipeline.d.ts +16 -0
- package/dist/cli/handlers/pipeline.js +112 -0
- package/dist/cli/handlers/pr-comment.js +4 -0
- package/dist/cli/handlers/pr-notes.js +4 -1
- package/dist/cli/handlers/pr.d.ts +20 -0
- package/dist/cli/handlers/pr.js +114 -11
- package/dist/cli/handlers/promote.js +792 -47
- package/dist/cli/handlers/reject.d.ts +84 -0
- package/dist/cli/handlers/reject.js +216 -0
- package/dist/cli/handlers/release.js +4 -2
- package/dist/cli/handlers/replan.d.ts +54 -0
- package/dist/cli/handlers/replan.js +177 -0
- package/dist/cli/handlers/run-generate.d.ts +5 -0
- package/dist/cli/handlers/run-generate.js +31 -4
- package/dist/cli/handlers/run-wave.js +15 -2
- package/dist/cli/handlers/run.js +4 -2
- package/dist/cli/handlers/stage.d.ts +35 -0
- package/dist/cli/handlers/stage.js +90 -0
- package/dist/cli/lsp/server.js +4 -0
- package/dist/cli/main.js +88 -8
- package/dist/cli/parse-args.js +35 -2
- package/dist/cli/registry.d.ts +12 -0
- package/dist/components/auto-release.d.ts +2 -0
- package/dist/components/auto-release.js +1 -0
- package/dist/components/capability.d.ts +40 -0
- package/dist/components/cli-support.d.ts +21 -1
- package/dist/components/cli-support.js +28 -6
- package/dist/components/component.d.ts +23 -4
- package/dist/components/component.schema.json +28 -0
- package/dist/components/declared-reads.d.ts +44 -4
- package/dist/components/declared-reads.js +80 -3
- package/dist/components/discover.d.ts +8 -0
- package/dist/components/discover.js +1 -1
- package/dist/components/driver.d.ts +13 -0
- package/dist/components/driver.js +23 -2
- package/dist/components/environment-sets.d.ts +229 -0
- package/dist/components/environment-sets.js +338 -0
- package/dist/components/fan-out-canary.d.ts +47 -0
- package/dist/components/fan-out-canary.js +58 -0
- package/dist/components/fan-out-run.d.ts +17 -0
- package/dist/components/fan-out-run.js +14 -1
- package/dist/components/fan-out-support.d.ts +7 -0
- package/dist/components/fan-out-support.js +1 -1
- package/dist/components/groups.d.ts +8 -1
- package/dist/components/groups.js +19 -1
- package/dist/components/index.d.ts +5 -2
- package/dist/components/index.js +4 -1
- package/dist/components/pr-cost.d.ts +28 -0
- package/dist/components/pr-cost.js +53 -0
- package/dist/components/pr-pipeline.d.ts +33 -0
- package/dist/components/pr-pipeline.js +32 -5
- package/dist/components/pr-policy.d.ts +33 -2
- package/dist/components/pr-policy.js +5 -2
- package/dist/components/pr-risk.d.ts +42 -0
- package/dist/components/pr-risk.js +74 -0
- package/dist/components/product-pipeline.d.ts +43 -0
- package/dist/components/product-pipeline.js +67 -1
- package/dist/components/promote.d.ts +6 -0
- package/dist/components/promote.js +13 -0
- package/dist/components/release-compile.js +3 -1
- package/dist/components/release-gate.d.ts +6 -1
- package/dist/components/release-gate.js +10 -2
- package/dist/components/step-environments.d.ts +236 -0
- package/dist/components/step-environments.js +392 -0
- package/dist/components/upstream-replan.d.ts +201 -0
- package/dist/components/upstream-replan.js +249 -0
- package/dist/components/verify-step.d.ts +30 -0
- package/dist/components/verify-step.js +27 -0
- package/dist/components/wave-plan.js +6 -2
- package/dist/config-environments.d.ts +4 -2
- package/dist/control/dispatch.d.ts +15 -0
- package/dist/control/dispatch.js +28 -4
- package/dist/cost-estimate.d.ts +188 -0
- package/dist/cost-estimate.js +363 -0
- package/dist/drift-record.d.ts +36 -0
- package/dist/drift-record.js +44 -0
- package/dist/engine-facts.d.ts +105 -0
- package/dist/engine-facts.js +111 -0
- package/dist/exit-codes.d.ts +4 -3
- package/dist/exit-codes.js +4 -3
- package/dist/flag-params.d.ts +2 -2
- package/dist/flag-params.js +9 -4
- package/dist/floor-table.data.js +53 -0
- package/dist/forge-token-vars.d.ts +12 -0
- package/dist/forge-token-vars.js +25 -0
- package/dist/gate-decision.d.ts +3 -1
- package/dist/gate-decision.js +3 -1
- package/dist/gated-waves.d.ts +2 -0
- package/dist/gated-waves.js +1 -0
- package/dist/graph-ir.d.ts +30 -0
- package/dist/graph-ir.js +33 -1
- package/dist/graph-refs.d.ts +26 -0
- package/dist/graph-refs.js +34 -3
- package/dist/graph-schema/graph.schema.json +136 -0
- package/dist/health.d.ts +65 -0
- package/dist/health.js +62 -0
- package/dist/lexicon.d.ts +188 -1
- package/dist/lifecycle/disruption.d.ts +14 -1
- package/dist/lifecycle/disruption.js +5 -1
- package/dist/lifecycle/gate-change-set.d.ts +8 -0
- package/dist/lifecycle/gate-change-set.js +2 -1
- package/dist/lifecycle/gate-ledger.d.ts +26 -0
- package/dist/lifecycle/gate-rejection.d.ts +82 -0
- package/dist/lifecycle/gate-rejection.js +93 -0
- package/dist/lifecycle/gate-seal.d.ts +3 -3
- package/dist/lifecycle/gate-seal.js +5 -5
- package/dist/lifecycle/observe.d.ts +17 -0
- package/dist/lifecycle/observe.js +10 -1
- package/dist/lifecycle/release-cut.js +4 -0
- package/dist/lifecycle/release-ledger.d.ts +8 -0
- package/dist/lifecycle/release-risk.d.ts +137 -0
- package/dist/lifecycle/release-risk.js +214 -0
- package/dist/lifecycle/release-store.d.ts +9 -0
- package/dist/lifecycle/release-store.js +4 -0
- package/dist/lifecycle/stage-log.d.ts +85 -0
- package/dist/lifecycle/stage-log.js +141 -0
- package/dist/lint/canary-checks.d.ts +31 -0
- package/dist/lint/canary-checks.js +45 -0
- package/dist/lint/rule.d.ts +1 -0
- package/dist/lint/rules/evl012-pipeline-fold.d.ts +14 -0
- package/dist/lint/rules/evl012-pipeline-fold.js +30 -0
- package/dist/lint/rules/index.d.ts +1 -0
- package/dist/lint/rules/index.js +3 -0
- package/dist/notify-relay-repo.d.ts +54 -0
- package/dist/notify-relay-repo.js +84 -0
- package/dist/notify-relay.d.ts +53 -3
- package/dist/notify-relay.js +96 -3
- package/dist/notify.d.ts +57 -1
- package/dist/notify.js +7 -1
- package/dist/notify.schema.json +61 -3
- package/dist/observation.d.ts +34 -0
- package/dist/observation.js +14 -1
- package/dist/op/activities/review-agent.d.ts +39 -2
- package/dist/op/activities/review-agent.js +88 -5
- package/dist/op/agent-permit.d.ts +88 -0
- package/dist/op/agent-permit.js +97 -0
- package/dist/op/gate-approval-base.d.ts +8 -0
- package/dist/op/gate-approval-base.js +9 -0
- package/dist/op/gate-approval.d.ts +30 -1
- package/dist/op/gate-approval.js +23 -2
- package/dist/op/gate-quorum.d.ts +114 -8
- package/dist/op/gate-quorum.js +198 -21
- package/dist/op/gate-reject.d.ts +79 -0
- package/dist/op/gate-reject.js +96 -0
- package/dist/op/gate-summary.js +1 -1
- package/dist/op/gate.d.ts +28 -3
- package/dist/op/gate.js +55 -13
- package/dist/op/generate-pipeline.d.ts +15 -1
- package/dist/op/generate-pipeline.js +32 -5
- package/dist/op/index.d.ts +11 -6
- package/dist/op/index.js +10 -5
- package/dist/op/local-executor.d.ts +2 -0
- package/dist/op/local-executor.js +23 -4
- package/dist/op/op-waves-after-plan.d.ts +23 -0
- package/dist/op/op-waves-after-plan.js +12 -1
- package/dist/op/op-waves-capability-spec.d.ts +14 -0
- package/dist/op/op-waves-capability-spec.js +46 -6
- package/dist/op/op-waves-capability.d.ts +21 -13
- package/dist/op/op-waves-capability.js +22 -59
- package/dist/op/op-waves-environment-sets.d.ts +41 -0
- package/dist/op/op-waves-environment-sets.js +82 -0
- package/dist/op/op-waves-quorum-warnings.d.ts +53 -0
- package/dist/op/op-waves-quorum-warnings.js +90 -0
- package/dist/op/op-waves-release-port.d.ts +7 -0
- package/dist/op/op-waves-release-port.js +15 -3
- package/dist/op/op-waves-release.d.ts +15 -0
- package/dist/op/op-waves-release.js +15 -0
- package/dist/op/op-waves-run.d.ts +37 -3
- package/dist/op/op-waves-run.js +141 -18
- package/dist/op/op-waves-soak.d.ts +57 -0
- package/dist/op/op-waves-soak.js +111 -0
- package/dist/op/op-waves-split.d.ts +4 -0
- package/dist/op/op-waves-split.js +4 -0
- package/dist/op/op-waves.d.ts +67 -4
- package/dist/op/op-waves.js +71 -3
- package/dist/pipeline/agent-ajv.d.ts +4 -0
- package/dist/pipeline/agent-ajv.js +14 -0
- package/dist/pipeline/agent-steps.d.ts +329 -0
- package/dist/pipeline/agent-steps.js +602 -0
- package/dist/pipeline/artifacts.d.ts +264 -0
- package/dist/pipeline/artifacts.js +425 -0
- package/dist/pipeline/diff.d.ts +45 -0
- package/dist/pipeline/diff.js +177 -0
- package/dist/pipeline/fold.d.ts +43 -0
- package/dist/pipeline/fold.js +140 -0
- package/dist/pipeline/generate.d.ts +52 -0
- package/dist/pipeline/generate.js +120 -0
- package/dist/pipeline/product.d.ts +225 -0
- package/dist/pipeline/product.js +257 -0
- package/dist/pipeline/promote.d.ts +404 -0
- package/dist/pipeline/promote.js +694 -0
- package/dist/pipeline/read.d.ts +37 -0
- package/dist/pipeline/read.js +58 -0
- package/dist/pipeline/rendered.d.ts +25 -0
- package/dist/pipeline/rendered.js +53 -0
- package/dist/pipeline/soak-checks.d.ts +80 -0
- package/dist/pipeline/soak-checks.js +254 -0
- package/dist/pipeline/soak-gate.d.ts +97 -0
- package/dist/pipeline/soak-gate.js +176 -0
- package/dist/pipeline/soak-sources.d.ts +17 -0
- package/dist/pipeline/soak-sources.js +42 -0
- package/dist/pipeline/soak.d.ts +260 -0
- package/dist/pipeline/soak.js +378 -0
- package/dist/pipeline/spec.d.ts +724 -0
- package/dist/pipeline/spec.js +567 -0
- package/dist/pipeline/stage-ledger.d.ts +187 -0
- package/dist/pipeline/stage-ledger.js +185 -0
- package/dist/pipeline/stage-waves.d.ts +114 -0
- package/dist/pipeline/stage-waves.js +161 -0
- package/dist/pipeline/stages.d.ts +64 -0
- package/dist/pipeline/stages.js +174 -0
- package/dist/pipeline/verify-rollback.d.ts +277 -0
- package/dist/pipeline/verify-rollback.js +393 -0
- package/dist/pipeline.d.ts +142 -0
- package/dist/pipeline.js +143 -0
- package/dist/pr-loop.d.ts +22 -0
- package/dist/pr-loop.js +8 -0
- package/dist/pr-plan-note.d.ts +15 -1
- package/dist/pr-plan-note.js +8 -0
- package/dist/pr-post.d.ts +31 -0
- package/dist/pr-post.js +89 -0
- package/dist/release-floors.d.ts +1 -1
- package/dist/release-floors.js +1 -1
- package/dist/report-store/audit.schema.json +50 -0
- package/dist/report-store/dora.schema.json +331 -0
- package/dist/report-store/estate.schema.json +96 -0
- package/dist/report-store/run.schema.json +14 -0
- package/dist/report-store.d.ts +151 -0
- package/dist/report-store.js +344 -0
- package/dist/run-event.d.ts +7 -2
- package/dist/wave-runtime.mjs +458 -404
- package/dist/workspace/catalog-edges.js +3 -3
- package/dist/workspace/change-set.schema.json +4 -0
- package/dist/workspace/ci-cloud-identity.d.ts +4 -0
- package/dist/workspace/ci-cloud-identity.js +30 -0
- package/dist/workspace/ci-run.js +17 -2
- package/dist/workspace/ci-secrets.d.ts +3 -1
- package/dist/workspace/ci-secrets.js +7 -1
- package/dist/workspace/compose-graph.d.ts +1 -1
- package/dist/workspace/compose-graph.js +3 -1
- package/dist/workspace/declaration.d.ts +27 -0
- package/dist/workspace/declaration.js +35 -0
- package/dist/workspace/declaration.schema.json +56 -0
- package/dist/workspace/graph-cli.js +26 -0
- package/dist/workspace/graph.schema.json +5 -1
- package/dist/workspace/identity-gate-rule.d.ts +4 -0
- package/dist/workspace/identity-gate-rule.js +2 -2
- package/dist/workspace/identity-reject-rule.d.ts +14 -0
- package/dist/workspace/identity-reject-rule.js +24 -0
- package/dist/workspace/identity.d.ts +3 -0
- package/dist/workspace/identity.js +2 -1
- package/dist/workspace/nested-graph.js +2 -0
- package/dist/workspace/pr-report.schema.json +65 -0
- package/dist/workspace/promotion-order.d.ts +19 -4
- package/dist/workspace/promotion-order.js +26 -4
- package/dist/workspace/release-train.d.ts +14 -0
- package/dist/workspace/release-train.js +32 -0
- package/dist/workspace/run-event.schema.json +2 -2
- package/dist/workspace/stack-read-edges.d.ts +19 -0
- package/dist/workspace/stack-read-edges.js +54 -0
- package/dist/workspace/status-gates.d.ts +51 -1
- package/dist/workspace/status-gates.js +60 -0
- package/dist/workspace/status-stages.d.ts +223 -0
- package/dist/workspace/status-stages.js +279 -0
- package/dist/workspace/status.d.ts +45 -1
- package/dist/workspace/status.js +109 -5
- package/dist/workspace/status.schema.json +283 -2
- package/dist/workspace/train-cut.js +5 -2
- package/dist/workspace/train-shell.d.ts +18 -0
- package/dist/workspace/train-shell.js +43 -0
- package/dist/workspace/trust/seal.d.ts +7 -0
- package/dist/workspace/trust/seal.js +9 -0
- package/package.json +5 -1
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Findings for an Op waves spec's approval rules (#5349): a count plain
|
|
3
|
+
* `chant approve` lines can meet, and a rule that needs proof on a wave where
|
|
4
|
+
* nothing can prove an approver. Kept apart from `./op-waves.ts`, so the
|
|
5
|
+
* gate-decision bundle stays small.
|
|
6
|
+
*/
|
|
7
|
+
import { quorumRuleSites, ruleNeedsProof, targetGlobMatch } from "./gate-quorum.js";
|
|
8
|
+
/**
|
|
9
|
+
* Whether a rule that needs proof on a wave nothing can prove an approver
|
|
10
|
+
* for refuses the spec (#5349, #5379). True: `generateOpWavesPipeline`
|
|
11
|
+
* refuses the spec with the finding's lines and writes nothing.
|
|
12
|
+
*/
|
|
13
|
+
export const UNPROVABLE_QUORUM_REFUSED = true;
|
|
14
|
+
/**
|
|
15
|
+
* The first chant whose `generateOpWavesPipeline` refuses an approval rule
|
|
16
|
+
* that needs proof where the signers file names nobody and no review mode
|
|
17
|
+
* applies (#5379), and writes nothing.
|
|
18
|
+
*/
|
|
19
|
+
export const UNPROVABLE_QUORUM_REFUSED_FLOOR = "0.124.110";
|
|
20
|
+
/** The rules a wave takes, each with where `approvals.quorum` writes it (#5354: inside groups too). A wave with no runs listed yet takes every rule. */
|
|
21
|
+
function rulesOf(rules, wave) {
|
|
22
|
+
const targets = (wave.runs ?? []).map((r) => r.target);
|
|
23
|
+
return rules
|
|
24
|
+
.map(({ rule, at }) => [rule, at])
|
|
25
|
+
.filter(([rule]) => rule.targets === undefined || targets.length === 0 || rule.targets.some((g) => targets.some((t) => targetGlobMatch(g, t))));
|
|
26
|
+
}
|
|
27
|
+
/** What a rule needs proof for, in words: `roles`, `notAuthor`, `proven`. */
|
|
28
|
+
function proofNeeds(rule) {
|
|
29
|
+
return [rule.roles?.length ? "`roles`" : "", rule.notAuthor ? "`notAuthor`" : "", rule.proven ? "`proven`" : ""].filter(Boolean).join(", ");
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Rules no approver can meet (#5349), one line each: a rule that needs a
|
|
33
|
+
* proven approver (`roles`, `notAuthor` or `proven`) on a wave where
|
|
34
|
+
* nothing can prove one. A seal proves its approver under every mode, so
|
|
35
|
+
* only when the signers file names nobody; and `pr-review` proves the merged
|
|
36
|
+
* pull request's reviewers (and a `reviewLedger`'s), so only on a wave under
|
|
37
|
+
* another mode. A wave that asks a decision point is decided by the point.
|
|
38
|
+
*/
|
|
39
|
+
export function opWavesUnprovableQuorum(spec, proof) {
|
|
40
|
+
if (proof.signersNamed)
|
|
41
|
+
return [];
|
|
42
|
+
const rules = quorumRuleSites(spec.approvals?.quorum, "approvals.quorum");
|
|
43
|
+
const out = [];
|
|
44
|
+
spec.waves.forEach((wave, i) => {
|
|
45
|
+
const mode = wave.approval ?? "ledger";
|
|
46
|
+
if (mode === "pr-review" || (wave.point ?? spec.point) !== undefined)
|
|
47
|
+
return;
|
|
48
|
+
for (const [rule, j] of rulesOf(rules, wave)) {
|
|
49
|
+
if (!ruleNeedsProof(rule))
|
|
50
|
+
continue;
|
|
51
|
+
out.push(`wave ${i + 1} (${wave.name}): ${j} needs a proven approver (${proofNeeds(rule)}), and nothing can prove one: ${proof.signersPath} names no signer, and \`${mode}\` reads no review. Add the approvers' keys to ${proof.signersPath} and approve with \`chant approve --sign\`, or set the wave's approval to \`pr-review\` so the merged pull request's review proves its reviewers`);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
return out;
|
|
55
|
+
}
|
|
56
|
+
/** The findings for a spec (#5349): `refusals` stop the build, `warnings` are printed and the pipeline is written. */
|
|
57
|
+
export function opWavesQuorumFindings(spec, proof, refuseUnprovable = UNPROVABLE_QUORUM_REFUSED) {
|
|
58
|
+
const unprovable = opWavesUnprovableQuorum(spec, proof);
|
|
59
|
+
return {
|
|
60
|
+
warnings: [...opWavesQuorumWarnings(spec), ...(refuseUnprovable ? [] : unprovable)],
|
|
61
|
+
refusals: refuseUnprovable ? unprovable : [],
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/** The approval modes that count a plain `chant approve` line of the digest, sealed or not (#5349). */
|
|
65
|
+
export const PLAIN_APPROVAL_MODES = ["ledger", "pr-review", "pull-request"];
|
|
66
|
+
/**
|
|
67
|
+
* Warnings for a spec's approval rules (#5349), one line each: a rule whose
|
|
68
|
+
* `count` is above 1, without `proven`, on a wave whose `approval` mode
|
|
69
|
+
* takes plain `chant approve` lines. One person who can push to
|
|
70
|
+
* `chant/lifecycle` can write those lines in two names, so the count does
|
|
71
|
+
* not show two people approved. A rule with `roles` already counts only
|
|
72
|
+
* proven approvers and is left out. `sealed` counts sealed approvals only.
|
|
73
|
+
* A wave that asks a decision point is decided by the point. The spec is
|
|
74
|
+
* not refused: the rule is valid and works as it did.
|
|
75
|
+
*/
|
|
76
|
+
export function opWavesQuorumWarnings(spec) {
|
|
77
|
+
const rules = quorumRuleSites(spec.approvals?.quorum, "approvals.quorum");
|
|
78
|
+
const out = [];
|
|
79
|
+
spec.waves.forEach((wave, i) => {
|
|
80
|
+
const mode = wave.approval ?? "ledger";
|
|
81
|
+
if (!PLAIN_APPROVAL_MODES.includes(mode) || (wave.point ?? spec.point) !== undefined)
|
|
82
|
+
return;
|
|
83
|
+
for (const [rule, j] of rulesOf(rules, wave)) {
|
|
84
|
+
if (rule.count <= 1 || rule.proven === true || (rule.roles?.length ?? 0) > 0)
|
|
85
|
+
continue;
|
|
86
|
+
out.push(`wave ${i + 1} (${wave.name}): ${j} asks for ${rule.count} approvers under \`${mode}\`, which counts plain \`chant approve\` lines, so one person who can push to chant/lifecycle can meet it alone. Set \`proven: true\` on the rule to count only approvers a seal or a review proves, or use \`approval: "sealed"\``);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
return out;
|
|
90
|
+
}
|
|
@@ -10,8 +10,15 @@ import { type OpWaveReleasePort } from "./op-waves-release.js";
|
|
|
10
10
|
* `maybeRecordAutoRelease`, which appends and pushes, with the release a cut
|
|
11
11
|
* from the commit names when there is one. Loaded behind dynamic imports, so
|
|
12
12
|
* the wave-job runtime bundle stays without them until a step applied.
|
|
13
|
+
*
|
|
14
|
+
* With `release` (#5427), the waves a promote runs for a release: every
|
|
15
|
+
* record names that release, with the step's plan digest, so the stages
|
|
16
|
+
* after it find the release applied here whichever commit the job ran at.
|
|
13
17
|
*/
|
|
14
18
|
export declare function gitOpWaveReleasePort(opts?: {
|
|
15
19
|
cwd?: string;
|
|
16
20
|
actor?: string;
|
|
21
|
+
release?: {
|
|
22
|
+
releaseDigest: string;
|
|
23
|
+
};
|
|
17
24
|
}): OpWaveReleasePort;
|
|
@@ -4,15 +4,27 @@
|
|
|
4
4
|
* release ledger, store or compile module. Only the wave loop
|
|
5
5
|
* (`./op-waves-run.ts`) and the package index load this file.
|
|
6
6
|
*/
|
|
7
|
-
import { releaseOfCommit } from "./op-waves-release.js";
|
|
7
|
+
import { opWaveRiskLines, releaseOfCommit } from "./op-waves-release.js";
|
|
8
8
|
/**
|
|
9
9
|
* The release ledger on `chant/lifecycle` (#4615): each request through
|
|
10
10
|
* `maybeRecordAutoRelease`, which appends and pushes, with the release a cut
|
|
11
11
|
* from the commit names when there is one. Loaded behind dynamic imports, so
|
|
12
12
|
* the wave-job runtime bundle stays without them until a step applied.
|
|
13
|
+
*
|
|
14
|
+
* With `release` (#5427), the waves a promote runs for a release: every
|
|
15
|
+
* record names that release, with the step's plan digest, so the stages
|
|
16
|
+
* after it find the release applied here whichever commit the job ran at.
|
|
13
17
|
*/
|
|
14
18
|
export function gitOpWaveReleasePort(opts = {}) {
|
|
15
19
|
return {
|
|
20
|
+
// #5387: each wave's change risk, on the commit's file, pushed with the release records after it.
|
|
21
|
+
async recordRisk(requests) {
|
|
22
|
+
const lines = opWaveRiskLines(requests, new Date().toISOString());
|
|
23
|
+
if (lines.length === 0)
|
|
24
|
+
return;
|
|
25
|
+
const { appendWaveRisk } = await import("../lifecycle/release-risk.js");
|
|
26
|
+
await appendWaveRisk(lines, opts.cwd ? { cwd: opts.cwd } : undefined);
|
|
27
|
+
},
|
|
16
28
|
async record(requests) {
|
|
17
29
|
if (requests.length === 0)
|
|
18
30
|
return [];
|
|
@@ -37,7 +49,7 @@ export function gitOpWaveReleasePort(opts = {}) {
|
|
|
37
49
|
const { runId, runOrigin } = resolveRunId();
|
|
38
50
|
const out = [];
|
|
39
51
|
for (const req of requests) {
|
|
40
|
-
const joined = req.gitSha ? releaseOfCommit(releases, cuts, { commit: req.gitSha, env: req.env, component: req.component }, templates) : null;
|
|
52
|
+
const joined = opts.release ? { releaseDigest: opts.release.releaseDigest } : req.gitSha ? releaseOfCommit(releases, cuts, { commit: req.gitSha, env: req.env, component: req.component }, templates) : null;
|
|
41
53
|
const got = await maybeRecordAutoRelease({
|
|
42
54
|
component: req.component,
|
|
43
55
|
env: req.env,
|
|
@@ -45,7 +57,7 @@ export function gitOpWaveReleasePort(opts = {}) {
|
|
|
45
57
|
runId,
|
|
46
58
|
...(runOrigin ? { runOrigin } : {}),
|
|
47
59
|
...(req.approver ? { approver: req.approver } : {}),
|
|
48
|
-
...(joined ? { releaseDigest: joined.releaseDigest, templatesDigest: joined.templatesDigest } : {}),
|
|
60
|
+
...(joined ? { releaseDigest: joined.releaseDigest, ...(joined.templatesDigest ? { templatesDigest: joined.templatesDigest } : {}) } : {}),
|
|
49
61
|
appliedDigest: { digest: req.planDigest, kind: "plan" },
|
|
50
62
|
}, { ...(opts.cwd ? { cwd: opts.cwd } : {}), ...(req.gitSha ? { gitSha: req.gitSha } : {}), ...(opts.actor ? { actor: opts.actor } : {}) });
|
|
51
63
|
if (got.recorded) {
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
*/
|
|
31
31
|
import type { OpWave, OpWaveRun, OpWavesSpec } from "./op-waves.js";
|
|
32
32
|
import type { Release, ReleaseCut } from "../lifecycle/release-store.js";
|
|
33
|
+
import type { WaveRisk } from "../lifecycle/release-risk.js";
|
|
33
34
|
/** The first chant whose op-wave applies write release records (#4615). */
|
|
34
35
|
export declare const OP_WAVE_RELEASE_RECORD_FLOOR = "0.124.55";
|
|
35
36
|
/** Where an op-wave apply's release record goes (#4615), and under which names. */
|
|
@@ -50,6 +51,12 @@ export interface OpWaveReleaseRequest {
|
|
|
50
51
|
gitSha?: string;
|
|
51
52
|
/** Who approved the wave, when a person did. */
|
|
52
53
|
approver?: string;
|
|
54
|
+
/**
|
|
55
|
+
* The wave's change risk under `holds.risk` (#5387): written once per wave
|
|
56
|
+
* beside the release records, for `chant release cut` to bind to the
|
|
57
|
+
* release cut from `gitSha`.
|
|
58
|
+
*/
|
|
59
|
+
risk?: WaveRisk;
|
|
53
60
|
}
|
|
54
61
|
/** How one record came out. */
|
|
55
62
|
export type OpWaveReleaseOutcome = {
|
|
@@ -66,7 +73,15 @@ export type OpWaveReleaseOutcome = {
|
|
|
66
73
|
/** Where an op wave job's release records go (#4615). */
|
|
67
74
|
export interface OpWaveReleasePort {
|
|
68
75
|
record(requests: readonly OpWaveReleaseRequest[]): Promise<OpWaveReleaseOutcome[]>;
|
|
76
|
+
/**
|
|
77
|
+
* Write the change risk the requests carry (#5387), once per wave and
|
|
78
|
+
* commit, before their release records, whose push carries it. Absent: no
|
|
79
|
+
* risk is written. Throws when it cannot be written.
|
|
80
|
+
*/
|
|
81
|
+
recordRisk?(requests: readonly OpWaveReleaseRequest[]): Promise<void>;
|
|
69
82
|
}
|
|
83
|
+
/** The wave scores a batch of release requests carries, one per spec, wave and commit (#5387). */
|
|
84
|
+
export declare function opWaveRiskLines(requests: readonly OpWaveReleaseRequest[], timestamp: string): import("../lifecycle/release-risk.js").WaveRiskLine[];
|
|
70
85
|
/** What is wrong with a spec's or a run's `release`, empty when nothing is. */
|
|
71
86
|
export declare function opWaveReleaseProblems(spec: Pick<OpWavesSpec, "release" | "waves">): string[];
|
|
72
87
|
/**
|
|
@@ -30,6 +30,21 @@
|
|
|
30
30
|
*/
|
|
31
31
|
/** The first chant whose op-wave applies write release records (#4615). */
|
|
32
32
|
export const OP_WAVE_RELEASE_RECORD_FLOOR = "0.124.55";
|
|
33
|
+
/** The wave scores a batch of release requests carries, one per spec, wave and commit (#5387). */
|
|
34
|
+
export function opWaveRiskLines(requests, timestamp) {
|
|
35
|
+
const seen = new Set();
|
|
36
|
+
const out = [];
|
|
37
|
+
for (const req of requests) {
|
|
38
|
+
if (!req.risk || !req.gitSha)
|
|
39
|
+
continue;
|
|
40
|
+
const key = JSON.stringify([req.gitSha, req.risk.op, req.risk.wave]);
|
|
41
|
+
if (seen.has(key))
|
|
42
|
+
continue;
|
|
43
|
+
seen.add(key);
|
|
44
|
+
out.push({ version: 1, commit: req.gitSha, timestamp, ...req.risk });
|
|
45
|
+
}
|
|
46
|
+
return out;
|
|
47
|
+
}
|
|
33
48
|
/** What is wrong with a spec's or a run's `release`, empty when nothing is. */
|
|
34
49
|
export function opWaveReleaseProblems(spec) {
|
|
35
50
|
const problems = [];
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
* question is answered, `chant run resume --op <name>` starts the job again
|
|
49
49
|
* (`pointGateResumable`, #3835).
|
|
50
50
|
*/
|
|
51
|
+
import { type OpWaveSoakOptions } from "./op-waves-soak.js";
|
|
51
52
|
import { type OpWavePhase } from "./op-waves-split.js";
|
|
52
53
|
import type { ResolvedGatePolicySource } from "../policy-source.js";
|
|
53
54
|
import { type WaveMember } from "../wave-engine.js";
|
|
@@ -65,6 +66,7 @@ import { type OpWaveAfterPlanHook, type OpWaveAnswerApproval } from "./op-waves-
|
|
|
65
66
|
import { type OtlpExporter } from "../otlp.js";
|
|
66
67
|
import { type RunEventSink } from "../run-event-stream.js";
|
|
67
68
|
import type { ChangeSetDocument, ChangeSetPart } from "../change-set.js";
|
|
69
|
+
import { type ChangeRisk } from "../change-risk.js";
|
|
68
70
|
import type { CapabilityRegistry } from "../components/capability.js";
|
|
69
71
|
import type { RunEventResource } from "../run-event.js";
|
|
70
72
|
import { type OpWaveReleasePort, type OpWaveReleaseRequest } from "./op-waves-release.js";
|
|
@@ -73,7 +75,7 @@ import type { LockLiveness } from "../lifecycle/resource-lock.js";
|
|
|
73
75
|
import type { GatePolicyExec } from "../gate-policy.js";
|
|
74
76
|
import { type OpWaveNewerCommitPort } from "./op-waves-stand-down.js";
|
|
75
77
|
import { type OpWaveHolds, type OpWaveStepPlan } from "./op-waves-capability.js";
|
|
76
|
-
import { type
|
|
78
|
+
import { type GateQuorumNode, type GateQuorumRuleProgress } from "./gate-quorum.js";
|
|
77
79
|
import { type GateApprovalSource, type OpWaveApplyHooksRunner, type OpWaveGatePolicy, type OpWaveHook, type OpWaveHookMoment, type OpWavePoint, type OpWavesInvolved, type OpWavesSpec } from "./op-waves.js";
|
|
78
80
|
import { OP_WAVE_PENDING_RESERVED, opWaveArgv, runStageHooks, runStageHooksAsync, spawnExecAsync, type OpWaveAsyncExec, type OpWaveExec, type OpWaveHoldFinished, type OpWaveHoldRequest, type OpWaveHookOutcome, type OpWaveHookRun, type OpWaveInProcessHook, type OpWaveInProcessHookCall, type RunStageHooksAsyncOptions, type RunStageHooksOptions, type StageHooksRun } from "./stage-hooks.js";
|
|
79
81
|
export { OP_WAVE_PENDING_RESERVED, opWaveArgv, runStageHooks, runStageHooksAsync, spawnExecAsync };
|
|
@@ -243,6 +245,10 @@ export interface OpWaveDecision {
|
|
|
243
245
|
question?: WaitingPoint;
|
|
244
246
|
answer?: GateAnswerRef;
|
|
245
247
|
};
|
|
248
|
+
/** The wave's failure tolerance at base (#5324), which the applying job reads from the decision. */
|
|
249
|
+
failureTolerance?: number | `${number}%`;
|
|
250
|
+
/** `replanDependents` at base (#5345): the members whose dependents the job plans again once the wave applied. */
|
|
251
|
+
replanDependents?: string[];
|
|
246
252
|
/** The review that approved the wave, or why the review did not, under `pr-review`. */
|
|
247
253
|
review?: {
|
|
248
254
|
pr?: number;
|
|
@@ -252,7 +258,7 @@ export interface OpWaveDecision {
|
|
|
252
258
|
reason?: string;
|
|
253
259
|
};
|
|
254
260
|
/** The approval rules at base the wave's targets take (#4290). Absent when it takes none. */
|
|
255
|
-
quorum?:
|
|
261
|
+
quorum?: GateQuorumNode[];
|
|
256
262
|
/** The op whose ledger holds the product's own reviews, read at base (#4333). */
|
|
257
263
|
reviewLedger?: string;
|
|
258
264
|
/** Who else counts as involved in the change, read at base (#4333). */
|
|
@@ -265,6 +271,8 @@ export interface OpWaveDecision {
|
|
|
265
271
|
hooks?: Partial<Record<OpWaveHookMoment, OpWaveHook[]>>;
|
|
266
272
|
/** The `onFailure: approve` hooks that failed: the wave needs an approval whatever its policy (#3762). */
|
|
267
273
|
heldBy?: string[];
|
|
274
|
+
/** The wave's change risk under `holds.risk` (#5325): the score, its level and each reason with its weight. */
|
|
275
|
+
risk?: ChangeRisk;
|
|
268
276
|
/**
|
|
269
277
|
* Spent approvals (#3784). `base`: the spec at base sets `approvals.spend`,
|
|
270
278
|
* so a spent approval counts for nothing and the approval this wave applies
|
|
@@ -581,7 +589,7 @@ export interface OpWaveBaseRules {
|
|
|
581
589
|
/** Set when the point at base cannot be asked: the wave fails rather than fall back to the ledger (#3836). */
|
|
582
590
|
pointRefused?: string;
|
|
583
591
|
/** The approval rules at base (#4290), `approvals.quorum`. */
|
|
584
|
-
quorum?:
|
|
592
|
+
quorum?: GateQuorumNode[];
|
|
585
593
|
/** Set when the rules at base cannot be read: the wave fails rather than wait on fewer approvers than they ask. */
|
|
586
594
|
quorumRefused?: string;
|
|
587
595
|
/** `approvals.reviewLedger` at base (#4333): the op whose ledger holds a product's own reviews. */
|
|
@@ -600,6 +608,10 @@ export interface OpWaveBaseRules {
|
|
|
600
608
|
evidenceRequires?: string[];
|
|
601
609
|
/** Set when `evidence` at base cannot be read: the wave fails rather than apply without the checks it asks for. */
|
|
602
610
|
evidenceRefused?: string;
|
|
611
|
+
/** The wave's `failureTolerance` at base (#5324): the failed runs it lets through. Absent at base, none. */
|
|
612
|
+
failureTolerance?: number | `${number}%`;
|
|
613
|
+
/** `replanDependents` at base (#5345): the members whose dependents the job plans again once the wave applied. */
|
|
614
|
+
replanDependents?: string[];
|
|
603
615
|
}
|
|
604
616
|
/**
|
|
605
617
|
* The policy of wave `name`, as the spec file at `base` declares it. The
|
|
@@ -609,6 +621,14 @@ export interface OpWaveBaseRules {
|
|
|
609
621
|
* own apply runs; the file or the wave missing there has none.
|
|
610
622
|
*/
|
|
611
623
|
export declare function readOpWavePolicy(specFile: string, name: string, base: string, cwd: string, show?: OpWaveShowAtBase): OpWaveBaseRules;
|
|
624
|
+
/**
|
|
625
|
+
* The first chant whose approval rules take `proven` (#5349), a rule's
|
|
626
|
+
* `count` met by proven approvers only, and whose generator warns about a
|
|
627
|
+
* count above 1 that plain `chant approve` lines can meet and about a rule
|
|
628
|
+
* that needs proof where the signers file names nobody and no review mode
|
|
629
|
+
* applies (`opWavesQuorumFindings`, `UNPROVABLE_QUORUM_REFUSED`).
|
|
630
|
+
*/
|
|
631
|
+
export declare const PROVEN_APPROVERS_FLOOR = "0.124.110";
|
|
612
632
|
/** The first chant whose Op waves spec takes `approvals.preview`: a merged wave applies the plans its pull request previewed, or exits 4. */
|
|
613
633
|
export declare const OP_WAVES_PREVIEW_FLOOR = "0.124.59";
|
|
614
634
|
/** The first chant whose op entry exports {@link opWavePlanPath} (terragucci#1304). */
|
|
@@ -704,6 +724,18 @@ export interface RunOpWaveOptions {
|
|
|
704
724
|
* `runs` defaults; `false` writes none. See `./op-waves-release.ts`.
|
|
705
725
|
*/
|
|
706
726
|
releases?: OpWaveReleasePort | false;
|
|
727
|
+
/**
|
|
728
|
+
* The replan step (#5345), run once a wave applied when `replanDependents`
|
|
729
|
+
* at base names a run it applied. Answers the line the job logs. Default
|
|
730
|
+
* `replanStep` (`../cli/handlers/replan.ts`), which runs `chant components
|
|
731
|
+
* replan` in the job's process.
|
|
732
|
+
*/
|
|
733
|
+
replan?: (input: {
|
|
734
|
+
cwd: string;
|
|
735
|
+
env: string;
|
|
736
|
+
components: string[];
|
|
737
|
+
replanDependents: string[];
|
|
738
|
+
}) => Promise<string>;
|
|
707
739
|
/**
|
|
708
740
|
* The capabilities a spec's `step` plans and applies through (#4545).
|
|
709
741
|
* Default: the project's at `cwd`, as `chant run --components` builds it.
|
|
@@ -791,6 +823,8 @@ export interface RunOpWaveOptions {
|
|
|
791
823
|
* again. See {@link OpWaveInProcessHook}.
|
|
792
824
|
*/
|
|
793
825
|
inProcessHooks?: Readonly<Record<string, OpWaveInProcessHook>>;
|
|
826
|
+
/** The seams of the soak of the wave before this one (#5326): its check reader, what it applied, and the time. Default: the job's own. */
|
|
827
|
+
soak?: OpWaveSoakOptions;
|
|
794
828
|
}
|
|
795
829
|
/** Where an op wave job's run record goes (#4551). */
|
|
796
830
|
export interface OpWaveRunPort {
|