{"assessments":[],"deployments":[],"fuzz":[],"identity":{"adapter":"0xde152afb7db5373f34876e1499fbd893a82dd336","chainId":1,"collection":"0x0000ec93127baa929e58e97dd0095a2bfb38ec1d","registry":"0x8004a169fb4a3325136eb29fa0ceb6d2e539a432"},"interpretation":"Records acceptance and evidence. Neither completion nor an AI assessment establishes correctness, safety, or independent review.","jobId":"188a3018-0379-413a-bccc-79f278452e8f","kind":"audit","nodes":[{"acceptedSubmissionHash":"1db081a775f5604e51876d85abc9ec5aa684ec9873ce3229c4eede58530e3d25","dependsOn":[],"execution":{"network":false,"profile":"foundry","requires":[],"skillHash":"e5ac2cb1fd91a56aa40b16487fc230c48de0d317c8266140331dd3219bb40a85","skillId":"audit-specialist","tools":[]},"key":"audit_economics","kind":"code","role":"review","skillHash":"e5ac2cb1fd91a56aa40b16487fc230c48de0d317c8266140331dd3219bb40a85","skillId":"audit-specialist","state":"accepted"},{"acceptedSubmissionHash":"dc455133b25b660c82bad269f5bd01db1b52280b051dfab674ca4dfca2725615","dependsOn":[],"execution":{"network":false,"profile":"foundry","requires":[],"skillHash":"e5ac2cb1fd91a56aa40b16487fc230c48de0d317c8266140331dd3219bb40a85","skillId":"audit-specialist","tools":[]},"key":"audit_flow","kind":"code","role":"review","skillHash":"e5ac2cb1fd91a56aa40b16487fc230c48de0d317c8266140331dd3219bb40a85","skillId":"audit-specialist","state":"accepted"},{"acceptedSubmissionHash":"38f4b026963f92f731ee16e153f2806f79fc0b4dc9880f449711545e320eb269","dependsOn":["audit_math","audit_permissions","audit_economics","audit_flow"],"execution":{"network":false,"profile":"foundry","requires":[],"skillHash":"af3aa01159bbf354f621cafa5c0006f6169e0938a8b015be508b7377dbf165bc","skillId":"audit-judge","tools":[]},"key":"audit_judge","kind":"code","role":"review","skillHash":"af3aa01159bbf354f621cafa5c0006f6169e0938a8b015be508b7377dbf165bc","skillId":"audit-judge","state":"accepted"},{"acceptedSubmissionHash":"ed8a8b36eb6a6a47f9a17e31d428054de04ca0e57931403fd26103fb474064ee","dependsOn":[],"execution":{"network":false,"profile":"foundry","requires":[],"skillHash":"e5ac2cb1fd91a56aa40b16487fc230c48de0d317c8266140331dd3219bb40a85","skillId":"audit-specialist","tools":[]},"key":"audit_math","kind":"code","role":"review","skillHash":"e5ac2cb1fd91a56aa40b16487fc230c48de0d317c8266140331dd3219bb40a85","skillId":"audit-specialist","state":"accepted"},{"acceptedSubmissionHash":"e314ba28e41ebb649c81113eb73fc125a6aeb462b2a665ba7155a22ae82f9595","dependsOn":[],"execution":{"network":false,"profile":"foundry","requires":[],"skillHash":"e5ac2cb1fd91a56aa40b16487fc230c48de0d317c8266140331dd3219bb40a85","skillId":"audit-specialist","tools":[]},"key":"audit_permissions","kind":"code","role":"review","skillHash":"e5ac2cb1fd91a56aa40b16487fc230c48de0d317c8266140331dd3219bb40a85","skillId":"audit-specialist","state":"accepted"}],"objective":"Review public commit 450507815fec44e1c496999e07da1b006861c5dd.\n\nAudit the shared GOLD remediation of job c47bc2a0-44e0-413f-a5f1-75b6922c575a. World source 7afdd097847d2cd6b5d503734566afc1b78a2c8d; copied Mint/Python inputs and portable adaptations are sealed in manifests. Review all 12 prior items plus the second-inspection hardening, across TypeScript/SQL/Python/Mint service, not Solidity alone. Read SCOPE.md, REQUIREMENTS.md, LOCAL_TESTS.md, world-source/docs/world-gold-audit5-remediation.md and the previous report. Verify independently; local passing tests are not proof of security or deployment readiness.\n\nPrioritize: (1) trial ends during network latency/clock skew must remove only trial access; holders still authenticate, nonholders/external profile receive no trial grant; malformed claims/revocation remain closed. (2) pre0014/pre0015 historical schemas and partially missing required tables return a valid plan or coded refusal, never TypeError; purchases/refunds/holds remain separate from staking corrections. (3) quote-before-pause, challenge/debit races and trusted runtime provider readiness: no new debit/job while paused/unbound, no browser/env capability forgery, but paid reconciliation/results/refunds/withdrawals continue. (4) service debit, paid state, challenge and job commit atomically, including injected job-write failure. Cron GOLD work must continue independently of RPC/config/limiter failure.\n\n(5) Delivery attempt/lease fencing, idempotency key=orderId, saved results without new charge, unknown timeout pending, structured provider-confirmed nondelivery proof stored intact, unusable UTF8/undefined/cyclic results terminal with one original refund, late workers unable to replace refunded/delivered state. (6) one overflowing/invalid old credit cannot roll back or permanently starve other wallets: per-order commit, explicit int64 capacity guard, diagnostics/cooldown, bounded repair and original-price/partial-credit once-only entitlement. The 2^53-1 per-product/order technical limit is not a total issuance cap, and valid old paid entitlements are not cancelled. (7) Mint retries compare the whole persisted wallet/amount/auth/chain/contract/instance/deadline. Strict outcome proofs and SQL mirror bind original scope, block, wallet and cost. No empty/timeout object or elapsed wall time releases a still-executable authorization. Consume/release race and replay must leave one debit and immutable before/after receipt.\n\n(8) Bounded held-order recovery must use stored bindings and the preserved chain reader, independent of memory maps. Wrong/lost/new EVM namespace remains blocked; original-chain used/revoked/expired facts permit only their valid transition. Inspect actual private EVM map-loss and same-chain backup restore tests. Injected shared ledger must refuse reset before any provider/runId/map/ledger changes. (9) transient predicate rows are cleaned atomically and excluded from recovery snapshots, while permanent admin/Mint and delivery evidence remains immutable. (10) live World session/CAS, EOA writes, origin/expected-wallet and three confirmed owners remain enforced; no arbitrary balance setter, cross-consumer spend of held funds, transaction replay or wallet-switch authority.\n\nGOLD cannot transfer, sell or redeem for EMBEO and is not an AMM/trading pair. UTC staking remains 100000 EMBEO per unit/day=>1 GOLD after a full UTC day with withdrawn units forfeiting only that day. Free/paid Mint share2222 simultaneously; one eligible free Mint with neither fee, no three-day window. Paid Mint still needs EMBEO plus shared GOLD. Treasury and original Solidity remain unchanged; game rewards/production collection rights are deferred.\n\nExplicit trust/release boundaries: treasury is also an existing administrator; versioned pricing can be economically generous but cannot rewrite old orders. Structured settlement/nondelivery evidence is an internal validation/audit contract, not cryptographic proof by itself. Trusted deployment-pinned finalized readers and authenticated real provider adapters must supply production facts; HTTP clients cannot. The bundled reader and synthetic provider/session/price tests are private fixtures. Actual AIMarket/fortune/VPS delivery, public-chain runtime/finality, persistent production namespace, real wallets, production CPU/D1 capacity and rollout/rollback/postflight are not proved. Production reviewedEconomyConfig returns null and no real delivery consumer is bound, so new service admission remains closed. No deployment is authorized.\n\nReport concrete exploits/failures with affected paths/lines, assumptions, severity, positive/negative controls and regressions. Distinguish reproduced implementation defects from explicit missing production release gates; do not count fixture success or absence of findings as a launch approval. Please verify prior-finding closure and look for new cross-boundary regressions. Return the report on the job page.","parentJobId":null,"planHash":"328196c6aff3e096c6fc29ee36b33b80fedf6ab33b0c26b2e62f988ec725c4c7","previousHash":"0000000000000000000000000000000000000000000000000000000000000000","projectId":"188a3018-0379-413a-bccc-79f278452e8f","publication":{"commit":null,"deliveredAt":null,"repoUrl":null},"receiptIdentity":{"adapter":"0xde152afb7db5373f34876e1499fbd893a82dd336","chainId":1,"collection":"0x0000ec93127baa929e58e97dd0095a2bfb38ec1d","registry":"0x8004a169fb4a3325136eb29fa0ceb6d2e539a432"},"registry":"0xb6d0a187b050fa5bb0b87033a203f37becf4a775","research":[],"schema":"identitymd-work-v1","signals":[{"agentId":"52162","feedbackHash":"391cd72a3843579e589e75c77e808d21be9a50cfc2ec6e3979c823df99b6f034","nodeKey":"audit_economics","submissionHash":"1db081a775f5604e51876d85abc9ec5aa684ec9873ce3229c4eede58530e3d25","tag1":"review:submission","tag2":"acceptance-v2","value":1},{"agentId":"52205","feedbackHash":"4f2c2b5600710e3b3a94e70ecb1280fe2d82f9afffc46a33f897f90d12d041ae","nodeKey":"audit_flow","submissionHash":"dc455133b25b660c82bad269f5bd01db1b52280b051dfab674ca4dfca2725615","tag1":"review:submission","tag2":"acceptance-v2","value":1},{"agentId":"53937","feedbackHash":"2706b3afab9738999c1df91df1e1341c9bb90ae55cee7ed0b3d6f8b9f035d707","nodeKey":"audit_judge","submissionHash":"38f4b026963f92f731ee16e153f2806f79fc0b4dc9880f449711545e320eb269","tag1":"review:submission","tag2":"acceptance-v2","value":1},{"agentId":"52607","feedbackHash":"a48e65f6355ba2cde369a383968cef49a77fe58cdd3d8ff6d743cbbac00c9bbd","nodeKey":"audit_math","submissionHash":"ed8a8b36eb6a6a47f9a17e31d428054de04ca0e57931403fd26103fb474064ee","tag1":"review:submission","tag2":"acceptance-v2","value":1},{"agentId":"51886","feedbackHash":"28f95458b7a511702b97c07b06506ccc1b89ba0fc0b34851a9cbcb8a63095374","nodeKey":"audit_permissions","submissionHash":"e314ba28e41ebb649c81113eb73fc125a6aeb462b2a665ba7155a22ae82f9595","tag1":"review:submission","tag2":"acceptance-v2","value":1}],"site":null,"snapshotHash":"f5ee1b6b538226cf7a63196a48e70c6bb0b7d649f6c2835cab34ecea9ce361a0","state":"completed","submissions":[{"artifacts":[],"attempt":1,"bundleHash":null,"device":"f9cb4fd544aa3c68","findings":[{"citation":"resolved","description":"The L3/I11/L9 remediation is enforced only for GOLD orders that have a world_gold_links row of kind 'service'. sharedServiceAdmission() returns false for any GOLD order created through the pre-existing catalogue route (createEconomyOrder via POST /api/economy/orders with currency 'GOLD'), so createEconomyGoldChallenge and payEconomyOrderGold skip the world_gold_controls 'service' predicate, skip the serviceReady (trusted runtime provider) requirement and insert no world_gold_jobs row. With any reviewed EconomyConfig whose catalogue is non-empty, a player can therefore keep buying and being debited for GOLD services while an administrator has paused 'service' and while no delivery consumer is bound; the debit lands in economy_fulfillments (an outbox nothing in this packet consumes) with no delivery, no terminal failure path and no refund entitlement (refundGold requires a world_gold_jobs row in state 'failed'). REQUIREMENTS.md: 'Pause only new admissions by feature' and 'Service debit creates one durable job'. Assumption: today reviewedEconomyConfig returns null and the fixture catalogue is empty, so this is not reachable in the deployed Worker; it becomes reachable the moment a reviewed config with a priced catalogue entry is released, which is the stated release path. Fix: when world_gold_links exists, treat any GOLD-currency order as a service admission (apply the control predicate and serviceReady gate), or refuse GOLD catalogue orders while the shared-GOLD schema is present and route them through goldQuote so they carry a link and a job.","line":209,"path":"world-source/server/economy-ledger.ts","reproduction":"Scratch test (node --test, d1-sqlite adapter, all migrations): config=defineEconomyConfig({chainId:1,token:ECONOMY_TOKEN,treasury:OWNER,stakingContract:0x11..,paymentContract:0x22..,deploymentBlock:'100',catalogue:[{id:'legacy-research',titleZh:'a',titleEn:'a',gold:'3'}]}). Wallet W tops up 10 GOLD via goldQuote('pack')+ingestEconomyEvents+reconcileWorldGold (book 10). Admin: goldAdminCommand control service enabled:false version:0. Negative control: goldQuote(research) now rejects. Then createEconomyOrder({wallet:W,serviceId:'legacy-research',currency:'GOLD'}), createEconomyGoldChallenge(...,{serviceReady:false}), payEconomyOrderGold with a valid EOA signature and serviceReady:false. Expected: FEATURE_PAUSED or SERVICE_DELIVERY_UNAVAILABLE, book stays 10. Actual: order status 'paid', book 7, SELECT COUNT(*) FROM world_gold_jobs = 0 while world_gold_controls shows service enabled=0 version=1.","severity":"low","snippet":"  if(!linked)return false;","title":"Legacy catalogue GOLD orders bypass the service pause, the trusted delivery-readiness gate and durable job creation"},{"citation":"resolved","description":"The cron guard treats the presence of world_gold_jobs (migration 0014) as proof the shared-GOLD schema is complete, but reconcileWorldGold's first statement (server/world-gold.ts:63) LEFT JOINs world_gold_reconcile_errors, a table created only by migration 0015, and finishGoldJob writes delivery_evidence_json (also 0015). On a database that has applied 0014 but not yet 0015 (the exact deploy-code-before-migrate window Cloudflare D1 migrations create, and the 'pre-0015' schema profile the brief asks about) every minute tick throws 'no such table: world_gold_reconcile_errors', is swallowed by Promise.allSettled and logged as gold_maintenance unavailable; the player-triggered POST /api/gold/orders/:id/reconcile throws the same raw SQLite error and is answered 503 GOLD_UNAVAILABLE. Meanwhile goldQuote and payEconomyOrderGold still accept new topups and service debits on that schema. Net effect: EMBEO paid to the treasury is not credited as GOLD and provider-failed jobs are not refunded until 0015 is applied, with no coded refusal distinguishing the schema gap from an outage. Finding 2 of the prior report asked for 'a valid plan or coded refusal, never a raw error' on partial schemas; the same discipline is missing on the operational path. Fix: guard maintainGold and the reconcile route on the newest required object (world_gold_reconcile_errors / the delivery_evidence_json column), or make reconcileWorldGold return a coded SCHEMA_INCOMPLETE failure, and refuse new admissions (goldQuote/pay) while the schema is incomplete.","line":158,"path":"world-source/worker/app.ts","reproduction":"Scratch test: db=openD1(migrationFiles().filter(n=>Number(n.slice(0,4))<15)) (0001..0014). goldAdminCommand product 'pack' succeeds. reconcileWorldGold(db,NOW) -> expected a plan/coded refusal or success with zero rows; actual throws Error 'no such table: world_gold_reconcile_errors'. createWorker(...).scheduled({cron:'* * * * *'},{DB:db},ctx) then await ctx promises -> console shows 'gold_maintenance {\"status\":\"unavailable\"}' on every tick. Negative control: the same calls with all migrations applied return {processed:0,failures:[]} and log nothing.","severity":"low","snippet":"    if(!env.DB||!await env.DB.prepare(\"SELECT name FROM sqlite_master WHERE type='table' AND name='world_gold_jobs'\").first())return;","title":"Worker deployed ahead of migration 0015 silently disables all GOLD topup crediting and refunds: maintainGold guards for world_gold_jobs only while reconcileWorldGold requires world_gold_reconcile_erro"},{"citation":"resolved","description":"The L4 remediation makes undefined, cyclic and oversize results terminal World-storage failures with a once-only refund, but a result of null passes: JSON.stringify(null) is the string 'null', so the job is marked 'delivered' with result_json 'null', the GOLD debit stands, and the state is final (refundGold requires 'failed'; admin refund-service requires failed/refunded). A provider adapter that resolves {kind:'delivered',result:null} on an empty upstream body (a common HTTP-client default) therefore charges the player for nothing with no lawful refund path, which is the same outcome the L4 fix was meant to close. Fix: treat null (and arguably an empty object/string) like undefined: failure='RESULT_NOT_SERIALIZABLE' (or a dedicated RESULT_EMPTY) with the existing world-result-unusable evidence and refund; the runGoldServiceJobs adapter contract should reject delivered outcomes without a non-null result before calling finishGoldJob.","line":91,"path":"world-source/server/world-gold.ts","reproduction":"Scratch test with the audit5 fixture: topup (book 10), id=f.service() (research, book 7), a=claimGoldJob(db,id,NOW); finishGoldJob(db,{orderId:id,attempt:a,nowMs:NOW+1,outcome:{result:null}}). Expected: terminal failure with evidence kind 'world-result-unusable' and book back to 10 (as for result:undefined). Actual: no error; SELECT state,result_json FROM world_gold_jobs -> {state:'delivered',result_json:'null'}; book stays 7; refundGold(db,id,NOW+2) rejects REFUND_NOT_ENTITLED. Negative control in the packaged suite: outcome {result:undefined} and 'x'.repeat(16001) become 'refunded' with book 10.","severity":"low","snippet":" if('result' in args.outcome){try{json=JSON.stringify(args.outcome.result)??null;}catch{failure='RESULT_NOT_SERIALIZABLE';}if(json===null)failure??='RESULT_NOT_SERIALIZABLE';else if(new TextEncoder().encode(json).length>16000){json=null;failure='RESULT_TOO_LARGE';}}","title":"finishGoldJob accepts a provider result of null as a delivered, chargeable result"},{"citation":"resolved","description":"validateMintProof rejects mode private-chain-fixture when the stored binding is not chain 31337, but the converse is not checked: a MintProof with mode finalized-chain is accepted for a chainId 31337 hold, and the world_gold_mint_proof trigger (migrations/0015_world_gold_audit_hardening.sql:36) mirrors the same one-directional rule. The remediation states the proof binds original scope and that the bundled reader is PRIVATE EDR ONLY; yet the permanent settlement evidence stored in world_gold_mint_settlements.evidence_json can claim production-grade finality for a fixture chain, and any future finalized-chain reader wired to a 31337 binding would be accepted as scope-valid. No GOLD is created or double-spent (orderId/wallet/gold/chainInstance are still compared), so this is an evidence-integrity and audit-classification gap rather than a theft path. Fix: require mode===(chainId===31337?private-chain-fixture:finalized-chain) in validateMintProof and in the trigger (replace the OR with an exact per-chain mapping), and add the negative case to the L6 test.","line":125,"path":"world-source/server/world-gold.ts","reproduction":"Scratch test with the audit5 fixture: topup (book 10); m={...f.mint(),chainId:31337}; reserveMintGold(db,m,NOW) (reserved 8). settleMintGold(db,{id:m.id,chainId:31337,contract:m.contract,chainInstance:m.chainInstance,state:released,evidence:mintProof(m,released,{mode:finalized-chain})},NOW+1). Expected: MINT_EVIDENCE_REQUIRED (mode does not match a private chain) with reserved staying 8. Actual: accepted; world_gold_mints state released, reserved 0, and world_gold_mint_settlements stores evidence_json with mode finalized-chain for chain 31337. Negative control: the same proof with mode private-chain-fixture on a chainId 1 binding is rejected MINT_EVIDENCE_REQUIRED by both layers (packaged L6 test).","severity":"low","snippet":" if(!e||e.schema!=='ember-mint-proof-v1'||!['finalized-chain','private-chain-fixture'].includes(e.mode)||(e.mode==='private-chain-fixture'&&m.chainId!==31337)||e.orderId!==m.id||e.wallet!==m.wallet||e.gold!==m.gold||e.chainId!==m.chainId||e.contract!==m.contract||e.chainInstance!==m.chainInstance||!hash(e.blockHash)||!uint(e.blockNumber)||!Number.isSafeInteger(e.chainTimeMs)||e.chainTimeMs<=0||!uint(e.tokenId)||typeof e.revoked!=='boolean')fail('MINT_EVIDENCE_REQUIRED');","title":"Mint proof mode is not bound to the chain: a private-chain (31337) hold accepts a proof labelled finalized-chain in both the server validator and the SQL mirror"},{"citation":"resolved","description":"LocalChainService.approval() (mint/service/chain.mjs:71) awaits beforeApproval before it branches on packet.route, and the shared runtime binds it to goldFeature(db,'mint'). An administrator 'control mint enabled:false' (intended to stop new GOLD hold admissions for paid Mint) therefore also rejects free-route approvals, which involve neither EMBEO nor GOLD. REQUIREMENTS.md: 'Pause only new admissions by feature' and 'Eligible Active Agent wallet gets one free Mint without either fee'. Free/paid simultaneity is preserved only while the pause is off. Private fixture wiring, not production code, but it is the reference adapter the production consumer is said to follow. Fix: call the feature check inside the paid branch (next to gold.reserve) or pass the route to beforeApproval and check only for route==='paid'. Not executed here: the EDR/Hardhat dependencies for the private chain are not installed in this review environment; the path is traced from source.","line":23,"path":"world-source/scripts/world-gold-local-runtime.mjs","reproduction":"Code-traced input: r=await createGoldLocalRuntime(); goldAdminCommand(r.db,{wallet:treasury,...,command:{action:'control',feature:'mint',enabled:false,version:0}}); r.mint.approval({wallet:'A',route:'free',look:<valid look>}). Expected: a free approval packet (no GOLD involved). Actual (per chain.mjs:71 executing before the route branch at line 84): rejects FEATURE_PAUSED. Negative control: with enabled:true the same call returns a packet; paid approvals correctly reject while paused.","severity":"info","snippet":" mint.beforeApproval=()=>goldFeature(db,'mint');","title":"Fixture runtime wires the GOLD 'mint' feature pause into every Mint approval, so pausing GOLD holds also blocks fee-free free Mints"},{"citation":"resolved","description":"Not a defect. The packaged tests that exercise the real EDR chain (tests/world-gold-audit5.test.mjs 'Audit L8', the economy-wallet-recovery/audit4 private-EVM cases and scripts/world-gold-local-runtime.mjs reopen()) import mint/contract/tools/runtime.mjs, whose Hardhat/EDR dependencies are not installed here; the one such case in the audit5 file failed on import in this environment while the other 10 SQL-level cases passed. By reading: resetChain() refuses before disconnecting the provider, replacing runId or clearing maps when an injected non-fixture ledger is present; reconcileHeldMintGold() uses stored bindings plus a scoped reader and never releases on elapsed wall time; the private reader re-anchors genesis and code hashes and the runId on every read. These closures are plausible but unreproduced here. Also confirmed in this environment: the 10 SQL-level audit5 cases, the 7 second-inspection adversarial cases, and the 10 Python trial tests pass; prior findings M1, M2, L3, L4, L5, L6, L9, I10 and I11 are closed by the code paths cited in the remediation document. Release gates remain as documented: reviewedEconomyConfig null, no bound delivery consumer, no finalized public-chain reader, no production namespace registry.","line":28,"path":"mint/service/chain.mjs","reproduction":"node --test tests/world-gold-audit5.test.mjs in a copy with only viem installed: 10 pass, 1 fail (Audit L8) with ERR_MODULE_NOT_FOUND on mint/contract/tools/runtime.mjs dependencies. Expected on a host with contracts/ dependencies installed: 11 pass. This entry records what was not independently executed; it opens no revision by itself.","severity":"info","snippet":"  if(this.gold&&!(this.gold instanceof LocalGoldLedger))reject('MINT_SHARED_RESET_FORBIDDEN');\r","title":"Review coverage note: private-EVM remediation tests (L7 map loss, L8 reset refusal, same-chain backup restore) could not be executed in this environment and are verified by code reading only"}],"hash":"1db081a775f5604e51876d85abc9ec5aa684ec9873ce3229c4eede58530e3d25","nodeId":"a980ffa0-7006-495e-abfb-595c97893009","outcome":"completed","summary":"The review is complete. The findings file is written at `.imd-findings.json` in the repository root, and no other file in the tree was changed (git status is clean apart from that ignored file).\n\n**Prior-finding closure.** All 12 items from job c47bc2a0 are closed in the code at this commit. I verified them by reading the remediated paths and by running the packaged SQL-level and Python suites in a scratch copy outside the repository: 10 of 11 audit5 cases, all 7 second-inspection adversarial cases and all 10 Python trial tests pass. The one audit5 case that did not run here is the L8 reset-refusal test, which needs the Hardhat/EDR dependencies that are not installed on this machine. L7, L8 and the backup-restore cases are therefore verified by code reading only, and I recorded that as an info entry rather than claiming they passed.\n\n**New findings, all substantiated with scratch reproductions against the real migrations:**\n\n- **Low, economy-ledger.ts line 209.** Legacy catalogue GOLD orders created through the pre-existing economy route skip the service pause, the trusted delivery-readiness gate and durable job creation. With a reviewed config whose catalogue is non-empty, a player is debited while service is paused and no consumer is bound, with no refund path. Not reachable today because the production config returns null.\n- **Low, worker/app.ts line 158.** On a database that has applied migration 0014 but not 0015, the cron guard passes but every GOLD maintenance tick and the player reconcile route fail with a raw \"no such table\" error. Topups stop crediting and refunds stop while new debits are still accepted.\n- **Low, world-gold.ts line 91.** A provider result of null is accepted as delivered and charged. The L4 fix covers undefined, cyclic and oversize results but not this case, and the delivered state has no refund path.\n- **Low, world-gold.ts line 125 and the 0015 trigger.** A private-chain hold accepts a proof labelled finalized-chain. The mode check is one-directional in both the server validator and the SQL mirror, so permanent settlement evidence can misstate the chain class.\n- **Info, local runtime line 23.** Pausing the GOLD mint feature also blocks fee-free free Mint approvals in the fixture adapter, because the check runs before the route branch.\n\n**Clean areas.** The settle race between consumed and released ends in a state conflict with one debit. Challenge and debit predicates enforce the pause inside the transaction. Job insertion failure rolls back debit, paid status and challenge together. Lease and attempt fencing reject late workers. Per-order reconciliation isolates the overflow case. The trial boundary normalizes an expired trial without denying holders.\n\n**Not proved and still release gates**, consistent with SCOPE.md: real provider delivery, public-chain finality readers, the persistent namespace registry, production capacity and rollout. No Solidity defect was found, so no Foundry proof files were needed and none were written.","treeHash":null,"usage":{"cachedInputTokens":3515098,"inputTokens":642,"model":"claude-fable-5-1","outputTokens":39704,"runtime":"claude","turns":36,"wallClockMs":680657}},{"artifacts":[],"attempt":1,"bundleHash":null,"device":"33bef35e96ccb653","findings":[{"citation":"resolved","description":"Remediation L5 added the BEFORE INSERT trigger world_gold_credit_capacity on world_gold_entries (migrations/0015 line 13) so a topup/refund credit that would push economy_gold_accounts.balance past 2^63-1 fails per order with GOLD_BALANCE_CAPACITY, a world_gold_reconcile_errors row and a cooldown. The same book is also credited by the staking journal: settleEconomy pushes every completed wallet's utc-reward into economy_gold_journal at this line, and trigger economy_gold_apply (migrations/0010 lines 109-112) runs UPDATE balance=balance+NEW.delta with no capacity check. For a wallet whose book already sits at 2^63-1 the sum is promoted to REAL and CHECK(typeof(balance)='integer') on economy_gold_accounts aborts. settleEconomy commits one page (up to 32 wallets' journals, the page row, the day-progress CAS and the day-completion marker) in a single db.batch, so the abort rolls back every other wallet's reward, economy_gold_days is never written, and every later run re-selects the identical page and fails identically (lines 166-171 swallow only a version change). No reconcile_errors row, cooldown or per-wallet isolation exists on this path; the minute cron only logs gold_maintenance unavailable. The state is reachable with lawful, non-rewritten entitlements: goldAdminCommand accepts gold up to WORLD_GOLD_MAX_PRODUCT (2^53-1) per product version, and the 0015 capacity trigger deliberately lets a wallet accumulate up to exactly 2^63-1 (1024 orders of 2^53-1 plus one of 1023). The documented admin pricing power (treasury is an admin; pricing may be generous) is the only precondition; the player then stakes one 100000-EMBEO unit and from the next settled day on no wallet earns staking GOLD. This violates REQUIREMENTS 'one overflowing/invalid credit cannot permanently starve other wallets' and 'purchases remain separate from staking corrections' at the shared-book boundary 0015 left unguarded. Trust assumption stated: requires an administrator to publish a 2^53-1 GOLD product and a player to buy it 1024 times; no non-admin path reaches capacity. Fix: mirror the capacity guard for positive economy_gold_journal inserts (BEFORE INSERT WHEN NEW.delta>0 AND balance>9223372036854775807-NEW.delta RAISE GOLD_BALANCE_CAPACITY), and in settleEconomy record that wallet as owed/carried (as world_gold_reconcile_errors does) while committing the rest of the page, or settle rewards per wallet so one failing journal cannot abort the day; consider capping the admissible per-wallet book far below int64 at quote time.","line":162,"path":"world-source/server/economy-ledger.ts","reproduction":"Scratch node:test file using tests/d1-sqlite.mjs and tests/world-gold-audit5-fixture.mjs (all migrations incl. 0015, config chainId 1, deploymentBlock '100'). Admin publishes topup products 'maxp' gold='9007199254740991' embeo='1' and 'tail' gold='1023' embeo='1' (both accepted). Wallet X: 1024 x goldQuote('maxp') + 1 x goldQuote('tail'), each paid via ingestEconomyEvents payment events; reconcileWorldGold ten times -> failures [] and worldGoldSnapshot(X).book === '9223372036854775807'. Then ingest stake events at block 1125: X positionId '1' shares '1' and Y positionId '2' shares '1' at T=Date.UTC(2026,9,20), then an empty batch with throughTimestamp T+2*DAY. settleEconomy(db,config,{nowMs:T+2*DAY}). Expected: Y credited 1 GOLD per full day and day rows created (X recorded as owed/skipped). Actual: throws \"CHECK constraint failed: typeof(balance)='integer' AND balance>=0\"; SELECT COUNT(*) FROM economy_gold_journal WHERE kind='utc-reward' = 0; economy_gold_days = 0; economyWalletSnapshot(Y).gold = '0'; settleEconomy again at T+30*DAY throws identically and world_gold_reconcile_errors stays empty. Positive control in the same file: identical stakes without the topups -> X gold '2', Y gold '2', 2 day rows.","severity":"medium","snippet":"      statements.push(bind(db,'INSERT INTO economy_gold_journal(id,wallet,delta,kind,reference,created_ms) VALUES(?,?,?,?,?,?)',`reward:${reference}`,who,String(reward),'utc-reward',reference,nowMs));","title":"One int64-capacity wallet aborts the whole UTC staking settlement page forever and starves every other staker (capacity guard covers world_gold_entries only)"},{"citation":"resolved","description":"sharedServiceAdmission returns false for any GOLD-currency order without a world_gold_links row of kind 'service', so createEconomyGoldChallenge and payEconomyOrderGold skip the world_gold_controls 'service' predicate, skip the serviceReady (trusted runtime provider) requirement and insert no world_gold_jobs row for orders created through the pre-existing catalogue route (createEconomyOrder via POST /api/economy/orders with currency 'GOLD'). With any reviewed EconomyConfig whose catalogue holds a GOLD-priced entry, a player can keep being debited for GOLD services while an administrator has paused 'service' and while no delivery consumer is bound; the debit lands in economy_fulfillments with no delivery, no terminal failure path and no refund entitlement (refundGold needs a world_gold_jobs row in state 'failed'). REQUIREMENTS.md: 'Pause only new admissions by feature' and 'Service debit creates one durable job'. Assumption: today reviewedEconomyConfig returns null and the fixture catalogue is empty, so this is not reachable in the deployed Worker; it becomes reachable the moment a reviewed config with a priced GOLD catalogue entry is released, which is the stated release path. Fix: when world_gold_links exists, treat every GOLD-currency order as a service admission (apply the control predicate and the serviceReady gate), or refuse GOLD catalogue orders while the shared-GOLD schema is present and route them through goldQuote so they carry a link and a job.","line":209,"path":"world-source/server/economy-ledger.ts","reproduction":"Scratch node:test (d1-sqlite adapter, all migrations): config=defineEconomyConfig({chainId:1,...,catalogue:[{id:'legacy-research',titleZh:'a',titleEn:'a',gold:'3'}]}). Wallet W tops up 10 GOLD via goldQuote('pack') + ingestEconomyEvents payment event + reconcileWorldGold (book '10'). Admin: goldAdminCommand control service enabled:false version:0. Negative control: goldQuote(research, serviceReady:false) rejects SERVICE_DELIVERY_UNAVAILABLE. Then createEconomyOrder({wallet:W,serviceId:'legacy-research',currency:'GOLD'}), createEconomyGoldChallenge(...,{serviceReady:false}), payEconomyOrderGold with a valid EOA signature and serviceReady:false. Expected: FEATURE_PAUSED or SERVICE_DELIVERY_UNAVAILABLE, book stays '10'. Actual: order status 'paid', book '7', SELECT COUNT(*) FROM world_gold_jobs = 0 while world_gold_controls shows service enabled=0 version=1.","severity":"low","snippet":"  if(!linked)return false;","title":"Legacy catalogue GOLD orders bypass the service pause, the trusted delivery-readiness gate and durable job creation"},{"citation":"resolved","description":"The cron guard treats the presence of world_gold_jobs (created by 0014) as proof the shared-GOLD schema is complete, but reconcileWorldGold's first statement (server/world-gold.ts line 63) unconditionally LEFT JOINs world_gold_reconcile_errors and lines 65-73 write it; both exist only after 0015, and finishGoldJob writes delivery_evidence_json (also 0015). On a database that has applied 0014 but not 0015 (the deploy-code-before-migrate window D1 migrations create, and the 'pre-0015' profile the brief asks about) every minute tick throws 'no such table: world_gold_reconcile_errors', is swallowed by Promise.allSettled and logged as gold_maintenance unavailable; the player route POST /api/gold/orders/:id/reconcile (server/world-gold-api.ts) throws the same raw SQLite error and answers 503 GOLD_UNAVAILABLE. Meanwhile goldQuote and payEconomyOrderGold still accept new topups and service debits on that schema, so EMBEO paid to the treasury is not credited as GOLD and provider-failed jobs are not refunded until 0015 is applied, with no coded refusal distinguishing the schema gap from an outage. The codebase treats a deploy that ran ahead of a migration as a supported state (tests/d1-sqlite.mjs openD1(files); economy-recovery and sharedServiceAdmission probe sqlite_master first), and prior finding 2 asked for 'a valid plan or coded refusal, never a raw error' on partial schemas. No GOLD is lost (orders stay paid and immutable; crediting resumes once 0015 applies), so this is a liveness/ordering defect. Fix: guard maintainGold and the reconcile route on the newest required object (world_gold_reconcile_errors or the delivery_evidence_json column), or make reconcileWorldGold degrade/return a coded SCHEMA_INCOMPLETE failure when the table is missing, and refuse new admissions while the schema is incomplete.","line":158,"path":"world-source/worker/app.ts","reproduction":"Scratch node:test: db=openD1(migrationFiles().filter(n=>Number(n.slice(0,4))<15)) (0001..0014 applied, 0015 absent). goldAdminCommand product 'pack' (topup gold 10 embeo 7) succeeds; wallet W quotes pack via goldQuote; ingestEconomyEvents records the matching payment at block 100 -> economy_orders.status='paid'. reconcileWorldGold(db,NOW) -> actual: throws Error 'no such table: world_gold_reconcile_errors'; reconcileWorldGold(db,NOW,orderId) (the player route) -> same throw. createWorker({},fetch,()=>NOW,undefined,()=>undefined,{config:async()=>config}).scheduled({cron:'* * * * *'},{DB:db,ECONOMY_CHAIN_LIMITER:{limit:async()=>({success:false})}},ctx), await ctx promises -> console shows ['economy_sync {\"status\":\"unavailable\"}','gold_maintenance {\"status\":\"unavailable\"}'] and worldGoldSnapshot(W).book stays '0'. Expected: book '10' or a coded, logged skip without a raw SQLite message. Positive control: the identical sequence on openD1() with all migrations credits book '10' on the first tick (packaged Audit L9a/L9b/I10 pass on this tree).","severity":"low","snippet":"    if(!env.DB||!await env.DB.prepare(\"SELECT name FROM sqlite_master WHERE type='table' AND name='world_gold_jobs'\").first())return;","title":"Worker deployed ahead of migration 0015 silently disables all GOLD topup crediting and refunds: maintainGold guards for world_gold_jobs (0014) while reconcileWorldGold requires world_gold_reconcile_er"},{"citation":"resolved","description":"M1 is closed for the trial claim: _identity() lines 251-254 normalise an active trial whose endsMs has passed to inactive and the holder path survives (verified: 10/10 packaged Python tests pass; session_eligible with endsMs NOW-20 and NOW returns (ADDRESS, True) with _balance True; external profile with an active trial returns (ADDRESS, False)). The same latency/skew pattern is still a hard failure one line earlier for the identity's own expiry. World's introspect answers 200 only while MIN(bridge.expires_at, session.expires_at) > World's clock, so the consumer receives expires_at <= its own _now_ms() exactly through transit latency or when AIMarket's clock runs ahead of World's. In that state _identity() raises BridgeUnavailable('invalid_world_response') from the structural check, which (a) session_eligible() (lines 366-373) does not catch, so every portal read of a session in its final skew-window milliseconds errors out as a bridge outage instead of a revoke-and-deny, leaving the world_sessions row in place, and (b) complete_login() (line 307/313) never reaches its own deny branch `if expiry <= _now_ms(): raise BridgeDenied('source_session_expired')` at line 321, which is therefore dead code for the only input that could trigger it. Expected, consistent with the trial fix and REQUIREMENTS ('fresh rechecks', 'revocation remains closed'): a clean deny, since an expired identity is not a malformed one. Impact is availability/misclassification only, bounded by the skew plus latency window per session; no access is granted. Fix: keep the type and upper-bound checks structural but let expiry <= _now_ms() raise BridgeDenied (or return the identity and let session_eligible lines 379-384 and complete_login line 321 deny it); add regressions asserting session_eligible('S'*43, require_profile='world') == (None, False) with the row removed for expires_at=NOW and NOW-1, and complete_login raising BridgeDenied('source_session_expired').","line":243,"path":"aimarket/web/world_auth.py","reproduction":"python3 -I probe in aimarket/ reusing test_world_trial.TrialTests setUp/identity/session (AIMARKET_BRIDGE_SECRET and AIMARKET_WORLD_STATE_DB set by the fixture, w._now_ms patched to NOW). Insert world_sessions(token 'S'*43, address 0xaa..aa, bridge_session 'B'*43, expires_at NOW+5000, profile 'world'). Patch _world_post to return the fixture identity with world_trial endsMs NOW+1000 and expires_at=EXP, _balance -> True. session_eligible('S'*43, require_profile='world'): EXP=NOW+1 -> ('0xaa..aa', True) [positive control]; EXP=NOW -> raises BridgeUnavailable('invalid_world_response') with the world_sessions row still present; EXP=NOW-1 -> same. begin_login('zh',ADDRESS,profile='world') then complete_login(state,flow,'C'*43,profile='world') with EXP=NOW -> raises BridgeUnavailable('invalid_world_response'), never BridgeDenied('source_session_expired'). Expected for EXP<=NOW: (None, False) with the session revoked, and BridgeDenied on login.","severity":"low","snippet":"            or type(expiry) is not int or expiry <= _now_ms() or expiry > _now_ms() + 7 * 86400_000 + 60_000):","title":"AIMarket consumer classifies an identity whose expires_at has just passed (latency/clock skew) as a malformed World response and raises BridgeUnavailable instead of denying; complete_login's source_se"},{"citation":"resolved","description":"The copied Mint service treats a reserved paid order as reusable while o.auth.deadline>=now, where now is the latest block timestamp. The contract accepts the appearance and the PaidAuthorization only while block.timestamp<=deadline (mint/contract/contracts/EmberEvoGenesisCandidate.sol lines 155 and 192), and every block mined after 'latest' has a strictly larger timestamp, so when now==deadline the existing authorization is already unexecutable. Everywhere else the boundary is strict: reconcileOrders releases when time()>auth.deadline (line 150), reserveMintGold refuses m.deadline<=nowMs, validateMintProof and the world_gold_mint_proof trigger release only at chainTimeMs>deadline. This one comparison is off by one. Effect: a reservation retry returns a packet that reverts on chain; because the reservation is reused, no fresh GOLD reservation, signature or deadline is produced, the player's mint attempt fails APPEARANCE_EXPIRED (gas spent), reconciliation then releases the hold, and only a further approval call creates a usable order. No GOLD or EMBEO is lost and the shared ledger stays correct, so this is a boundary/liveness defect of the fixture service; it matters because this retry comparison is what the second inspection hardened and what a production adapter would copy. Fix: use o.auth.deadline>now (ideally with a margin of a few blocks' seconds) so a reused packet is always still mineable.","line":86,"path":"mint/service/chain.mjs","reproduction":"Private EDR, contracts npm ci and world-source viem installed; scratch node:test importing mint/service/chain.mjs. mint=await createLocalService(); mint.transaction({wallet:'B',action:'approve',submissionId:uuid}); first=(await mint.approval({wallet:'B',look:initialLook(),route:'paid'})).packet -> goldAuthorization.deadline == time()+300. mint.admin({action:'advance',seconds:300}) so time()==deadline (asserted true). second=(await mint.approval(same)).packet -> second.packetId===first.packetId (reused). mint.transaction({wallet:'B',action:'mintPaid',packet:second,submissionId:uuid}). Expected: a new reservation/packet with a future deadline or a refusal; the returned packet must be mineable. Actual: rejects with code APPEARANCE_EXPIRED stage 'reverted', and state().orders shows the order 'released'. Negative control in the same file: advance 299 seconds instead -> packet reused and mintPaid succeeds with the order 'consumed'.","severity":"low","snippet":"   const existing=[...this.orders.values()].find(o=>o.status==='reserved'&&o.wallet===input.wallet&&o.auth.key===packet.key&&o.auth.deadline>=now&&o.auth.signerEpoch===signerEpoch&&o.auth.recipient===packet.expectedRecipient);","title":"Paid-Mint approval reuses a reserved authorization at chain time == deadline (>= instead of >), handing back a packet that can no longer be mined"},{"citation":"resolved","description":"The L4 remediation makes undefined, cyclic and oversize results terminal World-storage failures with a once-only refund, but a result of null passes: JSON.stringify(null) is the string 'null' (and JSON.stringify('') is '\"\"'), so json is non-null, the job is marked 'delivered' with result_json 'null', the GOLD debit stands, and the state is final (refundGold requires 'failed'; admin refund-service requires failed/refunded). A provider adapter that resolves {kind:'delivered',result:null} on an empty upstream body (a common HTTP-client default) therefore charges the player for nothing with no lawful refund path, the same outcome L4 was meant to close. Fix: treat null (and an empty string/object) like undefined: failure='RESULT_NOT_SERIALIZABLE' or a dedicated RESULT_EMPTY with the existing world-result-unusable evidence and refund; have runGoldServiceJobs reject delivered outcomes without a non-null result before calling finishGoldJob.","line":91,"path":"world-source/server/world-gold.ts","reproduction":"Scratch node:test with tests/world-gold-audit5-fixture.mjs: topup (book '10'), id=await f.service() (research, book '7'), a=await claimGoldJob(db,id,NOW); finishGoldJob(db,{orderId:id,attempt:a,nowMs:NOW+1,outcome:{result:null}}). Expected: terminal failure with evidence kind 'world-result-unusable' and book back to '10' (as for result:undefined). Actual: no error; SELECT state,result_json,failure FROM world_gold_jobs -> {state:'delivered',result_json:'null',failure:null}; book stays '7'; refundGold(db,id,NOW+2) rejects REFUND_NOT_ENTITLED. Negative control in the same run: a second service order finished with {result:undefined} becomes state 'refunded' failure RESULT_NOT_SERIALIZABLE.","severity":"low","snippet":" if('result' in args.outcome){try{json=JSON.stringify(args.outcome.result)??null;}catch{failure='RESULT_NOT_SERIALIZABLE';}if(json===null)failure??='RESULT_NOT_SERIALIZABLE';else if(new TextEncoder().encode(json).length>16000){json=null;failure='RESULT_TOO_LARGE';}}","title":"finishGoldJob accepts a provider result of null (or an empty string) as a delivered, chargeable result with no refund path"},{"citation":"resolved","description":"validateMintProof rejects mode private-chain-fixture when the stored binding is not chain 31337, and the migration 0015 trigger world_gold_mint_proof (line 36: mode='finalized-chain' OR (OLD.chain_id=31337 AND mode='private-chain-fixture')) mirrors that. Neither side enforces the converse: a proof claiming mode finalized-chain is accepted for a hold whose stored chain_id is 31337. The remediation says the ledger validates the complete original namespace and that the included reader is PRIVATE EDR ONLY, but the mode label, the only field distinguishing a deployment-pinned finalized reader from a fixture reader, does not bind to the stored namespace in the private direction. A misconfigured or mislabelled server reader (a production-mode adapter pointed at a 31337 namespace, or a fixture reader copying the production proof template) releases or consumes a private hold while recording evidence_json that asserts finality it cannot have; world_gold_mint_settlements is immutable, so the false label is permanent. orderId/wallet/gold/chainInstance are still compared, so no GOLD is created or double-spent; this is an evidence-integrity and audit-classification gap. Fix: require (e.mode==='private-chain-fixture')===(m.chainId===31337) in validateMintProof and replace the OR in the trigger with an exact per-chain mapping; add the negative case to the L6 test and the SQL guard-removal calibration.","line":125,"path":"world-source/server/world-gold.ts","reproduction":"Scratch node:test with the audit5 fixture: topup (book '10'); m={...f.mint(),chainId:31337}; reserveMintGold(db,m,NOW) (reserved '8'). settleMintGold(db,{id:m.id,chainId:31337,contract:m.contract,chainInstance:m.chainInstance,state:'released',evidence:mintProof(m,'released',{mode:'finalized-chain'})},NOW+1). Expected: MINT_EVIDENCE_REQUIRED (a 31337 binding is private-only) with reserved staying '8'. Actual: accepted; world_gold_mints shows state 'released' with json_extract(evidence_json,'$.mode')='finalized-chain', reserved '0', and world_gold_mint_settlements holds an immutable row with mode 'finalized-chain' for chain 31337. Negative control: the same proof with mode private-chain-fixture on a chainId 1 binding is rejected MINT_EVIDENCE_REQUIRED.","severity":"low","snippet":" if(!e||e.schema!=='ember-mint-proof-v1'||!['finalized-chain','private-chain-fixture'].includes(e.mode)||(e.mode==='private-chain-fixture'&&m.chainId!==31337)||e.orderId!==m.id||e.wallet!==m.wallet||e.gold!==m.gold||e.chainId!==m.chainId||e.contract!==m.contract||e.chainInstance!==m.chainInstance||!hash(e.blockHash)||!uint(e.blockNumber)||!Number.isSafeInteger(e.chainTimeMs)||e.chainTimeMs<=0||!uint(e.tokenId)||typeof e.revoked!=='boolean')fail('MINT_EVIDENCE_REQUIRED');","title":"Mint proof mode is bound one-way: a proof labelled finalized-chain is accepted for a private 31337 hold by both validateMintProof and the 0015 SQL mirror, storing a false finality claim in immutable s"},{"citation":"resolved","description":"reserveMintGold validates id, deadline, chainId and chainInstance with coded INVALID_MINT_AUTH refusals, but the auth payload is only size-checked after JSON.stringify. JSON.stringify returns undefined for undefined, functions and symbols, so encoded.length dereferences undefined and the function escapes with a TypeError before the stored-binding retry comparison (line 104), the mint feature pause check and the hold insert run. No GOLD is moved and no hold row is written, so this is a robustness/diagnostics gap at the shared-ledger boundary the production Mint adapter is expected to call (SCOPE: adapters must supply the complete binding), not a spend bypass; only server callers reach the function and the bundled fixture adapter always passes an object. Fix: treat encoded===undefined (or typeof m.auth!=='object'||m.auth===null) as fail('INVALID_MINT_AUTH') before reading .length, and add a regression that auth undefined rejects INVALID_MINT_AUTH leaving world_gold_mints/world_gold_holds empty.","line":102,"path":"world-source/server/world-gold.ts","reproduction":"Scratch node:test with the audit5 fixture (fresh in-memory D1, all migrations, wallet W book '10'). reserveMintGold(db,{...f.mint(H(2)),auth:undefined},NOW). Expected: Error('INVALID_MINT_AUTH'). Actual: TypeError: Cannot read properties of undefined (reading 'length'). Same TypeError for auth:()=>1 and auth:Symbol('x'); world_gold_mints count stays 0. Positive control: auth:{a:1} with the same binding succeeds and an identical retry returns silently with one world_gold_mints row.","severity":"low","snippet":" const encoded=JSON.stringify(m.auth);if(encoded.length>16000)fail('INVALID_MINT_AUTH');","title":"reserveMintGold throws an uncaught TypeError instead of a coded INVALID_MINT_AUTH refusal when the Mint binding carries a non-serializable auth value"},{"citation":"resolved","description":"LocalChainService.approval() (mint/service/chain.mjs line 71) awaits beforeApproval before it branches on packet.route (line 84), and the shared runtime binds it to goldFeature(db,'mint'). An administrator control mint enabled:false, intended to stop new GOLD hold admissions for paid Mint, therefore also rejects free-route approvals, which involve neither EMBEO nor GOLD. REQUIREMENTS.md: 'Pause only new admissions by feature' and one eligible free Mint 'without either fee'. Free/paid simultaneity holds only while the pause is off. This is private fixture wiring, not production code, but it is the reference adapter a production consumer is said to follow. Fix: call the feature check inside the paid branch (next to gold.reserve) or pass the route to beforeApproval and check only for route==='paid'.","line":23,"path":"world-source/scripts/world-gold-local-runtime.mjs","reproduction":"Private EDR with contracts npm ci: r=await createGoldLocalRuntime(); goldAdminCommand(r.db,{wallet:ECONOMY_TREASURY,requestId:uuid,command:{action:'control',feature:'mint',enabled:false,version:0},reason:'review probe pause',nowMs:Date.now()}); r.mint.approval({wallet:'A',look:initialLook(),route:'free'}). Expected: a free approval packet (no GOLD involved). Actual: rejects FEATURE_PAUSED (paid approval also rejects FEATURE_PAUSED, as intended). Control: after control mint enabled:true version:1 the same free approval returns a packet with route 'free'.","severity":"info","snippet":" mint.beforeApproval=()=>goldFeature(db,'mint');","title":"Fixture runtime wires the GOLD 'mint' feature pause into every Mint approval, so pausing GOLD holds also blocks fee-free free Mints"},{"citation":"resolved","description":"The deployed Worker constructs its economy dependencies with only config:reviewedEconomyConfig (worker/app.ts line 145) and no delivery provider, so hasGoldDeliveryProvider(economy.delivery) is false, serviceReady is false for every request, goldQuote for service products fails SERVICE_DELIVERY_UNAVAILABLE, sharedServiceAdmission blocks challenges and debits, and the control action cannot enable the service feature. That is the intended closed state. It also means that in production paid service jobs cannot be delivered or refunded (runGoldServiceJobs never runs), held Mint reservations cannot be settled (no reader or reconcileHeldMintGold caller exists in worker/app.ts), and the only MintProofReader in the packet is the private EDR fixture. Recorded so that passing fixture suites are not read as closure. Not proved by this review: real AIMarket/fortune/VPS delivery, public-chain finality, persistent namespace registry, real wallets, D1/CPU capacity, migration/rollback/postflight. Verified on this tree from a scratch copy with viem and the contracts lock installed (Node 24.21): tests/world-gold-audit5.test.mjs and world-gold-audit5-adversarial.test.mjs 27/27 pass including the EDR-backed L8 reset refusal; aimarket Python 10/10 pass. Prior findings M1, M2, L3, L4, L5, L6, L7, L8, L9, I10, I11 and the second-inspection hardening are closed by the cited code paths except for the residual edges reported above (settlement-journal capacity, pre-0015 reconcile, identity-expiry classification, legacy GOLD orders). Nothing in this review authorises deployment.","line":8,"path":"world-source/server/economy-deployment.ts","reproduction":"grep -n 'return null' world-source/server/economy-deployment.ts -> line 8; grep -n 'delivery\\|reconcileHeldMintGold\\|settleMintGold' world-source/worker/app.ts -> delivery appears only as the optional EconomyWorkerDeps field and the hasGoldDeliveryProvider guard; no reconcileHeldMintGold or settleMintGold call exists. createWorker(gateway) with the default economy argument then handling POST /api/gold/quote for an enabled service product by an admin EOA session returns 409 SERVICE_DELIVERY_UNAVAILABLE (packaged I11 test). Expected and actual agree (closed); recorded as a gate.","severity":"info","snippet":"export async function reviewedEconomyConfig():Promise<EconomyConfig|null>{return null;}","title":"Release gates confirmed open, not implementation defects: reviewedEconomyConfig returns null and no delivery consumer or Mint proof reader is bound in the deployed Worker entry"}],"hash":"38f4b026963f92f731ee16e153f2806f79fc0b4dc9880f449711545e320eb269","nodeId":"686ddace-8927-41e8-8740-64ef9c726c87","outcome":"completed","summary":"The review is complete. The findings file `.imd-findings.json` holds 10 entries, every one reproduced against the pinned tree in a scratch copy with viem, the contracts lock and the private EDR chain installed outside the repository.\n\n**What I reproduced and kept**\n\n- **Medium.** A wallet lawfully driven to the int64 book limit (1024 purchases of a 2^53-1 GOLD product plus one of 1023, all accepted by the 0015 capacity trigger) makes `settleEconomy` abort on the CHECK constraint in one page, which rolls back every other staker's daily reward and repeats on every later run. Positive control without the topups settles both wallets. This is the one finding where the 0015 guard covers `world_gold_entries` but not the staking journal.\n- **Low, merged from two specialists.** A Worker deployed ahead of migration 0015 fails every reconcile tick and the player reconcile route with a raw \"no such table\" error while quotes and payments still proceed, so paid topups sit uncredited.\n- **Low.** Catalogue GOLD orders created through the legacy economy route pay while the service feature is paused, with no delivery readiness and no job row, leaving a debit with no refund entitlement. Only reachable once a reviewed config with a GOLD catalogue entry ships.\n- **Low.** The AIMarket consumer turns an identity whose `expires_at` just passed into `BridgeUnavailable` rather than a deny, keeps the session row, and makes the login path's own expiry deny unreachable.\n- **Low.** The Mint service reuses a reserved paid authorization at chain time equal to the deadline; the reused packet reverts on chain with `APPEARANCE_EXPIRED`. Verified on the real EDR chain, with the 299-second control minting successfully.\n- **Low.** A delivered result of `null` or an empty string is stored as delivered and charged with no refund path, while `undefined` correctly refunds.\n- **Low, merged from two specialists.** A proof labelled `finalized-chain` is accepted for a 31337 hold by both the server validator and the SQL trigger, and the false finality label lands in the immutable settlement table.\n- **Low.** `reserveMintGold` escapes with a TypeError on a non-serializable auth value instead of a coded refusal.\n- **Info.** The fixture runtime's mint pause also blocks fee-free free Mint approvals, verified on EDR.\n- **Info.** Release gates remain open by construction: null reviewed config, no bound delivery consumer, no production Mint proof reader. Recorded so fixture passes are not read as launch approval.\n\n**What I dropped.** The admin replay acknowledgement note is not a defect since the HTTP layer re-authorizes before the call. The two \"could not run EDR\" coverage notes are superseded: the L8 reset refusal and the EDR-backed audit5 suite ran here and passed 27 of 27, and the Python trial suite passed 10 of 10.\n\nNo files in the repository were changed beyond the findings file, and no Solidity finding reached a severity that required a Foundry proof.","treeHash":null,"usage":{"cachedInputTokens":2213585,"inputTokens":674,"model":"claude-fable-5-1","outputTokens":33918,"runtime":"claude","turns":35,"wallClockMs":407337}},{"artifacts":[],"attempt":1,"bundleHash":null,"device":"fa5c50e7abe46571","findings":[{"citation":"resolved","description":"M1 was closed for the trial claim: _identity() (lines 251-254) now normalises an active trial whose endsMs has passed at the consumer's clock to inactive, and the holder path survives (verified: session_eligible with world_trial endsMs=NOW-20 and NOW returns (ADDRESS, True) with _balance patched True; external profile with an active trial returns (ADDRESS, False)). The same latency/skew pattern is still a hard failure one line earlier for the identity's own expiry. World's introspect (server/aimarket-auth.ts:145-152) answers 200 only while MIN(bridge.expires_at, session.expires_at) > World's clock, so the consumer can receive expires_at <= its own _now_ms() only through transit latency or when AIMarket's clock runs ahead of World's. In that state _identity() raises BridgeUnavailable('invalid_world_response') from the structural check, which (a) session_eligible() (lines 366-373) does not catch, so every portal read of a session in its final skew-window milliseconds errors out as a bridge outage instead of being revoked and denied, and (b) complete_login() (lines 307-322) never reaches its own deny branch `if expiry <= _now_ms(): raise BridgeDenied('source_session_expired')` at line 321, which is therefore dead code for the only input that could trigger it. The expected behaviour, consistent with the trial fix and with REQUIREMENTS.md ('fresh rechecks', 'revocation remains closed'), is a clean deny: an expired identity is not a malformed one. Impact is availability/misclassification only, bounded by the skew plus latency window on each session; no access is granted, so severity is low. Fix: in _identity() keep the type and upper-bound checks as structural failures but let `expiry <= _now_ms()` raise BridgeDenied (or return the identity and let the callers' existing expiry logic deny it: session_eligible line 380-384 already shrinks expires_at and returns (None, False); complete_login line 321 already denies). Regression: add to aimarket/test_world_trial_audit5.py a case with expires_at=NOW and NOW-1 asserting session_eligible('S'*43, require_profile='world') == (None, False) and that the world_sessions row is removed, and a complete_login case asserting BridgeDenied('source_session_expired') rather than BridgeUnavailable.","line":243,"path":"aimarket/web/world_auth.py","reproduction":"python3 (stdlib) in aimarket/ with sys.path including the directory, AIMARKET_BRIDGE_SECRET set to a 32+ char value, AIMARKET_WORLD_STATE_DB in a temp dir, w._now_ms patched to NOW=2_000_000_000_000. Insert world_sessions(token_hash=_digest('S'*43), address=0xaa..aa, bridge_session='B'*43, expires_at=NOW+5000, profile='world'). Patch _world_post to return {issuer:ISSUER, audience:CLIENT_ID, scope:'research:read', address, bridge_session:'B'*43, expires_at:EXP, world_trial:{active:True,endsMs:NOW+1000,version:1}} and _balance to return True. session_eligible('S'*43, require_profile='world'): EXP=NOW+1 -> ('0xaa..aa', True) [positive control]; EXP=NOW -> actual: raises BridgeUnavailable('invalid_world_response'); EXP=NOW-1 -> actual: raises BridgeUnavailable('invalid_world_response'). Expected for EXP<=NOW: (None, False) with the session revoked, i.e. the same clean deny World itself would give one round-trip later. Negative controls in the same run: world_trial endsMs=NOW-20 and endsMs=NOW with EXP=NOW+10000 -> ('0xaa..aa', True) (M1 closed); profile 'external' with an active trial and _balance False -> ('0xaa..aa', False).","severity":"low","snippet":"            or type(expiry) is not int or expiry <= _now_ms() or expiry > _now_ms() + 7 * 86400_000 + 60_000):","title":"AIMarket consumer classifies a bridge identity whose expires_at has just passed (latency/clock skew) as a malformed World response and raises BridgeUnavailable instead of denying; the source_session_e"},{"citation":"resolved","description":"L9 was closed correctly for the RPC/config/limiter dimension: maintainGold runs under Promise.allSettled independently of syncEconomy (verified: with ECONOMY_CHAIN_LIMITER returning success:false the economy_sync tick logs unavailable while gold maintenance still runs on a full schema, and the packaged L9b test passes). The new regression is in the schema dimension. maintainGold decides that the shared-GOLD tables exist by probing world_gold_jobs (created by 0014), but reconcileWorldGold (server/world-gold.ts:63, 65, 69, 72-73) now unconditionally LEFT JOINs and writes world_gold_reconcile_errors, which only exists after 0015. The codebase explicitly treats 'a deploy that ran ahead of a migration' as a supported state (tests/d1-sqlite.mjs openD1(files) comment; the economy-recovery planner and sharedServiceAdmission both probe sqlite_master before touching new tables), and 0015 is described as additive. In that state: the minute cron's maintainGold rejects every tick (logged as gold_maintenance unavailable), so EMBEO topups that are already paid and indexed are never credited and 'failed' jobs are never refunded; the player's POST /api/gold/orders/:id/reconcile (server/world-gold-api.ts:65) throws the same error and answers 503 GOLD_UNAVAILABLE; the admin repair-topup path still works because it does not touch the errors table. No GOLD is lost (orders stay paid and immutable; crediting resumes once 0015 is applied), so this is a liveness/ordering defect, low severity, but it is exactly the failure class the guard on this line exists to prevent. Fix: either probe for world_gold_reconcile_errors (the newest required table) on this line and skip with a log when absent, or make reconcileWorldGold degrade when the table is missing (probe sqlite_master once and omit the LEFT JOIN / error bookkeeping), mirroring sharedServiceAdmission. Regression: open openD1(migrationFiles().filter(n=>Number(n.slice(0,4))<15)), quote+pay a topup, run worker.scheduled with cron '* * * * *' and assert either the book becomes 10 or the tick returns a coded skip without throwing; assert POST reconcile does not 503 with a raw SQLite message.","line":158,"path":"world-source/worker/app.ts","reproduction":"Node 24, world-source with viem installed, scratch test using tests/d1-sqlite.mjs: db=openD1(migrationFiles().filter(n=>Number(n.slice(0,4))<15)) (0001..0014 applied, 0015 absent). Admin publishes product pack (topup, gold 10, embeo 7); wallet W quotes pack via goldQuote; ingestEconomyEvents records the matching Paid event at block 100 -> economy_orders.status='paid'. Then: reconcileWorldGold(db,NOW) -> actual: throws 'no such table: world_gold_reconcile_errors'; reconcileWorldGold(db,NOW,orderId) (the player route) -> same throw; worldGoldSnapshot(W).book stays '0'. createWorker({},fetch,()=>NOW,undefined,()=>undefined,{config:async()=>config}).scheduled({cron:'* * * * *'},{DB:db,ECONOMY_CHAIN_LIMITER:{limit:async()=>({success:false})}},ctx) -> logs ['economy_sync {\"status\":\"unavailable\"}','gold_maintenance {\"status\":\"unavailable\"}'] and book remains '0'. Expected: the paid topup is credited (book '10') or the tick skips with a coded, logged reason without touching the DB. Positive control: the identical sequence on openD1() with all migrations credits book '10' on the first tick (packaged tests Audit L9a/L9b and I10 pass on this tree).","severity":"low","snippet":"    if(!env.DB||!await env.DB.prepare(\"SELECT name FROM sqlite_master WHERE type='table' AND name='world_gold_jobs'\").first())return;","title":"Worker GOLD maintenance guard checks only for the 0014 world_gold_jobs table, so on a database where 0015 is not yet applied every cron tick and every player reconcile throws 'no such table: world_gol"},{"citation":"resolved","description":"Verified on this tree with the packaged suites re-run from a scratch copy (tests/world-gold-audit5.test.mjs and world-gold-audit5-adversarial.test.mjs: 27 pass including the EDR-backed L8 reset refusal and map-loss cases; aimarket Python: 10 pass) plus independent probes that are not in the packet: (1) serviceReady false/undefined at pay time after a ready challenge rejects SERVICE_DELIVERY_UNAVAILABLE with no debit; pausing after payment still lets a provider-confirmed failure refund and a paid replay return; (2) cyclic, undefined, BigInt and function results all become state 'refunded' with failure RESULT_NOT_SERIALIZABLE and an immutable world-result-unusable evidence row, a late worker gets STALE_DELIVERY, and raw UPDATE of delivery_evidence_json aborts; a bare {failure} or a proof missing reference is rejected with the job left 'working'; runGoldServiceJobs with pending/throwing/malformed-proof/malformed-code providers never refunds and later settles once with the provider reference stored; (3) Mint: wall time past deadline with chainTimeMs<=deadline and revoked=false is MINT_AUTH_EXECUTABLE, revoked:'true' string is MINT_EVIDENCE_REQUIRED, consumed with tokenId '0' or missing transactionHash is MINT_PROOF_CONFLICT, wallet/gold mismatch is MINT_EVIDENCE_REQUIRED, every retry field mismatch (gold, deadline, chainInstance, auth, wallet, chainId, contract) is MINT_ORDER_CONFLICT, consume then release replay yields one mint-payment entry, one settlement with before {held,10,8}/after {consumed,2,0}, and zero write_checks rows; reconcileHeldMintGold with a different chainInstance reports MINT_SCOPE_MISMATCH without consulting the reader, and a still-executable proof is 'pending' even 10 days of wall time later; (4) recovery: pre-0014 and pre-0015 plan ready/totalDelta 0; dropping world_gold_holds, world_gold_entries or world_gold_mint_settlements gives RECOVERY_SCHEMA_MISSING from both planner and preflight (no TypeError); (5) overflow: a 2^63-1 legacy journal balance makes only that order fail with GOLD_BALANCE_CAPACITY, a cooldown row (retry_ms now+300000, attempts increments), repair-topup fails with the same code, the order stays paid and uncancelled; (6) an injected BEFORE INSERT trigger on world_gold_jobs rolls back journal, paid status and challenge together and the same signed challenge pays once afterwards; two concurrent pays of one challenge produce one service-payment journal row; (7) enabling 'service' without the trusted runtime capability, by a non-admin, or with a stale control version is refused; campaign bounds are half-open; admin actions leave no scratch rows. Not proved and still open as documented release gates (not defects): reviewedEconomyConfig returns null on this line and createWorker's default EconomyWorkerDeps binds no delivery provider, so production service admission is closed by construction; the only MintProofReader is the private EDR reader; evidence is a validation contract, not cryptographic proof; the treasury is one of the three admin wallets and versioned pricing can be generous for new orders. The two low findings above are the only new cross-boundary regressions found; nothing in this review authorises deployment.","line":8,"path":"world-source/server/economy-deployment.ts","reproduction":"grep -n 'return null' world-source/server/economy-deployment.ts -> line 8; grep -n 'delivery' world-source/worker/app.ts -> the EconomyWorkerDeps.delivery seam is optional and the exported default passes {config:reviewedEconomyConfig} only; from a scratch copy with viem/@noble installed and contracts npm ci: node --test tests/world-gold-audit5.test.mjs tests/world-gold-audit5-adversarial.test.mjs -> 27 pass 0 fail; cd aimarket && python3 -m unittest test_world_trial test_world_trial_audit5 -> 10 OK.","severity":"info","snippet":"export async function reviewedEconomyConfig():Promise<EconomyConfig|null>{return null;}","title":"Prior-finding closure verified independently (M1, M2, L3-L9, I10, I11, second-inspection hardening); remaining items are explicit release gates, not implementation defects"}],"hash":"dc455133b25b660c82bad269f5bd01db1b52280b051dfab674ca4dfca2725615","nodeId":"e22cfd1e-f995-45e3-a8ba-5e9c454b9f25","outcome":"completed","summary":"The findings file is valid, all three snippets match the tree exactly, and the working tree is clean (no files changed; only `.imd-findings.json` was created in the repo root as instructed).\n\n## Summary\n\n**Outcome:** All 12 prior items and the second-inspection hardening are closed on this tree. I verified them independently rather than from the packaged logs: the packaged Node suites pass from a scratch copy with the pinned dependencies (27 of 27, including the real EDR reset-refusal and map-loss cases), the Python trial suites pass (10 of 10), and my own probes against boundaries the packet does not exercise all held. I found two new low-severity cross-boundary regressions and no exploitable defect.\n\n**Findings written to `.imd-findings.json`:**\n\n- **Low, `aimarket/web/world_auth.py:243`.** The M1 fix normalises an expired trial, but the identity's own `expires_at` one line earlier is still a structural hard failure. Under latency or AIMarket-ahead clock skew, a just-expired bridge identity raises `BridgeUnavailable` instead of a clean deny, so portal reads error out and the `source_session_expired` deny branch in `complete_login` is unreachable. No access is granted. Reproduced with `expires_at = NOW` and `NOW-1`, with positive and negative controls.\n\n- **Low, `world-source/worker/app.ts:158`.** The cron's GOLD maintenance guard probes only the 0014 table `world_gold_jobs`, but `reconcileWorldGold` now requires the 0015 table `world_gold_reconcile_errors`. On a database where the Worker is deployed ahead of migration 0015, every maintenance tick and every player reconcile throws a raw SQLite error, and already-paid topups are not credited until the migration lands. No GOLD is lost. Reproduced with a 0001 to 0014 schema through both the function and the scheduled handler.\n\n- **Info.** A record of what was verified (pause and readiness at pay time, unusable-result terminality and evidence immutability, Mint proof strictness and retry binding, consume/release replay yielding one debit and one receipt, schema-missing coded refusals, per-order overflow isolation, injected job-write rollback, admin CAS and campaign bounds) and of the explicit release gates that remain open by design: production economy config returns null, no delivery consumer is bound, the only Mint reader is the private EDR fixture, and evidence is a validation contract rather than cryptographic proof.\n\n**Limits of this review.** I did not run the full 2837-test workspace, the workerd D1 script, or anything against a public chain. The two findings are liveness and classification defects, not fund-loss paths. Nothing here is a deployment approval.","treeHash":null,"usage":{"cachedInputTokens":2393290,"inputTokens":546,"model":"claude-fable-5-1","outputTokens":51481,"runtime":"claude","turns":42,"wallClockMs":751991}},{"artifacts":[],"attempt":1,"bundleHash":null,"device":"dd3018ab6b18e7bc","findings":[{"citation":"resolved","description":"reserveMintGold validates id, deadline, chainId and chainInstance with coded INVALID_MINT_AUTH refusals, but the auth payload is only size-checked after JSON.stringify. JSON.stringify returns undefined for undefined, functions and symbols, so `encoded.length` dereferences undefined and the function escapes with \"TypeError: Cannot read properties of undefined (reading 'length')\" before the stored-binding comparison, the mint feature pause check and the hold insert run. The retry-comparison hardening (line 104, old.auth_json!==encoded) therefore never sees a canonical value for these inputs either. No GOLD is moved and no hold row is written, so this is a robustness/diagnostics gap at the shared-ledger boundary the production Mint adapter is said to await (SCOPE: adapters must supply the complete binding), not a spend bypass. Only server callers reach the function; the bundled fixture adapter always passes an object. Fix: treat `encoded===undefined` (or typeof m.auth!=='object'||m.auth===null) as fail('INVALID_MINT_AUTH') before taking .length, and add a regression that reserveMintGold with auth undefined rejects with INVALID_MINT_AUTH and leaves world_gold_mints/world_gold_holds empty. Positive control in the same probe: an identical retry of a valid binding returns silently; a retry with deadline+1 fails MINT_ORDER_CONFLICT; settle replay with empty evidence after release is idempotent; consume-after-release fails MINT_STATE_CONFLICT; world_gold_write_checks is empty after every batch.","line":102,"path":"world-source/server/world-gold.ts","reproduction":"Fresh in-memory D1 (tests/d1-sqlite.mjs openD1(), all migrations). Admin product pack gold=10, a paid EMBEO topup order for wallet A linked to pack:1, reconcileWorldGold -> A book 10. Call reserveMintGold(db,{id:\"0x\"+\"2\".repeat(64),wallet:A,auth:undefined,gold:\"1\",chainId:31337,contract:\"0x\"+\"4\".repeat(40),chainInstance:\"run-1\",deadline:NOW+10000},NOW+4). Expected: Error(\"INVALID_MINT_AUTH\"). Actual: TypeError: Cannot read properties of undefined (reading 'length'). Same TypeError for auth:()=>1 and auth:Symbol(\"x\"). Negative control: auth:{a:1} with the same binding succeeds and a second identical call returns without error.","severity":"low","snippet":" const encoded=JSON.stringify(m.auth);if(encoded.length>16000)fail('INVALID_MINT_AUTH');","title":"reserveMintGold throws an uncaught TypeError instead of a coded refusal when the Mint binding carries a non-serializable auth value"},{"citation":"resolved","description":"The server rejects a private-chain-fixture proof whose binding is not chain 31337, and the migration 0015 trigger world_gold_mint_proof mirrors that (line 36: mode='finalized-chain' OR (OLD.chain_id=31337 AND mode='private-chain-fixture')). Neither side enforces the converse: a proof that claims mode finalized-chain is accepted for a hold whose stored chain_id is 31337. The remediation text says the ledger \"validates complete original order/wallet/cost/namespace and canonical block/outcome fields\" and that the included reader is PRIVATE EDR ONLY, but the mode label, which is the only field distinguishing a deployment-pinned finalized reader from a fixture reader, does not bind to the stored namespace in the private direction. A misconfigured or mislabelled server reader (for example a production-mode adapter pointed at a 31337 test namespace, or a fixture reader that copies the production proof template) releases or consumes a private hold while recording evidence_json that asserts finality it cannot have. The shipped reader always emits private-chain-fixture, so this is an asymmetry in the internal validation contract rather than a reproduced spend; it does matter for the audit trail, because world_gold_mint_settlements is immutable and would permanently carry a false finality claim. Fix: in validateMintProof require (e.mode==='private-chain-fixture')===(m.chainId===31337) and in the trigger require (mode='finalized-chain' AND OLD.chain_id<>31337) OR (mode='private-chain-fixture' AND OLD.chain_id=31337); add a regression that a finalized-chain proof for a 31337 hold fails MINT_EVIDENCE_REQUIRED on both the server and the SQL guard-removal calibration.","line":125,"path":"world-source/server/world-gold.ts","reproduction":"Fresh in-memory D1 with all migrations; wallet A holds 10 GOLD via a reconciled paid topup. reserveMintGold(db,{id,wallet:A,auth:{a:1},gold:\"1\",chainId:31337,contract,chainInstance:\"run-1\",deadline:NOW+10000},NOW+4). settleMintGold(db,{id,chainId:31337,contract,chainInstance:\"run-1\",state:\"released\",evidence:{schema:\"ember-mint-proof-v1\",mode:\"finalized-chain\",orderId:id,wallet:A,gold:\"1\",chainId:31337,contract,chainInstance:\"run-1\",blockHash:\"0x\"+\"5\".repeat(64),blockNumber:\"7\",chainTimeMs:NOW+20000,tokenId:\"0\",revoked:false}},NOW+6). Expected: MINT_EVIDENCE_REQUIRED (a 31337 binding is private-only). Actual: accepted; world_gold_mints shows state released with json_extract(evidence_json,'$.mode')='finalized-chain' and world_gold_mint_settlements has an immutable row carrying that label. Negative control: the same proof with mode private-chain-fixture on a chainId 1 binding is rejected by the server check on this line.","severity":"low","snippet":" if(!e||e.schema!=='ember-mint-proof-v1'||!['finalized-chain','private-chain-fixture'].includes(e.mode)||(e.mode==='private-chain-fixture'&&m.chainId!==31337)||e.orderId!==m.id||e.wallet!==m.wallet||e.gold!==m.gold||e.chainId!==m.chainId||e.contract!==m.contract||e.chainInstance!==m.chainInstance||!hash(e.blockHash)||!uint(e.blockNumber)||!Number.isSafeInteger(e.chainTimeMs)||e.chainTimeMs<=0||!uint(e.tokenId)||typeof e.revoked!=='boolean')fail('MINT_EVIDENCE_REQUIRED');","title":"Mint proof mode binding is one-way: a proof labelled finalized-chain is accepted for a private 31337 hold by both validateMintProof and the 0015 SQL mirror"},{"citation":"resolved","description":"A repeated admin requestId with an identical payload returns at this line before authCheck is evaluated, so the authorization argument is never consulted for a replay and the function resolves to undefined (the API then answers {ok:true} with no result field). The HTTP route (world-gold-api.ts lines 41-47 and 57) reads the session twice, requires the wallet to be one of the three admin wallets and an EOA/ECDSA session before calling this function, so there is no privilege bypass: a non-admin or a revoked session never reaches the function, and a replay changes no state. Reported as an asymmetry for completeness: the SQL-level session EXISTS that protects first execution does not protect the acknowledgement, and the client cannot distinguish a replay acknowledgement from a fresh execution. Fix (optional): return the stored action id and a replayed:true flag, or run the authCheck statement before returning. Verified closed in this review for the assigned area: same-origin plus Origin requirement on writes, expected-address match, double readSession, ERC-1271 sessions limited to reads, three fixed admin wallets (treasury included, documented), CAS versions on controls/products/campaigns, admin before/after evidence copied into the immutable world_gold_admin_actions row, world_gold_write_checks deleted inside every batch (0 rows after each probe), no balance setter, service control plus serviceReady enforced at quote, challenge and debit (economy-ledger.ts sharedServiceAdmission) with the queued job written in the same debit batch, finishGoldJob attempt/lease fencing (late attempt -> STALE_DELIVERY), delivered/refunded states terminal, Python _identity normalising an expired trial to inactive while keeping the holder path (10/10 Python tests pass), external profile never granted a trial, reset refusal before provider disconnect in mint/service/chain.mjs line 28.","line":166,"path":"world-source/server/world-gold.ts","reproduction":"goldAdminCommand(db,{wallet:OWNER,requestId:\"r\".repeat(20),command:{action:\"product\",product:\"pack\",kind:\"topup\",title:\"p\",gold:\"10\",embeo:\"1\",enabled:true,version:1},reason:\"seed\",nowMs:NOW}) once without authorization, then again with authorization:{tokenHash:\"nosuch\"} (no sessions row). Expected (strict reading): the replay is re-authorized or returns an explicit replayed acknowledgement. Actual: resolves to undefined with no error and no new row. Control: the first call with the same bogus tokenHash fails the CHECK(accepted=1) constraint and writes nothing.","severity":"info","snippet":" const old=await st(db,'SELECT payload FROM world_gold_admin_actions WHERE id=?',id).first<{payload:string}>();if(old){if(old.payload!==payload)fail('IDEMPOTENCY_CONFLICT');return;}","title":"goldAdminCommand replays short-circuit before the live-session SQL predicate and return undefined; HTTP layer compensates"},{"citation":"resolved","description":"The deployed Worker constructs the economy dependencies with only config:reviewedEconomyConfig and no delivery provider, so hasGoldDeliveryProvider(economy.delivery) is false, serviceReady is false for every request, goldQuote for service products fails SERVICE_DELIVERY_UNAVAILABLE, sharedServiceAdmission blocks challenges and debits, and the control action cannot enable the service feature. That is the intended closed state. It also means that in production: paid service jobs cannot be delivered or refunded (runGoldServiceJobs never runs), held Mint reservations cannot be settled (no reader or reconcileHeldMintGold caller exists in worker/app.ts), and the only proof reader in the packet is the private EDR fixture. These are the explicit release gates named in SCOPE.md and the remediation document, listed here so they are not read as closed by the passing fixture suites. Not proved by this review: real AIMarket/fortune delivery, public-chain finality, persistent namespace registry, real wallets, D1/CPU capacity, migration/rollback. Packaged suites run on this machine with Node 22.23 and node:sqlite: world-gold-audit5, audit5-adversarial, world-gold and world-gold-api: 62 of 63 pass; the single failure is the L8 EDR reset test, which refuses to run below Node 24 (NODE_24_REQUIRED) and was therefore not independently reproduced here. Python test_world_trial and test_world_trial_audit5: 10 of 10 pass.","line":145,"path":"world-source/worker/app.ts","reproduction":"grep -n \"delivery\\|reconcileHeldMintGold\\|settleMintGold\" world-source/worker/app.ts: delivery appears only as the optional EconomyWorkerDeps field and hasGoldDeliveryProvider guard; no reconcileHeldMintGold or settleMintGold call exists. createWorker(gateway) with the default economy argument then handling POST /api/gold/quote for an enabled service product by an admin EOA session returns 409 SERVICE_DELIVERY_UNAVAILABLE; enabling the service control returns the same code. Expected and actual agree (closed); recorded as a gate.","severity":"info","snippet":"  edgeCache:()=>EdgeCache|undefined=defaultCache,economy:EconomyWorkerDeps={config:reviewedEconomyConfig}) {","title":"Release gates confirmed open, not implementation defects: no delivery consumer bound and reviewedEconomyConfig null in the deployed entry"}],"hash":"e314ba28e41ebb649c81113eb73fc125a6aeb462b2a665ba7155a22ae82f9595","nodeId":"9454e52f-63c7-4fd6-a295-d417154cdb5a","outcome":"completed","summary":"The review is complete and the findings file is written. The tree is clean apart from the untracked `.imd-findings.json` the task asked for.\n\n**Outcome.** The permissions, trust-gap and asymmetry review of the shared GOLD remediation found no privilege bypass, held-fund cross-spend, replay or wallet-switch authority. All twelve prior items check out as closed at the code level. Two low findings and two informational notes are recorded in `.imd-findings.json`, each with a concrete input and expected-versus-actual result.\n\n**Findings.**\n- **Low:** `reserveMintGold` escapes with an uncaught TypeError when the Mint binding's auth value is undefined, a function or a symbol, instead of the coded INVALID_MINT_AUTH refusal. No GOLD moves, but the retry-comparison hardening never sees a canonical value for these inputs.\n- **Low:** The proof mode check is one-way. A proof labelled finalized-chain is accepted for a private chain 31337 hold by both the server validator and the migration 0015 SQL trigger. Reproduced: the hold is released and the immutable settlement row permanently carries a false finality label. The shipped reader never emits that label, so this is a validation-contract asymmetry, not a reproduced spend.\n- **Info:** An admin command replay returns before the live-session SQL predicate runs and resolves to undefined. The HTTP layer reads the session twice and gates admin wallets first, so there is no bypass.\n- **Info:** Release gates confirmed open rather than defective. The deployed Worker binds no delivery provider and no Mint reader, so service admission stays closed and held Mint reservations have no production settlement path.\n\n**Verification performed.** I ran the four packaged GOLD Node suites with viem installed outside the repository. Results were 62 of 63 passing. The single failure is the L8 EDR reset test, which refuses to run below Node 24, so I could not independently reproduce the reset-refusal behaviour on this machine, though the guard at `mint/service/chain.mjs:28` sits before any provider disconnect as claimed. The ten Python trial tests pass. Scratch probes confirmed identical-binding retries succeed, changed bindings conflict, empty-evidence replays after settlement are idempotent, consume-after-release conflicts, late workers get STALE_DELIVERY, and the write-check scratch table is empty after every batch.\n\n**Not proved.** Real provider delivery, public-chain finality, persistent namespace registry, real wallets, D1 capacity and rollout remain the explicit release gates named in SCOPE.md. Passing fixture suites do not close them, and no deployment is authorized by this report.","treeHash":null,"usage":{"cachedInputTokens":3314703,"inputTokens":738,"model":"claude-fable-5-1","outputTokens":41788,"runtime":"claude","turns":36,"wallClockMs":630847}},{"artifacts":[],"attempt":1,"bundleHash":null,"device":"dc176559ff153c37","findings":[{"citation":"resolved","description":"Remediation L5 added trigger world_gold_credit_capacity (migrations/0015_world_gold_audit_hardening.sql) so that a topup/refund credit which would push economy_gold_accounts.balance past 9223372036854775807 fails per order with GOLD_BALANCE_CAPACITY, a diagnostics row and a cooldown. The same book balance is also credited by the legacy journal: settleEconomy inserts every completed wallet's utc-reward into economy_gold_journal (this line) and trigger economy_gold_apply (0010) runs UPDATE balance=balance+NEW.delta with no capacity check. For a wallet whose book is already at or near int64 capacity, SQLite promotes the sum to REAL and the CHECK(typeof(balance)='integer') on economy_gold_accounts aborts. Because settlement commits one page (up to 32 wallets' journals, the page CAS and the day-completion marker) in one db.batch, the abort rolls back every other wallet's reward for that day, the day never reaches economy_gold_days, and every later run re-selects the identical page and fails identically (lines 166-171 only swallow a version change). No world_gold_reconcile_errors row, cooldown or per-wallet isolation exists on this path, and the minute cron just logs 'unavailable'. Reaching capacity needs only lawful, non-rewritten entitlements under the new per-order limit: goldAdminCommand accepts gold up to WORLD_GOLD_MAX_PRODUCT (2^53-1) per product version, and the capacity trigger deliberately lets a wallet accumulate up to exactly 2^63-1 (1024 orders of 2^53-1 plus 1023). The documented admin pricing power is the only precondition; the player then stakes one 100000-EMBEO unit and, from the next settled day on, no wallet on the chain earns staking GOLD until an operator can somehow reduce that wallet's immutable book (the player can keep it at capacity). This violates REQUIREMENTS 'one overflowing/invalid credit cannot permanently starve other wallets' and 'purchases remain separate from staking corrections' at the shared-book boundary that 0015 left unguarded. Fix: mirror the capacity guard for positive economy_gold_journal inserts (BEFORE INSERT ... WHEN NEW.delta>0 AND balance>MAX-NEW.delta RAISE 'GOLD_BALANCE_CAPACITY'), and in settleEconomy treat that wallet as owed/carried (record it like world_gold_reconcile_errors) while committing the rest of the page, or settle rewards per wallet so one failing journal cannot abort the day. Also consider capping the admissible per-wallet book far below int64 at quote time.","line":162,"path":"world-source/server/economy-ledger.ts","reproduction":"Node 24, world-source dependencies installed (npm ci). Test file test/scratch/capacity-starvation.test.mjs (run from world-source: node --test ../test/scratch/capacity-starvation.test.mjs). Setup: openD1() with all migrations incl. 0015; defineEconomyConfig chainId 1, deploymentBlock '100'; treasury admin publishes topup products 'max' gold='9007199254740991' embeo='1' and 'tail' gold='1023' embeo='1' (both accepted). Wallet X: 1024 goldQuote('max') + one goldQuote('tail'), each paid via ingestEconomyEvents payment events; reconcileWorldGold(db,T) ten times (128 per page) -> failures [] and worldGoldSnapshot(X).book === '9223372036854775807'. Then ingest stake events: X positionId '1' shares '1' at T=Date.UTC(2026,9,16) and Y positionId '2' shares '1' at T+DAY, then an empty batch with throughTimestamp T+2*DAY. settleEconomy(db,config,{nowMs:T+2*DAY}). Expected: wallet Y credited 1 GOLD for its full day (and X for day T..T+DAY if it fits, otherwise X recorded as owed); day rows created. Actual: throws 'CHECK constraint failed: typeof(balance)='integer' AND balance>=0'; economy_gold_journal has 0 utc-reward rows, economy_gold_days has 0 rows; repeated settleEconomy at T+2*DAY and at T+30*DAY rejects identically; economyWalletSnapshot(Y).gold stays '0'. Positive control in the same file: identical stakes without the topups -> X gold '2', Y gold '1'.","severity":"medium","snippet":"      statements.push(bind(db,'INSERT INTO economy_gold_journal(id,wallet,delta,kind,reference,created_ms) VALUES(?,?,?,?,?,?)',`reward:${reference}`,who,String(reward),'utc-reward',reference,nowMs));","title":"int64-capacity wallet aborts the whole UTC staking settlement page forever: one wallet starves every other staker's GOLD rewards (capacity guard covers world_gold_entries only)"},{"citation":"resolved","description":"The copied Mint service treats a reserved paid order as reusable while o.auth.deadline>=now, where now is the latest block timestamp. The contract accepts the appearance and the PaidAuthorization only while block.timestamp<=deadline (EmberEvoGenesisCandidate.sol lines 155 and 192), and every block mined after 'latest' has a strictly larger timestamp, so when now==deadline the existing authorization is already unexecutable: the next block will be at >=deadline+1. Everywhere else the boundary is treated consistently and strictly (reconcileOrders releases when time()>auth.deadline; reserveMintGold refuses m.deadline<=nowMs; validateMintProof and the world_gold_mint_proof trigger release only at chainTimeMs>deadline). This one comparison is off by one. The effect is a reservation retry that hands back a packet that reverts on chain; because the reservation is reused, no fresh GOLD reservation, no fresh signature and no new deadline are produced, so the player's mint attempt fails with APPEARANCE_EXPIRED (gas spent), the reconciliation then releases the hold, and only a further approval call creates a usable order. No GOLD or EMBEO is lost and the shared ledger stays correct, so this is a boundary/liveness defect of the fixture service rather than a theft path; it matters because the same retry comparison is what the second inspection hardened and what a production adapter would copy. Fix: use o.auth.deadline>now (and ideally require a margin such as deadline>now+N blocks' worth of seconds) so a reused packet is always still mineable; mirror the same strictness in any production reservation retry.","line":86,"path":"mint/service/chain.mjs","reproduction":"Private EDR, contracts and world-source dependencies installed. test/scratch/mint-deadline.test.mjs (node --test from the repository root). mint=await createLocalService(); approve EMBEO for wallet A; first=approval({wallet:'A',look:initialLook(),route:'paid'}).packet -> goldAuthorization.deadline == time()+300. admin({action:'advance',seconds:300}) so time()==deadline. second=approval(same wallet/look/route).packet. Expected: either a new reservation/packet with a future deadline or a refusal; the returned packet must be mineable. Actual: second.packetId===first.packetId (reused), transaction({action:'mintPaid',wallet:'A',packet:second}) rejects with code APPEARANCE_EXPIRED stage 'reverted', and state().orders shows that order as 'released'. Negative control in the same file: advance 299 seconds instead -> the packet is reused and mintPaid succeeds with the order 'consumed'.","severity":"low","snippet":"   const existing=[...this.orders.values()].find(o=>o.status==='reserved'&&o.wallet===input.wallet&&o.auth.key===packet.key&&o.auth.deadline>=now&&o.auth.signerEpoch===signerEpoch&&o.auth.recipient===packet.expectedRecipient);","title":"Paid-Mint approval reuses a reserved authorization at chain time == deadline (>= instead of >), handing out a packet that can no longer be mined"}],"hash":"ed8a8b36eb6a6a47f9a17e31d428054de04ca0e57931403fd26103fb474064ee","nodeId":"6df2cfb5-d145-4ef9-aaec-4291f0b5c369","outcome":"completed","summary":"Both findings are recorded and their snippets match the tree (the second differs only by the file's CRLF line ending). I'm wrapping up with time to spare.\n\n## Recap\n\nI audited the math, boundary and numerical-gap surface of the shared GOLD remediation at commit 4505078 (World source 7afdd097): the 0014/0015 SQL triggers, `world-gold.ts`, `economy-ledger.ts`, the recovery planner, the delivery runner, the Python trial consumer, the Mint adapter/reader and the copied Mint service. World and contracts dependencies were installed so the SQL suites and the private EDR could be exercised. Findings are in `.imd-findings.json`; reproductions live under `test/scratch/`.\n\n**Findings (2)**\n\n- **Medium, `world-source/server/economy-ledger.ts:162`.** The new int64 capacity guard protects only `world_gold_entries`. A wallet that lawfully reaches a book of 2^63-1 through versioned topups (1024 orders at the accepted 2^53-1 cap plus 1023) then stakes one unit. The daily UTC settlement page inserts its reward into `economy_gold_journal`, the balance update overflows to REAL, the CHECK aborts the whole page, the day never completes, and every later run fails identically. All other stakers receive nothing from that day on, with no diagnostics row or cooldown. Reproduced in `test/scratch/capacity-starvation.test.mjs` with a positive control. Precondition is the documented generous-pricing admin power.\n- **Low, `mint/service/chain.mjs:86`.** Paid-Mint approval reuses a reserved authorization while `deadline >= now`, but the contract only accepts `block.timestamp <= deadline` and the next block is strictly later. At chain time exactly equal to the deadline the player gets back a packet that reverts with `APPEARANCE_EXPIRED`; the hold is then released. Reproduced on the real EDR in `test/scratch/mint-deadline.test.mjs` with a 299-second negative control. No funds lost; a boundary off-by-one inconsistent with every other deadline comparison in the ledger.\n\n**Prior-item closure checked in my area and found consistent:** M1 trial normalisation and half-open bounds on both sides; M2 missing-table handling and balance-equals-journal invariant; L4 UTF-8 byte sizing, undefined and cyclic results; L5 per-order commit, capacity trigger arithmetic (no subtraction overflow), cooldown; L6 ms/seconds deadline conversions, strict `chainTimeMs > deadline` in JS and SQL; lease fencing with no overlap at the lease boundary; the 2^53-1 cap applied only to new products while old links still credit.\n\n**Not proved here:** production chain finality, real providers and deployment gates remain open as the scope states. Fixture passes are not launch approval.","treeHash":null,"usage":{"cachedInputTokens":4798573,"inputTokens":1058,"model":"claude-fable-5-1","outputTokens":42357,"runtime":"claude","turns":34,"wallClockMs":638801}}],"verification":[]}