@plurnk/plurnk-service 1.0.4 → 1.0.6

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 (215) hide show
  1. package/.env.defaults +55 -31
  2. package/INSTALL.md +3 -3
  3. package/README.md +4 -4
  4. package/SPEC.md +205 -193
  5. package/dist/Paths.js +1 -1
  6. package/dist/Paths.js.map +1 -1
  7. package/dist/core/ChannelWrite.d.ts +18 -18
  8. package/dist/core/ChannelWrite.d.ts.map +1 -1
  9. package/dist/core/ChannelWrite.js +17 -17
  10. package/dist/core/ChannelWrite.js.map +1 -1
  11. package/dist/core/ChannelWrite.sql +11 -11
  12. package/dist/core/Dispatcher.d.ts +11 -16
  13. package/dist/core/Dispatcher.d.ts.map +1 -1
  14. package/dist/core/Dispatcher.js +122 -125
  15. package/dist/core/Dispatcher.js.map +1 -1
  16. package/dist/core/Engine.d.ts +20 -23
  17. package/dist/core/Engine.d.ts.map +1 -1
  18. package/dist/core/Engine.js +213 -210
  19. package/dist/core/Engine.js.map +1 -1
  20. package/dist/core/Engine.sql +108 -130
  21. package/dist/core/PacketBuilder.d.ts +10 -11
  22. package/dist/core/PacketBuilder.d.ts.map +1 -1
  23. package/dist/core/PacketBuilder.js +204 -128
  24. package/dist/core/PacketBuilder.js.map +1 -1
  25. package/dist/core/ProposalLifecycle.d.ts +8 -8
  26. package/dist/core/ProposalLifecycle.d.ts.map +1 -1
  27. package/dist/core/ProposalLifecycle.js +10 -10
  28. package/dist/core/ProposalLifecycle.js.map +1 -1
  29. package/dist/core/ProviderInstantiate.d.ts +1 -0
  30. package/dist/core/ProviderInstantiate.d.ts.map +1 -1
  31. package/dist/core/ProviderInstantiate.js +9 -3
  32. package/dist/core/ProviderInstantiate.js.map +1 -1
  33. package/dist/core/SchemeRegistry.d.ts +4 -1
  34. package/dist/core/SchemeRegistry.d.ts.map +1 -1
  35. package/dist/core/SchemeRegistry.js +18 -9
  36. package/dist/core/SchemeRegistry.js.map +1 -1
  37. package/dist/core/TelemetryChannel.d.ts +5 -5
  38. package/dist/core/TelemetryChannel.d.ts.map +1 -1
  39. package/dist/core/TelemetryChannel.js +9 -9
  40. package/dist/core/TelemetryChannel.js.map +1 -1
  41. package/dist/core/caps/CapsResolve.js +2 -2
  42. package/dist/core/caps/CapsResolve.js.map +1 -1
  43. package/dist/core/caps/DbNotifyCaps.js +2 -2
  44. package/dist/core/caps/DbNotifyCaps.js.map +1 -1
  45. package/dist/core/caps/DbSubscriptionCaps.js +7 -7
  46. package/dist/core/caps/DbSubscriptionCaps.js.map +1 -1
  47. package/dist/core/caps/SchemeCtxImpl.d.ts +2 -2
  48. package/dist/core/caps/SchemeCtxImpl.d.ts.map +1 -1
  49. package/dist/core/caps/SchemeCtxImpl.js +4 -4
  50. package/dist/core/caps/SchemeCtxImpl.js.map +1 -1
  51. package/dist/core/content-hash.d.ts +2 -0
  52. package/dist/core/content-hash.d.ts.map +1 -0
  53. package/dist/core/content-hash.js +6 -0
  54. package/dist/core/content-hash.js.map +1 -0
  55. package/dist/core/fork.d.ts +1 -1
  56. package/dist/core/fork.d.ts.map +1 -1
  57. package/dist/core/fork.js +31 -26
  58. package/dist/core/fork.js.map +1 -1
  59. package/dist/core/fork.sql +41 -32
  60. package/dist/core/git-env.d.ts.map +1 -1
  61. package/dist/core/git-env.js +23 -7
  62. package/dist/core/git-env.js.map +1 -1
  63. package/dist/core/git-iso.d.ts +9 -0
  64. package/dist/core/git-iso.d.ts.map +1 -0
  65. package/dist/core/git-iso.js +227 -0
  66. package/dist/core/git-iso.js.map +1 -0
  67. package/dist/core/git-membership.d.ts +2 -2
  68. package/dist/core/git-membership.d.ts.map +1 -1
  69. package/dist/core/git-membership.js +70 -50
  70. package/dist/core/git-membership.js.map +1 -1
  71. package/dist/core/git-state.d.ts +1 -1
  72. package/dist/core/git-state.d.ts.map +1 -1
  73. package/dist/core/git-state.js +21 -11
  74. package/dist/core/git-state.js.map +1 -1
  75. package/dist/core/packet-wire.d.ts.map +1 -1
  76. package/dist/core/packet-wire.js +81 -22
  77. package/dist/core/packet-wire.js.map +1 -1
  78. package/dist/core/plurnk-uri.d.ts +2 -2
  79. package/dist/core/plurnk-uri.d.ts.map +1 -1
  80. package/dist/core/plurnk-uri.js +19 -12
  81. package/dist/core/plurnk-uri.js.map +1 -1
  82. package/dist/core/run-ops.sql +26 -26
  83. package/dist/core/scheme-types.d.ts +6 -11
  84. package/dist/core/scheme-types.d.ts.map +1 -1
  85. package/dist/core/search-gate.js +0 -0
  86. package/dist/core/search-gate.js.map +1 -1
  87. package/dist/core/token-ruler.d.ts +2 -0
  88. package/dist/core/token-ruler.d.ts.map +1 -0
  89. package/dist/core/token-ruler.js +18 -0
  90. package/dist/core/token-ruler.js.map +1 -0
  91. package/dist/core/worker-cap.d.ts +8 -0
  92. package/dist/core/worker-cap.d.ts.map +1 -0
  93. package/dist/core/worker-cap.js +20 -0
  94. package/dist/core/worker-cap.js.map +1 -0
  95. package/dist/core/{session-settings.d.ts → workspace-settings.d.ts} +5 -5
  96. package/dist/core/workspace-settings.d.ts.map +1 -0
  97. package/dist/core/{session-settings.js → workspace-settings.js} +13 -13
  98. package/dist/core/workspace-settings.js.map +1 -0
  99. package/dist/digest/Digest.d.ts +3 -3
  100. package/dist/digest/Digest.d.ts.map +1 -1
  101. package/dist/digest/Digest.js +79 -73
  102. package/dist/digest/Digest.js.map +1 -1
  103. package/dist/digest/digest.sql +18 -18
  104. package/dist/schemes/Exec.d.ts +9 -2
  105. package/dist/schemes/Exec.d.ts.map +1 -1
  106. package/dist/schemes/Exec.js +121 -68
  107. package/dist/schemes/Exec.js.map +1 -1
  108. package/dist/schemes/ExecOutputScheme.js +3 -3
  109. package/dist/schemes/ExecOutputScheme.js.map +1 -1
  110. package/dist/schemes/File.js +23 -23
  111. package/dist/schemes/File.js.map +1 -1
  112. package/dist/schemes/Known.js +5 -5
  113. package/dist/schemes/Known.js.map +1 -1
  114. package/dist/schemes/Log.d.ts.map +1 -1
  115. package/dist/schemes/Log.js +63 -14
  116. package/dist/schemes/Log.js.map +1 -1
  117. package/dist/schemes/Log.sql +49 -8
  118. package/dist/schemes/Plurnk.js +5 -5
  119. package/dist/schemes/Plurnk.js.map +1 -1
  120. package/dist/schemes/Skill.js +5 -5
  121. package/dist/schemes/Skill.js.map +1 -1
  122. package/dist/schemes/Unknown.js +5 -5
  123. package/dist/schemes/Unknown.js.map +1 -1
  124. package/dist/schemes/{Run.d.ts → Worker.d.ts} +2 -2
  125. package/dist/schemes/Worker.d.ts.map +1 -0
  126. package/dist/schemes/{Run.js → Worker.js} +67 -67
  127. package/dist/schemes/Worker.js.map +1 -0
  128. package/dist/schemes/_entry-crud.js +11 -11
  129. package/dist/schemes/_entry-crud.js.map +1 -1
  130. package/dist/schemes/_entry-crud.sql +29 -29
  131. package/dist/schemes/_entry-find.d.ts +2 -1
  132. package/dist/schemes/_entry-find.d.ts.map +1 -1
  133. package/dist/schemes/_entry-find.js +31 -19
  134. package/dist/schemes/_entry-find.js.map +1 -1
  135. package/dist/schemes/_entry-find.sql +9 -9
  136. package/dist/schemes/_entry-graph.d.ts +2 -2
  137. package/dist/schemes/_entry-graph.d.ts.map +1 -1
  138. package/dist/schemes/_entry-graph.js +18 -18
  139. package/dist/schemes/_entry-graph.js.map +1 -1
  140. package/dist/schemes/_entry-graph.sql +8 -8
  141. package/dist/schemes/_entry-manifest.d.ts +1 -1
  142. package/dist/schemes/_entry-manifest.d.ts.map +1 -1
  143. package/dist/schemes/_entry-manifest.js +74 -50
  144. package/dist/schemes/_entry-manifest.js.map +1 -1
  145. package/dist/schemes/_entry-ops.d.ts +4 -4
  146. package/dist/schemes/_entry-ops.d.ts.map +1 -1
  147. package/dist/schemes/_entry-ops.js +25 -25
  148. package/dist/schemes/_entry-ops.js.map +1 -1
  149. package/dist/schemes/_entry-ops.sql +9 -9
  150. package/dist/schemes/_entry-semantic.d.ts +2 -1
  151. package/dist/schemes/_entry-semantic.d.ts.map +1 -1
  152. package/dist/schemes/_entry-semantic.js +23 -4
  153. package/dist/schemes/_entry-semantic.js.map +1 -1
  154. package/dist/schemes/_entry-semantic.sql +18 -4
  155. package/dist/schemes/_entry-send.d.ts +1 -1
  156. package/dist/schemes/_entry-send.d.ts.map +1 -1
  157. package/dist/schemes/_entry-send.js +6 -6
  158. package/dist/schemes/_entry-send.js.map +1 -1
  159. package/dist/schemes/exec-abort.js +1 -1
  160. package/dist/schemes/exec-abort.js.map +1 -1
  161. package/dist/server/Daemon.d.ts +50 -48
  162. package/dist/server/Daemon.d.ts.map +1 -1
  163. package/dist/server/Daemon.js +307 -297
  164. package/dist/server/Daemon.js.map +1 -1
  165. package/dist/server/client-input.js +20 -20
  166. package/dist/server/client-input.js.map +1 -1
  167. package/dist/server/dispatch-as-plurnk.d.ts +1 -1
  168. package/dist/server/dispatch-as-plurnk.d.ts.map +1 -1
  169. package/dist/server/dispatch-as-plurnk.js +7 -7
  170. package/dist/server/dispatch-as-plurnk.js.map +1 -1
  171. package/dist/server/drain.sql +27 -27
  172. package/dist/server/envelope.d.ts +20 -20
  173. package/dist/server/envelope.d.ts.map +1 -1
  174. package/dist/server/envelope.js +86 -86
  175. package/dist/server/envelope.js.map +1 -1
  176. package/dist/server/envelope.sql +39 -39
  177. package/dist/server/logEntry.d.ts +1 -1
  178. package/dist/server/logEntry.d.ts.map +1 -1
  179. package/dist/server/logEntry.js +1 -1
  180. package/dist/server/logEntry.js.map +1 -1
  181. package/dist/server/loop-model.d.ts +3 -0
  182. package/dist/server/loop-model.d.ts.map +1 -0
  183. package/dist/server/loop-model.js +26 -0
  184. package/dist/server/loop-model.js.map +1 -0
  185. package/dist/server/loopDocs.d.ts +1 -1
  186. package/dist/server/loopDocs.d.ts.map +1 -1
  187. package/dist/server/loopDocs.js +6 -6
  188. package/dist/server/loopDocs.js.map +1 -1
  189. package/dist/server/seam-entry-read.sql +2 -2
  190. package/dist/server/seam-log-read.sql +3 -3
  191. package/dist/server/seam-loop.sql +3 -3
  192. package/dist/server/seam-proposal-list.sql +4 -4
  193. package/dist/server/yolo.js +2 -2
  194. package/dist/server/yolo.js.map +1 -1
  195. package/dist/service.d.ts.map +1 -1
  196. package/dist/service.js +21 -6
  197. package/dist/service.js.map +1 -1
  198. package/migrations/0000-00-00.01_schema.sql +84 -85
  199. package/package.json +17 -14
  200. package/dist/core/TokenGauge.d.ts +0 -16
  201. package/dist/core/TokenGauge.d.ts.map +0 -1
  202. package/dist/core/TokenGauge.js +0 -58
  203. package/dist/core/TokenGauge.js.map +0 -1
  204. package/dist/core/run-cap.d.ts +0 -8
  205. package/dist/core/run-cap.d.ts.map +0 -1
  206. package/dist/core/run-cap.js +0 -20
  207. package/dist/core/run-cap.js.map +0 -1
  208. package/dist/core/search-prefetch.d.ts +0 -17
  209. package/dist/core/search-prefetch.d.ts.map +0 -1
  210. package/dist/core/search-prefetch.js +0 -164
  211. package/dist/core/search-prefetch.js.map +0 -1
  212. package/dist/core/session-settings.d.ts.map +0 -1
  213. package/dist/core/session-settings.js.map +0 -1
  214. package/dist/schemes/Run.d.ts.map +0 -1
  215. package/dist/schemes/Run.js.map +0 -1
package/.env.defaults CHANGED
@@ -45,9 +45,11 @@ PLURNK_PORT=3044
45
45
  # strikes, or cycle detection). A positive value is an inviolable hard cap a
46
46
  # per-call loop.run({maxTurns}) cannot exceed (min wins).
47
47
  PLURNK_SERVICE_MAX_TURNS=-1
48
- # Per-emission op cap (runaway-loop guard). A client may tighten it per session via
49
- # session.create settings.maxCommands (min wins); never raise it past this (#232).
50
- PLURNK_SERVICE_MAX_COMMANDS=99
48
+ # Per-emission op ceiling. -1 (default) = no cap: every generated op dispatches (a runaway
49
+ # op-loop is a sampler concern, not grounds to drop already-generated work). A positive value
50
+ # is an operator ceiling a client may tighten per workspace via workspace.create settings.maxCommands
51
+ # (min wins), never raise past (#232).
52
+ PLURNK_SERVICE_MAX_COMMANDS=-1
51
53
  # Proposal resolution bound (ms). Empty = a stopped world waits for its human indefinitely;
52
54
  # set to auto-cancel unattended (resolves cancel, outcome=timeout).
53
55
  PLURNK_SERVICE_PROPOSAL_TIMEOUT_MS=
@@ -70,10 +72,10 @@ PLURNK_SERVICE_LOOP_TIMEOUT=86400000
70
72
 
71
73
  # Operator questions (SEND[300] — ask-the-user multiple choice / open question). Three states:
72
74
  # unset (shipped) = ALLOWED but not enabled — a client must affirmatively pass its own
73
- # PLURNK_QUESTIONS=1 (rides session.create settings.questions) to enable its sessions;
74
- # uncomment =0 to DENY servicewide (a ceiling the client cannot override). Enabled sessions
75
+ # PLURNK_QUESTIONS=1 (rides workspace.create settings.questions) to enable its workspaces;
76
+ # uncomment =0 to DENY servicewide (a ceiling the client cannot override). Enabled workspaces
75
77
  # get the questions.md teaching injected automatically (the same conditional-doc mechanism as
76
- # the EXEC plugin docs) — an un-enabled session is never taught the op it can't use, and an
78
+ # the EXEC plugin docs) — an un-enabled workspace is never taught the op it can't use, and an
77
79
  # emitted [300] is refused with a self-decide steer instead of parking into the void.
78
80
  # PLURNK_QUESTIONS=0
79
81
 
@@ -83,27 +85,39 @@ PLURNK_SERVICE_MIN_CYCLES=3
83
85
  PLURNK_SERVICE_MAX_CYCLE_PERIOD=4
84
86
 
85
87
  # --- Schemes ---
