Skip to content

fix(aws): monitoring-stack EVL004 spread source (#1139) - #1929

Merged
lex00 merged 1 commit into
mainfrom
fix/1920-evl004
Aug 25, 2026
Merged

lex00 merged 1 commit into
mainfrom
fix/1920-evl004

Conversation

@lex00

@lex00 lex00 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fixes CI's "Lint aws reference composites (EVL regression guard)" step, red on main since feat(aws): monitoring stack composite (#1139) #1920 merged: EVL004 at monitoring-stack.ts:101:51, "Spread from non-const source".
  • Root cause: EVL004's isConstIdentifier (packages/core/src/lint/rules/evl004-spread-non-const.ts) only walks sourceFile.statements — module-level declarations — so a const declared inside a function body (the widget() helper's const dims = [...]) never traces as const even though it genuinely is one. The spread ...dims inside the metrics tuple then reads as coming from a non-const source.
  • Fix: drop the spread. widget() now builds the metrics tuple as a ternary between two literal arrays ([namespace, metricName, dimName, dimValue] vs [namespace, metricName]), which EVL004 accepts outright (object/array literals are always traceable).

Relates to #1139.

Test plan

  • CI's exact guard command, foregrounded: npx tsx packages/core/src/cli/main.ts lint lexicons/aws/src/composites → exit 0, 35 pre-existing warnings (same class already present on eks-cluster.ts, fargate-alb.ts, etc.), 0 errors, EVL004 gone
  • lexicons/aws/src/composites/monitoring-stack.test.ts + barrel.test.ts — 45 tests pass
  • Full aws lexicon suite: npx vitest run lexicons/aws — 122 files, 1598 passed

Co-Authored-By: Claude Fable 5 noreply@anthropic.com

https://claude.ai/code/session_013GoZx3iYpaQxKNCNxguYvT

CI's EVL regression guard (npx tsx packages/core/src/cli/main.ts lint
lexicons/aws/src/composites) flagged monitoring-stack.ts:101:51 — a spread
from a same-function `const dims = [...]`. EVL004's isConstIdentifier only
walks sourceFile.statements (module-level declarations), so a function-local
const, though genuinely const, doesn't trace as one. Sidesteps the gap
instead of fighting it: a ternary between two literal arrays, no spread.

Verified: the CI lint command exits 0 on lexicons/aws/src/composites (35
pre-existing warnings, 0 errors, EVL004 gone); full aws suite green
(122 files, 1598 passed).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013GoZx3iYpaQxKNCNxguYvT
@lex00
lex00 merged commit abbdeea into main Aug 25, 2026
5 checks passed
@lex00
lex00 deleted the fix/1920-evl004 branch August 25, 2026 05:49
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.

1 participant