@plurnk/plurnk-service 1.13.0 → 1.14.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.
- package/.env.defaults +0 -6
- package/SPEC.md +42 -82
- package/dist/build-info.json +1 -1
- package/dist/content/matcher.d.ts.map +1 -1
- package/dist/content/matcher.js +21 -1
- package/dist/content/matcher.js.map +1 -1
- package/dist/core/ChannelWrite.d.ts +1 -17
- package/dist/core/ChannelWrite.d.ts.map +1 -1
- package/dist/core/ChannelWrite.js +5 -5
- package/dist/core/ChannelWrite.js.map +1 -1
- package/dist/core/Dispatcher.d.ts +2 -4
- package/dist/core/Dispatcher.d.ts.map +1 -1
- package/dist/core/Dispatcher.js +10 -43
- package/dist/core/Dispatcher.js.map +1 -1
- package/dist/core/Engine.d.ts +3 -12
- package/dist/core/Engine.d.ts.map +1 -1
- package/dist/core/Engine.js +34 -44
- package/dist/core/Engine.js.map +1 -1
- package/dist/core/PacketBuilder.d.ts.map +1 -1
- package/dist/core/PacketBuilder.js +1 -6
- package/dist/core/PacketBuilder.js.map +1 -1
- package/dist/core/TurnRunner.d.ts.map +1 -1
- package/dist/core/TurnRunner.js +26 -5
- package/dist/core/TurnRunner.js.map +1 -1
- package/dist/core/packet-wire.d.ts +1 -1
- package/dist/core/packet-wire.d.ts.map +1 -1
- package/dist/core/packet-wire.js +2 -5
- package/dist/core/packet-wire.js.map +1 -1
- package/dist/digest/Digest.d.ts.map +1 -1
- package/dist/digest/Digest.js +69 -16
- package/dist/digest/Digest.js.map +1 -1
- package/dist/schemes/Worker.d.ts.map +1 -1
- package/dist/schemes/Worker.js +0 -2
- package/dist/schemes/Worker.js.map +1 -1
- package/dist/server/Daemon.d.ts +1 -1
- package/dist/server/Daemon.d.ts.map +1 -1
- package/dist/server/Daemon.js +81 -149
- package/dist/server/Daemon.js.map +1 -1
- package/dist/server/drain.sql +16 -0
- package/dist/server/lifecycle-recovery.sql +0 -7
- package/dist/server/model-route.d.ts +2 -2
- package/dist/server/model-route.d.ts.map +1 -1
- package/dist/server/model-route.js +8 -1
- package/dist/server/model-route.js.map +1 -1
- package/migrations/001_schema.sql +0 -51
- package/package.json +37 -37
- package/dist/core/BranchReceipt.d.ts +0 -6
- package/dist/core/BranchReceipt.d.ts.map +0 -1
- package/dist/core/BranchReceipt.js +0 -29
- package/dist/core/BranchReceipt.js.map +0 -1
- package/dist/core/GitBranch.d.ts +0 -23
- package/dist/core/GitBranch.d.ts.map +0 -1
- package/dist/core/GitBranch.js +0 -120
- package/dist/core/GitBranch.js.map +0 -1
- package/dist/server/BranchBatches.d.ts +0 -49
- package/dist/server/BranchBatches.d.ts.map +0 -1
- package/dist/server/BranchBatches.js +0 -599
- package/dist/server/BranchBatches.js.map +0 -1
- package/dist/server/branch-batch.sql +0 -156
package/.env.defaults
CHANGED
|
@@ -151,11 +151,6 @@ PLURNK_SERVICE_GIT_ALLOWED=1
|
|
|
151
151
|
# PLURNK_SERVICE_GIT_AUTO — automatic project-repository membership. =1 includes the Git
|
|
152
152
|
# repository containing project_root; =0 leaves member definitions as the only membership source.
|
|
153
153
|
PLURNK_SERVICE_GIT_AUTO=1
|
|
154
|
-
# PLURNK_SERVICE_BRANCH_DELEGATION — branch-tagged WORK/FORK ({§worker-branch-batch}). =0 refuses a
|
|
155
|
-
# WORK/FORK signal up front as 501 branch-delegation-disabled: the form is off the model-facing
|
|
156
|
-
# surface until it is specified and witnessed end to end (#396). =1 enables the serialized
|
|
157
|
-
# branch batches for development and their witnesses.
|
|
158
|
-
PLURNK_SERVICE_BRANCH_DELEGATION=0
|
|
159
154
|
# Maximum stdout/stderr payload accepted from one native Git subprocess.
|
|
160
155
|
PLURNK_SERVICE_GIT_OUTPUT_MAX_BYTES=67108864
|
|
161
156
|
|
|
@@ -198,7 +193,6 @@ PLURNK_SERVICE_EDIT_RECEIPT_REVISION_CHARS=8
|
|
|
198
193
|
|
|
199
194
|
# Number of Git commit characters rendered in model-facing branch receipts.
|
|
200
195
|
# The durable batch retains complete commit ids; this is display-only.
|
|
201
|
-
PLURNK_SERVICE_BRANCH_RECEIPT_REVISION_CHARS=8
|
|
202
196
|
|
|
203
197
|
# Number of surrounding and landed lines shown at each boundary of an EDIT
|
|
204
198
|
# result. Overlapping windows coalesce; the model can READ omitted content.
|
package/SPEC.md
CHANGED
|
@@ -387,7 +387,7 @@ plus a broadcast duplicate. Ordinary project files, private worker entries,
|
|
|
387
387
|
and remote resources do not acquire ambient attention merely because they are
|
|
388
388
|
workspace-addressable.
|
|
389
389
|
|
|
390
|
-
§actor-boundary-no-mutex **Wild west
|
|
390
|
+
§actor-boundary-no-mutex **Wild west, no exceptions.** Workers share workspace state without locks. Coordination is cooperative and softly fenced (the {§membership} overlay, a workspace policy, bounds every worker's visible surface uniformly — {§machine-processes}); stale writes reject at their anchor or compare-and-swap boundary rather than being prevented by a lock ({§line-anchors}, {§membership-edit-write-cas}).
|
|
391
391
|
|
|
392
392
|
§actor-boundary-passive-wake **Passive wake follows ownership.** A directed
|
|
393
393
|
voice wakes an idle worker. A parked continuation resumes when an obligation it
|
|
@@ -615,78 +615,14 @@ literal `workers.name` value.
|
|
|
615
615
|
parent's private entries — its own space deep-copied with the owner
|
|
616
616
|
remapped (source → branch) — so the branch opens with the parent's notes and
|
|
617
617
|
diverges on its own edits: *fork = everything-in-common-but-name*.
|
|
618
|
-
-
|
|
618
|
+
- §worker-spawn-no-signal **WORK and FORK take no signal.** Branch delegation was
|
|
619
|
+
removed outright (#396): a signalled spawn refuses on its own row as
|
|
620
|
+
`400 worker-signal-invalid`, naming the signal-less form. A model manages git
|
|
621
|
+
branches through ordinary EXEC git, taught by the git skill — never engine
|
|
622
|
+
machinery. No batch, branch, or child comes into being from a signalled spawn.
|
|
619
623
|
- §worker-delegation-inherits-policy **Delegation cannot widen authority.** WORK and FORK copy the delegating actor's complete effective capability policy into the child's immutable `capability_bound`; later widening of any parent layer cannot enlarge that child. Every fresh delegated loop carries that complete effective attenuation and the delegating loop's proposal disposition, including a loop created by SEND to an idle Worker. SEND into an active or parked loop leaves that loop's immutable policy untouched. The bound is delegation authority captured by value, not a client binding or a live parent-policy link.
|
|
620
624
|
- §worker-lifecycle-wake-requeue-not-terminal **A wake re-queue is not a terminal.** A conclusion-wake resumes a 202-blocked loop by re-queueing it (202 → 100); when that lands while the loop's own live drain is between turns, the drain **re-claims and continues** (atomic 100 → 102; the injected prompt is already the next turn). The internal re-queue is never reported as an outward terminal.
|
|
621
625
|
|
|
622
|
-
Untagged worker control rides the daemon's inject seam (active→fold, idle→enqueue+drain), so the handler creates/branches the worker and hands off; the daemon owns provider + system prompt. Tagged WORK/FORK instead enqueue a fresh loop without starting its drain; {§worker-branch-batch} becomes its sole starter. FORK/WORK carry the seed task in the body and are their own ops, dispatched to worker control — never the entry-copy path.
|
|
623
|
-
|
|
624
|
-
### §worker-branch-batch Serialized Git branch batches
|
|
625
|
-
|
|
626
|
-
Branch-tagged WORK/FORK serializes ordinary Git branches over the one project
|
|
627
|
-
checkout. It creates no worktrees, alternate roots, hidden merges, or stashes.
|
|
628
|
-
|
|
629
|
-
§branch-delegation-disabled **Off the surface until specified (#396).** The form is
|
|
630
|
-
not offered to the model: the teaching carries no `[branch]` slot, and unless the
|
|
631
|
-
operator sets `PLURNK_SERVICE_BRANCH_DELEGATION=1` a WORK/FORK signal is refused up
|
|
632
|
-
front as `501 branch-delegation-disabled`, naming the signal-less form. Twelve
|
|
633
|
-
branch delegations across the benchmarks produced no organic success; the
|
|
634
|
-
preconditions below are invisible to the model until the refusal, and any label on
|
|
635
|
-
WORK/FORK reads as a branch order. The batches below remain the implementation behind
|
|
636
|
-
that knob and keep their witnesses.
|
|
637
|
-
|
|
638
|
-
§worker-branch-batch-exclusive **Stop the workspace; serialize
|
|
639
|
-
ordinary branches.** A branch signal on WORK/FORK creates a durable batch keyed
|
|
640
|
-
to the parent turn. The batch queues one exclusive workspace gate before that
|
|
641
|
-
parent releases its turn. Turns already in flight drain; every later model turn
|
|
642
|
-
and client file operation waits. The batch owns exactly one repository: the Git
|
|
643
|
-
repository containing `workspaces.project_root`. A project root may be a
|
|
644
|
-
package inside a monorepo; the repository, not the package directory, is the
|
|
645
|
-
transaction boundary. Unrelated repositories belong to unrelated workspaces
|
|
646
|
-
and receive no branch policy from this workspace.
|
|
647
|
-
|
|
648
|
-
§worker-branch-batch-frozen-base All tagged children from the turn branch from
|
|
649
|
-
the same frozen commit, then run one at a time in emission order. The active
|
|
650
|
-
child and its descendants may take turns; no other worker may enter the
|
|
651
|
-
checkout. Worktrees, stashes, automatic merges, and hidden alternate roots do
|
|
652
|
-
not participate.
|
|
653
|
-
|
|
654
|
-
```mermaid
|
|
655
|
-
sequenceDiagram
|
|
656
|
-
participant P as Parent turn
|
|
657
|
-
participant G as Workspace gate
|
|
658
|
-
participant B as Branch batch
|
|
659
|
-
participant C1 as Child branch 1
|
|
660
|
-
participant C2 as Child branch 2
|
|
661
|
-
P->>B: WORK branch-1, FORK branch-2
|
|
662
|
-
P->>G: queue exclusive before releasing shared turn
|
|
663
|
-
G-->>B: all earlier turns drained
|
|
664
|
-
B->>B: snapshot clean project repository; create both refs from frozen base
|
|
665
|
-
B->>C1: checkout branch-1; run to terminal
|
|
666
|
-
C1-->>B: committed, clean result
|
|
667
|
-
B->>B: record tip; restore exact parent ref
|
|
668
|
-
B->>C2: checkout branch-2; run to terminal
|
|
669
|
-
C2-->>B: committed, clean result
|
|
670
|
-
B->>B: record tip; restore exact parent ref
|
|
671
|
-
B-->>G: release exclusive
|
|
672
|
-
B-->>P: wake; deliver branch receipts
|
|
673
|
-
```
|
|
674
|
-
|
|
675
|
-
§worker-branch-batch-preflight **Preflight is total.** `GitMembership.projectRepository` resolves the repository containing `project_root`; absence rejects the tagged op. Earlier turns and finite derivation work drain at the exclusive boundary; a pre-existing open stream subscription is not a finite checkout operation and therefore rejects preflight rather than being silently cancelled or waited forever. Before any child starts, every branch passes `git check-ref-format --branch`, the project repository has no staged, unstaged, or nonignored untracked changes, every requested branch is absent, and the original symbolic ref/detached commit is recorded. All branch refs are then created from that frozen commit. Failure rolls back only refs created by this preflight, fails the queued children, restores the parent, and releases the workspace. Existing branches are never adopted or overwritten.
|
|
676
|
-
|
|
677
|
-
§worker-branch-batch-return **A child returns commits, never a dirty checkout.** SEND signals `200`, `499`, and an already-drained `202` are refused with 409 while the project repository is off the assigned branch or dirty. The model commits or deliberately discards its changes and concludes again. On terminal, the batch records the full result commit and whether it differs from the frozen base, restores the exact original ref and commit, and only then advances. A clean child failure is a completed batch item and does not suppress later siblings; an ambiguous or dirty host failure becomes `recovery_required` and retains exclusivity because restoring would destroy or misattribute work.
|
|
678
|
-
|
|
679
|
-
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}
|
|
680
|
-
|
|
681
|
-
§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.
|
|
682
|
-
|
|
683
|
-
§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.
|
|
684
|
-
|
|
685
|
-
The remaining worker surfaces are:
|
|
686
|
-
|
|
687
|
-
- **Entries (storage)** — entry addressing rides the authority carving above ({§worker-authority-carving}): `worker:///` the commons, `worker://~/` the own space, a name an ancestry-gated read ({§worker-read-scope}), writes own-space-and-commons only ({§worker-write-scoping}). An entry-path `KILL` deletes under the same write-scoping (200; 404 absent; 403 named) — distinct from the path-absent `## KILL0 (worker://<name>)` which terminates the worker ({§worker-scheme-terminate}); the discriminator is the entry path, never the op. A worker's own space is catalogued in its perspective alone (`## FIND0 [+init] (worker://~/*)`, foisted at turn 0 even when empty); isolation is the owner column, structural.
|
|
688
|
-
- §worker-scheme-terminate **Terminate** — `## KILL0 (worker://<name>)` aborts a named worker and `## KILL0 (worker://~)` aborts the caller: every unresolved loop in that worker's subtree closes 499 and every subscription in the subtree tears down; a literal name with no worker is 404. Cancellation is structured: descendants cannot detach implicitly. The override to the fire-and-forget default is not a parent-power — whoever holds the address may end it; a worker left alone simply ends at its own SEND signal `200`.
|
|
689
|
-
- §worker-scheme-cap **Cap** — `PLURNK_SERVICE_WORKSPACE_WORKERS_MAX_ACTIVE` ceilings the *concurrent* active workers per workspace (a worker 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 workspaces that live for months.
|
|
690
626
|
- §worker-scheme-collect **Collect** — a worker's loop reaching a terminal status
|
|
691
627
|
surfaces to its direct parent as an ambient delta ({§env-delta}): a `SEND` from
|
|
692
628
|
`worker://<name>` carrying the loop's exact terminal operation result. A
|
|
@@ -694,8 +630,8 @@ The remaining worker surfaces are:
|
|
|
694
630
|
materialized into the parent's packet, not hidden behind a fold): a child's
|
|
695
631
|
success must reach the parent open and awakening, never a bodyless row. An
|
|
696
632
|
non-2xx result surfaces folded; a failure retains its exact status and Problem. Every death-path is stamped uniformly —
|
|
697
|
-
including a spawn that dies before its first turn
|
|
698
|
-
|
|
633
|
+
including a spawn that dies before its first turn — so no child termination is
|
|
634
|
+
silent to its owner; collection is lineage
|
|
699
635
|
supervision, never a
|
|
700
636
|
verb. The **pull** side mirrors the push: a path-absent
|
|
701
637
|
`## READ0 (worker://<name>)` collects that same result on demand for a
|
|
@@ -719,6 +655,8 @@ The remaining worker surfaces are:
|
|
|
719
655
|
sh:///1/2/3`) and reasons for itself — READ/OPEN/KILL via the path.
|
|
720
656
|
Empty sections are omitted, like errors.
|
|
721
657
|
|
|
658
|
+
Worker control rides the daemon's inject seam (active→fold, idle→enqueue+drain), so the handler creates/branches the worker and hands off; the daemon owns provider + system prompt. FORK/WORK carry the seed task in the body and are their own ops, dispatched to worker control — never the entry-copy path.
|
|
659
|
+
|
|
722
660
|
### §worker-loop-lifecycle Worker and loop lifecycle: drain, reap, and passive wake
|
|
723
661
|
|
|
724
662
|
- §join-blocking-collect **A `READ` on a running child is a blocking join, not a poll.** A path-absent `## READ0 (worker://<running-child>)` returns **425** (Too Early) and records a live obligation on the loop. The turn's bare SEND signal `102` is converted into an indefinite parked loop (202) instead of asking the model to poll or drive the scheduler. When the child reaches any terminal status, the same loop resumes with the result in its log. Children are bounded by their own turn and strike limits, terminal failure also wakes the parent, and the owed-wake path covers completion before the parent parks. Any `SEND` clears the per-turn arm; SEND signal `200` with a live child remains a premature-termination error. A `<seconds>` timeout-poll is the explicit polling alternative.
|
|
@@ -1250,6 +1188,7 @@ Directed SEND (non-null path) routes to scheme's `send`. Status = intent:
|
|
|
1250
1188
|
|
|
1251
1189
|
- §log-uniform-query **Log speaks the universal query contract** — `## FIND0 (log://…)` works like every scheme's FIND. Candidates are worker rows scoped by the coordinate hierarchy ({§log-coordinate-hierarchy}) and projected exactly as READ shows them. Content dialects use `Matcher.matchCandidates`; `~semantic` and `&graph` use the same persistent derivation artifacts and candidate rankers as entries. Broad results are one-channel catalog groups whose `[0].path` is `log:///loop/turn/seq/OP`; exact matcher results are flat locations ({§find-result-projection}). A FIND signal classifies the FIND result row and never changes this candidate set ({§log-item-tags}). Log remains the core event ledger rather than duplicating rows into `entries`; its core-private storage adapter supplies one complete channel representation to the same READ projector. That adapter is not a plugin seam and grants no protocol scheme an alternate READ path.
|
|
1252
1190
|
- §find-source-agnostic **The content matcher is source-agnostic** — `Matcher.matchCandidates(body, candidates, mimetypes)` applies a content matcher (regex/jsonpath/xpath/glob) to candidates from ANY source, keyed by the caller's own identity (a pathname for entries, a `loop/turn/seq` coordinate for log). The matcher never cares what table the content came from, so FIND works uniformly across schemes by construction: `EntryFind` and `Log.find` run the one shared primitive rather than re-implementing it per scheme. Log stays its own event stream, but its rows are candidates the shared matcher covers like any entry's content.
|
|
1191
|
+
- §find-candidate-containment **One candidate's crash is that candidate's problem** — arbitrary member content can crash a mimetype handler mid-match (an unbalanced template partial crashed Readability and killed a 1,916-file FIND as a blank 500, #449). `Matcher.matchCandidates` contains a per-candidate handler throw: the candidate drops out exactly like unsupported content, the cause goes to daemon stderr, and only a FIND whose every candidate crashed reports a 415 whose Problem names the first crashing member and handler. The operation's other candidates always answer.
|
|
1253
1192
|
- §channel-selection-visibility **Channel selection is decision-time information, not a guess** — every multi-channel resource presents its channels with extents wherever FIND presents the resource: broad results list each channel's path, mimetype, tokens, and lines (default channel first), and matcher locations name the channel their line coordinates address. The packet never presents channels as equal and indistinguishable; extents derive from the stored channels by construction. Budget enforcement stays with {§overflow-turn} — this is information, not a second guard.
|
|
1254
1193
|
|
|
1255
1194
|
- §matcher-selection-signal **Matching carries navigation evidence** - a matcher is a boolean resource predicate. Internally, each selected resource carries `matches: MatchEvidence[]`, where `MatchEvidence` is `{channel?,locator?,region?}`; `channel` names the entry channel the finding was located in and is absent for channel-less resources such as log rows, so line coordinates cannot be mis-attributed across channels of the same resource ({§channel-selection-visibility}). `locator` preserves a structural address without overloading the resource row's `path`; `region` is a complete four-coordinate `TextRegion` only when the finding maps honestly into the exact text the model can READ. Exact duplicate evidence deduplicates. Relation findings map their indexed source spans through the same readable text coordinate index. FIND alone decides whether that grouped selection projects as resource rows or flat locations ({§find-result-projection}); the engine never fabricates a region or guesses which surgical READ the model wants.
|
|
@@ -3085,7 +3024,10 @@ first receives its model. Model identity and reasoning
|
|
|
3085
3024
|
policy are persisted atomically, while visibility of returned reasoning and
|
|
3086
3025
|
token ceilings remain separate concerns. An explicit policy change validates
|
|
3087
3026
|
the exact policy against both the worker model and its optional spawn model and
|
|
3088
|
-
is refused while the worker owns a live or parked loop.
|
|
3027
|
+
is refused while the worker owns a live or parked loop. Effort is identity-grade:
|
|
3028
|
+
every client-visible model route carries the worker's durable policy as
|
|
3029
|
+
`reasoningPolicy`, omitted only when the cataloged model has no reasoning
|
|
3030
|
+
dimension. Client inspection
|
|
3089
3031
|
returns the supported-policy intersection of those two routes. Inspection or
|
|
3090
3032
|
mutation materializes the daemon-default model and policy onto an uninitialized
|
|
3091
3033
|
model worker before answering; a deliberately modelless daemon remains unset.
|
|
@@ -3158,7 +3100,6 @@ active lifecycle behind. LOOK text anchors resolve through the same
|
|
|
3158
3100
|
| §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}. |
|
|
3159
3101
|
| §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. |
|
|
3160
3102
|
| §notifications-workspace-created `workspace/created` | `{ id, name, projectRoot }` | A workspace is created. This is the only current global event. |
|
|
3161
|
-
| §notifications-workspace-branch-batch `workspace/branch-batch` | Branch-batch lifecycle payload | A branch batch enters queued, running, completed, failed, or recovery-required state. |
|
|
3162
3103
|
| §notifications-stream-event-on-channel-change `stream/event` | `{ entryId, workerId, target, channel, state, contentLength, mimetype?, loop_seq?, turn_seq?, sequence? }` | Channel content grows or channel state transitions. `workerId` is the entry owner and read perspective; `target` is its canonical URI. The optional coordinate is copied from schemes whose addresses carry one. Core-managed channel writes include the current stored `mimetype`, which may change per call ({§channel-mimetype}); the generic plugin notification capability does not require it. It carries metadata, not content; consumers read bytes from the stated worker perspective. |
|
|
3163
3104
|
| §notifications-stream-concluded `stream/concluded` | `{ entryId, workerId, target, subscriptionId, scheme, result, summary, wakeAction, wakeLoopId?, loop_seq?, turn_seq?, sequence? }` | A subscription closes. `workerId` identifies the entry owner; `target` is its canonical URI. The optional coordinate is copied from schemes whose addresses carry one, so clients never parse it back out of `target`. Exact result truth is preserved; `wakeAction` records whether core resumed a parked loop, folded into an active loop, skipped an aborted/cancelled worker, or found no loop. |
|
|
3164
3105
|
| §notifications-notice-event `notice/event` | `{ workerId, loopId, notice: Notice }` | A transient observation or progress notice occurs. `workerId` owns loop activity; only workspace derivation progress uses `null` with `loopId=0`. It cannot alter durable history, scheduling, recovery, or model-visible failure truth. |
|
|
@@ -3929,7 +3870,16 @@ retain distinct contracts and lifetimes.
|
|
|
3929
3870
|
| `workerId` | Narrows workers and every dependent loop, turn, turn-attached logical inference, specialization, physical request, and log row to that one worker. Workspace-only embeddings are excluded. |
|
|
3930
3871
|
| `workspaceId` | Narrows workers plus every logical inference and dependent evidence owned by one workspace, including workspace-only embeddings; when both selectors are present they intersect. |
|
|
3931
3872
|
|
|
3932
|
-
§digest-forensic-fidelity **Forensic fidelity and cardinality.** The digest's machine-readable JSON preserves every log event with its initial and current projection, causal `source`, tags, and structured `attrs`; every exact OPEN/FOLD/log-KILL target effect; the exact Problem on every failed row; each loop's exact terminal result; and every ordered physical provider request. KILLed `turnOps` still produce their chronological `assistant.md` artifacts because curation cannot rewrite what a producer submitted. Each stored packet validates independently: one malformed historical packet remains exact raw evidence with its complete validation error chain and never prevents healthy turns from being projected. Accounting on broader rows is the shared exact derivation from that ledger, never a second stored fact. The reasoning chronology distinguishes readable reasoning content from provider-reported reasoning usage: when tokens were reported but no readable content was returned, it states both facts instead of implying that no reasoning occurred. The human Markdown waterfall shows a present causal source and may preview only the Problem detail because it remains a triage projection, not the machine record. Targets reconstruct the model-visible address, including hostname, port, serialized query, and fragment; an authority-bearing URL must never degrade from `https://host/path` to `https:///path`, and durable resource coordinates render back to their authority form. Its human Markdown waterfall groups identical per-turn op outcomes and typed `entry_materialized` narrations, reporting the exact count and sequence span (`xN (seq A-B)`). Grouping keys include source and the complete target, so distinct causes, authorities, or channels never collapse. Thus amplification is conspicuous without making the diagnostic artifact itself pathological; valid packet files remain byte-identical records of what the model saw.
|
|
3873
|
+
§digest-forensic-fidelity **Forensic fidelity and cardinality.** The digest's machine-readable JSON preserves every log event with its initial and current projection, causal `source`, tags, and structured `attrs`; every exact OPEN/FOLD/log-KILL target effect; the exact Problem on every failed row; each loop's exact terminal result; and every ordered physical provider request. KILLed `turnOps` still produce their chronological `assistant.md` artifacts because curation cannot rewrite what a producer submitted. Each stored packet validates independently: one malformed historical packet remains exact raw evidence with its complete validation error chain and never prevents healthy turns from being projected. Accounting on broader rows is the shared exact derivation from that ledger, never a second stored fact. A worker's Cost line names how many settled requests carry no usage at all (errored or aborted exchanges) — their server-side spend is unrecorded rather than silently priced as zero. The reasoning chronology distinguishes readable reasoning content from provider-reported reasoning usage: when tokens were reported but no readable content was returned, it states both facts instead of implying that no reasoning occurred. The human Markdown waterfall shows a present causal source and may preview only the Problem detail because it remains a triage projection, not the machine record. Targets reconstruct the model-visible address, including hostname, port, serialized query, and fragment; an authority-bearing URL must never degrade from `https://host/path` to `https:///path`, and durable resource coordinates render back to their authority form. Its human Markdown waterfall groups identical per-turn op outcomes and typed `entry_materialized` narrations, reporting the exact count and sequence span (`xN (seq A-B)`). Grouping keys include source and the complete target, so distinct causes, authorities, or channels never collapse. Thus amplification is conspicuous without making the diagnostic artifact itself pathological; valid packet files remain byte-identical records of what the model saw.
|
|
3874
|
+
|
|
3875
|
+
§digest-executor-evidence **A red command is work, not a defect.** Engine-materialized
|
|
3876
|
+
completion rows for a failed command carry the executor's problem identity
|
|
3877
|
+
(`https://problems.plurnk.xyz/executor/*`), and the digest classifies them as
|
|
3878
|
+
evidence: they render like any row but never count toward a loop's error total,
|
|
3879
|
+
its health verdict, or the per-turn `errs=` badge — a loop that concluded green
|
|
3880
|
+
over red test runs is CLEAN, not DEGENERATE-WIN. This is the digest mirror of the
|
|
3881
|
+
strike rail's exemption ({§engine-rails}, #425 F1): structural violations count,
|
|
3882
|
+
executor evidence never does.
|
|
3933
3883
|
|
|
3934
3884
|
§digest-requiem **A requiem is an out-of-band forensic interview, not a worker
|
|
3935
3885
|
turn.** It cannot execute operations or alter the audited history.
|
|
@@ -3937,13 +3887,27 @@ turn.** It cannot execute operations or alter the audited history.
|
|
|
3937
3887
|
| Aspect | Contract |
|
|
3938
3888
|
|-----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
3939
3889
|
| Scope | One interview for each worker with model-bearing inference turns; workers without inference evidence are omitted. |
|
|
3940
|
-
| Evidence | The worker's final packet plus every attempt's exact normalized response and admission evidence; opaque raw transport remains in durable forensic artifacts. |
|
|
3890
|
+
| Evidence | The worker's final packet plus every attempt's exact normalized response and admission evidence; opaque raw transport remains in durable forensic artifacts. Quoted evidence is budgeted to the witness window ({§digest-requiem-evidence-budget}). |
|
|
3941
3891
|
| Witness | An explicitly supplied provider or the active configured provider; absence fails hard. |
|
|
3942
3892
|
| Identity | The worker's durable provider identity ({§worker-provider-identity}) is sent as both `workerId` and `primaryWorkerId`, making the synthetic interview its own root without asserting a live worker topology. |
|
|
3943
3893
|
| Attempts | One call at `PLURNK_SERVICE_REQUIEM_MAX_TOKENS`; only an empty length-limited response receives one retry at `PLURNK_SERVICE_REQUIEM_RETRY_MAX_TOKENS`. |
|
|
3944
3894
|
| Artifacts | `requiem.md` carries testimony and exact nullable USD accounting. `requiem.json` is durably materialized before each call and preserves logical call state, messages, normalized responses, every physical request's state and accounting, and their shared aggregate projection. |
|
|
3945
3895
|
|
|
3946
|
-
§
|
|
3896
|
+
§digest-requiem-evidence-budget **Quoted evidence fits the witness.** The
|
|
3897
|
+
interview's user message is budgeted against the witness provider's context
|
|
3898
|
+
window minus the retry output allowance and system framing (chars/2, the
|
|
3899
|
+
capacity gate's own estimator). Overflow elides the oldest provider attempts
|
|
3900
|
+
behind an explicit `elidedOldestAttempts` count marker, never silently; the
|
|
3901
|
+
final packet and the newest attempts always testify. A windowless witness
|
|
3902
|
+
(`contextWindow` null) quotes unbudgeted.
|
|
3903
|
+
|
|
3904
|
+
§turn-lifecycle **Turn-lifecycle liveness.** Provider generation is the long, opaque window in a turn — one or more same-packet emission attempts may occur before the first committed op. A static client screen there is indistinguishable from a hang. The engine brackets the complete attempt window with two `notice/event` notices (`source: "engine:turn"`, `level: "info"`): `turn_awaiting_model` before the first call and `turn_generated` when an emission is accepted or the attempt budget is exhausted. The completion beat carries the spend ({§turn-accounting-notice}). Rejected content never rides the notice channel. Both are suppressed on an aborted loop and broadcast to the workspace like any notice ({§notice-event-notify}).
|
|
3905
|
+
|
|
3906
|
+
§turn-accounting-notice **The completion beat carries the spend.** `turn_generated`
|
|
3907
|
+
carries the turn's exact settled wire accounting — request count, exact nullable
|
|
3908
|
+
USD, and token totals across every physical exchange the turn paid for, failed
|
|
3909
|
+
calls included. It is the shared exact derivation from the ledger, never a second
|
|
3910
|
+
stored fact, so a live watcher accrues running loop cost per turn (#465).
|
|
3947
3911
|
|
|
3948
3912
|
§notice-content-offset-pointer **Content-offset position.** A non-fatal diagnosis on an accepted emission (for example `grammar_unenforced` or `parse_advisory`) carries `position: { type: "content-offset", line, column }` into the model's own folded `turnOps`. A bounded hard parse error becomes a durable failed operation whose Problem Details preserve its line, column, source, and parser-owned diagnostic. Hard errors that make the frame untrustworthy remain only with their rejected forensic attempt.
|
|
3949
3913
|
|
|
@@ -4162,11 +4126,7 @@ unstaged, `untracked members` — each path with the inclusion pattern that admi
|
|
|
4162
4126
|
`created` for a creation record — and `untracked (not members)`, named because such a
|
|
4163
4127
|
file is not a member ({§membership-baseline}) and a human must `git add` it or add a
|
|
4164
4128
|
members definition before the model can read it. The section never contradicts the
|
|
4165
|
-
catalog: an untracked file a definition admits is named as the member it is. The
|
|
4166
|
-
active direct child of a running branch batch additionally receives its assigned
|
|
4167
|
-
branch and the requirement to commit any project changes and leave the checkout
|
|
4168
|
-
clean before concluding ({§worker-branch-batch-return}); no other worker receives
|
|
4169
|
-
that instruction. The section never carries an unbounded path list. Per-path state belongs to
|
|
4129
|
+
catalog: an untracked file a definition admits is named as the member it is. The section never carries an unbounded path list. Per-path state belongs to
|
|
4170
4130
|
the runtime actor's durable causal evidence: its `source=file` row carries
|
|
4171
4131
|
the exact two-character porcelain `XY` value as `git` metadata when the status
|
|
4172
4132
|
snapshot names that path. The engine takes one snapshot after membership
|
package/dist/build-info.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"package":"@plurnk/plurnk-service","version":"1.
|
|
1
|
+
{"package":"@plurnk/plurnk-service","version":"1.14.0","revision":"6abb3ba2d9236ebbcfb6cd84261c76b725573505","dirty":false}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matcher.d.ts","sourceRoot":"","sources":["../../src/content/matcher.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAEH,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,cAAc,EACtB,MAAM,wBAAwB,CAAC;AAGhC,YAAY,EAAE,WAAW,EAAE,CAAC;AAE5B,MAAM,CAAC,OAAO,OAAO,OAAO;IACxB,OAAa,mBAAmB,CAC5B,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,SAAS,GACrB,OAAO,CAAC,WAAW,CAAC,CAMtB;IAUD,OAAa,eAAe,CACxB,IAAI,EAAE,WAAW,EACjB,UAAU,EAAE,aAAa,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;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MAAM,WAAW,cAAc;IAAG,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,aAAa,EAAE,CAAC;CAAE;AAG1E,MAAM,WAAW,oBAAoB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACpD,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
package/dist/content/matcher.js
CHANGED
|
@@ -31,7 +31,27 @@ export default class Matcher {
|
|
|
31
31
|
let queryable = 0;
|
|
32
32
|
let unsupported;
|
|
33
33
|
for (const cand of candidates) {
|
|
34
|
-
|
|
34
|
+
// {§find-candidate-containment} (#449) — arbitrary member content can crash a
|
|
35
|
+
// mimetype handler (a template partial crashed Readability and killed a
|
|
36
|
+
// 1,916-file FIND as a blank 500). One candidate's crash is that candidate's
|
|
37
|
+
// unqueryability, never the operation's: it drops out like unsupported
|
|
38
|
+
// content, the cause goes to daemon stderr, and only an all-crash FIND
|
|
39
|
+
// reports the 415.
|
|
40
|
+
let match;
|
|
41
|
+
try {
|
|
42
|
+
match = await Matcher.matchAgainstContent(body, cand.content, cand.mimetype, mimetypes);
|
|
43
|
+
}
|
|
44
|
+
catch (cause) {
|
|
45
|
+
console.error(`FIND candidate ${cand.key} (${cand.mimetype}) content handler crashed:`, cause);
|
|
46
|
+
unsupported ??= {
|
|
47
|
+
type: "https://problems.plurnk.xyz/mimetypes/handler-crashed",
|
|
48
|
+
title: "Content handler crashed",
|
|
49
|
+
status: 415,
|
|
50
|
+
detail: `The ${cand.mimetype} content handler failed on ${cand.key}: `
|
|
51
|
+
+ (cause instanceof Error ? cause.message : String(cause)),
|
|
52
|
+
};
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
35
55
|
if (match.status === 415) {
|
|
36
56
|
if (match.problem === undefined) {
|
|
37
57
|
throw new Error("Matcher.matchCandidates: status 415 has no Problem Details");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matcher.js","sourceRoot":"","sources":["../../src/content/matcher.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,8EAA8E;AAC9E,8EAA8E;AAC9E,iDAAiD;AACjD,EAAE;AACF,sFAAsF;AACtF,yFAAyF;AACzF,oEAAoE;AAGpE,OAAO,EAAE,eAAe,EAAkB,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EACH,OAAO,IAAI,aAAa,GAI3B,MAAM,wBAAwB,CAAC;AAChC,OAAO,WAAW,MAAM,wBAAwB,CAAC;AAIjD,MAAM,CAAC,OAAO,OAAO,OAAO;IACxB,MAAM,CAAC,KAAK,CAAC,mBAAmB,CAC5B,IAAiB,EACjB,OAAe,EACf,QAAgB,EAChB,SAAoB;QAEpB,sEAAsE;QACtE,uEAAuE;QACvE,mEAAmE;QACnE,IAAI,IAAI,CAAC,OAAO,KAAK,UAAU,IAAI,IAAI,CAAC,OAAO,KAAK,OAAO;YAAE,MAAM,IAAI,KAAK,CAAC,wCAAwC,IAAI,CAAC,OAAO,4BAA4B,CAAC,CAAC;QAC/J,OAAO,aAAa,CAAC,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IACtG,CAAC;IAED,4FAA4F;IAC5F,8EAA8E;IAC9E,0EAA0E;IAC1E,4DAA4D;IAC5D,4FAA4F;IAC5F,0EAA0E;IAC1E,yEAAyE;IACzE,8BAA8B;IAC9B,MAAM,CAAC,KAAK,CAAC,eAAe,CACxB,IAAiB,EACjB,UAA6E,EAC7E,SAAoB;QAEpB,MAAM,OAAO,GAAqB,EAAE,CAAC;QACrC,IAAI,SAAS,GAAG,CAAC,CAAC;QAClB,IAAI,WAAuC,CAAC;QAC5C,KAAK,MAAM,IAAI,IAAI,UAAU,EAAE,CAAC;YAC5B,
|
|
1
|
+
{"version":3,"file":"matcher.js","sourceRoot":"","sources":["../../src/content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C;CACJ"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Db } from "./Db.ts";
|
|
2
|
-
import type { LoopPolicy
|
|
2
|
+
import type { LoopPolicy } from "./types.ts";
|
|
3
3
|
import { type ChannelProducerResult, type ChannelState, type SchemeResult } from "@plurnk/plurnk-schemes";
|
|
4
4
|
import type { Notice } from "@plurnk/plurnk-contracts";
|
|
5
5
|
export type { ChannelState } from "@plurnk/plurnk-schemes";
|
|
@@ -47,22 +47,6 @@ export type InjectWorkerNotify = (args: {
|
|
|
47
47
|
action: "injected_next_turn" | "enqueued_new_loop";
|
|
48
48
|
loopId: number;
|
|
49
49
|
}>;
|
|
50
|
-
export type BranchWorkerNotify = (args: {
|
|
51
|
-
workspaceId: number;
|
|
52
|
-
parentWorkerId: number;
|
|
53
|
-
parentLoopId: number;
|
|
54
|
-
parentTurnId: number;
|
|
55
|
-
op: "WORK" | "FORK";
|
|
56
|
-
name: string;
|
|
57
|
-
branch: string;
|
|
58
|
-
prompt: string;
|
|
59
|
-
policy: LoopPolicy;
|
|
60
|
-
origin: WriterTier;
|
|
61
|
-
}) => Promise<{
|
|
62
|
-
workerId: number;
|
|
63
|
-
loopId: number;
|
|
64
|
-
}>;
|
|
65
|
-
export type BranchCompletionGate = (workerId: number) => Promise<SchemeResult | null>;
|
|
66
50
|
export type CancelWorkerNotify = (workerId: number, reason: string) => Promise<void>;
|
|
67
51
|
export type CancelDescendantsNotify = (workerId: number, reason: string) => Promise<void>;
|
|
68
52
|
export interface NoticePayload {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChannelWrite.d.ts","sourceRoot":"","sources":["../../src/core/ChannelWrite.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,KAAK,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"ChannelWrite.d.ts","sourceRoot":"","sources":["../../src/core/ChannelWrite.ts"],"names":[],"m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: workerId, entry_id: entryId, scheme, handle,
|
|
63
63
|
poll_seconds: pollSeconds ?? null, turn_scoped: turnScoped ? 1 : 0,
|
|
64
|
-
published_channel: publishedChannel ?? null
|
|
64
|
+
published_channel: publishedChannel ?? null
|
|
65
65
|
});
|
|
66
66
|
if (row === undefined)
|
|
67
67
|
throw new Error("openSubscription: INSERT ... RETURNING produced no row");
|
|
@@ -76,13 +76,13 @@ export default class ChannelWrite {
|
|
|
76
76
|
const published = notify === undefined
|
|
77
77
|
? []
|
|
78
78
|
: await ChannelWrite.#publishedChannelMetaStmt(db).all({
|
|
79
|
-
subscription_id: subscriptionId
|
|
79
|
+
subscription_id: subscriptionId
|
|
80
80
|
});
|
|
81
81
|
const settled = await ChannelWrite.#closeSubStmt(db).run({
|
|
82
82
|
result: JSON.stringify(result),
|
|
83
83
|
status: result.status,
|
|
84
84
|
channel_results: JSON.stringify(exactChannelResults),
|
|
85
|
-
subscription_id: subscriptionId
|
|
85
|
+
subscription_id: subscriptionId
|
|
86
86
|
});
|
|
87
87
|
if (settled.changes === 0 || notify === undefined)
|
|
88
88
|
return;
|
|
@@ -101,7 +101,7 @@ export default class ChannelWrite {
|
|
|
101
101
|
state,
|
|
102
102
|
contentLength: meta.contentLength,
|
|
103
103
|
mimetype: meta.mimetype,
|
|
104
|
-
...coordinate
|
|
104
|
+
...coordinate
|
|
105
105
|
});
|
|
106
106
|
}
|
|
107
107
|
}
|
|
@@ -114,7 +114,7 @@ export default class ChannelWrite {
|
|
|
114
114
|
worker_id: workerId,
|
|
115
115
|
scheme,
|
|
116
116
|
authority,
|
|
117
|
-
pathname
|
|
117
|
+
pathname
|
|
118
118
|
});
|
|
119
119
|
return row?.close_status ?? null;
|
|
120
120
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChannelWrite.js","sourceRoot":"","sources":["../../src/core/ChannelWrite.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,0FAA0F;AAC1F,EAAE;AACF,mFAAmF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
7
7
|
import type ProposalLifecycle from "./ProposalLifecycle.ts";
|
|
8
8
|
import type ClientInteractions from "./ClientInteractions.ts";
|
|
9
9
|
import type { WriterTier, PlurnkSchemeContext } from "./scheme-types.ts";
|
|
10
|
-
import { type StreamEventNotify, type WakeWorkerNotify, type InjectWorkerNotify, type
|
|
10
|
+
import { type StreamEventNotify, type WakeWorkerNotify, type InjectWorkerNotify, type CancelWorkerNotify, type CancelDescendantsNotify } from "./ChannelWrite.ts";
|
|
11
11
|
import type LiveSubscriptions from "./LiveSubscriptions.ts";
|
|
12
12
|
import { type SchemeResult } from "@plurnk/plurnk-schemes";
|
|
13
13
|
import type { ProviderEncryptedReasoningItem } from "@plurnk/plurnk-providers";
|
|
@@ -34,7 +34,7 @@ export interface ResolvedClientEntryAddress {
|
|
|
34
34
|
}
|
|
35
35
|
export default class Dispatcher {
|
|
36
36
|
#private;
|
|
37
|
-
constructor({ db, schemes, mimetypes, weigh, notices, proposals, interactions, executors, loopSignal, settleDerivations, settleVectors, streamEventNotify, wakeWorkerNotify, injectWorker,
|
|
37
|
+
constructor({ db, schemes, mimetypes, weigh, notices, proposals, interactions, executors, loopSignal, settleDerivations, settleVectors, streamEventNotify, wakeWorkerNotify, injectWorker, cancelWorker, cancelDescendants, parkDeadlines, joinTargets, liveSubscriptions, entryAddresses }: {
|
|
38
38
|
db: Db;
|
|
39
39
|
schemes: SchemeRegistry;
|
|
40
40
|
mimetypes: Mimetypes;
|
|
@@ -49,8 +49,6 @@ export default class Dispatcher {
|
|
|
49
49
|
streamEventNotify?: StreamEventNotify;
|
|
50
50
|
wakeWorkerNotify?: WakeWorkerNotify;
|
|
51
51
|
injectWorker?: InjectWorkerNotify;
|
|
52
|
-
branchWorker?: BranchWorkerNotify;
|
|
53
|
-
branchCompletionGate?: BranchCompletionGate;
|
|
54
52
|
cancelWorker?: CancelWorkerNotify;
|
|
55
53
|
cancelDescendants?: CancelDescendantsNotify;
|
|
56
54
|
parkDeadlines?: Map<number, number>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dispatcher.d.ts","sourceRoot":"","sources":["../../src/core/Dispatcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,aAAa,EACb,oBAAoB,EACpB,aAAa,EAMb,UAAU,EAEV,eAAe,EACf,aAAa,EAEhB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAGlC,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,iBAAiB,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,kBAAkB,MAAM,yBAAyB,CAAC;AAQ9D,OAAO,KAAK,EAAkB,UAAU,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAIzF,OAAqB,EAAE,KAAK,iBAAiB,EAAE,KAAK,gBAAgB,EAAE,KAAK,kBAAkB,EAAE,KAAK,kBAAkB,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"Dispatcher.d.ts","sourceRoot":"","sources":["../../src/core/Dispatcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,aAAa,EACb,oBAAoB,EACpB,aAAa,EAMb,UAAU,EAEV,eAAe,EACf,aAAa,EAEhB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAGlC,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,iBAAi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 -72,8 +72,6 @@ class Dispatcher {
|
|
|
72
72
|
#streamEventNotify;
|
|
73
73
|
#wakeWorkerNotify;
|
|
74
74
|
#injectWorker;
|
|
75
|
-
#branchWorker;
|
|
76
|
-
#branchCompletionGate;
|
|
77
75
|
#cancelWorker;
|
|
78
76
|
#cancelDescendants;
|
|
79
77
|
// {§send-premature-terminate}/SEND signal 202 with scope — the engine-owned park-deadline registry (loopId → seconds;
|
|
@@ -86,7 +84,7 @@ class Dispatcher {
|
|
|
86
84
|
#resourceMutations;
|
|
87
85
|
#entryAddresses;
|
|
88
86
|
#capabilities;
|
|
89
|
-
constructor({ db, schemes, mimetypes, weigh, notices, proposals, interactions, executors, loopSignal, settleDerivations, settleVectors, streamEventNotify, wakeWorkerNotify, injectWorker,
|
|
87
|
+
constructor({ db, schemes, mimetypes, weigh, notices, proposals, interactions, executors, loopSignal, settleDerivations, settleVectors, streamEventNotify, wakeWorkerNotify, injectWorker, cancelWorker, cancelDescendants, parkDeadlines, joinTargets, liveSubscriptions, entryAddresses }) {
|
|
90
88
|
this.#db = db;
|
|
91
89
|
this.#schemes = schemes;
|
|
92
90
|
this.#mimetypes = mimetypes;
|
|
@@ -101,8 +99,6 @@ class Dispatcher {
|
|
|
101
99
|
this.#streamEventNotify = streamEventNotify;
|
|
102
100
|
this.#wakeWorkerNotify = wakeWorkerNotify;
|
|
103
101
|
this.#injectWorker = injectWorker;
|
|
104
|
-
this.#branchWorker = branchWorker;
|
|
105
|
-
this.#branchCompletionGate = branchCompletionGate;
|
|
106
102
|
this.#cancelWorker = cancelWorker;
|
|
107
103
|
this.#cancelDescendants = cancelDescendants;
|
|
108
104
|
this.#parkDeadlines = parkDeadlines ?? new Map();
|
|
@@ -767,36 +763,16 @@ class Dispatcher {
|
|
|
767
763
|
if (live !== undefined) {
|
|
768
764
|
return _a.#failure("worker-already-running", 409, `Worker '${name}' is already running.`, {}, { worker: name, retryable: false });
|
|
769
765
|
}
|
|
770
|
-
if (
|
|
771
|
-
// {§
|
|
772
|
-
//
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
});
|
|
780
|
-
}
|
|
781
|
-
if (this.#branchWorker === undefined)
|
|
782
|
-
throw new Error("branch worker control: branchWorker capability absent");
|
|
783
|
-
const child = await this.#branchWorker({
|
|
784
|
-
workspaceId: ctx.workspaceId,
|
|
785
|
-
parentWorkerId: ctx.workerId,
|
|
786
|
-
parentLoopId: ctx.loopId,
|
|
787
|
-
parentTurnId: ctx.turnId,
|
|
788
|
-
op: statement.op,
|
|
789
|
-
name,
|
|
790
|
-
branch: statement.signal,
|
|
791
|
-
prompt,
|
|
792
|
-
policy: delegationPolicy,
|
|
793
|
-
origin: ctx.writer,
|
|
766
|
+
if (statement.signal !== null && statement.signal !== undefined) {
|
|
767
|
+
// {§worker-spawn-no-signal} (#396) — WORK/FORK take no signal. Branch
|
|
768
|
+
// delegation was removed outright; a model manages git branches through
|
|
769
|
+
// ordinary EXEC git, taught by the git skill, never engine machinery.
|
|
770
|
+
return _a.#failure("worker-signal-invalid", 400, `${statement.op} takes no signal.`, {}, {
|
|
771
|
+
worker: name,
|
|
772
|
+
signal: statement.signal,
|
|
773
|
+
recovery: `Spawn without a signal: \`## ${statement.op}0 (worker://${name})\` with the prompt as the body.`,
|
|
774
|
+
retryable: false,
|
|
794
775
|
});
|
|
795
|
-
return {
|
|
796
|
-
status: 200,
|
|
797
|
-
body: name,
|
|
798
|
-
attrs: { branch: statement.signal, workerId: child.workerId, loopId: child.loopId },
|
|
799
|
-
};
|
|
800
776
|
}
|
|
801
777
|
if (statement.op === "FORK") {
|
|
802
778
|
// Branch the current worker's log into a named sister.
|
|
@@ -1156,9 +1132,6 @@ class Dispatcher {
|
|
|
1156
1132
|
const failCount = await this.#unobservedFailureCount(turnId);
|
|
1157
1133
|
if (failCount > 0)
|
|
1158
1134
|
return _a.#unobservedFailures(failCount);
|
|
1159
|
-
const branchDenial = await this.#branchCompletionGate?.(workerId) ?? null;
|
|
1160
|
-
if (branchDenial !== null)
|
|
1161
|
-
return branchDenial;
|
|
1162
1135
|
// The joined set is already drained. Awaiting an empty task group completes
|
|
1163
1136
|
// immediately; it never parks and needs no corrective model turn.
|
|
1164
1137
|
const finished = await this.#lifecycle.finish(loopId, TerminalResult.success(raw));
|
|
@@ -1200,17 +1173,11 @@ class Dispatcher {
|
|
|
1200
1173
|
retryable: false,
|
|
1201
1174
|
});
|
|
1202
1175
|
}
|
|
1203
|
-
const branchDenial = await this.#branchCompletionGate?.(workerId) ?? null;
|
|
1204
|
-
if (branchDenial !== null)
|
|
1205
|
-
return branchDenial;
|
|
1206
1176
|
}
|
|
1207
1177
|
const finished = await this.#lifecycle.finish(loopId, TerminalResult.success(raw));
|
|
1208
1178
|
return _a.#statusResult(finished !== null ? 200 : await this.#lifecycle.status(loopId), "loop-already-terminal", "The loop was already terminal when SEND attempted to conclude it.");
|
|
1209
1179
|
}
|
|
1210
1180
|
if (status === 499) {
|
|
1211
|
-
const branchDenial = await this.#branchCompletionGate?.(workerId) ?? null;
|
|
1212
|
-
if (branchDenial !== null)
|
|
1213
|
-
return branchDenial;
|
|
1214
1181
|
const reason = raw === "" ? null : ErrorDetail.preview(raw);
|
|
1215
1182
|
const failure = _a.#failure("scope-abandoned", 499, "The worker ended its scope with SEND[499].", {}, {
|
|
1216
1183
|
...(reason === null ? {} : { reason }),
|