@plurnk/plurnk-service 1.7.0 → 1.8.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 (280) hide show
  1. package/.env.defaults +29 -42
  2. package/INSTALL.md +49 -10
  3. package/README.md +11 -1
  4. package/SPEC.md +631 -279
  5. package/digest-sql/channel-dispositions/dispositions.sql +15 -0
  6. package/digest-sql/channel-state/state.sql +6 -0
  7. package/digest-sql/curation/curation.sql +5 -0
  8. package/digest-sql/derivations/derivations.sql +4 -0
  9. package/digest-sql/embeddings/embeddings.sql +4 -0
  10. package/digest-sql/entry-dispositions/dispositions.sql +15 -0
  11. package/digest-sql/entry-state/state.sql +6 -0
  12. package/digest-sql/token-counts/token-counts.sql +2 -0
  13. package/dist/Paths.d.ts +2 -5
  14. package/dist/Paths.d.ts.map +1 -1
  15. package/dist/Paths.js +9 -21
  16. package/dist/Paths.js.map +1 -1
  17. package/dist/build-info.json +1 -1
  18. package/dist/content/read-projector.d.ts.map +1 -1
  19. package/dist/content/read-projector.js +4 -3
  20. package/dist/content/read-projector.js.map +1 -1
  21. package/dist/core/BudgetReadout.d.ts.map +1 -1
  22. package/dist/core/BudgetReadout.js +12 -22
  23. package/dist/core/BudgetReadout.js.map +1 -1
  24. package/dist/core/ChannelWrite.d.ts.map +1 -1
  25. package/dist/core/ChannelWrite.js.map +1 -1
  26. package/dist/core/ChannelWrite.sql +2 -1
  27. package/dist/core/Dispatcher.d.ts +7 -6
  28. package/dist/core/Dispatcher.d.ts.map +1 -1
  29. package/dist/core/Dispatcher.js +34 -88
  30. package/dist/core/Dispatcher.js.map +1 -1
  31. package/dist/core/Engine.d.ts +11 -8
  32. package/dist/core/Engine.d.ts.map +1 -1
  33. package/dist/core/Engine.js +45 -27
  34. package/dist/core/Engine.js.map +1 -1
  35. package/dist/core/Engine.sql +112 -107
  36. package/dist/core/ExecutorRegistry.d.ts +8 -2
  37. package/dist/core/ExecutorRegistry.d.ts.map +1 -1
  38. package/dist/core/ExecutorRegistry.js +6 -3
  39. package/dist/core/ExecutorRegistry.js.map +1 -1
  40. package/dist/core/HostPaths.d.ts +29 -0
  41. package/dist/core/HostPaths.d.ts.map +1 -0
  42. package/dist/core/HostPaths.js +74 -0
  43. package/dist/core/HostPaths.js.map +1 -0
  44. package/dist/core/LegacyHome.d.ts +10 -0
  45. package/dist/core/LegacyHome.d.ts.map +1 -0
  46. package/dist/core/LegacyHome.js +170 -0
  47. package/dist/core/LegacyHome.js.map +1 -0
  48. package/dist/core/LogBody.d.ts +1 -1
  49. package/dist/core/LogBody.d.ts.map +1 -1
  50. package/dist/core/LogBody.js +2 -2
  51. package/dist/core/LogBody.js.map +1 -1
  52. package/dist/core/LogEntryProjection.js +1 -1
  53. package/dist/core/LogEntryProjection.js.map +1 -1
  54. package/dist/core/LogVisibility.d.ts +28 -0
  55. package/dist/core/LogVisibility.d.ts.map +1 -0
  56. package/dist/core/LogVisibility.js +215 -0
  57. package/dist/core/LogVisibility.js.map +1 -0
  58. package/dist/core/LoopLifecycle.d.ts +1 -0
  59. package/dist/core/LoopLifecycle.d.ts.map +1 -1
  60. package/dist/core/LoopLifecycle.js +8 -0
  61. package/dist/core/LoopLifecycle.js.map +1 -1
  62. package/dist/core/LoopLifecycle.sql +10 -0
  63. package/dist/core/OperatorConfig.d.ts +6 -0
  64. package/dist/core/OperatorConfig.d.ts.map +1 -0
  65. package/dist/core/OperatorConfig.js +92 -0
  66. package/dist/core/OperatorConfig.js.map +1 -0
  67. package/dist/core/OverflowTurn.d.ts +11 -0
  68. package/dist/core/OverflowTurn.d.ts.map +1 -0
  69. package/dist/core/OverflowTurn.js +77 -0
  70. package/dist/core/OverflowTurn.js.map +1 -0
  71. package/dist/core/Owner.js +2 -2
  72. package/dist/core/Owner.js.map +1 -1
  73. package/dist/core/PacketBuilder.d.ts +3 -15
  74. package/dist/core/PacketBuilder.d.ts.map +1 -1
  75. package/dist/core/PacketBuilder.js +48 -121
  76. package/dist/core/PacketBuilder.js.map +1 -1
  77. package/dist/core/ProblemLog.js +1 -1
  78. package/dist/core/ProblemLog.js.map +1 -1
  79. package/dist/core/ProposalLifecycle.d.ts.map +1 -1
  80. package/dist/core/ProposalLifecycle.js +3 -23
  81. package/dist/core/ProposalLifecycle.js.map +1 -1
  82. package/dist/core/ProviderInstantiate.d.ts +9 -5
  83. package/dist/core/ProviderInstantiate.d.ts.map +1 -1
  84. package/dist/core/ProviderInstantiate.js +99 -104
  85. package/dist/core/ProviderInstantiate.js.map +1 -1
  86. package/dist/core/ResourceMutations.d.ts.map +1 -1
  87. package/dist/core/ResourceMutations.js +5 -3
  88. package/dist/core/ResourceMutations.js.map +1 -1
  89. package/dist/core/SchemeRegistry.d.ts +0 -1
  90. package/dist/core/SchemeRegistry.d.ts.map +1 -1
  91. package/dist/core/SchemeRegistry.js +7 -11
  92. package/dist/core/SchemeRegistry.js.map +1 -1
  93. package/dist/core/ToolResources.d.ts +19 -0
  94. package/dist/core/ToolResources.d.ts.map +1 -0
  95. package/dist/core/ToolResources.js +122 -0
  96. package/dist/core/ToolResources.js.map +1 -0
  97. package/dist/core/Turn.d.ts +27 -0
  98. package/dist/core/Turn.d.ts.map +1 -0
  99. package/dist/core/Turn.js +43 -0
  100. package/dist/core/Turn.js.map +1 -0
  101. package/dist/core/Turn.sql +72 -0
  102. package/dist/core/TurnOps.d.ts +7 -0
  103. package/dist/core/TurnOps.d.ts.map +1 -0
  104. package/dist/core/TurnOps.js +63 -0
  105. package/dist/core/TurnOps.js.map +1 -0
  106. package/dist/core/TurnRunner.d.ts +12 -4
  107. package/dist/core/TurnRunner.d.ts.map +1 -1
  108. package/dist/core/TurnRunner.js +1045 -898
  109. package/dist/core/TurnRunner.js.map +1 -1
  110. package/dist/core/WorkerName.d.ts +1 -1
  111. package/dist/core/WorkerName.d.ts.map +1 -1
  112. package/dist/core/env-defaults.d.ts.map +1 -1
  113. package/dist/core/env-defaults.js +7 -5
  114. package/dist/core/env-defaults.js.map +1 -1
  115. package/dist/core/fork.d.ts.map +1 -1
  116. package/dist/core/fork.js +15 -4
  117. package/dist/core/fork.js.map +1 -1
  118. package/dist/core/fork.sql +57 -27
  119. package/dist/core/git-env.d.ts +0 -1
  120. package/dist/core/git-env.d.ts.map +1 -1
  121. package/dist/core/git-env.js +0 -3
  122. package/dist/core/git-env.js.map +1 -1
  123. package/dist/core/git-membership.d.ts.map +1 -1
  124. package/dist/core/git-membership.js +10 -26
  125. package/dist/core/git-membership.js.map +1 -1
  126. package/dist/core/git-state.d.ts.map +1 -1
  127. package/dist/core/git-state.js +13 -14
  128. package/dist/core/git-state.js.map +1 -1
  129. package/dist/core/operation-target-groups.d.ts +3 -0
  130. package/dist/core/operation-target-groups.d.ts.map +1 -0
  131. package/dist/core/operation-target-groups.js +53 -0
  132. package/dist/core/operation-target-groups.js.map +1 -0
  133. package/dist/core/packet-inject.d.ts +0 -1
  134. package/dist/core/packet-inject.d.ts.map +1 -1
  135. package/dist/core/packet-inject.js +6 -13
  136. package/dist/core/packet-inject.js.map +1 -1
  137. package/dist/core/packet-wire.d.ts +4 -0
  138. package/dist/core/packet-wire.d.ts.map +1 -1
  139. package/dist/core/packet-wire.js +208 -44
  140. package/dist/core/packet-wire.js.map +1 -1
  141. package/dist/core/plurnk-uri.d.ts +1 -1
  142. package/dist/core/plurnk-uri.d.ts.map +1 -1
  143. package/dist/core/plurnk-uri.js +3 -3
  144. package/dist/core/plurnk-uri.js.map +1 -1
  145. package/dist/core/teaching.d.ts.map +1 -1
  146. package/dist/core/teaching.js +4 -5
  147. package/dist/core/teaching.js.map +1 -1
  148. package/dist/core/worker-settings.d.ts +9 -0
  149. package/dist/core/worker-settings.d.ts.map +1 -0
  150. package/dist/core/worker-settings.js +25 -0
  151. package/dist/core/worker-settings.js.map +1 -0
  152. package/dist/core/workspace-settings.d.ts +0 -11
  153. package/dist/core/workspace-settings.d.ts.map +1 -1
  154. package/dist/core/workspace-settings.js +3 -47
  155. package/dist/core/workspace-settings.js.map +1 -1
  156. package/dist/digest/Digest.d.ts.map +1 -1
  157. package/dist/digest/Digest.js +164 -92
  158. package/dist/digest/Digest.js.map +1 -1
  159. package/dist/digest/digest.sql +8 -2
  160. package/dist/observe/genai.d.ts +9 -0
  161. package/dist/observe/genai.d.ts.map +1 -0
  162. package/dist/observe/genai.js +31 -0
  163. package/dist/observe/genai.js.map +1 -0
  164. package/dist/observe/spans.d.ts +3 -3
  165. package/dist/observe/spans.d.ts.map +1 -1
  166. package/dist/observe/spans.js +20 -5
  167. package/dist/observe/spans.js.map +1 -1
  168. package/dist/schemes/EffectPolicy.d.ts +3 -0
  169. package/dist/schemes/EffectPolicy.d.ts.map +1 -1
  170. package/dist/schemes/EffectPolicy.js +38 -6
  171. package/dist/schemes/EffectPolicy.js.map +1 -1
  172. package/dist/schemes/Exec.d.ts.map +1 -1
  173. package/dist/schemes/Exec.js +55 -13
  174. package/dist/schemes/Exec.js.map +1 -1
  175. package/dist/schemes/Log.d.ts +6 -2
  176. package/dist/schemes/Log.d.ts.map +1 -1
  177. package/dist/schemes/Log.js +73 -22
  178. package/dist/schemes/Log.js.map +1 -1
  179. package/dist/schemes/Log.sql +25 -7
  180. package/dist/schemes/Prompt.d.ts.map +1 -1
  181. package/dist/schemes/Prompt.js +1 -2
  182. package/dist/schemes/Prompt.js.map +1 -1
  183. package/dist/schemes/QuestionTool.d.ts +10 -0
  184. package/dist/schemes/QuestionTool.d.ts.map +1 -0
  185. package/dist/schemes/QuestionTool.js +81 -0
  186. package/dist/schemes/QuestionTool.js.map +1 -0
  187. package/dist/schemes/Skill.d.ts.map +1 -1
  188. package/dist/schemes/Skill.js +4 -1
  189. package/dist/schemes/Skill.js.map +1 -1
  190. package/dist/schemes/Worker.d.ts.map +1 -1
  191. package/dist/schemes/Worker.js +20 -3
  192. package/dist/schemes/Worker.js.map +1 -1
  193. package/dist/schemes/_entry-crud.sql +19 -1
  194. package/dist/schemes/_entry-find.d.ts +5 -3
  195. package/dist/schemes/_entry-find.d.ts.map +1 -1
  196. package/dist/schemes/_entry-find.js +102 -22
  197. package/dist/schemes/_entry-find.js.map +1 -1
  198. package/dist/schemes/_entry-find.sql +8 -6
  199. package/dist/schemes/_entry-graph.sql +2 -6
  200. package/dist/schemes/_entry-manifest.d.ts.map +1 -1
  201. package/dist/schemes/_entry-manifest.js +12 -1
  202. package/dist/schemes/_entry-manifest.js.map +1 -1
  203. package/dist/schemes/_search-index.d.ts.map +1 -1
  204. package/dist/schemes/_search-index.js +37 -25
  205. package/dist/schemes/_search-index.js.map +1 -1
  206. package/dist/server/Daemon.d.ts +58 -7
  207. package/dist/server/Daemon.d.ts.map +1 -1
  208. package/dist/server/Daemon.js +551 -113
  209. package/dist/server/Daemon.js.map +1 -1
  210. package/dist/server/DrainSupervisor.d.ts +12 -9
  211. package/dist/server/DrainSupervisor.d.ts.map +1 -1
  212. package/dist/server/DrainSupervisor.js +59 -10
  213. package/dist/server/DrainSupervisor.js.map +1 -1
  214. package/dist/server/client-input.d.ts +5 -2
  215. package/dist/server/client-input.d.ts.map +1 -1
  216. package/dist/server/client-input.js +53 -34
  217. package/dist/server/client-input.js.map +1 -1
  218. package/dist/server/dispatch-as-plurnk.d.ts.map +1 -1
  219. package/dist/server/dispatch-as-plurnk.js +28 -6
  220. package/dist/server/dispatch-as-plurnk.js.map +1 -1
  221. package/dist/server/drain.sql +26 -11
  222. package/dist/server/envelope.d.ts +1 -1
  223. package/dist/server/envelope.d.ts.map +1 -1
  224. package/dist/server/envelope.js +4 -4
  225. package/dist/server/envelope.js.map +1 -1
  226. package/dist/server/envelope.sql +25 -1
  227. package/dist/server/lifecycle-recovery.sql +11 -1
  228. package/dist/server/logEntry.d.ts +2 -1
  229. package/dist/server/logEntry.d.ts.map +1 -1
  230. package/dist/server/logEntry.js +3 -2
  231. package/dist/server/logEntry.js.map +1 -1
  232. package/dist/server/logEntry.sql +7 -0
  233. package/dist/server/loop-model.d.ts +2 -2
  234. package/dist/server/loop-model.d.ts.map +1 -1
  235. package/dist/server/loop-model.js +23 -33
  236. package/dist/server/loop-model.js.map +1 -1
  237. package/dist/server/loopDocs.d.ts.map +1 -1
  238. package/dist/server/loopDocs.js +61 -10
  239. package/dist/server/loopDocs.js.map +1 -1
  240. package/dist/server/loopDocs.sql +4 -2
  241. package/dist/server/model-catalog.d.ts +3 -0
  242. package/dist/server/model-catalog.d.ts.map +1 -0
  243. package/dist/server/model-catalog.js +83 -0
  244. package/dist/server/model-catalog.js.map +1 -0
  245. package/dist/server/model-route.d.ts +7 -0
  246. package/dist/server/model-route.d.ts.map +1 -0
  247. package/dist/server/model-route.js +47 -0
  248. package/dist/server/model-route.js.map +1 -0
  249. package/dist/server/module-discovery.d.ts +13 -0
  250. package/dist/server/module-discovery.d.ts.map +1 -0
  251. package/dist/server/module-discovery.js +78 -0
  252. package/dist/server/module-discovery.js.map +1 -0
  253. package/dist/server/skillDocs.d.ts +9 -0
  254. package/dist/server/skillDocs.d.ts.map +1 -0
  255. package/dist/server/skillDocs.js +212 -0
  256. package/dist/server/skillDocs.js.map +1 -0
  257. package/dist/server/skillDocs.sql +14 -0
  258. package/dist/service.d.ts.map +1 -1
  259. package/dist/service.js +182 -123
  260. package/dist/service.js.map +1 -1
  261. package/migrations/001_schema.sql +424 -65
  262. package/package.json +37 -37
  263. package/dist/core/ExecutableTools.d.ts +0 -11
  264. package/dist/core/ExecutableTools.d.ts.map +0 -1
  265. package/dist/core/ExecutableTools.js +0 -49
  266. package/dist/core/ExecutableTools.js.map +0 -1
  267. package/dist/core/JournalTurn.d.ts +0 -9
  268. package/dist/core/JournalTurn.d.ts.map +0 -1
  269. package/dist/core/JournalTurn.js +0 -14
  270. package/dist/core/JournalTurn.js.map +0 -1
  271. package/dist/core/JournalTurn.sql +0 -10
  272. package/dist/core/git-iso.d.ts +0 -13
  273. package/dist/core/git-iso.d.ts.map +0 -1
  274. package/dist/core/git-iso.js +0 -267
  275. package/dist/core/git-iso.js.map +0 -1
  276. package/dist/core/search-gate.d.ts +0 -17
  277. package/dist/core/search-gate.d.ts.map +0 -1
  278. package/dist/core/search-gate.js +0 -77
  279. package/dist/core/search-gate.js.map +0 -1
  280. package/dist/digest/Digest.sql +0 -1
package/.env.defaults CHANGED
@@ -1,8 +1,7 @@
1
1
  # ⚠ REFERENCE — this is @plurnk/plurnk-service's shipped .env.defaults: the operative floor
2
- # for its knobs and the source of the derived --<knob> CLI flags (INSTALL.md is the agent-facing
3
- # breakdown). ~/.plurnk/.env.defaults is the ASSEMBLED catalog (every installed package's file),
4
- # machine-owned and regenerated each boot do NOT edit either. Put YOUR config in ~/.plurnk/.env
5
- # (yours, seeded once, never touched) or ./.env.
2
+ # for its knobs and source of the derived --<knob> CLI flags. Run
3
+ # `plurnk-service config defaults` for the complete owner-labelled installed aggregate. Put user
4
+ # overrides in $XDG_CONFIG_HOME/plurnk/.env (seeded once, never overwritten), ./.env, or the shell.
6
5
  #
7
6
  # THE STANDARD (every plurnk package, third-party included): ship a `.env.defaults` at your
8
7
  # package root declaring YOUR knobs (prefix = your package's name); the file IS the documentation.
@@ -12,16 +11,18 @@
12
11
  #
13
12
  # Source classes (low → high precedence; higher classes win):
14
13
  # assembled .env.defaults floor (this file + every installed member's, uniqueness-checked)
15
- # < ~/.plurnk/.env (your home config — seeded once, yours to keep)
14
+ # < $XDG_CONFIG_HOME/plurnk/.env (your user config — seeded once, yours to keep)
16
15
  # < ./.env (per-project, current directory)
17
16
  # < --env-file=… / --config=…
18
17
  # < shell environment
19
18
  # < --<knob> CLI flags (the 1:1 mirror: --service-max-turns <-> PLURNK_SERVICE_MAX_TURNS)
20
- # Ordering among repeated explicit files is currently unspecified (#84).
19
+ # Later repeated explicit files win.
21
20
  # Feature-flag bools use `=== "1"` exactly, never `=== "true"`. `~/` expands to your home.
22
21
 
23
22
  # --- Storage ---
24
- PLURNK_SERVICE_DB_PATH=~/.plurnk/plurnk.db
23
+ # Empty derives $XDG_DATA_HOME/plurnk/plurnk.db (default ~/.local/share/plurnk/plurnk.db).
24
+ # An explicit non-empty path overrides it; `~/` expands to home.
25
+ PLURNK_SERVICE_DB_PATH=
25
26
 
26
27
  # --- Sqlite tuning (curated knobs passed through to sqlrite; optional) ---
27
28
  # sqlrite already sets the safe posture (WAL + synchronous=NORMAL + busy_timeout=5000ms).
