@tnunamak/dalan 0.8.1 → 0.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +61 -2
- package/CONTRIBUTING.md +2 -0
- package/README.md +8 -12
- package/bin/dalan.mjs +25 -4
- package/bin/dot-acp-agent.mjs +572 -76
- package/bin/dot-alert.mjs +9 -3
- package/bin/dot-deadman.mjs +3 -1
- package/bin/dot-heartbeat.mjs +14 -7
- package/bin/dot-pr-reviewer.mjs +3 -31
- package/bin/dot-worker.mjs +121 -34
- package/contracts/adapter-qualification.schema.json +94 -7
- package/docs/chatgpt-worker-onboarding.md +1 -1
- package/docs/codex-to-muse.md +2 -2
- package/docs/connect-chatgpt.md +1 -1
- package/docs/connection-longevity.md +2 -2
- package/docs/dalan-upgrade.md +8 -5
- package/docs/deadman.md +4 -0
- package/docs/design/authority-matrix.md +18 -0
- package/docs/design/failure-table.md +87 -0
- package/docs/design/identities.md +22 -0
- package/docs/design/pnpm-prepared-dependencies.md +64 -0
- package/docs/design/reuse-ledger.md +75 -0
- package/docs/design/target-architecture-v2.md +434 -0
- package/docs/local-agent-mcp.md +14 -0
- package/docs/local-agent-requester.md +2 -1
- package/docs/manual-setup.md +1 -1
- package/docs/operations.md +77 -14
- package/docs/pull-workers.md +11 -1
- package/docs/service-setup.md +10 -10
- package/docs/t3-integration.md +4 -2
- package/docs/t3-reverse-control.md +5 -5
- package/docs/test-suite-isolation.md +7 -6
- package/docs/trials/chatgpt-agent.md +47 -0
- package/docs/trials/claude-code-requester.md +68 -0
- package/docs/trials/muse.md +46 -0
- package/docs/usage.md +21 -7
- package/docs/worker-clients.md +1 -1
- package/integrations/t3/acp-kit/src/errors.mjs +6 -2
- package/integrations/t3/acp-kit/src/lock.mjs +46 -17
- package/integrations/t3/acp-kit/src/session-store.mjs +15 -3
- package/integrations/t3/acp-kit/src/t3-envelope.mjs +10 -2
- package/package.json +4 -3
- package/packages/job-core/protocol/canonical.mjs +45 -7
- package/packages/job-core/transitions.mjs +4 -2
- package/scripts/upgrade-drain.mjs +96 -8
- package/scripts/worker-bridge-setup.mjs +215 -120
- package/src/ack-ledger.mjs +7 -1
- package/src/acp-bridge.mjs +256 -28
- package/src/admin-socket.mjs +32 -3
- package/src/alerts.mjs +17 -8
- package/src/answer-journal-retention.mjs +82 -0
- package/src/answer-journal.mjs +6 -4
- package/src/as-store.mjs +51 -6
- package/src/as.mjs +27 -5
- package/src/catalog-switch-inventory.mjs +70 -0
- package/src/check-response.mjs +4 -1
- package/src/cli-help.mjs +14 -3
- package/src/cli-name.mjs +13 -1
- package/src/connect-cli.mjs +159 -4
- package/src/deadman.mjs +8 -5
- package/src/delivery.mjs +2 -19
- package/src/destinations/index.mjs +75 -14
- package/src/drain-runner.mjs +5 -1
- package/src/follow-current.mjs +3 -1
- package/src/get-summary.mjs +11 -2
- package/src/git-env.mjs +1 -1
- package/src/gozar-routes.mjs +313 -94
- package/src/host-budget-storage.py +56 -6
- package/src/host-budget.mjs +98 -15
- package/src/host-execution-policy.mjs +17 -6
- package/src/legacy-names.mjs +0 -2
- package/src/lifecycle.mjs +44 -9
- package/src/loopback-probe.mjs +46 -0
- package/src/mcp-outcome.mjs +3 -1
- package/src/mcp-sse.mjs +2 -1
- package/src/mcp-stdio.mjs +192 -30
- package/src/patch-apply.mjs +212 -7
- package/src/phase-trace.mjs +73 -0
- package/src/prepared-go-modules.mjs +127 -0
- package/src/prepared-node-modules.mjs +225 -38
- package/src/prepared-pnpm.mjs +276 -0
- package/src/prepared-store-prune.mjs +52 -0
- package/src/projects.mjs +59 -7
- package/src/protocol-artifact-commands.mjs +28 -0
- package/src/protocol-finish.mjs +3 -2
- package/src/publication-authority.mjs +22 -0
- package/src/publish-plan.mjs +2 -2
- package/src/pull-queue.mjs +55 -20
- package/src/read-api.mjs +127 -0
- package/src/redaction.mjs +173 -0
- package/src/rejections.mjs +19 -3
- package/src/route-custody.mjs +90 -0
- package/src/route-publication.mjs +50 -0
- package/src/route-setup.mjs +184 -0
- package/src/schema-subset.mjs +5 -3
- package/src/server.mjs +503 -98
- package/src/service-launchd.mjs +5 -1
- package/src/service-update-lock.mjs +7 -4
- package/src/service-update-runtime.mjs +136 -21
- package/src/service-update.mjs +207 -51
- package/src/service.mjs +276 -77
- package/src/setup.mjs +48 -25
- package/src/signal.mjs +1 -1
- package/src/status-evidence.mjs +18 -5
- package/src/store.mjs +876 -120
- package/src/submission-policy.mjs +257 -56
- package/src/t3-control.mjs +1 -1
- package/src/t3.mjs +14 -8
- package/src/terminal-safe.mjs +9 -7
- package/src/tool-registry.mjs +134 -41
- package/src/try-exposure.mjs +53 -86
- package/src/try-hosted.mjs +257 -70
- package/src/try.mjs +48 -22
- package/src/work-order.mjs +11 -6
- package/src/worker-instructions.mjs +26 -4
- package/src/worker-runs.mjs +35 -0
- package/src/workers.mjs +34 -7
- package/src/workspace.mjs +354 -54
- package/systemd/dot-deadman.service +3 -1
- package/docs/dot-pr-reviewer.config.example.json +0 -9
- package/docs/pr-head-reviewer.md +0 -70
- package/src/pr-head-reviewer.mjs +0 -596
- package/systemd/dot-pr-reviewer.service +0 -11
- package/systemd/dot-pr-reviewer.timer +0 -10
package/CHANGELOG.md
CHANGED
|
@@ -4,7 +4,55 @@ This file lists user-visible changes, newest first. Check the section for your t
|
|
|
4
4
|
|
|
5
5
|
## Unreleased
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## 0.8.3 (2026-12-03)
|
|
8
|
+
|
|
9
|
+
## 0.8.2 (2026-12-03)
|
|
10
|
+
|
|
11
|
+
- **A repository job that asks for a file in your home directory is refused at submission.** `$HOME/` and `${HOME}/` follow the same rule as `~/`. A warning alone used to let these jobs queue even though the worker could not read the file.
|
|
12
|
+
- **The PR-head reviewer is retired, and Dalan no longer reads T3's private database.** `dalan-pr-reviewer` now prints that the reviewer was retired and exits 2; the command stays for one release so an upgrade leaves no dangling command. Its systemd units, example config and docs are removed. Fleet tooling owns PR-head reviews. Disable any `dot-pr-reviewer.timer` you installed.
|
|
13
|
+
- **Each job records its delivery as adapter, address and adapter version (schema 73).** New columns `delivery_adapter`, `delivery_address` and `delivery_adapter_version` hold the delivery tuple next to the existing `delivery` string. Each registered destination declares a version (built-ins are `1`). The upgrade fills the tuple for existing `none` and `t3:` rows and leaves other rows unknown. A Dalan release from before this change refuses to open the upgraded database.
|
|
14
|
+
- **A worker can be told how often to report progress.** Set `worker_heartbeat_ms` for a worker in `limits.json` (for example `{"muse": 120000}`). Its claim, progress and own `get` replies then carry `progress_due_at`, the claim guidance asks for a short progress note at least that often, and `status` shows `heartbeat_ms` for the worker. Nothing is refused or taken over; without the setting replies are unchanged.
|
|
15
|
+
- **A delivery adapter without its own route check needs a valid address.** The default routing check now uses the same address parser as admission, so a malformed stored row no longer loads such an adapter; `none` and stored `t3` rows route as before.
|
|
16
|
+
- **The admission track record counts jobs that ended in the last 7 days.** It used to select by creation time, so a job queued just before the window and finished yesterday was left out. Jobs are now placed by their report, cancellation or terminal lifecycle time, with creation time only for old rows that have none.
|
|
17
|
+
- **Check metadata reports each named check's own refusal.** Before, the first check's refusal was copied to every `named/N` entry, so one excluded path could make every check look blocked; the aggregate reason is now set only when no authorized check can run.
|
|
18
|
+
- **MCP owner verbs refuse a request id that starts with `-`.** Such an id could have been read by the CLI as an option such as `--approve`; it is now refused with a validation error before any CLI call.
|
|
19
|
+
- **`worker_max_claims` also holds when an expired claim comes back.** Resuming or rotating an expired claim is now refused with `capacity_full` when the worker is already at its cap; an exact retry of a live claim is unchanged.
|
|
20
|
+
- **A dry run refused before the work-order check still carries the admission answer.** `dalan forecast --json` and `submit --dry-run` used to drop `admission` when the refusal came early (for example `head_sha_unsupported`). The early reply now includes it when the target and task kind are known; a body that is not valid JSON still has none.
|
|
21
|
+
- **An agent can finish a local client's sign-in without opening a browser.** `dalan connect complete URL --worker NAME` takes the authorization URL a local client (for example `pi mcp login`) printed, checks that it is this bridge's endpoint with one loopback callback and an open pairing window for that worker, approves exactly that pairing with the local operator key and delivers the callback to the client's loopback listener. It prints only the connection id, never the code, cookie or token. A URL for another host, a non-loopback callback or a closed window is refused and nothing is sent.
|
|
22
|
+
- **An owner can cap how many claims one worker holds (`worker_max_claims` in limits.json).** A worker in the map is refused a claim while it already holds that many live claims, across all its connections; `/status` and the lane counts report the cap. Workers not in the map behave as before.
|
|
23
|
+
- **A zip with bytes in front of it is scanned before download.** The scan finds a zip by its end-of-central-directory record, as zip readers do, so a self-extracting or prefixed archive is decoded and checked. Archive magic bytes that occur by chance in an ordinary binary do not change how it is scanned.
|
|
24
|
+
- **A finish_handoff reply says the next job is already claimed, and when that claim lapses.** Each handed-off grant carries `already_claimed: true` and its `lease_expires_at`. The reply tells the worker not to call `claim` again and to send `progress` first, which keeps the claim.
|
|
25
|
+
- **A failed patch apply restores both ends of a rename, and a materialize grant file with setuid, setgid or sticky bits is refused.** The file list behind the snapshot now includes a rename's old path as well as its new one. The grant check now requires a mode of exactly 0600, including the special bits.
|
|
26
|
+
- **`dalan forecast` and `submit --dry-run` show the real reason for a refused job.** A dry run that was refused or needed clarification used to fail inside the admission forecast and report a generic `refused` reason. A refused dry run now carries its own reasons and no forecast.
|
|
27
|
+
- **The first help screen is short again.** `forecast`, `correct` and `materialize` are listed under `dalan help --all`. `materialize` help now describes publishing as well as `--dry-run`.
|
|
28
|
+
- **A job whose T3 delivery has no valid thread id is refused at submit, so its result is never delivered nowhere.** A delivery object with an empty, missing, non-string or invalid `threadId` now fails with `invalid_delivery: t3 delivery needs a valid thread id` before anything is stored. Stored legacy values keep routing as before.
|
|
29
|
+
- **`dalan materialize ID` pushes a finished patch inside the owner's grant to `dalan/<request_id>` and opens a draft PR.** The patch is applied in a temporary worktree at the job's base, committed with the owner's own git identity, pushed only to that new branch and opened as a draft against the default branch. A repo outside the grant gets no push; `per_pr` needs `--approve`; an existing different branch is refused. Dalan never merges.
|
|
30
|
+
- **A Gozar route operation that the SDK refuses before it reserves anything can be retried after a restart.** When a replayed operation without a route handle is refused with a pre-allocation code (for example an expired consent), Dalan records it as `prepared` again instead of leaving it stuck at `dispatching`. An operation that holds a handle stays protected.
|
|
31
|
+
- **A secret inside a gzip or zip artifact is found before download.** The artifact scan now opens gzip and zip (stored or deflated members, one nested layer) within fixed size, ratio and member limits. An archive it cannot read fully (truncated, encrypted, another compression method, over a limit or nested deeper) is refused as `artifact_unscannable: <reason>`, because an unscanned archive could carry a secret.
|
|
32
|
+
- **Delivery modes are registered by adapters, so a host other than T3 can add one without core changes.** The core routes a job's delivery by the adapter name before the first `:`. `none` and `t3:<thread>` parse, store and route exactly as before, and an unknown adapter is refused with a message that lists the registered names.
|
|
33
|
+
- **`status` reports the dispatch state of every worker, not only the legacy one.** `dispatch.by_worker` gives each configured worker its state (`paused`, `unknown`, `full`, `dispatch_gap` or `supply_gap`), free lanes, live queued jobs it has not skipped, and the oldest one's age. The top-level dispatch fields are unchanged.
|
|
34
|
+
- **`dalan-pr-reviewer` refuses a repeated value flag.** `--max 10 --max 0` used to run with the first value (up to ten submissions); it now stops with `duplicate argument --max`. The same applies to `--only`, `--config` and `--state-dir`. Repeated boolean flags are still accepted.
|
|
35
|
+
- **`dalan materialize ID --dry-run` shows whether a finished patch may be pushed, and changes nothing.** The owner names the repositories in `materialize.json` beside `checks.json` (mode 0600): `{"grant": ["org:<name>", "repo:<owner>/<name>"], "mode": "standing" | "per_pr"}`. The dry run lists the repository, base and files of the patch, the decision and the branch `dalan/<request_id>` it would push. No push exists yet.
|
|
36
|
+
- **An artifact that contains a secret is never downloaded.** Before the first byte is returned on any route, the bridge scans the whole artifact with the existing secret rules. A hit refuses every chunk with `artifact_secret_content: <rule name>`, never the matched text, and the request log records only ids and the rule. Clean artifacts download as before.
|
|
37
|
+
- **A requester can ask how soon a job would start without queuing it.** `dalan forecast` (CLI) and `dalan_forecast` (MCP, read-only) run the same checks as a dry-run submit and return the verdict, any reasons and the admission answer. `dalan correct ID` is the same as `dalan submit --revises ID`.
|
|
38
|
+
- **`status` no longer reports a dispatch gap for jobs the worker chose to skip.** The dispatch count and oldest age now count only live, uncancelled jobs the worker has not passed over.
|
|
39
|
+
- **A T3 child task no longer reports "queue full" when the target worker has room.** The ACP preflight now counts the jobs of the worker the job will go to (the reported default, or the only configured worker), not the whole bridge.
|
|
40
|
+
- **A requester can name the tests a job must pass, and the worker can run exactly those.** An implementation assignment may list up to eight `node <path>` commands in `checks`; the worker runs them as `named/1`..`named/8` with `run_check`, only where the owner's allowlist permits (repository, `named`) and the repository has an owner `default` check. See "Checks the requester names" in docs/usage.md.
|
|
41
|
+
- **The admission answer includes the worker's track record.** `admission.track_record` counts how this worker's recent jobs of the same kind ended: landed, check passed, checks failed, refused by the provider, unable to run, owner cancelled, or finished without a check. Each job counts once, and these are never folded into one success rate.
|
|
42
|
+
- **A job is no longer refused because a directory in its scope holds a file whose name only looks sensitive.** Read-only work drops such a file (for example `docs/signature.txt`) from the scope and tells the requester; `--exclude-sensitive` is no longer needed for it. Hard names, owner `sensitive_paths` and implementation scopes refuse as before. A file the caller names explicitly still refuses, and the refusal now says which rule matched and how to fix it.
|
|
43
|
+
- **A requester learns at submit how soon work is likely to start.** Submit and dry-run responses carry `admission`: jobs ahead and the oldest one's age, measured claimed and started waits with censored work counted apart, and whether the worker is live, paused, on a break or has no live subscription. The T3 child task shows it as its first line. Dalan reserves no lane, so `start` is always `queued`.
|
|
44
|
+
- **A local agent can now cancel, accept or reject, and correct a job through `dalan mcp`.** Three new tools, `dalan_cancel`, `dalan_accept` and `dalan_correct`, run the same `dalan cancel`, `dalan accept`/`dalan reject` and `dalan submit --revises` commands, with the same receipts and checks. The six existing tools are unchanged.
|
|
45
|
+
- **A host check no longer fails before testing because a branch changed `package.json` but not the lock file.** Prepared `node_modules` now get one entry per full dependency identity (runtime, root manifest, workspace manifests and local tarballs), so two checkouts that share a lock file keep separate entries. Entries prepared by an older version under the runtime-only key are prepared again once. A failed lookup now names its cause (`missing`, `bad metadata`, `identity mismatch`, `unexpected workspace tree`, `invalid dependency tree` or `unsafe store directory`).
|
|
46
|
+
- **The request log shows how long a coordinator took to hand a job to a helper.** A new line kind, `claim_dispatch`, is written when the holder's first `progress` note starts with `dispatched_at=<UTC time, whole seconds, ending in Z>`. It carries that time, the claim time, the gap (`null` when the stamp is later than the claim) and `source: worker_note`: a worker-reported estimate that the bridge does not match to one dispatch, written best effort at most once per claim. Log only: no tool, schema or catalog changes, so no connector Refresh.
|
|
47
|
+
- **`list_pending` and `next_queued` show what a coordinator needs to decide which queued jobs can start together.** Each assignment item now also carries `execution_scope`, `repos` (`github_repo` and `base_sha` of each pinned repository input), `scope_paths` and `output_paths` (the first 10 of each, with `scope_paths_total` and `output_paths_total`), `priority` and `review`. Before, an item was only the request ID, the first 160 characters of the brief and the creation time, so a worker that dispatches jobs to helpers had to guess which ones overlap on a repository, pin or file. A path list is cut at 10 entries: when `scope_paths_total` or `output_paths_total` is larger than the list shown, or the job names no scope, treat overlap as unknown, not as safe to run together. A destination-blocked item keeps its old fields and `blocked: true`, and has no triage fields. A key is omitted when the job names nothing for it (no repository, no scope paths, no output paths). These are response fields only: the tool description, the input schema and the event schema do not change, so the cached ChatGPT catalog stays valid and no connector Refresh is needed.
|
|
48
|
+
- **The request log shows where the time between "queued" and "claimed" goes.** Three new line kinds: `wake_delivery` (each wake webhook: queued-to-attempt time, HTTP status, and how long the receiver took to answer), `claim_phase` (each new claim: submit-to-wake, how long the receiver took to acknowledge the wake, wake-to-first-listing, listing-to-claim and submit-to-claim gaps in ms, with `handoff` set for a finish handoff) and `claim_first_action` (the holder's first call after the claim, and its delay). A step the bridge did not see, such as a handoff claim's wake, is `null`. Nothing else changes; no schema change.
|
|
49
|
+
- **A finished assignment's checkout is removed the moment its finish commits, not only by the hourly sweep.** A finished tree used to stay on disk for 6 hours (`WORKSPACE_RETENTION_MS`), or until the owner fetched the result, and about 40 new trees an hour made worktrees the bridge's main disk writer. Nothing reads a tree after the finish commits (the report, patch and check evidence are artifacts; owner `get`, `wait` and `artifact` read the store), so `finish` now removes the worktree, its dependency cache and its workspace row right after the finish commits, using the same removal the hourly sweep performs. A refused or rolled-back finish keeps the tree; a checkout with an active check, or a removal that fails, is logged (`artifact_cleanup_error`) and left to the hourly sweep; cleanup never delays or fails the finish reply.
|
|
50
|
+
- **The bridge reads far less of its database, so a loaded host no longer stalls it for seconds.** On a 428 MB database the timer that checks for due notifications (every 500 ms), `status`, `get` and `finish` each scanned whole tables: 2.7 GB read per minute, and every read a disk read once the host ran low on memory. A scan blocks the event loop, so requests to the bridge hung for up to 30 s and a worker saw the bridge as down. Now four new indexes (`notifications_due_live`, `notifications_held`, `progress_request`, `assignments_worker_status`; created at start, no schema-version change, so older code still opens the database), one `finish` statement that uses `request_id`, and a `status` that reads only new progress and report rows cut the read volume of a call mix with the same call rate about 20 times (idle: 953 to 43 MB per minute; `status` on a loaded host: 36 s to a few seconds cold, milliseconds warm).
|
|
51
|
+
- **A loopback probe makes a stalled bridge visible.** Every 30 s the bridge asks its own listener a question and measures the answer and the timer's lateness. A slow (1 s or more) or failed answer is logged as `loopback_probe_slow` with its milliseconds; every tenth sample logs a `loopback_probe` summary. `dalan status --json` shows `loopback_probe` (last answer, worst of the last hour, failures). Set `DALAN_LOOPBACK_PROBE_MS` to another interval (at least 1000) or `0` to turn it off.
|
|
52
|
+
- **Host-check memory ceilings sized from measurement, and an OOM-killed reservation is not restarted at once.** The maximum `host_budget.memory_bytes` rises from 1 GiB to 2 GiB: the heaviest measured suite-class workload on the deployment host peaked at 1592 MB (test-sandbox run ledger, 2026-11-24), about 27% under the new ceiling, while completed host checks peaked at 209 MB (bridge `check_runs` evidence). One unit still runs per user at a time. After the kernel OOM-kills a host-check unit, the same workload (directory, phases and budgets) on that unit fails fast for 60 seconds with reason `oom` (`oom: <unit> was kernel-killed and is not restarted at once`): a caller's restart loop can no longer hand the same workload back to the kernel second after second, and the affected check is marked failed without a new kill. Other workloads on the unit still start.
|
|
53
|
+
- **`dalan prepare-deps` works when the `npm` file beside Node is a shell wrapper.** Node installs from mise put a Bash wrapper there, so preparation failed with `dependencies_install_failed` before npm started. Dalan now runs npm's own JavaScript entry point: `npm_execpath` when it names `npm-cli.js`, then `../lib/node_modules/npm/bin/npm-cli.js` and `node_modules/npm/bin/npm-cli.js` beside the Node binary, then the old sibling `npm` file. The same fix covers the prepared-dependency step of host checks (part of #19).
|
|
54
|
+
- **A hosted agent that refreshes one OAuth connection from several sessions no longer loses it.** The refresh token that another session rotated away up to 5 minutes ago (only the one just before the current token) now gets a fresh access token and the connection's current refresh token instead of revoking the connection. Any older token, or the same token after 5 minutes, still revokes it. The log shows `as_refresh_reuse_tolerated` with the token's age. Tests can change the window with `DALAN_REFRESH_REUSE_WINDOW_MS` (1 s to 1 h, default 5 minutes).
|
|
55
|
+
- **`finish` can hand a worker its next job (opt in per worker).** A worker whose session ends after each `finish` leaves work queued. Set `"finish_handoff": true` (or `{"wait_ms": N}`, 0 to 45000, default 20000) for the worker in `workers.json`. After the report is stored, the `finish` reply carries `next_job`: the oldest queued job, claimed through the normal `claim` path. The claim starts on a 2-minute idle lease: if the worker never touches the job, it returns to the queue after 2 minutes, so a session that ended after `finish` does not hold a lane. The first call on the claim (a `get` counts) moves it to the 10-minute working lease. If nothing is queued, `finish` waits up to `wait_ms` for work, then returns `queue_empty`. A paused bridge, a closed client connection or a claim error ends the wait with the old `next_queued` hint, and the stored report is never affected. A repeated `finish` returns the same `next_job`. Off by default. `max_jobs` (1 to 8, default 1) lets one `finish` hand over several jobs, one per freed lane, in `next_jobs`; a worker that runs jobs side by side no longer drops to one job per finish.
|
|
8
56
|
|
|
9
57
|
## 0.8.1
|
|
10
58
|
|
|
@@ -13,6 +61,13 @@ This file lists user-visible changes, newest first. Check the section for your t
|
|
|
13
61
|
|
|
14
62
|
- **Relationships, work and authority have separate lifetimes.** Ending a worker relationship refuses new jobs while existing jobs, questions and results remain available under their own permissions and expiry.
|
|
15
63
|
- **Inspect relationships and permissions from the CLI.** `dalan relationships list` shows active and ended relationships, and `dalan relationships end ID` ends one. `dalan grants` lists permissions with each permission's enforcing component and expiry.
|
|
64
|
+
- **Public routes now go through Gozar 0.5.1.** `dalan service install`, `dalan try` and `dalan setup` ask Gozar which routes meet the requirements, show the setup steps and ask for approval in the terminal before anything is created. `--route NAME` is now optional on install. Dalan installs the service and writes the connector URL only after Gozar verifies the route.
|
|
65
|
+
- **An interrupted install or uninstall can be retried.** Dalan saves the setup operation ID before it asks Gozar to act. A retry asks for fresh consent on that same ID, and `dalan setup --cancel OPERATION_ID` cancels a prepared operation after you approve each offered action. If Gozar has not confirmed the outcome, Dalan keeps the reference so you can finish cleanup.
|
|
66
|
+
- **A public trial withdraws its connector URL while Gozar re-checks the route.** The URL comes back only after Gozar verifies the same address. When the route reaches a terminal state, the trial ends and closes its exact route handle.
|
|
67
|
+
- **An existing HTTPS address needs a matching Gozar offer.** Gozar must confirm that you own the infrastructure and that the origin and listener match the request. You keep the reverse proxy and its configuration; Dalan does not edit them.
|
|
68
|
+
- **`dalan service install` no longer accepts `--yes`, and the target port must equal the Dalan port.** Approve the route in the terminal instead. Gozar's route proof binds the receiving port, so a custom `--verify-cmd` can no longer publish a translated port; use the same port for `--port` and `--target`. `dalan service update --yes` is unchanged.
|
|
69
|
+
- **Route failures keep the state you already had.** A failed route check leaves the existing resource URL file in place. A worker that retries keeps the Gozar operation ID it first saved. A local error while Dalan hands off a verified route ends the wait as a handoff failure, not as a lost route. A failed cleanup of the setup intake no longer hides the setup result.
|
|
70
|
+
- Upgrade note: if Gozar asks to migrate configuration, keep the old installation and its route records, close the old route with that installation first, and enter credentials only at Gozar's approval prompts. See [upgrade](docs/dalan-upgrade.md#route-credentials-and-existing-services).
|
|
16
71
|
|
|
17
72
|
## 0.8.0
|
|
18
73
|
|
|
@@ -29,7 +84,8 @@ This file lists user-visible changes, newest first. Check the section for your t
|
|
|
29
84
|
- Test-only: parallel test suites no longer share ports, systemd unit names, setup locks or scratch directories, and a new acceptance test covers question relationships across the CLI and T3 requesters.
|
|
30
85
|
|
|
31
86
|
- **Install checks setup before requesting a public route.** `dalan service install` now runs every check that only reads (the worker profile, the home, the service package link, service and automatic-update unit collisions, Gozar's state path and, on Linux, the user systemd manager) before it asks Gozar for a route. This includes macOS LaunchAgent plists. `--write-units-only` no longer asks Gozar for a route. A later file-write or startup failure can still leave a route. Install never closes a route on failure because it may have reused one; once the service receipt is written, `dalan service uninstall` can use its recorded handle to remove it.
|
|
32
|
-
- **
|
|
87
|
+
- **A long home no longer breaks the admin socket.** A Unix socket path holds at most 107 bytes on Linux and 103 on macOS. When `<home>/.local/share/dalan/admin.sock` does not fit, the bridge and every client now use a short path in a private per-user directory, `/tmp/dalan-<uid>/<hash>.sock`. The directory must be a real directory that only you can use, or the bridge refuses to start and says why. Short homes keep the old path.
|
|
88
|
+
- **Install names a common setup problem.** A user systemd manager that cannot be reached is named, with `systemctl --user status` to see why and the note that a login session or `loginctl enable-linger` may be needed.
|
|
33
89
|
- **`dalan doctor --auth` explains your own pairing window.** When a pairing window for the same worker is already open, the check still fails and leaves the window alone, and now says it is your own window: finish pairing the client, or run `dalan connect stop`, then run doctor again.
|
|
34
90
|
- **A command with `--home` no longer runs the default home's version.** `dalan` hands each command to the version that the default home's service runs. With `--home DIR` (or `--home=DIR`) you name another home, so the installed `dalan` now runs the command itself. `DALAN_HOME` works as before.
|
|
35
91
|
- The [local-agent requester guide](docs/local-agent-requester.md) now passes the brief in single quotes, so the shell cannot run `$(...)` or backticks from it, and shows how to write a single quote inside the brief. It also no longer says that `report.summary` is always one line.
|
|
@@ -100,6 +156,9 @@ Upgrade note: `@tnunamak/gozar` 0.2.1 is now a dependency (`^0.2.1`). A service
|
|
|
100
156
|
|
|
101
157
|
## 0.5.2
|
|
102
158
|
|
|
159
|
+
- Fix: an invalid assignment `execution_scope` error now names `execution_scope` and lists the allowed values, `read-only` and `implementation`. It previously named the separate execution setting.
|
|
160
|
+
- Fix: a brief that mentions a path outside the repository through a shell variable (`$CONFIG_DIR/client.toml`), a Windows drive path or a UNC path is no longer refused as an undeclared or unknown repository path. The submission warns and grants no scope. Paths starting with `~/` or an absolute host path keep their refusal. Sensitive external paths are still refused.
|
|
161
|
+
|
|
103
162
|
- 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.
|
|
104
163
|
|
|
105
164
|
## 0.5.1
|
package/CONTRIBUTING.md
CHANGED
|
@@ -17,6 +17,8 @@ DALAN_HOST_CHECKS=0 npm test
|
|
|
17
17
|
|
|
18
18
|
For concurrent runs, use a separate Git worktree and a separate short `TMPDIR` for each run (for example `/tmp/s-a-$$` and `/tmp/s-b-$$`). The temporary directory must exist before the run starts. Unix socket paths must fit within 107 bytes. Each test owns its temporary homes, databases, listeners, and host-check systemd units; installed dependencies and the toolchain may be shared read-only. Host-check resource ceilings apply per check, so concurrent runs add their resource use together.
|
|
19
19
|
|
|
20
|
+
When running the installed Gozar journey on its own, point `TMPDIR` at a short, existing, writable directory on disk, especially if the isolated `HOME` is deeply nested. The journey creates and removes its own fixture directory under that temporary root.
|
|
21
|
+
|
|
20
22
|
New HTTP fixtures should bind port `0` and read the listening port. A fixture that must write its URL before starting a child should use `reservedPort({ start })` from `src/test-support/port.mjs` and report an actual bind failure with `error.code = 'EADDRINUSE'`; the helper then retries setup on another port. Calling `reservedPort()` without a startup callback only supplies a candidate, which can be taken before the listener binds. Tests that deliberately exercise a named or occupied port must retain that behavior rather than silently changing ports.
|
|
21
23
|
|
|
22
24
|
Some upgrade tests also run against the source of releases from before Dalan was public. Maintainers keep those archives outside the repository and set `DALAN_PREPUBLIC_FIXTURES` to their directory; without it, those tests skip with the reason "pre-public release fixtures not present".
|
package/README.md
CHANGED
|
@@ -2,28 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
Put your MCP-only agent to work on coding jobs from your Mac or Linux computer. The hosted agent is the worker: it connects to your local Dalan bridge over MCP and claims jobs you queue. With explicit repository grants and workspace setup, it can return findings or a patch for you to review. You decide whether to apply changes. Dalan does not run a model or start the agent.
|
|
4
4
|
|
|
5
|
-
Before you begin, install [Node.js](https://nodejs.org) 24 or newer
|
|
6
|
-
|
|
7
|
-
**Tailscale prerequisite.** `--route tailscale` publishes through Tailscale Funnel, which your tailnet administrator must allow (a `funnel` entry in the tailnet access controls; HTTPS and MagicDNS must be on too). If Funnel is not allowed, Dalan stops before it publishes anything and tells you which setup step is missing, or prints Tailscale's own refusal. Enable Funnel once at <https://tailscale.com/kb/1223/funnel>, then run the command again. Other routes need no Tailscale setting; `dalan setup` lists them.
|
|
5
|
+
Before you begin, install [Node.js](https://nodejs.org) 24 or newer. Your agent's account must allow custom MCP connectors.
|
|
8
6
|
|
|
9
7
|
<a id="quickstart"></a>
|
|
10
8
|
|
|
11
|
-
**Just exploring?** Run a temporary
|
|
9
|
+
**Just exploring?** Run a temporary trial that gives your connected worker a text-only job:
|
|
12
10
|
|
|
13
11
|
```sh
|
|
14
12
|
npm install -g @tnunamak/dalan
|
|
15
|
-
dalan try --public
|
|
13
|
+
dalan try --public
|
|
16
14
|
```
|
|
17
15
|
|
|
18
16
|
Follow the terminal instructions to add the connector and approve only the matching sign-in code. Paste the supplied prompt into your agent's chat. Success is a report returned to your terminal.
|
|
19
17
|
|
|
20
|
-
The trial
|
|
18
|
+
The public trial is text-only and grants no repository access. Keep private code and secrets out of it. It ends after three hours at most. Its public link can change or stop without warning. For a local-only trial that opens no public route, run `dalan try --local`. That mode may briefly grant its built-in self-check worker access to a synthetic repository created locally, not to your repositories. To connect a worker client by hand, see [manual setup](docs/manual-setup.md#worker-setup). For a persistent connection, use the installation steps below.
|
|
21
19
|
|
|
22
20
|
### Stop a trial
|
|
23
21
|
|
|
24
|
-
Ctrl-C stops the
|
|
25
|
-
|
|
26
|
-
If Gozar reports cleanup as pending, Dalan prints a recovery command that stops by port. Gozar does not bind that command to a session, so inspect the current route before you run it.
|
|
22
|
+
Ctrl-C stops the bridge and asks Gozar to close the trial's recorded route. If Gozar cannot confirm removal, rerun the trial with the same `--home DIR`. Dalan checks the retained route before it asks Gozar for a new one.
|
|
27
23
|
|
|
28
24
|
A trial prints its own home. Set `DALAN_HOME` to that home before you run other `dalan` commands against the trial. On stop, Dalan removes the connector URL file and the bridge's secret file for temporary routes.
|
|
29
25
|
|
|
@@ -45,7 +41,7 @@ The persistent service uses a fresh home and needs a new sign-in. Do not reuse t
|
|
|
45
41
|
|
|
46
42
|
```sh
|
|
47
43
|
npm install -g @tnunamak/dalan
|
|
48
|
-
dalan service install --worker assistant
|
|
44
|
+
dalan service install --worker assistant
|
|
49
45
|
dalan connect start --worker assistant
|
|
50
46
|
```
|
|
51
47
|
|
|
@@ -116,7 +112,7 @@ The text-only job proves pairing and reporting, not coding access. Keep using th
|
|
|
116
112
|
|
|
117
113
|
The [manual setup guide](docs/manual-setup.md#owner-and-requester-setup) creates a separate loopback bridge in a new home; it is not an upgrade path for your persistent service. If your existing service has no workspace access, stop before submitting a repository job. Reinstalling with `--enable-workspace` is refused because the saved service configuration must match; it cannot enable workspace access in place.
|
|
118
114
|
|
|
119
|
-
The first repository job below reads one file at a pinned commit. It does not edit files or run checks. The trial
|
|
115
|
+
The first repository job below reads one file at a pinned commit. It does not edit files or run checks. The trial's synthetic repository self-check is not a grant for this job; use the persistent service and the explicit grant below.
|
|
120
116
|
|
|
121
117
|
Replace `WORKER` with your worker's name (`assistant` above) and `OWNER/REPO` with the repository:
|
|
122
118
|
|
|
@@ -203,7 +199,7 @@ Replace `REQUEST_ID` with a job's ID.
|
|
|
203
199
|
| Command help | `dalan help --all` |
|
|
204
200
|
| Trial options | `dalan help try` |
|
|
205
201
|
| Bridge and queue state | `dalan status --json` |
|
|
206
|
-
|
|
|
202
|
+
| Job notices across all requesters on this host (last 72 hours by default) | `dalan inbox --all` |
|
|
207
203
|
| A full job record | `dalan get REQUEST_ID --json` |
|
|
208
204
|
| Host diagnostics | `dalan doctor --json` |
|
|
209
205
|
| File locations | `dalan paths --json` |
|
package/bin/dalan.mjs
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import fs from 'node:fs';
|
|
5
5
|
import os from 'node:os';
|
|
6
6
|
import path from 'node:path';
|
|
7
|
+
import { READ_API_COMMANDS, READ_API_SCHEMA_VERSION } from '../src/read-api.mjs';
|
|
7
8
|
import { fileURLToPath } from 'node:url';
|
|
8
9
|
import { unsupportedRuntime } from '../src/runtime-check.mjs';
|
|
9
10
|
import { followTarget, handOver } from '../src/follow-current.mjs';
|
|
@@ -31,10 +32,15 @@ if (help) {
|
|
|
31
32
|
// stdout is the protocol channel: nothing else may print to it. The tools run the CLI, which applies the DALAN_HOME rules.
|
|
32
33
|
await (await import('../src/mcp-stdio.mjs')).main();
|
|
33
34
|
} else if (process.argv[2] === 'setup') {
|
|
34
|
-
await (await import('../src/setup.mjs')).main();
|
|
35
|
+
await (await import('../src/setup.mjs')).main(process.argv.slice(3));
|
|
35
36
|
} else if (process.argv[2] === 'service') {
|
|
36
37
|
try { await (await import('../src/service.mjs')).serviceMain(process.argv.slice(3)); }
|
|
37
|
-
catch (error) {
|
|
38
|
+
catch (error) {
|
|
39
|
+
const { explainRouteError } = await import('../src/gozar-routes.mjs');
|
|
40
|
+
const { fix } = explainRouteError(error);
|
|
41
|
+
process.stderr.write(`dalan: service: ${error.message}\n${fix ? `Next: ${fix}\n` : ''}`);
|
|
42
|
+
process.exitCode = 1;
|
|
43
|
+
}
|
|
38
44
|
} else if (process.argv[2] === 'try') {
|
|
39
45
|
await (await import('../src/try.mjs')).main();
|
|
40
46
|
} else {
|
|
@@ -43,10 +49,25 @@ if (help) {
|
|
|
43
49
|
// doctor is exempt: it diagnoses a missing bridge home and reports it as a finding.
|
|
44
50
|
if (!process.env.DALAN_HOME && command && !['help', '--help', '-h', 'paths', 'doctor'].includes(command) && fs.existsSync(path.join(trial, '.dalan-trial'))) {
|
|
45
51
|
const message = `DALAN_HOME is not set, so "dalan ${command}" does not know which bridge home to use. To use the trial bridge, run this, then run the command again:\n export DALAN_HOME='${trial.replaceAll("'", "'\\''")}'`;
|
|
46
|
-
|
|
52
|
+
const error = { error: message, kind: 'local' };
|
|
53
|
+
const payload = READ_API_COMMANDS.includes(command) ? { schema_version: READ_API_SCHEMA_VERSION, ...error } : error;
|
|
54
|
+
process.stderr.write(process.argv.includes('--json') ? `${JSON.stringify(payload)}\n` : `dalan: ${message}\n`);
|
|
47
55
|
process.exit(1);
|
|
48
56
|
}
|
|
49
57
|
if (process.env.DALAN_HOME) process.env.HOME = path.resolve(process.env.DALAN_HOME);
|
|
50
|
-
|
|
58
|
+
if (command === 'forecast') {
|
|
59
|
+
process.argv.splice(2, 1, 'submit', '--dry-run');
|
|
60
|
+
} else if (command === 'correct') {
|
|
61
|
+
const id = process.argv[3];
|
|
62
|
+
if (!/^\w[-\w]{7,127}$/.test(id ?? '') || process.argv.slice(4).some(arg => arg === '--revises' || arg.startsWith('--revises='))) {
|
|
63
|
+
const error = 'usage: dalan correct REQUEST_ID (--file PATH | --stdin | --brief TEXT) [options]';
|
|
64
|
+
process.stderr.write(process.argv.includes('--json') ? JSON.stringify({error,kind:'local'}) + '\n' : error + '\n');
|
|
65
|
+
process.exit(2);
|
|
66
|
+
}
|
|
67
|
+
process.argv.splice(2, 2, 'submit', '--revises', id);
|
|
68
|
+
}
|
|
69
|
+
if (READ_API_COMMANDS.includes(command)) {
|
|
70
|
+
(await import('../src/read-api.mjs')).readMain(command, process.argv.slice(3), os.homedir());
|
|
71
|
+
} else await import('./dot-worker.mjs');
|
|
51
72
|
}
|
|
52
73
|
}
|