pi-goal-list-loop-audit 0.39.69 → 0.41.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.
Files changed (42) hide show
  1. package/CHANGELOG.md +89 -0
  2. package/README.md +3 -1
  3. package/docs/DESIGN-long-running-supervision.md +38 -18
  4. package/docs/INDEX.md +1 -1
  5. package/docs/RECOVERY.md +16 -0
  6. package/docs/RUNTIME-INVENTORY.md +12 -12
  7. package/docs/SETTINGS.md +3 -1
  8. package/docs/UI-STATUS.md +2 -2
  9. package/extensions/card-sections.ts +117 -0
  10. package/extensions/completion-summary.ts +575 -148
  11. package/extensions/decision-auto-select.ts +252 -0
  12. package/extensions/finding-lead.ts +13 -1
  13. package/extensions/gate-receipts.ts +276 -0
  14. package/extensions/goal-commands.ts +162 -41
  15. package/extensions/goal-continuation.ts +31 -1
  16. package/extensions/goal-heartbeat.ts +105 -1
  17. package/extensions/goal-loop-auditor-process.ts +37 -9
  18. package/extensions/goal-loop-auditor.ts +10 -3
  19. package/extensions/goal-loop-core.ts +140 -1
  20. package/extensions/goal-loop-display.ts +41 -4
  21. package/extensions/goal-loop-shield.ts +235 -40
  22. package/extensions/goal-loop.ts +20 -4
  23. package/extensions/goal-settings.ts +29 -0
  24. package/extensions/human-handoff.ts +33 -14
  25. package/extensions/loops/goal-activation.ts +77 -9
  26. package/extensions/loops/goal-auditor-hooks.ts +18 -3
  27. package/extensions/loops/goal-orchestrator.ts +15 -2
  28. package/extensions/loops/goal-settings-ui.ts +24 -0
  29. package/extensions/loops/goal-tools.ts +98 -48
  30. package/extensions/loops/goal-ui.ts +5 -0
  31. package/extensions/loops/goal.ts +6 -2
  32. package/extensions/main-model-recovery.ts +6 -1
  33. package/extensions/quota-retry.ts +37 -1
  34. package/extensions/settings-menu.ts +9 -0
  35. package/extensions/summary-renderer.ts +77 -25
  36. package/extensions/ui-status.ts +8 -0
  37. package/package.json +1 -1
  38. package/prompts/goal-loop-continuation.md +2 -25
  39. package/schemas/goal.schema.json +41 -4
  40. package/scripts/auditor-round-prompts.d.mts +1 -0
  41. package/scripts/auditor-round-prompts.mjs +21 -1
  42. package/scripts/summary-readability-capture.ts +34 -7
package/CHANGELOG.md CHANGED
@@ -2,6 +2,95 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.41.0 — a completion card that restates the goal, and decision pauses that can answer themselves (2026-11-18)
6
+
7
+ ### The completion card reminds you what was asked, and rework turns stop resending the whole brief (2026-11-18)
8
+
9
+ Measured against the local record (the active ledger plus all retained segments: 2,091 continuation sends, 2,231 active-ledger events).
10
+
11
+ - **The card restates the goal.** A long autonomous goal ends hours after it was set, and the card never said what had been asked. The chat card now carries `Goal: <first sentence of the objective>` directly above the meta line, in one block (Markdown hard break). The archive is unchanged: it already opens with the full `## Objective`.
12
+ - **One meta line.** When no file list follows, the diff stat joins the meta line (`3h 00m elapsed · 1 audit · 14 files changed, +620 −88`) instead of sitting in its own block.
13
+ - **Sentence case.** Agent text written in lower case (`all six complaints are addressed`, `an in-dialog toggle is not possible`) read as fragments. The headline, finding leads, follow-ups and next steps now start with a capital. Only a plain lower-case leading word is touched; paths, commands and identifiers (`note.md`, `npm run …`, `handleClick`, `iOS`) keep their spelling.
14
+ - **No `· ·`.** A `path:line` pointer moved out of `… existed · path:line` left a bare separator that the join then doubled.
15
+ - **The second "Summary" heading reads as "What changed".** The prose lede above it already is the summary. This is display-only: durable content keeps `Summary`, so the collapsed projection and replayed receipts are unchanged.
16
+ - **A non-complete render never wears `Done`.** `buildTerminalApprovalRender` passed no headline kind, so a stopped goal rendered through it read `## Done — Work stopped`. Every production caller passes `complete` today; the headline now follows the status anyway.
17
+ - **Rework turns ride the marker.** `pendingTasks` (the auditor TODO list) forced a full ~28 KB continuation on *every* turn while rework was open: 160 of the 258 most recent full sends carried a TODO list the model had already been given. Delivery is now fingerprinted per goal, as the audit report already was. A new or edited list still goes full, and an unchanged one sends the 46-char marker. `session_compact` forgets both delivered fingerprints, because a compaction may summarize the brief away. The next send re-teaches it: one full brief per compaction instead of one per turn.
18
+ - **`context_hygiene_dropped` is de-duplicated.** The `context` hook runs once per provider request. While a host retried against a dead provider (402 plan exhausted, 429 token plan), GLLA ledgered the identical projection every 10–30 s: 1,114 of 2,231 active-ledger events. Identical repeats are now silent and counted (`suppressedRepeats` on the next change), matching `payload_guard_eviction`. The projection itself still runs on every request.
19
+ - `tests/context-checkpoint.test.ts` re-pinned: the expanded `HUMAN_HANDOFF_GUIDANCE` (already in Unreleased) adds 382 serialized bytes to the retained payload.
20
+ - Coverage: `tests/summary-human-reminder.test.ts`, `tests/delta-only-continuation.test.ts`, `tests/context-hygiene.test.ts`. Summary pins were migrated to the sentence-cased wording.
21
+
22
+ ### A decision pause can answer itself after a delay, so an odd question never parks the work forever (2026-11-18)
23
+
24
+ - **New setting `decisionAutoSelectMinutes` (off by default).** Turn it on in `/glla` → **Keep-going** → *Stuck-decision auto-select* (2 / 10 / 30 minutes). After that long with nobody answering, the RECOMMENDED decision option is adopted and the work continues. When it is unset, a decision pause waits for you forever — exactly as before.
25
+ - **Only a continue-work answer may be adopted.** `/goal resume`, `/list resume`, `/list next`, `/loop resume`, and a prose/content option the picker would steer to the agent are eligible. Cancel, accept-with-follow-ups, tweak, pause, stop/clear, wipe, any `/glla` action, and verification-contract amendments are NOT: those end or rewrite the work, so they keep waiting. An ineligible recommendation still reports once (`decision_auto_select_refused`) that your deadline passed and why it declined.
26
+ - **Both surfaces share one clock.** The `/goal decide` picker carries pi's own dialog countdown and adopts at expiry; a heartbeat backstop adopts the same pause when no dialog ever opened (headless rig, Decision popup off, an Escape, a restart mid-question). An Escape *before* the deadline leaves the pause alone — the adoption happens only when the durable clock says the delay elapsed.
27
+ - **The clock measures the pause EPISODE.** A new `pauseDecidedAt` stamp is written when a pause lands; later goal writes (counter bumps, history appends) do not restart the fuse, so an active goal cannot push its own question out of reach.
28
+ - **The adoption is an assumption, not a silent choice.** It is ledgered (`decision_auto_select_adopted` with the waited time and the option) and recorded on the goal's `autoDefaultLog`, which is what the agent carries into the completion recap. The widget card also states it plainly: `auto-answers with option N in Xm unless you decide first`.
29
+ - **Your own holds still win.** `/glla pause` and the automatic load hold freeze the clock exactly as they freeze every other automatic dispatch, and a stale/handed-off host never consumes a pause it cannot resume.
30
+ - Coverage: `tests/decision-auto-select.test.ts`.
31
+
32
+ ## 0.40.1 — status cards and an honest "waiting for the conversation" state (2026-11-13)
33
+
34
+ ### Status cards: one place for the version, and an honest "waiting for the conversation" state (2026-11-13)
35
+
36
+ - **The version always folds onto the card's final row.** It folded only when that row already read `└─`; a card whose last row was still `├─` (the closer is fixed up afterwards) got a separate `└─ v0.40.0` row instead, so the same fact sat in two different places on two cards. Any final tree row now takes it.
37
+ - **A compact card trimmed to its row budget keeps the version.** The fold rode the closer that the trim then dropped, leaving `└─ more: /glla status` with no version; the footer now re-attaches any folded fact (version, supervisor pause, queue depth) no kept row still shows.
38
+ - **A fresh pi with no conversation loaded says so.** GLLA deliberately waits for the transcript before resuming, and the notice said exactly that — but the card under it projected the previous session's state: `EXECUTION UNCONFIRMED`, the durable-vs-defer plaques of a decision already made, and `next: /glla status to inspect execution`. The status projection now has a `loadPending` input: the card reads `BLOCKED`, `next: Load or resume the conversation in pi, or run /glla resume`, `why: Waiting for pi to load the conversation`. Because that is a user action, the compact card hides the plaques (existing rule), and the paused-lifecycle row no longer offers a competing `next: retry scheduled (unconfirmed)` for a retry that cannot run until the conversation loads.
39
+ - Coverage: `tests/status-card-consistency.test.ts`.
40
+
41
+ ## 0.40.0 — completion reports, faster audits, and leaner prompts (2026-11-13)
42
+
43
+ ### Second re-audit: honest turn counts, stopped-goal cards, observed gate runs, leaner prompts (2026-11-13)
44
+
45
+ Measured against the local record (1,740 continuation sends, 483 audit verdicts, the 40 most recent archives, the registered tool definitions).
46
+
47
+ - **Turns count model turns.** Turn telemetry incremented on `agent_end` — once per whole agent run — and a continuation queued into a running agent never ends that run: 11 of 14 archived records said "0 turns" beside 15–283 bash calls. It now counts on `turn_end`. The light-audit ceiling (150 turns) and `/glla stats` both mean model turns, so expect more full-tier audits on long goals.
48
+ - **A goal that stops without a claim gets a real card.** The recorded-facts recap never said why the goal stopped, called an aborted goal "completed without a recorded completion review", listed absolute paths behind "file-write signal(s)", and offered "review the durable record" as the only next step. It now leads with the cause in plain words (`Aborted — The model's plan or quota ran out`), names the change set as a diff stat since the goal started with repo-relative files, says how many tasks were done and which is next, and gives one action that moves it forward (restore model access, or nothing — it stopped on request). The machine counters stay in the verbatim machine record, the receipt line says "stopped before completion; no completion review" once, and legacy recaps are still recognized on replay.
49
+ - **The executor's own gate run can stand in for the pre-audit re-run.** The executor usually runs the contract gate right before claiming, and the pre-audit then ran it again (about 14 minutes here). Pi's bash tool result carries the exit code and wall time in `structuredContent`; when the command is *exactly* a contract step (a pipeline hides the real exit code and never counts; a step with its own `cd` is left to the pre-audit) and it exited 0, GLLA records an observed receipt fenced to the working-tree fingerprint (`Goal.observedGateReceipts`, ledger `gate_receipt_observed`). If every contract step is covered for the identical tree when the claim arrives, the pre-audit reuses them (`gate_receipts_reused_observed`); any edit since falls through to the normal re-run. The brief and the card say "observed" (`PASS: GLLA saw it pass — exit 0 in 14m02s`), never "ran".
50
+ - **The tree fingerprint ignores `.pi-glla/`.** GLLA's own runtime state changes on every event; in a project that does not gitignore it, every receipt went stale within seconds.
51
+ - **The continuation template is 3.8 KB smaller and no longer contradicts the card.** Its completion-communication section still said gate tables are archive-only and that chat shows verification only after `showVerification` — the opposite of the shipped report card. It is now a short paragraph pointing at `complete_goal`'s REPORT SHAPE. The commit-rewrite section is generic: no single operator's daemon name or config keys ship to every rig. Each full continuation is about 950 tokens lighter.
52
+ - **Leaner tool definitions on every request.** `complete_goal`'s schema dropped version stamps, document pointers and implementation notes (8.1k → 5.1k characters) while keeping every rule, and the seven project-builder tools are active only while a `/loop respec` build runs (each answered "No active respec project builder" otherwise) — about 1.6k fewer tokens per request in total. An explicit per-tool `allow` override still wins.
53
+ - **The card names the changed files when the claim has no area groups.** Only 5 of the 40 most recent claims supplied `findingGroups`; without them the card now lists the five largest changed files under the change line. With groups, the areas say what changed and the list is omitted.
54
+ - Coverage: `tests/reaudit-round2.test.ts`; `tests/context-checkpoint.test.ts` and `tests/prompt-daemon-investigation.test.ts` re-pinned to the smaller template.
55
+
56
+ ### The final audit stops re-running gates GLLA already ran, and the card reads like a report (2026-11-12)
57
+
58
+ Measured against the local record of 483 audit verdicts and 257 tier decisions: median audit 4.1 min, p90 22 min, audits that ended in an error a median 25 min. 282 of 483 reports re-ran a full-suite command (164 named `npm run release:check`), and the most common audit error was an approval refused because that re-run was cancelled at the 300 s per-tool budget. Only 18 of 257 tier decisions were light.
59
+
60
+ - **Gate receipts.** The deterministic pre-audit already ran every mechanical contract command before the auditor started, and a *passing* run was discarded. `runMechanicalPreAuditChecks` now returns one receipt per passing step (command, exit 0, wall time, bounded output tail, cwd, retry flag). The receipts ride the claim (`pendingCompletion.gateReceipts`, sanitized and capped at the state boundary), fenced to a working-tree content fingerprint (`gateTreeFingerprint`: `git write-tree` over a throwaway index seeded from the real one, so the user's index is never touched and auto-commits of the same bytes do not invalidate it). A stored-claim retry reuses them only while the tree is byte-identical. New leaf module `extensions/gate-receipts.ts`.
61
+ - **The auditor quotes receipts instead of re-running them.** The brief carries an escaped `<gate_receipts>` block and says not to re-run those commands or the full suite; the regression shield accepts a receipt for the contract item that names its command (an `<evidence>` block is still required, and prose items still need the auditor's own evidence).
62
+ - **The challenge round is bounded on first rounds too.** The rework-only "do not re-run the full suite" rule now has a first-round counterpart (`FIRST_ROUND_CHALLENGE_SCOPE_RULES`): falsify the first-pass report's cited claims with the narrowest check, never re-run a receipt. This is where audits stalled on a full-suite call past the budget.
63
+ - **Independent read-only checks may run together.** The brief no longer asks for "one tool call at a time" — that line guarded output length, not tool parallelism. Long or heavy commands still run one at a time.
64
+ - **The per-tool budget is never below a gate GLLA watched take longer** (1.5× the longest receipt, bounded by the existing ceiling) on both dispatch paths.
65
+ - **Light-tier audits are reachable again.** The high-stakes scan ignores code spans, fenced blocks, `npm|bun|… run <script>` and `script:name` tokens, so a contract that names its own `release:check` gate is no longer "release" language; real deploy/publish objectives still escalate. Ceilings move from 12 writes / 20 bash / 80 turns to 25 / 60 / 150; the 10% spot-check still calibrates them.
66
+ - **A spent plan under a 429 is an account wall.** `Token Plan usage limit reached: Upgrade your Token Plan or purchase Credits` was retried once a minute against the same dead model (16 attempts in 13 minutes, then 45 idle minutes until a person switched model). "Upgrade your plan / purchase credits" with **no** reset or retry-after hint now classifies `plan-quota` (an account quota wall, not request rate): a supervised goal rotates to a permitted backup promptly as quota-class walls do (`billing` would first spend the same-model retry budget on a plan that cannot heal), it never enters the eager 5 s window, and the unsupervised lane refuses with one "switch model or top up" notice instead of retrying the same model. A message that also names a reset stays a rate limit; concurrency walls keep their own lane.
67
+ - **The card shows what GLLA ran.** A receipt backs the agent's gate row for the same command (`PASS: GLLA ran it — exit 0 in 14m02s · <notes>`) or adds its own `Contract gate` row; status for those rows comes from the receipt, not from parsing the agent's notes.
68
+ - **"N files changed, +A −R" since the goal started.** Goals record `startTree` (the same content snapshot) at creation; the card shows a one-line diff stat under the lede and the archive's repository section lists the largest changes. `git status` alone read "clean" seconds after every edit in an auto-committing repo.
69
+ - **Section spacing reads the right way round.** Each card block is its own Markdown component and Pi trims a component's trailing blank, so there was a gap under every heading and none between sections. The renderer now separates blocks with one blank row, and a `What changed · <area>` label displays as the bold area name directly above its bullets (durable content, the collapsed projection and the archive keep the full label).
70
+ - **A trailing `path:line` no longer strands its preposition** ("…an audit log for · path"): when the pointer ended the sentence, the dangling `for/in/at/see/…` is dropped with it; mid-sentence pointers and plain prose are untouched.
71
+ - **A clean tree no longer reads "Tree state unreadable".** `buildFinalRepoStateLines` collapsed empty `git status` output into the failure value, so the "Tree clean" branch was unreachable.
72
+ - Coverage: `tests/gate-receipts.test.ts`, `tests/report-polish.test.ts`.
73
+
74
+ ### The completion summary is an end-of-task report, not an audit log (2026-11-11)
75
+
76
+ - Operator report: "i am not loving the goal completion summary, that should be more like how opencode does the summary upon task completion." The card had grown one section per internal contract — `Summary`, `What Changed`, `Remaining`, `Verification Evidence`, `Next`, `Final Repository State` — opened with a verdict banner above a second request-echo headline, and closed with four `•` trailer bullets that restated the verdict three times in three voices. A finished goal read as audit bookkeeping attached to a report.
77
+
78
+ - **One report replaces the section stack.** The card is now `## Done — <result>` headline, prose lede (the rest of the Outcome sentence), `## Summary` carrying the structured Outcome body and one `What changed · <area>` subsection per `findingGroups` entry, `## Verification`, `## Follow-up items` (`Unresolved` plus the deliberate `leftOut`, with a resolving action inline as `→ Next:`), `## Next steps`, the archive-only `Final Repository State`, and ONE closing receipt line (`completion audit approved (N reviews) · record: <path>`). The full report order is what the operator confirmed during drafting.
79
+
80
+ - **The headline is a title, never a truncation.** The first clause (em-dash break, sentence end, or the last clause break that fits) becomes the headline and the remainder becomes the lede with only its first letter capitalized — no ellipsis, no dropped words, no second headline echoing the objective.
81
+
82
+ - **The gate inventory is part of the report.** Verification used to be archive-only unless the agent passed `showVerification` after an explicit user request; the reading a person actually got said nothing about what was checked. Chat now renders the compact `Gate | Command | Result` shape and the archive keeps the wide `Quality Gate | Command | Scope | Status | Notes` inventory with its review row. Status stays DERIVED from the notes: `PASS` only on a complete pass parse with zero failures, `FAIL` on any failure evidence, otherwise the row keeps its honest wording instead of borrowing a status word.
83
+
84
+ - **Narrow terminals get bullets, not broken pipes.** Pi prints a Markdown table's raw pipe rows when the width cannot fit it. Below the table threshold the verification section renders `- <gate> — <command> — <result>` bullets instead, and the capture script now fails if a narrow capture contains a raw pipe row.
85
+
86
+ - **Every goal-event receipt adopts the vocabulary** — detached-auditor approval, no-audit / user-choice completion, aborted and paused archives, and renders replayed from the durable outbox. An audit entry with no verdict (provider wall, auth abort) still never reads as a reviewed completion.
87
+
88
+ - **One leaf module owns the section names.** `extensions/card-sections.ts` (no imports) feeds the composer, the collapsed receipt projection and the terminal renderer; putting the vocabulary in `completion-summary.ts` would have closed the cycle `human-handoff → completion-summary → goal-loop-display → human-handoff`. Legacy names (`What Changed`, `Remaining`, `Next`, `Verification Evidence`) stay recognized forever, so a receipt queued by an older build still collapses, colors and keeps its review qualification and record link; its durable text is never rewritten.
89
+
90
+ - **The claim guidance asks for the report's material.** `complete_goal`'s description and the shared human-handoff guidance now ask for a plain-sentence Outcome, per-area `findingGroups`, and the real `gateRows` with counts, instead of a compact recap whose shape the renderer had to rescue.
91
+
92
+ - Coverage moved with the shape rather than away from it: the migrated pins keep their original subjects (evidence tokens and derived status, pipe escaping, review qualifications and record links, stale-Next filtering, sanitize bounds, narrow-width fit, no ANSI or control bytes) in the new vocabulary, and `tests/report-card-shape.test.ts` pins the report order, the always-on inventory, the narrow fallback, the legacy replay path and the leaf module's acyclic position. Captures under `audit/summary-captures/` were regenerated from the production renderer at 40 and 120 columns in dark and light.
93
+
5
94
  ## 0.39.69 — the audit lane waits for a quoted reset, uses a fallback, and stops when it stops progressing (2026-11-10)
6
95
 
7
96
  ### "If the model runs out then the audit never completes"
package/README.md CHANGED
@@ -272,6 +272,8 @@ with:
272
272
  - **Auditor model and thinking level:** choose a verifier that can handle the contract.
273
273
  - **Fallback models:** choose providers you can actually authenticate and afford.
274
274
  - **Auto-resume:** decide whether loaded work may restart automatically.
275
+ - **Stuck-decision auto-select:** decide how long a decision may sit before its
276
+ recommended continue-work answer is adopted for you (off by default).
275
277
  - **State root:** choose where durable work belongs.
276
278
  - **Retry and audit limits:** keep failure recovery bounded.
277
279
  - **Notifications:** decide how you want to hear about decisions and results.
@@ -285,7 +287,7 @@ different default. Sections:
285
287
 
286
288
  | Section | Example rows |
287
289
  |---|---|
288
- | Keep-going | auto-resume, decision popup, carryover policy, decision-pause budget, auto-accept drafts, aggressive mode, vision assist |
290
+ | Keep-going | auto-resume, decision popup, stuck-decision auto-select, carryover policy, decision-pause budget, auto-accept drafts, aggressive mode, vision assist |
289
291
  | Main agent | main-agent model, fallback models, fallback thinking levels, retry minutes, same-model retry budget, primary-probe minutes |
290
292
  | Drafter | drafting model used to interview an objective before it activates |
291
293
  | Compactor | compaction token target, compactor agent and its fallback models |
@@ -119,28 +119,48 @@ Executors should supply a full objective-level recap on each corrected claim,
119
119
  not depend on a rejected predecessor to fill in omitted work.
120
120
  The human layer follows two different purposes:
121
121
 
122
- - Chat and transcript explain **what happened**: outcome first, then a
123
- change-first `What Changed` account grouped by area, followed by material
124
- `Remaining` limitations and one concrete `Next` action. Tests, verification,
125
- gate tables, commands, hashes, and machine evidence stay out of the default
126
- user view. If the user explicitly asks for verification, the terminal render
127
- may add one compact `Verification` sentence; the archive always retains the
128
- complete evidence. The default terminal view previews structured results
129
- and a few primary changes; expansion retains the complete saved message.
130
- Required actions, Remaining limitations, review qualifications and the saved
131
- record link are not lost to that preview. Evidence-only recap fields are
132
- not reclassified as changes. Legacy incomplete recaps may supply useful
133
- human fields, but a missing result stays explicitly missing: telemetry is
134
- not a substitute for an explanation.
122
+ - Chat, transcript and archive all read as **one end-of-task report**
123
+ (field 2026-11-11 — "more like opencode's end-of-task summary"):
124
+ `## Done — <result>` headline, a prose lede carrying the rest of the
125
+ `Outcome` sentence, `## Summary` with the structured Outcome body and one
126
+ `What changed · <area>` subsection per `findingGroups` entry, an
127
+ always-visible `## Verification` gate inventory (chat compact
128
+ `Gate | Command | Result`, archive wide
129
+ `Quality Gate | Command | Scope | Status | Notes` plus its review row),
130
+ `## Follow-up items` (`Unresolved` and the deliberate `leftOut`, with a
131
+ resolving action inline as `→ Next:`), `## Next steps` (standalone actions),
132
+ the archive-only `Final Repository State`, and ONE closing receipt line
133
+ (`completion audit approved (N reviews) · record: <path>`).
134
+ Status words in the inventory are derived from the gate notes, never claimed:
135
+ `PASS` only on a complete pass parse with zero failures, `FAIL` on any
136
+ failure evidence, otherwise the row keeps its honest `REPORTED` shape.
137
+ - Chat headings are depth 2 (the Pi TUI renders them without the `##`
138
+ prefix); the archived markdown keeps `###`/`####`. Below the narrow-table
139
+ threshold the chat verification section renders as
140
+ `- <gate> — <command> — <result>` bullets, because Pi prints a Markdown
141
+ table's raw pipe rows when the width cannot fit it.
142
+ - The section vocabulary lives in one leaf module (`extensions/card-sections.ts`)
143
+ consumed by the composer, the collapsed receipt projection and the terminal
144
+ renderer. Legacy section names (`What Changed`, `Remaining`, `Next`,
145
+ `Verification Evidence`) stay recognized so a receipt queued by an older
146
+ build still collapses, colors, and keeps its review qualification and record
147
+ link; their durable text is never rewritten.
148
+ - The default terminal view previews structured results and a few primary
149
+ changes; expansion retains the complete saved message. Required actions,
150
+ follow-up limitations, review qualifications and the saved record link are
151
+ not lost to that preview. Evidence-only recap fields are not reclassified as
152
+ changes. Legacy incomplete recaps may supply useful human fields, but a
153
+ missing result stays explicitly missing: telemetry is not a substitute for
154
+ an explanation.
135
155
  - The archive's `## Terminal summary` remains forensic and complete: detailed
136
156
  findings grouped or tabulated at 4+ groups, per-finding proof, the full
137
- Verification Summary table (Quality Gate | Command | Scope | Status | Notes
138
- when supplied), and Final Repository State.
157
+ Verification table (Quality Gate | Command | Scope | Status | Notes when
158
+ supplied), and Final Repository State.
139
159
 
140
160
  Both surfaces retain the independent completion review and access to the full
141
- six-label machine recap in the saved record. A lone approval may be promoted
142
- to the chat headline because it is a durable review fact, not because tests
143
- passed. Goal-approval external notifications use the short human outcome,
161
+ six-label machine recap in the saved record. The verdict is stated once, in
162
+ that closing receipt line, rather than as an archive banner above a second
163
+ headline. Goal-approval external notifications use the short human outcome,
144
164
  not telemetry or a projection of every machine label.
145
165
  Every terminal goal notification, including version-bearing already-shipped
146
166
  claims and explicit cancellation, carries the change-first human view or the
package/docs/INDEX.md CHANGED
@@ -34,7 +34,7 @@
34
34
  ## Versions and shipped content
35
35
 
36
36
  [CHANGELOG.md](../CHANGELOG.md) records the full release history from
37
- v0.1.0-alpha.1 (2026-07-19) through v0.39.69 (2026-11-10), including an audit
37
+ v0.1.0-alpha.1 (2026-07-19) through v0.41.0 (2026-11-18), including an audit
38
38
  lane that waits for the provider's quoted reset (even a weekly one) instead of
39
39
  re-arming a five-minute timer, uses a configured fallback model instead of
40
40
  re-walking the failed one, and stops to ask after six hours without a verdict
package/docs/RECOVERY.md CHANGED
@@ -79,6 +79,22 @@ use a genuine pause for decisions, user holds or manual-action blockers. Unknown
79
79
  worker ids are rejected. Legacy saved standby records have no provable ownership:
80
80
  GLLA requests an assessment once eligible, rather than promising automatic wake.
81
81
 
82
+ **A decision pause can carry a clock of its own.** With
83
+ `decisionAutoSelectMinutes` set (`/glla` → **Keep-going** → *Stuck-decision
84
+ auto-select*), a decision that sits unanswered that long adopts its RECOMMENDED
85
+ **continue-work** answer and the work continues. Only `/goal resume`,
86
+ `/list resume`, `/list next`, `/loop resume`, and the content choice the picker
87
+ would steer to the agent are eligible — cancel, accept-with-follow-ups, tweak,
88
+ pause, stop/clear, wipe, any `/glla` action and verification-contract
89
+ amendments keep waiting for you, and name once why they did
90
+ (`decision_auto_select_refused`). The adoption is ledgered
91
+ (`decision_auto_select_adopted`), stamped into the goal's `autoDefaultLog`, and
92
+ shown on the card as `auto-answers with option N in Xm unless you decide
93
+ first`, so it reaches the completion recap as an assumption rather than a
94
+ silent choice. Unset (the default) keeps every decision paused indefinitely;
95
+ `/glla pause` and the load hold freeze the clock like every other automatic
96
+ dispatch.
97
+
82
98
  Use `/goal status`, `/list show`, or `/loop status` to inspect the checkpoint.
83
99
  On reload, GLLA reads only the saved identity-matching public status artifacts;
84
100
  completed, failed, stopped or missing results are assessed without discarding
@@ -2,9 +2,9 @@
2
2
 
3
3
  Generated by `node scripts/generate-inventory.mjs`. Run with `--check` to detect drift. Counts describe files and literal registrations, not executed coverage.
4
4
 
5
- - Extension/script files: 152
6
- - Extension/script lines: 79089
7
- - Top-level test files: 492
5
+ - Extension/script files: 155
6
+ - Extension/script lines: 81237
7
+ - Top-level test files: 501
8
8
  - Ambient bridge names: 176 (audit baseline: 176)
9
9
  - Commands: `/glla`, `/goal`, `/list`, `/loop`, `/review`
10
10
  - Tools: `audit_project_increment`, `block_project_requirement`, `claim_project_task`, `complete_goal`, `complete_task`, `list_activate`, `list_add`, `list_status`, `pause_goal`, `plan_project_increment`, `propose_goal_draft`, `propose_loop_draft`, `propose_loop_refine`, `propose_project_refinement`, `propose_project_requirements`, `propose_task_list`, `propose_tweak`, `record_goal_judgment`, `resume_goal`, `unblock_project_requirement`, `update_task_batch`, `update_task_status`, `wait_for_background`
@@ -13,15 +13,15 @@ Generated by `node scripts/generate-inventory.mjs`. Run with `--check` to detect
13
13
 
14
14
  | Module | Lines |
15
15
  |---|---:|
16
- | [extensions/goal-loop-core.ts](../extensions/goal-loop-core.ts) | 5906 |
17
- | [extensions/loops/goal-tools.ts](../extensions/loops/goal-tools.ts) | 4821 |
18
- | [extensions/loops/goal-activation.ts](../extensions/loops/goal-activation.ts) | 4202 |
19
- | [extensions/goal-commands.ts](../extensions/goal-commands.ts) | 3975 |
20
- | [extensions/goal-loop-display.ts](../extensions/goal-loop-display.ts) | 3733 |
21
- | [extensions/goal-loop-auditor-process.ts](../extensions/goal-loop-auditor-process.ts) | 3204 |
22
- | [extensions/loops/goal-auditor-hooks.ts](../extensions/loops/goal-auditor-hooks.ts) | 3121 |
23
- | [extensions/loops/goal-settings-ui.ts](../extensions/loops/goal-settings-ui.ts) | 2329 |
16
+ | [extensions/goal-loop-core.ts](../extensions/goal-loop-core.ts) | 6045 |
17
+ | [extensions/loops/goal-tools.ts](../extensions/loops/goal-tools.ts) | 4871 |
18
+ | [extensions/loops/goal-activation.ts](../extensions/loops/goal-activation.ts) | 4270 |
19
+ | [extensions/goal-commands.ts](../extensions/goal-commands.ts) | 4096 |
20
+ | [extensions/goal-loop-display.ts](../extensions/goal-loop-display.ts) | 3770 |
21
+ | [extensions/goal-loop-auditor-process.ts](../extensions/goal-loop-auditor-process.ts) | 3232 |
22
+ | [extensions/loops/goal-auditor-hooks.ts](../extensions/loops/goal-auditor-hooks.ts) | 3136 |
23
+ | [extensions/loops/goal-settings-ui.ts](../extensions/loops/goal-settings-ui.ts) | 2353 |
24
24
  | [extensions/goal-recovery.ts](../extensions/goal-recovery.ts) | 2327 |
25
- | [extensions/goal-continuation.ts](../extensions/goal-continuation.ts) | 2207 |
25
+ | [extensions/goal-continuation.ts](../extensions/goal-continuation.ts) | 2237 |
26
26
 
27
27
  Settings are defined in [SETTINGS.md](SETTINGS.md); supported host versions and process limits are defined in [COMPATIBILITY.md](COMPATIBILITY.md).
package/docs/SETTINGS.md CHANGED
@@ -69,7 +69,8 @@ copies are ignored (GLLA reads the global file for these policies):
69
69
  `compactionTokenThreshold`,
70
70
  `auditorModel`, `auditorModelFallbacks`, `auditorToolTimeoutMs`, `auditorStallMs`,
71
71
  `auditJobRetentionMs`, `auditSpotCheckRate`, `auditorStrictChallenge`, `auditorInspection`,
72
- `autoAcceptDrafts`, `versionDisplay`, `auditorThinkingLevel`.
72
+ `autoAcceptDrafts`, `versionDisplay`, `auditorThinkingLevel`,
73
+ `decisionAutoSelectMinutes`.
73
74
 
74
75
  This list is `GLOBAL_ONLY_KEYS` in `extensions/goal-settings.ts`, and a
75
76
  project-scope write to any of them is stripped on read. Every other key —
@@ -146,6 +147,7 @@ This authority boundary applies before settings-value normalization.
146
147
  | `wedgeAlertMinutes` | unset (30, or off while aggressive mode is on — the default) | Busy-but-silent minutes before the wedge alert; `0` = off. The menu shows the effective value. |
147
148
  | `autoResume` | `false` | Restored goals/loops/lists auto-resume in fresh sessions. Global-only. |
148
149
  | `decisionPopup` | `true` | Decision pauses pop the picker (`false` = widget card only). |
150
+ | `decisionAutoSelectMinutes` | unset (off) | The stuck-question clock: minutes a decision pause may sit before its RECOMMENDED **continue-work** answer is adopted automatically (`/goal resume`, `/list resume`, `/list next`, `/loop resume`, or the content the picker would steer to the agent). Cancel, accept-with-follow-ups, tweak, pause, stop/clear, wipe and verification-contract amendments are never adopted — they end or rewrite the work, so they keep waiting for you. The adoption is ledgered (`decision_auto_select_adopted`) and recorded on the goal's `autoDefaultLog` so the agent carries it into the recap as an assumption. Both the `/goal decide` picker countdown and a heartbeat backstop honour it, so a popup that never opened still unsticks. Global-only. |
149
151
  | `decisionPauseBudget` | unset (unlimited) | Budget for unattended decline of promoted suggestions: after N admitted decisions, proceed without executing the suggestion and record the declined command in `autoDefaultLog` and `decision_budget_auto_default` (or `run_to_done_auto_default` for run-to-done). `0` permits that safe decline immediately. It never supplies consent or waives criteria: classified material exceptions remain paused; unclassified human decisions require local classification; known authorized mechanical/reversible work continues without a decision. Run-to-done follows the same consent boundary. |
150
152
  | `carryover` | `"pause"` | Stale carryover on new activation: `"pause"` / `"clear"` / `"resume"`. |
151
153
  | `autoAcceptDrafts` | `false` | Drafts activate without the Confirm dialog (unattended rigs). |
package/docs/UI-STATUS.md CHANGED
@@ -44,7 +44,7 @@ See [external-check recovery](RECOVERY.md#checking-authorized-external-work) and
44
44
  - `extensions/goal-loop-display.ts`: compact/detailed cards and footer, including project-builder branch.
45
45
  - `extensions/loops/goal-ui.ts`: production compact-card caller, runtime evidence adapter and notifications.
46
46
  - `extensions/goal-commands.ts`: goal/glla shared status projection and on-demand read-only fleet command integration.
47
- - `extensions/completion-summary.ts`: concise chat projection versus complete durable archive.
47
+ - `extensions/completion-summary.ts`: the end-of-task report card (headline, prose lede, per-area `What changed` subsections, always-on verification, follow-ups, next steps, one receipt line) versus the complete durable archive. Section vocabulary is shared through the leaf module `extensions/card-sections.ts`, which also owns the narrow-width table-to-bullet fallback.
48
48
  - `extensions/goal-recovery.ts`: recovery evidence and ownership fencing; preserve retry policy and permission gates.
49
49
 
50
50
  ## Glance contract
@@ -89,6 +89,6 @@ Surfaces: all modes, compact and detailed cards, footer, status, notifications,
89
89
 
90
90
  Fleet: configured-root limits, symlinks, malformed and oversized journals, partial results, closed versus unconfirmed sessions, immutable sibling artifacts and zero dispatch.
91
91
 
92
- Summary: outcome-first grouped changes, one instance of each limitation, one next action, full archive evidence and truthful audit/challenge caveats.
92
+ Summary: the completion report opens with a short result headline over its prose lede, groups the changes by work area, always states the derived verification inventory (bullets when the width cannot hold the table), carries one instance of each limitation and one next action, and closes with a single receipt line; the archive keeps the wide evidence and truthful audit/challenge caveats.
93
93
 
94
94
  Captures: reproducible actual terminal renderer output for running, quota recovery, workflow rejection, user-blocked, dormant/unconfirmed audit, settling and completed summary at narrow/wide widths. See [native capture inspection](https://github.com/DraconDev/pi-goal-list-loop-audit/blob/main/audit/UI-CAPTURE-INSPECTION.md) for reproduction commands, real private-xterm screenshots and the disposition of the user's older/newer style comparison. These fixtures demonstrate production rendering, not live session execution; final integration gates remain open in the implementation register.
@@ -0,0 +1,117 @@
1
+ // pi-goal-list-loop-audit — the end-of-task report vocabulary.
2
+ //
3
+ // Field 2026-11-11 ("i am not loving the goal completion summary, that should
4
+ // be more like how opencode does the summary upon task completion"): the card
5
+ // grew one section per internal contract (Summary / What Changed / Remaining /
6
+ // Verification Evidence / Next / Final Repository State) and closed with four
7
+ // `•` trailer bullets, so a finished goal read as an audit log rather than a
8
+ // report of what was done.
9
+ //
10
+ // The section names live here, in a LEAF module with no imports, because every
11
+ // surface that has to agree about them already sits on a different branch of
12
+ // the import graph: the composer (extensions/completion-summary.ts), the
13
+ // collapsed chat receipt (extensions/human-handoff.ts, which
14
+ // goal-loop-display.ts already imports) and the terminal renderer
15
+ // (extensions/summary-renderer.ts). Putting them in completion-summary.ts
16
+ // instead would close the cycle
17
+ // human-handoff → completion-summary → goal-loop-display → human-handoff,
18
+ // which breaks at module init.
19
+
20
+ /** Section headings the report card composes. `<name> · <area>` is the
21
+ * grouped-change shape used for multi-area work. */
22
+ export const CARD_SECTION = {
23
+ summary: "Summary",
24
+ whatChanged: "What changed",
25
+ verification: "Verification",
26
+ followUp: "Follow-up items",
27
+ nextSteps: "Next steps",
28
+ repo: "Final Repository State",
29
+ } as const;
30
+
31
+ /** Section names that must stay recognized after an upgrade: a terminal
32
+ * render queued by an older build lives in the durable outbox and may be
33
+ * replayed months later. Its text is never rewritten, so the recognizer
34
+ * accepts both vocabularies forever. */
35
+ export const LEGACY_CARD_SECTIONS = [
36
+ "What Changed",
37
+ "Remaining",
38
+ "Next",
39
+ "Verification Evidence",
40
+ "Verification Summary",
41
+ ] as const;
42
+
43
+ /** The pre-report chat trailer shape (`• completion audit approved …`,
44
+ * `• record: …`). A receipt persisted by an older build collapses and colors
45
+ * on those lines too, so the collapsed projection can still tell them apart
46
+ * from body prose. */
47
+ export const LEGACY_TRAILER_PREFIX = "\u2022 " as const;
48
+
49
+ /** Width at which the Markdown gate table is abandoned for bullets. Pi's
50
+ * Markdown renders a table only when the border overhead (3n + 1 for n
51
+ * columns) leaves room for one character per cell; below this a three-column
52
+ * table prints its raw pipe rows instead, which reads as broken output. */
53
+ export const NARROW_TABLE_COLUMNS = 50;
54
+
55
+ const KNOWN_SECTIONS: readonly string[] = [...Object.values(CARD_SECTION), ...LEGACY_CARD_SECTIONS];
56
+
57
+ /** The canonical section a heading belongs to, or null when the heading is
58
+ * authored prose rather than a card section. Accepts `###` prefixes, bold
59
+ * wrappers and the `· <area>` suffix the grouped shape adds. */
60
+ export function cardSectionName(heading: string): string | null {
61
+ const bare = heading
62
+ .replace(/^\s*#{1,6}\s+/, "")
63
+ .replace(/^\*\*(.*?)\*\*$/, "$1");
64
+ const name = bare.split(/\s*\u00b7\s*/)[0]?.trim() ?? "";
65
+ const canonical = CANONICAL_ALIASES[name];
66
+ if (canonical) return canonical;
67
+ return KNOWN_SECTIONS.includes(name) ? name : null;
68
+ }
69
+
70
+ /** Legacy names map onto the section they now stand for, so one recognizer
71
+ * answers for both vocabularies (e.g. a queued `Remaining` block still reads
72
+ * as the follow-up section it became). */
73
+ const CANONICAL_ALIASES: Record<string, string> = {
74
+ "What Changed": CARD_SECTION.whatChanged,
75
+ Remaining: CARD_SECTION.followUp,
76
+ Next: CARD_SECTION.nextSteps,
77
+ "Verification Evidence": CARD_SECTION.verification,
78
+ "Verification Summary": CARD_SECTION.verification,
79
+ };
80
+
81
+ /** Turn a Markdown table into `- <first cell> — <remaining cells>` bullets.
82
+ *
83
+ * Pi's Markdown prints a table's RAW pipe rows when the width cannot fit the
84
+ * border overhead and one character per cell, so a three-column gate table in
85
+ * a narrow terminal reads as broken output. The narrow receipt therefore
86
+ * states the same facts as bullets: the gate name first (that is what a reader
87
+ * scans for), then the command and the result.
88
+ *
89
+ * Non-table lines pass through untouched, and a table with no body rows (a
90
+ * header-only table) yields nothing rather than a stray bullet. */
91
+ export function tableAsBullets(markdown: string): string[] {
92
+ const out: string[] = [];
93
+ let headerPending = false;
94
+ for (const line of markdown.split("\n")) {
95
+ const trimmed = line.trim();
96
+ if (!trimmed.startsWith("|")) {
97
+ headerPending = false;
98
+ out.push(line);
99
+ continue;
100
+ }
101
+ // The first pipe row of a table block is its header; the separator row
102
+ // (if the table carries one) has no cells to report either.
103
+ if (!headerPending) {
104
+ headerPending = true;
105
+ continue;
106
+ }
107
+ if (/^\|(?:\s*:?-{2,}:?\s*\|)+$/u.test(trimmed)) continue;
108
+ const cells = trimmed
109
+ .replace(/^\|/, "")
110
+ .replace(/\|$/, "")
111
+ .split("|")
112
+ .map((cell) => cell.trim())
113
+ .filter((cell) => cell.length > 0 && cell !== "\u2014");
114
+ if (cells.length > 0) out.push(`- ${cells.join(" \u2014 ")}`);
115
+ }
116
+ return out;
117
+ }