Skip to content

feat: trail is the command name, graft still works - #555

Closed
anirudhkumar-nanonets wants to merge 3 commits into
mainfrom
feat/trail-cli-name
Closed

anirudhkumar-nanonets wants to merge 3 commits into
mainfrom
feat/trail-cli-name

Conversation

@anirudhkumar-nanonets

Copy link
Copy Markdown
Collaborator

Moves: graft_active (PostHog DB 11, posthog_event_full_view, distinct users with a query event in the last 7 days, the SQL in daily/project.md): 9,370 on 2026-10-07. The new cli_name property on every event splits it by which name ran, trail or graft. It starts at 0 for trail because it's new.

People sign up for Trail, so the command is called trail now. graft keeps working for everyone who already has it, and its output doesn't change.

  • Two packages with one bin each. @trailhq/trail ships trail, laid out by scripts/pack-trail.mjs into build/trail. @nanonets/graft ships graft. It's the same code: dist/bin/trail.js / dist/bin/graft.js set TRAIL_INVOKED_AS, and brand() / cmd() pick the spelling. I diffed graft's --help against main. The only addition is graft build --check / --json.
  • Commands under trail:
    • The help is grouped.
    • login, push, pull, logout and status are top-level.
    • The old trail trail … spellings still run.
    • The freshness check moves to trail build --check, because trail check becomes the team check later in this stack.
  • MCP. trail mcp serves trail_* tools and still answers graft_* calls, so wiring an older graft wrote keeps working.
  • Upgrades. graft upgrade also installs @trailhq/trail once it's published, and people still typing graft see a once-a-day note about the new name.
  • Telemetry. cli_name is added to the contract allowlist and to TELEMETRY.md, and the contract test pins it.

Not published: @trailhq/trail needs the trailhq npm org.

Stack: this PR, then the notes, skills and cloud PRs on top. To try all four together, check out feat/trail-all.

Tests: npm test, 1,375 pass on this branch.

@trailhq-graft

trailhq-graft Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

🌱 graft blast radius

5 areas changed → 7 areas can be affected. 19 dependent symbols, depth 2.
Tests: Graph Validation has tests the diff did not touch; 3 areas updated their tests.
Tag: @shhdwi — 8 of 12 areas · @afeddersen — MCP Server, Session Telemetry · 贾旭卿 — Graph Validation

flowchart TB
  A0(("Session Display<br/>5 symbols"))
  A1(("Tool Invocation<br/>4 symbols"))
  A2(("Workspace Federation<br/>4 symbols"))
  A3(("Change Tracking<br/>3 symbols"))
  A4(("Search Formatting<br/>1 symbol"))
  AX(("2 smaller areas<br/>2 symbols"))
  classDef reached fill:#D9EDF3,stroke:#3AA7C9,stroke-width:1.5px,color:#0E313C;
  class A0,A1,A2,A3,A4 reached;
  classDef tail fill:#EEF2F3,stroke:#9AA4A9,stroke-width:1px,color:#3A4247;
  class AX tail;
Loading
Can be affected Symbols Nearest hop Reached from
Session Display 5 src/claude/state.ts:L1-L104 state.ts — imports, depth 1 Telemetry Contract
Tool Invocation 4 src/mcp/tools.ts:L247-L329 callSingleTool — calls, depth 1 cmd, Graph Validation +2
Workspace Federation 4 src/graph/map.ts:L325-L350 formatRepoMap — calls, depth 2 cmd
Change Tracking 3 src/brain/autopush.ts:L1-L270 autopush.ts — imports, depth 1 Telemetry Contract
Search Formatting 1 src/search/grep-cli.ts:L54-L63 formatGrepResult — calls, depth 2 cmd
Maintenance Tasks 1 src/upkeep-run.ts:L59-L81 runUpkeep — calls, depth 1 cmd
1 smaller area 1 Session Telemetry see below
Who knows this code — 4 people across 12 areas
Area Who knows it
cmd · changed @shhdwi — 47 commits, last 2mo ago
MCP Server · changed @shhdwi — 2 commits, last 3mo ago · @afeddersen — 1 commit, last 1mo ago
Graph Validation · changed @shhdwi — 3 commits, last 2mo ago · 贾旭卿 — 1 commit, last 1mo ago
Build Scripts · changed @shhdwi — 1 commit, last 3mo ago
Session Display · affected @shhdwi — 17 commits, last 2mo ago
Tool Invocation · affected @shhdwi — 14 commits, last 2mo ago
Workspace Federation · affected @shhdwi — 14 commits, last 2mo ago
Search Formatting · affected @shhdwi — 3 commits, last 2mo ago
…4 further 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 @ has no GitHub handle in its commit email — tag them by hand, or add a .mailmap entry. A suggestion from history, not a CODEOWNERS rule.

All 19 dependent symbols, grouped by area

