@plurnk/plurnk-service 0.44.0 → 0.45.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 (116) hide show
  1. package/.env.example +27 -23
  2. package/README.md +37 -18
  3. package/SPEC.md +31 -7
  4. package/dist/core/ChannelWrite.d.ts +4 -0
  5. package/dist/core/ChannelWrite.d.ts.map +1 -1
  6. package/dist/core/ChannelWrite.js +9 -0
  7. package/dist/core/ChannelWrite.js.map +1 -1
  8. package/dist/core/ChannelWrite.sql +69 -0
  9. package/dist/core/Engine.d.ts.map +1 -1
  10. package/dist/core/Engine.js +108 -71
  11. package/dist/core/Engine.js.map +1 -1
  12. package/dist/core/Engine.sql +291 -0
  13. package/dist/core/ExecutorRegistry.d.ts +4 -2
  14. package/dist/core/ExecutorRegistry.d.ts.map +1 -1
  15. package/dist/core/ExecutorRegistry.js +14 -4
  16. package/dist/core/ExecutorRegistry.js.map +1 -1
  17. package/dist/core/SchemeRegistry.d.ts +1 -0
  18. package/dist/core/SchemeRegistry.d.ts.map +1 -1
  19. package/dist/core/SchemeRegistry.js +6 -0
  20. package/dist/core/SchemeRegistry.js.map +1 -1
  21. package/dist/core/fork.d.ts.map +1 -1
  22. package/dist/core/fork.js +8 -1
  23. package/dist/core/fork.js.map +1 -1
  24. package/dist/core/fork.sql +50 -0
  25. package/dist/core/plugin-attribution.d.ts +5 -0
  26. package/dist/core/plugin-attribution.d.ts.map +1 -0
  27. package/dist/core/plugin-attribution.js +39 -0
  28. package/dist/core/plugin-attribution.js.map +1 -0
  29. package/dist/core/run-ops.sql +16 -0
  30. package/dist/core/session-settings.d.ts +1 -0
  31. package/dist/core/session-settings.d.ts.map +1 -1
  32. package/dist/core/session-settings.js +2 -1
  33. package/dist/core/session-settings.js.map +1 -1
  34. package/dist/schemes/Exec.d.ts +1 -0
  35. package/dist/schemes/Exec.d.ts.map +1 -1
  36. package/dist/schemes/Exec.js +17 -5
  37. package/dist/schemes/Exec.js.map +1 -1
  38. package/dist/schemes/File.d.ts.map +1 -1
  39. package/dist/schemes/File.js +27 -3
  40. package/dist/schemes/File.js.map +1 -1
  41. package/dist/schemes/Log.sql +37 -0
  42. package/dist/schemes/_entry-crud.sql +88 -0
  43. package/dist/schemes/_entry-find.sql +31 -0
  44. package/dist/schemes/_entry-graph.sql +60 -0
  45. package/dist/schemes/_entry-manifest.d.ts.map +1 -1
  46. package/dist/schemes/_entry-manifest.js +4 -1
  47. package/dist/schemes/_entry-manifest.js.map +1 -1
  48. package/dist/schemes/_entry-ops.sql +20 -0
  49. package/dist/schemes/_entry-semantic.sql +64 -0
  50. package/dist/schemes/exec-env.js +1 -1
  51. package/dist/schemes/exec-env.js.map +1 -1
  52. package/dist/server/Daemon.d.ts.map +1 -1
  53. package/dist/server/Daemon.js +103 -37
  54. package/dist/server/Daemon.js.map +1 -1
  55. package/dist/server/clientTurn.sql +10 -0
  56. package/dist/server/drain.sql +82 -0
  57. package/dist/server/dsl.d.ts.map +1 -1
  58. package/dist/server/dsl.js +11 -4
  59. package/dist/server/dsl.js.map +1 -1
  60. package/dist/server/envelope.sql +75 -0
  61. package/dist/server/logEntry.sql +10 -0
  62. package/dist/server/methods/_dispatchAsClient.d.ts.map +1 -1
  63. package/dist/server/methods/_dispatchAsClient.js +11 -6
  64. package/dist/server/methods/_dispatchAsClient.js.map +1 -1
  65. package/dist/server/methods/entry_read.sql +21 -0
  66. package/dist/server/methods/log_read.sql +11 -0
  67. package/dist/server/methods/loop_run.sql +9 -0
  68. package/dist/server/methods/session_create.d.ts.map +1 -1
  69. package/dist/server/methods/session_create.js +10 -3
  70. package/dist/server/methods/session_create.js.map +1 -1
  71. package/dist/service.d.ts +6 -0
  72. package/dist/service.d.ts.map +1 -0
  73. package/dist/service.js +221 -0
  74. package/dist/service.js.map +1 -0
  75. package/package.json +28 -14
  76. package/bin/plurnk-service.ts +0 -176
  77. package/dist/core/ProviderRegistry.d.ts +0 -42
  78. package/dist/core/ProviderRegistry.d.ts.map +0 -1
  79. package/dist/core/ProviderRegistry.js +0 -72
  80. package/dist/core/ProviderRegistry.js.map +0 -1
  81. package/dist/core/line-marker.d.ts +0 -23
  82. package/dist/core/line-marker.d.ts.map +0 -1
  83. package/dist/core/line-marker.js +0 -321
  84. package/dist/core/line-marker.js.map +0 -1
  85. package/dist/core/matcher.d.ts +0 -12
  86. package/dist/core/matcher.d.ts.map +0 -1
  87. package/dist/core/matcher.js +0 -72
  88. package/dist/core/matcher.js.map +0 -1
  89. package/dist/core/mimetype-binary.d.ts +0 -6
  90. package/dist/core/mimetype-binary.d.ts.map +0 -1
  91. package/dist/core/mimetype-binary.js +0 -82
  92. package/dist/core/mimetype-binary.js.map +0 -1
  93. package/dist/core/path-mimetype.d.ts +0 -3
  94. package/dist/core/path-mimetype.d.ts.map +0 -1
  95. package/dist/core/path-mimetype.js +0 -47
  96. package/dist/core/path-mimetype.js.map +0 -1
  97. package/dist/core/plugin-trust.d.ts +0 -4
  98. package/dist/core/plugin-trust.d.ts.map +0 -1
  99. package/dist/core/plugin-trust.js +0 -23
  100. package/dist/core/plugin-trust.js.map +0 -1
  101. package/dist/providers/Mock.d.ts +0 -43
  102. package/dist/providers/Mock.d.ts.map +0 -1
  103. package/dist/providers/Mock.js +0 -36
  104. package/dist/providers/Mock.js.map +0 -1
  105. package/dist/server/methods/op_hide.d.ts +0 -5
  106. package/dist/server/methods/op_hide.d.ts.map +0 -1
  107. package/dist/server/methods/op_hide.js +0 -24
  108. package/dist/server/methods/op_hide.js.map +0 -1
  109. package/dist/server/methods/op_show.d.ts +0 -5
  110. package/dist/server/methods/op_show.d.ts.map +0 -1
  111. package/dist/server/methods/op_show.js +0 -24
  112. package/dist/server/methods/op_show.js.map +0 -1
  113. package/dist/server/methods/session_set_persona.d.ts +0 -5
  114. package/dist/server/methods/session_set_persona.d.ts.map +0 -1
  115. package/dist/server/methods/session_set_persona.js +0 -29
  116. package/dist/server/methods/session_set_persona.js.map +0 -1
package/.env.example CHANGED
@@ -1,10 +1,20 @@
1
- # plurnk-service environment cascade.
1
+ # plurnk-service config — the shipped legend: every knob + its default.
2
2
  #
3
- # Override order: `.env.example` < `.env` < `.env.<profile>` < shell < params.
4
- # Feature-flag bools use `=== "1"` exactly. Never `=== "true"`.
3
+ # On first run this file is copied to ~/.plurnk/.env.example, which is the cascade FLOOR.
4
+ # Edit there (or layer ~/.plurnk/.env over it). This node_modules copy is the SEED + the
5
+ # source of derived --<knob> CLI flags — it is NOT itself a runtime layer.
6
+ #
7
+ # Override order (low → high precedence):
8
+ # ~/.plurnk/.env.example (the floor — override, don't remove!)
9
+ # < ~/.plurnk/.env (your home config)
10
+ # < ./.env (per-project, current directory)
11
+ # < --env-file=… / --config=…
12
+ # < shell environment
13
+ # < --<knob> CLI flags
14
+ # Feature-flag bools use `=== "1"` exactly, never `=== "true"`. `~/` expands to your home.
5
15
 
6
16
  # --- Storage ---
7
- PLURNK_DB_PATH=./plurnk.db
17
+ PLURNK_DB_PATH=~/.plurnk/plurnk.db
8
18
 
9
19
  # --- Sqlite tuning (curated knobs passed through to sqlrite; optional) ---
10
20
  # sqlrite already sets the safe posture (WAL + synchronous=NORMAL + busy_timeout=5000ms).
@@ -23,28 +33,22 @@ PLURNK_HOST=127.0.0.1
23
33
  PLURNK_PORT=3044
24
34
 
25
35
  # --- Model aliases ---
26
- # PLURNK_MODEL is the active provider for every loop (a client may override per
27
- # loop via loop.run({alias})). Out of the box it is `plurnk` the zero-friction
28
- # default: Plurnk, Inc.'s hosted, grammar-tuned model at model.plurnk.ai, served
29
- # anonymously with no account on a throttled free tier. Change this one line to
30
- # use another model; set it empty for no default provider. Prompts on the default
31
- # route to model.plurnk.ai — see "Plurnk account" below for (optional) creds.
32
- PLURNK_MODEL=plurnk
33
-
36
+ # PLURNK_MODEL is the active provider for every loop (a client may override per loop
37
+ # via loop.run({alias})). Out of the box it is `plurnk`. Change this one line to use
38
+ # another model; set it empty for no default provider.
39
+ # PLURNK_MODEL_alias=openai/gemma (presumes PLURNK_BASE_URL set locally)
34
40
  PLURNK_MODEL_plurnk="plurnk/plurnk"
35
41
 
42
+ PLURNK_MODEL=plurnk
43
+
36
44
  # --- Plurnk account (OPTIONAL) ---
