@tnunamak/dalan 0.8.1 → 0.8.3
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/CHANGELOG.md +61 -2
- package/CONTRIBUTING.md +2 -0
- package/README.md +8 -12
- package/bin/dalan.mjs +25 -4
- package/bin/dot-acp-agent.mjs +572 -76
- package/bin/dot-alert.mjs +9 -3
- package/bin/dot-deadman.mjs +3 -1
- package/bin/dot-heartbeat.mjs +14 -7
- package/bin/dot-pr-reviewer.mjs +3 -31
- package/bin/dot-worker.mjs +121 -34
- package/contracts/adapter-qualification.schema.json +94 -7
- package/docs/chatgpt-worker-onboarding.md +1 -1
- package/docs/codex-to-muse.md +2 -2
- package/docs/connect-chatgpt.md +1 -1
- package/docs/connection-longevity.md +2 -2
- package/docs/dalan-upgrade.md +8 -5
- package/docs/deadman.md +4 -0
- package/docs/design/authority-matrix.md +18 -0
- package/docs/design/failure-table.md +87 -0
- package/docs/design/identities.md +22 -0
- package/docs/design/pnpm-prepared-dependencies.md +64 -0
- package/docs/design/reuse-ledger.md +75 -0
- package/docs/design/target-architecture-v2.md +434 -0
- package/docs/local-agent-mcp.md +14 -0
- package/docs/local-agent-requester.md +2 -1
- package/docs/manual-setup.md +1 -1
- package/docs/operations.md +77 -14
- package/docs/pull-workers.md +11 -1
- package/docs/service-setup.md +10 -10
- package/docs/t3-integration.md +4 -2
- package/docs/t3-reverse-control.md +5 -5
- package/docs/test-suite-isolation.md +7 -6
- package/docs/trials/chatgpt-agent.md +47 -0
- package/docs/trials/claude-code-requester.md +68 -0
- package/docs/trials/muse.md +46 -0
- package/docs/usage.md +21 -7
- package/docs/worker-clients.md +1 -1
- package/integrations/t3/acp-kit/src/errors.mjs +6 -2
- package/integrations/t3/acp-kit/src/lock.mjs +46 -17
- package/integrations/t3/acp-kit/src/session-store.mjs +15 -3
- package/integrations/t3/acp-kit/src/t3-envelope.mjs +10 -2
- package/package.json +4 -3
- package/packages/job-core/protocol/canonical.mjs +45 -7
- package/packages/job-core/transitions.mjs +4 -2
- package/scripts/upgrade-drain.mjs +96 -8
- package/scripts/worker-bridge-setup.mjs +215 -120
- package/src/ack-ledger.mjs +7 -1
- package/src/acp-bridge.mjs +256 -28
- package/src/admin-socket.mjs +32 -3
- package/src/alerts.mjs +17 -8
- package/src/answer-journal-retention.mjs +82 -0
- package/src/answer-journal.mjs +6 -4
- package/src/as-store.mjs +51 -6
- package/src/as.mjs +27 -5
- package/src/catalog-switch-inventory.mjs +70 -0
- package/src/check-response.mjs +4 -1
- package/src/cli-help.mjs +14 -3
- package/src/cli-name.mjs +13 -1
- package/src/connect-cli.mjs +159 -4
- package/src/deadman.mjs +8 -5
- package/src/delivery.mjs +2 -19
- package/src/destinations/index.mjs +75 -14
- package/src/drain-runner.mjs +5 -1
- package/src/follow-current.mjs +3 -1
- package/src/get-summary.mjs +11 -2
- package/src/git-env.mjs +1 -1
- package/src/gozar-routes.mjs +313 -94
- package/src/host-budget-storage.py +56 -6
- package/src/host-budget.mjs +98 -15
- package/src/host-execution-policy.mjs +17 -6
- package/src/legacy-names.mjs +0 -2
- package/src/lifecycle.mjs +44 -9
- package/src/loopback-probe.mjs +46 -0
- package/src/mcp-outcome.mjs +3 -1
- package/src/mcp-sse.mjs +2 -1
- package/src/mcp-stdio.mjs +192 -30
- package/src/patch-apply.mjs +212 -7
- package/src/phase-trace.mjs +73 -0
- package/src/prepared-go-modules.mjs +127 -0
- package/src/prepared-node-modules.mjs +225 -38
- package/src/prepared-pnpm.mjs +276 -0
- package/src/prepared-store-prune.mjs +52 -0
- package/src/projects.mjs +59 -7
- package/src/protocol-artifact-commands.mjs +28 -0
- package/src/protocol-finish.mjs +3 -2
- package/src/publication-authority.mjs +22 -0
- package/src/publish-plan.mjs +2 -2
- package/src/pull-queue.mjs +55 -20
- package/src/read-api.mjs +127 -0
- package/src/redaction.mjs +173 -0
- package/src/rejections.mjs +19 -3
- package/src/route-custody.mjs +90 -0
- package/src/route-publication.mjs +50 -0
- package/src/route-setup.mjs +184 -0
- package/src/schema-subset.mjs +5 -3
- package/src/server.mjs +503 -98
- package/src/service-launchd.mjs +5 -1
- package/src/service-update-lock.mjs +7 -4
- package/src/service-update-runtime.mjs +136 -21
- package/src/service-update.mjs +207 -51
- package/src/service.mjs +276 -77
- package/src/setup.mjs +48 -25
- package/src/signal.mjs +1 -1
- package/src/status-evidence.mjs +18 -5
- package/src/store.mjs +876 -120
- package/src/submission-policy.mjs +257 -56
- package/src/t3-control.mjs +1 -1
- package/src/t3.mjs +14 -8
- package/src/terminal-safe.mjs +9 -7
- package/src/tool-registry.mjs +134 -41
- package/src/try-exposure.mjs +53 -86
- package/src/try-hosted.mjs +257 -70
- package/src/try.mjs +48 -22
- package/src/work-order.mjs +11 -6
- package/src/worker-instructions.mjs +26 -4
- package/src/worker-runs.mjs +35 -0
- package/src/workers.mjs +34 -7
- package/src/workspace.mjs +354 -54
- package/systemd/dot-deadman.service +3 -1
- package/docs/dot-pr-reviewer.config.example.json +0 -9
- package/docs/pr-head-reviewer.md +0 -70
- package/src/pr-head-reviewer.mjs +0 -596
- package/systemd/dot-pr-reviewer.service +0 -11
- package/systemd/dot-pr-reviewer.timer +0 -10
|
@@ -0,0 +1,434 @@
|
|
|
1
|
+
# Dalan target architecture v2: remote workers as native subagents
|
|
2
|
+
|
|
3
|
+
Status: frozen for build, 2026-11-27, after three independent reviews (one ChatGPT worker review, two Muse reviews: design, and separation plus consumers) and two source reads of T3. It supersedes the slice plans (the R4-R9 route decision and the A-D PR graph) where they conflict. It keeps the core ideas of the 2026-11-14 target architecture: separate relationship, work and authority, durable delivery, and host-neutral core.
|
|
4
|
+
|
|
5
|
+
## 1. The bar
|
|
6
|
+
|
|
7
|
+
An orchestrating agent (Claude Code, Codex, or a T3 Code thread running either) already knows how to use a subagent. It makes one call with a task, it may end its turn, and a native completion notice wakes it later with the result. Dalan's bar is **parity with that, from the caller's view**. Each difference that a caller can see is a gap that Dalan closes or names.
|
|
8
|
+
|
|
9
|
+
Dalan is the bridge only: relationships, work, authority, delivery and wake, worker capability, and the surface that requester agents call. Job generators, filler queues and fleet nudges are tooling on top of Dalan. They adopt Dalan; they are not part of it.
|
|
10
|
+
|
|
11
|
+
The bar has three parts, judged separately:
|
|
12
|
+
- **Live initial delegation**: call, forecast, completion wake and result while both host and facade stay up. The first v2 release must reach parity here.
|
|
13
|
+
- **Recovery parity**: the result after a host or facade restart. v2 makes the result durable and its status truthful, and finishes the original task through T3's own restart continuation. That claim waits for the P1 crash probes (section 10).
|
|
14
|
+
- **Interaction parity**: questions, corrections and cancel. v2 makes each one structured and honestly reported. Where the host cannot show it natively, the table below names the gap.
|
|
15
|
+
|
|
16
|
+
### 1.1 Parity table (caller's view)
|
|
17
|
+
|
|
18
|
+
Reference: a Claude Code `Agent` subagent or a Codex `spawn_agent` child. Gap kinds:
|
|
19
|
+
- **V2**: v2 closes it.
|
|
20
|
+
- **NATIVE**: it closes through a native protocol route once the host supports it. Until then a versioned adapter supplies it and is listed in section 9.
|
|
21
|
+
- **SHARED**: a provider limit that native subagents also have in some form. Dalan does not work around it. It reports the limit as an honest status the caller can see, the way a subagent's rate-limit error is visible.
|
|
22
|
+
- **BY DESIGN**: a deliberate difference that follows from the safety line or from the worker running elsewhere. Dalan states it at the call.
|
|
23
|
+
|
|
24
|
+
| # | Property | Native subagent | Dalan worker on main (d0dd670) | Gap kind | v2 |
|
|
25
|
+
|---|---|---|---|---|---|
|
|
26
|
+
| 1 | How you call it | One tool call: prompt, model or target, isolation, background | T3: `delegate_task target:{providerInstanceId:"dot"}` already reaches Dalan through `bin/dot-acp-agent.mjs`; 3 of about 30,000 jobs in 7 days used it. CLI: `dalan submit` with about 20 flags. MCP `dalan_submit`: 6 fields, no delivery, no kind. The facade never gives the parent the work id; it appears only in a thought chunk. | V2 | Each host's own subagent call (section 4). The same work fields on every route: task, priority class, requirements, repo, base. The child's first agent message gives the work id, so the parent always holds a durable handle (`dalan get <id>`). |
|
|
27
|
+
| 2 | Answer at submit | Starts at once, or fails at once (rate limit) | `queued`. Queue-wait data exists (`src/store.mjs#queueWaitEvidence`) but is used only for `valid_until`. | V2 | Measured admission: `starts now` only with a reserved lane and a live worker; otherwise `queued` with measured claim and start latencies, and the count and age of eligible work ahead. The parent decides from that answer whether to wait or cancel and route elsewhere. Also the per-kind track record (section 6). |
|
|
28
|
+
| 3 | Wake on result | Native completion notice in a later turn; caller may end its turn | T3 only, as a user-role chat message into the parent; protected threads suppress it. A background `dalan wait` dies with the turn or with T3. | V2 (T3, Claude Code); NATIVE (Codex CLI) | The host's own child-completion path; never chat in a main thread (section 5). |
|
|
29
|
+
| 4 | Wake on question | Claude Code: no questions from subagents (`AskUserQuestion` removed); permission prompts surface in the main session. T3: a child raises a `user_input` runtime request; T3 wakes the parent, which reads and answers it with `t3_pending_request`. | `ask_question` exists with keyed answers (#38) and purpose (#32). The pinned ACP facade renders a question as text and ends the turn (`bin/dot-acp-agent.mjs#waitLoop`). T3 then marks the delegated task `completed` with the question as its summary, wakes the parent with a completion, and cancels any queued question wake for the settled task. A later message to the child is filed as an unsent steering note (`bin/dot-acp-agent.mjs#session.prompt`, historical behavior), so the Dalan job waits for an answer until it expires. On the legacy route the question reaches T3 as chat carrying a `dalan answer` command. | V2 | The facade raises the question as an ACP permission or elicitation request while the child turn is still held. T3 turns it into a native `user_input` runtime request and wakes the parent (as its own fixture `acp_titled_multiselect` shows). The parent answers with `t3_pending_request`, typed by request id, so there is no answer-or-correction guess from free text. The facade writes the response to the keyed answer journal before it acknowledges the request. The question carries work id, question id, purpose and expected respondent. A `human_decision` question is never answered this way; the facade says so. Probe P5 confirms the path with a fake provider. |
|
|
30
|
+
| 5 | Correct running work | `SendMessage` to the agent; T3 `t3_thread_send` steer | `note` only. While the child turn is held, the facade rejects a second prompt (`prompt already active`, `bin/dot-acp-agent.mjs#prompt already active`). | V2 for the operation; NATIVE for steering a held child | One `correct` operation on every route, built on the existing successor link (`--revises`, `supersedes`). It applies in place only where a worker runtime can take it (none today). In T3, steering a held ACP child is unprobed: until it is, the parent corrects through `dalan correct <id>` or the MCP verb, and the facade says so. |
|
|
31
|
+
| 6 | Cancel | `TaskStop`, `interrupt_agent`, `task_cancel` | The ACP facade maps T3 cancel to `cancel`, which withdraws only unclaimed work. Claimed work keeps running with `delivery: none`, and the parent has no work id to fetch it (`bin/dot-acp-agent.mjs#cancelPending`) | V2 for the stop request and the report; SHARED for a mid-step stop | The facade calls the real cancel for claimed work too. It reports two facts separately: `requester_interrupted` (the child turn stopped) and the worker's state (`withdrawn`, `stop_requested`, or `still_running` with the work id). A hosted worker cannot always be stopped mid-step (C4 #40 already records this). |
|
|
32
|
+
| 7 | Streaming progress | Claude Code shows the subagent's transcript; T3 shows the child thread live | `progress` events stored; the ACP facade sends heartbeats; little reaches the caller | V2 | Facade relays the worker's `progress` and `ack_message` events as child-thread agent messages (visible, never a wake). |
|
|
33
|
+
| 8 | Tool and repo access | The caller's own tools, files and credentials (scoped by permission mode) | `read_file`, `apply_patch`, allowlisted `run_check`; files named like `auth` or `token` refuse the whole job | V2 for repo access; SHARED for the worker's own tool set | The worker uses its own computer and its own tools: a public repo at `base`, or for a private repo the scoped file set with a manifest (section 7.1). Secrets never reach it; a hard secret file is left out of the file set instead of refusing the job. The worker's own tool policy is the provider's. |
|
|
34
|
+
| 9 | Running code and tests | Shell in the caller's environment | No shell. In the 7 days to 2026-11-27 04:56 UTC, 6,875 of 6,989 build jobs (98.4%) had no passing check; 1,961 of them reported a blocked check, test or build (before-measures snapshot of the live store) | V2 where the worker has a computer; SHARED where the provider withholds a shell or network | The worker runs code on its own computer and reports `worker_reported` evidence; Dalan can add `bridge_observed` checks on the materialized branch. |
|
|
35
|
+
| 10 | Result shape | Text plus files in the shared worktree or an isolated worktree branch | A patch in a bridge workspace; fleet tooling turns it into a branch | V2 | Inside the owner's standing push grant: a `dalan/<work-id>` branch and a draft PR, opened with no further prompt, plus evidence. Outside it: the patch plus evidence, with no push (section 7.3). |
|
|
36
|
+
| 11 | Recovery after a crash | Claude Code: an in-process subagent dies with the process; the transcript is resumable. T3: delegated tasks and completions persist. | Store and outbox persist; the ACP turn dies with T3. The facade clears its saved pointer on finish (`bin/dot-acp-agent.mjs#saveSession`), so a fresh prompt to the child starts a new acquire instead of replaying the result (`bin/dot-acp-agent.mjs#session.prompt`, historical behavior). | V2 | Work and its terminal event persist in Dalan. On T3's restart continuation (`session/load`), the facade reattaches and finishes the original task, so the parent is woken natively. When T3 does not continue the run, the result waits in the recovery inbox and `status` says so. Claimed only after the P1 crash probes pass (sections 4.1, 10). |
|
|
37
|
+
| 12 | Rate limits and breaks | The provider's error is visible to the caller at once | The worker goes quiet; jobs sit queued. After 10 minutes on a break the facade fails the child turn with a provider error while the job continues ("usage break exceeded the turn wait limit") | SHARED | Status, not a workaround: `worker_state: break (until T)` in the admission answer, and a child message when an accepted job is delayed by a break. The child turn stays held through a break; a break never fails it. |
|
|
38
|
+
| 13 | Provider policy refusals (for example OpenAI Guardian) | The refusal text reaches the caller | Often a blocked result with little reason | SHARED | The worker's refusal is passed through verbatim as `outcome: refused_by_provider`. |
|
|
39
|
+
| 14 | Session length | Context limits and compaction | Hosted sessions end after minutes (Muse about 7-10 min) | SHARED | Shown in the track record and admission answer (`typical session ~N min`). Work is sized by the caller, as with a subagent. |
|
|
40
|
+
| 15 | Output quality | Varies by model | Varies by worker | SHARED | Shown as the per-kind track record: accepted, checks passed, n. |
|
|
41
|
+
| 16 | Uncommitted work | Shares the caller's checkout, dirty or not | The worker sees the pushed `base` only. A dirty checkout gets a brief-only note or a packed diff against an origin ancestor; a build from a dirty tree is refused (`BUILD_NEEDS_PUSHED`, `src/acp-bridge.mjs`) | BY DESIGN | The work runs on another computer against a pushed SHA. The facade says so in the admission answer and names what the worker will not see. |
|
|
42
|
+
| 17 | Cost and spend | The caller's own plan; visible in its own usage view | Invisible to the caller | BY DESIGN | The worker's spend belongs to the worker's host. The caller sees `worker_state` (live, break, no subscription) and the track record, not a budget. |
|
|
43
|
+
|
|
44
|
+
## 2. What stays, changes or goes from main
|
|
45
|
+
|
|
46
|
+
| Item on main | Verdict | Why |
|
|
47
|
+
|---|---|---|
|
|
48
|
+
| Store: jobs, claims, epochs, receipts, outbox, lifecycle events | **Stays** (core) | Durable, tested, host-neutral. |
|
|
49
|
+
| C2 #33: relationship, work and authority lifetimes | **Stays** (core) | The enduring separation. Relationships gain a `requester_route` column (section 4). |
|
|
50
|
+
| #38 keyed answer journal | **Stays** (core) | Exactly-once answer across a crash. The T3 child route calls it. |
|
|
51
|
+
| #32 question purpose | **Stays** (core) | A `human_decision` question still bypasses the model. |
|
|
52
|
+
| C4 #40 typed control events | **Stays** (core) | `correct` is one operation over the existing successor link (`--revises`, `supersedes`). No new control type is added until a worker runtime can apply a correction in place. |
|
|
53
|
+
| B5 MCP `dalan_answer` and `dalan_questions` | **Stays**, and grows | `dalan mcp` already has `dalan_submit`, `dalan_wait`, `dalan_status`, `dalan_result`, `dalan_questions` and `dalan_answer`. New: `dalan_forecast`, `dalan_correct`, `dalan_cancel`, `dalan_accept`, and the full work fields on submit. The CLI gains `forecast` and `correct` (section 4.2). |
|
|
54
|
+
| #36 wake hold while the parent is interrupted, and the R4 fence | **Changes**: legacy route only | On the child-task route, T3 owns the parent lifecycle and the wake. Dalan stops reading parent run status for that route. |
|
|
55
|
+
| `--deliver t3:<thread>` user-message wake (`src/destinations/t3.mjs`, `t3-transport.mjs`) | **Changes**: legacy adapter | It stays for callers that cannot use the child route, but it is no longer the default. Its binding checks, protected-thread suppression and uncertain-send state stay (`src/destinations/t3.mjs:60-65, 94-126`). It moves out of the core only after its replacement is verified. |
|
|
56
|
+
| `bin/dot-acp-agent.mjs` T3 ACP facade | **Changes**: becomes the primary T3 adapter | Already registered as T3 providers `dot` and `muse`. It needs: questions raised as ACP permission or elicitation requests while the turn is held (parity row 4); the work id and admission answer as the first agent message; cancel that reaches claimed work and reports requester and worker apart; a held turn through usage breaks; and reattach on `session/load` that finishes the original task from the stored terminal event (section 4.1). |
|
|
57
|
+
| `assignments.thread_id`, `environment_id` NOT NULL; delivery string only `none` or `t3:` | **Changes** | Delivery becomes `{adapter, address, adapter_version}`, with T3 columns moved into the T3 adapter's own table. The core names no host. |
|
|
58
|
+
| Worker catalog `read_file`, `apply_patch`, `run_check` | **Changes**: kept for workers without a computer | A worker with its own computer gets the work as repo, base and task, and returns a branch or patch with evidence. |
|
|
59
|
+
| Host `run_check` allowlist and `scope_paths_read_isolation_unavailable` | **Changes**: becomes acceptance evidence, not the worker's only test route | Owner-side checks still run on the returned branch when configured. They label their evidence `bridge_observed`; the worker's own runs are labeled `worker_reported`. |
|
|
60
|
+
| Name-based refusals (`auth`, `sign*`, `token`, `*secret*` soft names) | **Changes**: soft names stop refusing | Safety is "no secrets, tokens or keys reach a worker". Soft-name matches inside a directory scope are dropped from what ships and noted; they no longer refuse the job. A hard secret path that the caller names explicitly (as a scope, output, diff or patch path) still refuses the job (`inspectPath`, `src/submission-policy.mjs`): the caller asked for a secret file. A soft-name file the caller names explicitly also still refuses, because the content scan misses secrets in formats it does not know; the refusal names the file and the rule it matched, and says to rename or redact the file. The exclusion, symlink and patch-authorization boundary stays (`src/submission-policy.mjs#validateSubmission`, `src/submission-policy.mjs#inspectPath`). Content scanning (`hasSecretContent`) stays as defense in depth, not as proof. |
|
|
61
|
+
| `status.dispatch` scoped to `dot` | **Changes**: per worker | It stays as a simple dispatch diagnostic, keyed by worker name. The admission answer (section 6) does not replace it. |
|
|
62
|
+
| `dalan wait` loops as the wake for non-T3 callers (`docs/local-agent-requester.md`) | **Goes** as the documented wake | It stays as a tool for scripts. Section 4.3 gives native wakes. |
|
|
63
|
+
|
|
64
|
+
## 3. Core model (enduring)
|
|
65
|
+
|
|
66
|
+
The core owns six things, and nothing about any one host.
|
|
67
|
+
|
|
68
|
+
1. **Relationship**: who works for whom, with which route on each side (`requester_route`, `worker_route`) and adapter version.
|
|
69
|
+
2. **Work**: `{task, kind, priority_class, requirements, repo, base, inputs, outputs_expected}`. Priority classes are the stored ones, `normal` and `background`. Requirements are capability names (`shell`, `internet`, `push:<org>`, `tests:<selector>`, `identified_questions`). Admission compares them with qualified worker capabilities and refuses before creating the job, never later.
|
|
70
|
+
3. **Authority**: grants per relationship and per work item. The safety line is a core invariant: **no credential, token or key enters a work payload, a worker tool result, or an artifact the worker can fetch.** Content scanning checks it at submit. Build L5c scans every artifact at download: before the first byte is returned on any route, the whole artifact is checked with the same secret rules, and a hit refuses the download with the rule name only. Until L5c ships, no artifact download carries repository content.
|
|
71
|
+
4. **Events**: the existing lifecycle events per work item (`lifecycleTypes` in `src/lifecycle.mjs`: queued, claimed, working, waiting, blocked, completed, consumed, accepted, integrated, abandoned, cancelled, delivery events) plus the question journal. v2 adds only what it needs: `started` (first substantive worker event) and the stored admission answer. It does not build a second event stream. Delivery is "deliver the events this route subscribes to, keyed by a stable event id, until the host's receipt is observed". Dalan cannot make delivery exactly once in a host that does not deduplicate its key, so an unconfirmed send is recorded as `uncertain` and shown, never silently resent (section 5).
|
|
72
|
+
5. **Evidence**: each claim about the result carries its trust label: `worker_reported` (the worker says so), `bridge_observed` (an owner-side check ran on the materialized result), or `owner_accepted`. A label states who observed the fact, not that the fact is true.
|
|
73
|
+
6. **Measures**: per kind and per worker: queue wait, start latency, outcome rates, check pass rate, acceptance rate, and "could not check my work" rate. Section 8 lists them.
|
|
74
|
+
|
|
75
|
+
Operations, the same on every route: `delegate`, `forecast`, `status`, `result`, `questions`, `answer`, `correct`, `cancel`, `accept|reject`, `artifact`.
|
|
76
|
+
|
|
77
|
+
## 4. Requester routes (versioned, disposable adapters)
|
|
78
|
+
|
|
79
|
+
The rule: **the caller uses the subagent call its host already has.** Dalan supplies an adapter per host. Each adapter states which capabilities it actually delivers (design for the expected capabilities; advertise only the delivered ones).
|
|
80
|
+
|
|
81
|
+
### 4.1 T3 Code child task (primary; covers Claude and Codex threads in T3)
|
|
82
|
+
|
|
83
|
+
- Call: `delegate_task {task, target:{providerInstanceId:"dot"|"muse"|<worker>}, isolation}`. T3 creates a child thread whose agent is Dalan's ACP facade. The parent gets T3's own reply: "Completion wakes this thread."
|
|
84
|
+
- The child turn is held while the work runs. This is right for a child: the long turn is the child's, not the parent's. The parent shows `waiting_for_children`.
|
|
85
|
+
- First message: the facade's first agent message gives the work id and the admission answer (section 6).
|
|
86
|
+
- Completion: the facade ends the child turn with the result summary, branch, PR and evidence. T3 wakes the parent with its native delegate-completion notice. **No chat message reaches the parent thread.**
|
|
87
|
+
- Questions: the facade raises each worker question as an ACP permission or elicitation request while the child turn stays held. T3 creates a `user_input` runtime request and wakes the parent, which reads and answers it with `t3_pending_request` (T3 `DelegatedTaskQuestionReactor.ts`; the shared ACP adapter converts these forms at `packages/provider-acp/src/server/adapter.ts`, 3dbefda28). The facade maps the response, by request id, to the keyed `answer` and stores the receipt before it acknowledges. The turn never ends on a question: a turn that ends is a completion to T3, and T3 cancels question wakes for a settled task. A `human_decision` question is not answerable this way; the facade says so and the question waits for its owner.
|
|
88
|
+
- Priority and requirements: given in the task text header (`priority: normal|background`; `requires: ...`). `target.options` carries only model configuration that the provider advertises (probe P4), so it cannot carry these fields.
|
|
89
|
+
- Cancel: T3 cancel ends the child turn. The facade calls the real cancel for queued and claimed work, and reports `requester_interrupted` and the worker's state separately (parity row 6).
|
|
90
|
+
- Usage breaks: the turn stays held, with a child message that names the break and its expected end.
|
|
91
|
+
- A message to a finished child, or a follow-up delegate, is a new host task with its own task id (T3 `Orchestrator.ts`). It is not part of the original. The facade answers it from the stored terminal event when it names a finished work id, and never starts a new acquire for it.
|
|
92
|
+
- Restart: if T3 or the facade dies mid-turn, the Dalan work continues and its terminal event is stored. T3 marks the interrupted run `cancelled`, then, for eligible runs, submits a restart continuation and calls `session/load` on a provider that advertises it (the facade does). While the continuation is pending, T3 holds the parent with the child task still running. If it completes, the original task completes with its summary and the parent is woken natively; if it is declined or stopped, the task settles as `cancelled` (T3 3dbefda28: `ProviderRuntimeRecoveryService.ts`, `RestartContinuation.ts`, `AcpSessionRuntime.ts`, `OrchestratorMcpService.ts`). The facade's job on `session/load` is to reattach to the stored work and resume the wait, or finish at once from a stored terminal event. When T3 does not continue the run, the result waits in the recovery inbox (`status`, `dalan get <work id>`). Dalan does not send outside messages into the child: it does not know the child thread id, and a run started that way is not owned by the delegated task, so it could double-wake or never wake.
|
|
93
|
+
|
|
94
|
+
### 4.2 MCP requester (any MCP host)
|
|
95
|
+
|
|
96
|
+
`dalan mcp` keeps its six tools and gains four (`dalan_forecast`, `dalan_correct`, `dalan_cancel`, `dalan_accept`) plus every work field on submit. Today the MCP tool is a bounded wait plus result and question operations (`src/mcp-stdio.mjs#TOOLS`, `src/mcp-stdio.mjs#runCli`), not a deferred completion notice. The reply to `dalan_submit` carries the admission answer and a truthful `next` text. By default that text says the caller must check `dalan_status` or `dalan_result` later, or read the inbox. It says "Completion wakes this session" only where a gated wake integration (4.3) is enabled for that host.
|
|
97
|
+
|
|
98
|
+
Native protocol route for MCP hosts: the MCP Tasks extension (`io.modelcontextprotocol/tasks`, SEP-2663, MCP 2026-07-28), an official optional extension. Here `dalan_delegate` returns `resultType: task` instead of a final result. The host polls `tasks/get`, which reports `working`, `input_required`, `completed`, `failed` or `cancelled`. Dalan questions map to keyed `inputRequests`, and the caller's `tasks/update` answer maps to Dalan's keyed answer under the rules in parity row 4. Claude Code documents Tasks support and host polling ([Claude Code MCP docs](https://code.claude.com/docs/en/mcp)). That does not show that a disconnected or idle session wakes. Codex, ChatGPT and Cursor show no verified support as of 2026-11 (research library entry, 2026-11-27). Dalan offers Tasks only when the host negotiates the extension, and describes it as host polling, not a wake.
|
|
99
|
+
|
|
100
|
+
### 4.3 Wakes for hosts outside T3 (gated integrations, not v2 defaults)
|
|
101
|
+
|
|
102
|
+
v2 ships the disposition contract for every host: `status`, `result`, the inbox, and truthful labels for each. An outside wake is an independent integration. Each one gets its own gate (a documented host interface, a probe, and an opt-in setting) and ships separately from v2. v2 does not build these four adapters speculatively. The candidates, as of 2026-11:
|
|
103
|
+
|
|
104
|
+
| Host | Candidate wake | Status |
|
|
105
|
+
|---|---|---|
|
|
106
|
+
| Claude Code session | Cross-session inbox socket (v2.1.224+): "When the receiving session is idle, Claude Code starts a new turn with the message." Gated by `crossSessionInbound` (accept, hold, refuse). | Not on the default path. Messages are plain text between Claude sessions on the same machine; the sender is itself a Claude session. Dalan would not write socket frames: the viable shape is a Claude session (or the SDK route) acting as sender for Dalan. Candidate only after that is documented and probed (P3, off the release path). Default today: the inbox, with an optional SessionStart hook that shows `dalan inbox`. |
|
|
107
|
+
| Claude Code, MCP channels | `notifications/claude/channel` from `dalan mcp` | Research preview; needs a development flag. Not built. |
|
|
108
|
+
| Codex app-server | `turn/start` or `thread/inject_items` on a loaded thread | Unloaded threads cannot be woken. Not built; work waits in the inbox. |
|
|
109
|
+
| Codex CLI alone | None found | Poll, stated honestly. |
|
|
110
|
+
|
|
111
|
+
### 4.4 A2A peer (future)
|
|
112
|
+
|
|
113
|
+
When a peer speaks A2A, Dalan maps A2A task, message and artifact to work, question and artifact, behind a versioned adapter. It is a transport for work and results, not a source of authority: grants still come from the relationship. Nothing in the core changes. Not built in v2; the core must not prevent it.
|
|
114
|
+
|
|
115
|
+
## 5. Delivery and wake rules
|
|
116
|
+
|
|
117
|
+
1. **Deliver on the caller's own path.** For the T3 child route, the child thread and T3's completion are the path. Dalan never posts results as chat into a parent thread on that route, and never posts to a protected parent by default.
|
|
118
|
+
2. **One wake per decision.** Completion, a question, or a refusal wakes the caller. Progress never does.
|
|
119
|
+
3. **Observed receipt or stated uncertainty.** Every delivery has a key built from a stable event id, never from message text. (The T3 destination today keys its acceptance ledger on the item id, the message text and the binding, so a reworded resend is not recognized as the same event; that changes.) A delivery is done only when Dalan observes the host's receipt. If Dalan cannot tell whether the host received it, the delivery is `uncertain` and `status` shows it. A stable local key does not stop a double wake in a host that ignores the key, so Dalan does not resend blindly.
|
|
120
|
+
4. **Reconcile before any retry.** After a Dalan, facade or host restart, Dalan reads the host's own record for the exact terminal event and the stored host task ids before it sends again. A new host task id is stored beside the original, never in its place.
|
|
121
|
+
5. **Inbox is the floor.** If no adapter can wake the caller, the event waits in `dalan inbox`, and `status` says so. That is a valid route, not an error.
|
|
122
|
+
|
|
123
|
+
## 6. Admission, forecast and track record
|
|
124
|
+
|
|
125
|
+
- Priority classes: `normal` (queue, with an estimate) and `background` (queue behind normal), as stored today (`CHECK(priority IN ('normal','background'))`). A start-or-refuse class would need a schema and admission change; v2 does not add one. The parent gets the admission answer within seconds and can cancel and route elsewhere.
|
|
126
|
+
- A free lane or a first claim is not a start. Today `queueWaitEvidence` (`src/store.mjs#queueWaitEvidence`) measures to the first stored claim and uses lower bounds for work that expired unclaimed. v2 measures two latencies: **claimed** (first claim) and **started** (the worker's first substantive event on the work, such as a workspace read or a progress event). Censored samples (expired or cancelled before a claim or a start) are counted in their own group and never mixed into the percentiles.
|
|
127
|
+
- Admission answer, computed before submit with a defined stale-answer policy: `start: "now"` only when Dalan has reserved a lane for this work and the worker's subscription is live at that moment. Otherwise `start: "queued"` with the facts: eligible ready work ahead (count and oldest age, same or higher class), measured claimed and started latencies (p50/p90, n, window, censored count), and the worker state (`live`, `break until T`, `no live subscription`). Below the existing minimum of 5 samples (`QUEUE_WINDOW.minSamples`, `src/store.mjs#QUEUE_WINDOW`) it says `insufficient_history` and gives no number. Lower bounds from work that expired unclaimed are reported as their own group; today they are mixed into the percentiles, which understates waits.
|
|
128
|
+
- Track record, with outcomes kept apart: `unable_to_run`, `checks_failed`, `check_passed`, `landed` (merged or applied by the owner), plus `refused_by_provider`, n and window. "No passing check" is never reported as one blocked number.
|
|
129
|
+
- `status.dispatch` stays as a simple diagnostic beside this answer (section 2).
|
|
130
|
+
- No delegated-agent product shows a reliable ETA (see the prior-art list). Dalan reports only measured values with their basis, so a caller can judge them.
|
|
131
|
+
|
|
132
|
+
## 7. Worker capability (full native ability)
|
|
133
|
+
|
|
134
|
+
### 7.1 Inputs
|
|
135
|
+
|
|
136
|
+
A work item names `repo`, `base` (a pushed SHA, the anchor) and the task. A worker with its own computer clones a public repo itself.
|
|
137
|
+
|
|
138
|
+
For a private repo, Dalan does not ship the whole checkout or any git metadata. A git bundle at `base` cannot leave files out and keep the commit's identity, so it is not used. Dalan ships the scoped file set the relationship permits, through the existing exclusion and symlink rules (`src/submission-policy.mjs#validateSubmission`, `src/submission-policy.mjs#inspectPath`): regular files only, hard secret files left out. A manifest goes with it: each path, its content hash, and the anchor SHA. The manifest is how the owner side later proves which files the patch was written against. That download is an artifact of the work item, not a credential.
|
|
139
|
+
|
|
140
|
+
### 7.2 Outputs
|
|
141
|
+
|
|
142
|
+
A worker returns a patch against the anchor, or, if it can push with its own access to a public repo, a branch and commit. It reports its own test runs as `worker_reported` evidence: command, exit code, and an output tail.
|
|
143
|
+
|
|
144
|
+
### 7.3 Materialize and check
|
|
145
|
+
|
|
146
|
+
The owner side applies the patch to the anchored original commit, never to the worker's snapshot. Dalan first checks that the manifest hashes match the anchor and that the patch touches only permitted paths (the existing patch-authorization boundary, `src/submission-policy.mjs#validateSubmission`). Dalan never gives credentials to the worker and never puts publisher authority into worker execution. The owner's credentials do the push, on the owner's side.
|
|
147
|
+
|
|
148
|
+
Authority to push is a **standing grant** on the relationship (the C2 #33 authority model): the owner names repos or orgs once, for example `materialize: [org:<a>, org:<b>, repo:<c>/<d>]`. Every patch for a repo inside the grant that passes the checks above is pushed to `dalan/<work-id>` and opened as a draft PR, with no prompt per PR. A repo outside the grant gets the patch result only, with no push. An owner who wants to approve each PR can set the grant to `per_pr`; that is an option, not the default. Today `apply_patch` keeps changes local and nothing is pushed (`src/server.mjs#apply_patch`). Build L5 stores the grant in an owner configuration file, `materialize.json` beside `checks.json` (owner-owned, mode 0600, `{"grant": ["org:<a>", "repo:<c>/<d>"], "mode": "standing" | "per_pr"}`), not in the relationship tables: on one computer the owner and the relationship owner are the same person, and a file keeps the grant readable and auditable without a schema change. L5a adds the grant and `dalan materialize ID --dry-run`, which shows the decision and changes nothing; L5b pushes with the owner's own git identity and credential on the owner's computer. A re-run of a job is a new request with a new id, so it gets its own branch and never overwrites an earlier one. The grant covers push and draft PR only. Merge rules stay with the repo owner, and Dalan never merges to a protected branch on its own authority. If the owner configured a check for that repo, Dalan runs it on the materialized branch and records `bridge_observed` evidence.
|
|
149
|
+
|
|
150
|
+
**Checks the requester names (own build item).** A native subagent runs the test it is told to run. Today a worker's `run_check` can run only the owner's or the repository's configured checks (`available_checks`, `src/projects.mjs` and `src/workspace.mjs`), so a brief that names a test cannot be verified in the job, and the result arrives untested. A requester may therefore declare up to 8 test commands at submit, in one closed form (`node <repo-relative .mjs, .js or .cjs file>`, with no flags, shell syntax or environment), validated like any other check argv and refused if the file is sensitive or absent. Each becomes a derived check `named/<n>` that takes its install, budget and prerequisites from the repository's `default` check, and it runs through the same sandbox, receipts and `bridge_observed` evidence. The owner keeps the authority: a named check runs only where the host allowlist permits the pair (repo, `named`). The worker can then iterate on the named tests until they pass before it submits.
|
|
151
|
+
|
|
152
|
+
### 7.4 What a worker may receive
|
|
153
|
+
|
|
154
|
+
Anything in the repos and data the relationship grants, including other people's data where the owner allows it, within the scoped paths of the work. The one hard line: no secrets, tokens or keys. Whole-job refusals by path name go away; the hard secret-file list removes those files from what Dalan ships. Content scanning stays as defense in depth; it is not proof that nothing secret left.
|
|
155
|
+
|
|
156
|
+
## 8. What Dalan reports
|
|
157
|
+
|
|
158
|
+
Dalan reports facts about its own work. Fleet-level measures (delegation share per orchestrator, filler use) belong to the tooling that sits on top. Dalan supplies the fields they need: a `requester` on every work item, and the route that carried it.
|
|
159
|
+
|
|
160
|
+
| Report | Definition | Source |
|
|
161
|
+
|---|---|---|
|
|
162
|
+
| Track record per kind and worker | Separate counts: unable to run, checks failed, check passed, landed, refused by provider; n and window | Lifecycle events and report outcomes (per-kind grouping is being added) |
|
|
163
|
+
| Admission accuracy | For `start: now`: share that started within 5 minutes. For `queued`: stated p50 against actual start | Admission answer stored at submit (new) |
|
|
164
|
+
| Starved minutes | Minutes with queued eligible work and a free, live lane | `lane_utilization.idle_while_queued` exists but is global; per worker is new |
|
|
165
|
+
| Could not check my work | Build results with no passing test run of either evidence label, split into no check run, check failed, and unable to run | Evidence labels (new) |
|
|
166
|
+
| Time to claim, time to start, time to result | p50 and p90 per class and kind; censored samples counted apart | `queue_latency` exists but is global; per class and kind, `started`, and time to result are new |
|
|
167
|
+
| Uncertain deliveries | Deliveries with no observed host receipt | Delivery records (new) |
|
|
168
|
+
| Route share | Work and deliveries per requester route (T3 child, MCP, CLI) and per wake path | `requester_route` and delivery adapter columns (new) |
|
|
169
|
+
|
|
170
|
+
## 9. Workaround ledger
|
|
171
|
+
|
|
172
|
+
Each workaround names the missing capability it supplies and what removes it.
|
|
173
|
+
|
|
174
|
+
| Workaround | Missing capability | Removed when |
|
|
175
|
+
|---|---|---|
|
|
176
|
+
| Child turn held open by the ACP facade for the whole job | ACP v1 has no background work after a prompt turn | ACP v2 background activity ships in T3; the facade then ends the turn and reports later |
|
|
177
|
+
| Recovery inbox when T3 does not continue the run (4.1) | No host API to attach an outside result to the original delegated task. A message to the child is a new host task (T3 `tools.ts`, `OrchestratorMcpService.ts` at 3dbefda28) | T3 offers an outside-completion API for delegated tasks, or ACP v2 session resume with state sync |
|
|
178
|
+
| Questions raised as ACP permission or elicitation requests, answered with `t3_pending_request` | ACP v1 has no agent-initiated question except permission requests. T3 shows a pending question only for a live `user_input` runtime request (`OrchestratorMcpService.ts`). Hosted-worker support for MCP elicitation or Tasks `input_required` is **unprobed**. | MCP Tasks or ACP v2 input requests are supported end to end |
|
|
179
|
+
| Priority and requirements parsed from the task header | `delegate_task` has no priority or requirements field | T3 passes provider options through to ACP, or adds the fields |
|
|
180
|
+
| Admission answer as the child's first message | No host shows a provider's admission answer at delegate time | A host field for provider admission or ETA |
|
|
181
|
+
| Dalan materializes a branch and draft PR under the owner's standing grant | The worker's computer has no git credentials, and Dalan will not supply them | The worker host offers its own scoped repo write (for example, a GitHub app on the worker side) |
|
|
182
|
+
| Scoped file set with a hash manifest for private repos | The worker cannot clone private repos without a credential, and a whole checkout would exceed the scoped grant | Same as above, with path-scoped read |
|
|
183
|
+
| Keyed user-role T3 message (`--deliver t3:`) | The caller is not a T3 child-task parent | The caller moves to the child route |
|
|
184
|
+
| Workers pull work over MCP and must be woken through their own conversation | An inbound hosted-worker API for ChatGPT/Muse is **unprobed** | The worker host offers A2A, ACP or a task API |
|
|
185
|
+
|
|
186
|
+
## 10. Likeliest-wrong assumptions and the probes that settle them
|
|
187
|
+
|
|
188
|
+
| # | Assumption | Cheapest settling method | Fallback if false |
|
|
189
|
+
|---|---|---|---|
|
|
190
|
+
| P1 | (a) T3 keeps a child turn held by an ACP provider alive for hours. **Settled by source read 2026-11-27**: the registry adapter sets no prompt inactivity timeout; only provider close, outage or abort end it. (b) The original result is neither lost nor delivered twice at each crash point, and T3's restart continuation with `session/load` completes the original task. **Source says yes, conditionally** (section 4.1); not yet run. (c) A message to a settled child is a new follow-up task. **Settled by source**: it needs a settled original and an eligible parent; it may reuse an open follow-up. | Source read done (T3 main 3dbefda28 and v0.1.13). Remaining: short scripted fault probes with a fake worker, one per crash point: before the facade finishes; after the final emit but before the host acknowledges; after the facade clears its saved pointer; and during a restart of both T3 and the facade. Each checks the stored IDs, the terminal event and the wake count. Only then one 2-hour soak. | Keep the recovery inbox as the only post-restart path. Never fall back to posting into a protected parent. |
|
|
191
|
+
| P2 | The ChatGPT worker's computer can clone public repos, install, run tests and return a patch, with Cloud network access on. **First run 2026-11-27 blocked**: the worker's only computer was offline and not attached, so nothing ran. Open. Only the worker-side path (the worker clones, installs and tests on its own computer) waits on it; the owner-side L5 work (grant, push, draft PR, artifact scanning) and L6 do not, because they run on the owner's computer. | One ChatGPT-worker job on a public repo: clone, `npm ci`, run one test, return the diff and test output. | Keep the bridge workspace tools for that worker, and run the checks on the owner side. |
|
|
192
|
+
| P3 | Claude Code's inbox socket accepts a message from a non-child process under `crossSessionInbound: accept`. Off the release path (section 4.3). | Wait for a documented frame or SDK route; until then, no build. | The inbox plus an optional SessionStart hook. |
|
|
193
|
+
| P4 | T3 passes `target.options` to an ACP provider. **Settled by source read 2026-11-27: only as model configuration.** T3 validates options against the provider's advertised model config and applies them with `setConfigOption`; it does not pass arbitrary fields. | Done. | Task header parsing for priority and requirements (the plan). A provider could advertise `priority` as a config option; probe before relying on it. |
|
|
194
|
+
| P5 | The facade can raise a question that T3 shows as a native pending question, and the parent's `t3_pending_request` answer reaches the facade by request id. The shared ACP adapter converts some provider question forms into `user_input` (`packages/provider-acp/src/server/adapter.ts` at 3dbefda28); T3's `acp_titled_multiselect` fixture is an ACP form elicitation answered this way. On the critical path: L1 depends on it. | Read that conversion path; one fake-provider run in a scratch T3 home. | The legacy keyed `dalan answer` message to the parent, with the child turn still held. Never a turn end with question text. |
|
|
195
|
+
|
|
196
|
+
## 11. Prior art used
|
|
197
|
+
|
|
198
|
+
Captured in the research library (not in this repo): async completion contracts for seven coding harnesses; the late-2026 survey of how Claude Code, Codex, T3 Code, Copilot, Devin and Cursor return delegated work and which allow an outside wake; T3 local ACP providers running delegated children; the finding that delegated-agent products separate the job, its runs and its results, and that none shows a reliable ETA; hosted coding agents bridging to local orchestrators through PR and issue webhooks; the finding that agent standards fit edges, not contributor authority; and the finding that a ChatGPT agent can be woken only through its own conversation (MCP Events).
|
|
199
|
+
|
|
200
|
+
Primary sources behind the claims in sections 4 and 9, as read on 2026-11-27: [Claude Code MCP documentation](https://code.claude.com/docs/en/mcp) (Tasks support and polling); [ACP v2 migration guide](https://agentclientprotocol.com/protocol/v2/migration) (a preview; not an outside completion path); the MCP Tasks extension proposal SEP-2663 (`io.modelcontextprotocol/tasks`, MCP 2026-07-28); T3 Code source at commit 3dbefda28 (files and lines cited where used); Dalan `main` at d0dd670 (files and lines cited where used).
|
|
201
|
+
|
|
202
|
+
## 12. Separation: Dalan and the tooling built on it
|
|
203
|
+
|
|
204
|
+
Rule: this repository holds the bridge only: relationship, work, authority, delivery and wake, worker capability, and the surface that requester agents call. Tooling that an operator builds on top (job generators, admission gates, wake scripts, nudges to workers, filler rules, fleet reports) uses only Dalan's public interface. That interface is the CLI and MCP verbs, `status`/`metrics`/`get` JSON, the config files documented in `docs/`, and the requester adapters. Tooling holds no Dalan internals. Dalan holds no operator rules, host thread ids, account names or fleet vocabulary.
|
|
205
|
+
|
|
206
|
+
Where the line is crossed today, and where each piece moves:
|
|
207
|
+
|
|
208
|
+
| Crossing | Direction | Moves to |
|
|
209
|
+
|---|---|---|
|
|
210
|
+
| Host fields in the core schema: `assignments.thread_id` and `environment_id` NOT NULL, `parent_generation`, `t3_muted`, the `t3` notification kind, the `t3_audit` table | Host in core | The T3 adapter's own tables under `integrations/t3/`. The core keeps `{adapter, address, adapter_version}` (build L6). |
|
|
211
|
+
| T3 worker tools (`t3_thread_*`), `t3` worker capability, `t3.read`/`t3.write` scopes, `DALAN_T3_*`, `--allow-main`, `--thread`, `--producer-thread`, `main_thread_ids` | Host in core | A T3 tool pack and a T3 destination, loaded as adapters. `main_thread_ids` (`src/limits.mjs`) becomes the T3 adapter's own config. |
|
|
212
|
+
| The worker name `dot` hard-coded in the core: about 80 literals in `src/store.mjs` (dot-only `dispatch`, a break hold only for `dot`, a legacy default worker), plus `DOT_ACP_*`, the `dot-decision` prefix, and the `[dot-bridge event]` label | Deployment in core | Worker-neutral: every rule keyed by worker name from `workers.json`. The `DOT_*` names stay as aliases for one release. |
|
|
213
|
+
| ACP facade: T3 role-preamble stripping and the T3 envelope (`src/acp-bridge.mjs`), and the producer config's `deny_path_terms` and `repo_selection` read by the facade | Host and operator policy in core | `integrations/t3/acp-kit/`. Repo selection becomes a documented config of the facade, not a producer file. |
|
|
214
|
+
| `DALAN_ACP_PROSE_CHECK` and `DALAN_ACP_PROSE_CHECK_OWNERS` (an external prose linter run on build output; `src/acp-bridge.mjs#checkerEnv`) | Operator tooling in the adapter | A generic optional post-result hook (`DALAN_POST_RESULT_HOOK`) with a documented contract; the operator chooses the linter in its own config. |
|
|
215
|
+
| Operator scripts that open the bridge database or Dalan's home directly: 34 files, 23 of them opening `bridge.db` | Tooling into internals | `dalan status --json`, `dalan metrics --json`, and new read verbs for whatever they need (queue by class, per-kind record, deliveries). The schema is internal and may change without notice. |
|
|
216
|
+
| The destination registry and delivery vocabulary know only `none` and `t3:<thread>` (`src/destinations/index.mjs` `createDestinations`/`destinationName`; `src/delivery.mjs` `parseDelivery`) | Host in core | Adapters register their delivery modes; the core routes by name (build L6). |
|
|
217
|
+
| The default worker `dot` outside the store: `src/server.mjs` admission paths (`target ?? 'dot'`, about 10 sites), `src/workers.mjs:67, 127, 431`, `bin/dot-worker.mjs#case 'submit'` | Deployment in core | Worker-neutral defaults from `workers.json`, with the store literals above. |
|
|
218
|
+
| `dot-bridge` default homes: `src/server.mjs#configDir`, `src/paths.mjs#workspaceRoot`, `src/store.mjs#isDefaultHomeDatabase` | Deployment in core | `dalan` defaults; `dot-bridge` only as a migration alias (`src/paths.mjs#defaultPath` already renames). |
|
|
219
|
+
| `DOT_BRIDGE_*` error codes (`src/submission-policy.mjs#infrastructureError`, `src/submission-policy.mjs#validateSubmission`; `src/server.mjs#DOT_BRIDGE_INFRASTRUCTURE`) | Deployment in core | `DALAN_*` codes, with `DOT_BRIDGE_*` accepted as aliases for one release. |
|
|
220
|
+
| Shipped commands named for this deployment: six `bin/` entry points carry the deployment's worker name as a prefix | Deployment in core | Neutral `bin/` names, with the old names kept as shims for one release. |
|
|
221
|
+
| The worker capability vocabulary admits only `t3` (`src/workers.mjs#parseWorkers`) | Host in core | A capability registry owned by adapters. |
|
|
222
|
+
| Patch landing (turning a worker patch into a branch and draft PR) done by operator tooling | Tooling doing bridge work | Dalan's materialize step, under the owner's standing grant (section 7.3). Tooling keeps only its own merge policy. |
|
|
223
|
+
| Admission decisions in an operator gate (deny, then override on repeat) | Tooling doing bridge work | Dalan's admission answer at the call (section 6). An operator gate may still apply its own routing policy on top. |
|
|
224
|
+
|
|
225
|
+
Test for the rule: a second operator with no fleet could install Dalan, use every requester route, and see no name or rule from this operator. And this operator's tooling keeps working across a Dalan schema change.
|
|
226
|
+
|
|
227
|
+
## 13. Consumers and the product-neutrality check
|
|
228
|
+
|
|
229
|
+
Dalan must not depend on T3, on any one fleet, or on any one product. Named consumers:
|
|
230
|
+
|
|
231
|
+
| Consumer | Uses | Must not require from Dalan |
|
|
232
|
+
|---|---|---|
|
|
233
|
+
| T3 Code threads (Claude, Codex) | The T3 child-task adapter (4.1) | Nothing T3-specific outside `integrations/t3/` |
|
|
234
|
+
| Plain Claude Code or Codex sessions | MCP requester (4.2) and wake adapters (4.3) | Nothing host-specific in the core |
|
|
235
|
+
| An operator's fleet tooling | The public interface (section 12) | Fleet rules in Dalan |
|
|
236
|
+
| Faravan (planned): people lend coding-agent time to people they trust | The relationship, work and authority model | Circles, lending strategies, presence, approval UI or people's names |
|
|
237
|
+
|
|
238
|
+
Faravan check: could Faravan's lending loop sit on Dalan without Dalan learning anything Faravan-specific?
|
|
239
|
+
|
|
240
|
+
- **Fits.**
|
|
241
|
+
- A lending arrangement is a relationship with role symmetry: either member may request or serve. A borrowed job is work. The lender's rules (hours, limits, approval mode) are authority grants on that relationship.
|
|
242
|
+
- The lender's local agent is a worker on the ACP-runtime pattern. The borrower's agent is a requester on the MCP route.
|
|
243
|
+
- Results, questions, cancel and delivery are Dalan's unchanged.
|
|
244
|
+
- **Gap 1: authority has more than one human owner.** Dalan today has one owner and one operator key per install. Faravan needs two people, each the authority over their own side of a relationship. The core must keep authority per relationship side (C2 already separates the lifetimes) and must never assume one owner. v2 adds no new single-owner assumption.
|
|
245
|
+
- **Gap 2: no always-on host.** Dalan today is one server with one SQLite store. Faravan's rule is that any online member serves the circle. The core must stay usable as an embedded library with its own store per member, with relationships that span peers. v2 does not build this. It keeps the store behind the Store class, puts all host I/O in adapters, and adds nothing that assumes a single server.
|
|
246
|
+
- **Gap 3: requesters use the host's administrative surface.** Privileged calls carry the install's operator key (`src/auth-check.mjs#runAuthCheck`; `docs/design/authority-matrix.md`: "Requesters need the local host administrative surface"). A borrower's agent is a remote peer and cannot hold that key. The core needs a per-relationship requester credential.
|
|
247
|
+
- **Gap 4: delivery reaches only T3 threads or nothing.** A lender's agent is not a T3 thread, so a borrowed job has no wake path back. Build L6 (adapter-registered delivery modes) closes this in the core; the peer adapter is Faravan's.
|
|
248
|
+
- **Gap 5: relationships are pairs keyed by worker name.** The relationship pattern is `outbound_only`, `service_native` or `controllable` (`src/store.mjs#migrate`), looked up by `counterpart_ref = worker ?? 'dot'` (`src/store.mjs#relationshipForSubmission`). There is no symmetric pattern and no group. The core needs a symmetric relationship pattern, and a circle composed of per-member relationships.
|
|
249
|
+
- **Verdict.** Faravan fits the work model. The five gaps are in authority, authentication, delivery vocabulary, relationship shape and deployment shape, not in the work model. v2 closes gap 4 (L6) and must not widen the other four. A Faravan adapter must be possible without core changes beyond those five.
|
|
250
|
+
|
|
251
|
+
## 14. Subagent parity beyond one-shot
|
|
252
|
+
|
|
253
|
+
**Design amendment, 2026-11-28; proposed, not implemented or live-qualified.** The first release targets initial delegation. The owner's wider bar is that any agent can use a remote worker repeatedly, with as little difference from a local subagent as the host constraints permit. This section extends the frozen baseline: it does not relabel the successor-based `correct` in sections 2–4 as in-place steering, nor terminal replay as conversation continuation. Where the earlier parity table describes an older main, the source snapshot below is the implementation baseline for this amendment.
|
|
254
|
+
|
|
255
|
+
### Packet authority and qualification
|
|
256
|
+
|
|
257
|
+
The source is the owner's **Dalan Tech Lead Handoff, 2026-11-14**. Packet paths below are relative to `Dalan_Tech_Lead_Handoff_2026-11-14/`, recovered read-only at `~/.tmp/lead/dalan-handoff-1114/zip/`. These are packet citations, not repository-relative links. `reference/protocol/READ_FIRST.md`, “Decision” and “Material changes”, refines R33 with exact protocol/SDK/host boundaries; `planning/decision-register.json` AD01–AD18 consolidates the choices. The taxonomy D-numbers below are separate from the packet's R33 D01–D12 and planning AD-numbers.
|
|
258
|
+
|
|
259
|
+
**Precedence:** packet authority, identity, consent and recovery obligations govern this amendment and qualify the earlier frozen baseline. A later source observation can establish a changed implementation fact; it cannot silently reverse a packet decision. The disagreements subsection records the departures across the whole document, including release-scope choices that still need the owner. No new protocol is selected here. R33 W4 selected E (existing protocols plus narrow adapters), deferring P until an independently reproduced semantic mismatch. Missing adapter functionality is not that mismatch.
|
|
260
|
+
|
|
261
|
+
`reference/protocol/COMPATIBILITY_RECORD.json` says **“template only; no route certified”**. Its operation and route entries are null, not passes. `reference/protocol/qualification-state.json` has `qualified_dimensions: []`; its scores are same-author ordinal design judgments. Neither the protocol review nor this amendment improves that ledger. The later P1b/P5 observations below retain their narrower scenario evidence only. In particular, actual `dot` and hosted Muse input consumption, concurrent questions, partial artifact production, in-place correction and native session retention remain **unprobed** here.
|
|
262
|
+
|
|
263
|
+
A builder fills a separate compatibility record for each caller/worker route: protocol name and wire revision, binding, extensions, SDK pin, native host/version, authority, recovery and activation. Support is the intersection of endpoint implementation, adapter preservation, caller understanding, grant and host policy (`ADAPTER_OBLIGATIONS.md`, “Capability and authority composition”). Ordinary Dalan MCP application tools remain a valid explicit route. Required MCP Tasks mode must fail if unsupported; it must not silently fall back to application tools or blocking calls. An outbound MCP worker need not itself serve Tasks: Dalan can expose work state to the requester while the worker calls authorized domain tools (`PROTOCOL_SELECTION.md`, “Modern MCP deployment decision”).
|
|
264
|
+
|
|
265
|
+
The taxonomy assigns steering to D5, delivery to D8, context to D1, lineage to D4, evidence to D7, and portability to D18. D12 authority and D19 data flow constrain all five decisions. These are extensions to execution and repair, not a new scheduler or job graph. See [taxonomy v2](https://github.com/tnunamak/divan/blob/main/remote-agent-delegation/taxonomy-v2-remote-coding-delegation-is-a-six-stage-lifecycle-with-twenty-dimensions-each-owning-one-design-decision.md).
|
|
266
|
+
|
|
267
|
+
### Evidence boundary and common contracts
|
|
268
|
+
|
|
269
|
+
Source facts below refer to Dalan `8680977` (origin/main merged 2026-11-28); repository line references are refreshed against that snapshot; older baseline behavior and external source pins remain historical observations. **Fact** means code or a recorded probe establishes the stated boundary. **Inference/proposal** means a mechanism we can build. **Unprobed** means it must not be advertised as a worker capability.
|
|
270
|
+
|
|
271
|
+
| Evidence | Established fact and limit |
|
|
272
|
+
|---|---|
|
|
273
|
+
| Worker surface: `src/server.mjs:348-376, 387-425, 1074-1102`; `src/store.mjs:174, 2126-2139, 2792-2880` | Workers pull with `list_pending`, claim an assignment, and receive an active claim/epoch; retry/takeover and lease rules govern who can act. `get` exposes owner notes and marks them seen by the live holder. Guidance asks the worker to check notes before finishing. `progress` is an explicit worker call. This is a cooperative read path, not an interrupt channel. Tool availability varies by catalog profile: `stable` excludes identified questions, and `legacy-v46` has a narrower list. A catalog declaration is not evidence that `dot` or Muse used it. |
|
|
274
|
+
| Caller surface: `src/mcp-stdio.mjs#TOOLS`; `bin/dot-acp-agent.mjs:335-435, 449-499, 542-566` | Local MCP exposes submit, questions, keyed answer, correct and cancel. `correct` submits a successor and cancels nothing. The ACP facade holds a prompt, relays progress, elicits clarification and supports session load/cancel; a concurrent prompt fails `prompt already active`. Load restores bridge pointers, not the hosted worker's model context. Completed-work lookup replays a saved terminal result. |
|
|
275
|
+
| Recorded facade probes: `~/code/dotfiles/ai/fleet/design/dalan-handoff-1114/PROBES-1128.md` | P1b records four fake-bridge recovery cuts with one submit and one result delivery each. P5 records a real facade in a scratch T3 server with a fake worker: one pending question answered by ID while the same run stays active. It does not prove `dot`/Muse question consumption, concurrent questions, or the crash after an external send but before its receipt is saved. |
|
|
276
|
+
| Hosted-worker boundary: sections 9 and 10 P2; `~/code/dotfiles/ai/fleet/design/dalan-handoff-1114/TARGET-ARCHITECTURE.md:48-58, 364-381` | `dot` and Muse reach Dalan through outbound MCP; a conversation/event/schedule starts the hosted session. Dalan queues work; it does not own that session. Muse's roughly 7–10 minute session length is the operational observation recorded in parity row 14, not a documented hard deadline or a measured distribution in this amendment. P2's first `dot` computer test was blocked by an offline computer. No new live worker probe was run here. |
|
|
277
|
+
|
|
278
|
+
The reference local contracts are versioned observations, not universal promises. [The late-November harness survey](https://github.com/tnunamak/divan/blob/main/agent-harnesses/by-late-november-2026-claude-code-codex-t3-copilot-devin-and-cursor-return-delegated-work-in-five-ways-and-only-claude-code-codex-app-server-t3-and-devin-let-an-outside-process-wake-the-orchestrator.md), sections B–D, records Claude Code `Agent`/`SendMessage` correction and resume; Codex `spawn_agent`, messages and follow-up turns; and T3 `delegate_task`, steer/queue and native input requests. A T3 send to a finished child starts a **fresh host task**, possibly reusing an open follow-up; it cannot finish the old delegated task. Codex V2 messages alone do not trigger an idle turn; `followup_task` does. Claude Code subagents lack `AskUserQuestion`, although permission requests have their own path. These differences must survive adapter translation.
|
|
279
|
+
|
|
280
|
+
[The context/steering/checkpoint study](https://github.com/tnunamak/divan/blob/main/agent-harnesses/remote-coding-jobs-need-separate-context-manifests-acknowledged-steering-messages-and-workspace-checkpoints.md) supplies the prior art for acknowledged messages, safe-step delivery and explicit continuation modes. Its recommendations are not evidence of `dot`/Muse support. [The `dot` interface study](https://github.com/tnunamak/divan/blob/main/agent-harnesses/dot-can-operate-t3-through-mcp-events-or-a-connected-computer-but-cannot-yet-be-a-native-t3-provider.md) documents MCP Events wake and the absence of a documented `dot` session-control API in its October snapshot; its older conclusion about a hypothetical facade is superseded by the facade now in this repo. Neither study proves an event enters an already-running hosted turn.
|
|
281
|
+
|
|
282
|
+
**Core mapping.** All new interaction events use existing durable work/event and receipt infrastructure. Delivery uses the L6 shape **`{adapter, address, adapter_version}`**; `adapter_version` maps to shipped schema 73's `assignments.delivery_adapter_version`; `adapter` and `address` map to `delivery_adapter` and `delivery_address` (`src/store.mjs#delivery_adapter_version`; `CHANGELOG.md#delivery_adapter_version`). This names the conceptual tuple, not a column rename. The core stores opaque addresses and capability declarations, never T3 thread/task/session IDs. The stable Dalan child handle is a proposed application reference, marked new (packet silent), not an ACP owned-child assertion. Each adapter keeps its own mapping from that handle to work IDs and native task IDs. CLI and MCP must expose every operation independently of ACP. An adapter that cannot wake its caller leaves a readable inbox event and reports that disposition.
|
|
283
|
+
|
|
284
|
+
Claims stay short-lived authority grants, not child identities or proof of conversation continuity. A continuation acquires a fresh grant and rechecks scope, base and eligibility; no checkpoint or steering text widens permission. Worker observations remain `worker_reported`; server observations of storage/delivery remain `bridge_observed`. Neither is proof that a model understood an instruction.
|
|
285
|
+
|
|
286
|
+
### (a) Steer a running child in place — D5/D8
|
|
287
|
+
|
|
288
|
+
**Governing packet decision.** `reference/r33/W4_STANDARDS_DECISION.md`, “One consequential standards gap, not grounds for new protocol now”, explicitly rules out MCP Tasks `tasks/update` as general steering. `reference/r33/BUILD_SPEC.md` §4, “Correct and follow up”, and planning AD11 require successors for immutable jobs and preserve genuine in-place revision/fencing where supported. `reference/protocol/PROTOCOL_SELECTION.md`, “ACP design correction”, permits supported ACP v1/native sessions and negotiated Draft v2 background work; a v2 label alone establishes neither host support nor revision safety. `ADAPTER_OBLIGATIONS.md`, “New discriminating cases”, requires exact pending input IDs for MCP task updates (M01). MRTR answered retry carries exact opaque state and `inputResponses`; it is not an arbitrary mid-run edit or blind retry of an uncertain write (C07, M02–M03).
|
|
289
|
+
|
|
290
|
+
**Local offer.** A parent can send a correction to its running child while keeping child identity. Message delivery does not imply atomic interruption of a tool effect; interrupt remains a separate control.
|
|
291
|
+
|
|
292
|
+
**Allowed today.** Worker side: `dot` and Muse can fetch owner notes through `get` during a claim (`src/server.mjs#case 'get'`; `src/store.mjs:2126-2139, 2388, 2395`); the read cursor proves exposure, not application. Whether either worker rereads and applies notes mid-run is **unprobed**. Caller side: MCP `dalan_correct` creates a successor (`src/mcp-stdio.mjs#dalan_correct`); a second active ACP prompt fails (`bin/dot-acp-agent.mjs#prompt already active`). No qualified host path for in-place correction is established by the packet's empty compatibility template.
|
|
293
|
+
|
|
294
|
+
**Closest mechanism.** Retain successor correction as the immutable-job route. On a stronger native/ACP route, preserve its supported steering only when material-input revision fences controlled effects and final acceptance. Store relationship, work, material revision and immutable operation attempt separately from native mutation revision and claim epoch. Deliver observations through L6 `{adapter, address, adapter_version}`; the adapter owns native session addressing. A correction never answers or dismisses an unrelated pending question. Old output remains superseded evidence. Independently held host tools remain outside Dalan's control; refuse required fencing when the real execution boundary cannot enforce it.
|
|
295
|
+
|
|
296
|
+
**Recommendation: successor plus handoff for native jobs.** Create a keyed successor with `correct`, explicitly withdraw the old job, and let the same live holder acquire the successor through the existing claim/handoff path. `correct` alone cancels nothing, so withdrawal remains an explicit step. The finish handoff (`src/server.mjs#finishNextGuidance`) uses ordinary claim policy, keyed acquisition and a short idle lease; it preserves the worker's hosted session when the worker cooperates. It currently selects eligible queued work after `finish`, so exact successor targeting and handoff after withdrawal are not guaranteed today. Reconcile successor creation and withdrawal separately after lost receipts, and refuse to claim same-holder continuity if the worker exits or another eligible claimant wins. This composition needs relationship/revision mapping and qualification, but no new operation or mutable job payload.
|
|
297
|
+
|
|
298
|
+
**Alternative departure, not selected.** A cooperative safe-step mailbox would add `steer(work_id, message_id, expected_material_revision, text)`, keyed to the caller-visible material revision, not the worker's claim epoch. The server would bind delivery/receipts to the current grant independently. It would require immutable attempts, read/applied/cannot-apply receipts and material-revision checks on controlled effects and final acceptance. BUILD_SPEC §4 and prior-art `REUSE_DECISIONS.md`, “Input categories”, already choose explicit replacement for immutable native jobs; this mailbox departs from that choice rather than filling packet silence (disagreement 17). It adds a second correction path without demonstrated benefit over successor-plus-handoff. Preserve qualified stronger native steering on other routes; this is not MCP Tasks or MRTR conformance.
|
|
299
|
+
|
|
300
|
+
**Named gap.** Cooperative note fetching cannot preempt an offline or non-calling hosted worker. ACP background support allows activity after a prompt, but does not prove that `dot`/Muse accept edits in that session. Successor correction satisfies explicit correction, not in-place parity.
|
|
301
|
+
|
|
302
|
+
**Falsifier P6.** Create a uniquely keyed successor between worker calls; lose the creation and withdrawal receipts separately and reconcile each original attempt. Race old finish, controlled effects, withdrawal and claim turnover. Require the superseded result to remain unacceptably stale, unrelated questions to retain their identities, and only authorized successor acquisition to proceed. In a separate handoff cut, require the cooperating live holder to take the linked successor without a new hosted session; record inability to target it rather than silently claiming continuity. Only a stronger route may run the same-work correction cut: qualify actual input consumption and material-revision fences separately for each worker before advertising `steer_in_place`.
|
|
303
|
+
|
|
304
|
+
### (b) Follow up on the same child after completion — D1/D4/D18
|
|
305
|
+
|
|
306
|
+
**Governing packet decision.** `reference/r33/W4_STANDARDS_DECISION.md`, “What the existing standards already define”, selects A2A context/task ancestry: new task in existing `contextId` with `referenceTaskIds`; MCP terminal results stay terminal and another `tools/call` creates new work. `reference/protocol/PROTOCOL_SELECTION.md`, “ACP design correction”, limits resume to actual retained state and distinguishes owned Subagent Sessions from arbitrary external participants. `reference/host-neutral/DESIGN_TARGET.md` §5 and the protocol “ACP design correction” govern retention and recovery; planning AD11 governs immutable completion and successor work. AD02 separates relationship, work and authority lifetimes; it does not establish context retention. A context/session ID is neither hidden-context proof nor a credential.
|
|
307
|
+
|
|
308
|
+
**Local offer.** The parent follows up using the existing child and useful context. A new execution turn or T3 task ID can coexist with stable logical child identity; unlimited hidden-context retention is not implied.
|
|
309
|
+
|
|
310
|
+
**Allowed today.** Worker side: claim handoff can offer more work within a current hosted session (`src/server.mjs#finishNextGuidance`), but cannot select or restore a particular conversation. Addressable native resume on `dot` and Muse is **unprobed**. Muse's recorded 7–10 minute observation is not a guaranteed retention bound. Caller side: ACP load restores facade pointers and terminal receipts (`bin/dot-acp-agent.mjs:462-466, 490-499`); terminal replay is not delta-only follow-up. A new unbound prompt can create another job, but establishes no contextful continuation by itself.
|
|
311
|
+
|
|
312
|
+
**Closest mechanism.** Core links new immutable work to earlier work within the same authorized relationship/shared context. For A2A, map those references to native task/context ancestry; for MCP, create new work through the agreed tool contract. Recheck current authority, base, retention and disclosure. Preserve stronger native resume when actually supported and disclose whether the route retains, replays or reconstructs. Route through `{adapter, address, adapter_version}` and keep native task/session mappings in the adapter. Follow-up must not supersede a valid earlier result merely because it is later work.
|
|
313
|
+
|
|
314
|
+
**New (packet silent).** A `follow_up(child, prior_work, message_id, delta)` application operation and bounded context capsule are proposed schema choices. Capsule fields: shared decisions, unresolved questions, prior artifact digests, repository anchor and explicit workspace checkpoint inclusions/omissions. Proposed continuity labels are `native_resume`, `checkpoint_replay`, `fresh`; they describe observed behavior, not a `dot`/Muse default. A single-writer rule or explicitly isolated fork prevents concurrent editing continuations. No checkpoint continuity claim is available until restoration is demonstrated; native continuity requires separate evidence.
|
|
315
|
+
|
|
316
|
+
**Named gap.** Same logical child is achievable through lineage; same hosted model state is unqualified. A summary and files cannot restore all inferences, processes or undisclosed context. Retention loss must produce an explicit degraded option or refusal.
|
|
317
|
+
|
|
318
|
+
**Falsifier P7.** Finish work with a nondefault decision and sealed checkpoint. A delta-only follow-up must recover both, create distinct work/result identities and retain ancestry. For the separate `native_resume` cut, give the worker a random harmless canary during the original session and deliberately omit it from the capsule, checkpoint, files, artifacts and follow-up prompt. The oracle keeps the expected value outside worker-accessible recovery inputs. Require the resumed worker to recover it without re-sending it; capsule-only recovery can pass `checkpoint_replay` but cannot pass this cut. Repeat after facade restart, hosted-session loss and base movement; after actual context loss, report degradation/refusal rather than reconstructing the canary and claiming native resume. Old-result replay, silent omissions, concurrent writers or cold replay labeled native resume fails. Record each worker separately; the packet supplies no native-resume pass.
|
|
319
|
+
|
|
320
|
+
### (c) Intermediate artifacts — D7/D8/D19
|
|
321
|
+
|
|
322
|
+
**Governing packet decision.** `reference/r33/W4_STANDARDS_DECISION.md`, “What the existing standards already define”, selects A2A messages/history/artifacts plus polling, streaming or optional push for multiple outputs. `reference/protocol/PROTOCOL_SELECTION.md`, “A2A implementation shortlist”, selects SDK store/event-bus injection over native authority, including `settleByTaskId` for delayed-event lifetime. `ADAPTER_OBLIGATIONS.md`, “Ownership and identity” and the executor-return case (A06–A07), forbid a second authoritative task store and premature event-bus teardown. `reference/host-neutral/DESIGN_TARGET.md` §5 requires provenance, input revision and separate receipt/acceptance. Artifacts do not require a new wire protocol or universal central relay.
|
|
323
|
+
|
|
324
|
+
**Local offer.** A parent can inspect files or diffs before the child finishes; partial output conveys neither completion nor acceptance.
|
|
325
|
+
|
|
326
|
+
**Allowed today.** Worker side: `artifact_chunk` can seal uploads during a live claim (`src/server.mjs#artifact_chunk`); actual pre-finish uploads by `dot` and Muse are **unprobed**. Caller side: authorized owners can retrieve sealed bytes by ID without a finished-job prerequisite (`src/server.mjs#url.pathname==='/artifact'`); `finish.artifact_ids` is the documented discovery path. Earlier §3's no-repository-download restriction remains an admission policy until its scan gate ships; raw route availability is not permission to bypass it.
|
|
327
|
+
|
|
328
|
+
**Closest mechanism.** Retain native artifact/result authority and expose scoped references, input/source revision, digest and provenance while work is active. A2A adapters map native observations through the selected SDK stores/event bus without mirroring authoritative state. The packet's SDK candidate is protocol 1.0 with opt-in 0.3 compatibility; pin exact wire/SDK mapping before claiming the R33 1.0.1 design requirements. Other routes use explicit artifact read/list application tools. Deliver references through `{adapter, address, adapter_version}`; parent admission/review remains host-owned. If admission returns before events drain, retain event-bus settlement ownership until the actual external lifecycle permits closure.
|
|
329
|
+
|
|
330
|
+
**New (packet silent).** Append `artifact_ready` on successful seal with stable artifact ID, work/epoch, material revision, digest, size and partial disposition; retries reconcile the same artifact identity. Proposed subscriptions/listing expose it before finish without a wake per chunk. An explicit request for review can reference it as a separate question. Replacement bytes get a new identity. This event schema/discovery policy is local application design, not a mandatory peer protocol.
|
|
331
|
+
|
|
332
|
+
**Named gap.** Unsealed byte streaming and a shared filesystem are not offered. Discovery, authorized download, worker production and parent use are separate observations. A2A protocol support does not qualify real artifact delivery on either hosted route.
|
|
333
|
+
|
|
334
|
+
**Falsifier P8.** Hold finish; seal a harmless artifact, observe its reference and fetch matching bytes while work remains active. Drop the seal receipt, retry, then cancel/reclaim. Fail on duplicate logical publication, unsealed/wrong bytes, missing permitted pre-finish access, scan bypass or an event bus destroyed before the delayed artifact arrives. Use maintained native/SDK fixtures first, then one separate hosted production check per worker.
|
|
335
|
+
|
|
336
|
+
### (d) Several outstanding questions — D5/D8/D12/D16
|
|
337
|
+
|
|
338
|
+
**Governing packet decision.** `reference/r33/W4_STANDARDS_DECISION.md`, “What the existing standards already define”, selects MCP Tasks 2026-07-28 unique task-lifetime `inputRequests` keys and matching `tasks/update.inputResponses`. `reference/protocol/ADAPTER_OBLIGATIONS.md`, “New discriminating cases” (M01 and MRTR C07/M02–M03) and “Clarification/consent classification”, requires exact pending IDs and separates clarification, human decision, authentication and tool permission. `PROTOCOL_SELECTION.md`, “Elicitation versus collaboration”, supersedes blanket autonomous ACP form answering: user-facing review/consent requirements remain binding. R33 `BUILD_SPEC.md` §3 “R31 implementable seam”, `W1_HANDOFF.md` and D03/D05 select the T3 adapter’s app-owned external-question binding described below. ACP v2 idle/background requests are optional negotiated support, not dependent on an open foreground prompt.
|
|
339
|
+
|
|
340
|
+
**Local offer.** Parent and child retain several distinct questions and can answer independently. Multiple core questions do not require simultaneous host dialogs.
|
|
341
|
+
|
|
342
|
+
**Allowed today.** Worker side: the native keyed journal stores/consumes answers independently with claim fencing (`src/store.mjs#questions(id)`); catalog-dependent `ask_question`/`consume_answer` are exposed (`src/server.mjs:368-369, 387-425`). `dot`/Muse raising and consuming several questions is **unprobed**. Caller side: the facade awaits each elicitation serially (`bin/dot-acp-agent.mjs#listQuestions()`). P5 proves one fake-worker question reaching the caller, not that the form is a permissible autonomous-consent route or a detached/restart solution.
|
|
343
|
+
|
|
344
|
+
**Closest mechanism.** Persist each authenticated question and intended answer authority before notification; requester owns the chosen answer. For negotiated MCP Tasks, expose unique pending input IDs and match responses exactly to the native question/epoch. MRTR, where actually supported, intentionally starts a new protocol request using the original opaque state and exact `inputResponses`; preserve backend side-effect deduplication and host policy. It does not replace durable task identity. ACP/native session routes preserve pending-request bindings during idle/background work or report a recoverable block if callbacks cannot be restored. For T3, use the W1 clarification channel: trusted external-question admission on the parent thread, an `external` response capability, a separate question node (never the running subagent node), existing `t3_pending_request` list/read/respond and a durable external-answer effect. Keep the chosen answer in T3’s authoritative projections and persist the native Dalan answer attempt before send. This is source-verified design, not shipped support. Another requester maps its own collaboration lifecycle; these T3 types belong only in the T3 adapter. Replace W1 with ACP only after a maintained pinned implementation passes all five BUILD_SPEC §3 reversal traces with less machinery: detached question, pending-question restart, answered-before-delivery restart, control intent and result recovery. Do not repurpose user-review forms or permissions. Human/auth/tool-grant flows retain their actual authority boundary. Core delivery is `{adapter, address, adapter_version}` with question mappings at the adapter.
|
|
345
|
+
|
|
346
|
+
Persist the complete original native answer attempt before send: command key, expected mutation revision, exact question/content, associated identity/version and credential reference. Reconcile ambiguous delivery with that same attempt; never refresh the revision under the old key or re-ask merely because the receipt was lost (`reference/r33/BUILD_SPEC.md` §4, “Ask and answer”). Receipt and worker consumption remain separate.
|
|
347
|
+
|
|
348
|
+
**New (packet silent).** Independent discovery/listing and a bounded concurrency scheduler prevent one waiting answer from blocking progress or another question. Advertise the outstanding-request limit and explicit recoverable limit response. A serial-dialog host may expose the whole list; any batched answers must retain independent keys. Decline/cancel preserves the protocol's actual meaning and an explicit per-question disposition; it must not silently answer or discard other questions. No universal purpose enum is added: the packet's classification is a mapping taxonomy.
|
|
349
|
+
|
|
350
|
+
**Named gap.** Host presentation and detached activation are separate capabilities. A route unable to preserve a pending request across restart stays blocked/unqualified; durable history alone cannot reconstruct every callback. An autonomous parent cannot manufacture human consent.
|
|
351
|
+
|
|
352
|
+
**Falsifier P9.** Ask two clarifications plus a human-only request. Answer clarification two first, restart before/after answer commit and lose a receipt; then answer one. Require unchanged attempt identity, one effective answer per exact question and continued progress. Reject stale IDs after regrant, a model's human-consent response and an input update presented as steering. Crossed answers, invisible pending questions or silently reconstructed callbacks fail.
|
|
353
|
+
|
|
354
|
+
### (e) Prove an ongoing relationship — D7/D15/D18
|
|
355
|
+
|
|
356
|
+
**Governing packet decision.** `reference/r33/BUILD_SPEC.md` §5 J1–J5 and §6 “Hosted and general proof” require sustained work, correction, artifacts, recovery and portable composition. `reference/protocol/TOOLING_HANDOFF.md`, “A2A”, “MCP”, “ACP” and “Next bounded design decision”, requires maintained pinned fixtures and per-requirement reports, not exit-code certification. `reference/protocol/COMPATIBILITY_RECORD.json` and `qualification-state.json` expressly provide no certified route or qualified dimension. Planning AD14/AD16 retains actual `dot` and hosted Muse as separate gates; substitutes and one-worker passes do not close them.
|
|
357
|
+
|
|
358
|
+
**Local offer.** A parent supervises an existing child across delegation, questions, corrections, progress, follow-up and cancellation. A useful terminal result alone proves only one part.
|
|
359
|
+
|
|
360
|
+
**Allowed today.** Worker side: real hosted interaction across all these steps is **unprobed** in this amendment. Caller side: the earlier B7 plan scopes initial live delegation; recorded P1b/P5 cover selected recovery/question cases with doubles. Progress relay and cancel requests exist (`bin/dot-acp-agent.mjs:335-385, 542-566`); none establishes actual hosted stop, idle activation or continuation.
|
|
361
|
+
|
|
362
|
+
**Closest mechanism.** Extend maintained real store/handler/selected SDK fixtures, first mapping exact dependencies and state ownership. Include lost creation acknowledgement: persist authenticated caller-scoped initiation identity and use authoritative lookup/deduplication or hold `outcome_unknown`. MCP Tasks has no task listing/creation-idempotency guarantee; A2A message deduplication is only MAY (W4, “One consequential standards gap”). Record original IDs, attempts, grants, input revisions, parent generation and evidence level, with `{adapter, address, adapter_version}` for delivery. Count transport receipt, activation, execution, domain outcome, consumption and acceptance separately; MCP task completion may carry tool-level `isError`. Inspect optional Tasks checks, skips and expected failures before calling conformance a pass.
|
|
363
|
+
|
|
364
|
+
**New (packet silent).** The B7 label and the combined short walk below are a local packaging of J1–J4, with P6–P9 as scenario names. Run deterministic failure cuts first; only a separately authorized bounded hosted walk settles cooperation. Its exact latency/quality/cost thresholds must be frozen before execution, as required by BUILD_SPEC §5. Use per-worker and per-caller records, not a shared success flag. Repeat the application-tool trace through CLI/MCP independently of T3.
|
|
365
|
+
|
|
366
|
+
**Named gap.** B7 does not close J5: a second maintained requester, service-native/controlled worker, hosted parent and attenuated onward delegation remain separate gates. `dot` does not qualify Muse; a T3 path does not qualify Claude Code/Codex idle wakes or scripts. These remain visibly unavailable or use an explicitly agreed polling/inbox disposition.
|
|
367
|
+
|
|
368
|
+
**Falsifier.** Manual hidden-state repair, parent chat injection labeled native completion, an unlinked replacement labeled the same child, or discarded uncertainty fails parity even if the patch is useful. No new qualification is claimed by writing this mapping. Prior-art regression cuts also apply: `reference/prior-art/TRANSFERRED_FAILURE_CASES.md`, “Waiting for an answer blocks the only path”, “A native resume re-executes code” and the retention-eviction/interior-event-loss rows require reentrant answer admission, stable effect identity and explicit reconciliation when history is missing. `REUSE_DECISIONS.md`, “Dependency boundary”, keeps optional connectors outside core and defers package extraction to a real consumer.
|
|
369
|
+
|
|
370
|
+
### B7 parity walk and pass conditions
|
|
371
|
+
|
|
372
|
+
Record references below as fields of a **new per-route** compatibility record (CR); the packet template is not a pass. The historical qualification ledger remains unchanged until evidence is evaluated against its actual rubric. Live admission, permissions and renewal for actual `dot`/Muse remain separate observations under R33 D07/D08 and BUILD_SPEC §9.
|
|
373
|
+
|
|
374
|
+
| Step | Pass condition | Packet evidence/record obligation |
|
|
375
|
+
|---|---|---|
|
|
376
|
+
| Delegate | One authenticated intent yields one work identity, with durable handle and truthful admission. Lost creation receipt reconciles by original key or stays unknown; no blind resubmit. | W4 lost-ack rule; CR `operations.admit_work`, `recovery.admission_reconciliation`, `route`, `authority`, `activation`. A webhook receipt is not execution. |
|
|
377
|
+
| Answer a question | Exact pending clarification receives the authorized answer once effectively; original native attempt survives lost receipt; work stays active. Run P9 before claiming plural support. | BUILD_SPEC J1/J4; M01/MRTR and consent obligations; CR `clarify`, `answer`, `recovery.answer_attempt_identity`, `human_approval_boundary`. |
|
|
378
|
+
| Correct mid-run | Native jobs use a linked successor, explicit withdrawal and a live-holder claim/handoff where available; stale controlled effects/acceptance are fenced. A stronger route may instead apply the material revision under the same work. Record successor correction separately from in-place qualification. The successor must reach the worker that holds the claim: the lifecycle events show the successor claimed by the same worker, and inside the same hosted session where the route exposes one, with no queue wait behind other work. A successor that another worker claims, or that waits in the queue, fails this step. | BUILD_SPEC J2; W4 excludes `tasks/update` steering; CR `correct` and required unsupported modes; P6 records fencing/cooperation separately. |
|
|
379
|
+
| See progress and an intermediate artifact | Substantive progress and scoped sealed bytes with matching digest arrive before finish; no premature completion or bus teardown. A heartbeat is insufficient. | BUILD_SPEC J3; A06–A07 delayed-event ownership; CR `observe_work`, `recovery.stream_gap_detection`, `evidence`. |
|
|
380
|
+
| Finish, then follow up on the same child | Consume the first result; delta-only successor work retains relationship/ancestry, useful shared decision/artifact, current authority and explicit continuity omissions. Cold restoration passes checkpoint continuity only. | W4 terminal follow-up rule; BUILD_SPEC J1/J4; CR `followup`, `recovery.retention`, `native_resume_semantics`; P7. |
|
|
381
|
+
| Cancel the follow-up while claimed | Separate detach/foreground interruption from withdrawal/revocation and observed worker stop. Fence late controlled effects; preserve earlier work/siblings and evidence. Unknown physical stop stays unknown. | R33 D06; ACP background-cancel obligations; BUILD_SPEC J4; CR `detach`, `interrupt`, `withdraw`, native control evidence. `tasks/cancel` acknowledgement alone cannot pass physical stop. |
|
|
382
|
+
|
|
383
|
+
**Expect it to work because:** the packet already selected the standard boundaries and assigned authoritative owners. Dalan has native claims, keyed questions/receipts and sealed artifacts to map, rather than replace. The likeliest-wrong assumption is that the selected extensions and native host features work on the actual `dot`/Muse caller/worker routes. The empty compatibility template and unchanged ledger settle that they were not qualified by the packet. Pin dependencies and exercise deterministic failure cuts before the authorized hosted walk. Confidence is high in the packet mapping, conditional in proposed application schemas and low in unprobed hosted steering/context retention. No live probes were run here.
|
|
384
|
+
|
|
385
|
+
### Departures from a local subagent seen in B7
|
|
386
|
+
|
|
387
|
+
The B7 walks of 2026-11-28 showed where a delegated build still differs from a local subagent. Each row says whether the difference stays by design or is a gap to close.
|
|
388
|
+
|
|
389
|
+
| # | Difference | Kind | Caller's part |
|
|
390
|
+
|---|---|---|---|
|
|
391
|
+
| P1 | A build names every file it reads or changes on its `[dot-build]` line, at most `BUILD_MAX_FILES` (`src/acp-bridge.mjs#BUILD_MAX_FILES`). A brief that mentions a file outside that list is refused with `undeclared instruction path` and the corrected list (`src/work-order.mjs#undeclared_path`). A local subagent needs no declared paths. | Stays by design: the declared list bounds what a remote worker reads and changes, which section 7 relies on. | A good caller acts on the refusal: it resubmits once with the corrected list it was given. Repeated refusals are a caller failure, not a route failure. |
|
|
392
|
+
| P2 | A listed file that does not exist at the caller's HEAD is a new file the worker creates (`src/acp-bridge.mjs#buildAssignment`, `output_paths`). Before this, such a build was refused. | Gap, closed by the new-file change. | None. |
|
|
393
|
+
| P3 | Builds run only for repository owners on the operator's list (`src/acp-bridge.mjs#buildIneligible`). An unset list refuses every build. | Stays by design (operator authority); a setup without the list must say so when the adapter starts. | None; an operator setting. |
|
|
394
|
+
| P4 | A caller's job was refused when backlog that nobody waited on filled the queue cap (`src/acp-bridge.mjs#bridgeRefusal`). | Gap: a waiting caller must be admitted and claimed ahead of backlog. | None. |
|
|
395
|
+
|
|
396
|
+
### Where v2 disagrees with the packet
|
|
397
|
+
|
|
398
|
+
This comparison covers §§1–14, not just the added interaction mechanisms. It distinguishes contradictions from narrower release choices and packet-silent additions; it does not claim that every addition violates the packet. Each row is one distinct departure. Packet semantics win where stated; release/product decisions remain the owner's call.
|
|
399
|
+
|
|
400
|
+
| # | v2 side | Packet side (file and section) | Resolution |
|
|
401
|
+
|---|---|---|---|
|
|
402
|
+
| 1 | Status, §1 and §14: “frozen for build”; first release requires initial delegation only. | `reference/host-neutral/closure-work.json` C1–C6 still pending; `DESIGN_TARGET.md` §§7–8 and R33 `BUILD_SPEC.md` §6 require closure and a continuing relationship before the full upgrade. | Owner's call on incremental release scope; freeze is a local planning status, not completion of packet closure or qualification. |
|
|
403
|
+
| 2 | §§1.1 row 4, 2, 4.1, 9, P5: ACP permission/form elicitation answers ordinary worker questions through the model parent. | `reference/protocol/PROTOCOL_SELECTION.md`, “Elicitation versus collaboration”; `READ_FIRST.md` material change 2; planning AD09 supersedes blanket autonomous form answering. | Packet wins: select W1’s T3 external-question seam (R33 §3, D03/D05); ACP replaces it only after all five reversal traces. Preserve human-review/consent requirements. P5 transport success does not settle semantic permission. See (d). |
|
|
404
|
+
| 3 | §4.1 and §9: a held ACP child is the primary durable route; resume is expected to finish original tasks. | R33 `BUILD_SPEC.md` §3/R31 seam and planning AD13 select an app-owned external projection conditionally, with detached/pending-answer restart reversal traces; protocol “ACP design correction” warns resume may lose requests. | Packet wins on durability/ownership. Later P1b/P5 are narrower than all reversal cuts; keep held child as an unqualified route hypothesis, never remote execution authority. |
|
|
405
|
+
| 4 | §4.1 and §9: future background activity is coupled to T3 shipping ACP v2; v1 limitations motivate the workaround. | Protocol `PROTOCOL_SELECTION.md`, “ACP design correction”, and adapter idle/background/cancel cases preserve supported v1/native routes and negotiated Draft v2 without a universal T3 seam. | Packet wins: optional per-host capability, no draft migration prerequisite; foreground cancel must not silently withdraw background work. |
|
|
406
|
+
| 5 | §§1.1 row 5, 2 and original §14: successor correction today lacks an explicit relationship material-revision/effect-fence mapping. | W4 “One consequential standards gap” and R33 `BUILD_SPEC.md` §4 “Correct and follow up” require material-revision fences, exclude task updates, and preserve stronger native steering. | Packet wins: (a) retains successors with explicit controlled-effect and acceptance fences; qualified stronger native steering remains available. The mailbox departure is row 17. |
|
|
407
|
+
| 6 | §4.1: a prompt naming finished work always replays its terminal event; original §14 proposed checkpoint replay as `dot`/Muse default. | W4 standards table, `BUILD_SPEC.md` §4 and host-neutral §5 distinguish immutable terminal replay from new follow-up work and actual native continuity. | Packet wins: replay only for result retrieval; explicit delta follow-up creates linked work. No default continuity claim without P7. See (b). |
|
|
408
|
+
| 7 | §§2–5 specify delivery keys/reconciliation; §14's old B7 required duplicate submit to return work, without the creation-ack uncertainty case. | W4 lost-creation-ack section; protocol adapter “Unknown result after task creation”; planning AD08 requires initiation identity, lookup/dedup or unknown. | Packet wins. Persist original admission intent before sending; do not infer safe creation retry from task polling or event keys. See (e). |
|
|
409
|
+
| 8 | §§2 and 4.1: journal receipt before callback acknowledgement is specified, but the exact original native answer envelope/revision is omitted. | R33 `BUILD_SPEC.md` §4 “Ask and answer” and planning AD08 require original expected mutation revision/content/key before send, immutable on ambiguous retry. | Packet wins. (d) states the missing envelope and recovery rule; local journal identity alone is insufficient. |
|
|
410
|
+
| 9 | §4.4: A2A is future-only with task/message/artifact field mapping, no SDK/ownership decision. | R33 D09/W4 selects E including A2A 1.0.1; protocol “A2A implementation shortlist” selects injected stores/event bus and delayed settlement, protocol 1.0 SDK candidate. | Owner's call on release timing; packet wins on implementation boundary and explicit version mapping. No hand-written replica or competing task authority; see (c). |
|
|
411
|
+
| 10 | §§3, 4.2, 9: MCP support discussed mostly by host label; absence at hosted worker is used to motivate question workarounds. | Protocol “Modern MCP deployment decision” and adapter capability composition require exact wire/extension/SDK/host route. Outbound worker need not serve Tasks. | Packet wins: §9’s claims “Hosted workers do not support MCP elicitation or Tasks input_required” and “Hosted workers expose no inbound API” are **unprobed**, not established absence. Qualify requester and worker roles separately. Explicit negotiated failure for required Tasks; ordinary tools are an agreed application mode. See common qualification contract. |
|
|
412
|
+
| 11 | §7.3: install-owned `materialize.json` substitutes for relationship grants because owner and relationship owner are assumed identical on one machine; §13 says no new single-owner assumptions. | Host-neutral `DESIGN_TARGET.md` §§3–4; planning AD03/AD10 require authenticated parties and per-relationship/work grants with effect-boundary policy. | Packet wins: an install policy may constrain a relationship grant, not erase borrower/work scope. Check current grant at push; a transport address or conversational yes cannot authorize it. Storage choice alone is not the defect. |
|
|
413
|
+
| 12 | §§1.1, 6–8: pushed-base-only work, secret exclusion, automatic branch/draft PR materialization, closed-form named checks and measured admission thresholds are selected product policy. | Host-neutral §§2, 4–5 and `closure-work.json` C3/C5 leave exact enforcement/operating policy to closure; planning AD06 retains stronger native facilities. | Owner's call on these new policies (packet silent). They must remain route/capability-specific and cannot flatten stronger authorized native workers or claim scanning guarantees. They are not packet protocol decisions. |
|
|
414
|
+
| 13 | §13 gap 2 requires embedded-library usability; gap 5 proposes a symmetric relationship pattern and circle composition. | Host-neutral §1 and prior-art `REUSE_DECISIONS.md`, “Dependency boundary”, defer library packaging until a real consumer; planning AD03 separates roles rather than requiring a group model. | Owner's call if Faravan is the actual consumer. Keep role symmetry; no speculative packaging or universal circle abstraction is entailed by the packet. |
|
|
415
|
+
| 14 | §§1, 10 and original B7 focus T3 and actual hosted workers, with source/probe claims but no explicit unchanged ledger or full portability exit. | R33 `BUILD_SPEC.md` J5; planning AD14/AD16; protocol compatibility/qualification records require second requester, native service/controlled runtime, hosted parent, onward delegation and independent evidence. | Packet wins for full qualification. B7 is a bounded relationship proof, not J5 completion; the records above remain unqualified. Release scope remains row 1's owner decision. |
|
|
416
|
+
| 15 | §§1.1 row 6 and 4.1: T3 cancel automatically calls remote cancel, including claimed work. | R33 `BUILD_SPEC.md` §4 “Control”, D06, and protocol adapter foreground/background-cancel cases require trusted lifecycle intent and explicit scope, not every ACP cancel. | Packet wins: map explicit withdrawal separately from local interruption/detach; preserve background scope and report observed stop independently. B7 must test these distinct intents. |
|
|
417
|
+
| 16 | §3 says v2 adds only `started` and admission events and lists a fixed operation set; §14 adds correction mapping, follow-up and artifact observations. | Host-neutral `DESIGN_TARGET.md` §§2–3 calls for missing continuity/material-revision associations atop native records, not a second event store; C2 leaves exact schemas pending. | This amendment extends the earlier v2 event/operation scope (new (packet silent)); retain the same authoritative infrastructure. Owner's call on whether these ship in the initial release. |
|
|
418
|
+
| 17 | (a)’s proposed safe-step mailbox adds same-work mutation for native Dalan jobs. | R33 `BUILD_SPEC.md` §4 “Correct and follow up” chooses linked successors for immutable native jobs; prior-art `REUSE_DECISIONS.md`, “Input categories”, chooses faithful native steering or explicit replacement. | Packet wins: recommend successor-plus-handoff, preserving a live hosted session where supported; no new operation. Mailbox is an unselected alternative keyed to material revision, never caller-supplied claim epoch. |
|
|
419
|
+
| 18 | §§2 and 9 retain `--deliver t3:` user-message wakes as a legacy route. | R33 `BUILD_SPEC.md` §4 “Return and accept”: “Dalan does not create a second paid-parent waker beside T3.” | Packet wins for the relationship route: T3 owns parent wake; do not run legacy chat delivery alongside it. Retaining standalone legacy delivery is a separate release choice, not parity qualification. |
|
|
420
|
+
|
|
421
|
+
There are **18 distinct disagreements** above, including the unselected mailbox and retained legacy-wake choice. No contradictory packet decision was identified in the remaining separation, evidence-label, inbox-floor or requester-owned acceptance rules. L6’s conceptual `adapter_version` maps to shipped `delivery_adapter_version`; no persistence rename is proposed.
|
|
422
|
+
|
|
423
|
+
### Build rows (packet mapping before new mechanisms)
|
|
424
|
+
|
|
425
|
+
These are proposed scopes, not implementation changes or assignments. Reuse maintained fixtures named in `reference/protocol/TOOLING_HANDOFF.md`; new script names below are candidates, not a requirement to build toy servers. Executing each row produces compatibility evidence without changing the historical qualification ledger by assertion.
|
|
426
|
+
|
|
427
|
+
| Build | Governing packet choice / disposition | Intended files | Behavior oracle |
|
|
428
|
+
|---|---|---|---|
|
|
429
|
+
| P6 successor correction and live-holder handoff | W4 excludes task-update steering; BUILD_SPEC §4 and REUSE “Input categories” choose native successors; mailbox not selected | `src/store.mjs`, `src/server.mjs`, `src/mcp-stdio.mjs`, `bin/dalan.mjs`; candidate `scripts/subagent-steering-e2e.mjs` (new) | Keyed successor creation/withdrawal reconciliation; old finish/effect races; same live holder acquires successor or reports continuity unavailable; unrelated questions preserved. Stronger same-work steering qualified separately or refused. |
|
|
430
|
+
| P7 linked follow-up and truthful continuity | W4 terminal-follow-up ancestry; protocol ACP resume limits; capsule/schema new (packet silent) | `src/store.mjs`, `src/server.mjs`, `src/mcp-stdio.mjs`, `src/workspace.mjs`, `src/acp-bridge.mjs`; candidate `scripts/subagent-continuation-e2e.mjs` (new) | New immutable work/result under shared relationship; authority/base recheck; retained decision/artifact; capsule-excluded session canary distinguishes native resume from checkpoint replay; cold replay omissions. |
|
|
431
|
+
| P8 intermediate output mapping | A2A injected stores/event bus and delayed settlement; local artifact event new (packet silent) | `src/server.mjs`, `src/store.mjs`, `src/mcp-stdio.mjs`, `scripts/artifact-provenance-test.mjs`; selected SDK delayed-event fixture | Pre-finish scoped sealed-byte fetch; original artifact identity after receipt loss; scan/refusal; delayed artifact survives executor return. Pin SDK/wire before adding adapter. |
|
|
432
|
+
| P9 identified input, caller-neutral mapping | MCP Tasks exact IDs, optional MRTR exact state and consent obligations; scheduler new (packet silent) | `src/mcp-stdio.mjs`, `scripts/question-relationship-e2e.mjs`; caller adapters | Reordered questions; exact answer envelope after restart/lost receipt; human-only requests preserved; no steering via input update; required unsupported modes fail explicitly. No T3 types in core. |
|
|
433
|
+
| P9 T3 clarification adapter | R33 §3/W1, D03/D05 external response capability and separate question node; ACP conditional on five reversal traces | T3 requester adapter and W1’s maintained `RemoteDelegatedTask.test.ts`, `ProviderRuntimeRecoveryService.test.ts`, `ThreadStop.test.ts`; Dalan `scripts/question-lifecycle-test.mjs`, `scripts/regrant-question-fencing-test.mjs`. `scripts/acp-elicitation-probe.mjs` only evaluates a replacement candidate. | External parent-thread admission, authoritative saved answer, immutable native send and separate question/task nodes survive detached question, pending restart, answered-before-delivery restart, control intent and result recovery. W1 is the baseline, not an optional hook. |
|
|
434
|
+
| L6 and B7 per-route qualification | Existing protocols/adapters; CR ownership/authority/recovery; B7 packaging new (packet silent) | `src/delivery.mjs`, `src/destinations/index.mjs`, requester adapters; candidate `scripts/subagent-parity-e2e.mjs` (new), `docs/usage.md` | `{adapter, address, adapter_version}` neutrality; original admission-key recovery/unknown; domain errors kept distinct from task completion; real permission/activation/renewal and P6–P9 per worker/caller after deterministic fixtures. J5 remains separate. |
|
package/docs/local-agent-mcp.md
CHANGED
|
@@ -7,12 +7,26 @@
|
|
|
7
7
|
| Tool | Does | Read-only |
|
|
8
8
|
| --- | --- | --- |
|
|
9
9
|
| `dalan_submit` | Queues an assignment, like `dalan submit`. Returns the `request_id` and the bridge verdict. A `clarify` or `reject` verdict comes back as an error result with its reasons. Optional: `worker`, `execution`, `dry_run`, `queue_anyway`, `refuse_defer`. | no |
|
|
10
|
+
| `dalan_forecast` | Returns admission verdict, reasons, and available queue or worker estimates without queuing or reserving a job. Pass `assignment`, with optional `worker` and `execution`. CLI equivalent: `dalan forecast`. | yes |
|
|
11
|
+
| `dalan_correct` | Queues a new job that corrects an earlier job you submitted, like `dalan submit --revises`. Pass `revises` (the earlier request_id) and `assignment`. The earlier job is not cancelled, but its result can no longer be accepted. | no |
|
|
12
|
+
| `dalan_cancel` | Cancels a queued job, or asks the worker on a claimed job to stop, like `dalan cancel`. Optional `reason`. | no |
|
|
13
|
+
| `dalan_accept` | Records your verdict on a finished job, like `dalan accept` or `dalan reject`. Pass `request_id` and `verdict` (`accept` or `reject`); optional `note`. | no |
|
|
10
14
|
| `dalan_wait` | Waits for a finished report, question, blocker, cancellation, worker break or timeout. `timeout_seconds` defaults to 120 and is capped at 300. A timeout returns `status: timeout`; call again to keep waiting. | yes |
|
|
11
15
|
| `dalan_result` | Returns the job state and, once finished, the report. Secrets are redacted. Output over 32 KiB is cut at 32 KiB and ends with a note on how to read the rest. | yes |
|
|
16
|
+
| `dalan_questions` | Lists identified questions for a job. Pass `id` (the request_id). Human-only questions require operator action. | yes |
|
|
17
|
+
| `dalan_answer` | Answers a question through the answer journal. Pass `id`, `question_id` and `text`. Exact retries reuse the saved attempt; different text is refused. Cannot answer human-only questions with owner authority alone. | no |
|
|
12
18
|
| `dalan_status` | Returns `dalan status --json`. | yes |
|
|
13
19
|
|
|
14
20
|
Each tool runs the matching `dalan` command with `--json`, so receipts, assignment checks and verdicts are the same as on the command line. Failures are tool results with `isError: true` and a message; they never end the server. Only protocol messages go to standard output; logs go to standard error.
|
|
15
21
|
|
|
22
|
+
## When the worker asks a question
|
|
23
|
+
|
|
24
|
+
If `dalan_wait` reports a waiting question, call `dalan_questions` with the job's `id`. Show the question to the person and ask for their answer; do not invent one. Send their reply with `dalan_answer`, using that same `id`, the returned `question_id` and their answer as `text`, then call `dalan_wait` again with `request_id`. Keep the same bridge home and request ID; do not submit another job.
|
|
25
|
+
|
|
26
|
+
If the question is marked human-only, stop and ask the person to take the required operator action instead. Owner authority alone cannot answer it. After the person confirms the action, call `dalan_wait` again. If there is only a blocker and no identified question, use `dalan_result` to show it and wait for its resolution. Questions and blockers do not authorize scope changes, spending, access grants or new result destinations.
|
|
27
|
+
|
|
28
|
+
Answers starting with a dash are refused; ask the person to rephrase so the answer does not start with a dash. Answers are journaled before sending. Resending the exact same answer to the same question is safe: it reuses the saved attempt rather than sending a second answer. After a lost reply, the same envelope may be retried; a different second answer is refused. Keep the same `DALAN_HOME` and journal. On an error, read `dalan_questions`/`dalan_result` to reconcile before retrying; do not change the text or delete the journal to bypass a refusal.
|
|
29
|
+
|
|
16
30
|
## Access
|
|
17
31
|
|
|
18
32
|
The server has the access of the user who starts it: it reaches the bridge through the local admin socket, as the CLI does. It opens no network port and has no separate credential. Do not run it for someone you would not give `dalan` to. For a service made by `dalan service install`, `dalan mcp` finds the remembered service home, so you set nothing. For a `dalan try` bridge or a bridge you started by hand, set `DALAN_HOME` in this MCP server's environment to the exact home of the running bridge, using the Home line that the running trial printed. A local `dalan try` prints `$HOME/.local/share/dalan-trial`; a public trial prints its own home. A trial home is not the CLI's normal default, and `dalan mcp` does not stop to ask which home you meant.
|