|
| 1 | +--- |
| 2 | +"@objectstack/metadata": patch |
| 3 | +--- |
| 4 | + |
| 5 | +fix(lint,metadata): revoke the `http.server` lint exemption — its stated reason was false (#4251) |
| 6 | + |
| 7 | +`http.server` was added to `UNCONTRACTED_SLOTS` in #4321 on the ground that |
| 8 | +"no IHttpServer contract exists". The contract does exist — |
| 9 | +`packages/spec/src/contracts/http-server.ts` — and eight call sites were |
| 10 | +already resolving the slot as `getService<IHttpServer>(…)` when the exemption |
| 11 | +was written. An exemption is a claim like any other, and this one rested on a |
| 12 | +premise nobody checked: the same shape as the gaps the rule exists to find. |
| 13 | + |
| 14 | +Revoked. That surfaced **9 erasures the exemption had been hiding** — 7 in |
| 15 | +files never grandfathered, 2 as count growth inside grandfathered ones, none of |
| 16 | +which the baseline could legally absorb. All typed to `IHttpServer`; |
| 17 | +`packages/metadata/src/plugin.ts` came out clean entirely, so the baseline |
| 18 | +ratchets **DOWN to 168 sites in 36 files** and loses a file. |
| 19 | + |
| 20 | +Two things confirmed on the way, reported rather than changed: |
| 21 | + |
| 22 | +**`http.server` and `http-server` are the same instance under two names.** |
| 23 | +plugin-hono-server and qa's node-plugin each register it twice, two lines |
| 24 | +apart; runtime's `config.server` path registers only `http.server`. |
| 25 | +`metadata/src/plugin.ts` reads both with a `??`, which is how it survived. No |
| 26 | +registration is removed here — that is a runtime-behaviour change and belongs |
| 27 | +with whoever picks the canonical name. |
| 28 | + |
| 29 | +**`IHttpServer` is defined twice and the two have already diverged.** |
| 30 | +`packages/spec/src/contracts/http-server.ts` (15 importers) declares `write?()` |
| 31 | +and `end?()`; `packages/core/src/contracts/http-server.ts` (8 importers) does |
| 32 | +not. Spec's is the superset and the one the ledger points at, so it is the |
| 33 | +source; core's is a stale near-copy and should re-export it. Left for its own |
| 34 | +change — collapsing a duplicated contract is not a lint fix. |
| 35 | + |
| 36 | +Also worth a note for whoever writes the wider HTTP contract: `getRawApp()` now |
| 37 | +has a **third** independent consumer (metadata's HMR routes, joining |
| 38 | +cloud-connection's two). It is deliberately absent from `IHttpServer` — the |
| 39 | +contract is framework-agnostic and the raw app is the framework's own handle — |
| 40 | +so each consumer names it locally. Three is enough evidence to decide whether |
| 41 | +that stays the right answer. |
0 commit comments