fix: [ENG-3025] preserve structured cleanup-error signal + close docs gaps
Second round of PR review fixes (four findings on the previous fix
commit):
1. Switch cleanup-failure-post-success from warnings[] (free-text) to
errors[] (structured kind). The previous fix moved
response-file-delete-error into warnings, which buried the machine-
readable kind under a substring-match. Now the cleanup error is
appended to the dispatch envelope's errors[] so consumers can switch
on `kind === 'response-file-delete-error'` programmatically. The
`ok`/`status` fields stay as the daemon set them, so
`{ok: true, status: 'done', errors: [{kind: 'response-file-delete-error', …}]}`
is the success-with-cleanup-hiccup shape.
2. Update docs/curate-protocol.md row for response-file-delete-error to
describe the new "non-terminal companion" lifecycle. Previously said
"the curate is aborted" which mismatched the post-fix behavior.
3. Document the warnings[] field in the wire-envelope JSON skeleton.
Was undocumented (pre-existing gap); this PR actively uses the field
so now's the time to surface it.
4. Add a doc note under --delete-response-file explaining the
correct-html re-authoring tax: on a validation-failed continuation,
the file is unlinked but the session is still live, so the calling
agent must author a fresh envelope and write a new file before the
next continuation. Inline --response has no equivalent overhead.
Interactive verification: forced unlink failure via chmod-protected
parent dir. Result: status=done, ok=true, errors=[{kind:response-file-
delete-error, message:EACCES…}], warnings=None. Structured kind is
where consumers can find it. N
Nguyễn Thuận Phát committed
316ece0c2c07b423b1a7c574fd6383ae9c80e8b0
Parent: abd82ba