Repository navigation
Add the publish_source agent tool - #252
nishu-builder merged 1 commit into
Conversation
4cf96f3 to
2256c2b
Compare
2256c2b to
36f9cda
Compare
nishu-builder
left a comment
There was a problem hiding this comment.
Layer 5/8. The pin-before-push structure is right: intent (H, E, repo, branch) is appended atomically with the ToolStart under the call's durable identity, a later source edit does not move the pinned head (the unit test checks exactly that, including after restart), and moving Outcome into conversation-protocol removes a copy from caos-cli.
One finding I would fix before merging, inline at the if fresh branch: the comment says concurrent attempts may send the pinned push and converge on the lease, but only the pin winner ever pushes. A second attempt that observes the branch while the first push is in flight records Uncertain first, and the winner's Complete is then dropped by finish. Since the push is idempotent under the exact lease, letting non-fresh attempts send the same pinned request is the simplest fix and is what the design already describes.
Second inline comment: the _ => arm after command.output() treats every non-zero caos push-git exit, including 400s and local usage errors, as "recovered by observation", which reports uncertainty for calls that never reached the server.
Generated by Claude Code
a801ccd to
d251500
Compare
d251500 to
dd7c811
Compare
dd7c811 to
b20eba2
Compare
b20eba2 to
1f763b2
Compare
Add publish_source(source_tree, repository, branch). Persist the selected commit, destination and expected remote head before pushing. Every resumed attempt can send that same pinned intent, without substituting newer source edits or refreshing the lease.
Pass definite rejection reasons through to the model. After a conflict or uncertain result, inspect the remote: the intended commit confirms success, including when Git retries after losing an acknowledgement and reports a stale lease. Keep source integration and publication policy in the agent.
Regression coverage preserves the first pin through competing observations, source edits, lost acknowledgement and restart, and checks convergence after a rejected HTTP retry.
Validation on EC2: Nix build passed. The salted suite passed 46/47 checks in 395s; its Clippy findings were fixed, and Clippy passed on all affected crates with --all-targets -- -D warnings. Formatting passed after those lint-only fixes. HTTPS import/push, shallow-locator/offline-cache, and focused unit checks also passed. The functional suite was not repeated for the lint-only changes.