pi-daddy 0.49.5 → 0.50.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 (149) hide show
  1. package/CHANGELOG.md +51 -1
  2. package/README.md +217 -27
  3. package/dist/governance/initiative-coordinator.d.ts +58 -0
  4. package/dist/governance/initiative-coordinator.d.ts.map +1 -0
  5. package/dist/governance/initiative-coordinator.js +348 -0
  6. package/dist/governance/initiative-coordinator.js.map +1 -0
  7. package/dist/governance/initiative-effects.d.ts +20 -0
  8. package/dist/governance/initiative-effects.d.ts.map +1 -0
  9. package/dist/governance/initiative-effects.js +108 -0
  10. package/dist/governance/initiative-effects.js.map +1 -0
  11. package/dist/governance/initiative-state.d.ts +13 -0
  12. package/dist/governance/initiative-state.d.ts.map +1 -0
  13. package/dist/governance/initiative-state.js +122 -0
  14. package/dist/governance/initiative-state.js.map +1 -0
  15. package/dist/governance/operation-artifact-io.d.ts +8 -0
  16. package/dist/governance/operation-artifact-io.d.ts.map +1 -0
  17. package/dist/governance/operation-artifact-io.js +95 -0
  18. package/dist/governance/operation-artifact-io.js.map +1 -0
  19. package/dist/governance/operation-artifact-scan.d.ts +13 -0
  20. package/dist/governance/operation-artifact-scan.d.ts.map +1 -0
  21. package/dist/governance/operation-artifact-scan.js +71 -0
  22. package/dist/governance/operation-artifact-scan.js.map +1 -0
  23. package/dist/governance/operation-artifacts.d.ts +53 -0
  24. package/dist/governance/operation-artifacts.d.ts.map +1 -0
  25. package/dist/governance/operation-artifacts.js +309 -0
  26. package/dist/governance/operation-artifacts.js.map +1 -0
  27. package/dist/governance/runtime-settlement.d.ts +2 -0
  28. package/dist/governance/runtime-settlement.d.ts.map +1 -1
  29. package/dist/governance/runtime-settlement.js +26 -0
  30. package/dist/governance/runtime-settlement.js.map +1 -1
  31. package/dist/governance/workspace-acceptance.d.ts +5 -0
  32. package/dist/governance/workspace-acceptance.d.ts.map +1 -1
  33. package/dist/governance/workspace-acceptance.js +16 -0
  34. package/dist/governance/workspace-acceptance.js.map +1 -1
  35. package/dist/index.d.ts +8 -0
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.js +8 -0
  38. package/dist/index.js.map +1 -1
  39. package/dist/kernel/dashboard-observation.d.ts +76 -0
  40. package/dist/kernel/dashboard-observation.d.ts.map +1 -0
  41. package/dist/kernel/dashboard-observation.js +49 -0
  42. package/dist/kernel/dashboard-observation.js.map +1 -0
  43. package/dist/kernel/dispatch-operation.d.ts +2 -0
  44. package/dist/kernel/dispatch-operation.d.ts.map +1 -1
  45. package/dist/kernel/dispatch-operation.js.map +1 -1
  46. package/dist/kernel/initiative.d.ts +94 -0
  47. package/dist/kernel/initiative.d.ts.map +1 -0
  48. package/dist/kernel/initiative.js +38 -0
  49. package/dist/kernel/initiative.js.map +1 -0
  50. package/dist/kernel/operation-artifact.d.ts +49 -0
  51. package/dist/kernel/operation-artifact.d.ts.map +1 -0
  52. package/dist/kernel/operation-artifact.js +4 -0
  53. package/dist/kernel/operation-artifact.js.map +1 -0
  54. package/dist/kernel/principal-binding.d.ts +4 -0
  55. package/dist/kernel/principal-binding.d.ts.map +1 -0
  56. package/dist/kernel/principal-binding.js +94 -0
  57. package/dist/kernel/principal-binding.js.map +1 -0
  58. package/dist/kernel/project-paths.d.ts +6 -0
  59. package/dist/kernel/project-paths.d.ts.map +1 -1
  60. package/dist/kernel/project-paths.js +12 -0
  61. package/dist/kernel/project-paths.js.map +1 -1
  62. package/dist/kernel/selected-definitions.d.ts.map +1 -1
  63. package/dist/kernel/selected-definitions.js +5 -91
  64. package/dist/kernel/selected-definitions.js.map +1 -1
  65. package/dist/kernel/workspace-diagnostics.d.ts +24 -0
  66. package/dist/kernel/workspace-diagnostics.d.ts.map +1 -0
  67. package/dist/kernel/workspace-diagnostics.js +81 -0
  68. package/dist/kernel/workspace-diagnostics.js.map +1 -0
  69. package/dist/products/activity-storage.d.ts +2 -0
  70. package/dist/products/activity-storage.d.ts.map +1 -0
  71. package/dist/products/activity-storage.js +119 -0
  72. package/dist/products/activity-storage.js.map +1 -0
  73. package/dist/products/activity-timeline.d.ts +4 -0
  74. package/dist/products/activity-timeline.d.ts.map +1 -1
  75. package/dist/products/activity-timeline.js +12 -0
  76. package/dist/products/activity-timeline.js.map +1 -1
  77. package/dist/products/dashboard-cli.d.ts +2 -0
  78. package/dist/products/dashboard-cli.d.ts.map +1 -1
  79. package/dist/products/dashboard-cli.js +41 -9
  80. package/dist/products/dashboard-cli.js.map +1 -1
  81. package/dist/products/dashboard-display-controls.d.ts.map +1 -1
  82. package/dist/products/dashboard-display-controls.js +30 -0
  83. package/dist/products/dashboard-display-controls.js.map +1 -1
  84. package/dist/products/dashboard-file-cache.d.ts +10 -0
  85. package/dist/products/dashboard-file-cache.d.ts.map +1 -0
  86. package/dist/products/dashboard-file-cache.js +38 -0
  87. package/dist/products/dashboard-file-cache.js.map +1 -0
  88. package/dist/products/dashboard-panels.d.ts +6 -0
  89. package/dist/products/dashboard-panels.d.ts.map +1 -0
  90. package/dist/products/dashboard-panels.js +179 -0
  91. package/dist/products/dashboard-panels.js.map +1 -0
  92. package/dist/products/dashboard-screen.d.ts +8 -0
  93. package/dist/products/dashboard-screen.d.ts.map +1 -1
  94. package/dist/products/dashboard-screen.js +86 -15
  95. package/dist/products/dashboard-screen.js.map +1 -1
  96. package/dist/products/dashboard-session-client.d.ts +16 -2
  97. package/dist/products/dashboard-session-client.d.ts.map +1 -1
  98. package/dist/products/dashboard-session-client.js +64 -11
  99. package/dist/products/dashboard-session-client.js.map +1 -1
  100. package/dist/products/dashboard-settings.d.ts.map +1 -1
  101. package/dist/products/dashboard-settings.js +4 -6
  102. package/dist/products/dashboard-settings.js.map +1 -1
  103. package/dist/products/ecosystem-versions.d.ts +1 -1
  104. package/dist/products/ecosystem-versions.d.ts.map +1 -1
  105. package/extensions/activity-timeline.ts +3 -1
  106. package/extensions/artifact-bridge.ts +130 -0
  107. package/extensions/dashboard-live.ts +63 -0
  108. package/extensions/dashboard-observation.ts +39 -0
  109. package/extensions/dashboard-session-server.ts +45 -3
  110. package/extensions/dashboard-sources.ts +124 -0
  111. package/extensions/delegation-artifacts.ts +125 -0
  112. package/extensions/delegation-operations.ts +42 -13
  113. package/extensions/ecosystem-versions.ts +12 -5
  114. package/extensions/grants-command.ts +34 -6
  115. package/extensions/grants.ts +9 -20
  116. package/extensions/initiative-dashboard.ts +143 -0
  117. package/extensions/initiative-runtime.ts +406 -0
  118. package/extensions/runtime-snapshot.ts +118 -2
  119. package/extensions/session-environment.ts +13 -1
  120. package/extensions/session.ts +28 -10
  121. package/extensions/workspace-diagnostics.ts +90 -0
  122. package/package.json +1 -1
  123. package/src/governance/initiative-coordinator.ts +400 -0
  124. package/src/governance/initiative-effects.ts +146 -0
  125. package/src/governance/initiative-state.ts +144 -0
  126. package/src/governance/operation-artifact-io.ts +103 -0
  127. package/src/governance/operation-artifact-scan.ts +77 -0
  128. package/src/governance/operation-artifacts.ts +363 -0
  129. package/src/governance/runtime-settlement.ts +28 -0
  130. package/src/governance/workspace-acceptance.ts +18 -0
  131. package/src/index.ts +13 -0
  132. package/src/kernel/dashboard-observation.ts +109 -0
  133. package/src/kernel/dispatch-operation.ts +2 -0
  134. package/src/kernel/initiative.ts +126 -0
  135. package/src/kernel/operation-artifact.ts +46 -0
  136. package/src/kernel/principal-binding.ts +104 -0
  137. package/src/kernel/project-paths.ts +16 -0
  138. package/src/kernel/selected-definitions.ts +5 -100
  139. package/src/kernel/workspace-diagnostics.ts +110 -0
  140. package/src/products/activity-storage.ts +128 -0
  141. package/src/products/activity-timeline.ts +11 -0
  142. package/src/products/dashboard-cli.ts +44 -9
  143. package/src/products/dashboard-display-controls.ts +27 -0
  144. package/src/products/dashboard-file-cache.ts +38 -0
  145. package/src/products/dashboard-panels.ts +217 -0
  146. package/src/products/dashboard-screen.ts +107 -17
  147. package/src/products/dashboard-session-client.ts +78 -14
  148. package/src/products/dashboard-settings.ts +4 -6
  149. package/src/products/ecosystem-versions.ts +2 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,56 @@
1
1
  # Changelog — pi-daddy
2
2
 
3
+ ## 0.50.0 — Unreleased
4
+
5
+ - Recognize the public `pi-bookie` package and retain legacy Bookie names in version observations.
6
+ Reload Pi after updating Daddy; suggested npm pin commands keep the selected package name.
7
+
8
+ - Keep private lifecycle state out of dashboard owner replies by emitting only the public session and
9
+ directory identity. Restart Pi after updating; circular internal state no longer breaks serialization.
10
+
11
+ - Inspect routing with `/grants workspace <id>`: distinguish saved acceptance, current grant/pin,
12
+ pending activation, moved/removed destinations and invalid worktrees. The dashboard retains a bounded
13
+ last-observed result; candidate, approvals and execution checks remain at dispatch.
14
+ - Use Pi's selected working directory for existing root grants and runtime defaults at startup/reload.
15
+ Explicit grants keep precedence; descendants with missing inherited grants no longer fall back to a
16
+ local root store. Acceptance still requires a new root session to establish a new pin; reload never repins.
17
+
18
+
19
+ - Prepare default activity storage during awaited session startup so later log/content writes do not
20
+ alter a product snapshot taken before `/grants init`. Preserve existing ignore rules, settings and
21
+ unrelated files; tracked or insufficiently excluded runtime paths report observation unavailable.
22
+ Custom locations retain their policy, and marker-free non-Git use does not require Git.
23
+
24
+ - Report settled prior-generation tasks as unclaimed after safe exclusive takeover, without changing retained attempt provenance or bypassing explicit claim and admission checks. Recovery-only, running and uncertain ownership remain non-free.
25
+
26
+
27
+ - Avoid repeating full selected-work-map scans for exact read-only owner observations when a trusted client supplies a separate current read-authority guard; all execution and mutation guards remain full.
28
+
29
+
30
+ - Keep initiative dashboard refresh display-only with bounded last-observed facts and unchanged timestamps.
31
+ Remove a duplicate selection callback while retaining the coordinator's bound authority/generation checks.
32
+ Optional display no longer repeats work-map validation during selection or execution controls.
33
+
34
+ - Retain optional exact neutral effect targets/outcomes with explicit operator-attested or owner-verified provenance.
35
+ Unknown outcomes do not reconcile effects; current target observations stay separate from historical targets
36
+ after goal/plan changes. Recovery returns the original attempt's exact receipt outcome, without registry inference
37
+ or task acceptance. Old outcome-less receipts remain readable without invented upgrade status.
38
+
39
+ - Add optional one-host initiative ownership for trusted selected work maps. Exact task association feeds the
40
+ existing durable operation admission; current grants and workspace leases remain required. Interrupted or
41
+ external-effect-unknown work blocks takeover rather than becoming a silent retry. Add recovery-only selection
42
+ and exact owner-verified receipt reconciliation without treating process settlement as external success.
43
+ - Show bounded initiative observations and improve narrow dashboard word wrapping, attention summaries and
44
+ visible page scrolling. These observations never approve work or grant authority.
45
+
46
+ - Add six bounded current-session dashboard views, shared compact/expanded selection, live metadata with capture off, and optional owner-bound producer status contributions. Stale/disconnected data stays explicitly historical; exact evidence identities do not load payloads, and review observations confer no execution authority. Models/Versions shortcuts and old-owner compatibility remain.
47
+ - Show pending/applied/refused/unconfirmed control effects, reject stale owner snapshots, and recheck the owner across awaited settings reads. Display metadata caching is bounded; redraws create no durable records or provider calls. Add safe typed artifact-read failure codes without changing legacy reasons.
48
+
49
+ - Add an optional trusted retained-artifact hint/list/read bridge and bounded current-owner enumeration. Missed notifications are recoverable without dispatch; consumer failures cannot alter a published result. Historical reads require independently rechecked consumer authority.
50
+
51
+ - Retain stable-ID attempt admission and exact visible results in private producer manifests, independently of optional diagnostics. Same-session restart resolves historical evidence without redispatching an interrupted or completed attempt; changed requests remain conflicts. Historical reads are bounded and identity checked, and never grant live authority or task approval. Partial and failed outcomes remain explicitly distinct.
52
+ - Add root-exported artifact readers, owner-bound `pi-daddy:operation-history:v1`, optional live `operation.artifact` references and small Pi custom entries for downstream consumers. Principal retains its engineering policy; its existing binding is isolated without changing ordinary inline roles.
53
+
3
54
  ## 0.49.5 — 2026-11-03
4
55
 
5
56
  - Retain native `not-started` operation evidence for non-approval admission-preview refusals, including missing workspace authority. Previously these refusals could leave a prepared coordinator attempt without a native operation record. The original typed refusal still throws; duplicate and conflicting IDs never overwrite an existing execution. After correcting authority, use the coordinator's explicit retry rather than redispatching the terminal ID. No permission or Auto setting changes.
@@ -165,7 +216,6 @@ Release candidate for review, not a stable or npm publication. Use the immutable
165
216
  usage remain. Pi 1.0.4 argument preparation validates active arguments after removing the retired cost override.
166
217
  - Live complete episode cost is explicitly unavailable in the session dashboard; historical usage remains in reports.
167
218
 
168
-
169
219
  ### Passive cost coverage
170
220
 
171
221
  - **Breaking — report JSON change:** row/group/total cost and episode-cost percentiles may be null when coverage is incomplete.
package/README.md CHANGED
@@ -19,6 +19,76 @@ request under the same ID refuses. An intentional retry needs a new attempt afte
19
19
  previous operation is proven settled or never started; uncertainty stays blocked.
20
20
  Principal 4.12.0 introduced automatic operation IDs and exact candidate/report references for this contract.
21
21
 
22
+ Stable-ID attempts also retain private producer evidence under
23
+ `<PI_CODING_AGENT_DIR>/pi-daddy/operation-results` (default agent directory: `~/.pi/agent`).
24
+ Admission is synchronized before dispatch; a restart with no published result leaves the attempt uncertain,
25
+ not safe to rerun. Exact visible finals and available visible partial output remain distinct from native
26
+ cleanup, successful work, review approval and current applicability. Diagnostics settings do not control this
27
+ required result store. No raw session, reasoning, environment or task request is captured here.
28
+
29
+ `OperationArtifactRef`, `openOperationArtifacts` and `readOperationArtifact` are available from the package
30
+ root without loading the extension, Principal or Bookie. Immutable references bind the original owner,
31
+ operation, execution, manifest hash and authored bytes. Historical reads require the selected agent directory,
32
+ check identity and confinement, and refuse missing, altered or oversized evidence. Authored content is bounded
33
+ at 4 MiB per result; manifests at 64 KiB. There is no automatic lifetime quota or deletion: the operator owns
34
+ retention and backup. Deleting evidence does not establish that an interrupted execution never started.
35
+
36
+ The live `pi-daddy:operation-status:v1` reply retains its original meaning and may add
37
+ `operation.artifact`. `pi-daddy:operation-history:v1` accepts `{version:1, requestId, sessionId, cwd,
38
+ operationId, reply}` for the currently bound session/canonical cwd only, returning `history:true`, the
39
+ historical `operation`, optional `artifact` and exact `final` or explicitly `partial` content. It never claims
40
+ live qualification or approval. Pi custom entries contain only `pi-daddy:operation-artifact:v1` references.
41
+ Bookie can register a reference afterward; a registration retry never dispatches the child again.
42
+
43
+ ## Current-session dashboard
44
+
45
+ The connected terminal dashboard has six destinations: **1 Now, 2 Work, 3 Reviews, 4 Activity,
46
+ 5 Evidence, 6 Settings**. `x` switches the same selection to an expanded details layout at 96 columns;
47
+ smaller panes keep the compact layout. Arrow keys select, PageUp/PageDown scroll, Enter opens details,
48
+ Esc returns, and `m` Models / `v` Versions / `s` Settings remain available. Old owners and standalone
49
+ ledger views keep their compatible legacy display.
50
+
51
+ Now combines an explicitly reported goal/next-step recommendation with actual parent and child
52
+ observations. Recommendations do not authorize work. Reviews show producer judgments in their stated
53
+ scope; retained output, a successful process, and an overall approved task are different facts. Evidence
54
+ shows exact technical references, never automatically restores output into context. References may contain
55
+ local names or paths. Explicit `p`/`f` reads retain one checked display snapshot until another selection.
56
+
57
+ Optional Bookie, Scout, Principal and Harness status adapters publish only bounded terminal metadata.
58
+ Absent adapters show unavailable; closed adapters, disconnected owners and observations older than two
59
+ minutes show last observed/stale. Silence is not a hang. Ordinary parent tool-name activity works with
60
+ transcripts/diagnostics disabled; no arguments, results, prompts or reasoning are captured for this view.
61
+ The small resource sample is the parent Pi process's RSS, not host health or total child memory. Native
62
+ children use the current owner's existing ledger/timeline; unrelated sessions are excluded.
63
+
64
+ Controls remain the existing authenticated owner controls. Changes show pending, applied, refused or
65
+ unconfirmed status. Unconfirmed mutations need owner inspection before retry. Auto changes current
66
+ permission handling, JEV still requires its separate paid-call/storage choices, and model/wall/idle edits
67
+ apply to future children. Running children keep captured settings. The dashboard does not implement a
68
+ new pause/cancel/stop route: use the owning Pi control, and treat a reported request as unconfirmed until
69
+ its owner reports settlement. Existing Herdr child panes stay view-only and parent controlled.
70
+
71
+ Display storage is bounded and memory-only: at most eight source updates of 4 KiB, 32 parent activity
72
+ observations, 16 recent producer-reference identities, and four metadata files of at most 2 MiB. Unchanged
73
+ metadata is cached with a one-second file-check interval; package version inventory is cached for five seconds
74
+ per owner. Versions includes optional Scout/Bookie observations and separates installed bytes from loaded
75
+ generations; a local 0.0.0 Bookie manifest is not evidence of npm publication. The view does not scan historical artifact stores,
76
+ make provider calls, or write durable records on redraw. Larger ledger files are reported unavailable in
77
+ this view rather than silently truncated into a false complete history.
78
+
79
+ The optional event `pi-daddy:dashboard-source:v1` takes a trusted
80
+ `{version:1, sessionId, cwd, producer, producerVersion, reply}` registration for the actual current native
81
+ owner and canonical cwd. A successful reply supplies `{version:1, ok:true, generation, publish, close}`.
82
+ `publish({sequence, items})` accepts strictly increasing nonnegative sequence values, no more than eight
83
+ items and 4 KiB total. Each item has `id`, `kind` (`goal`, `next`, `work`, `review`, `evidence`, `status`),
84
+ `label`, `state` (`observed`, `running`, `dependency-wait`, `approval-wait`, `cancel-requested`, `settled`,
85
+ `failed`, `unknown`, `unavailable`), optional bounded `details`, and an optional opaque display `reference`.
86
+ IDs are bounded to 160 characters, labels to 240, details to six strings of 240, and references to 512.
87
+ Replacing a producer invalidates its prior publisher even at the same version; session/lifecycle changes
88
+ invalidate all publishers. Registered extensions own refresh/closure; no callback conveys permission,
89
+ review approval, a content resolver, or executable actions. The exported TypeScript interfaces document
90
+ this seam without making other ecosystem packages mandatory.
91
+
22
92
  The dashboard shows the selected task's last observed tool event and time since that event.
