feat: DX ratchet — headless API-test runner, typecheck ratchet, first CI (TODO 15) - #126
Closed
lopugit wants to merge 4 commits into
Closed
feat: DX ratchet — headless API-test runner, typecheck ratchet, first CI (TODO 15)#126lopugit wants to merge 4 commits into
lopugit wants to merge 4 commits into
Conversation
TODO item 15. The 241-test API suite only ran via the interactive /tests page, tsc had no gate at all, and there was no CI. - scripts/run-api-tests.mjs: runs the exact /tests suite definitions through the exact runApiTest execution path headlessly (test == live cohesion). Zero new dependencies: Node >= 23 strips TS types natively; scripts/tt-alias-loader.mjs resolves the `~/` alias + extensionless TS relative imports; a cookie-jar fetch wrapper reproduces the browser's cookie-persisting auth chains. `npm test`, with --group=<g,g> and --list. - Six test expectations were stale from before the auth hardening (expecting 401/200 where admin-gated endpoints now correctly 403, and PUT-by-id 404): updated to accept the hardened responses with the reason commented. - scripts/typecheck-ratchet.mjs + typecheck-baseline.json: `tsc --noEmit` has a known 121-error baseline (strictness is being enabled progressively), so the gate fails only when the count GROWS; shrinking nags to ratchet the baseline down (--update-baseline). `npm run typecheck` stays as the raw view. - test:unit aggregates the four existing node --test suites; registering the alias loader there fixes test:editorjs, which failed at module resolution (extensionless `./inlineHtmlText` import) - 87/87 unit tests now pass. - .github/workflows/ci.yml: build:client + typecheck ratchet + unit tests, and the full API suite against a real dev stack + mongo:7 service. Verified locally: 241/241 API tests in 4.2s against a worktree dev stack, 87/87 unit tests, ratchet at baseline (121), build:client clean. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…e.json's packageManager Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
|
Conflicted files (as recorded by the merge step):
|
Conflicted paths: remix/package.json Resolved by the resolve-pr-conflicts workflow: https://github.com/lopugit/thingtime/actions/runs/30196272252 Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
|
🤝 Merged Conflicted files:
Please review the merge commit before relying on it. |
lopugit
added a commit
that referenced
this pull request
Jul 29, 2026
…te, single Web CI Absorbs the best of the parallel PRs #119, #123, and #126 into this branch (#121), so one PR carries TODO item 15: - typecheck ratchet (from #126): scripts/typecheck-ratchet.mjs + typecheck-baseline.json (134 errors today) — CI fails only when the tsc error count grows, and --update-baseline locks in reductions. - test:unit aggregate (from #119/#123), with the node --test suites loading through tsx instead of a hand-rolled resolve hook — fixes the previously broken ~/-alias suites and adds the scriptless mongodb/*.test.ts suite (109 unit tests, all passing). - runner --list flag (parity with the other runners). - TODO.md item-15 status note (from #123, updated). - one workflow: api-tests.yml + the others' ci.yml variants become web-ci.yml — build + ratchet + unit tests, plus the headless 243-test API suite against a real Vite + Nitro + Mongo stack; path-filtered to remix/**, read-only token, node 24. Verified locally: ratchet at baseline, 109/109 unit tests, 243/243 API tests against a live dev stack. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Owner
Author
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.
Implements TODO 15 — 🛠️ DX ratchet: typecheck, a headless test runner, and CI.
What changes
Headless API-test runner (
npm test):remix/scripts/run-api-tests.mjsruns the exact/tests-page suite definitions (apiTests.ts, 241 tests) through the exactrunApiTestexecution path — test == live cohesion, no parallel test framework. Zero new dependencies: Node ≥ 23 native type-stripping runs the app's TS directly;tt-alias-loader.mjs(anode:moduleresolve hook) handles the~/alias + extensionless TS relative imports; a cookie-jarfetchwrapper reproduces the browser's cookie-persisting auth chains. Supports--group=auth,health,--list,TT_TEST_BASE_URL.Six stale expectations fixed: they predated the auth hardening —
mongodb/populateexpected 200/500 but is now (correctly) admin-gated 403; the quota/admin-guardedtests expected only 401 but an authenticated non-admin now gets 403; PUT-by-unknown-id 404s. Each updated expectation documents why the new status is a pass (the guard holding), not a laxening.Typecheck ratchet (
npm run typecheck:ratchet):tsc --noEmithas a known 121-error baseline (strictness lands progressively — this is the mechanism for that). The gate fails only when the count grows; when it shrinks it nags to run--update-baselineand lock in the progress.npm run typecheckremains the raw view.Unit-test aggregate (
npm run test:unit) over the four existingnode --testsuites — and registering the alias loader there fixestest:editorjs, which was entirely broken (failed at module resolution on an extensionless./inlineHtmlTextimport before any test ran). 87/87 unit tests now pass.CI (
.github/workflows/ci.yml, the repo's first): two jobs — (1)build:client+ typecheck ratchet + unit tests; (2) the full API suite against a real booted dev stack with amongo:7service container, with dev-stack logs dumped on failure.Verification (local)
npm testagainst a worktree dev stack: 241/241 in 4.2s (parity caveat: the 6 previously-failing tests fail identically in a browser run with the same auth state — they were auth-state-dependent, now they pass in both).npm run test:unit: 87/87 (includes the 12 resurrected editorjs tests).npm run typecheck:ratchet: at baseline (121).pnpm run build:client: clean.Left for follow-ups (as TODO 15 contemplates): progressively enabling
noImplicitAny, unifying the two driftedThingtimeTypesinterfaces, finishing the Commander V1→V2 migration.Session 1 of the parallel todo batch — claimed in
TODO/SESSION-CLAIMS.md.🤖 Generated with Claude Code