feat(chat): report the partial turn when the authoring gate refuses a chat extraction (#3514) #3518
All Vouch review confidence checks passed
Residual risk 0.35 = Change Risk (0.66) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.66 · 389 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.357
Shallow Review Depth
shallow_review_depth
0.344
Sensitive Paths
sensitive_paths
0.066
Real PR Conversation Timeline
1 comments
"Review active on #3518"
general
weight: 0.35
claude[bot]
Refs #3514 (the server symptom; leaves hadron-portal#916 open, the portal slice follows). Gate: CHECKED 6660454838 (T2), contract folded by Patrick.
Carrier (the PR names it, per the acceptance)
Typed error
extensions, with the existing code, not nullable fields onChatResponseResult. The call still fails exactly as before (AUTHORING_ATTESTATION_MISSING/AUTHOR_TASK_BROKENkeep code androle), so no client that treats an error as a failed turn changes behavior, and no success shape moves. A refused extraction now adds:Fixed component names and the existing refusal code only: no id, task, revision or count, nothing the caller could not already read.
What changed
src/lib/chatPartialTurn.ts: the report andreportPartialTurn, which labels onlyAuthoringAttestationError; any other error (lock timeout, database fault) passes through as the same object.resolvers.mutation.chat.ts: the extraction transaction ends.catch(reportPartialTurn). Nothing else moves: the assistant append and the target write stay separate transactions, the gate is untouched.typeDefs.ts: the mutation's description says it is NOT atomic, names the report, and says repeating the call may append another assistant message. No retry-safety claim.Tests (red first)
resolvers.chatPartialTurn3514.test.ts, 9 pins. At the fix head, before the change, cases 2 and 3 and the disclosure, label and SDL pins fail for the missing report (re-verified there, not assumed from 410d5212); cases 1, 4 and 5 and the non-refusal error pass on main and stay green. Chip's matrix: case 2 (missing claim) and case 3 (not-runnable required task) each assert code, the full report, one more assistant row, counter +1, stage unchanged, target data and revisions untouched; cases 1, 4, 5 assert the success shape (exact key set) with no report.Mutants (each turns red): persisted/notRun swapped (3 pins), wrong refused component (3), wrong refused code (3), counter dropped from persisted (3), label every GraphQLError not only the attestation refusal (1), remove the
.catch(3).Also green: 8 neighbouring chat/attestation/MCP files (216 tests), tsc, SDL/enum/hash-doc/loc-scope/cross-parent guards.
Freeze condition (not met yet)
Condition 6: Vera confirms
cor:cht:020:01step 2 andcor:acl:010:03fit or rule n/a, and says whether step 2 needs a Proposed sentence on partial outcomes. I will not freeze until that is on the record.Limits
No stack run (QA seat does the wire matrix). The report covers the typed attestation refusal only; a non-typed fault after the append is the generic internal error as before.
Review plan T2: cross-family (non-Claude) LOCAL and BLIND, §10 scoped to "gate semantics unweakened, no disclosure leak in the partial report", QA on the wire matrix on a disposable stack; UX waived.
🤖 Generated with Claude Code