feat(relation): refuse a summary as the source identity - #139
Conversation
A summary may point at earlier event time (ADR 0003). It cannot become a state transition or reuse the source document identity. Recovery is the computed share of summary kinds that match known truth versus collapsing every summary to the source.
|
Warning Review limit reachedNext included review available in 11 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 |
|
Current-head validation update (7108baa): fixed the quality contract to derive the Rust crate count from scripts/check_workspace_contract.py instead of hard-coding 10. Local evidence: 89 quality tests passed; coverage 100% (991/991 statements, 442/442 branches); workspace, docstring, documentation, and diff checks passed. Please review and rerun Checks against this exact head; merge remains subject to the repository's two independent approvals and protected rules. |
|
@opencode-agent @cwl-noema-review Review-only request for exact current head |
|
Queued @cwl-noema-review and @opencode-agent for PR #139 at head |
|
Current-head review refresh for 7108baa:
|
|
Rebased current head 43ebbda onto origin/main. The changelog conflict retains both the summary-edge 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 request: exact head |
Maintainer exact-head disposition
|
# Conflicts: # ARCHITECTURE.md # CHANGELOG.md # Cargo.lock # Cargo.toml # README.md # docs/TRACEABILITY.md # docs/adr/0003-relational-event-multiple-membership.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
| pub fn identity_recovery_rate( | ||
| truth: &[SummarizesKind], | ||
| decided: &[SummarizesKind], | ||
| ) -> Result<f64, SummarizesEdgeError> { | ||
| if truth.is_empty() || truth.len() != decided.len() { | ||
| return Err(SummarizesEdgeError::InvalidEdgePayload); | ||
| } | ||
| let mut matches = 0_u32; | ||
| for (truth_kind, decided_kind) in truth.iter().zip(decided) { | ||
| if truth_kind == decided_kind { | ||
| matches += 1; | ||
| } | ||
| } | ||
| Ok(f64::from(matches) / truth.len() as f64) | ||
| } |
There was a problem hiding this comment.
📝 Info: identity_recovery_rate cast precision is intentionally allowed
identity_recovery_rate at kind.rs casts truth.len() as f64, which would normally trip clippy::cast_precision_loss under the workspace's denied pedantic lints. This is intentionally permitted via #![allow(clippy::cast_precision_loss)] in lib.rs. The empty/mismatched-length guard at line 75 ensures no division by zero, and match counting is correct.
Was this helpful? React with 👍 or 👎 to provide feedback.
A summary may point at earlier event time (ADR 0003). It cannot become a state transition or reuse the source document identity. Recovery is the computed share of recovered kinds that match known truth versus collapsing every summary to the source.
Complementary to #120 citation, #130 support, #136 translation, #137 retrospective, and #138 outcome_order. This crate owns the remaining closed provenance kind `summarizes`.
Local gates:
Does not allocate migration `0008`. Does not recreate `outcome_order` or other in-flight crates.
Keep this PR draft. Preferred merge remains #46 only when exact-head required Checks pass and a qualifying independent (non-Cursor/CodeRabbit) APPROVE exists. OpenCode `CHANGES_REQUESTED` on #46 is a coverage-evidence race — do not empty-commit.