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
- Validate submitted URL/name and optional metadata.
- required at submit: website + trust signal
- most metadata remains optional for low-friction contribution
- Scrape website metadata/content (
lib/scraper.ts). - Run AI enrichment for:
- display name
- slug
- category (required)
- tags (preferred) and labels (legacy compatibility; optional)
- punchline and description
- image-fit recommendation
- Process feature image:
- use uploaded file, or
- evaluate scraped image candidates, optionally with AI selection, or
- generate fallback image
- Persist quality + provenance metadata:
products.enrichment_metawithmetadata_flagsandenrichment_fallbackproducts.enrichment_meta.facet_suggestionswith accepted/rejected/source facet audit dataproduct_submissionswith trust signal and submitter context
- Insert product facet links.
- 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_taxonomyfor: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)
- closed-set facets reject unknown terms (
- Audience guardrails:
audienceis optional and should stay empty unless the source explicitly targets a canonical audience segment.- Do not default to
intended-parents. - Use
intended-parentsonly for conception/fertility-planning resources clearly aimed at prospective parents. - For broad general-health or mental-health resources, prefer an empty
audiencearray unless the source makes the audience explicit.
- Resource-type and topic guardrails:
- Use
directoryonly when the resource primarily lists or matches multiple external providers/resources. - For a single clinic, health system, hospital, practice, or treatment center, prefer
clinicorproviderinstead ofdirectory. - Do not assign
mental-healthorcommunity-supportunless the source explicitly centers those themes.
- Use
navigationCategorysuggestions 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
- Source file:
DOCS/features/submission-and-enrichment.md - Source URL: https://github.com/maggielerman/smc-directory/blob/main/DOCS/features/submission-and-enrichment.md
Dataset Preview
- Raw CSV row/table content is available in the source artifact.