Skip to content

test: cover injection usage and abstention accounting - #178

Merged
abogartz merged 1 commit into
abogartz:mainfrom
WhollyMindless:test/injection-accounting-177
Oct 29, 2026
Merged

abogartz merged 1 commit into
abogartz:mainfrom
WhollyMindless:test/injection-accounting-177

Conversation

@WhollyMindless

Copy link
Copy Markdown
Contributor

The suite could miss injection no longer recording usage or counting requests without an epoch as abstentions. Add six hook-level regression cases that inspect the persisted use ledger and the live memory_status report.

Coverage includes budget-surviving rows, session/source attribution, shared terms without private prompt text, discarded versus adopted rebuilds, and abstention counts before a prompt, after compaction, and for empty established epochs. The discarded-rebuild test resets the hit throttle so rate limiting cannot hide an accidental duplicate credit.

This changes only one test file and is based on main after the #172 extraction. Production behavior is unchanged.

Closes #177.

Validation (Windows, Bun 1.4.4):

  • Full bun run gate: typecheck and lint pass; 687 unit tests pass, 12 existing skips; 11 real-host end-to-end tests pass. Existing lint warnings remain; the new file lints cleanly.
  • Seven deliberate mutations were rejected on the inline implementation, covering missing/premature credit, pre-budget candidates, private prompt logging, and incorrect abstention counting.
  • Both reported mutations were also rejected on the extracted controller. The temporary integration check with refactor: isolate injection epoch policy #172 passed 75 relevant tests and typecheck before the final full gate on merged main.

@abogartz
abogartz merged commit fe619a8 into abogartz:main Oct 29, 2026
4 checks passed
@abogartz-opencode-self-improvement

Copy link
Copy Markdown

🎉 This PR is included in version 0.14.19 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Injection-side use-ledger credit and the abstained counter survive mutation: both documented, neither pinned

2 participants