@plurnk/plurnk-service 1.5.0 → 1.6.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 (248) hide show
  1. package/.env.defaults +22 -27
  2. package/INSTALL.md +22 -17
  3. package/README.md +1 -1
  4. package/SPEC.md +505 -362
  5. package/dist/build-info.json +1 -1
  6. package/dist/content/edit-collision.d.ts +5 -0
  7. package/dist/content/edit-collision.d.ts.map +1 -0
  8. package/dist/content/edit-collision.js +14 -0
  9. package/dist/content/edit-collision.js.map +1 -0
  10. package/dist/content/edit-receipt.d.ts +3 -2
  11. package/dist/content/edit-receipt.d.ts.map +1 -1
  12. package/dist/content/edit-receipt.js +58 -13
  13. package/dist/content/edit-receipt.js.map +1 -1
  14. package/dist/content/index.d.ts +4 -1
  15. package/dist/content/index.d.ts.map +1 -1
  16. package/dist/content/index.js +3 -1
  17. package/dist/content/index.js.map +1 -1
  18. package/dist/content/line-anchors.d.ts +41 -0
  19. package/dist/content/line-anchors.d.ts.map +1 -0
  20. package/dist/content/line-anchors.js +191 -0
  21. package/dist/content/line-anchors.js.map +1 -0
  22. package/dist/content/read-projector.d.ts +7 -1
  23. package/dist/content/read-projector.d.ts.map +1 -1
  24. package/dist/content/read-projector.js +46 -10
  25. package/dist/content/read-projector.js.map +1 -1
  26. package/dist/content/read-resolve.js +3 -3
  27. package/dist/content/read-resolve.js.map +1 -1
  28. package/dist/core/BudgetReadout.d.ts.map +1 -1
  29. package/dist/core/BudgetReadout.js +9 -2
  30. package/dist/core/BudgetReadout.js.map +1 -1
  31. package/dist/core/ChannelWrite.js +1 -1
  32. package/dist/core/ChannelWrite.js.map +1 -1
  33. package/dist/core/ChannelWrite.sql +3 -3
  34. package/dist/core/CoreSchemeServices.d.ts +1 -1
  35. package/dist/core/CoreSchemeServices.d.ts.map +1 -1
  36. package/dist/core/CoreSchemeServices.js +1 -1
  37. package/dist/core/CoreSchemeServices.js.map +1 -1
  38. package/dist/core/Dispatcher.d.ts +15 -5
  39. package/dist/core/Dispatcher.d.ts.map +1 -1
  40. package/dist/core/Dispatcher.js +220 -978
  41. package/dist/core/Dispatcher.js.map +1 -1
  42. package/dist/core/DurableStatement.d.ts.map +1 -1
  43. package/dist/core/DurableStatement.js +2 -0
  44. package/dist/core/DurableStatement.js.map +1 -1
  45. package/dist/core/Engine.d.ts +18 -43
  46. package/dist/core/Engine.d.ts.map +1 -1
  47. package/dist/core/Engine.js +90 -1554
  48. package/dist/core/Engine.js.map +1 -1
  49. package/dist/core/Engine.sql +192 -112
  50. package/dist/core/ExecutableTools.d.ts +10 -0
  51. package/dist/core/ExecutableTools.d.ts.map +1 -0
  52. package/dist/core/ExecutableTools.js +41 -0
  53. package/dist/core/ExecutableTools.js.map +1 -0
  54. package/dist/core/ExecutorRegistry.d.ts +3 -3
  55. package/dist/core/ExecutorRegistry.d.ts.map +1 -1
  56. package/dist/core/ExecutorRegistry.js +2 -2
  57. package/dist/core/ExecutorRegistry.js.map +1 -1
  58. package/dist/core/LogBody.d.ts +3 -0
  59. package/dist/core/LogBody.d.ts.map +1 -1
  60. package/dist/core/LogBody.js +21 -5
  61. package/dist/core/LogBody.js.map +1 -1
  62. package/dist/core/LogEntryProjection.d.ts +14 -0
  63. package/dist/core/LogEntryProjection.d.ts.map +1 -0
  64. package/dist/core/LogEntryProjection.js +38 -0
  65. package/dist/core/LogEntryProjection.js.map +1 -0
  66. package/dist/core/ModelCall.d.ts +27 -0
  67. package/dist/core/ModelCall.d.ts.map +1 -0
  68. package/dist/core/ModelCall.js +127 -0
  69. package/dist/core/ModelCall.js.map +1 -0
  70. package/dist/core/PacketBuilder.d.ts +14 -25
  71. package/dist/core/PacketBuilder.d.ts.map +1 -1
  72. package/dist/core/PacketBuilder.js +170 -244
  73. package/dist/core/PacketBuilder.js.map +1 -1
  74. package/dist/core/ProblemLog.d.ts +1 -1
  75. package/dist/core/ProblemLog.d.ts.map +1 -1
  76. package/dist/core/ProblemLog.js +15 -3
  77. package/dist/core/ProblemLog.js.map +1 -1
  78. package/dist/core/ProposalLifecycle.d.ts +2 -2
  79. package/dist/core/ProposalLifecycle.d.ts.map +1 -1
  80. package/dist/core/ProposalLifecycle.js +17 -9
  81. package/dist/core/ProposalLifecycle.js.map +1 -1
  82. package/dist/core/ProviderInstantiate.d.ts.map +1 -1
  83. package/dist/core/ProviderInstantiate.js +25 -8
  84. package/dist/core/ProviderInstantiate.js.map +1 -1
  85. package/dist/core/ResourceMutations.d.ts +73 -0
  86. package/dist/core/ResourceMutations.d.ts.map +1 -0
  87. package/dist/core/ResourceMutations.js +1142 -0
  88. package/dist/core/ResourceMutations.js.map +1 -0
  89. package/dist/core/SchemeRegistry.js +10 -10
  90. package/dist/core/SchemeRegistry.js.map +1 -1
  91. package/dist/core/StoredPacket.d.ts +2 -2
  92. package/dist/core/StoredPacket.js +7 -7
  93. package/dist/core/StrikeRail.d.ts +0 -1
  94. package/dist/core/StrikeRail.d.ts.map +1 -1
  95. package/dist/core/StrikeRail.js +6 -4
  96. package/dist/core/StrikeRail.js.map +1 -1
  97. package/dist/core/TurnRunner.d.ts +72 -0
  98. package/dist/core/TurnRunner.d.ts.map +1 -0
  99. package/dist/core/TurnRunner.js +1730 -0
  100. package/dist/core/TurnRunner.js.map +1 -0
  101. package/dist/core/caps/CapsResolve.js +1 -1
  102. package/dist/core/caps/CapsResolve.js.map +1 -1
  103. package/dist/core/caps/DbChannelCaps.js +4 -4
  104. package/dist/core/caps/DbChannelCaps.js.map +1 -1
  105. package/dist/core/caps/DbEntryCaps.d.ts +2 -1
  106. package/dist/core/caps/DbEntryCaps.d.ts.map +1 -1
  107. package/dist/core/caps/DbEntryCaps.js +8 -5
  108. package/dist/core/caps/DbEntryCaps.js.map +1 -1
  109. package/dist/core/caps/DbProjectionCaps.d.ts +1 -0
  110. package/dist/core/caps/DbProjectionCaps.d.ts.map +1 -1
  111. package/dist/core/caps/DbProjectionCaps.js +29 -0
  112. package/dist/core/caps/DbProjectionCaps.js.map +1 -1
  113. package/dist/core/caps/SchemeCtxImpl.d.ts +5 -2
  114. package/dist/core/caps/SchemeCtxImpl.d.ts.map +1 -1
  115. package/dist/core/caps/SchemeCtxImpl.js +6 -4
  116. package/dist/core/caps/SchemeCtxImpl.js.map +1 -1
  117. package/dist/core/content-hash.js +2 -2
  118. package/dist/core/content-hash.js.map +1 -1
  119. package/dist/core/content-weight.d.ts +2 -0
  120. package/dist/core/content-weight.d.ts.map +1 -0
  121. package/dist/core/content-weight.js +4 -0
  122. package/dist/core/content-weight.js.map +1 -0
  123. package/dist/core/content_weight.d.ts +4 -0
  124. package/dist/core/content_weight.d.ts.map +1 -0
  125. package/dist/core/content_weight.js +6 -0
  126. package/dist/core/content_weight.js.map +1 -0
  127. package/dist/core/fork.d.ts.map +1 -1
  128. package/dist/core/fork.js +23 -7
  129. package/dist/core/fork.js.map +1 -1
  130. package/dist/core/fork.sql +38 -17
  131. package/dist/core/git-membership.d.ts.map +1 -1
  132. package/dist/core/git-membership.js +1 -2
  133. package/dist/core/git-membership.js.map +1 -1
  134. package/dist/core/git-state.js +1 -1
  135. package/dist/core/git-state.js.map +1 -1
  136. package/dist/core/packet-wire.d.ts +6 -3
  137. package/dist/core/packet-wire.d.ts.map +1 -1
  138. package/dist/core/packet-wire.js +257 -99
  139. package/dist/core/packet-wire.js.map +1 -1
  140. package/dist/core/provider-accounting.d.ts +24 -0
  141. package/dist/core/provider-accounting.d.ts.map +1 -0
  142. package/dist/core/provider-accounting.js +76 -0
  143. package/dist/core/provider-accounting.js.map +1 -0
  144. package/dist/core/scheme-types.d.ts +1 -1
  145. package/dist/core/scheme-types.d.ts.map +1 -1
  146. package/dist/core/search-gate.d.ts +2 -2
  147. package/dist/core/search-gate.d.ts.map +1 -1
  148. package/dist/core/search-gate.js +8 -8
  149. package/dist/core/search-gate.js.map +1 -1
  150. package/dist/core/turn-scheduler.js +1 -1
  151. package/dist/core/turn-scheduler.js.map +1 -1
  152. package/dist/digest/Digest.d.ts.map +1 -1
  153. package/dist/digest/Digest.js +221 -110
  154. package/dist/digest/Digest.js.map +1 -1
  155. package/dist/digest/digest.sql +40 -18
  156. package/dist/schemes/Exec.d.ts.map +1 -1
  157. package/dist/schemes/Exec.js +136 -110
  158. package/dist/schemes/Exec.js.map +1 -1
  159. package/dist/schemes/ExecOutputScheme.js +1 -1
  160. package/dist/schemes/ExecOutputScheme.js.map +1 -1
  161. package/dist/schemes/File.d.ts +5 -4
  162. package/dist/schemes/File.d.ts.map +1 -1
  163. package/dist/schemes/File.js +25 -23
  164. package/dist/schemes/File.js.map +1 -1
  165. package/dist/schemes/Log.d.ts +11 -0
  166. package/dist/schemes/Log.d.ts.map +1 -1
  167. package/dist/schemes/Log.js +172 -107
  168. package/dist/schemes/Log.js.map +1 -1
  169. package/dist/schemes/Log.sql +48 -32
  170. package/dist/schemes/Prompt.d.ts +3 -3
  171. package/dist/schemes/Prompt.d.ts.map +1 -1
  172. package/dist/schemes/Prompt.js +4 -1
  173. package/dist/schemes/Prompt.js.map +1 -1
  174. package/dist/schemes/Skill.d.ts +4 -4
  175. package/dist/schemes/Skill.d.ts.map +1 -1
  176. package/dist/schemes/Skill.js +3 -0
  177. package/dist/schemes/Skill.js.map +1 -1
  178. package/dist/schemes/Worker.d.ts +4 -4
  179. package/dist/schemes/Worker.d.ts.map +1 -1
  180. package/dist/schemes/Worker.js +11 -7
  181. package/dist/schemes/Worker.js.map +1 -1
  182. package/dist/schemes/_entry-crud.d.ts +0 -1
  183. package/dist/schemes/_entry-crud.d.ts.map +1 -1
  184. package/dist/schemes/_entry-crud.js +19 -13
  185. package/dist/schemes/_entry-crud.js.map +1 -1
  186. package/dist/schemes/_entry-crud.sql +4 -16
  187. package/dist/schemes/_entry-find.d.ts +17 -16
  188. package/dist/schemes/_entry-find.d.ts.map +1 -1
  189. package/dist/schemes/_entry-find.js +58 -52
  190. package/dist/schemes/_entry-find.js.map +1 -1
  191. package/dist/schemes/_entry-find.sql +2 -21
  192. package/dist/schemes/_entry-graph.sql +1 -1
  193. package/dist/schemes/_entry-manifest.d.ts +5 -17
  194. package/dist/schemes/_entry-manifest.d.ts.map +1 -1
  195. package/dist/schemes/_entry-manifest.js +32 -28
  196. package/dist/schemes/_entry-manifest.js.map +1 -1
  197. package/dist/schemes/_entry-ops.d.ts +5 -4
  198. package/dist/schemes/_entry-ops.d.ts.map +1 -1
  199. package/dist/schemes/_entry-ops.js +89 -49
  200. package/dist/schemes/_entry-ops.js.map +1 -1
  201. package/dist/schemes/_entry-ops.sql +30 -4
  202. package/dist/schemes/_entry-send.js +4 -4
  203. package/dist/schemes/_entry-send.js.map +1 -1
  204. package/dist/schemes/_search-index.d.ts.map +1 -1
  205. package/dist/schemes/_search-index.js +10 -2
  206. package/dist/schemes/_search-index.js.map +1 -1
  207. package/dist/schemes/exec-abort.js +2 -2
  208. package/dist/schemes/exec-abort.js.map +1 -1
  209. package/dist/server/Daemon.d.ts +7 -42
  210. package/dist/server/Daemon.d.ts.map +1 -1
  211. package/dist/server/Daemon.js +139 -900
  212. package/dist/server/Daemon.js.map +1 -1
  213. package/dist/server/DrainSupervisor.d.ts +117 -0
  214. package/dist/server/DrainSupervisor.d.ts.map +1 -0
  215. package/dist/server/DrainSupervisor.js +802 -0
  216. package/dist/server/DrainSupervisor.js.map +1 -0
  217. package/dist/server/drain.sql +2 -2
  218. package/dist/server/envelope.d.ts +0 -2
  219. package/dist/server/envelope.d.ts.map +1 -1
  220. package/dist/server/envelope.js.map +1 -1
  221. package/dist/server/envelope.sql +2 -2
  222. package/dist/server/lifecycle-recovery.sql +28 -15
  223. package/dist/server/logEntry.d.ts +2 -1
  224. package/dist/server/logEntry.d.ts.map +1 -1
  225. package/dist/server/logEntry.js +14 -2
  226. package/dist/server/logEntry.js.map +1 -1
  227. package/dist/server/logEntry.sql +5 -1
  228. package/dist/server/seam-entry-read.sql +2 -2
  229. package/dist/service.js +1 -1
  230. package/dist/service.js.map +1 -1
  231. package/migrations/001_schema.sql +622 -216
  232. package/package.json +39 -34
  233. package/dist/core/BudgetOverflow.d.ts +0 -20
  234. package/dist/core/BudgetOverflow.d.ts.map +0 -1
  235. package/dist/core/BudgetOverflow.js +0 -49
  236. package/dist/core/BudgetOverflow.js.map +0 -1
  237. package/dist/core/caps/DbTagCaps.d.ts +0 -10
  238. package/dist/core/caps/DbTagCaps.d.ts.map +0 -1
  239. package/dist/core/caps/DbTagCaps.js +0 -46
  240. package/dist/core/caps/DbTagCaps.js.map +0 -1
  241. package/dist/core/ruler_count.d.ts +0 -4
  242. package/dist/core/ruler_count.d.ts.map +0 -1
  243. package/dist/core/ruler_count.js +0 -7
  244. package/dist/core/ruler_count.js.map +0 -1
  245. package/dist/core/token-ruler.d.ts +0 -2
  246. package/dist/core/token-ruler.d.ts.map +0 -1
  247. package/dist/core/token-ruler.js +0 -5
  248. package/dist/core/token-ruler.js.map +0 -1
package/.env.defaults CHANGED
@@ -45,7 +45,7 @@ PLURNK_PORT=3044
45
45
  # Optional default child-provider alias. Unset = each WORK/FORK child inherits
46
46
  # its spawning loop's provider. Clients may override this per top-level loop.
47
47
  # PLURNK_MODEL_CHILD=fast
48
- # Operator turn ceiling. -1 (default) = no cap (loops end via SEND, budget,
48
+ # Operator turn ceiling. -1 (default) = no cap (loops end via SEND, provider capacity,
49
49
  # strikes, or cycle detection). A positive value is an inviolable hard cap a
50
50
  # CoreSeam runLoop({maxTurns}) request cannot exceed (min wins).
51
51
  PLURNK_SERVICE_MAX_TURNS=-1
@@ -97,7 +97,7 @@ PLURNK_SERVICE_LOOP_TIMEOUT=86400000
97
97
  # Maximum characters retained from caught runtime diagnostics in a model-facing
98
98
  # Problem detail. Complete errors remain in daemon diagnostics.
99
99
  PLURNK_SERVICE_ERROR_DETAIL_LIMIT=512
100
- PLURNK_SERVICE_MAX_STRIKES=3
100
+ PLURNK_SERVICE_MAX_STRIKES=6
101
101
  # Completed responses that do not form a valid PLAN...SEND turn are retried
102
102
  # beneath the same engine turn and against the identical packet.
103
103
  PLURNK_SERVICE_EMISSION_ATTEMPTS=3
@@ -131,13 +131,17 @@ PLURNK_SERVICE_GIT_ISO=0
131
131
  # optional in-process reader does not use this bound.
132
132
  PLURNK_SERVICE_GIT_OUTPUT_MAX_BYTES=67108864
133
133
 
134
- # Ordinary bounded OPEN-body projection. READ/FIND results render their selected
135
- # operation result complete; every other log body renders at most these
136
- # independent line and character bounds. A truncated body carries its canonical
137
- # log URI.
134
+ # Ordinary bounded OPEN-body projection. READ/FIND results and PLAN working
135
+ # memory render complete; prompt initialization uses its separate budget share.
136
+ # Every remaining log body renders at most these independent line and character
137
+ # bounds. A truncated body carries its canonical log URI.
138
138
  PLURNK_SERVICE_PREVIEW_LINES=16
139
139
  PLURNK_SERVICE_PREVIEW_CHARS=2560
140
140
 
141
+ # Number of complete neighboring lines hashed on each side of a model-facing
142
+ # line anchor. 0 authenticates only the addressed line.
143
+ PLURNK_SERVICE_LINE_ANCHOR_CONTEXT_LINES=2
144
+
141
145
  # --- Reference docs (auto-READ at turn 0) ---
142
146
  # PLURNK_SERVICE_MD_<ALIAS>=<path> materializes <path>'s markdown as a
143
147
  # worker://plurnk/<ALIAS>.md
@@ -166,8 +170,8 @@ PLURNK_SERVICE_EDIT_RECEIPT_REVISION_CHARS=8
166
170
  # The durable batch retains complete commit ids; this is display-only.
167
171
  PLURNK_SERVICE_BRANCH_RECEIPT_REVISION_CHARS=8
168
172
 
169
- # Number of neighboring lines (or top-level JSON items) rendered on each side
170
- # of an EDIT's resulting range. The model can READ for arbitrary final content.
173
+ # Number of surrounding and landed lines shown at each boundary of an EDIT
174
+ # result. Overlapping windows coalesce; the model can READ omitted content.
171
175
  PLURNK_SERVICE_EDIT_RECEIPT_CONTEXT_LINES=2
172
176
 
173
177
  # Workspace-tier ceiling on CONCURRENT active runs (a run with a non-terminal loop)
@@ -176,25 +180,16 @@ PLURNK_SERVICE_EDIT_RECEIPT_CONTEXT_LINES=2
176
180
  # the ceiling fails hard (508 — no queue, no retry); the acting run counts itself.
177
181
  PLURNK_SERVICE_WORKSPACE_WORKERS_MAX_ACTIVE=-1
178
182
 
179
- # --- Prompt budget and packing safety — PER ALIAS (#352) ---
180
- # Providers report physical context and response capacity. Core's natural prompt budget is the
181
- # remaining physical input room after the response envelope and SAFETY margin.
182
- #
183
- # PROMPT_BUDGET is optional virtual pressure: it makes the model-facing gauge and grinder enforce
184
- # a smaller input budget without changing provider context or generation settings. Unset uses the
185
- # natural physical prompt budget; a set value can only tighten it. Both core knobs resolve per
186
- # alias: _<alias> wins over bare.
187
- # The retired PLURNK_SERVICE_{CONTEXT_WINDOW,REASONING,COMPLETION} names FAIL HARD at boot naming
188
- # their successors — a stale .env never silently loses its envelope.
189
- # PLURNK_SERVICE_PROMPT_BUDGET=128000
190
- PLURNK_SERVICE_SAFETY=1024
191
- #
192
- # LOCAL aliases (llama-server): the window is PROBED and the reserves DERIVE from it in the
193
- # provider tier (percent defaults) — zero-config. Absolute pins, when wanted, are provider-tier:
194
- # PLURNK_PROVIDERS_{REASONING,COMPLETION}_RESERVE_<alias> (see plurnk-providers/.env.defaults).
195
- # The provider sends the resolved reasoning allowance per request; no llama-server launch-flag
196
- # synchronization is required. Pinned absolutes exceeding the detected window fail HARD at build
197
- # time, naming the provider-tier knobs.
183
+ # --- Prompt projection — PER ALIAS ---
184
+ # Providers derive physical input capacity from model limits and the total output envelope.
185
+ # Core projects that number into its model-facing curation gauge; no second service-side token
186
+ # budget or packing margin exists. The retired PLURNK_SERVICE_{PROMPT_BUDGET,SAFETY,
187
+ # CONTEXT_WINDOW,REASONING,COMPLETION} names fail hard at boot.
188
+ # Maximum aggregate share of the model-facing curation budget used by
189
+ # automatic OPEN prompt bodies. The complete prompt remains stored and
190
+ # READ/FIND-addressable; this controls projection, not prompt admission.
191
+ # Alias-scoped overrides follow the ordinary _<alias> convention.
192
+ PLURNK_SERVICE_PROMPT_PROJECTION=25%
198
193
 
199
194
  # --- Plugins (third-party trust) ---
200
195
  # (PLURNK_PLUGINS_TRUSTED_ONLY lives in @plurnk/plurnk-meta — reader-declares: the
package/INSTALL.md CHANGED
@@ -4,7 +4,7 @@ Operator guide. Put machine-specific choices in `~/.plurnk/.env`. Each installed
4
4
 
5
5
  ## Install
6
6
 
7
- ```
7
+ ```sh
8
8
  npm install -g @plurnk/plurnk-service
9
9
  plurnk-service migrate # apply the disposable version-1 schema baseline
10
10
  plurnk-service start
@@ -40,16 +40,20 @@ When a value is required, an unset or retired name fails boot naming the violate
40
40
 
41
41
  These are relationships *between* flags. Set them as a unit.
42
42
 
43
- - **Provider capacity and PLURNK pressure are separate.** Providers report
44
- physical context and response capacity. Core derives the natural input
45
- budget from those facts. Optional `PLURNK_SERVICE_PROMPT_BUDGET_<alias>`
46
- only tightens the model-facing gauge and grinder; it is never sent to the
47
- provider and never changes generation settings.
48
- - **Reasoning capacity is request-scoped on llama-server.**
49
- `PLURNK_PROVIDERS_REASONING_RESERVE_<alias>` is the adaptive cumulative
50
- response allowance. An explicit `PLURNK_PROVIDERS_REASONING_BUDGET_<alias>`
51
- may tighten but cannot exceed it. The provider sends the allowance on every
52
- request; no serving-box flag synchronization is required.
43
+ - **One generation envelope derives input capacity.** The provider resolves
44
+ model input/output limits, the effective context window, one total output
45
+ budget, and an optional reasoning subset. Its resulting input capacity drives
46
+ both physical request admission and Core's model-independent curation gauge;
47
+ Core has no second token budget or packing margin. Request-shaped token
48
+ evidence remains provider-owned ({§tokenomics-window-partition}).
49
+ `PLURNK_SERVICE_PROMPT_PROJECTION_<alias>` assigns a stable percentage of
50
+ that gauge to automatic prompt bodies; it never limits stored prompt size
51
+ ({§prompt-projection}).
52
+ - **Reasoning is part of output.** `PLURNK_PROVIDERS_OUTPUT_BUDGET_<alias>` is
53
+ the complete response ceiling, including hidden reasoning. Optional
54
+ `PLURNK_PROVIDERS_REASONING_BUDGET_<alias>` is a strict subset; unset leaves
55
+ depth provider-adaptive. Activation remains the independent
56
+ `PLURNK_PROVIDERS_REASONING_<alias>` contract.
53
57
  - **Local GBNF is optional.** The PLURNK language is always parsed normally.
54
58
  Local llama-server users may set `PLURNK_PROVIDERS_GBNF_<alias>`; transport
55
59
  and enforcement are verified at boot. Cloud and endpoint-managed aliases
@@ -63,7 +67,7 @@ These are relationships *between* flags. Set them as a unit.
63
67
 
64
68
  ## Profiles (examples, not a decision tree — adapt to the real box)
65
69
 
66
- - **Local GPU (llama-server).** `PLURNK_MODEL_local="openai/<name>"`, `OPENAI_BASE_URL=http://127.0.0.1:<port>`, `PLURNK_MODEL=local`, `PLURNK_PROVIDERS_GBNF_local=plurnk.gbnf`. The provider detects llama-server, verifies its GBNF transport, and derives a request-scoped reasoning allowance from the detected window. Add `PLURNK_PROVIDERS_LLAMA_SERVER_local=1` only when the endpoint cannot be fingerprinted reliably.
70
+ - **Local GPU (llama-server).** `PLURNK_MODEL_local="openai/<name>"`, `OPENAI_BASE_URL=http://127.0.0.1:<port>`, `PLURNK_MODEL=local`, `PLURNK_PROVIDERS_GBNF_local=plurnk.qwen.gbnf` for Qwen's template-prefilled `<think>` protocol (or `plurnk.gemma.gbnf` when Gemma generates a complete Harmony channel). The provider detects llama-server, verifies its GBNF transport, and derives input capacity from the detected window and configured output envelope. Add `PLURNK_PROVIDERS_LLAMA_SERVER_local=1` only when the endpoint cannot be fingerprinted reliably.
67
71
  - **Cloud, bring-your-own-key.** `PLURNK_MODEL_cloud="openrouter/<model>"`, `OPENROUTER_API_KEY=…`, `PLURNK_MODEL=cloud`. No local GBNF or `LLAMA_SERVER` pin.
68
72
  - **plurnk.ai endpoint.** `PLURNK_MODEL_plurnk="plurnk/plurnk"`, `PLURNK_API_KEY=…`, `PLURNK_MODEL=plurnk`.
69
73
  - **Headless / CI / constrained container.** A CPU-only box should NOT disable semantic search — it should point derivation at a real embedder: `PLURNK_MIMETYPES_EMBED_BASE_URL` (any OpenAI-compatible `/v1/embeddings` — a host GPU turns a CPU-hours corpus grind into seconds). Weak hardware is the target workload, not a reason to shed capability; `PLURNK_SERVICE_EMBED_DISABLE=1` exists for test lanes that deterministically assert non-semantic behavior, nothing else. Consider `PLURNK_SERVICE_MAX_TURNS=<n>` as a cost cap, `PLURNK_SERVICE_GIT_ALLOWED=0` to lock out git in a sandbox.
@@ -77,14 +81,15 @@ Each mirrors a `# --- section ---` in the floor; consult the floor for exact def
77
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.
78
82
  - **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`.
79
83
  - **Git** — `PLURNK_SERVICE_GIT_ALLOWED` (0 = hard sandbox lockout), `_GIT_AUTO`.
80
- - **Packet / reference docs** — `PLURNK_SERVICE_FILES_ITEMS` (turn-0 shallow file-map cap), `_PREVIEW_LINES`/`_PREVIEW_CHARS`, `_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).
84
+ - **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).
81
85
  - **Providers** — the portable provider knobs and defaults are defined by
82
86
  `@plurnk/plurnk-providers/.env.defaults`; any provider knob may take an alias
83
87
  suffix that wins over the bare fallback.
84
- - **Provider capacity and prompt budget** —
85
- `PLURNK_PROVIDERS_CONTEXT_WINDOW`/`_REASONING_RESERVE`/`_COMPLETION_RESERVE`
86
- describe provider capacity. `PLURNK_SERVICE_PROMPT_BUDGET` applies optional
87
- virtual pressure; `PLURNK_SERVICE_SAFETY` is the packing margin.
88
+ - **Provider envelope and prompt projection** —
89
+ `PLURNK_PROVIDERS_CONTEXT_WINDOW`/`_OUTPUT_BUDGET` and optional
90
+ `_REASONING_BUDGET` derive physical input capacity.
91
+ `PLURNK_SERVICE_PROMPT_PROJECTION` assigns the automatic prompt-body share
92
+ of that provider-derived curation gauge.
88
93
  - **Plugins** — bare `PLURNK_PLUGINS_TRUSTED_ONLY` (0/unset = load all installed; a value = `@plurnk/*` plus an allowlist).
89
94
  - **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).
90
95
  - **Schemes: http** — `PLURNK_SCHEMES_HTTP_FETCH_TIMEOUT`, `_TTL_MS`, optional `# TAVILY_API_KEY=`, and `PLURNK_SCHEMES_HTTP_TAVILY_DEPTH`/`_TAVILY_TIMEOUT_MS`.
package/README.md CHANGED
@@ -28,7 +28,7 @@ a second client transport.
28
28
 
29
29
  ## Start
30
30
 
31
- ```
31
+ ```sh
32
32
  npm install -g @plurnk/plurnk-service
33
33
  plurnk-service migrate # apply the disposable version-1 schema baseline
34
34
  plurnk-service start # daemon