Skip to content

perf(build): skip the lib check in build; typecheck keeps it - #59

Merged
Upd4ting merged 1 commit into
mainfrom
perf/build-skip-lib-check
Nov 7, 2026
Merged

Upd4ting merged 1 commit into
mainfrom
perf/build-skip-lib-check

Conversation

@Upd4ting

@Upd4ting Upd4ting commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Why

Goal: make the interface-auth CI and the verify-interface skill as fast as reasonable, measured before and after each fix.

Done means: every fix is measured and lands in its own pull request against main carrying before/after numbers, with the repository checks green and the review gate passed.

pnpm run build runs tsc with the lib check, which type-checks every .d.ts file in node_modules on each build. typecheck already does that check over the same program. The build runs often: twice in every verify-interface new (the setup, then prepack during the pack), and once in every pnpm test, the CI test job included.

What changed

  • build runs tsc --skipLibCheck. typecheck (tsc --noEmit) keeps the lib check.
  • release runs typecheck before it packs, so a release still checks the dependency declarations.

Nothing is checked less often:

  • tsc --listFilesOnly prints the same file list with and without --skipLibCheck, so typecheck checks every file build compiles.
  • dist is byte-identical with and without the flag (diff -r).
  • typecheck runs in pnpm run checks (the Node job of CI), in the lefthook pre-push hook, and now in release, which the release workflow runs through pnpm release.

Measurements

4 interleaved rounds per side, load 19 to 21 on 16 cores.

tsc (the build alone):

CPU user+sys, median wall range
before 3.4 s 1.68 to 1.83 s
after 1.6 s 0.79 to 0.97 s

antelopejs-verify new (build plus pack, which builds again):

CPU user+sys, median wall range
before 8.3 s 3.9 to 7.0 s
after 5.0 s 2.6 to 3.7 s

Wall medians go from 5.0 s to 3.5 s, about 1.5 s of a full warm verify run of all four features (about 11 s).

Verification

  • pnpm run checks: 8 passed, 0 failed.
  • verify-interface, all four features (package.json changed, so the full set): smoke, tokens, cookies and request-auth journeys all PASS. The contract and publish doors flag package.json; they are false positives, since only the build and release scripts change and the exports, dependencies and package name do not.

@Upd4ting
Upd4ting merged commit 248b4a6 into main Nov 7, 2026
8 checks passed
@Upd4ting
Upd4ting deleted the perf/build-skip-lib-check branch November 7, 2026 15:56
Upd4ting added a commit that referenced this pull request Nov 7, 2026
## Why

Goal: make the interface-auth CI and the verify-interface skill as fast
as reasonable, measured before and after each fix.

Done means: every fix is measured and lands in its own pull request
against `main` carrying before/after numbers, with the repository checks
green and the review gate passed.

The CI test job is the critical path of every run (median 31 s on recent
`main` runs, "Run tests" median 12.5 s). Most of "Run tests" is `ajs
module test` installing the test project's npm modules into
`.antelope/cache` ("Loaded 3 modules 7.3s" on the latest `main` run).
The tests themselves take 27 ms. Those installs also resolve every
transitive dependency afresh on each run, because the modules' lockfiles
were never recorded ("Recorded 2 module locks in antelope-lock/: commit
them so every install gets the same dependencies").

## What changed

- `antelope-lock/` is committed. Core replays each recorded lockfile
when it installs a module, so every run installs the same dependency
graph instead of the newest in range.
- `ci.yml` passes `cache-paths: .antelope/cache` and `cache-key-files:
src/antelope.test.ts` plus `antelope-lock/**` to `ci-node.yml`, which
restores the folder before the tests and saves it after a miss. Only the
Test job writes the folder. The Node job skips tests, so it has nothing
to save.
- AGENTS.md says how `antelope-lock/` is used and refreshed.

A restored folder never serves different dependencies than a fresh
install. Core reuses a cached module only when the version in its
`manifest.json` satisfies the pinned one and its lockfile is
byte-identical to the recorded one; otherwise it reinstalls from the
record. Checked by downgrading `@antelopejs/interface-api` inside a
cached `api` module to 0.1.0: the next `pnpm test` reinstalled it at the
recorded 0.3.0.

## Measurements

Local `pnpm test` on current `main` (after #57 and #59), 4 interleaved
rounds per side, fresh npm cache and pnpm store each round, load 13 to
15 on 16 cores:

| | CPU user+sys, median | wall range |
|---|---|---|
| `main` (no lock, no cache) | 11.0 s | 5.4 to 6.7 s |
| lock committed, no cache (a cache miss) | 4.5 s | 2.9 to 3.1 s |
| lock committed, cache restored | 2.6 s | 1.71 to 1.73 s |

No wall ranges overlap.

CI, Test job (the critical path) on GitHub runners:

| | "Run tests" step | Test job |
|---|---|---|
| `main`, 4 recent runs | 10 to 14 s, median 12.5 s | 28 to 33 s, median
31 s |
| this PR at 141216c (before the rebase onto #57), 2 runs, both restored
a cache | 5 s and 7 s | 20 s and 24 s |
| `main` after #57 and #59, 2 runs | 7 s and 9 s | 19 s and 23 s |
| this PR at 1d1798e, 1 run | 1 s | 17 s |

In those runs, "Valid module found" to "Loaded 3 modules" took 2.4 s and
3.4 s, against 10.3 s on the latest `main` run.

## Verification

- `pnpm run checks`: 8 passed, 0 failed.
- verify-interface, all four features (`antelope-lock/**` is a shared
file): smoke, tokens, cookies and request-auth journeys all PASS. No
one-way door flagged.
Upd4ting added a commit that referenced this pull request Nov 10, 2026
## Why

This PR moves interface-auth onto the latest
`@antelopejs/tooling-configs` release (0.5.0, still `latest` on npm on
2026-11-10) so that every check passes under it, not just the version
number. It also needs to survive the next release, where
tooling-configs#282 turns two warnings into `sync --check` failures.
Task ANT-1771, split from ANT-1694.

## What changes

- `@antelopejs/tooling-configs` goes from `^0.4.0` to `^0.5.0`, with the
lockfile updated.
- `pnpm run sync` rewrote the managed files `.agents/setup`, `AGENTS.md`
and `.agents/skills/verify-interface/SKILL.md`.
- The 0.5.0 preset adds `anti-slop(no-runtime-typeof)`, which flagged
`value instanceof Object` in `.agents/skills/verify-interface/calls.ts`.
The check now goes through an `isJsonObject` type guard over the
interface's own `JsonValue` union, as the rule asks. No suppression was
added.

## The two #282 items

Both already hold on main, so this PR changes nothing for them:

- No tsconfig sets `skipLibCheck`. Only `build` passes `--skipLibCheck`,
and `typecheck` (`tsc --noEmit`) checks the same root `tsconfig.json`
program (#59).
- `release` runs `pnpm run lint && pnpm run typecheck && pnpm run
prepack && release-it`.

## Conflict with #61

There is none. #61 changes only `.github/workflows/modules-update.yml`,
and this PR does not touch that file.

## Proof

Before: main with the version bumped, before `pnpm run sync` and the
lint fix. Node's `MODULE_TYPELESS_PACKAGE_JSON` warning is left out of
the outputs.

`pnpm run sync:check` before:

```

> @antelopejs/interface-auth@0.2.0 sync:check /home/debian/.t3/worktrees/interface-auth/build-bump-tooling-configs
> antelopejs-sync --check

Drift: .agents/setup; run antelopejs-sync
Drift: AGENTS.md; run antelopejs-sync
Drift: .agents/skills/verify-interface/SKILL.md; run antelopejs-sync
 ELIFECYCLE  Command failed with exit code 1.
exit 1
```

`pnpm run checks` before:

```

> @antelopejs/interface-auth@0.2.0 checks /home/debian/.t3/worktrees/interface-auth/build-bump-tooling-configs
> antelopejs-checks

[lint]

> @antelopejs/interface-auth@0.2.0 lint /home/debian/.t3/worktrees/interface-auth/build-bump-tooling-configs
> oxlint

.agents/skills/verify-interface/calls.ts:11:9: error anti-slop(no-runtime-typeof): `instanceof Object` is a `typeof` check in another form. Parse input at its I/O boundary, or move the check into a type guard such as `(value: unknown): value is Function`.
 ELIFECYCLE  Command failed with exit code 1.

[sync:check]

> @antelopejs/interface-auth@0.2.0 sync:check /home/debian/.t3/worktrees/interface-auth/build-bump-tooling-configs
> antelopejs-sync --check

Drift: .agents/setup; run antelopejs-sync
Drift: AGENTS.md; run antelopejs-sync
Drift: .agents/skills/verify-interface/SKILL.md; run antelopejs-sync
 ELIFECYCLE  Command failed with exit code 1.
Checks: 8 passed, 2 failed.
 ELIFECYCLE  Command failed with exit code 1.
exit 1
```

`pnpm run sync:check` after:

```

> @antelopejs/interface-auth@0.2.0 sync:check /home/debian/.t3/worktrees/interface-auth/build-bump-tooling-configs
> antelopejs-sync --check

Guardrails are in sync.
exit 0
```

`pnpm run checks` after:

```

> @antelopejs/interface-auth@0.2.0 checks /home/debian/.t3/worktrees/interface-auth/build-bump-tooling-configs
> antelopejs-checks

Checks: 10 passed, 0 failed.
exit 0
```

Verify layer (`antelopejs-verify journey <run> --plan --jobs 4` at
b4b80c4, base origin/main). The plan ran every feature, because
`package.json` and `pnpm-lock.yaml` are shared files:

```
PASS smoke/every-function (1.5 s)
PASS smoke/minor-bump (1.7 s)
PASS cookies/sign-server-response (0.1 s)
PASS cookies/cookie-types (1.0 s)
PASS request-auth/default-source (0.1 s)
PASS request-auth/check-authentication (0.1 s)
PASS request-auth/auth-decorators (0.1 s)
PASS request-auth/request-types (0.9 s)
PASS tokens/sign-and-verify (0.1 s)
PASS tokens/token-types (0.9 s)
```

The `every-function` evidence includes the checks `.:ValidateRaw
returned the value verify.config.ts expects` and
`.:internal.defaultAuthenticator returned the value verify.config.ts
expects`. Both values pass through the rewritten `plain()`. No verify
failure is pre-existing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant