@intentius/chant 0.124.51 → 0.124.52

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.
Files changed (37) hide show
  1. package/dist/cli/handlers/pr.d.ts.map +1 -1
  2. package/dist/cli/handlers/pr.js +2 -1
  3. package/dist/components/capability.d.ts +9 -0
  4. package/dist/components/capability.d.ts.map +1 -1
  5. package/dist/components/covered-round.d.ts +173 -0
  6. package/dist/components/covered-round.d.ts.map +1 -0
  7. package/dist/components/covered-round.js +200 -0
  8. package/dist/components/driver.d.ts +8 -0
  9. package/dist/components/driver.d.ts.map +1 -1
  10. package/dist/components/driver.js +8 -0
  11. package/dist/components/index.d.ts +1 -0
  12. package/dist/components/index.d.ts.map +1 -1
  13. package/dist/components/index.js +1 -0
  14. package/dist/components/pr-run.d.ts +21 -3
  15. package/dist/components/pr-run.d.ts.map +1 -1
  16. package/dist/components/pr-run.js +147 -16
  17. package/dist/components/wave-plan.d.ts +2 -0
  18. package/dist/components/wave-plan.d.ts.map +1 -1
  19. package/dist/components/wave-plan.js +4 -1
  20. package/dist/pr-loop.d.ts +36 -2
  21. package/dist/pr-loop.d.ts.map +1 -1
  22. package/dist/pr-loop.js +11 -2
  23. package/dist/wave-runtime.mjs +3 -3
  24. package/dist/workspace/pr-report.schema.json +25 -1
  25. package/package.json +1 -1
  26. package/src/cli/handlers/pr.ts +2 -1
  27. package/src/components/capability.ts +9 -0
  28. package/src/components/covered-round.test.ts +166 -0
  29. package/src/components/covered-round.ts +293 -0
  30. package/src/components/driver.ts +12 -0
  31. package/src/components/index.ts +17 -0
  32. package/src/components/pr-run.test.ts +212 -1
  33. package/src/components/pr-run.ts +166 -16
  34. package/src/components/wave-plan.ts +5 -2
  35. package/src/pr-loop.test.ts +14 -1
  36. package/src/pr-loop.ts +43 -4
  37. package/src/workspace/pr-report.schema.json +25 -1
