Preserve scoped Phase-A audit receipts - #9
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR closes the remaining post-merge Phase‑A audit findings by ensuring sweep receipts are preserved per campaign/scope/day, analysis fails closed for explicitly unknown campaigns, a midnight-boundary regression test is stabilized, and the Rust language-correction path avoids repeated Unicode character counting.
Changes:
- Write sweep receipts to per-(date, real/synthetic scope, hashed campaign) filenames instead of overwriting a single daily receipt.
- Fail closed in
analyze()when an explicitcampaign_run_idis not found in the selected scope, matching watchdog behavior. - Remove test flakiness around midnight boundaries and add a regression asserting multiple campaign receipts are preserved; cache character counts in Rust language correction.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/test_o1_phasea.py | Stabilizes the foreign-campaign regression timing, adds receipt-preservation coverage, and adds an analyze() unknown-campaign failure test. |
| phase_a/sweep.py | Persists sweep receipts using scope + hashed campaign ID to prevent overwriting across campaigns/scopes. |
| phase_a/analyze.py | Adds a fail-closed guard when an explicit campaign is missing from the chosen scope. |
| crates/smartkey-core/src/input.rs | Caches Unicode character counts in the opt-in language correction path to avoid repeated .chars().count() work. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
What
Closes all four actionable post-merge findings from #8:
analyze()receives an explicit campaign absent from the selected scopeVerification
Commit:
b1ac68b