@intentius/chant 0.65.0 → 0.66.1
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/behaviour-delta.d.ts +181 -0
- package/dist/behaviour-delta.d.ts.map +1 -0
- package/dist/behaviour-http.d.ts +106 -0
- package/dist/behaviour-http.d.ts.map +1 -0
- package/dist/behaviour-overlay.d.ts +61 -0
- package/dist/behaviour-overlay.d.ts.map +1 -0
- package/dist/behaviour.d.ts +178 -3
- package/dist/behaviour.d.ts.map +1 -1
- package/dist/cli/handlers/scenario.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/lifecycle/scenario-eval.d.ts +23 -5
- package/dist/lifecycle/scenario-eval.d.ts.map +1 -1
- package/dist/lifecycle/scenario.d.ts +45 -3
- package/dist/lifecycle/scenario.d.ts.map +1 -1
- package/dist/lifecycle/types.d.ts +17 -0
- package/dist/lifecycle/types.d.ts.map +1 -1
- package/dist/op/activities/activity-contracts.d.ts +42 -0
- package/dist/op/activities/activity-contracts.d.ts.map +1 -1
- package/dist/op/activities/index.d.ts +2 -0
- package/dist/op/activities/index.d.ts.map +1 -1
- package/dist/op/activities/predict-behaviour.d.ts +207 -0
- package/dist/op/activities/predict-behaviour.d.ts.map +1 -0
- package/dist/op/activities/reconcile.d.ts +7 -0
- package/dist/op/activities/reconcile.d.ts.map +1 -1
- package/dist/op/composites/behaviour-op.d.ts +57 -0
- package/dist/op/composites/behaviour-op.d.ts.map +1 -0
- package/dist/op/composites/index.d.ts +2 -0
- package/dist/op/composites/index.d.ts.map +1 -1
- package/dist/op/index.d.ts +2 -2
- package/dist/op/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/behaviour-delta.test.ts +331 -0
- package/src/behaviour-delta.ts +564 -0
- package/src/behaviour-http.test.ts +456 -0
- package/src/behaviour-http.ts +252 -0
- package/src/behaviour-overlay.test.ts +149 -0
- package/src/behaviour-overlay.ts +76 -0
- package/src/behaviour.test.ts +50 -0
- package/src/behaviour.ts +255 -3
- package/src/cli/handlers/scenario.test.ts +108 -0
- package/src/cli/handlers/scenario.ts +63 -16
- package/src/index.ts +2 -0
- package/src/lifecycle/scenario-cost.test.ts +183 -0
- package/src/lifecycle/scenario-eval.ts +133 -6
- package/src/lifecycle/scenario.ts +72 -4
- package/src/lifecycle/types.ts +17 -0
- package/src/lint/rules/op/ops012-activity-contract.test.ts +31 -0
- package/src/op/activities/activity-contracts.ts +49 -0
- package/src/op/activities/index.ts +24 -0
- package/src/op/activities/predict-behaviour.test.ts +255 -0
- package/src/op/activities/predict-behaviour.ts +468 -0
- package/src/op/activities/reconcile.ts +7 -2
- package/src/op/activity-contract-registry.test.ts +3 -0
- package/src/op/composites/behaviour-op.test.ts +56 -0
- package/src/op/composites/behaviour-op.ts +99 -0
- package/src/op/composites/index.ts +2 -0
- package/src/op/index.ts +2 -0
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,QA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AACnC,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,OAAO,EACP,YAAY,EACZ,YAAY,EACZ,KAAK,SAAS,EACd,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,GACtB,MAAM,0BAA0B,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,yBAAyB,CAAC;AACxC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAElC,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAClE,cAAc,EAAE,iBAAiB,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC5F,YAAY,EAAE,QAAQ,EAAE,eAAe,EAAE,cAAc,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -14,7 +14,19 @@
|
|
|
14
14
|
* the unobserved clause.
|
|
15
15
|
*/
|
|
16
16
|
import { type ChangeSet } from "./change-set.js";
|
|
17
|
+
import { type BehaviourResult } from "../behaviour.js";
|
|
17
18
|
import type { ScenarioExpect } from "./scenario.js";
|
|
19
|
+
/**
|
|
20
|
+
* What stands in for the engine's answer when a scenario carries a `cost`
|
|
21
|
+
* clause (#2358): the fixture's `behaviour` block, or the reason there is
|
|
22
|
+
* none. The handler resolves it from the same fixture every other clause
|
|
23
|
+
* reads; this module only evaluates it.
|
|
24
|
+
*/
|
|
25
|
+
export type ScenarioBehaviourFixture = {
|
|
26
|
+
readonly result: BehaviourResult;
|
|
27
|
+
} | {
|
|
28
|
+
readonly missing: string;
|
|
29
|
+
};
|
|
18
30
|
/**
|
|
19
31
|
* One clause's verdict — always present in {@link ScenarioVerdict.checks}, in
|
|
20
32
|
* declaration order, whether it passed or not. A scenario with no failing
|
|
@@ -24,7 +36,11 @@ export interface ScenarioCheckResult {
|
|
|
24
36
|
/** Which `expect` clause this is (`"noop"`, `"create"`, `"deletes"`, …). */
|
|
25
37
|
clause: string;
|
|
26
38
|
pass: boolean;
|
|
27
|
-
/** Present when `pass` is false — what was expected vs what the plan
|
|
39
|
+
/** Present when `pass` is false — what was expected vs what the plan
|
|
40
|
+
* proposes, naming resources for delete/ownership failures. The `cost`
|
|
41
|
+
* clause carries it on a pass too, saying which figure was bounded and
|
|
42
|
+
* what the engine declined, so a passing bound is never read as a bound
|
|
43
|
+
* over the whole estate when it was not. */
|
|
28
44
|
detail?: string;
|
|
29
45
|
}
|
|
30
46
|
/** The result of evaluating one scenario's `expect` against a change set. */
|
|
@@ -34,9 +50,11 @@ export interface ScenarioVerdict {
|
|
|
34
50
|
checks: ScenarioCheckResult[];
|
|
35
51
|
}
|
|
36
52
|
/**
|
|
37
|
-
* Evaluate `expect` against `cs`. Pure: reads `cs` and
|
|
38
|
-
*
|
|
39
|
-
*
|
|
53
|
+
* Evaluate `expect` against `cs`. Pure: reads `cs`, `expect` and, for a
|
|
54
|
+
* `cost` clause, the fixture's `behaviour` block handed over as `behaviour`;
|
|
55
|
+
* computes nothing else. Every clause present on `expect` is checked
|
|
56
|
+
* independently and every one contributes to `checks`; `pass` is true only
|
|
57
|
+
* when all of them are.
|
|
40
58
|
*/
|
|
41
|
-
export declare function evaluateScenario(cs: ChangeSet, expect: ScenarioExpect): ScenarioVerdict;
|
|
59
|
+
export declare function evaluateScenario(cs: ChangeSet, expect: ScenarioExpect, behaviour?: ScenarioBehaviourFixture): ScenarioVerdict;
|
|
42
60
|
//# sourceMappingURL=scenario-eval.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scenario-eval.d.ts","sourceRoot":"","sources":["../../src/lifecycle/scenario-eval.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"scenario-eval.d.ts","sourceRoot":"","sources":["../../src/lifecycle/scenario-eval.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzD,OAAO,EAAoD,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAEtG,OAAO,KAAK,EAGV,cAAc,EAEf,MAAM,YAAY,CAAC;AAEpB;;;;;GAKG;AACH,MAAM,MAAM,wBAAwB,GAChC;IAAE,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAA;CAAE,GACpC;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjC;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,4EAA4E;IAC5E,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;IACd;;;;gDAI4C;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,6EAA6E;AAC7E,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,OAAO,CAAC;IACd,mFAAmF;IACnF,MAAM,EAAE,mBAAmB,EAAE,CAAC;CAC/B;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,EAAE,EAAE,SAAS,EACb,MAAM,EAAE,cAAc,EACtB,SAAS,CAAC,EAAE,wBAAwB,GACnC,eAAe,CAoDjB"}
|
|
@@ -93,12 +93,47 @@ export interface ScenarioDeleteExpectation {
|
|
|
93
93
|
export type ScenarioUnobservedPolicy = "refuse" | {
|
|
94
94
|
readonly allow: readonly string[];
|
|
95
95
|
};
|
|
96
|
+
/**
|
|
97
|
+
* A bound on one predicted figure in the fixture (#2358).
|
|
98
|
+
*
|
|
99
|
+
* A scenario has one fixture, not a before-and-after pair, so this bounds a
|
|
100
|
+
* **single** predicted rate rather than a delta: the fixture's own
|
|
101
|
+
* `behaviour` block (a `BehaviourResult` recorded on the `LifecycleSnapshot`,
|
|
102
|
+
* ../lifecycle/types.ts) stands in for the engine's answer the way the rest
|
|
103
|
+
* of the snapshot stands in for a live read, and the clause asks whether one
|
|
104
|
+
* figure in it is at or under `maxPerHour`.
|
|
105
|
+
*
|
|
106
|
+
* Which figure: `entity`'s own `cost.perHour` when named; otherwise the
|
|
107
|
+
* estate's — the engine's own `meta.total` when it states one, and chant's
|
|
108
|
+
* sum over every predicted entity when it does not. The verdict's detail says
|
|
109
|
+
* which of the three it read, and names every entity the engine declined,
|
|
110
|
+
* because a sum over an estate with declined entities is a sum over less
|
|
111
|
+
* than the estate and the reader should know it.
|
|
112
|
+
*
|
|
113
|
+
* The bound is a rate for one hypothetical hour at the fixture's stated
|
|
114
|
+
* traffic level, never an amount; `currency` is required and compared
|
|
115
|
+
* exactly, because chant converts nothing and a bound in USD says nothing
|
|
116
|
+
* about a figure in EUR.
|
|
117
|
+
*
|
|
118
|
+
* A fixture whose `behaviour` block is a refusal, or that carries none, fails
|
|
119
|
+
* the clause with the refusal's reason. A bound cannot be checked against no
|
|
120
|
+
* figure, and passing would be the faked number the epic forbids.
|
|
121
|
+
*/
|
|
122
|
+
export interface ScenarioCostExpectation {
|
|
123
|
+
/** The figure must be at or under this many `currency` per hour. */
|
|
124
|
+
readonly maxPerHour: number;
|
|
125
|
+
/** ISO 4217 code the figure must be stated in. Compared exactly. */
|
|
126
|
+
readonly currency: string;
|
|
127
|
+
/** Bound one entity's figure instead of the estate's. */
|
|
128
|
+
readonly entity?: string;
|
|
129
|
+
}
|
|
96
130
|
/**
|
|
97
131
|
* The assertion vocabulary (#1292 research, settled shape). Every clause is
|
|
98
132
|
* independently optional and clauses compose within one `expect` object — a
|
|
99
|
-
* scenario can assert `noop`, exact counts, specific named deletes,
|
|
100
|
-
* unobserved policy together. At least one clause must be
|
|
101
|
-
* `expect` asserts nothing and is refused as a likely
|
|
133
|
+
* scenario can assert `noop`, exact counts, specific named deletes, an
|
|
134
|
+
* unobserved policy and a cost bound together. At least one clause must be
|
|
135
|
+
* present; an empty `expect` asserts nothing and is refused as a likely
|
|
136
|
+
* mistake.
|
|
102
137
|
*/
|
|
103
138
|
export interface ScenarioExpect {
|
|
104
139
|
/** The plan proposes no create, update, or delete, and no declared effect
|
|
@@ -121,7 +156,14 @@ export interface ScenarioExpect {
|
|
|
121
156
|
/** How the scenario treats unobserved rows. Omitted = unconstrained (an
|
|
122
157
|
* unobserved entity neither passes nor fails the scenario on its own). */
|
|
123
158
|
readonly unobserved?: ScenarioUnobservedPolicy;
|
|
159
|
+
/** One predicted figure in the fixture's `behaviour` block is at or under
|
|
160
|
+
* a stated rate per hour (#2358). See {@link ScenarioCostExpectation} for
|
|
161
|
+
* which figure, and for why a refusal in the fixture fails it. */
|
|
162
|
+
readonly cost?: ScenarioCostExpectation;
|
|
124
163
|
}
|
|
164
|
+
/** Every recognized `expect` clause key — for the excess-key check below and
|
|
165
|
+
* for exhaustiveness at call sites. */
|
|
166
|
+
export declare const EXPECT_KEYS: readonly ["noop", "create", "update", "delete", "deletes", "unobserved", "cost"];
|
|
125
167
|
/**
|
|
126
168
|
* A scenario declaration — a Declarable, so discovery collects it and `chant
|
|
127
169
|
* list` shows it, but it carries no resource payload: `partitionByLexicon`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scenario.d.ts","sourceRoot":"","sources":["../../src/lifecycle/scenario.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAqB,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C;;iEAEiE;AACjE,eAAO,MAAM,eAAe,eAA+B,CAAC;AAE5D,2DAA2D;AAC3D,eAAO,MAAM,oBAAoB,oBAAoB,CAAC;AAEtD;;;;;GAKG;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type { DeepResourceObservation } from "../deep-observation.js";
|
|
4
|
+
import type { BehaviourResult } from "../behaviour.js";
|
|
4
5
|
import type { IREdge } from "../graph-ir.js";
|
|
5
6
|
export type { ResourceMetadata, ArtifactMetadata } from "../lexicon.js";
|
|
6
7
|
/**
|
|
@@ -81,6 +82,22 @@ export interface LifecycleSnapshot {
|
|
|
81
82
|
stackExports?: Record<string, Record<string, unknown>>;
|
|
82
83
|
/** Build digest at snapshot time — what was declared when this snapshot was taken */
|
|
83
84
|
digest?: BuildDigest;
|
|
85
|
+
/**
|
|
86
|
+
* What a behaviour engine said about this estate, when one was asked
|
|
87
|
+
* (#2358): the whole `BehaviourResult`, a report or a named refusal,
|
|
88
|
+
* exactly as `predictBehaviour()` returned it.
|
|
89
|
+
*
|
|
90
|
+
* Carried on the snapshot rather than in a fixture of its own because a
|
|
91
|
+
* `Scenario` has one `given`, and that one fixture stands in for everything
|
|
92
|
+
* a live read would have answered — presence, ownership, and now the
|
|
93
|
+
* engine's figures. A scenario's `expect.cost` clause reads this block;
|
|
94
|
+
* `chant scenario check` refuses the clause, naming the reason, when the
|
|
95
|
+
* block is absent or is a refusal, because a bound checked against no figure
|
|
96
|
+
* would pass on nothing. Absent on every snapshot written before this and
|
|
97
|
+
* on every snapshot recorded without an engine, which is read as "no
|
|
98
|
+
* prediction was made" rather than as a prediction of nothing.
|
|
99
|
+
*/
|
|
100
|
+
behaviour?: BehaviourResult;
|
|
84
101
|
}
|
|
85
102
|
/**
|
|
86
103
|
* Digest of a single resource declaration.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/lifecycle/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CA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
export declare const chantTeardownContract: import("../index.js").ActivityContract<{
|
|
52
52
|
path: string;
|
|
53
53
|
}, never>;
|
|
54
|
+
/**
|
|
55
|
+
* The prediction (#2358). `args` mirrors `PredictBehaviourArgs` field for
|
|
56
|
+
* field; the return is the contract's `BehaviourResult`, a report or a
|
|
57
|
+
* refusal, so `returns` is the envelope both arms share and a step's
|
|
58
|
+
* `outcomeAttribute.from` may name `behaviour` or `refusal`.
|
|
59
|
+
*/
|
|
60
|
+
export declare const predictBehaviourContract: import("../index.js").ActivityContract<{
|
|
61
|
+
environment: string;
|
|
62
|
+
traffic: string;
|
|
63
|
+
stack?: string | undefined;
|
|
64
|
+
region?: string | undefined;
|
|
65
|
+
owned?: boolean | undefined;
|
|
66
|
+
}, {
|
|
67
|
+
behaviour: "v1";
|
|
68
|
+
refusal?: unknown;
|
|
69
|
+
}>;
|
|
70
|
+
/**
|
|
71
|
+
* The pull-request finding (#2358). Same inputs as the prediction plus the
|
|
72
|
+
* Op's name (the marker's key, #2319), the mode, and an optional explicit
|
|
73
|
+
* base branch. `returns` names what a step reads as an outcome — the posted
|
|
74
|
+
* URL, and whether either side refused.
|
|
75
|
+
*/
|
|
76
|
+
export declare const behaviourFindingContract: import("../index.js").ActivityContract<{
|
|
77
|
+
environment: string;
|
|
78
|
+
traffic: string;
|
|
79
|
+
op: string;
|
|
80
|
+
mode?: "report" | "comment" | undefined;
|
|
81
|
+
base?: string | undefined;
|
|
82
|
+
title?: string | undefined;
|
|
83
|
+
stack?: string | undefined;
|
|
84
|
+
region?: string | undefined;
|
|
85
|
+
owned?: boolean | undefined;
|
|
86
|
+
}, {
|
|
87
|
+
mode: "report" | "comment";
|
|
88
|
+
base: string;
|
|
89
|
+
head: string;
|
|
90
|
+
refused: boolean;
|
|
91
|
+
summary: string;
|
|
92
|
+
commentUrl?: string | undefined;
|
|
93
|
+
pullRequest?: string | undefined;
|
|
94
|
+
mergeRequest?: string | undefined;
|
|
95
|
+
}>;
|
|
54
96
|
//# sourceMappingURL=activity-contracts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity-contracts.d.ts","sourceRoot":"","sources":["../../../src/op/activities/activity-contracts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAKH,eAAO,MAAM,yBAAyB;;SAGrC,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;;;;EAIjC,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;SAG5B,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;EAgB7B,CAAC;AAEF,eAAO,MAAM,qBAAqB;;SAGjC,CAAC"}
|
|
1
|
+
{"version":3,"file":"activity-contracts.d.ts","sourceRoot":"","sources":["../../../src/op/activities/activity-contracts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAKH,eAAO,MAAM,yBAAyB;;SAGrC,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;;;;EAIjC,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;SAG5B,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;EAgB7B,CAAC;AAEF,eAAO,MAAM,qBAAqB;;SAGjC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;EAUpC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;EAuBpC,CAAC"}
|
|
@@ -28,4 +28,6 @@ export { convergeTick, planConvergeTick } from "./converge.js";
|
|
|
28
28
|
export type { ConvergeTickArgs, ConvergeTickResult, ConvergeTickPlan, SerializedConvergeRule } from "./converge.js";
|
|
29
29
|
export { lexiconUpgrade, isPinned, isRolling, severityToLabel, upgradeBranchName, upgradePrTitle, buildUpgradeSummary, } from "./lexicon-upgrade.js";
|
|
30
30
|
export type { LexiconUpgradeArgs, LexiconUpgradeResult, LexiconUpgradeMode, SupportedLexicon, SemverLabel, CheckPinnedFn, CheckRollingFn, GhRunner, ApplyBumpFn, } from "./lexicon-upgrade.js";
|
|
31
|
+
export { predictBehaviour, behaviourFinding, behaviourFindingMarker, declaredEdgeCoverage, baseRefFrom, headRefFrom, noBaseRefMessage, noPredictingLexiconMessage, ambiguousPredictorMessage, } from "./predict-behaviour.js";
|
|
32
|
+
export type { PredictBehaviourArgs, BehaviourFindingArgs, BehaviourFindingResult, BehaviourFindingMode, BehaviourFindingDeps, BaseCheckout, } from "./predict-behaviour.js";
|
|
31
33
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/op/activities/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAQ9C,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,YAAY,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAK/C,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACnD,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC/D,YAAY,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEjG,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,YAAY,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,YAAY,EAAE,eAAe,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,gBAAgB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,EAAE,MAAM,YAAY,CAAC;AAC5D,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEjH,OAAO,EACL,cAAc,EACd,QAAQ,EACR,SAAS,EACT,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,cAAc,EACd,QAAQ,EACR,WAAW,GACZ,MAAM,mBAAmB,CAAC;AAM3B,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,sBAAsB,EACtB,oBAAoB,EACpB,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,0BAA0B,EAC1B,yBAAyB,GAC1B,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,oBAAoB,EACpB,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,EACpB,oBAAoB,EACpB,YAAY,GACb,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `predictBehaviour` activity and the pull-request finding built on it
|
|
3
|
+
* (#2358, epic #2355).
|
|
4
|
+
*
|
|
5
|
+
* Two activities, because they answer two questions:
|
|
6
|
+
*
|
|
7
|
+
* - {@link predictBehaviour} asks the project's predicting lexicon what the
|
|
8
|
+
* declared estate would do at a stated traffic level, and returns the
|
|
9
|
+
* {@link BehaviourResult} as the contract defines it — a report, or a named
|
|
10
|
+
* refusal. It builds the project in-process, assembles the request from the
|
|
11
|
+
* build the way `lifecycle plan` assembles a deep read's, and hands it to
|
|
12
|
+
* the one configured lexicon that implements the fourth observation method.
|
|
13
|
+
* `isBehaviourRefusalReport` is the branch every consumer of its result
|
|
14
|
+
* takes first.
|
|
15
|
+
* - {@link behaviourFinding} runs that prediction twice — once on the
|
|
16
|
+
* checkout the run is in (the pull request's head) and once on the base
|
|
17
|
+
* branch it targets — differences the two under the rules in
|
|
18
|
+
* `../../behaviour-delta.ts`, and posts the finding in `comment` mode
|
|
19
|
+
* through {@link reconcilePr}. Same sticky comment on GitHub and Forgejo,
|
|
20
|
+
* same merge-request note on GitLab, same marker recipe: nothing here
|
|
21
|
+
* posts anything itself.
|
|
22
|
+
*
|
|
23
|
+
* ## The base side is a checkout, not a snapshot
|
|
24
|
+
*
|
|
25
|
+
* The finding is declared-versus-declared: the graph the pull request
|
|
26
|
+
* proposes against the graph its base branch already holds. Both sides are
|
|
27
|
+
* built from source, so the base branch is checked out into a detached git
|
|
28
|
+
* worktree under the repository's own root (module resolution walks up from
|
|
29
|
+
* there to the same `node_modules` the head build uses) and removed again
|
|
30
|
+
* whether the prediction succeeded or not. A shallow CI clone does not carry
|
|
31
|
+
* the base branch, so it is fetched at depth one first — the same reason
|
|
32
|
+
* `converge.ts` fetches `chant/lifecycle` before reading it.
|
|
33
|
+
*
|
|
34
|
+
* The base branch name comes off the run's own event, the way the pull
|
|
35
|
+
* request itself does in `reconcile.ts`: `GITHUB_BASE_REF` on a GitHub
|
|
36
|
+
* Actions or Forgejo Actions `pull_request` job, `CI_MERGE_REQUEST_TARGET_BRANCH_NAME`
|
|
37
|
+
* on a GitLab `merge_request_event` pipeline. A run with neither and no
|
|
38
|
+
* explicit `base` fails by name rather than guessing `main`.
|
|
39
|
+
*
|
|
40
|
+
* ## What the marker names
|
|
41
|
+
*
|
|
42
|
+
* The comment's hidden marker names the Op and the env together
|
|
43
|
+
* ({@link behaviourFindingMarker}), for #2319's reason: a `comment`-mode
|
|
44
|
+
* `reconcilePr` step on the same pull request keys its marker on the env
|
|
45
|
+
* alone, and a behaviour finding over `prod` sharing a marker with a plan
|
|
46
|
+
* finding over `prod` would edit the wrong comment on every push.
|
|
47
|
+
*
|
|
48
|
+
* ## Edge coverage on the declared path
|
|
49
|
+
*
|
|
50
|
+
* `buildGraphIr` produces reference edges and is exhaustive for them. It
|
|
51
|
+
* produces no containment — a subnet's membership of a VPC is not a reference
|
|
52
|
+
* — and #2360's third comment records that nothing on the declared path does
|
|
53
|
+
* yet. So the request never claims `complete`: that would be a true claim
|
|
54
|
+
* about references and a false one about the graph. It cannot honestly claim
|
|
55
|
+
* `partial` either, because `partial` has to name a gap as `dangling` or
|
|
56
|
+
* `unresolvedKinds`, and the gap here is neither — every reference resolved,
|
|
57
|
+
* and the generic builder has no vocabulary for "this kind is a boundary
|
|
58
|
+
* whose containment is missing" (augur's own fixture names its boundary
|
|
59
|
+
* kinds by hand, which is lexicon knowledge core does not have). An earlier
|
|
60
|
+
* draft named every kind no reference touched, and named a queue nobody
|
|
61
|
+
* references as "unresolved", which it is not. So the claim is `unknown`,
|
|
62
|
+
* which the contract tells a consumer to treat exactly as it treats
|
|
63
|
+
* `partial`, and the finding shows each side's coverage and does not compare
|
|
64
|
+
* resilience verdicts across it — see `renderBehaviourFinding`.
|
|
65
|
+
*/
|
|
66
|
+
import { type BehaviourEdgeCoverage, type BehaviourResult } from "../../behaviour.js";
|
|
67
|
+
import { type BehaviourDelta } from "../../behaviour-delta.js";
|
|
68
|
+
import { reconcilePr } from "./reconcile.js";
|
|
69
|
+
export interface PredictBehaviourArgs {
|
|
70
|
+
/** The environment the prediction is for, mirroring the deep read's `environment`. */
|
|
71
|
+
environment: string;
|
|
72
|
+
/** The traffic level to predict at, verbatim: `100 rps, p50`. Never parsed here. */
|
|
73
|
+
traffic: string;
|
|
74
|
+
/** Deployed stack, for a multi-stack project. */
|
|
75
|
+
stack?: string;
|
|
76
|
+
/** Region the stack is deployed in. */
|
|
77
|
+
region?: string;
|
|
78
|
+
/** Restrict to chant-owned resources; a withheld entity is `filtered`, not absent. */
|
|
79
|
+
owned?: boolean;
|
|
80
|
+
}
|
|
81
|
+
/** What the activity says when no configured lexicon implements the fourth method. */
|
|
82
|
+
export declare function noPredictingLexiconMessage(lexicons: readonly string[]): string;
|
|
83
|
+
/** What the activity says when more than one configured lexicon predicts. */
|
|
84
|
+
export declare function ambiguousPredictorMessage(names: readonly string[]): string;
|
|
85
|
+
/**
|
|
86
|
+
* The declared path's honest coverage claim. See the module doc: reference
|
|
87
|
+
* edges are exhaustive and containment is absent, and the contract has a
|
|
88
|
+
* field for a missing reference and none for missing containment, so the
|
|
89
|
+
* claim is `unknown`. Never `complete`, and not `partial` naming a kind the
|
|
90
|
+
* generic builder has no basis to name. A function rather than a constant so
|
|
91
|
+
* the day the declared path produces containment edges (#2360), the claim
|
|
92
|
+
* changes here and nowhere else.
|
|
93
|
+
*/
|
|
94
|
+
export declare function declaredEdgeCoverage(): BehaviourEdgeCoverage;
|
|
95
|
+
/**
|
|
96
|
+
* Predict the estate declared under `projectPath`. The in-process half of
|
|
97
|
+
* {@link predictBehaviour}, taking the project root explicitly so the
|
|
98
|
+
* finding can run it on the base checkout too.
|
|
99
|
+
*
|
|
100
|
+
* Imports are dynamic so this module carries no load-time edge into the CLI
|
|
101
|
+
* or the build: `cli/plugins` reaches back into the root index, and the
|
|
102
|
+
* activity registry imports this module statically.
|
|
103
|
+
*/
|
|
104
|
+
export declare function predictDeclared(projectPath: string, args: PredictBehaviourArgs): Promise<BehaviourResult>;
|
|
105
|
+
/**
|
|
106
|
+
* Predict the declared estate in the working directory at `args.traffic`.
|
|
107
|
+
* Returns the contract's result as it is; a refusal is a result, not a
|
|
108
|
+
* thrown error, and `isBehaviourRefusalReport` is the branch to take first.
|
|
109
|
+
* Uses the `fastIdempotent` profile: the build is offline and the engine call
|
|
110
|
+
* is read-only.
|
|
111
|
+
*/
|
|
112
|
+
export declare function predictBehaviour(args: PredictBehaviourArgs): Promise<BehaviourResult>;
|
|
113
|
+
/** How the finding leaves the run. Only the two modes a pull request can carry. */
|
|
114
|
+
export type BehaviourFindingMode = "comment" | "report";
|
|
115
|
+
export interface BehaviourFindingArgs extends PredictBehaviourArgs {
|
|
116
|
+
/**
|
|
117
|
+
* The name of the Op this step belongs to — it keys the sticky comment's
|
|
118
|
+
* marker together with `environment` ({@link behaviourFindingMarker}), so
|
|
119
|
+
* two Ops over one env own two comments. Required for the same reason
|
|
120
|
+
* `reconcilePr`'s `issue` mode requires it (#2319).
|
|
121
|
+
*/
|
|
122
|
+
op: string;
|
|
123
|
+
/** `comment` posts on the triggering pull or merge request; `report` returns the body only. Default: `comment`. */
|
|
124
|
+
mode?: BehaviourFindingMode;
|
|
125
|
+
/**
|
|
126
|
+
* The base branch to predict the other side from. Read off the run's own
|
|
127
|
+
* event when omitted — `GITHUB_BASE_REF`, then `CI_MERGE_REQUEST_TARGET_BRANCH_NAME`
|
|
128
|
+
* — and refused by name when neither is set.
|
|
129
|
+
*/
|
|
130
|
+
base?: string;
|
|
131
|
+
/** Comment title, unused on a sticky comment but carried for `reconcilePr`'s result. */
|
|
132
|
+
title?: string;
|
|
133
|
+
}
|
|
134
|
+
export interface BehaviourFindingResult {
|
|
135
|
+
mode: BehaviourFindingMode;
|
|
136
|
+
/** The base branch the other side was predicted from. */
|
|
137
|
+
base: string;
|
|
138
|
+
/** What the head side was called in the finding. */
|
|
139
|
+
head: string;
|
|
140
|
+
/** The structured delta, before rendering. */
|
|
141
|
+
finding: BehaviourDelta;
|
|
142
|
+
/** True when either side refused, so the finding says "no prediction". */
|
|
143
|
+
refused: boolean;
|
|
144
|
+
/** The rendered Markdown, whether or not it was posted. */
|
|
145
|
+
summary: string;
|
|
146
|
+
/** The posted or updated comment / note URL (comment mode). */
|
|
147
|
+
commentUrl?: string;
|
|
148
|
+
/** `owner/repo#number` (comment mode, GitHub and Forgejo). */
|
|
149
|
+
pullRequest?: string;
|
|
150
|
+
/** `group/project!iid` (comment mode, GitLab). */
|
|
151
|
+
mergeRequest?: string;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* The hidden marker a behaviour finding is found by across re-runs. Keyed on
|
|
155
|
+
* the Op *and* the env, both slugified the same way `reconcilePr`'s markers
|
|
156
|
+
* are, and distinct from both of those by its prefix: a `comment`-mode
|
|
157
|
+
* `reconcilePr` step and this step on one pull request must never match each
|
|
158
|
+
* other's comment.
|
|
159
|
+
*/
|
|
160
|
+
export declare function behaviourFindingMarker(op: string, env: string): string;
|
|
161
|
+
/** What the finding says when the run names no base branch to predict against. */
|
|
162
|
+
export declare function noBaseRefMessage(): string;
|
|
163
|
+
/** Where the base branch name comes from, most specific first. Pure — exported for testing. */
|
|
164
|
+
export declare function baseRefFrom(env: Record<string, string | undefined>, explicit?: string): string | undefined;
|
|
165
|
+
/** What the head side is called in the finding: the source branch when the run names one, else the short commit. */
|
|
166
|
+
export declare function headRefFrom(env: Record<string, string | undefined>, shortSha?: string): string;
|
|
167
|
+
/** A checked-out base branch: where its project root is, and how to remove it. */
|
|
168
|
+
export interface BaseCheckout {
|
|
169
|
+
/** The base branch's counterpart of the working directory. */
|
|
170
|
+
projectPath: string;
|
|
171
|
+
cleanup(): Promise<void>;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Check `base` out into a detached worktree beside the repository. Fetches it
|
|
175
|
+
* at depth one first, because a CI clone carries only the pull request's own
|
|
176
|
+
* ref; a branch already present locally (a full clone, a developer's own
|
|
177
|
+
* checkout) is used as it stands after the fetch fails.
|
|
178
|
+
*/
|
|
179
|
+
export declare function checkoutBase(base: string, signal?: AbortSignal): Promise<BaseCheckout>;
|
|
180
|
+
/** What {@link createBehaviourFinding} takes instead of reaching for the process. */
|
|
181
|
+
export interface BehaviourFindingDeps {
|
|
182
|
+
/** Predict one project root. Default: {@link predictDeclared}. */
|
|
183
|
+
predict?: (projectPath: string, args: PredictBehaviourArgs) => Promise<BehaviourResult>;
|
|
184
|
+
/** Check the base branch out. Default: {@link checkoutBase}. */
|
|
185
|
+
checkout?: (base: string, signal?: AbortSignal) => Promise<BaseCheckout>;
|
|
186
|
+
/** Post the finding. Default: {@link reconcilePr}, whose `comment` mode does the forge split. */
|
|
187
|
+
post?: typeof reconcilePr;
|
|
188
|
+
/** The environment the base and head refs are read from. Default: the process's. */
|
|
189
|
+
env?: Record<string, string | undefined>;
|
|
190
|
+
/** The short commit the head side is named by when the run names no branch. Default: `git rev-parse --short HEAD`. */
|
|
191
|
+
shortSha?: () => Promise<string | undefined>;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Build the finding activity, with its four side effects injected so a test
|
|
195
|
+
* can drive the whole thing — predict twice, difference, render, post —
|
|
196
|
+
* against fixtures and a stubbed poster.
|
|
197
|
+
*/
|
|
198
|
+
export declare function createBehaviourFinding(deps?: BehaviourFindingDeps): (args: BehaviourFindingArgs, signal?: AbortSignal) => Promise<BehaviourFindingResult>;
|
|
199
|
+
/**
|
|
200
|
+
* Predict the pull request's declared estate and its base branch's, and post
|
|
201
|
+
* the delta as one sticky comment on the pull request — or one note on the
|
|
202
|
+
* merge request — that triggered the run. Needs a pull-request-triggered
|
|
203
|
+
* run; fails by name without one, the same way `reconcilePr`'s `comment`
|
|
204
|
+
* mode does, because that is the function that posts.
|
|
205
|
+
*/
|
|
206
|
+
export declare const behaviourFinding: (args: BehaviourFindingArgs, signal?: AbortSignal) => Promise<BehaviourFindingResult>;
|
|
207
|
+
//# sourceMappingURL=predict-behaviour.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"predict-behaviour.d.ts","sourceRoot":"","sources":["../../../src/op/activities/predict-behaviour.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AAMH,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EAErB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAc,WAAW,EAAwC,MAAM,aAAa,CAAC;AAY5F,MAAM,WAAW,oBAAoB;IACnC,sFAAsF;IACtF,WAAW,EAAE,MAAM,CAAC;IACpB,oFAAoF;IACpF,OAAO,EAAE,MAAM,CAAC;IACh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AE,OAAO,WAAW,CAAC;IAC1B,oFAAoF;IACpF,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IACzC,sHAAsH;IACtH,QAAQ,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;CAC9C;AAWD;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,GAAE,oBAAyB,GAC9B,CAAC,IAAI,EAAE,oBAAoB,EAAE,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,sBAAsB,CAAC,CAiEvF;AAED;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,SA1EnB,oBAAoB,WAAW,WAAW,KAAK,OAAO,CAAC,sBAAsB,CA0E/B,CAAC"}
|
|
@@ -237,6 +237,13 @@ export declare function commentMarker(env: string): string;
|
|
|
237
237
|
* slug does not keep.
|
|
238
238
|
*/
|
|
239
239
|
export declare function issueMarker(op: string, env: string): string;
|
|
240
|
+
/**
|
|
241
|
+
* The slugify every marker shares: everything outside `[A-Za-z0-9._-]`
|
|
242
|
+
* collapses to `-`. Exported for the behaviour finding's own marker
|
|
243
|
+
* (`./predict-behaviour.ts`), so a third marker cannot slugify differently
|
|
244
|
+
* from the two here.
|
|
245
|
+
*/
|
|
246
|
+
export declare function markerSlug(s: string): string;
|
|
240
247
|
/**
|
|
241
248
|
* What any mode says about a supplied `marker` it cannot use safely (#2319
|
|
242
249
|
* pre-merge review).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reconcile.d.ts","sourceRoot":"","sources":["../../../src/op/activities/reconcile.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6EG;AACH,MAAM,MAAM,aAAa,GAAG,cAAc,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE5E,wDAAwD;A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AAW,GAAG,OAAO,CAAC,eAAe,CAAC,CA6HvG"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BehaviourOp composite — the predicted delta of a pull request as a review
|
|
3
|
+
* finding (#2358, epic #2355).
|
|
4
|
+
*
|
|
5
|
+
* One phase, one step: `behaviourFinding` predicts the declared estate on the
|
|
6
|
+
* pull request's head and on its base branch, differences the two under the
|
|
7
|
+
* contract's rules, and posts the finding in `comment` mode on the pull
|
|
8
|
+
* request (GitHub, Forgejo) or as a note on the merge request (GitLab) that
|
|
9
|
+
* triggered the run. There is no `schedule` here and there never will be: the
|
|
10
|
+
* cadence is the pull request, and the trigger lives on the `ScheduledOpSpec`
|
|
11
|
+
* handed to `generateOpsPipeline` (`{ kind: "pull_request" }`), the way
|
|
12
|
+
* `TerraformWatchOp`'s does.
|
|
13
|
+
*
|
|
14
|
+
* `findingMode: "report"` returns the body without posting, for a `chant run`
|
|
15
|
+
* on a developer's machine with `base` named by hand.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* export const { op } = BehaviourOp({
|
|
20
|
+
* name: "pr-behaviour",
|
|
21
|
+
* env: "prod",
|
|
22
|
+
* traffic: "1000 rps, p99",
|
|
23
|
+
* });
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
import type { OpResource } from "../resource.js";
|
|
27
|
+
import type { BehaviourFindingMode } from "../activities/predict-behaviour.js";
|
|
28
|
+
export interface BehaviourOpConfig {
|
|
29
|
+
/** Op name (kebab-case). Names the Op's output directory, is what `chant run` takes, and keys the comment's marker. */
|
|
30
|
+
name: string;
|
|
31
|
+
/** Environment the prediction is for. */
|
|
32
|
+
env: string;
|
|
33
|
+
/** The traffic level to predict at, verbatim: `1000 rps, p99`. */
|
|
34
|
+
traffic: string;
|
|
35
|
+
/**
|
|
36
|
+
* What to do with the finding. `comment` posts it on the triggering pull or
|
|
37
|
+
* merge request; `report` returns the body only.
|
|
38
|
+
* @default "comment"
|
|
39
|
+
*/
|
|
40
|
+
findingMode?: BehaviourFindingMode;
|
|
41
|
+
/** The base branch, when the run cannot read it off its own event (a local `chant run`). */
|
|
42
|
+
base?: string;
|
|
43
|
+
/** Deployed stack, for a multi-stack project. */
|
|
44
|
+
stack?: string;
|
|
45
|
+
/** Region the stack is deployed in. */
|
|
46
|
+
region?: string;
|
|
47
|
+
/** Restrict to chant-owned resources. */
|
|
48
|
+
scope?: {
|
|
49
|
+
owned?: boolean;
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
export interface BehaviourOpResources {
|
|
53
|
+
/** Op resource — the predict-both-sides-and-post Op. */
|
|
54
|
+
op: InstanceType<typeof OpResource>;
|
|
55
|
+
}
|
|
56
|
+
export declare function BehaviourOp(config: BehaviourOpConfig): BehaviourOpResources;
|
|
57
|
+
//# sourceMappingURL=behaviour-op.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"behaviour-op.d.ts","sourceRoot":"","sources":["../../../src/op/composites/behaviour-op.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAwB,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAElG,MAAM,WAAW,iBAAiB;IAChC,uHAAuH;IACvH,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,GAAG,EAAE,MAAM,CAAC;IACZ,kEAAkE;IAClE,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,WAAW,CAAC,EAAE,oBAAoB,CAAC;IACnC,4FAA4F;IAC5F,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iDAAiD;IACjD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uCAAuC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,yCAAyC;IACzC,KAAK,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;CAC7B;AAED,MAAM,WAAW,oBAAoB;IACnC,wDAAwD;IACxD,EAAE,EAAE,YAAY,CAAC,OAAO,UAAU,CAAC,CAAC;CACrC;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,oBAAoB,CAwC3E"}
|
|
@@ -23,4 +23,6 @@ export { PipelineAuditOp } from "./pipeline-audit-op.js";
|
|
|
23
23
|
export type { PipelineAuditOpConfig, PipelineAuditOpResources } from "./pipeline-audit-op.js";
|
|
24
24
|
export { LexiconUpgradeOp, IN_SCOPE_LEXICONS } from "./lexicon-upgrade-op.js";
|
|
25
25
|
export type { LexiconUpgradeOpConfig, LexiconUpgradeOpResources } from "./lexicon-upgrade-op.js";
|
|
26
|
+
export { BehaviourOp } from "./behaviour-op.js";
|
|
27
|
+
export type { BehaviourOpConfig, BehaviourOpResources } from "./behaviour-op.js";
|
|
26
28
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/op/composites/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,YAAY,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,YAAY,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACzF,OAAO,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sB,CAAC;AAC3E,YAAY,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAC9F,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,YAAY,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/op/index.d.ts
CHANGED
|
@@ -8,8 +8,8 @@ export type { FreshnessResult } from "./emulator-freshness.js";
|
|
|
8
8
|
export type { OpConfig, OpSchedule, PhaseDefinition, StepDefinition, ActivityStep, GateStep, EffectStep, OutcomeAttribute } from "./types.js";
|
|
9
9
|
export { outcomeAttributesOf } from "./types.js";
|
|
10
10
|
export { isValidCronExpression, cronSyntaxMessage, cronMatches, cronDueBetween } from "./cron.js";
|
|
11
|
-
export { WatchOp, ReconcileOp, ApplyOp, ConvergeOp, WorkflowAuditOp, PipelineAuditOp, LexiconUpgradeOp, IN_SCOPE_LEXICONS, } from "./composites/index.js";
|
|
12
|
-
export type { WatchOpConfig, WatchOpResources, ReconcileOpConfig, ReconcileOpResources, ApplyOpConfig, ApplyOpResources, ConvergeOpConfig, ConvergeOpResources, ConvergeDial, WorkflowAuditOpConfig, WorkflowAuditOpResources, PipelineAuditOpConfig, PipelineAuditOpResources, LexiconUpgradeOpConfig, LexiconUpgradeOpResources, } from "./composites/index.js";
|
|
11
|
+
export { WatchOp, ReconcileOp, ApplyOp, ConvergeOp, WorkflowAuditOp, PipelineAuditOp, LexiconUpgradeOp, IN_SCOPE_LEXICONS, BehaviourOp, } from "./composites/index.js";
|
|
12
|
+
export type { WatchOpConfig, WatchOpResources, ReconcileOpConfig, ReconcileOpResources, ApplyOpConfig, ApplyOpResources, ConvergeOpConfig, ConvergeOpResources, ConvergeDial, WorkflowAuditOpConfig, WorkflowAuditOpResources, PipelineAuditOpConfig, PipelineAuditOpResources, LexiconUpgradeOpConfig, LexiconUpgradeOpResources, BehaviourOpConfig, BehaviourOpResources, } from "./composites/index.js";
|
|
13
13
|
export { receiptActivities, receiptCheckInput } from "./receipt-store.js";
|
|
14
14
|
export type { ReceiptStore, EffectReceiptRef, ReceiptCheckInput, ReceiptActivities, ReceiptActivityOptions, ReceiptReadArgs, ReceiptReadResult, ReceiptWriteArgs, ReceiptStalenessArgs, ReceiptStalenessResult, ReceiptStaleFinding, } from "./receipt-store.js";
|
|
15
15
|
export { discoverOps } from "./discover.js";
|