Repository navigation
Preserve shared artifacts during concurrent branch cleanup - #14
Merged
Merged
Conversation
Why: regex-based JSON parsing is brittle to key order/whitespace changes in collector responses. python3 is preinstalled on ubuntu-latest runners. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…lidity Binary mimes (application/octet-stream, image/*, application/pdf, …) whose bytes happen to be valid UTF-8 were coming back as content_encoding "utf-8", which caused the web ArtifactViewer to dump them as text instead of showing the metadata + download UX added in the hardening PR. Encoding now honors the declared mime: text-like mimes try UTF-8 first, everything else is always base64. Adds a regression test. Co-Authored-By: Claude Opus 4.6 (1M context) <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.
Concurrent cleanup of a failed branch could delete a shared blob while another run was publishing an artifact with the same bytes. The real storage API then committed an unreadable artifact in memory, or rejected the SQLite writer because its blob had vanished.
Serialize byte storage plus metadata publication with reference checking plus blob removal. In-memory storage keeps its existing state lock through both operations. SQLite reserves an IMMEDIATE writer transaction before content publication and both cleanup phases, coordinating independently opened collector/API handles. Metadata cleanup remains transactional; unreferenced blob removal remains best-effort. Existing validation, unrelated runs and shared committed artifacts are preserved.
Two deterministic regressions pause the actual artifact writer after deduplication but before metadata publication, run cleanup concurrently, and check the surviving bytes. Both fail against frozen PR #13 production logic; both pass with this repair. Validation: all 171 Rust workspace tests pass (one ignored doctest), strict workspace clippy with -D warnings passes, cargo fmt and git diff --check pass. Storage's full 33 tests include persistence, independent SQLite handles and shared/orphan blob cleanup. Fresh native smoke also passes real collector ingestion, API run/tree reads, SQLite/blob files and API-only restart persistence.
This aggregate PR contains the unchanged reviewed integration from #13 (head 5ae21b6) plus this one-file repair. It targets current main b379893 so the coordinator can land the safe combined tree directly; owner branches #10/#13 remain untouched. Published head e03603e has tree 03e0f743d8814620a0ad1223eb8207a046ee0d63, identical to tested source. Previous #13 browser/artifact/restart evidence applies to unchanged frontend and integration files; current aggregate hosted Rust/Web/Docker checks now pass. Full job logs confirm 171 Rust tests plus clippy/fmt/native smoke, 75 frontend tests plus lint/production build, and a real Chromium seeded-data smoke against Docker compose.
Scope: ReplayKit-owned artifact storage and failure cleanup. Raw external blob-store mutation, live model execution and external side-effect rollback are outside this guarantee. Content writes now hold the storage writer reservation during blob I/O. Coordinated isolated support slice in jadenfix/jadenfix#1; root owns reviewed sequential merges. No owner branch rewrites or merges performed here.