@abhishek944/pi-tasks 0.16.0 → 0.17.0
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.
- package/README.md +10 -8
- package/dist/agents/delegation.js +77 -6
- package/dist/auto-continue.js +262 -19
- package/dist/blocked.d.ts +29 -0
- package/dist/blocked.js +100 -0
- package/dist/delegated-time.d.ts +5 -5
- package/dist/delegated-time.js +53 -21
- package/dist/dependency.d.ts +1 -1
- package/dist/dependency.js +1 -1
- package/dist/durable.d.ts +5 -1
- package/dist/durable.js +70 -8
- package/dist/herdr-panel.d.ts +9 -1
- package/dist/herdr-panel.js +46 -9
- package/dist/index.d.ts +1 -1
- package/dist/index.js +31 -2
- package/dist/progress.js +1 -1
- package/dist/snapshot.js +47 -4
- package/dist/state.d.ts +27 -5
- package/dist/state.js +235 -14
- package/dist/timing.js +7 -1
- package/dist/tools.js +258 -16
- package/dist/tracking.js +14 -9
- package/dist/transition.d.ts +9 -0
- package/dist/transition.js +26 -0
- package/dist/types.d.ts +67 -1
- package/dist/ui/panel.js +22 -10
- package/dist/ui/works-dashboard.js +16 -5
- package/docs/REFERENCE.md +40 -14
- package/docs/USAGE_GUIDE.md +29 -17
- package/herdr/pi-tasks/README.md +7 -6
- package/herdr/pi-tasks/header.js +61 -41
- package/herdr/pi-tasks/main.js +88 -13
- package/package.json +1 -1
package/dist/ui/panel.js
CHANGED
|
@@ -2,6 +2,7 @@ import { stripVTControlCharacters } from "node:util";
|
|
|
2
2
|
import { copyToClipboard } from "@earendil-works/pi-coding-agent";
|
|
3
3
|
import { sliceByColumn, truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
|
|
4
4
|
import { delegateLink, focusTerminal } from "../agents/links.js";
|
|
5
|
+
import { blockedDependencyCounts, blockedRowLabel, compactBlockedSummary } from "../blocked.js";
|
|
5
6
|
import { formatWorksMarkdown } from "../markdown.js";
|
|
6
7
|
import { openRepository, openSession } from "../open-repository.js";
|
|
7
8
|
import { taskOwner } from "../ownership.js";
|
|
@@ -157,7 +158,8 @@ class TasksPanel {
|
|
|
157
158
|
if (width < 48)
|
|
158
159
|
return [];
|
|
159
160
|
const { works, error } = readTaskView(this.state);
|
|
160
|
-
const
|
|
161
|
+
const visible = (todos) => todos.filter((todo) => todo.status !== "closed" && todo.status !== "cancelled");
|
|
162
|
+
const todos = visible(works.flatMap((work) => work.tasks));
|
|
161
163
|
const boxWidth = this.placement === "floating" ? width : Math.min(54, Math.max(48, Math.floor(width * 0.44)));
|
|
162
164
|
const innerWidth = boxWidth - 2;
|
|
163
165
|
const leftPad = this.placement === "widget" ? " ".repeat(Math.max(0, width - boxWidth)) : "";
|
|
@@ -179,13 +181,15 @@ class TasksPanel {
|
|
|
179
181
|
if (works.length === 0)
|
|
180
182
|
content.push(metricsColumn(this.theme.fg("muted", "No works yet."), null, null, false, innerWidth, this.theme));
|
|
181
183
|
for (const work of works) {
|
|
182
|
-
const
|
|
183
|
-
const
|
|
184
|
+
const shown = visible(work.tasks);
|
|
185
|
+
const completed = shown.filter((todo) => todo.status === "completed").length;
|
|
186
|
+
const summary = workSummaryLine(work.workName, `${completed}/${shown.length}`, contentWidth, this.theme, work.workId);
|
|
184
187
|
content.push(metricsColumn(summary, workCompletion(work), workTime(work), work.tasks.some((todo) => todo.workingSince !== undefined), innerWidth, this.theme));
|
|
185
|
-
for (const todo of
|
|
188
|
+
for (const todo of shown) {
|
|
186
189
|
const agent = delegateLink(todo.taskInfo);
|
|
187
190
|
const lead = ` ${todoIcon(todo.status, this.theme)} ${recordId(todo.taskId, this.theme)} `;
|
|
188
|
-
const
|
|
191
|
+
const blocked = blockedRowLabel(todo);
|
|
192
|
+
const label = `${lead}${ownerBadge(todo.taskInfo, this.theme, Boolean(agent))} ${this.theme.fg(todo.status === "completed" ? "muted" : "text", safeSingleLine(todo.taskName))}${blocked === undefined ? "" : ` ${this.theme.fg("warning", `· ${blocked}`)}`}`;
|
|
189
193
|
delegateRows.set(content.length, { agent, start: visibleWidth(lead) });
|
|
190
194
|
content.push(metricsColumn(label, taskCompletion(todo), taskTime(todo), todo.workingSince !== undefined, innerWidth, this.theme));
|
|
191
195
|
}
|
|
@@ -304,12 +308,20 @@ class TasksPanel {
|
|
|
304
308
|
this.tui.requestRender();
|
|
305
309
|
}
|
|
306
310
|
renderHeader(width, leftPadWidth, todos, suffix = "") {
|
|
307
|
-
const counts = { active: 0, blocked: 0, completed: 0, cancelled: 0 };
|
|
311
|
+
const counts = { active: 0, blocked: 0, completed: 0, closed: 0, cancelled: 0 };
|
|
308
312
|
for (const todo of todos)
|
|
309
313
|
counts[todo.status]++;
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
314
|
+
// One aggregate blocked count made 2 user blockers + 1 agent wait read as
|
|
315
|
+
// "3 blocked on me". Keep the classes visible wherever the header fits.
|
|
316
|
+
const parts = [];
|
|
317
|
+
const blockedSummary = compactBlockedSummary(blockedDependencyCounts(todos));
|
|
318
|
+
if (blockedSummary)
|
|
319
|
+
parts.push(blockedSummary);
|
|
320
|
+
for (const status of ["active", "completed", "cancelled"]) {
|
|
321
|
+
if (counts[status] > 0)
|
|
322
|
+
parts.push(`${counts[status]}${todoIcon(status, this.theme)}`);
|
|
323
|
+
}
|
|
324
|
+
const summary = parts.join(" ");
|
|
313
325
|
const copyAction = this.copying
|
|
314
326
|
? this.theme.fg("dim", "[Copying…]")
|
|
315
327
|
: this.theme.fg("accent", this.theme.bold("[Copy]"));
|
|
@@ -460,7 +472,7 @@ function workSummaryLine(name, count, width, theme, workId) {
|
|
|
460
472
|
return `${shownLeft}${gap}${right}`;
|
|
461
473
|
}
|
|
462
474
|
export function todoIcon(status, theme) {
|
|
463
|
-
if (status === "completed")
|
|
475
|
+
if (status === "completed" || status === "closed")
|
|
464
476
|
return theme.fg("success", "✓");
|
|
465
477
|
if (status === "active")
|
|
466
478
|
return theme.fg("accent", "▶");
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { copyToClipboard } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import { matchesKey, truncateToWidth, visibleWidth, wrapTextWithAnsi, } from "@earendil-works/pi-tui";
|
|
3
3
|
import { delegateLink, focusTerminal } from "../agents/links.js";
|
|
4
|
+
import { blockedDependencyCounts, blockedRowLabel, compactBlockedSummary } from "../blocked.js";
|
|
4
5
|
import { dependentOnLabel } from "../dependency.js";
|
|
5
6
|
import { formatWorksMarkdown } from "../markdown.js";
|
|
6
7
|
import { openRepository } from "../open-repository.js";
|
|
@@ -90,8 +91,9 @@ export class WorksDashboard {
|
|
|
90
91
|
const terminalRows = this.tui.terminal.rows || process.stdout.rows || 30;
|
|
91
92
|
const dialogHeight = Math.max(8, Math.min(36, Math.floor(terminalRows * 0.82)));
|
|
92
93
|
const activeTodos = todos.filter((todo) => todo.status === "active").length;
|
|
93
|
-
const completedTodos = todos.filter((todo) => todo.status === "completed").length;
|
|
94
|
-
const
|
|
94
|
+
const completedTodos = todos.filter((todo) => todo.status === "completed" || todo.status === "closed").length;
|
|
95
|
+
const blocked = compactBlockedSummary(blockedDependencyCounts(todos));
|
|
96
|
+
const summary = `${works.length} works · ${activeTodos} todos active${blocked ? ` · ${blocked}` : ""} · ${completedTodos}/${todos.length} completed · session scoped`;
|
|
95
97
|
const listHeight = Math.max(0, dialogHeight - CHROME_LINES);
|
|
96
98
|
if (listHeight > 0)
|
|
97
99
|
this.keepSelectionVisible(items, listHeight);
|
|
@@ -281,12 +283,12 @@ export class WorksDashboard {
|
|
|
281
283
|
const selected = item.key === this.selectedKey;
|
|
282
284
|
const prefix = selected ? this.theme.fg("accent", "▶ ") : " ";
|
|
283
285
|
if (item.kind === "work") {
|
|
284
|
-
const done = item.work.tasks.filter((todo) => todo.status === "completed").length;
|
|
286
|
+
const done = item.work.tasks.filter((todo) => todo.status === "completed" || todo.status === "closed").length;
|
|
285
287
|
const metadata = this.theme.fg("dim", `${done}/${item.work.tasks.length} completed`);
|
|
286
288
|
const label = `${prefix}${this.theme.bold(`${recordId(item.work.workId, this.theme)} ${safeSingleLine(item.work.workName)}`)} ${metadata}`;
|
|
287
289
|
return metricsColumn(label, workCompletion(item.work), workTime(item.work), item.work.tasks.some((todo) => todo.workingSince !== undefined), width, this.theme);
|
|
288
290
|
}
|
|
289
|
-
const metadata = this.theme.fg("dim", item.todo.status);
|
|
291
|
+
const metadata = this.theme.fg(item.todo.status === "blocked" ? "warning" : "dim", blockedRowLabel(item.todo) ?? item.todo.status);
|
|
290
292
|
const label = `${prefix} ${todoIcon(item.todo.status, this.theme)} ${recordId(item.todo.taskId, this.theme)} ${ownerBadge(item.todo.taskInfo, this.theme, Boolean(delegateLink(item.todo.taskInfo)))} ${safeSingleLine(item.todo.taskName)} ${metadata}`;
|
|
291
293
|
const line = metricsColumn(label, taskCompletion(item.todo), taskTime(item.todo), item.todo.workingSince !== undefined, width, this.theme);
|
|
292
294
|
const start = visibleWidth(`${prefix} ${todoIcon(item.todo.status, this.theme)} ${recordId(item.todo.taskId, this.theme)} `);
|
|
@@ -334,13 +336,22 @@ export class WorksDashboard {
|
|
|
334
336
|
const lines = ["", ...wrap(this.theme.bold(safeSingleLine(name))), ""];
|
|
335
337
|
if (task) {
|
|
336
338
|
lines.push(...wrap(this.theme.fg("muted", `${recordId(item.work.workId, this.theme)} ${safeSingleLine(item.work.workName)}`)), "");
|
|
337
|
-
const
|
|
339
|
+
const blocked = blockedRowLabel(task);
|
|
340
|
+
const status = `${todoIcon(task.status, this.theme)} ${task.status}${blocked ? ` · ${blocked}` : ""}`;
|
|
338
341
|
lines.push(...wrap(`${status} · ${formatCompletion(taskCompletion(task))} complete · Time: ${formatTime(taskTime(task))}`), "");
|
|
339
342
|
}
|
|
340
343
|
else {
|
|
341
344
|
lines.push(...wrap(`${formatCompletion(workCompletion(item.work))} complete · Time (task effort): ${formatTime(workTime(item.work))}`), "");
|
|
342
345
|
}
|
|
343
346
|
if (task) {
|
|
347
|
+
if (task.goal) {
|
|
348
|
+
lines.push(this.theme.fg("accent", this.theme.bold("Goal")));
|
|
349
|
+
lines.push(...safeMultiline(task.goal.goal).flatMap(wrap));
|
|
350
|
+
lines.push(this.theme.fg("accent", this.theme.bold("Acceptance criteria")));
|
|
351
|
+
for (const criterion of task.goal.criteria)
|
|
352
|
+
lines.push(...safeMultiline(`• ${criterion}`).flatMap(wrap));
|
|
353
|
+
lines.push("");
|
|
354
|
+
}
|
|
344
355
|
const dependency = dependentOnLabel(task.dependentOn);
|
|
345
356
|
lines.push(this.theme.fg("accent", this.theme.bold(dependency === undefined ? "Final thoughts" : `Final thoughts · Dependent on: ${dependency}`)));
|
|
346
357
|
const thoughts = finalThoughtsFor(task) ?? "No final thoughts recorded.";
|
package/docs/REFERENCE.md
CHANGED
|
@@ -23,21 +23,31 @@ Limits:
|
|
|
23
23
|
|
|
24
24
|
A work contains `workId`, `workName`, `workInfo`, `createdAt`, and `updatedAt`. It is a collection with no stored or derived lifecycle status. Work tools do not accept status, and WorkList has no status filter. The public WorkStatus type is removed; consumers should use TodoStatus for task lifecycle.
|
|
25
25
|
|
|
26
|
-
A todo contains `taskId`, `workId`, `taskName`, hidden `taskInfo`, optional visible `finalThoughts`, `status`, optional `blockedReason`, optional `dependentOn`, optional `completionPercent`, optional `elapsedMs`, optional `delegatedTimes`, optional snapshot `workingSince`, `createdAt`, and `updatedAt`.
|
|
26
|
+
A todo contains `taskId`, `workId`, `taskName`, hidden `taskInfo`, optional visible `finalThoughts`, `status`, optional `blockedReason`, optional `dependentOn`, optional `blockedAt`, optional `decisionQuestionId`, optional `completionPercent`, optional `elapsedMs`, optional `delegatedTimes`, optional snapshot `workingSince`, `createdAt`, and `updatedAt`. Every task also stores a visible goal and criteria, and the status set includes `closed`. A task starts active; no goal confirmation is required. Legacy records may store a goal confirmation or closeout attempts, and those fields remain readable exactly as stored. Records written before the lifecycle have no goal or revision; they remain readable exactly as stored and can be updated, completed, or closed without a fabricated goal or approval. `dependentOn` is `"user-decision" | "another-agent"`, stored only on blocked tasks; the Durable document uses `null` for absence. `blockedAt` is the epoch millisecond when the current blocked state began and is optional so legacy records omit the age instead of showing an invented one. `decisionQuestionId` links a `user-decision` blocker to its pi-decisions question and is cleared when the task leaves blocked or changes dependency class.
|
|
27
27
|
|
|
28
|
-
`taskInfo` is coordination metadata for resumption: the machine-read `owner:` declaration, canonical artifact paths, parent IDs, terminal/monitor links, and necessary execution constraints. It is never rendered as task text. `finalThoughts`
|
|
28
|
+
`taskInfo` is coordination metadata for resumption: the machine-read `owner:` declaration, canonical artifact paths, parent IDs, terminal/monitor links, and necessary execution constraints. It is never rendered as task text. Goals, criteria and `finalThoughts` are visible; empty/whitespace final thoughts are stored as absent. Existing records without them remain valid.
|
|
29
29
|
|
|
30
30
|
The public list shape assembles each work with `tasks: Todo[]`; tasks are stored separately to avoid duplicate state. Work progress is derived, not independently stored or editable.
|
|
31
31
|
|
|
32
|
-
`Blocked` means waiting for a user decision (a response, approval, or permission) or another agent's output or review. Mark such dependent tasks blocked immediately. `TodoCreate`
|
|
32
|
+
`Blocked` means waiting for a user decision (a response, approval, or permission) or another agent's output or review. Mark such dependent tasks blocked immediately. `TodoCreate` creates an active task; `TodoUpdate` requires both fields when entering blocked status. Explain the current dependency and resume condition. The blocked reason is the task's visible Final thoughts, so it is authoritative and is not duplicated in `finalThoughts`; `finalThoughts` is only a legacy fallback when an old blocked record has no reason. Unrelated blocked updates preserve both fields, and leaving blocked clears both. A supplied dependency outside blocked status is rejected. Replay accepts legacy blocked tasks without a dependency and never infers one from prose; details omit the label for those records. External services, tool failures, and other obstacles are classified by who can clear them, not by what failed. An obstacle only the user can clear — signing in or reconnecting a browser profile, granting access, supplying an identifier only they hold, or choosing between options — is a `user-decision` blocker. An obstacle nobody can act on yet — a provider outage, an unreachable service, an internal tool defect — is not blocked status: keep the task active, preserve safety, and report the unavailable dependency truthfully. Lists and copied Markdown include the visible thought and any stored dependency. AgentCreate supplies its automatic waiting reason with `dependentOn="another-agent"`. Parent delegated tasks stay blocked while awaiting worker output; the worker's own local tasks may be active. AgentCreate automatically blocks the parent task after successful creation, retaining its progress. For manual delegation, mark the parent task blocked explicitly. Resume affected tasks as active when the dependency resolves and work resumes. Each blocked state records `blockedAt`; an unrelated blocked edit preserves it, while a different dependency class starts a new age. When the blocker is a browser decision, store its question ID in `decisionQuestionId`. Several tasks may reference the same question: one answer must reconcile every linked task, and a superseded page is retired with `WithdrawQuestion` while its linked task records are updated in the same turn. If the agent concludes in conversation that a blocked dependency no longer exists, it must update the task record in that same turn; saying no input is needed without clearing or re-recording the blocker is a lifecycle defect. A task whose premise no longer holds is retired through the human cancellation decision with a recorded reason, never by inventing completion. A cancellation requested from an active task is recorded as blocked on `user-decision` with its `decisionQuestionId` while the page is pending; rejection restores it to active, so no active task is left awaiting the user with no record. `TaskLifecycleDecision` accepts an optional cancellation `reason`, shown on the page and stored with the decision. Works do not have status; cancelling a collection means explicitly cancelling its remaining tasks. These are agent instructions, not automatic dependency detection or a wake mechanism.
|
|
33
33
|
|
|
34
34
|
Legacy migration accepts version-1 Work events with or without status, ignores retired Work statuses and status-only patches, and preserves IDs, details, timestamps and tasks without rewriting history. It normalizes legacy planned/pending statuses to active. New mutations update only the session task JSON, not custom conversation entries. Older extension versions cannot read that JSON: back up the task file and retain the new version when rolling back other code, rather than expecting old session history to contain post-migration edits.
|
|
35
35
|
|
|
36
|
+
### Task lifecycle
|
|
37
|
+
|
|
38
|
+
Each task stores its goal and criteria separately from hidden coordination notes. `TaskGoalUpdate` replaces them and increments the goal revision; no approval is required. Starting, timing, delegation, completion, and closure do not need goal confirmation.
|
|
39
|
+
|
|
40
|
+
Verified work is `completed` at 100% and remains visible. A completed task can be closed without a separate approval step: `TodoUpdate` accepts `closed`, or for a delegated task use `TaskWorkerClose` to request and verify a `/close`, or `TaskCloseoutFinalize` to verify the worker is absent and record that the retrospective was not run. An unverified presence check never proves absence. Closed and cancelled tasks remain stored but are hidden in the Tasks panel. Deletion only permits a task with no recorded work; a Work containing retained tasks cannot be deleted. `TaskLifecycleDecision` requires an explicit human decision to cancel a task or reopen a closed or cancelled one. A legacy task with no stored `revision` is bound as revision 0 for this decision path, so it remains readable and retireable without an unrelated edit; the first actual mutation assigns a real revision, and no stored data is rewritten merely to present the decision. Reopening retains prior attempts and effort.
|
|
41
|
+
|
|
42
|
+
A local pi-decisions answer is validated against its session and immutable question, but it does not cryptographically prove a human submitted it: a same-user local process with access to the page capability can submit an answer. Real human action is a workflow requirement, not a tamper-proof authentication boundary. Similarly, generic shell/Core access is outside the tool-level guards.
|
|
43
|
+
|
|
44
|
+
Existing session task files are read as stored: no record is rewritten, no goal is synthesized, and no human approval is fabricated. Because there is no second lifecycle, their records follow these same rules; a goal-less record can be worked, completed, or closed without a fabricated goal. The independent Durable 1.1 conversation backend has no nested tool bridge for pi-decisions or Core; it closes a completed task normally and does not implement the explicit human cancel/reopen path.
|
|
45
|
+
|
|
36
46
|
### Final thoughts
|
|
37
47
|
|
|
38
|
-
|
|
48
|
+
Task details show `finalThoughts` (or the blocked reason) as the result update. Task details also show the stored goal and criteria when present. `taskInfo` remains hidden.
|
|
39
49
|
|
|
40
|
-
- **Blocked:** the authoritative `blockedReason` is shown, including what is awaited and what unblocks it. Do not duplicate it in `finalThoughts`. `/works` shows any stored dependency beside the Final thoughts heading; the native mod shows `Dependent on` beside its inline label. A legacy blocked record with no reason or dependency may fall back to its `finalThoughts
|
|
50
|
+
- **Blocked:** the authoritative `blockedReason` is shown, including what is awaited and what unblocks it. Do not duplicate it in `finalThoughts`. `/works` shows any stored dependency and blocked age beside the Final thoughts heading; the native mod shows `Dependent on` and `Blocked for` beside its inline label and a compact age in the collapsed row. A legacy blocked record with no reason or dependency may fall back to its `finalThoughts`, shows no invented label, and shows no age at all rather than zero.
|
|
41
51
|
- **Completed:** `finalThoughts` states the short actual result, verification performed, and remaining limits. A newly completed task should provide it; historical completed records without one remain honestly empty. No outcome is synthesized from old `taskInfo`.
|
|
42
52
|
- **Active:** `finalThoughts` is an occasional short update only when something significant changed; no filler is required per turn, estimate, or tool call.
|
|
43
53
|
- **Contents:** never include the goal again, ownership or delegation rationale, `owner:` declarations, terminal/monitor links, artifact paths, parent IDs, sections, lists, or history.
|
|
@@ -48,7 +58,7 @@ The desktop panel, `/works` task detail, and copied Markdown show only `finalTho
|
|
|
48
58
|
|
|
49
59
|
`TodoCreate` and `TodoUpdate` accept optional `completionPercent`: an integer from 0 through 100, or `null` to clear an obsolete estimate. Omission preserves an existing estimate on updates. For longer tasks, the guidance asks the AI to include interim estimates in `TodoUpdate` after roughly 5–10 meaningful working steps or a milestone, not just at completion or in status-only updates. The AI reports approximate progress based on completed effort and verification; visible evidence belongs in `finalThoughts` only when the change is significant, never in hidden `taskInfo`. Status alone never implies an arbitrary partial percentage. Estimates remain optional; use `null` when unknown and do not increase a percentage without new evidence. This cadence is guidance, not a runtime timer or enforced tool-call count. No new tool or extra model call is added.
|
|
50
60
|
|
|
51
|
-
- Completed tasks
|
|
61
|
+
- Completed and closed tasks are 100%; explicit partial progress with those statuses is rejected. Completion is an agent assertion after verification; closure needs no separate approval.
|
|
52
62
|
- Moving a partial task to blocked retains its progress. Reopening a completed task without a new estimate becomes unknown rather than retaining 100%.
|
|
53
63
|
- A work is the equal arithmetic mean of all non-cancelled task percentages, rounded down for display. For example, 100, 40, 0, 0 yields 35%.
|
|
54
64
|
- Any unknown eligible task makes the work unknown (`—`); unknown is not silently 0. With no eligible tasks (empty Work or only cancelled tasks), work is unknown.
|
|
@@ -58,11 +68,13 @@ The desktop panel, `/works` task detail, and copied Markdown show only `finalTho
|
|
|
58
68
|
|
|
59
69
|
### Measured time
|
|
60
70
|
|
|
61
|
-
`TodoUpdate` accepts optional `working: boolean`, separate from status and progress. `true` selects an active `owner: self` task in this session; a missing task, non-active status, or other ownership is rejected before changing state. The selected task is exclusive per session. `false` pauses that task without changing status; it does not interrupt a different selected task. Changing status away from active, changing ownership away from self, or deleting the task/Work closes its interval. The field is an operation, not persistent task status; callers cannot provide elapsed duration or timestamps.
|
|
71
|
+
`TodoUpdate` accepts optional `working: boolean`, separate from status and progress. `true` selects an active `owner: self` task in this session; a missing task, non-active status, or other ownership is rejected before changing state. The selected task is exclusive per session. `false` pauses that task without changing status for the rest of that run; it does not interrupt a different selected task. Changing status away from active, changing ownership away from self, or deleting the task/Work closes its interval. The field is an operation, not persistent task status; callers cannot provide elapsed duration or timestamps.
|
|
72
|
+
|
|
73
|
+
Automatic start removes the routine initial `working=true` call. When the agent is actually running (the same execution gate that drives `agentRunning`), exactly one task that is active, declares `owner: self`, and carries no delegated timing is selected without a tool call: at the start of each run, when a run resumes after a blocking prompt, and when a task becomes eligible during a run (return to active or reopen). With no candidate or several, no automatic choice is made and the caller selects explicitly. Delegated ownership, blocked, completed, closed and cancelled tasks are never auto-selected. A current focus or an explicit `working=false` pause always wins; the pause lasts until the next run boundary. One local task remains timed at a time, and idle, prompt and terminal pauses are unchanged.
|
|
62
74
|
|
|
63
|
-
The shared JSON stores focus, the agent-running gate, and `workingSince` during an active interval. Interval boundaries atomically update cumulative `elapsedMs` and clear the running marker, without changing status, completion or descriptive `updatedAt`. Resume/reload clears stale running focus without counting offline time. Migration accepts old time entries and sanitizes invalid duration fields to unknown. New tasks start at zero; older records remain unknown until selected, which begins measurement from that point rather than reconstructing history. Negative intervals following a backward wall-clock change clamp to zero; forward clock corrections can affect measured time because the agreed clock is Date.now().
|
|
75
|
+
The shared JSON stores focus, the agent-running gate, and `workingSince` during an active interval. Interval boundaries atomically update cumulative `elapsedMs` and clear the running marker, without changing status, completion or descriptive `updatedAt`. Automatic selection writes the same focus field and therefore the same validation rules apply; it can only run while `agentRunning` is true, so no timer starts in a session that is restored, idle, or blocked on a prompt. Resume/reload clears stale running focus without counting offline time. Migration accepts old time entries and sanitizes invalid duration fields to unknown. New tasks start at zero; older records remain unknown until selected, which begins measurement from that point rather than reconstructing history. Negative intervals following a backward wall-clock change clamp to zero; forward clock corrections can affect measured time because the agreed clock is Date.now().
|
|
64
76
|
|
|
65
|
-
`registerTaskTiming` gates focus with agent start/end and nested blocking user-prompt events. Every new `before_agent_start` clears prior selection;
|
|
77
|
+
`registerTaskTiming` gates focus with agent start/end and nested blocking user-prompt events. Every new `before_agent_start` clears prior selection and an explicit pause; the same activity gate then starts the sole eligible task automatically at `agent_start` or when a task becomes eligible, so no tool call is needed for routine work. Native loop continuations can retain selection until final settlement. Abort signals close the interval immediately. Settlement, shutdown, and pre-navigation boundaries close and clear selection. Tool execution and model thinking within an agent loop count; idle and native retry waits between loops do not. Hosts without blocking-prompt events cannot exclude an in-loop extension dialog, but retain loop-boundary pauses. There is no per-second persistence, heartbeat, or crash-recovery registry: forced termination may lose the uncommitted interval.
|
|
66
78
|
|
|
67
79
|
`taskTime`, `workTime`, and `formatTime` supply shared display calculations. Work time sums all tasks, including cancelled tasks, because already-spent effort is real; an empty Work or any unknown task yields unknown. This differs deliberately from completion, which excludes cancelled tasks and averages rather than sums. Delegated workers measure their own session-local tasks. Parent delegate records remain unknown until their registered assignment snapshots have been exported and imported. Known task effort is the stored local interval total plus imported assignment totals; prompt-to-completion duration is never used as a substitute. Imported sources remain attached across ownership changes so already-consumed effort is not lost. Unknown local history or any unknown source keeps the aggregate unknown. Unsafe aggregate totals also display unknown. No cross-session task registry or live monitor timing bridge is added.
|
|
68
80
|
|
|
@@ -94,17 +106,31 @@ This is model guidance only. No new schema fields, path-creation code, tool-call
|
|
|
94
106
|
|
|
95
107
|
## Auto-continuation
|
|
96
108
|
|
|
97
|
-
Auto-continuation is optional and requires Pi 1.2.0 or newer. Configure `pi-tasks.autoContinue` in Pi's `settings.json`; the extension reads `pi.getSettings()` so trusted project settings override global settings. `enabled` defaults to `false`. `maxContinuations` is optional and defaults to
|
|
109
|
+
Auto-continuation is optional and requires Pi 1.2.0 or newer. Configure `pi-tasks.autoContinue` in Pi's `settings.json`; the extension reads `pi.getSettings()` so trusted project settings override global settings. `enabled` defaults to `false`. `maxContinuations` is optional and defaults to 10; if supplied, it must be a positive safe integer, subject to the existing maximum of 50. Values above 50 are clamped to 50 with one warning. Explicit `null` is invalid. Invalid configuration disables the flow and reports a warning. Hosts without the new settings API keep normal task tracking with no automatic continuation.
|
|
98
110
|
|
|
99
111
|
A fresh accepted main interactive/RPC run arms a new continuation epoch and is the only path that resets its count. Input is provisional until the run starts, so handled/rejected prompts cannot arm it. Extension/custom starts do not arm or reset it. Steering/follow-up messages queued inside an already-running activity do not themselves reset the cap. Session start/reload and shutdown disarm and reset the epoch; tree navigation disarms it while preserving the count until fresh user input. Explicitly aborted activity also suspends it without resetting the count; failed activity does not. `agent_settled.aborted` covers aborts that skip the actionable boundary. Tracking tools must be active; side conversations must not start continuation.
|
|
100
112
|
|
|
101
113
|
The synchronous `agent_before_settle` handler runs after native retries, compaction, and queued work. It accepts completed or error outcomes and requires a non-aborted signal, no pending messages in either the boundary preview or runtime queue, and no continuation already requested by an earlier handler. Pi is still busy at this actionable boundary, so it does not require `ctx.isIdle()`. Instead it appends one custom-message draft and requests one native continuation; Pi owns committing it and honoring cancellation. No detached prompt, timer, background worker, or polling loop is created.
|
|
102
114
|
|
|
103
|
-
|
|
115
|
+
Eligible active tasks across all Works and pending TodoUpdate completion or blocker transitions share one task-review continuation. Legacy planned/pending task statuses replay as active. Empty Works and unchanged blocked, completed, or cancelled tasks do not trigger continuation. Work metadata has no scheduling role. The prompt includes task IDs, names and statuses and directs the agent to list tools for full details. The extension never mutates statuses, verifies work independently, or treats a blocker label as proof of an actual dependency.
|
|
116
|
+
|
|
117
|
+
Continuation is not a retry. Before continuing, the extension fingerprints the records it would send: task and work IDs, status, completion estimate and visible Final thoughts. Comparing only happens when nothing outside task bookkeeping ran since the previous committed continuation, so real work is preserved without demanding a reporting update every round: reads, searches, builds, browser calls, edits, monitors and decisions all count as work even when the record fields stay untouched, and tracking never requires a filler `TodoUpdate`. An orchestration wrapper such as `codemode` is credited only with the nested calls it ran, identified by Pi's `<callerId>/<n>` nested call IDs, so a batch that only read or rewrote bookkeeping is not progress. Work evidence accumulates across native retries and queued low-level runs inside one settlement interval and is cleared only when a continuation is committed or a fresh accepted main run starts. A comparison interval with no such work and an identical fingerprint would repeat the previous round exactly, so it stops the epoch with one visible notice. A fresh accepted main user run clears the fingerprint with the count, and a delivered or dismissed command-monitor wake clears it too, because the new evidence is not comparable with the interval that was waiting. Measured time, the running interval and hidden `taskInfo` are excluded, so ordinary time accumulation cannot mask a stall. When the stop does happen, the unresolved obstacle, wait or failure is reported once with its exact dependency and resume trigger instead of being repeated.
|
|
104
118
|
|
|
105
119
|
A focused `owner: self` task that launched a command `MonitorCreate` with an `onDone` wake is excluded from that preview until the wake is actually delivered, dismissed, or stale. pi-tasks captures the exact task at `tool_call` by tool-call identity, matches it with `pi-loop-monitor:ondone-registered`, and verifies each boundary through `pi-loop-monitor:state-probe`. Core `hcTerminalId` subscriptions are excluded because their signals report worker state, not command completion; worker signals and unrelated active tasks continue normally. The probe's `queued` state still suppresses continuation while a completed monitor's notification waits for Pi to become idle, and `released` clears that wait only after actual delivery or dismissal. A task may have multiple outstanding command waits; they are tracked and released individually, with no one-monitor limit, and any live or queued wait keeps that task suppressed. pi-tasks does not parse monitor text or create a replacement loop. The task stays active and its status is never changed to blocked for these waits.
|
|
106
120
|
|
|
107
|
-
At most the effective limit
|
|
121
|
+
At most the effective limit of extra continuations are requested per fresh accepted main user run: 10 by default, a higher configured `maxContinuations` up to the hard maximum of 50, and 50 when a configured value exceeds it. The final permitted request is labeled final. If active tasks remain after that request, the next boundary surfaces one explicit unresolved warning that names them, states that progress continuation stopped at the limit, and tells the user to send a new prompt to start a fresh budget; it changes no record and does not silently imply completion. When `autoContinue.enabled` is false and active tasks remain, the same explicit unresolved warning appears once instead of a silent settlement, and names the settings change followed by a fresh main prompt as the actionable continuation; reloading the setting alone does not arm continuation, so a new accepted main prompt is required. Tasks with a live command-monitor wake are identified as having their own wake, not relabeled blocked or cancelled. A fresh user prompt resets the cap. The cap applies across failed runs, native retries, compaction, and queued work, and cannot be reset by extension messages, steering/follow-up input, or session-tree changes. This is not a cost cap or a cap on native tool/retry requests, and another extension may independently request work. Settings changes take effect when Pi reloads effective settings, normally through `/reload`. Reloading does not arm a continuation epoch; only a fresh accepted main user prompt does.
|
|
122
|
+
|
|
123
|
+
## Transition review
|
|
124
|
+
|
|
125
|
+
The desktop extension registers a `tool_result` observer for both TodoUpdate implementations. The tools add an additive structured marker (`details.data.transition` and `details.data.taskId` in the standard tool; the Durable tool also exposes the marker on its flat details) when the status changes to `completed`, `blocked` with `user-decision`, or `blocked` with `another-agent`, or when a blocked task's dependency class changes between the two blocked values. Persisted task records and their schema are unchanged; ordinary same-state updates emit no marker.
|
|
126
|
+
|
|
127
|
+
At `agent_before_settle`, pending markers and eligible active tasks are combined into one `pi-tasks-review` draft. Pending changes remain queued while native retries or other messages take priority and are consumed only when a review is delivered. Actual later transitions can be reviewed again; same-status edits do not create markers.
|
|
128
|
+
|
|
129
|
+
Record correctness is not budgeted progress. When `autoContinue.enabled` is false or the progress-continuation limit is reached, a pending transition still produces one `pi-tasks-review` that only challenges the records; it names why progress continuation is disabled or stopped, explicitly says not to start or continue unrelated active work in that review, lists any active tasks as unresolved, and does not increment the progress budget. The limit notice clarifies that the next transition still gets a record review. A transition is consumed once delivered, so a review that changes no status does not repeat by itself. Neither the warning nor the record review mutates a task, overrides the user's `autoContinue` setting, or treats an outage or live monitor as a completion.
|
|
130
|
+
|
|
131
|
+
A review that is already being delivered also carries a read-only blocked-task audit: every blocked task with its dependency class, blocked age when stored, linked decision question, shared-question tasks, and reason. It asks the agent to confirm the dependency still exists, return the task to active when it does not, retire an obsolete task through the human cancellation decision, or keep the block with its exact unblock condition and a live question or monitor. The same audit is delivered once at `session_start` for a restored start (`startup`, `/reload`, or `resume`), because restarts and reloads stop decision watchers and agent monitors; a fresh `fork` keeps its isolation and a brand-new session has no inherited store; that audit triggers one reconciliation turn, changes no record itself, and is not a new user request. Both audits are generated from task bookkeeping and never treat task text as instructions.
|
|
132
|
+
|
|
133
|
+
Transition guidance validates task IDs and never copies blocked reasons as instructions. It also requires a chat statement that a blocker is superseded to be accompanied by a task update in the same turn, and a shared decision to reconcile all linked tasks when it is answered or withdrawn. Monitor and decision-watcher wakes remain independent of the review budget. Hosts without the newer boundary APIs retain ordinary tracking without automatic review.
|
|
108
134
|
|
|
109
135
|
## Repository status and opening directories
|
|
110
136
|
|
|
@@ -136,11 +162,11 @@ pi-herdr 0.1.0 needs this compatible local source. The package version remains 0
|
|
|
136
162
|
|
|
137
163
|
## Interfaces
|
|
138
164
|
|
|
139
|
-
`pi-tasks.panel.enabled` defaults to false; `pi-tasks.panel.mode` defaults to floating and also accepts widget. `pi-tasks.herdrPanel.enabled` also defaults to false; when true, a TUI session in a local Herdr Core terminal opens or focuses the native Tasks pane at session start and replaces a Tasks pane left by the same terminal’s earlier session. Automatic startup keeps setup failures silent, while `/works herdr-on` reports them. Pi 1.2+ merged settings apply on startup/reload; older hosts keep defaults. `/works compact-off` hides the compact TUI and `/works compact-on` restores the last visible mode. Commands do not rewrite settings. `/works` remains available on demand. `/works herdr-on` validates the current session snapshot,
|
|
165
|
+
`pi-tasks.panel.enabled` defaults to false; `pi-tasks.panel.mode` defaults to floating and also accepts widget. `pi-tasks.herdrPanel.enabled` also defaults to false; when true, a TUI session in a local Herdr Core terminal opens or focuses the native Tasks pane at session start and replaces a Tasks pane left by the same terminal’s earlier session. Automatic startup keeps setup failures silent, while `/works herdr-on` reports them. Pi 1.2+ merged settings apply on startup/reload; older hosts keep defaults. `/works compact-off` hides the compact TUI and `/works compact-on` restores the last visible mode. Commands do not rewrite settings. `/works` remains available on demand. `/works herdr-on` validates the current session snapshot, syncs the bundled assets in the personal mods/pi-tasks directory, then explicitly opens a native read-only pane beside the originating local Core terminal. A bundled asset that already matches is left untouched; a differing copy is saved beside itself as `<name>.bak-<timestamp>` and replaced, because the pane validates the snapshot contract of the package version that writes it, and a refreshed viewer loads in a new pane. A missing/invalid snapshot binding fails before pane creation with restart/resume guidance; no snapshot is synthesized from stale in-memory records. It passes sessionId, snapshot path and terminal identity, never infers the session from UI focus, and does not launch a second Pi. If same-session Loops/Monitors is already open, Tasks stacks below it instead of creating another column. Reopening focuses the existing Tasks pane. Closing either panel leaves the other in place without affecting task state.
|
|
140
166
|
|
|
141
167
|
Native header close uses a personal cloned layout/header, leaving originals intact and delegating other panes to its copied base renderer. Only an exact terminal-null pi-tasks pane can be closed. Existing top/always headers are required; conflicting personal files are preserved. Content uses compact Work→Task rows, unboxed inline Final thoughts with any stored blocked dependency beside the label, leading genuine-running/blocked symbols, adjacent existing-delegate Agent buttons and plain metrics, without session/status bars or a footer. Repository command configuration is passed as explicit view props.
|
|
142
168
|
|
|
143
|
-
The native mod reads the same version-1 snapshot containing sessionId, cwd, optional terminalId, updatedAt, nextWorkId, nextTaskId, works, todos, agentRunning and optional focusedTaskId. It never edits task JSON. Its header status dropdown is view state: the header writes `pi-tasks-status:<paneId>` through Herdr's shared store and the view reads it, so filtering changes visibility only and no pane sees another pane's selection. The opener passes `paneFile`, an absolute `<agentDir>/tasks/<sessionId>.pane` holding the hosting pane id, because a pane content copy receives only its creation props. A pane created before that hand-off has no `paneFile` prop, so the view also looks itself up in the live pane inventory: the Tasks pane in the source terminal's tab, adopted only when exactly one matches. A missing, malformed or ambiguous answer leaves the view at All statuses. Copy and header menu behavior assume the installed personal mods are refreshed after a source change. See [setup](USAGE_GUIDE.md#panel-visibility-and-herdr-tasks-pane).
|
|
169
|
+
The native mod reads the same version-1 snapshot containing sessionId, cwd, optional terminalId, updatedAt, nextWorkId, nextTaskId, works, todos, agentRunning and optional focusedTaskId. It never edits task JSON. Its header status dropdown is view state: the header writes `pi-tasks-status:<paneId>` through Herdr's shared store and the view reads it, so filtering changes visibility only and no pane sees another pane's selection. A Work is rendered only while it has a task the current selection lists, so a Work with no tasks or no match leaves no Work heading. The header offers All statuses, Active, Blocked (all), Blocked on you, Waiting on agents, Completed and Cancelled; Completed lists `completed` and `closed` records together because verified work is closed after completion, All statuses stays the live view, and every count is the number of tasks its entry lists. The opener passes `paneFile`, an absolute `<agentDir>/tasks/<sessionId>.pane` holding the hosting pane id, because a pane content copy receives only its creation props. A pane created before that hand-off has no `paneFile` prop, so the view also looks itself up in the live pane inventory: the Tasks pane in the source terminal's tab, adopted only when exactly one matches. A missing, malformed or ambiguous answer leaves the view at All statuses. Copy and header menu behavior assume the installed personal mods are refreshed after a source change. See [setup](USAGE_GUIDE.md#panel-visibility-and-herdr-tasks-pane).
|
|
144
170
|
|
|
145
171
|
The compact TUI panel is off by default. When explicitly enabled, its default visible mode is a non-capturing floating overlay anchored at the top-right. Its header hides the session ID and places an underlined Open session action immediately after Copy, including minimized/widget layouts. The action uses the Pi session-context identity to locate the matching direct/nested artifact directory under repository var and opens it via the configured shell-free launcher. If absent, the standard var/sessionId directory is created on activation; ambiguous matches or unsafe identity fail visibly. No lookup or process launch occurs during rendering. /works open-session supplies a keyboard-command path. Existing repository Open remains separate. On narrow headers, Minimize/Maximize shorten to [-]/[+] to preserve every action and its hit region; overflow hints use remaining space. It prefixes work and todo names with bracketed IDs (`[W1] Name`, `[T1] [self] Name`), alongside status icons, completion counts, and a visible row range when content exceeds the terminal-aware viewport. It hides on terminals narrower than 90 columns or shorter than 18 rows. In fullscreen TUI mode, its title-bar Copy action exports every work and nested todo as Markdown, while Minimize collapses the panel to a restorable title bar that keeps Copy, Open, and Maximize available. `/works minimize` and `/works maximize` provide a keyboard-command path and preserve the collapsed state when switching between floating and widget layouts. Overflow starts at the newest rows and follows newly added tail rows until the user scrolls upward. Mouse-wheel events over the expanded floating panel scroll it directly without taking keyboard focus; regular terminal mode shows the newest rows and uses `/works` for complete browsing and copying. Because Pi treats any persistent overlay as active, the floating mode can block display-mode changes. `/works widget` switches to a right-aligned widget above the editor, renders all rows, and retains the title actions, while `/works compact-off` hides it.
|
|
146
172
|
|
package/docs/USAGE_GUIDE.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Tasks belong only to the Pi session ID, not to conversation branches. Pi reads and atomically writes `<agent-directory>/tasks/<sessionId>.json`, normally `~/.pi/agent/tasks/<sessionId>.json`. The Pi TUI and native Herdr pane display the same document. Navigating the conversation tree never rolls tasks back. Resume/reload preserves the session file; a fork with a new session ID starts empty. Do not open the same session in multiple independent Pi writer processes.
|
|
6
6
|
|
|
7
|
-
Existing sessions without a task file import the selected legacy task view once, preserving old session history. Pre-upgrade forks with their own task edits migrate that old view. Fresh interactive and CLI forks start empty; copied-only legacy entries do not count as
|
|
7
|
+
Existing sessions without a task file import the selected legacy task view once, preserving old session history. Pre-upgrade forks with their own task edits migrate that old view. Fresh interactive and CLI forks start empty; copied-only legacy entries do not count as this session's tasks. Legacy fork migration may need its parent history file to distinguish inherited events; restore that file if migration reports it unavailable. Subsequent edits no longer append task events to that history. Back up the JSON file when upgrading or moving sessions; exporting/sharing conversation JSONL does not include this separate task file. Invalid or mismatched files are reported without overwriting them. If a file disappears after initialization, restore it instead of expecting automatic history replay. Old extension versions do not see post-migration edits.
|
|
8
8
|
|
|
9
9
|
## Panel visibility and Herdr Tasks pane
|
|
10
10
|
|
|
@@ -32,15 +32,15 @@ Set the native Herdr pane default in the same settings object:
|
|
|
32
32
|
}
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
`pi-tasks.herdrPanel.enabled` defaults to false. When true, each new TUI session inside a local Herdr Core terminal
|
|
35
|
+
`pi-tasks.herdrPanel.enabled` defaults to false. When true, each new TUI session inside a local Herdr Core terminal syncs the bundled assets and opens/focuses the Tasks pane at session start; a Tasks pane from the same terminal’s earlier session is replaced. Automatic startup keeps setup failures silent. `/works herdr-off` still closes the running session’s pane, and `/works herdr-on` still reports setup problems. Settings apply on startup/reload; commands never rewrite them.
|
|
36
36
|
|
|
37
|
-
The package includes a native read-only mod at `herdr/pi-tasks/`. `/works herdr-on` automatically
|
|
37
|
+
The package includes a native read-only mod at `herdr/pi-tasks/`. `/works herdr-on` automatically syncs its files into your personal Herdr app home as `mods/pi-tasks/` (normally `~/.config/herdr-app/mods/pi-tasks/`; respecting `XDG_CONFIG_HOME` but ignoring inherited `HERDR_APP_HOME` fixture overrides for both app commands and asset installation), then opens the pane. No manual copying is required. A file that already matches the package is left untouched; a differing copy is kept as `<name>.bak-<timestamp>` beside it and replaced, because the pane validates the snapshot contract of the package version that writes it. The personal `mods/pi-tasks-pane-header/` mod is a separate clone and is not refreshed automatically. Developers can validate the installed mod with:
|
|
38
38
|
|
|
39
39
|
```sh
|
|
40
40
|
herdr-app check ~/.config/herdr-app/mods/pi-tasks
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
From a local Pi terminal already displayed in Herdr, run `/works herdr-on` to install/open the Tasks pane beside that exact terminal, or enable `pi-tasks.herdrPanel.enabled` for automatic startup. The command first requires an initialized, valid snapshot for the current Pi session; it does not create a pane with missing binding props. If a running instance mixes older task modules with the updated command, restart Pi and resume the session before retrying. The first panel opens beside the source terminal. If same-session Loops/Monitors is already open, Tasks stacks below it instead. Reopening focuses the existing Tasks pane; closing either panel leaves the other in place. The command passes the session ID and authoritative snapshot path explicitly. It does not start another Pi process or choose whichever terminal happens to have focus. Use `/works compact-off` or the setting above to avoid duplicate compact TUI display. The mod reads/watches the file and shows a compact Work→Task tree with inline name-activated Final thoughts, leading running/blocked symbols, right-aligned numeric metrics and adjacent linked-task-only Agent buttons. Its pane header adds one compact status dropdown (All statuses, Active, Blocked, Completed, Cancelled) that shows only matching tasks and the Works containing them; Work progress and effort remain totals for every task, and the selection is per-pane view state read from Herdr's shared store under `pi-tasks-status:<paneId>`, never a settings entry or a task-record write. The opener also writes the hosting pane id to `<agentDir>/tasks/<sessionId>.pane` and passes `paneFile`, because a pane content copy cannot name its own pane; reopening the pane refreshes it. A pane created before that hand-off carries no `paneFile` prop and its stored props never change, so the view falls back to the live pane inventory and adopts the one Tasks pane in the source terminal's tab; anything absent, malformed or ambiguous leaves the view at All statuses instead of guessing another pane's selection. An edited mod reaches existing panes when the Herdr app starts or a pane is closed and reopened, independently of Pi process age. It omits owner/status fact lines, connection/session bars and the bottom Read-only footer. It does not write task state or run model calls. Remote sessions and task editing from the pane are not included.
|
|
43
|
+
From a local Pi terminal already displayed in Herdr, run `/works herdr-on` to install/open the Tasks pane beside that exact terminal, or enable `pi-tasks.herdrPanel.enabled` for automatic startup. The command first requires an initialized, valid snapshot for the current Pi session; it does not create a pane with missing binding props. If a running instance mixes older task modules with the updated command, restart Pi and resume the session before retrying. The first panel opens beside the source terminal. If same-session Loops/Monitors is already open, Tasks stacks below it instead. Reopening focuses the existing Tasks pane; closing either panel leaves the other in place. The command passes the session ID and authoritative snapshot path explicitly. It does not start another Pi process or choose whichever terminal happens to have focus. Use `/works compact-off` or the setting above to avoid duplicate compact TUI display. The mod reads/watches the file and shows a compact Work→Task tree with inline name-activated Final thoughts, leading running/blocked symbols, right-aligned numeric metrics and adjacent linked-task-only Agent buttons. Its pane header adds one compact status dropdown (All statuses, Active, Blocked (all), Blocked on you, Waiting on agents, Completed, Cancelled) that shows only matching tasks and the Works containing them, with each label counting the tasks that entry lists; Completed lists finished tasks including records closed after verified completion, while All statuses stays the live view; the split entries use dependency counts, and a collapsed blocked row shows its dependency and blocked age when space allows and the record stores one; Work progress and effort remain totals for every task, and the selection is per-pane view state read from Herdr's shared store under `pi-tasks-status:<paneId>`, never a settings entry or a task-record write. The opener also writes the hosting pane id to `<agentDir>/tasks/<sessionId>.pane` and passes `paneFile`, because a pane content copy cannot name its own pane; reopening the pane refreshes it. A pane created before that hand-off carries no `paneFile` prop and its stored props never change, so the view falls back to the live pane inventory and adopts the one Tasks pane in the source terminal's tab; anything absent, malformed or ambiguous leaves the view at All statuses instead of guessing another pane's selection. An edited mod reaches existing panes when the Herdr app starts or a pane is closed and reopened, independently of Pi process age. It omits owner/status fact lines, connection/session bars and the bottom Read-only footer. It does not write task state or run model calls. Remote sessions and task editing from the pane are not included.
|
|
44
44
|
|
|
45
45
|
The persistent close button lives in the actual native pane header. First setup creates/selects personal copies of the current visible top-header layout and its header mod; originals remain untouched and non-Tasks header behavior uses the copied original. A minimum 32px header supports the close target. Conflicting custom assets or unsupported header layouts fail with guidance rather than being overwritten. See [native header setup and rollback](../herdr/pi-tasks/README.md). The native content has no three-dot trigger or action menu. Copy and repository actions remain available through the `/works` dashboard and commands; reopen the native pane after a watcher error.
|
|
46
46
|
|
|
@@ -51,7 +51,7 @@ For every normal request that starts or continues work, Pi should:
|
|
|
51
51
|
1. Find existing work and todos.
|
|
52
52
|
2. Create the relevant Work collection, or refresh its shared context when needed.
|
|
53
53
|
3. Create a todo for each distinct new actionable request, or update an existing todo that already owns the same outcome, with hidden coordination metadata and a concise visible Final thoughts when useful. Adding a request to an existing Work does not make it part of an existing todo.
|
|
54
|
-
4. Mark the current todo active before starting it.
|
|
54
|
+
4. Mark the current todo active before starting it. An active `owner: self` task starts timing automatically when a run begins or when it becomes the only eligible task during that run; use `working=true` only to switch between several eligible tasks, and `working=false` to pause for the rest of the run.
|
|
55
55
|
5. During longer tasks, report interim progress after roughly 5–10 meaningful working steps or a milestone, when an estimate is possible. Update Final thoughts only when the change is significant.
|
|
56
56
|
6. Mark the todo blocked only when its next step waits for a user decision or another agent's output or review. Supply the current `blockedReason` and `dependentOn` (`"user-decision"` or `"another-agent"`); otherwise update it after the attempt as active, completed, or cancelled, with a concise result when completing.
|
|
57
57
|
7. Keep status on tasks only; update Work context when scope or shared decisions change.
|
|
@@ -97,9 +97,9 @@ Every subagent must create or resume its own session-local Work and Todos before
|
|
|
97
97
|
|
|
98
98
|
## Statuses and dependencies
|
|
99
99
|
|
|
100
|
-
Works are collections with no status. Tasks use
|
|
100
|
+
Works are collections with no status. Tasks use `active`, `blocked`, `completed`, `closed`, and `cancelled`. A new task starts `active` with its visible goal and criteria; work, timing, and delegation need no goal confirmation. Completed work stays visible at 100% and can be closed without a separate approval step: `TodoUpdate` closes a completed task, or a delegated task is closed through `TaskWorkerClose` or `TaskCloseoutFinalize`. Cancelling a task or reopening a closed or cancelled one requires an explicit human decision through `TaskLifecycleDecision`. A cancellation requested from an active task is recorded as blocked on `user-decision` with that `decisionQuestionId` while the page is pending; rejecting it restores the task to active, so no active task is left awaiting the user with no record. `TaskLifecycleDecision` accepts an optional cancellation `reason`, shown on the page and recorded with the decision, so an obsolete task is retired truthfully instead of being marked complete. A valid legacy task without a stored revision is handled as revision 0 for this path, so cancellation and reopening work without first inventing a record change. Saved legacy task statuses `planned` and `pending` restore as active but are no longer accepted by tools. Old Work statuses are ignored during replay; no saved history is rewritten.
|
|
101
101
|
|
|
102
|
-
Use `blocked` only when a task cannot proceed until a user decision (a response, approval, or permission) or another agent's output or review arrives. Supply both `blockedReason` and `dependentOn` when
|
|
102
|
+
Use `blocked` only when a task cannot proceed until a user decision (a response, approval, or permission) or another agent's output or review arrives. Supply both `blockedReason` and `dependentOn` when entering blocked status: `dependentOn` is exactly `"user-decision"` or `"another-agent"`. Explain which dependency it awaits and what will unblock it. That reason is the blocked task's visible Final thoughts, so do not duplicate it; task details show the chosen dependency and, when the record stores one, the blocked age beside Final thoughts. Retain its current completion estimate. Other blocked edits preserve both fields; leaving blocked clears both. When the blocker is a browser decision, set `decisionQuestionId` to the pi-decisions question ID and pass the same task IDs to `SubmitQuestion`. If several tasks wait on one question, one answer must reconcile every linked task; if the page becomes unnecessary, call `WithdrawQuestion` with the reason and update those task records in the same turn. A chat statement that the blocker is superseded is incomplete until the task record changes in that same turn. Older blocked tasks without a reason or dependency show no invented values, and no reason falls back to Final thoughts. Classify an obstacle by who can clear it, not by what failed. Do not use blocked when a service, tool or access failed and nobody can act on it yet: keep the task active, preserve safety, continue other safe work, and report the unavailable dependency truthfully. Do use blocked with `"user-decision"` when only the user can clear the obstacle, for example by signing in or reconnecting a browser profile, granting a permission, supplying an identifier only they hold, or choosing between options; present that decision with `SubmitQuestion` and `WaitForAnswer` instead of leaving the task active with no request to them. A status change clears an unsupplied thought, so resumed and completed rows never show a stale waiting message. Parent delegated tasks stay blocked while awaiting worker output; the worker's own local tasks may be active. AgentCreate automatically blocks the parent task after successful creation, retaining its progress. For manual delegation, mark the parent task blocked explicitly.
|
|
103
103
|
|
|
104
104
|
When the dependency resolves and work resumes, mark the affected tasks active. Do not assign status to the parent Work. To cancel the whole collection, cancel its remaining tasks explicitly. Neither blocked status nor changing it schedules a wake automatically; use the appropriate monitor or event when an automatic notification is needed.
|
|
105
105
|
|
|
@@ -117,11 +117,23 @@ This is off by default and requires Pi 1.2.0+. Add the following to global `~/.p
|
|
|
117
117
|
}
|
|
118
118
|
```
|
|
119
119
|
|
|
120
|
-
Send a normal prompt to start. After success or failure,
|
|
120
|
+
Send a normal prompt to start. After success or failure, eligible active tasks across all Works can request a review. A pending TodoUpdate completion or classified blocker transition joins that same review. Legacy planned/pending task statuses restore as active. Empty Works and unchanged blocked, completed, or cancelled tasks do not cause another continuation. An active task that launched a command `MonitorCreate` with an `onDone` wake is excluded until that wake is delivered or dismissed, including while its notification is queued for idle. The exact task is captured at launch; Core `hcTerminalId` subscriptions and unrelated active tasks still continue. No task status is changed for that wait. Record genuine blockers and resume conditions in `blockedReason` with the required `dependentOn` classification when entering blocked status before handing off.
|
|
121
121
|
|
|
122
|
-
Press Escape/abort to stop. The extension will not restart from a monitor wake or another extension's message; send a new main prompt when you want it to resume. Failed runs do not disarm continuation: after native retries, unfinished records request another run until the
|
|
122
|
+
Press Escape/abort to stop. The extension will not restart from a monitor wake or another extension's message; send a new main prompt when you want it to resume. Failed runs do not disarm continuation: after native retries, unfinished records request another run until the configured continuation limit is reached. Reloading or navigating session branches does not silently resume unfinished work; a tree change preserves the current count and requires fresh user input. When progress continuation is disabled or its limit is reached, the next settlement surfaces an explicit unresolved warning naming the active tasks. That warning is not a completion and changes no record. For the limit, send a new prompt to start a fresh budget; for a disabled setting, enable `pi-tasks.autoContinue`, reload, then send a new main prompt (reload alone does not arm continuation), or drive the remaining work yourself in a new prompt. Tasks with a live command monitor keep that wake and are not marked blocked or cancelled.
|
|
123
123
|
|
|
124
|
-
|
|
124
|
+
Continuation is not a retry loop. The extension remembers the records it sent (task and work IDs, status, completion estimate, visible Final thoughts) and compares them only when nothing outside task bookkeeping ran since the previous automatic continuation, so real reads, builds, browser calls, edits, monitors and decisions keep continuation alive without a reporting update every round. A `codemode` batch is judged by the nested calls it ran, so batching bookkeeping reads never counts as progress, and work evidence survives native retries inside one settlement interval. A comparison interval with no such work and no record change stops with one visible notice; a fresh main prompt clears that memory together with the count, and a delivered or dismissed command-monitor wake clears it too. Measured time and hidden `taskInfo` do not count as progress. Ordinary tool calls such as re-reading a failed check count as activity, not proof of new evidence, and can continue only within the shared budget. An obstacle the user alone can clear should be recorded as a `user-decision` blocker with the decision tools.
|
|
125
|
+
|
|
126
|
+
Auto-continuation defaults to 10 extra runs per fresh accepted main user run when `maxContinuations` is omitted. Set a positive integer such as `"maxContinuations": 20` to change the limit; values above 50 are clamped to 50 with one visible warning. The final requested continuation is labeled final. If active tasks remain after it, the next boundary names them in one explicit unresolved warning, says that progress continuation stopped at the limit, and tells you to send a new prompt to start a fresh budget. It changes no record and does not claim completion. A fresh accepted main user run resets the limit; a rejected prompt, extension wake, session-tree change, or steering/follow-up input queued inside a running activity does not. Set `enabled` to `false` and reload to disable the feature. It checks recorded states, not whether every user requirement was captured or genuinely verified.
|
|
127
|
+
|
|
128
|
+
## Transition review
|
|
129
|
+
|
|
130
|
+
When a `TodoUpdate` changes a task to completed or a classified blocker, including a change of blocked dependency class, pi-tasks includes that transition with eligible active tasks in one review at the next safe settlement. Progress continuation still uses the opt-in `autoContinue.enabled` switch and shared budget, but record correctness does not: when auto-continue is off or its limit is reached, the transition still gets one record-only review. That review says not to start or continue unrelated active work, lists any active tasks as unresolved, and does not count against the budget. Pending transitions wait behind queued work; ordinary same-status updates do not create transition events. Review does not change task records, start a timer, or poll.
|
|
131
|
+
|
|
132
|
+
A completion reflection asks the agent to recheck the authorized request, finish and verify in-scope work, and avoid unrelated optional work. A `user-decision` reflection first challenges the blocker: if the work can continue safely, return the task to active; if a human choice, approval, or permission is genuinely required, use pi-decisions `SubmitQuestion` with the blocked task IDs and `decisionQuestionId`, then `WaitForAnswer` once, share the returned URL, and yield for the watcher wake instead of asking the decision again in chat. Do not submit secrets or content not approved for the configured backend. When the decision tools, browser access, or permission are unavailable, keep the honest `blockedReason` with the exact dependency and resume check rather than claiming a submission. An `another-agent` reflection keeps that blocker distinct: retain one continuous monitor, inspect fresh worker output, and resume after verification.
|
|
133
|
+
|
|
134
|
+
Every delivered review also carries a blocked-task audit: task, dependency class, blocked age, linked question, and reason. It asks for a decision per row: confirm the dependency, return to active, retire an obsolete task through the human cancellation decision, or keep the block with its exact unblock condition and a live question or monitor. The same audit is delivered once for a restored start (`startup`, `/reload`, or `resume`), because restarts and reloads stop decision watchers and agent monitors; a fresh fork stays isolated. If a linked page is still needed, re-arm its watcher with `WaitForAnswer`; if it is superseded, withdraw it and update the linked tasks. Saying in chat that no input is needed without changing the record is a lifecycle defect.
|
|
135
|
+
|
|
136
|
+
A delivered transition is consumed; a genuine later transition, including reopening and completing again, can appear in another review. Abort suspends automatic reviews. Monitor and decision-watcher wakes remain independent of the review budget.
|
|
125
137
|
|
|
126
138
|
## Configure Open and Open Session
|
|
127
139
|
|
|
@@ -161,7 +173,7 @@ TodoList status="active"
|
|
|
161
173
|
TodoList workId="W1" limit=10
|
|
162
174
|
TodoUpdate taskId="T1" status="active" completionPercent=40 finalThoughts="Inspection is complete; implementation and verification remain."
|
|
163
175
|
TodoUpdate taskId="T1" status="blocked" dependentOn="another-agent" blockedReason="Waiting for the review findings. Resume when the reviewer returns them."
|
|
164
|
-
TodoUpdate taskId="T2" status="blocked" dependentOn="user-decision" blockedReason="Waiting for the user to choose the migration window."
|
|
176
|
+
TodoUpdate taskId="T2" status="blocked" dependentOn="user-decision" decisionQuestionId="migration-window" blockedReason="Waiting for the user to choose the migration window."
|
|
165
177
|
TodoUpdate taskId="T1" status="completed" finalThoughts="The token flow is fixed; typecheck and build passed. Live provider behavior remains unverified."
|
|
166
178
|
TodoUpdate taskId="T2" completionPercent=null
|
|
167
179
|
TodoDelete taskId="T1"
|
|
@@ -175,7 +187,7 @@ TodoDelete taskId="T1"
|
|
|
175
187
|
|
|
176
188
|
Final thoughts is the only task text shown in the compact native Tasks pane, the `/works` task detail, and copied Markdown. `taskInfo` stays stored for ownership, links, artifact paths, and resumption but is never rendered as task text.
|
|
177
189
|
|
|
178
|
-
- **Blocked:** `blockedReason` is authoritative and states what is awaited and what will unblock the task. Do not duplicate it in `finalThoughts`. Details show `Dependent on: User decision` or `Dependent on: Another agent` when the
|
|
190
|
+
- **Blocked:** `blockedReason` is authoritative and states what is awaited and what will unblock the task. Do not duplicate it in `finalThoughts`. Details show `Dependent on: User decision` or `Dependent on: Another agent` and the blocked age when the fields are stored; a legacy blocked record without a reason, dependency or `blockedAt` shows no invented values, omits the age entirely, and may fall back to an existing `finalThoughts`.
|
|
179
191
|
- **Completed:** state the short actual result, the verification performed, and any remaining limits. A newly completed task should provide this; historical completed records without it remain honestly empty. Do not synthesize an outcome from old `taskInfo`.
|
|
180
192
|
- **Active:** provide an occasional short update only when something significant changed. There is no required filler on every turn, estimate, or tool call.
|
|
181
193
|
- **Never include:** the goal again, delegation or ownership rationale, `owner:` declarations, terminal/monitor links, artifact paths, parent IDs, sections, lists, or history. Those belong in `taskInfo` or the owning workflow records.
|
|
@@ -186,14 +198,14 @@ No length cap, summarizer, migration, or history mechanism is added. Stored reco
|
|
|
186
198
|
### Active task time
|
|
187
199
|
|
|
188
200
|
```text
|
|
189
|
-
TodoUpdate taskId="T1" status="active"
|
|
201
|
+
TodoUpdate taskId="T1" status="active"
|
|
190
202
|
TodoUpdate taskId="T2" working=true
|
|
191
203
|
TodoUpdate taskId="T2" working=false
|
|
192
204
|
```
|
|
193
205
|
|
|
194
|
-
|
|
206
|
+
An active task with `owner: self` in its details starts timing automatically when a run begins, or when it becomes the only eligible task during that run, so ordinary work needs no `working` call. T1 above is timed by that automatic start. The second call only matters when another task is also eligible: it pauses the timed task and switches to T2. The third pauses T2 without changing its status for the rest of that run. `working=true` requires an active task with `owner: self` in its details. Blocked, delegated, completed and closed tasks are never timed automatically, and an explicit selection or pause always wins. The model selects the task, but never submits timestamps or estimates of duration.
|
|
195
207
|
|
|
196
|
-
Time is saved total milliseconds plus `Date.now() - workingSince` while running. The extension saves each interval when paused, switched, or finished, not on every one-second display refresh. Thinking and foreground tool execution count. Idle periods, retry delays between agent loops, and blocking extension UI prompts pause timing. Blocking, completion, cancellation, changing away from self ownership, abort, and shutdown close the interval.
|
|
208
|
+
Time is saved total milliseconds plus `Date.now() - workingSince` while running. The extension saves each interval when paused, switched, or finished, not on every one-second display refresh. Thinking and foreground tool execution count. Idle periods, retry delays between agent loops, and blocking extension UI prompts pause timing. Blocking, completion, cancellation, changing away from self ownership, abort, and shutdown close the interval. Each fresh run resumes automatic timing for the only eligible task. A restored session or branch always starts paused and excludes offline time. Abrupt process termination can lose the unsaved current interval; there is no background checkpoint writer. Blocking prompt exclusion requires a Pi host emitting `ui_prompt_start` and `ui_prompt_end`; older hosts retain loop-boundary timing.
|
|
197
209
|
|
|
198
210
|
The compact panel and `/works` show reserved Done and Time columns; `▶` beside a duration means it is running. New tasks show `0s`. Legacy tasks without timing show `—`; selecting one begins measurement from now, not from its creation date. Work time sums task effort, including cancelled tasks; any unknown duration makes its total unknown. This is not elapsed wall-clock time and does not predict completion. Each delegated agent times its own local tasks. Parent delegate records show `—` until the worker exports measured time and the parent imports it. Imported effort contributes to both the parent task and its Work, even while the parent task remains blocked. List tools and copied Markdown include durations too.
|
|
199
211
|
|
|
@@ -287,7 +299,7 @@ Use actual returned terminal addresses (t7 or machine/t7), not app pane IDs or t
|
|
|
287
299
|
|
|
288
300
|
Linked delegate badges are underlined and clickable in the compact panel, widget, dashboard and detail headings when fully visible. In /works use d; /works delegate T<number> works in regular mode too. Navigation uses herdr-app: a pane owner gets focus, while a pane-less Core child opens its existing terminal.peek overlay over the current tab without navigating to the parent. Unavailable app/CLI, closed targets, or a terminal Herdr is not showing report errors. No subprocess runs while rendering. Without a valid Core link, badges remain informational. Open actions remain unchanged.
|
|
289
301
|
|
|
290
|
-
The compact panel no longer displays the session ID. Before Copy, its header shows nonzero task-state counts across all Works: `
|
|
302
|
+
The compact panel no longer displays the session ID. Before Copy, its header shows nonzero task-state counts across all Works and splits blocked tasks by what they wait on: `1 on you · 2 on agents`, then `2▶` active, `5✓` completed, and `1×` cancelled. A legacy blocked task with no dependency class shows as `N blocked` rather than being counted as a user blocker. Blocked rows also show their age. Counts use the same icon colors as task rows. Counts update in floating, widget and minimized layouts; narrow headers shorten the toggle and truncate the summary when needed. Its underlined `[Open session]` action sits immediately after Copy in floating, widget and minimized layouts. It opens this agent's existing artifact directory under repository `var/` using the configured command, including a nested delegated session folder. If no folder exists, it creates `var/<full-sessionId>/`; multiple matching folders report an ambiguity rather than guessing. Session identity comes from Pi's context, not a pane name. Folder resolution and command launch happen only on activation, never during rendering. `/works open-session` is the keyboard-command alternative. The existing Open action still opens the repository. Narrow compact headers use `[-]`/`[+]` for Minimize/Maximize so all actions fit. The `/works` dashboard retains its existing title and controls.
|
|
291
303
|
|
|
292
304
|
The compact TUI is off by default. When enabled, its default layout floats at the top-right without taking keyboard focus. Its minimum box width is 48 columns to leave room for names beside both metrics; the widget hides below 48 columns. Separated right-hand Done and Time columns keep work/task percentages and measured durations aligned and visible even when names are long; the left side retains names, task status icons and Work task-counts. Work rows have no status icons. It hides on small terminals. The top border centers repository-wide Git status: `git main · S2 U3 ?1` means two staged files, three unstaged files, and one untracked file; a file with both staged and unstaged edits counts in both. A clean repository shows `git main · clean`. Long branches shorten before counts. Detached HEAD shows `@` plus the short commit. Git remains visible while minimized and adds no content row.
|
|
293
305
|
|
|
@@ -295,7 +307,7 @@ The asynchronous Git cache refreshes every second while a view is attached; file
|
|
|
295
307
|
|
|
296
308
|
In fullscreen TUI mode, click Copy in its title bar to copy every work and todo as Markdown, Open to run the configured command in the current session directory, or Minimize to collapse the panel to a small title bar. Copy and Open remain available while minimized, and Maximize restores the rows. The configured executable must be on PATH (or be an absolute path); launch failures produce visible error feedback. When more rows exist than fit, the floating panel starts at the newest rows; move the mouse over it and use the wheel to scroll older or newer rows without taking focus from the editor. In regular terminal mode, open `/works` to browse and copy the complete list.
|
|
297
309
|
|
|
298
|
-
Use `/works minimize`, `/works maximize`, `/works open`, or `/works open-session` when mouse input is unavailable. Use `/works widget` for a right-aligned layout above the editor that renders every row and retains the clickable title actions, `/works floating` to return to the floating layout, `/works compact-off` to hide it, or `/works compact-on` to restore the last visible layout. `/works herdr-on`
|
|
310
|
+
Use `/works minimize`, `/works maximize`, `/works open`, or `/works open-session` when mouse input is unavailable. Use `/works widget` for a right-aligned layout above the editor that renders every row and retains the clickable title actions, `/works floating` to return to the floating layout, `/works compact-off` to hide it, or `/works compact-on` to restore the last visible layout. `/works herdr-on` syncs the bundled mod files and opens the native Tasks pane; `pi-tasks.herdrPanel.enabled` opens it at each session start.
|
|
299
311
|
|
|
300
312
|
Run `/works` for full details. Its top border mirrors repository-wide Git status, and its top bar includes Copy, Open, and Minimize actions. In fullscreen TUI mode, click Minimize to collapse the dashboard to a top bar showing the current work and todo totals; click Maximize to restore it. The actions also have keyboard shortcuts that work in regular terminal mode.
|
|
301
313
|
|
package/herdr/pi-tasks/README.md
CHANGED
|
@@ -4,7 +4,7 @@ A read-only native GPUI view of the same per-Pi-session JSON used by pi-tasks. N
|
|
|
4
4
|
|
|
5
5
|
## Install and open
|
|
6
6
|
|
|
7
|
-
From an updated local Pi terminal already displayed in Herdr, run `/works herdr-on`, or enable `pi-tasks.herdrPanel.enabled` for automatic startup. The command validates the session file and source terminal,
|
|
7
|
+
From an updated local Pi terminal already displayed in Herdr, run `/works herdr-on`, or enable `pi-tasks.herdrPanel.enabled` for automatic startup. The command validates the session file and source terminal, syncs the bundled content assets into `<Herdr app home>/mods/pi-tasks/`, and opens beside that exact terminal, or stacks below its same-session Loops/Monitors pane if already open. Reopening focuses the existing Tasks pane. Automatic startup runs the same setup at each session start and replaces this terminal’s Tasks pane from an earlier session; it stays silent when Herdr is unavailable or setup fails, while the command reports the reason. The opener uses the normal desktop app home (`~/.config/herdr-app`, or the `XDG_CONFIG_HOME` equivalent), ignoring inherited `HERDR_APP_HOME` fixture overrides for both app commands and asset installation. A content asset that already matches this package is left untouched; a differing copy is saved as `<name>.bak-<timestamp>` beside it and replaced, because the pane validates the snapshot contract of the package version that writes it, and the refreshed viewer loads in a new pane. The personal `mods/pi-tasks-pane-header/main.js` is a separate clone and is never refreshed by the command; copy the bundle's `header.js` over it yourself to pick up header changes, preserving personal changes and the cloned `base.js` and layout.
|
|
8
8
|
|
|
9
9
|
The always-visible × belongs to Herdr's real pane header, not the content view. On first setup the command uses Herdr's official clone operations to create:
|
|
10
10
|
|
|
@@ -26,20 +26,21 @@ herdr-app check ~/.config/herdr-app/mods/pi-tasks-pane-header
|
|
|
26
26
|
|
|
27
27
|
## Behavior
|
|
28
28
|
|
|
29
|
-
- Compact real Work → Task rows, newest Work first with older Works below; task order within each Work stays unchanged. No invented subtasks. Activate a Work name to fold its tasks, or a task name to toggle an unboxed inline Final thoughts. A blocked task shows its authoritative blocked reason and any stored `Dependent on: User decision` or `Dependent on: Another agent` beside the Final thoughts label; a legacy blocked record without a dependency shows no invented label, and a task without a thought shows an honest empty label. Stored `taskInfo` metadata (owner line, links, paths, parent IDs) is never rendered. Work and task title buttons use the same underline focus affordance, so clicking one does not paint a selection-like background. The selected task is highlighted across its whole row. Double-clicking counts as one activation instead of immediately toggling the thought twice.
|
|
30
|
-
- Leading loader only while the task is genuinely running, `!` for blocked, `✓` for complete, quiet idle/cancelled marks. No session/connection bar,
|
|
29
|
+
- Compact real Work → Task rows, newest Work first with older Works below; task order within each Work stays unchanged. No invented subtasks. Activate a Work name to fold its tasks, or a task name to toggle an unboxed inline Final thoughts. A blocked task shows its authoritative blocked reason and any stored `Dependent on: User decision` or `Dependent on: Another agent` plus `Blocked for: 18h` beside the Final thoughts label. Its collapsed row shows the dependency and age when width allows, or just the age on narrow panes; a record without a stored age shows its dependency alone. A legacy blocked record without a dependency or `blockedAt` shows no invented label and no age rather than zero, and a task without a thought shows an honest empty label. Stored `taskInfo` metadata (owner line, links, paths, parent IDs) is never rendered. Work and task title buttons use the same underline focus affordance, so clicking one does not paint a selection-like background. The selected task is highlighted across its whole row. Double-clicking counts as one activation instead of immediately toggling the thought twice.
|
|
30
|
+
- Leading loader only while the task is genuinely running, `!` for blocked, `✓` for complete and a quiet `✓` for a closed task, quiet idle/cancelled marks. No session/connection bar, content-level counts, extra owner/status fact line or Read-only footer.
|
|
31
31
|
- Plain right-aligned progress and measured effort. Work completion averages noncancelled tasks; unknown propagates. Effort includes cancelled time and imported cumulative reports once. Unknown is `—`, known zero `0s`.
|
|
32
32
|
- A measured clock ticks only for a live source actually working on the selected measured task. Saved/offline/paused values freeze; time is not wall-clock age or ETA. Native spinner animation is independent of clock redraws. This Herdr API does not expose an OS reduced-motion preference.
|
|
33
33
|
- `Agent ↗` appears next to a task with a valid existing live delegate link. Activation rechecks that exact link: a terminal that owns a pane gets normal app focus, while a pane-less Core child opens its own `terminal.peek` overlay over the current tab; a deeper child is recognized by its nonempty Core parent record. It never navigates to the parent, launches an agent, or reports a silent success. Work rows have no Agent button. Agent and task-thought controls are independent.
|
|
34
34
|
- No three-dot trigger or native action menu is shown. Copy and repository actions remain available through the `/works` dashboard and commands; reopen the native pane to refresh after a watcher error.
|
|
35
35
|
- The native header × targets only the exact verified terminal-null pi-tasks pane. Closing leaves Pi, agents and tracking intact. It remains present for populated, empty, loading and error content.
|
|
36
|
-
- Snapshot version/session identity and record structure are validated, including a blocked task's optional two-value dependency
|
|
37
|
-
- The
|
|
36
|
+
- Snapshot version/session identity and record structure are validated, including a blocked task's optional two-value dependency, optional `blockedAt`, and optional `decisionQuestionId`; the directory is watched for atomic replacement. Invalid/missing files show an error, not stale rows. No authoritative record cache or mod-local task persistence is added.
|
|
37
|
+
- The header displays the count each status entry lists beside **Tasks**, and the title shows the **All statuses** count. Counts come from the content pane's validated snapshot; a blocked task also counts under Blocked on you or Waiting on agents, so one aggregate cannot read as all user blockers. Missing or invalid snapshots show no counts. The content publishes counts under a pane-scoped shared key, keyed by the same filter values the header offers, and clears them on errors and close.
|
|
38
|
+
- The persistent pane header carries one compact status dropdown before its ×: **All statuses** (default), **Active**, **Blocked (all)**, **Blocked on you**, **Waiting on agents**, **Completed**, **Cancelled**. It filters tasks by stored status or, for the two split entries, by `dependentOn`, never works; a running task is Active. **Completed** lists every finished task — the stored `completed` status and records later closed after verified completion — so finished work stays findable where people look for it instead of vanishing when it is closed; a closed row keeps a quiet `✓` and reports `Closed` as its state. **All statuses** stays the live view, so `closed` and `cancelled` records are listed by their own entries rather than in every view. Filtered views keep only matching tasks and the Works that contain them, in the existing newest-Work-first and original task order; Work progress and effort stay totals for every task of the Work, and task status, estimates, timing and records are untouched. A Work with nothing to list is not drawn, rather than leaving an empty heading. No Work or task record is removed. A selection with no match shows an empty state, and a changed selection starts at the top of the list. The selection is view state for that exact pane: it lives in Herdr's shared store under `pi-tasks-status:<paneId>` (the neighbouring Loops/Monitors header uses the same per-pane pattern) and is never written to a settings file or a task record.
|
|
38
39
|
- The menu is open state, not just a value: the header publishes it as `pi-tasks-status-open:<paneId>` so the view can close it. A press anywhere in the task list dismisses it, a press on the header row dismisses it, the trigger toggles it, an option selects and closes it, and Escape closes it; dismissing always keeps the selected status. Herdr's Select closes on presses inside its own mod, so the view supplies the press from its own root.
|
|
39
40
|
- A pane content copy receives only the props it was created with, so it cannot name its own pane. The opener therefore writes the hosting pane id to `<agentDir>/tasks/<sessionId>.pane` and passes its path as the `paneFile` prop; the view reads it beside the snapshot. A pane created before that hand-off carries no `paneFile` prop, and its stored props never change, so the view falls back to the live pane inventory: it finds the source terminal's tab and adopts the one Tasks pane there, which is the pane the opener split it into. An absent, missing, malformed or ambiguous answer leaves the view at **All statuses** instead of guessing another pane's selection. The dropdown anchors its menu to the trigger and grows downward, because a header at the top of a pane has no room above it.
|
|
40
41
|
|
|
41
42
|
Manual content props are `{sessionId, snapshot, terminal?, openCommand?, paneFile?}`. Bind the full Pi session ID and absolute task JSON path explicitly, never whichever terminal is focused. The source terminal's availability alone does not prove it still hosts that session. Only local file-backed sessions are supported.
|
|
42
43
|
|
|
43
|
-
`herdr-app check` proves loading and an initial render only. Populated native visual/interaction checks must separately verify file updates, inline Final thoughts, keyboard focus, linked Agent navigation (pane owner and pane-less child overlay), the status dropdown (menu placement, each status, no-match empty state, Work totals, two panes staying independent) and guarded close behavior. Browser mockups do not prove native behavior.
|
|
44
|
+
`herdr-app check` proves loading and an initial render only. Populated native visual/interaction checks must separately verify file updates, inline Final thoughts, keyboard focus, linked Agent navigation (pane owner and pane-less child overlay), the status dropdown (menu placement, each status including the split blocked entries, no-match empty state, Work totals, two panes staying independent) and guarded close behavior. Browser mockups do not prove native behavior. Setup refreshes the content mod from this package version and keeps the replaced file as a timestamped backup; the personal header mod still needs an explicit refresh to receive source changes.
|
|
44
45
|
|
|
45
46
|
Mod code and pane props have separate lifetimes. A pane's view is built from the mod files in `mods/` when the Herdr app starts or when the pane is created, so an edited mod reaches existing panes after an app restart or a closed-and-reopened pane. The props a pane was created with are stored in the Herdr core document and only a *new* pane from an extension that knows them can change them: a Pi process keeps the extension code it started with, so a pane it reopens still carries the older props until that Pi session is restarted or a new session opens the pane.
|