37
- # Plurnk Service is vendor-agnostic, and connects to (almost) any LLM.
38
- # Plurnk Service is MIT Licensed and owned by Plurnk Foundation, not Plurnk, Inc.
39
- # Plurnk, Inc.'s grammar-tuned plurnk.ai model is offered as an optional convenience.
40
- # You may (OPTIONALLY) obtain free PLURNK_ACCOUNT and PLURNK_KEY variables at https://plurnk.ai.
41
-
42
- # PLURNK_ACCOUNT="..."
43
- # PLURNK_KEY="..."
44
- # The hosted endpoint defaults to https://model.plurnk.ai/v1; override it to self-
45
- # host the model or point at a mirror — it speaks the llama-server API (same grammar
46
- # transport) like the local model.
47
- # PLURNK_BASE_URL="https://model.plurnk.ai/v1"
45
+ # Plurnk Service is vendor-agnostic and connects to (almost) any LLM. MIT Licensed.
46
+ # You may (OPTIONALLY) obtain a free PLURNK_API_KEY bearer token at https://plurnk.ai.
47
+
48
+ # PLURNK_API_KEY="..."
49
+ # PLURNK_BASE_URL overrides the default endpoint — self-host or point at a mirror that
50
+ # speaks the llama-server API (same grammar transport).
51
+ # PLURNK_BASE_URL="..."
48
52
 
49
53
  # --- Loop control ---
50
54
  # Operator turn ceiling. -1 (default) = no cap (loops end via SEND, budget,
package/README.md CHANGED
@@ -1,29 +1,48 @@
1
1
  # plurnk-service
2
2
 
3
- LLM agent runtime engine. Consumes [plurnk-grammar](https://github.com/plurnk/plurnk-grammar); exposes WebSocket JSON-RPC for clients. User-facing CLI: [plurnk](https://github.com/plurnk/plurnk).
4
- Default Provider: [plurnk.ai](https://plurnk.ai).
3
+ > Plurnk is in early-alpha public testing see https://status.plurnk.ai for current status.
5
4
 
6
- * Plurnk Service is vendor-agnostic, and connects to (almost) any LLM.
7
- * Plurnk Service is MIT Licensed and owned by Plurnk Foundation, not Plurnk, Inc.
8
- * Plurnk, Inc.'s grammar-tuned [plurnk.ai](https://plurnk.ai) model is offered as an optional convenience.
9
- * You may (OPTIONALLY) obtain free PLURNK_ACCOUNT and PLURNK_KEY variables at [plurnk.ai](https://plurnk.ai).
5
+ LLM agent runtime engine. Consumes [plurnk-grammar](https://github.com/plurnk/plurnk-grammar); exposes WebSocket JSON-RPC. User-facing CLI: [plurnk](https://github.com/plurnk/plurnk). Provider-agnostic, MIT — no vendor or model lock-in.
10
6
 
11
- ## Documentation
7
+ ## What an agent can do
12
8
 
13
- - [`SPEC.md`](./SPEC.md) canonical specification. Sections and promises share one terse-tag namespace (`§<tag>`, no digits). Anchors `{§<tag>}` bind to integration tests (`test/intg/spec-anchors.test.ts`).
14
- - [`AGENTS.md`](./AGENTS.md) — collaboration memory for agents working on this repo (gitignored).
9
+ 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.
15
10
 
16
- ## Sibling contracts
11
+ Over schemes: `file://` project files · `exec://` command output · `http(s)://` web fetch · `run://` sibling agent runs (spawn / fork / message) · `known://` scratch · `log://` own history.
17
12
 
18
- Author-facing contracts hosted in their own repos. plurnk-service is the consumer; consumption surface section noted.
13
+ ## Loop model
19
14
 
20
- | Repo | Domain | Consumption |
21
- |---|---|---|
22
- | [plurnk-providers](https://github.com/plurnk/plurnk-providers) | LLM transports + tokenomic primitives | SPEC §provider |
23
- | [plurnk-schemes](https://github.com/plurnk/plurnk-schemes) | URI scheme handlers | SPEC §scheme-surface |
24
- | [plurnk-mimetypes](https://github.com/plurnk/plurnk-mimetypes) | Content interpreters | SPEC §mimetype-surface |
25
- | [plurnk-execs](https://github.com/plurnk/plurnk-execs) | Runtime executors (EXEC dispatch) | SPEC §bundled-set |
15
+ 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.
16
+
17
+ ## Integration (WebSocket JSON-RPC)
18
+
19
+ 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.
20
+
21
+ ```
22
+ ws connect → session.create({ projectRoot }) → loop.run({ prompt })
23
+ → read log/entry notifications until loop/terminated
24
+ ```
25
+
26
+ The human CLI over this surface is [plurnk](https://github.com/plurnk/plurnk).
27
+
28
+ ## Run
29
+
30
+ ```
31
+ npm install -g @plurnk/plurnk-service
32
+ plurnk-service start # daemon (`migrate` initializes the DB)
33
+ ```
34
+
35
+ Config + state live in `~/.plurnk/` (created on first run): set `PLURNK_MODEL` and friends in `~/.plurnk/.env`; the DB defaults to `~/.plurnk/plurnk.db`. Provider-agnostic — point `PLURNK_MODEL` at any vendor. Full override cascade (`~/.plurnk` < `./.env` < `--env-file` < shell < `--flags`) is documented at the top of `.env.example`. Also exports `{ Engine, Daemon, SchemeRegistry }` for in-process embedding.
36
+
37
+ ## Contract & siblings
38
+
39
+ - [`SPEC.md`](./SPEC.md) — canonical specification. One `§<tag>` namespace; anchors `{§<tag>}` bind 1:1 to `test/intg/spec-anchors.test.ts`.
40
+ - [plurnk-providers](https://github.com/plurnk/plurnk-providers) §provider · [plurnk-schemes](https://github.com/plurnk/plurnk-schemes) §scheme-surface · [plurnk-mimetypes](https://github.com/plurnk/plurnk-mimetypes) §mimetype-surface · [plurnk-execs](https://github.com/plurnk/plurnk-execs) §bundled-set.
41
+
42
+ ## Semantic search
43
+
44
+ `FIND` ranks via an optional embedder peer, `@plurnk/plurnk-mimetypes-embeddings` (heavy native deps; not installed by default). Absent → `FIND` degrades and `start` prints an `embedder inactive` notice. Enable: `npm i @plurnk/plurnk-mimetypes-embeddings`.
26
45
 
27
46
  ## Tests
28
47
 
29
- Tiers per SPEC §test-taxonomy. Scripts: `test:lint`, `test:unit`, `test:intg`, `test:live`, `test:demo`.
48
+ `test:lint`, `test:unit`, `test:intg`, `test:live`, `test:demo`; off-hot-path `test:installation`.
package/SPEC.md CHANGED
@@ -102,7 +102,7 @@ Dependency direction (from root to leaf):
102
102
  - `plurnk-mimetypes` — handler base classes, discovery, fitting algorithm, matcher dispatch. Handler children are per-mimetype: `plurnk-mimetypes-text-{python,typescript,markdown,html,csv,plain}`, `plurnk-mimetypes-application-{json,yaml,toml,pdf}`, …
103
103
  - `plurnk-schemes` — scheme-author types (`SchemeManifest`, `WriterTier`, `LoopFlags`), result-shape contracts (`EntryResult` / `ProposalResult` / `PassthroughResult`), slicing primitives, matcher helpers, `schemeError(...)` constructor. Future scheme children: `plurnk-schemes-http`, `plurnk-schemes-git`, …
104
104
  - `plurnk-execs` — `BaseExecutor`, `SubprocessExecutor`, runtime resolver, discovery. Children declare runtimes: `plurnk-execs-sh`, future `plurnk-execs-search`, `plurnk-execs-node`, …
105
- - **`plurnk-service`** (this repo) — consumes all of the above. Implements the engine, dispatches ops through scheme handlers, hosts the in-tree set of schemes (`plurnk`, `log`, `exec`, `known`, `unknown`, `skill`, `file`), discovers installed mimetype handlers + provider vendors + executor siblings at boot, hosts the daemon (`bin/plurnk-service.ts` over WebSocket + JSON-RPC), and projects packets to the wire per `Packet.json`. Most of the substantive runtime work lives here.
105
+ - **`plurnk-service`** (this repo) — consumes all of the above. Implements the engine, dispatches ops through scheme handlers, hosts the in-tree set of schemes (`plurnk`, `log`, `exec`, `known`, `unknown`, `skill`, `file`), discovers installed mimetype handlers + provider vendors + executor siblings at boot, hosts the daemon (`src/service.ts` over WebSocket + JSON-RPC), and projects packets to the wire per `Packet.json`. Most of the substantive runtime work lives here.
106
106
  - **`plurnk`** (client) — terminal UI consuming the daemon's RPC surface. Renders `telemetry/event` notifications, subscribes to log/stream/proposal events. No engine logic of its own.
107
107
 
108
108
  The grammar is the contract. The frameworks consume the contract and add author-facing surfaces. The service consumes the frameworks and runs the engine. The client consumes the service and renders to humans. Each tier is its own published package; each tier's evolution happens in its own repo.
@@ -188,6 +188,17 @@ Beyond the three creation ops:
188
188
  - **Cap** — `PLURNK_SESSION_RUNS_MAX_ACTIVE` ceilings the *concurrent* active runs per session (a run with a non-terminal loop); a spawn or fork past it fails hard (508 — no queue, no retry), irc exempt; `-1` disables it. The fork-bomb brake, sized for sessions that live for months. {§run-scheme-cap}
189
189
  - **Collect** — a run's loop reaching a terminal status surfaces to its sisters as an ambient FOLDED delta (§env-delta): a `SEND` from `run:///<name>` carrying the loop's deliverable — the `SEND[200]` body, or for an abandonment the reason. Every death-path is stamped uniformly, so no termination is silent; collection is the shared world moving, never a verb. {§run-scheme-collect}
190
190
 
191
+ ### §run-lifecycle Run lifecycle: the drain, the reap, the passive wake
192
+
193
+ A run is a **log plus a cancellation scope** — one `AbortController` per run, reused while live and replaced only once aborted, so a cancel ends the run as a unit and a later `loop.run` is never born cancelled. A run's queued loops are advanced by a **drain**: a single per-run worker that claims loops atomically (status 100→102) and runs each under the run's scope. A loop may spawn **streams** (execs) that outlive it; each is a row in the subscription registry (§subscriptions) — the durable record of what the run holds open. Cancellation and conclusion are defined against these structures, never wall-clock timing.
194
+
195
+ - **One drain advances a run.** At most one drain is registered for a run at any instant: a `loop.run` or wake on a run with a live drain folds in (active→next-turn) or enqueues a loop that drain claims, never a second parallel drain. A drain's start and its empty-queue teardown relinquish run under one per-run lock, so the teardown's re-claim cannot race a concurrent start into a double-drain. {§run-lifecycle-single-drain}
196
+ - **A cancel reaps every stream the run holds — by the registry.** `loop.cancel` / `KILL` / shutdown abort the run scope AND iterate the run's open subscriptions, aborting each via its owning scheme; the registry is the source of truth, the in-process abort signal a fast-path optimization. A stream that is running, mid-spawn (its row written before it is killable), or spawned after the cancel is reaped alike. {§run-lifecycle-total-reap}
197
+ - **A stream's kill binds to the scope it captured at spawn.** A stream captures the run's cancellation scope as it registers and wires its kill to it, re-checking `aborted` AFTER wiring — no check-then-listen gap can drop an abort that lands mid-registration. Because the scope is replaced only once aborted, a captured-then-replaced scope is necessarily already aborted, so replacement never strands a live stream. {§run-lifecycle-exec-epoch-bound}
198
+ - **A cancelled run is not resurrected by its own torn-down work.** A stream conclusion delivered to a cancelled, idle run starts no fresh drain: an aborted (499) conclusion is skipped, and a straggler that concluded cleanly surfaces its deliverable as an environment delta (§env-delta), never a revived loop. The cancel was deliberate; only an explicit `loop.run` resumes the run. {§run-lifecycle-no-resurrection}
199
+ - **A stream conclusion always reaches its run.** When a backgrounded stream concludes, the daemon routes it through the same inject seam as any loop source (§actor-boundary-passive-wake): an active run folds the summary into its next turn; a dormant run opens a fresh loop with the summary as its prompt — a long-running result is never lost because its spawning loop ended first. {§run-lifecycle-wake-liveness}
200
+ - **A loop is never stranded by a drain's exit.** A drain relinquishes its registry slot only after a lock-held re-claim confirms the queue is empty; a loop enqueued during that teardown is either re-claimed by the exiting drain or claimed by a fresh drain that a later inject starts. The relinquish and the start are serialized, so neither the lost-loop hang nor a transient double-drain can occur. {§run-lifecycle-no-lost-loop}
201
+
191
202
  ---
192
203
 
193
204
  ## §provider Provider Contract
@@ -212,6 +223,20 @@ Plus immutable identity: `provider.contextSize` (token total, or `null` → "no
212
223
  - `assistantRaw` is opaque to the engine (forensics-only). {§provider-guarantees-assistantraw-opaque}
213
224
  - `countTokens` is cheap by contract; engine calls frequently.
214
225
 
226
+ ### §attribution First-party plugin attribution
227
+
228
+ A plugin declares an opaque attribution tag in its `package.json` so the creators behind it can be credited when the plugin is active:
229
+
230
+ ```
231
+ { "plurnk": { "attribution": "@acme/widgets" } } // a string, or string[]
232
+ ```
233
+
234
+ The engine unions the declared tags of the active plugin families (schemes, execs) onto `generate({ attributions })`, deduped + stable, per turn; an empty set is omitted. The service does not interpret a tag; richer creator identities (`@plurnk/creators/<name>`) ride the same namespace later.
235
+
236
+ **The `@plurnk/` namespace is reserved.** A package may declare an `@plurnk/` tag only if it is itself `@plurnk/`-scoped (npm enforces scope ownership at publish); otherwise it fails hard. {§attribution-plurnk-namespace-reserved}
237
+
238
+ Deferred (#249): grounding the value in real per-turn value flow rather than the active-plugin placeholder, token-weighting, entry-level attribution, and the `client` id. Native surfacing of the field in each framework's `discover()` supersedes the service-side manifest read and extends collection to mimetype + provider plugins.
239
+
215
240
  ### §provider-instantiation Provider instantiation
216
241
 
217
242
  Model alias parsing (`parseAliasesFromEnv` / `resolveActiveAlias`) lives in [`@plurnk/plurnk-providers`](https://github.com/plurnk/plurnk-providers). {§provider-instantiation-alias-resolution} Dynamic provider instantiation (`instantiateProvider` / `loadActiveProvider`) lives in `src/core/ProviderInstantiate.ts` here — `import()` resolves package specifiers relative to the calling module, so the dynamic-import path stays in the consumer where the `@plurnk/plurnk-providers-<vendor>` packages are installed.
@@ -714,7 +739,7 @@ Plugin discovery (§plugin-discovery) registers whatever's in `node_modules/@plu
714
739
 
715
740
  ## §operator-config Operator Configuration
716
741
 
717
- Env-var cascade: `.env.example` < `.env` < `.env.<config>` (via `--config=`) < shell < CLI flags. `bin/plurnk-service.ts` auto-loads `.env.example`; zero-setup boot.
742
+ Env-var cascade: `.env.example` < `.env` < `.env.<config>` (via `--config=`) < shell < CLI flags. `src/service.ts` auto-loads `.env.example`; zero-setup boot.
718
743
 
719
744
  Model selection: separate alias cascade in `ProviderRegistry` (§provider-instantiation). `PLURNK_MODEL_<alias>=<provider>/<model-id>` declares; `PLURNK_MODEL=<alias>` selects. Aliases live in `.env`, not `.env.example` (operator-specific).
720
745
 
@@ -734,7 +759,6 @@ Model selection: separate alias cascade in `ProviderRegistry` (§provider-instan
734
759
  | `PLURNK_MANIFEST_ITEMS` | `0` | enforced | Turn-0 manifest preview foisted into the model's first turn. `-1` = full `plurnk:///manifest.json`; positive `N` = the first N items (jsonpath slice); `0` / unset = off (§actor-boundary-manifest-preview). |
735
760
  | `PLURNK_PROPOSAL_TIMEOUT_MS` | `300000` | enforced | ms wait for a proposed entry (status=202) to be resolved before timing out. |
736
761
  | `PLURNK_PROVIDERS_REASON_LEVEL` | `0` | enforced | Reasoning **magnitude** sent to the providers: `0` = none, positive = effort/budget the provider module translates to wire format (o-series tiers, Anthropic `budget_tokens`). The on/off is the `PLURNK_PROVIDERS_REASONING` gate. |
737
- | `PLURNK_PLAN` | `0` | enforced | Enable the grammar's `<<PLAN` op — advertised in the `# Plurnk System Tools` packet section (§tools). `1` on, `0` off. |
738
762
  | `PLURNK_FETCH_TIMEOUT` | `600000` | enforced | Service-wide ms ceiling on any outbound request (providers, future http schemes). Module-specific overrides are allowed below the ceiling. |
739
763
  | `PLURNK_DEBUG` | `0` | reserved | Schema-validation toggle. Not yet enforced. |
740
764
  | `PLURNK_LOG_LEVEL` | `info` | reserved | Stdout banner verbosity. Not yet enforced. |
@@ -754,14 +778,14 @@ Enforcement is per-use-site — no central most-restrictive pass; each ceiling i
754
778
  - `settings.mdDocs` (`[{alias, content}]`) **unions** with the server's `PLURNK_MD_*` docs, keyed by alias — a client adds its own repo docs atop the operator's systemwide policy doc. On alias collision the client wins (a deliberate shadow), but by default the policy doc rides into every session. The client sends content (it owns the file), not a path. {§operator-config-session-md-docs}
755
779
 
756
780
  *Ceilings — most-restrictive-wins (the client may only narrow, never widen):*
757
- - `settings.maxCommands` (number) **min()s** the `PLURNK_MAX_COMMANDS` per-emission cap for the session — a client tightens the runaway-op guard, never raises it past the operator's. {§operator-config-session-max-commands}
781
+ - `settings.maxCommands` (number) **min()s** the `PLURNK_MAX_COMMANDS` per-emission cap for the session — a client tightens the runaway-op guard, never raises it past the operator's. {§operator-config-session-max-commands} The cap bounds *actions* only: PLAN (reasoning) and a terminal `SEND` (signal ≥ 200, the conclusion) are never counted and always dispatch — so `0` is a valid floor (the tightest), admitting a plan and a conclusion with zero actions. {§operator-config-session-max-commands-floor}
758
782
  - `settings.git` (`false`) **denies** git for the session (`PLURNK_GIT_ALLOWED` AND session) — the client opts its session out of git membership + telemetry; it can never re-enable git past the operator's service-wide lockout. {§operator-config-session-git}
759
783
 
760
784
  Feature-flag bools use `process.env.X === "1"` exactly — never `=== "true"`.
761
785
 
762
786
  External plugins declare their own env vars in their own `.env.example`; service merges at boot via the cascade.
763
787
 
764
- **Admin CLI flag derivation.** `bin/plurnk-service.ts` auto-derives flags from `.env.example`: every `PLURNK_*` becomes `--<kebab-cased-name>` (prefix stripped, lowercased, underscores → dashes). Comment immediately above (no blank line) becomes `-h` description. Non-`PLURNK_*` vars in `.env.example` are bugs — vendor config belongs in the vendor's package namespace.
788
+ **Admin CLI flag derivation.** `src/service.ts` auto-derives flags from `.env.example`: every `PLURNK_*` becomes `--<kebab-cased-name>` (prefix stripped, lowercased, underscores → dashes). Comment immediately above (no blank line) becomes `-h` description. Non-`PLURNK_*` vars in `.env.example` are bugs — vendor config belongs in the vendor's package namespace.
765
789
 
766
790
  ---
767
791
 
@@ -1206,7 +1230,7 @@ Strike accounting, cycle detection, sudden-death thresholds, and no-ops bookkeep
1206
1230
 
1207
1231
  A `# Plurnk System Tools` section renders **above** `# Plurnk System Requirements` — a hook-populated list of the capabilities enabled this session, so the model sees what it can *do* before the rules it must follow. Each enabled capability contributes one line via `Engine.#collectTools`; the whole section is omitted when nothing is enabled. {§tools-capability-sheet}
1208
1232
 
1209
- **Contributors: the wired executor tags.** Each available executor tag injects a line describing its tag and functionality (the boot `ExecutorRegistry` probes availability per tag), retiring the model's blind `<<EXEC[sh]…`. The plan directive does **not** render here: it is a hard requirement gated by `PLURNK_PLAN`, joined to and dropped from the rules list with the flag rather than softly advertised as an optional tool (§requirements-plan-gated).
1233
+ **Contributors: the wired executor tags.** Each available executor tag injects a line describing its tag and functionality (the boot `ExecutorRegistry` probes availability per tag), retiring the model's blind `<<EXEC[sh]…`.
1210
1234
 
1211
1235
  ### §schemes user.schemes — the scheme directory
1212
1236
 
@@ -1216,7 +1240,7 @@ A `# Plurnk System Schemes` section renders in the system slot **after the defin
1216
1240
 
1217
1241
  ### §requirements The requirements section — static per-turn rules
1218
1242
 
1219
- Rendered at the END of the user packet under `# Plurnk System Requirements` {§requirements-requirements-render-last} — closest to the assistant turn so the contract the model has to honor is the most recent text it sees. The header is omitted entirely when the requirements string is empty. {§requirements-requirements-omitted-when-empty} Contains rules the grammar block doesn't cover (canonical example: "Conclude the loop with `<<SEND[200]:answer:SEND`"). The op syntax leads the section, and when `PLURNK_PLAN=1` the plan directive *YOU MUST begin every response with `<<PLAN:...:PLAN`* joins the rules: a hard requirement dynamically added to and removed from the list with the flag, never the soft optional-tools sheet. {§requirements-plan-gated}
1243
+ Rendered at the END of the user packet under `# Plurnk System Requirements` {§requirements-requirements-render-last} — closest to the assistant turn so the contract the model has to honor is the most recent text it sees. The header is omitted entirely when the requirements string is empty. {§requirements-requirements-omitted-when-empty} Contains rules the grammar block doesn't cover (canonical example: "Conclude the loop with `<<SEND[200]:answer:SEND`"). The op syntax leads the section. PLAN is mandated unconditionally by plurnk.md §Imperatives (grammar 0.70 requires every turn to lead with `<<PLAN`), so the service injects no separate plan directive here.
1220
1244
 
1221
1245
  **Sourcing:** caller supplies the string via `runLoop({ requirements })` / `runTurn({ requirements })`. Plurnk-service exposes `PATHS.defaultRequirements` (resolves `PLURNK_REQUIREMENTS` env → in-package `requirements.md`). No DB cascade — same string every turn.
1222
1246
 
@@ -84,5 +84,9 @@ export default class ChannelWrite {
84
84
  scheme: string;
85
85
  handle: string;
86
86
  } | null>;
87
+ static findOpenSubscriptionsForRun(db: Db, runId: number): Promise<Array<{
88
+ id: number;
89
+ scheme: string;
90
+ }>>;
87
91
  }
88
92
  //# sourceMappingURL=ChannelWrite.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChannelWrite.d.ts","sourceRoot":"","sources":["../../src/core/ChannelWrite.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,EAAE,EAAc,MAAM,SAAS,CAAC;AAG9C,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAMtE,MAAM,WAAW,gBAAgB;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EA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KAAE,GACjE,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;WAKZ,sBAAsB,CAC/B,EAAE,EAAE,EAAE,EACN,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GACvD,OAAO,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;WAUpD,2BAA2B,CACpC,EAAE,EAAE,EAAE,EACN,KAAK,EAAE,MAAM,GACd,OAAO,CAAC,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAGpD"}
@@ -15,6 +15,7 @@ export default class ChannelWrite {
15
15
  static #openSubStmt(db) { return db.open_subscription; }
16
16
  static #closeSubStmt(db) { return db.close_subscription; }
17
17
  static #findActiveStmt(db) { return db.find_active_subscription; }
18
+ static #openSubsForRunStmt(db) { return db.find_open_subscriptions_for_run; }
18
19
  static #execTerminalStmt(db) { return db.find_exec_close_status; }
19
20
  // The entry's target URI for stream notifications (#179). A NULL scheme is
20
21
  // a filesystem entry (the file scheme stores scheme=NULL), so it decodes to
@@ -76,5 +77,13 @@ export default class ChannelWrite {
76
77
  const row = await ChannelWrite.#findActiveStmt(db).get({ run_id: runId, entry_id: entryId });
77
78
  return row ?? null;
78
79
  }
80
+ // The run's still-open subscriptions — the registry-routed reap
81
+ // (§run-lifecycle-total-reap). A cancel iterates these and aborts each via the
82
+ // owning scheme, so a backgrounded exec is reaped regardless of in-process
83
+ // AbortSignal-listener timing (R1): the registry is the source of truth, the
84
+ // signal an optimization.
85
+ static async findOpenSubscriptionsForRun(db, runId) {
86
+ return ChannelWrite.#openSubsForRunStmt(db).all({ run_id: runId });
87
+ }
79
88
  }
80
89
  //# sourceMappingURL=ChannelWrite.js.map
@@ -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;IACnD,MAAM,CAAC,KAAK,CAAC,kBAAkB,CAC3B,EAAM,EACN,EAAE,SAAS,EAAE,QAAQ,EAA2C;QAEhE,MAAM,GAAG,GAAG,MAAM,YAAY,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC,GAAG,CAA2B,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,CAAC;QACxH,OAAO,GAAG,EAAE,YAAY,IAAI,IAAI,CAAC;IACrC,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,sBAAsB,CAC/B,EAAM,EACN,EAAE,KAAK,EAAE,OAAO,EAAsC;QAEtD,MAAM,GAAG,GAAG,MAAM,YAAY,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC,GAAG,CAAiD,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;QAC7I,OAAO,GAAG,IAAI,IAAI,CAAC;IACvB,CAAC;IAED,gEAAgE;IAChE,+EAA+E;IAC/E,2EAA2E;IAC3E,6EAA6E;IAC7E,0BAA0B;IAC1B,MAAM,CAAC,KAAK,CAAC,2BAA2B,CACpC,EAAM,EACN,KAAa;QAEb,OAAO,YAAY,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAC,GAAG,CAAiC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;IACvG,CAAC;CACJ"}
@@ -0,0 +1,69 @@
1
+ -- Channel-write SQL for streaming schemes. SPEC §channel-state + §subscriptions + §notifications.
2
+
3
+ -- PREP: channel_meta
4
+ SELECT e.session_id, e.scheme, e.pathname, ec.state, ec.mimetype, length(ec.content) AS contentLength
5
+ FROM entry_channels ec
6
+ JOIN entries e ON e.id = ec.entry_id
7
+ WHERE ec.entry_id = $entry_id AND ec.name = $channel;
8
+
9
+ -- PREP: append_to_channel
10
+ UPDATE entry_channels
11
+ SET content = content || $chunk
12
+ WHERE entry_id = $entry_id AND name = $channel;
13
+
14
+ -- PREP: set_channel_state
15
+ UPDATE entry_channels
16
+ SET state = $state
17
+ WHERE entry_id = $entry_id AND name = $channel;
18
+
19
+ -- PREP: set_channel_mimetype
20
+ -- A streaming scheme labels the channel with the body's per-call type (#226 —
21
+ -- http's Content-Type varies per fetch). Conditional: only writes when the type
22
+ -- actually changed, so labelling every chunk is a steady-state no-op.
23
+ UPDATE entry_channels
24
+ SET mimetype = $mimetype
25
+ WHERE entry_id = $entry_id AND name = $channel AND mimetype != $mimetype;
26
+
27
+ -- PREP: replace_channel_content
28
+ -- Full content swap for one channel (ChannelCaps.replace). Re-tokenizes at
29
+ -- write (unlike append_to_channel, which defers token count to render).
30
+ UPDATE entry_channels
31
+ SET content = $content, tokens = $tokens
32
+ WHERE entry_id = $entry_id AND name = $channel;
33
+
34
+ -- PREP: open_subscription
35
+ INSERT INTO subscriptions (run_id, entry_id, scheme, handle)
36
+ VALUES ($run_id, $entry_id, $scheme, $handle)
37
+ RETURNING id;
38
+
39
+ -- PREP: close_subscription
40
+ UPDATE subscriptions
41
+ SET closed_at = strftime('%Y-%m-%dT%H:%M:%fZ', 'now')
42
+ , close_status = $status
43
+ WHERE id = $subscription_id AND closed_at IS NULL;
44
+
45
+ -- PREP: find_active_subscription
46
+ SELECT id, scheme, handle
47
+ FROM subscriptions
48
+ WHERE run_id = $run_id AND entry_id = $entry_id AND closed_at IS NULL;
49
+
50
+ -- PREP: find_open_subscriptions_for_run
51
+ -- The run's still-open subscriptions — the registry-routed reap (§run-lifecycle-total-reap):
52
+ -- loop.cancel / KILL / shutdown iterate these and abort each via the owning scheme, so a
53
+ -- backgrounded exec is reaped independent of any in-process AbortSignal-listener timing.
54
+ SELECT id, scheme
55
+ FROM subscriptions
56
+ WHERE run_id = $run_id AND closed_at IS NULL;
57
+
58
+ -- PREP: find_exec_close_status
59
+ -- Terminal outcome of a finished exec stream, addressed by its coordinate
60
+ -- pathname — the KILL-on-a-non-running-exec lookup. 499 (aborted) = killed
61
+ -- earlier; any other terminal status = exited naturally; no row = unknown exec.
62
+ SELECT s.close_status
63
+ FROM entries e
64
+ JOIN subscriptions s ON s.entry_id = e.id
65
+ WHERE e.scope = 'session' AND e.session_id = $session_id
66
+ AND e.scheme = 'exec' AND e.pathname = $pathname
67
+ AND s.closed_at IS NOT NULL
68
+ ORDER BY s.closed_at DESC
69
+ LIMIT 1;
@@ -1 +1 @@
1
- {"version":3,"file":"Engine.d.ts","sourceRoot":"","sources":["../../src/core/Engine.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAwF,MAAM,wBAAwB,CAAC;AAMpJ,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAiB,MAAM,0BAA0B,CAAC;AACpE,OAAO,KAAK,EAAE,EAAE,EAAc,MAAM,SAAS,CAAC;AAW9C,OAAO,KAAK,EAAkB,UAAU,EAAuB,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACpG,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAC;AAE1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,aAAa,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AA8DlI,KAAK,WAAW,GAAG;IAAE,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAG9E,OAAO,KAAK,EAAE,QAAQ,EAAsD,MAAM,0BAA0B,CAAC;AAqC7G,KAAK,eAAe,GAAG;IACnB,SAAS,EAAE,eAAe,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,UAAU,CAAC;IACnB,UAAU,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7C,CAAC;AAEF,KAAK,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