Session Display — 5 symbols in 5 files

  • src/claude/state.ts:L1-L104 — state.ts (imports, depth 1)
    10: import type { AgentHost } from '../telemetry/contract.js';
  • src/claude/format.ts:L1-L238 — format.ts (imports, depth 2)
    31: return [C.muted('◤ graft · not built · run ') + C.text('graft build')];
  • src/claude/stats.ts:L1-L27 — stats.ts (imports, depth 2)
  • src/claude/statusline.ts:L1-L36 — statusline.ts (imports, depth 2)
  • src/claude/sync-run.ts:L1-L42 — sync-run.ts (imports, depth 2)
    40: // Run only when executed directly (node dist/claude/sync-run.js <dir>), not on import.

Tool Invocation — 4 symbols in 1 file

  • src/mcp/tools.ts:L247-L329 — callSingleTool (calls, depth 1)
    273: const parts = [formatCheckReport(r)];
  • src/mcp/tools.ts:L216-L244 — callTool (calls, depth 1)
    223: const name = canonicalToolName(requestedName);
  • src/mcp/tools.ts:L153-L199 — callWorkspaceTool (calls, depth 2)
  • src/mcp/tools.ts:L1-L330 — tools.ts (imports, depth 2)
    7: import { formatCheckReport } from '../context/check.js';

Workspace Federation — 4 symbols in 4 files

  • src/graph/map.ts:L325-L350 — formatRepoMap (calls, depth 2)
  • src/graph/traverse-cli.ts:L166-L242 — runCallersCommand (calls, depth 2)
    171: console.error(`✗ no graph found at ${contextDir} — run \`graft build\` first`);
  • src/graph/workspace-cli.ts:L88-L97 — runWorkspaceAsk (calls, depth 2)
  • src/graph/workspace.ts:L659-L695 — federateCallers (calls, depth 2)
    689: const base = `no symbol "${symbol}" in any of the ${wg.loaded.length} workspace repo(s) — check spelling or run graft build`;

Change Tracking — 3 symbols in 3 files

  • src/brain/autopush.ts:L1-L270 — autopush.ts (imports, depth 1)
    7: * command you run once, during onboarding — so a trail attached in March was
  • src/brain/pull.ts:L1-L332 — pull.ts (imports, depth 1)
    51: if (res.ruleCount === 0) return "· the trail has no rules yet — run graft trail push to read this repo into it";
  • src/brain/watch-trail.ts:L1-L395 — watch-trail.ts (imports, depth 1)
    9: * `graft-watcher.sh` that ran `graft trail pull --dry-run` every minute and

Search Formatting — 1 symbol in 1 file

  • src/search/grep-cli.ts:L54-L63 — formatGrepResult (calls, depth 2)

Maintenance Tasks — 1 symbol in 1 file

  • src/upkeep-run.ts:L59-L81 — runUpkeep (calls, depth 1)
    77: const nudge = formatUpdateNudge(current, readUpdateCache(opts.home)?.latest);

Session Telemetry — 1 symbol in 1 file

  • src/telemetry/sessions.ts:L1-L113 — sessions.ts (imports, depth 1)
    20: * (the force-close) — both places guaranteed to run at the right moment. A hook
Test signal per changed area — 3 ✓ · 1 ⚠ · 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.

  • ✓ cmd — 12 of 43 reached · 1 test file changed here: test/trail-name.test.ts
    • not reached: inBrand, setBrand, trailOnPath, readPackageName, runUpgrade, grouped, queryRoot, spelling, …23 more
  • ✓ Telemetry Contract — 0 of 1 reached · 1 test file changed here: test/telemetry-contract.test.ts
    • not reached: commonProps
  • ✓ MCP Server — 1 of 4 reached · 1 test file changed here: test/trail-name.test.ts
    • not reached: toolSearchQuery, mcpInstructions, startMcpServer
  • ⚠ Graph Validation — 2 of 3 reached · 3 test files reach it, none changed here
    • not reached: formatPendingNote
  • – Build Scripts — no function, method or class changed here
25 test suites also reference this code

25 symbols, kept out of the diagram and the table so they cannot crowd out the areas a reviewer has to look at.

  • test/ask-fusion.test.ts
  • test/ask.test.ts
  • test/brain-context-files-pull.test.ts
  • test/brain-trail-watch.test.ts
  • test/claude-format.test.ts
  • test/claude-hooks.test.ts
  • test/claude-state.test.ts
  • test/claude-statusline.test.ts
  • test/claude-tally.test.ts
  • test/cli-meta.test.ts
  • test/graph-enrich-pending.test.ts
  • test/graph-follow-submodules.test.ts
  • test/graph-load.test.ts
  • test/graph-refresh.test.ts
  • test/graph-seed.test.ts
  • test/mcp-tools.test.ts
  • test/regression-single-repo.test.ts
  • test/savings.test.ts
  • test/session-metrics.test.ts
  • test/telemetry-gate.test.ts
  • …5 more

⚠️ 3 changed files not in the graph (.gitignore, TELEMETRY.md, package.json) — no parser claims the extension, or the index predates the file.

graft blast · origin/main...HEAD · depth 2 · 25 changed files

Open the interactive graph → — click an area to see its dependent symbols at file:line.

github-actions Bot added a commit that referenced this pull request Oct 7, 2026
@anirudhkumar-nanonets

Copy link
Copy Markdown
Collaborator Author

Folded into #558, which now carries this change along with the rest of trail.

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