Settlement simulator (the money's lifecycle)
暂无简介
- License 许可
- MIT
- 所属仓库
- rhCat/skillChip
- 最近更新
- 2026-07-31
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- Settlement simulator (the money's lifecycle)
- perks
- [ "floatban", "zerosum", "quote", "settle", "manipulate", "dispute", "simulate", "capstone", "pricer", "rail", "credits" ]
- skill
- cws-settle-sim
02 资源文件 70
- 参考文档blueprint.json3.8 KB
- 参考文档index.json7.4 KB
- 参考文档ledger.json288 B
- 参考文档perks.json3.3 KB
- 参考文档perks/capstone/manifesto.json253 B
- 参考文档perks/capstone/metadata.json223 B
- 参考文档perks/capstone/src/contracts.json259 B
- 脚本perks/capstone/src/settle_capstone.py868 B
- 脚本perks/capstone/src/settle_capstone.sh149 B
- 参考文档perks/capstone/test/case.json322 B
- 参考文档perks/credits/manifesto.json250 B
- 参考文档perks/credits/metadata.json312 B
- 参考文档perks/credits/src/contracts.json255 B
- 脚本perks/credits/src/settle_credits.py1.3 KB
- 脚本perks/credits/src/settle_credits.sh215 B
- 参考文档perks/credits/test/case.json401 B
- 参考文档perks/dispute/manifesto.json250 B
- 参考文档perks/dispute/metadata.json189 B
- 参考文档perks/dispute/src/contracts.json255 B
- 脚本perks/dispute/src/settle_dispute.py863 B
- 脚本perks/dispute/src/settle_dispute.sh147 B
- 参考文档perks/dispute/test/case.json270 B
- 参考文档perks/floatban/manifesto.json253 B
- 参考文档perks/floatban/metadata.json187 B
- 参考文档perks/floatban/src/contracts.json259 B
- 脚本perks/floatban/src/settle_floatban.py1.2 KB
- 脚本perks/floatban/src/settle_floatban.sh208 B
- 参考文档perks/floatban/test/case.json263 B
- 参考文档perks/manipulate/manifesto.json259 B
- 参考文档perks/manipulate/metadata.json223 B
- 参考文档perks/manipulate/src/contracts.json267 B
- 脚本perks/manipulate/src/settle_manipulate.py861 B
- 脚本perks/manipulate/src/settle_manipulate.sh153 B
- 参考文档perks/manipulate/test/case.json279 B
- 参考文档perks/pricer/manifesto.json247 B
- 参考文档perks/pricer/metadata.json251 B
- 参考文档perks/pricer/src/contracts.json251 B
- 脚本perks/pricer/src/settle_pricer.py1.3 KB
- 脚本perks/pricer/src/settle_pricer.sh202 B
- 参考文档perks/pricer/test/case.json367 B
- 参考文档perks/quote/manifesto.json244 B
- 参考文档perks/quote/metadata.json218 B
- 参考文档perks/quote/src/contracts.json247 B
- 脚本perks/quote/src/settle_quote.py870 B
- 脚本perks/quote/src/settle_quote.sh182 B
- 参考文档perks/quote/test/case.json357 B
- 参考文档perks/rail/manifesto.json241 B
- 参考文档perks/rail/metadata.json314 B
- 参考文档perks/rail/src/contracts.json243 B
- 脚本perks/rail/src/settle_rail.py1.3 KB
- 脚本perks/rail/src/settle_rail.sh207 B
- 参考文档perks/rail/test/case.json450 B
- 参考文档perks/settle/manifesto.json247 B
- 参考文档perks/settle/metadata.json248 B
- 参考文档perks/settle/src/contracts.json251 B
- 脚本perks/settle/src/settle_engine.py877 B
- 脚本perks/settle/src/settle_engine.sh184 B
- 参考文档perks/settle/test/case.json366 B
- 参考文档perks/simulate/manifesto.json253 B
- 参考文档perks/simulate/metadata.json199 B
- 参考文档perks/simulate/src/contracts.json259 B
- 脚本perks/simulate/src/settle_simulate.py1.5 KB
- 脚本perks/simulate/src/settle_simulate.sh200 B
- 参考文档perks/simulate/test/case.json304 B
- 参考文档perks/zerosum/manifesto.json250 B
- 参考文档perks/zerosum/metadata.json214 B
- 参考文档perks/zerosum/src/contracts.json255 B
- 脚本perks/zerosum/src/settle_zerosum.py902 B
- 脚本perks/zerosum/src/settle_zerosum.sh186 B
- 参考文档perks/zerosum/test/case.json257 B
03 SKILL.md 正文
cws-settle-sim — the SV-6 settlement validator (M6, "the work pays for the work")
cws-settle-sim grades the settlement substrate (infra/settle/) — the money's lifecycle from type to ledger
to quote to engine, and onward through the pre-run pricer, the settle-time tax rail, and credit
usage-billing (the Hermes usage-pricing layer). It is built incrementally alongside the P6 cone (as
cws-release was grown through P3): each perk validates one money-cone capability against its acceptance, on
REAL runs.
Perks
| perk | task | what |
|---|---|---|
floatban |
P6-T01 | Money type + float-ban — infra/settle/money.py is exact decimal at scale 4, HALF_EVEN, and refuses binary floats at construction; a split re-sums to the total exactly (largest-remainder). The float-ban AST lint finds 0 float intrusions in infra/settle (and fires on a seed, so the 0 is a real verdict). |
zerosum |
P6-T02 | double-entry reward ledger — every posting set balances (per-currency zero); an unbalanced set is refused; a 10k-settlement storm stays globally zero-sum with escrow zero at every terminal state; a Merkle balance root is committed. |
quote |
P6-T04 | signed funded quote — govd signs a plan-bound quote whose breakdown sums to the amount exactly; a priced grant is admitted only with a funded quote; tampered / unfunded / plan-mismatched quotes are refused. |
settle |
P6-T05 | settlement engine — a dual-signed, validation:pass, quote-bound receipt settles atomically (escrow drained to zero, posting balanced, ledger zero-sum, dispute holdback parked); a mutant receipt (signature stripped / verdict flipped / unbound) settles nothing. Funding is per-quote (escrow keyed by quote_sha, so one quote's funds never satisfy another) and settlement is idempotent (a re-funded quote_sha cannot pay out twice). |
manipulate |
P6-T11 | FMV manipulation resistance — the index is a trimmed, control-capped, volume-weighted median; 20% adversarial volume at an extreme price moves it <2%; sub-admission markets are provisional; sybils under one controller collapse to one. |
dispute |
P6-T12 | dispute lifecycle — bond → m-of-n WebAuthn resolution (reusing the P3 approval artifact) → clawback from holdback (upheld) or bond forfeit (rejected) + reputation delta, all ledgered & zero-sum; <m approvals or a tampered approval does not resolve. |
simulate |
P6-T18 | the authoring — storm + manipulate + dispute together: zero-sum exact, index drift <2% @ 20% adversarial, dispute lifecycle complete. |
capstone |
P6-T21 | the ladder closes — cyberware's real redeemed milestones settle as internal-credit bounties (zero-sum), seed the first FMV index, and the plan's completion is a dual-signed, TSA-anchored receipt that verifies offline end-to-end. |
pricer |
price.py (#110) | plan pricer — price_plan prices a governed run from its value-free PLAN, before it runs: context tokens (SKILL.md + blueprint + perk metadata) + output tokens × model rate + tool fee + marketplace %. The itemized subtotal and the total sum exactly (Money, scale-4); a seeded tool_fee flows into the total; freeform pricing differs from contract pricing; infra/settle stays float-clean. |
rail |
rails.py (#113) | settle-time tax rail — the platform tax is collected at settle, never as an agent action and never from a hidden portal: charge_from_price splits into substrate / skill-author / marketplace as visible lines that re-sum to the total (an over-total split is refused — no skim); LedgerRail/StripeRail/CreditRail are pluggable, StripeRail stays inert until keyed, and collect_run_tax settles zero-sum and is idempotent per plan_sha. |
credits |
credits.py (#116) | credit usage-billing — a prepaid balance + per-call debits, not per-call card fees: a top-up credits the balance, each priced run debits its usage tax as a zero-sum posting set, the balance draws down, and a run whose tax exceeds the balance is refused (the structural gate); debits are idempotent per plan_sha. |
Scope / residuals (stated honestly)
The two value-integrity guards above — per-quote escrow and the spent-quote idempotency guard — were
added after an adversarial review found that a global escrow pool let one funding satisfy a distinct quote,
and that a re-funded quote could double-pay while staying zero-sum (conservation alone cannot catch a
double-pay). Both now have explicit regression checks. Known honestly-scoped residuals: the demo is
single-currency (the invariants are currency-generic); Money(Decimal(<float>)) is a soft-leak the
scale-4 quantization neutralizes and the float-ban lint keeps infra/settle literal-free; and
release_holdback has no dispute-window timer or auth yet (it stays balanced and cannot exceed the held
amount) — the timed/authorized release is downstream P6 work.
Status — the cone is closed
The P6 settlement cone is closed: simulate (P6-T18, the formal authoring of storm + manipulate + dispute)
and capstone (P6-T21) redeemed SV-6 — the ladder's top rung. The pricer / rail / credits perks
extend the validated surface to the Hermes usage-pricing layer (pre-run pricing, the settle-time tax rail,
and credit billing) added on top of the formal cone.
04 同仓库更多 Skills
Vercel Deploy
暂无简介
Audio Transcribe
暂无简介
Speech (OpenAI TTS)
暂无简介
Skill Installer
暂无简介
demo-skill
A demo skill used as a test fixture for the validate perk. Use when checking that quick_validate.py accepts a well-formed SKILL.md.
demo-skill
A demo skill used as a test fixture for generating agents/openai.yaml. Use when validating the gen_openai_yaml perk.