Skip to content

Commit 2e34508

Browse files
authored
Merge pull request #6800 from shin-core/fix/ams-policy-normalize-doc-6775
docs(engine): correct normalizeNonNegativeInteger's floor in its doc comment (#6775)
2 parents ab9cb63 + 13700c4 commit 2e34508

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

packages/loopover-engine/src/ams-policy-spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,9 @@ function normalizePositiveNumber(value: unknown, field: string, fallback: number
141141
}
142142

143143
/** Like normalizePositiveNumber, but floors to a whole count -- for fields that are semantically integer
144-
* counts (an iteration/turn budget), matching MinerGoalSpec's own normalizePositiveInteger convention. */
144+
* counts (an iteration/turn budget). Its floor is >= 0: unlike MinerGoalSpec's normalizePositiveInteger
145+
* (which rejects anything < 1 after flooring), 0 is deliberately accepted here (see the parser test's
146+
* zero-budget case) -- a 0 budget is a meaningful "do nothing" setting, not a malformed value. */
145147
function normalizeNonNegativeInteger(value: unknown, field: string, fallback: number, warnings: string[]): number {
146148
const normalized = normalizePositiveNumber(value, field, fallback, warnings);
147149
return Math.floor(normalized);

0 commit comments

Comments
 (0)