Commit 683bd4b
committed
chore(audit): handled-property WIRING critic + the two live gaps its first run caught
gen-property-coverage verifies every CFn property is ACCOUNTED FOR (declared in
handledProperties or unhandledByDesign); gen-nested-key-coverage audits
spellings INSIDE a forwarded blob. Neither checks that a handledProperties
entry is actually WIRED. ECRProvider declared ImageTagMutabilityExclusionFilters
handled while the property appeared on NO API call, so the pre-flight passed on
the declaration alone and the value silently vanished (#1392, fixed in #1406) --
a FALSE handled claim, the exact thing the declaration system exists to prevent.
The critic requires per-property read evidence in one of four AST shapes
(element-read, property-read, destructure, table-loop), plus a delegated tag
when the read happens in a callable reached by a call edge. Evidence is
CLASS-SCOPED via a taint walk seeded from each method's desired-state parameter
and propagated only through calls that pass the bag WHOLE, so a sibling class in
the same file, a comment, a getDriftUnknownPaths entry, the declaration itself,
and a readCurrentState write-back all fail to vouch for a property.
Two strictness decisions were forced by the real tree, not by fixtures:
- A whole-bag forward does NOT blanket-excuse un-read declarations. The first
draft's excuse silenced the very #1392 property via ECRProvider's
hasCdkAutoDeleteTag(properties) call in delete(); measured across the tree it
rescued 0 of 1063 properties. Blind spots are recorded for visibility only.
- A read of previousProperties is NOT evidence: a diff-only read proves change
DETECTION, not delivery. Also 0 of 1063 today, so the strictness is free now
and closes the disguise later.
Coverage floors are per SHAPE rather than a grand total (84 classes / 1063
properties), with property-read and destructure pinned === 0 so a future first
user cannot regress those recognizers silently.
The first real-tree run found two live gaps, seeded as KNOWN GAP allow-list
entries and FILED rather than fixed here (this PR introduces the tool; the
fixes are separate): AWS::EC2::NatGateway.MaxDrainDurationSeconds (#1411) and
AWS::Logs::LogGroup.ResourcePolicyDocument (#1412). IAMAccessKeyProvider#Serial
and NestedStackProvider#TemplateURL are rationale'd NOT-A-BUG entries. Stale
entries fail in both modes, so wiring a property forces its entry's removal.
Real-code fail probe (the repo's checker rule, re-run independently): reverting
the real ecr-provider.ts to its pre-#1406 state makes --check exit 1 naming
ECRProvider#ImageTagMutabilityExclusionFilters, and the file restores
byte-identical. A first probe that stripped only the lowercase-p reads PASSED --
the surviving previousProperties read cleared it -- and that false clean is what
drove the previousProperties exclusion; both variants are now automated.
Closes #14041 parent cd7fe67 commit 683bd4b
7 files changed
Lines changed: 14133 additions & 0 deletions
File tree
- .claude/rules
- .github/workflows
- docs/_generated
- scripts
- tests/unit/scripts
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
221 | 242 | | |
222 | 243 | | |
223 | 244 | | |
| |||
0 commit comments