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.
- package/README.md +32 -0
- package/SETTLD_VERSION +1 -1
- package/bin/settld.js +58 -0
- package/docs/CIRCLE_SANDBOX_E2E.md +12 -0
- package/docs/QUICKSTART_MCP.md +41 -1
- package/docs/QUICKSTART_MCP_HOSTS.md +156 -89
- package/docs/QUICKSTART_POLICY_PACKS.md +65 -0
- package/docs/QUICKSTART_PROFILES.md +198 -0
- package/docs/README.md +18 -0
- package/docs/RELEASE_CHECKLIST.md +26 -0
- package/docs/RELEASING.md +1 -0
- package/docs/SLO.md +62 -1
- package/docs/SUMMARY.md +1 -0
- package/docs/gitbook/README.md +13 -1
- package/docs/gitbook/quickstart.md +57 -58
- package/docs/integrations/README.md +1 -0
- package/docs/integrations/openclaw/PUBLIC_QUICKSTART.md +95 -0
- package/docs/ops/DISPUTE_FINANCE_RECONCILIATION_PACKET.md +56 -0
- package/docs/ops/KERNEL_V0_SHIP_GATE.md +3 -1
- package/docs/ops/MCP_COMPATIBILITY_MATRIX.md +8 -6
- package/docs/ops/PRODUCTION_DEPLOYMENT_CHECKLIST.md +46 -9
- package/docs/ops/TRUST_CONFIG_WIZARD.md +37 -24
- package/docs/plans/2026-02-20-trust-os-v1-jira-backlog.md +348 -0
- package/docs/plans/2026-02-21-agent-economic-actor-operating-model.md +169 -0
- package/docs/plans/2026-02-21-trust-os-v1-strategy.md +241 -0
- package/docs/research/2026-02-21-agent-spend-host-landscape.md +57 -0
- package/docs/spec/ArbitrationOutcomeMapping.v1.md +62 -0
- package/docs/spec/DisputeCaseLifecycle.v1.md +51 -0
- package/docs/spec/OperatorAction.v1.md +90 -0
- package/docs/spec/PolicyDecision.v1.md +83 -0
- package/docs/spec/README.md +5 -0
- package/docs/spec/SettlementDecisionRecord.v2.md +2 -0
- package/docs/spec/schemas/OperatorAction.v1.schema.json +113 -0
- package/docs/spec/schemas/PolicyDecision.v1.schema.json +74 -0
- package/docs/spec/schemas/SettlementDecisionRecord.v2.schema.json +1 -0
- package/docs/spec/x402-error-codes.v1.txt +14 -0
- package/package.json +14 -1
- package/scripts/ci/build-launch-cutover-packet.mjs +177 -21
- package/scripts/ci/run-10x-throughput-drill.mjs +76 -4
- package/scripts/ci/run-10x-throughput-incident-rehearsal.mjs +49 -6
- package/scripts/ci/run-mcp-host-cert-matrix.mjs +201 -0
- package/scripts/ci/run-mcp-host-smoke.mjs +203 -5
- package/scripts/ci/run-offline-verification-parity-gate.mjs +762 -0
- package/scripts/ci/run-onboarding-host-success-gate.mjs +516 -0
- package/scripts/ci/run-onboarding-policy-slo-gate.mjs +537 -0
- package/scripts/ci/run-production-cutover-gate.mjs +540 -0
- package/scripts/ci/run-public-openclaw-npx-smoke.mjs +148 -0
- package/scripts/ci/run-release-promotion-guard.mjs +756 -0
- package/scripts/doctor/mcp-host.mjs +120 -0
- package/scripts/mcp/settld-mcp-server.mjs +330 -20
- package/scripts/ops/dispute-finance-reconciliation-packet.mjs +313 -0
- package/scripts/ops/hosted-baseline-evidence.mjs +286 -77
- package/scripts/ops/run-x402-hitl-smoke.mjs +607 -0
- package/scripts/policy/cli.mjs +600 -0
- package/scripts/profile/cli.mjs +1324 -0
- package/scripts/register-entity-secret.mjs +102 -0
- package/scripts/setup/circle-bootstrap.mjs +310 -0
- package/scripts/setup/host-config.mjs +617 -0
- package/scripts/setup/onboard.mjs +1337 -0
- package/scripts/setup/openclaw-onboard.mjs +423 -0
- package/scripts/setup/wizard.mjs +986 -0
- package/scripts/slo/check.mjs +123 -62
- package/scripts/spec/generate-protocol-vectors.mjs +88 -0
- package/scripts/test/run.sh +23 -9
- package/services/x402-gateway/src/server.js +147 -36
- package/src/api/app.js +2345 -267
- package/src/api/middleware/trust-kernel.js +114 -0
- package/src/api/openapi.js +598 -3
- package/src/api/persistence.js +184 -0
- package/src/api/store.js +277 -0
- package/src/core/agent-wallets.js +134 -0
- package/src/core/event-policy.js +21 -2
- package/src/core/operator-action.js +303 -0
- package/src/core/policy-decision.js +322 -0
- package/src/core/policy-packs.js +207 -0
- package/src/core/profile-fingerprint.js +27 -0
- package/src/core/profile-simulation-reasons.js +84 -0
- package/src/core/profile-templates.js +242 -0
- package/src/core/settlement-kernel.js +27 -1
- package/src/core/wallet-assignment-resolver.js +129 -0
- package/src/core/wallet-provider-bootstrap.js +365 -0
- package/src/db/store-pg.js +631 -0
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
# Quickstart: Profiles CLI
|
|
2
|
+
|
|
3
|
+
Goal: scaffold, validate, and simulate a policy profile with the Settld CLI.
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
- Node.js 20+
|
|
8
|
+
- Repo checkout with dependencies installed (`npm ci`)
|
|
9
|
+
|
|
10
|
+
## 0) One-command runtime setup (recommended before `profile apply`)
|
|
11
|
+
|
|
12
|
+
Non-interactive setup (manual mode):
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
./bin/settld.js setup --yes --mode manual --host codex --base-url http://127.0.0.1:3000 --tenant-id tenant_default --api-key sk_runtime_apply --profile-id engineering-spend
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
`settld setup` now also emits `SETTLD_PAID_TOOLS_AGENT_PASSPORT` automatically, so paid MCP tools run with policy-bound passport context without manual JSON editing.
|
|
19
|
+
Add `--smoke` if you want setup to run an immediate MCP probe before moving on.
|
|
20
|
+
|
|
21
|
+
Bootstrap mode (same flow, runtime key minted by onboarding endpoint):
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
./bin/settld.js setup --yes --mode bootstrap --host codex --base-url https://api.settld.work --tenant-id tenant_default --bootstrap-api-key mlk_admin_xxx --bootstrap-key-id sk_runtime --bootstrap-scopes runs:read,runs:write --idempotency-key profile_setup_bootstrap_1
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
If you only want runtime env + host wiring (without applying a profile), add:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
--skip-profile-apply
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
To validate payment evidence early, run a paid demo after setup and verify the first exported receipt:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm run demo:mcp-paid-exa
|
|
37
|
+
jq -c 'first' artifacts/mcp-paid-exa/*/x402-receipts.export.jsonl > /tmp/settld-first-receipt.json
|
|
38
|
+
settld x402 receipt verify /tmp/settld-first-receipt.json --format json --json-out /tmp/settld-first-receipt.verify.json
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
To verify MCP wiring immediately during setup, add:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
--smoke
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Single command that loads setup exports and applies a profile:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
eval "$(./bin/settld.js setup --yes --mode manual --host codex --base-url http://127.0.0.1:3000 --tenant-id tenant_default --api-key sk_runtime_apply | grep '^export ')" && ./bin/settld.js profile apply ./profiles/engineering-spend.profile.json --format json
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## 1) List available starter profiles
|
|
54
|
+
|
|
55
|
+
Installed CLI:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
npx settld profile list
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Repo checkout:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
./bin/settld.js profile list
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Example output:
|
|
68
|
+
|
|
69
|
+
```text
|
|
70
|
+
engineering-spend engineering Engineering Spend <profile_fingerprint_sha256>
|
|
71
|
+
procurement procurement Procurement <profile_fingerprint_sha256>
|
|
72
|
+
data-api-buyer data Data API Buyer <profile_fingerprint_sha256>
|
|
73
|
+
support-automation support Support Automation <profile_fingerprint_sha256>
|
|
74
|
+
finance-controls finance Finance Controls <profile_fingerprint_sha256>
|
|
75
|
+
growth-marketing marketing Growth Marketing <profile_fingerprint_sha256>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## 2) Initialize a profile
|
|
79
|
+
|
|
80
|
+
Installed CLI:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
npx settld profile init engineering-spend --out ./profiles/engineering-spend.profile.json
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Repo checkout:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
./bin/settld.js profile init engineering-spend --out ./profiles/engineering-spend.profile.json
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Example output:
|
|
93
|
+
|
|
94
|
+
```text
|
|
95
|
+
ok engineering-spend /home/you/repo/profiles/engineering-spend
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## 3) Validate profile schema + semantics
|
|
99
|
+
|
|
100
|
+
Installed CLI:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
npx settld profile validate ./profiles/engineering-spend.profile.json --format json
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Repo checkout:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
./bin/settld.js profile validate ./profiles/engineering-spend.profile.json --format json
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Example output:
|
|
113
|
+
|
|
114
|
+
```json
|
|
115
|
+
{
|
|
116
|
+
"schemaVersion": "SettldProfileValidationReport.v1",
|
|
117
|
+
"ok": true,
|
|
118
|
+
"profileId": "engineering-spend",
|
|
119
|
+
"profileFingerprintVersion": "SettldProfileFingerprint.v1",
|
|
120
|
+
"profileFingerprint": "<sha256>",
|
|
121
|
+
"errors": [],
|
|
122
|
+
"warnings": []
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## 4) Simulate policy decisions
|
|
127
|
+
|
|
128
|
+
Installed CLI:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
npx settld profile simulate ./profiles/engineering-spend.profile.json --format json
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Repo checkout:
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
./bin/settld.js profile simulate ./profiles/engineering-spend.profile.json --format json
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Example output:
|
|
141
|
+
|
|
142
|
+
```json
|
|
143
|
+
{
|
|
144
|
+
"schemaVersion": "SettldProfileSimulationReport.v1",
|
|
145
|
+
"ok": true,
|
|
146
|
+
"profileId": "engineering-spend",
|
|
147
|
+
"decision": "allow",
|
|
148
|
+
"requiredApprovers": 0,
|
|
149
|
+
"approvalsProvided": 0,
|
|
150
|
+
"selectedApprovalTier": "auto",
|
|
151
|
+
"reasons": [],
|
|
152
|
+
"reasonCodes": [],
|
|
153
|
+
"reasonDetails": [],
|
|
154
|
+
"reasonRegistryVersion": "SettldProfileSimulationReasonRegistry.v1",
|
|
155
|
+
"profileFingerprintVersion": "SettldProfileFingerprint.v1",
|
|
156
|
+
"profileFingerprint": "<sha256>"
|
|
157
|
+
}
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
To simulate with explicit scenario data:
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
./bin/settld.js profile simulate ./profiles/engineering-spend.profile.json --scenario ./test/fixtures/profile/scenario-allow.json --format json
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## 5) Apply profile to runtime
|
|
167
|
+
|
|
168
|
+
Set runtime connection/auth values:
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
export SETTLD_BASE_URL=http://127.0.0.1:3000
|
|
172
|
+
export SETTLD_TENANT_ID=tenant_default
|
|
173
|
+
export SETTLD_API_KEY=sk_runtime_apply
|
|
174
|
+
# optional override:
|
|
175
|
+
export SETTLD_SPONSOR_WALLET_REF=wallet_ops_default
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
Dry-run first (no live writes):
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
./bin/settld.js profile apply ./profiles/engineering-spend.profile.json --dry-run --format json
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
Then execute live apply:
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
./bin/settld.js profile apply ./profiles/engineering-spend.profile.json --format json
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
`profile apply` also accepts runtime-prefixed aliases:
|
|
191
|
+
`SETTLD_RUNTIME_BASE_URL`, `SETTLD_RUNTIME_TENANT_ID`, `SETTLD_RUNTIME_BEARER_TOKEN`.
|
|
192
|
+
|
|
193
|
+
## Common troubleshooting
|
|
194
|
+
|
|
195
|
+
- `unknown profile`: run `settld profile list` and use one of the listed IDs.
|
|
196
|
+
- `validation failed`: fix reported schema/semantic errors, then rerun `profile validate`.
|
|
197
|
+
- `scenario file not found`: pass an existing JSON scenario path to `profile simulate`.
|
|
198
|
+
- `profile apply missing runtime config`: set runtime base URL, tenant ID, bearer token, and wallet ref before running live apply.
|
package/docs/README.md
CHANGED
|
@@ -6,6 +6,7 @@ For curated public docs, start here:
|
|
|
6
6
|
|
|
7
7
|
- [Settld Docs home](./gitbook/README.md)
|
|
8
8
|
- [Quickstart](./gitbook/quickstart.md)
|
|
9
|
+
- [Quickstart: Profiles CLI](./QUICKSTART_PROFILES.md)
|
|
9
10
|
- [Core Primitives](./gitbook/core-primitives.md)
|
|
10
11
|
- [API Reference](./gitbook/api-reference.md)
|
|
11
12
|
- [Conformance](./gitbook/conformance.md)
|
|
@@ -13,3 +14,20 @@ For curated public docs, start here:
|
|
|
13
14
|
- [Guides](./gitbook/guides.md)
|
|
14
15
|
- [Security Model](./gitbook/security-model.md)
|
|
15
16
|
- [FAQ](./gitbook/faq.md)
|
|
17
|
+
|
|
18
|
+
## Fastest onboarding path
|
|
19
|
+
|
|
20
|
+
1. Run `settld setup` (or `./bin/settld.js setup`) with your host, tenant, and API key.
|
|
21
|
+
2. Activate your host and run `npm run mcp:probe`.
|
|
22
|
+
3. Run `npm run demo:mcp-paid-exa`.
|
|
23
|
+
4. Verify the first receipt:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
jq -c 'first' artifacts/mcp-paid-exa/*/x402-receipts.export.jsonl > /tmp/settld-first-receipt.json
|
|
27
|
+
settld x402 receipt verify /tmp/settld-first-receipt.json --format json --json-out /tmp/settld-first-receipt.verify.json
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Reference docs:
|
|
31
|
+
|
|
32
|
+
- `docs/QUICKSTART_MCP_HOSTS.md`
|
|
33
|
+
- `docs/QUICKSTART_MCP.md`
|
|
@@ -5,6 +5,14 @@ This checklist is the “no surprises” gate for shipping Settld as a product (
|
|
|
5
5
|
## Preconditions
|
|
6
6
|
|
|
7
7
|
- `npm test` is green on main.
|
|
8
|
+
- Main-branch release gate jobs are green in `.github/workflows/tests.yml` for the release commit:
|
|
9
|
+
- `noo_44_47_48_regressions` (NOO-44/47/48 fail-closed regression lane)
|
|
10
|
+
- `kernel_v0_ship_gate`
|
|
11
|
+
- `production_cutover_gate`
|
|
12
|
+
- `offline_verification_parity_gate` (NOO-50)
|
|
13
|
+
- `onboarding_host_success_gate`
|
|
14
|
+
- Public package smoke for OpenClaw onboarding is green:
|
|
15
|
+
- `npm run test:ci:public-openclaw-npx-smoke`
|
|
8
16
|
- `CHANGELOG.md` is updated and accurate.
|
|
9
17
|
- Protocol v1 freeze gate is satisfied (no accidental v1 schema/vector drift).
|
|
10
18
|
- Minimum production topology is defined for the target environment:
|
|
@@ -16,6 +24,9 @@ This checklist is the “no surprises” gate for shipping Settld as a product (
|
|
|
16
24
|
- `SETTLD_STAGING_OPS_TOKEN`
|
|
17
25
|
- npm publish secret is configured for `.github/workflows/release.yml` if you want direct registry distribution:
|
|
18
26
|
- `NPM_TOKEN`
|
|
27
|
+
- Optional launch cutover packet signing inputs are configured for `.github/workflows/go-live-gate.yml` if signed packets are required:
|
|
28
|
+
- secret: `LAUNCH_CUTOVER_PACKET_SIGNING_PRIVATE_KEY_PEM`
|
|
29
|
+
- variable: `LAUNCH_CUTOVER_PACKET_SIGNATURE_KEY_ID`
|
|
19
30
|
- PyPI Trusted Publisher is configured for `.github/workflows/release.yml` and the `pypi` GitHub environment is allowed.
|
|
20
31
|
- PyPI Trusted Publisher is configured for `.github/workflows/python-pypi.yml` and the `pypi` GitHub environment is allowed (if using the Python-only lane).
|
|
21
32
|
- TestPyPI Trusted Publisher is configured for `.github/workflows/python-testpypi.yml` and the `testpypi` GitHub environment is allowed.
|
|
@@ -31,6 +42,7 @@ For a v1 freeze release, the GitHub Release MUST include:
|
|
|
31
42
|
- `conformance-v1.tar.gz` + `conformance-v1-SHA256SUMS`
|
|
32
43
|
- `settld-audit-packet-v1.zip` + `settld-audit-packet-v1.zip.sha256`
|
|
33
44
|
- `release_index_v1.json` + `release_index_v1.sig` (signed release manifest)
|
|
45
|
+
- `release-promotion-guard.json` (NOO-65 promotion guard report)
|
|
34
46
|
|
|
35
47
|
Release-gate evidence should also include:
|
|
36
48
|
|
|
@@ -47,6 +59,11 @@ Release-gate evidence should also include:
|
|
|
47
59
|
- `artifacts/throughput/10x-drill-summary.json`
|
|
48
60
|
- `artifacts/gates/s13-go-live-gate.json`
|
|
49
61
|
- `artifacts/gates/s13-launch-cutover-packet.json`
|
|
62
|
+
- when signing is configured, packet includes `signature` with `schemaVersion=LaunchCutoverPacketSignature.v1`
|
|
63
|
+
- `artifacts/gates/production-cutover-gate.json`
|
|
64
|
+
- `artifacts/gates/offline-verification-parity-gate.json` (NOO-50)
|
|
65
|
+
- `artifacts/gates/onboarding-host-success-gate.json`
|
|
66
|
+
- `artifacts/gates/release-promotion-guard.json` (NOO-65)
|
|
50
67
|
|
|
51
68
|
See `docs/spec/SUPPLY_CHAIN.md` for the release-channel threat model and verification posture.
|
|
52
69
|
|
|
@@ -145,8 +162,17 @@ Required gate reports:
|
|
|
145
162
|
|
|
146
163
|
- `artifacts/throughput/10x-drill-summary.json`
|
|
147
164
|
- `artifacts/throughput/10x-incident-rehearsal-summary.json`
|
|
165
|
+
- `artifacts/gates/production-cutover-gate.json`
|
|
148
166
|
- `artifacts/gates/s13-go-live-gate.json`
|
|
149
167
|
- `artifacts/gates/s13-launch-cutover-packet.json`
|
|
168
|
+
- Live deploy readiness run (manual workflow): `artifacts/gates/production-cutover-gate-prod.json`
|
|
169
|
+
|
|
170
|
+
Promotion guard order (fail-closed):
|
|
171
|
+
|
|
172
|
+
1. NOO-50 parity gate report is generated on main (`artifacts/gates/offline-verification-parity-gate.json`).
|
|
173
|
+
2. S13 go-live workflow report set is generated for the same release commit (`s13-go-live-gate.json` + `s13-launch-cutover-packet.json`).
|
|
174
|
+
3. Release workflow binds all required gate artifacts (kernel, production cutover, NOO-50 parity, onboarding host success, S13 go-live, S13 launch packet, hosted baseline evidence) into NOO-65.
|
|
175
|
+
4. Release workflow must emit `artifacts/gates/release-promotion-guard.json` with `verdict.ok=true` before artifact publish jobs execute.
|
|
150
176
|
|
|
151
177
|
Related runbooks:
|
|
152
178
|
|
package/docs/RELEASING.md
CHANGED
|
@@ -20,6 +20,7 @@ See `docs/RELEASE_CHECKLIST.md` for the definitive artifact completeness require
|
|
|
20
20
|
5. Run packaging smoke test:
|
|
21
21
|
- `node scripts/ci/npm-pack-smoke.mjs`
|
|
22
22
|
- `node scripts/ci/cli-pack-smoke.mjs`
|
|
23
|
+
- `node scripts/ci/run-public-openclaw-npx-smoke.mjs`
|
|
23
24
|
- `python3 -m build packages/api-sdk-python --sdist --wheel --outdir /tmp/settld-python-dist-smoke`
|
|
24
25
|
- Optionally generate full release artifacts locally: `npm run release:artifacts`
|
|
25
26
|
6. Create a tag and push it:
|
package/docs/SLO.md
CHANGED
|
@@ -62,9 +62,70 @@ DLQ backlog is an on-call page. Pending backlog at end-of-run implies workers ar
|
|
|
62
62
|
|
|
63
63
|
If the outbox is growing without being drained, the system is not steady-state safe.
|
|
64
64
|
|
|
65
|
+
## SLO-4: Onboarding first-paid-call runtime (host readiness)
|
|
66
|
+
|
|
67
|
+
**Objective**
|
|
68
|
+
|
|
69
|
+
- Across supported hosts in the compatibility matrix, first-paid-call runtime remains within a deterministic p95 bound.
|
|
70
|
+
|
|
71
|
+
**Metric**
|
|
72
|
+
|
|
73
|
+
- `onboarding_first_paid_call_runtime_ms_p95_gauge` (fallbacks supported by gate script: `first_paid_call_runtime_ms_p95_gauge`, `first_paid_call_latency_ms_p95_gauge`)
|
|
74
|
+
|
|
75
|
+
**Threshold**
|
|
76
|
+
|
|
77
|
+
- `p95 <= 2000ms` (default; configurable via `SLO_ONBOARDING_FIRST_PAID_CALL_P95_MAX_MS`)
|
|
78
|
+
|
|
79
|
+
## SLO-5: Policy decision runtime (latency + errors)
|
|
80
|
+
|
|
81
|
+
**Objective**
|
|
82
|
+
|
|
83
|
+
- Policy decision runtime stays fast and low-error on readiness runs.
|
|
84
|
+
|
|
85
|
+
**Metrics**
|
|
86
|
+
|
|
87
|
+
- `policy_decision_latency_ms_p95_gauge` (fallbacks supported by gate script)
|
|
88
|
+
- policy decision totals and error totals (`policy_decisions_total` + `outcome=error`, with supported fallbacks)
|
|
89
|
+
|
|
90
|
+
**Thresholds**
|
|
91
|
+
|
|
92
|
+
- `policy decision p95 <= 250ms` (default; configurable via `SLO_POLICY_DECISION_LATENCY_P95_MAX_MS`)
|
|
93
|
+
- `policy decision error rate <= 1%` (default; configurable via `SLO_POLICY_DECISION_ERROR_RATE_MAX_PCT`)
|
|
94
|
+
|
|
95
|
+
## SLO-6: Host onboarding success rate (clean environment)
|
|
96
|
+
|
|
97
|
+
**Objective**
|
|
98
|
+
|
|
99
|
+
- Supported hosts must pass deterministic `settld setup --preflight-only` onboarding checks at or above a configured success rate under isolated HOME paths.
|
|
100
|
+
|
|
101
|
+
**Metrics**
|
|
102
|
+
|
|
103
|
+
- `onboarding_host_setup_attempts_total_gauge{host=...}`
|
|
104
|
+
- `onboarding_host_setup_success_total_gauge{host=...}`
|
|
105
|
+
- `onboarding_host_setup_failure_total_gauge{host=...}`
|
|
106
|
+
- `onboarding_host_setup_success_rate_pct_gauge{host=...}`
|
|
107
|
+
|
|
108
|
+
**Threshold**
|
|
109
|
+
|
|
110
|
+
- Per-host success rate must be `>= 90%` by default (configurable with `ONBOARDING_HOST_SUCCESS_RATE_MIN_PCT`).
|
|
111
|
+
|
|
112
|
+
**Why**
|
|
113
|
+
|
|
114
|
+
Preflight success under clean homes verifies host bootstrap reliability and catches host-specific config drift before production cutover.
|
|
115
|
+
|
|
65
116
|
## CI enforcement
|
|
66
117
|
|
|
67
118
|
- Script: `scripts/slo/check.mjs`
|
|
68
119
|
- Source of truth: `/metrics` snapshot taken after the smoke lifecycle completes.
|
|
69
120
|
- Thresholds are configurable via env (see script header).
|
|
70
|
-
|
|
121
|
+
- Onboarding/policy readiness gate: `scripts/ci/run-onboarding-policy-slo-gate.mjs`
|
|
122
|
+
- Host matrix input: `artifacts/ops/mcp-host-cert-matrix.json`
|
|
123
|
+
- Output artifact: `artifacts/gates/onboarding-policy-slo-gate.json`
|
|
124
|
+
- Onboarding host success gate: `scripts/ci/run-onboarding-host-success-gate.mjs`
|
|
125
|
+
- Output artifact: `artifacts/gates/onboarding-host-success-gate.json`
|
|
126
|
+
- Metrics output directory: `artifacts/ops/onboarding-host-success/`
|
|
127
|
+
- Deterministic binding: onboarding gates emit `artifactHashScope` + `artifactHash` over canonical report core.
|
|
128
|
+
- Gates are fail-closed when required host checks/metrics are missing or thresholds are breached.
|
|
129
|
+
- CI wiring:
|
|
130
|
+
- `tests / onboarding_policy_slo_gate` generates matrix + metrics snapshot and runs the onboarding gate.
|
|
131
|
+
- `tests / onboarding_host_success_gate` runs clean-home preflight onboarding checks per supported host and emits host metrics artifacts.
|
package/docs/SUMMARY.md
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
- [Settld Documentation](README.md)
|
|
4
4
|
- [Docs Home](gitbook/README.md)
|
|
5
5
|
- [Quickstart](gitbook/quickstart.md)
|
|
6
|
+
- [Quickstart: Profiles CLI](QUICKSTART_PROFILES.md)
|
|
6
7
|
- [Core Primitives](gitbook/core-primitives.md)
|
|
7
8
|
- [API Reference](gitbook/api-reference.md)
|
|
8
9
|
- [Conformance](gitbook/conformance.md)
|
package/docs/gitbook/README.md
CHANGED
|
@@ -10,12 +10,24 @@ Settld gives you a canonical economic loop:
|
|
|
10
10
|
|
|
11
11
|
## Start here
|
|
12
12
|
|
|
13
|
-
- [Quickstart](./quickstart.md) —
|
|
13
|
+
- [Quickstart](./quickstart.md) — one-command onboarding to first verified paid receipt
|
|
14
14
|
- [Core Primitives](./core-primitives.md) — protocol objects and invariants
|
|
15
15
|
- [API Reference](./api-reference.md) — endpoint map and auth model
|
|
16
16
|
- [Conformance](./conformance.md) — machine-checkable correctness gates
|
|
17
17
|
- [Closepacks](./closepacks.md) — offline verification workflow
|
|
18
18
|
|
|
19
|
+
## One-command onboarding
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
settld setup --non-interactive --host codex --base-url http://127.0.0.1:3000 --tenant-id tenant_default --settld-api-key sk_live_xxx.yyy --wallet-mode managed --wallet-bootstrap remote --profile-id engineering-spend --smoke
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Then:
|
|
26
|
+
|
|
27
|
+
1. `npm run mcp:probe -- --call settld.about '{}'`
|
|
28
|
+
2. `npm run demo:mcp-paid-exa`
|
|
29
|
+
3. verify first receipt with `settld x402 receipt verify`
|
|
30
|
+
|
|
19
31
|
## Implementation path
|
|
20
32
|
|
|
21
33
|
1. Run local stack and conformance
|
|
@@ -1,104 +1,103 @@
|
|
|
1
1
|
# Quickstart
|
|
2
2
|
|
|
3
|
-
Get from zero to a verified
|
|
3
|
+
Get from zero to a verified paid agent action in minutes.
|
|
4
4
|
|
|
5
5
|
## Prerequisites
|
|
6
6
|
|
|
7
7
|
- Node.js 20+
|
|
8
|
-
-
|
|
9
|
-
-
|
|
8
|
+
- Settld API URL
|
|
9
|
+
- Tenant ID
|
|
10
|
+
- Tenant API key (`keyId.secret`)
|
|
10
11
|
|
|
11
|
-
##
|
|
12
|
+
## 0) One-command setup
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
Run guided setup:
|
|
14
15
|
|
|
15
16
|
```bash
|
|
16
|
-
|
|
17
|
+
settld setup
|
|
17
18
|
```
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
The guided setup uses arrow-key menus for host/wallet/policy decisions, then asks only the next required fields.
|
|
21
|
+
|
|
22
|
+
Non-interactive example:
|
|
20
23
|
|
|
21
24
|
```bash
|
|
22
|
-
|
|
25
|
+
settld setup --non-interactive \
|
|
26
|
+
--host codex \
|
|
27
|
+
--base-url http://127.0.0.1:3000 \
|
|
28
|
+
--tenant-id tenant_default \
|
|
29
|
+
--settld-api-key sk_live_xxx.yyy \
|
|
30
|
+
--wallet-mode managed \
|
|
31
|
+
--wallet-bootstrap remote \
|
|
32
|
+
--profile-id engineering-spend \
|
|
33
|
+
--smoke \
|
|
34
|
+
--out-env ./.tmp/settld.env
|
|
23
35
|
```
|
|
24
36
|
|
|
25
|
-
|
|
37
|
+
What this does:
|
|
26
38
|
|
|
27
|
-
-
|
|
28
|
-
-
|
|
39
|
+
- configures host MCP wiring
|
|
40
|
+
- sets runtime env and policy passport
|
|
41
|
+
- applies starter profile
|
|
42
|
+
- runs connectivity smoke checks
|
|
29
43
|
|
|
30
|
-
##
|
|
44
|
+
## 1) Activate your host
|
|
31
45
|
|
|
32
|
-
|
|
46
|
+
If you wrote an env file, load it:
|
|
33
47
|
|
|
34
48
|
```bash
|
|
35
|
-
|
|
49
|
+
source ./.tmp/settld.env
|
|
36
50
|
```
|
|
37
51
|
|
|
38
|
-
|
|
52
|
+
Then restart your host app (Codex/Claude/Cursor/OpenClaw) so it reloads MCP config.
|
|
53
|
+
|
|
54
|
+
## 2) Verify MCP connectivity
|
|
39
55
|
|
|
40
56
|
```bash
|
|
41
|
-
|
|
57
|
+
npm run mcp:probe -- --call settld.about '{}'
|
|
42
58
|
```
|
|
43
59
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
## 3) Run kernel conformance
|
|
47
|
-
|
|
48
|
-
Installed CLI:
|
|
60
|
+
Expected outcome:
|
|
49
61
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
```
|
|
62
|
+
- `settld.about` succeeds
|
|
63
|
+
- host can discover `settld.*` tools
|
|
53
64
|
|
|
54
|
-
|
|
65
|
+
## 3) Run first paid call
|
|
55
66
|
|
|
56
67
|
```bash
|
|
57
|
-
|
|
68
|
+
npm run demo:mcp-paid-exa
|
|
58
69
|
```
|
|
59
70
|
|
|
60
|
-
Expected:
|
|
71
|
+
Expected output includes:
|
|
61
72
|
|
|
62
|
-
-
|
|
63
|
-
-
|
|
73
|
+
- `PASS artifactDir=...`
|
|
74
|
+
- `gateId=...`
|
|
75
|
+
- `decisionId=...`
|
|
76
|
+
- `settlementReceiptId=...`
|
|
64
77
|
|
|
65
|
-
## 4)
|
|
66
|
-
|
|
67
|
-
Use an agreement hash from conformance/test output:
|
|
78
|
+
## 4) Verify first receipt (proof packet)
|
|
68
79
|
|
|
69
80
|
```bash
|
|
70
|
-
|
|
71
|
-
|
|
81
|
+
jq -c 'first' <artifactDir>/x402-receipts.export.jsonl > /tmp/settld-first-receipt.json
|
|
82
|
+
settld x402 receipt verify /tmp/settld-first-receipt.json --format json --json-out /tmp/settld-first-receipt.verify.json
|
|
72
83
|
```
|
|
73
84
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
- closepack verify passes
|
|
77
|
-
- JSON verification report produced
|
|
85
|
+
`/tmp/settld-first-receipt.verify.json` is your deterministic verification artifact for audit/compliance.
|
|
78
86
|
|
|
79
|
-
## 5)
|
|
87
|
+
## 5) Optional: policy profile workflows
|
|
80
88
|
|
|
81
89
|
```bash
|
|
82
|
-
|
|
83
|
-
|
|
90
|
+
settld profile list
|
|
91
|
+
settld profile init engineering-spend --out ./profiles/engineering-spend.profile.json
|
|
92
|
+
settld profile validate ./profiles/engineering-spend.profile.json --format json
|
|
93
|
+
settld profile simulate ./profiles/engineering-spend.profile.json --format json
|
|
84
94
|
```
|
|
85
95
|
|
|
86
|
-
Expected: replay comparison fields indicate consistency/match.
|
|
87
|
-
|
|
88
96
|
## Troubleshooting
|
|
89
97
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
Use Node 20+.
|
|
97
|
-
|
|
98
|
-
### Ops token permission error
|
|
99
|
-
|
|
100
|
-
Use token with at least `ops_read` scope.
|
|
101
|
-
|
|
102
|
-
### Port conflicts
|
|
103
|
-
|
|
104
|
-
Stop process on API port (`3000`) or configure alternate local runtime settings.
|
|
98
|
+
- `SETTLD_API_KEY must be a non-empty string`
|
|
99
|
+
- ensure key is present in setup flags or shell env.
|
|
100
|
+
- `BYO wallet mode missing required env keys`
|
|
101
|
+
- provide all required Circle keys in `docs/QUICKSTART_MCP_HOSTS.md`.
|
|
102
|
+
- Host cannot find MCP tools
|
|
103
|
+
- rerun setup, restart host, then rerun `npm run mcp:probe`.
|
|
@@ -4,6 +4,7 @@ Copy/paste adoption templates and guardrails:
|
|
|
4
4
|
|
|
5
5
|
- `github-actions.md` — composite action usage and trust anchor wiring.
|
|
6
6
|
- `github-actions-verify.yml` — pasteable workflow template.
|
|
7
|
+
- `openclaw/PUBLIC_QUICKSTART.md` — public npm onboarding flow for OpenClaw (`npx settld@latest setup`).
|
|
7
8
|
- `openclaw/settld-mcp-skill/SKILL.md` — OpenClaw skill payload for Settld MCP.
|
|
8
9
|
- `openclaw/CLAWHUB_PUBLISH_CHECKLIST.md` — publish + validation checklist for ClawHub.
|
|
9
10
|
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# OpenClaw Public Quickstart (No Repo Clone)
|
|
2
|
+
|
|
3
|
+
Use this when you want a public user to set up Settld from npm in a fresh machine.
|
|
4
|
+
|
|
5
|
+
## 1) Install and onboard OpenClaw
|
|
6
|
+
|
|
7
|
+
Follow OpenClaw docs:
|
|
8
|
+
|
|
9
|
+
- https://docs.openclaw.ai/install/index
|
|
10
|
+
- https://docs.openclaw.ai/start/wizard
|
|
11
|
+
|
|
12
|
+
Then run onboarding:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
openclaw onboard --install-daemon
|
|
16
|
+
openclaw doctor
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
If `openclaw` is not on PATH yet, use the npx fallback:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npx -y openclaw@latest onboard --install-daemon
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## 2) Run Settld setup from npm
|
|
26
|
+
|
|
27
|
+
Interactive path (recommended):
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npx -y settld@latest setup
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Choose:
|
|
34
|
+
|
|
35
|
+
1. `host`: `openclaw`
|
|
36
|
+
2. wallet mode (`managed` recommended first)
|
|
37
|
+
3. wallet bootstrap (`remote` recommended for first setup)
|
|
38
|
+
4. keep preflight + smoke enabled
|
|
39
|
+
5. apply a starter profile (`engineering-spend`)
|
|
40
|
+
|
|
41
|
+
Non-interactive path (automation/support):
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npx -y settld@latest setup \
|
|
45
|
+
--non-interactive \
|
|
46
|
+
--host openclaw \
|
|
47
|
+
--base-url https://api.settld.work \
|
|
48
|
+
--tenant-id tenant_default \
|
|
49
|
+
--settld-api-key 'sk_live_xxx.yyy' \
|
|
50
|
+
--wallet-mode managed \
|
|
51
|
+
--wallet-bootstrap remote \
|
|
52
|
+
--profile-id engineering-spend \
|
|
53
|
+
--smoke
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## 3) Verify OpenClaw + Settld are wired
|
|
57
|
+
|
|
58
|
+
Run:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
openclaw doctor
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Then from OpenClaw chat/test prompt:
|
|
65
|
+
|
|
66
|
+
- `Call settld.about and return JSON.`
|
|
67
|
+
|
|
68
|
+
Expected result: success payload with Settld tool metadata.
|
|
69
|
+
|
|
70
|
+
## 4) Run first paid tool call
|
|
71
|
+
|
|
72
|
+
From OpenClaw prompt:
|
|
73
|
+
|
|
74
|
+
- `Run settld.weather_current_paid for city=Chicago unit=f and include x-settld-* headers in the response.`
|
|
75
|
+
|
|
76
|
+
Expected result:
|
|
77
|
+
|
|
78
|
+
- tool call succeeds
|
|
79
|
+
- response includes policy/decision/settlement headers (`x-settld-*`)
|
|
80
|
+
|
|
81
|
+
## 5) Verify receipt artifact (when available)
|
|
82
|
+
|
|
83
|
+
If you exported a receipt JSON from your Settld environment, verify it offline:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
npx -y settld@latest x402 receipt verify ./receipt.json --format json
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Notes for operators
|
|
90
|
+
|
|
91
|
+
- Public users do not need to clone the Settld repo.
|
|
92
|
+
- Public path is valid only after publishing a package version that includes the current setup flow.
|
|
93
|
+
- For OpenClaw skill packaging and publish flow, see:
|
|
94
|
+
- `docs/integrations/openclaw/settld-mcp-skill/SKILL.md`
|
|
95
|
+
- `docs/integrations/openclaw/CLAWHUB_PUBLISH_CHECKLIST.md`
|