Skip to content

fix(for): an apply/invoke word led by "how do|does|did" is not a where-used cue (R1) - #736

Merged
joyful-ii-V-I merged 1 commit into
mainfrom
lane/r1-invoke-route
Nov 24, 2026
Merged

joyful-ii-V-I merged 1 commit into
mainfrom
lane/r1-invoke-route

Conversation

@joyful-ii-V-I

@joyful-ii-V-I joyful-ii-V-I commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

fix(for): an apply/invoke word led by "how do|does|did" is not a where-used cue (R1)

Problem. RT2's rule R2 (src/forroute.h isWhereUsed) reads "invoke"/"apply" and their forms as where-used cues. The
everyday question rake-12 — "When I run rake build, how does rake invoke the task: prerequisites, deciding whether a file
task is out of date, and running multitask prerequisites in parallel?" — was therefore routed to --uses=multitask.
The question asks how the actor works; the backticked symbol is not what is invoked. The routed answer (3,805 B) missed 6
of 7 rubric items.

Change. An apply/invoke-family word cues where-used unless "how" + do|does|did precedes it in its sentence
(howDoBefore). Unchanged: "where is X invoked", "what invokes X", a passive "how is X invoked", and every
pass/reference/usage/decorat/used cue. sentenceEnd's terminator test is factored out as endsSentenceAt, which the new
sentenceStart also uses.

Measured (development / in-sample only; the sealed held-out set was not used).

  • Text-only route decision over 313 in-sample --for texts (S1, LD, MF1, large-dev-2, mf1-dev-2, docs-dev): 2 decisions
    change, rake-12 and fzf-12. fzf-12's symbol (suffix$) never resolves, so its answer was already unrouted.
  • Default argv, base (0.7.0) vs this branch: rake-12 ◐ 3,805 B → ✓ 15,522 B (the --for page). fzf-12, ld2-angular-11,
    ld2-angular-15 and mf2-nest-06 (the other in-sample where-used rows) are byte-identical.
  • RT2's own development set and GA1 DEV were not available to this run and have not been re-checked.

Gates. test/forverbroutecheck.sh adds arms 41 and 41b: the rake-12 shape and an "apply" twin stay on --for, byte for
byte. Both are red on the 0.7.0 binary. Arm 42 checks that four where-used forms still route to --uses. forroutecheck,
forroutepagecheck, mcpforroutecheck, mcpforroutepagecheck, carriedpageboundcheck, foranswerfirstcheck pass;
scripts/qd_range.sh PASS (0 gating).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Questions using bounded “apply” or “invoke” phrasing are now routed to where-used results.
  • Bug Fixes
    • Questions beginning with “how do,” “how does,” or “how did” are excluded from this routing when the phrase appears in the same sentence.

… where-used cue

The everyday question rake-12 ("When I run `rake build`, how does rake invoke the task: prerequisites, … and running
`multitask` prerequisites in parallel?") was routed by RT2's rule R2 to --uses=multitask: "invoke" read as a where-used
cue, but the question asks how the actor works and the backticked symbol is not what is invoked. The routed answer
(3.8 KB) missed 6 of 7 rubric items; the unrouted --for answer (22 KB) is complete.

- forroute.h isWhereUsed: "apply"/"applies"/"applied"/"invoke"/"invokes"/"invoked" cue where-used unless "how" +
  do|does|did precedes the word in its sentence (howDoBefore). "where is `X` invoked", "what invokes `X`", a passive
  "how is `X` invoked" and every pass/reference/usage/decorat/used cue are unchanged. sentenceEnd's terminator test is
  now endsSentenceAt, shared with the new sentenceStart.
- Measured text-only over 313 in-sample --for texts (S1, LD, MF1, large-dev-2, mf1-dev-2, docs-dev): 2 decisions
  change, rake-12 and fzf-12 (fzf-12's `suffix$` never resolves, so its answer is unrouted already).
- Gate: test/forverbroutecheck.sh arms 41, 41b (the rake-12 shape and an "apply" twin stay on --for byte for byte;
  red on the 0.7.0 binary) and 42 (four where-used forms still route to --uses).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review.

Walkthrough

The routing logic now treats bounded apply/invoke forms as where-used cues unless “how do,” “how does,” or “how did” precedes them in the same sentence. Regression tests cover both routing outcomes.

Changes: Apply and invoke routing

Layer / File(s) Summary
Sentence-boundary detection
src/forroute.h
Sentence-boundary helpers identify question marks and periods followed by whitespace or end-of-text. The howDoBefore check uses these boundaries and does not treat periods within dotted names as sentence endings.
Apply/invoke classification and tests
src/forroute.h, test/forverbroutecheck.sh
isWhereUsed checks bounded apply/invoke forms separately from existing cues and excludes them when “how do,” “how does,” or “how did” precedes them in the same sentence. Tests check two unrouted cases and four where-used cases.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: Minimal · up to 16cb9

This change keeps questions such as "how does X invoke Y" on the --for path instead of routing them to --uses, and leaves the existing where-used cues unchanged. No concrete merge-blocking risk was identified, and regression tests cover both routing outcomes.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: an apply/invoke word preceded by "how do/does/did" in the same sentence is no longer treated as a where-used cue. The raw summary confirms that src/forroute.h implemen…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: an apply/invoke word preceded by "how do/does/did" in the same sentence is no longer treated as a where-used cue. The raw summary confirms that src/forroute.h implements exactly this exception, and the test script adds arms for it. The title is specific and matches the changeset. It is 84 characters, slightly long, but this does not affect the assessment.

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 326dec9 and 16cb9d6.

Files selected for processing: 2

  • src/forroute.h
  • test/forverbroutecheck.sh

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

@joyful-ii-V-I
joyful-ii-V-I merged commit 4f60497 into main Nov 24, 2026
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant