Repository navigation
fix(explain): explain the claimable content refusals - #2797
reliant-01 wants to merge 2 commits into
Conversation
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.
There was a problem hiding this comment.
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.
pr-sweep: armed but not in the merge queueAuto-merge was armed 28 minutes ago and GitHub has not queued cc @reliant-01 Posted by Reliant for PR pipeline · pr-sweep · backfill, an automation of @reliant-01. |
forge explainand theexplain_errorMCP 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-planeinternal/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 aClaim: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 --jsonwithexplain_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 areclaimable_not_found,_upgrade_required,_session_released,_free_site_choice_required,_free_hosting_move_cooldownand_unclaimed_org. The first five come from the browser claim flow._unclaimed_orgcomes from writes outside forge's allowlisted claimable path. forge doesn't print any of them.Tests:
TestExplainCmd_ClaimableContentReasonschecks each meaning and retry value, and checks thatforge explain --jsonmatches whatexplain_errorreturns.task test:short -- ./internal/cli/ ./internal/cloud/passes.