@llblab/pi-actors 0.45.1 → 0.46.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (228) hide show
  1. package/AGENTS.md +9 -7
  2. package/BACKLOG.md +582 -0
  3. package/CHANGELOG.md +17 -1
  4. package/README.md +27 -13
  5. package/dist/fixtures/protocol/recipe-summary.json +1 -1
  6. package/dist/index.js +1 -1
  7. package/dist/lib/async-runs.d.ts +5 -1
  8. package/dist/lib/async-runs.js +26 -24
  9. package/dist/lib/automatic-review-runtime.d.ts +2 -0
  10. package/dist/lib/automatic-review-runtime.js +12 -5
  11. package/dist/lib/draft-sleep.js +0 -1
  12. package/dist/lib/execution.d.ts +1 -0
  13. package/dist/lib/execution.js +1 -0
  14. package/dist/lib/extension-runtime.d.ts +1 -1
  15. package/dist/lib/extension-runtime.js +26 -4
  16. package/dist/lib/inspector.js +46 -7
  17. package/dist/lib/paths.d.ts +0 -1
  18. package/dist/lib/paths.js +0 -7
  19. package/dist/lib/prompts.d.ts +1 -1
  20. package/dist/lib/prompts.js +4 -4
  21. package/dist/lib/recipes-context.d.ts +12 -3
  22. package/dist/lib/recipes-context.js +30 -6
  23. package/dist/lib/recipes-discovery.d.ts +18 -0
  24. package/dist/lib/recipes-discovery.js +95 -22
  25. package/dist/lib/recipes-references.d.ts +42 -9
  26. package/dist/lib/recipes-references.js +248 -135
  27. package/dist/lib/registry.d.ts +14 -1
  28. package/dist/lib/registry.js +110 -87
  29. package/dist/lib/runtime.d.ts +30 -4
  30. package/dist/lib/runtime.js +74 -12
  31. package/dist/lib/tools-inspect.d.ts +3 -1
  32. package/dist/lib/tools-inspect.js +56 -9
  33. package/dist/lib/tools-local.d.ts +2 -0
  34. package/dist/lib/tools-local.js +5 -2
  35. package/dist/lib/tools-response.js +2 -0
  36. package/dist/lib/tools-spawn.d.ts +2 -0
  37. package/dist/lib/tools-spawn.js +24 -52
  38. package/dist/lib/tools.d.ts +4 -1
  39. package/dist/lib/tools.js +2 -0
  40. package/dist/scripts/build-dist.mjs +13 -4
  41. package/dist/skills/actors/SKILL.md +8 -8
  42. package/dist/skills/actors/recipes/recipe-validate.json +11 -0
  43. package/{recipes/utility-coordinator-lock-snapshot.json → dist/skills/actors/recipes/resource-locker-snapshot.json} +1 -3
  44. package/dist/{recipes → skills/actors/recipes}/resource-locker.json +1 -3
  45. package/dist/{recipes/utility-run-ops-snapshot.json → skills/actors/recipes/run-ops-snapshot.json} +1 -3
  46. package/dist/skills/actors/recipes/run-summary.json +9 -0
  47. package/dist/{scripts/locker.mjs → skills/actors/scripts/resource-locker.mjs} +2 -2
  48. package/dist/skills/actors/scripts/run-utils.mjs +164 -0
  49. package/{scripts → dist/skills/actors/scripts}/validate-recipe.mjs +134 -17
  50. package/dist/skills/artifacts/SKILL.md +16 -0
  51. package/{recipes/pipeline-artifact-bundle.json → dist/skills/artifacts/recipes/bundle.json} +4 -4
  52. package/dist/{recipes/utility-artifact-write.json → skills/artifacts/recipes/file-write.json} +1 -3
  53. package/dist/{recipes/utility-artifact-manifest.json → skills/artifacts/recipes/manifest.json} +1 -3
  54. package/{recipes/pipeline-artifact-report.json → dist/skills/artifacts/recipes/report.json} +2 -2
  55. package/dist/{recipes/pipeline-artifact-write.json → skills/artifacts/recipes/write.json} +3 -3
  56. package/dist/skills/artifacts/scripts/artifact-utils.mjs +63 -0
  57. package/dist/skills/media/SKILL.md +16 -0
  58. package/dist/{recipes/pipeline-media-library.json → skills/media/recipes/library.json} +2 -2
  59. package/{recipes/music-player.json → dist/skills/media/recipes/player.json} +1 -3
  60. package/dist/{recipes/utility-playlist-build.json → skills/media/recipes/playlist-build.json} +1 -3
  61. package/dist/skills/media/scripts/media-utils.mjs +47 -0
  62. package/dist/{scripts → skills/media/scripts}/music-player.mjs +9 -3
  63. package/dist/skills/project-work/SKILL.md +16 -0
  64. package/dist/skills/project-work/recipes/changelog-section.json +11 -0
  65. package/{recipes/pipeline-docs-maintenance.json → dist/skills/project-work/recipes/docs-maintenance.json} +4 -4
  66. package/dist/skills/project-work/recipes/package-summary.json +9 -0
  67. package/{recipes/pipeline-release-readiness.json → dist/skills/project-work/recipes/release-readiness.json} +6 -6
  68. package/dist/{recipes/pipeline-release-summary.json → skills/project-work/recipes/release-summary.json} +5 -5
  69. package/{recipes/pipeline-repo-health.json → dist/skills/project-work/recipes/repo-health.json} +6 -6
  70. package/{recipes/pipeline-async-run-ops.json → dist/skills/project-work/recipes/run-ops.json} +3 -3
  71. package/dist/skills/project-work/recipes/skill-summary.json +11 -0
  72. package/dist/skills/project-work/scripts/project-utils.mjs +89 -0
  73. package/dist/skills/recipe-memory/SKILL.md +16 -0
  74. package/dist/skills/swarm/SKILL.md +4 -4
  75. package/{recipes/pipeline-architect-coordinator.json → dist/skills/swarm/recipes/architect.json} +5 -5
  76. package/{recipes/pipeline-checkpoint-continuation.json → dist/skills/swarm/recipes/checkpoint-continuation.json} +3 -3
  77. package/dist/{recipes/pipeline-development-tasking.json → skills/swarm/recipes/development-tasking.json} +4 -4
  78. package/dist/{recipes/lens-swarm.json → skills/swarm/recipes/lens-review.json} +1 -1
  79. package/dist/{recipes/pipeline-quorum-review.json → skills/swarm/recipes/quorum-review.json} +4 -4
  80. package/{recipes/pipeline-research-synthesis.json → dist/skills/swarm/recipes/research-synthesis.json} +6 -6
  81. package/{recipes/pipeline-review-readiness.json → dist/skills/swarm/recipes/review-readiness.json} +1 -1
  82. package/{recipes/subagents-prompts.json → dist/skills/swarm/recipes/subagent-prompts.json} +1 -1
  83. package/{recipes → dist/skills/swarm/recipes}/subagent-quorum.json +1 -1
  84. package/dist/{recipes → skills/swarm/recipes}/subagent-review-coordinator.json +6 -6
  85. package/docs/actor-inspector.md +4 -3
  86. package/docs/async-runs.md +2 -2
  87. package/docs/recipe-library.md +23 -23
  88. package/docs/releasing.md +2 -2
  89. package/docs/template-recipes.md +32 -14
  90. package/docs/tool-registry.md +10 -4
  91. package/fixtures/protocol/recipe-summary.json +1 -1
  92. package/index.ts +2 -1
  93. package/lib/async-runs.ts +52 -25
  94. package/lib/automatic-review-runtime.ts +16 -3
  95. package/lib/draft-sleep.ts +0 -1
  96. package/lib/execution.ts +2 -0
  97. package/lib/extension-runtime.ts +42 -4
  98. package/lib/inspector.ts +57 -11
  99. package/lib/paths.ts +0 -7
  100. package/lib/prompts.ts +4 -4
  101. package/lib/recipes-context.ts +51 -6
  102. package/lib/recipes-discovery.ts +164 -24
  103. package/lib/recipes-references.ts +359 -146
  104. package/lib/registry.ts +185 -94
  105. package/lib/runtime.ts +109 -17
  106. package/lib/tools-inspect.ts +77 -10
  107. package/lib/tools-local.ts +9 -1
  108. package/lib/tools-response.ts +2 -0
  109. package/lib/tools-spawn.ts +38 -74
  110. package/lib/tools.ts +4 -1
  111. package/package.json +2 -4
  112. package/scripts/build-dist.mjs +13 -4
  113. package/skills/actors/SKILL.md +8 -8
  114. package/skills/actors/recipes/recipe-validate.json +11 -0
  115. package/{dist/recipes/utility-coordinator-lock-snapshot.json → skills/actors/recipes/resource-locker-snapshot.json} +1 -3
  116. package/{recipes → skills/actors/recipes}/resource-locker.json +1 -3
  117. package/{recipes/utility-run-ops-snapshot.json → skills/actors/recipes/run-ops-snapshot.json} +1 -3
  118. package/skills/actors/recipes/run-summary.json +9 -0
  119. package/{scripts/locker.mjs → skills/actors/scripts/resource-locker.mjs} +2 -2
  120. package/skills/actors/scripts/run-utils.mjs +164 -0
  121. package/{dist → skills/actors}/scripts/validate-recipe.mjs +134 -17
  122. package/skills/artifacts/SKILL.md +16 -0
  123. package/{dist/recipes/pipeline-artifact-bundle.json → skills/artifacts/recipes/bundle.json} +4 -4
  124. package/{recipes/utility-artifact-write.json → skills/artifacts/recipes/file-write.json} +1 -3
  125. package/{recipes/utility-artifact-manifest.json → skills/artifacts/recipes/manifest.json} +1 -3
  126. package/{dist/recipes/pipeline-artifact-report.json → skills/artifacts/recipes/report.json} +2 -2
  127. package/{recipes/pipeline-artifact-write.json → skills/artifacts/recipes/write.json} +3 -3
  128. package/skills/artifacts/scripts/artifact-utils.mjs +63 -0
  129. package/skills/media/SKILL.md +16 -0
  130. package/{recipes/pipeline-media-library.json → skills/media/recipes/library.json} +2 -2
  131. package/{dist/recipes/music-player.json → skills/media/recipes/player.json} +1 -3
  132. package/{recipes/utility-playlist-build.json → skills/media/recipes/playlist-build.json} +1 -3
  133. package/skills/media/scripts/media-utils.mjs +47 -0
  134. package/{scripts → skills/media/scripts}/music-player.mjs +9 -3
  135. package/skills/project-work/SKILL.md +16 -0
  136. package/skills/project-work/recipes/changelog-section.json +11 -0
  137. package/{dist/recipes/pipeline-docs-maintenance.json → skills/project-work/recipes/docs-maintenance.json} +4 -4
  138. package/skills/project-work/recipes/package-summary.json +9 -0
  139. package/{dist/recipes/pipeline-release-readiness.json → skills/project-work/recipes/release-readiness.json} +6 -6
  140. package/{recipes/pipeline-release-summary.json → skills/project-work/recipes/release-summary.json} +5 -5
  141. package/{dist/recipes/pipeline-repo-health.json → skills/project-work/recipes/repo-health.json} +6 -6
  142. package/{dist/recipes/pipeline-async-run-ops.json → skills/project-work/recipes/run-ops.json} +3 -3
  143. package/skills/project-work/recipes/skill-summary.json +11 -0
  144. package/skills/project-work/scripts/project-utils.mjs +89 -0
  145. package/skills/recipe-memory/SKILL.md +16 -0
  146. package/skills/swarm/SKILL.md +4 -4
  147. package/{dist/recipes/pipeline-architect-coordinator.json → skills/swarm/recipes/architect.json} +5 -5
  148. package/{dist/recipes/pipeline-checkpoint-continuation.json → skills/swarm/recipes/checkpoint-continuation.json} +3 -3
  149. package/{recipes/pipeline-development-tasking.json → skills/swarm/recipes/development-tasking.json} +4 -4
  150. package/{recipes/lens-swarm.json → skills/swarm/recipes/lens-review.json} +1 -1
  151. package/{recipes/pipeline-quorum-review.json → skills/swarm/recipes/quorum-review.json} +4 -4
  152. package/{dist/recipes/pipeline-research-synthesis.json → skills/swarm/recipes/research-synthesis.json} +6 -6
  153. package/{dist/recipes/pipeline-review-readiness.json → skills/swarm/recipes/review-readiness.json} +1 -1
  154. package/{dist/recipes/subagents-prompts.json → skills/swarm/recipes/subagent-prompts.json} +1 -1
  155. package/{dist → skills/swarm}/recipes/subagent-quorum.json +1 -1
  156. package/{recipes → skills/swarm/recipes}/subagent-review-coordinator.json +6 -6
  157. package/dist/recipes/utility-changelog-section.json +0 -13
  158. package/dist/recipes/utility-package-summary.json +0 -11
  159. package/dist/recipes/utility-run-summary.json +0 -11
  160. package/dist/recipes/utility-skill-summary.json +0 -13
  161. package/dist/recipes/utility-validate-recipe.json +0 -13
  162. package/dist/scripts/executable-block-style.d.mts +0 -1
  163. package/dist/scripts/executable-block-style.mjs +0 -73
  164. package/dist/scripts/recipe-utils.mjs +0 -404
  165. package/dist/scripts/release-gates.mjs +0 -281
  166. package/recipes/utility-changelog-section.json +0 -13
  167. package/recipes/utility-package-summary.json +0 -11
  168. package/recipes/utility-run-summary.json +0 -11
  169. package/recipes/utility-skill-summary.json +0 -13
  170. package/recipes/utility-validate-recipe.json +0 -13
  171. package/scripts/executable-block-style.d.mts +0 -1
  172. package/scripts/executable-block-style.mjs +0 -73
  173. package/scripts/recipe-utils.mjs +0 -404
  174. package/scripts/release-gates.mjs +0 -281
  175. /package/dist/{recipes/utility-validation-wrapper.json → skills/actors/recipes/command-validate.json} +0 -0
  176. /package/dist/{recipes/utility-jsonl-tail.json → skills/actors/recipes/jsonl-tail.json} +0 -0
  177. /package/dist/{recipes/utility-run-state-files.json → skills/actors/recipes/run-state-files.json} +0 -0
  178. /package/dist/{recipes/utility-playlist-scan.json → skills/media/recipes/playlist-scan.json} +0 -0
  179. /package/dist/{recipes/utility-changelog-head.json → skills/project-work/recipes/changelog-head.json} +0 -0
  180. /package/dist/{recipes/utility-git-log.json → skills/project-work/recipes/git-log.json} +0 -0
  181. /package/dist/{recipes/utility-git-status.json → skills/project-work/recipes/git-status.json} +0 -0
  182. /package/dist/{recipes/utility-markdown-index.json → skills/project-work/recipes/markdown-index.json} +0 -0
  183. /package/dist/{recipes → skills/recipe-memory/recipes}/draft-review.json +0 -0
  184. /package/dist/{recipes → skills/recipe-memory/recipes}/tool-review.json +0 -0
  185. /package/dist/{recipes → skills/swarm/recipes}/subagent-artifact.json +0 -0
  186. /package/dist/{recipes → skills/swarm/recipes}/subagent-checkpoint.json +0 -0
  187. /package/dist/{recipes → skills/swarm/recipes}/subagent-conflict-report.json +0 -0
  188. /package/dist/{recipes → skills/swarm/recipes}/subagent-contradiction-map.json +0 -0
  189. /package/dist/{recipes → skills/swarm/recipes}/subagent-critic.json +0 -0
  190. /package/dist/{recipes → skills/swarm/recipes}/subagent-evidence-map.json +0 -0
  191. /package/dist/{recipes → skills/swarm/recipes}/subagent-followup.json +0 -0
  192. /package/dist/{recipes → skills/swarm/recipes}/subagent-judge.json +0 -0
  193. /package/dist/{recipes → skills/swarm/recipes}/subagent-merge.json +0 -0
  194. /package/dist/{recipes → skills/swarm/recipes}/subagent-normalize.json +0 -0
  195. /package/dist/{recipes → skills/swarm/recipes}/subagent-plan.json +0 -0
  196. /package/dist/{recipes → skills/swarm/recipes}/subagent-preflight.json +0 -0
  197. /package/dist/{recipes → skills/swarm/recipes}/subagent-prompt.json +0 -0
  198. /package/dist/{recipes → skills/swarm/recipes}/subagent-review.json +0 -0
  199. /package/dist/{recipes → skills/swarm/recipes}/subagent-task-card.json +0 -0
  200. /package/dist/{recipes → skills/swarm/recipes}/subagent-tools.json +0 -0
  201. /package/dist/{recipes → skills/swarm/recipes}/subagent-verify.json +0 -0
  202. /package/{recipes/utility-validation-wrapper.json → skills/actors/recipes/command-validate.json} +0 -0
  203. /package/{recipes/utility-jsonl-tail.json → skills/actors/recipes/jsonl-tail.json} +0 -0
  204. /package/{recipes/utility-run-state-files.json → skills/actors/recipes/run-state-files.json} +0 -0
  205. /package/{recipes/utility-playlist-scan.json → skills/media/recipes/playlist-scan.json} +0 -0
  206. /package/{recipes/utility-changelog-head.json → skills/project-work/recipes/changelog-head.json} +0 -0
  207. /package/{recipes/utility-git-log.json → skills/project-work/recipes/git-log.json} +0 -0
  208. /package/{recipes/utility-git-status.json → skills/project-work/recipes/git-status.json} +0 -0
  209. /package/{recipes/utility-markdown-index.json → skills/project-work/recipes/markdown-index.json} +0 -0
  210. /package/{recipes → skills/recipe-memory/recipes}/draft-review.json +0 -0
  211. /package/{recipes → skills/recipe-memory/recipes}/tool-review.json +0 -0
  212. /package/{recipes → skills/swarm/recipes}/subagent-artifact.json +0 -0
  213. /package/{recipes → skills/swarm/recipes}/subagent-checkpoint.json +0 -0
  214. /package/{recipes → skills/swarm/recipes}/subagent-conflict-report.json +0 -0
  215. /package/{recipes → skills/swarm/recipes}/subagent-contradiction-map.json +0 -0
  216. /package/{recipes → skills/swarm/recipes}/subagent-critic.json +0 -0
  217. /package/{recipes → skills/swarm/recipes}/subagent-evidence-map.json +0 -0
  218. /package/{recipes → skills/swarm/recipes}/subagent-followup.json +0 -0
  219. /package/{recipes → skills/swarm/recipes}/subagent-judge.json +0 -0
  220. /package/{recipes → skills/swarm/recipes}/subagent-merge.json +0 -0
  221. /package/{recipes → skills/swarm/recipes}/subagent-normalize.json +0 -0
  222. /package/{recipes → skills/swarm/recipes}/subagent-plan.json +0 -0
  223. /package/{recipes → skills/swarm/recipes}/subagent-preflight.json +0 -0
  224. /package/{recipes → skills/swarm/recipes}/subagent-prompt.json +0 -0
  225. /package/{recipes → skills/swarm/recipes}/subagent-review.json +0 -0
  226. /package/{recipes → skills/swarm/recipes}/subagent-task-card.json +0 -0
  227. /package/{recipes → skills/swarm/recipes}/subagent-tools.json +0 -0
  228. /package/{recipes → skills/swarm/recipes}/subagent-verify.json +0 -0
