Skip to content

Preserve scoped Phase-A audit receipts - #9

Merged
RMANOV merged 1 commit into
masterfrom
agent/smartkey-pr8-review-blockers
Jul 19, 2026
Merged

Preserve scoped Phase-A audit receipts#9
RMANOV merged 1 commit into
masterfrom
agent/smartkey-pr8-review-blockers

Conversation

@RMANOV

@RMANOV RMANOV commented Jul 19, 2026

Copy link
Copy Markdown
Owner

What

Closes all four actionable post-merge findings from #8:

  • preserve one sweep receipt per date, real/synthetic scope, and hashed campaign ID
  • fail closed when analyze() receives an explicit campaign absent from the selected scope
  • remove the midnight boundary flake from the foreign-campaign regression
  • cache Unicode character counts in the opt-in language-correction path

Verification

  • targeted new regressions: 4 PASS
  • full Python suite: 84 PASS, 1 skip
  • focused Rust autocorrect tests: 2 PASS
  • Ruff, py_compile, cargo fmt check, diff check: PASS

Commit: b1ac68b

@RMANOV
RMANOV marked this pull request as ready for review July 19, 2026 20:18
Copilot AI review requested due to automatic review settings July 19, 2026 20:18
@RMANOV
RMANOV merged commit 8838643 into master Jul 19, 2026
6 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 explicit campaign_run_id is 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.

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.

2 participants