pi-better-harness 0.41.3 → 0.42.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 CHANGED
@@ -22,18 +22,22 @@ Use `pi-better-harness` when you want the full working set for Pi. It manages:
22
22
 
23
23
  In `/harness-settings`, **Outcome & Todo display** (`outcome-todo-display`)
24
24
  defaults to **On**, and **Outcome & Todo hooks** (`outcome-todo`) defaults to
25
- **Off**. Saved outcomes and checklists display even when hooks are off; missing
26
- state creates no placeholder, state, or settings. Turning display off does not
27
- disable hooks. Saved v1 `enabled` remains the hooks authority; the new optional
28
- display preference defaults to true.
25
+ **Off**. **Long-term work ledger** (`outcome-todo-ledger`) is a third independent
26
+ control and defaults to **Off**. Saved outcomes and checklists display even when
27
+ hooks are off; missing state creates no placeholder, state, or settings. Turning
28
+ display off does not disable hooks. Saved v1 `enabled` remains the hooks
29
+ authority; the optional display and ledger preferences default to their existing
30
+ or conservative values.
29
31
 
30
32
  The compact widget has one Todo heading, with a caret after Todo and the completion
31
33
  count on the left. A matching Goal's status and existing active-time clock appear
32
34
  on the right. The outcome is one muted, truncated subtitle. The collapsed view
33
35
  shows up to five relevant rows; the expanded view shows all rows. Click to toggle.
34
- `/todo` shows the full objective, acceptance criteria, boundaries, and plan;
35
- `/todo expand` and `/todo collapse` also control the compact checklist. Todo
36
- commands remain available with hooks off for explicit user control.
36
+ `/todo` reveals the compact Overview (when display is on) and returns it to automatic display;
37
+ `/todo expand` and `/todo collapse` control which rows it shows. The full
38
+ objective, acceptance criteria, boundaries, and plan remain available through
39
+ `get_todo` when hooks are enabled. Todo commands remain available with hooks off
40
+ for explicit user control.
37
41
 
38
42
  An accepted outcome can be saved without a checklist. Completing or clearing its
39
43
  Todo does not complete or remove the outcome. Write labels as short, plain actions,
@@ -55,6 +59,21 @@ Existing Plan session histories restore as Todo. Workflow task-plan files and
55
59
  revision checks stay unchanged; skills continue using their own records when the
56
60
  optional interface is off. See the [usage guide](docs/usage.md#outcome--todo).
57
61
 
62
+ The separate **Long-term work ledger** setting enables a durable project-scoped
63
+ record of the overall outcome, boundaries, and high-level items. It stays off by
64
+ default; turning it off removes ledger views and hints without deleting records.
65
+ The same `update_todo` / `get_todo` interface carries optional ledger payloads and
66
+ selectors for create, update, attach, detach, list, and read. Updates require the
67
+ current revision, preserve completed evidence and history, and never associate old
68
+ work with a new session automatically. Use `/ledger attach <id>` (or an explicit
69
+ `update_todo` ledger attach) to continue the same record; `/ledger list`,
70
+ `/ledger switch`, and `/ledger detach` manage the reference without copying it. A
71
+ resumed session keeps its reference, a fresh session stays unassociated, and
72
+ bounded recovery reminders after compaction or resume are rebuilt from durable
73
+ state. Workflow-owned rows keep their canonical stage/status rendering; the
74
+ ledger adds context, not a second execution model. See
75
+ [usage](docs/usage.md#associate-a-ledger-with-a-session).
76
+
58
77
  Subagent and background-task rows can be clicked to open their existing navigator
59
78
  details. Enter and keyboard controls remain available, and editor input stays
60
79
  passive. Harness packages do not write to Pi's status bar. Goal holds and resume
@@ -5,6 +5,8 @@ export interface CompactTaskHeader {
5
5
  subtitle?: string;
6
6
  disclosure?: string;
7
7
  runtime?: { status: string; clock?: string };
8
+ /** Preformatted high-level ledger counts shown in the existing Todo surface. */
9
+ ledger?: string;
8
10
  }
9
11
 
10
12
  export function canRenderTaskRuntime(width: number, runtime: CompactTaskHeader["runtime"]): boolean {
@@ -26,10 +28,16 @@ export function renderCompactTaskHeader(summary: string | undefined, width: numb
26
28
  ? title + " ".repeat(Math.max(2, size - visibleWidth(title) - rightWidth)) + right
27
29
  : truncateToWidth(left, size);
28
30
  const lines = [truncateToWidth(heading, size)];
31
+ const indent = Math.min(2, size - 1);
32
+ const details: string[] = [];
29
33
  if (header.subtitle) {
30
- const indent = Math.min(2, size - 1);
31
34
  const text = header.subtitle.replace(/[\r\n\t]+/g, " ").replace(/ {2,}/g, " ").trim();
32
- lines.push(" ".repeat(indent) + theme.fg("muted", truncateToWidth(text, size - indent)), "");
35
+ details.push(" ".repeat(indent) + theme.fg("muted", truncateToWidth(text, size - indent)));
33
36
  }
37
+ if (header.ledger) {
38
+ const text = header.ledger.replace(/[\r\n\t]+/g, " ").replace(/ {2,}/g, " ").trim();
39
+ details.push(" ".repeat(indent) + theme.fg("dim", truncateToWidth(text, size - indent)));
40
+ }
41
+ if (details.length > 0) lines.push(...details, "");
34
42
  return lines;
35
43
  }