@tnunamak/dalan 0.5.2 → 0.6.1
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 +37 -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 +181 -0
- package/docs/connect-chatgpt.md +9 -4
- package/docs/connection-longevity.md +7 -1
- package/docs/dalan-upgrade.md +18 -14
- 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 +3 -1
- 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/lib/expose-tailscale.mjs +1 -1
- 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 +423 -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 +918 -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
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
This file lists user-visible changes, newest first. Check the section for your target release before you upgrade.
|
|
4
4
|
|
|
5
|
+
## 0.6.1
|
|
6
|
+
|
|
7
|
+
- `dalan service install` now uses the Gozar that ships with Dalan. A `gozar` command on `PATH` is no longer required. An explicit `--gozar-bin` still wins; otherwise Dalan uses the bundled copy, then `GOZAR_BIN`, then `PATH`. If none is found, the command stops before it creates any unit.
|
|
8
|
+
- `dalan service install` now checks Gozar's state path before it creates units or starts anything. Gozar refuses a state directory with a group- or world-writable ancestor, such as `~/.local` at mode 775. Dalan now stops first with one line that names the directory and the `chmod go-w` command to run.
|
|
9
|
+
- When another program replaces the Tailscale Funnel rule of a stopped trial, Dalan leaves it alone and no longer prints a command that would switch off that port.
|
|
10
|
+
- Muse is now described as the cloud agent at muse.ai in the Muse and worker-client guides. These guides also say that either a Tailscale route or the Gozar relay can supply public HTTPS.
|
|
11
|
+
- Documentation fixes: the generated service environment list in the upgrade guide is complete, the old-package command list matches the one at the top of that guide, and the local MCP guide tells you to use the Home line a public trial prints.
|
|
12
|
+
|
|
13
|
+
## 0.6.0
|
|
14
|
+
|
|
15
|
+
- Run one long-lived bridge for several named workers with built-in OAuth and a stable worker catalog. `dalan service install` creates a systemd user service on Linux and registers an existing HTTPS origin with Gozar. See [service setup](docs/service-setup.md).
|
|
16
|
+
- Migrate existing worker settings with `dalan service migrate-workers`. It reads source files without changing them and copies only effective repository grants supported by audit records. It denies and reports unaudited additions. It does not copy connections, tokens, jobs, results or old destination approvals; pair each connector again and approve new destination revisions.
|
|
17
|
+
- Add read-only policy work orders. Submit one result to named eligible workers; the first eligible worker to claim it owns that job. Destination approvals remain tied to each worker's reviewed revision. See [pool submission and worker flow](docs/pull-queue.md).
|
|
18
|
+
- Start a hosted MCP trial with `npx -y @tnunamak/dalan try`. It prints the connector URL, asks for terminal approval and returns the connected agent's demo report. The `--local` option runs a self-check on this computer without opening a public route.
|
|
19
|
+
- In `auto` mode, a saved Gozar choice or an older saved localhost.run choice selects Gozar. Otherwise Dalan uses Tailscale when a route is usable, and Gozar when Tailscale is not usable. When Gozar is selected, Dalan names tunnl.gg, links its [terms](https://tunnl.gg/terms) and [privacy notice](https://tunnl.gg/privacy), and asks for consent before exposure. After consent, Gozar creates an installation-owned key for its key-bound `tunnl-gg` relay. Dalan does not pass your SSH keys. The relay terminates TLS and can see the connector URL and traffic.
|
|
20
|
+
- A temporary demo link can change or stop without warning, including within minutes. Dalan checks the original address and ends the trial when it detects a route change or loss. The trial ends after three hours at most; that limit does not promise that the link will last that long. `npx -y @tnunamak/dalan setup` can save Tailscale or Gozar for public trials. An explicit `--route tailscale` stops with an explanation if Tailscale cannot start; it does not fall back to a trial link. The explicit `--route localhost.run` option remains available.
|
|
21
|
+
- On stop, Dalan closes its forwarding gate and attempts to remove its route. If it cannot confirm cleanup, it reports that and prints a recovery command. It removes the connector URL file. For temporary routes it also removes the bridge secret; a reusable Tailscale home keeps its bridge configuration.
|
|
22
|
+
- Tailscale trials use port 443. Dalan opens its own Funnel rule and attempts to remove only that rule when it stops. If another rule holds port 443, Dalan can start an isolated temporary node without changing that rule. The node may need a one-time sign-in and uses a new address. If its public address does not answer, the trial prints `TLS certificate: ok` or `TLS certificate: error (...)` and keeps a masked `tailscaled.log` in the trial home.
|
|
23
|
+
- Ctrl-C cancels a route that is still starting. The trial's readiness check verifies OAuth metadata before it prints that the public route is ready.
|
|
24
|
+
- Hosted-trial clients that negotiate SSE now receive a heartbeat every 20 seconds while an authenticated request is in progress; JSON replies are unchanged. `t3_thread_wait` defaults to 90 seconds and stops at that limit, returning partial state. The legacy catalog keeps its existing 120-second descriptor.
|
|
25
|
+
- The worker tool list changes once in this release. After upgrading, refresh the Dalan connection once in each worker client.
|
|
26
|
+
|
|
5
27
|
## 0.5.2
|
|
6
28
|
|
|
7
29
|
- Fix: a queued job that a worker had skipped is no longer marked skipped again as soon as it expires and is requeued. A job is marked skipped, and lists behind newer jobs, after it has been claimable for 10 minutes without a claim. The expiry requeue cleared the skip mark but kept the time the job first became claimable, so the next listing marked it skipped again at once and it stayed behind every newer job. The requeue now also restarts that time and the job's listing count.
|
|
@@ -21,7 +43,7 @@ This file lists user-visible changes, newest first. Check the section for your t
|
|
|
21
43
|
- Fix: the worked backup recipe in `docs/operations.md` now stops when `lsof` reports an error, not only when it finds a process holding a database; before, a failed check counted as "nothing open". Run the recipe as the service user or as root.
|
|
22
44
|
- Fix: `worker-bridge-setup.mjs --remove --purge-home` now keeps the bridge home whenever it cannot be sure that nothing uses it. Before, a missing `lsof` (macOS), an `lsof` that timed out or failed, or an unreadable `/proc` (Linux) was read as "no process holds `bridge.db`", and the home was deleted under a running service. A failed check now stops the purge, keeps the home and says why; only a check that ran to the end and found no holder lets the purge go on. The unit-file check now follows symlinks, so a unit linked into the user's unit directory that names the home blocks the purge, and a unit file or directory that cannot be read blocks it too. A link to `/dev/null` (a masked unit) or to nothing is ignored. On Linux, a process that refuses the check (another user's, or one that is not dumpable) is skipped, because the bridge is a plain node process. In the upgrade guide, the service-file commands (`--repoint`, `--remove`, `--write-units-only`) are exempt from the bridge-`HOME` prefix, since they look for the unit files under your own `HOME`. Tool names and schemas are unchanged.
|
|
23
45
|
- Security: a worker can no longer add audit rows or replay finished registry calls without limit. The registry tools `call_tool_read` and `call_tool_write` now share one admission budget of 120 calls per minute for each verified worker, checked before the tool lookup, the refusal, an idempotency replay and the audit write. Before, a worker with no grant could call a missing tool without limit and add one `tool_registry_log` row per call, and a granted worker could replay a finished `idempotency_key` without limit, because the 30-per-minute limit of each tool ran only after those steps. A call over the budget is refused with `rate_limited` and writes no audit row; the bridge counts it in one `admission_refused:WORKER` row of `tool_registry_meta`, which survives a restart (the minute window does not). Tool names, descriptions and schemas in `tools/list` are unchanged.
|
|
24
|
-
- Fix: a secret in a worker's JSON report is now masked even when one character of it is written as a `\uXXXX` escape. Redaction now inspects JSON text in its decoded form. A worker could write a registered secret, a known token format or a credential field name into a JSON report with one character written as a `\uXXXX` escape, and it passed into the owner report and other sinks unmasked. Such text is now masked; JSON with nothing to mask keeps its formatting. Redaction still cannot stop
|
|
46
|
+
- Fix: a secret in a worker's JSON report is now masked even when one character of it is written as a `\uXXXX` escape. Redaction now inspects JSON text in its decoded form. A worker could write a registered secret, a known token format or a credential field name into a JSON report with one character written as a `\uXXXX` escape, and it passed into the owner report and other sinks unmasked. Such text is now masked; JSON with nothing to mask keeps its formatting. Redaction still cannot stop deliberate disclosure through unrecognized transformations, including base64 encoding of an unregistered secret; SECURITY.md and `docs/redaction.md` say so. Tool names and schemas are unchanged.
|
|
25
47
|
- Fix: the restore check (`restore-check.mjs`) now catches a wrong `as-storage.key`. It authenticates the built-in authorization store with `as-storage.key`: it opens the storage verifier and every sealed row read-only, as the store's own start does. Before, it reported `as.sqlite` as `ok, key present` for any 32-byte key file, so a wrong key passed the check and the service then refused to start. The check still does not prove that the whole service starts; [Operations](docs/operations.md) describes the isolated start that does. It now reports `ok, key verified`, or fails with `authorization storage cannot be decrypted with the restored key`. Tool names and schemas are unchanged.
|
|
26
48
|
- Fix: under an external OAuth issuer, a subject that the operator did not name for a worker can no longer reach it. A `workers.json` connection record must now name `subject`. Before, a record with only `issuer` and `connection_id` matched any allowed subject that presented that `connection_id`, so a subject the operator never named for the worker could reach it. A workers file with such a record now fails at startup with `workers: NAME: every connection record needs a subject`; add `"subject": "<the token's sub claim>"` to each record (`client_id` and `connection_id` stay optional extra pins). The legacy profile (no workers file) and built-in OAuth are unchanged; tool names and schemas are unchanged.
|
|
27
49
|
- An operator-registered tool can no longer use a schema `pattern` that makes validation slow. Schema `pattern` now admits only one closed form: `^`, an optional literal prefix of letters, digits, `_` or `-`, one character class (such as `[a-f0-9]` or `\d`) with one quantifier (`+`, `*`, `{n}`, `{n,m}` or `{n,}`), then `$`. Examples: `^[a-f0-9]{64}$`, `^[A-Za-z0-9_-]+$`, `^job-[0-9]{1,8}$`. Such a pattern matches in time linear in the input. Before, a bounded backtracking check admitted patterns such as `^a*a{0,16}a{0,16}a{0,16}a{0,16}$` and `^a*a{4000}b$` that blocked validation for one to six seconds on long strings. Any other pattern is refused at registration with a message naming the allowed form. Tool names and schemas in `tools/list` are unchanged.
|
|
@@ -32,60 +54,50 @@ This file lists user-visible changes, newest first. Check the section for your t
|
|
|
32
54
|
- Fix: a tool that posts a T3 message can no longer be registered as read-only. In the registry, a handler kind now declares its effect class, and registration refuses a class that does not match. A `t3_post` tool must be class `write`; before, it could be registered as `read` and `call_tool_read` would then post a message. A stored `t3_post` tool whose class is `read` is listed and enforced as `write`, so `call_tool_read` is refused (`wrong_class`) and a write call needs the `schema_hash` and `idempotency_key`. Tool names and schemas in `tools/list` are unchanged. `docs/worker-clients.md` now has one "Operator-registered tools" section for the add, grant, call, revoke and remove steps, and `docs/t3-reverse-control.md` states the correct `owner_message` limits.
|
|
33
55
|
- Fix: a message that a worker queued through `t3_post` no longer reaches a thread after the worker's grant or the tool is gone. This closes three registry safety gaps. Messages a worker queued through `t3_post` are now dropped when its grant is revoked or the tool is disabled or removed, and the timer delivers a queued message only while the tool is enabled, the worker is granted and the tool still points at the thread it was queued for, so a removed tool re-registered under the same name for another thread can no longer receive old text. Tool names and schemas are unchanged.
|
|
34
56
|
- Removed: the OpenAI allow-list updater is no longer part of Dalan. This removes `docs/openai-allowlist-updater.md`, `scripts/update-openai-allowlist.mjs` and the matching systemd unit and timer. It was a deployment-specific helper, not part of the bridge.
|
|
35
|
-
- For contributors: `npm run scan:public` checks that no tracked file names private details. The script `scripts/public-scan.mjs` fails when a tracked file names an internal role, a job code or the legacy worker nickname, unless `scripts/public-scan-allowlist.json` explains the hit. Private names such as owner hosts, people and private tools are not in the repository: set `DALAN_PUBLIC_SCAN_DENYLIST` to an untracked file of `RULE-ID /REGEX/FLAGS` lines to check them too. A configured file that is missing, unreadable or empty fails the scan. Rename test files that carried job codes and use neutral wording in docs, comments and test names. Served tool names, descriptions and schemas are unchanged.
|
|
36
57
|
- Fix: on macOS, a generated service now starts at load and restarts after a crash even while the desktop session is idle or locked. Generated launch agents now list the `Aqua` and `Background` session types, and setup loads and starts them in the `user/UID` launchd domain instead of `gui/UID`. A `gui/UID` domain whose desktop session is idle or locked can be in on-demand-only mode, where launchd neither starts an agent at load nor restarts it after `kill -9` (`KeepAlive` has no effect). `--remove` stops an agent in either domain. Services that an earlier release set up keep running as before; `worker-bridge-setup.mjs --repoint --worker NAME` brings their plist up to date.
|
|
37
58
|
- New `worker-bridge-setup.mjs --repoint --worker NAME` points an existing service at the code that runs the script. Use it after `npm uninstall -g dot-bridge && npm install -g @tnunamak/dalan`, which is now the documented npm upgrade ([upgrade guide](docs/dalan-upgrade.md#upgrade-an-npm-install)): the old package leaves its `dot-worker`, `dot-deadman` and `dot-heartbeat` commands on `PATH` until you remove it; Dalan installs only `dalan` and `dalan-*` commands. The guide also corrects the macOS restart after `bootout` (`launchctl bootstrap` before `kickstart`, which otherwise exits 113).
|
|
38
59
|
- `scripts/upgrade-drain.mjs` is now part of the npm package, so the documented pre-upgrade drain exists in an npm install.
|
|
39
60
|
- `worker-bridge-setup.mjs --repoint` now changes only `WorkingDirectory` and the script argument. A HOME or log path below the old code directory used to be rewritten. It also adds the macOS session types when the code directory did not move, so the upgrade guide runs it on every source upgrade.
|
|
40
61
|
- `worker-bridge-setup.mjs --remove --purge-home` refuses, and names what it found, while another unit file in the user's unit directory names the home or a process holds its `bridge.db` open. It no longer needs to know the launchd label of a release before 0.4.0 to avoid deleting a home under a running service.
|
|
41
62
|
- Fix: `dalan wait --drained` could leave two waiters running for one producer, or report `already_running` when nobody was waiting. The waiter slot is now a directory that a waiter takes with one atomic rename; a stale entry is removed by its own unique name, so no waiter can remove another waiter's entry, and a waiter that dies at any step leaves nothing that blocks its replacement.
|
|
42
|
-
- Fix (test scripts): the live-trial teardown no longer fails when a stopped process has not been collected yet. Before, it failed with `cutoff PID changed identity while stopping` when the cutoff process had exited but its parent had not yet collected it. An exited process now counts as stopped.
|
|
43
63
|
- Add `dalan mcp`, a local stdio MCP server with `dalan_submit`, `dalan_wait`, `dalan_result` and `dalan_status` tools, so a local agent (Claude Code, Codex) can use the bridge as tool calls. Each tool runs the matching CLI command through the admin socket. The worker-facing endpoint and its tool catalog are unchanged. See `docs/local-agent-mcp.md`.
|
|
44
64
|
- The worker tool list changes once in this release: refresh the Dalan connection in each worker client once after you upgrade. This is the last planned change to the tool list. This release (catalog v2) supersedes the announced `list_files` cursor change. It keeps the worker tools `t3_thread_create`, `t3_thread_send`, `t3_thread_wait` and `t3_thread_set` as top-level tools, advertised only with `DALAN_ENABLE_T3_TOOLS=1`. Adds MCP `annotations` to every tool and three fixed registry tools: `list_tools` (read-only), `call_tool_read` (read-only) and `call_tool_write`, each taking `{tool, arguments}`. Future abilities are registered server-side and never change the tool list. `legacy-v46` is unchanged. Add future abilities by registering tools, not through tool names, descriptions or schemas.
|
|
45
|
-
- A new database no longer contains the name of the first worker. The columns that record which worker owns a job or message start with an empty default instead of `'dot'`, the break table is `worker_breaks` (was `dot_breaks`), and the skip marker on jobs is `assignments.skipped_at` (was `skipped_by_dot_at`). The fix-loop source is stored as `fix-loop` in new databases; databases created earlier keep `dot-fix` in their stored rows and schema, and both spellings are still accepted as input. Schema version is now
|
|
65
|
+
- A new database no longer contains the name of the first worker. The columns that record which worker owns a job or message start with an empty default instead of `'dot'`, the break table is `worker_breaks` (was `dot_breaks`), and the skip marker on jobs is `assignments.skipped_at` (was `skipped_by_dot_at`). The fix-loop source is stored as `fix-loop` in new databases; databases created earlier keep `dot-fix` in their stored rows and schema, and both spellings are still accepted as input. Schema version is now 66, adding policy work orders. Upgrading renames the table and column in place and keeps every row's worker. **Rolling back after this upgrade needs the backup taken before it**, because older code looks for the old names. Databases that already reached schema 35 keep `DEFAULT 'dot'` in their stored schema text; every insert names the worker, so the default is never used.
|
|
46
66
|
- Fix: a check job that the [owner integrator](docs/owner-integrator.md) creates can no longer be claimed by a worker named `dot`. These check jobs were stored as belonging to the worker `dot`. They now belong to the reserved owner `unknown`, which no worker can claim.
|
|
47
67
|
- Fix: a worker session that stopped responding no longer keeps its jobs for the length of a usage break. A claim whose worker made no claim-bearing call for one lease period is now released even across a usage break. Before, the sweep was held during a break and the end of the break (owner clear or the worker's next tool call) extended every ordinary worker deadline by the break's length, so a dead worker session kept its claimed jobs for the lease plus the break. Only the claimant's own calls extend a lease; `list_pending` never does. Tool names and schemas are unchanged, so no connector refresh is needed.
|
|
48
68
|
- The earlier alias of the `notify_owner` MCP tool is removed. `notify_owner` is the only notification tool and keeps its schema, authorization, audit and retry ledger. The tool catalog changes for the default `stable`, `questions-v1` and `protocol-v0` profiles (`legacy-v46` never listed the alias). A client that cached the old tool list keeps working without a refresh; only a call to the removed alias fails, with `unknown tool`. Refresh the connector when convenient to drop it from the list.
|
|
49
69
|
- Workers that follow wake signals now take the oldest job first, so older jobs no longer expire behind newer ones. The wake sent when a job is submitted now names the oldest queued job the worker may claim, not the new job, so workers that follow wakes claim oldest first and older jobs no longer expire behind newer ones. `finish` responses that name `next_queued` now tell the worker to claim it before its run ends, and the `assignment_expired` error tells the worker to call `list_pending`. Who may claim what is unchanged.
|
|
50
|
-
-
|
|
70
|
+
- The guides now show how to run Codex CLI as a worker without a screen, and how to upgrade, check and uninstall an installation. They cover Codex CLI non-interactive approval for the worker tools (per-tool `approval_mode`, no bypass flag), login order and `--skip-git-repo-check`; source-install upgrade, macOS restart, first-job smoke check and one uninstall inventory.
|
|
51
71
|
- Fix: `submit` no longer fails with "not a git repository" after a temp cleaner deletes a repository mirror's files. The bridge re-initialises a repository mirror whose directory exists but is not a valid repository (for example after an age-based temp cleaner deleted its files), so `submit` no longer fails with "not a git repository". The next fetch refills the mirror.
|
|
52
72
|
- A claim refused because the bridge is paused now says the pause is temporary and tells the worker to call `list_pending` and claim again later. `list_pending` adds `claims_accepted` and, when work is queued and the worker has free slots (`free_lanes`), `next_queued` and `next_action` naming the oldest queued jobs; while paused it says not to claim yet. Tool names and claim schemas are unchanged.
|
|
53
|
-
- `dalan` with no arguments now prints short grouped help (getting started, everyday, operator) instead of one long usage line. An unknown command prints one line that names it, suggests a close match and points to `dalan --help`, and exits 1. `dalan help --all` lists every command, and `dalan COMMAND --help` or `dalan help COMMAND` shows a command's usage. Command behaviour is unchanged.
|
|
73
|
+
- `dalan` with no arguments now prints short grouped help (getting started, everyday, operator) instead of one long usage line. An unknown command prints one line that names it, suggests a close match and points to `dalan --help`, and exits 1. `dalan help --all` lists every command, and `dalan COMMAND --help` or `dalan help COMMAND` shows a command's usage. Command behaviour is unchanged.
|
|
54
74
|
- A job with no delivery option now defaults to `none` (read results with `wait` and `get`), and unsupported destination modes are rejected. The T3 delivery adapter loads only for an explicit T3 destination.
|
|
55
|
-
- Tests: cover disabled direct T3 tool calls, worker capability refusal, and legacy/canonical environment setting precedence.
|
|
56
75
|
|
|
57
76
|
- `dalan try` now cleans up after the repository step: it revokes the demo grant, deletes the demo repository and the request files when it exits, and does the same at the next start if a run was killed. It also checks that a second repository is still refused after the grant, and stops the repository setup on Ctrl-C.
|
|
58
|
-
- Security: request logs now mask credential values by field name. Opaque credential values are redacted at the request-log sink before JSON serialization.
|
|
59
|
-
-
|
|
60
|
-
- Tests: add supplemental native authority cases for revoked connections, destination approval and replacement-connection replay, with mutation-checked assertions.
|
|
61
|
-
- Tests: record remaining native conformance gaps without changing the 42 shared profile traces.
|
|
62
|
-
- Fix: a bridge restart no longer restarts the claim lease clock, a notification is not sent twice, and a job cannot be cancelled while its result delivery is uncertain. Notification idempotency keys are reserved before publishing, cancellation is blocked while result delivery is uncertain, and claim lease deadlines persist across restarts. A bridge restart no longer restarts the lease clock. (This entry once said that the end of a usage break extends ordinary worker deadlines by the break's length. A later fix, above, removed that: a usage break never moves a claim's lease deadline.)
|
|
77
|
+
- Security: request logs now mask credential values by field name. Opaque credential values are redacted at the request-log sink before JSON serialization.
|
|
78
|
+
- Fix: a bridge restart no longer restarts the claim lease clock, a notification is not sent twice, and a job cannot be cancelled while its result delivery is uncertain. Notification idempotency keys are reserved before publishing, cancellation is blocked while result delivery is uncertain, and claim lease deadlines persist across restarts. A usage break never moves a claim's lease deadline.
|
|
63
79
|
- Fix: a paused service or a slow delivery can no longer hold up lease expiry. Lease, preparation and skip maintenance run on an independent timer.
|
|
64
80
|
|
|
65
|
-
- Host checks: a stop is now reported as verified only with durable evidence from the host. In receipt mode, the bridge requires durable host stop evidence before accepting a verified stop;
|
|
66
|
-
|
|
67
|
-
- `dalan try` now also runs a repository job. It builds a one-commit demo repository in the trial home, shows that a job for an ungranted repository is refused, grants the demo repository with `dalan worker allow`, and lets the demo worker claim, read and finish a job on it through the real claim path. The trial bridge turns repository workspaces on (256 MiB free-disk floor) and redirects only `dalan-demo/hello` to the local copy; no other repository is reachable until granted. Without Git or Python 3 the step is skipped with the fix named.
|
|
81
|
+
- Host checks: a stop is now reported as verified only with durable evidence from the host. In receipt mode, the bridge requires durable host stop evidence before accepting a verified stop; it scans nested cgroups, refuses stop verification without a sandbox scope, uses pidfd signaling, and uses monotonic stop deadlines. Full-tree cancellation is reported as verified only for the systemd backend.
|
|
68
82
|
|
|
69
|
-
-
|
|
83
|
+
- `dalan try` now also runs a repository job. It builds a one-commit demo repository in the trial home, shows that a job for an ungranted repository is refused, grants the demo repository with `dalan worker allow`, and lets the demo worker claim, read and finish a job on it. The trial bridge turns repository workspaces on (256 MiB free-disk floor) and redirects only `dalan-demo/hello` to the local copy; no other repository is reachable until granted.
|
|
70
84
|
|
|
71
|
-
-
|
|
85
|
+
- The Claude Code guide now documents a native worker (`claude mcp add`, `/mcp`, `dalan connect approve`) without T3 Code.
|
|
72
86
|
|
|
73
87
|
- On macOS, `worker-bridge-setup.mjs --start` now also runs `launchctl kickstart` after `bootstrap`. On macOS 26 a bootstrapped agent could stay loaded and never run, so the bridge did not answer after "Started".
|
|
74
88
|
|
|
75
|
-
- Tests: remove a stray marker file from `scripts/mirror-fetch-test.mjs`.
|
|
76
89
|
- The pre-upgrade drain can no longer wait without end: the pause and active-claim commands share one time limit, and a timeout prints how to resume the old service before retrying.
|
|
77
90
|
|
|
78
91
|
- A native client, such as Codex CLI or Claude Code, on another computer can now sign in to a remote HTTPS bridge. The owner allowlists its native loopback OAuth callback, with exact canonical host and path, random client ports, a redirect typo check and out-of-band pairing-code approval. Native pairings are approved one code at a time: a newer native attempt never supersedes or blocks an older one, and `dalan connect pending` prints each native entry's approve command. Web pairings keep newest-only approval.
|
|
79
92
|
|
|
80
|
-
- A new profile no longer shows or defaults to the legacy worker name `dot`: `tell` without `--worker` now follows the same rule as `submit` (the only worker, or a clear error), and the top-level `status` fields report scope `none` instead of `dot` unless a worker named `dot` is configured.
|
|
93
|
+
- A new profile no longer shows or defaults to the legacy worker name `dot`: `tell` without `--worker` now follows the same rule as `submit` (the only worker, or a clear error), and the top-level `status` fields report scope `none` instead of `dot` unless a worker named `dot` is configured.
|
|
81
94
|
|
|
82
|
-
- Docs: the README connection section now starts with "Connect any MCP worker"; the ChatGPT and hosted Claude guides become optional recipes.
|
|
83
95
|
|
|
84
96
|
- Fix: a repository grant (`dalan worker allow`) now takes effect only after its audit event is recorded. If its audit event cannot be written, the grant is not applied and the command says "repository grant not applied". Before, the grant stayed in force with no audit record. A removal still takes effect first and reports a missing audit event, because failing closed is safe.
|
|
85
97
|
|
|
86
|
-
- Add `dalan try`: one command that creates a private trial home, starts the loopback bridge, pairs a built-in demo worker through the real OAuth flow and finishes one job. It then queues a second job for the owner's own worker, asks before approving that worker's pairing, and prints its report.
|
|
98
|
+
- Add `dalan try`: one command that creates a private trial home, starts the loopback bridge, pairs a built-in demo worker through the real OAuth flow and finishes one job. It then queues a second job for the owner's own worker, asks before approving that worker's pairing, and prints its report. `dalan` now also reads `DALAN_HOME` as its `HOME`; the server still reads `HOME`.
|
|
87
99
|
|
|
88
|
-
- Dalan is published to npm as `@tnunamak/dalan`.
|
|
100
|
+
- Dalan is published to npm as `@tnunamak/dalan`. The npm package excludes generated Python caches; package checks confirm that it ships no tests, fixtures or local state and that shipped modules have resolvable relative imports. `dalan try` also reads `connect pending --json`, shows the resource line (or says the bridge did not report it), refuses a home that already holds files it did not create, stops on ended input or Ctrl-C at any step, retries a lost port race, and has the demo worker open an MCP session before it calls tools. A relative `DALAN_HOME` is resolved against the current directory.
|
|
89
101
|
|
|
90
102
|
- A fresh install's heartbeat can now ping without a drainer: drainer evidence is opt-in with `DALAN_DRAINER_HEALTH_FILE`. The bridge status gate remains mandatory; opted-in evidence retains fail-closed freshness and health checks.
|
|
91
103
|
|
|
@@ -98,9 +110,9 @@ This file lists user-visible changes, newest first. Check the section for your t
|
|
|
98
110
|
|
|
99
111
|
### Changes
|
|
100
112
|
|
|
101
|
-
- Security: the development flags that allow unauthenticated or insecure public access now work only on loopback. `DALAN_DEV_ALLOW_UNAUTHENTICATED=1` and `DALAN_ALLOW_INSECURE_PUBLIC=1` are restricted to loopback binds (`127.0.0.1`, `::1`, `localhost`). On any other bind host, including the `0.0.0.0` default, startup now fails instead of serving an unauthenticated public route, and neither flag waives the TLS reverse proxy requirement for external OAuth.
|
|
102
|
-
-
|
|
103
|
-
- Fix: a resolver failure is reported once per listing even when it returns a Promise or throws a falsy value.
|
|
113
|
+
- Security: the development flags that allow unauthenticated or insecure public access now work only on loopback. `DALAN_DEV_ALLOW_UNAUTHENTICATED=1` and `DALAN_ALLOW_INSECURE_PUBLIC=1` are restricted to loopback binds (`127.0.0.1`, `::1`, `localhost`). On any other bind host, including the `0.0.0.0` default, startup now fails instead of serving an unauthenticated public route, and neither flag waives the TLS reverse proxy requirement for external OAuth.
|
|
114
|
+
- Operations documentation now says that a future-schema refusal makes no schema or row changes, though SQLite may manage WAL sidecars.
|
|
115
|
+
- Fix: a resolver failure is reported once per listing even when it returns a Promise or throws a falsy value. Restoring an approved destination clears the listing block only while repository policy still allows the job.
|
|
104
116
|
- Fix: the self-check now accepts a resource with a path and rejects an origin-only match. It compares the OAuth metadata `resource` with the whole configured resource, as RFC 9728 requires, instead of its origin. A path resource now works and an origin-only value no longer matches it.
|
|
105
117
|
- Fix: the daily self-check no longer accepts an issuer that only appears inside another string. It requires the issuer to be an exact member of the metadata's `authorization_servers` array in the daily self-check. A string that only contains the issuer no longer matches.
|
|
106
118
|
- Redaction now detects Slack rotating tokens, Telegram and Discord bot token shapes and URL credentials with short passwords.
|
package/PROTOCOL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Dalan protocol
|
|
2
2
|
|
|
3
|
-
The product is Dalan, and the OAuth scopes are `dalan.read` and `dalan.work`. The older `dot-bridge.read` and `dot-bridge.work` names remain accepted aliases with exactly the same permissions, so existing tokens, connections and clients keep working. Existing metadata namespaces and persisted protocol identifiers keep their values. T3
|
|
3
|
+
The product is Dalan, and the OAuth scopes are `dalan.read` and `dalan.work`. The older `dot-bridge.read` and `dot-bridge.work` names remain accepted aliases with exactly the same permissions, so existing tokens, connections and clients keep working. Existing metadata namespaces and persisted protocol identifiers keep their values. The six T3 thread tools require `DALAN_ENABLE_T3_TOOLS=1` and the worker's `t3` capability; `notify_owner` is advertised independently of that switch, and its calls also require the capability. See [upgrade settings and connector refresh](docs/dalan-upgrade.md).
|
|
4
4
|
|
|
5
5
|
## Worker identity and client independence
|
|
6
6
|
|
|
@@ -47,9 +47,21 @@ In built-in mode a grant records the connection it was given to (`claims.connect
|
|
|
47
47
|
|
|
48
48
|
This is **destination disclosure and claim admission, not egress protection**. Pre-claim list/get/wake disclosure remains possible; declarations may be inaccurate; active remote work is not stopped. See [usage](docs/usage.md#destination-disclosure-and-claim-admission) for configuration, private HTTP approval and limitations.
|
|
49
49
|
|
|
50
|
+
## Policy work orders (schema 66)
|
|
51
|
+
|
|
52
|
+
A policy work order is a read-only submission reserved for one result from a pool of named workers. It is not an assignment until an eligible worker acquires it. `work_order_id` identifies the reserved order. The submitted `request_id` is reserved when the owner creates the order; on acquisition, the ordinary execution child uses that same ID, and `child_request_id` equals `request_id`. There is no second result slot and no automatic cross-worker retry. Removal or revocation of the acquired worker does not reallocate the order after lease expiry. The owner must cancel it and submit a fresh request ID for the remaining eligible workers, after checking that previous external work has stopped. Cancellation does not establish that external compute stopped.
|
|
53
|
+
|
|
54
|
+
The owner sets `routing.version: 1`, a non-empty `allowed_workers` list, `fan_out: 1`, and `deadline_at`. The assignment must use `execution_scope: "read-only"` and cannot be a protocol job. Set `routing.deadline_at`, or set `assignment.valid_until` when no routing deadline is supplied. If both fields are present, the earlier deadline applies. `valid_until` limits queue admission: the bridge cancels queued work when its deadline expires, but it does not stop an active claim. `destination_revisions` binds the owner's approval to each candidate worker's exact destination revision returned in the private submit preview. A dry-run stores nothing.
|
|
55
|
+
|
|
56
|
+
A policy work order carries `priority` (`normal` or `background`); normal work is listed first. `list_pending` returns at most 50 eligible orders in `policy_work.items`; the eligible backlog is independent of free claim lanes. `policy_work.next_page_request_id` is an encrypted, worker-bound cursor read through the existing `get` tool. It captures a high-water mark, survives a bridge restart while its database key remains, and does not include later work orders. Eligibility is checked on each page. A worker that is not currently allowed sees neither titles nor a global backlog count. An ineligible unacquired order is omitted from its claimable set. Once materialized, a child follows ordinary assignment visibility, including `blocked: true` for destination-blocked jobs.
|
|
57
|
+
|
|
58
|
+
A policy child claim supplies a fresh `acquisition_id`, kept unchanged for an exact retry. Acquisition commits the child, claim and work-order winner in one SQLite transaction. A lost reply can be retried with the same worker, subject, claimant, connection and acquisition ID; it returns the saved receipt and child. A changed policy does not silently replace an existing holder. Cancel the submitted request ID to revoke bridge authority. An unacquired order is cancelled at its deadline; once acquired, ordinary queue expiry applies to an unclaimed child, while an active claim remains untouched. Cancellation does not prove that external compute stopped.
|
|
59
|
+
|
|
60
|
+
Version 1 discovers unacquired orders by polling `list_pending`; they are not queued assignments and do not generate `assignment.available` re-wake events. Events for materialized children remain hints. The database upgrade to schema 66 is additive; use a pre-upgrade backup to return to an older build. See [pool submission and worker flow](docs/pull-queue.md) for the command examples and wire walkthrough.
|
|
61
|
+
|
|
50
62
|
## Native contract v5: protocol-v0 jobs
|
|
51
63
|
|
|
52
|
-
Set `DALAN_CATALOG_PROFILE=protocol-v0` to advertise the opt-in native job tools. The default catalog remains the stable profile:
|
|
64
|
+
Set `DALAN_CATALOG_PROFILE=protocol-v0` to advertise the opt-in native job tools. The default catalog remains the stable profile: 22 named tools with `DALAN_ENABLE_T3_TOOLS=1` and 16 without T3. In modern profiles, `tools/list` is process-wide and does not vary by worker capability; advertised names do not grant authority, and `tools/call` enforces the `t3` capability. `questions-v1` remains available with its existing identified-question behavior. Release 0.5.0 changes the advertised tool list once ([Catalog v2](#catalog-v2)): after you upgrade, refresh the connector or reconnect each worker client one time. Changing `DALAN_CATALOG_PROFILE` also changes the tool list and needs the same refresh. `legacy-v46` keeps its pinned catalog behavior. This section describes the native bridge contract; it does not claim full Job Protocol Fixture Profile conformance.
|
|
53
65
|
|
|
54
66
|
A protocol job has an immutable `protocol` object with exactly `profile: 'job-v0'`, `source`, `scope`, `policy`, `destination`, and `retain_until_ms`. The retention deadline is an absolute safe integer in milliseconds. Owner labels in these fields describe intent and routing; they do not grant execution authority. Existing owner capability checks, worker identity, claim and epoch checks still control actions. Protocol jobs use schema 60 native revisioned events and command receipts. Worker mutations provide `command_key` and `expected_revision`, with an optional `epoch` checked against the current grant. Private owner mutations use the same key and revision fields. Authorization, current grant and lease checks precede replay; an exact retry then returns its original receipt before revision comparison. Changed intent conflicts, while a committed finish receipt can be retrieved after lease expiry by its original authenticated holder, without restoring authority. Cancelled jobs may retain bounded late output as audit evidence while the original lease remains valid; they accept no result or new worker authority.
|
|
55
67
|
|
|
@@ -291,12 +303,12 @@ Catalog v2 is the last advertised catalog change. ChatGPT caches tool names, des
|
|
|
291
303
|
|
|
292
304
|
- Every tool carries MCP `annotations`. Read-only tools (`list_pending`, `get`, `list_files`, `read_file`, `workspace_result`, `t3_thread_list`, `t3_thread_read`, `t3_thread_wait`, `list_tools`, `call_tool_read`) set `readOnlyHint:true`. All other tools, including `call_tool_write`, set `readOnlyHint:false` and `destructiveHint:false`; `notify_owner` also sets `openWorldHint:true` because it reaches an outside service.
|
|
293
305
|
- Three fixed tools front a server-side tool registry. `list_tools` takes no arguments and returns `{registry_version, tools}`. `registry_version` is a monotonic integer that moves on every register, remove, grant, revoke, enable and disable. Each tool has `name`, `description`, `input_schema`, `class` (`read` or `write`) and `schema_hash`. `call_tool_read` and `call_tool_write` take `{tool, arguments, schema_hash, idempotency_key}` and no other field. `arguments` is an open object that the registry validates against the registered tool's own schema. `schema_hash` and `idempotency_key` (at most 128 characters) are required for `call_tool_write` and optional for `call_tool_read`. `call_tool_read` runs only `read` tools and `call_tool_write` only `write` tools. Their names, descriptions and schemas are fixed and name no individual registered tool, so registering, changing or removing a tool never changes `tools/list`.
|
|
294
|
-
- The advertised `tools/list` is fixed per catalog profile and
|
|
306
|
+
- The advertised `tools/list` is fixed per modern catalog profile and global T3 setting. It does not vary by worker capability. Registry changes never alter it, and the tools a worker can actually use vary per worker and are read through `list_tools`.
|
|
295
307
|
- `schema_hash` pins what the model saw. It covers the tool name, description, input schema, class, handler kind and handler config (target thread, command template) and the calling worker's grants. A call whose hash differs from the current one is refused with `stale_registry` and the text `call list_tools again`. A changed target or a new grant therefore cannot ride on an older view or an older approval. The ChatGPT approval of `call_tool_write` is a user-interface convenience, not the control. The control is the owner-managed grant plus this pin.
|
|
296
308
|
- Every call passes one enforcement function, in this order: authenticate, resolve the worker, a per-worker admission budget (it also counts unknown and ungranted tools), exact-match registry lookup (no case or whitespace normalisation), grant, class, schema hash, idempotency, argument validation, rate limit, handler. Handlers take their target and config only from the registry row, never from arguments.
|
|
297
309
|
- `idempotency_key` is stored per (worker, tool, key) in SQLite before the handler runs. The reservation holds a lease of the handler timeout plus 30 seconds (45 s for `t3_post`); a finished outcome is kept for 7 days. A repeat returns the stored outcome without running the handler again. A repeat while the lease is live is refused with `in_progress` (retryable, with the seconds left); after a crash, a repeat once the lease has expired takes the reservation over and runs the handler again. A failed handler may run again under the same key only when it proved it delivered nothing (`t3-post` exit code 3).
|
|
298
310
|
- A refused call is an MCP result with `isError:true` whose text starts with one machine-readable code: `tool_unavailable` (unknown, ungranted and disabled tools look the same, so a worker cannot list tools it cannot use), `wrong_class`, `stale_registry`, `invalid_arguments`, `rate_limited`, `in_progress` or `handler_failed`. It is never a transport error, and the text never holds registry contents. Results are redacted and capped at 32 KiB; a longer result becomes `{truncated:true, preview}`. The owner manages the registry with `dalan tool` ([operator-registered tools](docs/t3-reverse-control.md#adding-abilities-without-a-refresh)). A worker sees and may call only the tools granted to its resolved worker name; with no grants `list_tools` returns an empty `tools` array.
|
|
299
|
-
- The worker tools `t3_thread_create`, `t3_thread_send`, `t3_thread_wait` and `t3_thread_set` are top-level tools again, advertised
|
|
311
|
+
- The worker tools `t3_thread_create`, `t3_thread_send`, `t3_thread_wait` and `t3_thread_set` are top-level tools again, advertised when `DALAN_ENABLE_T3_TOOLS=1`; calls also require the worker's `t3` capability. `t3_thread_wait` is read-only. With the setting on, `tools/list` advertises all six T3 thread tools, including `t3_thread_list` and `t3_thread_read` (`scripts/fixtures/catalog.t3-on.tools.golden.json` freezes it). `legacy-v46` keeps its frozen twelve-tool catalog byte for byte, without annotations or the registry tools.
|
|
300
312
|
|
|
301
313
|
## Owner operations and delivery recovery
|
|
302
314
|
|