Repository navigation
fix(usage-retention): fail the retention gate on readers whose bound cannot be parsed - #449
Merged
Merged
Conversation
The gate resolved each reader's time bound with an early continue, so a reader site whose bound could not be parsed vanished from the roster and R1/R2 kept quantifying over what was left. The module doc already promised that an unparseable bound means that reader has no criterion; it now does. R5 records such sites in Reading.unpaired and fails the verdict, the positive control asserts the unpaired list is empty, and the tooth test mutates that list. Test-only module (#[cfg(test)]); no production change. Also corrects the rule-count sentence in the module doc itself. Refs #448
argszero
added a commit
that referenced
this pull request
Nov 27, 2026
…le boundary (#451) The gate cut a file's production code at the first `#[cfg(test)]`. That marker is an attribute, not a module: when it attributes a single test-only helper, every reader below it leaves the scanned region — and it leaves before the roster is built, so R5 (#449), which judges the roster, cannot see it. The verdict stays green on a roster that is a strict prefix of the file. The boundary is now one the code checks: the region ends at the first `#[cfg(test)]` that introduces a module (`mod … {` / `mod …;`), and a marker that does not is recorded in `Reading.bare_markers` and fails the new rule R6 in the two files the gate takes facts from (`src/routes/` for the roster, `src/usage_retention.rs` for the threshold and the delete helper). Test-only module: no production behaviour change, no config or data-structure change. Closes #450
Merged
argszero
added a commit
that referenced
this pull request
Dec 3, 2026
Five commits since v0.7.35 (#449, #451, #452, #453, #454). No schema change (18 either side). The version string moves in the five carriers the deploy gate guards: Cargo.toml, Cargo.lock, Dockerfile, docker-compose.yml and the new CHANGELOG heading. Co-authored-by: argszero <argszero@users.noreply.github.com>
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.
Summary
usage_retention_gate.rsis the static gate that keeps theusage_recordsdeletion threshold no later than every reader's own window lower bound. It resolved a reader's bound withso a site that matched the reader shape but whose bound could not be parsed was dropped from the roster — and R1/R2 only quantify over the roster, so the invariant silently degraded to "the threshold is not later than every reader I could parse". The module doc already said an unparseable bound means that reader has no criterion; the code meant "that reader has no constraint".
This change makes that case fail the verdict: an unpaired site is recorded in
Reading.unpaired, and the new rule R5 (roster complete) requires that list to be empty.Related Issue
Closes #448
Changes
Readinggainsunpaired: Vec<String>(file@masked-offset), filled by the reader scan where the silentcontinueused to be.r5()=unpaired.is_empty());Reading::all()includes it andblame()prints the list.the_scanner_sees_both_sidesnow also asserts the roster was not silently pruned.every_usage_retention_rule_has_a_toothgains a sixth tooth that mutatesunpaired.#[cfg(test)] mod usage_retention_gate;insrc/main.rs, so production behaviour is unchanged. No config or data-structure change, soconfig/config.example.tomlis untouched.Tests
cargo test— 614 passed, 0 failed, 0 ignoredcargo fmt --check— cleancargo clippy— cleanProof that the new rule has teeth (run against the tree of this patch, and against the same tree with this patch reverted): I injected an unpaired reader into
src/routes/ops.rs—FROM usage_records WHERE time >with a strict>instead of>=— and rancargo test usage_retention_gate.routes/ops.rs@3587and printingr5=falseThe probe was then removed; the committed diff touches only
src/usage_retention_gate.rs.Checklist
fix/<description>)