feat(build): ground "I'll wire that"/"it's in the queue" in real Gitea issues (#774, Gap 2) - #787
Merged
Conversation
…a issues (#774, Gap 2) Real incident: a paid, git-provisioned founder said "The stripe integration" (a topic phrase, not an imperative edit -- detectEditIntent correctly stayed conservative and never fired). Cody still replied "I'll have this wired in the next run" -- gateInstructions unconditionally scripted that phrasing for every change/feature message, with zero task or issue ever actually created. fetchBacklogSummary's own "backlog" was purely synthetic (derived from selectPrimitives), with no connection to lib/git/gitea-client.ts at all, so Cody had no real system of record to cite either. Fixed with two combined detection layers feeding one real action: 1. A cheap, deterministic heuristic (no LLM call) auto-qualifies any short (<=6 word), non-question message that reached here without matching detectEditIntent's imperative-verb pattern -- the exact "The stripe integration" shape from the real incident. 2. A secondary, single-purpose classifier call (completeText, bounded to 6s, fails closed to "no") handles longer/ambiguous phrasing the heuristic doesn't resolve. Either path files a REAL Gitea issue in the company's own repo (new listIssues + the already-proven createIssue) before the system prompt is built. gateInstructions' "I'll wire that"/"it's in the queue" framing is now conditioned on real work (an edit dispatch OR a filed issue) having actually happened THIS turn -- never said as scripted filler otherwise. fetchBacklogSummary also now surfaces the company's real open/recently- closed Gitea issues alongside the synthetic primitive-derived list, so "it's queued"/"already built" claims are grounded in the same system of record the nightly loop and the SMS-to-issue path (#744) already use.
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
Closes Gap 2 of #774.
Real incident: a paid, git-provisioned founder said "The stripe integration" (a topic phrase, not an imperative edit —
detectEditIntentcorrectly stayed conservative and never fired). Cody still replied "I'll have this wired in the next run" —gateInstructionsunconditionally scripted that phrasing for every change/feature message, with zero task or issue ever actually created.fetchBacklogSummary's own "backlog" was purely synthetic (derived fromselectPrimitives), with no connection tolib/git/gitea-client.tsat all — Cody had no real system of record to cite either.Fixed with two combined detection layers feeding one real action:
detectEditIntent's imperative-verb pattern — the exact "The stripe integration" shape from the real incident.completeText, bounded to 6s, fails closed to "no"): handles longer/ambiguous phrasing the heuristic doesn't resolve.Either path files a real Gitea issue in the company's own repo (new
listIssues+ the already-provencreateIssue) before the system prompt is built.gateInstructions' "I'll wire that"/"it's in the queue" framing is now conditioned on real work (an edit dispatch OR a filed issue) having actually happened this turn — never said as scripted filler otherwise.fetchBacklogSummaryalso now surfaces the company's real open/recently-closed Gitea issues alongside the synthetic primitive-derived list, so "it's queued"/"already built" claims are grounded in the same system of record the nightly loop and the SMS-to-issue path (#744) already use.Test plan
npx tsc --noEmit— cleannpx vitest run— full suite: 396 files, 5615 tests passed, 0 failuresgitea-client-listissues-774.test.ts(9 tests): success/failure/thrown-error paths, state/limit params, unconfigured degradationask-real-work-grounding-774.test.ts(13 tests): heuristic path files an issue with no classifier call, plain questions never file, classifier path both ways, timeout/failure degrades safely, no double-filing when an edit was already dispatched, free-tier/unprovisioned never file, system-prompt framing conditioned correctly both ways, real Gitea issues surfaced in the backlog block, graceful degradation when Gitea is unreachableask/edit-intenttest suites (71 tests)