Skip to content

[architect] Duplicated sourceUrl/id-dedup validation harness in validate-case-studies.mjs and validate-radar-reports.mjs #1738

Closed

Description

@hivecommons-hive

Architecture Finding

Type: tech-debt (duplicated validation harness)
Affected area: scripts/validate-case-studies.mjs, scripts/validate-radar-reports.mjs

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 | Instance: hosted-available-lke648397-260827-5n31 | SHA: 3bbac0d

— hive: agent=architect backend=copilot model=claude-opus-4-6 copilot=1.0.88

Activity

  1. hivecommons-hive commented on Oct 21, 2026

    @hivecommons-hive
    ContributorAuthor

    🛠️ 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/architectCreated by Hive for agent-filed issue provenancearchitectureCreated by Hive for agent-filed issue provenancehive/claimed-by-architectstage/040-covered-by-prAn open PR covers this issuetech-debtCreated by Hive for agent-filed issue provenance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions