Skip to content

Recheck current file preimages before direct Git Trees merge - #31478

Merged
woahwhattheheck merged 2 commits into
mainfrom
swarm-7ca6/atomic-premerge-preimages-20261005-1791166502
Oct 5, 2026
Merged

woahwhattheheck merged 2 commits into
mainfrom
swarm-7ca6/atomic-premerge-preimages-20261005-1791166502

Conversation

@woahwhattheheck

Copy link
Copy Markdown
Owner

Problem and change

The direct publishGitHubChange merge path checked target preimages before creating its tree, commit and PR, then merged without rechecking a base that may have moved. The existing merge continuation and Contents publisher already perform this current-base check.

Before the direct expected-head merge, read the current base commit/tree. An unchanged immutable base reuses its completed preimage check. A moved base uses the established baseFileReader and exact previous blob/mode/type comparison for every prepared path; changed targets stop with the existing branch and PR retained. Verified retained-tree bytes are re-bound to the current native parent with separate consumed markers. A mismatching parent stops without accepting stale tree bytes.

The expected PR head remains guarded by the same native merge call. This does not provide an atomic expected-base CAS: the base can move after observation. Existing uncertain-write stopping and no automatic retry are unchanged.

Batching and evidence

The existing Git Trees route already creates one tree/commit for a regular-file batch. The guide documents pinned versus inline UTF-8 behavior and the source-modeled call cost; it preserves source pins and full immutable readbacks. The measured 17-file Razer carrier #31476 used 110 Contents-publisher calls, plus 21 separate full-main reads. It was not republished or benchmarked.

Only these existing paths change:

  • host/connected_github_publish.cjs: 6bacc605fe1205291e5e9c4219e460c97d6c28f8 -> 77baf408c5013a577d56c6c9b9c81aec405099b8
  • host/CONNECTED_GITHUB_PUBLISH.md: 6c876b36770d25ae54b084510a6ea0a3cd631b2e -> 789828db45bd013cfff2b13e847ba6c800956c45

Removing the 24-line insertion reconstructs the complete source preimage. The entire continuation, contribution, observation and Contents implementations remain byte-identical. The guide change is additive.

Validation is static source reasoning and guarded publication/full-text readback through the existing Contents implementation. The new direct-merge branch is not executed by this publication. No tests, fixtures, native process, workflow, historical packet replay or performance run was performed.

Operation: CONNECTED-GITHUB-ATOMIC-PREMERGE-PREIMAGE-20261005-7CA6.
Exact-path coordination: https://tokenjunkielabs.slack.com/archives/C0BTB4SUCP9/p1791166502773229 .
The adjacent large-directory activity is preserved; its traversal/fallback implementation is unchanged.

@woahwhattheheck
woahwhattheheck merged commit db9aefb into main Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant