Repository navigation
Document get's real paid_required JSON (#982) - #1299
Conversation
CLI_CONTRACT.md promised an envelope status "paidRequired" from get
and scan. Nothing emits it: get prints its legacy
{"status": "paid_required", ...} shape (exit 0) and scan only counts
paid patches. Clients coding against the contract never matched.
The contract now describes the shape get emits and says scan never
reports it; the unused Status::PaidRequired variant is gone; get's
two paid paths share one emitter, and a contract test pins the row
against the source (#982).
Also applies rustfmt to a test in redirect/upstream that main left
unformatted.
Assisted-by: Claude Code:claude-opus-5-5
|
BugBot review Generated by Claude Code |
|
[agent] Generated by Claude Code |
|
bugbot run Generated by Claude Code |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit d69066e. Configure here.
|
Ready for review at
Labeled Generated by Claude Code |
|
[agent] Generated by Claude Code |
LLM Description written by Claude Code:claude-opus-5-5
Fixes #982
Root cause
CLI_CONTRACT.mddocuments a paid-plan outcome that no command emits: envelopestatus: "paidRequired"with afailedevent taggedpaid_required, from "get/scan". What actually ships:get --jsonprints its legacy shape{"status": "paid_required", "found", "downloaded": 0, "applied": 0, "patches": [...]}, with noeventsand noerror, and exits 0. Two code paths (search with no accessible patch, andget <uuid>on the public proxy) hand-wrote it separately.scannever reports it. It leaves paid patches out of the selection and counts them inpaidPatches/canAccessPaidPatches.Status::PaidRequiredwas never constructed outside tests.A client that matches
status == "paidRequired"never takes its "upgrade your plan" branch.Change (no behavior change)
paid_requiredrow now describesget's real shape and exit code and saysscannever reports it.paidRequiredis dropped from the envelope status enum.json_envelope::Status::PaidRequiredis removed, along with its two test references.get's two paid JSON blocks now share one emitter,paid_required_json.tests/contract_paid_required.rspins the contract row and the enum against the source, in the style ofcontract_gradle_codes.rs.Tests (red → green)
contract_paid_required::contract_paid_required_row_matches_getand::get_writes_the_paid_required_shape_once(new). Onmain, both fail: the row saysstatus=paidRequired, andget.rswrites the paid shape twice. Both pass on this branch.--test getpaid tests still pin the emittedpaid_requiredshape and exit 0.Commands run
cargo test -p socket-patch-cli --all-features --lib --test contract_paid_required --test get --test covgap_commands_get --test cli_get_silent: all pass.cargo fmt --all -- --checkandcargo clippy --locked --workspace --all-features -- -D warnings: clean. This PR also formats one test inredirect/upstream/mod.rsthatmainleft unformatted.The
hosted-e2e/e2e_safety_pnpm/ Bun native legs are red onmaintoo, because of the withdrawn minimist patch (#1293). That failure is not caused by this diff.Note
Low Risk
Documentation and internal refactor only; paid JSON shape and exit code are unchanged and covered by existing and new contract tests.
Overview
Aligns CLI_CONTRACT.md with what
getactually emits for paid-only results: the legacy top-level"status": "paid_required"JSON (exit 0, no unified envelopeevents/error), and documents thatscannever reports this outcome. The unused envelope statuspaidRequiredis removed from the contract and fromjson_envelope::Status.getconsolidates its two paid JSON code paths behind a sharedpaid_required_jsonhelper (no intended runtime behavior change). Newcontract_paid_requiredtests pin the contract row and single emitter against the source. A small test formatting tweak inredirect/upstream/mod.rs.Reviewed by Cursor Bugbot for commit d69066e. Configure here.
Generated by Claude Code