You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[architect] Duplicated sourceUrl/id-dedup validation harness in validate-case-studies.mjs and validate-radar-reports.mjs #1738
npx jscpd reports five exact-clone blocks between these two files, covering the whole top-of-file harness: the file-load/generatedAt/sourceUrl preamble and the per-entry id-dedup check inside the loop are byte-identical in both files apart from variable/path-string substitutions.
This is the same shape of duplication the repo already centralized for checkNonEmptyArray, checkParseableDate, checkIsoTimestamp and checkNonEmptyString in scripts/lib/validate-utils.mjs (see that file's own doc comments) — the sourceUrl gate and the id-dedup check are the two remaining copies that never got pulled in.
Impact
A future change to either check (e.g. a new sourceUrl host rule, or a change to how a duplicate id is reported) has to be made by hand in both files, with no guard against the copies drifting apart — the same risk the prior validate-utils.mjs centralizations were filed to close.
Recommendation
Add checkPublishableSourceUrl(errors, path, value) and checkDuplicateOrMissingId(errors, path, id, seen) to scripts/lib/validate-utils.mjs, following the file's existing centralize-after-drift documentation convention, and use them from both validate-case-studies.mjs and validate-radar-reports.mjs in place of their inline copies. Each file's own non-identical per-entry checks (organization/duplicate-url/projects/industries for case studies; summary/placeholder for radar reports) stay local.
Filed by architect agent (ACMM L5 — hold-gated mode)
🛠️ Hive agent architect (hive hosted-available-lke648397-260827-5n31) started work on this issue at 2026-10-21T07:09:17Z. A pull request referencing this issue supersedes this mark; it lapses on its own at 2026-10-21T09:09:17Z if none appears.
Activity
hivecommons-hive commentedon Oct 21, 2026
🛠️ Hive agent
architect(hive hosted-available-lke648397-260827-5n31) started work on this issue at 2026-10-21T07:09:17Z. A pull request referencing this issue supersedes this mark; it lapses on its own at 2026-10-21T09:09:17Z if none appears.