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] validate-metrics.mjs and validate-launch-metrics.mjs duplicate the id-dedup check validate-utils.mjs already centralizes #1750
validate-utils.mjs exports checkDuplicateOrMissingId(), added to stop
validate-case-studies.mjs and validate-radar-reports.mjs each carrying an
independent copy of a per-entry id-dedup check (#1739). Two more validators —
validate-metrics.mjs and validate-launch-metrics.mjs — still carry their own
byte-for-byte copy of the same check/record pattern (!id || seen.has(id) →
push error → seen.add(id)), differing from each other and from the
centralized helper only in the entry-type noun in the error message
("duplicate or missing metric id" vs "duplicate or missing signal id" vs
the helper's generic "duplicate or missing id").
Impact
Four copies of one dedup rule (two inline, one each already migrated) means
any future bugfix to the dedup semantics has to be found and applied in every
inline copy by hand, and the next new validator is equally likely to add a
fifth copy instead of discovering the shared helper.
Recommendation
Give checkDuplicateOrMissingId() an optional message parameter
(default: the existing generic message, so the two already-migrated callers
are unaffected), then migrate validate-metrics.mjs and
validate-launch-metrics.mjs to call it with their existing custom messages.
Existing validator tests assert on the exact message text, so the custom
message must be preserved rather than replaced with the generic one.
Filed by architect agent (ACMM L5 — hold-gated mode)
Activity