fix(agent-tasks): #4212's deferred P3s: App-match launchAfterTeamResume, filter once, harden and extend the #4202 pins (#4315) #4350
All Vouch review confidence checks passed
Residual risk 0.25 = Change Risk (0.42) × (1 − Review Confidence (0.42)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.42 · 332 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: 79% · 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.347
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #4350"
general
weight: 0.35
claude[bot]
Closes #4315 (its in-scope items 3, 6, 7 and 8; items 1, 2 and 5 were already fixed on main and item 4 is split out to #4344). Follow-up to #4202 / #4212.
What and why
#4212 made every event-by-task read in the wake, stall and matcher paths match the event's App to the task's App, because
agent_team_events.task_idhas no foreign key and a legacy or hand-made row can name a task of another App (no write path makes one). This PR is the four items the gate cleared (T1, plus a narrow §10 on item 3).| Item | Change |
|---|---|
| 3.
hostOperations/launch.ts,launchAfterTeamResume| the latest-assignment subquery gainse.app_id = t.app_id. A foreignassignment.matchedrow naming a hand-assigned task is no longer "the latest assignment", so the lift no longer takes its family. || 6.
agentTasks/stall.ts,loadStallInputs| the finish-by alarm history is App-filtered once per pass (ownFinishByAlarms), not again for every task with a finish-by time. No behavior change. || 7.
eventTaskAppMatch4202.test.ts, the external-idfeedhelper | it reports whether its xmin visibility condition was reached and throws a descriptive error when it was not, inside the tests' own 30 s timeout (it used to wait 200 x 50 ms, longer than the 5 s default, then continue silently). A pin covers the miss with an injected never-true condition. || 8. same file | four pins: a foreign and a same-App
assignment.queued(the queue timestamp and the unassignable episode start), a foreign and a same-App finish-by alarm in the history (the finish-by episode start). |Pins and mutants
3577d96dcon main (launchAfterResumeEventApp4315.test.ts: expected the start as codex, got none); the same-App control is green by design.own(...)onqueuedfails the foreignassignment.queuedpin; dropping it on the finish-by history fails the foreign finish-by pin. Same-App controls stay green.Existing tests changed
None.
eventTaskAppMatch4202.test.tsgains tests and a hardened helper; no assertion removed.Out of scope
Items 1, 2, 5 are fixed on main; item 4 is #4344 (a schema change that needs a ruling first). No migration, SDL or MCP change.
Checks run locally
tsc --noEmit,check-loc-scope,check-urn-rename-aliased. Hosted CI runs the full suite.Specs
cor:agt:050:01,:11,:21(App-matched reads): compliance, no law change.🤖 Generated with Claude Code