Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/loopover-engine/src/ams-policy-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down