feat(database,service,features): a task's and an agent's write answers the transaction it committed in
The service half of the txid rollout for tasks and agents, ported from #4259 (closed when Realtime was switched off) onto today's main; the branch didn't rebase cleanly, so this is a fresh PR.
Per Neon's mutations guide, each write reads pg_current_xact_id()::text in its own RETURNING, with no extra transaction:
- Task: start (
createTaskCommitted), change/pin/archive/move (updateTaskCommitted, from the row update or the reader's pin), delete (deleteTaskCommitted). - Agent: start (the
insertAgentrow), rename, archive, pin (*Committedvariants incoding-agent-store.ts). - A write that changes no row (a pin asked again, a change naming only an unchanged pin) answers no txid.
- Stop and send-message answer none: their visible effect comes later from eve in another transaction.
The wire answers (taskAnswerSchema, taskStartAnswerSchema, taskDeleteAnswerSchema, codingAgentAnswerSchema, codingAgentAgentAnswerSchema) carry an optional decimal txid, and HostedTaskClient hands it beside the task (TaskWritten). The existing store functions keep their old answers, each mapped from its committed write.
The host wait (onTxWait + confirmWrite) follows in a second PR, after #4423.
Tests: task-list-live.test.ts checks that a task change, a pin, an agent rename and pin, and a delete each return a txid, and that a repeated pin and a delete of a missing task return none.
Made with Luke