Repository navigation
fix(claude): inject a pre-rename INDEX.md preamble in the running name - #771
minjunkim-dev wants to merge 2 commits into
Conversation
A graft/INDEX.md built before the rename stays on disk until the next full build, since query-path refreshes skip writeIndex. Session start pasted it verbatim, so under trail it taught graft ask and graft_* tools that a trail-only machine does not have. Run the preamble through inBrand at injection, the same transform writeIndex uses; concept and file lists keep the repo's own words, and graft output is unchanged. Fixes trailhq#770 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🌱 graft blast radius1 area changed → 1 area can be affected. 2 dependent symbols, depth 2. flowchart TB
A0(("Orientation Management<br/>2 symbols"))
classDef reached fill:#D9EDF3,stroke:#3AA7C9,stroke-width:1.5px,color:#0E313C;
class A0 reached;
Who knows this code — 2 people across 2 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 2 dependent symbols, grouped by areaOrientation Management — 2 symbols in 1 file
Test signal per changed area — 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.
3 test suites also reference this code3 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 the code that changed, and the line that reaches it. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
Fixes #770.
A
graft/INDEX.mdbuilt before the rename stays on disk until the next full build, because query-path refreshes run withgraphOnlyand skipwriteIndex. Session start pasted the file in as it is. So under trail, the agent gotgraft ask,graft callersandgraft_find_code, right below a directive that correctly saystrail ask, and none of the graft names exist on a trail-only machine.Changes
src/claude/format.ts:formatOrientationnow runs INDEX.md's preamble (everything before the first##section) throughinBrand()before injecting it. This is the same transformwriteIndexalready applies to that preamble.inBrandreturns its input, so graft's output stays byte for byte the same.test/claude-orientation-brand.test.ts: a new file, so the brand env var it sets stays in its own process.The file on disk is not touched. The next full
trail buildrewrites it, as before. #371 tracks the broader problem of cards going stale between full builds.Testing
node dist/cli.js build .withTRAIL_INVOKED_ASunset). That wrote# graft — repo mapwithgraft askandgraft_find_code.main('session-start')fromsrc/claude/hooks.tswithTRAIL_INVOKED_AS=trail, a temporaryHOME, and a SessionStart payload on stdin.repo map (graft/INDEX.md):block containedgraft askandgraft_find_code, right under thereach for trail firstdirective.trail askandtrail_find_code, with no graft names.graft/INDEX.mdon disk was left as it was.mainand passes on this branch.test/claude-format.test.tsandtest/claude-copy-dashes.test.ts(31 of 31).tsc -p tsconfig.json --noEmitis clean.npm teston macOS (Node 26.13.0): 28 failures on this branch and 29 onmainat e02b754, with the same tests failing on both. They are in init/skills/hooks tests and look environmental here. The only test that failed on this branch alone wastest/hooks-fifo.test.ts, under full-suite load. It passed 3 of 3 runs on its own.TRAIL_INVOKED_ASunset. If a shell has it set totrail, as a Claude Code session started by trail does, the existing graft-spelled assertions inclaude-format.test.tsfail, onmaintoo.🤖 Generated with Claude Code