Skip to content

fix(cli): warn when Git cannot confirm the build cache is ignored - #815

Open
yungSNAT wants to merge 1 commit into
trailhq:mainfrom
yungSNAT:ryan/report-actual-cache-ignore
Open

yungSNAT wants to merge 1 commit into
trailhq:mainfrom
yungSNAT:ryan/report-actual-cache-ignore

Conversation

@yungSNAT

Copy link
Copy Markdown

Summary

graft build now warns when Git cannot confirm that the build cache is ignored. The build still succeeds if writing .gitignore fails.

Closes #772.

Evidence

The regression makes .gitignore unwritable by creating a directory at that path. On main, the build exits 0 and prints 'is git-ignored'. With the fix, it exits 0 and warns on stderr. The test then removes the directory, rebuilds and confirms the ignore rule with git check-ignore.

Focused build and context tests and the TypeScript check passed on Windows.

Risk

The build footer now uses the same Git ignore check as the cache writer, so a missing Git binary or a failed check also produces the warning.

Unverified

Full suite and non-Windows runs.

@trailhq-graft

trailhq-graft Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

🌱 graft blast radius

2 areas changed → 3 areas can be affected. 6 dependent symbols, depth 2.
Tests: Gitignore Management has tests the diff did not touch.
Tag: @anirudhkumar-nanonets — 5 of 5 areas · @shhdwi — CLI, Workspace Build Graph · @Frankie-Xu — Gitignore Management

flowchart TB
  A0(("Workspace Build Graph<br/>4 symbols"))
  A1(("Graph Engine<br/>1 symbol"))
  A2(("Pull Request Review<br/>1 symbol"))
  classDef reached fill:#D9EDF3,stroke:#3AA7C9,stroke-width:1.5px,color:#0E313C;
  class A0,A1,A2 reached;
Loading
Can be affected Symbols Nearest hop Reached from
Workspace Build Graph 4 src/graph/build.ts:L217-L492 buildGraph — calls, depth 1 Gitignore Management
Graph Engine 1 src/engine.ts:L104-L115 graph — calls, depth 2 Gitignore Management
Pull Request Review 1 src/app/review.ts:L45-L99 reviewPullRequest — calls, depth 2 Gitignore Management
Who knows this code — 3 people across 5 areas
Area Who knows it
Gitignore Management · changed @anirudhkumar-nanonets — 11 commits, last 26d ago · @Frankie-Xu — 4 commits, last yesterday
CLI · changed @anirudhkumar-nanonets — 71 commits, last 2d ago · @shhdwi — 51 commits, last 14d ago
Workspace Build Graph · affected @anirudhkumar-nanonets — 22 commits, last 8d ago · @shhdwi — 10 commits, last 14d ago
Graph Engine · affected @anirudhkumar-nanonets — 17 commits, last 28d ago
Pull Request Review · affected @anirudhkumar-nanonets — 3 commits, last 2mo ago

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 6 dependent symbols, grouped by area

Workspace Build Graph — 4 symbols in 4 files

  • src/graph/build.ts:L217-L492 — buildGraph (calls, depth 1)
    449: // (`ensureGitignored` writes `.gitignore`, which a read has no business doing),
  • src/graph/workspace-cli.ts:L59-L142 — runWorkspaceBuild (calls, depth 1)
    121: ensureGitignored(root, contextDirFor(root, opts.override));
  • src/graph/refresh-run.ts:L18-L21 — main (calls, depth 2)
  • src/graph/refresh.ts:L202-L225 — rebuild (calls, depth 2)

Graph Engine — 1 symbol in 1 file

  • src/engine.ts:L104-L115 — graph (calls, depth 2)

Pull Request Review — 1 symbol in 1 file

  • src/app/review.ts:L45-L99 — reviewPullRequest (calls, depth 2)
Test signal per changed area — 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.

  • ⚠ Gitignore Management — 1 of 2 reached · 2 test files reach it, none changed here
    • not reached: gitIgnoresDirectory
  • – CLI — no function, method or class changed here
49 test suites also reference this code

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

  • test/ask-index.test.ts
  • test/ask.test.ts
  • test/claude-hooks.test.ts
  • test/claude-prompt-private.test.ts
  • test/container-extract.test.ts
  • test/context-only-dir.test.ts
  • test/context.test.ts
  • test/covers.test.ts
  • test/depth-parity.ts
  • test/generic-extract.test.ts
  • test/graph-bash.test.ts
  • test/graph-elixir.test.ts
  • test/graph-extensions.test.ts
  • test/graph-go.test.ts
  • test/graph-incremental.test.ts
  • test/graph-invariants.test.ts
  • test/graph-java.test.ts
  • test/graph-jsx.test.ts
  • test/graph-kotlin.test.ts
  • test/graph-languages.test.ts
  • …29 more

graft blast · origin/main...HEAD · depth 2 · 3 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 Nov 10, 2026

This branch has not been deployed

No deployments
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.

graft build reports graft/ as git-ignored even when the .gitignore write failed, so an exit-0 build leaves the cache committable

1 participant