@c4roa0/agentpay-user 0.0.0-stage → 0.3.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 (173) hide show
  1. package/AGENTS.md +137 -0
  2. package/CONTRIBUTING.md +16 -0
  3. package/LICENSE +373 -0
  4. package/NOTICE.md +20 -0
  5. package/README.md +84 -2
  6. package/SECURITY.md +16 -0
  7. package/doc/README.md +52 -0
  8. package/doc/TODO.md +97 -0
  9. package/doc/architecture.md +96 -0
  10. package/doc/design.md +60 -0
  11. package/doc/develope.md +68 -0
  12. package/doc/plans/user-wallet-distribution.md +91 -0
  13. package/doc/reference/harness-skill-runtime.md +120 -0
  14. package/doc/reference/local-cache-foundation.md +176 -0
  15. package/doc/reference/local-safe-owner-ui.md +25 -0
  16. package/doc/reference/local-update.md +18 -0
  17. package/doc/reference/multi-service-runtime.md +119 -0
  18. package/doc/reference/npm-integration-verification.md +67 -0
  19. package/doc/reference/onboarding-writing.md +48 -0
  20. package/doc/reference/original-order-recovery.md +97 -0
  21. package/doc/reference/private-anvil-onboarding-config.example.json +18 -0
  22. package/doc/reference/public-deployment-settings.md +56 -0
  23. package/doc/reference/random-skill-contract.md +18 -0
  24. package/doc/reference/result-file-cache.md +166 -0
  25. package/doc/reference/runtime-address-recovery.md +42 -0
  26. package/doc/reference/runtime-result-cache.md +157 -0
  27. package/doc/reference/runtime-startup-recovery.md +141 -0
  28. package/doc/reference/skill-input-output-cache.md +93 -0
  29. package/doc/reference/wallet-identity-policy-history.md +23 -0
  30. package/doc/runbooks/commands.md +89 -0
  31. package/doc/runbooks/deployment-authorization-update.md +42 -0
  32. package/doc/runbooks/emergency-payment-stop.md +80 -0
  33. package/doc/runbooks/local-autostart.md +212 -0
  34. package/doc/runbooks/local-cache.md +115 -0
  35. package/doc/runbooks/local-update.md +84 -0
  36. package/doc/runbooks/market-connection.md +73 -0
  37. package/doc/runbooks/npm-publication.md +56 -0
  38. package/doc/runbooks/official-test-package.md +62 -0
  39. package/doc/runbooks/order-cancellation.md +56 -0
  40. package/doc/runbooks/order-support.md +41 -0
  41. package/doc/runbooks/policy-renewal.md +80 -0
  42. package/doc/runbooks/private-anvil-terminal-setup.md +58 -0
  43. package/doc/runbooks/runtime-skill-client.md +155 -0
  44. package/doc/runbooks/safe-owner-web.md +104 -0
  45. package/doc/runbooks/safe-policy-migration.md +36 -0
  46. package/doc/runbooks/safe-policy-setup.md +52 -0
  47. package/doc/runbooks/terminal-authorization-preview.md +38 -0
  48. package/doc/runbooks/unlock-wallet.md +68 -0
  49. package/doc/runbooks/user-onboarding.md +87 -0
  50. package/doc/runbooks/wallet-identity.md +59 -0
  51. package/doc/security/public-source-review-2026-11-06.md +71 -0
  52. package/doc/usage.md +54 -0
  53. package/package.json +49 -4
  54. package/progress.md +178 -0
  55. package/run +29 -0
  56. package/scripts/agentpay-cli.mjs +11 -0
  57. package/scripts/authorize-existing-safe.mjs +211 -0
  58. package/scripts/autostart.mjs +186 -0
  59. package/scripts/cancel-order.mjs +76 -0
  60. package/scripts/check-installation.mjs +26 -0
  61. package/scripts/check-official-test-package.mjs +35 -0
  62. package/scripts/check-purchase-readiness.mjs +275 -0
  63. package/scripts/configure-runtime-client.mjs +16 -0
  64. package/scripts/guide-policy.mjs +64 -0
  65. package/scripts/initialize-caller-credential.mjs +11 -0
  66. package/scripts/install-skill-bundle.mjs +176 -0
  67. package/scripts/install-user.mjs +24 -0
  68. package/scripts/local-service.mjs +60 -0
  69. package/scripts/lock.mjs +11 -0
  70. package/scripts/login-notify.mjs +39 -0
  71. package/scripts/migrate-safe-policy.mjs +165 -0
  72. package/scripts/official-paid-test.mjs +9 -0
  73. package/scripts/poll-unconfirmed-notice.mjs +75 -0
  74. package/scripts/prepare-onboarding.mjs +33 -0
  75. package/scripts/preview-policy.mjs +65 -0
  76. package/scripts/random-model-ack-smoke.mjs +235 -0
  77. package/scripts/random-reject-smoke.mjs +147 -0
  78. package/scripts/renew.mjs +9 -0
  79. package/scripts/repair.mjs +10 -0
  80. package/scripts/revoke.mjs +9 -0
  81. package/scripts/select-skill-bundle.mjs +39 -0
  82. package/scripts/setup-local.mjs +199 -0
  83. package/scripts/status.mjs +13 -0
  84. package/scripts/test-package.mjs +35 -0
  85. package/scripts/unlock.mjs +13 -0
  86. package/scripts/update.mjs +7 -0
  87. package/scripts/user-setup.mjs +219 -0
  88. package/scripts/verify-npm-release.mjs +32 -0
  89. package/src/active-skill.mjs +160 -0
  90. package/src/anvil-onboarding-state.mjs +96 -0
  91. package/src/anvil-onboarding.mjs +1036 -0
  92. package/src/authorization-question-checkpoint.mjs +114 -0
  93. package/src/autostart-files.mjs +50 -0
  94. package/src/cache-management-cli.mjs +302 -0
  95. package/src/cache-management.mjs +47 -0
  96. package/src/caller-auth.mjs +58 -0
  97. package/src/client-request-lock.mjs +44 -0
  98. package/src/connect-market.mjs +408 -0
  99. package/src/demo-unlock-secret.mjs +64 -0
  100. package/src/deployment-status.mjs +198 -0
  101. package/src/file-cache-cli.mjs +83 -0
  102. package/src/file-cache-owner.mjs +74 -0
  103. package/src/file-cache-settings.mjs +50 -0
  104. package/src/file-cache.mjs +790 -0
  105. package/src/file-download.mjs +281 -0
  106. package/src/finalization-disclosure.mjs +16 -0
  107. package/src/guided-setup.mjs +194 -0
  108. package/src/index.mjs +1231 -0
  109. package/src/install-and-setup.mjs +38 -0
  110. package/src/install-preflight.mjs +201 -0
  111. package/src/install-user.mjs +279 -0
  112. package/src/installation-paths.mjs +31 -0
  113. package/src/invocation-result.mjs +148 -0
  114. package/src/invocation-store.mjs +385 -0
  115. package/src/local-data-directory.mjs +117 -0
  116. package/src/local-info.mjs +181 -0
  117. package/src/local-services.mjs +156 -0
  118. package/src/local-time.mjs +36 -0
  119. package/src/local-update.mjs +306 -0
  120. package/src/local-wallet-ipc.mjs +93 -0
  121. package/src/login-reminder.mjs +28 -0
  122. package/src/market-download-url.mjs +21 -0
  123. package/src/node-version.mjs +12 -0
  124. package/src/npm-update.mjs +126 -0
  125. package/src/official-paid-test.mjs +407 -0
  126. package/src/official-test-package.mjs +41 -0
  127. package/src/official-test-update.mjs +162 -0
  128. package/src/order-cancellation.mjs +241 -0
  129. package/src/order-closure.mjs +42 -0
  130. package/src/order-list-panel.mjs +110 -0
  131. package/src/order-review.mjs +424 -0
  132. package/src/order-status-panel.mjs +65 -0
  133. package/src/order-support.mjs +365 -0
  134. package/src/owner-approval-server.mjs +332 -0
  135. package/src/owner-signer.mjs +67 -0
  136. package/src/policy-info.mjs +38 -0
  137. package/src/policy-migration.mjs +84 -0
  138. package/src/policy-operations.mjs +67 -0
  139. package/src/policy-preview-server.mjs +236 -0
  140. package/src/policy-terminal-guide.mjs +377 -0
  141. package/src/prepare-local-services.mjs +143 -0
  142. package/src/prepare-onboarding.mjs +210 -0
  143. package/src/private-journal-files.mjs +29 -0
  144. package/src/readiness-profile.mjs +30 -0
  145. package/src/renew-policy.mjs +605 -0
  146. package/src/repair-market-wallet.mjs +137 -0
  147. package/src/restore-wallet.mjs +255 -0
  148. package/src/result-cache-view.mjs +276 -0
  149. package/src/runtime-client.mjs +1145 -0
  150. package/src/runtime-connection-settings.mjs +101 -0
  151. package/src/runtime-recovery.mjs +667 -0
  152. package/src/runtime-status.mjs +32 -0
  153. package/src/safe-owner-anvil.mjs +115 -0
  154. package/src/safe-policy-plan.mjs +195 -0
  155. package/src/service-reference.mjs +233 -0
  156. package/src/service-url.mjs +52 -0
  157. package/src/settlement-response.mjs +69 -0
  158. package/src/setup-autostart.mjs +197 -0
  159. package/src/setup-demo.mjs +152 -0
  160. package/src/skill-bundle.mjs +142 -0
  161. package/src/skill-client.mjs +198 -0
  162. package/src/skill-install-prompt.mjs +31 -0
  163. package/src/skill-package.mjs +50 -0
  164. package/src/skill-zip.mjs +220 -0
  165. package/src/status-panel.mjs +589 -0
  166. package/src/transport.mjs +48 -0
  167. package/src/uninstall-local.mjs +299 -0
  168. package/src/user-cli.mjs +354 -0
  169. package/src/user-setup-guide.mjs +193 -0
  170. package/src/wallet-control.mjs +182 -0
  171. package/src/wallet-ipc-error.mjs +16 -0
  172. package/src/wallet-package.mjs +22 -0
  173. package/update-pair.json +6 -0
