Skip to content

show a catalog ingredient's source scrap by title and let one click list its siblings #7617

Description

@atomantic

Problem / Goal

A committed ingredient shows its source as a bare cat-scrap-<uuid> monospace string (client/src/pages/CatalogIngredient.jsx:1438), and there is no way to ask "what else came out of this piece?". The catalog already has two grouping seams — refs (universe / series / work) and sources (scrap) — so the fix is to promote the scrap that already groups these rows, not to invent a third parallel taxonomy (an autobiography record type is explicitly the wrong answer: a third taxonomy is what makes the catalog feel arbitrary).

Approach

  1. GET /api/catalog/ingredients/:id/details (server/routes/catalog.js:239-264) returns source rows as { scrapId, span, extractedAt } with no title. Join catalog_scraps.title onto them, and add the sibling extractions for each source scrap via listSourcesForScrap (server/services/catalogDB/refs.js:38) so the detail page needs no second round-trip.
  2. client/src/pages/CatalogIngredient.jsx:1438 renders the scrap title as a link, plus a "From the same source" list of sibling ingredients.
  3. Add scrapId to catalogIngredientQuerySchema (server/lib/catalogValidation.js), filter on it through catalog_ingredient_sources in listIngredients (server/services/catalogDB/ingredients.js), and wire ?scrap=<id> into client/src/pages/Catalog.jsxselection lives in the URL per client/src/AGENTS.md, so "everything extracted from this piece" is one click and one shareable link.

Acceptance criteria

  • Ingredient detail shows the source scrap's title (not the raw id) and its sibling ingredients, from a single /details response.
  • /catalog?scrap=<id> filters the catalog to that scrap's extractions and survives a reload / share.
  • An ingredient with no source scrap, and a scrap with exactly one extraction, both render without an empty "From the same source" stub.
  • Route tests cover the scrapId filter and the joined title; the client test covers the link and the sibling list.
  • The catalog docs describe the source-scrap grouping.

Out of scope

  • Per-chunk source provenance: commitScrap links to the parent scrap only and the extractor never emits span. Pre-existing, unchanged here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:createUniverse/catalog/Create-suiteeffort:mediumDispatch effort: mediumenhancementNew feature or requestin-progressClaimed and being workedmodel:mediumRoutine multi-file workplanTracked by /do:replanplanner:opus-5Plan authored by the opus-5 model

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions