Fix code-probe call-site patterns to match paren-less Ruby sends #482

Closed
opened 2026-08-22 17:28:27 +00:00 by jared · 1 comment
Owner

Context

The code-probe skill's step 3 (trace call sites) prescribes exactly two ast-grep forms: $RECV.NAME($$$A) and NAME($$$A). Both require a parenthesized argument-list node, so they miss idiomatic paren-less Ruby sends. Verified live 2026-08-22: the only production sender of WriteGuard#deny? is return unless guard.deny? at plugins/os-sdlc/hooks/pre_tool_use.rb:24; both prescribed patterns return zero hits on it, while the bare $RECV.deny? form finds it. Consequence: a code-probe run following its own method silently drops real senders from the evidence brief — worst for query methods (foo?), which are conventionally called without parentheses.

Skeptic verdict: CREATE — verified, reproducible tool defect in code-probe's own prescribed patterns (real false-negative on a live call site), with a clear root cause and no existing mechanism covering it.

Tasks

  • In the code-probe skill's step 3, prescribe the bare $RECV.NAME form first; keep NAME($$$A)/$RECV.NAME($$$A) as arity-constraining refinements only.
  • Add the cross-check rule: when a call-site query returns zero hits for a method with a known use, run grep -n before trusting the absence.

Acceptance criteria

  • Running the revised step-3 commands verbatim against deny? finds pre_tool_use.rb:24.

Origin

  • Trigger: manual execution of code-probe step 2.3 commands during teaching session 2026-08-22; both prescribed patterns returned empty on a known call.
  • Improvised this session: bare $RECV.deny? + grep cross-check; cheat-sheet in the teach workspace corrected, skill file untouched.
  • Chain: missed senders in evidence briefs ← ($$$A) patterns require paren'd arg lists ← DESIGN (code-probe SKILL.md step 3 pattern prescription).
  • Root candidate: this ticket.
## Context The code-probe skill's step 3 (trace call sites) prescribes exactly two ast-grep forms: `$RECV.NAME($$$A)` and `NAME($$$A)`. Both require a parenthesized argument-list node, so they miss idiomatic paren-less Ruby sends. Verified live 2026-08-22: the only production sender of `WriteGuard#deny?` is `return unless guard.deny?` at plugins/os-sdlc/hooks/pre_tool_use.rb:24; both prescribed patterns return zero hits on it, while the bare `$RECV.deny?` form finds it. Consequence: a code-probe run following its own method silently drops real senders from the evidence brief — worst for query methods (`foo?`), which are conventionally called without parentheses. Skeptic verdict: CREATE — verified, reproducible tool defect in code-probe's own prescribed patterns (real false-negative on a live call site), with a clear root cause and no existing mechanism covering it. ## Tasks - [ ] In the code-probe skill's step 3, prescribe the bare `$RECV.NAME` form first; keep `NAME($$$A)`/`$RECV.NAME($$$A)` as arity-constraining refinements only. - [ ] Add the cross-check rule: when a call-site query returns zero hits for a method with a known use, run `grep -n` before trusting the absence. ## Acceptance criteria - [ ] Running the revised step-3 commands verbatim against `deny?` finds pre_tool_use.rb:24. ## Origin - Trigger: manual execution of code-probe step 2.3 commands during teaching session 2026-08-22; both prescribed patterns returned empty on a known call. - Improvised this session: bare `$RECV.deny?` + grep cross-check; cheat-sheet in the teach workspace corrected, skill file untouched. - Chain: missed senders in evidence briefs ← ($$$A) patterns require paren'd arg lists ← DESIGN (code-probe SKILL.md step 3 pattern prescription). - Root candidate: this ticket.
Author
Owner

Resolution

Done: code-probe step-3 call-site prescription rewritten: bare $RECV.NAME is the primary query, arity-pinned ($$$A) forms demoted to refinements, trigger-scoped grep cross-check added (0-hit known use, or dynamic :NAME/send hunts); cheatsheet.md and pattern-catalog.md updated consistently; plugin cache refreshed

Evidence: Working-tree diff on plugins/os-sdlc/skills/code-probe/{SKILL.md,references/cheatsheet.md,references/pattern-catalog.md} + History row in docs/implementation-status/os-sdlc.md (uncommitted, pending user commit). Acceptance criterion verified live: ast-grep run --lang ruby -p '$RECV.deny?' plugins/os-sdlc finds plugins/os-sdlc/hooks/pre_tool_use.rb:24, which both old prescribed forms missed (ast-grep 0.45.1). bin/refresh-plugins: all plugins synchronized.

Follow-ups: Two surfaced by the implementer, neither captured: (1) zero-arg caveat for the def-anchor example in code-write/references/rewrite.md — different use case (rewrite anchors, not call-site tracing), surfaced to user in-session for a judgment call; (2) audit of other os-sdlc reference docs for arity-assumption blind spots — dropped as speculative, no second observed failure.

## Resolution **Done:** code-probe step-3 call-site prescription rewritten: bare $RECV.NAME is the primary query, arity-pinned ($$$A) forms demoted to refinements, trigger-scoped grep cross-check added (0-hit known use, or dynamic :NAME/send hunts); cheatsheet.md and pattern-catalog.md updated consistently; plugin cache refreshed **Evidence:** Working-tree diff on plugins/os-sdlc/skills/code-probe/{SKILL.md,references/cheatsheet.md,references/pattern-catalog.md} + History row in docs/implementation-status/os-sdlc.md (uncommitted, pending user commit). Acceptance criterion verified live: ast-grep run --lang ruby -p '$RECV.deny?' plugins/os-sdlc finds plugins/os-sdlc/hooks/pre_tool_use.rb:24, which both old prescribed forms missed (ast-grep 0.45.1). bin/refresh-plugins: all plugins synchronized. **Follow-ups:** Two surfaced by the implementer, neither captured: (1) zero-arg caveat for the def-anchor example in code-write/references/rewrite.md — different use case (rewrite anchors, not call-site tracing), surfaced to user in-session for a judgment call; (2) audit of other os-sdlc reference docs for arity-assumption blind spots — dropped as speculative, no second observed failure.
jared closed this issue 2026-08-22 17:39:23 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jared/cc-os#482
No description provided.