@tnunamak/dalan 0.5.2 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -25
- package/PROTOCOL.md +16 -4
- package/README.md +127 -260
- package/SECURITY.md +1 -1
- package/bin/dalan.mjs +5 -0
- package/bin/dot-worker.mjs +35 -26
- package/docs/chatgpt-worker-onboarding.md +5 -5
- package/docs/claude-worker-onboarding.md +5 -5
- package/docs/codex-to-muse.md +175 -0
- package/docs/connect-chatgpt.md +9 -4
- package/docs/connection-longevity.md +7 -1
- package/docs/dalan-upgrade.md +17 -13
- package/docs/deadman.md +5 -3
- package/docs/local-agent-mcp.md +8 -6
- package/docs/manual-setup.md +8 -8
- package/docs/mirror-fetch.md +1 -2
- package/docs/operations.md +90 -42
- package/docs/operator-duties.md +1 -1
- package/docs/owner-integrator.md +2 -2
- package/docs/portable-auth-profile.md +12 -14
- package/docs/pr-head-reviewer.md +21 -5
- package/docs/pr-preflight.md +2 -0
- package/docs/pull-queue.md +131 -0
- package/docs/pull-workers.md +7 -10
- package/docs/redaction.md +1 -1
- package/docs/service-setup.md +56 -3
- package/docs/setup-reference.md +1 -1
- package/docs/t3-integration.md +2 -0
- package/docs/t3-result-retry-delivery.md +2 -2
- package/docs/t3-reverse-control.md +7 -7
- package/docs/usage.md +19 -15
- package/docs/worker-clients.md +18 -13
- package/package.json +3 -1
- package/scripts/dalan-try-selfcheck.mjs +29 -0
- package/scripts/worker-bridge-setup.mjs +1 -1
- package/src/acp-bridge.mjs +18 -12
- package/src/as.mjs +41 -0
- package/src/child-exit.mjs +18 -0
- package/src/child-registry.mjs +94 -0
- package/src/cli-help.mjs +25 -11
- package/src/demo-worker.mjs +2 -2
- package/src/drained-owner.mjs +26 -0
- package/src/drained-slot.mjs +20 -3
- package/src/mcp-outcome.mjs +10 -1
- package/src/mcp-sse.mjs +62 -0
- package/src/pr-head-reviewer.mjs +3 -3
- package/src/process-inspection.mjs +36 -0
- package/src/pull-queue.mjs +159 -0
- package/src/route-setting.mjs +24 -0
- package/src/server.mjs +157 -29
- package/src/service-migrate-workers.mjs +113 -0
- package/src/service.mjs +388 -0
- package/src/setup.mjs +63 -0
- package/src/store.mjs +21 -9
- package/src/tool-registry.mjs +3 -1
- package/src/try-exposure.mjs +908 -0
- package/src/try-hosted-clients.mjs +46 -0
- package/src/try-hosted.mjs +444 -0
- package/src/try-selfcheck.mjs +168 -0
- package/src/try.mjs +63 -17
- package/src/workers.mjs +33 -23
- package/src/workspace.mjs +10 -3
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# Submit one read-only result to an eligible pool
|
|
2
|
+
|
|
3
|
+
A policy work order lets one of several named workers take a job. It creates one
|
|
4
|
+
ordinary assignment when the first eligible worker claims it. Later attempts stay
|
|
5
|
+
with that worker; Dalan does not assign the slot to another worker automatically.
|
|
6
|
+
|
|
7
|
+
Every candidate must already have access to the job's repository. Listing and
|
|
8
|
+
acquisition both check the current repository grant and approved destination.
|
|
9
|
+
Listing a job does not reserve it or authorize work to start.
|
|
10
|
+
|
|
11
|
+
For workers without a destination declaration, put an explicit `valid_until`
|
|
12
|
+
deadline inside the assignment file itself (the `review.json` passed to `--file`
|
|
13
|
+
carries a `valid_until` field), then submit:
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
dalan submit --file review.json --eligible alpha,beta --execution worker
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The assignment must use `execution_scope: "read-only"`. Version 1 accepts
|
|
20
|
+
`execution=none` or `execution=worker`, one result only (a single worker's report,
|
|
21
|
+
not several) and explicit worker names. It rejects host execution, protocol jobs,
|
|
22
|
+
fan-out greater than 1, worker classes, superseding, command keys and backend
|
|
23
|
+
capability requirements (the `--require-capability` option is for direct host
|
|
24
|
+
jobs, not pool jobs). The effective deadline is the earlier of the policy
|
|
25
|
+
deadline and the assignment's `valid_until`.
|
|
26
|
+
|
|
27
|
+
For workers with a declared destination, start with a policy file containing this
|
|
28
|
+
routing object (a destination is declared in the worker's profile; the dry-run
|
|
29
|
+
preview below shows each candidate's destination disclosure):
|
|
30
|
+
|
|
31
|
+
```json
|
|
32
|
+
{
|
|
33
|
+
"version": 1,
|
|
34
|
+
"allowed_workers": ["alpha", "beta"],
|
|
35
|
+
"fan_out": 1,
|
|
36
|
+
"deadline_at": "2026-12-01T00:00:00Z"
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Run `dalan submit --file review.json --policy policy.json --execution worker --dry-run --json`.
|
|
41
|
+
The preview stores no job and returns `destination_disclosures` for each candidate.
|
|
42
|
+
Review each disclosure. Add its exact `revision` to the policy file:
|
|
43
|
+
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"routing": {
|
|
47
|
+
"version": 1,
|
|
48
|
+
"allowed_workers": ["alpha", "beta"],
|
|
49
|
+
"fan_out": 1,
|
|
50
|
+
"deadline_at": "2026-12-01T00:00:00Z"
|
|
51
|
+
},
|
|
52
|
+
"destination_revisions": {
|
|
53
|
+
"alpha": "sha256:<alpha revision from the preview>",
|
|
54
|
+
"beta": "sha256:<beta revision from the preview>"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Then run:
|
|
60
|
+
|
|
61
|
+
```sh
|
|
62
|
+
dalan submit --file review.json --policy policy.json --execution worker --dry-run
|
|
63
|
+
dalan submit --file review.json --policy policy.json --execution worker
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
A policy file can also contain the routing object directly when no candidate needs
|
|
67
|
+
a destination revision. The owner can use `get`, `wait`, `inbox` and `cancel` with
|
|
68
|
+
the submitted request ID before or after acquisition. Reports and decisions use
|
|
69
|
+
that same request ID and the same saved owner capability.
|
|
70
|
+
|
|
71
|
+
## Worker flow without a connector refresh
|
|
72
|
+
|
|
73
|
+
Workers connected over MCP use these tools; `list_pending` and `claim` are MCP
|
|
74
|
+
tools, not `dalan` commands.
|
|
75
|
+
|
|
76
|
+
1. Call `list_pending`. Its existing `assignments` list is unchanged. The new
|
|
77
|
+
`policy_work.items` field contains up to 50 eligible work orders, with priority,
|
|
78
|
+
original queue time and deadline. Normal priority precedes background work.
|
|
79
|
+
2. If `policy_work.next_page_request_id` is present, call the existing `get` tool
|
|
80
|
+
with that value as `request_id`. Continue until it is null. Pagination captures
|
|
81
|
+
a queue high-water mark; jobs added later appear on the next fresh list. Every
|
|
82
|
+
page checks current eligibility. Page tokens are encrypted and bound to the
|
|
83
|
+
authenticated worker, and survive a bridge restart.
|
|
84
|
+
3. Call `get` with an offered job's `request_id` to read its assignment. Call
|
|
85
|
+
`claim` with that ID, a claimant and a fresh `acquisition_id`. Respect the
|
|
86
|
+
existing free-lane and pause limits. A race has one winner.
|
|
87
|
+
4. Use the returned `request_id` and `claim_id` with the existing progress,
|
|
88
|
+
workspace and finish tools. The receipt includes a distinct `work_order_id`. Once acquired, `child_request_id`
|
|
89
|
+
equals the original submitted `request_id`; the child keeps that reserved ID.
|
|
90
|
+
A lost-reply retry must use the original claimant, lease and acquisition ID.
|
|
91
|
+
5. Read the owner's decision separately. Completion does not accept the result.
|
|
92
|
+
|
|
93
|
+
The eligible backlog is independent of available lanes. An unauthorized worker
|
|
94
|
+
sees neither work-order titles nor a global backlog count. Repository revocation,
|
|
95
|
+
destination drift or connection-set drift removes an unacquired order from that
|
|
96
|
+
worker's claimable set and refuses a new acquisition. Once a child exists, it
|
|
97
|
+
follows ordinary assignment listing rules, including a visible `blocked:true` entry
|
|
98
|
+
when destination policy blocks it. A committed live acquisition retry follows the
|
|
99
|
+
existing grant fences; changing policy does not silently replace its holder.
|
|
100
|
+
|
|
101
|
+
Acquisition commits the child, claim and parent winner in one SQLite transaction.
|
|
102
|
+
A crash before commit leaves the work order available with no child or claim.
|
|
103
|
+
A crash after commit can lose the reply; retrying the same acquisition returns
|
|
104
|
+
the saved child and claim, subject to the ordinary live-grant checks.
|
|
105
|
+
|
|
106
|
+
At its deadline, an unacquired work order is cancelled and no child is created.
|
|
107
|
+
After acquisition, the deadline becomes the child's `valid_until`; ordinary expiry
|
|
108
|
+
rules cancel a queued child, while an active claim is untouched. The deadline does
|
|
109
|
+
not stop an already active claim. Cancel the submitted request ID to revoke an
|
|
110
|
+
active child's authority. Cancellation does not prove external compute stopped.
|
|
111
|
+
The child's report and owner decision remain linked by the submitted request ID
|
|
112
|
+
and `work_order_id`; a finished report is not an accepted result.
|
|
113
|
+
|
|
114
|
+
Version 1 discovers unacquired work through polling `list_pending`. An unacquired
|
|
115
|
+
work order is not a queued assignment for the protocol's re-wake rule, so it adds
|
|
116
|
+
no availability event. Existing events for materialized
|
|
117
|
+
children remain hints. Lease expiry and abandonment use the ordinary child
|
|
118
|
+
recovery path with a fresh acquisition ID, once prior work has verifiably stopped.
|
|
119
|
+
There is no second result slot or cross-worker retry.
|
|
120
|
+
|
|
121
|
+
If the acquired worker is removed or its connection is revoked, lease expiry does
|
|
122
|
+
not offer the order to a different worker. The owner must cancel the submitted
|
|
123
|
+
request ID and submit a fresh request ID for the remaining eligible workers.
|
|
124
|
+
Check that any previous external work has stopped before resubmitting; bridge
|
|
125
|
+
cancellation alone cannot prove that. The cancelled order and its history remain
|
|
126
|
+
separate from the replacement and its result.
|
|
127
|
+
|
|
128
|
+
Pool submission uses the existing MCP tool definitions.
|
|
129
|
+
`pull-catalog-hash-test.mjs` pins all four profiles with T3 tools off and on.
|
|
130
|
+
The database upgrade is additive schema 66; use a pre-upgrade backup to return to
|
|
131
|
+
an older Dalan build.
|
package/docs/pull-workers.md
CHANGED
|
@@ -48,11 +48,13 @@ Each worker has its own URL. A hook with one worker's URL cannot see other worke
|
|
|
48
48
|
|
|
49
49
|
The answer is exactly `{"work":true}` or `{"work":false}`. It has no job ids, titles or counts. A wrong token gets `404`, the same as any unknown path. The bridge recomputes the answer at most once every 10 seconds.
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
On the bridge computer, run `dalan connect signal-token --worker NAME` once. Transfer the private file it names to the worker host over a trusted channel and keep it mode 0600. The hook needs only that file, not Dalan's owner socket or connector credentials.
|
|
52
|
+
|
|
53
|
+
On the worker host, set `SIGNAL_FILE` to that file's absolute path and replace `wake` with your worker client's supported start command. Run this hook at the [poll interval below](#poll-interval-and-url-secrecy). Do not echo the URL or enable shell tracing.
|
|
52
54
|
|
|
53
55
|
```sh
|
|
54
|
-
SIGNAL_FILE
|
|
55
|
-
SIGNAL_URL=$(cat "$SIGNAL_FILE")
|
|
56
|
+
SIGNAL_FILE=/absolute/path/to/private-signal-url
|
|
57
|
+
SIGNAL_URL=$(cat "$SIGNAL_FILE") || exit 1
|
|
56
58
|
curl -fsS "$SIGNAL_URL" | grep -q '"work":true' && wake
|
|
57
59
|
```
|
|
58
60
|
|
|
@@ -70,7 +72,7 @@ A vendor run can stop in the middle of a job. Resume wake exposes an expired own
|
|
|
70
72
|
- **Progress nudge (opt in per worker).** In `workers.json` set `"guidance": "resume"` for the worker. `claim` and `get` then add acquisition and progress guidance. The progress interval is half the idle threshold, rounded down to a multiple of 30 seconds, with a minimum of 30 seconds. Thresholds of `120000`, `240000`, and `45000` ms produce intervals of 1 minute, 2 minutes, and 30 seconds. For the default threshold the text is: "Generate one random acquisition_id per run and pass it on every claim call, including retries. Post progress at least every 1 minute with what is done and what remains, so a resumed run can continue; if your run may end, post progress first." With the switch at 0, guidance uses the default threshold. The only valid guidance value is `"resume"`.
|
|
71
73
|
- **Measure.** `dalan metrics --json` has `resume_wake.by_worker.<worker>`: `resumed`, `lease_expiry_retries`, and `time_to_finish_resumed` against `time_to_finish_lease_expiry` (first queued event to completed, p50/p90). `resume_wake.duplicate_epoch_claims` must be 0. The text form prints `resumed=` and `duplicate_epochs=`. Falsifier: resumed jobs do not finish sooner than lease-expiry jobs.
|
|
72
74
|
|
|
73
|
-
|
|
75
|
+
Maintainer check: from a source checkout installed with `npm ci`, run `node scripts/resume-wake-test.mjs`. The npm package does not include this script.
|
|
74
76
|
|
|
75
77
|
### Poll interval and URL secrecy
|
|
76
78
|
|
|
@@ -87,11 +89,6 @@ An unclaimed job stays queued unless a cancellation rule applies. **Preparation
|
|
|
87
89
|
|
|
88
90
|
## Vendor notes
|
|
89
91
|
|
|
90
|
-
|
|
91
|
-
|---|---|---|---|
|
|
92
|
-
| Native scheduler | Periodic hook | Timed worker check | Example configuration |
|
|
93
|
-
| Grok Bot | Routines, at least 5 min apart (documented) | Not documented | Needs a Grok account |
|
|
94
|
-
| Grok automations | Daily or less often (documented) | Signed webhook trigger (documented) | Needs a Grok account |
|
|
95
|
-
| Hosted worker | Scheduled background checks | Client-specific | Verify availability for the target account |
|
|
92
|
+
Scheduling and hook support vary by product, account and workspace policy. Check the vendor's current documentation and the controls available in the intended account before choosing a pattern. Dalan supplies neither a scheduler nor a worker-start command. Until that account's scheduled or hook-driven path has completed a real job, use the manual pattern above.
|
|
96
93
|
|
|
97
94
|
More detail: the "Wake signal for hook-driven workers" section of [portable-auth-profile.md](portable-auth-profile.md) and the hook-driven worker example in [scripts/live-trial/README.md](https://github.com/tnunamak/dalan/blob/main/scripts/live-trial/README.md).
|
package/docs/redaction.md
CHANGED
|
@@ -18,7 +18,7 @@ The tests are in `scripts/secret-sinks-redaction-test.mjs`, `scripts/redaction-m
|
|
|
18
18
|
|
|
19
19
|
## Known residual risks
|
|
20
20
|
|
|
21
|
-
Redaction catches accidental leaks of registered secrets and known formats
|
|
21
|
+
Redaction catches accidental leaks of registered secrets and known formats, including base64 forms of registered values. It cannot prevent deliberate disclosure through unrecognized encodings or transformations. The following cases can pass unmasked.
|
|
22
22
|
|
|
23
23
|
- **Encoded unknown values:** a credential that Dalan did not register is found only in plain text. Its base64 or percent-encoded form, or a JWT payload, is not decoded.
|
|
24
24
|
- **Split across log lines:** a secret that is split over two separate log entries is not found, because each entry is masked on its own.
|
package/docs/service-setup.md
CHANGED
|
@@ -2,6 +2,57 @@
|
|
|
2
2
|
|
|
3
3
|
Use this guide after a first job works with `dalan try`, when you want a bridge that keeps running or a worker on another computer. Built-in OAuth binds the bridge to `127.0.0.1`; a tunnel or HTTPS reverse proxy forwards worker traffic to that listener. The owner CLI uses a private Unix socket, which must never be exposed through the proxy.
|
|
4
4
|
|
|
5
|
+
## Install one bridge for several workers
|
|
6
|
+
|
|
7
|
+
The Linux-only `dalan service install` creates a systemd user service and registers its HTTPS origin as a Gozar service route. Gozar records and verifies an origin-to-target route that your reverse proxy already serves; it does not edit the proxy. The bridge uses built-in OAuth. Moving a connector to the new URL requires reauthorization and a catalog refresh. All workers use the same stable catalog. The process-wide `legacy-v46` setting remains available for other installations. Its auth keys, worker allowlists and job queue stay in one private home.
|
|
8
|
+
|
|
9
|
+
First prepare the public origin so it forwards to the address in `--target`. Preserve the public `Host` header. The bridge rejects requests with another Host, including requests that try to replace it with `X-Forwarded-Host`. The proxy must pass the secret MCP path, the OAuth discovery and authorization paths, `/signal/*` when used, and `/.well-known/gozar/service` with its query string. TLS terminates at the proxy. Keep the secret path out of proxy logs.
|
|
10
|
+
|
|
11
|
+
For existing installations, create the new home and copy each worker's repository allowlist. Replace the example paths with the old bridge homes on this computer:
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
dalan service migrate-workers \
|
|
15
|
+
--home "$HOME/.local/share/dalan-service" \
|
|
16
|
+
--source "$HOME/.config/dot-bridge/workers.json" \
|
|
17
|
+
--source "$HOME/OLD_BRIDGE_TWO/.config/dot-bridge/workers.json" \
|
|
18
|
+
--source "$HOME/OLD_BRIDGE_THREE/.config/dot-bridge/workers.json"
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
The helper reads the source files without changing them. If an older home has no `workers.json`, it can read the adjacent `workers-repos.json` migration journal. It preserves worker names and repository allowlists, and copies supported worker capabilities and guidance. It does not copy OAuth registrations, tokens, jobs or results. The new bridge starts with `default_execution: none`. Workspace access defaults to denied; add `--workspace-worker NAME` for each worker that needs an explicit workspace grant. This option records the owner's grant; it does not require an earlier audit record. Existing explicit `workspaceAllowed` and T3 capability settings are retained. Destination declarations are copied, but old destination approvals bind old jobs and connections, so each new job requires a fresh approval.
|
|
22
|
+
|
|
23
|
+
Optionally pass `--source-db PATH` for each old job database. The helper opens it read-only and writes a private `service-migration.json` checklist containing active subscription counts, callback origins and destination approval counts. It omits callback paths, query strings, signing secrets and encrypted records. This checklist grants no authority. Re-enrol every connector, call `events/subscribe` with a fresh signing key, and approve each new destination revision. Without `--source-db`, the checklist still records those required steps but has no old subscription inventory. For a brand-new bridge, skip migration and pass `--worker NAME` once for each worker instead; those initial workers have empty repository allowlists, no capabilities, and no host execution.
|
|
24
|
+
|
|
25
|
+
Replace `192.0.2.10` below with the address configured on this computer, then run the install after the proxy route reaches the target:
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
dalan service install \
|
|
29
|
+
--home "$HOME/.local/share/dalan-service" \
|
|
30
|
+
--public-url https://bridge.example.com \
|
|
31
|
+
--port 8787 \
|
|
32
|
+
--target 192.0.2.10:8787 \
|
|
33
|
+
--lan-port 8787
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
The Dalan process listens on `127.0.0.1:8787`. With `--lan-port`, systemd opens the address and matching port in `--target` and forwards it to that loopback listener. A separate target requires this explicit option, even when its numeric port equals the bridge port. Use a distinct non-wildcard address configured on this computer: the example binds 192.0.2.10:8787 separately from 127.0.0.1:8787. Do not use 0.0.0.0 for a same-port forwarder because it collides with loopback. Challenge verification binds the actual receiving socket port to the declared target port; its challenge path has no port override. Translating to a different numeric port is allowed only with an explicit nonempty trusted `--verify-cmd COMMAND`, not challenge verification. Add `--enable-workspace` or `--enable-t3` to enable those host capabilities; each worker must also have its own workspace or T3 grant. Without these options both host capabilities are disabled. If Gozar runs on the same computer and can reach loopback directly, set `--target 127.0.0.1:8787`. `gozar service add` runs after systemd starts the bridge; install succeeds only when Gozar returns a verified route. If the origin filters the Gozar verifier by source IP, pass the trusted host check with `--verify-cmd COMMAND`.
|
|
37
|
+
|
|
38
|
+
Set `DALAN_HOME` to the selected home. The private MCP URL is stored in `$DALAN_HOME/resource-url` with mode 0600. Point the client's connector at that URL and sign in separately for each worker. Repository jobs remain blocked until their allowlists are present. `dalan service install` creates a unit named `dalan-<10 hex>.service`; use the exact unit name printed by install with `systemctl --user status UNIT`, then confirm the public origin returns 404 for `/admin` and accepts the secret MCP path with its original Host header.
|
|
39
|
+
|
|
40
|
+
The service starts when the systemd user manager starts. `dalan service install` does not check or warn whether user lingering is enabled. Without lingering, the user manager may start only after the user logs in after a reboot. If the bridge must start before login, ask an administrator to run `loginctl enable-linger USER` for the account that owns the bridge.
|
|
41
|
+
|
|
42
|
+
`--write-units-only` writes the systemd unit files without initializing the bridge home, starting systemd or calling Gozar. It is for offline inspection; run the normal install to finish setup.
|
|
43
|
+
|
|
44
|
+
### Restarting and backing up built-in sign-ins
|
|
45
|
+
|
|
46
|
+
With compatible code, a restart using the same private home and issuer preserves an unexpired built-in OAuth access token while its grant and connection remain live. The issuer includes the public origin and secret path. Access tokens last up to one hour.
|
|
47
|
+
|
|
48
|
+
Before an upgrade or restore, stop the bridge and every other writer and make a consistent SQLite backup. Preserve the complete active private config directory, including `as.json`, `as-jwks.json`, `as-cookie-keys.json`, `as.sqlite` and its sibling `as-storage.key`; the keys alone cannot restore sign-ins. Follow the [backup and rollback steps](operations.md#upgrade-and-rollback).
|
|
49
|
+
|
|
50
|
+
For the built-in public-client flow, a client that loses a refresh response can recover it only by retrying the identical request within five seconds, while the successor token and connection remain live. A retry after that window can fail and require the client to pair again. This is not a promise of recovery after a longer outage or across incompatible code or storage changes.
|
|
51
|
+
|
|
52
|
+
## Legacy setup with `scripts/worker-bridge-setup.mjs`
|
|
53
|
+
|
|
54
|
+
The sections below document the separate legacy setup script, not `dalan service install`. The script supports the Linux and macOS setup options shown below. In particular, its `dot-bridge-NAME.service` unit name and lingering warning do not apply to `dalan service install`.
|
|
55
|
+
|
|
5
56
|
## Keep a local trial working
|
|
6
57
|
|
|
7
58
|
Setup has no local-only service mode, and it needs either `--public-url https://HOST` or `--expose tailscale` (or `--expose ngrok`, for the [ngrok](https://ngrok.com/) tunnel service), so a service always has an HTTPS origin. Dalan does not supply a launchd or systemd recipe for a bridge that serves only `127.0.0.1`, and it cannot convert the paired trial home into a service. Do not point setup at the trial home: it needs a fresh home.
|
|
@@ -27,7 +78,7 @@ If you want only a bridge on this computer that stays up, run the server in a te
|
|
|
27
78
|
|
|
28
79
|
## Owner setup
|
|
29
80
|
|
|
30
|
-
You need the installed package (from `npm install -g @tnunamak/dalan`) or a checkout, a stable Node.js 24 LTS or newer executable, a fresh private bridge home, and a free port from 1024 through 65535. Use short, space-free paths without symlinks; on Linux, starting the service needs a running systemd user manager; on macOS, it needs the user's launchd domain (`user/UID`), which exists while that user has a login session.
|
|
81
|
+
You need the installed package (from `npm install -g @tnunamak/dalan`) or a checkout, a stable Node.js 24 LTS or newer executable, a fresh private bridge home, and a free port from 1024 through 65535. Use short, space-free paths without symlinks; on Linux, starting the service needs a running systemd user manager; on macOS, it needs the user's launchd domain (`user/UID`), which exists while that user has a login session. `worker-bridge-setup.mjs` does not check the Node.js version.
|
|
31
82
|
|
|
32
83
|
On macOS the service is a LaunchAgent. A LaunchAgent starts when you log in to the Mac and stops when you log out, so it does not run after a reboot until someone logs in and you cannot rely on it for unattended availability.
|
|
33
84
|
|
|
@@ -48,7 +99,7 @@ The domain and label are the ones that `worker-bridge-setup.mjs` writes.
|
|
|
48
99
|
|
|
49
100
|
The bridge and the worker come back by separate rules:
|
|
50
101
|
|
|
51
|
-
- **Bridge, Linux.** The generated unit is wanted by `default.target`, so it starts when your systemd user manager starts. Without lingering, that is your first login after the reboot; with lingering (an administrator runs `loginctl enable-linger USER`; setup warns when it is off), it is the boot. Check with `systemctl --user is-active dot-bridge-NAME.service`, which must print `active`.
|
|
102
|
+
- **Bridge, Linux.** The generated unit is wanted by `default.target`, so it starts when your systemd user manager starts. Without lingering, that is your first login after the reboot; with lingering (an administrator runs `loginctl enable-linger USER`; the legacy setup script warns when it is off), it is the boot. Check with `systemctl --user is-active dot-bridge-NAME.service`, which must print `active`.
|
|
52
103
|
- **Bridge, macOS.** It starts at your login, as described above.
|
|
53
104
|
- **Worker, both systems.** Dalan has no worker scheduler, and nothing wakes the worker when the bridge returns. Jobs wait in the queue until a worker run claims them. The supported way is manual, and it takes three steps. First wait until `dalan status --json` answers, with `DALAN_HOME` set to the service home. Then prompt the worker in its own client, for example: "Use Dalan to list pending work. Claim the oldest job you may claim, read it, report progress and finish it exactly as instructed. Stop when nothing is pending." In Codex, `codex exec "PROMPT" < /dev/null` runs that without a screen (see [worker clients](worker-clients.md)). Last, check that the job moved: `dalan wait REQUEST_ID` returns `finished`, or `dalan get REQUEST_ID --json` shows the report.
|
|
54
105
|
|
|
@@ -148,9 +199,11 @@ Setup with `--expose tailscale` or `--expose ngrok` can leave the home, service
|
|
|
148
199
|
The retry has the form below. It needs the exposure record that those two modes save, so it does not work for an install made with an explicit `--public-url`.
|
|
149
200
|
|
|
150
201
|
```sh
|
|
151
|
-
node scripts/worker-bridge-setup.mjs --retry-public-check --worker NAME --public-url EXPOSURE_URL --port PORT --home HOME_PATH
|
|
202
|
+
node "$(npm root -g)/@tnunamak/dalan/scripts/worker-bridge-setup.mjs" --retry-public-check --worker NAME --public-url EXPOSURE_URL --port PORT --home HOME_PATH
|
|
152
203
|
```
|
|
153
204
|
|
|
205
|
+
From a source checkout, use `node scripts/worker-bridge-setup.mjs` with the same options.
|
|
206
|
+
|
|
154
207
|
It should mark the existing exposure verified. A 404 from unauthenticated `/admin` proves the expected public route answers, not that OAuth pairing or a worker job works, so complete both separately.
|
|
155
208
|
|
|
156
209
|
## Remove a generated service
|
package/docs/setup-reference.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Dalan setup reference
|
|
2
2
|
|
|
3
|
-
Use this page after the [README](../README.md) first-job path works. It lists server settings, requester commands, worker tools and legacy service files. The package and CLI
|
|
3
|
+
Use this page after the [README](../README.md) first-job path works. It lists server settings, requester commands, worker tools and legacy service files. The npm package is `@tnunamak/dalan` and the CLI command is `dalan`; the command names of the `dot-bridge` package are not installed.
|
|
4
4
|
|
|
5
5
|
## Environment and storage
|
|
6
6
|
|
package/docs/t3-integration.md
CHANGED
|
@@ -28,6 +28,8 @@ A separate, opt-in feature lets a worker list, read and write T3 threads. It giv
|
|
|
28
28
|
|
|
29
29
|
Quiet delivery (`none`) is the default. Only for an explicit visible task-thread notice, obtain the exact owner thread ID from `t3_thread_configuration` (current thread). A delegated child returning to its parent may use `orchestrator_capabilities.parentThreadId`. Verify the chosen ID and its environment with `t3code --json threads inspect --thread ID`. T3 delivery requires a CLI that supports `threads inspect`; metadata lookup fails closed if that command fails, without falling back to a transcript read, and quiet delivery needs no T3 CLI. Do not guess the ID from cwd or a recent thread. Protected top-level threads retain notices quietly.
|
|
30
30
|
|
|
31
|
+
After verifying the destination, submit with `dalan submit --worker NAME --execution none --deliver t3:THREAD_ID --file job.json --json`. Replace `NAME`, `THREAD_ID` and `job.json` with your worker, verified destination and assignment file. For an ordinary quiet job, keep `--deliver none`.
|
|
32
|
+
|
|
31
33
|
<a id="main-thread-guard"></a>
|
|
32
34
|
|
|
33
35
|
## Main-thread guard
|
|
@@ -10,11 +10,11 @@ By default, result delivery selects `steer_active` for the latest active run; if
|
|
|
10
10
|
|
|
11
11
|
## Focused mock check
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
From a source checkout installed with `npm ci`, run `node scripts/t3-result-delivery-test.mjs`; the npm package does not include this test script. The mock persists a receiver receipt, message, run and effect, drops the first response, then accepts a retry from a second transport session. It verifies one persisted effect and stable IDs, but it does not prove behavior against a real receiver.
|
|
14
14
|
|
|
15
15
|
## Owner-run live proof
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
This harness requires a source checkout installed with `npm ci` and the matching local T3 installation described below; its script is not included in the npm package. It defaults to dry-run. It reads the supplied SQLite database in read-only mode, verifies that the explicit project maps to the exact supplied repository root, and prints the planned operation. It does not issue auth or dispatch unless `--execute` is present. For execution, it creates an empty scratch thread with the installed `@bvdm/t3code-cli` internal API and a `thread.create` command. The pinned API package version and exported method shapes are checked first. The scratch uses model metadata with approval-required runtime and plan interaction settings; it sends no provider prompt and never calls `launchThread`.
|
|
18
18
|
|
|
19
19
|
Each of two result sends uses the real `dispatchT3Result` path, which creates a fresh auth and WebSocket session. Before and after each send, the harness opens the supplied database read-only and checks command receipt, stable message, thread run, and outbox counts. It requires one persisted receipt, message, and held run after the first send; no `provider-turn.start` outbox effect or running/starting run before or after either send; and identical scoped counts after the retry. The scratch thread is left held for owner review. The harness does not archive it or release the run.
|
|
20
20
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
With `DALAN_ENABLE_T3_TOOLS=1`, the bridge exposes a small T3 thread wrapper (list, read, create, send, wait and set) through its existing OAuth MCP connection. The wrapper uses `t3code --json --origin http://127.0.0.1:3773` with argument arrays. It can address any T3 project or thread the local CLI can address by an ID of at most 128 bytes; the other tools reject a longer ID from a list result. The bridge does not scope a thread to the worker that calls it: a worker with the `t3` capability has the owner's full authority over every local thread. The tools are off by default, and a fresh `dalan init` worker profile has no `t3` capability. The CLI currently obtains a short-lived administrative T3 session for each operation; the bridge's approved OAuth subject and per-tool scopes remain the remote boundary.
|
|
4
4
|
|
|
5
|
-
These calls use owner-granted, job-independent authority. They require no `request_id` or `claim_id` and have no assignment epoch, so they are outside job-scoped authority checks, and job expiry or cancellation does not revoke them. To
|
|
5
|
+
These calls use owner-granted, job-independent authority. They require no `request_id` or `claim_id` and have no assignment epoch, so they are outside job-scoped authority checks, and job expiry or cancellation does not revoke them. To advertise the six thread tools, set `DALAN_ENABLE_T3_TOOLS=1`; each call also requires the worker's `capabilities: ["t3"]`, including for the legacy single-worker profile. When the global setting is off, direct calls are rejected as unknown tools. Capability, OAuth scope and audit admission always apply.
|
|
6
6
|
|
|
7
7
|
| MCP tool | Scope | Operation |
|
|
8
8
|
| --- | --- | --- |
|
|
@@ -14,9 +14,9 @@ These calls use owner-granted, job-independent authority. They require no `reque
|
|
|
14
14
|
| `t3_thread_set` | `dalan.work` | Change a thread's provider, model, effort, permission or mode. |
|
|
15
15
|
| `notify_owner` | `dalan.work` | Publish a short message through the configured ntfy alerts path. |
|
|
16
16
|
|
|
17
|
-
`dalan tell "text"` adds a durable lightweight message to a worker's `list_pending` inbox and emits the existing `assignment.available` event with `{message_id,title}`. The event uses the signed webhook retry path, so
|
|
17
|
+
`dalan tell "text"` adds a durable lightweight message to a worker's `list_pending` inbox and emits the existing `assignment.available` event with `{message_id,title}`. The event uses the signed webhook retry path, so an existing subscription can notify a client that supports wake-up. The worker reads it with `get {request_id: message_id}` and removes it from the pending list with `ack_message {message_id}`. Messages do not need assignment claim or finish. `tell` accepts `--json` and `--worker NAME` (default: `dot` if that worker exists, else the only configured worker; with several workers and no `dot`, pass `--worker`); `dalan untell MESSAGE_ID [--worker NAME]` withdraws a pending message.
|
|
18
18
|
|
|
19
|
-
The
|
|
19
|
+
The `notify_owner` tool retains its `t3` capability, work scope and audit checks. Modern catalogs advertise it independently of `DALAN_ENABLE_T3_TOOLS`; this flag controls only the six `t3_thread_*` operations. A worker without `t3` can see the name but its call is denied and audited. The `legacy-v46` pin advertises no notification tool. The earlier notification alias was removed.
|
|
20
20
|
|
|
21
21
|
## Notification retries outside the job lifecycle
|
|
22
22
|
|
|
@@ -49,7 +49,7 @@ Audit admission uses persisted rolling windows per `(worker, subject)`. Each den
|
|
|
49
49
|
Before refreshing, enable `DALAN_ENABLE_T3_TOOLS=1` and retain the worker’s `t3` capability.
|
|
50
50
|
|
|
51
51
|
1. Open the existing Dalan connector in ChatGPT and select **Refresh** to load the new tool schemas.
|
|
52
|
-
2. T3 tools use the existing `dalan.read`/`dalan.work` scopes
|
|
52
|
+
2. T3 tools use the existing `dalan.read`/`dalan.work` scopes; the legacy `dot-bridge.read`/`dot-bridge.work` names are accepted aliases. Refresh the catalog first. Sign in again if the connection is no longer live or the client cannot refresh its credentials. For an external issuer, check its offline-access requirements separately; do not add scopes merely to refresh the tool list.
|
|
53
53
|
3. Inspect the refreshed tool list for `notify_owner`, `list_tools`, `call_tool_read`, `call_tool_write`, and `ack_message`. If you recreate the connector, upload [t3-connector-icon.png](t3-connector-icon.png) as its icon.
|
|
54
54
|
4. In a disposable worker conversation, call `t3_thread_list` and `notify_owner`, then inspect `dalan audit --json`. Recheck the original subscribed worker conversation separately.
|
|
55
55
|
|
|
@@ -57,7 +57,7 @@ Do not trigger a ChatGPT reconnect from the bridge host. The connector's current
|
|
|
57
57
|
|
|
58
58
|
## Standing instruction for worker
|
|
59
59
|
|
|
60
|
-
> You can inspect the owner's T3 threads through this connector. Use `t3_thread_list` and `t3_thread_read`. They can reach any project or thread the local T3 CLI can reach by an ID of at most 128 bytes. Use `notify_owner` for a short out-of-band alert that does not start a T3 turn. Send assignment questions to the exact owner thread. Mark blockers with optional `progress.blocker:true` or start the note with `BLOCKED:` / `QUESTION:` so the bridge forwards them once if you forget. The owner can leave a lightweight message with `dalan tell`;
|
|
60
|
+
> You can inspect the owner's T3 threads through this connector. Use `t3_thread_list` and `t3_thread_read`. They can reach any project or thread the local T3 CLI can reach by an ID of at most 128 bytes. Use `notify_owner` for a short out-of-band alert that does not start a T3 turn. Send assignment questions to the exact owner thread. Mark blockers with optional `progress.blocker:true` or start the note with `BLOCKED:` / `QUESTION:` so the bridge forwards them once if you forget. The owner can leave a lightweight message with `dalan tell`; it emits an event, but whether that starts a run depends on your client. Find it in `list_pending`, read it with `get`, and call `ack_message` after reading it. It is a message, not an assignment. `run_check` can return `{check_run_id,status:"running"}`; poll `workspace_result` for completion. Upload sealed evidence with `artifact_chunk` in any claimed assignment. Call `list_tools` first to learn the other tools you may use, then run them with `call_tool_read` or `call_tool_write`. All T3 tool calls are audited.
|
|
61
61
|
|
|
62
62
|
## After adding or changing tools
|
|
63
63
|
|
|
@@ -66,7 +66,7 @@ Do not trigger a ChatGPT reconnect from the bridge host. The connector's current
|
|
|
66
66
|
|
|
67
67
|
## Catalog freeze
|
|
68
68
|
|
|
69
|
-
The `stable` catalog omits question tools, and `DALAN_CATALOG_PROFILE=questions-v1` adds `ask_question` and `consume_answer`. In either profile, the six T3 tools require `DALAN_ENABLE_T3_TOOLS=1`;
|
|
69
|
+
The `stable` catalog omits question tools, and `DALAN_CATALOG_PROFILE=questions-v1` adds `ask_question` and `consume_answer`. In either profile, the six T3 tools require `DALAN_ENABLE_T3_TOOLS=1`; `notify_owner` retains its capability check. Catalog selection does not split OAuth scopes or add pagination. Catalog v2 is the last advertised change: add abilities by registering tools, which never changes the tool list, and never through tool names, descriptions or schemas (see [Catalog v2](../PROTOCOL.md#catalog-v2)). Compare the running server catalog with the approved profile before any Refresh. If you deploy server support before your clients refresh, keep the default profile until they have refreshed their tool list and restarted.
|
|
70
70
|
|
|
71
71
|
Clients may cache tool and event schemas. Plan a connector refresh and client restart when changing the catalog.
|
|
72
72
|
|
|
@@ -76,7 +76,7 @@ The workspace install and check phases both run in a sandbox with its own networ
|
|
|
76
76
|
|
|
77
77
|
## Who may hold the t3 capability
|
|
78
78
|
|
|
79
|
-
The t3 tools act as the owner, with no per-job binding. Pairing a client never grants this capability; the bridge reads it only from the owner's `workers.json`, where it declares that a worker is the owner's own harness. The tools take any thread, project or directory and are not bound to a job, a worker or a repository. Never give `capabilities: ["t3"]` to a worker you do not fully trust with every T3 thread on the computer.
|
|
79
|
+
The t3 tools act as the owner, with no per-job binding. Pairing a client never grants this capability; the bridge reads it only from the owner's `workers.json`, where it declares that a worker is the owner's own harness. The tools take any thread, project or directory and are not bound to a job, a worker or a repository. Never give `capabilities: ["t3"]` to a worker you do not fully trust with every T3 thread on the computer. Modern catalogs advertise the same names to every worker; a worker without the capability receives a denied and audited result when it calls them. With the tools on, startup prints a notice naming each worker that holds the capability.
|
|
80
80
|
|
|
81
81
|
## Adding abilities without a Refresh
|
|
82
82
|
|
package/docs/usage.md
CHANGED
|
@@ -4,6 +4,8 @@ This is the reference for requesters who already have a working bridge. A first
|
|
|
4
4
|
|
|
5
5
|
Path examples use fresh-home defaults. For an existing installation, use the roots from `dalan paths --json`, because populated legacy roots remain active ([upgrade guide](dalan-upgrade.md)).
|
|
6
6
|
|
|
7
|
+
Jump to: [submit and review](#submit-wait-and-review-a-job), [recover after restart](#recover-results-after-a-restart), [repository jobs and checks](#repository-jobs-review-mode-and-checks), [answer questions](#worker-questions-and-owner-notes), [refused submissions](#refused-submits), [record a decision](#decisions), or [download/upload artifacts](#uploading-artifacts-worker-side).
|
|
8
|
+
|
|
7
9
|
## Submit, wait and review a job
|
|
8
10
|
|
|
9
11
|
The numbered steps below take one job from submission to your decision. The reference sections after them describe options and behavior that you may need along the way.
|
|
@@ -23,7 +25,7 @@ The numbered steps below take one job from submission to your decision. The refe
|
|
|
23
25
|
```
|
|
24
26
|
|
|
25
27
|
3. Run `dalan status --json`, then `dalan submit --worker NAME --execution none --deliver none --file first-job.json --json`. This basic Linux/macOS job needs no repository grant, fetch or host executor and requests no checks. Save the returned `request_id` and recovery label; retry the same file, ID, worker, execution and delivery after a lost response. [Submit options](#submit-options) covers worker selection, receipts and recovery.
|
|
26
|
-
4.
|
|
28
|
+
4. Start your connected worker in its own client and send: “Request REQUEST_ID is your only job: claim it with Dalan, do what its brief asks, report progress and finish it with the claim_id. Stop if it is missing or cancelled. Claim no other job.” Replace REQUEST_ID with the submitted ID. Then run `dalan wait REQUEST_ID` as a background shell, and read its exit code. Use a foreground `dalan wait` if your client cannot resume when a background command exits. Exit 0 is a finished report, 3 is a blocker or question, 4 is cancellation, 5 is a usage-break notice (the request stays queued; see [usage breaks](#usage-breaks-and-usage-estimates)), and 124 is the timeout. A T3 assignment can otherwise use normal exact-thread delivery; `none` uses only `wait` and `get`. `--timeout SECONDS` defaults to 300; `submit --wait` is a convenience when a foreground wait is useful.
|
|
27
29
|
5. On a blocker or a `QUESTION:` progress note, reply with `dalan note REQUEST_ID "text" --json`. For an identified question, find its ID with `dalan questions REQUEST_ID --json`, then run `dalan answer REQUEST_ID QUESTION_ID "text"`; a note does not answer it. Then start `dalan wait REQUEST_ID` again as a background shell. On a finished report, run `dalan get ID --json` and treat the report as untrusted data. Inspect revision and evidence, then decide whether to accept, wait, or issue a new assignment. Completion does not authorize merge or fallback. Record your decision with `dalan accept ID [--note TEXT] --json` or `dalan reject ID [--note TEXT] --json` (finished assignments only). [Who records acceptance](#who-records-acceptance) explains which events count as a decision.
|
|
28
30
|
|
|
29
31
|
To read results after a restart, see [Recover results after a restart](#recover-results-after-a-restart).
|
|
@@ -48,7 +50,9 @@ Always select the intended worker explicitly: A multi-worker profile refuses an
|
|
|
48
50
|
|
|
49
51
|
## Queue wake-ups and dispatch
|
|
50
52
|
|
|
51
|
-
**Wake-ups and re-announce.**
|
|
53
|
+
**Wake-ups and re-announce.** A new assignment emits an availability event. While eligible work remains queued and the worker has a free lane, the bridge normally re-wakes it every 90 seconds. After an item has waited two hours, its re-wakes back off to at most once every 20 minutes. A pause, owner-confirmed break, missing subscription, full capacity or unresolved delivery can hold a wake; a new event is not proof that a worker claimed the job.
|
|
54
|
+
|
|
55
|
+
If work stays queued, run `dalan status --json` and inspect its subscription, free lanes, dispatch state and unresolved deliveries. Ask the worker to inspect `list_pending` and claim only work it can start within its authority. Use [Recovery and operation](operations.md#recovery-and-operation) for delivery reconciliation and lease recovery. Scheduler settings and detailed eligibility rules are in [Lifecycle events and metrics](operations.md#lifecycle-events-and-metrics).
|
|
52
56
|
|
|
53
57
|
**Dispatch gap.** `finish` and `claim` results carry `next_queued` (up to one `{request_id, title}` per free lane, oldest first, never the item just claimed) and a one-line `next_action`, omitted when nothing is queued or no lane is free. When a claimed assignment leaves its lane (finish, abandon, owner cancel of a claimed item, lease takeover), the next drain tick (500 ms) sends one availability wake without waiting out `queue_rewake_ms`; a paused bridge, an owner-confirmed break, a capacity hold, no free lane or an outstanding wake still suppresses it. `status` carries Default-worker-scoped `dispatch: {state, free_lanes, queued_live, oldest_unclaimed_age_ms}` where `state` is `dispatch_gap` (free lanes and live queued work: the worker should claim), `supply_gap` (free lanes, nothing queued), `full`, `paused` or `unknown` (no active subscription proves capacity); `status --explain` shows `dispatch=<state>(free:F,queued:Q,oldest:Nm)` and the metrics line adds `idle_no_queue24h`/`7d` (time with nothing queued) next to `idle_while_queued`.
|
|
54
58
|
`status --json` also exposes `by_worker`: each worker has its own assignment counts, active claims, live queue, call timestamps, stale claims and queue liveness. Top-level assignment and priority counts remain global (`counts_scope` and `priority_counts_scope` are `global`). Each worker's `capacity` is bridge subscription-policy evidence, not vendor quota, availability or productive capacity. Without an active valid subscription, `free_lanes` is `null` and `state` is `unknown`; duplicate subscriptions do not add lanes, and conflicting historical principal scopes remain unknown. Top-level dispatch and liveness retain their scope (`dispatch.scope` and `liveness_scope`).
|
|
@@ -105,7 +109,7 @@ Native protocol leases instead expire at their fixed deadline and require explic
|
|
|
105
109
|
|
|
106
110
|
`dalan metrics [--since RFC3339] [--json]` (default window: 30 days) derives queue latency, claim-to-first-activity, working/blocked/waiting/idle time against claimed time, lane utilization (see below), completed reports per day by kind, rework, duplicates and objective coverage, orphaned claims, check outcomes and owner acceptance from the lifecycle event table; `dalan status --explain` adds a one-line summary. A value the events cannot show is `{"value":null,"unknown_reason":"..."}`, never zero.
|
|
107
111
|
|
|
108
|
-
**Lane utilization** uses `worker_lane_capacity` in limits.json (integer 1..10, default 6; shown in `dalan status --json`; independent of `max_claimed_outer_assignments`) as an explicit denominator, over the last 24 hours and the last 7 days, always ending now (`--since` governs only the other metrics). `utilization` = working lane time / (`worker_lane_capacity` x covered wall time); the JSON states `numerator_ms`, `denominator_ms` and `lanes`. Working time
|
|
112
|
+
**Lane utilization** uses `worker_lane_capacity` in limits.json (integer 1..10, default 6; shown in `dalan status --json`; independent of `max_claimed_outer_assignments`) as an explicit denominator, over the last 24 hours and the last 7 days, always ending now (`--since` governs only the other metrics). `utilization` = working lane time / (`worker_lane_capacity` x covered wall time); the JSON states `numerator_ms`, `denominator_ms` and `lanes`. Working time follows the event-gap rules in [Lifecycle events and metrics](operations.md#lifecycle-events-and-metrics), clipped to the window. Three shares of covered time add up to 1: `idle_while_queued` (work queued and fewer active claims than lanes), `queue_empty`, and `all_lanes_busy`. `idle_while_queued` splits in two (`idle_while_queued` stays their sum): `idle_while_fresh_queued` (every queued item has waited at most `pickup_budget_ms`, 180 s) is the normal pickup window after a submit, and `idle_while_waiting_queued` (some queued item has waited longer) indicates a wake-up or claiming gap, not a supply gap. `idle_while_waiting_by_cause` splits it into `owner_break` (an owner-confirmed usage break was active), `worker_inactive` (no claim event by the worker in the last 20 min: the worker is silent or away) and `worker_active` (the worker was working claims but left a free lane unused); `status --explain` prints them as `iwq_waiting24h=X%(break:..,worker_inactive:..,worker_active:..)`.
|
|
109
113
|
|
|
110
114
|
Each window also reports `pickup_wait` (p50/p90 of queued-to-claimed time for assignments claimed in the window), `max_concurrent_claims`, and `throughput_by_concurrency`: for each number of claims held at once, `time_ms` at that level, `completions` that finished while it held, `completions_per_hour` and `per_claim_per_hour`. Levels with less than 10 minutes of time are omitted. A per-claim rate that stays flat up to N claims and then falls shows the real parallel capacity, which is how `worker_lane_capacity` is checked.
|
|
111
115
|
|
|
@@ -119,9 +123,9 @@ A request made before owner receipts existed has no owner receipt; an operator m
|
|
|
119
123
|
|
|
120
124
|
Repository assignments are a separate branch after the first text report. Fresh workers have `repos: []`: the owner must run `dalan worker allow NAME OWNER/REPO`, then `dalan worker list NAME --json` and verify the exact intended list before submitting. The host's GitHub credential must also read that repository; its authority is not narrowed by the worker list. No local folder mapping is needed. Use a new request ID and `--execution none` for basic repository delegation without host checks; the [copyable repository example](../README.md#separate-repository-assignment) includes the pinned input and scope. Missing `repos` is legacy compatibility only, not a fresh-profile example. A full base commit SHA is required; an optional `head_sha` can pin a revision to review. The worker must not start metered model tasks for a read-only assignment. With the optional T3 Code adapter, if a fallback worker is needed, the owner chooses it after checking that worker's remaining usage quota, and records the reason. Treat stale or missing quota data as unknown.
|
|
121
125
|
|
|
122
|
-
**Review mode.** `dalan submit --deliver none --file assignment.json --review` marks the assignment as a review. The bridge stores the flag on the assignment row, outside the assignment payload and its hash; the worker never sees it in `assignment`, and the brief is not changed. `--review` sets `execution_scope` to `implementation` only when the file does not state a scope. Retrying the same `request_id` with a different `--review` setting is a `request_id conflict`. `get` shows `review: true`. In review mode `apply_patch` returns the structured error `{"error":"review_mode_read_only"}`; `list_files`, `read_file` and `workspace_result` work, and so does `run_check` when the assignment has implementation scope (a file that states `read-only` keeps it closed), and `finish` is never blocked by diff state. The worktree is checked out at `head_sha` when the assignment gives one, so checks and reads see the revision under review; `workspace_result` still diffs against `base_sha`. Without `--review`, implementation scope checks out `base_sha`, so the bridge now rejects a new implementation assignment whose `head_sha` differs from `base_sha` (`head_sha_unsupported`); pin `base_sha` to the revision to work on.
|
|
126
|
+
**Review mode.** `dalan submit --worker NAME --execution none --deliver none --file assignment.json --review` marks the assignment as a review without host checks. For a separately authorized Linux host-check review, use `--execution host` with the prerequisites below. The bridge stores the flag on the assignment row, outside the assignment payload and its hash; the worker never sees it in `assignment`, and the brief is not changed. `--review` sets `execution_scope` to `implementation` only when the file does not state a scope. Retrying the same `request_id` with a different `--review` setting is a `request_id conflict`. `get` shows `review: true`. In review mode `apply_patch` returns the structured error `{"error":"review_mode_read_only"}`; `list_files`, `read_file` and `workspace_result` work, and so does `run_check` when the assignment has implementation scope (a file that states `read-only` keeps it closed), and `finish` is never blocked by diff state. The worktree is checked out at `head_sha` when the assignment gives one, so checks and reads see the revision under review; `workspace_result` still diffs against `base_sha`. Without `--review`, implementation scope checks out `base_sha`, so the bridge now rejects a new implementation assignment whose `head_sha` differs from `base_sha` (`head_sha_unsupported`); pin `base_sha` to the revision to work on.
|
|
123
127
|
|
|
124
|
-
The bridge fetches the pinned commit into a private worktree. Fresh generic profiles use `execution=none`, and host checks are optional. Host checks work only on Linux: use a separate `--execution host` assignment after `dalan doctor` shows the host executor ready. Doctor checks `/usr/bin/bwrap`, not a check's runtime, binary or lockfile prerequisites; submit checks those. Add the check requirement to the assignment. `none` (including basic macOS delegation) must not request `run_check`; it returns `capability_not_available`. `claim` and `get` add `available_checks` only for implementation assignments when workspace tools are enabled. Repository-backed `workspace_result` includes check discovery; without repository input it returns only `checks` and sealed `artifacts`.
|
|
128
|
+
The bridge fetches the pinned commit into a private worktree. Fresh generic profiles use `execution=none`, and host checks are optional. Host checks work only on Linux: use a separate `--execution host` assignment after `dalan doctor` shows the host executor ready. Doctor checks `/usr/bin/bwrap`, not a check's runtime, binary or lockfile prerequisites; submit checks those. Add the check requirement to the assignment. `none` (including basic macOS delegation) must not request `run_check`; it returns `capability_not_available`. `claim` and `get` add `available_checks` only for implementation assignments when workspace tools are enabled. Repository-backed `workspace_result` includes check discovery; without repository input it returns only `checks` and sealed `artifacts`. Use only an ID listed in the assignment's current `available_checks`. If the requested ID is absent or the call refuses it, do not treat that as a completed check: review the current owner check definition and allowlist with the operator before retrying. The legacy `.dot-bridge.json` remains a fallback when `.dalan.json` is absent. The `default` ID is auto-detected from a test script or standard project manifest even without `.dalan.json`; repository and host check files can override it. Host execution requires `DALAN_HOST_CHECKS=1`, an exact owner allowlist entry for the repository/check pair, an owner-configured check definition and a valid six-field `host_budget` (`cpu_ms`, `wall_ms`, `memory_bytes`, `processes`, `disk_write_bytes`, `output_bytes`). A narrow read grant or any `scope_excluded` refuses host execution. See [execution setup](operations.md#execution-capability-and-check-evidence) for dependency preparation and backend prerequisites. After a worker finishes, inspect `workspace_evidence` in `dalan get ID --json`, fetch `patch_artifact.artifact_id` with `dalan artifact ARTIFACT_ID --output patch.diff` (a new file in an existing directory), verify its SHA-256, and apply it only after owner review. The bridge never pushes the patch.
|
|
125
129
|
|
|
126
130
|
**What a check can see and change.** Installation and checking use a private tmpfs execution copy; their writes are not exported to the host worktree. The previous writable-checkout result procedure is replaced by captured output and the original candidate diff.
|
|
127
131
|
|
|
@@ -135,8 +139,8 @@ Before an implementation request with `execution=host` is admitted, the bridge v
|
|
|
135
139
|
|
|
136
140
|
## Worker questions and owner notes
|
|
137
141
|
|
|
138
|
-
Worker should record questions with `progress` for the owner. A `progress` note with optional `blocker:true` or a leading `BLOCKED:` / `QUESTION:` is retained quietly by default and forwarded only for unprotected explicit T3 delivery, once per distinct note, using `--if-busy steer` so an active owner sees blockers promptly. CLI-delivered notices use `--if-busy steer`; job results sent through the result transport instead use orchestration `message.dispatch`, selecting `steer_active` for the latest active run, `queue_after_active` when no active run exists but a queue does, and `start_immediately` otherwise. Lifecycle checks prevent waking settled or archived threads. Reply to a progress note with `dalan note REQUEST_ID "text"` (at most 4096 UTF-8 bytes, with a 16384-byte total per assignment, only `--json` is accepted as an option). Use `note` for
|
|
139
|
-
For a small outcome sample, keep a private TSV with header `request_id\taccepted\taccepted_at\tuseful\tfallback_reason\thuman_intervention\tquota_before\tquota_after`.
|
|
142
|
+
Worker should record questions with `progress` for the owner. A `progress` note with optional `blocker:true` or a leading `BLOCKED:` / `QUESTION:` is retained quietly by default and forwarded only for unprotected explicit T3 delivery, once per distinct note, using `--if-busy steer` so an active owner sees blockers promptly. CLI-delivered notices use `--if-busy steer`; job results sent through the result transport instead use orchestration `message.dispatch`, selecting `steer_active` for the latest active run, `queue_after_active` when no active run exists but a queue does, and `start_immediately` otherwise. Lifecycle checks prevent waking settled or archived threads. Reply to a progress note with `dalan note REQUEST_ID "text"` (at most 4096 UTF-8 bytes, with a 16384-byte total per assignment, only `--json` is accepted as an option). Use `note` for assignment-specific progress replies and messages. For an identified question, run `dalan questions REQUEST_ID --json` and answer it with `dalan answer REQUEST_ID QUESTION_ID "text"`; a note does not answer an identified question. Append-only `owner_notes` appear in `get` and `claim`, in insertion order, and each note emits an `assignment.available` event with `request_id` and a `title` that carries the note id (the event schema has no `note_id` field) for the claimant. A note on an assignment that is already claimed is also listed in the `attention` key of the `list_pending` result (`[{request_id,note_count}]`) until the claimant calls `get` or `claim` for it, so a rebooted or event-missing worker can still find it. `claim` and `get` results carry a `guidance` string: on a permission-review denial, stop, report `BLOCKED:`, never retry around it. `dalan tell "text" [--worker NAME]` wakes the selected worker (default `dot`) with `assignment.available`; `dalan untell MESSAGE_ID [--worker NAME]` withdraws an unread pending message. After tool changes, Refresh the MCP connection using your client's documented procedure, then verify the tool catalog; restart the worker's conversation only if needed.
|
|
143
|
+
For a small outcome sample, keep a private TSV with header `request_id\taccepted\taccepted_at\tuseful\tfallback_reason\thuman_intervention\tquota_before\tquota_after`. From a source checkout installed with `npm ci`, run `node scripts/outcomes.mjs --observations observations.tsv`. This script is not included in the npm package. Missing acceptance and quota data remain unknown; coarse quota differences are not per-task billing.
|
|
140
144
|
|
|
141
145
|
## Removed commands
|
|
142
146
|
|
|
@@ -174,7 +178,7 @@ Usage and caps match the 24-hour `throttle` fields; caps include learned limits
|
|
|
174
178
|
- Content gates what names no longer do: `read_file` returns a file with each secret value replaced by `[redacted secret]` and a `redacted` count (private keys; GitHub, AWS, OpenAI, Stripe, Slack, Google, GitLab and npm tokens; a URL with an inline password to a non-local host), check output previews mask such values, and a PR diff or patch that contains one is refused at submit.
|
|
175
179
|
- The soft rule (auth, secret, credential, sign in a name) reads the file name only, not its directories, and a name without an extension (usually a directory) only matches credential-token names (`auth-token`, `api_key`).
|
|
176
180
|
- Code in a PR diff, an `input_patch` or an inlined diff is a reference, not a read: `payload.key`, `credentials.appleId` and `'.env.local'` in code pass. A host secret path in code (`~/.ssh/id_rsa`, `/home/u/.aws/credentials`) still refuses.
|
|
177
|
-
- In prose, a mention resolves against the repository tree. In scope, or a directory holding scope entries: fine. A tree file outside scope: eligible free-form read-only and `--review` work without structured objectives or explicit read lists adds it to `scope_paths` (after the sensitivity check, with a submission warning); implementation work refuses, naming every such path at once. A PR's changed files join the scope the same way. Structured briefs and explicit read lists keep their declared scope. A bare filename (`index.ts`) or abbreviated path (`x/util.ts`) that matches several tree paths outside scope, and a bare filename the tree lacks, refuse (see
|
|
181
|
+
- In prose, a mention resolves against the repository tree. In scope, or a directory holding scope entries: fine. A tree file outside scope: eligible free-form read-only and `--review` work without structured objectives or explicit read lists adds it to `scope_paths` (after the sensitivity check, with a submission warning); implementation work refuses, naming every such path at once. A PR's changed files join the scope the same way. Structured briefs and explicit read lists keep their declared scope. A bare filename (`index.ts`) or abbreviated path (`x/util.ts`) that matches several tree paths outside scope, and a bare filename the tree lacks, refuse (see [Refused submits](#refused-submits)); a tree directory outside scope, a slash path the tree lacks (a new file) and the other cases in that table only warn. Identifiers and routes (`input.privateKey`, `/v1`) pass. Host paths (`/etc/hosts`, `~/x`), `..` traversal, a file-like absolute path (`/README.md`), invalid path syntax and a file-shaped secret name (`.env`, `secrets.yaml`) still refuse.
|
|
178
182
|
|
|
179
183
|
## Reviewing a local patch
|
|
180
184
|
|
|
@@ -195,7 +199,7 @@ A check is an `argv` plus limits, in the owner's `~/.config/dalan/checks.json` (
|
|
|
195
199
|
- At run time, before anything runs, the bridge confirms each entry, file or directory, exists in the checkout. A missing entry fails the check at once with `check_test_path_missing: <path>`; no job row is made and no other tests run in its place.
|
|
196
200
|
- `run_check` results and the stored evidence include `test_paths`: the declared list, or the test files `argv` names when none is declared.
|
|
197
201
|
|
|
198
|
-
|
|
202
|
+
Partial check-definition example showing `argv` and `test_paths` only. This is not a complete host-runnable check: before using `--execution host`, add the owner limits and all six `host_budget` fields, allow this exact repository/check pair, and satisfy the [host-check prerequisites](operations.md#execution-capability-and-check-evidence).
|
|
199
203
|
|
|
200
204
|
```json
|
|
201
205
|
{"example-org/example-repo": {"checks": {"api-contract-check": {
|
|
@@ -210,16 +214,16 @@ Example of a focused check:
|
|
|
210
214
|
|
|
211
215
|
`dalan submit` runs one work-order compiler (`src/work-order.mjs`) before it stores anything. It reuses the checks that always guarded submit (size limits, scope and sensitive-path rules against the pinned tree, `output_paths`, execution capability, check readiness, PR preflight) and answers with a verdict, typed reasons and byte accounting. There is no separate intake step: the real submit and the preview use the same call.
|
|
212
216
|
|
|
213
|
-
`dalan submit --stdin --dry-run [--json]` uses `POST /submit-preview` and stores nothing: no assignment, no lifecycle event, no local receipt. It answers HTTP 200 for every verdict. The ACP adapter previews the exact prepared assignment before it submits it. This route requires a server that supports `/submit-preview`; an older server returns 404, and the CLI and ACP adapter stop without sending a submit. They do not fall back to `/submit`. `/submit` always submits and rejects `dry_run` flags. A CLI dry run uses one request; ACP already uses one preview request followed by one submit request.
|
|
217
|
+
`dalan submit --worker NAME --execution none --stdin --dry-run [--json]` uses `POST /submit-preview` and stores nothing: no assignment, no lifecycle event, no local receipt. It answers HTTP 200 for every verdict. The ACP adapter previews the exact prepared assignment before it submits it. This route requires a server that supports `/submit-preview`; an older server returns 404, and the CLI and ACP adapter stop without sending a submit. They do not fall back to `/submit`. `/submit` always submits and rejects `dry_run` flags. A CLI dry run uses one request; ACP already uses one preview request followed by one submit request.
|
|
214
218
|
|
|
215
219
|
| Verdict | Meaning | `submit` exit code |
|
|
216
220
|
|---|---|---|
|
|
217
221
|
| `admissible` | The current checks allow this submission. | 0 |
|
|
218
222
|
| `reject` | Invalid or forbidden: bad schema, unsafe path, sensitive path in scope, secret content, an oversized rendered brief or instruction set, an expired caller deadline. Retrying unchanged cannot work. | 2 |
|
|
219
223
|
| `clarify` | Ambiguous but fixable by the requester: a probable typo (the reason lists `candidates`), an ambiguous bare filename (it lists the paths it matches), a path the brief names outside `scope_paths`, missing `inputs` or `scope_paths`. | 3 |
|
|
220
|
-
| `defer` |
|
|
224
|
+
| `defer` | The job cannot run now. Pause, owner-confirmed usage break and queue-threshold defers queue by default on a real submit; `--refuse-defer` refuses them without storing a job unless `--queue-anyway` is also set. Missing execution capability or unmet check prerequisites always refuse. The answer carries `retry_after_seconds`. | 4 when refused; see the real-submit behavior below. |
|
|
221
225
|
|
|
222
|
-
Other failures keep exit code 1: local checks before anything is sent (JSON, assignment shape, options, repository policy), untyped bridge errors, transport failures, bridge down and `request_id conflict`. A fresh
|
|
226
|
+
Other failures keep exit code 1: local checks before anything is sent (JSON, assignment shape, options, repository policy), untyped bridge errors, transport failures, bridge down and `request_id conflict`. A fresh submission that is refused stores no job and removes the receipt created by that call, so a corrected retry under the same `request_id` goes through. A deferred job that is admitted to the queue retains its job and receipt. `defer` queues by default during a pause, usage break or queue threshold; use `--refuse-defer` to exit 4 without storing a job or fresh receipt. `--queue-anyway` remains accepted for compatibility and does not bypass scope, capability or freshness checks (the raw HTTP API also queues unless the body sets `refuse_defer`). A host that cannot run the job at all (no executor, a missing capability, an unmet check prerequisite) is a `defer` that always refuses with HTTP 400 and exit 4: queueing it would only fail later, so `--queue-anyway` does not apply.
|
|
223
227
|
|
|
224
228
|
Each reason is `{code, field, message, fix}`, plus `candidates` or `suggested_scope_paths` where they apply. Codes: `invalid_field`, `brief_too_large`, `instructions_too_large`, `expected_output_too_large`, `sensitive_path_hard`, `sensitive_path`, `secret_content`, `authority_claim`, `invalid_path`, `invalid_output_paths`, `output_path_taken`, `output_path_sensitive`, `unknown_scope_path`, `undeclared_path`, `ambiguous_path`, `unknown_path`, `missing_inputs`, `missing_scope`, `diff_outside_scope`, `contradictory_scope`, `missing_test_scope`, `symlink_in_scope`, `head_sha_unsupported`, `invalid_valid_until`, `validity_expired`, `invalid_schema`, `check_prerequisites_unmet`, `capability_unavailable`, `capability_unsupported`, `worker_paused`, `usage_break`, `queue_depth`, `queue_full`, `background_capacity_full`, and `refused` for a refusal with no specific rule. A real refusal returns the same `verdict` and `reasons` next to the old `error` text (the text is unchanged).
|
|
225
229
|
|
|
@@ -229,7 +233,7 @@ Each reason is `{code, field, message, fix}`, plus `candidates` or `suggested_sc
|
|
|
229
233
|
|
|
230
234
|
**Expiry is not an owner cancel.** The bridge cancels with `cancelled_reason: expired` (or `skipped_by_worker`) and a system lifecycle event. An owner may use the same reason text, but the owner lifecycle actor keeps it classified as an owner cancellation. `get`, `wait` and the inbox expose bridge-observed expiry and owner-cancel transitions separately. Lease expiry is reported as an observed bridge lease transition; it does not prove a vendor silently dropped work.
|
|
231
235
|
|
|
232
|
-
**Failure labels.** Bridge lifecycle transitions carry `failure_type_source: bridge_observed_transition`. Worker-reported blocked or failed outcomes use `worker_text_inference`; keyword matches describe report text and do not prove the cause. A previous `check_failed` event is reported separately and does not establish the cause of a later report. A lease expiry is a persisted bridge lease transition, not proof of a vendor silent drop; a later owner cancellation remains classified as an owner cancellation, even when its reason text is `expired`. Unknown and other cases stay `unknown`. Submit refusals carry typed `verdict` and `reason_codes` in request logs; transport errors and defers are not counted as correct policy denials. `node scripts/admission-measure.mjs [--since RFC3339] [--until RFC3339] [--db PATH] [--log PATH]`
|
|
236
|
+
**Failure labels.** Bridge lifecycle transitions carry `failure_type_source: bridge_observed_transition`. Worker-reported blocked or failed outcomes use `worker_text_inference`; keyword matches describe report text and do not prove the cause. A previous `check_failed` event is reported separately and does not establish the cause of a later report. A lease expiry is a persisted bridge lease transition, not proof of a vendor silent drop; a later owner cancellation remains classified as an owner cancellation, even when its reason text is `expired`. Unknown and other cases stay `unknown`. Submit refusals carry typed `verdict` and `reason_codes` in request logs; transport errors and defers are not counted as correct policy denials. From a source checkout installed with `npm ci`, run `node scripts/admission-measure.mjs [--since RFC3339] [--until RFC3339] [--db PATH] [--log PATH]` for a read-only report over a fixed, half-open time window. This script is not included in the npm package. Objective and revision labels are logged as digests, never raw values; legacy labels are read only to compute the same anonymous cohorts. It reports request-ID retry groups and declared objective cohorts as proxies; deduplicated intent remains unknown without a binding. It counts explicit typed policy denials separately from legacy keyword guesses, uses submit-event time for refusal cohorts and terminal-event time for terminal outcomes, and reports missing timestamps. Terminal shares are percentages (0–100). A missing request log leaves admission metrics unknown; generic worker-blocked text stays in the unknown-cause share. Size-overflow coverage reflects observed bridge request-log byte fields; absent provider overflows are unobserved. Submit latency is per attempt from server request arrival to response, not first actionable response, owner read, intent use or task completion. Report expiry and owner cancellation separately; do not infer deployment improvements without a measured cohort.
|
|
233
237
|
|
|
234
238
|
Tests: `scripts/work-order-test.mjs`, `scripts/work-order-e2e.mjs`, `scripts/admission-measure-test.mjs`; the adapter matrix is `scripts/adapter-conformance-test.mjs` (clean, untracked-only and tracked-dirty checkouts, oversize brief, slow submit, compiler refusal, defer, outage, expiry, cancel).
|
|
235
239
|
|
|
@@ -315,7 +319,7 @@ Every result you request gets one recorded decision. `dalan decide ID WORD [--no
|
|
|
315
319
|
|
|
316
320
|
`accept ID` and `reject ID` still work and are the same as `accepted` and `not_useful`. Decisions go to the append-only `decisions` table (schema version 44). A different decision is added and the latest one wins, so the history stays; the same decision again is a no-op. A decision on an unread result also records the read. Only a finished result can be decided. The bridge sweeps hourly (and at start) for finished results from the last 90 days with no decision, 500 per pass.
|
|
317
321
|
|
|
318
|
-
|
|
322
|
+
After reading a finished result, record your decision with `dalan decide ID WORD`. The ACP adapter also includes a decision command in its reply.
|
|
319
323
|
|
|
320
324
|
**`dalan apply ID [--dir PATH]`** (default the current directory) downloads the patch artifact and checks its sha256 against the build evidence, then checks that the job's base commit is an ancestor of the checkout's HEAD (or HEAD itself), then runs `git apply --check` and `git apply`. Any failed gate prints the reason and changes nothing. On success it records `applied`. If the decision call fails after the patch applied, the error says so and gives the `decide` command.
|
|
321
325
|
|
|
@@ -333,7 +337,7 @@ A directory in `scope_paths` can hold a sensitive file the submitter never named
|
|
|
333
337
|
|
|
334
338
|
A worker with a claim can attach files (a report, a log, a patch it built elsewhere) to its `finish`. Upload them with `artifact_chunk`, then name them in `finish.artifact_ids`. This works for read-only and implementation claims. It needs the workspace capability; with the workspace off, `artifact_chunk` remains advertised but calls fail with `capability_not_enabled`; `finish` with nonempty `artifact_ids` fails with the same error.
|
|
335
339
|
|
|
336
|
-
**IDs.** The worker chooses the ID. It must match `^art_[a-zA-Z0-9_-]{8,128}$`: the literal `art_`, then 8 to 128 letters, digits, `_` or `-`. A fresh `art_` plus a UUID works. The ID is an alias that is unique only inside one request. The bridge stores the bytes under its own global ID (`art_` plus 48 hex digits derived from request, claim and your ID). The worker keeps using its own ID in later chunks and in `finish`. Each artifact in `get` also shows `origin_epoch` (the epoch that first created it) and `inherited: true` when an earlier epoch created it and a later claim now holds it. Only the owner `get` shows `origin_claim_id` (the claim that first created it), on artifacts and in the `finish` workspace evidence; worker replies, including the `claim` reply and worker `get`, omit it. A takeover carries only SEALED uploads (sealed and sha256 verified) to the new claim, which can cite them. An upload that was not sealed when the epoch ended stays bound to the old claim: the new epoch cannot append to it, seal it or cite it. If the new epoch uploads under the same alias, it starts a fresh upload at offset 0; the alias then means the new row. The old unsealed bytes stay as evidence until retention cleanup removes them.
|
|
340
|
+
**IDs.** The worker chooses the ID. It must match `^art_[a-zA-Z0-9_-]{8,128}$`: the literal `art_`, then 8 to 128 letters, digits, `_` or `-`. A fresh `art_` plus a UUID works. The ID is an alias that is unique only inside one request. The bridge stores the bytes under its own global ID (`art_` plus 48 hex digits derived from request, claim and your ID). The worker keeps using its own ID in later chunks and in `finish`. Each artifact in `get` also shows `origin_epoch` (the epoch that first created it) and `inherited: true` when an earlier epoch created it and a later claim now holds it. Only the owner `get` shows `origin_claim_id` (the claim that first created it), on artifacts and in the `finish` workspace evidence; worker replies, including the `claim` reply and worker `get`, omit it. A takeover carries only SEALED uploads (sealed and sha256 verified) to the new claim, which can cite them. An upload that was not sealed when the epoch ended stays bound to the old claim: the new epoch cannot append to it, seal it or cite it. If the new epoch uploads under the same alias, it starts a fresh upload at offset 0; the alias then means the new row. The old unsealed bytes stay as evidence until retention cleanup removes them. Worker tool replies use the worker-chosen alias. Owner `wait --json` and `get --json` expose the server's globally unique artifact ID; pass that ID, not the worker alias, to `dalan artifact ARTIFACT_ID --output FILE`.
|
|
337
341
|
|
|
338
342
|
**`artifact_chunk` fields.**
|
|
339
343
|
|