Skip to content

fix(deep): don't abort a 96% meaning pass the same way as a quota error (#235) - #254

Merged
shhdwi merged 1 commit into
trailhq:mainfrom
Frankie-Xu:fix/235-deep-partial-or-diagnostics
Aug 31, 2026
Merged

shhdwi merged 1 commit into
trailhq:mainfrom
Frankie-Xu:fix/235-deep-partial-or-diagnostics

Conversation

@Frankie-Xu

Copy link
Copy Markdown
Contributor

Summary

  • After fix(deep): retry pending nodes — don't cache empty meaning summaries (#172) #177, empty/unusable crux replies correctly fail the file instead of being cached as ready. Combined with LlmFailureGate's consecutive-failure cutoff, that turned a ~96% meaning pass (the same files 0.10.1 used to defer as pending) into a hard abort: remaining files were skipped, resume died on the same set, and graft build --deep exited like a quota error.
  • A — diagnostics: per-file errors now include a miss class (empty-toolCalls / unparseable / truncated / empty-parsed) and the provider finish_reason, so truncation vs empty vs parse-miss is one line.
  • B — gate: content-quality misses still count as failedFiles (exit 1 unless --allow-partial) and are not written as successful cache. They no longer increment the consecutive-failure cutoff, so the rest of the pass is attempted. Quota/auth still stop immediately (deep build swallows per-file LLM failures (incl. 429) and exits successfully #127).
  • Not rolled back: fix(deep): retry pending nodes — don't cache empty meaning summaries (#172) #177 remains — an empty crux is not a cache hit.
  • Not in this PR: per-file max_tokens scaling / symbol chunking (issue request 1). Maintainer diagnosis confirmed truncation on dense files, but this window has no Together key and no raw finish_reason=length dump from the reporter's files, so a token policy would be a guess. The new miss class will make that follow-up obvious when it happens.

Test plan

Closes #235

Made with Cursor

…or (trailhq#235)

Empty/unusable crux replies stay failed and uncached (trailhq#177), but consecutive
content-quality misses no longer trip LlmFailureGate. Quota/auth still stop
immediately. Per-file errors now include miss class and finish_reason.

Co-authored-by: Cursor <[email protected]>
@trailhq-graft

trailhq-graft Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

🌱 graft blast radius

2 areas changed → 4 areas can be affected. 7 dependent symbols, depth 2.
Tests: 2 areas updated their tests.
Tag: @anirudhkumar-nanonets — 6 of 6 areas · @shhdwi — 3 of 6 areas · @qoole — Context Building

flowchart TB
  A0(("Engine Initialization<br/>3 symbols"))
  A1(("Graph Building<br/>2 symbols"))
  A2(("Context Building<br/>1 symbol"))
  A3(("Pull Request Review<br/>1 symbol"))
  classDef reached fill:#D9EDF3,stroke:#3AA7C9,stroke-width:1.5px,color:#0E313C;
  class A0,A1,A2,A3 reached;
Loading
Can be affected Symbols Nearest hop Reached from
Engine Initialization 3 src/engine.ts:L143-L145 cruxSummarizer — references, depth 1 Crux Summarization, Graph Enrichment
Graph Building 2 src/graph/build.ts:L151-L410 buildGraph — calls, depth 1 Crux Summarization, Graph Enrichment
Context Building 1 src/context/build.ts:L111-L342 buildContext — calls, depth 1 Crux Summarization
Pull Request Review 1 src/app/review.ts:L45-L84 reviewPullRequest — calls, depth 2 Graph Enrichment
Who knows this code — 3 people across 6 areas
Area Who knows it
Crux Summarization · changed @anirudhkumar-nanonets — 4 commits, last 8d ago · @shhdwi — 1 commit, last 10d ago
Graph Enrichment · changed @anirudhkumar-nanonets — 4 commits, last 8d ago
Engine Initialization · affected @anirudhkumar-nanonets — 16 commits, last 1mo ago · @shhdwi — 3 commits, last 16d ago
Graph Building · affected @anirudhkumar-nanonets — 18 commits, last 8d ago · @shhdwi — 5 commits, last 16d ago
Context Building · affected @anirudhkumar-nanonets — 4 commits, last 8d ago · @qoole — 2 commits, last 27d ago
Pull Request Review · affected @anirudhkumar-nanonets — 1 commit, last 3d 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 7 dependent symbols, grouped by area

Engine Initialization — 3 symbols in 1 file

  • src/engine.ts:L143-L145 — cruxSummarizer (references, depth 1)
    143: private cruxSummarizer(): CruxSummarizer {
  • src/engine.ts:L88-L98 — graph (calls, depth 2)
  • src/engine.ts:L61-L70 — init (calls, depth 2)

Graph Building — 2 symbols in 2 files

  • src/graph/build.ts:L151-L410 — buildGraph (calls, depth 1)
    280: // Persist the memo BEFORE enrichment, because `enrichGraph` mutates these very
  • src/graph/refresh.ts:L150-L227 — ensureFreshGraph (calls, depth 2)

Context Building — 1 symbol in 1 file

  • src/context/build.ts:L111-L342 — buildContext (calls, depth 1)
    191: gate.record(message);

Pull Request Review — 1 symbol in 1 file

  • src/app/review.ts:L45-L84 — reviewPullRequest (calls, depth 2)
Test signal per changed area — 2 ✓

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.

  • ✓ Crux Summarization — 2 of 6 reached · 1 test file changed here: test/graph-enrich-quality.test.ts
    • not reached: classifyCruxMiss, formatCruxMiss, isTruncatedStop, describeFile
  • ✓ Graph Enrichment — 1 of 3 reached · 1 test file changed here: test/graph-enrich-quality.test.ts
    • not reached: cruxMissMessage, collectFileCrux
36 test suites also reference this code

43 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/container-extract.test.ts
  • test/context-checkpoint.test.ts
  • test/context.test.ts
  • test/covers.test.ts
  • test/generic-extract.test.ts
  • test/graph-enrich-checkpoint.test.ts
  • test/graph-enrich-failures.test.ts
  • test/graph-enrich-pending.test.ts
  • test/graph-go.test.ts
  • test/graph-incremental.test.ts
  • test/graph-invariants.test.ts
  • test/graph-java.test.ts
  • test/graph-languages.test.ts
  • test/graph-php.test.ts
  • test/graph-posix-paths.test.ts
  • test/graph-python.test.ts
  • test/graph-r-classes.test.ts
  • test/graph-r-phase3.test.ts
  • …16 more

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

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

@shhdwi

shhdwi commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

This is exactly the right fix for #235 — thank you for taking it on, and for the careful separation of concerns. Verified locally on top of current main (clean merge; npm run build + tsc --noEmit clean):

  • Content-quality misses no longer abort the build. Base main: 12 empty-crux files → fatal="5 files in a row failed…", 7 skipped, whole pass aborts. This PR: same 12 → fatal=undefined, all attempted, 0 skipped, nodes stay pending (uncached, so a retry is free). A ~96% pass now publishes instead of hard-failing.
  • Quota/auth stays terminal. A consecutive 401 still trips fatal on the first file — terminalReason() fires even under the {quality:true} flag. That's the important half: the breaker still stops a spent key immediately.
  • Nice touch classifying the miss (empty-toolCalls/unparseable/truncated/empty-parsed) + surfacing finish_reason, which directly answers the reporter's truncation question.

New graph-enrich-quality.test.ts (7 cases) + the existing enrich/failure/deep suites: 28/0. Fixes #235. Merging — this unblocks deep builds on DeepSeek/Together/o-series for everyone. 🙌

@shhdwi
shhdwi merged commit 415a2de into trailhq:main Aug 31, 2026
8 checks passed
github-actions Bot added a commit that referenced this pull request Aug 31, 2026
FrancescoMerenda pushed a commit to FrancescoMerenda/Graft that referenced this pull request Sep 7, 2026
…or (trailhq#235) (trailhq#254)

Empty/unusable crux replies stay failed and uncached (trailhq#177), but consecutive
content-quality misses no longer trip LlmFailureGate. Quota/auth still stop
immediately. Per-file errors now include miss class and finish_reason.

Co-authored-by: Cursor <[email protected]>
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.

0.13.0: deep pass hard-fails (circuit breaker) on files where 0.10.1 published — DeepSeek-V4/Together crux returns "no usable symbol summaries"

2 participants