23
93
  Details include the actual recorded working directory and phase where available. Silence is
24
94
  not proof of a hang, and a finished process is not an approved task. Tool observations retain
@@ -135,13 +205,13 @@ delegate({ agent: "build", task: "Implement it.",
135
205
  context: { mode: "files", files: ["src/kernel/resolve.ts"] } })
136
206
  ```
137
207
 
138
- | Mode | What crosses |
139
- | :--- | :--- |
140
- | `none` | nothing beyond the definition and the task; the default |
141
- | `files` | the contents of paths the parent names, confined to the working directory |
142
- | `pruned` | the last few turns of the parent's session, plus older turns naming those files |
143
- | `summary` | what the parent writes in its own words |
144
- | `fork` | the parent's whole session, as a fork; **gated**, so a human answers first |
208
+ | Mode | What crosses |
209
+ | :-------- | :------------------------------------------------------------------------------ |
210
+ | `none` | nothing beyond the definition and the task; the default |
211
+ | `files` | the contents of paths the parent names, confined to the working directory |
212
+ | `pruned` | the last few turns of the parent's session, plus older turns naming those files |
213
+ | `summary` | what the parent writes in its own words |
214
+ | `fork` | the parent's whole session, as a fork; **gated**, so a human answers first |
145
215
 
146
216
  A `delegate_chain` step takes the same parameter, and because a chain is planned as one unit, a gate any step
147
217
  raises is answered before the first step runs.
@@ -223,6 +293,13 @@ The timeline is enabled by default. It may store private prompt and final conten
223
293
  `PI_DADDY_ACTIVITY_CONTENT=metadata-only` (or `off`) to keep only digests, or
224
294
  `PI_DADDY_ACTIVITY_TIMELINE=off` to disable observation.
225
295
 
296
+ The default location is prepared during session startup, before product snapshots. Fresh ignore rules
297
+ cover activity/content and grants-ledger runtime files only; settings and unrelated files stay reviewable.
298
+ Existing ignore rules are preserved. Already tracked runtime data, unsafe storage paths or insufficient
299
+ exclusions report observation unavailable rather than silently changing repository policy. Custom and
300
+ transported timeline locations keep their existing policy. Non-Git roles can still record without Git;
301
+ an existing repository whose policy cannot be checked remains unavailable.
302
+
226
303
  `pi-daddy outcomes` reads Git history, optional GitHub Actions results from `gh`, and narrowly recognized corrections
227
304
  in the next recorded operator turn, then appends only changed `episode_outcome` signals. Only commits carrying a
228
305
  `Pi-Episode: <episode-id>` trailer is considered; `pi-daddy report` can display attribution only when matching episode
@@ -231,6 +308,20 @@ is `packages/pi-daddy/contracts/ledger-record/v1`.
231
308
 
232
309
  ## Workspaces and leases
233
310
 
311
+ `/grants workspace <id>` inspects one workspace without changing grants, acceptance or destination pins.
312
+ It distinguishes saved acceptance, the current routing capability, pending activation, a moved or removed
313
+ destination, and invalid worktrees. It names the selected grant directory and its source. An active route
314
+ is only a current observation: candidate, selected task/input scope, approvals, writer lease and native
315
+ settlement remain dispatch-time checks. The dashboard retains the last explicit inspection with its time
316
+ and freshness; redraw does not scan repositories or refresh authority.
317
+
318
+ Startup uses the actual Pi working directory's existing root grant and runtime defaults, even when an
319
+ embedding process started elsewhere. Explicit environment grants still win; descendants never adopt a
320
+ target directory's broader root grant. Stored directory identity remains exact: an alias does not silently
321
+ borrow or migrate another spelling's saved grant or approvals. Canonical aliases of registered workspace
322
+ destinations continue to resolve through the existing Git/worktree validator.
323
+
324
+
234
325
  A registered worktree is named `workspace:<id>` and routing a child there is a capability that attenuates like any
235
326
  other. Acceptance is trust on first use: the first session accepts and announces every id already in the registry.
236
327
  Later additions are refused until `/grants workspaces` accepts the current id set, effective next session. Each session
@@ -357,18 +448,17 @@ replace a pin, then deliberately reload. There are no background registry checks
357
448
  **:** opens command mode, **Tab** changes the task filter, **p/f** shows retained prompt/final content,
358
449
  **Esc** returns to the previous view and **q** closes the dashboard.
359
450
 
360
-
361
451
  ## Bounds and configuration
362
452
 
363
453
  Every variable is `PI_DADDY_*`. Operator-facing controls are grouped below; the environment overrides stored
364
454
  configuration where both exist.
365
455
 
366
- | Area | Variables |
367
- | :--- | :--- |
368
- | Governance | `PI_DADDY_GOVERNANCE`, `PI_DADDY_GRANT`, `PI_DADDY_GATED`, `PI_DADDY_MAX_DEPTH`, `PI_DADDY_FANOUT`, `PI_DADDY_LEDGER`, `PI_DADDY_APPROVAL_TIMEOUT`, `PI_DADDY_AUTO_MODE` |
369
- | Child execution | `PI_DADDY_HERDR`, `PI_DADDY_HERDR_WORKSPACE`, `PI_DADDY_HERDR_KEEP_PANE`, `PI_DADDY_CHILD_IDLE_TIMEOUT`, `PI_DADDY_CHILD_TIMEOUT`, `PI_DADDY_ALLOW_UNRESOLVED_MODELS` |
370
- | Workspaces and retention | `PI_DADDY_WORKSPACE_REGISTRY`, `PI_DADDY_WORKSPACE_LEASE_DIR`, `PI_DADDY_EXECUTION_ARCHIVE`, `PI_DADDY_RETAIN_NATIVE_SESSIONS`, `PI_DADDY_NATIVE_SESSION_ROOT` |
371
- | Activity | `PI_DADDY_ACTIVITY_TIMELINE`, `PI_DADDY_ACTIVITY_CONTENT` |
456
+ | Area | Variables |
457
+ | :----------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
458
+ | Governance | `PI_DADDY_GOVERNANCE`, `PI_DADDY_GRANT`, `PI_DADDY_GATED`, `PI_DADDY_MAX_DEPTH`, `PI_DADDY_FANOUT`, `PI_DADDY_LEDGER`, `PI_DADDY_APPROVAL_TIMEOUT`, `PI_DADDY_AUTO_MODE` |
459
+ | Child execution | `PI_DADDY_HERDR`, `PI_DADDY_HERDR_WORKSPACE`, `PI_DADDY_HERDR_KEEP_PANE`, `PI_DADDY_CHILD_IDLE_TIMEOUT`, `PI_DADDY_CHILD_TIMEOUT`, `PI_DADDY_ALLOW_UNRESOLVED_MODELS` |
460
+ | Workspaces and retention | `PI_DADDY_WORKSPACE_REGISTRY`, `PI_DADDY_WORKSPACE_LEASE_DIR`, `PI_DADDY_EXECUTION_ARCHIVE`, `PI_DADDY_RETAIN_NATIVE_SESSIONS`, `PI_DADDY_NATIVE_SESSION_ROOT` |
461
+ | Activity | `PI_DADDY_ACTIVITY_TIMELINE`, `PI_DADDY_ACTIVITY_CONTENT` |
372
462
 
373
463
  `PI_DADDY_FANOUT` bounds active cooperating descendant sessions. Its default remains 8; literal 0 means exhausted,
374
464
  and malformed values refuse. A reservation includes the child and its disjoint descendant allowance, so concurrent
@@ -505,10 +595,10 @@ The command never uploads, calls a model, grants training rights, or changes LoR
505
595
  External advisors, monetary cost gates and the first-delegation model chooser were removed. These recognized old
506
596
  inputs are inert, including malformed values; the package does not rewrite existing configuration or history:
507
597
 
508
- | Input | Compatibility behavior |
509
- |---|---|
510
- | Tool argument `episodeCostCeiling` on single/all/chain | Removed before Pi validates the remaining arguments |
511
- | Settings `episodeCostCeiling`, `advisor`, `sessionModelPrompt` | Ignored; active model and authority fields still validate |
598
+ | Input | Compatibility behavior |
599
+ | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
600
+ | Tool argument `episodeCostCeiling` on single/all/chain | Removed before Pi validates the remaining arguments |
601
+ | Settings `episodeCostCeiling`, `advisor`, `sessionModelPrompt` | Ignored; active model and authority fields still validate |
512
602
  | `PI_DADDY_EPISODE_COST_CEILING`, `PI_DADDY_ADVISOR`, `PI_DADDY_ADVISOR_KEY`, `PI_DADDY_ADVISOR_MODEL`, `PI_DADDY_ADVISOR_TASK_EGRESS` | Never select or execute an intervention; reserved environment stripping remains |
513
603
 
514
604
  Historical advice/cost-gate records remain readable. Manual model choices and permission approvals remain active.
@@ -545,14 +635,13 @@ primitives, including `resolve`, `planSpawn`, `appendLedgerEvent`, `readRecords`
545
635
  The Files column names the main modules of each layer, not all of them; the module docstrings are the
546
636
  specification of who owns what.
547
637
 
548
-
549
- | Layer | Answers | Files |
550
- | :--- | :--- | :--- |
551
- | `src/kernel` | What may a child hold, and how is that carried? Mostly pure; the readers that discover what exists are the exception, and they are bounded. | `resolve`, `spawn`, `propagation`, `catalog`, `definitions`, `capabilities`, `approval`, `chain`, `context-handoff`, `fanout`, `correlation`, `refusals`, `env-names`, `project-paths`, `workspace`, `bounded-read` |
552
- | `src/governance` | What was decided, and where is it written? | `record`, `ledger`, `ledger-events`, `ledger-report`, `approval-store`, `approval-prompt`, `grant-store`, `init`, `workspace-lease`, `execution-retention` |
553
- | `src/executors` | How does a child process start and end? | `executor`, `run-herdr`, `herdr-*`, `pane-reaper` |
554
- | `src/products` | What does the operator see or report? | `activity-timeline`, `dashboard-*`, `episode-report`, `episode-outcomes` |
555
- | `extensions/` | The pi extension and its wiring: hooks, the three tools, approvals flow, `/grants`. | `grants.ts` is the entry point |
638
+ | Layer | Answers | Files |
639
+ | :--------------- | :------------------------------------------------------------------------------------------------------------------------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
640
+ | `src/kernel` | What may a child hold, and how is that carried? Mostly pure; the readers that discover what exists are the exception, and they are bounded. | `resolve`, `spawn`, `propagation`, `catalog`, `definitions`, `capabilities`, `approval`, `chain`, `context-handoff`, `fanout`, `correlation`, `refusals`, `env-names`, `project-paths`, `workspace`, `bounded-read` |
641
+ | `src/governance` | What was decided, and where is it written? | `record`, `ledger`, `ledger-events`, `ledger-report`, `approval-store`, `approval-prompt`, `grant-store`, `init`, `workspace-lease`, `execution-retention` |
642
+ | `src/executors` | How does a child process start and end? | `executor`, `run-herdr`, `herdr-*`, `pane-reaper` |
643
+ | `src/products` | What does the operator see or report? | `activity-timeline`, `dashboard-*`, `episode-report`, `episode-outcomes` |
644
+ | `extensions/` | The pi extension and its wiring: hooks, the three tools, approvals flow, `/grants`. | `grants.ts` is the entry point |
556
645
 
557
646
  ## Tests
558
647
 
@@ -569,7 +658,6 @@ PI_DADDY_IT_MODEL=1 npm run test:integration --workspace=pi-daddy # opt-in real-
569
658
 
570
659
  `pi-daddy` under `packages/pi-daddy` is the only published package; the workspace root is private.
571
660
 
572
-
573
661
  ### Exact definition runtime choices (candidate)
574
662
 
575
663
  A selected definition may author a single-line `runtime-preferences` JSON array:
@@ -596,3 +684,105 @@ Call `delegate_describe({agent:"build"})` and carry its `definitionId` into `del
596
684
  child, or a `delegate_chain` step. Principal bindings require that precondition. Description starts no child
597
685
  and grants no authority. A stale ID refuses before approval or launch. This hash is an observation and
598
686
  precondition, not an approval record or a learned-policy authorization.
687
+
688
+ ### Optional retained-result consumers
689
+
690
+ `pi-daddy:operation-artifact-ready:v1` is a best-effort trusted extension hint containing `{ version: 1, reference }`. A missing or failing consumer cannot change the durable result or relaunch work. Pi's custom entry likewise holds only a reference. Consumers recover missed hints through the trusted `pi-daddy:operation-artifacts:v1` event; this is not a model-callable tool.
691
+
692
+ Requests carry `version:1`, a bounded `requestId`, current `sessionId` and canonical `cwd`, an `action`, and a reply callback. `list` accepts a limit of 1–64 directory entries and an optional opaque continuation cursor. Its response includes exact references, unfinished-admission and invalid-entry counts, completion and optional next cursor. Each page is bounded; traversal is not a snapshot under concurrent publication. Only the current owner is enumerated. A new traversal replaces the previous cursor; session replacement closes it. Consumers serialize scans and restart on failed pages rather than treating missing registration as completed.
693
+
694
+ `read` accepts an exact producer reference and optional expected `producerInstance`. The instance binds the canonical selected agent directory and filesystem identity. Artifact bytes and original admission/scope are verified under that selected root. A previous owner's exact read additionally requires a trusted asynchronous `authorize` callback, checked before and after reading. A consumer must derive that callback from its already retained, explicitly selected project registration; do not forward model-provided paths or permission flags. This does not grant live execution authority or semantic approval.
695
+
696
+ `openOperationArtifactScan(agentDirectory, owner)` and `operationArtifactInstance(agentDirectory)` are root package exports for trusted local consumers. A scan has `next(limit)` and `close()`; callers own closing it. No Bookie import or dependency is needed. Bookie may separately register reference metadata after operator consent. A failed/partial producer result remains failed/partial evidence; an admission without a result is not registration-ready completion proof.
697
+
698
+ ### One-host initiative continuation
699
+
700
+ A trusted work-map owner can select an initiative through `pi-daddy:initiative:v1`. Bookie's optional
701
+ `/bookie-work` command supplies the exact selected Project/map/task revisions and asks the operator before
702
+ acquisition. Daddy remains usable without Bookie: normal delegation is unchanged and initiative association
703
+ stays unavailable until a trusted owner selects a map. There is no background scheduler or new model call.
704
+
705
+ After selection, `initiative_task` associates a selected `taskId`/`taskRevision` with the intended
706
+ `operationId`. Use that ID as ordinary delegation's `operation_id`. Association does not dispatch, approve,
707
+ or grant tools. Ordinary delegation still checks current capabilities, selected definition and workspace
708
+ routing; actual writers still use the existing workspace lease. A trusted `assertExecutionScope` callback
709
+ also compares the actual routed child directory/workspace with this task's selected resource roots before
710
+ spawn. General permission for another repository does not make it this task's target. The original session, operation and
711
+ execution identities remain in durable attempt records when a later coordinator takes over.
712
+
713
+ One coordinator holds the existing OS ownership lock per initiative on this host. Acquisition requires an
714
+ exact previous record revision, and every mutation checks the owner generation and selected-map callback.
715
+ A lost process or an old timestamp is insufficient for takeover. Every earlier attempt must have exact
716
+ producer no-start/native-cleanup evidence. External or unknown effects additionally need a selected exact
717
+ canonical receipt, verified by the trusted work-map owner against original owner/task/operation/execution
718
+ identity and current receipt content. A human confirmation can establish operator-confirmed reconciliation;
719
+ it never invents provider success or task acceptance. Missing or changed receipts remain blocked. Local
720
+ cleanup is process settlement, not semantic acceptance, a sandbox, or a way to stop arbitrary shell writes.
721
+
722
+ The owner status is a cached dashboard contribution with an explicit initiative scope, known session count,
723
+ and bounded task observations. It knows only recorded relationships. Task reviews, releases and registry
724
+ publication remain separate owner facts. The six terminal views do not become a global initiative registry.
725
+
726
+ After restart, trusted `recover` acquires the same lock and exact state revision without changing the old
727
+ owner/generation or allowing dispatch. The handle lists bounded pending effects and reconciles only a selected
728
+ exact receipt. Release then normal acquisition establishes the next generation. Native process settlement
729
+ is required independently; a receipt cannot authorize takeover while an owned process remains unresolved.
730
+
731
+ State is a private, bounded per-initiative record under the selected agent directory (256 task revisions,
732
+ 1,024 attempt links, 512 KiB). A retained initialization marker makes a deleted record fail closed; restore
733
+ trusted state instead of treating deletion as a new initiative. Closed or revoked selection does not erase
734
+ unresolved attempts. No record is written by dashboard redraws.
735
+
736
+ Trusted event requests include `version:1`, `requestId`, `sessionId`, `cwd`, `initiativeId`, and `reply`.
737
+ `action:"status"` returns an exact `revision` or null for never-initialized state. `action:"acquire"` additionally
738
+ requires `expectedRevision`, selected `tasks:[{taskId,taskRevision,effectScope}]`, and a trusted
739
+ `assertSelection()` and task-specific `assertTaskReady({taskId,taskRevision})` callbacks. The latter is
740
+ rechecked at association, admission and launch; current inputs alone do not establish dependency readiness.
741
+ The reply echoes request/owner identity and returns a handle with
742
+ `associate`, `observe`, `release` (clean transfer), and `close` (abandon cooperative ownership; no settlement
743
+ claim). `observe` is read-only and returns an `assertCurrent` recheck for exact generation, task revision
744
+ and observed execution states. A callback or opaque identifier supplied by model text is not this authority.
745
+
746
+ `action:"recover"` uses those same selected-scope callbacks but returns `recoveryOnly:true`. Both handle modes
747
+ provide `pendingEffects()` and `reconcileEffect({initiativeId,taskId,taskRevision,owner,operationId,executionId,
748
+ effectScope,receipt:{reference,sha256}})`. Only the trusted `assertEffectReconciled` callback can verify that
749
+ receipt. No callback means unresolved effects. Task revisions retain their exact `sha256:<64hex>` source
750
+ identity (bare 64-hex revisions are also accepted); receipt digests are bare 64-hex values. Revalidation of a
751
+ previous receipt is required in the new session, using the original attempt identity, not the new owner.
752
+
753
+ Selected tasks may include one bounded neutral `effectTarget:{owner,kind,reference}`. Its responsible owner
754
+ binds the exact target into the task revision. Receipt `observation` is optional for old records; when present
755
+ it names the same target, an `applied`, `not-applied` or `unknown` outcome, and `operator-attested` or
756
+ `owner-verified` provenance. Daddy does not interpret package, registry or other business semantics.
757
+ `unknown` never resolves effects. Applied/not-applied reconciliation never accepts the task or grants execution.
758
+ An old receipt without an outcome remains readable without inventing an outcome during upgrade.
759
+
760
+ `observe` returns the selected revision's `effectObservation`: pending only when no attempt exists or exact
761
+ no-start evidence exists, otherwise unknown until native settlement and a current exact receipt establish an
762
+ outcome. Older revisions can independently require reconciliation; their outcome is never rebound to a new
763
+ target. `pendingEffects` includes each original target, and `reconcileEffect` returns that historical attempt's
764
+ exact observation. Recovery can therefore confirm an old target after a plan amendment while the current
765
+ selected target remains pending. The work-map owner still validates current target resources separately.
766
+
767
+ Task-readiness callbacks must not turn the newly admitted attempt's honest unknown state into a self-block
768
+ at launch. Daddy's `begin` refuses a new attempt while any prior attempt or effects are unresolved; the
769
+ work-map owner separately rejects repeating an already-applied target and enforces semantic prerequisites.
770
+ Immediately before start, Daddy rechecks prior attempts across all revisions of that task, excluding only the
771
+ exact already-admitted owner/operation/execution/request identity. Revoking an older receipt after admission
772
+ therefore blocks launch without misclassifying the current admitted attempt as evidence of earlier effects.
773
+
774
+ For a selected target, changing only the task revision does not authorize applying that identical target again.
775
+ Admission and launch refuse a current exact applied receipt from any retained revision of the same task. This
776
+ prevents duplicate effects; it does not reclassify the old receipt as current task acceptance. A different target
777
+ still needs normal readiness, permission, resource validation and reconciliation of earlier attempts.
778
+
779
+ Initiative dashboard refresh is display-only: it uses at most five cached observations from real owner reads,
780
+ keeps their original timestamps and labels missing or invalidated facts unavailable/stale. It performs no
781
+ semantic currentness scan, native read, model call or durable write. Work-map reads and every admission/start
782
+ boundary still invoke their authoritative currentness checks; cached display facts never authorize execution.
783
+
784
+ Trusted work-map clients may provide `assertObservationAuthority` for exact runtime-fact reads. It binds current read permission and selected owner; it does not certify current authored intent, task acceptance or permission to execute. The client still checks canonical inputs before disclosing or reusing a projection. Missing read callbacks use the original full selection guard. Claim, begin, start, reconciliation and release always keep the full guard; native receipts, held ownership and exact generation checks also remain on observations.
785
+
786
+ Exact effect-receipt validators also use the observation guard: checking an existing receipt cannot itself authorize a mutation. Coordinator acquisition, claim, begin, start, reconcile and release independently bracket those awaits with full mutation authority, including a final check before retaining an attestation.
787
+
788
+ After safe exclusive coordinator takeover, a settled previous-generation task is reported as `unclaimed` until explicitly claimed. Observation does not rewrite its historical generation or attempts. Recovery-only handles, running attempts and uncertain settlement remain non-free; current-generation claims remain `owned`.
@@ -0,0 +1,58 @@
1
+ import type { OperationArtifactOwner } from "../kernel/operation-artifact.ts";
2
+ import type { OperationRequest } from "../kernel/dispatch-operation.ts";
3
+ import { type InitiativeTask, type InitiativeTaskIdentity, type InitiativeObservation, type InitiativeEffectReconciliation } from "../kernel/initiative.ts";
4
+ import { type InitiativeResolution } from "./initiative-effects.ts";
5
+ export interface InitiativeCoordinatorOptions extends InitiativeResolution {
6
+ assertAuthority(): void | Promise<void>;
7
+ /** Optional read permission for exact owner facts; never substitutes for mutation or task-readiness authority. */
8
+ assertObservationAuthority?(): void | Promise<void>;
9
+ }
10
+ export interface AcquireInitiative {
11
+ initiativeId: string;
12
+ owner: OperationArtifactOwner;
13
+ expectedRevision: string | null;
14
+ recoveryOnly?: boolean;
15
+ }
16
+ export declare function acquireInitiativeCoordinator(directory: string, request: AcquireInitiative, options: InitiativeCoordinatorOptions): Promise<{
17
+ generation: number;
18
+ recoveryOnly: boolean;
19
+ revision: () => string;
20
+ metadata: () => {
21
+ initiativeId: string;
22
+ generation: number;
23
+ knownSessions: number;
24
+ recordedTasks: number;
25
+ recordedAttempts: number;
26
+ };
27
+ assertCurrent: () => Promise<void>;
28
+ assertObservationCurrent: () => Promise<void>;
29
+ claim(task: InitiativeTask): Promise<void>;
30
+ begin(task: InitiativeTask, operation: OperationRequest): Promise<void>;
31
+ assertPriorAttemptsSettled(task: InitiativeTask, operation: OperationRequest): Promise<void>;
32
+ notAdmitted(operation: OperationRequest): Promise<void>;
33
+ observe(input: InitiativeTaskIdentity, selectedTask?: InitiativeTask): Promise<InitiativeObservation | {
34
+ status: "unavailable";
35
+ }>;
36
+ pendingEffects(): Promise<{
37
+ effectTarget?: import("../kernel/initiative.ts").InitiativeEffectTarget | undefined;
38
+ execution: "running" | "settled" | "unknown";
39
+ owner: OperationArtifactOwner;
40
+ operationId: string;
41
+ executionId: string;
42
+ effectScope: InitiativeTask["effectScope"];
43
+ initiativeId: string;
44
+ taskId: string;
45
+ taskRevision: string;
46
+ }[]>;
47
+ reconcileEffect(input: InitiativeEffectReconciliation): Promise<{
48
+ effectObservation?: import("../kernel/initiative.ts").InitiativeEffectObservation | undefined;
49
+ reconciled: boolean;
50
+ taskAccepted: boolean;
51
+ executionAuthorized: boolean;
52
+ }>;
53
+ release(): Promise<void>;
54
+ /** Abandon only cooperative ownership; unresolved attempts remain durable and block takeover. */
55
+ close(): Promise<void>;
56
+ }>;
57
+ export type InitiativeCoordinator = Awaited<ReturnType<typeof acquireInitiativeCoordinator>>;
58
+ //# sourceMappingURL=initiative-coordinator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"initiative-coordinator.d.ts","sourceRoot":"","sources":["../../src/governance/initiative-coordinator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAExE,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAE3B,KAAK,qBAAqB,EAC1B,KAAK,8BAA8B,EACpC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EASL,KAAK,oBAAoB,EAC1B,MAAM,yBAAyB,CAAC;AAIjC,MAAM,WAAW,4BAA6B,SAAQ,oBAAoB;IACxE,eAAe,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxC,kHAAkH;IAClH,0BAA0B,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACrD;AACD,MAAM,WAAW,iBAAiB;IAChC,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,sBAAsB,CAAC;IAC9B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AACD,wBAAsB,4BAA4B,CAChD,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,4BAA4B;;;;;;;;;;;;;gBAsHrB,cAAc;gBAed,cAAc,aAAa,gBAAgB;qCA8BhB,cAAc,aAAa,gBAAgB;2BA0B3D,gBAAgB;mBAkB9B,sBAAsB,iBACd,cAAc,GAC5B,OAAO,CAAC,qBAAqB,GAAG;QAAE,MAAM,EAAE,aAAa,CAAA;KAAE,CAAC;;;;;;;;;;;;2BA8FtC,8BAA8B;;;;;;;IA0CrD,iGAAiG;;GAUtG;AACD,MAAM,MAAM,qBAAqB,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,4BAA4B,CAAC,CAAC,CAAC"}