Skip to content

id: program gallery read surface (list, fetch, search) and --gallery-dir - #11690

Merged
dezren39 merged 1 commit into
mainfrom
claude/id-gallery-read-10003
Nov 18, 2026
Merged

dezren39 merged 1 commit into
mainfrom
claude/id-gallery-read-10003

Conversation

@dezren39

@dezren39 dezren39 commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Before: the registry core from #11500 could hold verified program bundles, but no server exposed them, bundles carried no discovery metadata, and nothing could search them.

After: id serve --web --gallery-dir <dir> serves a public gallery read surface. It lists signed records, fetches bundles by content hash, and searches the authors' signed descriptions and categories in a fixed, documented order.

This implements v3 design G1 (the endpoint is a read surface over D6, unchanged), G3 (search over signed metadata from a rebuildable index, deterministic order, no engagement ranking) and G7 (answers are cacheable because records are signed and bundles are content-addressed).

How:

  • program_bundle.rs: BundleManifest gains optional signed description (at most 4096 bytes) and categories (at most 8, lower-case ASCII, digits and -, no repeats). They are omitted from the JSON when absent, so existing bundles decode unchanged. ProgramSpec gains matching fields.
  • program_gallery.rs (new, id-worlds):
    • SearchIndex::rebuild(records) indexes only records that verify.
    • search matches every query word against name, description, categories and author key.
    • Order: exact name, then category match, then most recent version; name, author and hash break ties. Results are capped at 200.
    • Gallery wraps a Registry and keeps the index in step with publish, unpublish and remove; rebuild_index() recreates it from records alone.
  • id-web/src/gallery.rs (new):
    • GET /api/gallery/records?author=&name= and GET /api/gallery/search?q=&category=&limit= return JSON records with Cache-Control: public, max-age=60. Search answers also state their order.
    • GET /api/gallery/bundles/{hash} returns the exact bundle bytes, immutable, with the hash as the ETag; a malformed hash gets 400.
    • Every route returns 404 unless a gallery is wired in through AppState::set_gallery. The routes sit inside the listener's existing security guard.
  • id serve --gallery-dir (requires --web, env ID_GALLERY_DIR) opens the directory with Registry::open_dir, which verifies every bundle and fails the start on a bad file. There is no publish route: the operator decides what goes in the directory, so the admission-posture question in the v3 design stays open.

Testing:

  • cargo test -p id-worlds --lib -- program_ passes (50), including 9 gallery tests: ordering, category filter, limit, permutation-invariant order, rebuild, withdrawal tracking, unverifiable records and query length, plus a discovery-metadata signing and bounds test.
  • cargo test -p id-web --lib passes (723), including 4 route tests.
  • The new CLI parse test passes.
  • cargo check passes for id and for id-cli with and without web.
  • Clippy is clean on the changed lines.

Closes #10003


Generated by Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

The gallery's public read surface (#10003, v3 design G1, G3, G7) over
the registry core from #11500.

- Bundle manifests gain signed discovery metadata: an optional
  description and up to 8 portable categories, bounded and checked at
  export and decode.
- id-worlds program_gallery: a SearchIndex rebuildable from registry
  records alone, with the documented deterministic order (exact name,
  then category, then most recent version; no engagement ranking), and
  a Gallery that keeps the index in step with publish, unpublish and
  remove.
- id-web /api/gallery/records, /bundles/{hash} and /search, cacheable
  (bundles immutable by content hash), 404 when no gallery is wired.
- id serve --gallery-dir <dir> (requires --web) verifies every stored
  bundle at start and serves them.

Closes #10003

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dezren39
dezren39 marked this pull request as ready for review November 18, 2026 06:18
@dezren39
dezren39 requested a review from a team as a code owner November 18, 2026 06:18
@coderabbitai

coderabbitai Bot commented Nov 18, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T06:20:19.714252Z 9b2dd48 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@dezren39
dezren39 merged commit 7381ae9 into main Nov 18, 2026
@dezren39
dezren39 deleted the claude/id-gallery-read-10003 branch November 18, 2026 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

id(phase-14): public gallery endpoint read surface — D6 list/fetch + rebuildable search index (v3 of #6294)

2 participants