test(querier): rfc0044.6 — renames and reversions, no alias expansion - #673
Conversation
The registry folds every (template_id, version)'s tokens, so unification inherently finds each id under which byte-identical records were written — a re-created id and a widened version both contribute, and a record whose own tokens do not render the literal never matches. The criterion and §3.3 are refined accordingly, stated inline: expanding RFC 0007 alias classes here would be wrong, not just unnecessary — alias classes group differing shapes, which byte-equality must never cross; resolves_to(n) remains the shape-crossing query. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qtny6z6cA74xPZa4qRhk4F Signed-off-by: Jens Holdgaard Pedersen <Jens@holdgaard.org>
|
Warning Review limit reached
Next review available in: 19 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
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 |
There was a problem hiding this comment.
Pull request overview
This PR updates RFC 0044’s definition of plan-time body == matching to explicitly exclude RFC 0007 alias-class expansion (since alias classes can cross shapes), and adds/renames the RFC0044.6 integration scenario in ourios-querier to validate the intended “rename/re-create under new id” drift shape.
Changes:
- Refines RFC 0044 §3.3 and criterion RFC0044.6 to state that matching is driven by registry-wide token unification across ids/versions, while explicitly excluding alias-class expansion.
- Adds the RFC0044.6 querier integration test scenario for the “template re-created under a new id” drift case and asserts byte-equality excludes rows whose own tokens don’t render the literal.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| docs/rfcs/0044-template-aware-body-equality.md | Refines RFC text to clarify rename/version contribution and explicitly exclude alias-class expansion for body ==. |
| crates/ourios-querier/tests/it/rfc0044_body_equality.rs | Adds RFC0044.6 integration scenario covering the “re-created under a new id” drift shape and asserts exact matching behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The scenario now fixtures a real v1->v2 widening alongside the rename: the v2 record matches only its own render (7-token literal), and the 6-token literal excludes it — versions key separately in the registry and unification finds each. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qtny6z6cA74xPZa4qRhk4F Signed-off-by: Jens Holdgaard Pedersen <Jens@holdgaard.org>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (3)
crates/ourios-querier/tests/it/rfc0044_body_equality.rs:245
- With the widening represented as a fixed-token→wildcard change, the widened (v2) record should keep the same token/separator count as v1 and add one extra param for the newly-wildcarded position. The current fixture uses a different separator vector (
sep7) and an extra literal token (EXTRA), which implies a length-changing widening. Adjust the v2 record to usesep6and three params so it matches the v2 template shape.
let sep6 = ["", " ", " ", " ", " ", " ", ""];
let sep7 = ["", " ", " ", " ", " ", " ", " ", ""];
write_all(
bucket.path(),
&[
mined("t", 2, TS0 + 10, &["999", "1.2.3.4"], &sep6),
mined("t", 7, TS0 + 20, &["999", "1.2.3.4"], &sep6),
mined("t", 7, TS0 + 30, &["888", "1.2.3.4"], &sep6),
// Written under the widened (2, v2).
MinedRecord {
template_version: 2,
..mined("t", 2, TS0 + 40, &["999", "1.2.3.4", "EXTRA"], &sep7)
},
],
crates/ourios-querier/tests/it/rfc0044_body_equality.rs:264
- The widened-version assertion currently uses a literal with an extra trailing token. If the widening is modeled as a fixed-token→wildcard change (same token count), update the query literal accordingly so it matches only the v2 record created above.
let widened = run(
bucket.path(),
r#"body == "user 999 logged in from 1.2.3.4 EXTRA""#,
)
.await;
assert_eq!(
widened.rows, 1,
"the widened version's tokens key separately and match their own render"
);
crates/ourios-querier/tests/it/rfc0044_body_equality.rs:229
- The fixture models
TemplateChange::Widenedas appending a new trailing<*>token ("... <*> <*>"), but the miner’s widening logic only widens by turning existingFixedtoken positions intoWildcardand assumes the line/template token lengths are equal (find_widening_positionshasdebug_assert_eq!(line.len(), template.len())). Using an impossible widening here risks making the scenario misleading and brittle if future validation is added. Prefer a widening that keeps token count constant (e.g. widen theloggedtoken at position 2).
This issue also appears in the following locations of the same file:
- line 232
- line 256
// A real widening: v2 gains a trailing wildcard, so the
// version's tokens differ from v1's and key separately.
AuditEvent {
tenant_id: TenantId::new("t"),
timestamp: at(TS0 + 3),
payload: AuditPayload::Template {
template_id: 2,
triggering_line_hash: hash_triggering_line(b"widen"),
triggering_line_sample: None,
change: TemplateChange::Widened {
old_version: 1,
new_version: 2,
old_template: "user <*> logged in from <*>".to_owned(),
new_template: "user <*> logged in from <*> <*>".to_owned(),
positions_widened: vec![6],
},
Summary
RFC 0044 slice 3 — the .6 criterion, with a design refinement stated inline in the RFC:
body ==returns the byte-identical records under both ids and excludes the record whose params differ. Registry-wide unification is what provides this: every(template_id, version)'s tokens are in the fold, so renames and reversions contribute inherently.resolves_to(n)remains the query for shape-crossing equivalence. §3.3 and the .6 criterion now say exactly that, refinement visible.Verification
8/8 rfc0044 it scenarios green; fmt clean;
mdbook buildclean.🤖 Generated with Claude Code
https://claude.ai/code/session_01Qtny6z6cA74xPZa4qRhk4F