Note

    submission-and-enrichment

    End-user submission pipeline and AI-assisted metadata/image generation

    Dates

    Created
    Not recorded
    Last updated
    Not recorded

    Document Metadata

    • title: Submission and Enrichment
    • description: End-user submission pipeline and AI-assisted metadata/image generation
    • status: evolving
    • lastUpdated: "2026-03-13 11:46 ET (America/New_York)"
    • owner: Product

    Submission and Enrichment ## Entry Point - Route action: app/(public)/submit-new/action. ts - Validation schema: `app/(public)/submit-new/schema.

    Submission and Enrichment

    Entry Point

    • Route action: app/(public)/submit-new/action.ts
    • Validation schema: app/(public)/submit-new/schema.ts
    • AI prompts: app/(public)/submit-new/prompt.ts

    Flow

    1. Validate submitted URL/name and optional metadata.
      • required at submit: website + trust signal
      • most metadata remains optional for low-friction contribution
    2. Scrape website metadata/content (lib/scraper.ts).
    3. Run AI enrichment for:
      • display name
      • slug
      • category (required)
      • tags (preferred) and labels (legacy compatibility; optional)
      • punchline and description
      • image-fit recommendation
    4. Process feature image:
      • use uploaded file, or
      • evaluate scraped image candidates, optionally with AI selection, or
      • generate fallback image
    5. Persist quality + provenance metadata:
      • products.enrichment_meta with metadata_flags and enrichment_fallback
      • products.enrichment_meta.facet_suggestions with accepted/rejected/source facet audit data
      • product_submissions with trust signal and submitter context
    6. Insert product facet links.
    7. Revalidate public product/taxonomy caches.

    Approval Gate

    • Submissions can be incomplete at creation time.
    • Admin approval requires publish-ready minimum fields:
      • title
      • website
      • punchline
      • description
      • feature image

    Taxonomy Behavior

    • User-provided and AI-provided taxonomy values are merged and normalized by facet policy.
    • Accepted facet links are created in product_taxonomy for:
      • resourceType, topic, audience, lifeStage, format, location, cost, trust
    • Canonical persistence policy now applies by facet:
      • closed-set facets reject unknown terms (resourceType, topic, audience, lifeStage, format, cost, trust)
      • location: controlled-open-set (unknown values allowed + review metadata)
    • Audience guardrails:
      • audience is optional and should stay empty unless the source explicitly targets a canonical audience segment.
      • Do not default to intended-parents.
      • Use intended-parents only for conception/fertility-planning resources clearly aimed at prospective parents.
      • For broad general-health or mental-health resources, prefer an empty audience array unless the source makes the audience explicit.
    • Resource-type and topic guardrails:
      • Use directory only when the resource primarily lists or matches multiple external providers/resources.
      • For a single clinic, health system, hospital, practice, or treatment center, prefer clinic or provider instead of directory.
      • Do not assign mental-health or community-support unless the source explicitly centers those themes.
    • navigationCategory suggestions are retained in audit metadata only and are never persisted as term links from this flow.

    Failure Handling

    • Scrape failures fall back to user input and safe defaults.
    • AI enrichment failures degrade gracefully to non-AI values.
    • AI enrichment now attempts a strict-format retry before fallback.
    • AI fallback state is persisted via enrichment_meta.enrichment_fallback.
    • Image failures fall back to generated feature artwork.

    Provenance

    Dataset Preview

    • Raw CSV row/table content is available in the source artifact.