Skip to content

Add curated-collections layer with burned set#7

Merged
jwahdatehagh merged 2 commits into
networked-art:masterfrom
seanbonner:feat/curated-collections-burned
May 28, 2026
Merged

Add curated-collections layer with burned set#7
jwahdatehagh merged 2 commits into
networked-art:masterfrom
seanbonner:feat/curated-collections-burned

Conversation

@seanbonner
Copy link
Copy Markdown
Contributor

Implements the first step of #6: a small curated-collections layer — named, sourced sets of Punk ids that resolve in search and through a lookup API. This PR ships the mechanism plus the objective on-chain burned set (12 Punks). The museum set follows in a second PR.

This is deliberately distinct from search-synonyms.json, which rewrites trait phrases and structurally can't express id sets. Collections resolve as a separate resolver that runs before synonym expansion, so the two never collide.

What's in it

  • Data: sdk/src/search-collections.json, bundled next to search-synonyms.json. The burned entry carries title / description / aliases / source / standard / ids.
  • Search resolution: a whole-phrase alias (burned punks, burned, destroyed punks) resolves to the set via the existing PunksSearchQuery.ids / includeIds path, so it composes with the rest of a query — burned alien intersects, burned OR alien unions. Matching is on by default; the trailing punk(s) is optional; quoting ("burned") opts back out to a literal trait lookup.
  • Lookup API: punks.collections.list() / .get(slug) / .has(slug), plus standalone searchCollections and getSearchCollection. New CuratedCollection type. Getters return fresh copies, so callers can't mutate the bundle.
  • Tests + changeset (minor).

Decisions on the RFC's open questions

  1. In-SDK (this PR), reusing the existing ids path.
  2. Collection-level metadata only for burned (ids + title/description/source/standard) — no per-id provenance, keeping the first set objective and minimal.
  3. On by default, so punks.search("burned punks") works with no flag, as in the RFC's headline example. Whole-phrase-only matching keeps free-text surprise low; happy to gate behind a query flag instead if you'd prefer.
  4. search-collections.json alongside search-synonyms.json.

One refactor

normalizeName and normalizePunkStandard moved to the leaf utils module so the new collections module can reuse them without an import cycle through query. Both stay re-exported from their previous module, so this is non-breaking for consumers.

V1 / V2

Each collection carries a standard field (here v2PunkStandard.CryptoPunks) so sets stay attributed to the right contract. Two burned Punks (#2838, #5449) are also ZKM museum acquisitions; the upcoming museum PR represents that overlap rather than flattening it.

🤖 Generated with Claude Code

seanbonner and others added 2 commits May 28, 2026 11:37
Named, sourced sets of Punk ids that resolve in search and through a
lookup API, distinct from the trait-phrase synonym rewriter.

- Bundle the on-chain `burned` set (12 Punks) in search-collections.json.
- Resolve whole-phrase aliases (`burned punks`, `burned`) to their id set
  via the existing includeIds path, before synonym expansion. Quoting opts
  back out to a literal trait lookup.
- Add `punks.collections` (list / get / has) plus standalone
  `searchCollections` and `getSearchCollection`, and a `CuratedCollection`
  type.
- Move `normalizeName` / `normalizePunkStandard` to the leaf utils module so
  collections can reuse them without an import cycle; both stay re-exported
  from their previous module, so consumers are unaffected.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jwahdatehagh jwahdatehagh merged commit abca80c into networked-art:master May 28, 2026
@github-actions github-actions Bot mentioned this pull request May 28, 2026
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.

2 participants