@@ -42,8 +43,9 @@ PLURNK_HOST=127.0.0.1
42
43
  PLURNK_PORT=3044
43
44
 
44
45
  # --- Loop control ---
45
- # Optional default child-provider alias. Unset = each WORK/FORK child inherits
46
- # its spawning loop's provider. Clients may override this per top-level loop.
46
+ # Optional default child-model selector (declared alias or provider/model route).
47
+ # Unset = each WORK/FORK child inherits its spawning loop's model. Clients may
48
+ # override this per top-level loop.
47
49
  # PLURNK_MODEL_CHILD=fast
48
50
  # Operator turn ceiling. -1 (default) = no cap (loops end via SEND, provider capacity,
49
51
  # strikes, or cycle detection). A positive value is an inviolable hard cap a
@@ -56,6 +58,9 @@ PLURNK_SERVICE_MAX_TURNS=-1
56
58
  PLURNK_SERVICE_MAX_COMMANDS=-1
57
59
  # Live & demo test harness story timeout (ms) — 10 minutes (600000ms).
58
60
  PLURNK_SERVICE_LIVE_TIMEOUT=600000
61
+ # {§crash-only-stop} — the daemon's settle deadline on stop(): past this the
62
+ # shutdown abandons its waits instead of hanging forever on a wedged child.
63
+ PLURNK_SERVICE_STOP_TIMEOUT_MS=30000
59
64
  # Proposal resolution bound (ms). Empty = a stopped world waits for its human indefinitely;
60
65
  # a finite positive value auto-cancels unattended (outcome=timeout). Every other explicit
61
66
  # value is invalid and fails at the proposal lifecycle owner.
