Skip to content

fix(platform): persist holder retirement and chat custody - #4238

Closed
yannickmonney wants to merge 4 commits into
mainfrom
fix/bound-upload-intent-reclaim
Closed

yannickmonney wants to merge 4 commits into
mainfrom
fix/bound-upload-intent-reclaim

Conversation

@yannickmonney

@yannickmonney yannickmonney commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Draft — TALE-549 / #4208 remains incomplete

Do not merge, deploy, close #4208 or infer whole-task acceptance. Root's existing retention policy is unchanged. This extends the preserved LOW/INFO work on the same branch.

Prospective source changes

  • Durable organization/ref reclaim ledger, transactional pg-boss enqueue, bounded retries and recovery. The strict conservative deletion seam preserves restorable rows, pending intents, applicable holds and genuine holders; it observes store failures.
  • Mail settlement (including Message-ID conflict), failed discard, bounded 15-minute owned undo handoff, conversation deletion, API acknowledgement/receipt-owned reconciliation removal and chat-lineage purge capture affected refs transactionally. Observed successful transport is settled by recovery rather than resurrected as retryable failed mail.
  • Chat ownership is classified from server-side locked file provenance before carrying rows disappear, persisted and copied through branch/arena copies. Readable borrowed document/file attachments confer no independent retention ownership; replay is filtered after the authorized source disappears.
  • Retention audit distinguishes document record removal and confirmed deleted, retained or unknown bytes. Additive migration 0150 and a registered native schema probe; no historical backfill or bucket scan.
  • Original bounded upload-intent scans, failure rotation, canonical ownership lock order and corrected scan-cost documentation remain.

Observed proof

  • 29 focused suites / 400 tests pass with private PostgreSQL 18.4 and moto S3, including actual pg-boss enqueue/rollback, store HEAD/delete, send/undo/discard/conversation/purge/API matrix, borrowed deletion/destruction, legal holds/restorable rows, concurrent append/delete, recovery fairness and observed-send failures.
  • 32 selected-file TypeScript diagnostics: zero; focused type-aware lint, format and diff checks pass. Scoped pinned SAST: zero findings, with test/config exclusions and one partial parse reported by the engine.
  • Previous-code MEDIUM control: three actual PostgreSQL/S3 regressions fail at 795ec00 (executed after draft implementation, not represented as test-first). Separate previous-image upgrade control remains deliberately red.
  • Local probes are not the full hosted/native integration-check harness; pg_search/vector substrate was unavailable locally. No whole-workspace test/typecheck was run.

Blocking disposition

Distinct immutable-head review requests changes: C1: same-blob multi-team source proof selects file_metadata.document_id, not necessarily the visible authorizing document; C2: legacy NULL-owner undo can obtain the handoff proof lock before the ledger. Both require fixes and actual native adversarial proof. The review receipt is retained in the task delivery box; no whole-task acceptance is given.
R3: legacy genuine owned chat attachment already rowless before migration. Trusted provenance is absent; the upgrade control reports hold true before / false after, replay unavailable, bytes still present. No author/readability/client-parts inference or broad legacy exception was introduced. A trusted provenance source or explicit audited rollout disposition and passing transition proof are required before release.

The continuation commit was published with invalid scope files instead of allowed platform; local commitlint reports this. Shared history is not rewritten in this lane. This is another explicit pre-merge repair gate, not a claimed passing check.

Distinct immutable-head whole-task review and complete hosted gates remain required. CI is observed passively; no rerun/cancellation/native slot is claimed. API source closure intentionally preserves existing queued/failed replies; later acknowledgement or actual removal ends those holders. No production operation, deployment or cleanup occurred. Pending-held deliverable is a read-only design only.

@yannickmonney yannickmonney changed the title fix(platform): bound upload-intent sweeps and order ownership locks fix(platform): persist holder retirement and chat custody Oct 4, 2026
@yannickmonney

Copy link
Copy Markdown
Contributor Author

Replacement draft for TALE-549 / #4208: #4270 at 08f613c preserves the work on a clean, correctly scoped history. This original draft and its published branch remain intact as the record of the earlier source, native proofs and unresolved review findings.

The replacement is still a draft. Its author reports focused source repairs for C1/C2 and a conservative R3 migration gate, but actual PostgreSQL/S3 proofs, the legacy-transition disposition, complete hosted checks and a distinct whole-task review remain outstanding. Neither draft is approved for merge or deployment; #4208 and TALE-549 remain open. Coordinate further work through the existing author task, without duplicating an implementation or reviewer.

@yannickmonney

Copy link
Copy Markdown
Contributor Author

Closing this draft. #4270 replaced it with the same work on a cleaner history, and both are being retired together. Nothing is deleted: the branch fix/bound-upload-intent-reclaim (head 372353a61) stays on origin, and GitHub keeps the commits under refs/pull/4238/head.

What this branch held that is not on main yet, for whoever picks #4208 up:

  • The LOW and INFO items (a bounded sweepUploadIntents backlog, sorted refs in firstForeignUpload) are commit 795ec00c0, independent of the rest. Checked against the stable train on 2026-11-02: cherry-picked onto it, the unit tests and both real-Postgres tests pass (23 of 23); against the unfixed code the same Postgres tests fail with deadlock detected and on the unbounded sweep. Only a test title conflicted.
  • The MEDIUM items (bytes kept for a mail or chat holder are never reclaimed; any reader can keep bytes alive past an owner's delete) were never accepted: the review findings are unresolved, the native suites were red, and the second item needs a retention-policy decision. Migration 0150 is also taken now (the line is at 0224).

#4208 stays open.

@yannickmonney
yannickmonney deleted the fix/bound-upload-intent-reclaim branch November 2, 2026 17:53
@yannickmonney

Copy link
Copy Markdown
Contributor Author

Update: the branch fix/bound-upload-intent-reclaim is now deleted on origin, so the line above that says it stays there no longer holds. The commits are still reachable as refs/pull/4238/head (372353a61).

Where the content went: the LOW and INFO items of #4208 are on the stable train as "fix(platform): bound upload-intent sweeps and order ownership locks" (24286d63c; it reaches main with the next train pull request). It is 795ec00c0 re-applied. Its real-Postgres proof now lives in two checks of the files lane (reject-blob.integration.ts), because the separate upload-intents.postgres.test.ts only runs when ITEST_UPLOAD_INTENTS_DATABASE_URL is set, and CI sets it nowhere. Against the unfixed code two of the lane's checks fail (the backlog drains in one sweep instead of 25 per sweep, and of 20 concurrent sends that name the same uploads in opposite order only 10 finish, the first failure being deadlock detected); with the fix the lane passes 96 of 96.

Nothing else from this branch moved. The MEDIUM items stay on #4208.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant