Skip to content

fix(engine): fix stale test fixtures, wire the suite into test:ci - #4150

Merged
JSONbored merged 1 commit into
mainfrom
fix/gittensory-engine-test-suite
Jul 8, 2026
Merged

fix(engine): fix stale test fixtures, wire the suite into test:ci#4150
JSONbored merged 1 commit into
mainfrom
fix/gittensory-engine-test-suite

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

packages/gittensory-engine's own test script (tsconfig.test.json + node --test) was broken and silently ungated — test:ci never invoked it, only the narrower root-level typecheck/test:engine-parity/test:coverage. Three independent, pre-existing issues:

  • test/ai-policy-map.test.ts: a fixture was missing the required repoFullName field AiPolicyFatigueInput has always required.
  • test/gate-verdict-calibration.test.ts: two tests deliberately pass malformed/extra-field input to verify the sanitizer strips it, but typed the fixture as the strict output type instead of casting through unknown first — TypeScript's excess-property/enum checks correctly rejected the literals. Cast via as unknown as GateVerdictCalibrationIngestion, matching what "untrusted external input" actually looks like at this boundary.
  • test/duplicate-winner.test.ts: three tests asserted createdAt-based election ordering that fix(review): prevent backdated duplicate-winner claims #3956 deliberately removed (anti-backdating fix — an older PR could otherwise steal winner credit by editing its body later). Root test/unit/duplicate-winner.test.ts was updated in that same commit; this parallel copy wasn't, because nothing ran it. Replaced with the equivalent claim-time-only assertions — the file already had adequate non-createdAt coverage for the rest.

Adds npm run test --workspace @jsonbored/gittensory-engine to test:ci so this can't silently drift again.

Test plan

  • npm run typecheck — clean
  • npm run test --workspace @jsonbored/gittensory-engine — 272/272 pass
  • npm run test:engine-parity — clean

packages/gittensory-engine's own test script (tsconfig.test.json + node
--test) was broken and silently ungated -- test:ci never invoked it, only
the narrower root-level typecheck/test:engine-parity/test:coverage. Three
independent issues, all pre-existing:

- test/ai-policy-map.test.ts: a fixture was missing the required
  repoFullName field AiPolicyFatigueInput has always required.
- test/gate-verdict-calibration.test.ts: two tests deliberately pass
  malformed/extra-field input to verify the sanitizer strips it, but typed
  the fixture as the strict output type instead of casting through unknown
  first -- TypeScript's excess-property/enum checks correctly rejected the
  literals. Cast via `as unknown as GateVerdictCalibrationIngestion`,
  matching what "untrusted external input" actually looks like at this
  boundary.
- test/duplicate-winner.test.ts: three tests asserted createdAt-based
  election ordering that #3956 deliberately removed (anti-backdating fix,
  since an older PR could otherwise steal winner credit by editing its
  body later) -- root test/unit/duplicate-winner.test.ts was updated in
  that same commit, this parallel copy wasn't, because nothing runs it.
  Replaced with the equivalent claim-time-only assertions; the file
  already had adequate non-createdAt coverage for the rest.

Adds `npm run test --workspace @jsonbored/gittensory-engine` to test:ci so
this can't silently drift again.
@superagent-security

Copy link
Copy Markdown
Contributor

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

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
gittensory-ui 0f0bed2 Commit Preview URL

Branch Preview URL
Jul 08 2026, 08:02 AM

@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.72%. Comparing base (97f087b) to head (0f0bed2).
⚠️ Report is 4 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4150   +/-   ##
=======================================
  Coverage   93.72%   93.72%           
=======================================
  Files         385      385           
  Lines       36243    36243           
  Branches    13281    13281           
=======================================
  Hits        33968    33968           
  Misses       1618     1618           
  Partials      657      657           
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JSONbored JSONbored self-assigned this Jul 8, 2026
@JSONbored
JSONbored merged commit 5a4de69 into main Jul 8, 2026
12 checks passed
@JSONbored
JSONbored deleted the fix/gittensory-engine-test-suite branch July 8, 2026 08:11
@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Development

Successfully merging this pull request may close these issues.

1 participant