⚠️ Definition of Done: this issue must be completed in full, in a single PR. Do not split this
work across multiple PRs, and do not defer any Deliverable below to a follow-up issue. A PR that
satisfies only some of the Deliverables, stubs a required test, or leaves a checkbox
partially-done does NOT resolve this issue and will be closed.
Context
packages/loopover-engine/src/miner-goal-spec.ts:247-270's normalizeSelfPlagiarismPolicy only warns when similarityThreshold isn't a number (line 262); an out-of-range numeric value (e.g. 5, -1) falls through to self-plagiarism.ts's Math.min(1, Math.max(0, value)), silently clamping to 1 with zero warnings and marked "present"/configured. Every sibling numeric normalizer in the same file (normalizePositiveInteger, lines 313-323) and in ams-policy-spec.ts's normalizePositiveNumber (lines 192-199) rejects out-of-range values, warns, and falls back to the default instead.
Requirements
Warn and fall back to the module's documented default when the numeric similarityThreshold value is outside [0,1] or non-finite, matching the sibling normalizer convention (normalizePositiveInteger/normalizePositiveNumber) exactly -- same warning-message style, same fallback-to-default behavior.
Deliverables
All of the above Deliverables are required in the same PR unless the deliverable text itself states otherwise.
Test Coverage Requirements
packages/loopover-engine/** -- 99%+ patch coverage, branch-counted, on the new out-of-range warning path.
Expected Outcome
A misconfigured similarityThreshold outside [0,1] produces a visible warning and falls back to the safe default, matching every sibling numeric config normalizer in this codebase.
Links & Resources
packages/loopover-engine/src/miner-goal-spec.ts:247-270,313-323
packages/loopover-engine/src/ams-policy-spec.ts:192-199
Context
packages/loopover-engine/src/miner-goal-spec.ts:247-270'snormalizeSelfPlagiarismPolicyonly warns whensimilarityThresholdisn't a number (line 262); an out-of-range numeric value (e.g.5,-1) falls through toself-plagiarism.ts'sMath.min(1, Math.max(0, value)), silently clamping to1with zero warnings and marked "present"/configured. Every sibling numeric normalizer in the same file (normalizePositiveInteger, lines 313-323) and inams-policy-spec.ts'snormalizePositiveNumber(lines 192-199) rejects out-of-range values, warns, and falls back to the default instead.Requirements
Warn and fall back to the module's documented default when the numeric
similarityThresholdvalue is outside[0,1]or non-finite, matching the sibling normalizer convention (normalizePositiveInteger/normalizePositiveNumber) exactly -- same warning-message style, same fallback-to-default behavior.Deliverables
normalizeSelfPlagiarismPolicywarns and falls back to the default whensimilarityThresholdis a finite number outside[0,1]5or-1) produces a warning and the default threshold, not a silently-clamped value with no warningAll of the above Deliverables are required in the same PR unless the deliverable text itself states otherwise.
Test Coverage Requirements
packages/loopover-engine/**-- 99%+ patch coverage, branch-counted, on the new out-of-range warning path.Expected Outcome
A misconfigured
similarityThresholdoutside[0,1]produces a visible warning and falls back to the safe default, matching every sibling numeric config normalizer in this codebase.Links & Resources
packages/loopover-engine/src/miner-goal-spec.ts:247-270,313-323packages/loopover-engine/src/ams-policy-spec.ts:192-199