@plurnk/plurnk-service 1.0.5 → 1.0.7

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 (201) hide show
  1. package/.env.defaults +66 -48
  2. package/INSTALL.md +3 -3
  3. package/README.md +4 -4
  4. package/SPEC.md +212 -196
  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 +15 -11
  13. package/dist/core/Dispatcher.d.ts.map +1 -1
  14. package/dist/core/Dispatcher.js +124 -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 +210 -185
  19. package/dist/core/Engine.js.map +1 -1
  20. package/dist/core/Engine.sql +106 -109
  21. package/dist/core/PacketBuilder.d.ts +9 -9
  22. package/dist/core/PacketBuilder.d.ts.map +1 -1
  23. package/dist/core/PacketBuilder.js +199 -151
  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/fork.d.ts +1 -1
  52. package/dist/core/fork.d.ts.map +1 -1
  53. package/dist/core/fork.js +31 -26
  54. package/dist/core/fork.js.map +1 -1
  55. package/dist/core/fork.sql +41 -32
  56. package/dist/core/git-env.d.ts.map +1 -1
  57. package/dist/core/git-env.js +23 -7
  58. package/dist/core/git-env.js.map +1 -1
  59. package/dist/core/git-iso.d.ts +9 -0
  60. package/dist/core/git-iso.d.ts.map +1 -0
  61. package/dist/core/git-iso.js +227 -0
  62. package/dist/core/git-iso.js.map +1 -0
  63. package/dist/core/git-membership.d.ts +2 -2
  64. package/dist/core/git-membership.d.ts.map +1 -1
  65. package/dist/core/git-membership.js +70 -50
  66. package/dist/core/git-membership.js.map +1 -1
  67. package/dist/core/git-state.d.ts +1 -1
  68. package/dist/core/git-state.d.ts.map +1 -1
  69. package/dist/core/git-state.js +21 -11
  70. package/dist/core/git-state.js.map +1 -1
  71. package/dist/core/packet-wire.d.ts.map +1 -1
  72. package/dist/core/packet-wire.js +81 -22
  73. package/dist/core/packet-wire.js.map +1 -1
  74. package/dist/core/plurnk-uri.d.ts +2 -2
  75. package/dist/core/plurnk-uri.d.ts.map +1 -1
  76. package/dist/core/plurnk-uri.js +19 -12
  77. package/dist/core/plurnk-uri.js.map +1 -1
  78. package/dist/core/run-ops.sql +26 -26
  79. package/dist/core/scheme-types.d.ts +6 -6
  80. package/dist/core/scheme-types.d.ts.map +1 -1
  81. package/dist/core/search-gate.js +0 -0
  82. package/dist/core/search-gate.js.map +1 -1
  83. package/dist/core/token-ruler.js +2 -2
  84. package/dist/core/token-ruler.js.map +1 -1
  85. package/dist/core/worker-cap.d.ts +8 -0
  86. package/dist/core/worker-cap.d.ts.map +1 -0
  87. package/dist/core/worker-cap.js +20 -0
  88. package/dist/core/worker-cap.js.map +1 -0
  89. package/dist/core/{session-settings.d.ts → workspace-settings.d.ts} +5 -5
  90. package/dist/core/workspace-settings.d.ts.map +1 -0
  91. package/dist/core/{session-settings.js → workspace-settings.js} +13 -13
  92. package/dist/core/workspace-settings.js.map +1 -0
  93. package/dist/digest/Digest.d.ts +3 -3
  94. package/dist/digest/Digest.d.ts.map +1 -1
  95. package/dist/digest/Digest.js +83 -73
  96. package/dist/digest/Digest.js.map +1 -1
  97. package/dist/digest/digest.sql +18 -18
  98. package/dist/schemes/Exec.d.ts +9 -2
  99. package/dist/schemes/Exec.d.ts.map +1 -1
  100. package/dist/schemes/Exec.js +124 -68
  101. package/dist/schemes/Exec.js.map +1 -1
  102. package/dist/schemes/ExecOutputScheme.js +3 -3
  103. package/dist/schemes/ExecOutputScheme.js.map +1 -1
  104. package/dist/schemes/File.js +23 -23
  105. package/dist/schemes/File.js.map +1 -1
  106. package/dist/schemes/Known.js +5 -5
  107. package/dist/schemes/Known.js.map +1 -1
  108. package/dist/schemes/Log.d.ts.map +1 -1
  109. package/dist/schemes/Log.js +63 -14
  110. package/dist/schemes/Log.js.map +1 -1
  111. package/dist/schemes/Log.sql +49 -8
  112. package/dist/schemes/Plurnk.js +5 -5
  113. package/dist/schemes/Plurnk.js.map +1 -1
  114. package/dist/schemes/Skill.js +5 -5
  115. package/dist/schemes/Skill.js.map +1 -1
  116. package/dist/schemes/Unknown.js +5 -5
  117. package/dist/schemes/Unknown.js.map +1 -1
  118. package/dist/schemes/{Run.d.ts → Worker.d.ts} +2 -2
  119. package/dist/schemes/Worker.d.ts.map +1 -0
  120. package/dist/schemes/{Run.js → Worker.js} +67 -67
  121. package/dist/schemes/Worker.js.map +1 -0
  122. package/dist/schemes/_entry-crud.js +8 -8
  123. package/dist/schemes/_entry-crud.js.map +1 -1
  124. package/dist/schemes/_entry-crud.sql +29 -29
  125. package/dist/schemes/_entry-find.d.ts +2 -1
  126. package/dist/schemes/_entry-find.d.ts.map +1 -1
  127. package/dist/schemes/_entry-find.js +31 -19
  128. package/dist/schemes/_entry-find.js.map +1 -1
  129. package/dist/schemes/_entry-find.sql +9 -9
  130. package/dist/schemes/_entry-graph.d.ts +2 -2
  131. package/dist/schemes/_entry-graph.d.ts.map +1 -1
  132. package/dist/schemes/_entry-graph.js +18 -18
  133. package/dist/schemes/_entry-graph.js.map +1 -1
  134. package/dist/schemes/_entry-graph.sql +8 -8
  135. package/dist/schemes/_entry-manifest.d.ts +1 -1
  136. package/dist/schemes/_entry-manifest.d.ts.map +1 -1
  137. package/dist/schemes/_entry-manifest.js +72 -28
  138. package/dist/schemes/_entry-manifest.js.map +1 -1
  139. package/dist/schemes/_entry-ops.d.ts +4 -4
  140. package/dist/schemes/_entry-ops.d.ts.map +1 -1
  141. package/dist/schemes/_entry-ops.js +25 -25
  142. package/dist/schemes/_entry-ops.js.map +1 -1
  143. package/dist/schemes/_entry-ops.sql +9 -9
  144. package/dist/schemes/_entry-semantic.d.ts +2 -1
  145. package/dist/schemes/_entry-semantic.d.ts.map +1 -1
  146. package/dist/schemes/_entry-semantic.js +23 -4
  147. package/dist/schemes/_entry-semantic.js.map +1 -1
  148. package/dist/schemes/_entry-semantic.sql +18 -4
  149. package/dist/schemes/_entry-send.d.ts +1 -1
  150. package/dist/schemes/_entry-send.d.ts.map +1 -1
  151. package/dist/schemes/_entry-send.js +6 -6
  152. package/dist/schemes/_entry-send.js.map +1 -1
  153. package/dist/schemes/exec-abort.js +1 -1
  154. package/dist/schemes/exec-abort.js.map +1 -1
  155. package/dist/server/Daemon.d.ts +48 -48
  156. package/dist/server/Daemon.d.ts.map +1 -1
  157. package/dist/server/Daemon.js +295 -292
  158. package/dist/server/Daemon.js.map +1 -1
  159. package/dist/server/client-input.js +20 -20
  160. package/dist/server/client-input.js.map +1 -1
  161. package/dist/server/dispatch-as-plurnk.d.ts +1 -1
  162. package/dist/server/dispatch-as-plurnk.d.ts.map +1 -1
  163. package/dist/server/dispatch-as-plurnk.js +7 -7
  164. package/dist/server/dispatch-as-plurnk.js.map +1 -1
  165. package/dist/server/drain.sql +27 -27
  166. package/dist/server/envelope.d.ts +20 -20
  167. package/dist/server/envelope.d.ts.map +1 -1
  168. package/dist/server/envelope.js +86 -86
  169. package/dist/server/envelope.js.map +1 -1
  170. package/dist/server/envelope.sql +39 -39
  171. package/dist/server/logEntry.d.ts +1 -1
  172. package/dist/server/logEntry.d.ts.map +1 -1
  173. package/dist/server/logEntry.js +1 -1
  174. package/dist/server/logEntry.js.map +1 -1
  175. package/dist/server/loopDocs.d.ts +1 -1
  176. package/dist/server/loopDocs.d.ts.map +1 -1
  177. package/dist/server/loopDocs.js +6 -6
  178. package/dist/server/loopDocs.js.map +1 -1
  179. package/dist/server/seam-entry-read.sql +2 -2
  180. package/dist/server/seam-log-read.sql +3 -3
  181. package/dist/server/seam-loop.sql +3 -3
  182. package/dist/server/seam-proposal-list.sql +4 -4
  183. package/dist/server/yolo.js +2 -2
  184. package/dist/server/yolo.js.map +1 -1
  185. package/dist/service.d.ts.map +1 -1
  186. package/dist/service.js +22 -7
  187. package/dist/service.js.map +1 -1
  188. package/migrations/0000-00-00.01_schema.sql +82 -70
  189. package/package.json +18 -15
  190. package/dist/core/run-cap.d.ts +0 -8
  191. package/dist/core/run-cap.d.ts.map +0 -1
  192. package/dist/core/run-cap.js +0 -20
  193. package/dist/core/run-cap.js.map +0 -1
  194. package/dist/core/search-prefetch.d.ts +0 -17
  195. package/dist/core/search-prefetch.d.ts.map +0 -1
  196. package/dist/core/search-prefetch.js +0 -164
  197. package/dist/core/search-prefetch.js.map +0 -1
  198. package/dist/core/session-settings.d.ts.map +0 -1
  199. package/dist/core/session-settings.js.map +0 -1
  200. package/dist/schemes/Run.d.ts.map +0 -1
  201. package/dist/schemes/Run.js.map +0 -1
