Skip to content

feat(analysis): record syntax run-memo reads in the probe trace - #10926

Merged
EffortlessSteven merged 3 commits into
mainfrom
claude/trace-memo-reads-9784
Oct 28, 2026
Merged

EffortlessSteven merged 3 commits into
mainfrom
claude/trace-memo-reads-9784

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Governing issue or accepted claim: #9784
Acceptance delta (one sentence): The Phase A read trace records a memo read for every syntax run-memo consultation, hit or build, attributed to the calling site.

Why

The design note requires memos to record on read, not on build, so a probe that hits an entry another probe built still shows the dependency. The syntax run memo (syntax/run_memo.rs) is shared across probes inside a worker scope and was invisible to the trace.

What changed

  • Kind::Memo and probe_read_trace::memo(product, key_digest). The subject is product:key-digest (hex of the key over source text, discriminator and query). It returns before formatting when tracing is off.
  • memoize, memoize_with and memoize_many record a read whenever they consult an entry inside a memo scope; #[track_caller] attributes it to the consumer, not run_memo. Product::name() names the product.
  • Design note and a changelog.d fragment.

Proof

  • New control: outside a memo scope no read; inside, a miss and a warm hit of one entry are one read with count 2, plus two distinct batch entries; the subject is external_docs: plus 64 hex digits; the site is the caller's file.
  • 20 probe_read_trace and run_memo lib tests pass; cargo xtask precommit passes.

Not claimed

Diagnostic output only. The digest names the key, not the produced value. The other memos in the design note's table (candidate index, transitive reach and the rest) are not yet recorded, and the unknown-input list is unchanged, so coverage stays unknown and reusable false. No analysis behavior or speed change.


Generated by Claude Code


Devin Review

@coderabbitai

coderabbitai Bot commented Oct 28, 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 25 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 154 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: 608275da-3951-4c6d-929f-b31825358930
Commits

Reviewing files that changed from the base of the PR and between c948531 and baff3f3.

Files selected for processing: 5
  • changelog.d/9784-trace-run-memo-reads.md
  • crates/ripr/src/analysis/probe_read_trace.rs
  • crates/ripr/src/analysis/probe_read_trace/tests.rs
  • crates/ripr/src/analysis/syntax/run_memo.rs
  • docs/PER_PROBE_INCREMENTAL_ANALYSIS.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces tracking for syntax run-memo consultations in the RIPR_PROBE_READ_TRACE diagnostic, recording a memo read on every hit or miss. It updates the run_memo functions to log these reads, adds a test suite to verify the behavior, and updates the documentation. The feedback suggests optimizing the byte-to-hex string formatting loop in probe_read_trace::memo by pre-allocating the string and formatting in-place to avoid multiple allocations.

@devin-ai-integration devin-ai-integration 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.

Devin Review found 1 potential issue.

Devin Review

…mo and what is not covered (#9784)

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

Copy link
Copy Markdown
Member Author

Ripr Rust Small on GitHub Hosted / Rust gates failed on b98e8e5 at cargo xtask goldens check: four TypeScript typescript_call_removal_* fixtures lack canonical_gap_id. That is the main break at 96d6dab, not this PR (it touches no fixtures or TypeScript). The fix of record is #10927, still in CI. I'm not opening a duplicate; once it lands I'll merge main into this branch, push the pending doc commit, and re-apply merge-ready.


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.

Verification questions

  • Confirm real probe memo coverage is still not asserted by the CLI trace test identified in the seeded thread.
  • Confirm the syntax run memo records one read for every in-scope consultation, but no real CLI test asserts that a memoized syntax product produces a Memo row.
  • Confirm the sibling-path evidence covers the three named run-memo helpers but does not establish that no other syntax memo lookup route exists.
  • Confirm the existing real CLI trace test does not assert a memo read, so direct scope-level tests do not prove real classification attribution.
  • Confirm the unit test covers instrumentation semantics but not an end-to-end syntax probe.
  • Confirm real probe memo coverage remains unverified by an end-to-end fixture.
  • Confirm the available thread still lacks an assertion that a real probe emits a memo read; the new unit test directly constructs memo scopes and calls run_memo APIs.
  • Confirm real CLI classification-path memo coverage is not asserted by the added test; the seeded thread already records this as unverified.

Refuted

  • memoize_many crosses a worker/async-style handoff where memo state or trace attribution could be lost or misattributed.; refuted because: The changed code constructs keys and emits trace reads on the calling thread before worker execution; workers only receive computed values. The diff contains no JS runtime, GC, detach, or transfer ownership boundary.
  • The per-byte hex formatting is an architectural defect requiring a preallocated formatter change.; refuted because: This diagnostic-only allocation is outside the changed semantics, the author explicitly declined it in the seeded thread, and it does not affect the memo boundary or trace behavior.
  • The hexadecimal-subject allocation objection is a correctness or oracle failure.; refuted because: It is not: the formatting occurs only after the tracing-enabled check and affects diagnostic allocation volume, not the represented memo identity or read semantics.

Evidence gaps

  • Model proof intent was rejected by deterministic validation.

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

Copy link
Copy Markdown
Member Author

Merged main (includes the #10927 goldens fix) and pushed baff3f3, which also carries a docs commit stating where a real classification consults the run memo. Devin and github-actions asked for end-to-end memo coverage; I tried the CLI fixture with and without a helper chain and neither produced a memo read, so I did not add an assertion that cannot hold, and the design note now says no end-to-end fixture covers it. cargo xtask precommit passed on the docs commit before the merge. merge-ready re-applied.


Generated by Claude Code

Copy link
Copy Markdown
Member Author

The run on baff3f3 passed the gates and all four test shards; only the final Ripr Rust Small Result step "Recheck initially admitted eligibility" failed, because Devin's review thread on the memo-coverage question was still unresolved (I had not replied to it). I have now replied with the evidence and the follow-up #10933, resolved the thread, and re-applied merge-ready for a fresh run on the same head.


Generated by Claude Code

EffortlessSteven commented Oct 28, 2026 •

Copy link
Copy Markdown
Member Author

Independent source/currentness reconciliation at baff3f3: no new behavioral blocker found. All five candidate files, the complete docs-only b98e8e5→946f8d5 successor, and the complete five-path c948531→baff delta were inspected. The three production/test files and changelog have identical blobs across independently reviewed b98e8e5, current baff3f3, and executed merge f70fdb1; the changed coverage paragraph correctly retains unknown/reusable=false.

Recording remains after memo-scope admission and before hit/miss lookup; batch reads stay on the caller thread; disabled tracing avoids formatting. Existing hosted logs pass the new memo unit test, 19 trace/run-memo library controls plus the real CLI preservation test (20 relevant controls total), and and classification/value-origin preservation tests. Those last two do not assert an actual memo row, so #10933 remains an explicit real-classification coverage residual, not an established production defect.

Replacement qualification40690393732 passed producer, four shards, verifier and Result for baff3f3/request40690393732-1. Verifier:22,778 listed/JUnit, zero duplicate/missing/extra. Actual checkout f70fdb1 has base66048679 and candidatebaff3f32. Older same-head qualification40683252005 failed final eligibility and remains a failed historical attempt.

Later main66048679→86c05558 changes agent-refusal/docs paths with no overlap in this five-path candidate; that later whole-main composition was not executed. Main ruleset and clean PR state were readable, but the legacy required-status-check inventory GET returned403 Resource not accessible by integration and was not retried. This receipt therefore does not assert independently enumerated current legacy protection requirements. No new qualification or formal APPROVE review was submitted.

Copy link
Copy Markdown
Member Author

Review of record, head baff3f3

Angles inspected on this exact head:

  • Correctness: memoize, memoize_with and memoize_many record on lookup, hit or miss, after the key is computed. #[track_caller] attributes the read to the consumer. memoize_many records once per source key on the calling thread. No analysis result changes.
  • Tests: the control covers off outside a scope, a miss and a warm hit as one read with count 2, distinct batch entries, the external_docs: + 64 hex subject, and caller attribution. No end-to-end fixture asserts a memo read from a real classification; this is documented in the design note and tracked as test(trace): no end-to-end fixture shows a run-memo read from a real classification #10933.
  • Spec and docs: design note and changelog.d fragment match behavior. Coverage stays unknown and reusable false.
  • Performance and security: disabled path returns before any formatting. The enabled path is diagnostic only and bounded by the existing row and site caps.

Findings: two threads (Gemini, a write! allocation nit, declined with the reason; Devin, real-classification coverage, answered and tracked in #10933). Both resolved. No blockers.

CI: qualification run 40690393732 on this head passed gates, four shards, verifier and Ripr Rust Small Result. The reviewing lane reconciled the same head with no new behavioral blocker.

Squash-merging with the expected head.


Generated by Claude Code

@EffortlessSteven
EffortlessSteven merged commit 19b882e into main Oct 28, 2026
87 of 88 checks passed
@EffortlessSteven
EffortlessSteven deleted the claude/trace-memo-reads-9784 branch October 28, 2026 13:45
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