Skip to content

Foreign-order resilience: render orphan Drive IDs and turn them into source discovery #324

Description

@WilfordGrimley

Owner-ratified direction, 2026-07-22. Milestone: Federation v1. Priority: polish-tier (behind funnel/consensus work).

The feature in one paragraph

Today the editor renders only what the catalog already knows: an imported order XML whose identifiers come from un-indexed drives shows "card not found" per slot, even though a public Google Drive file ID is a globally unique, self-sufficient image address. This feature makes the editor resilient to foreign orders — any mpc-autofill-lineage XML opens visually intact here — and then closes the loop by treating each orphan ID as a catalog-growth lead: derive the drive it came from and offer it to the source-intake flow. Editor parity for users; discovery funnel for the catalog; a concrete adoption argument for federation ("your orders survive the move").

User stories

  1. Import: As a user importing an order built against another instance, I see my actual card images, not placeholders — with the orphans honestly labeled as "from your file, not in our catalog."
  2. Discovery: As the same user, when orphans are present I'm offered: "these images come from a drive we don't index — suggest it as a source?" One tap files the lead.
  3. Operator: As the catalog operator, suggested drives arrive as structured intake leads (root folder ID, file count, sample names), not free-text requests.

Phase 1 — orphan rendering (frontend only)

  • On identifier lookup miss, synthesize a minimal card object: identifier + the slot's XML search query as its stand-in name.
  • Image loads direct from Google (lh3/lh4.googleusercontent.com/d/<id>), never through our CDN Worker — the Worker's cache stays catalog-only; we do not become an open proxy for arbitrary IDs.
  • Downgrade to the existing "card not found" only when the image fetch itself fails (private/deleted/revoked).
  • Orphans get no version picker, tags, or consensus surfaces; visually distinct treatment.
  • Votes-off/base-parity safe: no dependency on the vote system (candidate row for docs/upstreaming/extractable-primitives.md at build time).

Phase 2 — source derivation + suggestion

  • Backend endpoint: given an orphan file ID, call Drive API files.get?fields=parents with our existing indexer credentials, walk parents to the shared root, files.list to summarize it (count, sample filenames). Indexing metadata only — no pixel storage (governing premise).
  • Editor surfaces the one-tap "suggest this drive as a source" flow on orders containing orphans; suggestions land as structured intake leads for owner review.
  • Known limit: per-file sharing without folder sharing dead-ends the walk — degrade gracefully to "couldn't identify the drive."
  • VERIFY AT PICKUP (Tron): empirically confirm files.get?fields=parents returns parents for anyone-with-link files under our API credential class before building; this claim is from documentation knowledge, not yet tested against our key.

Explicitly out of scope

Authenticated proxying of private drives to general users. Serving is unauthenticated-GET by design; bridging private content through our credentials would republish it via our domain — separate design/security decision if ever wanted. (Users' OWN private files already work client-side via their own OAuth session in the Drive-connect surfaces.)

Acceptance

  • A test XML referencing public un-indexed IDs renders images for every reachable slot; revoked ID degrades to not-found; no requests for orphan IDs appear in Worker logs.
  • Phase 2: suggestion flow produces a structured lead from a single orphan ID on a folder-shared drive; per-file-shared fixture degrades gracefully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions