Repository navigation
trail init learns from PR review comments - #614
anirudhkumar-nanonets wants to merge 1 commit into
Conversation
🌱 graft blast radius3 areas changed → 4 areas can be affected. 11 dependent symbols, depth 2. flowchart TB
A0(("Session State Management<br/>7 symbols"))
A1(("Telemetry Tracking<br/>2 symbols"))
A2(("Cloud Nudges<br/>1 symbol"))
A3(("MCP Tools<br/>1 symbol"))
classDef reached fill:#D9EDF3,stroke:#3AA7C9,stroke-width:1.5px,color:#0E313C;
class A0,A1,A2,A3 reached;
Who knows this code — 2 people across 7 areas
Ownership is git history over each area's own files, weighted towards recent work (120-day half-life). Merge commits and bots are dropped, and you are dropped from your own PR. A name with no All 11 dependent symbols, grouped by areaSession State Management — 7 symbols in 7 files
Telemetry Tracking — 2 symbols in 2 files
Cloud Nudges — 1 symbol in 1 file
MCP Tools — 1 symbol in 1 file
Test signal per changed area — 2 ✓ · 1 –Reached = a node under a test path has a resolved edge into the changed symbol. It undercounts anything called indirectly — through a CLI, a spawned process or a dynamic import — so read a low ratio as “look here”, never as a coverage gate.
19 test suites also reference this code19 symbols, kept out of the diagram and the table so they cannot crowd out the areas a reviewer has to look at.
Open the interactive graph → — click an area to see its dependent symbols at file:line. |
6f3a80c to
516fcf8
Compare
Moves:
learnings_committed, clones whose committed learnings went up in the last 7 days (PostHog Postgres, DB 11,posthog_event_full_view; query indaily/project.md). I couldn't read today's value because this session has no Metabase access. The last recorded value is 0 on 2026-10-13, before the event shipped.What
trail initgets a second source for its first-run learnings: review comments on the repo's last 50 merged PRs. This was rushabh's 13 Oct ask for init's opening, e.g. "PR reviews keep flagging missing error handling in /api".gh api graphqlcall fetches review summaries and inline comments. It runs only when the repo has a GitHub remote andgh auth tokensucceeds; otherwise it's skipped quietly, the same way init stays quiet when it can't find claude.scrub()runs on every comment before it reaches Claude, and no logins are sent.placeQuotes, whichverify()uses too.--yes, all are kept..trail/learnings/, with the line_Flagged in review on N PRs here (#41, #38), most recently on Oct 10._pr-reviews.json). It's also skipped when.trail/learnings/already holds review learnings, i.e. a teammate already ran it, so the same reviews don't create duplicates._trail-past-read, for repos that move from graft to trail at session start.Init output, with both sources:
Telemetry
cold_startgainssource(sessions/reviews) andreviews_bucket(merged PRs with a reviewer's comment, bucketed).no_reviewsandno_gh(andcancelled, from trail init: find extension claude, tick learnings #612, applies to both sources).source: sessions. An event withoutsourcecomes from a build before this change.TELEMETRY.mdand the README's "What stays on your machine" section are updated.Tested
test/trail-pr-reviews.test.ts:verifyReviews: a finding on 2 PRs is kept, a misfiled quote still counts, made-up and single-PR findings are droppedtrail initwith a fakeghandclaudeon PATH: both learning blocks, once per repo, skipped on a teammate's machine, and what Claude was sentghthat isn't signed in, no GitHub remote, andghmissingtest/cli-picker.test.ts: a review row in the same list as session rows.npm test: 1407 tests, 0 failures, 1 skipped (the existing Node 24 skip).tsc --noEmitis clean.Stacked on #612
The base is
fix/trail-init-extension-claude, because #612 changes the same init code (theclaudeBin()lookup, the session counts and the keep picker). Once #612 merges, GitHub retargets this PR tomain.🤖 Generated with Claude Code