Skip to content

fix(analysis): path keywords never seed assertion-target affinity (#9171) - #9204

Merged
EffortlessSteven merged 17 commits into
mainfrom
claude/fix-keyword-affinity
Oct 24, 2026
Merged

EffortlessSteven merged 17 commits into
mainfrom
claude/fix-keyword-affinity

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Governing issue or accepted claim: #9171

Acceptance delta (one sentence): a Rust path or declaration keyword (crate, union Name {..}, macro_rules!, ...) in an owner-less probe no longer relates an unrelated test through assertion-target affinity, so the probe stops reporting reach yes and a borrowed exact-value oracle, while a genuine identifier use still relates.

Change

  • Strict/reserved keywords are dropped by fix(analysis): a Rust keyword in a changed expression is not a related-test name token (#9172) #9205's RUST_KEYWORDS at probe-token construction (merged); this PR adds its regression coverage and fixture.
  • is_declaration_only_token refuses union and macro_rules only when every occurrence is a declaration (union Name {/</where, macro_rules!), on the probe side and the assertion side; identifier uses (a.union(&b)) keep the token. The scan is textual (a declaration in a comment/string counts as a declaration; fail-closed).
  • Tests: path_keyword_in_owner_less_probe_relates_no_assertion_test, declaration_introducer_in_probe_relates_no_assertion_test, every_long_rust_keyword_is_refused_as_assertion_affinity_seed (indexed and full-scan).
  • Fixture fixtures/rust_path_keyword_affinity (union, macro_rules, real-identifier positive), RIPR-SPEC-0172 section, traceability, changelog fragment.
  • Includes the one-line duplicate-field fix in app/test_stub.rs (same hunk as test(stub): drop duplicated already_present field in the repair-journey witness #10036) so the lib test target compiles.

Proof

  • New unit tests, cargo xtask goldens check, cargo xtask check-traceability, cargo xtask precommit: exit 0.
  • Not run: full workspace tests, hosted CI.

Out of scope: #9173, #9174.


🤖 Generated with Claude Code

https://claude.ai/code/session_01X6PpvQbrLxYbxRjHqJ4Aby

)

An owner-less probe (import, const, field line) related every test that
asserts on any `crate::..` path because `crate` passed the 5-byte token
floor. Keywords are now excluded from the affinity token set.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X6PpvQbrLxYbxRjHqJ4Aby

Copy link
Copy Markdown
Member Author

Heads-up from #9205 (draft): it adds a single RUST_KEYWORDS const in related_tests.rs (keyword filter for the name-token path). To avoid two keyword lists, once #9205 lands this PR's is_rust_keyword should call RUST_KEYWORDS.contains(&token) instead of its own matches! list (whichever lands second reuses the first).

🤖 Generated with Claude Code

https://claude.ai/code/session_01X6PpvQbrLxYbxRjHqJ4Aby


Generated by Claude Code

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 20 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 143 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: e5a64e48-f746-462b-94db-8d0a7fb8bf1a
Commits

Reviewing files that changed from the base of the PR and between 8a615b6 and 5d5d848.

Files selected for processing: 12
  • .ripr/traceability.toml
  • changelog.d/9171-path-keyword-affinity.md
  • crates/ripr/src/analysis/classify/related_tests.rs
  • docs/specs/RIPR-SPEC-0172-cross-crate-dependency-edge-relation.md
  • fixtures/rust_path_keyword_affinity/SPEC.md
  • fixtures/rust_path_keyword_affinity/diff.patch
  • fixtures/rust_path_keyword_affinity/expected/CHANGELOG.md
  • fixtures/rust_path_keyword_affinity/expected/check.json
  • fixtures/rust_path_keyword_affinity/expected/human.txt
  • fixtures/rust_path_keyword_affinity/input/Cargo.toml
  • fixtures/rust_path_keyword_affinity/input/src/lib.rs
  • fixtures/rust_path_keyword_affinity/input/tests/other.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Confirmed findings

  • ripr sensor itself failed with exit code 2 in this run; the lane's static review treats the keyword filter as additive, but the failing sensor is unresolved input to the compiler.
  • docs/specs/RIPR-SPEC-0172-cross-crate-dependency-edge-relation.md:268 — The spec prose says 'crate is five bytes' as motivation, but the actual acceptance criterion is the 8-char assertion-token length threshold. Consider aligning wording to 'long enough to survive the assertion-token min-length pre-filter' so future readers understand the real gate.

Refuted

  • A length-5 Rust keyword ('crate') acts like a resizable-buffer active view: probe side mutates a token set while assertion side holds a stale snapshot, producing a detach-like loss of relation.; refuted because: No active-view or resizable-buffer machinery exists in the diff; the change is a pure prefilter on Vec tokens in a static analyzer. The 'crate' filter prevents any probe-side seeding at all, so there is no stale-snapshot or detach surface to evaluate.
  • Keyword filter applied to candidate prefilter would over-prune sibling path scans.; refuted because: The diff only adds the filter inside the long-probe-token set construction (find_related_tests_with_candidates ~line 851); the candidate prefilter stage (FullScan / indexed) is unchanged and explicitly described as 'stays a superset' in the PR acceptance delta and SPEC-0172. Source-route scanning across entry points is therefore not narrowed.
  • Adding is_rust_keyword to the filter chain might shrink ownership/lifetime tokens that a probe depends on, producing use-after-free style aliasing in the relation map.; refuted because: Probe tokens are read-only string slices consumed within the same function scope; removal cannot create dangling references or aliasing. Discriminator control demonstrates the affinity relation still fires for a real identifier, so the relation map's invariants are unchanged.
  • is_rust_keyword keywords list is gated by pre-existing length filter (>=8 chars), so tokens like 'crate','super','match','static','const','extern','unsafe','struct','trait','async','await' are kept out; shorter keywords never reach assertion tokens.
  • The new is_rust_keyword filter could be evaluated off-thread, losing the keyword set, or shared across workers/threads without sync.; refuted because: No concurrent or worker-boundary use site exists: the helper is a pure fn called inline inside find_related_tests_with_candidates on the analysis thread; there is no postMessage, transferable, or Send/Sync requirement. Rust keyword list is a static matches! literal, no shared mutable state, no async hop.
  • Active-view semantics (resizable buffer, detach/transfer, stale length) are out of scope: diff is a Rust-only static analyzer token filter plus a fixture and spec note; no JS/WASM/JS-bridge surface is touched.

Evidence gaps

  • cargo-test for the new test is scheduled-late and not in this packet; ripr sensor failed with exit code 2 and AST-grep did not surface the function. Without the cargo-test receipt we cannot confirm the test compiles and passes in the current workspace — request deterministic proof before merge.
  • Model proof intent was rejected by deterministic validation.

Parked follow-ups

  • Build-script name-token linking and string-literal continuation lines are separate routes and should not be broadened into this PR.
  • Prior comment about #9205's RUST_KEYWORDS const collides: this PR hard-codes its own matches! list; if #9205 lands first, this becomes a duplicate keyword table and risks drift (e.g. where listed here is 5 bytes and ≥ MIN_LEN).

Copy link
Copy Markdown
Member Author

Local proof on head 09f490a: cargo xtask precommit pass; cargo xtask goldens check pass (exit 0). Not run: hosted CI. Negative experiment: the same repro on ripr 0.11.0 (pre-fix) reports reach yes: picks_two; the blessed fixture now reports reach no.


Generated by Claude Code

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Confirmed findings

  • #9205 will land a RUST_KEYWORDS const in the same file; whichever PR lands second should redirect is_rust_keyword to RUST_KEYWORDS.contains rather than maintain two keyword lists. Author flagged this in the seeded issue comment (2026-10-21T16:20:32Z).
  • The keyword deny-list is incomplete, including contextually relevant words such as dyn and union, so a long assertion token matching one can still seed the same false affinity.

Verification questions

  • Confirm the new unit test and fixture prove only crate; they do not exercise other listed keywords or establish that every future Rust keyword is filtered.
  • Confirm spec wording says 'crate is five bytes' but the actual gate is ASSERTION_TOKEN_MIN_LEN (8 per context). A reader assumes the wrong threshold and may add or remove keywords at the wrong length boundary, weakening the deny-list.

Refuted

  • A second keyword list is inherently a correctness blocker in this PR.; refuted because: The seeded thread identifies duplication with #9205, but no evidence shows this PR's list causing divergent current behavior; that concern is folded into the stronger completeness objection.
  • Path-keyword filter could be exploited to suppress legitimate related-test signals (DoS of analysis output: every keyword-heavy import silently yields no related tests, hiding real coverage gaps).; refuted because: Filter only runs on the owner-less probe token stream inside assertion_target_affinity; cross-crate call edges, shared identifier tokens, and stem-named test files still relate via independent signals. Worst case is missed assertion-affinity relation, not suppression of the reach/finding pipeline.
  • The new is_rust_keyword filter or the surrounding token pipeline crosses a worker/async/transfer boundary (postMessage, Transferable, SharedArrayBuffer, structured clone, WeakRef finalize, detached ArrayBuffer) such that a stale probe-side token snapshot can re-seed assertion-target affinity after GC or detach.; refuted because: Diff and module are synchronous Rust on owned Vec<String> / &[String] with no JS runtime, no async spawn, no channel, no transferable handle, no detached buffer. The filter mutates only locals in one function call before collection; nothing is retained across any boundary. SEED thread also does not raise a worker-handoff concern (only keyword-list reuse vs #9205).
  • The change requires broad follow-up across build.rs name-token linking and string-literal continuation lines.; refuted because: Those concerns are explicitly out of scope in the PR body and are not implied by the changed assertion-affinity route.
  • Length-5 Rust keyword acts like a resizable-buffer active view: probe side mutates tokens while assertion side holds a stale snapshot, producing a detach-like loss of relation (#9171).; refuted because: No active-view or resizable-buffer machinery exists; tokens are produced, filtered, and consumed within one find_related_tests_with_candidates call. The keyword filter prevents probe-side seeding entirely, leaving nothing for a stale snapshot to refer to. Refuted as stated for this lane.
  • Filtering crate from long probe tokens creates a resizable-buffer active-view or stale-snapshot failure.; refuted because: No buffer, view, unsafe pointer, resize, detach, or transfer operation is involved. The filter borrows each owned token string, and the test checks both indexed and full-scan paths; the candidate prefilter remains unchanged.

Evidence gaps

  • Model proof intent was rejected by deterministic validation.

Parked follow-ups

  • The PR explicitly parks build.rs name-token linking and string-literal continuation-line handling; this lane did not broaden those unrelated parser/helper paths.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Independent exact-head inspection: REPAIR_REQUIRED.

reviewed_head_sha: 1d16325
reviewed_tree: bc370768a0e6e1de7e111bffe49189a34912604c
integration_basis: PR-reported base b2568cb; separately inspected main 07fcb90, tree 585633e2f29b41576a10a5ef65974214dc52a163.
claim_boundary: #9171, ownerless-probe assertion affinity; canonical candidate remains claude/fix-keyword-affinity. No candidate branch/ref changed.

Blocking source finding: declaration introducers union and macro_rules still seed assertion_target_affinity. The union case produces reach=yes, observation=yes and weakly_exposed for an unrelated test; see the inline reproduction. This is an incomplete fix to the advertised boundary, not a claim that the residual was introduced here. Rust documents both as context-dependent weak keywords: https://doc.rust-lang.org/reference/keywords.html#weak-keywords.

Observed local proof (Linux x86_64, rustc 1.95.0, locked default features, debug=0, jobs=2):

  • Pristine head: cargo test --locked -p ripr --lib built successfully. Four fully qualified libtest selections each executed one test and passed: path_keyword_in_owner_less_probe_relates_no_assertion_test; given_struct_field_probe_when_assertion_references_field_token_then_oracle_test_is_related; given_struct_field_probe_when_shared_token_is_4_chars_then_assertions_signal_does_not_fire; given_function_owner_probe_when_assertion_references_probe_token_then_signal_does_not_fire. The first unqualified --exact invocation selected zero tests and is excluded from proof.
  • Pristine cargo build --locked -p ripr --bin ripr passed. Binary reports the reviewed SHA; SHA256 de19be80b69277f556d0b8af22d4363717b1f982a7c982734c571fc5762eb108.
  • Real CLI: the submitted crate fixture reports reach=no and zero related tests; all expected JSON fields match (the additional canonical_next_action is intentionally stripped by the existing fixture normalizer). A genuine shared PICK_SEED constant retains assertion_target_affinity and reach=yes. No full goldens-runner pass is claimed.
  • Reviewer-only tests, with production bytes unchanged, are bound to experimental tree d47c81cbbb8f23d5fa0ec5ebf42794b539af997f. cargo test --locked -p ripr --lib review_9204 -- --nocapture executed 2 tests, exit 101: a 10-case matrix passed; the two-declaration negative control failed. Indexed/full-scan results agree for all 12 cases. crate, super, const, static, struct and unsafe reject unrelated assertions; alpha (5 bytes), pick_seed, crate_budget and union used as a genuine identifier retain affinity. union and macro_rules used as declaration syntax both incorrectly relate. Synthetic helper oracle facts are separate from the real CLI's producer-selected oracle kind.
  • The union and macro examples compile, and their independent Rust tests pass. Removing only the declaration from the unrelated assertion makes the same candidate binary report reach=no and zero related tests in both examples. Removing PICK_SEED from the genuine positive's assertion likewise removes its relation.

Earlier findings reconciled:

  • ASSERTION_TOKEN_MIN_LEN is 5 at related_tests.rs:82, not 8. The five-byte crate motivation is correct. dyn is three bytes and cannot enter this affinity set. false is already removed by extract_identifier_tokens. Neither is an executable omission here.
  • The union hypothesis is confirmed specifically in declaration context; macro_rules has the same residual. Neither occurrence is a thread, memory-view or asynchronous-boundary issue.
  • The candidate prefilter remains a deliberate superset; final semantic filtering owns rejection. The parity controls verify both selection paths.
  • The earlier author-reported precommit/goldens receipt is on 09f490a, not this current head; it is historical evidence, not current qualification.

#9205 composition inspection only:

  • #9205 head da3ed05 composes mechanically with this head: merge-tree exit 0, tree cc6e42bcdb12d781daae91b9bc44c5441b54d5fd.
  • Every one of this helper's 25 entries is in its 52-entry RUST_KEYWORDS table. Reusing that table covers the current helper list, but neither table handles union/macro_rules declaration syntax. The weak-keyword identifier policy must stay explicit; this inspection does not qualify #9205's separate name-link claim or alter its ownership.

Integration and hosted evidence:

  • merge-tree against the inspected main fails with content conflicts in related_tests.rs and RIPR-SPEC-0172. No combined-tree pass exists.
  • Observed GitHub merge ref c849479 has parents b2568cb and this head, tree bc370768a0e6e1de7e111bffe49189a34912604c. It is the earlier basis, not evidence for current-main composition.
  • Complete visible current-head check inventory: 23/23 returned, all terminal, none named Ripr Rust Small Result. No active hosted validation was duplicated.
  • ub-review run 39898983446/job 120235907481 is green in advisory mode with enforcement off. Its actual reporter records ripr failed/exit 2, cargo-test timed out at 900s, rejected proof intents and deferred red/green work; its head-only proof is not discrimination. These are missing/instrument evidence, not proof of a source failure or a clean review. Historical automated review comments do not establish current-head semantic clearance.
  • Existing reviews, ordinary comments and inline-thread inventory were re-read before posting; no existing inline threads were returned. No material finding was silently resolved.
  • Hosted required qualification and final protected merge are unestablished. Branch-protection read returned 403 Resource not accessible by integration; the branch-rules endpoint was unsupported by the connected fetcher, and gh reads returned bare transport Forbidden. No protection change or alternate credential route was attempted.

Inspected semantic path: token extraction -> candidate prefilter -> final relation selection -> RelationReason::establishes_reach/reach_evidence -> real JSON/human output; complete 12-file diff, fixture/spec/traceability/changelog and related controls. No new schema, package, platform, filesystem, permission or async surface is introduced. Full workspace tests, full precommit/goldens and hosted matrix were not rerun after the concrete source blocker.

Owner / governing claim: claude/fix-keyword-affinity / #9171.
Next: repair declaration-only affinity through this canonical candidate, retain real identifier positives, reconcile main conflicts and the #9205 shared-list composition, then obtain exact-new-head review, integration proof and normal required qualification. Keep Draft until those pre-Ready blockers clear. No Ready, merge-ready request, merge or release action was taken.

…ssertion affinity (#9171)

Merge origin/main and reject `union Name {..}` and `macro_rules!` declaration
occurrences on both the probe and assertion side of assertion-target affinity,
keeping genuine identifier uses. Extends the unit test and the
rust_path_keyword_affinity fixture with union, macro_rules and a real-identifier
positive. Depends on #9205 only for a future shared keyword table; this PR keeps
its own filter until #9205 lands.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X6PpvQbrLxYbxRjHqJ4Aby

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Confirmed findings

  • docs/specs/RIPR-SPEC-0172-cross-crate-dependency-edge-relation.md:273 — The rationale attributes the bug to crate being five bytes, but the implementation's relevant precondition is the shared ASSERTION_TOKEN_MIN_LEN threshold. This can mislead future changes about which tokens reach this filter. Replace the length explanation with the actual threshold invariant.

Verification questions

  • Confirm the keyword completeness contract is not established by the changed tests or fixture, which exercise only crate, union, and macro_rules.

Refuted

  • The fix must alter candidate selection or broader relation machinery to prevent keyword affinity.; refuted because: The diff keeps the candidate prefilter unchanged and applies filtering only after long probe tokens are formed, matching the advertised narrow assertion-affinity boundary.
  • The keyword/declaration filtering change could create an exploitable memory-safety primitive through token manipulation.; refuted because: The changed code only computes boolean filters over borrowed or owned immutable strings; it introduces no mutable aliasing, raw access, unsafe operation, or unbounded allocation path.
  • The keyword filter might prune candidate prefilter selection or sibling scans.; refuted because: The new keyword/declaration filters are applied to the long probe-token set after candidate selection, not to the candidate prefilter itself, and both indexed and full-scan relation paths are tested.
  • The keyword filter introduces an active-view or resizable-buffer failure by observing only part of a token stream while another side retains a different length.; refuted because: No resizable backing store or shared mutable view exists; the filters operate on an owned Vec snapshot and ordinary immutable &str text.
  • Filtering probe tokens could mutate a token collection shared with an asynchronous worker and leave a stale assertion-side snapshot.; refuted because: No worker, async task, shared mutable owner, or concurrent access exists in the changed path. long_probe_tokens is built synchronously, then only immutably queried by the assertion-side predicate.
  • The specification explains crate through its five-byte length, although the implemented admission gate is ASSERTION_TOKEN_MIN_LEN.
  • The change introduces a native lifetime, aliasing, or ownership safety risk.; refuted because: No unsafe block, raw pointer, reference lifetime, aliasing contract, FFI, or ownership-transfer boundary is changed; the implementation only inspects owned UTF-8 strings and collected token vectors.

Evidence gaps

  • The declared sibling boundary is not proven across every sibling token-extraction route because the ripr sensor failed before supplying a clean run receipt.
  • Exact-head automated proof is still incomplete because the ripr sensor failed and cargo-test evidence is scheduled late.

Parked follow-ups

  • Keyword policy is duplicated as a local matches! list and may diverge from the parallel keyword constant proposed in the seeded #9205 discussion.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Refuted

  • The specification still describes ASSERTION_TOKEN_MIN_LEN as five bytes, but the implementation gate is a byte-length threshold of eight in the review context; this can misdirect future keyword filtering.
  • The spec calls ASSERTION_TOKEN_MIN_LEN five bytes, but crate's five-byte length alone does not determine whether it passes the gate.
  • Token filtering might expose a stale or detached view across a worker, async, GC, or transfer boundary.; refuted because: The diff contains no such boundary or mutable aliased state; all relevant vectors and strings are local, owned, immutable during classification, and the filters do not retain views beyond their borrow scopes.
  • The changed code introduces a memory-safety or aliasing risk through token filtering.; refuted because: The change only performs immutable token/string inspection and collection filtering; it adds no mutable aliasing, unsafe access, or unbounded allocation operation.
  • The changed token classification could create a memory-safety issue through stale borrowed views or aliasing during probe-side and assertion-side filtering.; refuted because: The helper only inspects immutable UTF-8 text, returns a boolean, and does not mutate, free, cast, or store borrowed data beyond the call.
  • The keyword fix may leave a sibling path that still relates unrelated assertions through another token-matching route.; refuted because: The changed matching logic is the central assertion-target affinity intersection, and the added tests explicitly compare indexed and full-scan implementations; the remaining risk is completeness across unshown extraction routes, not a demonstrated public defect.
  • Filtering declaration keywords could over-prune legitimate identifier relationships.; refuted because: The helper returns false for a bounded occurrence not matching declaration syntax, preserving matches such as left.union(&right) and macro_rules.len().
  • Filtering Rust keywords and declaration introducers could expose an OOB read, UAF, type confusion, or DoS exploit primitive.; refuted because: The implementation operates on immutable owned/borrowed strings, performs bounded token searches and ASCII boundary checks, and introduces no unsafe access, pointer lifetime issue, type erasure, secret handling, or unbounded attacker-controlled allocation path.
  • Filtering crate or other keyword tokens could create an active-view/stale-snapshot defect analogous to a resized or detached buffer.; refuted because: The relevant tokens are immutable String values borrowed for the duration of the match. No backing storage is mutated, resized, detached, or transferred, and no length snapshot survives such an event.

Evidence gaps

  • Runtime completion on the reviewed head remains dependent on the failed ripr sensor and late cargo-test receipt rather than the lane's static inspection alone.
  • The security conclusion relies on static review because the ripr sensor failed and cargo-test evidence is scheduled rather than present in the packet.
  • Model proof intent was rejected by deterministic validation.

…pse bless log, honest spec (#9171)

Independent review repairs: keywords are already dropped at probe-token
construction (#9172); the where check is word-bounded; the table test iterates
RUST_KEYWORDS; the fixture blessing log is one accurate entry.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X6PpvQbrLxYbxRjHqJ4Aby

Copy link
Copy Markdown
Member Author

Reply to bot review 5635355291 (head 5d5d848): (1) spec reworded: the invariant is ASSERTION_TOKEN_MIN_LEN, crate is only an instance; keyword dropping is attributed to #9172's RUST_KEYWORDS. (2) the keyword test now iterates RUST_KEYWORDS (len >= the gate, minus tokenizer-dropped false) in both selection paths. An independent review pass also led to removing the now-redundant local keyword filter, word-bounding the where check, and collapsing the fixture bless log into one entry. Known limit recorded in the spec: the declaration scan is textual, so a declaration spelled in a comment or string counts as a declaration (fail-closed).


Generated by Claude Code

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 24, 2026 04:48
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Decision

  • Needs reviewer attention before upstream: findings remain.

Confirmed findings

  • Both probe-token construction and assertion affinity matching apply the declaration-only filter, preventing declaration syntax from seeding assertion affinity on either side.
  • The PR preserves genuine identifier affinity while removing keyword/declaration-only affinity, with explicit positive controls in unit tests and the fixture.

Refuted

  • A stale or detached view introduced by token filtering could cause unsafe memory behavior.; refuted because: The changed helper only inspects immutable string bytes and returns a boolean; no mutable aliasing, unsafe access, or retained borrowed view is introduced.
  • Token filtering could create stale or detached views across a worker, async, GC, or transfer boundary.; refuted because: No such boundary or mutable aliased state exists in the changed path; relevant strings and collections are local and immutably inspected during classification.
  • The new declaration-only token scan could enable a denial-of-service through pathological input.; refuted because: The helper scans bounded local source text with simple byte and string operations; no new external-input route or unbounded allocation is introduced.
  • The spec still says ASSERTION_TOKEN_MIN_LEN is five bytes, while prior review evidence says the implemented threshold is eight; this can misdirect future keyword filtering.

Parked follow-ups

  • The declaration-only check is textual and can classify declaration syntax appearing in comments or string literals, but this is a documented fail-closed limitation rather than an aliasing or lifetime issue.
  • The textual declaration classifier can misclassify declaration-like text inside comments or strings, but this is explicitly documented and the conservative direction is to refuse affinity rather than create a relation.
  • The fixture and specification explicitly document the residual textual limitation for declarations in comments or strings.

Evidence gaps

  • Model proof intent was rejected by deterministic validation.
  • The failed ripr sensor and late cargo-test receipt leave execution evidence unresolved in this packet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants