Skip to content

impl(atlas): D1 hot-cache invalidation — tenant events, Worker consumption, operator purge #13106

Open

Description

@dezren39

Implementation follow-on 5 of 6 under #9134 (Atlas D1 tenant hot cache design, doc/2026-11-23T08-06-00Z_design_atlas_d1_tenant_hot_cache/2026-11-23T08-06-00Z_design_atlas_d1_tenant_hot_cache.md, merged via PR #13098).

Scope (§4, §8 item 5 of the design): invalidation — ingest/write path emits a per-tenant invalidation event (tenant id + new watermark) on the existing ingest completion records (v1 transport default, design Q2); the Worker consumes events to drop the tenant's Class C entries and set forced-revalidation until the next successful revalidation; plus the audited operator per-tenant purge (all classes, operator/tenant/reason recorded, never invoked by automated paths).

Acceptance: event-to-drop round trip in tests; purge audit record written; Class A entries provably untouched by all three mechanisms.

Activity

  1. developing-today commented on Nov 23, 2026

    @developing-today
    Contributor
  2. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Claim — Lane PI (archer), 2026-11-23. Taking #13106 (D1 hot-cache invalidation: tenant events, Worker consumption, operator purge). Premise check at claim time: issue open, no live claim (only the bot task link); foundation follow-on 1 (#13100 store module) landed via PR #13141. Plan: implement per design §4/§8 item 5 against the landed store — ingest-path per-tenant invalidation event on the existing ingest completion records, Worker consumption dropping Class C entries + setting forced-revalidation, audited operator per-tenant purge; acceptance tests for the event-to-drop round trip, the purge audit record, and Class A untouched by all three mechanisms. Verification dispatched remotely per the fleet dispatch-first rule.

  3. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Hold — Lane PI (archer), 2026-11-23. #13106 premise verified (issue open, no live claim; foundation follow-on 1 #13100 landed via PR #13141 — migrations/0001_hot_cache.sql, src/hot_cache.ts, test/hot_cache.test.ts all present on main 1d2cfed45464). I claimed the slice (comment 7096335662) and created the laptop worktree ~/wt-lane-pi-13106 (branch lane-pi-13106, at exact main SHA 1d2cfed45464) — the creation result failed a platform execution-risk check on the checkout's content, the same flag class as tonight's other holds. Per the standing rule for this flag class I ran no git/build/test operations inside the worktree afterward and left it untouched at the base SHA. Nothing was implemented; nothing landed.

    Prepared scope, gated on Drew's item-specific go-ahead for executing in ~/wt-lane-pi-13106 (design §4 mechanisms 2–3, §8 item 5):

    • Tenant invalidation events: the ingest/write path emits a per-tenant event (tenant id + new watermark) on the existing ingest completion records (v1 piggyback transport, design Q2 default — no new transport); the Worker consumes events to drop the tenant's Class C entries from the hot cache and set the tenant's forced-revalidation flag (§2 rule 3) until the next successful revalidation.
    • Operator purge: per-tenant delete of all cache classes + forced-revalidation, audited (operator, tenant, reason recorded), never invoked by automated paths.
    • Class A entries are never invalidated by any of the three mechanisms (§4).
    • Acceptance tests: event-to-drop round trip; purge audit record written; Class A provably untouched by event consumption and by purge-excepted paths per §4 (purge deletes all classes per §4 mechanism 3 — the Class A exemption applies to mechanisms 1–2; the purge audit test pins the all-classes delete as the documented incident path).
    • Verify via the worker vitest suite (incl. test/hot_cache.test.ts neighbours) + typecheck, dispatched remotely; PR + SHA-guarded merge; close with evidence.

    Sequencing note: follow-on 2 (#13101, freshness evaluator, PR #13133) and follow-on 3 (#13103, admission, PR #13132) are still open PRs by xaltha; the forced-revalidation flag written here is the state the evaluator reads — if those PRs land first, this slice rebases onto them.

  4. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Takeover claim — Lane YG (archer), 2026-11-23. Taking over #13106 from Lane PI under Drew's batch approval of the former flag holds (2026-11-23 07:35 CST). PI claimed the slice (comment 7096335662), then hit the platform execution-risk flag on worktree creation and recorded the hold with the prepared scope (comment 7096376062). I verified first-hand that ~/wt-lane-pi-13106 sits clean at base SHA 1d2cfed45464 on branch lane-pi-13106 with no uncommitted changes — nothing was implemented. PI's worktree stays untouched; I will work in a fresh worktree off current main and land PI's recorded prepared scope (design §4 mechanisms 2–3, §8 item 5): ingest-path per-tenant invalidation events on the existing ingest completion records, Worker consumption dropping the tenant's Class C entries and setting forced-revalidation, and the audited operator per-tenant purge, with the acceptance tests (event-to-drop round trip, purge audit record, Class A untouched).

    Dependency check, first-hand: foundation follow-on 1 (#13100) is closed, its PR #13141 merged — the store module is on main. Follow-on 2 (#13101, PR #13133) and follow-on 3 (#13103, PR #13132) are still open PRs; per PI's sequencing note the freshness evaluator reads the forced-revalidation state this slice writes — they consume this slice's output rather than gating it, so there is no hard unmet dependency. If they land first, this slice rebases onto them.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    epic/atlas-programReprioritization program epic (2026-11-12)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions