pi-daddy 0.21.1 → 0.23.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 (411) hide show
  1. package/CHANGELOG.md +50 -1
  2. package/README.md +12 -7
  3. package/contracts/daily-view/v1/README.md +114 -0
  4. package/contracts/daily-view/v1/fixtures/view.json +525 -0
  5. package/contracts/daily-view/v1/fixtures/view.txt +75 -0
  6. package/contracts/daily-view/v1/fixtures/work.jsonl +17 -0
  7. package/contracts/daily-view/v1/p03/README.md +26 -0
  8. package/contracts/daily-view/v1/p03/fixtures/retained-executions.json +241 -0
  9. package/contracts/daily-view/v1/p03/projection.schema.json +194 -0
  10. package/contracts/daily-view/v1/p03/provenance.json +21 -0
  11. package/contracts/dashboard-host/v1/README.md +176 -0
  12. package/contracts/debrief/v1/README.md +146 -0
  13. package/contracts/debrief/v1/intervention/README.md +32 -0
  14. package/contracts/debrief/v1/intervention/fixtures/artifact-3ee11136beb864f518252e5024dae9197421fbf97b6e981d3243c782b5c44bd0.txt +1 -0
  15. package/contracts/debrief/v1/intervention/fixtures/artifact-58905d872dd3c54a9705f67b05fa82edbad7af6476ae8993faf1a7b9fadfb905.txt +1 -0
  16. package/contracts/debrief/v1/intervention/fixtures/assessment.json +29 -0
  17. package/contracts/debrief/v1/intervention/fixtures/blind-view.json +20 -0
  18. package/contracts/debrief/v1/intervention/fixtures/choice.json +7 -0
  19. package/contracts/debrief/v1/intervention/fixtures/manifest.json +57 -0
  20. package/contracts/debrief/v1/intervention/fixtures/reveal.json +39 -0
  21. package/contracts/debrief/v1/provenance.json +89 -0
  22. package/contracts/debrief/v1/work-capture/README.md +38 -0
  23. package/contracts/debrief/v1/work-capture/fixtures/batch.json +17 -0
  24. package/contracts/debrief/v1/work-capture/fixtures/cases.json +184 -0
  25. package/contracts/debrief/v1/work-capture/fixtures/review.json +184 -0
  26. package/contracts/debrief/v1/work-capture/review-request.schema.json +41 -0
  27. package/contracts/debrief/v1/work-capture/work-case.schema.json +190 -0
  28. package/contracts/debrief/v2/README.md +71 -0
  29. package/contracts/debrief/v2/input-pin.json +66 -0
  30. package/contracts/debrief/v2/intervention-upstream.md +40 -0
  31. package/contracts/debrief/v2/work-signals-upstream.md +22 -0
  32. package/contracts/dispatch-control/v1/README.md +109 -0
  33. package/contracts/dispatch-control/v1/request.schema.json +19 -0
  34. package/contracts/effect-profile/v1/README.md +124 -0
  35. package/contracts/execution-retention/v1/README.md +109 -0
  36. package/contracts/execution-retention/v2/README.md +148 -0
  37. package/contracts/execution-retention/v2/fixtures/interrupted-native-bytes.json +91 -0
  38. package/contracts/execution-retention/v2/fixtures/missing-native-session.json +91 -0
  39. package/contracts/execution-retention/v2/fixtures/native-file-unknown-branch.json +91 -0
  40. package/contracts/execution-retention/v2/fixtures/native-id-without-bytes.json +91 -0
  41. package/contracts/execution-retention/v2/fixtures/native-live-branch.json +90 -0
  42. package/contracts/execution-retention/v2/fixtures/replaced-native-session.json +92 -0
  43. package/contracts/execution-retention/v2/fixtures/result-82c620cdfeb8ca6b858cf653d7f5e2eedca5315d6244216d60e8b36f03223d6a.bin +1 -0
  44. package/contracts/execution-retention/v2/fixtures/session-2ec1f134bc739984434f7fca689e1c3d1c39fce2dcadae709e9b6faedfcc4ac7.bin +3 -0
  45. package/contracts/execution-retention/v2/fixtures/session-9bdb4bd16a901da31580acf056bda525225259e15ec409e0410480109011772f.bin +3 -0
  46. package/contracts/execution-retention/v2/manifest.schema.json +858 -0
  47. package/contracts/experiment/v1/README.md +164 -0
  48. package/contracts/factory-order/v1/README.md +151 -0
  49. package/contracts/factory-order/v1/adoption-pin.json +8 -0
  50. package/contracts/intent-control/v1/README.md +135 -0
  51. package/contracts/intent-control/v1/request.schema.json +1096 -0
  52. package/contracts/intent-control/v2/README.md +34 -0
  53. package/contracts/intent-control/v2/request.schema.json +1070 -0
  54. package/contracts/ledger/v3/fixtures/capability-decision.json +3 -4
  55. package/contracts/ledger/v3/fixtures/check-receipt.json +3 -4
  56. package/contracts/ledger/v3/fixtures/child-lifecycle.json +3 -4
  57. package/contracts/ledger/v3/fixtures/workflow-fact.json +3 -4
  58. package/contracts/ledger/v3/fixtures/workspace-lease.json +3 -4
  59. package/contracts/ledger/v3/ledger-event.schema.json +38 -13
  60. package/contracts/ledger/v4/README.md +241 -0
  61. package/contracts/ledger/v4/fixtures/layout-options.json +428 -0
  62. package/contracts/ledger/v4/fixtures/work-acceptance.json +57 -0
  63. package/contracts/ledger/v4/fixtures/work-occurrence.json +44 -0
  64. package/contracts/ledger/v4/fixtures/work-revision.json +26 -0
  65. package/contracts/ledger/v4/fixtures/work-snapshot.json +73 -0
  66. package/contracts/ledger/v4/ledger-event.schema.json +162 -0
  67. package/contracts/ordinary-control/v1/README.md +59 -0
  68. package/contracts/producer-ipc/v1/README.md +137 -0
  69. package/dist/check-runner.d.ts +5 -0
  70. package/dist/check-runner.d.ts.map +1 -1
  71. package/dist/check-runner.js +175 -149
  72. package/dist/check-runner.js.map +1 -1
  73. package/dist/control-journal.d.ts +20 -0
  74. package/dist/control-journal.d.ts.map +1 -0
  75. package/dist/control-journal.js +73 -0
  76. package/dist/control-journal.js.map +1 -0
  77. package/dist/correlation.d.ts +15 -4
  78. package/dist/correlation.d.ts.map +1 -1
  79. package/dist/correlation.js +40 -2
  80. package/dist/correlation.js.map +1 -1
  81. package/dist/daily-view-input.d.ts +44 -0
  82. package/dist/daily-view-input.d.ts.map +1 -0
  83. package/dist/daily-view-input.js +68 -0
  84. package/dist/daily-view-input.js.map +1 -0
  85. package/dist/daily-view-render.d.ts +4 -0
  86. package/dist/daily-view-render.d.ts.map +1 -0
  87. package/dist/daily-view-render.js +41 -0
  88. package/dist/daily-view-render.js.map +1 -0
  89. package/dist/daily-view.d.ts +74 -0
  90. package/dist/daily-view.d.ts.map +1 -0
  91. package/dist/daily-view.js +170 -0
  92. package/dist/daily-view.js.map +1 -0
  93. package/dist/dashboard-cli.d.ts +26 -1
  94. package/dist/dashboard-cli.d.ts.map +1 -1
  95. package/dist/dashboard-cli.js +121 -3
  96. package/dist/dashboard-cli.js.map +1 -1
  97. package/dist/dashboard-harness.d.ts +19 -0
  98. package/dist/dashboard-harness.d.ts.map +1 -0
  99. package/dist/dashboard-harness.js +75 -0
  100. package/dist/dashboard-harness.js.map +1 -0
  101. package/dist/dashboard-herdr.d.ts.map +1 -1
  102. package/dist/dashboard-herdr.js +7 -2
  103. package/dist/dashboard-herdr.js.map +1 -1
  104. package/dist/dashboard-host-contract.d.ts +111 -0
  105. package/dist/dashboard-host-contract.d.ts.map +1 -0
  106. package/dist/dashboard-host-contract.js +14 -0
  107. package/dist/dashboard-host-contract.js.map +1 -0
  108. package/dist/dashboard-host-transport.d.ts +15 -0
  109. package/dist/dashboard-host-transport.d.ts.map +1 -0
  110. package/dist/dashboard-host-transport.js +122 -0
  111. package/dist/dashboard-host-transport.js.map +1 -0
  112. package/dist/dashboard-host.d.ts +149 -0
  113. package/dist/dashboard-host.d.ts.map +1 -0
  114. package/dist/dashboard-host.js +329 -0
  115. package/dist/dashboard-host.js.map +1 -0
  116. package/dist/dashboard-observation.d.ts +28 -0
  117. package/dist/dashboard-observation.d.ts.map +1 -0
  118. package/dist/dashboard-observation.js +86 -0
  119. package/dist/dashboard-observation.js.map +1 -0
  120. package/dist/debrief-contract.d.ts +65 -0
  121. package/dist/debrief-contract.d.ts.map +1 -0
  122. package/dist/debrief-contract.js +151 -0
  123. package/dist/debrief-contract.js.map +1 -0
  124. package/dist/debrief-fixture.d.ts +16 -0
  125. package/dist/debrief-fixture.d.ts.map +1 -0
  126. package/dist/debrief-fixture.js +41 -0
  127. package/dist/debrief-fixture.js.map +1 -0
  128. package/dist/debrief-host.d.ts +59 -0
  129. package/dist/debrief-host.d.ts.map +1 -0
  130. package/dist/debrief-host.js +49 -0
  131. package/dist/debrief-host.js.map +1 -0
  132. package/dist/debrief-render.d.ts +5 -0
  133. package/dist/debrief-render.d.ts.map +1 -0
  134. package/dist/debrief-render.js +65 -0
  135. package/dist/debrief-render.js.map +1 -0
  136. package/dist/debrief.d.ts +90 -0
  137. package/dist/debrief.d.ts.map +1 -0
  138. package/dist/debrief.js +263 -0
  139. package/dist/debrief.js.map +1 -0
  140. package/dist/delegate-types.d.ts +2 -0
  141. package/dist/delegate-types.d.ts.map +1 -1
  142. package/dist/delegate-types.js.map +1 -1
  143. package/dist/delegate.d.ts.map +1 -1
  144. package/dist/delegate.js +1 -0
  145. package/dist/delegate.js.map +1 -1
  146. package/dist/delegation-approval.d.ts +2 -2
  147. package/dist/delegation-approval.d.ts.map +1 -1
  148. package/dist/delegation-approval.js +2 -0
  149. package/dist/delegation-approval.js.map +1 -1
  150. package/dist/dispatch-control.d.ts +45 -0
  151. package/dist/dispatch-control.d.ts.map +1 -0
  152. package/dist/dispatch-control.js +76 -0
  153. package/dist/dispatch-control.js.map +1 -0
  154. package/dist/effect-profile-runtime.d.ts +40 -0
  155. package/dist/effect-profile-runtime.d.ts.map +1 -0
  156. package/dist/effect-profile-runtime.js +51 -0
  157. package/dist/effect-profile-runtime.js.map +1 -0
  158. package/dist/effect-profile.d.ts +40 -0
  159. package/dist/effect-profile.d.ts.map +1 -0
  160. package/dist/effect-profile.js +152 -0
  161. package/dist/effect-profile.js.map +1 -0
  162. package/dist/execution-retention.d.ts +90 -0
  163. package/dist/execution-retention.d.ts.map +1 -0
  164. package/dist/execution-retention.js +247 -0
  165. package/dist/execution-retention.js.map +1 -0
  166. package/dist/experiment-contract.d.ts +56 -0
  167. package/dist/experiment-contract.d.ts.map +1 -0
  168. package/dist/experiment-contract.js +80 -0
  169. package/dist/experiment-contract.js.map +1 -0
  170. package/dist/experiment-state.d.ts +22 -0
  171. package/dist/experiment-state.d.ts.map +1 -0
  172. package/dist/experiment-state.js +79 -0
  173. package/dist/experiment-state.js.map +1 -0
  174. package/dist/experiment-store.d.ts +28 -0
  175. package/dist/experiment-store.d.ts.map +1 -0
  176. package/dist/experiment-store.js +130 -0
  177. package/dist/experiment-store.js.map +1 -0
  178. package/dist/experiment.d.ts +65 -0
  179. package/dist/experiment.d.ts.map +1 -0
  180. package/dist/experiment.js +357 -0
  181. package/dist/experiment.js.map +1 -0
  182. package/dist/factory-contract.d.ts +79 -0
  183. package/dist/factory-contract.d.ts.map +1 -0
  184. package/dist/factory-contract.js +89 -0
  185. package/dist/factory-contract.js.map +1 -0
  186. package/dist/factory-migration.d.ts +20 -0
  187. package/dist/factory-migration.d.ts.map +1 -0
  188. package/dist/factory-migration.js +55 -0
  189. package/dist/factory-migration.js.map +1 -0
  190. package/dist/factory-order.d.ts +848 -0
  191. package/dist/factory-order.d.ts.map +1 -0
  192. package/dist/factory-order.js +83 -0
  193. package/dist/factory-order.js.map +1 -0
  194. package/dist/factory-registry.d.ts +121 -0
  195. package/dist/factory-registry.d.ts.map +1 -0
  196. package/dist/factory-registry.js +133 -0
  197. package/dist/factory-registry.js.map +1 -0
  198. package/dist/file-lock.d.ts +8 -2
  199. package/dist/file-lock.d.ts.map +1 -1
  200. package/dist/file-lock.js +78 -19
  201. package/dist/file-lock.js.map +1 -1
  202. package/dist/finalization.d.ts +15 -0
  203. package/dist/finalization.d.ts.map +1 -0
  204. package/dist/finalization.js +65 -0
  205. package/dist/finalization.js.map +1 -0
  206. package/dist/git-identity.d.ts.map +1 -1
  207. package/dist/git-identity.js +18 -15
  208. package/dist/git-identity.js.map +1 -1
  209. package/dist/grant-store.d.ts +13 -0
  210. package/dist/grant-store.d.ts.map +1 -1
  211. package/dist/grant-store.js +48 -25
  212. package/dist/grant-store.js.map +1 -1
  213. package/dist/herdr-poll.d.ts +8 -0
  214. package/dist/herdr-poll.d.ts.map +1 -1
  215. package/dist/herdr-poll.js +23 -0
  216. package/dist/herdr-poll.js.map +1 -1
  217. package/dist/index.d.ts +20 -0
  218. package/dist/index.d.ts.map +1 -1
  219. package/dist/index.js +20 -0
  220. package/dist/index.js.map +1 -1
  221. package/dist/init.d.ts.map +1 -1
  222. package/dist/init.js +2 -6
  223. package/dist/init.js.map +1 -1
  224. package/dist/intent-application.d.ts +17 -0
  225. package/dist/intent-application.d.ts.map +1 -0
  226. package/dist/intent-application.js +113 -0
  227. package/dist/intent-application.js.map +1 -0
  228. package/dist/intent-control.d.ts +201 -0
  229. package/dist/intent-control.d.ts.map +1 -0
  230. package/dist/intent-control.js +110 -0
  231. package/dist/intent-control.js.map +1 -0
  232. package/dist/intent-scheduling.d.ts +9 -0
  233. package/dist/intent-scheduling.d.ts.map +1 -0
  234. package/dist/intent-scheduling.js +15 -0
  235. package/dist/intent-scheduling.js.map +1 -0
  236. package/dist/ledger-append.d.ts +15 -0
  237. package/dist/ledger-append.d.ts.map +1 -0
  238. package/dist/ledger-append.js +94 -0
  239. package/dist/ledger-append.js.map +1 -0
  240. package/dist/ledger.d.ts +11 -0
  241. package/dist/ledger.d.ts.map +1 -1
  242. package/dist/ledger.js +3 -7
  243. package/dist/ledger.js.map +1 -1
  244. package/dist/model-preflight.d.ts +8 -0
  245. package/dist/model-preflight.d.ts.map +1 -0
  246. package/dist/model-preflight.js +20 -0
  247. package/dist/model-preflight.js.map +1 -0
  248. package/dist/native-session-target.d.ts +9 -0
  249. package/dist/native-session-target.d.ts.map +1 -0
  250. package/dist/native-session-target.js +29 -0
  251. package/dist/native-session-target.js.map +1 -0
  252. package/dist/native-session.d.ts +59 -0
  253. package/dist/native-session.d.ts.map +1 -0
  254. package/dist/native-session.js +154 -0
  255. package/dist/native-session.js.map +1 -0
  256. package/dist/order-schedule.d.ts +37 -0
  257. package/dist/order-schedule.d.ts.map +1 -0
  258. package/dist/order-schedule.js +81 -0
  259. package/dist/order-schedule.js.map +1 -0
  260. package/dist/ordinary-children.d.ts +52 -0
  261. package/dist/ordinary-children.d.ts.map +1 -0
  262. package/dist/ordinary-children.js +93 -0
  263. package/dist/ordinary-children.js.map +1 -0
  264. package/dist/producer-ipc-contract.d.ts +29 -0
  265. package/dist/producer-ipc-contract.d.ts.map +1 -0
  266. package/dist/producer-ipc-contract.js +29 -0
  267. package/dist/producer-ipc-contract.js.map +1 -0
  268. package/dist/producer-ipc.d.ts +55 -0
  269. package/dist/producer-ipc.d.ts.map +1 -0
  270. package/dist/producer-ipc.js +143 -0
  271. package/dist/producer-ipc.js.map +1 -0
  272. package/dist/refusals.d.ts +1 -1
  273. package/dist/refusals.d.ts.map +1 -1
  274. package/dist/refusals.js +2 -0
  275. package/dist/refusals.js.map +1 -1
  276. package/dist/resource-budget.d.ts +334 -0
  277. package/dist/resource-budget.d.ts.map +1 -0
  278. package/dist/resource-budget.js +415 -0
  279. package/dist/resource-budget.js.map +1 -0
  280. package/dist/retention-contract.d.ts +73 -0
  281. package/dist/retention-contract.d.ts.map +1 -0
  282. package/dist/retention-contract.js +104 -0
  283. package/dist/retention-contract.js.map +1 -0
  284. package/dist/retention-json.d.ts +3 -0
  285. package/dist/retention-json.d.ts.map +1 -0
  286. package/dist/retention-json.js +32 -0
  287. package/dist/retention-json.js.map +1 -0
  288. package/dist/run-child.d.ts +4 -0
  289. package/dist/run-child.d.ts.map +1 -1
  290. package/dist/run-child.js +16 -2
  291. package/dist/run-child.js.map +1 -1
  292. package/dist/run-herdr.d.ts +6 -0
  293. package/dist/run-herdr.d.ts.map +1 -1
  294. package/dist/run-herdr.js +25 -11
  295. package/dist/run-herdr.js.map +1 -1
  296. package/dist/vendor/adoption.d.ts +129 -0
  297. package/dist/vendor/adoption.d.ts.map +1 -0
  298. package/dist/vendor/adoption.js +102 -0
  299. package/dist/vendor/adoption.js.map +1 -0
  300. package/dist/work-ledger-destination.d.ts +20 -0
  301. package/dist/work-ledger-destination.d.ts.map +1 -0
  302. package/dist/work-ledger-destination.js +131 -0
  303. package/dist/work-ledger-destination.js.map +1 -0
  304. package/dist/work-ledger-json.d.ts +25 -0
  305. package/dist/work-ledger-json.d.ts.map +1 -0
  306. package/dist/work-ledger-json.js +267 -0
  307. package/dist/work-ledger-json.js.map +1 -0
  308. package/dist/work-ledger-occurrences.d.ts +227 -0
  309. package/dist/work-ledger-occurrences.d.ts.map +1 -0
  310. package/dist/work-ledger-occurrences.js +115 -0
  311. package/dist/work-ledger-occurrences.js.map +1 -0
  312. package/dist/work-ledger-projection.d.ts +295 -0
  313. package/dist/work-ledger-projection.d.ts.map +1 -0
  314. package/dist/work-ledger-projection.js +237 -0
  315. package/dist/work-ledger-projection.js.map +1 -0
  316. package/dist/work-ledger-snapshot.d.ts +29 -0
  317. package/dist/work-ledger-snapshot.d.ts.map +1 -0
  318. package/dist/work-ledger-snapshot.js +267 -0
  319. package/dist/work-ledger-snapshot.js.map +1 -0
  320. package/dist/work-ledger-types.d.ts +261 -0
  321. package/dist/work-ledger-types.d.ts.map +1 -0
  322. package/dist/work-ledger-types.js +13 -0
  323. package/dist/work-ledger-types.js.map +1 -0
  324. package/dist/work-ledger-validation.d.ts +14 -0
  325. package/dist/work-ledger-validation.d.ts.map +1 -0
  326. package/dist/work-ledger-validation.js +226 -0
  327. package/dist/work-ledger-validation.js.map +1 -0
  328. package/dist/work-ledger.d.ts +43 -0
  329. package/dist/work-ledger.d.ts.map +1 -0
  330. package/dist/work-ledger.js +225 -0
  331. package/dist/work-ledger.js.map +1 -0
  332. package/extensions/chain-plan.ts +16 -0
  333. package/extensions/correlation-shape.ts +39 -0
  334. package/extensions/delegate-chain.ts +10 -14
  335. package/extensions/delegation-native.ts +12 -0
  336. package/extensions/delegation.ts +6 -27
  337. package/extensions/execute-child.ts +42 -5
  338. package/extensions/grant-store-refusal.ts +36 -0
  339. package/extensions/grants.ts +8 -0
  340. package/extensions/ordinary-runtime.ts +14 -0
  341. package/extensions/run-delegation.ts +28 -9
  342. package/extensions/session.ts +18 -6
  343. package/extensions/stored-grant-session.ts +33 -0
  344. package/package.json +80 -4
  345. package/src/check-runner.ts +76 -46
  346. package/src/control-journal.ts +26 -0
  347. package/src/correlation.ts +55 -6
  348. package/src/daily-view-input.ts +59 -0
  349. package/src/daily-view-render.ts +44 -0
  350. package/src/daily-view.ts +152 -0
  351. package/src/dashboard-cli.ts +103 -4
  352. package/src/dashboard-harness.ts +28 -0
  353. package/src/dashboard-herdr.ts +7 -2
  354. package/src/dashboard-host-contract.ts +42 -0
  355. package/src/dashboard-host-transport.ts +38 -0
  356. package/src/dashboard-host.ts +168 -0
  357. package/src/dashboard-observation.ts +44 -0
  358. package/src/debrief-contract.ts +127 -0
  359. package/src/debrief-fixture.ts +29 -0
  360. package/src/debrief-host.ts +53 -0
  361. package/src/debrief-render.ts +49 -0
  362. package/src/debrief.ts +198 -0
  363. package/src/delegate-types.ts +2 -0
  364. package/src/delegate.ts +1 -0
  365. package/src/delegation-approval.ts +4 -2
  366. package/src/dispatch-control.ts +81 -0
  367. package/src/effect-profile-runtime.ts +46 -0
  368. package/src/effect-profile.ts +129 -0
  369. package/src/execution-retention.ts +230 -0
  370. package/src/experiment-contract.ts +66 -0
  371. package/src/experiment-state.ts +44 -0
  372. package/src/experiment-store.ts +90 -0
  373. package/src/experiment.ts +231 -0
  374. package/src/factory-contract.ts +47 -0
  375. package/src/factory-migration.ts +29 -0
  376. package/src/factory-order.ts +56 -0
  377. package/src/factory-registry.ts +60 -0
  378. package/src/file-lock.ts +47 -11
  379. package/src/finalization.ts +79 -0
  380. package/src/git-identity.ts +20 -16
  381. package/src/grant-store.ts +55 -25
  382. package/src/herdr-poll.ts +18 -0
  383. package/src/index.ts +32 -0
  384. package/src/init.ts +5 -5
  385. package/src/intent-application.ts +90 -0
  386. package/src/intent-control.ts +107 -0
  387. package/src/intent-scheduling.ts +14 -0
  388. package/src/ledger-append.ts +72 -0
  389. package/src/ledger.ts +3 -9
  390. package/src/model-preflight.ts +32 -0
  391. package/src/native-session-target.ts +23 -0
  392. package/src/native-session.ts +139 -0
  393. package/src/order-schedule.ts +42 -0
  394. package/src/ordinary-children.ts +59 -0
  395. package/src/producer-ipc-contract.ts +26 -0
  396. package/src/producer-ipc.ts +107 -0
  397. package/src/refusals.ts +2 -0
  398. package/src/resource-budget.ts +349 -0
  399. package/src/retention-contract.ts +84 -0
  400. package/src/retention-json.ts +20 -0
  401. package/src/run-child.ts +13 -2
  402. package/src/run-herdr.ts +17 -11
  403. package/src/vendor/adoption.ts +109 -0
  404. package/src/work-ledger-destination.ts +113 -0
  405. package/src/work-ledger-json.ts +228 -0
  406. package/src/work-ledger-occurrences.ts +99 -0
  407. package/src/work-ledger-projection.ts +262 -0
  408. package/src/work-ledger-snapshot.ts +246 -0
  409. package/src/work-ledger-types.ts +229 -0
  410. package/src/work-ledger-validation.ts +174 -0
  411. package/src/work-ledger.ts +186 -0
