Repository navigation
Description
Architecture Finding
Type: tech-debt (duplicated logic)
Affected area: scripts/validate-architectures.mjs, scripts/validate-community-groups.mjs, scripts/validate-members.mjs, scripts/validate-projects-born.mjs
Four validator scripts each carry an independent, byte-near-identical copy
of the same per-entry dedup check: track seen values in a Set, push an
error on a repeat, differing only in variable names and the error message.
scripts/validate-case-studies.mjs, scripts/validate-radar-reports.mjs,
scripts/validate-metrics.mjs, and scripts/validate-launch-metrics.mjs
already centralize their version of this behind checkDuplicateOrMissingId()
in scripts/lib/validate-utils.mjs (see #1751/#1752). The four scripts above
were left out because that helper also treats a falsy value as an error on
its own — and all four already run a separate presence check on the same
field (checkNonEmptyString() or an inline check), so reusing it as-is would
double-report a single missing entry as both "missing" and "duplicate".
Impact
The same mechanical bug-fix or message-wording change to "how duplicates are
reported" has to be hand-applied in four places (plus the other four already
centralized), with no shared test coverage; a fix to one copy routinely
misses the others. New validators are likely to copy whichever inline
version they find first, growing the duplication further (npm run check:duplication already runs against a tracked clone-count ceiling in
.jscpd.json).
Recommendation
Add a checkDuplicateValue() helper — dedup-only, no presence check — in a
new scripts/lib/duplicate-check.mjs, and migrate the four scripts above to
it, each keeping its existing guard structure (unconditional, slug-style
if (value), or typeof === 'string') so none of them changes behavior for
a missing value.
Decision taken by hive: the new helper goes in its own file
(scripts/lib/duplicate-check.mjs) with its own test file
(tests/duplicate-check.test.mjs), rather than being added to
scripts/lib/validate-utils.mjs / tests/validate-utils.test.mjs. Those two
files are under active review in hold-gated PR #1761, and
tests/coverage-report-cli.test.mjs enforces 100% coverage of
validate-utils.mjs specifically from validate-utils.test.mjs, so any new
export there needs a same-PR test addition to that exact file. Keeping the
new, narrower check in its own module avoids touching #1761's claimed files
and needs no maintainer input to choose correctly.
Filed by architect agent (ACMM L5 — hold-gated mode)
🐝 Hive Agent: architect | Instance: hosted-available-lke648397-260827-5n31 | SHA: unknown
— hive: agent=architect backend=copilot model=claude-opus-4-6 copilot=1.0.88
Activity
hivecommons-hive commentedon Oct 22, 2026
🛠️ Hive agent
architect(hive hosted-available-lke648397-260827-5n31) started work on this issue at 2026-10-22T07:32:59Z. A pull request referencing this issue supersedes this mark; it lapses on its own at 2026-10-22T09:32:59Z if none appears.