Skip to content

feat(aws): SSM receipt row — materialization, store, and observation coverage (#1835) - #1882

Merged
lex00 merged 9 commits into
mainfrom
feat/1835-aws-receipt-row
Aug 24, 2026
Merged

lex00 merged 9 commits into
mainfrom
feat/1835-aws-receipt-row

Conversation

@lex00

@lex00 lex00 commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Fifth leg of the effect-receipts epic #1703: the first lexicon materialization row. An effect receipt becomes an AWS::SSM::Parameter — plain String, at /chant-receipts/<stack>/<env>/<effect> — readable with aws ssm get-parameter and read-only IAM, no chant binary.

Stack: this PR is based on feat/1834-effect-step (#1880) and additionally merges feat/1832-receipt-plan-apply (#1879) and feat/1833-receipt-guards (#1878) — the row needs all three seams (SerializeContext.receipts, the ReceiptStore activities, and the COR023 plain-store guard its tests exercise). The diff collapses to the aws-side changes as those merge. One merge artifact is fixed in the #1878 merge commit here: #1879 and #1878 both added the collectEffectReceipts import to cli/handlers/lifecycle.ts, and the textual merge kept both.

Materialization row (lexicons/aws/src/effect-receipt-row.ts)

  • EffectReceipt(name, { effect, flavor, inputs }) — core's factory signature and semantics (core: EffectReceipt factory + recognition marker + resolution split #1831), landing in the aws partition so the build routes it to the aws serializer. Carries the EFFECT_RECEIPT_MARKER, entityType AWS::SSM::Parameter, and props.Type pinned to the literal "String" — the concrete half of lint: receipt guards — leaf rule, plain store, secrets by pointer, baseline refusal #1833's COR023 guard (a SecureString fixture fails it; the factory's row passes, covered by tests).
  • receiptParameterName(stack, env, effect) — the single source of the path identity, derived from the same ownership-block fields that stamp markers (epic decision 4). Segments are validated; the serializer row, the store, and the observation leg all call it.
  • The serializer renders each receipt from SerializeContext.receipts (lifecycle: plan renders effect-will-fire; generic apply never writes a receipt #1832 withholds them from the apply-bound entity set) under Metadata["chant:effect-receipts"] — never Resources, the section appliers write and prune from. Value is the synthesis-time expectation for a static receipt, a placeholder note for reference-input receipts (never a digest over placeholders, decision 5). Ownership tags are stamped on the row. No ownership, or ownership without env, is an error — the env segment is explicit, never guessed.

ReceiptStore over SSM (lexicons/aws/src/receipt-store.ts)

Observation coverage

describeResources gains a receipt leg: a receipt is never a stack member, so the stack read would report it confirmed-absent even while the parameter exists. The leg reads each receipt's rendered path back from the build output's Metadata block and asks GetParameter directly — present maps the stored value onto attributes.value (core's RECEIPT_VALUE_ATTRIBUTE fallback shape), ParameterNotFound stays a real absence, and a failed read reports unobserved, never a wrong answer. Merged into every return path, including the stack-missing and stack-read-failed branches.

Example

examples/local-op-quickstart gains local-aws-migrate — the local-aws Floci loop plus a gated one-shot schema seed inside effect(schemaSeeded, [gate(...), shell(...)]), with the receipt declared in ops/receipts.ts and ownership: { stack, env } in the config. chant build ops renders the row at /chant-receipts/local-op-quickstart/local/demo-schema-seed; the README documents the --temporal run and the plain aws ssm get-parameter read.

Testing

  • npx vitest run lexicons/aws/src — 1541 passed (includes the new row/store/observation suites: path identity, plain String, tags, env-missing error, endpoint override, absent → undefined, String+Overwrite write, barrel wiring, SecureString vs COR023)
  • npm run build -w @intentius/chant-lexicon-aws clean
  • npx vitest run packages/core — 4582 passed
  • npx tsc --noEmit -p packages/core/tsconfig.json clean; just lint clean
  • npx tsx scripts/check-lexicons.ts — no untracked tier-1 failures
  • npx vitest run examples/examples.test.ts — 253+ passed, with new shape assertions for the gated migration op; the example's own npm run build / npm run lint clean

Closes #1835

@lex00
lex00 changed the base branch from feat/1834-effect-step to main August 24, 2026 21:42
@lex00
lex00 merged commit 8e4185e into main Aug 24, 2026
5 checks passed
@lex00
lex00 deleted the feat/1835-aws-receipt-row branch August 24, 2026 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

aws: receipt row — SsmParameter materialization + observation coverage

1 participant