From a843c30a9e0ecd98b3c4974068af7f729999db5d Mon Sep 17 00:00:00 2001 From: Matteo Cherubini Date: Fri, 19 Jun 2026 05:44:59 +0200 Subject: [PATCH] feat: Integrate duplicate slug advisory into ingest linting workflow --- skills/ingest/scripts/run-ingest.sh | 9 ++++++++- skills/ingest/scripts/scoped-lint.sh | 7 +++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/skills/ingest/scripts/run-ingest.sh b/skills/ingest/scripts/run-ingest.sh index 9ccd995..cb998cd 100644 --- a/skills/ingest/scripts/run-ingest.sh +++ b/skills/ingest/scripts/run-ingest.sh @@ -113,7 +113,14 @@ bash "${SCRIPTS}/log-append.sh" --type INGEST --subject "$slug" --model "$model" || fail "log" "log-append failed" # --- 3. scoped linter (capture findings for the PR; never aborts the run) --- -lint_out="$( bash "${SCRIPTS}/scoped-lint.sh" "$genome" "${all_paths[@]}" 2>&1 )" && lint_rc=0 || lint_rc=$? +# Point scoped-lint at the same manifest we were handed so its duplicate +# advisory reads the right file even when a non-default path arrives as $2. +# (The dedup check lives inside lib/lint.sh and is invoked by scoped-lint — +# there is no separate check-duplicates.sh script.) +export INGEST_MANIFEST="$manifest" +lint_out="$( + bash "${SCRIPTS}/scoped-lint.sh" "$genome" "${all_paths[@]}" 2>&1 +)" && lint_rc=0 || lint_rc=$? # --- 4. assemble the PR body (manifest tables + lint results) --- body="$(mktemp)" diff --git a/skills/ingest/scripts/scoped-lint.sh b/skills/ingest/scripts/scoped-lint.sh index 5fb12e9..21eb969 100644 --- a/skills/ingest/scripts/scoped-lint.sh +++ b/skills/ingest/scripts/scoped-lint.sh @@ -49,6 +49,13 @@ for f in "$@"; do check_broken_links "$f" || true # warnings only done +# Cross-page duplicate advisory: runs ONCE over the whole manifest (not per +# file) — it compares this run's created slugs against the index, so repeating +# it for every file would only print the same warnings N times. Warn-only; +# never affects the exit status. INGEST_MANIFEST lets run-ingest.sh point us at +# a non-default manifest path; falls back to the conventional name otherwise. +check_duplicates "${INGEST_MANIFEST:-.ingest-manifest.json}" + echo "" echo "scoped-lint: ${errors} error(s), ${stale} stale across ${count} file(s)"