package/AGENTS.md CHANGED
@@ -36,11 +36,11 @@ Pi host
36
36
  -> lib/observability.ts terminal + Trace-attention observation
37
37
  -> lib/inspector*.ts owner-filtered actor-instance inspection
38
38
  -> scripts/*.mjs process/service entrypoints
39
- -> recipes/*.json packaged Recipe library
39
+ -> skills/*/recipes/* Skill-owned Recipe components
40
40
  -> skills/* + docs/* agent and human guidance
41
41
  ```
42
42
 
43
- `index.ts` wires Pi ports and must not own domain behavior. Keep the local TypeScript import graph acyclic.
43
+ `index.ts` wires Pi ports and must not own domain behavior. Keep the local TypeScript import graph acyclic. For architecture-affecting work, load and follow `.agents/skills/domain-dag/SKILL.md`; its validator is local agent tooling, not an npm, CI, or release gate.
44
44
 
45
45
  ## Key Domains
46
46
 
@@ -58,17 +58,20 @@ Pi host
58
58
  - `observability.ts`, `run-ui-runtime.ts`: Trace attention, terminal reconciliation, and Pi follow-up delivery.
59
59
  - automatic draft/tool review domains: structurally redacted model review, journaled mutation, lineage, recovery, and explicit retry/reset safety.
60
60
 
61
- Scripts remain self-contained when no non-script consumer justifies a TypeScript domain. Command-template script leaves infer `.js`/`.mjs` in order through Node, Bun, or `deno run` and `.sh` through Bash without shell evaluation. Helper-backed packaged Recipes self-locate their installed package root while explicit caller values remain authoritative. Recipes stay optional, composable, policy-light, and caller-configurable.
61
+ The bundled Skill Recipe dependency DAG is `artifacts → actors, swarm`, `media → artifacts`, and `project-work → actors, artifacts, swarm`; `actors`, `swarm`, and `recipe-memory` have no cross-Skill Recipe dependencies.
62
+
63
+ Scripts remain self-contained when no non-script consumer justifies a TypeScript domain. Command-template script leaves infer `.js`/`.mjs` in order through Node, Bun, or `deno run` and `.sh` through Bash without shell evaluation. Helper-backed Skill Recipes self-locate through runtime-owned `{skill_dir}`. Recipes stay optional, composable, policy-light, and caller-configurable.
62
64
 
63
65
  ## Operating Principles
64
66
 
65
67
  ### Recipe
66
68
 
69
+ - Skill Recipe identity is `<active Skill name>/<Recipe filename stem>`; Recipe files have no top-level `name`. `SKILL.md` `name` is Pi host metadata matching the Skill directory, not a second pi-actors identity field.
67
70
  - Recipe files may define args/defaults, imports, artifacts, command-template flags, and `control`.
68
71
  - Declare actor-local actions only when a long-lived process implements them.
69
72
  - Actions are lowercase, unique, and cannot use runtime-reserved lifecycle names.
70
73
  - Removed communication-plane metadata fails explicitly; never translate it.
71
- - User Recipes shadow packaged definitions; invalid shadowing blocks fallback.
74
+ - User Recipes are discovered only from the persistent user registry; Skill Recipes are exact components outside tool discovery. Explicit entry paths resolve from invocation `cwd`; relative imports resolve from their importing file.
72
75
  - Files over 1 MiB, import depth over 32, and import cycles fail closed.
73
76
 
74
77
  ### Trace
@@ -136,11 +139,10 @@ When a deferred Run result gates the next step, wait for its terminal follow-up.
136
139
  ## Documentation and Release Discipline
137
140
 
138
141
  - Keep published text portable: use `~`, `<repo>`, or relative paths.
139
- - Keep executable JavaScript and TypeScript blocks compact: no blank lines inside function bodies or control-flow blocks. Structural object, type, interface, class, and module bodies are exempt.
140
142
  - Update `skills/actors/SKILL.md` when durable operating mechanics change.
141
143
  - Keep `skills/swarm/SKILL.md` focused on multi-agent methodology rather than kernel internals.
142
- - Recipe `description` is optional because discovery supplies stable fallback tool copy; packaged Recipe QA must report zero diagnostics and zero release-blocking warnings without component boilerplate.
143
- - Before release run build, full tests, preservation tests, Recipe QA, Domain DAG validation, ABCd context validation, line-count gates, and release gates.
144
+ - Recipe `description` is optional. Skill Recipe QA recursively validates direct filesystem-owned components and capability semantics with zero diagnostics or warnings; it does not enforce aesthetics or architecture policy.
145
+ - Before release run the normal product validation and dependency audit. Use the project-local Domain DAG Skill during architecture-affecting development, not as publication automation.
144
146
  - `.github/workflows/release.yml` owns the immutable sequence reusable validation → npm Trusted Publisher publication/verification → GitHub Release convergence; follow [docs/releasing.md](docs/releasing.md).
145
147
  - Keep npm publication tokenless: use the exact npm Trusted Publisher binding and job-scoped OIDC permission, never a long-lived npm token or token fallback.
146
148
  - Until a stable version beyond `1.x`, prefer clean breaking simplification over compatibility aliases or renamed legacy abstractions.
package/BACKLOG.md CHANGED
@@ -1,3 +1,585 @@
1
1
  # Project Backlog
2
2
 
3
+ ## 0.46.1 — Registration Truth
4
+
5
+ **Base:** `0.46.0` at `4abe9b26525a57883446b1d897e9e1ddf6cacde5`
6
+ **Release type:** patch / contract repair
7
+ **Primary evidence:** `tests/registration-truth.test.ts`, distilled from `PI_ACTORS_RECIPE_UX_SESSION_REPORT.md`
8
+ **Release sentence:** every live pi-actors surface resolves user Recipes against the same session Skill context, registration validates the effective delegated contract before persistence, activation is truthfully observable, and unrelated invalid Skill components can no longer poison valid capability discovery.
9
+
10
+ ## Mission
11
+
12
+ Repair the runtime seams exposed by the first real `0.46.0` Skill-Recipe authoring session before redesigning agent guidance.
13
+
14
+ The intended operation was:
15
+
16
+ ```text
17
+ maintained Skill Recipe
18
+ media/player
19
+ ↓ specialize
20
+ persistent user tool
21
+ music_player
22
+ ↓ activate
23
+ call in the same session
24
+ ```
25
+
26
+ The session instead observed:
27
+
28
+ ```text
29
+ spawn resolves media/player
30
+ standalone QA resolves media/player
31
+ register_tool cannot resolve media/player
32
+ live registry rejects the wrapper
33
+ one unrelated invalid Skill Recipe empties the catalog
34
+ runtime-owned placeholders leak into the tool schema
35
+ registry persistence is reported as registration success
36
+ spawn is mistakenly used as proof of tool invocation
37
+ ```
38
+
39
+ `0.46.1` owns the mechanical truth required for `0.47.0` agent-native UX.
40
+
41
+ Do **not** solve these failures with more prose, compatibility aliases, copied Recipe contracts, helper paths, shell wrappers, or new orchestration concepts.
42
+
43
+ The target transaction is:
44
+
45
+ ```text
46
+ current session
47
+ ↓
48
+ one RecipeResolutionContext
49
+ ↓
50
+ resolve candidate
51
+ ↓
52
+ derive effective Recipe/tool contract
53
+ ↓
54
+ validate candidate
55
+ ↓
56
+ persist
57
+ ↓
58
+ registry admission
59
+ ↓
60
+ host registration + active-tool reconciliation
61
+ ↓
62
+ verify activation
63
+ ↓
64
+ return truthful state
65
+ ```
66
+
67
+ ---
68
+
69
+ # 1. Retained Canon
70
+
71
+ The `0.46.0` capability model remains authoritative:
72
+
73
+ ```text
74
+ Recipe --spawn--> Run
75
+ Run = Recipe + Trace + Control
76
+ ```
77
+
78
+ Public Run verbs remain:
79
+
80
+ ```text
81
+ spawn
82
+ message
83
+ inspect
84
+ ```
85
+
86
+ Persistent capability mutation remains:
87
+
88
+ ```text
89
+ register_tool
90
+ ```
91
+
92
+ Run views remain:
93
+
94
+ ```text
95
+ recipe
96
+ trace
97
+ control
98
+ ```
99
+
100
+ Recipe references remain exactly:
101
+
102
+ ```text
103
+ <skill>/<recipe>
104
+ explicit/path.json
105
+ explicit/path.md
106
+ ```
107
+
108
+ Skill Recipe identity remains:
109
+
110
+ ```text
111
+ <active Skill identity>/<direct Recipe filename stem>
112
+ ```
113
+
114
+ Retain:
115
+
116
+ - six bundled Skill-owned capability packs;
117
+ - flat Skill `recipes/` directories;
118
+ - no root packaged Recipe library;
119
+ - no `std:` or `skill:` prefixes;
120
+ - no top-level file-backed Recipe `name`;
121
+ - session-scoped active Skill identity;
122
+ - runtime-owned `{recipe_dir}` and `{skill_dir}`;
123
+ - bounded Trace and Control;
124
+ - owner/generation/process fencing;
125
+ - automatic review transactions;
126
+ - secure npm publication;
127
+ - project-local Domain DAG Skill outside CI/release.
128
+
129
+ ---
130
+
131
+ # 2. Contract
132
+
133
+ ## 2.1 One live resolution environment
134
+
135
+ Every operation that decides whether a Recipe can be used in the live session must consume the same immutable session resolution environment.
136
+
137
+ Conceptually:
138
+
139
+ ```ts
140
+ interface RecipeResolutionContext {
141
+ session_id: string;
142
+ cwd: string;
143
+ active_skills: ActiveSkillRecipeContext;
144
+ generation: string;
145
+ }
146
+ ```
147
+
148
+ The exact internal type may be smaller, but there must be one explicit owner and one semantic contract.
149
+
150
+ The following must not invent independent active-Skill contexts:
151
+
152
+ ```text
153
+ spawn
154
+ register_tool candidate validation
155
+ user Recipe registry admission
156
+ user Recipe registry reload
157
+ tool schema derivation
158
+ inspect recipes
159
+ inspect tool
160
+ automatic review when resolving user wrappers
161
+ live Recipe validation used by registration
162
+ ```
163
+
164
+ Standalone package QA may still construct an offline package context, but it must be labeled as offline/package QA and may not be represented as proof of live registry admission.
165
+
166
+ ## 2.2 One user Recipe admission path
167
+
168
+ A user Recipe under:
169
+
170
+ ```text
171
+ ~/.pi/agent/recipes/<name>.json
172
+ ```
173
+
174
+ is an active agent tool only if one authoritative admission function can:
175
+
176
+ 1. parse the authored Recipe;
177
+ 2. resolve its delegation/import graph with the live `RecipeResolutionContext`;
178
+ 3. derive runtime-owned origins;
179
+ 4. derive the effective argument/type/default contract;
180
+ 5. classify async behavior;
181
+ 6. validate Control/artifacts;
182
+ 7. produce one `RegisteredTool` projection;
183
+ 8. produce bounded diagnostics on failure.
184
+
185
+ `register_tool`, startup/reload discovery, and live revalidation must use this same admission contract.
186
+
187
+ Do not maintain one path that creates a `RegisteredTool` directly from `register_tool` input and another path that later interprets the persisted Recipe differently.
188
+
189
+ ## 2.3 Registration is a state transition
190
+
191
+ A successful registration response must distinguish at least:
192
+
193
+ ```text
194
+ resolved
195
+ validated
196
+ persisted
197
+ registry_active
198
+ host_registered
199
+ active_tool
200
+ callable_now
201
+ ```
202
+
203
+ These states may all become `true` in the healthy path, but they are not synonyms.
204
+
205
+ Never return text that implies current-session invocation if the system cannot prove it.
206
+
207
+ ## 2.4 Effective contract before mutation
208
+
209
+ A Recipe-backed tool must be validated from the **resolved effective contract**, not the shallow wrapper shape.
210
+
211
+ For:
212
+
213
+ ```json
214
+ {
215
+ "description": "Play local music.",
216
+ "defaults": {
217
+ "source": "~/Music/1MIX"
218
+ },
219
+ "template": "media/player"
220
+ }
221
+ ```
222
+
223
+ the effective tool contract inherits from `media/player`:
224
+
225
+ ```text
226
+ async
227
+ args
228
+ arg types
229
+ defaults
230
+ artifacts
231
+ Control
232
+ runtime-owned origins
233
+ ```
234
+
235
+ without copying those fields into the authored wrapper.
236
+
237
+ The tool schema must contain only caller-owned inputs.
238
+
239
+ ## 2.5 Partial catalog, exact resolver
240
+
241
+ The active Skill component catalog is diagnostic/discovery state.
242
+
243
+ It must never be required for exact resolution of an unrelated valid component.
244
+
245
+ An invalid:
246
+
247
+ ```text
248
+ some-skill/bad-recipe
249
+ ```
250
+
251
+ must not make:
252
+
253
+ ```text
254
+ media/player
255
+ ```
256
+
257
+ unresolvable merely because a catalog listing failed.
258
+
259
+ ---
260
+
261
+ # 3. Runtime-Owned Inputs
262
+
263
+ The following are runtime-owned and must never leak into caller-facing tool schemas merely because they occur in an effective Recipe template:
264
+
265
+ ```text
266
+ recipe_dir
267
+ skill_dir
268
+ state_dir
269
+ trace_file
270
+ run_instance_id
271
+ owner/session identity
272
+ runtime state root
273
+ ```
274
+
275
+ `run_id` remains an intentional caller-visible optional override for async tool invocation if the existing public contract retains it.
276
+
277
+ The executor must inventory every runtime-injected placeholder and centralize ownership rather than maintaining ad hoc exclusion lists in unrelated schema code.
278
+
279
+ Declared user args retain their actual types:
280
+
281
+ ```text
282
+ string
283
+ path
284
+ bool
285
+ int
286
+ number
287
+ enum
288
+ array
289
+ ```
290
+
291
+ A delegated Recipe may not degrade them all to strings.
292
+
293
+ ---
294
+
295
+ # 4. Activation Truth
296
+
297
+ `pi-actors` must determine what the Pi host can actually guarantee after dynamic `registerTool`.
298
+
299
+ Preferred contract:
300
+
301
+ ```text
302
+ register_tool returns callable_now=true
303
+ → host definition exists
304
+ → tool is in the current active tool set
305
+ → the next model step in the same session can call it
306
+ ```
307
+
308
+ If the Pi host cannot guarantee that:
309
+
310
+ ```text
311
+ register_tool returns callable_now=false
312
+ activation=<exact boundary>
313
+ ```
314
+
315
+ and all prompts/docs must say so.
316
+
317
+ Do not infer model visibility from persistence or an extension-local map.
318
+
319
+ The implementation must test the real Pi integration path, not only mocked registration callbacks.
320
+
321
+ ---
322
+
323
+ # 5. Registration Atomicity
324
+
325
+ For a new registration:
326
+
327
+ ```text
328
+ candidate
329
+ → resolve/validate without mutation
330
+ → durable write
331
+ → authoritative registry admission
332
+ → host registration/activation
333
+ → verification
334
+ ```
335
+
336
+ If failure occurs before persistence, no user Recipe file appears.
337
+
338
+ If persistence succeeds but authoritative admission fails unexpectedly:
339
+
340
+ - restore/delete the just-written candidate under the canonical mutation lock;
341
+ - restore prior in-memory registry state;
342
+ - report the exact failed phase;
343
+ - do not leave an invalid file while returning generic success.
344
+
345
+ For updates:
346
+
347
+ - preserve the prior file bytes until replacement is known valid;
348
+ - do not destroy a working tool because the replacement cannot resolve;
349
+ - retain existing CAS/path/symlink/mutation safety.
350
+
351
+ Host APIs that cannot unregister stale dynamic definitions must be explicitly accounted for. Validate as much as possible before host mutation.
352
+
353
+ ---
354
+
355
+ # 6. Registry and Component Observability
356
+
357
+ Existing:
358
+
359
+ ```text
360
+ inspect target=recipes view=status
361
+ inspect target=recipes view=summary
362
+ inspect target=recipes view=doctor
363
+ inspect target=tool:<name> view=status
364
+ inspect target=tool:<name> view=schema
365
+ ```
366
+
367
+ remain the public surfaces.
368
+
369
+ Do not add a new `recipe:` target in this patch.
370
+
371
+ Recipe registry inspection must expose bounded current state such as:
372
+
373
+ ```text
374
+ registry_generation
375
+ scanned_at
376
+ resolution_generation
377
+ watch_status
378
+ user_recipe_count
379
+ active_tool_count
380
+ skill_component_count
381
+ rejected_skill_component_count
382
+ catalog_partial
383
+ ```
384
+
385
+ Rejected Skill components must be reported individually with:
386
+
387
+ ```text
388
+ skill
389
+ stem if derivable
390
+ portable file location
391
+ reason
392
+ ```
393
+
394
+ Use portable paths such as:
395
+
396
+ ```text
397
+ ~/.pi/agent/skills/...
398
+ <pi-actors>/skills/...
399
+ ```
400
+
401
+ rather than raw home-directory leakage.
402
+
403
+ `inspect tool:<name> view=status` must expose activation state where it can be proven.
404
+
405
+ ---
406
+
407
+ # 7. Fail-Soft Skill Component Discovery
408
+
409
+ Refactor active Skill component listing so it returns valid entries and failures together.
410
+
411
+ Conceptually:
412
+
413
+ ```ts
414
+ interface SkillComponentInventory {
415
+ components: ActiveSkillRecipeComponent[];
416
+ rejected: SkillComponentDiagnostic[];
417
+ partial: boolean;
418
+ }
419
+ ```
420
+
421
+ Rules:
422
+
423
+ - invalid top-level `Recipe.name` rejects that component;
424
+ - nested Recipe files reject those files/that namespace as appropriate;
425
+ - JSON/Markdown same-stem collision rejects that stem;
426
+ - one duplicate active Skill identity may invalidate that Skill namespace;
427
+ - unrelated Skill namespaces continue;
428
+ - every rejection is bounded and diagnosable;
429
+ - exact resolver remains independent and may resolve a valid exact component while catalog inventory is partial.
430
+
431
+ Do not silently omit bad components.
432
+
433
+ ---
434
+
435
+ # 8. Launch-Kind Truth
436
+
437
+ Keep existing usage distinctions:
438
+
439
+ ```text
440
+ tool
441
+ spawn
442
+ direct Recipe/foreground execution where applicable
443
+ ```
444
+
445
+ At minimum:
446
+
447
+ - `spawn` result/details expose `launch_kind: "spawn"`;
448
+ - registered tool invocation evidence exposes `launch_kind: "tool"`;
449
+ - `inspect tool` usage summary distinguishes tool calls from Recipe spawn calls;
450
+ - no product copy describes `spawn recipe=<user-wrapper>` as invoking the registered tool.
451
+
452
+ Do not add a second generic invocation mechanism just for testing.
453
+
454
+ ---
455
+
456
+ # 9. Work Items
457
+
458
+ ## RGT-12 — Publish `0.46.1`
459
+
460
+ **Goal:** ship the prepared registration-truth release before agent UX redesign.
461
+
462
+ **State:** gated on explicit release intent and repository `ADMIN` authority.
463
+
464
+ **Remaining:**
465
+
466
+ - Run the existing guarded GitHub release flow for prepared version `0.46.1`.
467
+ - Verify npm package identity/provenance and GitHub Release convergence.
468
+ - After successful publication, reset this backlog to:
469
+
470
+ ```text
471
+ # Project Backlog
472
+
3
473
  No open items.
474
+ ```
475
+
476
+ **Unblocker:** the operator explicitly authorizes the `0.46.1` release and confirms `ADMIN` permission for this repository.
477
+
478
+ **Dependencies:** none.
479
+
480
+ ---
481
+
482
+ # 10. Dependency Graph
483
+
484
+ ```text
485
+ RGT-12
486
+ ```
487
+
488
+ Integration hotspots:
489
+
490
+ ```text
491
+ lib/extension-runtime.ts
492
+ lib/recipes-references.ts
493
+ lib/recipes-discovery.ts
494
+ lib/runtime.ts
495
+ lib/registry.ts
496
+ lib/tools-register.ts
497
+ lib/tools-local.ts
498
+ lib/tools-inspect.ts
499
+ lib/schema.ts
500
+ lib/recipes-usage.ts
501
+ ```
502
+
503
+ Use one integration owner for resolution/admission semantics.
504
+
505
+ ---
506
+
507
+ # 11. Required Test Matrix
508
+
509
+ | Boundary | Required evidence |
510
+ | ---------------------- | ----------------------------------------------------------------- |
511
+ | Live context | spawn/register/registry/inspect share exact session Skill context |
512
+ | Session isolation | no context bleed across sessions/replacements |
513
+ | Startup | Skill-dependent user tools reconcile after active Skills known |
514
+ | Watcher | reload uses current context/generation, stale callback fenced |
515
+ | Delegation | compact wrapper inherits effective Recipe contract |
516
+ | Invalid wrapper | rejected before persistence with precise diagnostic |
517
+ | Schema ownership | runtime-owned values absent |
518
+ | Schema types | enum/bool/int/path/array retained |
519
+ | Defaults | wrapper overrides validated against effective types |
520
+ | Catalog | unrelated bad component yields partial inventory |
521
+ | Exact resolution | valid component resolves despite unrelated rejection |
522
+ | Registry observability | generation/time/watch/current counts available |
523
+ | Registration | persisted/active/host/callable states separated |
524
+ | Rollback | failed update preserves previous working tool |
525
+ | Pi host | same-session injection proven or truthful limitation returned |
526
+ | Launch kind | tool vs spawn explicit in result/usage |
527
+ | Source/dist | same behavior in repository and packed install |
528
+ | Security | path/CAS/redaction/generation/review safety retained |
529
+
530
+ ---
531
+
532
+ # 12. Explicitly Deferred to `0.47.0`
533
+
534
+ Only the **agent interface/guidance layer** is deferred:
535
+
536
+ ```text
537
+ register_tool from=<skill>/<recipe>
538
+ register_tool defaults={...}
539
+ system prompt redesign as Skill-loading meta-protocol
540
+ actors Skill redesign as root agent operating protocol
541
+ capability Skill description/entrypoint redesign
542
+ agent-facing delegation-vs-import decision guidance
543
+ focused resolution explanation UX
544
+ fresh-agent journey dogfood
545
+ human-doc vs agent-Skill separation cleanup
546
+ ```
547
+
548
+ Do not defer any known runtime inconsistency from the report.
549
+
550
+ ---
551
+
552
+ # 13. Negative Scope
553
+
554
+ Do not add:
555
+
556
+ ```text
557
+ new Run nouns
558
+ new Run views
559
+ new generic invocation tool
560
+ new recipe target namespace
561
+ task graph runtime
562
+ actor chat
563
+ rooms/peers/mailboxes
564
+ remote Recipe registry
565
+ compatibility std:/skill: aliases
566
+ copied packaged Recipe wrappers
567
+ shell fallbacks
568
+ new capability-authoring Skill
569
+ large system-prompt rewrite
570
+ ```
571
+
572
+ ---
573
+
574
+ # 14. Stop Conditions
575
+
576
+ Stop and preserve evidence if:
577
+
578
+ - Pi cannot dynamically expose a newly registered tool in the same session and the product cannot observe the activation boundary;
579
+ - one authoritative user Recipe admission path cannot serve registry and `register_tool`;
580
+ - session-scoped Skill-dependent tools require global mutable state;
581
+ - rollback would overwrite concurrent user edits;
582
+ - schema ownership cannot distinguish runtime and caller values without changing Recipe semantics;
583
+ - fixing a failure appears to require copying a Skill Recipe contract into the user wrapper.
584
+
585
+ Resolve blockers at the owning boundary rather than hiding them with agent guidance.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,22 @@
1
1
  # Changelog
2
2
 
3
- > Each release keeps at most 8 outcome records of at most 512 characters.
3
+ ## 0.46.1: Registration Truth
4
+
5
+ - `Live Resolution`: Spawn, registration, registry admission/reload, schema derivation, and Inspect now consume one immutable session Recipe context. Skill-dependent user wrappers reconcile only after Pi supplies active Skills, watcher reloads retain the current generation, and stale session consumers fail closed.
6
+ - `Effective Admission`: One user-Recipe admission path resolves direct delegation before persistence, inheriting async behavior, typed arguments/defaults, artifacts, Control, and runtime origins without copying maintained contracts. Malformed or mistyped wrappers fail before mutation, and failed updates roll back prior bytes, registry state, host definitions, and active tools.
7
+ - `Schema Ownership`: Caller schemas preserve enum, bool, integer, number, path, and array types while centrally excluding runtime-owned inputs such as `recipe_dir`, `skill_dir`, `state_dir`, Trace/run identity, and runtime state roots. The intentional async `run_id` override remains public.
8
+ - `Fail-Soft Catalog`: Active-Skill inventory returns valid components alongside bounded per-component rejections and an explicit partial state. Invalid unrelated Recipes and duplicate namespaces remain diagnosable without poisoning exact resolution of valid components.
9
+ - `Activation and Observability`: Registration reports resolved, validated, persisted, registry, host, active-tool, and callable states from Pi host evidence. Recipe inspection adds generation, scan, watcher, portable-root, and partial-catalog state; tool status reports current activation and separate spawn/tool usage.
10
+ - `Launch Truth and Dogfood`: Spawn and registered-tool launches expose distinct `launch_kind` evidence. Source and packed-package regressions activate `media/player`, quarantine an unrelated stale component, register and invoke a compact `music_player` in the same session, preserve inherited Control/schema, exercise repair reloads and negative cases, and reject shell/copy workarounds.
11
+
12
+ ## 0.46.0: Skill-Owned Capability Packs
13
+
14
+ - `Breaking Recipe Grammar`: File-backed identity now comes only from the filename; top-level Recipe `name`, nested Skill identities, JSON/Markdown stem collisions, bare references, and the old `std:` / `skill:` prefixes fail with migration guidance. Composition accepts exact `<active-skill>/<stem>` references or explicit `.json` / `.md` paths, with entry paths based at invocation cwd and relative imports based at their owning Recipe.
15
+ - `Skill-Owned Distribution`: All 58 bundled components move from the root Recipe library into six flat Pi Skills—Actors, Artifacts, Media, Project Work, Recipe Memory, and Swarm—with 67 explicit imports and an acyclic cross-Skill graph. Root and `dist` Recipe libraries, package-root discovery, fallback/shadowing, wrapper installation, and obsolete root capability helpers are removed; Skill components never auto-register as tools.
16
+ - `Scoped Resolution and Provenance`: Immutable active-Skill contexts are session-scoped and captured per Run. Recipe inspection distinguishes user registry capabilities, active Skill components, and explicit files while recording entry/import roles, filename stems, logical identities, Skill ownership, and alias ancestry without exposing private `source_file`, `{skill_dir}`, or `{recipe_dir}` values to model/Inspector surfaces.
17
+ - `Capability Safety`: Automatic review resolves exact package-owned `recipe-memory/*` components so user files cannot redirect reviewers. Helpers self-locate through runtime-owned `{skill_dir}`; Control, Trace, lifecycle fencing, review transactions, and the public `spawn`, `message`, `inspect`, `register_tool` plus Recipe/Trace/Control view contracts remain unchanged.
18
+ - `Validation and Architecture`: Recursive Skill QA validates direct identity, parse/import semantics, origins, Control, portable paths, and helper targets in source and installed packages. The custom release-gate and executable-style policy scanners are removed; CI runs product validation plus dependency audit, while a non-packaged project-local Domain DAG Skill supports architecture work without becoming a release gate.
19
+ - `Dogfood and Migration`: Source and installed tests execute repository health, release readiness, quorum review, artifact bundle, media player, and package-owned draft review through qualified Skill references, plus relative/absolute file imports and all breaking failures. Migrate `std:foo` to `owning-skill/foo`, `skill:foo/bar` to `foo/bar`, root Recipes to their owning Skill filename, and delete Recipe `name` fields.
4
20
 
5
21
  ## 0.45.1: Entrypoint and Release Policy
6
22