fix(prompt-hook): record high-tier gate telemetry only when context was actually injected (#1143)#1149
Merged
Merged
Conversation
…as actually injected (#1143) gate('high-keyword'/'high-token') sat outside the injection guard, so an errored or empty codegraph_explore still counted as a HIGH-tier success. The gate telemetry is the measured recall/precision funnel that decides whether the tiered gate design survives — a delivery failure must degrade it toward noop-*, not inflate the high tiers. Failures now record noop-explore-keyword / noop-explore-token. Doc enum updated (including the noop-vocab-empty outcome the #1142 fix adds next). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Summary
Fixes #1143. The
gate('high-keyword'/'high-token')call sat one level outside theif (!result.isError && text.trim())injection guard, so a silentcodegraph_explorefailure (error or empty result) was recorded as a successful HIGH-tier fire. Perdocs/design/telemetry.md, the gate counters are the measured recall/precision funnel — the data that decides whether the #1136 gate design survives — so a delivery failure inflating the high tiers corrupts exactly the signal the telemetry exists to produce.What changed
noop-explore-keyword/noop-explore-token, preserving the keyword-vs-token trigger split (an explore failing on keyword-gated prompts points at explore; on token-verified prompts it may point at verification looseness).docs/design/telemetry.md's outcome enum updated. It also pre-documentsnoop-vocab-empty, which the prompt-hook opens CodeGraph without sync, so the MEDIUM (segment-vocab) gate tier stays permanently empty on any repo indexed before v1.2.0 #1142 fix (next PR) introduces — one coherent edit to the enum paragraph instead of two conflicting ones.Testing
Build clean; hook + telemetry suites green. The gate call is inside the commander action and its outcomes are try/catch-wrapped fire-and-forget counters, so this is pinned by review rather than a spawned-CLI telemetry harness.
🤖 Generated with Claude Code