Skip to content

id(serve): a failed blob-gate rebuild replaces the live gate with an empty fold, so every current member loses blob fetch until the next tick #13821

Todo

Description

@dezren39

Finding

The blob membership gate's periodic refresh task replaces the live gate with an empty one when a transient read fails. build_blob_gate (pkgs/id/crates/id-cli/src/commands/serve/startup.rs) substitutes fallback values on each error and returns them as if they were a complete fold:

  • group log cannot be opened (startup.rs:206-209): group_projection = None
  • group log does not fold (startup.rs:201-204): group_projection = None
  • document_references() fails (startup.rs:215-218): references = Vec::new()
  • end of function (startup.rs:280-283): None becomes FoldedWorlds::new(Worlds::empty(), index), which has no members and an index built from the fallback references

The refresh loop in commands/serve.rs:2399-2415 runs build_blob_gate every GROUP_WARNING_INTERVAL (60s) and calls gate.refresh(folded) unconditionally. RefreshingWorlds::refresh (pkgs/id/crates/id-worlds/src/blob_gate.rs:227-231) installs the new fold with no check that the previous one was valid.

Result: one failed read of the group log or the document references, which can be a transient I/O or lock error, makes every current member fail to fetch or observe blobs until the next successful tick. The only signal is a warn! line (startup.rs:202, 207, 216); no metric or state records that the gate is running on a degraded fold.

This is fail-closed for reads, so it is not a data leak. It is a silent availability regression, and the same fallback pattern is a plausible source of a hard-to-diagnose "blobs disappeared" report.

Related: #6979 covers the groups-fold gate in ingest (event_store/resolve.rs), not this blob-gate refresh path.

Evidence

Checked on origin/main at 3be23e4943a:

  • pkgs/id/crates/id-cli/src/commands/serve/startup.rs:193-283 (build_blob_gate): the three fallback branches above
  • pkgs/id/crates/id-cli/src/commands/serve.rs:2399-2415: the refresh loop, with gate.refresh(folded) unconditional
  • pkgs/id/crates/id-worlds/src/blob_gate.rs:211-231: RefreshingWorlds::refresh overwrites the fold without validation
  • Existing refresh test (id-worlds/src/blob_gate.rs tests) covers only a legitimate membership removal, not a degraded read

Why it matters

The gate's purpose is to keep blobs from peers who are not members. Dropping a live gate to empty on a read error makes it misbehave in the other direction for every legitimate member, and the failure only appears as a warning in the serve log. An operator has no way to tell a temporary read failure from a real membership change.

Suggested fix shape

  • Have build_blob_gate return Result (or an explicit Degraded variant), and have the refresh loop keep the last good fold when a rebuild fails, logging the failure at error level.
  • Keep the fail-closed rule for a never-built gate: at startup, with no prior good fold, keep the empty gate.
  • Add a test that a failed GroupLog::open or failed reference read keeps the previous membership in force, and that a later successful rebuild replaces it.

Acceptance criteria

  • A failed rebuild in the refresh loop does not replace the previous good FoldedWorlds; the previous fold stays in force.
  • Each failed rebuild logs at error level with the failing step.
  • A test covers: rebuild fails (log open error, fold error, reference read error) → previous membership still admits a current member's fetch; then a successful rebuild that removes the member revokes it.
  • Startup with no prior good fold still refuses (no change to the fail-closed default).
{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-23T22:24:23Z",
    "session_id": "ses_e5df585f20dffeaLGc3gblZSAA",
    "lane": null,
    "host": "amd",
    "worktree": "/home/user/git/code",
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": {
      "kind": "worktree",
      "id": "/home/user/git/code",
      "repo": "developing-today/code",
      "branch": "main",
      "sha": "57597b8540ac0aa94d347a1b9609a6f29abee6ac"
    },
    "auth_subject": "oc-code-06",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Activity

  1. developing-today commented on Nov 23, 2026

    @developing-today
    Contributor
  2. added
    epic/id-maintenance
    primary-parent/id-maintenance
    stray-work
    on Nov 24, 2026
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/id-maintenanceprimary-parent/id-maintenancestray-work

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions