paseo-follow-up 2.7.0-beta.1 → 2.7.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@ import { NEW_NAME } from "../shared/new-name";
3
3
  import { Platform, View, type FlatList as NativeFlatList } from "react-native";
4
4
  import { Pressable, Text } from "./text";
5
5
  import { Icon, FlatList } from "@getpaseo/plugin/client/ui";
6
- import { type Badge, type HomeGroupId, type HomeModel, type Workstream, blocksOn, hiddenChips, lineBasis, lineFloor, lineFloorCss, markFloorCss, titleMaxCss, lineWidth, rowReserve, titleFloor, prChipSpoken, railChips, railKeeps, runningMark } from "../shared/home";
6
+ import { type Badge, type HomeGroupId, type HomeModel, type Workstream, blocksOn, hiddenChips, lineBasis, LINE_SHOWS, lineFloor, lineFloorCss, markFloorCss, titleMaxCss, lineWidth, rowReserve, titleFloor, prChipSpoken, prLabelText, railChips, railKeeps, runningMark } from "../shared/home";
7
7
  import { ASK_KEY, excerpt, FIELD_LABEL, type OmniboxItem, type Range, type RowHit, type SearchHit, sameHit } from "../shared/search";
8
8
  import { AskRow, PriorityLine } from "./home-chrome";
9
9
  import { age, wakeLabel, wakeShort } from "../shared/inbox";
@@ -347,7 +347,7 @@ export function PrChipView({ s, c }: { s: Workstream; c: Colors }) {
347
347
  const checks = s.pr.checks;
348
348
  return <View testID="follow-up-row-chip" role="img" aria-label={prChipSpoken(s.pr)} style={{ flexShrink: 0, flexDirection: "row", alignItems: "center", gap: 4, paddingHorizontal: 6, height: 20, borderRadius: 4, borderWidth: 1, borderColor: c.border }}>
349
349
  <Icon name="GitPullRequest" size={11} color={toneColor(c, s.pr.tone)} />
350
- <Text numberOfLines={1} style={{ flexShrink: 0, color: c.foreground, fontSize: 11, lineHeight: 14, fontVariant: ["tabular-nums"] }}>{s.pr.label}</Text>
350
+ <Text numberOfLines={1} style={{ flexShrink: 0, color: c.foreground, fontSize: 11, lineHeight: 14, fontVariant: ["tabular-nums"] }}>{prLabelText(s.pr.label)}</Text>
351
351
  {checks && <Text numberOfLines={1} style={{ flexShrink: 1, minWidth: 0, color: checks.tone === "muted" ? c.foregroundMuted : badgeColor({ text: "", tone: checks.tone }, c), fontSize: 11, lineHeight: 14 }}>{checks.text}</Text>}
352
352
  </View>;
353
353
  }
@@ -356,7 +356,7 @@ export function PrChipView({ s, c }: { s: Workstream; c: Colors }) {
356
356
  export function PrSummaryText({ s, c, lead = "" }: { s: Workstream; c: Colors; lead?: string }) {
357
357
  if (!s.pr) return null;
358
358
  const checks = s.pr.checks;
359
- return <Text>{lead}<Text style={{ color: c.foreground }}>{s.pr.label.replace(/\+(\d)/, " +$1")}</Text>
359
+ return <Text>{lead}<Text style={{ color: c.foreground }}>{prLabelText(s.pr.label)}</Text>
360
360
  {checks && <Text style={{ color: checks.tone === "muted" ? c.foregroundMuted : badgeColor({ text: "", tone: checks.tone }, c) }}>{` ${checks.text}`}</Text>}</Text>;
361
361
  }
362
362
 
@@ -563,9 +563,15 @@ const Row = memo(function Row({ s: raw, theme, dense, touch, selected, onSelect,
563
563
  from the line, which shrinks first, down to LINE_FLOOR; below that the first chip drops into "+N" too. With
564
564
  room the line grows, never past its own text: the rest goes to the rail (flexGrow 1), so a chip never drops
565
565
  beside blank line; spare room goes to the line first (flexGrow 1000). */}
566
- <Text numberOfLines={1} style={{ flexGrow: 1000, flexShrink: 100000, flexBasis: lineBasis(lineText(s, hit)), maxWidth: lineWidth(lineText(s, hit)), minWidth: Platform.OS === "web" ? lineFloorCss(lineText(s, hit), rowReserve({ title: titleText, word: !via && s.group === "needs" ? s.word : null, mark: via ? null : runningMark(s), rail: railChips(rail).length > 0, sendNow: !!sendNow })) as unknown as number : lineFloor(lineText(s, hit)), color: c.foregroundMuted, fontSize: 12, marginLeft: !via && s.word && s.group === "needs" ? -10 : 0 }}>
567
- {via ?? <>{s.word && s.group === "needs" && s.line ? "\u00a0· " : ""}{line}</>}
568
- </Text>
566
+ {/* Squeezed below LINE_SHOWS, the line shows nothing rather than a lone "·" or "· …": its words sit after a
567
+ zero-width spacer in a one-line-high wrapping box, so they wrap onto the hidden second line instead. */}
568
+ <View testID="follow-up-row-line" style={{ flexGrow: 1000, flexShrink: 100000, flexBasis: lineBasis(lineText(s, hit)), maxWidth: lineWidth(lineText(s, hit)), minWidth: Platform.OS === "web" ? lineFloorCss(lineText(s, hit), rowReserve({ title: titleText, word: !via && s.group === "needs" ? s.word : null, mark: via ? null : runningMark(s), rail: railChips(rail).length > 0, sendNow: !!sendNow })) as unknown as number : lineFloor(lineText(s, hit)), marginLeft: !via && s.word && s.group === "needs" ? -10 : 0,
569
+ flexDirection: "row", flexWrap: "wrap", alignContent: "flex-start", height: 16, overflow: "hidden" }}>
570
+ <View style={{ width: 0, height: 16 }} />
571
+ <Text numberOfLines={1} style={{ flexGrow: 1, flexShrink: 1, flexBasis: LINE_SHOWS, minWidth: LINE_SHOWS, lineHeight: 16, color: c.foregroundMuted, fontSize: 12 }}>
572
+ {via ?? <>{s.word && s.group === "needs" && s.line ? "\u00a0· " : ""}{line}</>}
573
+ </Text>
574
+ </View>
569
575
  {!via && <RunningMark s={s} c={c} size={12} lineHeight={16} tight reserve={rowReserve({ title: titleText, word: s.group === "needs" ? s.word : null, mark: null, rail: railChips(rail).length > 0, sendNow: !!sendNow })} />}
570
576
  <ChipRail s={rail} c={c} dim={older} />
571
577
  {sendNow}
@@ -591,11 +597,13 @@ function RunningMark({ s, c, size, lineHeight, tight = false, reserve = 0 }: { s
591
597
  // Wide rows: the mark stays whole while the row has its `reserve`; in a list too narrow for the word, the mark and
592
598
  // "+N" (320 px) its words give way, down to its spinner ("· ◌"; the row's label still says "N running"), so nothing
593
599
  // runs onto the time (invariant 34). Off the web the mark never shrinks.
600
+ // Its words show whole or not at all ("· ◌ 1." read as a typo): they wrap onto a hidden second line, never cut.
594
601
  const web = tight && Platform.OS === "web";
595
- return <View style={{ flexShrink: web ? 1 : 0, minWidth: web ? markFloorCss(text, size, reserve) as unknown as number : undefined, flexDirection: "row", alignItems: "center", gap: 4, height: lineHeight, marginLeft: tight ? -6 : 0 }}>
602
+ return <View style={{ flexShrink: web ? 1 : 0, minWidth: web ? markFloorCss(text, size, reserve) as unknown as number : undefined, flexDirection: "row", alignItems: "center", gap: 4, height: lineHeight, marginLeft: tight ? -6 : 0,
603
+ ...(web ? { flexWrap: "wrap" as const, alignContent: "flex-start" as const, overflow: "hidden" as const } : {}) }}>
596
604
  <Text style={{ flexShrink: 0, color: c.foregroundMuted, fontSize: size, lineHeight }}>{"\u00a0·"}</Text>
597
605
  <Spinner color={runningColor(c)} size={size - 1} label="Working" />
598
- <Text numberOfLines={1} style={{ flexShrink: 1, minWidth: 0, color: c.foregroundMuted, fontSize: size, lineHeight, fontVariant: ["tabular-nums"] }}>{text}</Text>
606
+ <Text testID="follow-up-row-running-text" numberOfLines={1} style={{ flexShrink: web ? 0 : 1, minWidth: 0, color: c.foregroundMuted, fontSize: size, lineHeight, fontVariant: ["tabular-nums"] }}>{text}</Text>
599
607
  </View>;
600
608
  }
601
609
 
@@ -611,7 +619,7 @@ function MetaLine({ s, d, c, touch, dim }: { s: Workstream; d: RowDetail; c: Col
611
619
  if (d.project) parts.push(<View key="p" style={{ flexDirection: "row", alignItems: "center", gap: 3, flexShrink: 1, minWidth: 0 }}><Icon name="Folder" size={glyph} color={c.foregroundMuted} /><Text numberOfLines={1} style={{ flexShrink: 1, color: c.foregroundMuted, fontSize: size }}>{d.project}</Text></View>);
612
620
  if (d.pr && s.pr) parts.push(<View key="r" style={{ flexDirection: "row", alignItems: "center", gap: 3, flexShrink: 0 }}>
613
621
  <Icon name="GitPullRequest" size={glyph} color={toneColor(c, s.pr.tone)} />
614
- <Text numberOfLines={1} style={{ color: c.foregroundMuted, fontSize: size, fontVariant: ["tabular-nums"] }}>{s.pr.label}</Text>
622
+ <Text numberOfLines={1} style={{ color: c.foregroundMuted, fontSize: size, fontVariant: ["tabular-nums"] }}>{prLabelText(s.pr.label)}</Text>
615
623
  {checks && <Text numberOfLines={1} style={{ color: checks.tone === "muted" ? c.foregroundMuted : badgeColor({ text: "", tone: checks.tone }, c), fontSize: size }}>{checks.text}</Text>}
616
624
  </View>);
617
625
  for (const l of d.labels) parts.push(<View key={`l:${l}`} style={{ flexDirection: "row", alignItems: "center", gap: 4, flexShrink: 1, minWidth: 0 }}><View style={{ width: 6, height: 6, borderRadius: 3, backgroundColor: c.foregroundMuted }} /><Text numberOfLines={1} style={{ flexShrink: 1, color: c.foregroundMuted, fontSize: size }}>{l}</Text></View>);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "paseo-follow-up",
3
3
  "private": false,
4
- "version": "2.7.0-beta.1",
4
+ "version": "2.7.0-beta.3",
5
5
  "description": "Every agent, one inbox. Follow-up brings what all your coding agents need from you into one ranked list, and follows their work through merge, deploy and after.",
6
6
  "type": "module",
7
7
  "files": [
package/server/engine.ts CHANGED
@@ -23,7 +23,7 @@ import { recordSnapshot } from "./deployment-anchor";
23
23
  import { askRefusal } from "../shared/reopen";
24
24
  import { pruneUnsent } from "./batch-archive";
25
25
  import { holdSuperseded, liftHold } from "../shared/status";
26
- import { agentAnswered, autoSentLastHour, autoTurnsPerHour, DEFAULT_MAX_AUTO_SENDS, runningAutoTurns, changedNotGone, conditionId, holdsQueue, inProgressHolds, IN_PROGRESS_MAX_MS, isCapped, MAIN_WAIT, movedOnReason, personHeld, personPart, QUIET_WAIT, readSince, repairWait, sendDecision, settleUnacknowledged, stillApplies, stuckRepair, UNACKNOWLEDGED_MS, type MainWait } from "../shared/send-decision";
26
+ import { agentAnswered, autoSentLastHour, autoTurnsPerHour, DEFAULT_MAX_AUTO_SENDS, runningAutoTurns, changedNotGone, conditionId, holdsQueue, inProgressHolds, IN_PROGRESS_MAX_MS, isCapped, MAIN_WAIT, movedOnReason, personHeld, personPart, QUIET_WAIT, readSince, repairWait, sendDecision, settleGoneParts, settleUnacknowledged, stillApplies, stuckRepair, UNACKNOWLEDGED_MS, type MainWait } from "../shared/send-decision";
27
27
  import { isRepair } from "../shared/task-rows";
28
28
  import { outsideQuestions, parseOutsideId, type OutsideRun } from "../shared/outside-run";
29
29
  import { dismissItem, undoDismissItem } from "./dismiss";
@@ -163,7 +163,7 @@ export class Engine {
163
163
  }
164
164
  // A batch left blocked or unconfirmed by a release before a-batch-item-leaves-once-nothing-applies, whose PRs
165
165
  // have since merged or changed, settles at start-up, dormant workspaces included (no tick observes those).
166
- if (w.enable_tracking && !w.archived) settleMoot(w, eligible, this.now());
166
+ if (w.enable_tracking && !w.archived) { settleMoot(w, eligible, this.now()); settleGoneParts(w); }
167
167
  const healed = healBatches(w);
168
168
  if (healed.restored || healed.relabelled || healed.duplicates) console.warn(`[follow-up] healed batches in ${w.id}: ${healed.restored} answered restored, ${healed.relabelled} relabelled as updated, ${healed.duplicates} duplicates set aside`);
169
169
  for (const b of w.batches) if (isRecovery(b) && b.state === "pending" && !b.enable_manual_recovery) { b.state = "cancelled"; b.result = "Recovery is now optional. Run recovery when needed; registered work continues independently."; }
@@ -898,6 +898,9 @@ export class Engine {
898
898
  // A stuck batch re-checks what it asked for like a queued one: once nothing still applies, it settles and leaves
899
899
  // Needs you (a-batch-item-leaves-once-nothing-applies).
900
900
  settleMoot(w, tasks, this.now());
901
+ // A person part leaves with its task: once GitHub no longer shows the condition, nothing of it waits on a person
902
+ // (a-person-part-leaves-with-its-task), and it stays gone if the condition comes back as new work.
903
+ settleGoneParts(w);
901
904
  // A human-only outcome isn't a delivery that awaits GitHub: its still-open conditions are held as "person" at once.
902
905
  // An in-progress answer holds its unchanged conditions while the agent's work runs (inProgressHolds), then they go
903
906
  // out again like any unacknowledged condition, toward the same cap.
@@ -1002,20 +1005,25 @@ export class Engine {
1002
1005
  agentWorkspace({ version: 1, workspaces: [w] }, agentId, "read", w.id);
1003
1006
  requireTracking(w, agentId);
1004
1007
  const b = w.batches.find(b => b.id === batchId);
1005
- if (!b || !["sending", "sent", "blocked", "uncertain"].includes(b.state)) throw new Error("Batch is not awaiting acknowledgment.");
1008
+ // Still in progress, the agent may name its person part again or take back one set by mistake (waitingOn ""):
1009
+ // only the part and the words change, never when it settled (a-person-part-leaves-with-its-task).
1010
+ const restated = !!b?.inProgress && b.state === "completed" && outcome === "in_progress" && waitingOn !== undefined && !humanOnly;
1011
+ if (!b || !restated && !["sending", "sent", "blocked", "uncertain"].includes(b.state)) throw new Error("Batch is not awaiting acknowledgment.");
1006
1012
  if ((b.recipientAgentId ?? w.mainAgentId) !== agentId) throw new Error(`Only the assigned agent can acknowledge this batch: expected agent ${b.recipientAgentId ?? w.mainAgentId}, received agent ${agentId}.`);
1007
1013
  if (outcome === "completed" && b.tasks.some(t => t.kind === "obligation" && w.obligations.some(o => o.id === t.target && o.communication && o.status !== "waived" && (o.status !== "done" || !replyRecorded(o.communication))))) throw new Error("Record the sent reply on each communication task before completing this batch, or acknowledge blocked with the posting/access reason.");
1008
1014
  if (humanOnly && (isRecovery(b) || completionCheck(b))) throw new Error("humanOnly is for repair batches. Acknowledge this one blocked with the reason.");
1009
1015
  if (outcome === "in_progress" && (isRecovery(b) || completionCheck(b))) throw new Error("in_progress is for repair batches. Acknowledge this one completed or blocked.");
1016
+ if (restated) { b.result = result; if (waitingOn!.trim()) b.waitingOn = waitingOn!.trim(); else delete b.waitingOn; return w; }
1010
1017
  // in_progress: the agent (or its own subagent) is already on it. Not a failure and not finished: the batch settles
1011
1018
  // completed and its unchanged conditions wait for that work (inProgressHolds), never sent again meanwhile.
1012
1019
  b.state = humanOnly || outcome === "in_progress" ? "completed" : outcome; b.result = result; b.acknowledgmentError = null; b.settledAt = new Date(this.now()).toISOString();
1013
1020
  if (completionCheck(b) && outcome === "completed") b.doneCheckOutcome = "acknowledged";
1014
1021
  if (humanOnly) b.humanOnly = true; else delete b.humanOnly;
1015
1022
  // The person part is this answer's: a later answer without one says nothing waits on a person any more.
1016
- // An in_progress answer that names none carries the last one over: "already on it" isn't "nothing waits on a person".
1017
- // A completed or blocked answer without one, or Hand back to agent, clears it.
1018
- const carried = outcome === "in_progress" && !waitingOn?.trim() ? b.tasks.map(t => personPart({ batches: w.batches.filter(x => x !== b) }, t.key)?.text).find(Boolean) : undefined;
1023
+ // An in_progress answer that leaves waitingOn out carries the last one over: "already on it" isn't "nothing waits on
1024
+ // a person". An explicit empty waitingOn takes a part set by mistake back while staying in progress; a completed or
1025
+ // blocked answer without one, or Hand back to agent, clears it too.
1026
+ const carried = outcome === "in_progress" && waitingOn === undefined ? b.tasks.map(t => personPart({ ...w, batches: w.batches.filter(x => x !== b) }, t.key)?.text).find(Boolean) : undefined;
1019
1027
  const part = waitingOn?.trim() || carried;
1020
1028
  if (part && !isRecovery(b) && !completionCheck(b)) b.waitingOn = part; else delete b.waitingOn;
1021
1029
  if (outcome === "in_progress") b.inProgress = true; else delete b.inProgress;
@@ -417,7 +417,7 @@ export const mcpSource: string = [
417
417
  " [\"register_pr\", \"Register a PR this workspace produced, after submitting it, parents before children; again after restacking to update stack or parent. Mentions and external dependencies aren't yours. A closed PR is settled; disposition says why. agentMerges=true when you merge it yourself with no human review; false hands it back.\", \"follow.register-pr\", { repo: string, number: integer, stack: string, parentNumber: { type: [\"integer\", \"null\"], minimum: 1 }, disposition: string, agentMerges: boolean }, [\"repo\", \"number\", \"stack\"]],",
418
418
  " [\"exclude_stack\", \"Move a stack registered by mistake out of this workspace: its PRs and the tasks in obligationIds go to an audit and can't be registered again. reason: the scope or ownership evidence.\", \"follow.exclude-stack\", { stack: string, reason: string, obligationIds: array }, [\"stack\", \"reason\"]],",
419
419
  " [\"update_obligation\", \"Record a concrete follow-up task: a production check, migration, decision or stakeholder reply. Not approve/merge/deploy checklists. afterPrs: owner/repo#number. A task comes due by itself when its afterPrs reach dependencyStage, or on recheck (no PRs: 3 days after your last update); Follow-up names due tasks at your turn's end. status: waiting on a PR or another agent; blocked only on the developer; working records you (workingAgentId: your subagent). trigger sends the task to you as a message: now, merge or deploy (with delayDays) only for timing the developer asked for; at (at or inMinutes) for a time they named, or to check back on something Follow-up can't see. Never a sleep loop or your own timer (CI: wait_for_checks). communication: a Slack reply the developer authorized.\", \"follow.obligation\", { id: string, workingAgentId: string, title: string, status: { type: \"string\", enum: [\"pending\", \"waiting\", \"working\", \"blocked\", \"done\", \"waived\"] }, afterPrs: array, dependencyStage: { type: \"string\", enum: [\"merged\", \"deployed\"] }, evidence: string, ask: { ...string, description: \"With blocked: a decision you haven't asked yet (asked with ask_question: pass question).\" }, question: { type: \"string\", pattern: \"^Q\\\\d+$\", description: \"With blocked: the Q<n> you asked with ask_question (task set to this task).\" }, need: { type: \"string\", enum: [\"decision\", \"action\"], description: \"With ask: decision (they choose) or action (they do something and report back; the card has Done). Left out: read from the ask.\" }, enable_follow_up: boolean, communication, trigger, recheck: { type: \"string\", description: \"\\\"YYYY-MM-DD\\\": when to look again. Set it when you keep a due task open, with why in evidence.\" }, new: { type: \"boolean\", description: \"Add it even though a similar open task exists.\" } }, [\"title\", \"status\"]],",
420
- " [\"acknowledge_batch\", \"Report a Follow-up batch's result by its batch ID before ending the turn. completed: every task verified. in_progress: you or your subagent are already on it; it isn't resent until that ends or GitHub changes. blocked: the reason; humanOnly=true when only a person can move it (a reviewer must re-review). waitingOn: the part that waits on a person, while you do the rest.\", \"follow.acknowledge\", { batchId: string, outcome: { type: \"string\", enum: [\"completed\", \"blocked\", \"in_progress\"] }, result: { ...string, maxLength: 2000 }, humanOnly: { type: \"boolean\" }, waitingOn: { ...string, maxLength: 500 } }, [\"batchId\", \"outcome\", \"result\"]],",
420
+ " [\"acknowledge_batch\", \"Report a Follow-up batch's result by its batch ID before ending the turn. completed: every task verified. in_progress: you or your subagent are already on it; it isn't resent until that ends or GitHub changes. blocked: the reason; humanOnly=true when only a person can move it (a reviewer must re-review). waitingOn: the part only a person (never an agent or a report) can move, while you do the rest; \\\"\\\" clears it.\", \"follow.acknowledge\", { batchId: string, outcome: { type: \"string\", enum: [\"completed\", \"blocked\", \"in_progress\"] }, result: { ...string, maxLength: 2000 }, humanOnly: { type: \"boolean\" }, waitingOn: { ...string, maxLength: 500 } }, [\"batchId\", \"outcome\", \"result\"]],",
421
421
  " [\"ask_question\", \"Ask the developer a decision you can't make yourself: a short title, the question, lettered options with what each means for them, and the one you recommend. big: only when building ahead would send something off this machine, change something others rely on, or most remaining work builds on it. Link a PR (owner/repo#number) or task; a task waiting on it then goes blocked with update_obligation question=\\\"Q<n>\\\". Asking again returns the open one; supersedes=\\\"Q<n>\\\" replaces it. Every card ends with Something else; don't add an \\\"Other\\\" option. URLs and owner/repo#123 are clickable. The reply says what to do until the answer arrives.\", \"follow.ask-question\", { title: { ...string, maxLength: 120 }, question: { ...string, maxLength: 2000 }, options: { type: \"array\", maxItems: 26, items: { type: \"object\", properties: { letter: { type: \"string\", pattern: \"^[A-Z]$\" }, label: { ...string, maxLength: 200 }, consequence: { ...string, maxLength: 600 } }, required: [\"letter\", \"label\"], additionalProperties: false } }, recommend: string, big: string, background: string, links: { type: \"array\", maxItems: 10, items: { type: \"object\", properties: { url: string, path: string, card: string, label: string }, additionalProperties: false } }, pr: string, task: string, supersedes: { type: \"string\", pattern: \"^Q\\\\d+$\" } }, [\"title\", \"question\"]],",
422
422
  " [\"record_answer\", \"Record the developer's answer to an open question when they answered in chat. choice: the option letter, their short answer when there were no options, or \\\"other\\\" with their words in words.\", \"follow.record-answer\", { id: string, choice: string, words: string }, [\"id\", \"choice\"]],",
423
423
  " [\"note_question\", \"When the developer asks something to answer rather than do (an opinion, a how or why), call this first with their words: it goes on their Your questions. Once per message. Not for commands, status pings or a message with a ctx- id. The reply says how to hand in the answer.\", \"follow.note-question\", { question: { ...string, minLength: 1, maxLength: 2000 } }, [\"question\"]],",
package/server/mcp.mjs CHANGED
@@ -33,7 +33,7 @@ const tools = [
33
33
  ["register_pr", "Register a PR this workspace produced, after submitting it, parents before children; again after restacking to update stack or parent. Mentions and external dependencies aren't yours. A closed PR is settled; disposition says why. agentMerges=true when you merge it yourself with no human review; false hands it back.", "follow.register-pr", { repo: string, number: integer, stack: string, parentNumber: { type: ["integer", "null"], minimum: 1 }, disposition: string, agentMerges: boolean }, ["repo", "number", "stack"]],
34
34
  ["exclude_stack", "Move a stack registered by mistake out of this workspace: its PRs and the tasks in obligationIds go to an audit and can't be registered again. reason: the scope or ownership evidence.", "follow.exclude-stack", { stack: string, reason: string, obligationIds: array }, ["stack", "reason"]],
35
35
  ["update_obligation", "Record a concrete follow-up task: a production check, migration, decision or stakeholder reply. Not approve/merge/deploy checklists. afterPrs: owner/repo#number. A task comes due by itself when its afterPrs reach dependencyStage, or on recheck (no PRs: 3 days after your last update); Follow-up names due tasks at your turn's end. status: waiting on a PR or another agent; blocked only on the developer; working records you (workingAgentId: your subagent). trigger sends the task to you as a message: now, merge or deploy (with delayDays) only for timing the developer asked for; at (at or inMinutes) for a time they named, or to check back on something Follow-up can't see. Never a sleep loop or your own timer (CI: wait_for_checks). communication: a Slack reply the developer authorized.", "follow.obligation", { id: string, workingAgentId: string, title: string, status: { type: "string", enum: ["pending", "waiting", "working", "blocked", "done", "waived"] }, afterPrs: array, dependencyStage: { type: "string", enum: ["merged", "deployed"] }, evidence: string, ask: { ...string, description: "With blocked: a decision you haven't asked yet (asked with ask_question: pass question)." }, question: { type: "string", pattern: "^Q\\d+$", description: "With blocked: the Q<n> you asked with ask_question (task set to this task)." }, need: { type: "string", enum: ["decision", "action"], description: "With ask: decision (they choose) or action (they do something and report back; the card has Done). Left out: read from the ask." }, enable_follow_up: boolean, communication, trigger, recheck: { type: "string", description: "\"YYYY-MM-DD\": when to look again. Set it when you keep a due task open, with why in evidence." }, new: { type: "boolean", description: "Add it even though a similar open task exists." } }, ["title", "status"]],
36
- ["acknowledge_batch", "Report a Follow-up batch's result by its batch ID before ending the turn. completed: every task verified. in_progress: you or your subagent are already on it; it isn't resent until that ends or GitHub changes. blocked: the reason; humanOnly=true when only a person can move it (a reviewer must re-review). waitingOn: the part that waits on a person, while you do the rest.", "follow.acknowledge", { batchId: string, outcome: { type: "string", enum: ["completed", "blocked", "in_progress"] }, result: { ...string, maxLength: 2000 }, humanOnly: { type: "boolean" }, waitingOn: { ...string, maxLength: 500 } }, ["batchId", "outcome", "result"]],
36
+ ["acknowledge_batch", "Report a Follow-up batch's result by its batch ID before ending the turn. completed: every task verified. in_progress: you or your subagent are already on it; it isn't resent until that ends or GitHub changes. blocked: the reason; humanOnly=true when only a person can move it (a reviewer must re-review). waitingOn: the part only a person (never an agent or a report) can move, while you do the rest; \"\" clears it.", "follow.acknowledge", { batchId: string, outcome: { type: "string", enum: ["completed", "blocked", "in_progress"] }, result: { ...string, maxLength: 2000 }, humanOnly: { type: "boolean" }, waitingOn: { ...string, maxLength: 500 } }, ["batchId", "outcome", "result"]],
37
37
  ["ask_question", "Ask the developer a decision you can't make yourself: a short title, the question, lettered options with what each means for them, and the one you recommend. big: only when building ahead would send something off this machine, change something others rely on, or most remaining work builds on it. Link a PR (owner/repo#number) or task; a task waiting on it then goes blocked with update_obligation question=\"Q<n>\". Asking again returns the open one; supersedes=\"Q<n>\" replaces it. Every card ends with Something else; don't add an \"Other\" option. URLs and owner/repo#123 are clickable. The reply says what to do until the answer arrives.", "follow.ask-question", { title: { ...string, maxLength: 120 }, question: { ...string, maxLength: 2000 }, options: { type: "array", maxItems: 26, items: { type: "object", properties: { letter: { type: "string", pattern: "^[A-Z]$" }, label: { ...string, maxLength: 200 }, consequence: { ...string, maxLength: 600 } }, required: ["letter", "label"], additionalProperties: false } }, recommend: string, big: string, background: string, links: { type: "array", maxItems: 10, items: { type: "object", properties: { url: string, path: string, card: string, label: string }, additionalProperties: false } }, pr: string, task: string, supersedes: { type: "string", pattern: "^Q\\d+$" } }, ["title", "question"]],
38
38
  ["record_answer", "Record the developer's answer to an open question when they answered in chat. choice: the option letter, their short answer when there were no options, or \"other\" with their words in words.", "follow.record-answer", { id: string, choice: string, words: string }, ["id", "choice"]],
39
39
  ["note_question", "When the developer asks something to answer rather than do (an opinion, a how or why), call this first with their words: it goes on their Your questions. Once per message. Not for commands, status pings or a message with a ctx- id. The reply says how to hand in the answer.", "follow.note-question", { question: { ...string, minLength: 1, maxLength: 2000 } }, ["question"]],
package/server/tasks.ts CHANGED
@@ -9,7 +9,7 @@ import { join } from "node:path";
9
9
  import { communicationReady } from "../shared/communication";
10
10
  import { taskSchedule } from "../shared/task-trigger";
11
11
  import { isWorkspaceRoot, type WorkspaceAgent } from "./workspace-agent";
12
- import { personPart, taskUpdate } from "../shared/send-decision";
12
+ import { addedChecks, mergedParent, personPart, repairable, reviewAsks, taskUpdate } from "../shared/send-decision";
13
13
  import { FIX_ONLY_LINE, type ReviewComments } from "../shared/pr-workflow";
14
14
 
15
15
  function fingerprint(value: unknown): string { return createHash("sha256").update(JSON.stringify(value)).digest("hex"); }
@@ -24,12 +24,13 @@ export function tasksFor(w: Workspace, now = Date.now(), wording: TaskWording =
24
24
  const tasks: Task[] = [];
25
25
  const add = (kind: Task["kind"], target: string, title: string, value: unknown, parts?: string[]) => tasks.push({ key: `${kind}:${target}`, kind, target, title, fingerprint: fingerprint(value), ...(parts ? { parts } : {}) });
26
26
  for (const pr of w.prs) {
27
- const s = pr.snapshot;
28
- if (!s?.complete || pr.error || s.state !== "OPEN" || s.draft) continue;
27
+ // The same conditions taskGone (shared/send-decision.ts) reads: a task is yielded exactly while it isn't gone.
28
+ if (!repairable(pr)) continue;
29
+ const s = pr.snapshot!;
29
30
  if (s.conflict) add("conflict", pr.key, `Resolve merge conflicts on ${pr.repo}#${pr.number}`, [s.head, s.base, "conflict"]);
30
31
  // Review comments Off: no review-comment repair at all; the threads stay on the PR row for people.
31
32
  const comments = wording.reviewComments?.(pr.repo) ?? "reply";
32
- if (comments !== "off" && (s.threads.length || s.reviewDecision === "CHANGES_REQUESTED")) {
33
+ if (comments !== "off" && reviewAsks(s)) {
33
34
  // a-person-part-is-a-person-item: the agent's count leaves out the part it said waits on a person (the PR row keeps all).
34
35
  const n = s.threads.length - (s.threads.length > 1 && personPart(w, `review:${pr.key}`) ? 1 : 0);
35
36
  const reason = s.threads.length ? `${n} open thread${n === 1 ? "" : "s"}` : "changes requested";
@@ -42,11 +43,11 @@ export function tasksFor(w: Workspace, now = Date.now(), wording: TaskWording =
42
43
  }
43
44
  // Add to repairs (invariant 222, an-added-check-is-repaired): an optional check the developer added joins the PR's
44
45
  // checks repair while it fails. Without one the repair's title and fingerprint are what they always were.
45
- const added = (s.otherFailedChecks ?? []).filter(c => pr.repairChecks?.includes(c));
46
+ const added = addedChecks(pr);
46
47
  if (s.failedChecks.length && !added.length) add("checks", pr.key, `Fix required checks on ${pr.repo}#${pr.number}: ${s.failedChecks.join(", ")}`, [s.head, s.failedChecks.slice().sort()]);
47
48
  else if (added.length) add("checks", pr.key, `Fix ${s.failedChecks.length ? "checks" : "optional checks"} on ${pr.repo}#${pr.number}: ${[...s.failedChecks, ...added].join(", ")}${s.failedChecks.length ? ` (${added.join(", ")} optional, added by the developer)` : " (added by the developer)"}`, [s.head, s.failedChecks.slice().sort(), added.slice().sort()]);
48
- const parent = w.prs.find(p => p.key === pr.parent);
49
- if (parent?.snapshot?.state === "MERGED") add("restack", pr.key, wording.github?.(pr.repo) || s.prWorkflow === "github" ? `Restack ${pr.repo}#${pr.number} onto ${s.trunk} after ${parent.repo}#${parent.number} merged: rebase, push with --force-with-lease, and retarget with gh pr edit --base ${s.trunk} if GitHub didn't` : `Reconcile stack parent after ${parent.repo}#${parent.number} merged`, [parent.key, parent.snapshot.head]);
49
+ const parent = mergedParent(w, pr);
50
+ if (parent?.snapshot) add("restack", pr.key, wording.github?.(pr.repo) || s.prWorkflow === "github" ? `Restack ${pr.repo}#${pr.number} onto ${s.trunk} after ${parent.repo}#${parent.number} merged: rebase, push with --force-with-lease, and retarget with gh pr edit --base ${s.trunk} if GitHub didn't` : `Reconcile stack parent after ${parent.repo}#${parent.number} merged`, [parent.key, parent.snapshot.head]);
50
51
  }
51
52
  for (const o of followUpObligations(w)) {
52
53
  if (!o.enable_follow_up || !["pending", "waiting"].includes(o.status) || !communicationReady(o.communication)) continue;
package/shared/home.ts CHANGED
@@ -207,6 +207,9 @@ function chipRank(s: Pr["snapshot"]): number {
207
207
  if (!s?.complete) return 2;
208
208
  return s.threads?.length ? 1 : s.checksPending ? 3 : s.draft ? 4 : 5;
209
209
  }
210
+ /** A PR summary as a row draws it: "#2143 +5", the count apart from the number (the label keeps "#2143+5"). */
211
+ export const prLabelText = (label: string): string => label.replace(/\+(\d)/, " +$1");
212
+
210
213
  /**
211
214
  * The PR chip (`a-pr-summary-says-the-worst`): the workspace's PRs in one chip, so it says the worst of its open PRs,
212
215
  * never the first one's. It names the first open PR in stack order with the worst state ("#1058+125"), else the first
@@ -262,6 +265,11 @@ export function railKeeps(s: Pick<Workstream, "badges" | "pr">): number {
262
265
  */
263
266
  export const LINE_FLOOR = 160;
264
267
  export const lineFloor = (text: string): number => Math.min(LINE_FLOOR, Math.ceil(text.length * CHAR_PX));
268
+ /**
269
+ * Below this a squeezed line shows nothing, not a lone separator or "· …": its words wrap onto a hidden second line.
270
+ * About "· " and three characters with the ellipsis at 12 px.
271
+ */
272
+ export const LINE_SHOWS = 40;
265
273
  /** A wide row's title keeps this much (or its own width) when the list is too narrow for everything else. */
266
274
  export const TITLE_KEEPS = 80;
267
275
  export const titleFloor = (title: string): number => Math.min(TITLE_KEEPS, Math.ceil(title.length * 7));
package/shared/inbox.ts CHANGED
@@ -698,9 +698,13 @@ export function nextAfter(rows: InboxRow[], currentAgentId: string | null, now:
698
698
  return sectionRows(rows, "needs", now).find(r => r.agentId !== currentAgentId && flagFate(r, now, !!r.workspaceId && archived.has(r.workspaceId)) === "show") ?? null;
699
699
  }
700
700
 
701
- /** Title for a row: "Workspace › Agent" only when the workspace has more than one root agent. */
701
+ /**
702
+ * Title for a row: "Workspace › Agent" only when the workspace has more than one root agent, and only when the agent's
703
+ * name says something the workspace's doesn't ("Retry failed card payments › Retry failed card payments" said it twice).
704
+ */
702
705
  export function rowTitle(row: Pick<InboxRow, "title" | "workspaceTitle" | "multiRoot">): { primary: string; agent: string | null } {
703
- if (row.multiRoot && row.workspaceTitle) return { primary: row.workspaceTitle, agent: row.title };
706
+ const same = (a: string, b: string) => a.trim().toLowerCase() === b.trim().toLowerCase();
707
+ if (row.multiRoot && row.workspaceTitle) return { primary: row.workspaceTitle, agent: same(row.title, row.workspaceTitle) ? null : row.title };
704
708
  return { primary: row.workspaceTitle || row.title, agent: null };
705
709
  }
706
710
 
package/shared/model.ts CHANGED
@@ -184,6 +184,12 @@ export const batchSchema = z.object({
184
184
  * tells the agent to leave that part (a-person-part-is-a-person-item).
185
185
  */
186
186
  waitingOn: z.string().max(500).optional(),
187
+ /**
188
+ * Keys of this batch's tasks whose condition went away after the answer named `waitingOn` (the conflict resolved, the
189
+ * PR merged): the part no longer waits on a person for them, even if the condition comes back as new work
190
+ * (a-person-part-leaves-with-its-task, settleGoneParts in shared/send-decision.ts).
191
+ */
192
+ partGone: z.array(z.string().max(500)).optional(),
187
193
  /**
188
194
  * The agent acknowledged it in_progress: it (or its own subagent) is already working on it. Settled completed, not a
189
195
  * failure; its unchanged conditions are not sent again while that work runs (inProgressHolds, shared/send-decision.ts),
@@ -82,13 +82,18 @@ export function rowChips(i: Input): RowChips | null {
82
82
  */
83
83
  export type FitOpts = { charPx: number; chrome: number; recChrome: number; gap: number; maxLabel: number; floorChars: number; readPx: number; readMorePx: number; /** Lines the chips may wrap onto when every option then fits whole (2 on every surface). */ lines?: number };
84
84
  type Pick = Extract<RowChip, { kind: "pick" }>;
85
+ /**
86
+ * A label's width at the average glyph (charPx), plus what wide glyphs ("%", "@", "M", "W", about 0.9 em) add: the
87
+ * average alone suits long labels, but a short one with a "%" ran past it ("4%" drew as "4..").
88
+ */
89
+ export const labelPx = (label: string, charPx: number): number => (label.length + 0.6 * (label.match(/[%@MW]/g)?.length ?? 0)) * charPx;
85
90
  /** Each chip with its max width; brk marks the first chip of a wrapped second line. */
86
91
  export function fitChips(chips: readonly RowChip[], width: number, o: FitOpts): { chip: RowChip; max: number | null; brk?: boolean }[] {
87
92
  const picks = chips.filter((c): c is Pick => c.kind === "pick");
88
93
  const hasRead = chips.some(c => c.kind === "read");
89
94
  if (!picks.length) return chips.map(chip => ({ chip, max: null }));
90
95
  const chromeOf = (p: Pick) => p.recommended ? o.recChrome : o.chrome;
91
- const natural = (p: Pick) => chromeOf(p) + Math.min(o.maxLabel, p.label.length * o.charPx);
96
+ const natural = (p: Pick) => chromeOf(p) + Math.min(o.maxLabel, labelPx(p.label, o.charPx));
92
97
  const floor = (p: Pick) => Math.min(natural(p), chromeOf(p) + o.floorChars * o.charPx);
93
98
  const rec = picks.find(p => p.recommended) ?? null;
94
99
  const rest = picks.filter(p => p !== rec);
@@ -97,7 +102,7 @@ export function fitChips(chips: readonly RowChip[], width: number, o: FitOpts):
97
102
  // whole, so a phone or sidebar row with two short options offers both instead of the recommended one alone.
98
103
  if ((o.lines ?? 1) > 1) {
99
104
  // Whole labels here, past the one-line cap: wrapping is only worth a second line when nothing on it is cut.
100
- const whole = (p: Pick) => chromeOf(p) + p.label.length * o.charPx;
105
+ const whole = (p: Pick) => chromeOf(p) + labelPx(p.label, o.charPx);
101
106
  if (picks.every(p => whole(p) <= width)) {
102
107
  const items = [...picks.map(p => ({ chip: p as RowChip, w: whole(p) })), ...(hasRead ? [{ chip: { kind: "read", hidden: 0 } as RowChip, w: o.readPx }] : [])];
103
108
  const brk: boolean[] = []; let lines = 1, x = 0;
@@ -132,7 +137,7 @@ export function fitChips(chips: readonly RowChip[], width: number, o: FitOpts):
132
137
  for (const p of [...(rec && shown.includes(rec) ? [rec] : []), ...shown.filter(p => p !== rec)]) {
133
138
  const add = Math.max(0, Math.min(natural(p) - max.get(p)!, spare)); max.set(p, max.get(p)! + add); spare -= add;
134
139
  }
135
- const out: { chip: RowChip; max: number | null }[] = shown.map(p => ({ chip: p, max: Math.floor(max.get(p)!) }));
140
+ const out: { chip: RowChip; max: number | null }[] = shown.map(p => ({ chip: p, max: Math.ceil(max.get(p)!) }));
136
141
  if (hasRead) out.push({ chip: { kind: "read", hidden: picks.length - shown.length }, max: null });
137
142
  return out;
138
143
  }
@@ -1,5 +1,6 @@
1
1
  import { completionCheck, type Task, type Batch as StoredBatch } from "./model";
2
- import type { ListBatch as Batch, ListWorkspace as Workspace } from "./list";
2
+ import type { ListBatch as Batch, ListPr, ListWorkspace as Workspace } from "./list";
3
+ import { finishedTask } from "./finished";
3
4
  import { recoveryBatch } from "./follow-up";
4
5
 
5
6
  /** How long a new batch waits before it goes out on its own, so tasks that land together go in one message. */
@@ -233,17 +234,35 @@ export const personHeld = (w: Pick<Workspace, "batches">, t: Pick<Task, "key" |
233
234
  /**
234
235
  * a-person-part-is-a-person-item: what the agent's latest answer for this task said only a person can move
235
236
  * (Batch.waitingOn), else null. Keyed by the task, not its fingerprint, so a review that keeps changing keeps it; a
236
- * later answer without one drops it.
237
+ * later answer without one drops it. a-person-part-leaves-with-its-task: once the task itself is gone (taskGone, or
238
+ * seen gone since the answer: Batch.partGone) nothing of it waits on a person, so a returning condition never brings
239
+ * the old part back. Without `prs` (a batch list alone) only the record decides.
237
240
  */
238
- export function personPart(w: Pick<Workspace, "batches">, taskKey: string): { batchId: string; text: string } | null {
241
+ export function personPart(w: Pick<Workspace, "batches"> & Partial<Pick<Workspace, "prs" | "obligations">>, taskKey: string): { batchId: string; text: string } | null {
239
242
  for (let i = w.batches.length - 1; i >= 0; i--) {
240
243
  const b = w.batches[i]!;
241
- if (!b.sentAt || !b.settledAt || !["completed", "blocked"].includes(b.state) || b.unacknowledged || !b.tasks.some(t => t.key === taskKey)) continue;
242
- return b.waitingOn ? { batchId: b.id, text: b.waitingOn } : null;
244
+ const t = b.tasks.find(t => t.key === taskKey);
245
+ if (!b.sentAt || !b.settledAt || !["completed", "blocked"].includes(b.state) || b.unacknowledged || !t) continue;
246
+ if (!b.waitingOn || b.partGone?.includes(taskKey) || w.prs && taskGone({ prs: w.prs, obligations: w.obligations ?? [] }, t)) return null;
247
+ return { batchId: b.id, text: b.waitingOn };
243
248
  }
244
249
  return null;
245
250
  }
246
251
 
252
+ /**
253
+ * Records, on each answer whose person part still stands, the tasks whose condition is gone now (taskGone), so the part
254
+ * stays gone if the condition comes back later as new work (a-person-part-leaves-with-its-task). Run with settleMoot.
255
+ */
256
+ export function settleGoneParts(w: Pick<Workspace, "batches" | "prs" | "obligations">): void {
257
+ const keys = new Set(w.batches.flatMap(b => b.waitingOn ? b.tasks.map(t => t.key) : []));
258
+ for (const key of keys) {
259
+ const before = personPart({ batches: w.batches }, key);
260
+ if (!before || personPart(w, key)) continue;
261
+ const b = w.batches.find(b => b.id === before.batchId)!;
262
+ b.partGone = [...(b.partGone ?? []), key];
263
+ }
264
+ }
265
+
247
266
  /** Blocked or unconfirmed: a repair batch whose outcome the developer is shown (Needs you's "The repairs didn't finish"). */
248
267
  export const stuckRepair = (b: Pick<Batch, "state" | "tasks" | "movedOn">) =>
249
268
  ["blocked", "uncertain"].includes(b.state) && !b.movedOn && !recoveryBatch(b) && !(b.tasks.length > 0 && b.tasks.every(t => t.kind === "completion"));
@@ -260,6 +279,36 @@ function conditionKnown(w: Pick<Workspace, "prs">, t: Pick<Task, "kind" | "targe
260
279
  return !pr || !!pr.snapshot?.complete && !pr.error;
261
280
  }
262
281
 
282
+ /** A PR Follow-up repairs: GitHub answered in full and it is open and not a draft (server/tasks.ts tasksFor). */
283
+ export const repairable = (pr: Pick<ListPr, "snapshot" | "error">) => !!pr.snapshot?.complete && !pr.error && pr.snapshot.state === "OPEN" && !pr.snapshot.draft;
284
+ /** The review asks for something: open threads, or changes requested. */
285
+ export const reviewAsks = (s: Pick<NonNullable<ListPr["snapshot"]>, "threads" | "reviewDecision">) => !!s.threads?.length || s.reviewDecision === "CHANGES_REQUESTED";
286
+ /** Failing optional checks the developer added to repairs (Add to repairs, invariant 222). */
287
+ export const addedChecks = (pr: Pick<ListPr, "snapshot" | "repairChecks">) => (pr.snapshot?.otherFailedChecks ?? []).filter(c => pr.repairChecks?.includes(c));
288
+ /** The PR's stack parent once it merged (the restack task), else undefined. */
289
+ export const mergedParent = <P extends Pick<ListPr, "key" | "snapshot">>(w: { prs: readonly P[] }, pr: Pick<ListPr, "parent">): P | undefined => { const p = w.prs.find(p => p.key === pr.parent); return p?.snapshot?.state === "MERGED" ? p : undefined; };
290
+
291
+ /**
292
+ * a-person-part-leaves-with-its-task: the task's condition is known to be gone, by the same conditions tasksFor
293
+ * (server/tasks.ts) yields a task of that key with: the PR merged, closed, a draft or untracked, the conflict resolved,
294
+ * no open thread or requested change, the checks passing, the parent not merged, the task done, waived or removed.
295
+ * While GitHub's answer for its PR is unknown it isn't gone. A setting (Review comments Off) never makes it gone.
296
+ */
297
+ export function taskGone(w: Pick<Workspace, "prs" | "obligations">, t: Pick<Task, "kind" | "target">): boolean {
298
+ if (t.kind === "inventory" || t.kind === "completion" || !conditionKnown(w, t)) return false;
299
+ if (t.kind === "obligation") { const o = w.obligations.find(o => o.id === t.target); return !o || finishedTask(o); }
300
+ const pr = w.prs.find(p => p.key === t.target);
301
+ if (!pr || !repairable(pr)) return true;
302
+ const s = pr.snapshot!;
303
+ switch (t.kind) {
304
+ case "conflict": return !s.conflict;
305
+ case "review": return !reviewAsks(s);
306
+ case "checks": return !s.failedChecks?.length && !addedChecks(pr).length;
307
+ case "restack": return !mergedParent(w, pr);
308
+ default: return false;
309
+ }
310
+ }
311
+
263
312
  /**
264
313
  * Whether a stuck repair batch still asks for anything: some task's condition (key and fingerprint) is still open in
265
314
  * `open` (server/tasks.ts tasksFor, the PRs as they are now), or its PR's state is unknown. Once nothing applies (every
@@ -18,7 +18,7 @@ import { HOME_GROUPS, homeCounts, prChip, trackedGroup, type HomeModel } from ".
18
18
  import { needsEntries } from "./view-r";
19
19
  import { freshPriorities, type Priority } from "./priorities";
20
20
  import { agentCard, automaticHold, batchView, finishLine, holdSuperseded } from "./status";
21
- import { conditionId, isCapped, mainWait, NO_PROGRESS_CAP, personHeld, personPart, sendDecision, stuckRepair } from "./send-decision";
21
+ import { conditionId, isCapped, mainWait, NO_PROGRESS_CAP, personHeld, personPart, sendDecision, stuckRepair, taskGone } from "./send-decision";
22
22
  import { messageStrip, obligationDelivery, repairRows } from "./task-rows";
23
23
  import { followUpObligations } from "./follow-up";
24
24
  import { PRESENCE, claimsWorking, taskStatus, waitedAgent } from "./task-status";
@@ -195,6 +195,18 @@ export const INVARIANTS: Invariant[] = [
195
195
  return null;
196
196
  },
197
197
  },
198
+ {
199
+ id: "a-person-part-leaves-with-its-task",
200
+ why: "2026-12-04 (2.7.0-beta.2): a main agent acknowledged two conflict repairs with waitingOn set. Hours after the conflicts were fixed and both PRs were mergeable, Needs you still showed \"Part of #N waits on a person\" for each: the part only checked that the PR was open. Once its task's condition is gone (whatever tasksFor no longer yields) the part leaves; while GitHub's answer is unknown it stays.",
201
+ check(w, now) {
202
+ for (const i of needsYou(w, now)) {
203
+ if (i.kind !== "person" || !i.part) continue;
204
+ const t = w.batches.flatMap(b => b.tasks).find(t => t.key === i.taskKey);
205
+ if (t && taskGone(w, t)) return `${i.taskKey}: GitHub no longer shows the task, but Needs you still says part of it waits on a person`;
206
+ }
207
+ return null;
208
+ },
209
+ },
198
210
  {
199
211
  id: "a-pr-summary-says-the-worst",
200
212
  why: "2026-11-22: a 126-PR workspace with four PRs failing checks read \"#1001+125 ✓\" on Home (the chip took the first open PR's state) and \"Checks are running\" in the panel header (running outranked failing). A line or chip that sums up a workspace's PRs says the worst of its open PRs, and the chip counts failing PRs as the live line does.",