Context
packages/loopover-engine/src/ams-policy-spec.ts:143-148's normalizeNonNegativeInteger doc comment claims it matches "MinerGoalSpec's own normalizePositiveInteger convention," but that function (packages/loopover-engine/src/miner-goal-spec.ts:313-323) explicitly rejects any value < 1 after flooring, while normalizeNonNegativeInteger only rejects values < 0 and silently accepts 0. Per test/ams-policy-spec-parser.test.ts:101-102, accepting 0 here is deliberate, already-tested behavior — so the fix is to the comment, not the logic, which would otherwise mislead a future contributor into believing 0 is rejected here the way it is in miner-goal-spec.ts.
Requirements
- Correct the doc comment on
normalizeNonNegativeInteger to describe its own actual >=0 floor rather than claiming parity with MinerGoalSpec.normalizePositiveInteger's >=1 floor.
- No behavior change.
Deliverables
Test Coverage Requirements
Doc-accuracy fix only, no behavior change — confirm the existing test at test/ams-policy-spec-parser.test.ts:101-102 (which already covers the real behavior) still passes.
Expected Outcome
The function's documentation accurately describes its own floor instead of a different function's stricter one.
Links & Resources
packages/loopover-engine/src/ams-policy-spec.ts:143-148, packages/loopover-engine/src/miner-goal-spec.ts:313-323, test/ams-policy-spec-parser.test.ts:101-102.
Context
packages/loopover-engine/src/ams-policy-spec.ts:143-148'snormalizeNonNegativeIntegerdoc comment claims it matches "MinerGoalSpec's own normalizePositiveInteger convention," but that function (packages/loopover-engine/src/miner-goal-spec.ts:313-323) explicitly rejects any value< 1after flooring, whilenormalizeNonNegativeIntegeronly rejects values< 0and silently accepts0. Pertest/ams-policy-spec-parser.test.ts:101-102, accepting0here is deliberate, already-tested behavior — so the fix is to the comment, not the logic, which would otherwise mislead a future contributor into believing0is rejected here the way it is inminer-goal-spec.ts.Requirements
normalizeNonNegativeIntegerto describe its own actual>=0floor rather than claiming parity withMinerGoalSpec.normalizePositiveInteger's>=1floor.Deliverables
ams-policy-spec.ts:143-148Test Coverage Requirements
Doc-accuracy fix only, no behavior change — confirm the existing test at
test/ams-policy-spec-parser.test.ts:101-102(which already covers the real behavior) still passes.Expected Outcome
The function's documentation accurately describes its own floor instead of a different function's stricter one.
Links & Resources
packages/loopover-engine/src/ams-policy-spec.ts:143-148,packages/loopover-engine/src/miner-goal-spec.ts:313-323,test/ams-policy-spec-parser.test.ts:101-102.