Repository navigation
Phase 4 (B): flip S3 public early + propagation gate - #744
Merged
neuromechanist merged 2 commits intoJun 11, 2026
Merged
neuromechanist merged 2 commits into
neuromechanist merged 2 commits into
Conversation
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR744Version: 🤖 Updated on each push. |
Contributor
Author
|
Sonnet /review-pr addressed:
|
neuromechanist
merged commit Jun 11, 2026
7cf6689
into
feature/issue-736-epic-publish-robustness
1 check passed
This was referenced Jun 11, 2026
This branch was previously deployed
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
Phase 4 (B) of epic #736. Defense-in-depth for the public-flip race that broke nm000111. Two changes in the publish orchestrator:
Flip S3 public early. Move
s3_public_readto be the first mutation after the validation gates (ci_check,enrichment_check), ahead ofrepo_public, so the bucket-policy (deny-list) change has the most time to propagate beforecreate_tagfires version-doi -> generate-archive (~5 steps later). Per the maintainer directive: "the deny list should be removed very early in the publication cascade." Safe:s3_public_readandrepo_publicare independent, steps are idempotent, and the resume filter is order-tolerant.Non-fatal propagation gate. After
markDatasetPublic,waitForPublicPropagationlists one real blob under<id>/objects/and polls an unsigned HEAD until 200 (bounded: 6 attempts x 2s), so a stuck/slow propagation is surfaced in the publish log instead of silently advancing while blobs still 403 to the public. Non-fatal — on timeout it warns and proceeds: blocking a publish on AWS eventual consistency is the wrong tradeoff, and Phase 1's signed reads already removed the hard dependency. Unsigned by design (a signed HEAD would always 200 and wouldn't test public access).Closes #741
Part of epic #736
Files
backend/src/services/s3.ts—firstObjectKeyFromListXml(pure) +waitForPublicPropagation. ReuseslistObjectPages, the<Contents>…<Key>parse fromgetArchiveSize, and the encoded-key/anonymous-URL shape fromheadArchive.backend/src/routes/admin.ts— reorderallSteps(s3_public_read before repo_public); call the gate in thes3_public_readstep (non-fatal, logged, never 500s the publish).Test plan
bun test backend/test/public-propagation.test.ts— 4 tests, no mocks:firstObjectKeyFromListXmlagainst real S3ListBucketResultXML (multi-object page -> first key; empty/<Contents>-less page -> null; single-object page -> key verbatim; unrelated XML -> null). Typecheck (tsc --noEmit) clean; Biome clean; no existing test depends on the step order.The anonymous-403-then-200 transition the gate detects was demonstrated empirically this session: nm000111's blob returned 403 anonymously while private and 200 after the public flip. The full early-flip + gate exercises during a real publish at epic finalization (dev deploy).