Skip to content

id: import ingest — apply a verified export under normal admission rules with a per-entry report (§6.2 step 4; slice 4b of #2852, from #3810) #13158

Closed

Description

@dezren39

Slice 4b (ingest half) of #2852, remainder of #3810. The §6 core — export format + import verification (§6.2 steps 1–3) — landed in PR #9396 as slice 4a (pkgs/id/src/hosted_export.rs: build_export / verify_import, 9 tests green at main 3a941eff430e, verified 2026-11-23). What 4a deliberately left, in its own module doc: "Ingest itself (§6.2 step 4) follows the platform's normal rules and is likewise downstream of a verified import."

Scope

Apply a verified export at the importing (self-hosted) node:

  1. Downstream of verify_import only — an export that fails any §6.2 step 1–3 rule ingests nothing (already guaranteed by 4a; this slice must not weaken it).
  2. Ingest each verified object under the platform's normal rules (id: investigate: trust/visibility model — servers accept all signed objects; views count only allowed writers #2030: validity at ingest, counting at view). Import is not a privileged write path: hosted-origin objects are indistinguishable from self-hosted ones at the object layer (§6.2 step 4).
  3. Place each verified blob into the node's blob store by its hash, so document.put citations resolve locally.
  4. Return a per-entry outcome report to the operator: every object and blob named as applied, already-present, or refused with the rule that refused it. Refused entries are reported, never silently dropped (id: implement signed-object export/import for hosted ID stores (from #2046/#2852 slice 4) #3810's scope requirement).

Acceptance

  • Round-trip test: store → export → verify_import → ingest into a fresh node; the target's canonical object/hash set is identical to the export's set.
  • Re-ingesting the same export is idempotent: every entry reports already-present, nothing double-applies.
  • An entry that passes verification but fails a normal ingest rule (e.g. validity at ingest) is refused, named in the report with its rule, and does not block the remaining entries.
  • Blobs land by hash and are retrievable from the target node's blob store after ingest.
{
  "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-23T09:26:27Z",
    "session_id": null,
    "lane": null,
    "host": "htch-runtime",
    "worktree": null,
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": null,
    "auth_subject": "archer",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Activity

  1. added
    kind/featureNew feature or capability request
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    on Nov 23, 2026
  2. developing-today commented on Nov 23, 2026

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

    @dezren39
    MemberAuthor

    Pickup (Lane QJ, archer): working this now — import ingest (§6.2 step 4) downstream of verify_import: per-object ingest under normal admission rules, blobs placed by hash, per-entry outcome report (applied / already-present / refused-with-rule). Acceptance per the issue: round-trip identity, idempotent re-ingest, refused entries named without blocking the rest, blobs retrievable by hash. Worktree off current main on the laptop; premise check first (4a core hosted_export.rs on main).

  4. added a commit that references this issue on Nov 23, 2026
  5. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Done — Lane QJ (archer), 2026-11-23. Landed via PR #13201, merged c7ef51fbf859 (head SHA-guarded at 0785bdbe236f); this issue auto-closed via the PR body.

    What landed: new pkgs/id/src/hosted_ingest.rs — ingest_import applies a verified export at the importing node (§6.2 step 4):

    • Requires the VerifiedImport token from verify_import and checks it names this export's binding, key, and counts; a mismatch is refused before any write.
    • Objects go through EventStore::ingest — the store's normal verification/fork/waiting rules, no privileged path. Waiting-held objects are settled after the whole export is offered; one still waiting is reported refused under the waiting rule (its held row stays, so a later import carrying the dependency releases it).
    • Blobs are placed in the node's iroh-blobs store under the BLAKE3 hash of their bytes — the hash a document.put header cites — so citations resolve locally.
    • ImportReport names every object and blob as applied / already-present / refused-with-rule; a refusal never blocks the remaining entries.

    Verification (laptop, nix develop in pkgs/id): cargo test -p id --lib hosted_ → 57 passed, 0 failed (5 new tests covering each acceptance line: round-trip identity + blob retrievable by cited hash, idempotent re-ingest, malformed-object refusal named and non-blocking, missing-predecessor waiting refusal, foreign token writes nothing). Full cargo test -p id --lib → 531 passed, 0 failed. Clippy clean; rustfmt clean on the new file. hosted_export's module doc now points at the new module for step 4.

    #3810 stays open as the slice-4b tracker: its remaining half is #13157 (hosted export production — DO enumeration + R2 fetch feeding build_export).

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

    app/idPackage/app: id (pkgs/ or apps/ in this repo)kind/featureNew feature or capability requeststatus:in-review

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions