Repository navigation
Commit 3c3a05c
Fixes #20800
Clause-②: no
The last three packages of the #4311 type-check ledger,
`@objectstack/cloud-connection`, `@objectstack/observability` and
`@objectstack/hono`, now type-check their own test layer. Each gets a
sibling `tsconfig.test.json` named by a new `typecheck` script, every
code-tier error is repaired at its cause inside the test layer, and the
three `DEBT` entries are deleted rather than lowered. `DEBT` in
`scripts/check-type-check-coverage.mjs` now holds
`@objectstack/spec-monorepo` alone; `@objectstack/console` stays
`EXEMPT`, as the card says.
## What changed
| Path | Change |
|---|---|
|
`packages/{cloud-connection,observability,adapters/hono}/tsconfig.test.json`
| new: extends the package's build config, `noEmit`, `module: esnext` /
`moduleResolution: bundler`, `lib` ES2022 (hono keeps its `DOM` libs).
Strictness, `paths`, `rootDir` and `types` are inherited and not
re-declared. Each header carries its own measured readings. |
| `packages/{cloud-connection,observability,adapters/hono}/package.json`
| `typecheck` = `tsc --noEmit && tsc --noEmit -p tsconfig.test.json`,
the zero-residue shape `metadata-fs` and `trigger-record-change` use: no
per-package ledger, no new dependency, no lockfile change. |
| test files (listed below) | the code-tier repairs. No cast, no
`@ts-expect-error`, no `src` signature widened. |
| `scripts/check-type-check-coverage.mjs` | the three `DEBT` entries
deleted, plus one graduation paragraph in the same style as the ones
above it. No gate logic moved. |
## Both readings, before any fix
Taken at `f8178ffece` (origin/main) with the workspace closure built
first, once per config: `tsc --noEmit --pretty false --listFiles -p
tsconfig.json` (the build config) and the same with the new
`tsconfig.test.json`.
| package | files in the test program (own tests) | build config | test
config | config tier | code tier |
|---|---:|---|---|---:|---:|
| `@objectstack/cloud-connection` | 923 (30) | 13 = TS2493 x11 + TS2550
x2 | 11 = TS2493 x11 | 2 | 11 |
| `@objectstack/observability` | 401 (7) | 11 = TS2554 x10 + TS2552 x1 |
11 = same | 0 | 11 |
| `@objectstack/hono` | 858 (5) | 3 = TS2769 x2 + TS18046 x1 | 3 = same
| 0 | 3, and 4 more once those cleared (below) |
The build-config column reproduces the ledger exactly (13 / 11 / 3). All
three build configs already included the tests and never excluded them,
so the program that reads them always existed; no script ever ran it.
That is the `service-automation` shape, not an exclude-and-compensate
one.
After: every config of every package reads 0, and `typecheck` exits 0
for all three.
## Each error repaired at its cause
| Package / file | Errors | Cause | Repair |
|---|---|---|---|
| cloud-connection: `cloud-connection-plugin.test.ts` x3,
`connection-credential-store.test.ts` x4 (7 declarations) | TS2493 x11 |
`vi.fn(async () => new Response(...))` declared with no parameters, so
vitest types `mock.calls` as empty tuples, and the test indexes
`calls[0][0]` / `[1]` | the mock is typed to the call it stubs:
`vi.fn(async (_url: string, _init?: RequestInit) => ...)`, the shape
`fetch(url, init)` is always called with in the plugin |
| cloud-connection: `marketplace-install-local-bundle.test.ts` x2 |
TS2550 x2 (config tier) | `Array#at` under the build config's `lib`
ES2020 | rewritten to vitest's `mock.lastCall`, not a widening of the
shared build config (the `service-storage` call recorded in the ledger
prose). The test config also carries ES2022, but the first leg of
`typecheck` reads these files under ES2020 too, so the file itself had
to compile under both |
| observability: `error-exporters.test.ts`, `loggers.test.ts`,
`metrics-exporters.test.ts` | TS2554 x10 | the Noop classes declare
zero-parameter methods (legal narrowing), so calls on the concrete class
type have arity 0 while the contract consumers call through has the real
one | the instance is declared as the contract it is used through
(`ErrorReporter`, `Logger`, `MetricsRegistry`). The source signatures
were not widened |
| observability: `otlp-http.test.ts` | TS2552 | fake `fetch` parameter
named `RequestInfo`, a DOM-lib name this program does not have | typed
as the union of string, URL and Request, the call site it stubs |
| hono: `hono.test.ts` | TS2769 x2, TS18046 | a bare `new Hono()`
declares no `Variables`, so `c.get('objectStack')` takes `never` and
returns `unknown` | the two tests that read the variable back build
their app with a `KernelEnv` type argument declaring `objectStack` (the
middleware does `c.set('objectStack', kernel)`) |
| hono: `src/__mocks__/runtime.ts` | TS2883 x4, latent | see the next
section | the four `vi.fn()` fields are annotated `Mock` |
## A finding for the reviewer: hono's "3" was not its whole pile
With the three semantic errors repaired, the hono test config reported
four more: TS2883 on the four `vi.fn()` class fields of
`src/__mocks__/runtime.ts` (the inferred type cannot be named without a
reference to `Procedure` inside the pnpm store). tsc withholds
declaration-emit diagnostics while any semantic error stands, so the
first reading could not show them, and the build config never shows them
at all (it exits 0 on that file; only the `bundler` resolution reports
it). Observed in two states: state A (original files) reads 3 errors and
no TS2883; state B (`hono.test.ts` repaired, mock not yet) reads exactly
4 TS2883 and nothing else. The repair is a test-support annotation; the
file is a vitest alias target (`vitest.config.ts`), never built or
published.
Nothing was hiding behind the other two: for cloud-connection and
observability both configs read 0 once the listed errors were repaired.
## Acceptance, measured
All at head `5f4aa15801` unless stated (the branch is two commits plus a
merge of `origin/main` at `9b0de7de73`, taken so the derived gate list
was not read from a stale tree; closure rebuilt after the merge).
- `pnpm --filter PKG run typecheck` exits **0** for all three; each run
echoes the `typecheck` script name.
- `pnpm check:type-check-coverage`: OK, "79/80 workspace packages
type-checked (plus the root), 1 in the DEBT ledger (26 frozen raw
errors), 1 exempt". `pnpm check:type-check-debt`: OK, "1 ledger
entr(ies) re-measured ... none above its recorded number", surplus none.
- The three suites do not regress: cloud-connection 30 files / 397
tests, observability 7 / 85, hono 5 / 122, all passing; the diff touches
no `it(`, `test(` or `describe(` line.
- **The new scripts can fail.** Planted through
`scripts/ablation-replace.mjs` (anchor must hit once, blob change
proven, restore proven) in one test file per package that this PR does
not otherwise edit: the copyright line of
`marketplace-public-url.test.ts`, `perf-timing.test.ts` and
`hono-wildcard-fallthrough.test.ts` replaced by a line assigning a
string to a `number`. Each `typecheck` exited **2**, naming that file
(TS2322 and TS6133), and each restore left the blob equal to HEAD with
`git diff HEAD` empty. Direction observed: turns red, as expected.
- `node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack
--commands` derived 82 families; all 82 were run one by one with the
exit code captured before any pipe, and `--ran` reconciles "82 derived,
82 run, 0 NOT-MEASURED, 0 UNRUN". `check:pm-dispatch-gates` needed the
detached form its own header prescribes (about 17 minutes on this shared
box; its first two foreground attempts were cut by my own timeout and
are not counted).
- `pnpm lint` exits **0** over the whole repo at `5f4aa15801`.
## Changeset
None written. The diff changes no file the three packages ship:
`files[]` is `dist`, `README.md` and `CHANGELOG.md`; the `dist` build is
from `src/index.ts` and reaches no test file or `__mocks__`; and after
building the three packages, a grep of their `dist` for every symbol
this PR introduced (`KernelEnv`, `lastCall`, the `_init` parameter,
`type Mock`) found nothing, while a positive control
(`CloudConnectionPlugin`, `InMemoryErrorReporter`, `createHonoApp`) hit
in each. The only shipped-manifest change is the `scripts` block of each
`package.json`. The seat applies `skip-changeset`.
## Acceptance notes
- `@objectstack/spec-monorepo` (root entry, 26) is untouched, as the
card says. Its `compositionAt` staleness notice is the same one `main`
prints.
- Not run locally: the repository-wide CI jobs (`pnpm test` for the
whole repo, the full dogfood set); they are CI's.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01VvcEokUG1tvVxkceYfR5XB)_
---------
Co-authored-by: Claude <noreply@anthropic.com>
1 parent a11faee commit 3c3a05c
16 files changed
Lines changed: 273 additions & 36 deletions
File tree
- packages
- adapters/hono
- src
- __mocks__
- cloud-connection
- src
- observability
- src/__tests__
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
25 | 30 | | |
26 | 31 | | |
27 | 32 | | |
28 | 33 | | |
29 | 34 | | |
30 | 35 | | |
31 | | - | |
| 36 | + | |
32 | 37 | | |
33 | 38 | | |
34 | 39 | | |
| |||
61 | 66 | | |
62 | 67 | | |
63 | 68 | | |
64 | | - | |
| 69 | + | |
65 | 70 | | |
66 | 71 | | |
67 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
| 154 | + | |
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
183 | | - | |
| 183 | + | |
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
209 | | - | |
| 209 | + | |
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
| 115 | + | |
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
| 137 | + | |
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| |||
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
224 | | - | |
| 224 | + | |
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
| |||
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
270 | | - | |
| 270 | + | |
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
0 commit comments