Problem
The CLI purchase path classifies a provider result using only PurchaseResult.Success.
If a provider returns PurchaseResult{Success: true, Error: nonNil}, purchaseSingleRec records audit status success and prints the success diagnostic even though the result contains a provider error. The MCP path had the same inconsistency and is being corrected in PR #1889.
Relevant current code:
cmd/multi_service.go: purchaseSingleRec selects status and diagnostics from result.Success only.
cmd/multi_service_helpers.go: executePurchase preserves a provider-returned result when the separate Go error is nil, including a non-nil result.Error.
Expected
CLI audit status and diagnostics should treat a purchase as successful only when result.Success is true and result.Error is nil. Returned provider data should remain compatible unless a separate API decision is made.
Acceptance criteria
- Add a regression using a provider result with
Success=true and a non-nil Error.
- Require audit status
error and a failure diagnostic for that result.
- Preserve existing behavior for ordinary success,
Success=false, and a separate Go error.
- Verify the real
purchaseSingleRec path, not only a helper predicate.
Found during adversarial review of PR #1889. This is intentionally separate because #1889 is scoped to MCP purchase auditing.
Problem
The CLI purchase path classifies a provider result using only
PurchaseResult.Success.If a provider returns
PurchaseResult{Success: true, Error: nonNil},purchaseSingleRecrecords audit statussuccessand prints the success diagnostic even though the result contains a provider error. The MCP path had the same inconsistency and is being corrected in PR #1889.Relevant current code:
cmd/multi_service.go:purchaseSingleRecselects status and diagnostics fromresult.Successonly.cmd/multi_service_helpers.go:executePurchasepreserves a provider-returned result when the separate Go error is nil, including a non-nilresult.Error.Expected
CLI audit status and diagnostics should treat a purchase as successful only when
result.Successis true andresult.Erroris nil. Returned provider data should remain compatible unless a separate API decision is made.Acceptance criteria
Success=trueand a non-nilError.errorand a failure diagnostic for that result.Success=false, and a separate Go error.purchaseSingleRecpath, not only a helper predicate.Found during adversarial review of PR #1889. This is intentionally separate because #1889 is scoped to MCP purchase auditing.