settld 0.1.5 → 0.2.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 (82) hide show
  1. package/README.md +32 -0
  2. package/SETTLD_VERSION +1 -1
  3. package/bin/settld.js +58 -0
  4. package/docs/CIRCLE_SANDBOX_E2E.md +12 -0
  5. package/docs/QUICKSTART_MCP.md +41 -1
  6. package/docs/QUICKSTART_MCP_HOSTS.md +156 -89
  7. package/docs/QUICKSTART_POLICY_PACKS.md +65 -0
  8. package/docs/QUICKSTART_PROFILES.md +198 -0
  9. package/docs/README.md +18 -0
  10. package/docs/RELEASE_CHECKLIST.md +26 -0
  11. package/docs/RELEASING.md +1 -0
  12. package/docs/SLO.md +62 -1
  13. package/docs/SUMMARY.md +1 -0
  14. package/docs/gitbook/README.md +13 -1
  15. package/docs/gitbook/quickstart.md +57 -58
  16. package/docs/integrations/README.md +1 -0
  17. package/docs/integrations/openclaw/PUBLIC_QUICKSTART.md +95 -0
  18. package/docs/ops/DISPUTE_FINANCE_RECONCILIATION_PACKET.md +56 -0
  19. package/docs/ops/KERNEL_V0_SHIP_GATE.md +3 -1
  20. package/docs/ops/MCP_COMPATIBILITY_MATRIX.md +8 -6
  21. package/docs/ops/PRODUCTION_DEPLOYMENT_CHECKLIST.md +46 -9
  22. package/docs/ops/TRUST_CONFIG_WIZARD.md +37 -24
  23. package/docs/plans/2026-02-20-trust-os-v1-jira-backlog.md +348 -0
  24. package/docs/plans/2026-02-21-agent-economic-actor-operating-model.md +169 -0
  25. package/docs/plans/2026-02-21-trust-os-v1-strategy.md +241 -0
  26. package/docs/research/2026-02-21-agent-spend-host-landscape.md +57 -0
  27. package/docs/spec/ArbitrationOutcomeMapping.v1.md +62 -0
  28. package/docs/spec/DisputeCaseLifecycle.v1.md +51 -0
  29. package/docs/spec/OperatorAction.v1.md +90 -0
  30. package/docs/spec/PolicyDecision.v1.md +83 -0
  31. package/docs/spec/README.md +5 -0
  32. package/docs/spec/SettlementDecisionRecord.v2.md +2 -0
  33. package/docs/spec/schemas/OperatorAction.v1.schema.json +113 -0
  34. package/docs/spec/schemas/PolicyDecision.v1.schema.json +74 -0
  35. package/docs/spec/schemas/SettlementDecisionRecord.v2.schema.json +1 -0
  36. package/docs/spec/x402-error-codes.v1.txt +14 -0
  37. package/package.json +14 -1
  38. package/scripts/ci/build-launch-cutover-packet.mjs +177 -21
  39. package/scripts/ci/run-10x-throughput-drill.mjs +76 -4
  40. package/scripts/ci/run-10x-throughput-incident-rehearsal.mjs +49 -6
  41. package/scripts/ci/run-mcp-host-cert-matrix.mjs +201 -0
  42. package/scripts/ci/run-mcp-host-smoke.mjs +203 -5
  43. package/scripts/ci/run-offline-verification-parity-gate.mjs +762 -0
  44. package/scripts/ci/run-onboarding-host-success-gate.mjs +516 -0
  45. package/scripts/ci/run-onboarding-policy-slo-gate.mjs +537 -0
  46. package/scripts/ci/run-production-cutover-gate.mjs +540 -0
  47. package/scripts/ci/run-public-openclaw-npx-smoke.mjs +148 -0
  48. package/scripts/ci/run-release-promotion-guard.mjs +756 -0
  49. package/scripts/doctor/mcp-host.mjs +120 -0
  50. package/scripts/mcp/settld-mcp-server.mjs +330 -20
  51. package/scripts/ops/dispute-finance-reconciliation-packet.mjs +313 -0
  52. package/scripts/ops/hosted-baseline-evidence.mjs +286 -77
  53. package/scripts/ops/run-x402-hitl-smoke.mjs +607 -0
  54. package/scripts/policy/cli.mjs +600 -0
  55. package/scripts/profile/cli.mjs +1324 -0
  56. package/scripts/register-entity-secret.mjs +102 -0
  57. package/scripts/setup/circle-bootstrap.mjs +310 -0
  58. package/scripts/setup/host-config.mjs +617 -0
  59. package/scripts/setup/onboard.mjs +1337 -0
  60. package/scripts/setup/openclaw-onboard.mjs +423 -0
  61. package/scripts/setup/wizard.mjs +986 -0
  62. package/scripts/slo/check.mjs +123 -62
  63. package/scripts/spec/generate-protocol-vectors.mjs +88 -0
  64. package/scripts/test/run.sh +23 -9
  65. package/services/x402-gateway/src/server.js +147 -36
  66. package/src/api/app.js +2345 -267
  67. package/src/api/middleware/trust-kernel.js +114 -0
  68. package/src/api/openapi.js +598 -3
  69. package/src/api/persistence.js +184 -0
  70. package/src/api/store.js +277 -0
  71. package/src/core/agent-wallets.js +134 -0
  72. package/src/core/event-policy.js +21 -2
  73. package/src/core/operator-action.js +303 -0
  74. package/src/core/policy-decision.js +322 -0
  75. package/src/core/policy-packs.js +207 -0
  76. package/src/core/profile-fingerprint.js +27 -0
  77. package/src/core/profile-simulation-reasons.js +84 -0
  78. package/src/core/profile-templates.js +242 -0
  79. package/src/core/settlement-kernel.js +27 -1
  80. package/src/core/wallet-assignment-resolver.js +129 -0
  81. package/src/core/wallet-provider-bootstrap.js +365 -0
  82. package/src/db/store-pg.js +631 -0
@@ -0,0 +1,169 @@
1
+ # Agent Economic Actor Operating Model (v1)
2
+
3
+ Date: 2026-02-21
4
+ Owner: Product + Platform + Risk
5
+
6
+ ## Why this model
7
+
8
+ Goal: let agents spend and act with much more autonomy while keeping actions bounded, auditable, and reversible.
9
+
10
+ Settld does this by treating autonomy as a controlled envelope:
11
+
12
+ 1. identity + delegation,
13
+ 2. policy-bound authorization,
14
+ 3. deterministic evidence + receipts,
15
+ 4. dispute/reversal recourse.
16
+
17
+ ## How customers are served
18
+
19
+ Primary user groups:
20
+
21
+ 1. Agent builders: quick setup, policy profiles, paid tool calls, receipts.
22
+ 2. Platform/runtime teams: central controls across hosts, no-bypass enforcement.
23
+ 3. Ops/finance/risk/compliance: audit exports, dispute workflows, deterministic reconciliation.
24
+ 4. Design partners: staged rollout with fail-closed release gates.
25
+
26
+ ## Deployment modes
27
+
28
+ ### Mode A: Hosted control plane + managed wallet (default)
29
+ - `settld setup --wallet-mode managed --wallet-bootstrap remote`
30
+ - Fastest time-to-first-paid-call, least wallet ops burden.
31
+
32
+ ### Mode B: Hosted control plane + BYO wallet
33
+ - `settld setup --wallet-mode byo`
34
+ - Customer controls custody while Settld enforces trust contract.
35
+
36
+ ### Mode C: Hosted/self-hosted control plane + no wallet rails
37
+ - `settld setup --wallet-mode none`
38
+ - Non-paid trust control path (proof/audit/dispute readiness before spend).
39
+
40
+ Reference flows:
41
+ - `docs/QUICKSTART_MCP_HOSTS.md`
42
+ - `scripts/setup/onboard.mjs`
43
+ - `services/magic-link/src/server.js`
44
+
45
+ ## Should Settld manage agent wallets?
46
+
47
+ Answer: optional and policy-dependent.
48
+
49
+ 1. Managed mode: Settld control plane bootstraps wallet provider config and returns runtime env.
50
+ 2. BYO mode: customer supplies wallet env/refs; Settld still enforces policy and receipts.
51
+ 3. No-wallet mode: only trust/evidence control path is active.
52
+
53
+ Wallet bootstrap and runtime bootstrap endpoints:
54
+ - `POST /v1/tenants/{tenantId}/onboarding/wallet-bootstrap`
55
+ - `POST /v1/tenants/{tenantId}/onboarding/runtime-bootstrap`
56
+ - `POST /v1/tenants/{tenantId}/onboarding/runtime-bootstrap/smoke-test`
57
+
58
+ ## Should every agent have identity?
59
+
60
+ Yes.
61
+
62
+ Identity model (already defined in spec surface):
63
+
64
+ 1. `AgentPassport.v1`: principal binding + active key anchors + delegation root + policy envelope.
65
+ 2. `DelegationGrant.v1`: bounded authority transfer (scope, spend limits, depth, revocation).
66
+ 3. `ExecutionIntent.v1`: canonical request/risk/spend/policy binding precondition.
67
+
68
+ Spec anchors:
69
+ - `docs/spec/AgentPassport.v1.md`
70
+ - `docs/spec/DelegationGrant.v1.md`
71
+ - `docs/spec/ExecutionIntent.v1.md`
72
+
73
+ Runtime anchors:
74
+ - `src/api/app.js` (passport validation, delegation lineage, wallet policy enforcement)
75
+ - `src/core/settlement-kernel.js`
76
+
77
+ ## How wallet assignment should work
78
+
79
+ Do not default to “1 wallet per agent.”
80
+ Default to deterministic assignment:
81
+
82
+ `tenant + environment + profile + risk tier + delegation depth -> sponsorWalletRef + policyRef + policyVersion`
83
+
84
+ Recommended rules:
85
+
86
+ 1. High-risk financial agents: dedicated sponsor wallet.
87
+ 2. Low-risk read/compute agents: pooled sponsor wallet with strict per-call and daily limits.
88
+ 3. Delegated child agents: inherited wallet policy with depth checks and tighter caps.
89
+ 4. Cross-team isolation: separate wallet by business unit + policy pack.
90
+
91
+ ## How agents get funded
92
+
93
+ Funding control should be policy-driven, not ad hoc:
94
+
95
+ 1. Prefund sponsor wallet.
96
+ 2. Enforce per-call, per-day, and cumulative limits.
97
+ 3. Add threshold-based top-up automation.
98
+ 4. Lock escrow before authorization where required.
99
+ 5. Require deterministic reserve and rollback semantics on failure.
100
+
101
+ Current code anchors:
102
+ - `src/api/app.js` (`computeX402DailyAuthorizedExposureCents`, wallet policy checks, reserve + rollback)
103
+ - `src/core/money-rail-adapters.js`
104
+ - `src/core/x402-gate.js`
105
+
106
+ ## Setup flow (operator runbook)
107
+
108
+ 1. Tenant bootstrap (runtime key material and tenant setup).
109
+ 2. Wallet bootstrap (`managed` local/remote or `byo` env resolution).
110
+ 3. Runtime bootstrap (MCP env + host config).
111
+ 4. Profile apply (`settld profile ...`) and passport generation.
112
+ 5. Host smoke test and first paid call run.
113
+ 6. Conformance matrix + release gate checks.
114
+
115
+ Command anchors:
116
+ - `settld setup`
117
+ - `settld profile init|validate|simulate|apply`
118
+ - `npm run mcp:probe`
119
+ - `settld doctor`
120
+
121
+ ## What this enables agents to do
122
+
123
+ As autonomy tiers increase, agents can do more actions safely:
124
+
125
+ ### Tier 0 (Observe)
126
+ - Read-only calls, no spend.
127
+
128
+ ### Tier 1 (Bounded spend)
129
+ - Paid tool calls under strict caps and allowlists.
130
+
131
+ ### Tier 2 (Delegated execution)
132
+ - Multi-step workflows with delegation lineage and challenge windows.
133
+
134
+ ### Tier 3 (Conditional autonomy)
135
+ - Challenge/escalate fallback and operator overrides.
136
+
137
+ ### Tier 4 (Programmatic economic actor)
138
+ - Cross-tool/cross-agent spend orchestration with deterministic receipts, disputes, and reversals.
139
+
140
+ ## Hard controls (must stay fail-closed)
141
+
142
+ 1. No policy bypass across MCP stdio, MCP HTTP bridge, and gateway paths.
143
+ 2. Authority boundaries: who can sign/revoke/pause/kill-switch.
144
+ 3. Adapter invariant conformance for every rail lane.
145
+ 4. Determinism soak checks for repeat export/verification.
146
+ 5. Onboarding SLO gates for real operator usability.
147
+
148
+ ## What still must be built
149
+
150
+ 1. No-bypass negative matrix as release blocker.
151
+ 2. Authority boundary and rollback drill automation.
152
+ 3. Shared adapter invariant gate for all rails.
153
+ 4. Deterministic repeat-run soak gate.
154
+ 5. Onboarding SLO CI gate tied to runtime metrics.
155
+
156
+ Execution artifacts:
157
+ - `planning/jira/trust-os-v1-gap-closure-backlog.json`
158
+ - `planning/jira/trust-os-v1-gap-closure-tickets.csv`
159
+ - `planning/jira/agent-economic-actor-backlog.json`
160
+
161
+ ## External research references
162
+
163
+ - Coinbase AgentKit docs: [https://docs.cdp.coinbase.com/agent-kit/docs/welcome](https://docs.cdp.coinbase.com/agent-kit/docs/welcome)
164
+ - Coinbase Agentic Wallet docs: [https://docs.cdp.coinbase.com/agentic-wallet/welcome](https://docs.cdp.coinbase.com/agentic-wallet/welcome)
165
+ - Circle docs: [https://developers.circle.com/](https://developers.circle.com/)
166
+ - Privy docs: [https://docs.privy.io/](https://docs.privy.io/)
167
+ - SPIFFE overview: [https://spiffe.io/docs/latest/spiffe-about/overview/](https://spiffe.io/docs/latest/spiffe-about/overview/)
168
+ - EIP-4337: [https://eips.ethereum.org/EIPS/eip-4337](https://eips.ethereum.org/EIPS/eip-4337)
169
+
@@ -0,0 +1,241 @@
1
+ # Trust OS v1 Strategy
2
+
3
+ Date: 2026-02-21
4
+ Owner: Settld Product + Platform
5
+
6
+ ## Positioning
7
+
8
+ Settld is a Trust OS for autonomous agent actions.
9
+ It is not a wallet replacement and not a prompt-only guardrail product.
10
+
11
+ Settld is the control plane that makes agent spending and execution:
12
+
13
+ 1. enforceable,
14
+ 2. auditable,
15
+ 3. reversible when required,
16
+ 4. portable across hosts and payment rails.
17
+
18
+ ## Core Objective
19
+
20
+ Become the default trust and control layer for paid and high-risk autonomous actions.
21
+
22
+ Any agent integration should be able to:
23
+
24
+ 1. act with bounded authority,
25
+ 2. prove what happened,
26
+ 3. emit deterministic receipts,
27
+ 4. resolve disputes and apply reversals safely,
28
+ 5. pass audit/compliance scrutiny,
29
+ 6. plug into real operations workflows.
30
+
31
+ ## Product Direction (Trust OS v1)
32
+
33
+ Current release focus: terminal-first onboarding + MCP host integration, with deterministic trust guarantees.
34
+
35
+ ### Pillar 1: Policy Runtime Enforcement
36
+
37
+ Guarantee:
38
+ - Paid and high-risk actions are gated by deterministic decisions (`allow|challenge|deny|escalate`) and stable reason codes.
39
+
40
+ Implementation anchors:
41
+ - `src/api/app.js`
42
+ - `scripts/mcp/settld-mcp-server.mjs`
43
+ - `src/core/policy.js`
44
+ - `src/core/event-policy.js`
45
+
46
+ Test/gate anchors:
47
+ - `test/mcp-paid-exa-tool.test.js`
48
+ - `test/mcp-paid-weather-tool.test.js`
49
+ - `test/mcp-paid-llm-tool.test.js`
50
+ - `test/api-e2e-x402-authorize-payment.test.js`
51
+
52
+ ### Pillar 2: Execution Binding + Evidence + Receipts
53
+
54
+ Guarantee:
55
+ - Request/authorization/policy/decision bindings are hash-addressable and replay/mutation failures are deterministic.
56
+
57
+ Implementation anchors:
58
+ - `src/core/settlement-kernel.js`
59
+ - `src/core/x402-receipt-verifier.js`
60
+ - `src/core/tool-call-agreement.js`
61
+ - `src/core/tool-call-evidence.js`
62
+ - `docs/spec/SettlementDecisionRecord.v2.md`
63
+
64
+ Test/gate anchors:
65
+ - `test/settlement-kernel.test.js`
66
+ - `test/x402-receipt-verifier.test.js`
67
+ - `test/api-e2e-proof-strict-settlement-gating.test.js`
68
+ - `test/api-e2e-idempotency-settlement-disputes.test.js`
69
+
70
+ ### Pillar 3: Dispute + Reversal Engine
71
+
72
+ Guarantee:
73
+ - Dispute lifecycles and verdict outcomes are deterministic, idempotent, and financially safe.
74
+
75
+ Implementation anchors:
76
+ - `src/api/app.js`
77
+ - `src/core/dispute-open-envelope.js`
78
+ - `src/core/settlement-adjustment.js`
79
+ - `src/core/x402-reversal-command.js`
80
+ - `src/core/x402-provider-refund-decision.js`
81
+
82
+ Test/gate anchors:
83
+ - `test/api-e2e-tool-call-holdback-arbitration.test.js`
84
+ - `test/api-e2e-x402-gate-reversal.test.js`
85
+ - `test/x402-reversal-command.test.js`
86
+ - `test/arbitration-schemas.test.js`
87
+
88
+ ### Pillar 4: Operator Controls
89
+
90
+ Guarantee:
91
+ - Challenged/escalated actions have auditable operator paths; emergency controls are explicit and recorded.
92
+
93
+ Implementation anchors:
94
+ - `src/api/app.js`
95
+ - `src/core/governance.js`
96
+ - `src/core/agent-wallets.js`
97
+ - `src/core/agreement-delegation.js`
98
+
99
+ Test/gate anchors:
100
+ - `test/api-e2e-ops-kernel-workspace.test.js`
101
+ - `test/api-e2e-ops-arbitration-workspace.test.js`
102
+ - `test/api-e2e-ops-arbitration-workspace-browser.test.js`
103
+
104
+ ### Pillar 5: Rail Adapter Hardening
105
+
106
+ Guarantee:
107
+ - Rail adapters are pluggable but cannot bypass trust-kernel enforcement.
108
+
109
+ Implementation anchors:
110
+ - `services/x402-gateway/src/server.js`
111
+ - `src/core/money-rail-adapters.js`
112
+ - `src/core/x402-gate.js`
113
+ - `src/core/wallet-provider-bootstrap.js`
114
+
115
+ Test/gate anchors:
116
+ - `test/x402-gateway-autopay.test.js`
117
+ - `test/api-e2e-x402-provider-signature.test.js`
118
+ - `test/circle-sandbox-batch-settlement-e2e.test.js`
119
+ - `test/provider-conformance-strict-mode.test.js`
120
+
121
+ ### Pillar 6: Profile-Based Policy UX
122
+
123
+ Guarantee:
124
+ - Policy profiles are deterministic, testable, and usable from terminal-first workflows.
125
+
126
+ Implementation anchors:
127
+ - `scripts/profile/cli.mjs`
128
+ - `src/core/profile-templates.js`
129
+ - `src/core/policy-packs.js`
130
+ - `scripts/setup/wizard.mjs`
131
+
132
+ Test/gate anchors:
133
+ - `test/cli-profile.test.js`
134
+ - `test/setup-wizard.test.js`
135
+ - `docs/QUICKSTART_PROFILES.md`
136
+
137
+ ### Pillar 7: Production Gates
138
+
139
+ Guarantee:
140
+ - Release readiness is fail-closed when deterministic trust gates regress.
141
+
142
+ Implementation anchors:
143
+ - `.github/workflows/tests.yml`
144
+ - `.github/workflows/release.yml`
145
+ - `scripts/ci/run-kernel-v0-ship-gate.mjs`
146
+ - `scripts/ci/run-production-cutover-gate.mjs`
147
+
148
+ Test/gate anchors:
149
+ - `test/production-cutover-gate-script.test.js`
150
+ - `test/throughput-gate-script-reporting.test.js`
151
+ - `test/x402-hitl-smoke-script.test.js`
152
+ - `test/mcp-host-cert-matrix-script.test.js`
153
+
154
+ ## Users (Near Term)
155
+
156
+ 1. Developers and agent builders who need safe paid-action execution.
157
+ 2. Platform/runtime teams requiring enforceable controls across hosts.
158
+ 3. Finance, ops, risk, and compliance stakeholders needing deterministic evidence.
159
+ 4. Design partners running real-money agent spend with incident controls.
160
+
161
+ ## Priority Use Cases
162
+
163
+ 1. Agent-to-tool paid calls with deterministic policy envelopes.
164
+ 2. Agent-to-agent settlement with challenge windows and receipts.
165
+ 3. Procurement-style bounded spending with approvals/escalations.
166
+ 4. API/service consumption under budget and compliance constraints.
167
+ 5. Multi-agent workflows with auditable and bounded hop-by-hop execution.
168
+
169
+ ## Explicit Non-Goals
170
+
171
+ 1. Replacing all wallet providers.
172
+ 2. Replacing all agent frameworks.
173
+ 3. Becoming a single-host feature.
174
+ 4. Shipping prompt-only governance without deterministic settlement controls.
175
+
176
+ ## Roadmap (Now -> Long Term)
177
+
178
+ ### Phase 1: Production Core (Now)
179
+ - Close v1 backend gaps.
180
+ - Complete deterministic gates.
181
+ - Finalize terminal-first host onboarding.
182
+ - Harden evidence artifacts for production review.
183
+
184
+ ### Phase 2: Frictionless Adoption (Next)
185
+ - Default managed wallet path where possible.
186
+ - One-command onboarding for Codex/Claude/Cursor/OpenClaw.
187
+ - Strong first verified receipt path.
188
+ - Better operator reliability workflows.
189
+
190
+ ### Phase 3: Platform Expansion
191
+ - Multiple adapter lanes under one trust contract.
192
+ - Richer profile packs + simulation.
193
+ - Tenant automation and enterprise controls.
194
+
195
+ ### Phase 4: Agentverse Infrastructure
196
+ - Cross-runtime inter-agent trust fabric.
197
+ - Cross-tenant dispute/reputation/attestation primitives.
198
+ - Open standards leadership for machine-native commerce trust.
199
+
200
+ ## Decision Record
201
+
202
+ Chosen approach: trust-kernel-first (policy + evidence + recourse), then rail expansion.
203
+
204
+ Rejected alternatives:
205
+ 1. Rail-first product strategy (faster demo surface but weak durable moat).
206
+ 2. Host-specific product strategy (faster initial distribution but no cross-host trust portability).
207
+
208
+ ## Rollout and Rollback
209
+
210
+ Rollout:
211
+ 1. Gate by deterministic CI artifacts and ship-gate checks.
212
+ 2. Progress environments only when policy/runtime + evidence + reversal checks pass.
213
+ 3. Promote adapter lanes behind conformance and abuse-path coverage.
214
+
215
+ Rollback:
216
+ 1. Fail closed on gate regressions.
217
+ 2. Block release promotion if kernel-v0 ship gate or production cutover gate fails.
218
+ 3. Revert adapter-specific rollout independently from trust-kernel contract.
219
+
220
+ ## Observability Requirements
221
+
222
+ 1. Policy runtime: decision mix + p50/p95 latency.
223
+ 2. Evidence/receipt: deterministic hash drift rate.
224
+ 3. Disputes: open backlog, SLA breaches, reversal completion latency.
225
+ 4. Rails: authorization failure rates, insolvency/reversal events.
226
+ 5. Adoption: time-to-first-verified-receipt, host onboarding success rate.
227
+
228
+ ## Success Criteria
229
+
230
+ Near term:
231
+ 1. Terminal onboarding with minimal off-terminal steps.
232
+ 2. End-to-end paid flow with verified receipt and no policy bypass.
233
+ 3. Deterministic dispute-to-reversal CI path.
234
+ 4. Host compatibility matrix with evidence artifacts.
235
+ 5. Production cutover gates green.
236
+
237
+ Long term:
238
+ 1. Settld is the default trust layer across multiple ecosystems.
239
+ 2. Teams adopt Settld to reduce operational and compliance burden.
240
+ 3. Agent commerce scales without becoming ungovernable.
241
+
@@ -0,0 +1,57 @@
1
+ # Agent Spend Host Landscape (2026-02-21)
2
+
3
+ ## Why this matters
4
+ To get Settld adopted, we need to integrate where autonomous spend is already happening and where users already run agents day-to-day.
5
+
6
+ ## What users are running today
7
+
8
+ ### 1) Coding-agent hosts with MCP support are the default surface
9
+ - Codex exposes MCP server setup in CLI (`codex mcp add ...`) and shared config between CLI + IDE extension.
10
+ - Claude Code has first-class MCP server management (`claude mcp add`, `list`, `get`) and scope controls.
11
+ - Cursor supports MCP in editor + CLI (`cursor-agent mcp ...`) with stdio/SSE/HTTP transports.
12
+
13
+ Implication for Settld:
14
+ - MCP-first distribution is correct.
15
+ - Setup must be one command, host-aware, and idempotent.
16
+
17
+ ### 2) Wallet/payment rails are accelerating and commoditizing
18
+ - Coinbase Agentic Wallet positions CLI/MCP wallet operations with built-in limits and x402 support.
19
+ - Stripe + OpenAI announced Instant Checkout and ACP in ChatGPT (US rollout, Sept 29, 2025).
20
+ - x402 continues to position HTTP-native pay-per-use flows as core agent payment rail.
21
+
22
+ Implication for Settld:
23
+ - We should not position as "just another wallet".
24
+ - Differentiate with policy runtime, deterministic enforcement, dispute/evidence lifecycle, and cross-host operational safety.
25
+
26
+ ### 3) OpenClaw ecosystem is active but noisier/higher risk
27
+ - OpenClaw docs confirm skills-based extension model and local skill install paths.
28
+ - Community skill/marketplaces and wallet wrappers are growing quickly.
29
+ - Security incidents around malicious skills have been reported in ecosystem media.
30
+
31
+ Implication for Settld:
32
+ - Keep OpenClaw as a target host, but treat it as higher-risk environment.
33
+ - Emphasize signed policy packs, deterministic receipts, and strict tool/policy constraints.
34
+
35
+ ## Build priorities derived from this landscape
36
+ 1. Make `settld setup` fully host-native for Codex/Claude/Cursor/OpenClaw.
37
+ 2. Make policy deployment one step from onboarding (starter profile apply + dry-run + live).
38
+ 3. Keep MCP smoke validation built in so users know setup is real immediately.
39
+ 4. Publish security posture for skill-hosted environments (verification, guardrails, audit proofs).
40
+ 5. Avoid wallet-only framing; focus on trust/runtime layer for any wallet/payment rail.
41
+
42
+ ## Confidence notes
43
+ - Official docs/newsroom items are high confidence.
44
+ - Community ecosystem pages indicate direction, but quality varies; use for signal, not sole source of truth.
45
+
46
+ ## Sources
47
+ - OpenAI Docs MCP: https://platform.openai.com/docs/docs-mcp
48
+ - Anthropic Claude Code MCP: https://docs.anthropic.com/en/docs/claude-code/mcp
49
+ - Cursor MCP docs: https://docs.cursor.com/advanced/model-context-protocol
50
+ - Cursor CLI MCP docs: https://docs.cursor.com/cli/mcp
51
+ - Coinbase Agentic Wallet docs: https://docs.cdp.coinbase.com/agentic-wallet/welcome
52
+ - Stripe newsroom (OpenAI Instant Checkout + ACP): https://stripe.com/us/newsroom/news/stripe-openai-instant-checkout
53
+ - x402 docs: https://docs.x402.org/
54
+ - x402 site: https://www.x402.org/
55
+ - OpenClaw skills docs: https://docs.openclaw.ai/skills
56
+ - OpenClaw community directory example: https://www.ruleofclaw.ai/
57
+ - OpenClaw ecosystem incident coverage (secondary source): https://www.tomshardware.com/tech-industry/cyber-security/malicious-moltbot-skill-targets-crypto-users-on-clawhub
@@ -0,0 +1,62 @@
1
+ # ArbitrationOutcomeMapping.v1
2
+
3
+ This document freezes deterministic mapping from dispute/arbitration outcomes to settlement directives in Trust OS v1.
4
+
5
+ ## Purpose
6
+
7
+ Dispute outcomes must produce one unambiguous financial directive so settlement resolution is:
8
+
9
+ - deterministic,
10
+ - replay-safe,
11
+ - auditable with stable evidence traces.
12
+
13
+ ## Outcome to directive mapping
14
+
15
+ Input: `AgentRunSettlement.v1.disputeResolution` + settlement `amountCents`
16
+
17
+ - `outcome=accepted`
18
+ - directive: `status=released`
19
+ - `releaseRatePct=100`
20
+ - `releasedAmountCents=amountCents`
21
+ - `refundedAmountCents=0`
22
+ - `outcome=rejected`
23
+ - directive: `status=refunded`
24
+ - `releaseRatePct=0`
25
+ - `releasedAmountCents=0`
26
+ - `refundedAmountCents=amountCents`
27
+ - `outcome=partial`
28
+ - financial outcome: `reversal`
29
+ - settlement directive: `status=released`
30
+ - requires `releaseRatePct` integer in range `1..99`
31
+ - `releasedAmountCents=floor(amountCents * releaseRatePct / 100)`
32
+ - `refundedAmountCents=amountCents - releasedAmountCents`
33
+ - both released/refunded amounts must be non-zero (true split)
34
+
35
+ ## Validation invariants
36
+
37
+ - `accepted` may include `releaseRatePct` only as `100`.
38
+ - `rejected` may include `releaseRatePct` only as `0`.
39
+ - `partial` must include `releaseRatePct` in `1..99`.
40
+ - `withdrawn|unresolved` must not include `releaseRatePct` and cannot derive settlement directives.
41
+ - `amountCents` must be a positive safe integer when deriving directives.
42
+
43
+ Invalid combinations fail-closed with stable error code `DISPUTE_OUTCOME_DIRECTIVE_INVALID`.
44
+
45
+ ## Resolve request guardrails
46
+
47
+ For `/runs/{runId}/settlement/resolve` when a dispute directive exists:
48
+
49
+ - request `status` may be omitted (derived status is authoritative),
50
+ - explicit `status` must equal derived status,
51
+ - explicit `releaseRatePct`, `releasedAmountCents`, and `refundedAmountCents` must match derived values exactly.
52
+ - if settlement is already resolved and dispute directive is present, dispute status must be `closed`.
53
+
54
+ Status mismatch fails with `DISPUTE_OUTCOME_STATUS_MISMATCH`.
55
+ Directive amount/rate mismatch fails with `DISPUTE_OUTCOME_AMOUNT_MISMATCH`.
56
+ Resolved-settlement directive precondition mismatch fails with `TRANSITION_ILLEGAL`.
57
+
58
+ ## Determinism requirements
59
+
60
+ - identical dispute inputs must generate identical directives across retries.
61
+ - idempotency replay for resolve operations must return the same settlement and decision traces.
62
+ - decision traces should include the resolved `disputeSettlementDirective` for audit.
@@ -0,0 +1,51 @@
1
+ # DisputeCaseLifecycle.v1
2
+
3
+ This document freezes dispute + arbitration lifecycle behavior enforced by Trust OS v1 APIs.
4
+
5
+ ## Run dispute lifecycle (`AgentRunSettlement.v1`)
6
+
7
+ State machine:
8
+
9
+ - `none -> open`
10
+ - `closed -> open`
11
+ - `open -> closed`
12
+
13
+ Invalid transitions fail closed with `TRANSITION_ILLEGAL`.
14
+
15
+ Guard rules:
16
+
17
+ - Dispute open is allowed only before dispute-window expiry (`DISPUTE_WINDOW_EXPIRED` on expiry).
18
+ - `/runs/{runId}/dispute/open` is rejected when settlement is still locked (`status=locked`).
19
+ - Dispute close requires an active open dispute (and matching `disputeId` when provided).
20
+ - Dispute evidence/escalation updates require an active open dispute.
21
+ - Escalation level cannot downgrade an active dispute.
22
+
23
+ ## Arbitration case lifecycle (`ArbitrationCase.v1`)
24
+
25
+ Statuses:
26
+
27
+ - `open`
28
+ - `under_review`
29
+ - `verdict_issued`
30
+ - `closed`
31
+
32
+ Operational transitions:
33
+
34
+ - Case creation (`action=open` or `action=appeal`) creates case in `under_review`.
35
+ - Assignment/evidence paths may advance `open -> under_review`.
36
+ - Verdict is accepted only from `open|under_review`, and sets `verdict_issued`.
37
+ - Close is accepted only from `verdict_issued`, and sets `closed`.
38
+
39
+ Invalid transitions fail closed with `TRANSITION_ILLEGAL`.
40
+
41
+ Guard rules:
42
+
43
+ - Arbitration open requires parent dispute status `open`.
44
+ - Appeal requires parent case in `verdict_issued|closed` and valid parent verdict metadata.
45
+ - Verdict and appeal actions are denied after dispute-window expiry (`DISPUTE_WINDOW_EXPIRED`).
46
+
47
+ ## Determinism requirements
48
+
49
+ - Panel assignment canonicalizes and lexically sorts `panelCandidateAgentIds` before hashing.
50
+ - Candidate reordering must not change `assignmentHash` or chosen arbiter.
51
+ - Transition/window denials emit stable machine codes for replay automation.
@@ -0,0 +1,90 @@
1
+ # OperatorAction.v1
2
+
3
+ `OperatorAction.v1` is the canonical operator-evidence artifact used for high-risk control actions.
4
+
5
+ It captures who acted, which case was affected, what action was taken, and why. The signed form binds this surface to an Ed25519 signature for offline verification.
6
+
7
+ ## Purpose
8
+
9
+ `OperatorAction.v1` enables:
10
+
11
+ - deterministic replay/audit of emergency operator decisions,
12
+ - hash-based tamper detection over a frozen action surface,
13
+ - stable verification codes for schema/key/hash/signature failures.
14
+
15
+ ## Emergency RBAC + dual-control policy
16
+
17
+ For `/ops/emergency/*` actions, `OperatorAction.v1` is evaluated against runtime authorization policy:
18
+
19
+ - Role matrix:
20
+ - `pause|quarantine`: `oncall|ops_admin|incident_commander`
21
+ - `revoke|kill-switch`: `ops_admin|incident_commander`
22
+ - `resume`: follows the strictest targeted control class (`ops_admin|incident_commander` when resuming `revoke|kill-switch`)
23
+ - Dual-control:
24
+ - `revoke|kill-switch` class actions require both `operatorAction` and `secondOperatorAction`.
25
+ - The two approvals must be from distinct `actor.operatorId` and distinct `signature.keyId`.
26
+ - Missing or non-distinct second approvals fail closed.
27
+
28
+ ## Required fields
29
+
30
+ - `schemaVersion` (const: `OperatorAction.v1`)
31
+ - `caseRef`
32
+ - `kind` (`challenge|dispute|escalation`)
33
+ - `caseId`
34
+ - `action` (`APPROVE|REJECT|REQUEST_INFO|OVERRIDE_ALLOW|OVERRIDE_DENY`)
35
+ - `justificationCode` (uppercase machine token)
36
+ - `actor`
37
+ - `operatorId`
38
+ - `actedAt` (ISO 8601 date-time)
39
+
40
+ Optional:
41
+
42
+ - `actionId`
43
+ - `justification`
44
+ - `actor.role` (lowercase token)
45
+ - `actor.tenantId`
46
+ - `actor.sessionId`
47
+ - `actor.metadata`
48
+ - `metadata`
49
+ - `signature`
50
+ - `schemaVersion` (const: `OperatorActionSignature.v1`)
51
+ - `algorithm` (const: `ed25519`)
52
+ - `keyId`
53
+ - `signedAt` (ISO 8601 date-time)
54
+ - `actionHash` (`sha256` hex)
55
+ - `signatureBase64`
56
+
57
+ Optional fields MUST be omitted when absent (not `null`) unless explicitly allowed by schema.
58
+
59
+ ## Canonicalization + hashing
60
+
61
+ `actionHash` is computed over canonical JSON (RFC 8785 / JCS) of the unsigned `OperatorAction.v1` object.
62
+
63
+ Hash algorithm: `sha256` over canonical UTF-8 bytes, lowercase hex output.
64
+
65
+ `actionHash` is carried inside `signature.actionHash` in the signed envelope.
66
+
67
+ ## Signing and verification
68
+
69
+ Signing (`signOperatorActionV1`) attaches a `signature` object and signs `actionHash` using Ed25519.
70
+
71
+ Verification (`verifyOperatorActionV1`) enforces:
72
+
73
+ 1. `action.schemaVersion === OperatorAction.v1`,
74
+ 2. `action.signature.schemaVersion === OperatorActionSignature.v1`,
75
+ 3. `signature.keyId` matches the expected public key id,
76
+ 4. `signature.actionHash` equals recomputed hash,
77
+ 5. Ed25519 signature verification succeeds.
78
+
79
+ Failures return stable codes such as:
80
+
81
+ - `OPERATOR_ACTION_SCHEMA_MISMATCH`
82
+ - `OPERATOR_ACTION_SIGNATURE_SCHEMA_MISMATCH`
83
+ - `OPERATOR_ACTION_KEY_ID_MISMATCH`
84
+ - `OPERATOR_ACTION_HASH_MISMATCH`
85
+ - `OPERATOR_ACTION_SIGNATURE_INVALID`
86
+ - `OPERATOR_ACTION_SCHEMA_INVALID`
87
+
88
+ ## Schema
89
+
90
+ See `docs/spec/schemas/OperatorAction.v1.schema.json`.