Repository navigation
feat(lint): effect-receipt guards — leaf rule, plain store, secrets by pointer, baseline refusal (#1833) - #1878
Merged
Merged
Conversation
…y pointer, baseline refusal (#1833)
This was referenced Aug 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Four guards for effect receipts (#1831's factory + marker), all core.
COR022 — receipt is a leaf (pre-synth rule)
Nothing may reference a receipt's attributes. The rule walks the file's reference graph the way COR011 does: it collects every variable bound to an
EffectReceipt(...)call (identifier aliases resolved to a fixpoint, soconst r = EffectReceipt(...); other.prop = r.somethingfires through the indirection) and flags every property or element access rooted at one. Passing the receipt value itself is allowed — the leaf constraint is about attributes, and materialization rows legitimately take the whole declaration.COR023 — plain-store target (post-synth check)
#1831's declaration shape carries no materialization hints, so this is the honest core half: a post-synth checkchant buildruns over the FULL build result (receipts are recognized by marker, lexicon-independently, so the check is deliberately not plugin-scoped). It fires when a marker-carrying entityentityTypematching core's existing secret-kind knowledge (SENSITIVE_KEY_PATTERNS,deep-observation.ts) —K8s::Core::Secret,AWS::SecretsManager::Secret, ...;Type/Kindprop selecting a secret-capable variant of an otherwise plain kind — SSM'sType: "SecureString"is the canonical case.Findings go through the same
applyConfiguredSeverityfunnel as every other post-synth diagnostic. The aws materialization row (#1835) enforces SSM plainStringconcretely at the source.COR024 — secrets by pointer (pre-synth rule)
A receipt's
inputsfeed its expectation hash, and no chant code path may hash or compare secret material (#1365/#1828). The rule reuses COR022's reference walk: a variable is Secret-kind when its initializer names one (new SecretManagerSecret(...),new ExternalSecret(...),declareSecret(...)); an input fires when a property chain rooted at one crosses a material field (data,value,stringData,plaintext, ...), const indirection included (const m = sec.data; inputs: { p: m.password }). The message points at the name+version pointer form —{ secretName: sec.name, secretVersion: 3 }— so a rotation re-proposes the effect through an explicit version bump.Baseline refusal
acceptDeviations(lifecycle/observation-baseline.ts) now refuses a deviation on an effect receipt, throwing before anything is recorded — the whole acceptance aborts, so a partial baseline never lands. Recognition is two-layered: aDeviationToAccept.typeofChant::EffectReceiptis refused unconditionally, and the--update-baselinepath threads a marker-based receipt name set (collectEffectReceiptsover every target's build entities) so materialized lexicon rows are caught under their ownentityType. The error names the receipt and states that theeffect()step is the receipt's only writer — accepting the live value would silently defuse the effect.Tests / docs
correctness.mdx,overview.mdx). The audit-rules page is catalog-generated and unaffected — these are lint rules, not audit-catalog rules.npx vitest run packages/core4542 passed,just lint,just docs-check.Closes #1833