@@ -63,15 +68,21 @@ PLURNK_SERVICE_PROPOSAL_TIMEOUT_MS=
63
68
  # Turn-hold runtimes: while a listed runtime's stream is in flight the cycle pauses (no next
64
69
  # turn) until it concludes. Bounded by _HOLD_MS, fail-open at the cap. Empty = no holds.
65
70
  # A bare name holds all of that runtime's spawns; `<runtime>:<effect>` holds only
66
- # that effect class.
67
- PLURNK_SERVICE_EXEC_HOLD=search,images,videos,news,map,music,it,science,social,downloadable
71
+ # that effect class. The retired web-search family names are gone; declare operator
72
+ # runtimes explicitly.
73
+ PLURNK_SERVICE_EXEC_HOLD=
68
74
  PLURNK_SERVICE_EXEC_HOLD_MS=300000
75
+ # Effect admission overrides ({§effect-policy-tunable}): comma-separated
76
+ # <effect>:<policy> entries (host/read/pure → propose/auto). Unlisted effects
77
+ # keep the default map (host proposes; read/pure auto-run). Empty = defaults.
78
+ PLURNK_SERVICE_EFFECT_POLICY=
69
79
  # Optimistic worker settlement: before model dispatch, allow newly started
70
80
  # streams or a completion wake with live siblings this many ms to quiesce.
71
81
  # Settlement ends immediately at quiescence and never extends its first
72
82
  # deadline; survivors follow the monitored lifecycle. 0 = off.
73
83
  PLURNK_SERVICE_OPTIMISTIC_WAIT_MS=5000
74
- # Exec poll backoff (#521, {§exec-poll}): a parked exec with NO explicit `<,P>` cadence is no longer
84
+ # Exec poll backoff ({§exec-poll}, https://github.com/plurnk/plurnk-service/issues/521):
85
+ # a parked exec with NO explicit `<,P>` cadence is no longer
75
86
  # park-blind-forever — the loop wakes on an exponential backoff so the model regains a turn to read
76
87
  # partial output and re-park a slow long-runner or KILL a stuck one. Wake N fires at BASE·2^min(N,TURNS-1)
77
88
  # seconds (60,120,240,…,7680), then holds at the cap. An explicit `<,P>` wins; `<,0>` opts out (blind).
@@ -123,12 +134,7 @@ PLURNK_SERVICE_GIT_ALLOWED=1
123
134
  # PLURNK_SERVICE_GIT_AUTO — automatic project-repository membership. =1 includes the Git
124
135
  # repository containing project_root; =0 leaves `pick` as the only membership source.
125
136
  PLURNK_SERVICE_GIT_AUTO=1
126
- # PLURNK_SERVICE_GIT_ISO - git READ backend. Default (0) uses the native Git
127
- # binary. =1 explicitly selects the slower, in-process isomorphic-git backend
128
- # for a deployment that cannot spawn Git. The two backends never fail over.
129
- PLURNK_SERVICE_GIT_ISO=0
130
- # Maximum stdout/stderr payload accepted from one native Git subprocess. The
131
- # optional in-process reader does not use this bound.
137
+ # Maximum stdout/stderr payload accepted from one native Git subprocess.
132
138
  PLURNK_SERVICE_GIT_OUTPUT_MAX_BYTES=67108864
133
139
 
134
140
  # Ordinary bounded OPEN-body projection. READ/FIND results and PLAN working
@@ -142,17 +148,6 @@ PLURNK_SERVICE_PREVIEW_CHARS=2560
142
148
  # line anchor. 0 authenticates only the addressed line.
143
149
  PLURNK_SERVICE_LINE_ANCHOR_CONTEXT_LINES=2
144
150
 
145
- # --- Reference docs (auto-READ at turn 0) ---
146
- # PLURNK_SERVICE_MD_<ALIAS>=<path> materializes <path>'s markdown as a
147
- # worker://plurnk/<ALIAS>.md
148
- # entry the model READs at turn 0 — an idiomatic way to inject standing context
149
- # (an ordinary entry + READ op, not a bespoke packet section). ~ expands to home;
150
- # relative paths resolve against the package root. A client may add its own docs
151
- # per workspace via workspace.create settings.mdDocs (content, not a path); those UNION
152
- # with these env docs, keyed by alias — the client wins a collision (#231).
153
- # Commented out = no docs by default. (The operating policy is NOT a doc: readSystemPolicy
154
- # already renders ~/.plurnk/AGENTS.md as the ## Policy section — pointing a
155
- # PLURNK_SERVICE_MD_* alias at it injects the same file twice.)
156
151
  # Turn-0 catalog preview so a run opens oriented, not blank. Folder-capable schemes use
157
152
  # FIND(<scheme>:///*): direct entries plus exact dir/** summaries carrying each subtree's
158
153
  # recursive item and token counts. Curated kernel docs remain recursive, demonstrating both
@@ -195,10 +190,9 @@ PLURNK_SERVICE_PROMPT_PROJECTION=25%
195
190
  # (PLURNK_PLUGINS_TRUSTED_ONLY lives in @plurnk/plurnk-meta — reader-declares: the
196
191
  # trust rule's one implementation lives there and so does its knob.)
197
192
 
198
- # PLURNK_SERVICE_DOCS_EXCLUDE — comma list of scheme/exec names dropped from BOTH the teaching oneliner
199
- # and the materialized pull-doc on load. The default names are omitted from this generic
200
- # catalogue because their teaching is owned elsewhere. Empty → exclude nothing. Unknown names
201
- # are inert (a filter, not a contract).
193
+ # PLURNK_SERVICE_DOCS_EXCLUDE — comma list of scheme names dropped from BOTH the teaching oneliner
194
+ # and its materialized pull-doc on load. Executable tools instead use their one enablement policy,
195
+ # so an enabled tool is always discoverable. Empty → exclude nothing. Unknown names are inert.
202
196
  PLURNK_SERVICE_DOCS_EXCLUDE="plurnk,file,exec"
