Skip to content

ams-policy-spec.ts's normalizeNonNegativeInteger doc comment claims a floor it doesn't enforce #6775

Description

@JSONbored

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

  • Corrected doc comment in ams-policy-spec.ts:143-148

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:bugGittensor-scored bug fix — scores a 0.05x multiplier.help wantedExtra attention is needed

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions