Fault P1 from the crash-refund review, reproduced by a5851fba3: a restart through receipt replay restored joules alone. A priced allow's money debit (§4.8) was in no signed member, and nothing read what a tainted call accrued against its sub-budget (§4.10), so a spent money ceiling and an exhausted tainted wallet came back whole. The signed core now says both. debited_minor is the money a decision debited, and chain_debited_minor gives each link's sum where a link with no money ceiling was debited none. A tainted call sealed with its flow block (jcp/3) already says its accrual: the block and its debit mean it accrued its cost_uj. tainted_uj states the accrual where no block says it, as on a chained tainted decision, and as 0 beside a block whose decision accrued nothing. Every receipt sealed before keeps its bytes and the tag stays jcp/2; of the published vectors only the priced allow in dual_ceilings.json changes, gaining its debited_minor. Decision carries the three figures. replay_ledger reads a stream into a jcp_runtime::Ledger of joules, money and tainted accrual, and Runtime::restore_ledger adds it, never lowering a spend. jcp-gateway's resume and jcp-bridge's local tool gate restore from it; replay_spend and restore keep their joules-only meaning. Receipts sealed before these members keep verifying: a verifier drops each generation of members an envelope omits, newest first. SPEC §8.1 says what they can no longer prove. An old priced allow shows no money, since the core holds no price and there is no figure to read instead, and an old tainted decision without a flow block shows no accrual; an enforcement point restoring such a log must not take either as complete. An old jcp/3 receipt reads as at least what it accrued. replay.json gains a priced allow and its refusal, a tainted call and a tainted refusal that records a cost, a priced chain whose root has no money ceiling, and a chained tainted call, each entry's money and accrual taken from the runtime's ledgers, plus legacy forms without each later member. verify_replay.py reads both dimensions and refuses six more planted reader faults. C14 restores money and taint and refuses the next call past each. The three P1 tests lose their should_panic markers and pass. Planted on the Framework, each of these fails the suite: replay restoring joules alone (all three P1 tests fail), a sealer omitting the money, a reader ignoring the flow block, a sealer omitting an accrual, and a priced chain forgetting which links paid. Changelog: none Co-Authored-By: Claude Opus 5.5 <[email protected]>
85 lines
7.1 KiB
JSON
85 lines
7.1 KiB
JSON
{
|
|
"grant": {
|
|
"budget_funds": {
|
|
"currency": "USD",
|
|
"minor": 500
|
|
},
|
|
"budget_uj": 1000000,
|
|
"id_hex": "6029fa6238bf16b012276af6d63378dc23b7a582d2790e5750f9c335167637ae",
|
|
"issuer": "did:key:z6Mkon3Necd6NkkyfoGoHxid2znGc59LU3K7mubaRcFbLfLX",
|
|
"signature_hex": "b1a94961108cdcac11affb93f0407fe9a1c82c771cbd28f03ad98cd7f28de55963ea8f41415d25a08879efd9c5dab2e646a1a36dabcbb1ea18bea8815ed2ef07",
|
|
"subject": "did:key:z6Mko9hTggMwjSTEaJaPUfE6tqcy2xvU6BnNq3e3o8qVBiyH"
|
|
},
|
|
"receipts": [
|
|
{
|
|
"envelope_hex": "d284581fa201270458196469643a6578616d706c653a6a63702d7265666572656e6365a0590237b065747275737467636f6e74726f6c66616374696f6e64726561646669737375657278386469643a6b65793a7a364d6b6f6e334e656364364e6b6b79666f476f48786964327a6e476335394c55334b376d756261526346624c664c5867636f73745f756a0a677374657761726478196469643a6578616d706c653a6a63702d7265666572656e6365677375626a65637478386469643a6b65793a7a364d6b6f39685467674d776a535445614a615055664536747163793278765536426e4e713365336f38715642697948677665726469637465616c6c6f77686772616e745f6964784036303239666136323338626631366230313232373661663664363333373864633233623761353832643237393065353735306639633333353136373633376165687265736f75726365784030663766623535636565393361623937373738323936303865383531666133316536386531326462396466633061383032366164323938333134636633663932696275646765745f756a1a000f42406a6672616d655f6b696e6469746f6f6c2d63616c6c6b6a63705f72656365697074656a63702f326c7061796c6f61645f686173687840663030336462336338666464633336313163643735636463623035313038363036393233653062633133376539396635336138336266646435633866643664366d646562697465645f6d696e6f7219012c71656e657267795f70726f76656e616e63656748775368756e74736275646765745f72656d61696e696e675f756a1a000f4236584005f18840a120e3779097906d725b1b5fa94eaeedf0cb5e1afd4da4308bf0dc2f0e59cd9786c566754b284ae6ba68465e83a21fa0faf3a52bfbee960219a6570c",
|
|
"verdict": "allow",
|
|
"wire": {
|
|
"action": "read",
|
|
"budget_remaining_uj": 999990,
|
|
"budget_uj": 1000000,
|
|
"cost_uj": 10,
|
|
"debited_minor": 300,
|
|
"energy_provenance": "HwShunt",
|
|
"frame_kind": "tool-call",
|
|
"grant_id": "6029fa6238bf16b012276af6d63378dc23b7a582d2790e5750f9c335167637ae",
|
|
"issuer": "did:key:z6Mkon3Necd6NkkyfoGoHxid2znGc59LU3K7mubaRcFbLfLX",
|
|
"jcp_receipt": "jcp/2",
|
|
"payload_hash": "f003db3c8fddc3611cd75cdcb05108606923e0bc137e99f53a83bfdd5c8fd6d6",
|
|
"resource": "0f7fb55cee93ab9777829608e851fa31e68e12db9dfc0a8026ad298314cf3f92",
|
|
"steward": "did:example:jcp-reference",
|
|
"subject": "did:key:z6Mko9hTggMwjSTEaJaPUfE6tqcy2xvU6BnNq3e3o8qVBiyH",
|
|
"trust": "control",
|
|
"verdict": "allow"
|
|
}
|
|
},
|
|
{
|
|
"envelope_hex": "d284581fa201270458196469643a6578616d706c653a6a63702d7265666572656e6365a0590240b065747275737467636f6e74726f6c66616374696f6e64726561646669737375657278386469643a6b65793a7a364d6b6f6e334e656364364e6b6b79666f476f48786964327a6e476335394c55334b376d756261526346624c664c5867636f73745f756a0a677374657761726478196469643a6578616d706c653a6a63702d7265666572656e6365677375626a65637478386469643a6b65793a7a364d6b6f39685467674d776a535445614a615055664536747163793278765536426e4e713365336f3871564269794867766572646963746464656e79686772616e745f6964784036303239666136323338626631366230313232373661663664363333373864633233623761353832643237393065353735306639633333353136373633376165687265736f75726365784030663766623535636565393361623937373738323936303865383531666133316536386531326462396466633061383032366164323938333134636633663932696275646765745f756a1a000f42406a6672616d655f6b696e6469746f6f6c2d63616c6c6b64656e795f726561736f6e6e66756e64732d65786365656465646b6a63705f72656365697074656a63702f326c7061796c6f61645f6861736878406630303364623363386664646333363131636437356364636230353130383630363932336530626331333765393966353361383362666464356338666436643671656e657267795f70726f76656e616e63656748775368756e74736275646765745f72656d61696e696e675f756a1a000f42365840e7b6f8c47ddb7ac5e7466a730db4e1f56577b5e511ba5d0864d11d02188378f931571a1c02bed41f384dbd3cb53ab2f25da33cbb5604c112643b7f4a3fc2b003",
|
|
"verdict": "deny",
|
|
"wire": {
|
|
"action": "read",
|
|
"budget_remaining_uj": 999990,
|
|
"budget_uj": 1000000,
|
|
"cost_uj": 10,
|
|
"deny_reason": "funds-exceeded",
|
|
"energy_provenance": "HwShunt",
|
|
"frame_kind": "tool-call",
|
|
"grant_id": "6029fa6238bf16b012276af6d63378dc23b7a582d2790e5750f9c335167637ae",
|
|
"issuer": "did:key:z6Mkon3Necd6NkkyfoGoHxid2znGc59LU3K7mubaRcFbLfLX",
|
|
"jcp_receipt": "jcp/2",
|
|
"payload_hash": "f003db3c8fddc3611cd75cdcb05108606923e0bc137e99f53a83bfdd5c8fd6d6",
|
|
"resource": "0f7fb55cee93ab9777829608e851fa31e68e12db9dfc0a8026ad298314cf3f92",
|
|
"steward": "did:example:jcp-reference",
|
|
"subject": "did:key:z6Mko9hTggMwjSTEaJaPUfE6tqcy2xvU6BnNq3e3o8qVBiyH",
|
|
"trust": "control",
|
|
"verdict": "deny"
|
|
}
|
|
},
|
|
{
|
|
"envelope_hex": "d284581fa201270458196469643a6578616d706c653a6a63702d7265666572656e6365a0590243b065747275737467636f6e74726f6c66616374696f6e64726561646669737375657278386469643a6b65793a7a364d6b6f6e334e656364364e6b6b79666f476f48786964327a6e476335394c55334b376d756261526346624c664c5867636f73745f756a01677374657761726478196469643a6578616d706c653a6a63702d7265666572656e6365677375626a65637478386469643a6b65793a7a364d6b6f39685467674d776a535445614a615055664536747163793278765536426e4e713365336f3871564269794867766572646963746464656e79686772616e745f6964784036303239666136323338626631366230313232373661663664363333373864633233623761353832643237393065353735306639633333353136373633376165687265736f75726365784030663766623535636565393361623937373738323936303865383531666133316536386531326462396466633061383032366164323938333134636633663932696275646765745f756a1a000f42406a6672616d655f6b696e6469746f6f6c2d63616c6c6b64656e795f726561736f6e7163757272656e63792d6d69736d617463686b6a63705f72656365697074656a63702f326c7061796c6f61645f6861736878406630303364623363386664646333363131636437356364636230353130383630363932336530626331333765393966353361383362666464356338666436643671656e657267795f70726f76656e616e63656748775368756e74736275646765745f72656d61696e696e675f756a1a000f4236584065e1e5037b3575c22dbeef1f8d86d79f7d3f23f1786567a6f48ccb4b1ae3a04ea92b8e19b723f59c5e82288cb80559975fe4e88ef67dd8091c6e52b9f1c33609",
|
|
"verdict": "deny",
|
|
"wire": {
|
|
"action": "read",
|
|
"budget_remaining_uj": 999990,
|
|
"budget_uj": 1000000,
|
|
"cost_uj": 1,
|
|
"deny_reason": "currency-mismatch",
|
|
"energy_provenance": "HwShunt",
|
|
"frame_kind": "tool-call",
|
|
"grant_id": "6029fa6238bf16b012276af6d63378dc23b7a582d2790e5750f9c335167637ae",
|
|
"issuer": "did:key:z6Mkon3Necd6NkkyfoGoHxid2znGc59LU3K7mubaRcFbLfLX",
|
|
"jcp_receipt": "jcp/2",
|
|
"payload_hash": "f003db3c8fddc3611cd75cdcb05108606923e0bc137e99f53a83bfdd5c8fd6d6",
|
|
"resource": "0f7fb55cee93ab9777829608e851fa31e68e12db9dfc0a8026ad298314cf3f92",
|
|
"steward": "did:example:jcp-reference",
|
|
"subject": "did:key:z6Mko9hTggMwjSTEaJaPUfE6tqcy2xvU6BnNq3e3o8qVBiyH",
|
|
"trust": "control",
|
|
"verdict": "deny"
|
|
}
|
|
}
|
|
],
|
|
"spent_after": {
|
|
"minor": 300,
|
|
"uj": 10
|
|
}
|
|
}
|