package/CHANGELOG.md CHANGED
@@ -12,12 +12,61 @@ the record of how the package got here and are worth keeping; they are not worth
12
12
  > the record of how the package arrived at what it does, and because the reasoning behind each one is
13
13
  > usually the clearest statement of why the current behaviour is what it is.
14
14
 
15
+ ## 0.23.0 — bounded factory control and retained evidence (2026-09-11)
16
+
17
+ - Add an opt-in work-ledger v4 contract, strict builders/readers, deterministic fixtures and explicit
18
+ authority-scoped projection. Ledger v3 remains the default governance format; existing v2/v3 paths and
19
+ behavior are unchanged.
20
+ - Add opt-in execution retention for exact available process, Herdr and native-session evidence without
21
+ converting runtime completion into acceptance or claiming unavailable bytes.
22
+ - Add one fixed `linux-bwrap-digest-v1` effect profile with durable aggregate attempt/input/concurrency
23
+ accounting. It executes package-owned digest/hold code only; arbitrary shell/model profiles, shared
24
+ writable destinations and aggregate CPU/memory/money enforcement remain unsupported.
25
+ - Add versioned resource dispatch and work-intent controls, bounded experiments and factory orders. Exact
26
+ authority, CAS, quiescence, reservation and acknowledgement boundaries fail closed; unknown ownership is
27
+ never replayed, refunded or inferred as success.
28
+ - Add read-only daily projections, retained blind debrief/checkpoint adapters and an explicit dashboard host
29
+ transport over a private bounded socket. Presentation, steering and cancellation require independently
30
+ supplied exact authority; refresh remains read-only and does not authenticate a human or module.
31
+ - Retain original ordinary-child cancellation handles and intent admission holds without replacing caller
32
+ lifetimes. Best-effort terminal observation failure stays visible but no longer permanently poisons a
33
+ known-settled boundary; required failure, unknown ownership and late coverage still refuse quiescence.
34
+ - Reject benign stale dashboard CAS and immutable-ID mismatches without poisoning the host before any
35
+ claim/effect. Attempted or uncertain effects retain the existing failed/unknown stop.
36
+ - Remove each newly owned native-profile probe fixture after all probe children settle, on success and
37
+ failure, without sweeping historical or caller-selected directories.
38
+ - CI now provisions bubblewrap on its ephemeral Ubuntu 26.04 preview runners, records bounded runtime
39
+ diagnostics and stages a verified job-owned Node runtime. These observations do not establish a general
40
+ sandbox or a new supported-host guarantee.
41
+ - Add public subpath exports and versioned artifacts for the new work-ledger, resource, experiment,
42
+ factory-order, effect-profile, retention, debrief and dashboard-host APIs. The workspace root remains
43
+ private; `pi-daddy` is the only published package. No dependency ranges changed.
44
+
45
+ ## 0.22.0 — fail-closed audit follow-ups (2026-09-04)
46
+
47
+ - **BREAKING — invalid project stores now fail closed.** Malformed, unsupported, unreadable and wrong-directory
48
+ stores never restore the ungoverned wildcard; `GRANT_STORE_INVALID` records the safety stop. Repair the store
49
+ or deliberately rerun `/grants init` rather than relying on invalid state being treated as absent.
50
+ - **BREAKING — explicit delegation models are resolved before any side effect.** Models absent from pi's session
51
+ catalogue refuse as `MODEL_UNRESOLVED`. Register custom models with pi, or deliberately set the operator
52
+ escape hatch `PI_GRANTS_ALLOW_UNRESOLVED_MODELS=1`.
53
+ - **BREAKING — correlation inputs are narrower.** `schema_version`, when present, must be exactly `"1.0"`, and
54
+ `assurance_scope` must use the closed entire-run/selectors union instead of arbitrary JSON. Strict ledger-v3
55
+ consumers must re-pin to the regenerated schema and fixtures, which also add `GRANT_STORE_INVALID` and
56
+ `MODEL_UNRESOLVED` to the refusal enum.
57
+ - Supplied `tree_sha` and `last_change_seq` now narrow exact approval reuse. `@types/node >=22` is declared as
58
+ a peer because the public declarations use `NodeJS.*`.
59
+ - Primary operation errors are preserved when Herdr, named-check, Git-index, or init cleanup also fails. Every
60
+ finalizer still runs and its failures remain visible; an attached Herdr close failure still retains the
61
+ workspace writer lease.
62
+ - CI runs the model-free, Herdr-free real-pi integration tier.
63
+
15
64
  ## 0.21.1 — twenty-minute default child timeout (2026-09-02)
