@intentius/chant 0.45.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/check-lexicon.d.ts +14 -0
- package/dist/cli/commands/check-lexicon.d.ts.map +1 -1
- package/dist/cli/commands/lexicon-surface-diff.d.ts +6 -0
- package/dist/cli/commands/lexicon-surface-diff.d.ts.map +1 -1
- package/dist/cli/commands/lint.d.ts.map +1 -1
- package/dist/cli/handlers/lifecycle.d.ts +13 -0
- package/dist/cli/handlers/lifecycle.d.ts.map +1 -1
- package/dist/cli/handlers/search.d.ts.map +1 -1
- package/dist/cli/main.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/registry.d.ts +7 -0
- package/dist/cli/registry.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/codegen/lexicon-regen.d.ts +11 -0
- package/dist/codegen/lexicon-regen.d.ts.map +1 -1
- package/dist/codegen/validate.d.ts +10 -0
- package/dist/codegen/validate.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 +54 -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/env.d.ts +12 -1
- package/dist/env.d.ts.map +1 -1
- 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 +223 -2
- 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 +3 -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 +132 -0
- package/dist/lifecycle/teardown.d.ts.map +1 -0
- package/dist/lifecycle/unobserved-gate.d.ts +67 -0
- package/dist/lifecycle/unobserved-gate.d.ts.map +1 -0
- package/dist/lint/engine.d.ts +6 -2
- package/dist/lint/engine.d.ts.map +1 -1
- 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/rule.d.ts +31 -0
- package/dist/lint/rule.d.ts.map +1 -1
- package/dist/lint/rules/cor021-env-literal-name.d.ts +3 -0
- package/dist/lint/rules/cor021-env-literal-name.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 +4 -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 +134 -8
- 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/testing.d.ts +136 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/yaml.d.ts.map +1 -1
- package/package.json +9 -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 +211 -0
- package/src/cli/commands/build.ts +126 -8
- package/src/cli/commands/check-lexicon.test.ts +45 -1
- package/src/cli/commands/check-lexicon.ts +45 -0
- package/src/cli/commands/lexicon-surface-diff.ts +9 -0
- package/src/cli/commands/lexicon-surface-diff.update.test.ts +112 -0
- package/src/cli/commands/lint.ts +32 -7
- package/src/cli/handlers/explain.test.ts +70 -1
- package/src/cli/handlers/graph.ts +4 -4
- package/src/cli/handlers/lifecycle.test.ts +345 -1
- package/src/cli/handlers/lifecycle.ts +300 -11
- package/src/cli/handlers/search.ts +5 -2
- package/src/cli/main.ts +12 -1
- 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/registry.ts +7 -0
- package/src/cli/reporters/stylish.test.ts +154 -0
- package/src/cli/reporters/stylish.ts +154 -33
- package/src/codegen/lexicon-regen.ts +19 -1
- package/src/codegen/validate.test.ts +33 -0
- package/src/codegen/validate.ts +21 -2
- 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 +55 -0
- package/src/config.ts +88 -1
- 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/env.test.ts +35 -1
- package/src/env.ts +17 -3
- 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 +227 -2
- package/src/lifecycle/change-set.ts +46 -7
- package/src/lifecycle/index.ts +3 -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 +568 -0
- package/src/lifecycle/teardown.ts +359 -0
- package/src/lifecycle/unobserved-gate.test.ts +109 -0
- package/src/lifecycle/unobserved-gate.ts +102 -0
- package/src/lint/engine.ts +7 -1
- 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/rule.ts +23 -0
- package/src/lint/rules/cor021-env-literal-name.test.ts +128 -0
- package/src/lint/rules/cor021-env-literal-name.ts +114 -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 +10 -1
- package/src/okf-read.test.ts +149 -0
- package/src/okf-read.ts +197 -0
- package/src/op/builders.ts +179 -8
- 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/testing.test.ts +261 -0
- package/src/testing.ts +338 -0
- package/src/yaml.test.ts +88 -0
- package/src/yaml.ts +76 -6
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { Declarable } from "./declarable.js";
|
|
2
|
+
/**
|
|
3
|
+
* One authored concept document, parsed from a bundle. Deliberately thinner
|
|
4
|
+
* than the emit side's internal `Concept` (`./okf.ts`) — this is what a
|
|
5
|
+
* *reader* trusts, and per the #1059 design that is `type`/`title` plus the
|
|
6
|
+
* single frontmatter key chant interprets, `binds`. Everything else an
|
|
7
|
+
* author wrote rides along in {@link frontmatter} unexamined, so a consumer
|
|
8
|
+
* that needs a project-specific key (a future `category`, say) can still
|
|
9
|
+
* reach it without a reader change.
|
|
10
|
+
*/
|
|
11
|
+
export interface OkfConcept {
|
|
12
|
+
/** Bundle-relative path (forward-slash separated), e.g. "decisions/public-assets.md". */
|
|
13
|
+
path: string;
|
|
14
|
+
/** The frontmatter `type`. May be empty — the reader never rejects a concept for it, unlike the emitter's conformance check. */
|
|
15
|
+
type: string;
|
|
16
|
+
/** Frontmatter `title`, when the author set one. */
|
|
17
|
+
title?: string;
|
|
18
|
+
/**
|
|
19
|
+
* This concept's `binds` frontmatter key, normalized to a list — one name,
|
|
20
|
+
* several, or `[]` for "declared no binding, and that's legitimate."
|
|
21
|
+
* Structural-looking keys (`name`, `lexicon`, `kind`) are deliberately
|
|
22
|
+
* *not* surfaced here or anywhere else on this type: the reader interprets
|
|
23
|
+
* exactly `binds` (#1059's precedence-by-construction), so authored and
|
|
24
|
+
* inferred knowledge cannot conflict at the fact level.
|
|
25
|
+
*/
|
|
26
|
+
binds: string[];
|
|
27
|
+
/** Every frontmatter key this concept's document carries, `binds` included, verbatim. */
|
|
28
|
+
frontmatter: Record<string, unknown>;
|
|
29
|
+
/** Markdown body (everything after the closing `---`), unchanged. */
|
|
30
|
+
body: string;
|
|
31
|
+
}
|
|
32
|
+
/** A loaded OKF knowledge bundle: every authored concept found, reserved files already excluded. */
|
|
33
|
+
export interface OkfBundle {
|
|
34
|
+
concepts: OkfConcept[];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Load every authored concept from an OKF knowledge bundle directory.
|
|
38
|
+
* `index.md`/`log.md` are skipped (reserved, by basename, at any depth —
|
|
39
|
+
* matching `okfConformanceProblems`'s check on the emit side). A directory
|
|
40
|
+
* that does not exist yields an empty bundle, not an error: the #1059 design
|
|
41
|
+
* treats a missing `knowledge/` as "this project has none yet," the same
|
|
42
|
+
* posture as a project with no lexicons configured.
|
|
43
|
+
*
|
|
44
|
+
* A file that fails to parse — no frontmatter block, unparseable YAML, or
|
|
45
|
+
* frontmatter that isn't a mapping — is skipped with a `console.warn` and
|
|
46
|
+
* does not affect any other file. Nothing here throws.
|
|
47
|
+
*/
|
|
48
|
+
export declare function loadOkfBundle(dir: string): Promise<OkfBundle>;
|
|
49
|
+
/** {@link bindConcepts}'s result: bound concepts per entity, plus every binding that resolved nothing. */
|
|
50
|
+
export interface BindConceptsResult {
|
|
51
|
+
/**
|
|
52
|
+
* Bound concepts keyed by entity logical name — the same names that key
|
|
53
|
+
* `DiscoveryResult.entities` (`./discovery/index.ts`). An entity with no
|
|
54
|
+
* bound concepts is absent from the map, never present with `[]`.
|
|
55
|
+
*/
|
|
56
|
+
bound: Map<string, OkfConcept[]>;
|
|
57
|
+
/** Every `binds` entry that named no entity in `entities` — chant's own broken-link posture (#1059): a warning for the caller to surface (COR022, #1865), never a load failure. */
|
|
58
|
+
unresolved: UnresolvedBinding[];
|
|
59
|
+
}
|
|
60
|
+
/** One `binds` entry that resolved to nothing. */
|
|
61
|
+
export interface UnresolvedBinding {
|
|
62
|
+
/** The concept whose `binds` named this entity. */
|
|
63
|
+
concept: OkfConcept;
|
|
64
|
+
/** The unresolved logical name. */
|
|
65
|
+
name: string;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Resolve every concept's `binds` against a project's discovered entities.
|
|
69
|
+
* `entities` is the same shape `./okf.ts`'s emitter takes, `DiscoveryResult`'s
|
|
70
|
+
* own `entities` map — a bare logical name is unambiguous within one
|
|
71
|
+
* discovery pass (#1059's "Rejected options" on binding ambiguity).
|
|
72
|
+
*
|
|
73
|
+
* A concept with no `binds` contributes to neither `bound` nor `unresolved`;
|
|
74
|
+
* an unbound concept is legitimate, not an omission (a runbook, a decision
|
|
75
|
+
* about the project as a whole).
|
|
76
|
+
*/
|
|
77
|
+
export declare function bindConcepts(bundle: OkfBundle, entities: Map<string, Declarable>): BindConceptsResult;
|
|
78
|
+
//# sourceMappingURL=okf-read.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"okf-read.d.ts","sourceRoot":"","sources":["../src/okf-read.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAkB/C;;;;;;;;GAQG;AACH,MAAM,WAAW,UAAU;IACzB,yFAAyF;IACzF,IAAI,EAAE,MAAM,CAAC;IACb,gIAAgI;IAChI,IAAI,EAAE,MAAM,CAAC;IACb,oDAAoD;IACpD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;;OAOG;IACH,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,yFAAyF;IACzF,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAC;CACd;AAED,oGAAoG;AACpG,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,UAAU,EAAE,CAAC;CACxB;AAmCD;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CA8CnE;AAED,0GAA0G;AAC1G,MAAM,WAAW,kBAAkB;IACjC;;;;OAIG;IACH,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;IACjC,mLAAmL;IACnL,UAAU,EAAE,iBAAiB,EAAE,CAAC;CACjC;AAED,kDAAkD;AAClD,MAAM,WAAW,iBAAiB;IAChC,mDAAmD;IACnD,OAAO,EAAE,UAAU,CAAC;IACpB,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,kBAAkB,CAgBrG"}
|
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,8 +100,53 @@ 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;
|
|
123
|
+
/**
|
|
124
|
+
* Tear down one environment's marker-owned resources — the durable form of
|
|
125
|
+
* `chant lifecycle teardown <env> --yes` (#1222). The activity runs core's
|
|
126
|
+
* teardown engine in-process: enumerate by ownership marker (this project's
|
|
127
|
+
* `ownership.stack` + `env`), delete through each lexicon's `executeTeardown`
|
|
128
|
+
* capability, retry failures once, and fail the step when any candidate is
|
|
129
|
+
* still failed. Distinct from {@link teardown}, which runs a project's own
|
|
130
|
+
* `npm run teardown` script.
|
|
131
|
+
*
|
|
132
|
+
* The CLI's guards apply unchanged, and a production-like environment name
|
|
133
|
+
* needs `confirmProd: true` in `opts` — the authored counterpart of
|
|
134
|
+
* `--confirm-prod`, since an Op never prompts. An ordinary {@link gate} step
|
|
135
|
+
* placed before this one composes as usual (steps run in authored order), so
|
|
136
|
+
* a human approval can precede the deletion:
|
|
137
|
+
*
|
|
138
|
+
* ```ts
|
|
139
|
+
* phase("Teardown", [
|
|
140
|
+
* gate("approve-teardown", { description: "Release the staging teardown" }),
|
|
141
|
+
* envTeardown("staging"),
|
|
142
|
+
* ]),
|
|
143
|
+
* ```
|
|
144
|
+
*
|
|
145
|
+
* `opts` also accepts `path` (the chant project directory, default the
|
|
146
|
+
* worker's cwd). Defaults to the `longInfra` profile (override via
|
|
147
|
+
* `opts.profile`).
|
|
148
|
+
*/
|
|
149
|
+
export declare const envTeardown: (env: string, opts?: Record<string, unknown>) => ActivityStep;
|
|
60
150
|
/**
|
|
61
151
|
* Create a local k3d cluster (vanilla Kubernetes in Docker). Idempotent: skips
|
|
62
152
|
* creation if a cluster of the same name already exists. Defaults to the
|
|
@@ -81,6 +171,40 @@ export declare const k3dUp: (name: string, opts?: Record<string, unknown>) => Ac
|
|
|
81
171
|
* (chant #1410) — requires `"k3d"` in the project's `lexicons`.
|
|
82
172
|
*/
|
|
83
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;
|
|
84
208
|
/**
|
|
85
209
|
* Boot a local Floci AWS emulator in Docker and point subsequent steps at it —
|
|
86
210
|
* sets `AWS_ENDPOINT_URL` + test creds in the process env so a following
|
|
@@ -147,8 +271,8 @@ export declare const azDelete: (templatePath: string, opts?: Record<string, unkn
|
|
|
147
271
|
* Deploy a built CloudFormation template by calling the CloudFormation API
|
|
148
272
|
* directly (create-or-update + poll) — the direct twin of {@link azApply} /
|
|
149
273
|
* {@link gcpApply} for AWS, targeting a local Floci emulator or real AWS by
|
|
150
|
-
* endpoint override. Speaks the CFN API over HTTP rather than shelling `aws`
|
|
151
|
-
*
|
|
274
|
+
* endpoint override. Speaks the CFN API over HTTP rather than shelling `aws` —
|
|
275
|
+
* `nativeApply({ target: "cloudformation" })` routes here too (#1449). Provided by
|
|
152
276
|
* the aws lexicon; loaded when the project lists `aws`. Defaults to the
|
|
153
277
|
* `longInfra` profile. `opts` requires `stackName`; accepts `endpoint`, `region`,
|
|
154
278
|
* `capabilities`, `timeoutMs`, `intervalMs`.
|
|
@@ -157,13 +281,15 @@ export declare const awsApply: (templatePath: string, opts?: Record<string, unkn
|
|
|
157
281
|
/** Delete a CloudFormation stack — the inverse of {@link awsApply}. Defaults to the `longInfra` profile (override via `opts.profile`). `opts` requires `stackName`. */
|
|
158
282
|
export declare const awsDelete: (templatePath: string, opts?: Record<string, unknown>) => ActivityStep;
|
|
159
283
|
/**
|
|
160
|
-
* Apply chant's built GCP (CNRM) resources directly to
|
|
284
|
+
* Apply chant's built GCP (CNRM) resources directly to their GCP REST APIs,
|
|
161
285
|
* targeting a local floci-gcp emulator or real GCP by endpoint override — the
|
|
162
|
-
* native GCP applier (#706 starter #711)
|
|
163
|
-
* Defaults to the `longInfra` profile (override via
|
|
286
|
+
* native GCP applier (#706 starter #711). `nativeApply({ target: "gcp" })`
|
|
287
|
+
* routes here too (#1449). Defaults to the `longInfra` profile (override via
|
|
288
|
+
* `opts.profile`).
|
|
164
289
|
*
|
|
165
|
-
* `opts` accepts `endpoint` (default `
|
|
166
|
-
* `project` (default `GOOGLE_CLOUD_PROJECT` env / the CNRM
|
|
290
|
+
* `opts` accepts `endpoint` (default `GCP_ENDPOINT_URL` env / each kind's
|
|
291
|
+
* real-GCP host) and `project` (default `GOOGLE_CLOUD_PROJECT` env / the CNRM
|
|
292
|
+
* project-id annotation).
|
|
167
293
|
*/
|
|
168
294
|
export declare const gcpApply: (manifestPath: string, opts?: Record<string, unknown>) => ActivityStep;
|
|
169
295
|
/** Delete the GCP (CNRM) resources in a built manifest — the inverse of {@link gcpApply}. Defaults to the `longInfra` profile (override via `opts.profile`). */
|
|
@@ -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,M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G,MAAM,CAAC;IACzB,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,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, 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,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E,yBAAyB,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAClH,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,gBAAgB,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,CA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IACrC;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;CAC9E;AAED,wDAAwD;AACxD,MAAM,WAAW,iBAAiB;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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