Repository navigation
feat(temporal): refuse event, system, and available time as cutoff - #125
Conversation
Add standalone cutoff_clock so knowledge cutoff stays distinct from event time, system time, and availability time (ADR 0002). Recovered cutoff stamps match known truth at a higher computed rate than treating every stamp as availability. Does not allocate migration 0008 or recreate available_clock, document_clocks, or membership_cutoff.
|
Warning Review limit reachedNext included review available in 44 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (17)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
# Conflicts: # CHANGELOG.md
|
Current head Validation on this exact head: No merge is requested until a qualifying independent approval and current required checks are present. |
|
Current-head review refresh for fbba5d6:
|
|
Rebased current head c225f35 onto origin/main. The changelog conflict retains both feature and current-main entries; inherited documentation trailing whitespace was removed. Local merge-tree, git diff --cached --check, and cargo fmt --all -- --check pass. Exact-head hosted checks and required independent approvals remain required before protected merge. |
|
Current-head review completed for exact head
|
…entity # Conflicts: # ARCHITECTURE.md # CHANGELOG.md # Cargo.lock # Cargo.toml # README.md # docs/TRACEABILITY.md # docs/adr/0002-six-clock-temporal-semantics.md # docs/adr/README.md # docs/research/standards-and-literature.md # docs/validation/temporal-event-foundation.md # scripts/check_workspace_contract.py # tests/quality/test_check_docstrings.py
| for (truth_flag, decided_flag) in truth.iter().zip(decided) { | ||
| if truth_flag == decided_flag { | ||
| matches += 1; | ||
| } | ||
| } |
There was a problem hiding this comment.
📝 Info: Coverage of the non-matching branch relies on integration tests
The local unit tests in clock.rs only exercise eligibility_recovery_rate with matching flags (&[true],&[true]), so the truth_flag == decided_flag false branch is never taken there. The false branch is only covered by recovered_cutoff_stamps_match_known_truth_better_than_available_stand_in in cutoff_clock_contract.rs (collapsed_flags all false vs truth all true). This is fine because cargo llvm-cov -p aggregates lib and integration tests, but worth noting the 100% branch claim depends on the integration test being run.
Was this helpful? React with 👍 or 👎 to provide feedback.
| [package] | ||
| name = "cutoff_clock" | ||
| description = "Knowledge cutoff cannot be replaced by event, system, or availability time." | ||
| version.workspace = true | ||
| edition.workspace = true | ||
| rust-version.workspace = true | ||
| license.workspace = true | ||
| authors.workspace = true | ||
| repository.workspace = true | ||
| homepage.workspace = true | ||
| readme.workspace = true | ||
| keywords.workspace = true | ||
| categories.workspace = true | ||
| publish = false | ||
|
|
||
| [lints] | ||
| workspace = true |
There was a problem hiding this comment.
📝 Info: cutoff_clock crate satisfies the workspace contract checks
I verified the new crate against check_workspace_contract.py: Cargo.toml sets publish = false, inherits all required workspace fields, and enables [lints] workspace = true; src/lib.rs contains #![forbid(unsafe_code)], #![deny(missing_docs)], and a //! crate doc; and tests/crate_contract.rs exists. EXPECTED_CRATES ordering (cutoff_clock last) matches both members and default-members in Cargo.toml. No contract violation found.
Was this helpful? React with 👍 or 👎 to provide feedback.
| pub fn eligibility_recovery_rate( | ||
| truth: &[bool], | ||
| decided: &[bool], | ||
| ) -> Result<f64, CutoffClockError> { | ||
| if truth.is_empty() || truth.len() != decided.len() { | ||
| return Err(CutoffClockError::InvalidCutoffPayload); | ||
| } | ||
| let mut matches = 0_u32; | ||
| for (truth_flag, decided_flag) in truth.iter().zip(decided) { | ||
| if truth_flag == decided_flag { | ||
| matches += 1; | ||
| } | ||
| } | ||
| Ok(f64::from(matches) / truth.len() as f64) | ||
| } |
There was a problem hiding this comment.
📝 Info: eligibility_recovery_rate handles empty and mismatched slices fail-closed
eligibility_recovery_rate (clock.rs) returns InvalidCutoffPayload when truth is empty or lengths differ, then divides matches by truth.len(), which is guaranteed non-zero at that point, so there is no division-by-zero risk. The zip iteration is correct given the equal-length guarantee. Logic is sound.
Was this helpful? React with 👍 or 👎 to provide feedback.
Summary
available_clock(feat(temporal): refuse event and system time as availability #124).cutoff_clock: event time, system time, and availability time cannot stand in for knowledge cutoff.available_clock,document_clocks,temporal_core, ormembership_cutoff.Claim boundary
#45still owns0007).Test plan
cutoff_clockfailed withno library targets foundcargo test -p cutoff_clock --offline --lib --testscargo clippy -p cutoff_clock --all-targets --offline -- -D warningscargo llvm-cov -p cutoff_clocklines 73/73; nightly-2026-08-01 branches 6/6