feat: add ready-to-earn inventory filter regression test [0x954dB727f224dAabeA2A506C8aE92029b25339cE] - #696
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
Add a deterministic regression test that proves the public ready-to-earn inventory excludes canonical bounties with verification_ready=false, recovery-reserved, invalid terms, or terminal status. - Covers one healthy funded/claimable/verification-ready bounty - Excludes 4 blocked states: invalid terms, terminal status, recovery-reserved, verification not ready - Mixed feed test with 1 ready + 3 excluded - Multiple exclusion reasons test (cancelled + not verification-ready) - Offline, replayable, and exits 0 - No secrets, wallet, or live write required Closes NSPG13#683
NSPG13
left a comment
There was a problem hiding this comment.
Thanks for covering healthy and excluded inventory states. The deterministic/offline intent and explicit exclusion reasons are useful.
This PR needs changes before main:
- It bundles the entire unrelated #682 claim-readiness implementation into #683. Split/rebase this PR to the smallest #683-only change.
scripts/ready-to-earn-filter.mjsis a second implementation of inventory filtering. Testing it does not prove the public Rust API'sready_to_earnprojection is correct. Exercise the realapply_query/opportunity conversion or a spawned/v1/opportunities?view=ready_to_earnresponse.- Assert excluded contracts remain in the broader lifecycle feed with their exact contract and exact production exclusion reason.
- Use committed fixtures shaped like the production response and add the focused regression to
scripts/check.py.
Run the owning Cargo test and python scripts/check.py --platform posix. A collaboration branch is reasonable after the unrelated #682 code is removed and the test targets production behavior. #683 is not canonically funded; only BountySettled proves payment.
|
This PR remains in manual-security review with requested changes. What passed: it targets issue #683. What blocks main: it overlaps #717, #735, and #762 and must prove that every advertised item is canonically funded, verifier-ready, and claimable. Action: resolve existing review threads, consolidate scope, run cargo run -p cli -- docs-contract-check and focused inventory tests, and add positive/negative feed fixtures. Thanks for helping the community grow, and sorry for the review friction. |
Summary
Add a deterministic regression test that proves the public ready-to-earn inventory excludes canonical bounties that are not ready for agents to discover and earn from.
What's included
New script:
scripts/ready-to-earn-filter.mjscontract_termsverification_ready === falseBenchmark runner:
benchmarks/direct-v1/ready-to-earn-filter/test.mjs11 test cases:
Self-test:
benchmarks/direct-v1/ready-to-earn-filter/self-test.mjsAcceptance criteria met
Closes #683