@@ -0,0 +1,166 @@
1
+ # Local result file cache
2
+
3
+ Current source, 2026-11-04: [unified cache management](../runbooks/local-cache.md)
4
+ includes text/file display, both durable result stores and saved Provider source.
5
+ The output APIs below remain supported through the shared store. Controlled binary
6
+ verification passed; actual paid binary-service acceptance is a separate gate.
7
+
8
+ Implemented and verified within the private scope on 2026-11-02. See the
9
+ closeout (private historical evidence; not distributed) for controlled tests,
10
+ participant restart/unlock and unverified environments.
11
+ This is an optional local Runtime interface, not a Provider wire requirement.
12
+
13
+ ## Operations
14
+
15
+ All routes are authenticated POSTs on the existing loopback Runtime with its
16
+ existing caller credential. Download requires exactly one saved Order with a verified
17
+ local result matching its original service/request. Listing and removing cached files
18
+ remain possible even when the original result file is missing or damaged. No Wallet signature, new payment, Provider service execution
19
+ or receipt confirmation is part of these operations.
20
+
21
+ | Route | JSON fields | Result |
22
+ | --- | --- | --- |
23
+ | `/files/cache` | `orderId`, `fileKey`, `url`; optional `filename`, `sha256` | Download/reuse metadata, including generated local path when available |
24
+ | `/files/list` | `orderId`; optional `offset`, `limit` (1–100) | Saved file metadata for this Order |
25
+ | `/files/remove` | `orderId`, `fileKey`, `confirmed: true` | Delete local copy and retain metadata with removed state |
26
+
27
+ The installed Runtime client exports `cacheResultFile`, `listResultFiles`, and
28
+ `removeResultFile`. Skill authors select a file URL explicitly; Runtime does not
29
+ inspect arbitrary business output for links or force a new output schema.
30
+
31
+ ```js
32
+ import {loadRuntimeConnection, cacheResultFile, listResultFiles}
33
+ from './runtime-client.mjs'; // Installed User client module, not a copied implementation.
34
+ const connection = await loadRuntimeConnection();
35
+ const file = await cacheResultFile(connection, {
36
+ orderId, fileKey: 'report', url: reportUrl, filename: 'report.pdf',
37
+ // sha256: expectedDigest, // Optional expected digest from your delivery contract.
38
+ });
39
+ const files = await listResultFiles(connection, orderId);
40
+ ```
41
+
42
+ Skill bootstrap code must resolve the installed User client through the saved local
43
+ connection as it already does. The illustrative import above denotes that installed
44
+ module; it is not a requirement to bundle transport or copy credentials into Skills.
45
+ Use `./run orders files ORDER_ID` to list copies and
46
+ `./run orders files ORDER_ID remove FILE_KEY` to remove one after terminal confirmation.
47
+ Listings show up to 100 entries, newest first; use `./run orders files ORDER_ID list 2`
48
+ for the second page. Runtime must be running; Wallet unlock is not needed. `confirmed: true` is an explicit operation acknowledgement, not an
49
+ OS isolation or cryptographic owner approval. Agents have the local caller boundary.
50
+
51
+ `fileKey` is 1–80 ASCII letters/digits/dots/underscores/hyphens and identifies one
52
+ file within the Order. Reuse the same key for retry. An expired URL may be replaced only when the
53
+ record already has a known local or expected digest; downloaded bytes must still
54
+ match that digest. Preserve the original optional `sha256` argument. Without any
55
+ known digest, use the original URL or explicitly select a different file key;
56
+ Runtime cannot establish that a newly supplied link contains the original bytes. Display filenames never form filesystem paths.
57
+ URLs, query credentials and file contents are not returned in routine metadata or
58
+ logged. Available metadata contains size, SHA-256, generated path, timestamp,
59
+ transport (http/https), and integrity description. Inspect the state before using a
60
+ path. The file is never executed, extracted, or rendered by Runtime.
61
+
62
+ ## Transfer and integrity
63
+
64
+ HTTP and HTTPS are supported, including explicit ports. HTTP is unencrypted;
65
+ metadata reports its transport. Neither transport alone proves delivery correctness.
66
+ Source URLs may differ from the Provider service endpoint.
67
+
68
+ DNS answers are validated; allowed addresses are tried in order and pinned to each
69
+ connection. Up to five redirects are revalidated hop by hop; HTTPS-to-HTTP
70
+ downgrade is refused. Direct HTTP remains supported.
71
+ Private, loopback, link-local/metadata and reserved destinations are denied by
72
+ default. Embedded URL credentials are refused. Identity transfer is requested;
73
+ gzip, deflate and Brotli responses are decoded with both transfer and decoded-byte
74
+ limits. Unknown HTTP encodings are rejected; this does not restrict archive file formats. Caller/Wallet credentials are never forwarded. Optional signed query URLs
75
+ remain only in private metadata; protect cache backups accordingly.
76
+
77
+ An operator may set `AGENTPAY_USER_FILE_CACHE_PRIVATE_ORIGINS` to a JSON array of at
78
+ most 16 exact origins, e.g. `["http://127.0.0.1:8123"]`, in the Runtime environment
79
+ for controlled private fixtures. Only that scheme/host/port is excepted; DNS is still
80
+ pinned. Only loopback/RFC1918/ULA destinations qualify for this exception; metadata
81
+ link-local and reserved addresses remain blocked. No wildcard/all-private-network
82
+ option exists. Default is `[]`; the installer does not enable an exception.
83
+
84
+ Transfers stream to private temporary files, enforce the actual byte limit even
85
+ without Content-Length. Default total transfer timeout is 15 minutes, configurable
86
+ up to 24 hours. Connection/header attempts are capped at 10 seconds each within
87
+ that total budget. These are local resource limits, not Provider delivery deadlines. No partial file is marked
88
+ available. After restart, the first cache operation validates completed bytes with a durable
89
+ digest and finishes publication where possible; other interrupted transfers are
90
+ marked failed and their owned partial bytes removed. Retrying restarts only the download; no
91
+ byte-range append or automatic background network retry is implemented.
92
+
93
+ An optional expected SHA-256 must match. Otherwise the digest records local bytes
94
+ only. A Skill-supplied digest is not itself evidence from Settlement. Metadata uses
95
+ `expected_digest_matched` or `local_digest_only`; neither is an evidence-binding
96
+ claim. Reuse rechecks the saved file hash, size and permissions. Listing shows saved
97
+ metadata and does not reread/hash every binary. If a previously downloaded URL later
98
+ serves different bytes, retry cannot silently replace the known digest. Original
99
+ links may expire; refreshing one is separate from buying/executing the service.
100
+
101
+ ## Storage, limits and cleanup
102
+
103
+ Storage is under `runtime/invocations.json.files/` in selected User data. Index and
104
+ binary files are owner-private (0600); directory is 0700. Generated SHA-256 storage
105
+ names derive from Order ID/file key. Files and index updates are fsynced and published
106
+ atomically. Metadata stores state/timestamps, source and integrity; it retains
107
+ removed/failed records. Local backup contains private result data and URLs.
108
+
109
+ Default limits: 100 MiB/file, 512 MiB shared input/output file bytes, 20 non-removed records per request or Order,
110
+ 2 concurrent transfers, 10,000 retained history records and 8 MiB metadata.
111
+ Removed copies free byte capacity and per-Order slots. Removed history remains
112
+ bounded separately: at its cap, new keys stop with FILE_HISTORY_LIMIT; existing
113
+ keys remain reusable. History is not silently deleted. Operators can raise the
114
+ record cap (up to 100,000), subject to the metadata byte cap.
115
+
116
+ Prefer `./run cache settings` to inspect/change limits live. `./run cache settings`
117
+ also shows saved limits and the optional settings path:
118
+ `runtime/invocations.json.file-cache-settings.json` under selected User data.
119
+ Create an owner-private (0600) JSON file containing only the overrides needed:
120
+
121
+ ```json
122
+ {"singleBytes":209715200,"totalBytes":1073741824,"timeoutMs":3600000}
123
+ ```
124
+
125
+ Other keys are `filesPerResult`, `concurrent`, and `records`. Values must be positive
126
+ integers; singleBytes cannot exceed totalBytes; totalBytes is capped at 1 TiB,
127
+ concurrent at 16, records at 100,000 and timeoutMs at 86,400,000. Manual file edits require Runtime restart (`./run service restart` also locks Wallet);
128
+ `./run cache settings KEY VALUE` applies changes live without that restart. Invalid optional cache settings
129
+ fail file operations without stopping Runtime's Order recovery. Limits cannot be
130
+ supplied by a Skill in route requests.
131
+
132
+ URL transfers reserve the maximum file size; local inputs reserve their checked
133
+ file size. Reservations subtract already-written partial or published bytes;
134
+ actual stored bytes also count. A small file may still require one full-size slot.
135
+ Cache ownership uses `fs-native-extensions` 1.5.3 through a small file-lock adapter.
136
+ Each Runtime retains a descriptor for the empty `owner.lock` file in the cache
137
+ folder. OS locks release on process exit/crash; the file itself remains and must
138
+ not be deleted/replaced while Runtime is running. There are no heartbeat timers,
139
+ PID-reuse assumptions or extra ports. Multiple handles in one process share a queue.
140
+
141
+ The pinned package ships Node prebuilds for Linux, macOS and Windows x64/ARM64;
142
+ this host verified Linux x64 with Node 22.22.3 using installation scripts disabled,
143
+ without compilation. The lock adapter no longer rejects other OSes. This is not a
144
+ claim that all User filesystem permissions, startup or CLI operations have been
145
+ ported/tested on Windows/macOS/mobile. Actual supported environments remain subject
146
+ to platform acceptance. Network/shared-filesystem locking is not validated.
147
+
148
+ If the native binding is unavailable, file operations fail with
149
+ `FILE_CACHE_LOCK_UNAVAILABLE`; they never silently skip locking. Reinstall the
150
+ locked User dependencies with `npm ci` and restart Runtime; if the error persists,
151
+ report the Node/OS/architecture to support. Runtime startup and Order recovery do
152
+ not load this optional native binding. A lock file left after a crash is normal:
153
+ do not manually delete it to recover. Full uninstall still stops services first.
154
+
155
+ Removal first persists deletion intent, then deletes bytes and records completion;
156
+ restart finishes interrupted deletion. Removal retains history and does not cancel/refund an Order or remove structured
157
+ results. Cache-full never evicts original data. The existing confirmed all-local-data
158
+ uninstall removes this subdirectory with User data. Back up the complete User data
159
+ folder privately to retain pending/verified results, files, history and signed URLs;
160
+ key/Policy backup alone cannot restore file contents.
161
+
162
+ Tests use controlled streams, default HTTP/HTTPS clients with normal certificate
163
+ validation, actual SIGKILL transfer recovery, and two
164
+ maintained business payloads through Runtime. They are not production network or
165
+ live paid acceptance, and do not establish that an arbitrary Provider can retain or
166
+ reissue files indefinitely.
@@ -0,0 +1,42 @@
1
+ # Runtime address and original-request recovery
2
+
3
+ Implemented recovery boundary; participant and real-network scope remain in TODO.
4
+ A local Runtime URL is transport location, not purchase identity. Historical records
5
+ that included an address are retained for guarded lookup rather than silently reset.
6
+
7
+ ## Existing-only recovery
8
+
9
+ Treat loopback Runtime URL as a connection location. Preserve service/profile/input,
10
+ caller request ID, original orderRequestId, authorization scope and any known Order
11
+ ID as recovery evidence. Do not add a machine ID or bind nickname to an installation.
12
+
13
+ Before allowing a changed destination, inspect the original request through the
14
+ authenticated local interface. Do not create state during this check. Continuing a
15
+ recovered request must atomically require that original invocation still exists and
16
+ matches: a separate successful preflight alone cannot protect against state removal
17
+ before execution. Missing, mismatched or ambiguous history stops paid continuation.
18
+ The new Runtime may not silently call begin's create branch for a recovery request.
19
+
20
+ Default selection must find old records independently of the changed port. Preserve
21
+ historical records and block ambiguity; do not overwrite legacy keys or silently
22
+ choose one of multiple candidate requests. Valid local verified results can be read
23
+ without restarting a purchase. Explicit new-purchase intent remains separate.
24
+
25
+ A truly never-submitted request needs a separately justified creation path; absence
26
+ of a local Order ID is not proof that it never reached Runtime. A lost-history
27
+ reinstall requires original-order reconciliation, not blind URL replacement.
28
+
29
+ ## Required regression coverage
30
+
31
+ Same history/new port; same Wallet/missing history; changed service/input/scope;
32
+ legacy address-keyed selection; multiple candidates; concurrent selection; crash
33
+ between lookup and execution; saved result reuse. In every recovery failure assert
34
+ zero new prepare/sign/fund calls. Use two maintained business payloads. No old
35
+ Policy, Order, commitment or service profile is rewritten.
36
+
37
+ ## Related input snapshots
38
+
39
+ The approved [Skill input/output persistence plan](skill-input-output-cache.md) adds
40
+ request-scoped file snapshots without changing the existing-only recovery requirement.
41
+ Implement and verify these together at the invocation boundary; cached files alone
42
+ do not prove that another Runtime retains the original financial history.
@@ -0,0 +1,157 @@
1
+ # Runtime result records and file caching
2
+
3
+ Date: 2026-11-02. All three implementation loops are complete within the
4
+ recorded private scope (private historical evidence; not distributed), including
5
+ participant restart/unlock. This plan introduces no new Provider output protocol.
6
+
7
+
8
+ ## Goal and existing behavior
9
+
10
+ Preserve a paid service's original result across Runtime/Agent interruption without
11
+ buying or executing the service again. Separate payment status, delivery evidence,
12
+ local result availability and downloaded file availability.
13
+
14
+ The initial verified-result store used `runtime/invocations.json.results/` and saved
15
+ only after evidence verification. Implemented loop 1 now saves a bounded pending
16
+ record first, then verifies and promotes it; local recovery distinguishes missing,
17
+ pending, invalid and old-format results. Loop 2 keeps binaries and transfer metadata
18
+ separate. See the current file-cache reference for implemented behavior and limits.
19
+ A JSON containing a URL is not a local copy of that file.
20
+
21
+ An initial pending-JSON draft was paused while this layered plan was approved.
22
+ Loop 1 now implements structured result persistence under that plan; it does not
23
+ implement file downloads. Current pending records use a separate private
24
+ `runtime/invocations.json.pending-results/` directory and retain the candidate
25
+ alongside the verified copy. Each record is capped at 2 MiB, matching the existing
26
+ result read limit. Automatic eviction and binary-file quota belong to loop 2.
27
+
28
+ ## Boundaries
29
+
30
+ - User Runtime owns private local storage and recovery orchestration. Wallet keeps
31
+ its existing bounded signing/read authority. Settlement stores hashes/usage and
32
+ delivery evidence, not private output or downloaded files. Market is not a result
33
+ hosting service. No contract, SQL or shared Provider wire change is required by
34
+ this plan.
35
+ - Keep Provider output format and existing output-hash semantics application-owned.
36
+ Do not scan arbitrary output strings for URLs, invent business-specific adapters,
37
+ require file descriptors in every response, or change what existing receipts mean.
38
+ - A Skill explicitly requests caching of selected files through a generic local
39
+ interface. This interface is an opt-in local feature, not a new prerequisite for
40
+ a Provider to accept Orders. The implemented local API is documented in
41
+ [the file-cache reference](../reference/result-file-cache.md); it is not a Provider wire change.
42
+ - Private contents, download tokens and signed URLs never appear in status/help,
43
+ routine logs, Market, or Settlement. Local OS ownership is the protection boundary;
44
+ this is not isolation from another process running as the same OS user.
45
+ - Cache state never authorizes payment, confirms receipt, changes dispute deadlines,
46
+ proves service quality, or automatically creates a replacement purchase.
47
+
48
+ ## Storage and separate states
49
+
50
+ Keep the existing verified-record format and location. Add separate pending result
51
+ storage and file storage under the selected User data directory, with private owner
52
+ permissions. Paths/names supplied by the Provider must not determine filesystem
53
+ paths; use generated internal identifiers. Original human filenames are metadata.
54
+
55
+ | Layer | States and meaning |
56
+ | --- | --- |
57
+ | Financial Order | Existing authenticated Settlement state; never inferred from cache |
58
+ | Result record | Missing; pending evidence; verified; invalid; older format not verifiable |
59
+ | File | Not downloaded; downloading; available locally; interrupted/failed; removed locally |
60
+ | File integrity | Local digest recorded; expected digest matched, if provided; evidence binding verified only when the existing delivery contract supports it |
61
+
62
+ Do not label an old-format result as absent if bytes exist. Do not label a local
63
+ hash as Provider authenticity: a digest computed after download proves only local
64
+ integrity unless independently bound to the agreed original evidence. A verified
65
+ structured result may coexist with undownloaded/expired file links. No implicit
66
+ "all files complete" claim is possible for unknown application-owned output.
67
+
68
+ Result records contain the original invocation/Order identity and service binding,
69
+ verification state and timestamps. File metadata references the original result,
70
+ local generated file identity, display filename, actual size, digest, source and
71
+ transfer state. Avoid putting binary content/base64 blobs in result JSON.
72
+
73
+ ## Result receipt and restart
74
+
75
+ 1. Validate Provider response shape, size, identity and output integrity using the
76
+ existing service contract. Save the bounded result as pending before waiting for
77
+ Settlement's evidence. Do not return it as a successful verified delivery yet.
78
+ 2. Verify original Order/service/request, output hash and usage against authenticated
79
+ Settlement evidence using the original Policy scope. Revocation or unavailable
80
+ authority stays a visible blocker; no Safe-only lookup or rebinding workaround.
81
+ 3. Atomically promote the result to verified, then return it. Crash between promotion
82
+ and response must return the same saved result on retry. Conflicting candidates
83
+ never silently overwrite the original. Avoid comparing mutable disclosure fields
84
+ as if they were immutable delivery content.
85
+ 4. Startup/background recovery may verify saved pending results using bounded reads;
86
+ it must not invoke Provider service execution, submit payment or confirm receipt.
87
+ Explicit same-request resume can use this pending copy before considering service
88
+ execution. Existing financial closure still governs all service/mutation actions.
89
+ 5. Corruption, disk-full, partial writes, concurrent recovery and unknown legacy
90
+ formats must fail visibly and preserve original history. Persisted pending state
91
+ must be included in orphan/history checks and limits. Unverified files never
92
+ become ordinary verified results merely because an Order was paid out.
93
+
94
+ When no result was durably received (for example the process dies before receiving
95
+ the response), local caching cannot solve that loss. Original Provider retrieval,
96
+ its permissions and applicable support deadlines remain the recovery route.
97
+
98
+ ## File transfer
99
+
100
+ - Skill calls a bounded, authenticated local cache operation for an explicitly
101
+ selected result/file. Do not reuse the payment or generic signing interface.
102
+ - Support HTTP and HTTPS; record whether the source transport is encrypted. Validate destination resolution and redirects, including private,
103
+ loopback, link-local and metadata endpoints; prevent DNS rebinding/redirect bypass.
104
+ Controlled private rehearsal fixtures require explicit narrow configuration,
105
+ never a global private-network bypass.
106
+ - No arbitrary filesystem writes, automatic unpacking, execution, previewing active
107
+ content, or forwarding Wallet/Runtime tokens to remote sources. Arbitrary remote
108
+ authentication headers are not an initial feature. Keep any permitted signed URL
109
+ private; redirect changes must not leak credentials.
110
+ - Stream to a temporary file, cap actual bytes even without Content-Length, enforce
111
+ deadlines/concurrency and reserve quota before writing. Match a supplied expected
112
+ hash where applicable, then fsync and atomically publish. Partial bytes are not an
113
+ available result. Leave original identity intact after timeout/network failure.
114
+ - Initial restart recovery may retry only the file transfer. Byte-range continuation
115
+ is optional: use it only with reliable validators preventing mixed file versions;
116
+ otherwise restart the download rather than append blindly. Never invoke the paid
117
+ service again to refresh an expired link.
118
+ - If the URL expired or content changed, retain the failure and original metadata.
119
+ Requesting an original file again is distinct from rerunning the service. No claim
120
+ that every Provider can reissue URLs or retain outputs indefinitely.
121
+
122
+ ## Capacity and cleanup
123
+
124
+ Implement bounded total file bytes, single-file bytes, per-result file count and
125
+ concurrent transfers. Implemented defaults and configuration names are documented in the
126
+ [file-cache reference](../reference/result-file-cache.md); the cache is bounded. Account for
127
+ concurrent reservations, interrupted temporary files and disk-full failures.
128
+
129
+ Do not automatically evict Order history, evidence metadata or pending result records
130
+ to make room. At the limit, stop new file downloads with a clear action. Initial
131
+ cleanup is deliberate: show scope/size, confirm, delete only selected local file
132
+ copies, and retain metadata marked removed locally. Protect in-flight writes and
133
+ use locks/atomic transitions so cleanup cannot publish a deleted transfer as ready.
134
+ Later automatic retention requires its own explicit policy. Uninstall's existing
135
+ confirmed all-local-data removal includes this storage. Backup guidance must explain
136
+ that restoring keys/Policy alone does not restore private result/file copies.
137
+
138
+ ## UX and implementation loops
139
+
140
+ 1. **Result preservation:** pending → evidence verification → verified; read-only
141
+ restart recovery; accurate missing/invalid/legacy/pending messages in status,
142
+ orders and details. Keep structured results general. Verify crash boundaries,
143
+ wrong evidence, revoked Policy, disk errors and concurrent same-request resume
144
+ with at least two maintained business payloads through one Runtime.
145
+ 2. **File cache:** finalize the local Skill client interface and limits; implement
146
+ metadata + streaming file storage, safe downloads, interruption/retry, quota and
147
+ deliberate cleanup. Test maintained text/binary fixtures, malicious destinations,
148
+ redirects, changed downloads, large/unknown-length streams and cleanup races.
149
+ 3. **Integration and acceptance:** document Skill-author usage and local CLI access;
150
+ distinguish original Order status, record verification and file availability.
151
+ Integrate uninstall/backup/info. Participant tests use official controlled fixtures,
152
+ preserve original Policy/history and avoid third-party Skills. No new purchase is
153
+ needed merely to inspect existing cache. Report source tests separately from
154
+ real-process and human acceptance.
155
+
156
+ The loops above were completed in sequence; see the closeout for their evidence. Neither a JSON placeholder
157
+ nor mocked downloads constitute acceptance of durable binary file recovery.
@@ -0,0 +1,141 @@
1
+ # Runtime startup self-check and Order recovery
2
+
3
+ Status: source implementation and isolated verification completed on 2026-10-24;
4
+ participant restart/unlock and legacy settled-Order reconciliation were reported.
5
+ Full login/reboot and missing-result restoration are not established. See verification and limits (private historical evidence; not distributed).
6
+ The source review table below records the pre-change findings.
7
+ This plan precedes discussion of `./run update`; it does not authorize real funds,
8
+ new Orders, deletion of participant history, or widening Wallet authority.
9
+
10
+ ## Required behavior
11
+
12
+ Start Runtime's safely configured local listener before asynchronous Order checks.
13
+ A historical business record, locked Wallet, unavailable network or old routing
14
+ format must not cause a restart loop. Report separately: process liveness,
15
+ self-check progress, Wallet availability/lock/Policy state, and purchase readiness.
16
+ An authenticated status view explains blockers and the next action without exposing
17
+ private input/output, signatures or credentials. Public health remains minimal.
18
+
19
+ This is not permission to listen without caller authentication, bind publicly,
20
+ overwrite a live socket/port, or ignore unsafe installation ownership. If the
21
+ listener itself cannot safely start (occupied port, missing/unsafe authentication
22
+ material), the CLI must explain repair; do not claim that every configuration can
23
+ produce a running HTTP server. Wallet capability failure may disable Wallet actions
24
+ without disabling an otherwise safely authenticated status listener.
25
+
26
+ Run local checks first, then reconcile eligible historical Orders in a bounded
27
+ background queue. Self-check does not prepare an Order, sign/submit a payment,
28
+ request service authorization, execute a Provider request, confirm receipt, cancel
29
+ an Order, or revoke/change Policy. These remain existing explicit invocation or
30
+ administrative flows. The existing Settlement workers own automatic closure/refund.
31
+
32
+ ## Two independent outcomes
33
+
34
+ A financial terminal state (Released, Refunded or Cancelled) is separate from
35
+ verified local result availability. Delivered is not financial finality. A cached
36
+ result does not establish payout; payout does not establish that the client saved
37
+ or received the output. Store observations with source, identity and observed-at
38
+ epoch time; retain original invocation/request/Order identities and replay fences.
39
+ These are local projections, not new Protocol enums or rewritten wire states.
40
+
41
+ ## Recovery matrix
42
+
43
+ | Observed condition | Startup self-check / permitted recovery | Purchase boundary and user action |
44
+ | --- | --- | --- |
45
+ | No history in a genuinely new installation | Complete local inventory; inspect Wallet/configuration | Normal readiness still required. Missing history in a previously used installation is not proof of a new installation. |
46
+ | Wallet missing, stopped, locked or unbound | Keep Runtime available; expose specific dependency status; retry after dependency changes | No payment without Wallet's existing checks. Prompt start/unlock/setup as appropriate. Never save an unlock secret. |
47
+ | Settlement/network unavailable or maintenance | Keep last observation explicitly stale; retry boundedly with backoff | Do not claim finality or replay a payment. Unresolved affected calls wait. |
48
+ | Valid current history and verified cached result | Validate result binding; separately reconcile financial status | Same-call result reuse needs no new payment; report any pending financial check separately. |
49
+ | Invocation exists, no saved Order ID | Preserve orderRequestId and commitmentNonce; inspect what read APIs can establish | Lost prepare response may still mean an Order exists. Self-check must not call prepare as a substitute for read. Only original explicit resume may use its established idempotent path. |
50
+ | Signed payload saved, payment outcome unknown | Read original Order/funding evidence using saved identity | Neither paymentSubmitted false nor a timeout proves no funding. No replacement Order, nonce or signature generated by self-check. |
51
+ | Funded, not yet accepted | Observe acceptance/closure/deadlines | Do not cancel because Provider briefly goes offline. Existing user cancellation and Settlement timeout rules apply. |
52
+ | Accepted, still executing | Observe original Order and deadline | No new service execution in background. Resume original request explicitly; accepted service deadline remains authoritative. |
53
+ | Delivered, payout pending | Track finalization/refund/closure observations separately from output cache | No startup receipt acknowledgement or accelerated payout. |
54
+ | Released, verified result saved | Persist verified financial observation; retain result and request replay fence | Same request returns existing result where its format is supported; no purchase. |
55
+ | Released, result absent or incompatible | Record settled transaction and unavailable/unverified result separately | Do not rerun the service or fabricate output. Existing Provider result retrieval may be used only if supported by the original contract and authorization; otherwise explain limitation. |
56
+ | Refunded or Cancelled | Persist verified terminal observation, preserve request identities and any valid result evidence | Same request stays terminal, not a fresh purchase; refunds do not restore cumulative Policy spend. |
57
+ | Legacy routing record | Preserve original bytes, IDs and binding; reconcile independently of current call routing where authoritative identity is available | No automatic routingVersion addition or coercion into new service context. Known request stays fenced; terminal history need not block unrelated new calls once scope is safely known. |
58
+ | Corrupt/unknown schema, conflicting IDs, unsafe file or write failure | Preserve source; report repair needed; isolate only if records can be reliably identified | If affected scope is unknown, pause all new paid calls while status stays available. Never replace unreadable state with an empty store. |
59
+ | Order not found, chain/Factory/Policy/deployment changed | Keep unresolved; require matching original deployment and identity evidence | A 404 or wrong current deployment does not mean unpaid. Do not silently query new deployment as if it owned the old Order. |
60
+ | Local and authoritative observations conflict, or finality is insufficient | Preserve evidence and mark pending/review; recheck matching source | Do not pick a convenient terminal result or release replay protection. |
61
+
62
+ ## Identity, authority and scope
63
+
64
+ Use Wallet's formal `readSettlementOrder` IPC and Settlement's Buyer-scoped read
65
+ endpoint; a normal User never reads server SQL or operator files. Today that HTTP
66
+ read requires a signed authentication request. Wallet locked means remote checks
67
+ wait for unlock; do not bypass authentication or add anonymous Order disclosure.
68
+ Signing a read authentication request is not payment signing.
69
+
70
+ Match Order ID, Buyer, chain, original Vault/Factory/Policy when available, service
71
+ reference and request hash. Persist only verified observations. For historical
72
+ records whose deployment facts cannot be recovered reliably, report the gap rather
73
+ than guessing. Optional independent chain verification must use the exact original
74
+ identity and existing finality policy; changing chain rules is outside this plan.
75
+
76
+ The participant's one legacy Order has independently observed Released state and
77
+ zero Vault balance on private Anvil. This proves the scoped chain observation,
78
+ not client result availability or a fresh Settlement database reconciliation.
79
+ Do not hard-code that Order or the reference random service into implementation.
80
+
81
+ Until initial inventory establishes a trustworthy replay boundary, block new paid
82
+ calls. After inventory, isolate known affected requests; allow unrelated requests
83
+ only when duplicate-payment scope is reliably bounded and normal Wallet/Settlement
84
+ readiness passes. Global pause remains valid for unreadable/conflicting history.
85
+ An explicit new user request (`--force`) is not an automatic recovery fallback.
86
+
87
+ ## Concurrency, persistence and scheduling
88
+
89
+ - One self-check scheduler per Runtime; bounded batch/concurrency and timeouts,
90
+ capped retry backoff with jitter. Wake on restart and dependency recovery;
91
+ no unbounded timers, pending promises or frequent polls of confirmed terminal Orders.
92
+ - Serialize background observations with foreground invocation updates. A stale
93
+ read must not overwrite a newer outcome; merge observation metadata without
94
+ mutating immutable request/Order/payment identities.
95
+ - Persist recovery observations atomically and durably. Crash during checking,
96
+ writing or restart resumes the same work. No archival or format migration that
97
+ opens a window for a known invocation ID to become a new purchase.
98
+ - Do not remove replay fences/results on terminal detection or introduce indefinite
99
+ new copies of private payloads. Any archive schema/retention change is reviewed
100
+ separately; preserve existing source history in the first implementation.
101
+ - Stop scheduling on shutdown and bound outstanding calls. Status counts distinguish
102
+ checked, waiting on dependency, unsettled and needs-review; no misleading all-clear
103
+ based solely on an empty queue or a successful `/health` response.
104
+
105
+ ## Source review: existing coverage and gaps
106
+
107
+ | Component / source | Existing behavior | Required work |
108
+ | --- | --- | --- |
109
+ | User `src/index.mjs` startup | Calls requireCurrentRouting before server.listen; initial Wallet credential failures also exit | Decouple safe listener from business checks and expose authenticated readiness/status. |
110
+ | User `src/invocation-store.mjs` | Whole-document validation, durable IDs and atomic saves; legacy mismatch fences repeats | Add read-only inventory and bounded isolation without weakening begin/update checks; choose storage evolution explicitly. |
111
+ | User `src/invocation-result.mjs` | Independently persisted verified results; binding checks | Keep output status distinct from money; inspect cached-result conflicts without erasing records. |
112
+ | User `src/index.mjs` invocation path | Reads original Order on active recovery; saves result before HTTP success; no background reconciliation | Add independent read-only scheduler and serialize observations with invocation writes. |
113
+ | User `src/order-closure.mjs` | Fences cancellation/refund/closure; does not treat Released as result availability | Define terminal financial classification for background work; preserve valid cached output. Review Released-without-result continuation explicitly. |
114
+ | Wallet `src/ipc.ts`, `src/settlement-http.ts` | Bounded authenticated Order reads; signing requires unlock | Reuse current authority; expose waiting-for-unlock clearly. No generic signing or new secrets. |
115
+ | Settlement `src/agentpay-order-preparation-store.mjs` | Buyer-scoped Order projection, deadlines, closure/finalization and delivery evidence | Verify existing projection covers legacy/terminal reads. Read-by-orderRequestId and old-Policy access are gaps to assess, not assumed supported or newly authorized endpoints. |
116
+ | User lifecycle/status and installer | systemd supervision, lock status, preserved settings; no complete upgrade inventory | Add readiness presentation and preflight before disruptive upgrade actions. Defer update orchestration until this recovery loop is closed. |
117
+
118
+ ## Implementation and acceptance order
119
+
120
+ 1. **Safe startup and local inventory.** Separate liveness/readiness, retain replay
121
+ fences, classify legacy/corrupt/current records and dependency failures. Test
122
+ the actual process starts with a valid secure listener despite old history;
123
+ affected/unknown-scope paid calls are fenced and state bytes remain unchanged.
124
+ 2. **Read-only Order reconciliation.** Use formal authenticated reads, independent
125
+ financial/result observations, durable writes, bounded retries and concurrency.
126
+ Test all matrix branches including absent Order ID, wrong identity, locked Wallet,
127
+ maintenance, incomplete funding, terminal state and conflicting cache. Any shared
128
+ API/storage change requires consumer review before implementation.
129
+ 3. **Recovery and upgrade handoff.** Present actionable status in `./run status`
130
+ and install/setup; verify restart during scans/writes, race with active calls,
131
+ repeated restarts and no duplicate payment. Preserve known request IDs through
132
+ any approved legacy handling. Use maintained fixtures with at least two business
133
+ payloads and official connectivity material only.
134
+ 4. **Participant acceptance.** Re-read the supplied desktop record, reconcile with
135
+ matching authority, and verify Runtime stays running, old request cannot trigger
136
+ a new purchase, and Wallet lock/unlock does not restart Runtime. Additional paid
137
+ acceptance needs explicit scope; do not rerun connectivity purchase automatically.
138
+
139
+ Each loop gets focused tests and evidence before the next. Mock tests do not prove
140
+ real process restart, chain settlement or participant usability. `./run update`
141
+ remains a subsequent design discussion, not part of this implementation approval.
@@ -0,0 +1,93 @@
1
+ # Skill glue and shared input/output persistence
2
+
3
+ Implemented design reference. Current release/participant gates are tracked in
4
+ [TODO](../TODO.md); this document is not new deployment or payment authorization.
5
+
6
+ ## Responsibilities
7
+
8
+ The editable Skill is glue: it validates application input, explicitly identifies
9
+ input/output files and adapts application data to its Provider interface. The
10
+ installed User client owns common persistence and recovery. Runtime continues to
11
+ own the existing bounded payment, service authorization and delivery verification
12
+ path. This work does not move those operations into arbitrary Skill callbacks.
13
+
14
+ Shared caching does not impose a common Provider business payload or result
15
+ format. Input remains supported bounded JSON, including arrays and nested data;
16
+ it is not necessarily text. Binary data belongs in separate files, not an enlarged
17
+ JSON/base64 payload. Only hashes and existing required metadata reach Settlement;
18
+ private content remains local or travels to the selected Provider.
19
+
20
+ ## Invocation lifecycle
21
+
22
+ 1. Validate input and select/preserve the original request ID. Persist explicit
23
+ file declarations and preparation state before copying files or submitting a
24
+ paid invocation. An incomplete snapshot cannot be mistaken for a file-free call.
25
+ 2. Save JSON using the existing checkpoint mechanism. Snapshot only files the
26
+ Skill explicitly declares; ordinary strings, paths and URLs are not instructions
27
+ to read or fetch. Record a stable file key, size and content digest. Write files
28
+ durably before marking the complete input snapshot ready.
29
+ 3. Application adaptation consumes the saved copies, not mutable original paths.
30
+ Preserve the exact final business request used for its existing request hash.
31
+ Provider-specific upload/reference construction must not be silently invented
32
+ by the common client. A changed or expired upload reference is not permission
33
+ to change an already submitted business request or create another Order.
34
+ 4. Continue through the existing Runtime payment/invocation path. Before the first
35
+ network submission, durably record that submission may occur; a crash or missing
36
+ local Order ID is not proof of non-payment.
37
+ 5. Retain the existing verified structured-result persistence. A Skill explicitly
38
+ selects output files for the existing Order-scoped cache. Cache/download failure
39
+ is distinct from paid service failure: retain the verified result and retry
40
+ caching only, without invoking the paid service again or confirming receipt.
41
+ 6. Resume by original request identity and saved inputs. A valid saved result can
42
+ be read without requiring its original input files to remain available. A resume
43
+ that still needs input bytes must stop if their snapshot is missing or corrupt.
44
+
45
+ Inputs are request-scoped because an Order may not exist yet. Outputs keep their
46
+ existing Order/evidence scope. Do not invent Order IDs for input caching or change
47
+ delivery hash rules to match cache digests. Runtime URLs are connection locations;
48
+ port changes do not create new request or file identities. The separate
49
+ [address recovery plan](runtime-address-recovery.md) still requires atomic
50
+ existing-only continuation when recovering potentially submitted requests.
51
+
52
+ ## Retry and storage boundaries
53
+
54
+ - Repeating a matching invocation selects its existing snapshot before reading
55
+ mutable sources. An edited/deleted original file does not replace saved bytes.
56
+ Deliberately using new input remains an explicit new request; `--force` retains
57
+ its existing additional-purchase meaning and never bypasses Policy limits.
58
+ - A missing snapshot after possible submission is a recovery problem, not a reason
59
+ to reconstruct from changed files. Legacy JSON-only requests remain JSON-only;
60
+ never infer missing file declarations from historical strings.
61
+ - Use bounded streaming, private local storage, atomic manifests and the existing
62
+ portable locking approach where appropriate. Do not introduce Linux-only process
63
+ identity checks or another lock protocol just for this feature.
64
+ - Reuse download validation for explicitly declared URL sources; do not assume
65
+ HTTPS-only Providers. Do not forward Wallet, Runtime or platform credentials to
66
+ file hosts. Do not follow symlinks or automatically inspect unrelated local files.
67
+ - Input and output usage must both be visible and bounded. Reusing numeric defaults
68
+ does not establish a shared quota unless accounting actually includes both stores.
69
+ Final limits and CLI presentation must be documented with implementation.
70
+ - Never automatically evict inputs needed by unresolved requests. Explicit deletion
71
+ must explain loss of local recovery, retain request/digest history, and prevent
72
+ future retries from silently substituting fresh input. Cache cleanup is not Order
73
+ cancellation. Existing uninstall confirmation covers deletion of local data.
74
+
75
+ ## Implementation sequence and acceptance
76
+
77
+ The user changed the sequence to **cache foundation first**. The detailed
78
+ [local cache design](local-cache-foundation.md) owns storage and management.
79
+
80
+ 1. Review existing storage; specify shared layout, formats, quotas, crash states,
81
+ cleanup and management. No payment/Skill integration in this loop.
82
+ 2. Implement the shared file store and management commands; reuse existing output
83
+ capabilities instead of running separate input/output storage engines.
84
+ 3. Verify the foundation with maintained arbitrary-byte fixtures, large streams,
85
+ concurrent operations, disk failures, process interruption and cleanup races.
86
+ 4. Attach input snapshots and existing verified results to request recovery;
87
+ implement address-independent original-record selection and atomic existing-only
88
+ continuation. Missing history must never create replacement purchases.
89
+ 5. Update editable templates and common Skill-client hooks, then verify two business
90
+ payloads through the same Runtime. Output-download retries must not repeat paid
91
+ execution. Participant deployment follows review and controlled verification.
92
+
93
+ No services, policies, stored purchases or public APIs are changed by this plan.
@@ -0,0 +1,23 @@
1
+ # Wallet identity and Policy history
2
+
3
+ Market display identity is network + Module + Safe + execution address (delegate).
4
+ The nickname belongs to that identity. Several individually verified Policies may
5
+ be attached, but each remains the access boundary for its own Orders. Same-key
6
+ copies with the same tuple are one Wallet, not separately verified machines.
7
+
8
+ User keeps one active local spending Policy and preserves original request scopes.
9
+ `./run market connect` proves the current Policy; renewal can continue connection
10
+ to the same Wallet. Failure to connect does not undo a successful on-chain renewal
11
+ or authorize recreating a Policy. Connection receipts are local metadata, not proof
12
+ of live website access.
13
+
14
+ Spending expiry, revocation and Module disablement stop the applicable new payments.
15
+ Original Order reads/support use their original verified scope and Order-specific
16
+ rules/deadlines; retaining history does not grant a different key access. Never
17
+ merge by Safe or nickname alone. Historical read verification does not change the
18
+ active binding or authorize a new purchase.
19
+
20
+ Use [Market connection](../runbooks/market-connection.md), [renewal](../runbooks/policy-renewal.md)
21
+ and [backup/restore](../runbooks/wallet-identity.md) for current user procedures.
22
+ Account grouping is not a revocation mechanism: consult
23
+ [emergency stop](../runbooks/emergency-payment-stop.md) for a compromised key.