16
65
 
17
66
  - Raise the default per-child wall-clock limit from 600 to 1200 seconds. Explicit
18
67
  `PI_GRANTS_CHILD_TIMEOUT` values remain unchanged and inherited by descendants.
19
68
 
20
- ## 0.21.0 — one project init enables its ledger (2026-09-01)
69
+ ## 0.21.0 — one project init enables its ledger (2026-09-02)
21
70
 
22
71
  - `/grants init` now atomically persists one project choice containing both the capability grant and default
23
72
  `.pi/grants.jsonl`, then adopts both after that write succeeds. Future plain `pi` starts load both, so
package/README.md CHANGED
@@ -141,7 +141,7 @@ A delegator that legitimately holds `fabric_exec` and knowingly wants a child to
141
141
  that child. `assertNarrowing`'s `allowUniversal` flag exists but is deliberately not plumbed through; the
142
142
  first real need for that override is the evidence it should be added.
143
143
 
144
- ## The two tools
144
+ ## The three tools
145
145
 
146
146
  ```
147
147
  delegate({ task: "summarise src/", agent: "docs-writer" }) // preferred: an operator-authored definition
@@ -156,7 +156,7 @@ delegate_all({ children: [ {…}, {…}, {…} ] }) // several
156
156
  - **Spawning is itself a capability.** Grant `delegate` and the child can sub-delegate; withhold it and the
157
157
  child is a leaf — the extension is only passed to children that hold it, so the machinery isn't even
158
158
  present. `PI_GRANTS_MAX_DEPTH` remains a backstop.
159
- - **A refusal is a tool *error*, not an answer.** Both tools throw, because `AgentToolResult` has **no
159
+ - **A refusal is a tool *error*, not an answer.** All three tools throw, because `AgentToolResult` has **no
160
160
  `isError` field** — pi sets it only when `execute` throws, and a normal return is hardcoded
161
161
  `isError: false`. Until 0.5.0 the tool returned `isError: true`, which was silently discarded, so every
162
162
  refusal this package made was recorded by pi as a **successful** tool call. Found by the integration suite
@@ -593,6 +593,7 @@ everything below it.
593
593
  | `PI_GRANTS_WORKSPACE_REGISTRY` | unset | Operator-owned `{version:1, workspaces:{id:{path}}}` file, required only for workspace-routed spawns. |
594
594
  | `PI_GRANTS_WORKSPACE_LEASE_DIR` | under `$PI_CODING_AGENT_DIR/pi-daddy/` | Kernel writer locks and ownership metadata. |
595
595
  | `PI_GRANTS_CHILD_TIMEOUT` | `1200` (seconds) | Wall-clock limit for a child. Inherited by descendants — an operator preference, deliberately *not* attenuating state. |
596
+ | `PI_GRANTS_ALLOW_UNRESOLVED_MODELS` | unset | Exact `1` lets pi attempt custom model resolution; otherwise an explicit provider/id missing from pi's session catalogue refuses before lease, approval or spawn. |
596
597
  | `PI_GRANTS_FANOUT` | `8` | Per-call width and downward subtree budget; not a session-total counter. Malformed or `0` falls back to the default. |
597
598
  | `PI_GRANTS_PARENT_ID` | `d0` | Readable logical tree position; set by the parent and allowed to repeat across calls. |
598
599
  | `PI_GRANTS_EXECUTION_ID` | unset at a root | Unique governed execution occurrence; set by the parent. Lifecycle/lease joins use this, never `PI_GRANTS_PARENT_ID`. |
@@ -601,7 +602,9 @@ everything below it.
601
602
  | `PI_GRANTS_HERDR_KEEP_PANE` | unset | `1` keeps each child's pane for inspection, and no sweep closes it. Off by default: a fan-out would flood the workspace. |
602
603
  | `PI_CODING_AGENT_DIR` | `~/.pi/agent` | pi's own variable, not ours — but it decides where stored project grants/ledger consent and persisted approvals live. |
603
604
 
604
- **A malformed value disables spawning; it never falls back to a default.** An unreadable
605
+ **A malformed value disables spawning; it never falls back to a default.** Stored grants are likewise
606
+ tri-state: only a missing file is opt-out; malformed, unsupported-version, unreadable or wrong-cwd state is a
607
+ loud empty-grant session with a `GRANT_STORE_INVALID` ledger line. An unreadable
605
608
  `PI_GRANTS_MAX_DEPTH` or `PI_GRANTS_DEPTH` yields `maxDepth: 0` and a startup warning naming the
606
609
  variable. Before 0.5.0 these were read with `parseInt`, which accepts numeric prefixes (`"2abc"` → `2`)
607
610
  and otherwise gives `NaN` — and since every comparison against `NaN` is false, a typo did not tighten the
@@ -632,8 +635,10 @@ timed out. A pending running append always lands before a terminal event. `denie
632
635
  is invisible without a record.**
633
636
 
634
637
  Workflow facts are identifier-only and mark `planned`, `observed`, or `controller_validated`; they can never
635
- claim pi-daddy enforcement. Capability/lifecycle records are the enforced class. Correlation remains a
636
- caller-declared label; fields eligible for display must use the v3 ASCII identifier grammar rather than prose.
638
+ claim pi-daddy enforcement. Capability/lifecycle records are the enforced class. Correlation remains
639
+ caller-declared: optional `schema_version` is exactly `1.0`, and `assurance_scope` is either entire-run with an
640
+ empty selector list or selectors with one or more non-empty strings. Fields eligible for display use the v3
641
+ ASCII identifier grammar rather than prose.
637
642
 
638
643
  **Privacy is a property of this file, and the boundary is exact: capability ids, counts and identifiers only
639
644
  — never prompts, task text, tool arguments or results.** Trusted `definitionDigest` and `taskDigest` values
@@ -784,9 +789,9 @@ every in-repo test passed. `npm run test:smoke` packs a tarball, installs it int
784
789
  ## Testing
785
790
 
786
791
  ```bash
787
- npm test # 719 unit tests. Fast, pure, no pi, no network.
792
+ npm test # 741 unit tests. Fast, pure, no pi, no network.
788
793
  npm run typecheck # src + extensions + tests + integration tests
789
- npm run test:integration # 45 tests against a REAL pi process. ~55s, no model tokens.
794
+ npm run test:integration # 48 tests against a REAL pi process/Herdr server, no model tokens.
790
795
  npm run test:smoke # pack/install; exercise library exports, both bins, the v2/v3 contracts,
791
796
  # bundled Herdr plugin, dashboard, and `pi-daddy init`
792
797
  PI_GRANTS_IT_MODEL=1 npm run test:integration # + 10 end-to-end tests with a real model. Costs money.
@@ -0,0 +1,114 @@
1
+ # P04 daily read-model v1 — input for P07/P08
2
+
3
+ Implemented candidate, local only. Independent overall review and formal acceptance remain pending.
4
+ This is an actual read-only path through the existing `pi-daddy-dashboard` CLI/Herdr plugin, not a control
5
+ API or an accepted-work counter derived from archive exits. P05 targeted control remains unavailable here.
6
+
7
+ The authority snapshot has its OWN identity namespace, distinct from the selected work snapshot.
8
+ Current/stale applicability derives from actual P01 claim/selection/matched-receipt validation, not equality
9
+ of those IDs/digests. Missing authority and superseded/mismatched receipts cannot carry acceptance forward.
10
+ The real walking P01 fixture with distinct identities is covered; P01 validation itself is unchanged.
11
+
12
+ ## Pinned P03 input, independent P01 authority
13
+
14
+ `p03/` vendors exact immutable Git blobs from skill-harness
15
+ `a311df8c991108ada7b6f4b901332232a78e9a44`. `p03/provenance.json` records paths/SHA256. Those schema/fixture
16
+ bytes are unchanged. Input version is exactly `execution-archive-projection-v1`; the reader rejects other
17
+ versions, duplicate JSON members/execution identities, contradictory terminal shapes and lossy numeric
18
+ forms. It supports the adapter's emitted integer-token subset. P03 is always partial/not-assessed.
19
+
20
+ Work intent is rebuilt with existing `projectWorkLedger` from separately configured strict work-v4 bytes.
21
+ Exact selected scope/obligation revisions and occurrence bindings attach attempts by **executionId**, not
22
+ child names, output labels, file tails, sessions or timestamps. Claimed P03 runtime and P01 runtime remain
23
+ separate; disagreements are diagnostic. P03 conflicts neither grant nor revoke independently supplied P01
24
+ acceptance. All active branches remain null, even if P01 labels or P03 reported sessions contain other hints.
25
+
26
+ Only a genuine host supplies `workContext` to `readDailyView`/`dashboardFrame`. The reader detaches it before
27
+ I/O and invokes P01 validation; it never manufactures decisions/availability from claims or loads authority
28
+ from a file/environment variable. Missing authority or authority for another selection means unresolved
29
+ acceptance, not zero completed work. Accepted results are explicitly **under supplied snapshot authority**,
30
+ not fresh native approval. The host must independently establish availability/authority when resupplying it.
31
+
32
+ ## Existing view path
33
+
34
+ The existing plugin command still calls `runDashboard`. Operator-only read settings are forwarded by its
35
+ existing open/reuse seam (no new plugin, worker hook or installation flow):
36
+
37
+ - `PI_DADDY_ARCHIVE_PROJECTION`: exact P03 snapshot file.
38
+ - `PI_DADDY_WORK_LEDGER`: exact separate work-v4 file.
39
+ - `PI_DADDY_WORK_SNAPSHOT`: JSON containing P01's exact `{snapshot:{id,digest},event:{eventId,digest}}` selection.
40
+ This is selection **only**, never authority. Pane reuse keys include these settings and their CWD.
41
+
42
+ CLI equivalents are `--archive-projection`, `--work-ledger`, `--work-snapshot`, plus `--once --no-color` or
43
+ `--once --daily-json`. No new files are discovered, installed or written by a status read. Legacy dashboard
44
+ behavior is unchanged when no daily input is configured. Existing core/plugin protocol validation remains.
45
+ Without a programmatic host-authority context the CLI intentionally cannot show authoritative acceptance.
46
+
47
+ ```ts
48
+ import { readDailyView, createDailyViewReader } from 'pi-daddy/daily-view';
49
+ const read = createDailyViewReader(); // session-local gap metadata, not an authority store
50
+ const view = await read({ archiveProjectionPath, workLedgerPath, workContext: independentlyVerifiedP01Context,
51
+ sourceManifestFiles: policyAuthorizedManifestPathsBySha256 });
52
+ // renderDailyView(view) is exported from the package root; dashboardFrame({cwd, dailyView: options})
53
+ // invokes the same reader/render path. Rendering an arbitrary caller object is not validation.
54
+ ```
55
+
56
+ ## Output contract
57
+
58
+ `version: "pi-daddy-daily-view-v1"`, `readOnly:true`, `freshness:"snapshot-unknown"`, `coverage:"partial"`.
59
+ Public TypeScript types: `DailyView`, `DailyObligation`, `DailyAttempt`, `DailyViewOptions` in `src/daily-view.ts`.
60
+ The deterministic `fixtures/view.json` and `fixtures/view.txt` are emitted by the actual reader/renderer.
61
+
62
+ - `scope` is an exact P01 revision or null; `selectedSnapshot` retains the exact selection references.
63
+ - `scopeState`, `authority`, and nullable `progress` are independent of runtime counts. Authority is
64
+ unavailable, stale-for-selection, or supplied-host-context. Obligations include intent/policy revisions,
65
+ acceptance, unstarted/attached activity, artifact/evidence coverage, matched receipt IDs, claim sources
66
+ and obstacle codes. IDs are shown because work-v4 has no verified human description text here.
67
+ - `attempts` preserves exact execution identity, P01 logical child/runtime and separate validated P03 row
68
+ (parents/public calls/archive IDs/reported sessions/outcome/issues). Reused child names stay separate.
69
+ `activeBranch` is always null. An archive exit0, including failed-control exit0, is never acceptance.
70
+ - `sourceAvailability` requires actual caller-authorized bytes matching each SHA256. No projection-supplied
71
+ path/URL is read. Missing mappings/deleted files are missing; mismatches/errors are not recovered facts.
72
+ Raw-manifest availability does not independently revalidate native transcript/check blobs or provenance.
73
+ - Check/evidence detail comes from P01's authority-aware coverage/receipt matching. P03 v1 has no named-check
74
+ receipt byte payload; that gap is printed, not inferred from a terminal result or an absent issue string.
75
+ - `sources` reports read/missing/error/unconfigured and exact file hashes. `issues` and `narrative` carry
76
+ deterministic coverage/obstacle explanations. No raw invalid input/error excerpts are rendered.
77
+
78
+ Reads are bounded regular non-symlink descriptor snapshots (4 MiB P03, 16 MiB work; at most 128 explicitly
79
+ mapped 64 KiB source manifests). Descriptor/path changes during read become errors. Every refresh rereads
80
+ rather than extending a cached execution history. Missing/error frames do not retain old runtime rows.
81
+ Reconnect produces a resnapshot and sticky gap label, never invented continuity. A new process starts with
82
+ an initial snapshot, not recovered history. Mtime is only a consistency check, never freshness or branch
83
+ proof. Rendering strips terminal control characters and caps lines/columns with visible omissions.
84
+
85
+ ## Supported and BLOCKED scope
86
+
87
+ Supported: deterministic file-backed read-only view, real CLI and freshly isolated compiled plugin-command
88
+ execution, plus fixture transport wiring through the existing plugin open seam. No worker/model/native-gate
89
+ call is needed. Repeated reads preserve session/control bytes and message counts; disconnected/unavailable
90
+ models do not prevent useful status. Model connectivity itself remains unknown, not falsely "connected".
91
+
92
+ **BLOCKED live qualification:** no deployed P03 live archive policy/subscription or actual passive live
93
+ transport freshness was supplied. No live Herdr pane/worker observation is claimed; no terminal read,
94
+ scroll, monitoring prompt or control message was used. Installed smoke is separate from isolated compiled
95
+ checks. Full native session/active-branch gaps from P02 and P06's arbitrary-shell/shared-write/aggregate
96
+ CPU-memory-PID-money limitations remain. No accepted packet, fresh source, steering, dispatch or recovery
97
+ can be inferred from the daily view. P07/P08 must preserve these distinctions.
98
+
99
+ ## Fixtures and reproduction
100
+
101
+ The fixture combines three fixed P01 obligations, two independently reconstructed fixture decisions and
102
+ one exited-but-unaccepted obligation with the exact six-row P03 fixture. P01's known branch labels are
103
+ explicit **test-world declarations**, not authentication of P03's unknown live branches. No authority is
104
+ constructed from incoming wire claims. Separate tests cover unstarted work, missing evidence, changed
105
+ scope/stale authority, unavailable sources, reconnect gaps and read-only repeated operation.
106
+
107
+ ```sh
108
+ node --test packages/pi-daddy/test/daily-view.test.ts
109
+ node packages/pi-daddy/scripts/generate-daily-view-fixture.ts --check packages/pi-daddy/contracts/daily-view/v1/fixtures /absolute/owned/scratch-parent
110
+ ```
111
+
112
+ The generator is repository fixture tooling, imports read-only and writes only explicit owned scratch/new
113
+ targets. Check does not change published fixtures; scratch is retained for inspection. No install, model
114
+ call, per-task review loop, mutation machinery or automatic authority/store update is involved.