fix(engine): fix stale test fixtures, wire the suite into test:ci - #4150
Merged
Conversation
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.
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Deploying with
|
| 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 Report✅ All modified and coverable lines are covered by tests. 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:
|
This was referenced Jul 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
packages/gittensory-engine's own test script (tsconfig.test.json+node --test) was broken and silently ungated —test:cinever invoked it, only the narrower root-leveltypecheck/test:engine-parity/test:coverage. Three independent, pre-existing issues:test/ai-policy-map.test.ts: a fixture was missing the requiredrepoFullNamefieldAiPolicyFatigueInputhas 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 throughunknownfirst — TypeScript's excess-property/enum checks correctly rejected the literals. Cast viaas unknown as GateVerdictCalibrationIngestion, matching what "untrusted external input" actually looks like at this boundary.test/duplicate-winner.test.ts: three tests assertedcreatedAt-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). Roottest/unit/duplicate-winner.test.tswas 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-createdAtcoverage for the rest.Adds
npm run test --workspace @jsonbored/gittensory-enginetotest:ciso this can't silently drift again.Test plan
npm run typecheck— cleannpm run test --workspace @jsonbored/gittensory-engine— 272/272 passnpm run test:engine-parity— clean