Skip to content

id: implement: journaled region-seam export/import #3870

Open

Description

@dezren39

Implements the accepted design from #2818. See the design note doc/2026-11-01_design_id2818.md and design PR #3875.

Build the journaled handoff for an application-owned entity crossing between spatial region shard-worlds. Use dedicated source/destination journal entries plus coordinator open/close records. The required local order is prepare/validate → persist typed record → apply in-memory state → acknowledge. Keep region journals independent; do not emulate a cross-region transaction or put entity payloads in the coordinator journal.

Phased packets

  1. Journal/schema/checkpoint foundation — typed handoff records, entity-addressed input, world journal version 3 bump/rollback compatibility, and compaction preservation for active handoffs, epochs, tombstones, and receipts.
  2. Program contract + source export/fence — pure prepare_entity_transfer hook, region-sharded mode gate, complete bounded entity payload, persist-before-apply source record, and source-side stale-write rejection. No receipt until apply/replay succeeds.
  3. Destination import — module/schema/digest validation, persist-before-apply import, idempotency by handoff ID, durable receipt only after apply/replay, and failure tests.
  4. Coordinator/recovery — journal start and observed receipts, retry/reconcile after crashes, and region-map switch only after matching durable receipts and a durable completion record.
  5. Client/operations — explicit transit/stuck status, fail-closed entity reads/writes while in transit, stale-route response, metrics/alerting, and feature-gated end-to-end acceptance.

Dependencies: 1 → 2 → 3 → 4 → 5. Each packet is separately mergeable after its predecessor. Follow the design note's recommended defaults; the open questions for Drew are recorded there and do not block the protocol work.

Acceptance

  • No entity duplication or silent loss across any injected failure point.
  • Source mutations are fenced at durable export; destination is routable only after completion.
  • Exact retries are idempotent; conflicting imports fail closed.
  • Actor crash between journal append and in-memory apply recovers by replay before returning a receipt.
  • Coordinator and region restart/replay/compaction retain correct ownership and recovery state.
  • No cross-region transaction, automatic rollback after export, or durable client write queue.

Acceptance criteria

Activity

  1. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    agent-note:v1 — task 5859 triage record for #3870 (lane D worker, 2026-11-01).

    Grounding (verified fresh this shift, main 33aefa7)

    Decision (already fixed by #2818 design + #3870 body — this triage routes it, it does not re-decide)

    Journaled intent → source export/fence → destination import → coordinator completion, for application-owned entities only. Required local order everywhere: prepare/validate → persist typed record → apply in-memory state → acknowledge. Region journals stay independent; the coordinator journal holds membership/region-map/handoff records and NEVER entity payloads; no cross-region transaction is emulated.

    Recommendation / invariants the packets must hold

    Adopt the design's defaults (its §9 questions are non-blocking, below). Invariants (design §7): no duplicate writer (export fences source before destination can become routable); no silent loss (source export is the durable recovery copy until completion is verified); exactly-once effect per handoff_id under at-least-once delivery; monotonic owner epochs; compaction preserves active handoffs, fences/tombstones, receipts, and epochs; 16 KiB v1 payload cap with oversize refused before fencing.

    Phased packets filed + enqueued (dependency chain 1 → 2 → 3 → 4 → 5; gated packets park on claim until their predecessor lands)

    Questions for Drew

    None that block. The design's three open questions (§9: transfer unit = app-owned entity; transit reads rejected with status-only response; 16 KiB v1 cap) proceed on the design's recommended defaults, exactly as #3870's body directs ("Follow the design note's recommended defaults; the open questions for Drew are recorded there and do not block the protocol work"). A ruling on #2818 can amend a default before its phase lands.

  2. added
    work/assignedQueue worker lifecycle state
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    priority/normalOrdinary priority (the default)
    effort/lLarge: multi-day or open-ended; expect staged check-ins
    meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added
    and removed
    work/assignedQueue worker lifecycle state
    on Nov 1, 2026
  3. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    Intake review

    Related: design code issue #2818 and design PR #3875 (doc/2026-11-01_design_id2818.md); phase issues #3900–#3904 are already filed and in flight (phase 1 claimed, phases 2–5 parked behind it at intake time).

    Notes: This parent tracks the set; the per-phase acceptance lives on each phase issue. The design note's open questions for Drew are recorded there and explicitly do not block the protocol work.

    Risks: The failure-injection matrix is the substance of this epic — a phase that lands without its crash-point tests leaves the journal's core promise unverified. Compaction preserving active handoffs/epochs/tombstones/receipts (phase 1) is the easiest place to silently lose state.

    Suggested approach: Keep the parent as the set tracker: each phase's PR references this issue, and the parent closes when phase 5's feature-gated end-to-end acceptance passes.

    — fleet monitor intake enrichment, 2026-11-01 run (protocol §5). Acceptance criteria appended to the body where missing; labels normalized.

  4. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    agent-note:v1 — CORRECTION to the task 5859 triage record above (lane D worker, 2026-11-01).

    The phase task IDs in that record were mis-transcribed for phases 3–5 (an off-by-one from a garbled tool delivery). Verified just now against the live queue, the correct mapping is:

    (Task 5868 is an unrelated CI triage task, not part of this set.) The dedupe keys in the original record are unchanged and correct. Current live state: task 5864 is claimed (phase 2 in progress); tasks 5865/5866/5867 are parked on their predecessor gates, as designed.

  5. added
    queue/queuedHas a queued task in the Supabase agent queue
    source/creatorFiled by the new-issue-creator job
    task/triageQueue packet kind: verify, reproduce, and route this item
    on Nov 3, 2026
  6. developing-today commented on Nov 3, 2026

    @developing-today
    Contributor

    agent-note:v1
    state: triaged (coverage pass)
    Coverage pass 2026-11-03: reviewed in the fleet-wide per-issue pass (drift / overlap / already-handled / stale / blockers / ordering). Verdict: still live; queued in repo-health-code-pilot as triage at priority 40 (priority/normal). If this is already handled at current main, the triage closes it with evidence; if it needs splitting, the triage files the split.
    Found via: coverage pass 2026-11-03

  7. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    Triage (task 8286, lane code-e): implementation tracker is live and correctly ordered — no new work to route.

    Verified fresh 2026-11-03 against GitHub + the queue:

    Blocker/ordering (recorded per the coverage acceptance): the only thing between the current state and phase 3 is PR #3931 merging and #3901 closing. Nothing needs Drew (the design note's open questions are recorded there as non-blocking). No follow-up task was enqueued from this triage: dedupe showed the phase-2 port (task 8542) and the phase-3 parked task already cover the next steps, and a duplicate would violate the one-task-per-item rule. This tracker stays open until all five phases land.

  8. removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/lLarge: multi-day or open-ended; expect staged check-inskind/enhancementmeta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobtask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions