@plurnk/plurnk-service 1.9.2 → 1.10.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 (71) hide show
  1. package/.env.defaults +3 -5
  2. package/SPEC.md +69 -32
  3. package/dist/build-info.json +1 -1
  4. package/dist/core/BranchReceipt.d.ts.map +1 -1
  5. package/dist/core/BranchReceipt.js +9 -4
  6. package/dist/core/BranchReceipt.js.map +1 -1
  7. package/dist/core/CoreSchemeServices.d.ts +1 -0
  8. package/dist/core/CoreSchemeServices.d.ts.map +1 -1
  9. package/dist/core/CoreSchemeServices.js +1 -0
  10. package/dist/core/CoreSchemeServices.js.map +1 -1
  11. package/dist/core/Dispatcher.d.ts +2 -1
  12. package/dist/core/Dispatcher.d.ts.map +1 -1
  13. package/dist/core/Dispatcher.js +49 -13
  14. package/dist/core/Dispatcher.js.map +1 -1
  15. package/dist/core/Engine.d.ts +3 -1
  16. package/dist/core/Engine.d.ts.map +1 -1
  17. package/dist/core/Engine.js +18 -17
  18. package/dist/core/Engine.js.map +1 -1
  19. package/dist/core/Engine.sql +34 -10
  20. package/dist/core/LoopPacket.d.ts +3 -0
  21. package/dist/core/LoopPacket.d.ts.map +1 -0
  22. package/dist/core/LoopPacket.js +2 -0
  23. package/dist/core/LoopPacket.js.map +1 -0
  24. package/dist/core/NoticeChannel.d.ts.map +1 -1
  25. package/dist/core/NoticeChannel.js +14 -2
  26. package/dist/core/NoticeChannel.js.map +1 -1
  27. package/dist/core/PacketBuilder.d.ts.map +1 -1
  28. package/dist/core/PacketBuilder.js +9 -2
  29. package/dist/core/PacketBuilder.js.map +1 -1
  30. package/dist/core/ResourceMutations.d.ts.map +1 -1
  31. package/dist/core/ResourceMutations.js +21 -3
  32. package/dist/core/ResourceMutations.js.map +1 -1
  33. package/dist/core/TerminalResult.d.ts.map +1 -1
  34. package/dist/core/TerminalResult.js +4 -1
  35. package/dist/core/TerminalResult.js.map +1 -1
  36. package/dist/core/ToolResources.js +4 -4
  37. package/dist/core/ToolResources.js.map +1 -1
  38. package/dist/core/TurnOps.d.ts.map +1 -1
  39. package/dist/core/TurnOps.js +3 -0
  40. package/dist/core/TurnOps.js.map +1 -1
  41. package/dist/core/TurnRunner.d.ts +3 -1
  42. package/dist/core/TurnRunner.d.ts.map +1 -1
  43. package/dist/core/TurnRunner.js +153 -159
  44. package/dist/core/TurnRunner.js.map +1 -1
  45. package/dist/core/packet-wire.d.ts.map +1 -1
  46. package/dist/core/packet-wire.js +5 -1
  47. package/dist/core/packet-wire.js.map +1 -1
  48. package/dist/core/scheme-types.d.ts +1 -0
  49. package/dist/core/scheme-types.d.ts.map +1 -1
  50. package/dist/schemes/Exec.d.ts.map +1 -1
  51. package/dist/schemes/Exec.js +26 -16
  52. package/dist/schemes/Exec.js.map +1 -1
  53. package/dist/schemes/_entry-find.d.ts.map +1 -1
  54. package/dist/schemes/_entry-find.js +24 -4
  55. package/dist/schemes/_entry-find.js.map +1 -1
  56. package/dist/schemes/_entry-graph.js +1 -1
  57. package/dist/schemes/_entry-graph.js.map +1 -1
  58. package/dist/schemes/_entry-send.d.ts.map +1 -1
  59. package/dist/schemes/_entry-send.js +3 -1
  60. package/dist/schemes/_entry-send.js.map +1 -1
  61. package/dist/schemes/_search-index.d.ts +1 -1
  62. package/dist/schemes/_search-index.d.ts.map +1 -1
  63. package/dist/schemes/_search-index.js +39 -35
  64. package/dist/schemes/_search-index.js.map +1 -1
  65. package/dist/server/Daemon.d.ts.map +1 -1
  66. package/dist/server/Daemon.js +4 -0
  67. package/dist/server/Daemon.js.map +1 -1
  68. package/dist/server/branch-batch.sql +4 -2
  69. package/dist/server/seam-loop.sql +5 -1
  70. package/migrations/001_schema.sql +4 -1
  71. package/package.json +32 -32
package/.env.defaults CHANGED
@@ -259,8 +259,6 @@ PLURNK_SERVICE_SEARCH_EXCLUDE=*.min.*,*.map,package-lock.json,npm-shrinkwrap.jso
259
259
  PLURNK_SERVICE_DERIVE_CONCURRENCY=
260
260
  # Maximum symbol or reference rows written by one search-index SQLite statement.
261
261
  PLURNK_SERVICE_DERIVE_STORE_BATCH=1024
262
- # Approximate number of aggregate progress milestones emitted during a multi-item
263
- # indexing pass. This also controls per-item embedding milestones.
264
- PLURNK_SERVICE_DERIVE_PROGRESS_STEPS=10
265
- # Minimum interval between progress notices from a long-running individual item.
266
- PLURNK_SERVICE_DERIVE_PROGRESS_HEARTBEAT_MS=5000
262
+ # Interval between intermediate progress heartbeats during active semantic indexing.
263
+ # Lifecycle start, failure, and completion are immediate; no-op passes stay silent.
264
+ PLURNK_SERVICE_DERIVE_PROGRESS_HEARTBEAT_MS=15000
package/SPEC.md CHANGED
@@ -430,7 +430,7 @@ direct-entry-plus-directory count; `-1` enables the ordinary markerless page;
430
430
  unset / `0` disables previews. `log://` is absent because the current worker's
431
431
  log already renders in present mode.
432
432
 
433
- §worker-initialization-entry **Model-worker initialization is a real `_plurnk` turn.** A model worker's first loop begins with one packetless `{ producer="_plurnk", kind="initialization" }` turn submitted through {§turn-ops-admission-path}. It preserves one OPEN exact `turnOps` item and dispatches the same source into ordinary PLAN, orienting READ/FIND, and terminal `SEND0 [102]` rows. Every row is structurally classified `_plurnk` and `init`. The PLAN is the canonical {§plan-value} with one `medium`, `in_progress` entry whose content is `Discover the tooling available and survey the workspace file root.`; SEND hands off with `Next: Address the prompt.` The first model request occupies the following turn and therefore begins at database/log turn sequence 2; “turn zero” is the initialization phase's model-facing label, not a zero-based database coordinate. Client and `_plurnk` administrative workers execute operation turns and do not receive model initialization.
433
+ §worker-initialization-entry **Model-worker initialization is a real `_plurnk` turn.** A model worker's first loop begins with one packetless `{ producer="_plurnk", kind="initialization" }` turn submitted through {§turn-ops-admission-path}. It preserves one OPEN exact `turnOps` item and dispatches the same source into ordinary PLAN, one archiving COPY, orienting READ/FIND, and terminal `SEND0 [102]` rows (authored in their {§op-mode-phases} execution order). Every orienting row is structurally classified `_plurnk` and `init`; the archiving `COPY (prompt:///<loop>/1)` onto `worker://~/prompts.md <-1>` is classified `_plurnk` and `backup` — the worked COPY specimen, showing the private space as scratch, emitted whenever the loop publishes a prompt ({§prompt-entry}). The PLAN is the canonical {§plan-value} with one `medium`, `in_progress` entry whose content is `Discover the tooling available and survey the workspace file root.`; SEND hands off with `Next: Address the prompt.` The first model request occupies the following turn and therefore begins at database/log turn sequence 2; “turn zero” is the initialization phase's model-facing label, not a zero-based database coordinate. Client and `_plurnk` administrative workers execute operation turns and do not receive model initialization.
434
434
 
435
435
  ### §machine-processes The machine and its processes: workspace, worker, fork
436
436
 
@@ -632,7 +632,7 @@ sequenceDiagram
632
632
 
633
633
  The active direct child's `Git Status` names its assigned branch and states the commit-and-clean return condition. No ordinary worker receives ambient commit or authorship policy; commit identity remains host-owned and outside model teaching. {§packet-git-status}
634
634
 
635
- §worker-branch-batch-receipt **The parent reconciles; the engine does not merge.** The ordinary child deliverable remains the model's exact SEND result. Its pushed termination delta and pull-side `## READ0 (worker://child)` append a bounded branch receipt to the presented body without changing that result: branch, item outcome, and the abbreviated result commit (`PLURNK_SERVICE_BRANCH_RECEIPT_REVISION_CHARS`; the database retains the full id). Branch refs remain after the batch. The parent chooses inspection, cherry-pick, merge, rejection, or deletion with ordinary Git tools.
635
+ §worker-branch-batch-receipt **The parent reconciles; the engine does not merge.** The ordinary child deliverable remains the model's exact SEND result. Its pushed termination delta and pull-side `## READ0 (worker://child)` append a bounded branch receipt to the presented body without changing that result — a statement of world state, never a next step: the worker, the branch, and the abbreviated commit now on it — for example: Branch worker `counter` created branch `count` at `8a249220`. (`PLURNK_SERVICE_BRANCH_RECEIPT_REVISION_CHARS` bounds the commit; the database retains the full id). An empty deliverable with a receipt presents the receipt alone, never "no deliverable": the branch is the deliverable. Branch refs remain after the batch. The parent chooses inspection, cherry-pick, merge, rejection, or deletion with ordinary Git tools.
636
636
 
637
637
  §worker-branch-batch-recovery **Recovery follows durable ownership.** `branch_batches`, their ordered items, the project-repository snapshot, and result tips are schema state, not process memory. Generic boot recovery never starts their queued loops. A crash before sealing fails the unstarted batch. A queued partial preflight is rolled back only when every created ref still equals its frozen base, then retried. A running child is never replayed: its loop settles under the ordinary owner-loss rule; if the checkout is clean and either on the assigned branch or the exact original position, the committed tip is retained, the original restored, that item marked interrupted, and queued siblings continue. Any mismatch becomes `recovery_required` and keeps the workspace stopped for operator correction.
638
638
 
@@ -664,7 +664,10 @@ The remaining worker surfaces are:
664
664
  (`## Active Child Workers`) — as terse `* <status> <path>` pointers (the same
665
665
  shape as the errors section), just above it. Folded child activity is durable
666
666
  history; this clump is the current inventory that keeps an active obligation
667
- visible even when no new activity arrived. It is orienting state, never
667
+ visible even when no new activity arrived. Each open stream pointer carries
668
+ its channels' sizes and growth since the last packet (`* active
669
+ sh:///1/2/3 — stdout 340 lines (+2048 bytes)`) — the only thing the model
670
+ learns about a stream before it closes ({§exec-stream}). It is orienting state, never
668
671
  advice: the model sees its live subtree (`* 102 worker://worker-x`, `* active
669
672
  sh:///1/2/3`) and reasons for itself — READ/OPEN/KILL via the path.
670
673
  Empty sections are omitted, like errors.
@@ -851,7 +854,7 @@ A completed provider exchange is an **emission attempt**, not necessarily an eng
851
854
 
852
855
  Core retries a rejected emission against the exact same packet beneath the same engine turn, up to `PLURNK_SERVICE_EMISSION_ATTEMPTS`. Rejected bytes never dispatch or reach the engine strike rail. Before each `generate`, Core opens one durable logical `model_calls` row and its emission-specific `turn_attempts` admission row. A call that ends without response evidence leaves that admission row unclassified (`accepted IS NULL`) and does not consume the emission-attempt ceiling. Beneath the model call, every provider observer invocation opens one cardinal `provider_requests` occurrence immediately before physical I/O and settles it as response or error. Adapter retries and capacity failover append requests in issue order; a response-less failure therefore remains an accounted occurrence rather than disappearing. Normalized response evidence is durable before parser classification and does not duplicate the separately owned accounting. The accepted exchange alone extends `turns.packet` with response evidence; every physical request remains in turn and loop accounting, while the context gauge reads the latest settled emission request on the latest turn. Digest exposes rejected response evidence as `packetNNN.attemptNNN.rejected.*` and every physical request in its machine-readable ledger.
853
856
 
854
- The first exhaustion in a consecutive sequence closes that unadmitted turn as a continue and opens exactly one ordinary recovery turn. Its packet projects the latest rejected response OPEN from a durably FOLDED emission-attempt item under {§rejected-emission-entry} and carries one transient `invalid_emission` Notice whose complete message is: `Your previous response contained an unrecoverable syntax error. No operations were performed. Try again.` No parser diagnostic, attempt count, or rail state becomes model-facing. The recovery turn has its own honestly stored packet and its configured private same-packet attempts. The packet-local projection never changes the row's curation state, so no later packet repeats the malformed body unless the model explicitly OPENs it. Admission clears the recovery state; exhausting the informed turn terminates instead of opening another.
857
+ The first exhaustion in a consecutive sequence closes that unadmitted turn as a continue and opens exactly one ordinary recovery turn. Its packet projects the latest rejected response OPEN from a durably FOLDED emission-attempt item under {§rejected-emission-entry} and carries one transient `invalid_emission` Notice: `Your previous response contained an unrecoverable syntax error. No operations were performed. Try again.` followed by `Parser: <the latest attempt's first diagnostic>` with its `content-offset` position — the model sees why, at which line, against its own projected text. Attempt count and rail state never become model-facing. The recovery turn has its own honestly stored packet and its configured private same-packet attempts. The packet-local projection never changes the row's curation state, so no later packet repeats the malformed body unless the model explicitly OPENs it. Admission clears the recovery state; exhausting the informed turn terminates instead of opening another.
855
858
 
856
859
  An admitted frame may contain bounded malformed statements. Parsed operations still dispatch; each malformed statement becomes one durable model-origin `error` row with the parser's exact diagnostic under {§parse-diagnostics} and status 400. These failures are committed before the terminal disposition, participate in the ordinary strike rail, and prevent SEND signal `200` or an already-drained signal `202` from concluding before the model sees them in the next packet. This is operation recovery, not provider resampling.
857
860
  The Problem recovery states that only the failed operation needs correction
@@ -1044,7 +1047,7 @@ render-time filtering.
1044
1047
 
1045
1048
  §fs-visibility-grantors **File visibility has two represented grantors; Plurnk never invents a private third one.** A file member is admitted by the active Git substrate or by an ordinary `pick` constraint. A `pick` is either explicit client policy or the exact, inspectable record of an accepted creation ({§fs-create-generated-pick}); both resolve to `constraint` membership. AGENTS.md remains auto-pulled as POLICY ({§policy-sections}), deliberately not a file member. A physically existing path that neither Git nor `pick` admits does not exist for the model and cannot be overwritten.
1046
1049
 
1047
- §fs-write-surface **The write surface — one admission and incorporation path.** Existing writes remain membership-gated. An absent path additionally crosses the effective creation scope and the complete constraint/Git policy before a proposal is issued. EDIT, COPY destinations, and MOVE destinations use this same path regardless of whether the producer is a model, client, plugin, or `_plurnk`.
1050
+ §fs-write-surface **The write surface — one admission and incorporation path.** Existing writes remain membership-gated. An absent path additionally crosses the effective creation scope and the complete constraint/Git policy before a proposal is issued. EDIT, COPY destinations, and MOVE destinations use this same path regardless of whether the producer is a model, client, plugin, or `_plurnk`. A COPY or MOVE destination region on an absent entry is admitted only as the append form `<-1>`, which creates the entry with the source content — appending to nothing is creation; any other region on an absent entry is `destination-region-not-found`.
1048
1051
 
1049
1052
  | Case | Required admission | Accepted result |
1050
1053
  |------|--------------------|-----------------|
@@ -1580,7 +1583,7 @@ The packet projects one actionable owner for each retrieval fact:
1580
1583
  | READ-shaped materialization notice | none | none | generic body `lines` |
1581
1584
  | catalog/path FIND | compact `resource` range | none | none |
1582
1585
  | broad matcher FIND | compact `resource` range | per-resource match-location counts; a resource with exactly one match also carries that match's `locator`/`region` | nonzero complete `matchLocationCount` |
1583
- | exact matcher FIND | compact `matchLocation` range | each row's locator/region | none |
1586
+ | exact matcher FIND | compact `matchLocation` range | each row's locator/region; a regex or glob row also carries `matched`, the matched text | none |
1584
1587
 
1585
1588
  The compact range is `{ unit, total, requested: [first,last], returned?:
1586
1589
  [first,last] }` ({§range-extent}); empty results omit `returned`. Transparent
@@ -1788,14 +1791,26 @@ the loop continue; repeated offenses terminate through the engine's 500.
1788
1791
  | Idle turn | An engine-rail error row with the corrective disposition | One strike |
1789
1792
  | Refused disposition | The final SEND's 409 row with its exact Problem Detail | One strike |
1790
1793
 
1794
+ - §send-target-recipient **A SEND target is a recipient.** A model's directed SEND
1795
+ addresses a worker (`## SEND0 (worker://<name>)`), an outbound agent (`a2a://`),
1796
+ or a scheme that implements SEND (an `https://` POST); with `[410]` it names a
1797
+ resource to delete. A SEND to a scheme the model may not write (the prompt, the
1798
+ log) is refused 400 `send-target-not-a-recipient` — the detail says the reply to
1799
+ the active prompt carries no target and the recovery names the recipient form —
1800
+ never the writer rule, which is true and teaches nothing (a model answering
1801
+ `(prompt:///…)` was striking out on 403s). A scheme that does not implement SEND
1802
+ answers 501 with the same recovery.
1791
1803
  - §send-idle-turn **Idle turn** — a continuing turn (102) whose ops are only PLAN/SEND — no work op. The model continued with nothing to do. The steer, verbatim: *"If your work is done, conclude with `## SEND0 [200]`. If you're waiting on a child or stream you spawned, use `## SEND0 [202]` to block on it — a 202 with nothing to wait on simply concludes."* A successful same-turn FOLD is the exception: its `202` continues without a strike so the curated packet can support the next reasoning turn.
1792
1804
  - §send-premature-terminate **Premature terminate — the pending set.**
1793
1805
  A model's completion claim is gated by one rule: *nothing pending may be silently
1794
1806
  discarded*. Pending work has two states: **live obligations** (open
1795
1807
  streams/spawns and live child workers) and **completed-but-unobserved
1796
- results** (same-turn READ/FIND/OPEN results, failed operations, terminal
1797
- stream output without a terminal foisted READ, and child results queued for
1798
- the next packet). The set is judged at the disposition's own dispatch, after
1808
+ results** (same-turn READ/FIND/OPEN results, failed operations, failed
1809
+ terminal stream output (close status ≥ 400) without a terminal foisted
1810
+ READ, and child results queued for the next packet). A stream that closed
1811
+ successfully is banked, not pending: its output stays in the Log and `[200]`
1812
+ over it is a legitimate conclusion on the stream's own success; the
1813
+ retrieval members are unchanged. The set is judged at the disposition's own dispatch, after
1799
1814
  earlier operations in the emission. `[200]` over any member is refused 409
1800
1815
  and the loop continues; every refusal strikes uniformly, including a
1801
1816
  retrieval-only refusal. The pending kind changes the corrective message, not
@@ -1822,7 +1837,17 @@ admission. Core owns target
1822
1837
  realization; neither filesystem type nor body presence may invent a target role
1823
1838
  the selected runtime did not declare. With no declared directory override,
1824
1839
  `cwd` is the workspace's `project_root`, where the File scheme writes — never
1825
- the daemon's own cwd.
1840
+ the daemon's own cwd. A runtime that routes a directory target to `cwd` resolves
1841
+ a relative target against the directory the command would run in — the project
1842
+ root, or the shell's own cwd when the workspace has none — and inspects it
1843
+ before anything spawns: a directory becomes the working directory, a file is the
1844
+ script; anything else is refused `400 target-not-found`, naming that directory
1845
+ and stating that a command belongs in the body. The started receipt always
1846
+ names the working directory. The EXEC `(path)` is one of cwd, script, or tool
1847
+ name — the runtime's declaration decides which (interpreters: cwd or script;
1848
+ tool families: tool name) — and a command is never a target. The default shell
1849
+ is taught as the bare `EXEC` with `(.)`; `[sh]` and `[bash]` remain the explicit
1850
+ forms.
1826
1851
 
1827
1852
  | Declared target kind | Authored target | Canonical effect target | Executor realization |
1828
1853
  | -------------------- | --------------------------------------- | ----------------------- | --------------------------------------------------------- |
@@ -1969,23 +1994,28 @@ loudly rather than degrading admission.
1969
1994
 
1970
1995
  After all non-SEND operations dispatch, the initiating turn applies {§worker-optimistic-settlement} to only the EXEC streams it started, then dispatches its terminal SEND against the refreshed lifecycle state. An older stream receives no renewed opportunity merely because another turn began. This is a settlement barrier before disposition, not sibling-operation serialization: dependent EXECs remain separate observed turns.
1971
1996
 
1972
- §exec-stream **Stream surfacing.** An exec's output is *observed, not fetched*.
1973
- Each turn the environment-observation injector publishes newly publishable content
1974
- from each owned channel as an `origin=_plurnk` READ at
1975
- `<runtime>:///<coord>#<channel>`, preserving the channel's current mimetype:
1997
+ §exec-stream **Stream surfacing.** An exec's output is *observed, not fetched*, in
1998
+ two states and no others:
1976
1999
 
1977
- | channel mimetype | while active | at terminal state |
1978
- |---|---|---|
1979
- | `text/*` (including `text/stream`) | every new text segment | every remaining segment |
1980
- | `application/jsonl` or `application/x-ndjson` | complete newline-terminated records | every remaining record |
1981
- | every other mimetype | nothing | the complete atomic document |
1982
-
1983
- The durable per-subscription, per-channel cursor advances only through content
1984
- actually published, so an active atomic document or trailing partial JSONL
1985
- record never reaches the model as malformed structured data. Its transition and
1986
- the generated READ commit atomically. Ongoing observations are folded and a
1987
- terminal observation is born OPEN; a terminal state with no newly publishable
1988
- body still produces one bodyless conclusion row. OPEN, FOLD, or KILL may curate
2000
+ | state | what the model receives |
2001
+ |---|---|
2002
+ | active | nothing in the Log. The `## Child Streams` pointer names the stream with each channel's size and its growth since the last packet ({§child-orientation}); the model READs any range it wants. |
2003
+ | terminal | ONE `origin=_plurnk` READ at `<runtime>:///<coord>#<channel>`, born OPEN, that is exactly a markerless READ of the channel — its first page ({§read-selection-projection}: lines 1–16, the whole channel when it fits, the channel's own mimetype), the `range` extent, and the terminal status and Problem. |
2004
+
2005
+ §exec-stream-page **An unrequested delivery never exceeds the retrieval page.** The
2006
+ terminal observation is the same page a markerless READ returns, whatever the
2007
+ mimetype and however many turns the stream ran: the channel keeps every line for a
2008
+ scoped READ (`## READ0 (<runtime>:///<coord>#<channel>) <L,M>`), and the extent
2009
+ tells the model the total. Only the active user prompt and the generated project
2010
+ instructions are delivered without this bound; the model receives more than a page
2011
+ only by asking.
2012
+
2013
+ The durable per-subscription, per-channel cursor records the size last reported
2014
+ to the model — by the Child Streams pointer while active, by the terminal
2015
+ observation at close — so the pointer can state growth and no partial document
2016
+ or record ever reaches the model. The terminal observation and its cursor
2017
+ transition commit atomically; a terminal state with an empty channel still
2018
+ produces one bodyless conclusion row. OPEN, FOLD, or KILL may curate
1989
2019
  that log row without rewinding the cursor or publishing the terminal result
1990
2020
  again; the exact terminal result and channel content remain READable at the
1991
2021
  stream address. Every READ then obeys {§body-projection} and therefore renders
@@ -2927,6 +2957,7 @@ active lifecycle behind. LOOK text anchors resolve through the same
2927
2957
  |--------------------------------------------------------------|---------|------------|
2928
2958
  | §notifications-log-entry-notify `log/entry` | `{ entry: LogEntry }` | A `log_entries` row is committed. |
2929
2959
  | §notifications-loop-terminated `loop/terminated` | `{ workerId, loopId, result, hitMaxTurns, turnIds, usage: { accounting, curationWeight, curationBudget, contextTokens, contextCapacity, meta }, attributions }` | One loop reaches a terminal state. `result` is the exact universal operation result, including its RFC 9457 Problem Details on failure. `accounting` is the loop's contracts-owned {§provider-accounting}; the two curation facts and two physical-context facts follow {§tokenomics-client-gauge}; `meta` is that turn's opaque provider bag. `attributions` is the sorted union of exact provider-request evidence ({§attribution}), separate from accounting. Worker and loop are an inseparable owning coordinate. |
2960
+ | §notifications-loop-packet `loop/packet` | `{ workerId, loopId, packetCount }` | One provider packet becomes durable. `packetCount` is the exact count of packet-bearing turns in that Loop; packetless producer turns and physical provider retries never contribute. |
2930
2961
  | §notifications-loop-proposal `loop/proposal` | contracts-owned `ProposalProjection` | Dispatch pauses on a durable 202 proposal. `disposition` is the sole authority for whether a client presents review UI; live and reconnect share {§proposal-projection}. |
2931
2962
  | §notifications-loop-interaction `loop/interaction` | contracts-owned `ClientInteractionProjection` | An operation is paused on client input. Live delivery and reconnect discovery share {§client-interactions}; workspace scope remains the event envelope. |
2932
2963
  | §notifications-workspace-created `workspace/created` | `{ id, name, projectRoot }` | A workspace is created. This is the only current global event. |
@@ -3163,7 +3194,7 @@ identity, and terminal disposition without exposing raw bytes or a base64 lane.
3163
3194
  | Binary with readable projection | Derived Unicode as `text/markdown` | READ uses the projection; source-aware EDIT remains 415. |
3164
3195
  | Binary without projection/over cap | Empty marker under the source binary mimetype | READ and EDIT return 415; private metadata distinguishes unavailable from limit. |
3165
3196
 
3166
- §derivation-dedup-parallel **The index dedups then parallelizes.** The derivation identity hashes the exact READ channel representation, mimetype, reader behavior, embedding configuration, and applicable search exclusion. A channel or log projection attaches the immutable artifact only after it is complete; identical projections therefore share one FTS row, one symbol graph, and one vector set without copying. Distinct artifacts run with bounded producer concurrency (`PLURNK_SERVICE_DERIVE_CONCURRENCY`). Pending artifacts sort by readable content length before entering that pool, so small resources start first while every outlier still derives fully. Unset uses a host-relative square-root fan-out; a positive integer is an exact operator budget and `-1` claims every core. Token-count and embedding batches retain only a pool-sized promise window; graph persistence writes at most `PLURNK_SERVICE_DERIVE_STORE_BATCH` definitions or references per SQLite statement. Every representation completed by a successful pass attaches a terminal classified artifact, identically at concurrency 1 and N. Multi-item warming reports aggregate milestones and heartbeat notices according to `PLURNK_SERVICE_DERIVE_PROGRESS_STEPS` and `PLURNK_SERVICE_DERIVE_PROGRESS_HEARTBEAT_MS`.
3197
+ §derivation-dedup-parallel **The index dedups then parallelizes.** The derivation identity hashes the exact READ channel representation, mimetype, reader behavior, embedding configuration, and applicable search exclusion. A channel or log projection attaches the immutable artifact only after it is complete; identical projections therefore share one FTS row, one symbol graph, and one vector set without copying. Distinct artifacts run with bounded producer concurrency (`PLURNK_SERVICE_DERIVE_CONCURRENCY`). Pending artifacts sort by readable content length before entering that pool, so small resources start first while every outlier still derives fully. Unset uses a host-relative square-root fan-out; a positive integer is an exact operator budget and `-1` claims every core. Token-count and embedding batches retain only a pool-sized promise window; graph persistence writes at most `PLURNK_SERVICE_DERIVE_STORE_BATCH` definitions or references per SQLite statement. Every representation completed by a successful pass attaches a terminal classified artifact, identically at concurrency 1 and N. A changed pass emits one immediate `preparing` state, intermediate `indexing` heartbeats at `PLURNK_SERVICE_DERIVE_PROGRESS_HEARTBEAT_MS`, and one immediate `complete` or `failed` state. A no-op pass emits no lifecycle, an indexing heartbeat never claims 100%, and the model-facing Notice buffer retains only the current derivation state while live clients observe each heartbeat.
3167
3198
 
3168
3199
  The artifact also retains a positive `{§mimetype-parse-issues}` count and the
3169
3200
  full normalized `{§mimetype-summary}` when the exact parsed channel reported
@@ -3310,7 +3341,7 @@ ordinary operation evidence still reaches that child's direct parent.
3310
3341
 
3311
3342
  | Producer / event | Durable occurrence | Observer projection |
3312
3343
  | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------- |
3313
- | §env-delta-child-activity Direct-child activity | Every final op-bearing child log row except runtime-private `_plurnk/operation` maintenance: prompt, PLAN, operation result, or actionless error. | Direct parent only; one exact attributed row born folded. Provider reasoning, calls, rejected emissions, turnOps, and harness maintenance do not cross. |
3344
+ | §env-delta-child-activity Direct-child activity | Every final op-bearing child log row except the runtime's own rows — `_plurnk` initialization, maintenance, and operation turns are private to the child: prompt, PLAN, operation result, or actionless error. | Direct parent only; one exact attributed row born folded. Provider reasoning, calls, rejected emissions, turnOps, and harness maintenance do not cross. |
3314
3345
  | §env-delta-child-termination Direct-child termination | The child's exact terminal loop result when the loop contains at least one non-maintenance turn. | Direct parent only; a 2xx deliverable is born open and every failure is folded ({§worker-scheme-collect}). |
3315
3346
  | §env-delta-commons-mutation Commons mutation | One successful resolved operation whose landed effects touch `worker:///...`. | Every existing worker; one folded row per observer, deduplicated with any lineage audience. |
3316
3347
  | §env-delta-filesystem-narration Project-file divergence | Runtime-owned reconciliation evidence remains in the runtime actor's own log. | No ambient observer row. Current content remains addressable and stale hash edits reject at their owned boundary. |
@@ -3554,7 +3585,7 @@ evidence when a downstream standard cannot represent the complete list.
3554
3585
 
3555
3586
  READ and FIND own their range or pagination before packet rendering; the packet never applies a second hidden substring bound to their selected result. PLAN is likewise complete while OPEN: it is the model's explicit persistent reasoning inventory, serialized once as compact JSON rather than clipped or reparsed from source text. Prompt rows follow their separate adaptive projection contract. Structured mutation contexts already carry the receipt-owned bound in {§edit-result-receipt-truth}, so packet rendering does not preview them again. Actionless source artifacts, SEND/WORK/FORK bodies, EXEC commands, environment-delta EDIT spans, and extension-produced bodies use the ordinary fixed bound. When an OPEN projection differs from its canonical body, `chunk` follows the displayed `body` with the exact selected and complete extents defined by {§jsonplurnk}; complete and FOLDED bodies omit it. `## READ0 (log:///<coordinate>/<OP>)` applies its default or explicit text range to the canonical body; the unsuffixed exact shorthand and authoritative suffix behavior are defined by {§log-coordinate-hierarchy}. `## FIND0 (log:///...)` and search match that same full body. FOLD hides the ordinary projection, and OPEN restores the producer's projection without changing its bound. System/policy sections are not log bodies. Notices are transient non-log observations; they share the ordinary line/character bounds but have no durable body or recovery URI.
3556
3587
 
3557
- §prompt-entry **Prompt as a first-class entry and log row.** Each prompt is stored once at `prompt:///<loop>/<N>` as an owner-keyed text/markdown entry, then published to its turn as one actionless lowercase `prompt` log row. No synthetic EDIT or READ operation is invented. The row is born OPEN and obeys {§body-projection}. The **Active User Prompts** section closes the user-slot status clump as a paths-only list (`* prompt:///<loop>/<N>`), so every frame remains directly READable even after its log row is folded or killed.
3588
+ §prompt-entry **Prompt as a first-class entry and log row.** Each prompt is stored once at `prompt:///<loop>/<N>` as an owner-keyed text/markdown entry — written before any turn of its loop executes, so the initialization COPY ({§worker-initialization-entry}) archives a real source — then published to its first model turn as one actionless lowercase `prompt` log row; that row, not the entry, records publication. No synthetic EDIT or READ operation is invented. The row is born OPEN and obeys {§body-projection}. The **Active User Prompts** section closes the user-slot status clump as a paths-only list (`* prompt:///<loop>/<N>`), so every frame remains directly READable even after its log row is folded or killed.
3558
3589
 
3559
3590
  §prompt-causal-source **Prompt authorship and delivery are distinct facts.** The harness publishes every prompt row with `origin="_plurnk"`; the row's existing `source` carries the canonical address of a different causal actor. Native WORK, FORK, and directed worker SEND derive `worker://<sender>` from the authenticated sender worker ID. A trusted exterior adapter may supply its own canonical actor address through {§methods-loop-run}. An absent source means the owning worker itself. Attribution persists with the prompt frame through active delivery, parking, orphan recovery, restart, and later log projection; model syntax cannot author it.
3560
3591
 
@@ -3705,8 +3736,11 @@ the family document materializes at `_plurnk` + that root in the
3705
3736
  worker's private entry space. Turn 0 surveys the families (`## FIND0 [+init,+tools]
3706
3737
  (worker://~/_plurnk/tools/*.md)`, one row per
3707
3738
  server carrying its summary) and, for each server named in
3708
- `PLURNK_MCP_EXPANDED`, adds one complete family-document READ
3709
- (`_plurnk/tools/<server>.md <1,-1>`) so turn 0 names every tool it exposes.
3739
+ `PLURNK_MCP_EXPANDED`, adds one FIND over its family document matching the
3740
+ `## EXEC0` headings (`## FIND0 [+init,+tools] (worker://~/_plurnk/tools/<server>.md)`
3741
+ with `/^## EXEC0 .*\n.*$/m`), so turn 0 names every tool with its annotation and
3742
+ signature — one row per tool, paged like every survey. No document is delivered
3743
+ unasked.
3710
3744
  Attached tools are capabilities like every other runtime; the model never
3711
3745
  learns an origin.
3712
3746
 
@@ -3856,7 +3890,10 @@ One parsed content matcher crosses three ownership layers:
3856
3890
  | Core `Matcher.matchCandidates` | Apply that operation adapter across caller-supplied `{key, content, mimetype}` candidates and preserve source identity. |
3857
3891
 
3858
3892
  §relation-indexed-dialects `~semantic` and `@graph` are indexed relation dialects and never route through
3859
- the content matcher. Candidate composition has no dependency on the table that
3893
+ the content matcher. A graph body is exactly one symbol (`@sym`, `@<sym`, `@>sym`); any other `@…` body is
3894
+ refused 400 naming the dialect before an index is consulted. When the candidates' persistent index is still
3895
+ deriving, the engine settles the workspace's derivations once and re-runs the selection; a still-incomplete
3896
+ index is a 503 that is retryable — never a refusal to wait paired with an instruction to wait. Candidate composition has no dependency on the table that
3860
3897
  stored a resource.
3861
3898
 
3862
3899
  §graph-relations **Graph matching is one-hop, kind-agnostic name matching.**
@@ -1 +1 @@
1
- {"package":"@plurnk/plurnk-service","version":"1.9.2","revision":"c04aadbb90ebbfe470768322eec5e8749e873a5e","dirty":false}
1
+ {"package":"@plurnk/plurnk-service","version":"1.10.0","revision":"583eb3b978fd821e97892e763ee4343801620641","dirty":false}
@@ -1 +1 @@
1
- {"version":3,"file":"BranchReceipt.d.ts","sourceRoot":"","sources":["../../src/core/BranchReceipt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAYlC,MAAM,CAAC,OAAO,OAAO,aAAa;;IAU9B,OAAa,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAWpE;CACJ"}
1
+ {"version":3,"file":"BranchReceipt.d.ts","sourceRoot":"","sources":["../../src/core/BranchReceipt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAalC,MAAM,CAAC,OAAO,OAAO,aAAa;;IAU9B,OAAa,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAepE;CACJ"}
@@ -15,10 +15,15 @@ export default class BranchReceipt {
15
15
  return null;
16
16
  const first = rows[0];
17
17
  const revisionChars = BranchReceipt.#revisionChars();
18
- const tip = first.result_commit === null
19
- ? ""
20
- : ` at \`${first.result_commit.slice(0, revisionChars)}\` (${first.changed === 1 ? "changed" : "unchanged"})`;
21
- return `Branch receipt: \`${first.branch}\` ${first.item_state}${tip} (batch ${first.batch_id} ${first.batch_state}).`;
18
+ // {§worker-branch-batch-receipt} world state, not a next step: which worker, which
19
+ // branch, and the commit that now sits on it. What happens next is the parent's call.
20
+ const who = `Branch worker \`${first.worker_name}\``;
21
+ const tip = first.result_commit === null ? "" : ` at \`${first.result_commit.slice(0, revisionChars)}\``;
22
+ if (first.item_state !== "succeeded")
23
+ return `${who} ${first.item_state} on branch \`${first.branch}\`${tip}.`;
24
+ return first.changed === 1
25
+ ? `${who} created branch \`${first.branch}\`${tip}.`
26
+ : `${who} left branch \`${first.branch}\` unchanged${tip}.`;
22
27
  }
23
28
  }
24
29
  //# sourceMappingURL=BranchReceipt.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BranchReceipt.js","sourceRoot":"","sources":["../../src/core/BranchReceipt.ts"],"names":[],"mappings":"AAYA,MAAM,CAAC,OAAO,OAAO,aAAa;IAC9B,MAAM,CAAC,cAAc;QACjB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,4CAA4C,CAAC;QACrE,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QAC1B,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,IAAI,KAAK,GAAG,EAAE,EAAE,CAAC;YAC1D,MAAM,IAAI,KAAK,CAAC,8FAA8F,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACzI,CAAC;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,MAAM,CAAC,KAA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AAK,CAAC;IACjB,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,EAAM,EAAE,QAAgB;QACxC,MAAM,IAAI,GAAG,MAAM,EAAE,CAAC,+BAA+B,CAAC,GAAG,CAAa;YAClE,SAAS,EAAE,QAAQ;SACtB,CAAC,CAAC;QACH,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QACnC,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACtB,MAAM,aAAa,GAAG,aAAa,CAAC,cAAc,EAAE,CAAC;QACrD,qFAAqF;QACrF,sFAAsF;QACtF,MAAM,GAAG,GAAG,mBAAmB,KAAK,CAAC,WAAW,IAAI,CAAC;QACrD,MAAM,GAAG,GAAG,KAAK,CAAC,aAAa,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC,IAAI,CAAC;QACzG,IAAI,KAAK,CAAC,UAAU,KAAK,WAAW;YAAE,OAAO,GAAG,GAAG,IAAI,KAAK,CAAC,UAAU,gBAAgB,KAAK,CAAC,MAAM,KAAK,GAAG,GAAG,CAAC;QAC/G,OAAO,KAAK,CAAC,OAAO,KAAK,CAAC;YACtB,CAAC,CAAC,GAAG,GAAG,qBAAqB,KAAK,CAAC,MAAM,KAAK,GAAG,GAAG;YACpD,CAAC,CAAC,GAAG,GAAG,kBAAkB,KAAK,CAAC,MAAM,eAAe,GAAG,GAAG,CAAC;IACpE,CAAC;CACJ"}
@@ -17,6 +17,7 @@ export interface CoreSchemeServices {
17
17
  readonly injectWorker: InjectWorkerNotify | undefined;
18
18
  readonly pushNotice: (workspaceId: number, loopId: number, notice: Notice) => void;
19
19
  readonly defaultChannelFor: (scheme: string, workerId: number) => string;
20
+ readonly settleDerivations: (workspaceId: number) => Promise<void>;
20
21
  readonly resolveEntryAddress: (target: ParsedPath, ctx: PlurnkSchemeContext) => Promise<EntryAddressResolution | null>;
21
22
  readonly readExecSource: (statement: ReadStatement, ctx: PlurnkSchemeContext) => Promise<SchemeResult>;
22
23
  readonly requestInteraction: (request: ClientInteractionRequest, ids: {
@@ -1 +1 @@
1
- {"version":3,"file":"CoreSchemeServices.d.ts","sourceRoot":"","sources":["../../src/core/CoreSchemeServices.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACjG,OAAO,KAAK,EACR,wBAAwB,EACxB,2BAA2B,EAC3B,MAAM,EACN,UAAU,EACV,aAAa,EAChB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzG,OAAO,KAAK,iBAAiB,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAEvE,MAAM,WAAW,kBAAkB;IAC/B,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC;IAChB,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,gBAAgB,GAAG,SAAS,CAAC;IACvD,QAAQ,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IACzC,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,GAAG,SAAS,CAAC;IAC1D,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,SAAS,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GAAG,OAAO,CAAC,YAAY,CAAC,CAIpG;IAED,SAAS,CAAC,gBAAgB,CACtB,MAAM,EAAE,UAAU,EAClB,GAAG,EAAE,qBAAqB,GAC3B,OAAO,CAAC,sBAAsB,GAAG,IAAI,CAAC,CAIxC;CACJ"}
@@ -25,6 +25,7 @@ export class CoreSchemeAdapterBase {
25
25
  executors: services.executors(),
26
26
  weigh: services.weigh,
27
27
  defaultChannelFor: (scheme) => services.defaultChannelFor(scheme, ctx.workerId),
28
+ settleDerivations: () => services.settleDerivations(ctx.workspaceId),
28
29
  pushNotice: (notice) => services.pushNotice(ctx.workspaceId, ctx.loopId, notice),
29
30
  requestInteraction: (request) => services.requestInteraction(request, {
30
31
  workspaceId: ctx.workspaceId,
@@ -1 +1 @@
1
- {"version":3,"file":"CoreSchemeServices.js","sourceRoot":"","sources":["../../src/core/CoreSchemeServices.ts"],"names":[],"mappings":"AAuEA,MAAM,OAAgB,qBAAqB;IACvC,SAAS,CAAiC;IAE1C,QAAQ,CAAC,QAA4B;QACjC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;IAC9B,CAAC;IAES,WAAW,CAAC,GAA0B;QAC5C,IAAI,IAAI,IAAI,GAAG;YAAE,OAAO,GAAG,CAAC;QAC5B,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC;QAChC,IAAI,QAAQ,KAAK,SAAS;YAAE,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,+BAA+B,CAAC,CAAC;QACrG,OAAO;YACH,EAAE,EAAE,QAAQ,CAAC,EAAE;YACf,WAAW,EAAE,GAAG,CAAC,WAAW;YAC5B,QAAQ,EAAE,GAAG,CAAC,QAAQ;YACtB,qBAAqB,EAAE,GAAG,CAAC,qBAAqB;YAChD,MAAM,EAAE,GAAG,CAAC,MAAM;YAClB,MAAM,EAAE,GAAG,CAAC,MAAM;YAClB,MAAM,EAAE,GAAG,CAAC,MAAM;YAClB,MAAM,EAAE,GAA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AAE,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,+BAA+B,CAAC,CAAC;QACrG,OAAO,QAAQ,CAAC,cAAc,CAAC,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;IACrE,CAAC;IAES,gBAAgB,CACtB,MAAkB,EAClB,GAA0B;QAE1B,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC;QAChC,IAAI,QAAQ,KAAK,SAAS;YAAE,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,+BAA+B,CAAC,CAAC;QACrG,OAAO,QAAQ,CAAC,mBAAmB,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;IACvE,CAAC;CACJ"}
@@ -33,7 +33,7 @@ export interface ResolvedClientEntryAddress {
33
33
  }
34
34
  export default class Dispatcher {
35
35
  #private;
36
- constructor({ db, schemes, mimetypes, weigh, notices, proposals, interactions, executors, loopSignal, streamEventNotify, wakeWorkerNotify, injectWorker, branchWorker, branchCompletionGate, cancelWorker, cancelDescendants, parkDeadlines, joinTargets, liveSubscriptions, entryAddresses }: {
36
+ constructor({ db, schemes, mimetypes, weigh, notices, proposals, interactions, executors, loopSignal, settleDerivations, streamEventNotify, wakeWorkerNotify, injectWorker, branchWorker, branchCompletionGate, cancelWorker, cancelDescendants, parkDeadlines, joinTargets, liveSubscriptions, entryAddresses }: {
37
37
  db: Db;
38
38
  schemes: SchemeRegistry;
39
39
  mimetypes: Mimetypes;
@@ -43,6 +43,7 @@ export default class Dispatcher {
43
43
  interactions: ClientInteractions;
44
44
  executors: () => ExecutorRegistry | undefined;
45
45
  loopSignal: (loopId: number) => AbortSignal | undefined;
46
+ settleDerivations: (workspaceId: number) => Promise<void>;
46
47
  streamEventNotify?: StreamEventNotify;
47
48
  wakeWorkerNotify?: WakeWorkerNotify;
48
49
  injectWorker?: InjectWorker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C;KAClE,GAAG,OAAO,CAAC,MAAM,CAAC,CAQlB;IAYK,gBAAgB,CAClB,OAAO,EAAE,IAAI,CAAC,eAAe,EAAE,WAAW,CAAC,GAAG;QAAE,SAAS,EAAE,aAAa,CAAA;KAAE,EAC1E,MAAM,EAAE,cAAc,EACtB,WAAW,EAAE,MAAM,GACpB,OAAO,CAAC,cAAc,CAAC,CAYzB;CAiuBJ"}
@@ -35,6 +35,8 @@ const assertClassifyingSignal = (statement) => {
35
35
  || statement.op === "BARE") {
36
36
  TagSignal.applied(statement.signal);
37
37
  }
38
+ if (statement.op === "EXEC")
39
+ TagSignal.applied(statement.tags ?? null); // {§exec-tag-signal}
38
40
  };
39
41
  // Op dispatch ({§op-methods-op-dispatch}): admission, operation-owner routing,
40
42
  // durable log writing, and proposal lifecycle.
@@ -58,6 +60,9 @@ class Dispatcher {
58
60
  #executors;
59
61
  // Per-loop abort signal, owned by Engine.runLoop — thunked.
60
62
  #loopSignal;
63
+ // {§relation-indexed-dialects} — the engine's derivation pump, awaited by a scheme whose
64
+ // indexed dialect met a still-deriving index.
65
+ #settleDerivations;
61
66
  #streamEventNotify;
62
67
  #wakeWorkerNotify;
63
68
  #injectWorker;
@@ -74,7 +79,7 @@ class Dispatcher {
74
79
  #lifecycle;
75
80
  #resourceMutations;
76
81
  #entryAddresses;
77
- constructor({ db, schemes, mimetypes, weigh, notices, proposals, interactions, executors, loopSignal, streamEventNotify, wakeWorkerNotify, injectWorker, branchWorker, branchCompletionGate, cancelWorker, cancelDescendants, parkDeadlines, joinTargets, liveSubscriptions, entryAddresses }) {
82
+ constructor({ db, schemes, mimetypes, weigh, notices, proposals, interactions, executors, loopSignal, settleDerivations, streamEventNotify, wakeWorkerNotify, injectWorker, branchWorker, branchCompletionGate, cancelWorker, cancelDescendants, parkDeadlines, joinTargets, liveSubscriptions, entryAddresses }) {
78
83
  this.#db = db;
79
84
  this.#schemes = schemes;
80
85
  this.#mimetypes = mimetypes;
@@ -84,6 +89,7 @@ class Dispatcher {
84
89
  this.#interactions = interactions;
85
90
  this.#executors = executors;
86
91
  this.#loopSignal = loopSignal;
92
+ this.#settleDerivations = settleDerivations;
87
93
  this.#streamEventNotify = streamEventNotify;
88
94
  this.#wakeWorkerNotify = wakeWorkerNotify;
89
95
  this.#injectWorker = injectWorker;
@@ -588,6 +594,10 @@ class Dispatcher {
588
594
  injectWorker: this.#injectWorker,
589
595
  mimetypes: this.#mimetypes,
590
596
  weigh: this.#weighContent,
597
+ // {§exec-stream} — a runtime scheme's default channel is its own (stdout), never the
598
+ // catalog fallback `body`; resolved through the same registry the writable gate reads.
599
+ defaultChannelFor: (scheme) => this.#schemes.defaultChannelFor(scheme, functionalityWorkerId),
600
+ settleDerivations: () => this.#settleDerivations(workspaceId),
591
601
  pushNotice: (notice) => this.#notices.push(workspaceId, loopId, notice),
592
602
  requestInteraction: (request) => this.#interactions.request(request, { workspaceId, workerId, loopId, turnId }, this.#loopSignal(loopId)),
593
603
  executors: this.#executors(),
@@ -632,7 +642,19 @@ class Dispatcher {
632
642
  return null;
633
643
  }
634
644
  const target = schemeNameOf(statement.target);
635
- return this.#denyIfDisallowed(target, origin, workerId);
645
+ const denial = this.#denyIfDisallowed(target, origin, workerId);
646
+ // {§send-target-recipient} — a model's SEND to a scheme it may not write (the prompt,
647
+ // the log) was meant as the reply; the writer rule is true and teaches nothing. Name the
648
+ // form: the reply carries no target, a SEND target is a recipient (#367).
649
+ if (denial !== null && statement.op === "SEND" && origin === "model") {
650
+ return _a.#failure("send-target-not-a-recipient", 400, "`## SEND0 [200]` answers the active prompt with no target.", {}, {
651
+ target: statement.target?.raw ?? String(target),
652
+ stage: "dispatch",
653
+ recovery: "A SEND target is a recipient — `## SEND0 (worker://<name>)` — or, with `[410]`, a resource to delete.",
654
+ retryable: false,
655
+ });
656
+ }
657
+ return denial;
636
658
  }
637
659
  #denyIfDisallowed(schemeName, origin, workerId) {
638
660
  if (schemeName === null)
@@ -1045,12 +1067,15 @@ class Dispatcher {
1045
1067
  pending.push("surviving workers");
1046
1068
  const boundaries = await this.#nextPacketBoundaries(workerId, turnId);
1047
1069
  if (boundaries.retrievals)
1048
- pending.push("this turn's retrieval results (they land in the NEXT packet's Log)");
1049
- if (boundaries.streamTerminations.length > 0) {
1050
- // Name the exact streams (bench#5 requiem #9): the model can wait on
1051
- // or KILL them specifically instead of guessing what remains.
1052
- pending.push(`completed stream results that land in the NEXT packet's Log: ${boundaries.streamTerminations.join("; ")}`);
1053
- }
1070
+ pending.push("this turn's receipts (READ/FIND/OPEN/BARE results and EDIT/COPY/MOVE effects land in the NEXT packet's Log)");
1071
+ // A stream that closed successfully is banked, not pending: concluding on its own
1072
+ // success is legitimate and its output stays in the Log. A failed close is an unseen
1073
+ // failure named exactly (bench#5 requiem #9) so the model reads it, not guesses.
1074
+ const failedStreams = boundaries.streamTerminations
1075
+ .filter(({ closeStatus }) => closeStatus >= 400)
1076
+ .map(({ handle }) => handle);
1077
+ if (failedStreams.length > 0)
1078
+ pending.push(`failed stream results that land in the NEXT packet's Log: ${failedStreams.join("; ")}`);
1054
1079
  if (boundaries.childTerminations)
1055
1080
  pending.push("worker results that arrived during this turn (they land NEXT turn)");
1056
1081
  return pending;
@@ -1071,7 +1096,7 @@ class Dispatcher {
1071
1096
  return {
1072
1097
  retrievals: turnBoundaries.some(({ op }) => op !== "FOLD"),
1073
1098
  folds: turnBoundaries.some(({ op }) => op === "FOLD"),
1074
- streamTerminations: streamTerminations.map(({ handle }) => handle),
1099
+ streamTerminations,
1075
1100
  childTerminations: childTermination !== undefined,
1076
1101
  };
1077
1102
  }
@@ -1187,11 +1212,11 @@ class Dispatcher {
1187
1212
  return _a.#unobservedFailures(failCount);
1188
1213
  const pending = await this.#pendingSet(workerId, turnId);
1189
1214
  if (pending.length > 0) {
1190
- // A retrieval-only refusal needs no KILL/park remedy menu: the results simply
1215
+ // A receipts-only refusal needs no KILL/park remedy menu: the results simply
1191
1216
  // arrive in the next packet. Streams and children retain their remedy steer.
1192
- const retrievalsOnly = pending.every((k) => k.startsWith("this turn's retrieval results"));
1193
- if (retrievalsOnly) {
1194
- return _a.#failure("retrieval-results-unobserved", 409, "Last turn both performed retrieval operations and attempted to terminate. Retrieval operations force an additional turn so their results can be reviewed.", {}, {
1217
+ const receiptsOnly = pending.every((k) => k.startsWith("this turn's receipts"));
1218
+ if (receiptsOnly) {
1219
+ return _a.#failure("retrieval-results-unobserved", 409, "Last turn both performed operations whose receipts land in the next packet and attempted to terminate. Retrievals and mutations force an additional turn so their results can be reviewed.", {}, {
1195
1220
  pending: [...pending],
1196
1221
  stage: "completion",
1197
1222
  recovery: "Review the results, then use only `# PLAN0` and `## SEND0 [200]` to conclude.",
@@ -1387,6 +1412,10 @@ class Dispatcher {
1387
1412
  return _a.#failure("operation-not-implemented", 501, `Scheme '${schemeName}' does not implement ${statement.op}.`, {}, {
1388
1413
  scheme: schemeName,
1389
1414
  operation: statement.op,
1415
+ // {§send-target-recipient} — a model's SEND to a file path was meant as the reply.
1416
+ ...(statement.op === "SEND"
1417
+ ? { recovery: "`## SEND0 [200]` answers the active prompt with no target. A SEND target is a recipient — `## SEND0 (worker://<name>)` — or, with `[410]`, a resource to delete." }
1418
+ : {}),
1390
1419
  retryable: false,
1391
1420
  });
1392
1421
  }
@@ -1579,6 +1608,13 @@ class Dispatcher {
1579
1608
  outcome: null,
1580
1609
  attrs,
1581
1610
  });
1611
+ // {§exec-tag-signal} — an EXEC row's signal is its runtime; its tag signal classifies
1612
+ // through the same idempotent primitive the log-write trigger uses for tag operations.
1613
+ if (row !== undefined && statement.op === "EXEC" && statement.tags !== undefined && statement.tags !== null) {
1614
+ for (const tag of TagSignal.applied(statement.tags).add) {
1615
+ await this.#db.log_write_tag.run({ log_entry_id: row.id, tag });
1616
+ }
1617
+ }
1582
1618
  if (row === undefined)
1583
1619
  throw new Error("Dispatcher.#writeLog: INSERT ... RETURNING produced no row");
1584
1620
  return row.id;