203
197
 
204
198
  # PLURNK_SERVICE_PACKET_INJECT — an operator markdown file injected as a section right after the teaching
@@ -207,10 +201,9 @@ PLURNK_SERVICE_DOCS_EXCLUDE="plurnk,file,exec"
207
201
  # PLURNK_SERVICE_PACKET_INJECT="~/injection.md"
208
202
 
209
203
  # PLURNK_SERVICE_POLICY — the operating-policy markdown, rendered as the ## Policy
210
- # section. Unset = the seeded ~/.plurnk/AGENTS.md; a path = that file; EXPLICITLY empty = policy off.
204
+ # section. Unset = the seeded $XDG_CONFIG_HOME/plurnk/AGENTS.md; a path = that file;
205
+ # EXPLICITLY empty = policy off.
211
206
  # PLURNK_SERVICE_POLICY=
212
- # PLURNK_SERVICE_PROJECT — a per-project policy markdown (relative to projectRoot). Unset = <root>/AGENTS.md.
213
- # PLURNK_SERVICE_PROJECT=
214
207
  # PLURNK_SERVICE_REQUIREMENTS — Recap source override (relative to the package root).
215
208
  # Unset = the packaged requirements.md.
216
209
  # PLURNK_SERVICE_REQUIREMENTS=
@@ -236,12 +229,6 @@ PLURNK_SERVICE_MAX_EMBED_SIZE=0
236
229
  # hosts/runs that don't want vector search; the Mock bootstrap and constrained benchmarks set it.
237
230
  PLURNK_SERVICE_EMBED_DISABLE=0
238
231
 
239
- # Which exec runtimes the search gate treats as searches — the per-turn cap and identical-query
240
- # dedup apply to these (the search family delegates page fetches to the entry() sink; {§exec-entry-sink}).
241
- PLURNK_SERVICE_SEARCH_RUNTIMES=search
242
- # Per-turn search flood cap: the (N+1)th search EXEC in one turn is refused 429 (dedup of
243
- # identical queries is unconditional and separate — it strikes and serves the prior results).
244
- PLURNK_SERVICE_SEARCH_MAX_PER_TURN=3
245
232
  # Comma-separated file pathname patterns omitted from search derivations. Content remains directly
246
233
  # readable. Patterns without `/` match the basename; patterns with `/` match the full pathname.
247
234
  # Uses body-matcher glob syntax; the first match is the observable exclusion reason. Empty = none.
package/INSTALL.md CHANGED
@@ -1,6 +1,10 @@
1
1
  # Configuring plurnk-service
2
2
 
3
- Operator guide. Put machine-specific choices in `~/.plurnk/.env`. Each installed package's `.env.defaults` is the authoritative list and floor for the knobs that package owns; the daemon assembles those files into the read-only `~/.plurnk/.env.defaults` catalog on every boot.
3
+ Operator guide. Put machine-specific choices in
4
+ `$XDG_CONFIG_HOME/plurnk/.env` (normally `~/.config/plurnk/.env`). Each
5
+ installed package's `.env.defaults` is the authoritative list and floor for
6
+ the knobs that package owns. `plurnk-service config defaults` projects the
7
+ complete owner-labelled catalog on demand; no generated copy is persisted.
4
8
 
5
9
  ## Install
6
10
 
@@ -10,7 +14,14 @@ plurnk-service migrate # apply the disposable version-1 schema baseline
10
14
  plurnk-service start
11
15
  ```
12
16
 
13
- First start creates `~/.plurnk/`: `.env` (yours, seeded once with a model picker — **edit this**), `AGENTS.md` (the operating policy, yours), `.env.defaults` + `INSTALL.md` (package-owned references, **refreshed every boot** — never edit them). No model ships active; the daemon can boot without one, but model loops fail until `PLURNK_MODEL` selects a declared alias.
17
+ First start creates `$XDG_CONFIG_HOME/plurnk` with `.env` (yours, seeded once
18
+ with three model profiles—**edit this**) and `AGENTS.md` (the operating policy,
19
+ yours). Durable SQLite data defaults to `$XDG_DATA_HOME/plurnk/plurnk.db`. No
20
+ model ships active; the daemon can boot without one, but model loops fail until
21
+ `PLURNK_MODEL` selects a declared alias or exact provider/model route. Use `plurnk-service config`, `config
22
+ edit`, `config defaults`, and `config check` to inspect and maintain the one
23
+ environment cascade. A pre-XDG `~/.plurnk` is never read implicitly; stop the
24
+ old daemon and run `plurnk-service paths migrate` once.
14
25
 
15
26
  The default service includes local embeddings. An explicitly disabled or unavailable embedder makes `~query` fall back to FTS keyword ranking. Set `PLURNK_MIMETYPES_EMBED_BASE_URL` to use a remote OpenAI-compatible embedding endpoint instead.
16
27
 
@@ -21,14 +32,20 @@ Higher-priority source classes override lower ones ({§operator-config-precedenc
21
32
  | Priority | Source | Role |
22
33
  |---------:|----------------------------------------|--------------------------------------------------------------------------------------------|
23
34
  | 1 | Installed packages' assembled defaults | Versioned floor; one owner per key. A collision fails boot naming both owners. |
24
- | 2 | `~/.plurnk/.env` | User configuration, seeded once and never overwritten. **Write generated config here.** |
35
+ | 2 | `$XDG_CONFIG_HOME/plurnk/.env` | User configuration, seeded once and never overwritten. |
25
36
  | 3 | `./.env` | Configuration for the current working directory. |
26
37
  | 4 | `--config=<path>` | One explicit service configuration file. |
27
38
  | 5 | `--env-file*` | Repeatable explicit files; later files win. The `-if-exists` form skips absent files. |
28
39
  | 6 | Shell environment | Process-level operator values. |
29
40
  | 7 | `--<flag>` | Highest-priority service CLI value. |
30
41
 
31
- `~/.plurnk/.env.defaults` is the regenerated assembled catalog, not another input layer. The service CLI mirrors only the `PLURNK_*` variables declared by the service package's own `.env.defaults`: strip `PLURNK_`, lowercase, and replace `_` with `-` (`PLURNK_SERVICE_MAX_TURNS` ↔ `--service-max-turns`). Installed plugin knobs remain available through env/config files and the assembled catalog without implicitly expanding the service executable's CLI ({§operator-config-cli-flags}). Feature-flag booleans use `1`, not `true`; `~/` expands to home.
42
+ The service CLI mirrors only the `PLURNK_*` variables declared by the service
43
+ package's own `.env.defaults`: strip `PLURNK_`, lowercase, and replace `_` with
44
+ `-` (`PLURNK_SERVICE_MAX_TURNS` ↔ `--service-max-turns`). Installed plugin
45
+ knobs remain available through env/config files and `config defaults` without
46
+ implicitly expanding the service executable's CLI
47
+ ({§operator-config-cli-flags}). Feature-flag booleans use `1`, not `true`;
48
+ `~/` expands to home.
32
49
 
33
50
  ## The prefix law (who owns a flag)
34
51
 
@@ -36,6 +53,26 @@ Family prefixes identify the semantic owner: `PLURNK_SERVICE_*` (this daemon), `
36
53
 
