fix(cloud): accept canonical answer receipts
Merged
KH
8h ago+238+238+012345678901234567890123456789-43-43-01234567890123456789
Outcome
- Accept the canonical Cloud answer route response:
runId,humanWait,humanAnswer, andnext. - Require exact run, wait, decision, and normalized note agreement before reporting
answerRecorded: true. - Read canonical
humanAnsweron retries and skip a duplicate answer POST only for the same recorded decision. - Refuse missing, competing, cross-run, cross-wait, or otherwise mismatched acknowledgements.
This changes only the SDK client and its composed route-shape tests. It does not answer or resume a live run, publish a package, or deploy Cloud.
Verification
Literal commands and captured output follow in PR comments, including revert/fail/byte-restore/pass mutation evidence.
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Updates the Cloud SDK answer flow to accept the canonical answer route response shape (humanAnswer with runId, humanWait, and next receipts) and to strictly confirm acknowledgements before reporting answerRecorded: true.
- Normalizes and compares notes so a retry with the same trimmed note is treated as identical.
- Preserves explicit refusals: an
errorfield orok: falseon the answer route now surfaces as an invalid response instead of being treated as a non-confirmation. - Refuses mismatched, competing, cross-run, or cross-wait acknowledgements; the legacy
answerandok: truefields are no longer accepted as confirmation. - Re-admits the persisted repository grant on resume, forwarding normalized
owner/repovalues and refusing to infer or widen malformed grants.