Piece 7: verify git delivery before payment#14
Open
orveth wants to merge 3 commits into
Open
Conversation
Legacy field names never existed in production journals; aliases enabled fail-open deserialize. Refuse old names; keep result_content_hash_hex. Co-authored-by: Cursor <cursoragent@cursor.com>
orveth
marked this pull request as ready for review
July 15, 2026 06:08
gudnuf
reviewed
Jul 15, 2026
| } | ||
|
|
||
| fn fetch(&self, delivery: &GitDelivery) -> Result<CommitOid, DeliveryError> { | ||
| let fetched_ref = format!("refs/mobee/deliveries/{}", delivery.commit_oid().as_str()); |
Contributor
There was a problem hiding this comment.
why is this hardoceded to this?
Contributor
Author
There was a problem hiding this comment.
Good question — added a clarifying comment in 6d484b2. Short version: refs/mobee/deliveries/<commit_oid> is a deliberately isolated, OID-keyed local ref namespace where the buyer stages the untrusted seller branch before verifying it.
Why it's hardcoded (and deliberately not a config knob):
- Isolation — it lives under
refs/mobee/deliveries/*, notrefs/heads/*orrefs/remotes/*, so a fetched delivery can't masquerade as (or collide with) a real local branch or remote-tracking ref. - OID-keyed — each delivery lands under its own
/<commit_oid>, so repeated/concurrent deliveries never clobber each other, and the staging ref is bound to the exact commit we're about to check. - Verify-before-pay — the buyer then resolves
<fetched_ref>^{commit}and tip-matches the expected OID beforeauthorize_pay. Making the namespace configurable would be a footgun (a wrong value could route untrusted content intorefs/heads), so it's fixed by design.
The only real gap was the missing explanation — now in the code.
…ace (PR #14 review) The delivery fetch stages the untrusted seller branch in an isolated, OID-keyed local ref namespace (not refs/heads or refs/remotes) so it cannot masquerade as a real branch or remote-tracking ref, keyed by the claimed commit OID to avoid cross-delivery collision. Internal verify-staging, not a config knob. Answers the review comment on delivery_git.rs line 75. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Verification
The workspace-only CLI AgentMessage("working") expectation failure is pre-existing and outside this diff.
Runtime and reality
The git-delivery adapter requires a git executable at runtime. The default dependency graph remains unchanged. This lands BUILT-BUT-OFF until a composed caller drives the delivery-gated path.