37
54
  When a value is required, an unset or retired name fails boot naming the violated key rather than selecting a silent default.
38
55
 
56
+ ## Agent Skills
57
+
58
+ Plurnk reads the standard universal roots: project skills from
59
+ `.agents/skills/<name>/SKILL.md`, then user-global skills from
60
+ `~/.agents/skills/<name>/SKILL.md`. Package-bundled skills form
61
+ the final layer; the default installation includes an attributed, pinned
62
+ `find-skills`. Project names shadow global names, which shadow bundled names.
63
+ Plurnk never copies a bundled skill into the shared global root and does not
64
+ maintain a separate skill registry.
65
+
66
+ Use the ecosystem CLI when you deliberately install something. A project
67
+ installation is the ordinary default:
68
+
69
+ ```sh
70
+ npx skills add <owner/repo@skill> --agent universal --yes
71
+ ```
72
+
73
+ Add `--global` only when you intend to share that skill with every compatible
74
+ agent using the universal user root.
75
+
39
76
  ## Couplings (the edges an agent gets wrong)
40
77
 
41
78
  These are relationships *between* flags. Set them as a unit.
@@ -58,12 +95,14 @@ These are relationships *between* flags. Set them as a unit.
58
95
  Local llama-server users may set `PLURNK_PROVIDERS_GBNF_<alias>`; transport
59
96
  and enforcement are verified at boot. Cloud and endpoint-managed aliases
60
97
  leave it unset. A configured PLURNK rail requires reasoning `adaptive` or
61
- `on`; pairing it with `off` is invalid. Pin
98
+ a fixed effort; pairing it with `off` is invalid. Pin
62
99
  `PLURNK_PROVIDERS_LLAMA_SERVER_<alias>=1` only when a llama-server cannot be
63
100
  fingerprinted reliably.
64
101
  - **A reasoning model must reason somewhere.**
65
- `PLURNK_PROVIDERS_REASONING_<alias>` selects `off`, `adaptive`, or `on`.
66
- An explicit `on` also requires a positive provider reasoning budget.
102
+ `PLURNK_PROVIDERS_REASONING_<alias>` selects `off`, `adaptive`, `low`,
103
+ `medium`, or `high`. A fixed effort may require a positive provider reasoning
104
+ budget when the provider exposes manual token allocation rather than an
105
+ effort control.
67
106
 
68
107
  ## Profiles (examples, not a decision tree — adapt to the real box)
69
108
 
@@ -78,7 +117,7 @@ Each mirrors a `# --- section ---` in the floor; consult the floor for exact def
78
117
 
79
118
  - **Storage** — `PLURNK_SERVICE_DB_PATH`, and the optional `PLURNK_SERVICE_SQLITE_*` passthroughs (sqlrite already sets a safe WAL posture; tune only for a hot/large DB).
80
119
  - **Daemon transport** — bare `PLURNK_HOST`/`PLURNK_PORT`: THE client surface (the AG-UI+ listener, bound by the plurnk-agui module at boot). Production is single-listener; every first-party client rides it.
81
- - **Model aliases** — bare `PLURNK_MODEL` selects the active provider; `PLURNK_MODEL_<alias>` defines one; `PLURNK_BASEURL_<alias>` overrides its endpoint. Optional `PLURNK_MODEL_CHILD=<alias>` selects WORK/FORK descendants; unset inherits the spawning loop's provider. The front door — keep these bare and short.
120
+ - **Model selection** — bare `PLURNK_MODEL` selects a declared alias or exact provider/model route; `PLURNK_MODEL_<alias>` defines an optional friendly route and tuning scope; `PLURNK_BASEURL_<alias>` overrides that alias's endpoint. `PLURNK_MODEL_CHILD` accepts the same selector vocabulary for WORK/FORK descendants; unset inherits the spawning loop's provider.
82
121
  - **Loop control / engine rails** — `PLURNK_SERVICE_MAX_TURNS` (−1 = uncapped), `_MAX_COMMANDS`, `_MAX_STRIKES`, `_EMISSION_ATTEMPTS`, `_MIN_CYCLES`, `_MAX_CYCLE_PERIOD`, `_LOOP_TIMEOUT`, `_PROPOSAL_TIMEOUT_MS`, `_EXEC_HOLD`, `_OPTIMISTIC_WAIT_MS`, `_EXEC_POLL_SEC`/`_TURNS`, `_EXEC_KILL_GRACE_MS`, `_WORKSPACE_WORKERS_MAX_ACTIVE`.
83
122
  - **Git** — `PLURNK_SERVICE_GIT_ALLOWED` (0 = hard sandbox lockout), `_GIT_AUTO`.
84
123
  - **Packet / reference docs** — `PLURNK_SERVICE_FILES_ITEMS` (turn-0 shallow file-map cap), `_PREVIEW_LINES`/`_PREVIEW_CHARS`, `_LINE_ANCHOR_CONTEXT_LINES`, `_EDIT_RECEIPT_REVISION_CHARS`/`_CONTEXT_LINES`, `_BRANCH_RECEIPT_REVISION_CHARS`, `_DOCS_EXCLUDE`, `_PACKET_INJECT` (operator markdown section), `_POLICY`/`_PROJECT` (policy overrides), `_REQUIREMENTS` (Recap-source override), `_MD_<alias>` (materialized reference entry).
@@ -92,8 +131,8 @@ Each mirrors a `# --- section ---` in the floor; consult the floor for exact def
92
131
  of that provider-derived curation gauge.
93
132
  - **Plugins** — bare `PLURNK_PLUGINS_TRUSTED_ONLY` (0/unset = load all installed; a value = `@plurnk/*` plus an allowlist).
94
133
  - **Semantic search** — `PLURNK_SERVICE_SEMANTIC_CHUNK_TOKENS`/`_CHUNK_OVERLAP` (service-side chunking), `PLURNK_SERVICE_EMBED_DISABLE` (FTS-only), `PLURNK_MIMETYPES_EMBED_WORKERS` (the embedder's pool — mimetypes-owned).
95
- - **Schemes: http** — `PLURNK_SCHEMES_HTTP_FETCH_TIMEOUT`, `_TTL_MS`, optional `# TAVILY_API_KEY=`, and `PLURNK_SCHEMES_HTTP_TAVILY_DEPTH`/`_TAVILY_TIMEOUT_MS`.
96
- - **Execs** - `PLURNK_EXECS_<runtime>=0` disables a runtime; `PLURNK_EXECS_SEARCH_SEARXNG_URL` enables web search (unset = search off).
134
+ - **Schemes: http** — `PLURNK_SCHEMES_HTTP_FETCH_TIMEOUT`, `_TTL_MS`, optional `# PLURNK_SCHEMES_HTTP_MATERIALIZER=` (a materializer plugin id).
135
+ - **Execs** `PLURNK_EXECS_<runtime>=0` disables a runtime; web discovery is an MCP attachment (`PLURNK_MCP_<server>`), not an executor.
97
136
  - **Hooks** — `PLURNK_HOOKS_COMMAND` plus JSON `PLURNK_HOOKS_ARGS` invokes one exact no-shell command for the core events selected by `PLURNK_HOOKS_EVENTS`; see `@plurnk/plurnk-hooks/README.md`.
98
137
  - **Observability** — standard `OTEL_*` env ({§observability-boundary}):
99
138
  `OTEL_TRACES_EXPORTER`/`OTEL_METRICS_EXPORTER` (`otlp` or `console`; unset
package/README.md CHANGED
@@ -34,7 +34,17 @@ plurnk-service migrate # apply the disposable version-1 schema baseline
34
34
  plurnk-service start # daemon
35
35
  ```
36
36
 
37
- Config + state live in `~/.plurnk/` (created on first start): put your config in `~/.plurnk/.env` (yours, seeded once); the DB defaults to `~/.plurnk/plurnk.db`. Declare a provider/model as `PLURNK_MODEL_<alias>=<provider>/<model-id>`, then select that alias with `PLURNK_MODEL=<alias>`. **[`INSTALL.md`](./INSTALL.md) is the config guide** — the cascade, prefix ownership, coupled settings, and profiles; each installed package's `.env.defaults` supplies its exact machine floor.
37
+ Configuration follows XDG at `$XDG_CONFIG_HOME/plurnk` (normally
38
+ `~/.config/plurnk`); durable data defaults to `$XDG_DATA_HOME/plurnk` (normally
39
+ `~/.local/share/plurnk`). First start seeds the user-owned `.env` and
40
+ `AGENTS.md` once. Select an exact route with
41
+ `PLURNK_MODEL=<provider>/<model-id>`, or declare a reusable/tuned
42
+ `PLURNK_MODEL_<alias>=<provider>/<model-id>` and select its alias. Run
43
+ `plurnk-service config defaults` for
44
+ the complete installed option catalog and `plurnk-service config check` to
45
+ validate without contacting a provider. **[`INSTALL.md`](./INSTALL.md) is the
46
+ configuration guide.** A legacy mixed `~/.plurnk` is moved only by the explicit
47
+ `plurnk-service paths migrate` command.
38
48
 
39
49
  The 1.x package retains its frozen root library barrel for SemVer compatibility;
40
50
  it is not the client boundary and gains no new APIs. Programmatic forensic use