From 13700c4d2b277e0a706971f8fc4d33686e384881 Mon Sep 17 00:00:00 2001 From: shin-core <153108882+shin-core@users.noreply.github.com> Date: Fri, 17 Jul 2026 17:05:28 +1000 Subject: [PATCH] docs(engine): correct normalizeNonNegativeInteger's floor in its doc comment (#6775) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The comment claimed parity with MinerGoalSpec's normalizePositiveInteger, which rejects anything < 1 after flooring. normalizeNonNegativeInteger only rejects < 0 and deliberately accepts 0 (already-tested behavior — a 0 budget is a meaningful "do nothing" setting). Describe its own >= 0 floor instead, so the comment can't mislead a contributor into thinking 0 is rejected here. Comment-only; no behavior change. Closes #6775 --- packages/loopover-engine/src/ams-policy-spec.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/loopover-engine/src/ams-policy-spec.ts b/packages/loopover-engine/src/ams-policy-spec.ts index 1769329cc..59c9389b0 100644 --- a/packages/loopover-engine/src/ams-policy-spec.ts +++ b/packages/loopover-engine/src/ams-policy-spec.ts @@ -141,7 +141,9 @@ function normalizePositiveNumber(value: unknown, field: string, fallback: number } /** Like normalizePositiveNumber, but floors to a whole count -- for fields that are semantically integer - * counts (an iteration/turn budget), matching MinerGoalSpec's own normalizePositiveInteger convention. */ + * counts (an iteration/turn budget). Its floor is >= 0: unlike MinerGoalSpec's normalizePositiveInteger + * (which rejects anything < 1 after flooring), 0 is deliberately accepted here (see the parser test's + * zero-budget case) -- a 0 budget is a meaningful "do nothing" setting, not a malformed value. */ function normalizeNonNegativeInteger(value: unknown, field: string, fallback: number, warnings: string[]): number { const normalized = normalizePositiveNumber(value, field, fallback, warnings); return Math.floor(normalized);