feat(commands): intent-classification router for unrecognized @gittensory mentions - #5036
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
gittensory-ui | 6729034 | Commit Preview URL Branch Preview URL |
Jul 11 2026, 10:20 AM |
…sory mentions Adds a closed-set intent classifier that maps a free-text natural-language question to the single closest existing Q&A command (never an action command), so a contributor who doesn't know the exact verb still gets routed to the right existing, already-tested answer instead of just a did-you-mean hint. The classifier's raw output is filtered through a hard runtime allowlist before ever being trusted, never a prompt instruction alone. Ollama-only via a new advisoryAiRouting.intentRouting flag (default false, global + per-repo override, same shape as chatQa). Rate-limited through its own dedicated counter, reusing the existing AI-cost-bearing ceiling. Closes #4596
maybeThrottleIntentRouting's body past the initial policy-off check was never exercised by any test -- the 3 existing #4596 integration tests all ran under the default (off) policy. Add hold-policy under/over-ceiling and same-deliveryId redelivery cases, fix a stale AdvisoryAiRoutingConfig test literal missing chatQaFrontierFallback, and regenerate openapi.json.
f808fdf to
6729034
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5036 +/- ##
=======================================
Coverage 94.36% 94.37%
=======================================
Files 459 460 +1
Lines 39285 39366 +81
Branches 14329 14360 +31
=======================================
+ Hits 37072 37152 +80
Misses 1558 1558
- Partials 655 656 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Caution 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥 🛑 Gittensory review result - fixes requiredReview updated: 2026-07-11 10:29:47 UTC
🛑 Suggested Action - Manual Review
Review summary Nits — 2 non-blocking
CI checks failing
Review context
Contributor next steps
Signal definitions
Visual preview
Click any thumbnail to open the full-size screenshot. Before = production · After = this PR's preview deploy. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
…ranch (#5056) #5036's codecov/patch flagged one partial branch in processors.ts: matchedCommand === "ask" || matchedCommand === "chat" ? command.unrecognizedText : undefined. The 3 existing #4596 integration tests only ever reroute to "blockers", so the true side (rerouting to ask/chat specifically) was never exercised -- meaning the one behavior that actually matters here (does the contributor's original free text survive the reroute into the command's own question field, instead of silently dropping it) was untested.
…5060) * test(commands): cover the intent-router ask/chat question-threading branch #5036's codecov/patch flagged one partial branch in processors.ts: matchedCommand === "ask" || matchedCommand === "chat" ? command.unrecognizedText : undefined. The 3 existing #4596 integration tests only ever reroute to "blockers", so the true side (rerouting to ask/chat specifically) was never exercised -- meaning the one behavior that actually matters here (does the contributor's original free text survive the reroute into the command's own question field, instead of silently dropping it) was untested. * fix(selfhost): widen GitHub-native id columns to bigint on Postgres Every migrations/*.sql column storing a raw GitHub-native numeric id (installation, account/user, check-run, comment) is declared bare INTEGER -- fine on SQLite/D1 (a type-affinity hint that already stores any 64-bit value), but a real 4-byte column on the self-host Postgres backend. GitHub's comment ids are already past 2^31, confirmed live on edge-nl-01 via a "value out of range for type integer" insert failure on github_agent_command_answers. widenGithubIdColumnsToBigint mirrors the existing tuneGithubRateLimitObservationsAutovacuum pattern: a Postgres-only, idempotent ALTER batch run unconditionally after migrations on every boot, never touching the original (SQLite/D1-correct) migration files. Closes #5059
Summary
Closes #4596
Adds a closed-set intent-classification router: an
@gittensorymention whose verb doesn't resolve to a known command, but has real trailing text (e.g. "why is this stuck?"), gets ONE chance to be classified against the existing Q&A command catalog before falling back to the plain did-you-mean hint.preflight,blockers,duplicate-check,next-action,reviewability,repo-fit,packet,ask,chat) or reports no match — it never synthesizes new content, so there's no hallucination surface, only mis-routing.isIntentRoutableCommandis a plainSetmembership check the classifier's raw output must pass before ever being trusted — a prompt-injection attempt naming an action command (review,gate-override, etc.) is filtered to "no match" regardless of what the model says. Exhaustively tested against every action command, every non-routable Q&A command, and arbitrary/non-string values.@gittensory X" note so a wrong match is immediately correctable.advisoryAiRouting.intentRoutingcapability flag (defaultfalse), Ollama-only same aschatQa, global + per-repo override.Part of #4594 (the epic's last remaining sub-issue).
Test plan
unrecognizedTextcapture (verb+trailing reconstruction, no-verb-token case, bare mention)processors.tsactually reaches the classifier and the rewritten command flows through the real pipelinenpm run typecheck,npm run test:coverage(unsharded, 100% on every changed line/branch),npm run test:ci,npm audit --audit-level=moderateall greennpm run ui:openapiregenerated and committednpx tsx scripts/check-engine-parity.tspasses