86
- # (Workspace root for file ops is per-session — supplied at
87
- # session.create({projectRoot}) or never (headless is forever);
88
- # stored on sessions.project_root. No env-level default.)
88
+ # (Workspace root for file ops is per-workspace — supplied at
89
+ # workspace.create({projectRoot}) or never (headless is forever);
90
+ # stored on workspaces.project_root. No env-level default.)
89
91
 
90
92
  # --- Git integration ---
91
93
  # PLURNK_SERVICE_GIT_ALLOWED — hard ceiling for git membership + integration (repo telemetry,
92
- # EXEC[git]). =1 permits it (then declared repos + per-session config decide; a client
93
- # may deny its own session via session.create settings.git:false, #232); =0 flatly
94
+ # EXEC[git]). =1 permits it (then declared repos + per-workspace config decide; a client
95
+ # may deny its own workspace via workspace.create settings.git:false, #232); =0 flatly
94
96
  # denies it service-wide, un-re-enableable (the sandbox/benchmark lockout).
95
97
  PLURNK_SERVICE_GIT_ALLOWED=1
96
98
  # PLURNK_SERVICE_GIT_AUTO — default repo declaration. =1 auto-declares an implicit `repo` at
97
99
  # project_root (no-op when it isn't a git tree); =0 declares nothing — clients add
98
100
  # repos explicitly via the `repo` overlay. SPEC §membership forest.
99
101
  PLURNK_SERVICE_GIT_AUTO=1
102
+ # PLURNK_SERVICE_GIT_NATIVE — git READ backend. Default (0) = in-process isomorphic-git:
103
+ # portable, sandbox-safe, no subprocess, hermetic by construction. =1 routes membership +
104
+ # status to the system git binary — in-process membership measures ~8x native (~130ms at
105
+ # 20k files) and the status read ~55x, so a large-repo host with git buys the hot path back.
106
+ PLURNK_SERVICE_GIT_NATIVE=0
107
+
108
+ # PLURNK_SERVICE_ARRIVAL_PREVIEW_LINES — the arrival law (§arrival-law, #499): content another
109
+ # actor pushes at a worker (a prompt, a child's deliverable) rides OPEN only up to this many
110
+ # lines AND 80×N chars (the char cap guards single-line bombs); over, a bounded head + the
111
+ # address + the full price ride instead. Self-invited content (a worker's own READ/FIND) is
112
+ # budget-bounded, never previewed. 16 = generous but not dangerous.
113
+ PLURNK_SERVICE_ARRIVAL_PREVIEW_LINES=16
100
114
 
101
115
  # --- Reference docs (auto-READ at turn 1) ---
102
116
  # PLURNK_SERVICE_MD_<ALIAS>=<path> materializes <path>'s markdown as a plurnk://<ALIAS>.md
103
117
  # entry the model READs at turn 0 — an idiomatic way to inject standing context
104
118
  # (an ordinary entry + READ op, not a bespoke packet section). ~ expands to home;
105
119
  # relative paths resolve against the package root. A client may add its own docs
106
- # per session via session.create settings.mdDocs (content, not a path); those UNION
120
+ # per workspace via workspace.create settings.mdDocs (content, not a path); those UNION
107
121
  # with these env docs, keyed by alias — the client wins a collision (#231).
108
122
  # Commented out = no docs by default. (The operating policy is NOT a doc: readSystemPolicy
109
123
  # already renders ~/.plurnk/AGENTS.md as the ## Plurnk Service Policy section — pointing a
@@ -114,19 +128,19 @@ PLURNK_SERVICE_GIT_AUTO=1
114
128
  # the model's own memory reads as withheld. This knob's first-N cap applies ONLY to the FILE list
115
129
  # (FIND(file:///**)), the one catalog that's external and arbitrarily large: -1 = the whole tree
116
130
  # (everything full); N = the first N files (memory still full); 0 = preview off entirely (the model
117
- # FINDs on demand). Servicewide default; a client overrides per session via session.create
131
+ # FINDs on demand). Servicewide default; a client overrides per workspace via workspace.create
118
132
  # settings.filesItems (#231).
119
133
  PLURNK_SERVICE_FILES_ITEMS=-1
120
134
 
121
- # Session-tier ceiling on CONCURRENT active runs (a run with a non-terminal loop)
135
+ # Workspace-tier ceiling on CONCURRENT active runs (a run with a non-terminal loop)
122
136
  # — the fork-bomb / destabilization brake. -1 = no cap (default); only concurrency
123
- # is bounded, never lifetime, since sessions persist for months. A spawn/fork past
137
+ # is bounded, never lifetime, since workspaces persist for months. A spawn/fork past
124
138
  # the ceiling fails hard (508 — no queue, no retry); the acting run counts itself.
125
- PLURNK_SERVICE_SESSION_RUNS_MAX_ACTIVE=-1
139
+ PLURNK_SERVICE_WORKSPACE_WORKERS_MAX_ACTIVE=-1
126
140
 
127
141
  # --- The window partition (§tokenomics-window-partition) — PER ALIAS (#352) ---
128
- # The window splits WITHOUT remainder: promptBudget = min(CTX, real window) − REASONING −
129
- # ASSISTANT − SAFETY is what the service may send; REASONING+ASSISTANT is the generation
142
+ # The window splits WITHOUT remainder: promptBudget = min(CONTEXT_WINDOW, real window) − REASONING −
143
+ # COMPLETION − SAFETY is what the service may send; REASONING+COMPLETION is the generation
130
144
  # envelope (max_tokens on every call — no decode is unbounded); SAFETY covers chat-template
131
145
  # overhead. The prompt ceiling is DERIVED, never set directly.
132
146
  #
@@ -136,19 +150,26 @@ PLURNK_SERVICE_SESSION_RUNS_MAX_ACTIVE=-1
136
150
  # a max-output field, so "send generous, let the backend clamp" is the honest cloud posture).
137
151
  # This makes connecting a cloud reasoner a zero-config on-ramp: a DeepSeek-V4 that burns ~16k on
138
152
  # reasoning alone gets the headroom to finish its DSL instead of dying at finish=length (#351).
139
- PLURNK_SERVICE_CTX=163840
153
+ PLURNK_SERVICE_CONTEXT_WINDOW=163840
140
154
  PLURNK_SERVICE_REASONING=16384
141
- PLURNK_SERVICE_ASSISTANT=49152
155
+ PLURNK_SERVICE_COMPLETION=49152
142
156
  PLURNK_SERVICE_SAFETY=1024
143
157
  #
158
+ # PLURNK_SERVICE_BUDGET_MERMAID — the Budget section as visual mermaid (#440, §budget-mermaid). Default
159
+ # `on`: the ceiling/usage/free headline PLUS three budget-scaled diagrams (turn-composition treemap,
160
+ # heaviest-items xychart, used/free pie) — budget-awareness at a glance, and the pie doubles as a
161
+ # training exemplar for the model's own user-facing SENDs. Validated to render on GitHub. Set `off` to
162
+ # A/B against the tabular baseline (#440's before/after measurement).
163
+ PLURNK_SERVICE_BUDGET_MERMAID=on
164
+ #
144
165
  # LOCAL aliases (llama-server) MUST keep a MEASURED envelope: llama-server honors n_predict to
145
166
  # the context wall, and an unbounded decode wall-runs into 30k+ junk tokens (providers#10 — the
146
167
  # reason the cap doctrine exists). The tinkerer with a graphics card UNCOMMENTS a block keyed to
147
168
  # their alias and their model's real n_ctx (example alias name 'myalias'; a local model
148
169
  # run under the bare cloud-generous defaults fails HARD at build with a remedy naming these knobs):
149
- # PLURNK_SERVICE_CTX_myalias=78848
170
+ # PLURNK_SERVICE_CONTEXT_WINDOW_myalias=78848
150
171
  # PLURNK_SERVICE_REASONING_myalias=4096
151
- # PLURNK_SERVICE_ASSISTANT_myalias=8192
172
+ # PLURNK_SERVICE_COMPLETION_myalias=8192
152
173
  # PLURNK_SERVICE_SAFETY_myalias=1024
153
174
  # COUPLING (F7): per-request numeric reasoning budgets are IGNORED by llama-server — a local
154
175
  # thinking model's serving box MUST clamp via --reasoning-budget = its PLURNK_SERVICE_REASONING_<alias>,
@@ -207,15 +228,18 @@ PLURNK_SERVICE_SEMANTIC_CHUNK_OVERLAP=0.15
207
228
  # hosts/runs that don't want vector search; the fast test lane sets it in .env.test.
208
229
  PLURNK_SERVICE_EMBED_DISABLE=0
209
230
 
210
- # --- Search prefetch search-prefetch, #333) ---
211
- # Exec runtimes whose #results digest declares web members: on conclusion every candidate url
212
- # is materialized into an ordinary http entry (inside the EXEC_HOLD window) and #results is
213
- # rewritten as the survivor render — chooser context + live token/line costs, dead rows gone.
214
- PLURNK_SERVICE_SEARCH_PREFETCH_RUNTIMES=search
215
- # Fan-out width for the materialization pass.
216
- PLURNK_SERVICE_SEARCH_PREFETCH_CONCURRENCY=4
217
- # Per-page ceiling (ms): a page slower than this is not a member (rummy: parallel, 10s).
218
- PLURNK_SERVICE_SEARCH_PREFETCH_TIMEOUT_MS=10000
231
+ # Which exec runtimes the search gate treats as searches — the per-turn cap and identical-query
232
+ # dedup apply to these (the search family delegates page fetches to the entry() sink; §exec-entry-sink).
233
+ PLURNK_SERVICE_SEARCH_RUNTIMES=search
219
234
  # Per-turn search flood cap: the (N+1)th search EXEC in one turn is refused 429 (dedup of
220
235
  # identical queries is unconditional and separate — it strikes and serves the prior results).
221
236
  PLURNK_SERVICE_SEARCH_MAX_PER_TURN=3
237
+ # FIND match-render budget: a FIND whose match set exceeds this returns a COUNT + narrow-your-query
238
+ # steer instead of enumerating every match (§find-count-not-contents) — a repo-scale FIND(**) over
239
+ # a 19k-entry workspace grinds clean instead of overflowing the window. 0/unset = no gate.
240
+ PLURNK_SERVICE_FIND_MAX_MATCHES=500
241
+ # Derivation-pump concurrency: how many entries' embeds run at once. The embedder's worker pool is
242
+ # data-parallel but starves on sequential per-entry calls (#416) — overlapping K embeds saturates
243
+ # it (a large-workspace ingest goes from a single-core minutes-long grind to a fast multi-core
244
+ # pass). 1 = sequential (default, safe). Set to ~cores for repo-scale ingest.
245
+ PLURNK_SERVICE_DERIVE_CONCURRENCY=1
package/INSTALL.md CHANGED
@@ -37,7 +37,7 @@ A bare flag is a signal: more than one component depends on it. A prefixed one i
37
37
 
38
38
  These are relationships *between* flags. Set them as a unit.
39
39
 
40
- - **The window partition is exact.** `promptBudget = min(PLURNK_SERVICE_CTX, real window) − REASONING − ASSISTANT − SAFETY`; `REASONING + ASSISTANT` is the per-call `max_tokens`. Shipped invariant: any window ≥ 77Ki partitions to **exactly 65536** prompt tokens (`78848 − 4096 − 8192 − 1024`). Reserves exceeding the window fail the boot. *(Pinned: `Engine.budget` / `shipped-defaults`.)*
40
+ - **The window partition is exact.** `promptBudget = min(PLURNK_SERVICE_CONTEXT_WINDOW, real window) − REASONING − COMPLETION − SAFETY`; `REASONING + COMPLETION` is the per-call `max_tokens`. Shipped invariant: any window ≥ 77Ki partitions to **exactly 65536** prompt tokens (`78848 − 4096 − 8192 − 1024`). Reserves exceeding the window fail the boot. *(Pinned: `Engine.budget` / `shipped-defaults`.)*
41
41
  - **Reasoning capacity is one number in three places.** `PLURNK_SERVICE_REASONING` (the partition's reserve) **must equal** `PLURNK_PROVIDERS_THINKING_CAPACITY` (the provider's thinking cap) **must equal** the serving box's `--reasoning-budget` launch flag. llama-server ignores per-request numeric budgets, so only the launch flag clamps it; a mismatch makes the reserve fiction. The daemon warns at boot when thinking is on. *(Pinned: `shipped-defaults` asserts the first equality.)*
42
42
  - **Grammar rails ship on, gated on the provider's claim (#336).** A backend that doesn't enforce grammars drops it cleanly — the daemon boots with a notice, unconstrained on that alias. A backend that CLAIMS enforcement (`constrainsOutput`) is **verified end-to-end at boot** and fails hard if it returns unconstrained output. Daemon-global — not alias-scoped (one backend per daemon). For a known llama-server alias, pin `PLURNK_PROVIDERS_LLAMA_SERVER_<alias>=1` — it transports the grammar deterministically instead of probing `/v1/models` (a probe race once silently disabled the rails). *(Pinned: `grammar-enforcement-verify`.)*
43
43
  - **A think-trained model must think somewhere.** `PLURNK_PROVIDERS_THINKING=off` reroutes a reasoning model's thought into the grammar's legal free zone as prose. Keep it `on` with a capacity; providers auto-clamp thinking on in-band grammar backends, so one setting is right everywhere.
@@ -60,10 +60,10 @@ Each mirrors a `# --- section ---` in the floor; consult the floor for exact def
60
60
  - **Git** — `PLURNK_SERVICE_GIT_ALLOWED` (0 = hard sandbox lockout), `_GIT_AUTO`.
61
61
  - **Packet / reference docs** — `PLURNK_SERVICE_FILES_ITEMS` (turn-1 file catalog cap), `_PROMPT_PREVIEW_CHARS`, `_DOCS_EXCLUDE`, `_PACKET_INJECT` (operator markdown section), `_POLICY`/`_PROJECT`/`_REQUIREMENTS` (policy + footer overrides; unset = the seeded/packaged defaults), `_MD_<alias>` (inject a markdown doc as a turn-0 entry).
62
62
  - **Providers** — `PLURNK_PROVIDERS_THINKING`/`_THINKING_CAPACITY`, `_TEMPERATURE`, `_REPEAT_PENALTY`, `_FETCH_TIMEOUT`, `_RETRY_ATTEMPTS`/`_RETRY_DELAY`, `_PROBE_ATTEMPTS`/`_PROBE_DELAY`, `_GBNF` (grammar variant), `_LLAMA_SERVER_<alias>`, `_CONTEXT_SIZE`, `_GBNF_DEBUG`. Alias-scopable: any knob takes a `_<alias>` suffix that wins over the bare fallback.
63
- - **The window partition** — `PLURNK_SERVICE_CTX`/`_REASONING`/`_ASSISTANT`/`_SAFETY` (see Couplings).
63
+ - **The window partition** — `PLURNK_SERVICE_CONTEXT_WINDOW`/`_REASONING`/`_ASSISTANT`/`_SAFETY` (see Couplings).
64
64
  - **Plugins** — bare `PLURNK_PLUGINS_TRUSTED_ONLY` (0/unset = load all installed; a value = `@plurnk/*` plus an allowlist).
65
65
  - **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).
66
66
  - **Schemes: http** — `PLURNK_SCHEMES_HTTP_FETCH_TIMEOUT`/`_SALVAGE_MIN_BODY_CHARS`/`_IDLE_TIMEOUT` (required on the HTML render path), optional Playwright/Chromium knobs.
67
67
  - **Execs** — `PLURNK_EXECS_<runtime>=0` disables a runtime; `PLURNK_EXECS_MCP_<server>` bridges an MCP server; `PLURNK_EXECS_SEARCH_SEARXNG_URL` enables web search (unset = search off).
68
68
 
69
- The client's own knobs live under `PLURNK_CLIENT_*` (`--session`, `--run`, `--yolo`, `--json`…) — see `plurnk --help`.
69
+ The client's own knobs live under `PLURNK_CLIENT_*` (`--workspace`, `--run`, `--yolo`, `--json`…) — see `plurnk --help`.
package/README.md CHANGED
@@ -6,18 +6,18 @@ LLM agent runtime engine. Consumes [plurnk-grammar](https://github.com/plurnk/pl
6
6
 
7
7
  Grammar ops: `PLAN` reason · `READ`/`EDIT` files · `FIND` search · `EXEC` run shell/code · `SEND` message or conclude · `COPY`/`MOVE`/`KILL` manage · `OPEN`/`FOLD` curate its own context.
8
8
 
9
- Over schemes: `file://` project files · `exec://` command output · `http(s)://` web fetch · `run://` sibling agent runs (spawn / fork / message) · `known://` scratch · `log://` own history.
9
+ Over schemes: `file://` project files · `exec://` command output · `http(s)://` web fetch · `worker://` sibling agent runs (spawn / fork / message) · `known://` scratch · `log://` own history.
10
10
 
11
11
  ## Loop model
12
12
 
13
- Session = the shared world (one filesystem + membership overlay). Run = one agent's private log. Loop = one `prompt → ops → SEND[terminal]` cycle; every turn leads with `PLAN`. Runs fork and message each other — many clients, many runs, one session.
13
+ Workspace = the shared world (one filesystem + membership overlay). Run = one agent's private log. Loop = one `prompt → ops → SEND[terminal]` cycle; every turn leads with `PLAN`. Runs fork and message each other — many clients, many runs, one workspace.
14
14
 
15
15
  ## Integration (WebSocket JSON-RPC)
16
16
 
17
- Methods: `session.*` (create / attach / constrain / list…) · `loop.run` / `loop.inject` / `loop.resolve` · `op.*` (read / edit / find / exec / send…) · `log.read` · `run.fork`. Streams: `log/entry` → … → `loop/terminated`, plus `loop/proposal`, `telemetry/event`. Full live catalog: the `discover` RPC.
17
+ Methods: `workspace.*` (create / attach / constrain / list…) · `loop.run` / `loop.inject` / `loop.resolve` · `op.*` (read / edit / find / exec / send…) · `log.read` · `run.fork`. Streams: `log/entry` → … → `loop/terminated`, plus `loop/proposal`, `telemetry/event`. Full live catalog: the `discover` RPC.
18
18
 
19
19
  ```
20
- ws connect → session.create({ projectRoot }) → loop.run({ prompt })
20
+ ws connect → workspace.create({ projectRoot }) → loop.run({ prompt })
21
21
  → read log/entry notifications until loop/terminated
22
22
  ```
23
23