Skip to content

Preserve shared artifacts during concurrent branch cleanup - #14

Merged
jadenfix merged 6 commits into
mainfrom
codex/qa-20261014-replay-blob-serialization
Oct 14, 2026
Merged

jadenfix merged 6 commits into
mainfrom
codex/qa-20261014-replay-blob-serialization

Conversation

@jadenfix

@jadenfix jadenfix commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

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.

Jaden Fix and others added 6 commits April 14, 2026 03:13
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>
@jadenfix
jadenfix merged commit 461e1e9 into main Oct 14, 2026
4 checks passed
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