@intentius/chant 0.46.0 → 0.49.0
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/audit/core.d.ts +21 -3
- package/dist/audit/core.d.ts.map +1 -1
- package/dist/audit/discover.d.ts +3 -2
- package/dist/audit/discover.d.ts.map +1 -1
- package/dist/audit/rules-doc.d.ts.map +1 -1
- package/dist/build.d.ts +3 -3
- package/dist/build.d.ts.map +1 -1
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/lint.d.ts.map +1 -1
- package/dist/cli/handlers/lifecycle.d.ts +1 -1
- package/dist/cli/handlers/lifecycle.d.ts.map +1 -1
- package/dist/cli/mcp/resource-handlers.d.ts.map +1 -1
- package/dist/cli/mcp/tools/explain.d.ts +6 -0
- package/dist/cli/mcp/tools/explain.d.ts.map +1 -1
- package/dist/cli/plugins.d.ts +1 -1
- package/dist/cli/plugins.d.ts.map +1 -1
- package/dist/cli/reporters/stylish.d.ts +15 -1
- package/dist/cli/reporters/stylish.d.ts.map +1 -1
- package/dist/components/auto-release.d.ts +4 -0
- package/dist/components/auto-release.d.ts.map +1 -1
- package/dist/components/starter-plugin.d.ts +2 -0
- package/dist/components/starter-plugin.d.ts.map +1 -1
- package/dist/components/verbs/ensure-secret.d.ts +50 -0
- package/dist/components/verbs/ensure-secret.d.ts.map +1 -0
- package/dist/components/verbs/index.d.ts +8 -0
- package/dist/components/verbs/index.d.ts.map +1 -1
- package/dist/components/verbs/r2-sync.d.ts +76 -0
- package/dist/components/verbs/r2-sync.d.ts.map +1 -0
- package/dist/components/verbs/wrangler.d.ts +108 -0
- package/dist/components/verbs/wrangler.d.ts.map +1 -0
- package/dist/config.d.ts +26 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/deep-observation.d.ts +14 -0
- package/dist/deep-observation.d.ts.map +1 -1
- package/dist/effect-receipt.d.ts +177 -0
- package/dist/effect-receipt.d.ts.map +1 -0
- package/dist/fold/subset.d.ts +15 -2
- package/dist/fold/subset.d.ts.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/lexicon.d.ts +44 -3
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lifecycle/change-set.d.ts +33 -5
- package/dist/lifecycle/change-set.d.ts.map +1 -1
- package/dist/lifecycle/index.d.ts +2 -0
- package/dist/lifecycle/index.d.ts.map +1 -1
- package/dist/lifecycle/observation-baseline.d.ts +21 -3
- package/dist/lifecycle/observation-baseline.d.ts.map +1 -1
- package/dist/lifecycle/receipt-plan.d.ts +62 -0
- package/dist/lifecycle/receipt-plan.d.ts.map +1 -0
- package/dist/lifecycle/release-ledger.d.ts +20 -0
- package/dist/lifecycle/release-ledger.d.ts.map +1 -1
- package/dist/lifecycle/teardown.d.ts +6 -4
- package/dist/lifecycle/teardown.d.ts.map +1 -1
- package/dist/lifecycle/unobserved-gate.d.ts +67 -0
- package/dist/lifecycle/unobserved-gate.d.ts.map +1 -0
- package/dist/lint/knowledge-checks.d.ts +48 -0
- package/dist/lint/knowledge-checks.d.ts.map +1 -0
- package/dist/lint/output-checks.d.ts +5 -0
- package/dist/lint/output-checks.d.ts.map +1 -0
- package/dist/lint/pipeline-change-gate.d.ts +101 -0
- package/dist/lint/pipeline-change-gate.d.ts.map +1 -0
- package/dist/lint/post-synth.d.ts +12 -0
- package/dist/lint/post-synth.d.ts.map +1 -1
- package/dist/lint/receipt-checks.d.ts +9 -0
- package/dist/lint/receipt-checks.d.ts.map +1 -0
- package/dist/lint/rules/cor022-receipt-leaf.d.ts +13 -0
- package/dist/lint/rules/cor022-receipt-leaf.d.ts.map +1 -0
- package/dist/lint/rules/cor024-receipt-secret-pointer.d.ts +3 -0
- package/dist/lint/rules/cor024-receipt-secret-pointer.d.ts.map +1 -0
- package/dist/lint/rules/evl001-non-literal-expression.d.ts.map +1 -1
- package/dist/lint/rules/index.d.ts +3 -1
- package/dist/lint/rules/index.d.ts.map +1 -1
- package/dist/okf-read.d.ts +78 -0
- package/dist/okf-read.d.ts.map +1 -0
- package/dist/op/builders.d.ts +98 -1
- package/dist/op/builders.d.ts.map +1 -1
- package/dist/op/index.d.ts +4 -2
- package/dist/op/index.d.ts.map +1 -1
- package/dist/op/local-executor.d.ts +2 -1
- package/dist/op/local-executor.d.ts.map +1 -1
- package/dist/op/receipt-store.d.ts +138 -0
- package/dist/op/receipt-store.d.ts.map +1 -0
- package/dist/op/types.d.ts +31 -1
- package/dist/op/types.d.ts.map +1 -1
- package/dist/secret-materialization.d.ts +138 -0
- package/dist/secret-materialization.d.ts.map +1 -0
- package/dist/secret-provenance.d.ts +218 -0
- package/dist/secret-provenance.d.ts.map +1 -0
- package/dist/serializer.d.ts +11 -0
- package/dist/serializer.d.ts.map +1 -1
- package/dist/yaml.d.ts.map +1 -1
- package/package.json +4 -1
- package/src/audit/core.test.ts +57 -0
- package/src/audit/core.ts +0 -0
- package/src/audit/detect-bundle.test.ts +1 -1
- package/src/audit/discover.test.ts +24 -0
- package/src/audit/discover.ts +11 -2
- package/src/audit/rules-doc.ts +11 -1
- package/src/build.test.ts +41 -0
- package/src/build.ts +34 -6
- package/src/cli/commands/__fixtures__/audit-fountain/agents/fleet.yaml +27 -0
- package/src/cli/commands/__fixtures__/audit-fountain/k8s/deploy.yaml +16 -0
- package/src/cli/commands/__fixtures__/audit-fountain-clean/fleet.yaml +20 -0
- package/src/cli/commands/audit.test.ts +53 -0
- package/src/cli/commands/audit.ts +1 -1
- package/src/cli/commands/build.test.ts +80 -0
- package/src/cli/commands/build.ts +106 -8
- package/src/cli/commands/lint.ts +15 -3
- package/src/cli/handlers/explain.test.ts +70 -1
- package/src/cli/handlers/graph.ts +2 -2
- package/src/cli/handlers/lifecycle.test.ts +115 -1
- package/src/cli/handlers/lifecycle.ts +84 -11
- package/src/cli/mcp/resource-handlers.ts +38 -1
- package/src/cli/mcp/server.test.ts +58 -1
- package/src/cli/mcp/tools/explain.ts +51 -2
- package/src/cli/plugins.ts +4 -2
- package/src/cli/reporters/stylish.test.ts +154 -0
- package/src/cli/reporters/stylish.ts +154 -33
- package/src/components/auto-release.ts +6 -0
- package/src/components/registry.test.ts +7 -2
- package/src/components/starter-plugin.ts +17 -0
- package/src/components/verbs/ensure-secret.test.ts +130 -0
- package/src/components/verbs/ensure-secret.ts +79 -0
- package/src/components/verbs/index.ts +8 -0
- package/src/components/verbs/r2-sync.test.ts +107 -0
- package/src/components/verbs/r2-sync.ts +124 -0
- package/src/components/verbs/wrangler.test.ts +170 -0
- package/src/components/verbs/wrangler.ts +241 -0
- package/src/config.test.ts +15 -0
- package/src/config.ts +30 -0
- package/src/deep-observation.test.ts +19 -0
- package/src/deep-observation.ts +17 -0
- package/src/effect-receipt-exclusion.test.ts +190 -0
- package/src/effect-receipt.test.ts +419 -0
- package/src/effect-receipt.ts +412 -0
- package/src/fold/subset.test.ts +26 -0
- package/src/fold/subset.ts +45 -19
- package/src/index.ts +4 -0
- package/src/lexicon.ts +48 -3
- package/src/lifecycle/change-set.ts +46 -7
- package/src/lifecycle/index.ts +2 -0
- package/src/lifecycle/observation-baseline.test.ts +46 -0
- package/src/lifecycle/observation-baseline.ts +33 -1
- package/src/lifecycle/receipt-plan.test.ts +250 -0
- package/src/lifecycle/receipt-plan.ts +249 -0
- package/src/lifecycle/release-ledger.ts +20 -0
- package/src/lifecycle/teardown.test.ts +31 -0
- package/src/lifecycle/teardown.ts +6 -4
- package/src/lifecycle/unobserved-gate.test.ts +109 -0
- package/src/lifecycle/unobserved-gate.ts +102 -0
- package/src/lint/knowledge-checks.test.ts +80 -0
- package/src/lint/knowledge-checks.ts +74 -0
- package/src/lint/output-checks.test.ts +85 -0
- package/src/lint/output-checks.ts +99 -0
- package/src/lint/pipeline-change-gate.test.ts +144 -0
- package/src/lint/pipeline-change-gate.ts +153 -0
- package/src/lint/post-synth.ts +15 -0
- package/src/lint/receipt-checks.test.ts +101 -0
- package/src/lint/receipt-checks.ts +93 -0
- package/src/lint/rules/cor022-receipt-leaf.test.ts +116 -0
- package/src/lint/rules/cor022-receipt-leaf.ts +130 -0
- package/src/lint/rules/cor024-receipt-secret-pointer.test.ts +121 -0
- package/src/lint/rules/cor024-receipt-secret-pointer.ts +218 -0
- package/src/lint/rules/evl001-non-literal-expression.test.ts +27 -0
- package/src/lint/rules/evl001-non-literal-expression.ts +8 -1
- package/src/lint/rules/index.ts +7 -1
- package/src/okf-read.test.ts +149 -0
- package/src/okf-read.ts +197 -0
- package/src/op/builders.ts +139 -1
- package/src/op/effect-step.test.ts +311 -0
- package/src/op/index.ts +10 -3
- package/src/op/local-executor.ts +172 -25
- package/src/op/op.test.ts +25 -2
- package/src/op/receipt-store.ts +211 -0
- package/src/op/types.ts +33 -1
- package/src/secret-materialization.test.ts +199 -0
- package/src/secret-materialization.ts +235 -0
- package/src/secret-provenance.test.ts +388 -0
- package/src/secret-provenance.ts +475 -0
- package/src/serializer.ts +12 -0
- package/src/yaml.test.ts +88 -0
- package/src/yaml.ts +76 -6
package/dist/op/builders.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { OpResource } from "./resource.js";
|
|
2
|
-
import type { OpConfig, PhaseDefinition, StepDefinition, ActivityStep, GateStep } from "./types.js";
|
|
2
|
+
import type { OpConfig, PhaseDefinition, StepDefinition, ActivityStep, GateStep, EffectStep } from "./types.js";
|
|
3
|
+
import { type EffectReceiptDeclaration } from "../effect-receipt.js";
|
|
3
4
|
/**
|
|
4
5
|
* Declare a named, phased Temporal workflow.
|
|
5
6
|
*
|
|
@@ -27,6 +28,38 @@ export declare function gate(signalName: string, opts?: {
|
|
|
27
28
|
timeout?: string;
|
|
28
29
|
description?: string;
|
|
29
30
|
}): GateStep;
|
|
31
|
+
/**
|
|
32
|
+
* Wrap nested steps in read-compare-run-write over an effect receipt (#1834,
|
|
33
|
+
* epic #1703). At run: read the live receipt through the receipt store,
|
|
34
|
+
* compare it against the resolved expectation, and on a match skip the nested
|
|
35
|
+
* steps ("effect already applied"). On a mismatch the nested steps run in
|
|
36
|
+
* authored order, and ONLY when every one of them succeeds is the receipt
|
|
37
|
+
* written — last, once. This step is the sole writer of a receipt (decision
|
|
38
|
+
* 3); a nested-step failure leaves the receipt untouched (stale), so the next
|
|
39
|
+
* run re-proposes the effect.
|
|
40
|
+
*
|
|
41
|
+
* `receipt` is the typed EffectReceipt declaration — import the const from
|
|
42
|
+
* your receipts module. There is no string form: a receipt named by string
|
|
43
|
+
* would sever the step from the declaration that lint, plan, and the lexicon
|
|
44
|
+
* row all key on.
|
|
45
|
+
*
|
|
46
|
+
* A gate authored inside `steps` pauses only when the effect will fire (the
|
|
47
|
+
* matched path never reaches it). The receipt-store activities (`receiptRead`,
|
|
48
|
+
* `receiptWrite`) are provided by the receipt row's lexicon (#1835, aws).
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```ts
|
|
52
|
+
* import { seededReceipt } from "./receipts";
|
|
53
|
+
* phase("Seed", [
|
|
54
|
+
* effect(seededReceipt, [
|
|
55
|
+
* shell("npm run db:seed"),
|
|
56
|
+
* ]),
|
|
57
|
+
* ]),
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
export declare function effect(receipt: EffectReceiptDeclaration, steps: Array<ActivityStep | GateStep>, opts?: {
|
|
61
|
+
description?: string;
|
|
62
|
+
}): EffectStep;
|
|
30
63
|
/** Run an npm build script in the given project directory. `opts.script` selects the script (default `build`, e.g. `build:aws`); `opts.env` adds env vars. */
|
|
31
64
|
export declare const build: (path: string, opts?: Record<string, unknown>) => ActivityStep;
|
|
32
65
|
/** Run `kubectl apply -f <manifest>`. Defaults to the `longInfra` profile (override via `opts.profile`). */
|
|
@@ -38,6 +71,18 @@ export declare const helmInstall: (name: string, chart: string, opts?: {
|
|
|
38
71
|
profile?: ActivityStep["profile"];
|
|
39
72
|
[k: string]: unknown;
|
|
40
73
|
}) => ActivityStep;
|
|
74
|
+
/**
|
|
75
|
+
* Deploy a recorded pinned render by its `sha256:` content digest (chant
|
|
76
|
+
* #1242): the helm lexicon's `helmInstall` activity loads the render from
|
|
77
|
+
* the render store, verifies the digest, and installs those exact bytes as
|
|
78
|
+
* a structure-preserving wrapper chart — no deploy-time render. Defaults to
|
|
79
|
+
* the `longInfra` profile (override via `opts.profile`).
|
|
80
|
+
*/
|
|
81
|
+
export declare const helmInstallPinned: (name: string, contentDigest: string, opts?: {
|
|
82
|
+
namespace?: string;
|
|
83
|
+
profile?: ActivityStep["profile"];
|
|
84
|
+
[k: string]: unknown;
|
|
85
|
+
}) => ActivityStep;
|
|
41
86
|
/** Poll for stack readiness (kubectl rollout, CloudFormation complete, etc). Defaults to the `k8sWait` profile (override via `opts.profile`). */
|
|
42
87
|
export declare const waitForStack: (name: string, opts?: Record<string, unknown>) => ActivityStep;
|
|
43
88
|
/** Poll any operator-backed Kubernetes resource until it reports ready, driven by a data-only readiness spec (CRD-aware; #365). Defaults to the `k8sWait` profile (override via `opts.profile`). */
|
|
@@ -55,6 +100,24 @@ export declare const shell: (cmd: string, opts?: {
|
|
|
55
100
|
env?: Record<string, string>;
|
|
56
101
|
profile?: ActivityStep["profile"];
|
|
57
102
|
}) => ActivityStep;
|
|
103
|
+
/**
|
|
104
|
+
* Ensure a `generated-once` secret exists in the target store (#1829, epic
|
|
105
|
+
* #1365). The op-step surface over the same engine as the `ensure-secret`
|
|
106
|
+
* capability verb (`ensureSecretMaterialization`, core's
|
|
107
|
+
* secret-materialization module): read-then-write — if the secret exists, its
|
|
108
|
+
* declared key-set and any declared `metadata` are verified and the step
|
|
109
|
+
* stops (present means done); if absent, one value per key is minted at
|
|
110
|
+
* apply time and written straight to the store. Never mints over an existing
|
|
111
|
+
* value, never rotates implicitly; a mismatch fails the step loudly, naming
|
|
112
|
+
* key names and metadata keys — never values. No output of the activity
|
|
113
|
+
* carries secret material. The backing activity is provided by the store's
|
|
114
|
+
* lexicon (k8s, #1830).
|
|
115
|
+
*/
|
|
116
|
+
export declare const ensureSecret: (name: string, keys: string[], opts?: {
|
|
117
|
+
metadata?: Record<string, string>;
|
|
118
|
+
profile?: ActivityStep["profile"];
|
|
119
|
+
[k: string]: unknown;
|
|
120
|
+
}) => ActivityStep;
|
|
58
121
|
/** Run `chant teardown` in the given project directory. Uses `longInfra` profile. */
|
|
59
122
|
export declare const teardown: (path: string) => ActivityStep;
|
|
60
123
|
/**
|
|
@@ -108,6 +171,40 @@ export declare const k3dUp: (name: string, opts?: Record<string, unknown>) => Ac
|
|
|
108
171
|
* (chant #1410) — requires `"k3d"` in the project's `lexicons`.
|
|
109
172
|
*/
|
|
110
173
|
export declare const k3dDown: (name: string, opts?: Record<string, unknown>) => ActivityStep;
|
|
174
|
+
/**
|
|
175
|
+
* Run the pinned k3s installer against a reachable host (`role`: `"server"`
|
|
176
|
+
* or `"agent"`). Idempotent on an already-installed matching version.
|
|
177
|
+
* Defaults to the `longInfra` profile (the installer downloads and starts
|
|
178
|
+
* the binary); override via `opts.profile`.
|
|
179
|
+
*
|
|
180
|
+
* The implementation lives in the k3s lexicon (chant #1601) — the project's
|
|
181
|
+
* `chant.config.ts` must list `"k3s"` in `lexicons` for the activity to load.
|
|
182
|
+
* Bounded exactly as `k3dUp`/`k3dDown` (chant #1410): drives the reachable-host
|
|
183
|
+
* case only, no host provisioning, no SSH orchestration.
|
|
184
|
+
*
|
|
185
|
+
* `opts` accepts `configFile` (required — path to the chant-emitted
|
|
186
|
+
* config.yaml, passed as `--config`), `version` (overrides the lexicon's
|
|
187
|
+
* pinned `INSTALL_K3S_VERSION`), and `tokenFile` (path to a file holding the
|
|
188
|
+
* join token, passed to the installer as `K3S_TOKEN_FILE`). There is no
|
|
189
|
+
* `token` option — the join secret's value never travels through this step;
|
|
190
|
+
* only a file path does (the #1601 token boundary, same stance as #1365).
|
|
191
|
+
*/
|
|
192
|
+
export declare const k3sInstall: (role: "server" | "agent", opts: {
|
|
193
|
+
configFile: string;
|
|
194
|
+
version?: string;
|
|
195
|
+
tokenFile?: string;
|
|
196
|
+
profile?: ActivityStep["profile"];
|
|
197
|
+
[k: string]: unknown;
|
|
198
|
+
}) => ActivityStep;
|
|
199
|
+
/**
|
|
200
|
+
* Uninstall k3s from a reachable host (`role`: `"server"` or `"agent"`).
|
|
201
|
+
* Defaults to the `fastIdempotent` profile (override via `opts.profile`).
|
|
202
|
+
* Implementation lives in the k3s lexicon (chant #1601) — requires `"k3s"`
|
|
203
|
+
* in the project's `lexicons`. A host where k3s was never installed is a
|
|
204
|
+
* no-op success, the same shape as `k3dDown` against an already-gone
|
|
205
|
+
* cluster.
|
|
206
|
+
*/
|
|
207
|
+
export declare const k3sUninstall: (role: "server" | "agent", opts?: Record<string, unknown>) => ActivityStep;
|
|
111
208
|
/**
|
|
112
209
|
* Boot a local Floci AWS emulator in Docker and point subsequent steps at it —
|
|
113
210
|
* sets `AWS_ENDPOINT_URL` + test creds in the process env so a following
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builders.d.ts","sourceRoot":"","sources":["../../src/op/builders.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,cAAc,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"builders.d.ts","sourceRoot":"","sources":["../../src/op/builders.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,cAAc,EAAE,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC7G,OAAO,EAAmB,KAAK,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAKnF;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,EAAE,CAAC,MAAM,EAAE,QAAQ,GAAG,YAAY,CAAC,OAAO,UAAU,CAAC,CAEpE;AAED,mEAAmE;AACnE,wBAAgB,KAAK,C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iHAAiH;AACjH,eAAO,MAAM,iBAAiB,GAAI,MAAM;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;CACnC,KAAG,YAGH,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS,GAAI,OAAM;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;CAC9B,KAAG,YAGR,CAAC;AAEF,+JAA+J;AAC/J,eAAO,MAAM,WAAW,GAAI,OAAM;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;CAC9B,KAAG,YAGR,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,GAAI,OAAO;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,KAAG,YAKjE,CAAC"}
|
package/dist/op/index.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
export { Op, phase, activity, gate, build, kubectlApply, helmInstall, waitForStack, waitForReady, gitlabPipeline, lifecycleSnapshot, shell, teardown, envTeardown, k3dUp, k3dDown, flociUp, flociDown, flociAzUp, flociAzDown, flociGcpUp, flociGcpDown, httpCheck, azGroupEnsure, azGroupDelete, azApply, azDelete, awsApply, awsDelete, gcpApply, gcpDelete, policyGate, spriteCreate, spriteExec, spriteCheckpoint, spriteRestore, listCheckpoints, spriteDestroy, spriteWriteFile, spriteReadFile, spriteListDir, spriteRemove, spriteApplyNetworkPolicy, spriteApplyServices, spriteTaskCreate, spriteTaskRefresh, spriteTaskRelease, spritesUp, spritesDown } from "./builders.js";
|
|
1
|
+
export { Op, phase, activity, gate, effect, build, kubectlApply, helmInstall, helmInstallPinned, waitForStack, waitForReady, gitlabPipeline, lifecycleSnapshot, shell, ensureSecret, teardown, envTeardown, k3dUp, k3dDown, k3sInstall, k3sUninstall, flociUp, flociDown, flociAzUp, flociAzDown, flociGcpUp, flociGcpDown, httpCheck, azGroupEnsure, azGroupDelete, azApply, azDelete, awsApply, awsDelete, gcpApply, gcpDelete, policyGate, spriteCreate, spriteExec, spriteCheckpoint, spriteRestore, listCheckpoints, spriteDestroy, spriteWriteFile, spriteReadFile, spriteListDir, spriteRemove, spriteApplyNetworkPolicy, spriteApplyServices, spriteTaskCreate, spriteTaskRefresh, spriteTaskRelease, spritesUp, spritesDown } from "./builders.js";
|
|
2
2
|
export { OpResource } from "./resource.js";
|
|
3
3
|
export { safeHeartbeat, sleep } from "./activity-runtime.js";
|
|
4
4
|
export { emulatorLifecycle, emulatorsOf, endpointEnvVars } from "./emulator-lifecycle.js";
|
|
5
5
|
export type { EmulatorSpec, EmulatorCapability, EmulatorDeclaration, EmulatorUpArgs, EmulatorLifecycle } from "./emulator-lifecycle.js";
|
|
6
6
|
export { checkFreshness, compare, formatResult, latestRelease, parseVersion, unpinned } from "./emulator-freshness.js";
|
|
7
7
|
export type { FreshnessResult } from "./emulator-freshness.js";
|
|
8
|
-
export type { OpConfig, PhaseDefinition, StepDefinition, ActivityStep, GateStep } from "./types.js";
|
|
8
|
+
export type { OpConfig, PhaseDefinition, StepDefinition, ActivityStep, GateStep, EffectStep } from "./types.js";
|
|
9
|
+
export { receiptActivities, receiptCheckInput } from "./receipt-store.js";
|
|
10
|
+
export type { ReceiptStore, EffectReceiptRef, ReceiptCheckInput, ReceiptActivities, ReceiptActivityOptions, ReceiptReadArgs, ReceiptReadResult, ReceiptWriteArgs, ReceiptStalenessArgs, ReceiptStalenessResult, ReceiptStaleFinding, } from "./receipt-store.js";
|
|
9
11
|
export { discoverOps } from "./discover.js";
|
|
10
12
|
export type { DiscoveredOp, OpDiscoveryResult } from "./discover.js";
|
|
11
13
|
export { loadActivities, loadProfiles, resolveActivity } from "./activity-registry.js";
|
package/dist/op/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/op/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/op/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,YAAY,EAAE,YAAY,EAClH,cAAc,EAAE,iBAAiB,EAAE,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,EAC7F,UAAU,EAAE,YAAY,EAAE,OAAO,EAAE,SAAS,EAC5C,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAC3D,aAAa,EAAE,aAAa,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EACrG,YAAY,EAAE,UAAU,EAAE,gBAAgB,EAAE,aAAa,EAAE,eAAe,EAAE,aAAa,EACzF,eAAe,EAAE,cAAc,EAAE,aAAa,EAAE,YAAY,EAC5D,wBAAwB,EAAE,mBAAmB,EAC7C,gBAAgB,EAAE,iBAAiB,EAAE,iBAAiB,EACtD,SAAS,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EA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AgB,CAAC"}
|
|
@@ -42,7 +42,8 @@ export declare class OpRunFailure extends Error {
|
|
|
42
42
|
}
|
|
43
43
|
/** Parse a Temporal duration string ("5m", "30s", "1h30m", "100ms") to ms. */
|
|
44
44
|
export declare function parseDuration(s: string): number;
|
|
45
|
-
/** Find the first gate step anywhere in the Op (phases + onFailure
|
|
45
|
+
/** Find the first gate step anywhere in the Op (phases + onFailure, including
|
|
46
|
+
* gates nested inside effect steps), if any. */
|
|
46
47
|
export declare function findGate(config: OpConfig): GateStep | undefined;
|
|
47
48
|
/**
|
|
48
49
|
* Execute an Op locally. Resolves with the run result on success; rejects with
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-executor.d.ts","sourceRoot":"","sources":["../../src/op/local-executor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAiC,QAAQ,
|
|
1
|
+
{"version":3,"file":"local-executor.d.ts","sourceRoot":"","sources":["../../src/op/local-executor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAiC,QAAQ,EAA8B,MAAM,SAAS,CAAC;AAC7G,OAAO,EAAmB,KAAK,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAK7F,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,MAAM,EAAE,IAAI,GAAG,MAAM,GAAG,SAAS,CAAC;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE,CAAC;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,OAAO,CAAC;CACb;AAID,kFAAkF;AAClF,qBAAa,yBAA0B,SAAQ,KAAK;aACtB,UAAU,EAAE,MAAM;gBAAlB,UAAU,EAAE,MAAM;CAO/C;AAED,mFAAmF;AACnF,qBAAa,YAAa,SAAQ,KAAK;aACT,MAAM,EAAE,WAAW;gBAAnB,MAAM,EAAE,WAAW;CAIhD;AAmBD,8EAA8E;AAC9E,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAU/C;AAWD;gDACgD;AAChD,wBAAgB,QAAQ,CAAC,MAAM,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAY/D;AAsRD;;;;;GAKG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,QAAQ,EAChB,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,EACnC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,EACzC,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,WAAW,CAAC,CA2CtB"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Receipt store seam (#1834, epic #1703) — how the `effect()` step and the
|
|
3
|
+
* receipt-reading Ops reach a materialized receipt without knowing which
|
|
4
|
+
* lexicon materializes it.
|
|
5
|
+
*
|
|
6
|
+
* The store is injectable: core defines the {@link ReceiptStore} interface and
|
|
7
|
+
* the activity contracts; the receipt row's lexicon implements the store over
|
|
8
|
+
* its own resource (#1835's aws row over `AWS::SSM::Parameter`) and exports
|
|
9
|
+
* the bound activities (`receiptRead`, `receiptWrite`, `receiptStaleness`)
|
|
10
|
+
* from its `op/activities` module via {@link receiptActivities}. The activity
|
|
11
|
+
* registry then resolves them by name, exactly like `ensureSecret`
|
|
12
|
+
* (#1829/#1830, provided by the k8s lexicon). Tests bind a mock store the
|
|
13
|
+
* same way.
|
|
14
|
+
*
|
|
15
|
+
* Write discipline (epic #1703 decision log, item 3): the `effect()` step is
|
|
16
|
+
* the SOLE writer of a receipt — on success of its nested steps, last. The
|
|
17
|
+
* store interface carries a `write`, but only the effect step's emitted
|
|
18
|
+
* read-compare-run-write (and its local-executor twin) reaches it.
|
|
19
|
+
* `receiptStaleness` — the WatchOp phase (#1834) — is read-only by
|
|
20
|
+
* construction: it never touches `write` and runs nothing.
|
|
21
|
+
*
|
|
22
|
+
* Expectation resolution follows the resolution split (decision 5): a fully
|
|
23
|
+
* static receipt's expectation is stamped at synthesis and rides the step
|
|
24
|
+
* data ({@link receiptCheckInput}); a hash-flavor receipt with reference
|
|
25
|
+
* inputs resolves at run, through the store lexicon's
|
|
26
|
+
* {@link ReceiptActivityOptions.resolveExpectation} hook — never by hashing
|
|
27
|
+
* placeholders.
|
|
28
|
+
*/
|
|
29
|
+
import { type EffectReceiptDeclaration, type EffectReceiptFlavor } from "../effect-receipt.js";
|
|
30
|
+
/**
|
|
31
|
+
* The serializable identity + declaration data of an effect receipt — what an
|
|
32
|
+
* `effect()` step and a `receiptStaleness` check carry through codegen. Built
|
|
33
|
+
* from the typed {@link EffectReceiptDeclaration} only ({@link receiptCheckInput});
|
|
34
|
+
* there is no string form. Reference inputs stay in placeholder form.
|
|
35
|
+
*/
|
|
36
|
+
export interface EffectReceiptRef {
|
|
37
|
+
/** The receipt's own name (the export-level identity of the witness). */
|
|
38
|
+
name: string;
|
|
39
|
+
/** The effect this receipt witnesses. */
|
|
40
|
+
effect: string;
|
|
41
|
+
/** How the receipt is compared: mere presence, or a digest of the inputs. */
|
|
42
|
+
flavor: EffectReceiptFlavor;
|
|
43
|
+
/** The effect's inputs as recorded at synthesis (references as placeholders). */
|
|
44
|
+
inputs: Record<string, unknown>;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The injectable seam over the materialized receipt (#1835 implements it for
|
|
48
|
+
* SSM; tests implement it with a map). `read` returns the receipt's current
|
|
49
|
+
* stored value, or `undefined` when the receipt is absent. `write` stores the
|
|
50
|
+
* expectation as the new value — called only by the effect step, on success,
|
|
51
|
+
* last.
|
|
52
|
+
*/
|
|
53
|
+
export interface ReceiptStore {
|
|
54
|
+
read(receipt: EffectReceiptRef): Promise<string | undefined>;
|
|
55
|
+
write(receipt: EffectReceiptRef, expectation: string): Promise<void>;
|
|
56
|
+
}
|
|
57
|
+
/** One receipt to check: its identity plus, when the receipt is fully static,
|
|
58
|
+
* the expectation stamped at synthesis. */
|
|
59
|
+
export interface ReceiptCheckInput {
|
|
60
|
+
receipt: EffectReceiptRef;
|
|
61
|
+
/** Present when the expectation was computable at synthesis; absent when
|
|
62
|
+
* reference inputs resolve at run (decision 5). */
|
|
63
|
+
expectation?: string;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Snapshot a typed receipt declaration into check-input data: the
|
|
67
|
+
* {@link EffectReceiptRef} plus the synthesis-time expectation when the
|
|
68
|
+
* receipt is fully static. Used by the `effect()` builder and by WatchOp's
|
|
69
|
+
* staleness phase — the single place "static enough to hash now" is decided.
|
|
70
|
+
*/
|
|
71
|
+
export declare function receiptCheckInput(receipt: EffectReceiptDeclaration): ReceiptCheckInput;
|
|
72
|
+
/** Args of the `receiptRead` activity, as the effect step's codegen emits them. */
|
|
73
|
+
export interface ReceiptReadArgs extends ReceiptCheckInput {
|
|
74
|
+
}
|
|
75
|
+
/** Result of the `receiptRead` activity. `current` is `null` (not `undefined`)
|
|
76
|
+
* for an absent receipt so the value survives JSON transport. */
|
|
77
|
+
export interface ReceiptReadResult {
|
|
78
|
+
/** The receipt's live stored value, or null when absent. */
|
|
79
|
+
current: string | null;
|
|
80
|
+
/** The resolved expectation the workflow compares and later writes. */
|
|
81
|
+
expectation: string;
|
|
82
|
+
/** Convenience: `current === expectation`. */
|
|
83
|
+
applied: boolean;
|
|
84
|
+
}
|
|
85
|
+
/** Args of the `receiptWrite` activity — the receipt and the resolved
|
|
86
|
+
* expectation returned by the preceding `receiptRead`. */
|
|
87
|
+
export interface ReceiptWriteArgs {
|
|
88
|
+
receipt: EffectReceiptRef;
|
|
89
|
+
expectation: string;
|
|
90
|
+
}
|
|
91
|
+
/** Args of the read-only `receiptStaleness` activity (WatchOp). */
|
|
92
|
+
export interface ReceiptStalenessArgs {
|
|
93
|
+
receipts: ReceiptCheckInput[];
|
|
94
|
+
}
|
|
95
|
+
/** One stale receipt, reported as a finding — never acted on. */
|
|
96
|
+
export interface ReceiptStaleFinding {
|
|
97
|
+
/** The receipt's name. */
|
|
98
|
+
receipt: string;
|
|
99
|
+
/** The effect the receipt witnesses. */
|
|
100
|
+
effect: string;
|
|
101
|
+
/** `absent` — no receipt stored; `differs` — stored value is not the expectation. */
|
|
102
|
+
kind: "absent" | "differs";
|
|
103
|
+
/** The resolved expectation. */
|
|
104
|
+
expected: string;
|
|
105
|
+
/** The live stored value (present only for `differs`). */
|
|
106
|
+
current?: string;
|
|
107
|
+
}
|
|
108
|
+
/** Result of the `receiptStaleness` activity. */
|
|
109
|
+
export interface ReceiptStalenessResult {
|
|
110
|
+
stale: boolean;
|
|
111
|
+
findings: ReceiptStaleFinding[];
|
|
112
|
+
}
|
|
113
|
+
/** Options for {@link receiptActivities}. */
|
|
114
|
+
export interface ReceiptActivityOptions {
|
|
115
|
+
/**
|
|
116
|
+
* Resolve a reference-carrying receipt's expectation at run (decision 5) —
|
|
117
|
+
* the store lexicon's hook to deploy-time values, typically wrapping core's
|
|
118
|
+
* `resolveReceiptExpectation`. Without it, a check input that carries no
|
|
119
|
+
* synthesis-time expectation fails loudly rather than hashing placeholders.
|
|
120
|
+
*/
|
|
121
|
+
resolveExpectation?: (receipt: EffectReceiptRef) => Promise<string> | string;
|
|
122
|
+
}
|
|
123
|
+
/** The three receipt activities, bound to one store. */
|
|
124
|
+
export interface ReceiptActivities {
|
|
125
|
+
receiptRead: (args: ReceiptReadArgs, signal?: AbortSignal) => Promise<ReceiptReadResult>;
|
|
126
|
+
receiptWrite: (args: ReceiptWriteArgs, signal?: AbortSignal) => Promise<{
|
|
127
|
+
written: true;
|
|
128
|
+
receipt: string;
|
|
129
|
+
}>;
|
|
130
|
+
receiptStaleness: (args: ReceiptStalenessArgs, signal?: AbortSignal) => Promise<ReceiptStalenessResult>;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Bind the receipt activities to a store. The store's lexicon calls this once
|
|
134
|
+
* and re-exports the result from its `op/activities` module; the activity
|
|
135
|
+
* registry picks the functions up by name for both executors.
|
|
136
|
+
*/
|
|
137
|
+
export declare function receiptActivities(store: ReceiptStore, opts?: ReceiptActivityOptions): ReceiptActivities;
|
|
138
|
+
//# sourceMappingURL=receipt-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"receipt-store.d.ts","sourceRoot":"","sources":["../../src/op/receipt-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAKL,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACzB,MAAM,mBAAmB,CAAC;AAE3B;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,yEAAyE;IACzE,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,6EAA6E;IAC7E,MAAM,EAAE,mBAAmB,CAAC;IAC5B,iFAAiF;IACjF,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAC7D,KAAK,CAAC,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACtE;AAED;2CAC2C;AAC3C,MAAM,WAAW,iBAAiB;IAChC,O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IAChC,WAAW,EAAE,CAAC,IAAI,EAAE,eAAe,EAAE,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACzF,YAAY,EAAE,CAAC,IAAI,EAAE,gBAAgB,EAAE,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC;QAAE,OAAO,EAAE,IAAI,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC5G,gBAAgB,EAAE,CAAC,IAAI,EAAE,oBAAoB,EAAE,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,sBAAsB,CAAC,CAAC;CACzG;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,CAAC,EAAE,sBAAsB,GAAG,iBAAiB,CAuCvG"}
|
package/dist/op/types.d.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* These types are intentionally free of Temporal SDK imports so they can live
|
|
5
5
|
* in core without pulling in @temporalio/* as a dependency.
|
|
6
6
|
*/
|
|
7
|
+
import type { EffectReceiptRef } from "./receipt-store.js";
|
|
7
8
|
export interface OpConfig {
|
|
8
9
|
/** Kebab-case identifier. Used as the workflow function name (camelCase) and output directory name. */
|
|
9
10
|
name: string;
|
|
@@ -30,7 +31,7 @@ export interface PhaseDefinition {
|
|
|
30
31
|
/** Run all steps concurrently via Promise.all. Default: false. */
|
|
31
32
|
parallel?: boolean;
|
|
32
33
|
}
|
|
33
|
-
export type StepDefinition = ActivityStep | GateStep;
|
|
34
|
+
export type StepDefinition = ActivityStep | GateStep | EffectStep;
|
|
34
35
|
export interface ActivityStep {
|
|
35
36
|
kind: "activity";
|
|
36
37
|
/** Name of the exported activity function in the pre-built activity library. */
|
|
@@ -59,6 +60,35 @@ export interface ActivityStep {
|
|
|
59
60
|
from?: string;
|
|
60
61
|
};
|
|
61
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* Read-compare-run-write over an effect receipt (#1834, epic #1703). The
|
|
65
|
+
* runtime reads the live receipt through the receipt store, compares it
|
|
66
|
+
* against the resolved expectation, skips the nested steps on a match, and
|
|
67
|
+
* otherwise runs them — writing the receipt only when every nested step
|
|
68
|
+
* succeeded, last. A nested-step failure leaves the receipt untouched
|
|
69
|
+
* (stale), so the next run re-proposes the effect.
|
|
70
|
+
*
|
|
71
|
+
* Authored via the `effect()` builder, which takes the typed EffectReceipt
|
|
72
|
+
* declaration only — there is no string form.
|
|
73
|
+
*/
|
|
74
|
+
export interface EffectStep {
|
|
75
|
+
kind: "effect";
|
|
76
|
+
/** Receipt identity + declaration data (references in placeholder form). */
|
|
77
|
+
receipt: EffectReceiptRef;
|
|
78
|
+
/**
|
|
79
|
+
* The expectation stamped at synthesis when the receipt is fully static;
|
|
80
|
+
* absent when reference inputs resolve at run (#1703 decision 5).
|
|
81
|
+
*/
|
|
82
|
+
expectation?: string;
|
|
83
|
+
/**
|
|
84
|
+
* Steps run when the live receipt does not match, in authored order. A gate
|
|
85
|
+
* authored here pauses only when the effect will fire. Effect steps do not
|
|
86
|
+
* nest.
|
|
87
|
+
*/
|
|
88
|
+
steps: Array<ActivityStep | GateStep>;
|
|
89
|
+
/** Annotation carried into the generated workflow as a comment. */
|
|
90
|
+
description?: string;
|
|
91
|
+
}
|
|
62
92
|
export interface GateStep {
|
|
63
93
|
kind: "gate";
|
|
64
94
|
/** Signal name. The generated workflow waits for this signal before continuing. */
|
package/dist/op/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/op/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,QAAQ;IACvB,uGAAuG;IACvG,IAAI,EAAE,MAAM,CAAC;IACb,mFAAmF;IACnF,QAAQ,EAAE,MAAM,CAAC;IACjB,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kFAAkF;IAClF,SAAS,C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,EAAE,cAAc,EAAE,CAAC;IACxB,kEAAkE;IAClE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG,QAAQ,GAAG,UAAU,CAAC;AAElE,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,UAAU,CAAC;IACjB,gFAAgF;IAChF,EAAE,EAAE,MAAM,CAAC;IACX,iDAAiD;IACjD,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B;;;OAGG;IACH,OAAO,CAAC,EAAE,gBAAgB,GAAG,WAAW,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,aAAa,CAAC;IAChG;;;;;;;;;;;OAWG;IACH,gBAAgB,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACpD;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,QAAQ,CAAC;IACf,4EAA4E;IAC5E,OAAO,EAAE,gBAAgB,CAAC;IAC1B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,KAAK,EAAE,KAAK,CAAC,YAAY,GAAG,QAAQ,CAAC,CAAC;IACtC,mEAAmE;IACnE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,mFAAmF;IACnF,UAAU,EAAE,MAAM,CAAC;IACnB,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8EAA8E;IAC9E,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated-once secret materialization — the one implementation behind the
|
|
3
|
+
* `ensure-secret` capability verb (components/verbs/ensure-secret.ts) and the
|
|
4
|
+
* `ensureSecret(...)` op step builder (op/builders.ts). chant #1829, epic
|
|
5
|
+
* #1365 decisions 3 and 6.
|
|
6
|
+
*
|
|
7
|
+
* The contract is read-then-write:
|
|
8
|
+
*
|
|
9
|
+
* - Absent: mint once, through the store adapter, and report `created`.
|
|
10
|
+
* - Present: verify presence, the declared key-set, and any declared
|
|
11
|
+
* metadata, then STOP — present means done. Never mint over an existing
|
|
12
|
+
* value. Never rotate implicitly. A re-run of a whole deploy leaves the
|
|
13
|
+
* stored bytes untouched.
|
|
14
|
+
* - Mismatch: fail loudly, naming what mismatched — key names and metadata
|
|
15
|
+
* keys, never a value or a value-derived hash (#1365 decision 6).
|
|
16
|
+
*
|
|
17
|
+
* The constitutional line (../secret-provenance.ts): no code path here may
|
|
18
|
+
* hold, log, hash, or compare a secret value. That is structural, not
|
|
19
|
+
* discipline:
|
|
20
|
+
*
|
|
21
|
+
* - {@link ensureSecretMaterialization} never calls the generator. It hands
|
|
22
|
+
* the generator to the store adapter's `create`, which consumes the
|
|
23
|
+
* material as it writes. The engine's result type has no field that could
|
|
24
|
+
* carry material.
|
|
25
|
+
* - The generator produces {@link SecretMaterial}, an opaque single-use
|
|
26
|
+
* handle. The plaintext lives in a module-private WeakMap, not on the
|
|
27
|
+
* object: enumeration, `JSON.stringify`, `String(...)`, and `util.inspect`
|
|
28
|
+
* all see only a redaction marker. Only {@link consumeSecretMaterial} —
|
|
29
|
+
* meant for store adapters, at the write — yields the plaintext, exactly
|
|
30
|
+
* once; a second consume throws.
|
|
31
|
+
* - `describe` returns key names and metadata only, so the mismatch check
|
|
32
|
+
* has nothing value-shaped to compare even by accident.
|
|
33
|
+
*
|
|
34
|
+
* Store adapters are per-provider (#1830 is the k8s row); core defines only
|
|
35
|
+
* the seam.
|
|
36
|
+
*/
|
|
37
|
+
/**
|
|
38
|
+
* A single-use, opaque handle to generated secret material. The plaintext is
|
|
39
|
+
* not a property of this object — it lives in a module-private WeakMap — so
|
|
40
|
+
* spreading, enumerating, stringifying, or logging the handle yields only a
|
|
41
|
+
* redaction marker. A store adapter redeems it with
|
|
42
|
+
* {@link consumeSecretMaterial} at the moment it writes; nothing else can.
|
|
43
|
+
*/
|
|
44
|
+
export declare class SecretMaterial {
|
|
45
|
+
private constructor();
|
|
46
|
+
/** Wrap plaintext in an opaque handle. Call inside a generator only. */
|
|
47
|
+
static mint(plaintext: string): SecretMaterial;
|
|
48
|
+
toString(): string;
|
|
49
|
+
toJSON(): string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Redeem a {@link SecretMaterial} handle for its plaintext — exactly once.
|
|
53
|
+
* For store adapters only, at the write to the backing store. Throws if the
|
|
54
|
+
* handle was already consumed (or was never minted here): material flows to
|
|
55
|
+
* the store exactly once and is retained nowhere.
|
|
56
|
+
*/
|
|
57
|
+
export declare function consumeSecretMaterial(material: SecretMaterial): string;
|
|
58
|
+
/**
|
|
59
|
+
* Produces the material for one key of a secret being minted. Called by the
|
|
60
|
+
* store adapter (never by the engine) once per declared key, at create time —
|
|
61
|
+
* generation is apply-time I/O, never synthesis.
|
|
62
|
+
*/
|
|
63
|
+
export type SecretMaterialGenerator = (key: string) => SecretMaterial | Promise<SecretMaterial>;
|
|
64
|
+
/** 32 bytes from the CSPRNG, base64url — the default mint. */
|
|
65
|
+
export declare const defaultSecretMaterialGenerator: SecretMaterialGenerator;
|
|
66
|
+
/** What `describe` reports about an existing secret: key NAMES and metadata. Never values. */
|
|
67
|
+
export interface SecretStoreDescription {
|
|
68
|
+
/** The key names present in the stored secret. */
|
|
69
|
+
readonly keys: readonly string[];
|
|
70
|
+
/** Store metadata (e.g. k8s labels/annotations the provider surfaces). */
|
|
71
|
+
readonly metadata?: Readonly<Record<string, string>>;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* A provider's view of one secret store — the seam #1830 (k8s) and future
|
|
75
|
+
* provider rows implement. `create` receives the generator and consumes each
|
|
76
|
+
* key's material as it writes; no method returns material.
|
|
77
|
+
*/
|
|
78
|
+
export interface SecretStoreAdapter {
|
|
79
|
+
/** Whether a secret of this name exists in the store. */
|
|
80
|
+
exists(name: string): Promise<boolean>;
|
|
81
|
+
/** Key names and metadata of an existing secret. Never values. */
|
|
82
|
+
describe(name: string): Promise<SecretStoreDescription>;
|
|
83
|
+
/**
|
|
84
|
+
* Create the secret, minting material for each declared key via
|
|
85
|
+
* `generate` and writing it straight to the store. Returns nothing:
|
|
86
|
+
* material must not travel back through this seam.
|
|
87
|
+
*/
|
|
88
|
+
create(name: string, keys: readonly string[], generate: SecretMaterialGenerator): Promise<void>;
|
|
89
|
+
}
|
|
90
|
+
/** The declared contract to ensure — names and keys only, never material. */
|
|
91
|
+
export interface EnsureSecretSpec {
|
|
92
|
+
/** The secret's name as the store knows it. */
|
|
93
|
+
readonly name: string;
|
|
94
|
+
/** The declared key-set. Creation mints one value per key; verification compares names. */
|
|
95
|
+
readonly keys: readonly string[];
|
|
96
|
+
/** Declared metadata an existing secret must carry (compared per key; mismatches are reported by KEY). */
|
|
97
|
+
readonly metadata?: Readonly<Record<string, string>>;
|
|
98
|
+
}
|
|
99
|
+
/** What `ensureSecretMaterialization` did. No field can carry material. */
|
|
100
|
+
export interface EnsureSecretOutcome {
|
|
101
|
+
/** `created` = minted now (first materialization); `present` = existed and matched the contract (no write). */
|
|
102
|
+
readonly outcome: "created" | "present";
|
|
103
|
+
/** The secret's name. */
|
|
104
|
+
readonly name: string;
|
|
105
|
+
/** The declared key names the contract was checked (or minted) against. */
|
|
106
|
+
readonly keys: readonly string[];
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* The loud failure: an existing secret does not match its declared contract.
|
|
110
|
+
* `mismatches` names what differed — key names and metadata keys only.
|
|
111
|
+
* Constructing one with anything value-shaped is the reviewer's tripwire;
|
|
112
|
+
* nothing in this module can, because nothing in this module holds a value.
|
|
113
|
+
*/
|
|
114
|
+
export declare class SecretContractMismatchError extends Error {
|
|
115
|
+
/** The secret's name. */
|
|
116
|
+
readonly secretName: string;
|
|
117
|
+
/** Human-readable mismatch descriptions, naming keys — never values. */
|
|
118
|
+
readonly mismatches: readonly string[];
|
|
119
|
+
constructor(
|
|
120
|
+
/** The secret's name. */
|
|
121
|
+
secretName: string,
|
|
122
|
+
/** Human-readable mismatch descriptions, naming keys — never values. */
|
|
123
|
+
mismatches: readonly string[]);
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Ensure a `generated-once` secret exists and matches its declared contract.
|
|
127
|
+
* Read-then-write:
|
|
128
|
+
*
|
|
129
|
+
* - Absent: `store.create(name, keys, generate)` — one mint, then done.
|
|
130
|
+
* - Present and matching: no write of any kind; returns `present`.
|
|
131
|
+
* - Present and mismatching: throws {@link SecretContractMismatchError}
|
|
132
|
+
* naming the missing/unexpected key names and mismatched metadata keys.
|
|
133
|
+
*
|
|
134
|
+
* The engine never calls `generate` itself and never sees what the adapter
|
|
135
|
+
* writes; its return value carries names only.
|
|
136
|
+
*/
|
|
137
|
+
export declare function ensureSecretMaterialization(store: SecretStoreAdapter, spec: EnsureSecretSpec, generate?: SecretMaterialGenerator): Promise<EnsureSecretOutcome>;
|
|
138
|
+
//# sourceMappingURL=secret-materialization.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secret-materialization.d.ts","sourceRoot":"","sources":["../src/secret-materialization.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAWH;;;;;;GAMG;AACH,qBAAa,cAAc;IACzB,OAAO;IAEP,wEAAwE;IACxE,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,cAAc;IAM9C,QAAQ,IAAI,MAAM;IAIlB,MAAM,IAAI,MAAM;CAQjB;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,cAAc,GAAG,MAAM,CAStE;AAED;;;;GAIG;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,GAAG,EAAE,MAAM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