Repository navigation
feat(core-contracts,report): locked-rule reason 'credits' (#1792) - #1793
Merged
Merged
Conversation
nc9
force-pushed
the
feat/1792-credits-reason
branch
from
November 12, 2026 09:09
b49bc14 to
bdb73ed
Compare
nc9
marked this pull request as ready for review
November 12, 2026 09:28
…hat ran out of credits is grouped and worded on its own in every report #1792 Signed-off-by: Nik Cubrilovic <[email protected]>
nc9
force-pushed
the
feat/1792-credits-reason
branch
from
November 12, 2026 12:32
bdb73ed to
e7e0a7b
Compare
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.
Closes #1792.
Adds
creditsto the closed locked-rule reason set (LOCKED_RULE_REASONS:plan,credits,provider_error,unsupported_environment), for an audit that ran out of credits before the check ran: not a plan exclusion (a paid org has the check) and not an environment limit (adding credits and re-running includes it).Renderers
lockedRulesMessage(packages/report/src/locked-rules.ts) groupscreditsrules in their own group, ordered afterplan, with its own sentence: "This check did not run because the audit ran out of credits. Add credits, then re-run the audit to include it." plus the rule's detail. It keeps the upsell link when the audience has one (the Free account's add-credits link) and adds none for a paid org. Never "not included in", "your plan", "environment" or "temporarily".data-locked-reason="credits"), LLM and XML (reason="credits"), JSON (lockedRules.rules[].reason).LOCKED_REASON_LABELSand the not-checked cause hints are exhaustive records, so the type checker held every place.notCheckedentry can carrycause: credits; its hint says the audit ran out of credits and to add credits.docs/reports.mdx; CHANGELOG.Older readers
A reader from before this release has a closed set without
credits:isLockedRuleReasonis false for it, it reads the rule as having no reason, keeps the audience wording, and nothing fails. That path is the one a value the set has never held takes; a test runs every renderer over such a value and asserts the audience sentence is unchanged and nothing throws.Tests
locked-rules-credits-1792(renderer-by-renderer: message for paid and Free, singular and plural, group order, failed audit, older-reader fallback, llm, xml, html, markdown, text, json, notChecked), the contract testcore-contracts/tests/locked-rule-reasons-1792, and the closed-set assertion in the #1734 test updated. The report package tests (103 files, chunks of 8), the CLI banner and locked-rules tests,make validate, and the core-contracts and report typechecks pass; lane-precheck no FAIL. apps/cli is not touched (it reads the shared helper), so no CLI format/lint run.Follow-up (private, after a release): #4109's classifier switches its out-of-credits cases from
unsupported_environmentplus a detail tocredits. Skill check: the squirrelscan agent skill needs no change.