Skip to content

docs(engine): correct normalizeNonNegativeInteger's floor in its doc comment (#6775)#6800

Merged
JSONbored merged 1 commit into
JSONbored:mainfrom
shin-core:fix/ams-policy-normalize-doc-6775
Jul 17, 2026
Merged

docs(engine): correct normalizeNonNegativeInteger's floor in its doc comment (#6775)#6800
JSONbored merged 1 commit into
JSONbored:mainfrom
shin-core:fix/ams-policy-normalize-doc-6775

Conversation

@shin-core

Copy link
Copy Markdown
Contributor

Summary

  • normalizeNonNegativeInteger's doc comment claimed it matches "MinerGoalSpec's own normalizePositiveInteger convention" — but that sibling rejects any value < 1 after flooring, while this one only rejects < 0 and deliberately accepts 0 (already-tested behavior: a 0 budget is a meaningful "do nothing" setting).
  • Corrected the comment to describe its own >= 0 floor and why 0 is accepted, so it can't mislead a contributor into believing 0 is rejected here the way it is in miner-goal-spec.ts.
  • Comment-only — no behavior change (the logic is correct as-is, per the issue).

Closes #6775

Test plan

  • Comment-only diff (verified: no non-comment lines changed).
  • npm run test --workspace @loopover/engine green — 588 pass / 0 fail, including the existing ams-policy-spec-parser zero-budget case that pins the real >= 0 behavior.
  • npm run typecheck clean.

…comment (JSONbored#6775)

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 JSONbored#6775
@shin-core
shin-core requested a review from JSONbored as a code owner July 17, 2026 07:05
@superagent-security superagent-security Bot added the contributor:flagged Contributor flagged for review by trust analysis. label Jul 17, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

🚨 Contributor flagged. Click here for more info: Superagent Dashboard

@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 17, 2026
@loopover-orb

loopover-orb Bot commented Jul 17, 2026

Copy link
Copy Markdown

Warning

⏸️ LoopOver review result - manual review recommended

Review updated: 2026-07-17 07:19:13 UTC

1 file · 1 AI reviewer · no blockers · CI green · unstable

⏸️ Suggested Action - Manual Review

Review summary
This is a comment-only fix that corrects a misleading doc comment on normalizeNonNegativeInteger, which previously claimed it followed MinerGoalSpec's normalizePositiveInteger convention (reject <1) when it actually floors and accepts 0. The new comment correctly describes the >=0 floor and explains why 0 is deliberately accepted (a meaningful 'do nothing' budget setting), verified against the function body which only checks `value < 0` in normalizePositiveNumber. No logic changed, and the PR closes the linked issue #6775 which specifically flagged this doc/behavior mismatch.

Nits — 3 non-blocking
  • Consider also updating MinerGoalSpec's normalizePositiveInteger doc comment (if it references this function) to keep the cross-reference bidirectional and avoid future drift.
  • No changes needed; the comment now accurately reflects the >=0 floor and the zero-budget rationale.
  • Code changes lack test evidence — Add focused regression tests or explain why existing coverage is sufficient.
Flagged checks (non-blocking)
  • Contributor trust — Contributor flagged for review

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #6775
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ❌ 8/20 High review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 44 registered-repo PR(s), 25 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor shin-core; Gittensor profile; 44 PR(s), 0 issue(s).
Improvement ℹ️ None detected risk: low · value: none
Review context
  • Author: shin-core
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: TypeScript, JavaScript, Solidity, Dart, Python, CSS, PHP, Rust
  • Official Gittensor activity: 44 PR(s), 0 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Add a concise scope and risk note.
  • Then work through the remaining 1 step in the Signals table above.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
🧪 Chat with LoopOver

Ask LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @loopover ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://loopover.ai/docs/loopover-commands

🧪 Experimental — new and may change.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@loopover-orb loopover-orb Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LoopOver approves — the gate is satisfied and CI is green.

@JSONbored
JSONbored merged commit 2e34508 into JSONbored:main Jul 17, 2026
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor:flagged Contributor flagged for review by trust analysis. gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants