@abelxiaoxing/cadence 1.8.3 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (208) hide show
  1. package/README.md +324 -111
  2. package/THIRD_PARTY_NOTICES.md +15 -0
  3. package/agents/design-explorer.md +14 -26
  4. package/agents/diagnosis-worker.md +14 -25
  5. package/agents/implementation-worker.md +16 -35
  6. package/config/.env.example +2 -5
  7. package/config/workflow-task.example.json +7 -0
  8. package/docs/remote-access.md +60 -0
  9. package/docs/reuse-and-distribution.md +44 -0
  10. package/docs/service-management.md +108 -0
  11. package/licenses/bundled-web.txt +6245 -0
  12. package/licenses/pi-web-ui-MIT.txt +21 -0
  13. package/licenses/pi-web-ui-reuse.md +22 -0
  14. package/package.json +94 -21
  15. package/src/index.ts +22 -1807
  16. package/src/native-build.ts +6 -0
  17. package/src/native-client.ts +103 -0
  18. package/src/native-export.ts +58 -0
  19. package/src/native-history.ts +359 -0
  20. package/src/operator-cli.mjs +453 -1937
  21. package/src/plan-proposal.ts +87 -0
  22. package/src/sdk-worker.mjs +549 -0
  23. package/src/service/contracts/active.ts +82 -0
  24. package/src/service/contracts/budget.ts +148 -0
  25. package/src/service/contracts/build.ts +67 -0
  26. package/src/service/contracts/capture.ts +48 -0
  27. package/src/service/contracts/core.ts +33 -0
  28. package/src/service/contracts/current.ts +261 -0
  29. package/src/service/contracts/domain.ts +68 -0
  30. package/src/service/contracts/history.ts +2245 -0
  31. package/src/service/contracts/models.ts +139 -0
  32. package/src/service/coordination.ts +862 -0
  33. package/src/service/private-files.ts +204 -0
  34. package/src/service-cli.mjs +5592 -0
  35. package/src/service-client.ts +747 -0
  36. package/src/service-contract.ts +245 -0
  37. package/src/service-host.mjs +22382 -0
  38. package/src/service-http-client.ts +425 -0
  39. package/src/service-wire.ts +372 -0
  40. package/src/task-shell.ts +1045 -0
  41. package/src/task-store.ts +479 -0
  42. package/src/task-types.ts +184 -0
  43. package/src/verification-diagnostics.ts +29 -72
  44. package/src/worker-capture.mjs +1197 -0
  45. package/src/worker-public.mjs +1753 -0
  46. package/src/worker-redaction.mjs +608 -0
  47. package/src/worker-tools.mjs +202 -0
  48. package/web/dist/assets/KaTeX_AMS-Regular.ttf +0 -0
  49. package/web/dist/assets/KaTeX_AMS-Regular.woff +0 -0
  50. package/web/dist/assets/KaTeX_AMS-Regular.woff2 +0 -0
  51. package/web/dist/assets/KaTeX_Caligraphic-Bold.ttf +0 -0
  52. package/web/dist/assets/KaTeX_Caligraphic-Bold.woff +0 -0
  53. package/web/dist/assets/KaTeX_Caligraphic-Bold.woff2 +0 -0
  54. package/web/dist/assets/KaTeX_Caligraphic-Regular.ttf +0 -0
  55. package/web/dist/assets/KaTeX_Caligraphic-Regular.woff +0 -0
  56. package/web/dist/assets/KaTeX_Caligraphic-Regular.woff2 +0 -0
  57. package/web/dist/assets/KaTeX_Fraktur-Bold.ttf +0 -0
  58. package/web/dist/assets/KaTeX_Fraktur-Bold.woff +0 -0
  59. package/web/dist/assets/KaTeX_Fraktur-Bold.woff2 +0 -0
  60. package/web/dist/assets/KaTeX_Fraktur-Regular.ttf +0 -0
  61. package/web/dist/assets/KaTeX_Fraktur-Regular.woff +0 -0
  62. package/web/dist/assets/KaTeX_Fraktur-Regular.woff2 +0 -0
  63. package/web/dist/assets/KaTeX_Main-Bold.ttf +0 -0
  64. package/web/dist/assets/KaTeX_Main-Bold.woff +0 -0
  65. package/web/dist/assets/KaTeX_Main-Bold.woff2 +0 -0
  66. package/web/dist/assets/KaTeX_Main-BoldItalic.ttf +0 -0
  67. package/web/dist/assets/KaTeX_Main-BoldItalic.woff +0 -0
  68. package/web/dist/assets/KaTeX_Main-BoldItalic.woff2 +0 -0
  69. package/web/dist/assets/KaTeX_Main-Italic.ttf +0 -0
  70. package/web/dist/assets/KaTeX_Main-Italic.woff +0 -0
  71. package/web/dist/assets/KaTeX_Main-Italic.woff2 +0 -0
  72. package/web/dist/assets/KaTeX_Main-Regular.ttf +0 -0
  73. package/web/dist/assets/KaTeX_Main-Regular.woff +0 -0
  74. package/web/dist/assets/KaTeX_Main-Regular.woff2 +0 -0
  75. package/web/dist/assets/KaTeX_Math-BoldItalic.ttf +0 -0
  76. package/web/dist/assets/KaTeX_Math-BoldItalic.woff +0 -0
  77. package/web/dist/assets/KaTeX_Math-BoldItalic.woff2 +0 -0
  78. package/web/dist/assets/KaTeX_Math-Italic.ttf +0 -0
  79. package/web/dist/assets/KaTeX_Math-Italic.woff +0 -0
  80. package/web/dist/assets/KaTeX_Math-Italic.woff2 +0 -0
  81. package/web/dist/assets/KaTeX_SansSerif-Bold.ttf +0 -0
  82. package/web/dist/assets/KaTeX_SansSerif-Bold.woff +0 -0
  83. package/web/dist/assets/KaTeX_SansSerif-Bold.woff2 +0 -0
  84. package/web/dist/assets/KaTeX_SansSerif-Italic.ttf +0 -0
  85. package/web/dist/assets/KaTeX_SansSerif-Italic.woff +0 -0
  86. package/web/dist/assets/KaTeX_SansSerif-Italic.woff2 +0 -0
  87. package/web/dist/assets/KaTeX_SansSerif-Regular.ttf +0 -0
  88. package/web/dist/assets/KaTeX_SansSerif-Regular.woff +0 -0
  89. package/web/dist/assets/KaTeX_SansSerif-Regular.woff2 +0 -0
  90. package/web/dist/assets/KaTeX_Script-Regular.ttf +0 -0
  91. package/web/dist/assets/KaTeX_Script-Regular.woff +0 -0
  92. package/web/dist/assets/KaTeX_Script-Regular.woff2 +0 -0
  93. package/web/dist/assets/KaTeX_Size1-Regular.ttf +0 -0
  94. package/web/dist/assets/KaTeX_Size1-Regular.woff +0 -0
  95. package/web/dist/assets/KaTeX_Size1-Regular.woff2 +0 -0
  96. package/web/dist/assets/KaTeX_Size2-Regular.ttf +0 -0
  97. package/web/dist/assets/KaTeX_Size2-Regular.woff +0 -0
  98. package/web/dist/assets/KaTeX_Size2-Regular.woff2 +0 -0
  99. package/web/dist/assets/KaTeX_Size3-Regular.ttf +0 -0
  100. package/web/dist/assets/KaTeX_Size3-Regular.woff +0 -0
  101. package/web/dist/assets/KaTeX_Size3-Regular.woff2 +0 -0
  102. package/web/dist/assets/KaTeX_Size4-Regular.ttf +0 -0
  103. package/web/dist/assets/KaTeX_Size4-Regular.woff +0 -0
  104. package/web/dist/assets/KaTeX_Size4-Regular.woff2 +0 -0
  105. package/web/dist/assets/KaTeX_Typewriter-Regular.ttf +0 -0
  106. package/web/dist/assets/KaTeX_Typewriter-Regular.woff +0 -0
  107. package/web/dist/assets/KaTeX_Typewriter-Regular.woff2 +0 -0
  108. package/web/dist/assets/cadence.css +2 -0
  109. package/web/dist/assets/cadence.js +7 -0
  110. package/web/dist/assets/markdown.js +296 -0
  111. package/web/dist/assets/react.js +9 -0
  112. package/web/dist/assets/rolldown-runtime.js +1 -0
  113. package/web/dist/assets/timeline-client.js +41 -0
  114. package/web/dist/assets/vis-timeline.css +1274 -0
  115. package/web/dist/assets/vis-timeline.js +32 -0
  116. package/web/dist/index.html +18 -0
  117. package/web/dist/manifest.json +505 -0
  118. package/config/plan-draft.example.json +0 -125
  119. package/config/plan-draft.multiple-tasks.example.json +0 -375
  120. package/config/plan-draft.quick.example.json +0 -78
  121. package/config/routes.example.json +0 -39
  122. package/prompts/abel-design.md +0 -382
  123. package/prompts/abel-diagnose.md +0 -71
  124. package/prompts/abel-implement.md +0 -284
  125. package/prompts/abel-init.md +0 -52
  126. package/src/activation.ts +0 -44
  127. package/src/activity-contracts.ts +0 -82
  128. package/src/agent-registry.ts +0 -53
  129. package/src/apply-transaction.ts +0 -1437
  130. package/src/artifact-store.ts +0 -213
  131. package/src/build-windows-job.mjs +0 -95
  132. package/src/candidate-artifact.ts +0 -143
  133. package/src/candidate-patch.ts +0 -271
  134. package/src/candidate-workspace.ts +0 -80
  135. package/src/canonical.ts +0 -16
  136. package/src/change-contract-schema.ts +0 -191
  137. package/src/change-contract.ts +0 -324
  138. package/src/change-verification.ts +0 -1617
  139. package/src/child-budget.ts +0 -58
  140. package/src/child-model.ts +0 -142
  141. package/src/child-session.ts +0 -640
  142. package/src/contracts.ts +0 -2476
  143. package/src/control-contracts.ts +0 -382
  144. package/src/delivery-compiler.ts +0 -1805
  145. package/src/delivery-revision.ts +0 -42
  146. package/src/design-control.ts +0 -1299
  147. package/src/design-diagnostics.ts +0 -181
  148. package/src/design-journal.ts +0 -1773
  149. package/src/directory-sync.ts +0 -36
  150. package/src/durable-contracts.ts +0 -231
  151. package/src/durable-workflow.ts +0 -978
  152. package/src/evidence-draft.ts +0 -122
  153. package/src/execution-profile.ts +0 -64
  154. package/src/execution-retention.ts +0 -77
  155. package/src/file-snapshot.ts +0 -163
  156. package/src/implement-continuation.ts +0 -559
  157. package/src/implement-graph.ts +0 -690
  158. package/src/implement-plan.ts +0 -72
  159. package/src/install-config.d.mts +0 -6
  160. package/src/isolation-backend.ts +0 -353
  161. package/src/model-source.ts +0 -22
  162. package/src/openspec-cli.ts +0 -494
  163. package/src/operator-cli-entry.mjs +0 -24
  164. package/src/operator-tools.ts +0 -309
  165. package/src/package-candidate.ts +0 -227
  166. package/src/package-delivery.ts +0 -486
  167. package/src/package-state.ts +0 -320
  168. package/src/package-verification.ts +0 -635
  169. package/src/package-workflow.ts +0 -342
  170. package/src/packet-runtime.ts +0 -570
  171. package/src/parent-provider.ts +0 -375
  172. package/src/phase-execution.ts +0 -2259
  173. package/src/pi-adapter.ts +0 -19
  174. package/src/plan-draft-summary.ts +0 -527
  175. package/src/plan-draft.ts +0 -502
  176. package/src/remove-path.ts +0 -32
  177. package/src/route-policy.ts +0 -545
  178. package/src/run-state.ts +0 -420
  179. package/src/run-store.ts +0 -1179
  180. package/src/safe-path.ts +0 -77
  181. package/src/scoped-grep-worker.mjs +0 -23
  182. package/src/scoped-tools.ts +0 -775
  183. package/src/single-task-draft.ts +0 -142
  184. package/src/sqlite-schema.ts +0 -171
  185. package/src/state-root.ts +0 -215
  186. package/src/storage-schema.ts +0 -360
  187. package/src/subagent-activity.ts +0 -1417
  188. package/src/submit-tool.ts +0 -950
  189. package/src/task-ledger.ts +0 -1338
  190. package/src/transport-budget.ts +0 -52
  191. package/src/verification-capability.ts +0 -1191
  192. package/src/verification-environment-io.ts +0 -389
  193. package/src/verification-environment.ts +0 -162
  194. package/src/verification-identity.ts +0 -77
  195. package/src/verification-scan.ts +0 -64
  196. package/src/windows-job-backend.ts +0 -419
  197. package/src/windows-job.c +0 -149
  198. package/src/worker-broker.ts +0 -806
  199. package/src/workflow-engine.ts +0 -28
  200. package/src/workflow-policy.ts +0 -1679
  201. package/src/workflow-recovery-policy.ts +0 -97
  202. package/src/workflow-scheduling.ts +0 -105
  203. package/src/workflow-state-machine.ts +0 -4355
  204. package/src/workflow-status.ts +0 -576
  205. package/src/workspace-io-entry.mjs +0 -76
  206. package/src/workspace-io-worker.mjs +0 -1312
  207. package/src/workspace-io.ts +0 -89
  208. package/src/workspace-store.ts +0 -634
@@ -1,39 +1,20 @@
1
- # Role: implementation-worker
1
+ ---
2
+ name: implementation-worker
3
+ description: One ordinary editing agent working from a human-reviewed Cadence plan
4
+ ---
2
5
 
3
- You are a package-owned read-only professional Agent for `abel-implement` task phases (Red, Green, and optional Refactor).
6
+ # Implementation Worker
4
7
 
5
- You explore the workspace ONLY through the scoped `read`, `grep`, `find`, and `ls` tools.
6
- You never write the workspace, run validation, or execute commands.
8
+ Implement the supplied goal and approved plan in the chosen working copy using ordinary host tools.
9
+ Read project conventions and adjacent code/tests first; reuse existing helpers and make the smallest complete change.
10
+ Preserve pre-existing user edits and unrelated files.
11
+ If the plan is insufficient or contradictory, report the blocker instead of silently expanding scope.
7
12
 
8
- Your output is one complete structured patch delivered through `abel_submit_result`:
13
+ Edits are direct: there is no disposable candidate, automatic rollback or filesystem sandbox.
14
+ Do not mutate Git (including stage/commit/reset), install software, delete consumer state, publish or invoke workflow commands.
15
+ Do not spawn another editing agent or automatically retry a failed work session.
16
+ Do not access credentials, private diagnostics or unrelated session history.
9
17
 
10
- - copy the attempt-bound `candidateId` from the phase contract;
11
- - submit one accepted `candidate-patch` call containing that `candidateId` and
12
- an ordered `operations` array;
13
- - use `replace` with exact uniquely occurring `oldText` and the intended
14
- `newText` for compact edits, `rewrite` for a complete existing-file body,
15
- `create` with complete content plus `regular | executable` mode, and
16
- `delete` only for an approved deletion path;
17
- - never write unified-diff headers or hunks and never calculate sequences,
18
- Base64 encodings, byte counts, or hashes; the trusted submit tool validates
19
- the operations, generates the diff, chunks it, and seals it atomically;
20
- - every operation path is within the declared phase boundary; paths that do
21
- not need a change may remain untouched;
22
- - preserve the expected parent-owned verification contract without claiming a result;
23
- - use a typed `context-request` for bounded context or task splitting instead
24
- of submitting a partial patch; classify every ref as a requested path with
25
- `read | write` access, a source citation with path and line, or a
26
- contract-diagnostic ref;
27
- - report only the missing context and structural facts: never select
28
- `approval-needed`, `boundary-review-needed`, a Gate, or a workflow stage;
29
- - an `AGENTS.md` path is never a Worker write path;
30
- - report an AGENTS read need separately, and leave every sealed AGENTS contract
31
- and managed-block update to the parent control plane.
32
-
33
- If the submit tool rejects malformed operations, use its concrete error to correct the submission once in this same disposable session; a second rejected structural submission ends the session.
34
-
35
- Never submit again after acceptance; brief accompanying text is harmless.
36
-
37
- If the configured candidate limit is exceeded, the submit tool returns terminal typed `result-limit` with `limitBytes`; never continue with a partial or truncated patch.
38
- The parent alone reviews, applies, and validates the generated diff.
39
- You report candidate facts only and never claim execution success, select parent recovery, choose a workflow stage, or control the task DAG.
18
+ Finish with a concise summary of changes, paths, checks actually attempted and remaining issues.
19
+ Your prose and process exit are not passing parent checks or human approval.
20
+ The parent separately runs explicitly confirmed commands and presents changes for human review.
@@ -1,8 +1,5 @@
1
- # Worker routing is configured as one whole JSON policy at
2
- # <project>/.pi/cadence/routes.json or ~/.pi/agent/cadence/routes.json.
3
- # Copy routes.example.json and reference custom credentials by environment
4
- # variable name; never place credential values in routes.json.
5
- CADENCE_CUSTOM_WORKER_API_KEY=
1
+ # Cadence child workers use the active Pi model and authentication configuration.
2
+ # Cadence no longer reads routes.json or custom worker endpoint settings.
6
3
 
7
4
  # Context7 works anonymously with its default URL. Uncomment the API key for
8
5
  # authenticated access, or the URL only when overriding the default endpoint.
@@ -0,0 +1,7 @@
1
+ {
2
+ "schema": "cadence-assistant-checks/1",
3
+ "checks": [
4
+ { "name": "Type check", "command": "bun run check", "timeoutMs": 120000 },
5
+ { "name": "Tests", "command": "bun run test", "timeoutMs": 120000 }
6
+ ]
7
+ }
@@ -0,0 +1,60 @@
1
+ # Explicit Personal HTTPS Access
2
+
3
+ Remote exposure is an operator action, not part of installation or extension discovery.
4
+ The backend stays on numeric loopback; configure one public HTTPS origin and trust only the immediate same-host proxy address.
5
+ Use a private0600 JSON file with actual absolute paths:
6
+
7
+ ```json
8
+ {
9
+ "schema": "cadence-service-host/1",
10
+ "cwd": "/absolute/project",
11
+ "agentDir": "/absolute/existing/pi-agent",
12
+ "tokenSource": "generated",
13
+ "tokenFile": null,
14
+ "http": {
15
+ "schema": "cadence-service-http/1",
16
+ "host": "127.0.0.1",
17
+ "port": 17423,
18
+ "proxy": {
19
+ "origin": "https://cadence.example.net",
20
+ "trustedAddresses": ["127.0.0.1"]
21
+ }
22
+ }
23
+ }
24
+ ```
25
+
26
+ Explicitly start with `cadence-service start --workspace /absolute/project --config /absolute/private-config.json`.
27
+ The host refuses arbitrary forwarding chains, alternate authorities and non-loopback binding.
28
+ Native/management capability traffic remains direct loopback, separate from browser credentials.
29
+
30
+ ## Caddy example — configuration only
31
+
32
+ ```caddyfile
33
+ cadence.example.net {
34
+ # Do not enable query/access logging for the token-bearing bootstrap URL.
35
+ reverse_proxy 127.0.0.1:17423 {
36
+ header_up -Forwarded
37
+ header_up -X-Forwarded-For
38
+ header_up -X-Forwarded-Host
39
+ header_up -X-Real-IP
40
+ header_up Host cadence.example.net
41
+ header_up X-Forwarded-Proto https
42
+ }
43
+ }
44
+ ```
45
+
46
+ Audit any additional proxy-generated forwarding headers against the exact backend policy before use.
47
+ HTTP and WebSocket upgrade must use the same authenticated route; no public backend bypass or insecure credential-bearing HTTP.
48
+ This example does not install Caddy, provision DNS/certificates, change a firewall or deploy a service.
49
+
50
+ Use `cadence-service token-link --workspace /absolute/project --reveal` to reveal a private entry link deliberately.
51
+ Only root GET token entry accepts query credentials; subsequent private reads, exports and WS use the HttpOnly SameSite=Strict Secure cookie.
52
+ Browser mutations/readonly POSTs require exact Origin and CSRF; access does not grant Start/check/review consent.
53
+ A bad explicit token refuses even with an older cookie.
54
+ Never put provider credentials in a browser or URL.
55
+
56
+ `token-rotate` invalidates old links/cookies, pending grants, authenticated sockets and incomplete downloads without canceling admitted tasks.
57
+ Environment-backed tokens require explicit Stop/restart with changed environment instead.
58
+ Links may already exist in clipboard/history or external logs; redirecting cannot retract disclosure.
59
+ Use [management and recovery](service-management.md) for Stop, uncertainty and exact local resolution.
60
+ Loopback HTTPS/viewport tests are not physical-device or second-machine deployment qualification.
@@ -0,0 +1,44 @@
1
+ # Reuse and Distribution
2
+
3
+ ## Source families
4
+
5
+ Cadence adapts `xing-shuyin/pi-web-ui@e8bab487af208bc9a1ab60a821652323f598127f`, MIT copyright 2026 xing-shuyin.
6
+ The full original license is `licenses/pi-web-ui-MIT.txt`.
7
+ Repository `provenance/webui-reuse.json` records source/destination hashes and explicit incompatible branches removed; `provenance/auth-reuse.json` records token/cookie adaptation.
8
+
9
+ | Source family | Package adaptation |
10
+ | ------------------------------------ | ------------------------------------------------------------------------ |
11
+ | App, panels, layout, drawers | Three-pane task workspace and responsive phone navigation |
12
+ | conv-groups, PlanBoard | Task/run/child tree, editable finite graph and separate confirmations |
13
+ | MessageList, Message, ToolCallBlock | Paged transcript, stable tool associations and retained detail |
14
+ | Markdown, StreamMarkdown, copy | Sanitized Markdown/math/code, no script/external-image execution |
15
+ | FilePreview, SCM presentation | Readonly observed changes, no Git/file mutation API |
16
+ | GlobalSearchModal, search, deep link | Literal durable search, exact versioned hits and scoped export |
17
+ | Standalone run-trace client | Local vis timeline/filter/replay of observations, never execution |
18
+ | use-chat, message-delta | Shared typed reconciliation, gaps/resync and no mutation replay |
19
+ | Token/cookie and upgrade guards | Cookie-first authenticated HTTP/WS, explicit Host/Origin/CSRF boundaries |
20
+
21
+ No upstream runtime, general chat server, PTY, plugin loader, browser shell, credentials editor, reconnect continuation or task repair ships.
22
+ Cadence's finite owner/admission/history contracts replace those incompatible seams.
23
+
24
+ ## Emitted licenses
25
+
26
+ `licenses/bundled-web.txt` contains full original notices with stable labeled boundaries: React/DOM/scheduler; react-icons and the selected Feather family; unified/Markdown/HTML utilities; highlight.js; KaTeX code; vis-timeline and the versions actually embedded by its standalone build.
27
+ KaTeX's 60 emitted TTF/WOFF/WOFF2 fonts retain their original bytes and separate SIL OFL1.1 plus reserved-family copyright notices.
28
+ The vis bundle includes its own Babel/core-js/moment/vis-data/vis-util and other dependencies; project-resolved package versions are not substituted for those embedded versions.
29
+ Both offered license texts are retained where supplied; extra notices do not imply extra runtime dependencies.
30
+
31
+ Repository `provenance/bundled-notices.json` binds rendered module bodies, exact source artifacts, per-module output chunks, font bodies and exact notice byte ranges/digests.
32
+ Provisioned official notice bodies were reused locally; builds never download licenses or dependencies.
33
+ `build:web:check` checks the actual rendered module set against that reviewed policy as well as deterministic output bytes and local asset references.
34
+
35
+ ## Runtime/package closure
36
+
37
+ Only the native extension's explicit import closure, maintained SDK worker/shared JS capture modules, generated management/host/operator executables, Agents, independent skills/configuration, documentation, notices and complete built assets ship.
38
+ Service/worker execution uses ordinary Node with declared external Pi/Typebox/Undici peers and exact production `ws`; no source-tree or TypeScript fallback, SDK bundle or consumer compilation.
39
+ The retired shell-local controller is not a shipped competing executor.
40
+
41
+ `provenance/package-members.json` is a reviewed source/import/asset policy, not generated from the archive being tested.
42
+ The real pack audit rejects missing/extra/duplicate/linked/special/unsafe members, altered bodies, pin/notice/font drift and linked extraction roots/ancestors.
43
+ Extracted tests use tar-only package bodies and explicitly linked existing fixture peers; they never fill missing package files from source.
44
+ No version bump, dependency install or publication is implied by this redesign.
@@ -0,0 +1,108 @@
1
+ # Explicit service management
2
+
3
+ The native `/cadence` view and browser are clients of the same explicitly started owner.
4
+ Opening either view, extension discovery, installation and login do not start it.
5
+ Use one coordination state-home for the checkout; a different state-home is not a recovery route.
6
+ Stop older Cadence sessions before starting the shared service.
7
+
8
+ ```sh
9
+ cadence-service start --workspace /absolute/project
10
+ cadence-service status --workspace /absolute/project
11
+ cadence-service diagnose --workspace /absolute/project
12
+ cadence-service token-link --workspace /absolute/project --reveal
13
+ cadence-service token-rotate --workspace /absolute/project
14
+ cadence-service stop --workspace /absolute/project
15
+ ```
16
+
17
+ The equivalent package-relative command is `node <cadence>/src/service-cli.mjs ...`.
18
+ `--help` lists the finite interface.
19
+ `start` also accepts `--foreground`, `--config`, `--agent-dir`, `--host` (loopback only), `--port`, `--token-file` and `--state-home`.
20
+ Defaults are loopback `127.0.0.1:17423`, normal Pi agent configuration, and detached service lifetime.
21
+ An explicit port0 selects and persists a positive port once; restart uses the selected configuration, not a fallback endpoint.
22
+ Missing/corrupt existing setup is preserved, not filled in or reset.
23
+ There is no login autostart, supervisor installation, provider login or credential migration.
24
+
25
+ ## Status, departure and Stop
26
+
27
+ - `alive` requires an authenticated exact-epoch reply.
28
+ It is not a PID probe.
29
+ `actions:false` can mean that no owner model has been explicitly selected yet.
30
+ - Return, browser close and Pi quit detach clients; admitted work continues.
31
+ Use the client's **Cancel** for a run or management **stop** for the service.
32
+ - Stop closes admission and waits original processes, credential writes, history writes, already-started publication continuations, owned networking and listener closure before releasing fences.
33
+ Checks, native process outcomes and human review remain separate facts.
34
+ - `unconfirmed` means startup/Stop acknowledgment or settlement was not established within its reporting bound.
35
+ It is not permission to restart, kill a guessed PID or remove a lock.
36
+ `quarantined` preserves uncertain process/auth/storage work and prevents unsafe writers.
37
+ - A foreground owner can be managed from another terminal.
38
+ Ctrl-C, SIGTERM, machine crash or terminal destruction is **not** the authenticated orderly Stop route and can leave recovery fences.
39
+ A recovered `stopped` registration means acknowledged fence release, not retroactive native closure certification.
40
+
41
+ `diagnose` reports fixed pending/recording facts and `proxyAuth: direct|validated-proxy`.
42
+ No normal status/diagnosis prints access secrets, provider credentials or outbound proxy URLs.
43
+ Keep the explicitly revealed token link private.
44
+ Browser entry redirects to a token-free URL and uses an HttpOnly cookie; that does not retract a link already copied into history, a clipboard or external logs.
45
+ File/generated token rotation invalidates old access and pending confirmations, not admitted work.
46
+ Environment-token replacement requires explicit Stop/restart with changed environment.
47
+ Inbound remote access still requires the selected same-host HTTPS reverse-proxy policy; outbound proxy routing below is independent.
48
+ Browser access, even with a valid token, cannot perform local management/recovery or arbitrary manual shell checks.
49
+ The native client's local capability uses an owned direct loopback dispatcher, never the Pi process's provider proxy.
50
+ Detach joins that client's original dispatcher closure without changing the parent's global dispatcher or canceling service work.
51
+
52
+ ## Outbound owner authentication and workers
53
+
54
+ Set one credential-free HTTP(S) proxy URL as an equal HTTP/HTTPS pair in the **service launch** environment.
55
+ Matching uppercase/lowercase duplicates are supported; conflicting or partial pairs refuse.
56
+ No `ALL_PROXY`, `NO_PROXY`/bypass, URL userinfo, non-root path, query/fragment, percent-bearing authority, unsafe controls or `NODE_OPTIONS` (including empty entries) is accepted.
57
+ `NODE_USE_ENV_PROXY` can be absent or exactly `1` with the pair.
58
+ A standalone opt-in refuses.
59
+ The service launcher projects the validated uppercase pair and opt-in before SDK imports, and uses the actual runtime's public `--use-env-proxy` capability.
60
+ Missing capability refuses before launch, without finding/installing another Node.
61
+
62
+ After SDK imports the dedicated owner installs one owned public Undici dispatcher, verifies its identity and uses it for public SDK getAuth/OAuth refresh.
63
+ Workers retain their separately validated startup/post-import route.
64
+ Scoped provider route entries must exactly match the captured route; they cannot select a route or become process environment.
65
+ Changed route facts/dispatcher identity refuse, never silently fall back to direct traffic.
66
+ DIRECT adds no dispatcher work.
67
+ No TLS override, global fetch replacement or private SDK networking is used.
68
+ Proxy URLs are RAM-only known redaction literals, not persisted route hashes or public history fields.
69
+
70
+ Pi's selected existing `auth.json`/`models.json` remain the model sources; OAuth renewal writes back through public SDK coordination, preserving unrelated credentials.
71
+ Cancel stops launch admission but does not claim an already-started refresh/writeback was rolled back.
72
+ Checks inherit the owner's frozen ordinary launch environment (including the canonical configured proxy pair/opt-in), minus service/access/control material.
73
+ Resolved model auth is never merged into checks.
74
+ Local fabricated-provider plain/gzip routing tests are not paid-provider, all-adapter, Node22 or other-platform qualification.
75
+
76
+ ## Informed local recovery
77
+
78
+ ```sh
79
+ cadence-service recover inspect --workspace /absolute/project
80
+ cadence-service recover resolve --workspace /absolute/project
81
+ ```
82
+
83
+ Inspection is readonly.
84
+ It displays the epoch, exact coordination/history digests, owner PID/host observation and independent process/credential/storage uncertainty.
85
+ Those digests identify preserved resources, not successful work or credential validity.
86
+ A journal with no unmatched intent does not prove every escaped descendant or external credential writer stopped.
87
+
88
+ Before resolve, independently inspect and stop old processes externally, inspect the selected Pi credential file and SDK locks, and inspect retained storage/history.
89
+ Cadence does not signal arbitrary processes, reclaim SDK locks, repair credentials, truncate damaged history, migrate old formats or delete old resources.
90
+ Resolve requires a native local TTY, four fresh typed responses within120seconds and the same unchanged resources: separate process/escaped-descendant, credential/writeback and storage acknowledgments, then the exact displayed epoch.
91
+ There is no `--yes`, piped-input confirmation, browser body boolean, HTTP recovery endpoint or pasted multiline authorization.
92
+ An SSH terminal executes locally on the owner host; this is an operator interaction boundary, not proof of a physical human's identity.
93
+
94
+ Only a same-host owner whose PID probe specifically reports absence is eligible; live, remote, ambiguous, refreshed or partial resources refuse.
95
+ Absence alone never clears anything.
96
+ The original durable append/flush/close of a new fenced recovery fact completes first.
97
+ Then exact registration and registry state are updated, and the exact capability, owner lock and associated v1 lock are released in order, rechecking remaining resources, history and local authority before every effect.
98
+ Other workspace reservations remain untouched.
99
+ The v1 lock is last.
100
+ An unrelated legacy lock is never eligible.
101
+
102
+ Recovery preserves old unknown outcomes and damaged bytes.
103
+ Its result is **operator acknowledgment, not certification**; restart chooses a new epoch and never replays queues/auth work.
104
+ New work requires fresh plan/action consent.
105
+ Failure/crash between append and release can leave a durable bridge and partial fences.
106
+ A refused command is not proof of no effects.
107
+ Reinspect and preserve that state; reading/restart does not repair it, and automatic retry/reset is not a safe resolution.
108
+ Recognized old history formats stay readonly and are not migrated to enable recovery.