Repository navigation
STE-49: escrow is locked before the audit, and a slash pays the reporter - #49
Merged
Merged
Conversation
…hes to a reporter The STE-27 rehearsal had to call onchain.* directly for two things orchestrate() could not express: 1. Lock before audit. orchestrate() ran register, verdict, mint and only then create_audit_request + post_bond, so neither fee nor bond was at stake while the audit ran. open_escrow_job() now locks both first; with escrow_lock="before_audit", orchestrate() closes that same job. 2. Slash to the reporter. _run_escrow always paid the admin. reporter_address now receives the bond; when empty the admin is paid and the step says "explicit fallback". Decisions: - The request_id travels in the journal (CREATE_REQUEST records it) and is never guessed. Before settling or slashing, get_request is read back and must be a Bonded job for this exact skill and version, because a journal is a local file that can be stale or copied. Otherwise nothing moves and the step fails naming what the chain holds. - Default stays "after_verdict" so existing callers do not change. - Resumable: an open job is not re-created, a posted bond not re-posted, a closed job neither re-closed nor silently re-opened. - An invalid reporter (not G...) or unknown mode is refused before any money moves. Tests: pipeline 673 passed (17 new: both orders, journal/chain disagreement x3, crash between create and bond, re-runs, reporter and fallback, invalid config). E2E on testnet (Escrow v1 + Registry/Tokens v2), read back from chain: - SAFE: request #20 Bonded with developer -0.1 / auditor -0.2 / escrow +0.3 USDC while the registry had no record of the bytes; after audit and orchestrate, Settled, net auditor +0.1, developer -0.1, is_verified true. - poisoned: request #21 locked the same way; audit DANGEROUS; Slashed, reporter +0.2, developer fee refunded, auditor -0.2.
…ce, not product behaviour Axel's note on the ACC: in a real report-and-slash flow there is always a reporter; the admin fallback exists for our own seed and rehearsal runs.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linear: STE-49 · ACC by Axel 2026-09-17 · reviewers @axelmatsama @fable
What changes
open_escrow_job()runscreate_audit_request+post_bondbefore the audit. Withescrow_lock="before_audit",orchestrate()closes that same job: it settles on SAFE and slashes otherwise.reporter_address. When that is empty it goes to the admin, and the step detail says "explicit fallback". Per Axel, the code comment now states that this fallback is an operational convenience for our own runs, not product behaviour.after_verdict, so seed and the rehearsal keep their behaviour.Decisions
request_idtravels in the journal and is never guessed.get_requestis read back from chain. It must be a Bonded job for this exact skill_id and version, otherwise nothing is paid and the step names what the chain holds.Tests
E2E (testnet, Escrow v1 + Registry/Tokens v2, balances read back from chain)
is_verifiedtrue.GADNHGAF…+0.2, the developer's fee refunded, auditor −0.2.docs/evidence/ste-49-e2e-escrow-order-2026-09-17.json. Script:pipeline/scripts/e2e_escrow_order.py.