feat: add portable claim-readiness diagnostics fixture and test [0x954dB727f224dAabeA2A506C8aE92029b25339cE] - #695
feat: add portable claim-readiness diagnostics fixture and test [0x954dB727f224dAabeA2A506C8aE92029b25339cE]#695waterWang wants to merge 2 commits into
Conversation
Add committed fixtures and a deterministic test for the solver-facing claim-readiness response so an agent can see reward, refundable bond, external spend, gross cash margin, and one actionable blocker before signing. - Covers 4 scenarios: healthy direct bounty, recovery-reserved bounty, unprofitable bounty, and non-creator failure - Each result exposes the exact next action and never requests a private key or seed phrase - Gross cash margin is clearly distinguished from guaranteed net profit - Test rejects any result that describes a plan, signature, transaction hash, or hosted row as payment - Offline, replayable, and exits 0 Closes NSPG13#682
NSPG13
left a comment
There was a problem hiding this comment.
Thanks for the substantial fixture coverage. The four requested scenarios, fail-closed parsing, private-key avoidance, and payment-language checks are useful.
Changes are required before main:
- The PR says it adds committed fixtures, but every fixture is generated in a temporary directory. Commit the four canonical response fixtures so API, MCP, and SDK consumers can replay the same contract.
scripts/next-agent-claim-readiness.mjsvalidates a standalone JSON formatter rather than the production API/MCP response, so it can pass while the real product regresses. Drive the fixtures through the real claim-readiness projection or deserialize the production schema in its owning Rust crate.external_spendcurrently accepts negative values and the code trusts the suppliedgross_cash_marginwhile separately calculatingprofit_outlook. This allows contradictory or inflated economics. Require unsigned external spend and derive/assertgross_cash_margin = solver_reward - required_external_spend; keep it explicitly distinct from guaranteed net profit.- Add the focused replay to
scripts/check.py.
Please run the focused test and python scripts/check.py --platform posix. A collaboration branch is reasonable after these production-contract and economics issues are fixed. #682 is not canonically funded; only BountySettled proves payment.
|
This PR remains in manual-security review with requested changes. What passed: it targets issue #682. What blocks main: diagnostics must remain advisory and the PR overlaps #697, #746, and #763. Action: resolve existing review threads, consolidate scope, run cargo run -p cli -- docs-contract-check and focused diagnostics tests, and add stale/malformed/unfunded/ready fixtures. Done when the output gives a safe next action without authorizing a claim or payment. Thanks for helping the community grow, and sorry for the review friction. |
Summary
Add committed fixtures and a deterministic test for the solver-facing claim-readiness response so an agent can see reward, refundable bond, external spend, gross cash margin, and one actionable blocker before signing.
Changes
New files
scripts/next-agent-claim-readiness.mjs— Portable implementation that validates a claim-readiness response and produces a canonical result with profit outlookbenchmarks/direct-v1/claim-readiness/test.mjs— Test runner with fixture-based test casesbenchmarks/direct-v1/claim-readiness/self-test.mjs— Self-test that validates the test runner catches real bugsTest scenarios
Acceptance criteria
Verification
Both pass cleanly.
Closes #682