Ghost stack 10 — explain why each gather candidate matched#199
Draft
nahiyankhan wants to merge 1 commit into
Draft
Ghost stack 10 — explain why each gather candidate matched#199nahiyankhan wants to merge 1 commit into
nahiyankhan wants to merge 1 commit into
Conversation
searchGraph carried a bare reason tier and score; a multi-word route
could not say which of the agent's words actually landed. Add an optional
coverage { covered, total } to SearchHit and surface a plain-language
reason in the gather candidate list ("matched 2/2 words in description",
"likely typo of the name"), so the request to node route is auditable
rather than an opaque ranking — the same self-explaining stance route.ts
already takes for check cascade.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #198
Base: `ghost/09-exit-code-contract` (#198). Builds on the search/grounding work in #197, which introduced `searchGraph`, candidate ranking, and `ERR_UNKNOWN_SURFACE`.
What & why
`searchGraph` ranked candidates with a bare `reason` tier + score. For a multi-word query that loses the real story — which of the agent's words actually landed, and where. The request→node route was the one router in Ghost that ranked silently, while `check/route.ts` already explains check cascade via `CheckRelevance`.
This closes that asymmetry, in a deliberately small shape:
Ranking and behavior are unchanged — this is purely additive, self-explaining output, the same stance `route.ts` already takes.
Tests
Three new `searchGraph` cases: whole-query carries no coverage, full coverage, partial coverage. Full suite green (118 passing), `pnpm check` clean.
Changeset
`minor` — new optional public field + auditable output.