fix(refocus): show held and pending work as labelled context when nothing is in progress #3821
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 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.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #3821"
general
weight: 0.35
mvschwarz
What changed
A seat that compacts or refocuses while its work is parked on another row, or still pending, lost its mission context:
FALLBACK — no current typed baton … Showing the project-level chain from the work root;No in-progress queue row names your work.Neither showed the mission the seat's held or pending rows belong to.
Now, when nothing is in progress, held and pending rows come back as labelled context: never as current work, and nothing resumes them.
The daemon (
current-work.ts,routes/queue.ts):mission:/slice:tags, resolved through the sameresolveMissionsRoot+resolveTaggedas an in-progress tag candidate. A slice pairs with its mission only when the row has exactly one of each, as before.rig queue whoami --json --held-work(routeheld=1) carries these rows asheldAndPendingWork, using the same bounded reads as--work-candidates: blocked and pending only, 50 each, with per-list truncation flags. Likecandidates=1, it's only on request, so a plainwhoamianswer is unchanged.The hook (
refocus.cjs): it asks for held work on its one lookup (--held-work) only where its trace can use it (work packet off, no explicit start, not a topology-only trace), and passesheldAndPendingWorkto the trace (--held-work -). There's no second lookup. An older CLI that rejects the flag is asked again plainly. A current work node, an explicit start or a topology-only trace never passes it.The trace (
trace-to-root.py):CONTEXT FROM HELD AND PENDING WORK … It is context, not your current work: using it does not resume a task.--work-startline. Today's broad orientation stays below it. The reasons: different missions, a row with no mission or an unresolved one, a cut list, or an older daemon that sends no folders.[mission: … / slice: …], withUNRESOLVED ON THIS HOSTwhen their tags didn't resolve.Unchanged: queue state, custody, wakes, priority, the daemon's
currentWork/currentWorkBasis, explicit work selection and the resolved in-progress path. Completed work never appears. Recently closed work isn't added here.Tests
refocus-work-packet.test.ts,refocus-context-ref.test.tsandqueue-routes.test.ts:- held-only, pending-only, conflicting missions, none, same mission with different slices (stops at the mission), same names in different project roots (no shared chain);
- a held row with a mission tag and no slice (reaches the mission);
- four partial cases (a cut held list, a cut list from an older daemon, an unresolved mission, a row with no mission);
- an empty summary, a catalogued project outside the workspace, the packet path;
- the hook with the packet off (Claude and Codex) and the older-CLI fallback;
- the route's plain answer;
- an end-to-end parked seat through the real hook and trace.
refocus-roleand the other refocus-hook files pass; CLIqueue.test.ts188/188.scripts/pr-scenarios.test.mjs: 24/24.mirror-skills --checkpasses;skill-edge-digests.generated.jsonwas regenerated withnpm run mirror-skills.tsc --noEmitis clean for the daemon and the CLI.Scenario pins updated:
refocus-parked-baton-packet-offused to require the FALLBACK for a parked seat. It now requires the labelled context and the held row, and forbidsFALLBACKandWORK FROM QUEUE EVIDENCE. The verifier intest-system/ci/result.mjsandpr-scenarios.test.mjsmatch it.trace-to-root.pyis a sensitive file.🤖 Generated with Claude Code
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
New Features
When no work is in progress, refocusing can display held and pending queue items as labelled context. Items that resolve to a shared mission or slice can guide the trace; otherwise, it presents mission choices and read commands.
Queue context includes mission and slice details, brief summaries, and indicators when lists are truncated. Unresolved or fallback-resolved scopes are identified.
Added the
--held-workoption torig queue whoamito request held and pending work details. Completed items are excluded, and default responses remain unchanged.Documentation
Updated refocusing guidance to explain how held and pending work appears in traces, including scope resolution and fallback behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->