@tnunamak/dalan 0.0.0-stage → 0.5.2

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.
Files changed (182) hide show
  1. package/CHANGELOG.md +172 -0
  2. package/CONTRIBUTING.md +26 -0
  3. package/LICENSE +204 -0
  4. package/PROTOCOL.md +339 -0
  5. package/README.md +348 -2
  6. package/SECURITY.md +30 -0
  7. package/bin/dalan.mjs +38 -0
  8. package/bin/dot-acp-agent.mjs +377 -0
  9. package/bin/dot-alert.mjs +9 -0
  10. package/bin/dot-deadman.mjs +82 -0
  11. package/bin/dot-heartbeat.mjs +29 -0
  12. package/bin/dot-pr-reviewer.mjs +32 -0
  13. package/bin/dot-worker.mjs +755 -0
  14. package/docs/chatgpt-worker-onboarding.md +112 -0
  15. package/docs/claude-worker-onboarding.md +113 -0
  16. package/docs/connect-chatgpt.md +78 -0
  17. package/docs/connection-longevity.md +37 -0
  18. package/docs/dalan-upgrade.md +242 -0
  19. package/docs/deadman.md +59 -0
  20. package/docs/dot-pr-reviewer.config.example.json +9 -0
  21. package/docs/durability-audit.md +27 -0
  22. package/docs/keycloak-client-chatgpt-dot-bridge.json +59 -0
  23. package/docs/keycloak-oauth-setup.md +30 -0
  24. package/docs/local-agent-mcp.md +39 -0
  25. package/docs/manual-setup.md +135 -0
  26. package/docs/mirror-fetch.md +98 -0
  27. package/docs/operations.md +751 -0
  28. package/docs/operator-duties.md +68 -0
  29. package/docs/owner-integrator.md +27 -0
  30. package/docs/portable-auth-profile.md +109 -0
  31. package/docs/pr-head-reviewer.md +54 -0
  32. package/docs/pr-preflight.md +26 -0
  33. package/docs/pull-workers.md +97 -0
  34. package/docs/redaction.md +27 -0
  35. package/docs/service-setup.md +166 -0
  36. package/docs/setup-reference.md +80 -0
  37. package/docs/t3-connector-icon.png +0 -0
  38. package/docs/t3-integration.md +49 -0
  39. package/docs/t3-result-retry-delivery.md +41 -0
  40. package/docs/t3-reverse-control.md +107 -0
  41. package/docs/usage.md +439 -0
  42. package/docs/worker-clients.md +285 -0
  43. package/integrations/t3/acp-kit/src/capability.mjs +25 -0
  44. package/integrations/t3/acp-kit/src/errors.mjs +13 -0
  45. package/integrations/t3/acp-kit/src/index.mjs +5 -0
  46. package/integrations/t3/acp-kit/src/lock.mjs +155 -0
  47. package/integrations/t3/acp-kit/src/session-store.mjs +36 -0
  48. package/integrations/t3/acp-kit/src/t3-envelope.mjs +62 -0
  49. package/package.json +65 -4
  50. package/packages/job-core/README.md +18 -0
  51. package/packages/job-core/index.mjs +2 -0
  52. package/packages/job-core/package.json +8 -0
  53. package/packages/job-core/protocol/canonical.mjs +11 -0
  54. package/packages/job-core/protocol/v0/command.schema.json +1154 -0
  55. package/packages/job-core/protocol/v0/event.schema.json +77 -0
  56. package/packages/job-core/protocol/v0/reply.schema.json +59 -0
  57. package/packages/job-core/transitions.mjs +25 -0
  58. package/scripts/daily-selfcheck.mjs +135 -0
  59. package/scripts/lib/expose-tailscale.mjs +408 -0
  60. package/scripts/live-trial/common.mjs +272 -0
  61. package/scripts/monitor-targets.mjs +44 -0
  62. package/scripts/upgrade-drain.mjs +39 -0
  63. package/scripts/worker-bridge-setup.mjs +925 -0
  64. package/src/ack-ledger.mjs +37 -0
  65. package/src/acp-bridge.mjs +412 -0
  66. package/src/acp-context.mjs +138 -0
  67. package/src/admin-socket.mjs +14 -0
  68. package/src/alerts.mjs +147 -0
  69. package/src/artifact-journal.mjs +75 -0
  70. package/src/as-files.mjs +347 -0
  71. package/src/as-store.mjs +456 -0
  72. package/src/as.mjs +497 -0
  73. package/src/auth.mjs +166 -0
  74. package/src/builtin-http.mjs +22 -0
  75. package/src/check-coverage.mjs +38 -0
  76. package/src/check-lint.mjs +88 -0
  77. package/src/check-readiness.mjs +112 -0
  78. package/src/check-response.mjs +19 -0
  79. package/src/claim-command-ledger.mjs +51 -0
  80. package/src/cli-help.mjs +172 -0
  81. package/src/cli-name.mjs +16 -0
  82. package/src/connect-cli.mjs +126 -0
  83. package/src/consumers.mjs +61 -0
  84. package/src/deadman.mjs +329 -0
  85. package/src/delivery.mjs +19 -0
  86. package/src/demo-worker.mjs +150 -0
  87. package/src/destinations/index.mjs +23 -0
  88. package/src/destinations/none.mjs +15 -0
  89. package/src/destinations/t3.mjs +109 -0
  90. package/src/diagnostic.mjs +78 -0
  91. package/src/docs-url.mjs +9 -0
  92. package/src/drain-runner.mjs +9 -0
  93. package/src/drained-slot.mjs +53 -0
  94. package/src/drained.mjs +40 -0
  95. package/src/durable-waiters.mjs +236 -0
  96. package/src/env.mjs +19 -0
  97. package/src/execution.mjs +112 -0
  98. package/src/failure-type.mjs +28 -0
  99. package/src/get-summary.mjs +32 -0
  100. package/src/git-env.mjs +15 -0
  101. package/src/host-budget-receipts.mjs +154 -0
  102. package/src/host-budget-seccomp.py +33 -0
  103. package/src/host-budget-service.mjs +54 -0
  104. package/src/host-budget-stop.mjs +26 -0
  105. package/src/host-budget-storage.py +259 -0
  106. package/src/host-budget.mjs +149 -0
  107. package/src/host-cgroup.mjs +23 -0
  108. package/src/host-check-allowlist.mjs +42 -0
  109. package/src/host-execution-policy.mjs +38 -0
  110. package/src/host-health.mjs +34 -0
  111. package/src/host-stop-reverify.mjs +44 -0
  112. package/src/inbox.mjs +55 -0
  113. package/src/integrator.mjs +322 -0
  114. package/src/job-retention.mjs +69 -0
  115. package/src/legacy-names.mjs +8 -0
  116. package/src/lifecycle.mjs +291 -0
  117. package/src/limits.mjs +31 -0
  118. package/src/loopback.mjs +9 -0
  119. package/src/mcp-outcome.mjs +70 -0
  120. package/src/mcp-stdio.mjs +191 -0
  121. package/src/mirror-fetch-lock.py +164 -0
  122. package/src/mirror-fetch.mjs +174 -0
  123. package/src/notify-ledger.mjs +82 -0
  124. package/src/objectives.mjs +129 -0
  125. package/src/owner-report-artifact.mjs +66 -0
  126. package/src/patch-apply.mjs +84 -0
  127. package/src/path-syntax.mjs +16 -0
  128. package/src/paths.mjs +67 -0
  129. package/src/pr-head-reviewer.mjs +596 -0
  130. package/src/pr-preflight.mjs +51 -0
  131. package/src/prepared-node-modules.mjs +129 -0
  132. package/src/projects.mjs +480 -0
  133. package/src/protocol-artifact-commands.mjs +52 -0
  134. package/src/protocol-delivery-driver.mjs +167 -0
  135. package/src/protocol-finish.mjs +100 -0
  136. package/src/protocol-owner-command.mjs +35 -0
  137. package/src/protocol-owner-mutations.mjs +22 -0
  138. package/src/protocol-owner-waiters.mjs +67 -0
  139. package/src/protocol-retention.mjs +52 -0
  140. package/src/protocol-services.mjs +61 -0
  141. package/src/protocol-stop-observer.mjs +131 -0
  142. package/src/publish-plan.mjs +245 -0
  143. package/src/redaction.mjs +763 -0
  144. package/src/rejections.mjs +18 -0
  145. package/src/request-log.mjs +102 -0
  146. package/src/restore-check.mjs +90 -0
  147. package/src/result-binding.mjs +65 -0
  148. package/src/runtime-check.mjs +13 -0
  149. package/src/sandbox-supervisor.mjs +105 -0
  150. package/src/schema-subset.mjs +186 -0
  151. package/src/scopes.mjs +15 -0
  152. package/src/server.mjs +1340 -0
  153. package/src/shutdown-signal.mjs +12 -0
  154. package/src/signal-sandbox-processes.py +56 -0
  155. package/src/signal.mjs +119 -0
  156. package/src/status-evidence.mjs +47 -0
  157. package/src/status-summary.mjs +54 -0
  158. package/src/store.mjs +3057 -0
  159. package/src/submission-policy.mjs +623 -0
  160. package/src/subscription-storage.mjs +64 -0
  161. package/src/t3-audit.mjs +120 -0
  162. package/src/t3-control.mjs +102 -0
  163. package/src/t3-transport.mjs +158 -0
  164. package/src/t3.mjs +209 -0
  165. package/src/terminal-safe.mjs +19 -0
  166. package/src/tool-registry.mjs +451 -0
  167. package/src/try-command.mjs +11 -0
  168. package/src/try.mjs +589 -0
  169. package/src/webhooks.mjs +86 -0
  170. package/src/work-order.mjs +265 -0
  171. package/src/worker-instructions.mjs +26 -0
  172. package/src/worker-prompt.mjs +4 -0
  173. package/src/workers.mjs +622 -0
  174. package/src/workspace.mjs +1058 -0
  175. package/systemd/dot-bridge-heartbeat.service +18 -0
  176. package/systemd/dot-bridge-heartbeat.timer +10 -0
  177. package/systemd/dot-bridge-selfcheck.service +12 -0
  178. package/systemd/dot-bridge-selfcheck.timer +11 -0
  179. package/systemd/dot-bridge.service +17 -0
  180. package/systemd/dot-deadman.service +30 -0
  181. package/systemd/dot-pr-reviewer.service +11 -0
  182. package/systemd/dot-pr-reviewer.timer +10 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,172 @@
1
+ # Changelog
2
+
3
+ This file lists user-visible changes, newest first. Check the section for your target release before you upgrade.
4
+
5
+ ## 0.5.2
6
+
7
+ - 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.
8
+
9
+ ## 0.5.1
10
+
11
+ - 0.5.1 was not published to npm; 0.5.2 is the first npm release.
12
+ - Packaging: the npm package is `@tnunamak/dalan`. npm refused the name `dalan` as too close to an existing package, so 0.5.0 was not published to npm. Install with `npm install -g @tnunamak/dalan`, or try it with `npx @tnunamak/dalan try`. The command is still `dalan`. 0.5.1 has no other changes from 0.5.0.
13
+
14
+ ## 0.5.0
15
+
16
+ - Packaging: the repository root no longer has the `dot-bridge.service`, `dot-bridge-selfcheck.service` and `dot-bridge-selfcheck.timer` links; the files stay in `systemd/`. If an installed unit is a symbolic link to one of the root paths, point it at the file in `systemd/` and run `systemctl --user daemon-reload` before you update the checkout ([setup reference](docs/setup-reference.md#legacy-service-examples)).
17
+ - Fix: `--purge-home` no longer misses a service file that names the bridge home through a directory name with `,`, `:` or `=` in it. The unit check now reads such a path in a unit or plist; before, the path was cut at those characters, so a unit that named the home through such an alias was missed. A unit with more possible paths than the check reads in bounded time now refuses the purge as unreadable.
18
+ - Fix: `--purge-home` now also refuses when another unit names the bridge home through a different spelling of the same directory, such as a path through a symlinked parent. Before, only the exact text of the path was matched, so such a unit was missed and its home could be deleted while the unit stayed installed.
19
+ - Fix: `worker-bridge-setup --remove --purge-home` now refuses a `--home` that reaches the bridge home through a symbolic link, such as a linked parent directory, and names the real path to use instead. Before, the unit and open-database checks compared the alias with the real path, did not match, and the purge deleted the real home while a bridge could still be using it. Nothing is removed when it refuses.
20
+ - Fix: a registered secret in a JSON text that is a single string, written as `"\u0073..."`, is now masked like one inside an object. Redaction now also inspects such a text in its decoded form.
21
+ - 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
+ - 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
+ - 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 a worker that deliberately encodes a secret it knows (for example as base64); SECURITY.md and `docs/redaction.md` say so. Tool names and schemas are unchanged.
25
+ - 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
+ - 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
+ - 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.
28
+ - Fix: a worker's `finish` no longer loses a completed report to a fixable summary problem. A missing, empty or blank `summary` is now taken from the first non-empty line of `result` (capped at 4096 bytes) and the receipt carries `summary_derived: true`; a `summary` over 4096 bytes is cut and marked `summary_truncated: true`; a `progress` note over 4096 bytes is cut and marked `note_truncated: true`. Refusals that must stay (empty or oversize `result`, bad `outcome`, too many `artifact_ids`, empty `note`, a second different report, progress on a finished job) now say the next call and what to change. Claim, connection and destination checks are unchanged. The advertised `finish` and `progress` schemas match: `summary` is no longer required, and the schemas for `summary` and the `progress` `note` accept up to 262144 bytes (before, 4096), so a client that checks arguments against `tools/list` no longer refuses these calls before the server repairs them. The server still stores at most 4096 bytes of each, and `result` stays at 262144 bytes. This changes the advertised tool list: workers see it after the one-time connector refresh of this release (refresh the Dalan connection in each worker client once). Tool names and every other tool are unchanged, and `legacy-v46` keeps its frozen schemas.
29
+ - Fix: a message that a worker queues for a T3 thread is no longer posted twice, and a failing post is no longer retried about 60 times an hour. In registry `t3_post` delivery, only one flush runs at a time per tool, worker and thread, and each flush selects its rows after it holds the turn, so concurrent calls and the minute timer no longer post the same queued message twice. Timer retries now count against the same 6 per hour and 30 per day budget and are logged in `tool_post_log`; a failing `t3-post` can no longer be retried about 60 times an hour. A failure other than `t3-post` exit 3 may have delivered the message, so the row is marked possibly delivered and is never retried automatically; `dalan tool list` reports the count. Tool names and schemas in `tools/list` are unchanged.
30
+ - Fix: a removed, revoked or disabled operator-registered tool can no longer leave an old message that a later registration or grant delivers. A tool removal, revoke or disable now commits together with the discarding of the messages queued under it, and registering a name discards any unsent rows left under it, so a crash cannot leave an old message that a later registration or grant would deliver. Queued messages the timer can never deliver (no thread, or no enabled granted tool pointing at their thread) are now discarded instead of staying queued forever. Tool names and schemas in `tools/list` are unchanged.
31
+ - Fix: a crash during a sign-in approval no longer leaves a connection whose sign-in can never finish. The built-in authorization server marked a connection attempt done before it stored the interaction result, so a crash between the two left an approved connection whose sign-in could never finish (the browser got "already finished"). The attempt is now marked done only after the result is stored. A retry of the same page finishes the flow for the already-approved connection, with no second approval and no second connection, and a repeated visit after the flow ended is refused. Exact code, worker, window and redirect checks are unchanged.
32
+ - 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
+ - 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
+ - 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
+ - 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
+ - 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
+ - `scripts/upgrade-drain.mjs` is now part of the npm package, so the documented pre-upgrade drain exists in an npm install.
39
+ - `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
+ - `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
+ - 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
+ - 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
+ - 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. 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
+ - 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
+ - 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
+ - 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
+ - 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
+ - Docs: 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
+ - 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
+ - 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. The README then opened with a short prerequisites list and four quickstart commands; a later change replaced those four with one command, `npx @tnunamak/dalan try`.
54
+ - 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
+
57
+ - `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. Document that executors and workers must run as a different user from the bridge because the check sandbox does not enforce Unix user separation. State that the `t3` capability gives a worker unscoped access to T3 threads, and print a startup notice naming each holder when the tools are on.
59
+ - Tests: the conformance fixtures pin the profile version, source identity, schemas and complete trace set, and unsupported wire versions are rejected before native calls.
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.)
63
+ - 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
+
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; scan nested cgroups, refuse stop verification without a sandbox scope, use pidfd signaling, and use monotonic stop deadlines. Report full-tree cancellation as verified only for the systemd backend whose cgroup stop receipt is tested through the workspace check path.
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.
68
+
69
+ - Docs: the README and contributor notes are easier to follow: a "Where to start" list at the top, one copy of the source install commands, a separate home for the manual walkthrough (it no longer collides with the `dalan try` home), a note on the legacy symlinks in the repository root, and the bubblewrap requirement for the full test suite.
70
+
71
+ - Docs: Claude Code is documented as a native worker (`claude mcp add`, `/mcp`, `dalan connect approve`), run end to end with no T3 Code.
72
+
73
+ - 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
+
75
+ - Tests: remove a stray marker file from `scripts/mirror-fetch-test.mjs`.
76
+ - 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
+
78
+ - 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
+
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. `scripts/neutral-worker-e2e.mjs` runs the whole job loop against a profile whose only worker is `acme`.
81
+
82
+ - Docs: the README connection section now starts with "Connect any MCP worker"; the ChatGPT and hosted Claude guides become optional recipes.
83
+
84
+ - 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
+
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. The README quickstart now uses it. `dalan` now also reads `DALAN_HOME` as its `HOME` (before, only the README's shell function did); the server still reads `HOME`.
87
+
88
+ - Dalan is published to npm as `@tnunamak/dalan`. To prepare the package contents: exclude `__pycache__` from the file list, and add `scripts/package-contents-test.mjs`, which checks that `npm pack` ships no tests, fixtures or local state and that every shipped module's relative imports resolve. `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
+
90
+ - 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
+
92
+ - Security: a worker connection that was revoked or replaced can no longer act on a claim. The bridge fences every built-in worker call that acts on a claim to the recorded, currently live connection, checked where the effect commits: renew, progress, ask and consume, finish (legacy and native, with stored replay and late evidence after a cancel), native `artifact_chunk` and upload, all five workspace tools (reads included), and claim activity. A revoked, replaced or other connection gets `connection_not_live` and no claim-scoped state change (no claim, workspace, report, notification or artifact row, no file of the job, no claim activity counter); legacy `finish` now captures its patch artifact inside the finish transaction, after the check, and checks again after its `makeRoom` await. Per-worker call accounting, `sweepExpired` and `makeRoom` cleanup still run before the check and are system effects. `get` still reads for anyone but moves the note-seen cursor only for the live holding connection. Pre-schema-61 NULL-bound claims must expire before reclaim. See PROTOCOL.md, Connection fence.
93
+
94
+ ### Upgrade
95
+
96
+ - **Upgrade action:** installs that relied on the drainer gate must set `DALAN_DRAINER_HEALTH_FILE` to their evidence file (the `drainer-health.json` written with the data root; default `~/.local/share/dot-bridge/drainer-health.json`) before restarting, or the heartbeat will ping on bridge health alone.
97
+ - Before upgrading, drain or cancel queued and running jobs for workers that declare a destination. Unapproved jobs are refused when they next need a claim, and built-in authentication now includes live connection IDs in the destination revision. Review the current destination and resubmit refused work under a new request ID; approvals cannot be changed in place.
98
+
99
+ ### Changes
100
+
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. Fixtures that use these flags must also set `DALAN_BIND_HOST=127.0.0.1`.
102
+ - Docs: clarify that future-schema refusal makes no schema or row change but SQLite may manage WAL sidecars; remove the schema-61 connection column from the synthetic schema-34 fixture.
103
+ - Fix: a resolver failure is reported once per listing even when it returns a Promise or throws a falsy value. The docs now say that restoring an approved destination clears the listing block only while repository policy still allows the job.
104
+ - 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
+ - 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
+ - Redaction now detects Slack rotating tokens, Telegram and Discord bot token shapes and URL credentials with short passwords.
107
+
108
+ - Redaction now masks private-key armor with ASCII and Unicode dashes. It retains the existing ASCII matcher, which can also mask ordinary hyphenated prose.
109
+ - Redaction refuses very long runs of combining marks: to bound normalization work, inputs with over 64 consecutive raw or compatibility-normalized combining marks are refused and masked in full.
110
+ - Redaction now detects and masks Slack incoming-webhook URLs, JWTs and Google OAuth client secrets, access tokens and refresh tokens.
111
+ - Worker-visible output now masks secrets held in object keys, matching admission, which already refused them.
112
+
113
+ ## 0.4.0
114
+
115
+ ### Upgrade
116
+
117
+ Dalan is the new package and command name. Dalan installs only the `dalan` and `dalan-*` commands; the command names of the `dot-bridge` package are not installed. Use `DALAN_X` settings; a defined new name wins over `DOT_BRIDGE_X`, including an empty value except `AUTH_MODE`: empty new auth falls back to a non-empty legacy mode, so a template cannot disable built-in auth. A real legacy fallback emits at most one main-thread warning per process.
118
+
119
+ Before restarting an existing installation, set `DALAN_ENABLE_T3_TOOLS=1` if its pinned catalog advertises the T3 reverse-control tools, and retain the worker capability and catalog profile. Inspect the exact repository list seeded once from each legacy worker's claimed jobs and still-live queued jobs; add any further owner-approved repositories explicitly. A non-loopback external-OAuth HTTP listener also needs `DALAN_TRUST_PROXY=1` and an HTTPS reverse proxy. Authentication-off development flags are refused in production.
120
+
121
+ Fresh homes use Dalan directories. Populated legacy roots, including OAuth keys, clients, tokens, path secrets, queued jobs and delivery ACKs, remain in place; an empty new root, or one that lacks a listed durable component, cannot hide them. Unlisted files are not merged or recovered, so verify a migration with `dalan paths`. Startup never moves or merges data. Follow [the upgrade guide](docs/dalan-upgrade.md) for explicit path migration, consistent backups and rollback. Database schema is 60; upgrading from 0.2.0 still requires the schema-49 backup procedure below.
122
+
123
+ Refresh non-legacy connectors and restart their worker conversation to discover the Dalan name/version and `notify_owner`. An older alias of the notification tool remains with the same schema, authorization and durable retry ledger (removed in a later release). With the T3 retention setting, existing tool names and schemas remain available. The `legacy-v46` profile preserves its captured twelve-tool catalog and server identity. Existing OAuth scope strings, issuers and resource URLs do not change.
124
+
125
+ ### Changes
126
+
127
+ - Add authenticated HTTP loopback mode with numeric IPv4 binding, Host/Origin checks, built-in OAuth and owner-allowlisted native callback paths with variable ports. Production needs no test OAuth flag.
128
+ - Seed legacy omitted repository policies from claimed history and still-live queued jobs; ignore expired queued jobs, preserve explicit lists, and deny repository access by default on fresh installs. Audit each seed and expose it through doctor, including for profile-less worker. The upgrade fixture boots the pinned 0.3.0 release. Setup preserves private config-directory permissions when it copies authorization keys.
129
+ - Resolve config, data, state and workspace paths through `dalan paths`, including the backup and rollback recipes.
130
+ - Revise the requester MCP design around separate grants, grant-owned reads and human approval before future submission work. Requester MCP is not implemented in this release.
131
+
132
+ ## 0.3.0
133
+
134
+ ### Operators
135
+
136
+ - **Upgrade action:** back up consistent private state before schema 49-to-57 migration; 0.2.0 refuses the upgraded database, and encrypted subscription storage is not an additive-only change (see [From 0.2.0](docs/operations.md#from-020)).
137
+ - **Host-check action:** explicitly enable host checks, allow each exact repository/check pair, supply owner budgets, and prepare matching npm dependencies; repository metadata alone cannot authorize execution.
138
+ - **Catalog action:** the default stable catalog keeps its 19 tool names, but the `claim` tool gains an optional `lease_ms` argument and a new description. Refresh the connector after the upgrade so workers see the new definition. The opt-in legacy-v46 catalog keeps its captured definitions without `lease_ms`.
139
+ - **Catalog action:** the `read_file` tool description now names the `end_line` and `truncated` result fields. Refresh the connector after the upgrade so workers see the new description. The legacy-v46 catalog keeps the old description.
140
+ - Add a repository-free first-job walkthrough, receipt-based recovery, owner decisions, and artifact retrieval instructions.
141
+ - Preserve learned preparation-deadline eligibility after requeue when claim history exists; explicit requester deadlines still apply.
142
+ - Delay health attention until a condition persists for 30 minutes and record successful publication before allowing recovery notices.
143
+ - Refuse accidental default-home database migrations from local Store callers unless explicitly enabled; normal service startup opts in.
144
+
145
+ ### Workers
146
+
147
+ - Retain the same live grant for exact claim retries, including matching omitted acquisition IDs; regrant requires lease expiry rather than idle rotation.
148
+ - Persist a requested per-grant lease duration, bounded by owner policy; upgrading existing grants uses the configured duration once.
149
+ - Add opt-in identified questions and answer consumption; completed reports require the current grant's questions to be consumed.
150
+ - Mark claim and progress replies `terminal:false` with a `request_action` that says the request is still open and needs `finish`; terminal results carry `terminal:true`. `next_action` keeps its queued-work meaning.
151
+ - Claims taken under 0.2.0 survive the schema 57 upgrade with the same claim ID and epoch while their lease is unexpired; a regression test runs real 0.2.0 code against the upgrade.
152
+ - Offer an opt-in twelve-tool legacy-v46 catalog without question, T3 or notification tools; internal lease and authority checks remain active.
153
+
154
+ ### Security
155
+
156
+ - Encrypt subscription secrets and connection records at rest, validate their storage key, clean legacy database pages, and reject plaintext writes.
157
+ - Give built-in authorization codes a 600-second redemption lifetime while retaining single-use, client, redirect, resource and S256 PKCE binding.
158
+ - Return the same encrypted refresh response for an identical retry within five seconds; later token reuse revokes the family, and the grace window also permits a stolen previous token to retry.
159
+ - Confine opted-in Linux host checks with explicit resource limits, offline execution and read-only prepared dependencies; unsupported backends refuse rather than fall back.
160
+ - Keep unresolved owner delivery and unverified host-stop evidence as regrant fences; elapsed time is not proof that an unknown send cannot arrive.
161
+
162
+ ### Protocol / conformance
163
+
164
+ - Add opt-in protocol-v0 jobs with revisioned events, command-key receipts, explicit fixed-deadline renewal, artifact bindings, durable owner waiters and retention tombstones.
165
+ - Add private capability-separated dispatch, delivery reconciliation and scoped stop observation; persisted acknowledgments and trusted evidence govern outcomes.
166
+ - Require protocol finish references sealed under the current claim and epoch; legacy non-protocol sealed inheritance is unchanged.
167
+ - Document native contract v5 separately from historical mappings; native features do not establish full fixture-profile conformance, exactly-once external effects or remote compute termination.
168
+
169
+ ## 0.2.0
170
+
171
+ - Refuse to open a database whose SQLite `user_version` is newer than schema 49. The bridge exits before schema bootstrap or startup recovery and reports the found and supported versions.
172
+ - Document consistent backup, upgrade, and rollback procedures for bridge data and private state.
@@ -0,0 +1,26 @@
1
+ # Contributing
2
+
3
+ Issues and pull requests are welcome. The maintainer sets the roadmap and decides which changes to accept. Discuss large changes before starting work.
4
+
5
+ ## Tests
6
+
7
+ The full suite runs on Linux and needs GNU coreutils `timeout` and `nice` on PATH. On macOS, install coreutils and add its `gnubin` directory to PATH so `timeout` resolves. The full suite also starts `bubblewrap` sandboxes, so it needs a Linux host where `bwrap` can create user namespaces; a nested container or macOS cannot run those segments. `npm run test:sandbox` runs the subset that works inside such a confined environment; it is not evidence for the full suite. See [execution and evidence](docs/operations.md#execution-capability-and-check-evidence).
8
+
9
+ Use Node.js 24 or newer. From the repository root, run:
10
+
11
+ ```sh
12
+ npm ci --ignore-scripts
13
+ DALAN_HOST_CHECKS=0 npm test
14
+ ```
15
+
16
+ `DALAN_HOST_CHECKS=0` turns host checks off by default; tests that exercise host checks may still turn them on.
17
+
18
+ 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".
19
+
20
+ ## Changes
21
+
22
+ Keep each pull request to one change. For a bug fix, add a failing test first, then fix the bug. Run the tests and state in the pull request which passed, failed, or could not run.
23
+
24
+ Do not include secrets or real hosts in fixtures, logs, issues, or pull requests. Use example.com and RFC 5737 documentation addresses such as 192.0.2.1, 198.51.100.1, and 203.0.113.1.
25
+
26
+ Report vulnerabilities privately as described in [SECURITY.md](SECURITY.md), not in a public issue.
package/LICENSE ADDED
@@ -0,0 +1,204 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
203
+
204
+ Copyright 2026 Tim Nunamaker