pi-better-harness 0.46.0 → 0.46.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.46.1] - 2026-11-15
4
+
5
+ ### Fixed
6
+
7
+ - Preserve optional answer-file links and source provenance when saving workflow decisions through the Todo tool and atomic plan writer. Legacy decisions, revision checks, profiling and completion guards are unchanged. (#780)
8
+ - Keep Navigator detail paints free of provider I/O, retaining refreshed detail state between paints. (#781)
9
+
3
10
  ## [0.46.0] - 2026-11-15
4
11
 
5
12
  ### Added
@@ -91,6 +91,8 @@ const WorkflowUpdateSchema = Type.Object({
91
91
  humanWords: Type.String({ description: "The human's words, quoted or closely paraphrased." }),
92
92
  changes: Type.String({ description: "What the decision changes: units, validation, forbidden actions." }),
93
93
  supersedes: Type.Optional(Type.String({ description: "Id of the earlier decision this one replaces." })),
94
+ answers: Type.Optional(Type.Array(Type.String({ minLength: 1 }), { description: "Answer-file keys resolved by this decision, e.g. results/127-impl-1.json." })),
95
+ source: Type.Optional(Type.String({ minLength: 1, description: "Decision provenance, e.g. agent-recommendation." })),
94
96
  }, { description: "A human decision to record with this transition." })),
95
97
  profiling: Type.Optional(Type.Object({}, {
96
98
  additionalProperties: true,
@@ -21,6 +21,8 @@ export interface RushDecisionInput {
21
21
  humanWords: string;
22
22
  changes: string;
23
23
  supersedes?: string | undefined;
24
+ answers?: string[] | undefined;
25
+ source?: string | undefined;
24
26
  }
25
27
 
26
28
  export interface RushPlanUpdate {
@@ -378,6 +380,13 @@ function appendDecision(plan: Record<string, unknown>, decision: RushDecisionInp
378
380
  for (const field of ["humanWords", "changes"] as const) {
379
381
  if (typeof decision[field] !== "string" || !decision[field].trim()) throw new Error(`workflow.decision.${field} is required.`);
380
382
  }
383
+ if (decision.answers !== undefined && (!Array.isArray(decision.answers) ||
384
+ !decision.answers.every((answer) => typeof answer === "string" && answer.trim().length > 0))) {
385
+ throw new Error("workflow.decision.answers must be a list of non-empty answer-file keys.");
386
+ }
387
+ if (decision.source !== undefined && (typeof decision.source !== "string" || !decision.source.trim())) {
388
+ throw new Error("workflow.decision.source must be non-empty text.");
389
+ }
381
390
  const decisions = plan.decisions === undefined || plan.decisions === null ? [] : plan.decisions;
382
391
  if (!Array.isArray(decisions)) throw new Error("The saved plan's decisions field is not a list.");
383
392
  const known = new Set(decisions.flatMap((entry) => isRecord(entry) && typeof entry.id === "string" ? [entry.id] : []));
@@ -388,6 +397,8 @@ function appendDecision(plan: Record<string, unknown>, decision: RushDecisionInp
388
397
  decisions.push({
389
398
  id, timestamp: ts, humanWords: decision.humanWords, changes: decision.changes,
390
399
  supersedes: decision.supersedes ?? null,
400
+ ...(decision.answers === undefined ? {} : { answers: [...decision.answers] }),
401
+ ...(decision.source === undefined ? {} : { source: decision.source }),
391
402
  });
392
403
  plan.decisions = decisions;
393
404
  return id;
@@ -1030,9 +1030,9 @@ function createOverlayComponent(
1030
1030
  startDetailTimer();
1031
1031
  });
1032
1032
 
1033
- function refreshRows(): void {
1033
+ function refreshRows(rows = listRows()): void {
1034
1034
  const selectedId = state().mainListSelectedId ?? overlayState.rows[overlayState.selected]?.navigatorId;
1035
- overlayState.rows = listRows();
1035
+ overlayState.rows = rows;
1036
1036
  const nextIdx = selectedId ? overlayState.rows.findIndex((row) => row.navigatorId === selectedId) : -1;
1037
1037
  overlayState.selected = nextIdx >= 0 ? nextIdx : Math.min(overlayState.selected, Math.max(0, overlayState.rows.length - 1));
1038
1038
  }
@@ -1160,7 +1160,8 @@ function createOverlayComponent(
1160
1160
  return {
1161
1161
  render(width: number) {
1162
1162
  closeIfEditorReplaced();
1163
- refreshRows();
1163
+ // The main-list refresh owns provider I/O; streaming paints reuse its snapshot.
1164
+ refreshRows(state().mainListRows ?? []);
1164
1165
  const rail = buildMainListLayout(overlayState.rows, width, deps.truncate, fg, {
1165
1166
  selectedId: selectedRow()?.navigatorId,
1166
1167
  focused: true,
@@ -1030,9 +1030,9 @@ function createOverlayComponent(
1030
1030
  startDetailTimer();
1031
1031
  });
1032
1032
 
1033
- function refreshRows(): void {
1033
+ function refreshRows(rows = listRows()): void {
1034
1034
  const selectedId = state().mainListSelectedId ?? overlayState.rows[overlayState.selected]?.navigatorId;
1035
- overlayState.rows = listRows();
1035
+ overlayState.rows = rows;
1036
1036
  const nextIdx = selectedId ? overlayState.rows.findIndex((row) => row.navigatorId === selectedId) : -1;
1037
1037
  overlayState.selected = nextIdx >= 0 ? nextIdx : Math.min(overlayState.selected, Math.max(0, overlayState.rows.length - 1));
1038
1038
  }
@@ -1160,7 +1160,8 @@ function createOverlayComponent(
1160
1160
  return {
1161
1161
  render(width: number) {
1162
1162
  closeIfEditorReplaced();
1163
- refreshRows();
1163
+ // The main-list refresh owns provider I/O; streaming paints reuse its snapshot.
1164
+ refreshRows(state().mainListRows ?? []);
1164
1165
  const rail = buildMainListLayout(overlayState.rows, width, deps.truncate, fg, {
1165
1166
  selectedId: selectedRow()?.navigatorId,
1166
1167
  focused: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-better-harness",
3
- "version": "0.46.0",
3
+ "version": "0.46.1",
4
4
  "description": "Pi extension bundle for a write sandbox, subagents, background tasks, SSH, goals, model routing, and Outcome & Todo.",
5
5
  "license": "MIT",
6
6
  "type": "module",