@@ -1 +1 @@
1
- {"version":3,"file":"pr.d.ts","sourceRoot":"","sources":["../../../src/cli/handl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AAE,MAAM,CAAC,GAC3B,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAW7B;AAyBD;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,EAAE,UAAU,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAO3J;AA+ED,qFAAqF;AACrF,wBAAgB,OAAO,CAAC,CAAC,EAAE,QAAQ,EAAE,UAAU,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,SAAS,CAAC,CAElF;AAED,wBAAgB,QAAQ,CAAC,CAAC,EAAE,QAAQ,EAAE,UAAU,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,SAAS,CAAC,CASnF;AA0ND,mKAAmK;AACnK,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAGxE;AA8GD,yLAAyL;AACzL,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAYzE;AAmYD,uKAAuK;AACvK,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAG1E;AAy3BD;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA+B9E"}
@@ -956,6 +956,7 @@ async function prApply(ctx, stage, beforeMerge) {
956
956
  env: p.env,
957
957
  set,
958
958
  gate: p.gate,
959
+ approval,
959
960
  decideRound,
960
961
  ...(resumed ? { resumed: prior } : {}),
961
962
  // The apply is this run's waves, so the fan-out's own run framing is
@@ -1870,7 +1871,7 @@ async function prApplyWaves(ctx, p, at) {
1870
1871
  planFailedIn ?? (planFailedIn = k);
1871
1872
  continue;
1872
1873
  }
1873
- const moved = waveNotCovered(approvedSet.doc, fresh.doc, approvedSet.members);
1874
+ const moved = waveNotCovered(approvedSet.doc, fresh.doc, approvedSet.members, { approved: approvedSet.shapes, fresh: fresh.shapes });
1874
1875
  set = fresh;
1875
1876
  if (moved.length === 0) {
1876
1877
  console.error(formatInfo(`wave ${k}: the approved plan covers what it plans now, so it applies under the pull request's approval`));
@@ -11,6 +11,7 @@
11
11
  * live under `./verbs/*` as typed stubs — no cloud calls, no side effects.
12
12
  * Cloud implementations are a later phase (see epic #551, issue #554).
13
13
  */
14
+ import type { PlanShape } from "./covered-round.js";
14
15
  import type { ReleaseIdentity } from "../telemetry-attribution.js";
15
16
  import type { ChangeSetPart } from "../change-set.js";
16
17
  /**
@@ -114,6 +115,14 @@ export interface CapabilityPlan {
114
115
  * targeted plan covers that plan and no other.
115
116
  */
116
117
  targets?: string[];
118
+ /**
119
+ * What the plan does, without values (#4419): the resources it touches,
120
+ * their actions and replacement, and the inputs it was made without. A
121
+ * pull request's apply compares the shape of a plan made after an upstream
122
+ * applied with this one (`coveredRound`) to decide whether the first
123
+ * approval covers it. Absent, core derives the shape from `changeSet`.
124
+ */
125
+ shape?: PlanShape;
117
126
  }
118
127
  /**
119
128
  * What a plan says about the outputs its apply will leave (#3999). An
@@ -1 +1 @@
1
- {"version":3,"file":"capability.d.ts","sourceRoot":"","sources":["../../src/components/capability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC5B,+DAA+D;IAC/D,GAAG,EAAE,MAAM,CAAC;IACZ,mEAAmE;IACnE,SAAS,EAAE,MAAM,CAAC;IAClB,qGAAqG;IACrG,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE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qD;IACrD,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEzB;IAED,oCAAoC;IACpC,KAAK,IAAI,MAAM,EAAE,CAEhB;CACF;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,KAAK,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAatH"}
@@ -0,0 +1,173 @@
1
+ /**
2
+ * Covered rounds (#4419): a round planned after an upstream applied is
3
+ * covered by the pull request's first approval when it does only what that
4
+ * approval previewed.
5
+ *
6
+ * A member that reads an output an upstream in the same change has not
7
+ * created yet is previewed with a hole: the input is marked unknown
8
+ * (`PrMember.unknownInputs`). Once the upstream applied, the apply plans the
9
+ * member again with the real value. That fresh plan is covered when
10
+ *
11
+ * - it touches only components the first plan previewed,
12
+ * - within each, only the logical ids and actions previewed (and no
13
+ * replacement the preview did not show), and
14
+ * - the only inputs that differ are the ones the preview marked unknown.
15
+ *
16
+ * A lexicon that can say more than the change set's entries (CloudFormation
17
+ * previews the member with placeholder parameters and reads the real change
18
+ * set afterwards) supplies a {@link PlanShape} on its `CapabilityPlan`.
19
+ * Core decides coverage; the lexicon only reports what it planned.
20
+ *
21
+ * A shape may go below the entry, to the properties a change touches and the
22
+ * ones an unknown input drives. Where it does, a property may drop out when
23
+ * an unknown input drives it (the real value turned out equal to the current
24
+ * one), and never otherwise, and a property may never be added.
25
+ *
26
+ * Coverage binds to the digest of the first approval. {@link coveredRound}
27
+ * takes that digest and records it, so a round planned for a different
28
+ * composition never counts as covered by an approval of another one.
29
+ */
30
+ import type { ChangeSetAction, ChangeSetDocument } from "../change-set.js";
31
+ /** CloudFormation's `Replacement`, in lower case. */
32
+ export type ShapeReplacement = "true" | "false" | "conditional";
33
+ /** One resource a plan touches. */
34
+ export interface PlanShapeEntry {
35
+ /** The resource's id in the lexicon's own terms: a CloudFormation logical id, a Terraform address. */
36
+ logicalId: string;
37
+ action: ChangeSetAction;
38
+ /**
39
+ * Whether the change replaces the resource, for an `update` or `replace`.
40
+ * `conditional` is the preview not knowing, because a parameter it
41
+ * depends on was a placeholder. Absent means the lexicon does not say.
42
+ */
43
+ replacement?: ShapeReplacement;
44
+ /** The resource's type, when the lexicon says. Compared for equality when both sides carry it. */
45
+ type?: string;
46
+ /**
47
+ * The properties the change touches, when the lexicon lists them. Present
48
+ * on both sides, the fresh plan may touch fewer where an unknown input
49
+ * drives them, and never more.
50
+ */
51
+ properties?: string[];
52
+ /**
53
+ * The properties an unknown input drives. On an update a subset of
54
+ * `properties`; on a create, where a planner cannot list properties, they
55
+ * stand alone. Present (even empty) on an entry that carries detail.
56
+ */
57
+ unknown?: string[];
58
+ }
59
+ /** What one member's plan does, without the values: what a lexicon supplies and core compares. */
60
+ export interface PlanShape {
61
+ /** The member the shape is of, as in the change set. */
62
+ member: string;
63
+ /** Every resource the plan touches. A `no-op` or `read` entry may be left out. */
64
+ entries: PlanShapeEntry[];
65
+ /**
66
+ * The inputs the plan was made without, as `<component>.<output>`: the
67
+ * ones the preview marked unknown. A fresh plan lists none of them; it
68
+ * is the inputs that were filled in that are recorded.
69
+ */
70
+ unknownInputs: string[];
71
+ /**
72
+ * The inputs the plan read with a value, by reference. When both shapes
73
+ * carry a reference, the values must be equal, or an input that was
74
+ * known has changed. Optional: a shape without it is checked on its
75
+ * entries alone, plus the change set's own attributes in core.
76
+ */
77
+ knownInputs?: Record<string, unknown>;
78
+ }
79
+ /**
80
+ * Every way `fresh` goes beyond `previewed`, as reasons; none means covered.
81
+ * Both are shapes of the same member.
82
+ *
83
+ * The fresh plan may match the preview exactly, or be narrower where an
84
+ * unknown input drives it: a property whose real value equals the current one
85
+ * drops out, a replacement that depended on a stand-in may not happen. It
86
+ * may never add a resource, add a property, change an action or a type,
87
+ * replace more than previewed, read an input that is still unknown, or read a
88
+ * known input as another value.
89
+ */
90
+ export declare function planShapeDifferences(previewed: PlanShape, fresh: PlanShape): string[];
91
+ /**
92
+ * Why `fresh` is not covered by `previewed`, or `undefined` when it is: the
93
+ * first of {@link planShapeDifferences}.
94
+ */
95
+ export declare function planShapeCovers(previewed: PlanShape, fresh: PlanShape): string | undefined;
96
+ /** A shape in the order that makes equal shapes digest equal. */
97
+ export declare function normalizePlanShape(shape: PlanShape): PlanShape;
98
+ export declare function planShapeDigest(shape: PlanShape): string;
99
+ /**
100
+ * What a lexicon hands the run for a previewed member, through
101
+ * `DeployContext.plans[member]`. `kind` is the lexicon's own so its `run`
102
+ * can tell a shape from its other artifacts.
103
+ */
104
+ export interface PlanShapeArtifact {
105
+ kind: string;
106
+ member: string;
107
+ shape: PlanShape;
108
+ digest: string;
109
+ }
110
+ /**
111
+ * Thrown by a member's `run` when the change it created is not covered by the
112
+ * shape previewed. The change set is deleted unexecuted. `planMoved` is
113
+ * core's mark for a moved plan, so the command that applied it exits 3.
114
+ */
115
+ export declare class PlanShapeMovedError extends Error {
116
+ readonly member: string;
117
+ readonly differences: string[];
118
+ readonly planMoved = true;
119
+ constructor(member: string, differences: string[]);
120
+ }
121
+ /** The shape a change-set document gives for `member`, when its lexicon supplies none. */
122
+ export declare function shapeFromChangeSet(doc: ChangeSetDocument, member: string, inputs?: {
123
+ unknownInputs?: string[];
124
+ knownInputs?: Record<string, unknown>;
125
+ }): PlanShape;
126
+ /** What a round was covered by, as the report records it (`PrRound.covered`). */
127
+ export interface RoundCover {
128
+ /** The digest of the first approval, which the coverage is bound to. */
129
+ digest: string;
130
+ /** The inputs the first plan marked unknown and this round planned with a value, `<component>.<output>`, sorted. */
131
+ filledInputs: string[];
132
+ }
133
+ export type RoundCoverage = ({
134
+ covered: true;
135
+ } & RoundCover) | {
136
+ covered: false;
137
+ reason: string;
138
+ };
139
+ /** One side of the comparison: a plan set, as far as coverage needs it. */
140
+ export interface CoverageSide {
141
+ doc: ChangeSetDocument;
142
+ /** Per member, its component and (first plan only) the inputs it was previewed without. */
143
+ members: {
144
+ member: string;
145
+ component: string;
146
+ unknownInputs?: string[];
147
+ }[];
148
+ /** Shapes a lexicon supplied, by member. Where absent, the change set gives the shape. */
149
+ shapes?: Record<string, PlanShape>;
150
+ }
151
+ export interface CoveredRoundInput {
152
+ /** The first plan, whose approval is being relied on. */
153
+ approved: CoverageSide;
154
+ /** The digest that approval binds: the report's `digest`. */
155
+ approvedDigest: string;
156
+ /** The round's fresh plan. */
157
+ fresh: CoverageSide;
158
+ /**
159
+ * Known inputs that changed between the first plan and the round, as
160
+ * `<component>.<output>`: an input the first plan read with a value that
161
+ * stands as another one now. Core reads them from the outputs.
162
+ */
163
+ changedKnown?: ReadonlyMap<string, string[]> | Record<string, string[]>;
164
+ /** The check on the change set's own attributes, per member (`planCoveredBy`). */
165
+ attributes?: (member: string) => string | undefined;
166
+ }
167
+ /**
168
+ * Whether the approval of `approvedDigest` covers `fresh`. Covered, the
169
+ * result names the digest and the inputs that were filled in; not covered,
170
+ * the reason, which the apply reports with the approval it asks for.
171
+ */
172
+ export declare function coveredRound(input: CoveredRoundInput): RoundCoverage;
173
+ //# sourceMappingURL=covered-round.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"covered-round.d.ts","sourceRoot":"","sources":["../../src/components/covered-round.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAGxE,qDAAqD;AACrD,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,OAAO,GAAG,aAAa,CAAC;AAEhE,mCAAmC;AACnC,MAAM,WAAW,cAAc;IAC7B,sGAAsG;IACtG,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,eAAe,CAAC;IACxB;;;;OAIG;IACH,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,kGAAkG;IAClG,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,UAAU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1
+ /**
2
+ * Covered rounds (#4419): a round planned after an upstream applied is
3
+ * covered by the pull request's first approval when it does only what that
4
+ * approval previewed.
5
+ *
6
+ * A member that reads an output an upstream in the same change has not
7
+ * created yet is previewed with a hole: the input is marked unknown
8
+ * (`PrMember.unknownInputs`). Once the upstream applied, the apply plans the
9
+ * member again with the real value. That fresh plan is covered when
10
+ *
11
+ * - it touches only components the first plan previewed,
12
+ * - within each, only the logical ids and actions previewed (and no
13
+ * replacement the preview did not show), and
14
+ * - the only inputs that differ are the ones the preview marked unknown.
15
+ *
16
+ * A lexicon that can say more than the change set's entries (CloudFormation
17
+ * previews the member with placeholder parameters and reads the real change
18
+ * set afterwards) supplies a {@link PlanShape} on its `CapabilityPlan`.
19
+ * Core decides coverage; the lexicon only reports what it planned.
20
+ *
21
+ * A shape may go below the entry, to the properties a change touches and the
22
+ * ones an unknown input drives. Where it does, a property may drop out when
23
+ * an unknown input drives it (the real value turned out equal to the current
24
+ * one), and never otherwise, and a property may never be added.
25
+ *
26
+ * Coverage binds to the digest of the first approval. {@link coveredRound}
27
+ * takes that digest and records it, so a round planned for a different
28
+ * composition never counts as covered by an approval of another one.
29
+ */
30
+ import { computePlanDigest } from "../lifecycle/plan-digest.js";
31
+ const SKIPPED = new Set(["no-op", "read"]);
32
+ const REPLACEMENT_RANK = { false: 0, conditional: 1, true: 2 };
33
+ /** An entry with property detail is compared whatever its action: a lexicon that lists properties means it. */
34
+ const skipped = (e) => SKIPPED.has(e.action) && e.properties === undefined;
35
+ /**
36
+ * Every way `fresh` goes beyond `previewed`, as reasons; none means covered.
37
+ * Both are shapes of the same member.
38
+ *
39
+ * The fresh plan may match the preview exactly, or be narrower where an
40
+ * unknown input drives it: a property whose real value equals the current one
41
+ * drops out, a replacement that depended on a stand-in may not happen. It
42
+ * may never add a resource, add a property, change an action or a type,
43
+ * replace more than previewed, read an input that is still unknown, or read a
44
+ * known input as another value.
45
+ */
46
+ export function planShapeDifferences(previewed, fresh) {
47
+ const member = fresh.member;
48
+ const out = [];
49
+ const was = new Map(previewed.entries.map((e) => [e.logicalId, e]));
50
+ const now = new Set();
51
+ for (const e of fresh.entries) {
52
+ if (skipped(e))
53
+ continue;
54
+ now.add(e.logicalId);
55
+ const p = was.get(e.logicalId);
56
+ if (!p) {
57
+ out.push(`${member} now plans to ${e.action} ${e.logicalId}, which the first plan did not`);
58
+ continue;
59
+ }
60
+ if (p.action !== e.action)
61
+ out.push(`${member} now plans to ${e.action} ${e.logicalId}, where the first plan showed ${p.action}`);
62
+ if (p.type !== undefined && e.type !== undefined && p.type !== e.type)
63
+ out.push(`${member} now has ${e.logicalId} as ${e.type}, where the first plan showed ${p.type}`);
64
+ if (p.properties && e.properties) {
65
+ const extra = e.properties.filter((x) => !p.properties.includes(x));
66
+ if (extra.length > 0)
67
+ out.push(`${member} now also changes ${extra.join(", ")} on ${e.logicalId}`);
68
+ const driven = p.unknown ?? [];
69
+ const lost = p.properties.filter((x) => !driven.includes(x) && !e.properties.includes(x));
70
+ if (lost.length > 0)
71
+ out.push(`${member} no longer changes ${lost.join(", ")} on ${e.logicalId}, which no unknown input drives`);
72
+ }
73
+ if (e.replacement === "true" && p.replacement !== "true" && p.replacement !== "conditional") {
74
+ out.push(`${member} now replaces ${e.logicalId}, which the first plan did not show`);
75
+ }
76
+ else if (e.replacement === "conditional" && p.replacement !== "conditional" && p.replacement !== "true") {
77
+ out.push(`${member} may now replace ${e.logicalId}, which the first plan did not show`);
78
+ }
79
+ else if (e.replacement && p.replacement && p.unknown?.length === 0 && REPLACEMENT_RANK[e.replacement] < REPLACEMENT_RANK[p.replacement]) {
80
+ out.push(`${member} replacement of ${e.logicalId} was ${p.replacement}, now ${e.replacement}, and no unknown input drives it`);
81
+ }
82
+ }
83
+ // A previewed change that is gone: allowed only where unknown inputs drive all of it.
84
+ for (const p of previewed.entries) {
85
+ if (now.has(p.logicalId) || skipped(p) || !p.properties)
86
+ continue;
87
+ const driven = p.unknown ?? [];
88
+ if (!(p.properties.length > 0 && p.properties.every((x) => driven.includes(x)))) {
89
+ out.push(`${member} no longer plans to ${p.action} ${p.logicalId}, which the first plan did and no unknown input drives`);
90
+ }
91
+ }
92
+ const unknown = new Set(previewed.unknownInputs);
93
+ const stillUnknown = fresh.unknownInputs[0];
94
+ if (stillUnknown)
95
+ out.push(`${member} still reads ${stillUnknown}, which is not known yet`);
96
+ for (const [ref, value] of Object.entries(fresh.knownInputs ?? {})) {
97
+ if (unknown.has(ref))
98
+ continue;
99
+ if (!previewed.knownInputs)
100
+ continue;
101
+ if (!(ref in previewed.knownInputs))
102
+ out.push(`${member} now reads ${ref}, which the first plan did not`);
103
+ else if (JSON.stringify(previewed.knownInputs[ref] ?? null) !== JSON.stringify(value ?? null)) {
104
+ out.push(`${member} now reads ${ref} as a different value than the first plan`);
105
+ }
106
+ }
107
+ return out;
108
+ }
109
+ /**
110
+ * Why `fresh` is not covered by `previewed`, or `undefined` when it is: the
111
+ * first of {@link planShapeDifferences}.
112
+ */
113
+ export function planShapeCovers(previewed, fresh) {
114
+ return planShapeDifferences(previewed, fresh)[0];
115
+ }
116
+ /** A shape in the order that makes equal shapes digest equal. */
117
+ export function normalizePlanShape(shape) {
118
+ const sorted = (xs) => [...new Set(xs)].sort();
119
+ return {
120
+ member: shape.member,
121
+ entries: shape.entries
122
+ .map((e) => ({
123
+ logicalId: e.logicalId,
124
+ action: e.action,
125
+ ...(e.replacement ? { replacement: e.replacement } : {}),
126
+ ...(e.type !== undefined ? { type: e.type } : {}),
127
+ ...(e.properties ? { properties: sorted(e.properties) } : {}),
128
+ ...(e.unknown ? { unknown: sorted(e.unknown) } : {}),
129
+ }))
130
+ .sort((a, b) => a.logicalId.localeCompare(b.logicalId) || a.action.localeCompare(b.action)),
131
+ unknownInputs: sorted(shape.unknownInputs),
132
+ ...(shape.knownInputs ? { knownInputs: shape.knownInputs } : {}),
133
+ };
134
+ }
135
+ export function planShapeDigest(shape) {
136
+ return computePlanDigest("plan-shape", normalizePlanShape(shape));
137
+ }
138
+ /**
139
+ * Thrown by a member's `run` when the change it created is not covered by the
140
+ * shape previewed. The change set is deleted unexecuted. `planMoved` is
141
+ * core's mark for a moved plan, so the command that applied it exits 3.
142
+ */
143
+ export class PlanShapeMovedError extends Error {
144
+ constructor(member, differences) {
145
+ super(`"${member}": refusing to apply. The change differs from the preview that was approved: ${differences.join("; ")}. Plan it again.`);
146
+ this.member = member;
147
+ this.differences = differences;
148
+ this.planMoved = true;
149
+ this.name = "PlanShapeMovedError";
150
+ }
151
+ }
152
+ /** The shape a change-set document gives for `member`, when its lexicon supplies none. */
153
+ export function shapeFromChangeSet(doc, member, inputs = {}) {
154
+ return {
155
+ member,
156
+ entries: doc.entries
157
+ .filter((e) => e.member === member)
158
+ .map((e) => ({ logicalId: e.deposed ? `${e.address}#${e.deposed}` : e.address, action: e.action })),
159
+ unknownInputs: [...(inputs.unknownInputs ?? [])].sort(),
160
+ ...(inputs.knownInputs ? { knownInputs: inputs.knownInputs } : {}),
161
+ };
162
+ }
163
+ /**
164
+ * Whether the approval of `approvedDigest` covers `fresh`. Covered, the
165
+ * result names the digest and the inputs that were filled in; not covered,
166
+ * the reason, which the apply reports with the approval it asks for.
167
+ */
168
+ export function coveredRound(input) {
169
+ const { approved, fresh } = input;
170
+ const previewedComponents = new Set(approved.members.map((m) => m.component));
171
+ const approvedMember = new Map(approved.members.map((m) => [m.member, m]));
172
+ const filled = new Set();
173
+ for (const m of fresh.members) {
174
+ if (!previewedComponents.has(m.component))
175
+ return { covered: false, reason: `${m.component} was not in the first plan` };
176
+ const was = approvedMember.get(m.member);
177
+ if (!was)
178
+ return { covered: false, reason: `${m.member} was not in the first plan` };
179
+ if (was.component !== m.component)
180
+ return { covered: false, reason: `${m.member} moved from ${was.component} to ${m.component}` };
181
+ const previewed = approved.shapes?.[m.member] ?? shapeFromChangeSet(approved.doc, m.member, { unknownInputs: was.unknownInputs });
182
+ const both = [...new Set([...(previewed.unknownInputs ?? []), ...(was.unknownInputs ?? [])])];
183
+ // A lexicon that only knows the upstream stack lists the bare component; the member names the output. Keep the named one.
184
+ const unknownInputs = both.filter((ref) => !both.some((other) => other.startsWith(`${ref}.`))).sort();
185
+ const now = fresh.shapes?.[m.member] ?? shapeFromChangeSet(fresh.doc, m.member);
186
+ const reason = planShapeCovers({ ...previewed, unknownInputs }, now);
187
+ if (reason)
188
+ return { covered: false, reason };
189
+ const changed = (input.changedKnown instanceof Map ? input.changedKnown.get(m.component) : input.changedKnown?.[m.component]) ?? [];
190
+ const changedKnown = changed.filter((ref) => !unknownInputs.includes(ref));
191
+ if (changedKnown.length > 0)
192
+ return { covered: false, reason: `${m.member} reads ${changedKnown.join(", ")}, which the first plan read as another value` };
193
+ const attrs = input.attributes?.(m.member);
194
+ if (attrs)
195
+ return { covered: false, reason: attrs };
196
+ for (const ref of unknownInputs)
197
+ filled.add(ref);
198
+ }
199
+ return { covered: true, digest: input.approvedDigest, filledInputs: [...filled].sort() };
200
+ }
@@ -251,6 +251,14 @@ export interface WiringReference {
251
251
  * upstream applies.
252
252
  */
253
253
  export declare function unresolvedWiringReferences(input: Record<string, unknown>, componentOutputs: Record<string, Record<string, unknown>>): WiringReference[];
254
+ /**
255
+ * Every cross-component reference in `input`, sorted by `ref` and each once,
256
+ * with whether `componentOutputs` holds a value for it. A pull request's
257
+ * report records each as a read between components, known at plan or not.
258
+ */
259
+ export declare function wiringReads(input: Record<string, unknown>, componentOutputs: Record<string, Record<string, unknown>>): Array<WiringReference & {
260
+ known: boolean;
261
+ }>;
254
262
  /**
255
263
  * The cross-component references in `input` that resolve to another value
256
264
  * against `now` than against `read`, sorted (#3999). A pull request's apply
@@ -1 +1 @@
1
- {"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../src/components/driver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAIH,OAAO,EAAmC,KAAK,kBAAkB,EAAE,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;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export function unresolvedWiringSources(input, componentOutputs) {
207
207
  export function unresolvedWiringReferences(input, componentOutputs) {
208
208
  return wiringReferences(input).filter((r) => r.value(componentOutputs) === undefined).map(({ source, ref, publish }) => ({ source, ref, publish }));
209
209
  }
210
+ /**
211
+ * Every cross-component reference in `input`, sorted by `ref` and each once,
212
+ * with whether `componentOutputs` holds a value for it. A pull request's
213
+ * report records each as a read between components, known at plan or not.
214
+ */
215
+ export function wiringReads(input, componentOutputs) {
216
+ return wiringReferences(input).map(({ source, ref, publish, value }) => ({ source, ref, publish, known: value(componentOutputs) !== undefined }));
217
+ }
210
218
  /**
211
219
  * Every cross-component reference in `input`, each once, sorted by `ref`,
212
220
  * with the value it resolves to against a given outputs map.
@@ -9,6 +9,7 @@ export { type DiscoveredComponent, type ComponentDiscoveryResult, discoverCompon
9
9
  export { type ListedComponent, type ListComponentsResult, type DescribedComponent, type DescribeComponentResult, type ComponentGraphResult, type GenerateLexicon, type GenerateComponentsResult, type RunComponentsOptions, type RunComponentsResult, type ResolvedComponentTargets, listComponents, describeComponent, computeComponentGraph, generateComponentsPipeline, runComponents, findComponentGate, resolveComponentTargets, } from "./cli-support.js";
10
10
  export { renderDriverHuman, renderDriverJson } from "./driver-output.js";
11
11
  export { type Capability, type CapabilityInput, type CapabilityOutput, type DeployContext, CapabilityRegistry, CapabilityNotImplementedError, } from "./capability.js";
12
+ export { coveredRound, normalizePlanShape, PlanShapeMovedError, planShapeCovers, planShapeDifferences, planShapeDigest, shapeFromChangeSet, type CoveredRoundInput, type CoverageSide, type PlanShape, type PlanShapeArtifact, type PlanShapeEntry, type RoundCover, type RoundCoverage, type ShapeReplacement, } from "./covered-round.js";
12
13
  export { createCapabilityRegistry, STARTER_VERB_FAMILIES } from "./registry.js";
13
14
  export { type CapabilityPlugin, type CapabilityManifest, isCapabilityPlugin, } from "./capability-plugin.js";
14
15
  export { CapabilityManifestSchema, type CapabilityManifestParsed, validateCapabilityManifest, } from "./capability-plugin-schema.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,KAAK,SAAS,EACd,KAAK,MAAM,EACX,KAAK,oBAAoB,EACzB,KAAK,SAAS,EACd,KAAK,IAAI,EACT,KAAK,IAAI,EACT,KAAK,KAAK,EACV,KAAK,SAAS,EACd,KAAK,+BAA+B,EACpC,KAAK,EACL,IAAI,EACJ,WAAW,EACX,cAAc,EACd,aAAa,EACb,WAAW,GACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,kBAAkB,GACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,cAAc,EACd,iBAAiB,EACjB,qBAAqB,EACrB,0BAA0B,EAC1B,aAAa,EACb,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EACL,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,kBAAkB,EAClB,6BAA6B,GAC9B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,wBAAwB,EACxB,KAAK,wBAAwB,EAC7B,0BAA0B,GAC3B,MAAM,4BAA4B,CAAC;AAC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B,eAAe,EACf,KAAK,qBAAqB,EAC1B,0BAA0B,EAC1B,KAAK,gCAAgC,GACtC,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,KAAK,SAAS,EACd,KAAK,MAAM,EACX,KAAK,oBAAoB,EACzB,KAAK,SAAS,EACd,KAAK,IAAI,EACT,KAAK,IAAI,EACT,KAAK,KAAK,EACV,KAAK,SAAS,EACd,KAAK,+BAA+B,EACpC,KAAK,EACL,IAAI,EACJ,WAAW,EACX,cAAc,EACd,aAAa,EACb,WAAW,GACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,kBAAkB,GACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,cAAc,EACd,iBAAiB,EACjB,qBAAqB,EACrB,0BAA0B,EAC1B,aAAa,EACb,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EACL,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,kBAAkB,EAClB,6BAA6B,GAC9B,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,oBAAoB,EACpB,eAAe,EACf,kBAAkB,EAClB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,SAAS,EAC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B,OAAO,EACL,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,SAAS,GACV,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAClB,YAAY,EACZ,cAAc,GACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,mBAAmB,EACnB,KAAK,yBAAyB,EAC9B,eAAe,EACf,KAAK,qBAAqB,EAC1B,0BAA0B,EAC1B,KAAK,gCAAgC,GACtC,MAAM,iBAAiB,CAAC"}
@@ -9,6 +9,7 @@ export { discoverComponents, } from "./discover.js";
9
9
  export { listComponents, describeComponent, computeComponentGraph, generateComponentsPipeline, runComponents, findComponentGate, resolveComponentTargets, } from "./cli-support.js";
10
10
  export { renderDriverHuman, renderDriverJson } from "./driver-output.js";
11
11
  export { CapabilityRegistry, CapabilityNotImplementedError, } from "./capability.js";
12
+ export { coveredRound, normalizePlanShape, PlanShapeMovedError, planShapeCovers, planShapeDifferences, planShapeDigest, shapeFromChangeSet, } from "./covered-round.js";
12
13
  export { createCapabilityRegistry, STARTER_VERB_FAMILIES } from "./registry.js";
13
14
  export { isCapabilityPlugin, } from "./capability-plugin.js";
14
15
  export { CapabilityManifestSchema, validateCapabilityManifest, } from "./capability-plugin-schema.js";
@@ -23,8 +23,9 @@
23
23
  * component in the project and not the selection.
24
24
  * - the upstream is in the change and its plan cannot say, or says the value
25
25
  * is known only after apply: no value. The dependent's members list the
26
- * reference under `unknownInputs`, and the approval does not cover what
27
- * it will do with it.
26
+ * reference under `unknownInputs`. The apply plans it again once the
27
+ * upstream applied, and the approval covers that round when it matches the
28
+ * preview (see `coveredRound`).
28
29
  *
29
30
  * `--seed-outputs` wins over both. The apply stage's plan reads the same
30
31
  * values, so on the same estate it gets the digest the plan stage showed.
@@ -73,6 +74,7 @@ import { type PrApproval, type PrMember, type PrRefusal, type PrRound, type PrRe
73
74
  import { type DriverComponent, type DriverComponentResult } from "./driver.js";
74
75
  import { type FanOutRunResult } from "./fan-out-run.js";
75
76
  import { type ComponentChangeSignal, type FanOutPlan } from "./fan-out.js";
77
+ import { type PlanShape } from "./covered-round.js";
76
78
  import type { PrApplyRecord } from "./fan-out-record.js";
77
79
  import type { CapabilityRegistry } from "./capability.js";
78
80
  import type { RunProgressEvent } from "./run-progress.js";
@@ -120,6 +122,8 @@ export interface PrPlanSet {
120
122
  * report's `plannedOutputs`.
121
123
  */
122
124
  plannedOutputs?: Record<string, string[]>;
125
+ /** The shapes lexicons supplied with their plans (#4419), by member. */
126
+ shapes?: Record<string, PlanShape>;
123
127
  /** Whether any component failed to plan. */
124
128
  failed: boolean;
125
129
  }
@@ -202,17 +206,28 @@ export interface PrApplyOptions {
202
206
  * The gate is {@link prRoundGate}. Without it, held members are left
203
207
  * `waiting` and nothing is planned again.
204
208
  */
209
+ /**
210
+ * Where the approval of `set` stands (#4419). When it is `approved`, a round
211
+ * whose fresh plan does only what `set` previewed, with only the inputs it
212
+ * marked unknown filled in, applies under that approval without a gate of
213
+ * its own (`coveredRound`), and the round records it (`PrRound.covered`).
214
+ * Without it every round decides its own gate.
215
+ */
216
+ approval?: PrApproval;
205
217
  decideRound?: (round: {
206
218
  round: number;
207
219
  gate: string;
208
220
  set: PrPlanSet;
209
221
  plan: FanOutPlan;
222
+ notCovered?: string;
210
223
  }) => Promise<PrRoundDecision>;
211
224
  }
212
225
  /** How a round's gate was decided: whether it applies, and where its approval stands. */
213
226
  export interface PrRoundDecision {
214
227
  satisfied: boolean;
215
228
  approval: PrApproval;
229
+ /** Set when the first approval covered the round (#4419): no gate of its own was decided. */
230
+ covered?: PrRound["covered"];
216
231
  /** Why it does not apply, when an approval stands but does not count (`--require-review`). */
217
232
  message?: string;
218
233
  }
@@ -312,7 +327,10 @@ export declare function prWavePlan(plan: FanOutPlan, components: DriverComponent
312
327
  * returns no change set) is covered only by the digest it was approved
313
328
  * with, since with no entries there is nothing to compare a moved plan by.
314
329
  */
315
- export declare function waveNotCovered(approved: ChangeSetDocument, fresh: ChangeSetDocument, approvedMembers?: readonly PrMember[]): string[];
330
+ export declare function waveNotCovered(approved: ChangeSetDocument, fresh: ChangeSetDocument, approvedMembers?: readonly PrMember[], shapes?: {
331
+ approved?: Record<string, PlanShape>;
332
+ fresh?: Record<string, PlanShape>;
333
+ }): string[];
316
334
  export interface PrReportInput {
317
335
  stage: "plan" | "apply" | "record";
318
336
  pr: number | null;