Repository navigation
Closed
Labels
bugSomething isn't working
Description
Problem
The llm-enrichment.yml CI workflow triggers on every push to README.md or dataset_description.json on main. The POST /webhooks/llm-enrich handler always runs the full pipeline (seed -> LLM enrich -> MeSH validate -> LLM judge validate), regardless of whether .nemar/metadata.json already has pipeline_stage: "validated".
This means:
- Unnecessary LLM API calls (OpenRouter costs)
- Risk of overwriting a human-curated or already-validated result with a potentially different LLM output
- Minor README formatting changes trigger a full re-enrichment
Current behavior
push README.md -> CI triggers -> webhook called -> full pipeline runs -> metadata.json overwritten
No check for current pipeline_stage or whether the changes are significant enough to warrant re-enrichment.
Expected behavior
The webhook should check whether re-enrichment is warranted:
- Read existing
.nemar/metadata.jsonand checkpipeline_stage - If already
validated:- Compare the incoming
dataset_description.jsonagainst what was used to seed (author changes, title changes, license changes are significant) - Compare README content hash or length delta to detect significant changes
- Skip re-enrichment if changes are not significant (respond with
{ skipped: true, reason: "..." }) - Allow override via request body
{ force: true }orworkflow_dispatch
- Compare the incoming
- If
seededorenriched, always re-run (the pipeline hasn't completed yet) - If no
.nemar/metadata.jsonexists, always run (first enrichment)
Significance heuristics
Consider a change "significant" if any of:
- Authors changed (added, removed, reordered)
- Title changed
- License changed
- README content changed by more than N% or N lines (threshold TBD)
dataset_description.jsonfields changed (beyond whitespace/formatting)
Non-significant changes (skip re-enrichment):
- README whitespace or formatting-only changes
- README changes that only affect acknowledgments or boilerplate
- No actual content change (e.g., git-annex pointer updates)
Affected files
backend/src/routes/webhooks.ts-POST /webhooks/llm-enrichhandler (line 560+).github/workflows/llm-enrichment.yml(in dataset repos via nemarDatasets/.github)
Workaround
Manual workflow_dispatch already exists for intentional re-runs. The fix is adding a guard in the webhook handler, not changing the CI trigger.
Metadata
Metadata
Assignees
Labels
bugSomething isn't working
Activity
Fix DOI metadata pipeline and add enrichment guard
Fix DOI metadata pipeline and add enrichment guard (#163)
neuromechanist commentedon Feb 20, 2026
Addressed in #163