Skip to content

Document get's real paid_required JSON (#982) - #1299

Merged
Mikola Lysenko (mikolalysenko) merged 3 commits into
mainfrom
agent/v5-paid-required-contract
Oct 9, 2026
Merged

Mikola Lysenko (mikolalysenko) merged 3 commits into
mainfrom
agent/v5-paid-required-contract

Conversation

@mikolalysenko

@mikolalysenko Mikola Lysenko (mikolalysenko) commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

LLM Description written by Claude Code:claude-opus-5-5

Fixes #982

Root cause

CLI_CONTRACT.md documents a paid-plan outcome that no command emits: envelope status: "paidRequired" with a failed event tagged paid_required, from "get/scan". What actually ships:

  • get --json prints its legacy shape {"status": "paid_required", "found", "downloaded": 0, "applied": 0, "patches": [...]}, with no events and no error, and exits 0. Two code paths (search with no accessible patch, and get <uuid> on the public proxy) hand-wrote it separately.
  • scan never reports it. It leaves paid patches out of the selection and counts them in paidPatches / canAccessPaidPatches.
  • Status::PaidRequired was never constructed outside tests.

A client that matches status == "paidRequired" never takes its "upgrade your plan" branch.

Change (no behavior change)

  • Contract: the paid_required row now describes get's real shape and exit code and says scan never reports it. paidRequired is dropped from the envelope status enum.
  • json_envelope::Status::PaidRequired is removed, along with its two test references.
  • get's two paid JSON blocks now share one emitter, paid_required_json.
  • New tests/contract_paid_required.rs pins the contract row and the enum against the source, in the style of contract_gradle_codes.rs.

Tests (red → green)

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 -- --check and cargo clippy --locked --workspace --all-features -- -D warnings: clean. This PR also formats one test in redirect/upstream/mod.rs that main left unformatted.

The hosted-e2e / e2e_safety_pnpm / Bun native legs are red on main too, 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 get actually emits for paid-only results: the legacy top-level "status": "paid_required" JSON (exit 0, no unified envelope events/error), and documents that scan never reports this outcome. The unused envelope status paidRequired is removed from the contract and from json_envelope::Status.

get consolidates its two paid JSON code paths behind a shared paid_required_json helper (no intended runtime behavior change). New contract_paid_required tests pin the contract row and single emitter against the source. A small test formatting tweak in redirect/upstream/mod.rs.

Reviewed by Cursor Bugbot for commit d69066e. Configure here.


Generated by Claude Code

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
@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

BugBot review


Generated by Claude Code

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

[agent] hosted-e2e and e2e (ubuntu-latest, e2e_safety_pnpm) (and so ci-ok) are red on this PR. The cause is not this PR: production stopped serving the free minimist@1.2.2 patch these suites are pinned to (#1293), and the same jobs fail on main and every other open PR. This diff doesn't touch the hosted patch service or the pinned fixtures. No fix exists yet. #1293 needs a maintainer to republish the patch, or to set HOSTED_E2E_DISABLED and repin the suites. I'm not re-running the jobs: they will fail the same way until #1293 is resolved.


Generated by Claude Code

@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

bugbot run


Generated by Claude Code

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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.

@mikolalysenko
Mikola Lysenko (mikolalysenko) added this pull request to the merge queue Oct 9, 2026
@mikolalysenko Mikola Lysenko (mikolalysenko) added the Ready for review Agent-verified: mergeable, CI green, Bugbot clean — awaiting human review label Oct 9, 2026
@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

Ready for review at d69066e74f55.

  • CI: required checks ci-ok and clippy green; 7 check suites succeeded.
  • Mergeable against main, no CHANGELOG.md change.
  • Bugbot reviewed this head; no unresolved review threads.

Labeled Ready for review by the burn-down agent. Slack announcement pending (connector unavailable this run).


Generated by Claude Code

@mikolalysenko
Mikola Lysenko (mikolalysenko) removed this pull request from the merge queue due to a manual request Oct 9, 2026
@mikolalysenko
Mikola Lysenko (mikolalysenko) added this pull request to the merge queue Oct 9, 2026
@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

[agent] ci-ok on 40f1a5c (the main merge) is red only because its CI run was cancelled: 14 jobs cancelled, no test failed. The cancellation landed as the PR was re-queued. I re-ran that run once (attempt 2). Nothing in this PR's diff changed.


Generated by Claude Code

Merged via the queue into main with commit 7ca3bf6 Oct 9, 2026
85 of 100 checks passed
@mikolalysenko
Mikola Lysenko (mikolalysenko) deleted the agent/v5-paid-required-contract branch October 9, 2026 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ready for review Agent-verified: mergeable, CI green, Bugbot clean — awaiting human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI_CONTRACT.md documents status paidRequired for get and scan, but get emits "paid_required" and scan never reports it

3 participants