Skip to content

feat(core-contracts,report): locked-rule reason 'credits' (#1792) - #1793

Merged
nc9 merged 1 commit into
mainfrom
feat/1792-credits-reason
Nov 12, 2026
Merged

nc9 merged 1 commit into
mainfrom
feat/1792-credits-reason

Conversation

@nc9

@nc9 nc9 commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Closes #1792.

Adds credits to 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) groups credits rules in their own group, ordered after plan, 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".
  • Every format reads the same helper: the console banner, text, Markdown and HTML (label "out of credits, add credits and re-run", data-locked-reason="credits"), LLM and XML (reason="credits"), JSON (lockedRules.rules[].reason). LOCKED_REASON_LABELS and the not-checked cause hints are exhaustive records, so the type checker held every place.
  • A notChecked entry can carry cause: credits; its hint says the audit ran out of credits and to add credits.
  • Docs: the reason table and the older-reader sentence in docs/reports.mdx; CHANGELOG.

Older readers

A reader from before this release has a closed set without credits: isLockedRuleReason is 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 test core-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_environment plus a detail to credits. Skill check: the squirrelscan agent skill needs no change.

@nc9
nc9 force-pushed the feat/1792-credits-reason branch from b49bc14 to bdb73ed Compare November 12, 2026 09:09
@nc9
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
nc9 force-pushed the feat/1792-credits-reason branch from bdb73ed to e7e0a7b Compare November 12, 2026 12:32
@nc9
nc9 merged commit c81d655 into main Nov 12, 2026
16 checks passed
@nc9
nc9 deleted the feat/1792-credits-reason branch November 12, 2026 12:49
@nc9 nc9 mentioned this pull request Nov 12, 2026
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.

Locked-rule reason codes: add a 'credits' reason for audits that ran out of credits

1 participant