Repository navigation
Conversation
An Analyzer is metadata for the rule catalog plus a pure function of the scan input. runAnalyzers validates every finding, isolates a rule that fails and returns the findings ranked by saving. The first rule, aws.ebs.unattached, prices a volume from what the export actually charged for it. core gains the resource inventory types the rule reads. Claude-Session: https://claude.ai/code/session_01WTtRZcdke1yYdYUAanaf7V
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
Why
The plan's engine is a set of rules that all implement one
Analyzerinterface, public and premium alike. This adds that interface, the runner and the first rule, so the shape an adapter has to produce is fixed by a rule that reads it.Scope
packages/analyzers(@costexplorer/analyzers, private for now):Analyzer: an id, catalog text (title,category,tier,signal,fix) andanalyze(input), a pure function.ScanInput:asOf,costRecordsandresources. Rules measure age againstasOf, never the clock.runAnalyzers: validates each finding againstfindingSchema, rejects a finding filed under another rule's id, reports a rule that throws and keeps the others, and returns findings ranked by saving. Two rules with one id is an error.runRate: the monthly cost of a resource from its usage charges in the export.aws.ebs.unattached: anavailablevolume unattached for 14 full days or more.packages/coregainsresourceSchema, withaws.ebs.volumeas its first member.CONTRIBUTING.mdgains the steps to add an analyzer.Stacked on #4.
Tradeoffs
These are judgment calls in the first rule. They set the pattern for the other thirteen, so they are worth a look.
lowconfidence.medium, because the volume may have been in use until yesterday.evidence.noteinstead of guessing its size.ScanInputneeds.Verification
VERIFIED.
pnpm verifyon Node 24.21.0.index.test.tsruns the public rule set end to end over a scan with one idle and one busy volume and gets exactly one finding,vol-idleat $7.30 a month.NOT VERIFIED: the rule has only run on fixtures. No real export or AWS inventory has been through it, because no adapter exists yet. The
aws ec2commands in the remediation were not executed.https://claude.ai/code/session_01WTtRZcdke1yYdYUAanaf7V