test(miner): add root-level vitest coverage for AmsPolicySpec's parser - #5253
Conversation
Advances #5132 #5249 merged with AmsPolicySpec at 40.98% patch coverage: Codecov only sees packages/gittensory-engine files through a root test/unit/*.test.ts that actually imports and exercises them -- the engine package's own node:test suite is a completely separate, Codecov-invisible measurement. test/unit/miner-ams-policy.test.ts only exercised resolveAmsPolicy's own call path, leaving most of parseAmsPolicySpec's field-level branches (submissionMode/slopThreshold rejection, capLimits/convergenceThresholds validation, malformed/oversized content) uncovered from Codecov's perspective. Adds a root-level mirror of the engine's own parser test, matching the established miner-goal-spec-parser.test.ts pattern -- 100% statement/branch/line coverage on ams-policy-spec.ts confirmed locally.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5253 +/- ##
==========================================
+ Coverage 94.27% 94.36% +0.08%
==========================================
Files 474 474
Lines 40078 40078
Branches 14612 14612
==========================================
+ Hits 37782 37818 +36
+ Misses 1609 1585 -24
+ Partials 687 675 -12
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-12 11:52:48 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 5 non-blocking
Concerns raised — review before merging
Review context
Contributor next steps
Signal definitions
[BETA] Chat with GittensoryAsk Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands 🟩 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 Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Summary
Advances #5132
#5249 (`.gittensory-ams.yml` operator execution-policy config) merged with `AmsPolicySpec` at 40.98% patch coverage -- a real codecov gap, not a false negative. Codecov only sees `packages/gittensory-engine` files through a root `test/unit/*.test.ts` that actually imports and exercises them; the engine package's own `node:test` suite (`packages/gittensory-engine/test/ams-policy-spec-parser.test.ts`, which already had 9/9 passing) is a completely separate, Codecov-invisible measurement.
`test/unit/miner-ams-policy.test.ts` only exercised `resolveAmsPolicy`'s own call path, leaving most of `parseAmsPolicySpec`'s field-level branches (submissionMode/slopThreshold rejection, capLimits/convergenceThresholds validation, malformed/oversized content, multi-byte UTF-8 byte-length counting) with zero Codecov-visible coverage.
Adds a root-level mirror of the engine's own parser test, matching the established `test/unit/miner-goal-spec-parser.test.ts` pattern (a root vitest file importing directly from `packages/gittensory-engine/src/index`, which vitest's coverage.include picks up without needing a miner-lib wrapper).
Test plan