Skip to content

fix(explain): explain the claimable content refusals - #2797

Open
reliant-01 wants to merge 2 commits into
mainfrom
fix/explain-claimable-reasons
Open

reliant-01 wants to merge 2 commits into
mainfrom
fix/explain-claimable-reasons

Conversation

@reliant-01

@reliant-01 reliant-01 commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

forge explain and the explain_error MCP tool read one table, and it had no row for the two reasons the control plane's content check returns on an unclaimed deploy's write (control-plane internal/contentscan). Both fell through to whatever the exit code's generic explanation said.

  • claimable_content_refused: none of the content went live. If the output printed a Claim: link (or the error says to claim first), claiming lifts it: give the link to the user, then deploy as their account. Otherwise the content matched a malware, phishing or bad-URL check and has to change. Retry as is: no.
  • claimable_scan_unavailable: the check couldn't run, so nothing was published. Not the project's fault. Retry as is: later.

The reasons are now constants in internal/cloud/claimable.go, next to the other claimable reasons. The explanations don't describe how the scanner works.

Exit code: this PR doesn't touch exit codes. #2771 moves these refusals to exit 4. The explanation is keyed on the reason, and the test names no exit code: it asks with none, checks that exit 1 and exit 4 give the same answer, and compares forge explain --json with explain_error. So this PR and #2771 can merge in either order.

I checked the other claimable_* reasons. Every reason forge emits (internal/cloud/claimable.go, deploy_claimable*.go) already had a row. The control-plane reasons without a row are claimable_not_found, _upgrade_required, _session_released, _free_site_choice_required, _free_hosting_move_cooldown and _unclaimed_org. The first five come from the browser claim flow. _unclaimed_org comes from writes outside forge's allowlisted claimable path. forge doesn't print any of them.

Tests: TestExplainCmd_ClaimableContentReasons checks each meaning and retry value, and checks that forge explain --json matches what explain_error returns. task test:short -- ./internal/cli/ ./internal/cloud/ passes.

forge explain and the explain_error MCP tool now explain
claimable_content_refused (claiming lifts it when the output printed a
Claim: link; otherwise the content must change) and
claimable_scan_unavailable (retry later). The reasons are named in
internal/cloud beside the other claimable reasons.
forge #2771 moves these refusals to exit 4. The answer is the reason's
whatever code comes with it, so the test asks with none, checks exits 1
and 4 give the same answer, and compares forge explain --json with
explain_error.

@reliant-labs reliant-labs Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

review:passed

Lane: MEDIUM (one pass on gpt-6-luna@codex).

MEDIUM: code (internal/cli/explain_error.go, internal/cloud/claimable.go)

The new reason mappings describe the control plane's refusal and unavailable outcomes accurately, and reason precedence keeps their explanations stable across exit codes. The CLI/MCP parity and wording tests cover both reasons. The added reason constants match the server reason values. RC-01, RC-10, and RC-11 do not apply to these changes.

Passed: entering the native merge queue at this exact head.

Reviewed 539befc357483359573dfb2fdb1b2ab3783b3df1.

Posted by Reliant for PR pipeline · pr-review · pushed, an automation of @reliant-01.

@reliant-labs reliant-labs Bot added merge:queue Ready: the merge steward batches, gates and lands it review:passed Automated review passed; exact-head merge-review SUCCESS also required and removed review:pending labels Nov 25, 2026
@reliant-labs
reliant-labs Bot enabled auto-merge November 25, 2026 07:25
@reliant-labs

reliant-labs Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

pr-sweep: armed but not in the merge queue

Auto-merge was armed 28 minutes ago and GitHub has not queued 539befc357483359573dfb2fdb1b2ab3783b3df1: armed and green, but GitHub has not queued it (merge state unknown). No required check is red, cancelled or running and the head passed review, so the pipeline has nothing to re-run or fix. Look at the PR's merge box; a push (reviewed as usual) or review:pending re-arms it.

cc @reliant-01

Posted by Reliant for PR pipeline · pr-sweep · backfill, an automation of @reliant-01.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix:needed merge:queue Ready: the merge steward batches, gates and lands it review:passed Automated review passed; exact-head merge-review SUCCESS also required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant