Skip to content

fix: publish authenticated immutable upload generations - #24

Draft
chenrui333 wants to merge 4 commits into
patch/9.8.0-backpressurefrom
rchen.INFRAOPS-20854.authenticated-cache-completion
Draft

chenrui333 wants to merge 4 commits into
patch/9.8.0-backpressurefrom
rchen.INFRAOPS-20854.authenticated-cache-completion

Conversation

@chenrui333

@chenrui333 chenrui333 commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Bind whole-PUT / exact Azure block-list completion to upload ID and capability, complete body, immutable revisions, manifest order and actual bytes. Preserve opaque IDs, valid duplicates, selected subsets and completed-key replacement.
  • Make key-only Finalize a read-only scoped completion acknowledgment. A delayed or same-token finalizer cannot abandon or publish a pending successor.
  • Bind new verified generations to creator JWT expiration (metadata only, never bearer persistence), checked after asynchronous storage and transactionally before visibility.
  • Recover only expired per-attempt write leases as failed; live owners stay fenced and a resumed expired writer cannot settle or overwrite authoritative bytes.
  • Limit requested-key legacy retirement to seven-day-idle NULL-capability reservations. No modern reclamation, global cleanup change, secret or issuer change.

Compatibility / forward recovery

Candidate version 9.8.0-backpressure.4, unpublished. $9_authenticated_upload_completion is forward-only; preserve the database backup and payload storage under a separately approved single-writer boundary. Old completed entries remain readable.

Not a transparent rolling upgrade: old capability-bearing reservations have unknown verified expiry, and old numeric staged parts lack an exact opaque-ID/revision manifest. With verification enabled their publication fails closed; fresh key-only Finalize cannot publish raw parts. A Security OWNER and service owner must explicitly approve client drain / maintenance and restart before rollout. No guessed expiry, automatic modern takeover, fake compatibility shim or image-only rollback claim. Full boundary and recovery notes: CHANGELOG.md and ADR-0013.

Observed local qualification

Node 26.13.0 / pnpm 11.11.0, SQLite + filesystem:

  • Typecheck, ESLint/Prettier and production Nitro build passed.
  • Complete relevant suite: 136 passed, 7 backend/conditional skips; 30 passed test files, 2 skipped.
  • Real @actions/cache 6.1 cold-write and repeated warm-read exact bytes, including 512 MiB after deleting the source before restores.
  • Real pinned OpenDAL 0.55 whole and concurrent multipart cold writes / exact warm reads, opaque 16-byte IDs, HTTP operation/status correlation and database receipt/manifest/size assertions.
  • Verified local JWKS: expiration before whole/manifest publication, expiration during async body/storage, and unknown-expiry migration fail-closed preservation.
  • Crash-boundary persistence/reconstructed writer retransmission, late expired writer fencing, live-owner cleanup preservation, protobuf nonempty completion acknowledgment and forward-only migration coverage.

An earlier affected run exposed a fixture protobuf type mismatch and a missing explicit local Cargo selection; both were corrected, not suppressed. Final full suite above passed. Ordinary CI must qualify the real configured database/storage matrix; local filesystem success is not S3/GCS or architecture qualification.

Required gates — keep DRAFT

  • Current-head configured CI matrix passed; final independent changed-line review found no additional source blocker (not actual Claude).
  • Actual Claude review is unexecuted: explicit authentication HOLD. No login, new credentials, secrets/settings or reviewer bootstrap. Independent non-Claude reviews supplement only and do not satisfy this gate.
  • Security OWNER / service-owner approval of the historical in-flight drain and availability contract, followed by separately authorized release/migration/deployment decisions.

No merge, tag, image publication, deployment, runtime schema/cache write, operational repair, backup or qualification retry is authorized or performed by this PR.

Current-head CI correction

Head 2ceabb7 makes only the reviewed admission-isolation correction in lib/uploads.ts:111–112: exact-generation FOR UPDATE already serializes claims, so PostgreSQL/MySQL admission uses READ COMMITTED; SQLite keeps its IMMEDIATE/serializable fence. Reservation creation and publication remain serializable. No retry-budget increase or test narrowing.

Prior ordinary run 43523654232 failed on actual PostgreSQL/filesystem concurrent OpenDAL staging (SQLSTATE40001); five matrix jobs passed, three were fail-fast canceled, lint/typecheck passed and deploy skipped. The source correction addresses that observed failure, not an ignored flake.

New ordinary push run 43524803099 completed successfully on exact current head 2ceabb7, attempt 1: all nine PostgreSQL/MySQL/SQLite × filesystem/S3/GCS jobs plus lint and typecheck passed; deploy skipped as intended. It is not a manual rerun. The previously reported complete local suite/build/lint/typecheck passed on parent 133ab5a; it was not needlessly repeated for this two-line delta. Current-head backend CI is the qualification gate. Independent final source reviews on 133ab5a found no additional expiry/lease defect beyond this actual CI admission issue; parent inspected the exact two-line delta and found no additional source blocker. These are NOT actual Claude review. All DRAFT, owner-drain, forward-only and authentication-HOLD gates above remain unchanged.

Unpublished schema and protocol foundation. The completed candidate must include storage, transport, caller and qualification cutover before review or rollout.

Signed-off-by: Rui Chen <rui@chenrui.dev>
Preserve the implemented generation/manifest/receipt paths and actual client regressions. Publication authorization-time equivalence and final full-suite fixture qualification remain incomplete. No merge, tag, image publication, runtime migration or repair is authorized.

Signed-off-by: Rui Chen <rui@chenrui.dev>
Preserve generation-bound publication and read-only Finalize. Carry verified creator expiration without retaining bearer credentials, and fence expired per-attempt writers before retransmission or cleanup. Keep the explicit pre-upgrade drain and security-owner readiness gates; no transparent rolling-upgrade or release authorization is claimed.

Signed-off-by: Rui Chen <rui@chenrui.dev>
Use READ COMMITTED for PostgreSQL/MySQL attempt admission so a waiting FOR UPDATE claimant observes the committed generation instead of exhausting serialization retries. Preserve SQLite IMMEDIATE transactions, serializable reservation/publication, verified deadlines and exact-attempt fences. The existing concurrent OpenDAL client case supplies backend CI regression proof.

Signed-off-by: Rui Chen <rui@chenrui.dev>
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