We add execution, discernment, and discipline:
- Redemption adapters — turn a signed reward_spend_voucher into real‑world tickets or payouts via pluggable backends.
- FX peer reputation — score your rollup peers and filter pulls by trust.
- Market‑priced arbitration — rep‑weighted panel selection and auto‑slashing for out‑of‑consensus votes.
✅ Fresh artifacts
- Step 38 wrapper server — Download
SHA‑256:ad4d1c2476e7c3ba6c412e7313b1c073be93a1802503c77e15dca139a7c4c264 - WordPress block (paste‑ready) — Download
Step 38 wraps Step 37 (which wrapped 36→35→34→…→18). All previous endpoints keep working.
What’s new — precisely
1) 🎟️ Redemption adapters (pluggable)
Turn vouchers into outcomes.
Built‑in adapter kinds
http_post— POST the voucher to any HTTP endpoint you control (add headers, e.g., bearer token).tickets_local— mint local “tickets” (defaults to 1 ticket per credit, configurable).payout_demo— queue a payout request to the local audit log (for wiring to a real disburser later).
Endpoints
- List:
GET /redeem/adapters - Add (admin):
# Local tickets: 1 credit → 1 ticket curl -s -X POST 'http://127.0.0.1:8080/admin/redeem/adapter/add?token=ADMIN123&name=tix' \ -H 'Content-Type: application/json' \ -d '{"kind":"tickets_local","credits_per_ticket":1,"unit":"credits"}' # HTTP payout curl -s -X POST 'http://127.0.0.1:8080/admin/redeem/adapter/add?token=ADMIN123&name=pay_http' \ -H 'Content-Type: application/json' \ -d '{"kind":"http_post","url":"https://payments.example/redeem","headers":["Authorization: Bearer XYZ"],"unit":"credits"}' - Remove (admin):
POST /admin/redeem/adapter/remove?token=ADMIN123&name=tix - Redeem:
POST /redeem/voucherwith{"adapter":"tix","voucher":{"body":{...},"signature":{...}}} - Status:
GET /redeem/status?digest=<VOUCHER_DIGEST>
Notes
- Voucher signatures are verified against your pinned settlement/ledger keys (plus your own keyring).
- Idempotent: same voucher digest won’t redeem twice.
- Logs:
audit/redeem/redeemed.jsonl,tickets.jsonl,payout_requests.jsonl.
2) 🔎 FX reputation (peer scoring + filtered pulls)
Score each peer by accept rate × volume weight using your FX pull history.
Endpoints
- Recompute scores (admin):
POST /admin/fx/reputation/roll?token=ADMIN123 - View:
GET /fx/reputation - Pull only from peers above a threshold:
POST /admin/fx/pull?token=ADMIN123&min_score=0.6
Under the hood
- Reads
audit/fx/fx.jsonl(Step‑37 logs) and writesaudit/fx/reputation.json. - Threshold filters your configured peers before pulling/keeping remote rollups.
3) ⚖️ Market‑priced arbitration (rep‑weighted + slashing)
Seat a panel by price × reputation, then penalize clear outliers after an award.
Policy
- File:
audit/disputes/arb/market.policy.json(auto‑created), e.g.:{"alpha": 1.0, "min_rating": 0.0, "min_bond": 0.0}alpha— exponent on reputation weight.min_rating,min_bond— eligibility gates.
Endpoints
- Select winners (rep‑weighted):
curl -s -X POST 'http://127.0.0.1:8080/admin/dispute/market/select?token=ADMIN123&id=<DISPUTE_ID>&m=3&budget=30&mode=score' | jq .Score =(bond/fee) × (rating^alpha)with smoothing; results include per‑winnerrepandwscore. - Auto‑slash after award:
# one-shot slashing (admin) curl -s -X POST 'http://127.0.0.1:8080/admin/dispute/market/auto-slash?token=ADMIN123&id=<DISPUTE_ID>&penalty=1.0' | jq .Or attach to the vote endpoint:curl -s -X POST 'http://127.0.0.1:8080/admin/dispute/vote?id=<DISPUTE_ID>&auto_slash=1&penalty=1.0&token=ADMIN123' \ -H 'Content-Type: application/json' \ -d '{"decision":"release","signature":{"alg":"Ed25519","kid":"KID_A","sig":"<b64url>"}}' | jq . - Arbitrator stats:
- Single:
GET /dispute/arbiters?kid=<KID> - All:
GET /dispute/arbiters
- Single:
Under the hood
- On award, we compute who voted with/against the final decision and update per‑KID stats with Laplace‑smoothed rating.
- Slashing deducts from the bidder’s credits (Step‑37); insufficient balance creates a recorded debt event.
Android / Termux run‑book (Step 38)
python solveforce_phone_thirtyeight.py \
--rollup-peers-file /sdcard/solveforce/rollup.peers.json \
--anchor-quorum-file /sdcard/solveforce/anchor.quorum.json \
--pins-file /sdcard/solveforce/pins.json \
--ledger-quorum-file /sdcard/solveforce/ledger.quorum.json \
--clearing-policy-file /sdcard/solveforce/clearing.policy.json \
--discovery-dod-enable \
--discovery-dod-source https://directory1.example.com/solveforce/peers.json \
--discovery-dod-jwks https://directory1.example.com/jwks.json \
--quorum-auto-enable \
--quorum-policy-file /sdcard/solveforce/quorum.policies.json \
--attest-enable \
--attest-url https://your-site.tld/wp-json/solveforce/v1/attest \
--attest-header "Authorization: Bearer <WP_TOKEN>" \
--host 0.0.0.0 --port 8080 \
--plugins-dir ~/solveforce/plugins \
--auth-mode protected \
--auth-token READER1:reader \
--allow-admin --admin-token ADMIN123 \
--schema-ed25519-secret-file /sdcard/solveforce/schema.ed25519.seed \
--schema-signing-secret-file /sdcard/solveforce/schema.hmac.key \
--audit-dir ./audit \
--mirror-enable \
--mirror-target-url https://your-site.tld/wp-json/solveforce/v1/notary \
--mirror-header "Authorization: Bearer <WP_TOKEN>" \
--allow-query-token --open-ui
“Show me” sequences
A) Redeem vouchers into tickets
# 1) Add a tickets adapter
curl -s -X POST 'http://127.0.0.1:8080/admin/redeem/adapter/add?token=ADMIN123&name=tix' \
-H 'Content-Type: application/json' \
-d '{"kind":"tickets_local","credits_per_ticket":1,"unit":"credits"}' | jq .
# 2) Redeem a voucher issued by Step-37 /rewards/spend
curl -s -X POST 'http://127.0.0.1:8080/redeem/voucher' \
-H 'Content-Type: application/json' \
-d '{"adapter":"tix","voucher":{"body":{...},"signature":{...}}}' | jq .
# 3) Inspect status
curl -s 'http://127.0.0.1:8080/redeem/status?digest=<VOUCHER_DIGEST>' | jq .
B) Pull only from reputable FX peers
# Roll scores and inspect
curl -s -X POST 'http://127.0.0.1:8080/admin/fx/reputation/roll?token=ADMIN123' | jq .
curl -s 'http://127.0.0.1:8080/fx/reputation' | jq .
# Pull from peers with score ≥ 0.6
curl -s -X POST 'http://127.0.0.1:8080/admin/fx/pull?token=ADMIN123&min_score=0.6' | jq .
C) Rep‑weighted selection and slashing
# Select a 3-seat panel with rep weighting
curl -s -X POST 'http://127.0.0.1:8080/admin/dispute/market/select?token=ADMIN123&id=<DISPUTE_ID>&m=3&budget=30&mode=score' | jq .
# After award, slash out-of-consensus votes by 1.0 credit each
curl -s -X POST 'http://127.0.0.1:8080/admin/dispute/market/auto-slash?token=ADMIN123&id=<DISPUTE_ID>&penalty=1.0' | jq .
# Review arbitrator stats
curl -s 'http://127.0.0.1:8080/dispute/arbiters' | jq .
WordPress — Step 38 (public page block)
Paste from step38_wordpress.md to publish this step transparently.
Logos Codex — recursive settlement
- Voucher → Event → Value. A signature becomes a seat, a ticket, a payout.
- Peer → Score → Choice. Trust is measured, not wished.
- Bid → Bench → Balance. The market seats the wise; the ledger trims the rest.
When you’re ready, Step Thirty‑Nine can wire real payout backends (ACH/SEPA mock → provider), FX peer reputation gossip, and panel insurance pools (underwrite slashing risk).