package/.env.defaults CHANGED
@@ -45,14 +45,18 @@ 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=
54
56
  # Turn-hold runtimes: while a listed runtime's stream is in flight the cycle pauses (no next
55
57
  # turn) until it concludes. Bounded by _HOLD_MS, fail-open at the cap. Empty = no holds.
58
+ # A bare name holds ALL of that runtime's spawns; `<runtime>:<effect>` (e.g. github:read) holds
59
+ # only that effect-class — an MCP server's read tools opt in while its host mutations background (#485).
56
60
  PLURNK_SERVICE_EXEC_HOLD=search,images,videos,news,map,music,it,science,social,downloadable
57
61
  PLURNK_SERVICE_EXEC_HOLD_MS=300000
58
62
  # Post-EXEC breath: after a turn fires a non-inline EXEC whose spawn is still in
@@ -70,10 +74,10 @@ PLURNK_SERVICE_LOOP_TIMEOUT=86400000
70
74
 
71
75
  # Operator questions (SEND[300] — ask-the-user multiple choice / open question). Three states:
72
76
  # 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
77
+ # PLURNK_QUESTIONS=1 (rides workspace.create settings.questions) to enable its workspaces;
78
+ # uncomment =0 to DENY servicewide (a ceiling the client cannot override). Enabled workspaces
75
79
  # 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
80
+ # the EXEC plugin docs) — an un-enabled workspace is never taught the op it can't use, and an
77
81
  # emitted [300] is refused with a self-decide steer instead of parking into the void.
78
82
  # PLURNK_QUESTIONS=0
79
83
 
@@ -83,27 +87,39 @@ PLURNK_SERVICE_MIN_CYCLES=3
83
87
  PLURNK_SERVICE_MAX_CYCLE_PERIOD=4
84
88
 
85
89
  # --- 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.)
90
+ # (Workspace root for file ops is per-workspace — supplied at
91
+ # workspace.create({projectRoot}) or never (headless is forever);
92
+ # stored on workspaces.project_root. No env-level default.)
89
93
 
90
94
  # --- Git integration ---
91
95
  # 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
96
+ # EXEC[git]). =1 permits it (then declared repos + per-workspace config decide; a client
97
+ # may deny its own workspace via workspace.create settings.git:false, #232); =0 flatly
94
98
  # denies it service-wide, un-re-enableable (the sandbox/benchmark lockout).
95
99
  PLURNK_SERVICE_GIT_ALLOWED=1
96
100
  # PLURNK_SERVICE_GIT_AUTO — default repo declaration. =1 auto-declares an implicit `repo` at
97
101
  # project_root (no-op when it isn't a git tree); =0 declares nothing — clients add
98
102
  # repos explicitly via the `repo` overlay. SPEC §membership forest.
99
103
  PLURNK_SERVICE_GIT_AUTO=1
104
+ # PLURNK_SERVICE_GIT_NATIVE — git READ backend. Default (0) = in-process isomorphic-git:
105
+ # portable, sandbox-safe, no subprocess, hermetic by construction. =1 routes membership +
106
+ # status to the system git binary — in-process membership measures ~8x native (~130ms at
107
+ # 20k files) and the status read ~55x, so a large-repo host with git buys the hot path back.
108
+ PLURNK_SERVICE_GIT_NATIVE=0
109
+
110
+ # PLURNK_SERVICE_ARRIVAL_PREVIEW_LINES — the arrival law (§arrival-law, #499): content another
111
+ # actor pushes at a worker (a prompt, a child's deliverable) rides OPEN only up to this many
112
+ # lines AND 80×N chars (the char cap guards single-line bombs); over, a bounded head + the
113
+ # address + the full price ride instead. Self-invited content (a worker's own READ/FIND) is
114
+ # budget-bounded, never previewed. 16 = generous but not dangerous.
115
+ PLURNK_SERVICE_ARRIVAL_PREVIEW_LINES=16
100
116
 
101
117
  # --- Reference docs (auto-READ at turn 1) ---
102
118
  # PLURNK_SERVICE_MD_<ALIAS>=<path> materializes <path>'s markdown as a plurnk://<ALIAS>.md
103
119
  # entry the model READs at turn 0 — an idiomatic way to inject standing context
104
120
  # (an ordinary entry + READ op, not a bespoke packet section). ~ expands to home;
105
121
  # 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
122
+ # per workspace via workspace.create settings.mdDocs (content, not a path); those UNION
107
123
  # with these env docs, keyed by alias — the client wins a collision (#231).
108
124
  # Commented out = no docs by default. (The operating policy is NOT a doc: readSystemPolicy
109
125
  # already renders ~/.plurnk/AGENTS.md as the ## Plurnk Service Policy section — pointing a
@@ -114,46 +130,45 @@ PLURNK_SERVICE_GIT_AUTO=1
114
130
  # the model's own memory reads as withheld. This knob's first-N cap applies ONLY to the FILE list
115
131
  # (FIND(file:///**)), the one catalog that's external and arbitrarily large: -1 = the whole tree
116
132
  # (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
133
+ # FINDs on demand). Servicewide default; a client overrides per workspace via workspace.create
118
134
  # settings.filesItems (#231).
119
135
  PLURNK_SERVICE_FILES_ITEMS=-1
120
136
 
121
- # Session-tier ceiling on CONCURRENT active runs (a run with a non-terminal loop)
137
+ # Workspace-tier ceiling on CONCURRENT active runs (a run with a non-terminal loop)
122
138
  # — 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
139
+ # is bounded, never lifetime, since workspaces persist for months. A spawn/fork past
124
140
  # the ceiling fails hard (508 — no queue, no retry); the acting run counts itself.
125
- PLURNK_SERVICE_SESSION_RUNS_MAX_ACTIVE=-1
141
+ PLURNK_SERVICE_WORKSPACE_WORKERS_MAX_ACTIVE=-1
126
142
 
127
143
  # --- 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
144
+ # The window splits WITHOUT remainder: promptBudget = min(CONTEXT_WINDOW, real window) − REASONING −
145
+ # COMPLETION − SAFETY is what the service may send; REASONING+COMPLETION is the generation
130
146
  # envelope (max_tokens on every call — no decode is unbounded); SAFETY covers chat-template
131
147
  # overhead. The prompt ceiling is DERIVED, never set directly.
132
148
  #
133
- # Each knob resolves PER ALIAS: PLURNK_SERVICE_<KNOB>_<alias> wins over the bare fallback.
134
- # The BARE defaults are CLOUD-GENEROUS — a large envelope the backend self-clamps to its true
135
- # output limit (cloud backends accept 65536, silently clamp an absurd ask; no models-API exposes
136
- # a max-output field, so "send generous, let the backend clamp" is the honest cloud posture).
137
- # This makes connecting a cloud reasoner a zero-config on-ramp: a DeepSeek-V4 that burns ~16k on
138
- # reasoning alone gets the headroom to finish its DSL instead of dying at finish=length (#351).
139
- PLURNK_SERVICE_CTX=163840
140
- PLURNK_SERVICE_REASONING=16384
141
- PLURNK_SERVICE_ASSISTANT=49152
149
+ # #507 (owner-ruled): the generation envelope is PROVIDER-owned window + reserves live in the
150
+ # provider tier (`PLURNK_PROVIDERS_CONTEXT_WINDOW` / `PLURNK_PROVIDERS_REASONING_RESERVE` /
151
+ # `PLURNK_PROVIDERS_COMPLETION_RESERVE`, ingested from the backend or pinned there; percent or
152
+ # absolute forms see plurnk-providers/.env.defaults). Core keeps ONE knob: SAFETY, the ruler's
153
+ # own packing margin (a service fact, not a model fact). Resolves per alias: _<alias> wins over bare.
154
+ # The retired PLURNK_SERVICE_{CONTEXT_WINDOW,REASONING,COMPLETION} names FAIL HARD at boot naming
155
+ # their successors — a stale .env never silently loses its envelope.
142
156
  PLURNK_SERVICE_SAFETY=1024
143
157
  #
144
- # LOCAL aliases (llama-server) MUST keep a MEASURED envelope: llama-server honors n_predict to
145
- # the context wall, and an unbounded decode wall-runs into 30k+ junk tokens (providers#10 — the
146
- # reason the cap doctrine exists). The tinkerer with a graphics card UNCOMMENTS a block keyed to
147
- # their alias and their model's real n_ctx (example alias name 'myalias'; a local model
148
- # run under the bare cloud-generous defaults fails HARD at build with a remedy naming these knobs):
149
- # PLURNK_SERVICE_CTX_myalias=78848
150
- # PLURNK_SERVICE_REASONING_myalias=4096
151
- # PLURNK_SERVICE_ASSISTANT_myalias=8192
152
- # PLURNK_SERVICE_SAFETY_myalias=1024
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
+ #
165
+ # LOCAL aliases (llama-server): the window is PROBED and the reserves DERIVE from it in the
166
+ # provider tier (percent defaults) — zero-config. Absolute pins, when wanted, are provider-tier:
167
+ # PLURNK_PROVIDERS_{REASONING,COMPLETION}_RESERVE_<alias> (see plurnk-providers/.env.defaults).
153
168
  # COUPLING (F7): per-request numeric reasoning budgets are IGNORED by llama-server — a local
154
- # thinking model's serving box MUST clamp via --reasoning-budget = its PLURNK_SERVICE_REASONING_<alias>,
155
- # or the reserve is fiction. The service warns at boot. A local alias whose partition contradicts
156
- # its real window fails HARD at build time, naming the per-alias knobs to set.
169
+ # thinking model's serving box MUST clamp via --reasoning-budget = the alias's resolved reasoning
170
+ # reserve, or the reserve is fiction. The service warns at boot. Pinned absolutes exceeding the
171
+ # detected window fail HARD at build time, naming the provider-tier knobs.
157
172
 
158
173
  # PLURNK_SERVICE_VERSION_POLL_TTL — how long (ms) discover caches its npm-registry version poll
159
174
  # (service + client `latest`) before a background refresh. Best-effort; the poll never
@@ -207,15 +222,18 @@ PLURNK_SERVICE_SEMANTIC_CHUNK_OVERLAP=0.15
207
222
  # hosts/runs that don't want vector search; the fast test lane sets it in .env.test.
208
223
  PLURNK_SERVICE_EMBED_DISABLE=0
209
224
 
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
225
+ # Which exec runtimes the search gate treats as searches — the per-turn cap and identical-query
226
+ # dedup apply to these (the search family delegates page fetches to the entry() sink; §exec-entry-sink).
227
+ PLURNK_SERVICE_SEARCH_RUNTIMES=search
219
228
  # Per-turn search flood cap: the (N+1)th search EXEC in one turn is refused 429 (dedup of
220
229
  # identical queries is unconditional and separate — it strikes and serves the prior results).
221
230
  PLURNK_SERVICE_SEARCH_MAX_PER_TURN=3
231
+ # FIND match-render budget: a FIND whose match set exceeds this returns a COUNT + narrow-your-query
232
+ # steer instead of enumerating every match (§find-count-not-contents) — a repo-scale FIND(**) over
233
+ # a 19k-entry workspace grinds clean instead of overflowing the window. 0/unset = no gate.
234
+ PLURNK_SERVICE_FIND_MAX_MATCHES=500
235
+ # Derivation-pump concurrency: how many entries' embeds run at once. The embedder's worker pool is
236
+ # data-parallel but starves on sequential per-entry calls (#416) — overlapping K embeds saturates
237
+ # it (a large-workspace ingest goes from a single-core minutes-long grind to a fast multi-core
238
+ # pass). 1 = sequential (default, safe). Set to ~cores for repo-scale ingest.
239
+ 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