Skip to content

fix(prompt-hook): record high-tier gate telemetry only when context was actually injected (#1143)#1149

Merged
colbymchenry merged 1 commit into
mainfrom
fix/1143-gate-telemetry
Jul 2, 2026
Merged

fix(prompt-hook): record high-tier gate telemetry only when context was actually injected (#1143)#1149
colbymchenry merged 1 commit into
mainfrom
fix/1143-gate-telemetry

Conversation

@colbymchenry

Copy link
Copy Markdown
Owner

Summary

Fixes #1143. The gate('high-keyword'/'high-token') call sat one level outside the if (!result.isError && text.trim()) injection guard, so a silent codegraph_explore failure (error or empty result) was recorded as a successful HIGH-tier fire. Per docs/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

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

…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant