Repository navigation
Commit bfca0ef
<!-- claude-projects-attribution: {"github_login":"os-support-ai"} -->
_Requested by **Yibo Wang** · [project
thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBWMEECkfNfe2VjW9rMJG3n7)_
Part of #30147 (phase 2b of 2a-2d: two by-path readers learn the facade
form, so the codemod moves four more members. 2c, 2d and the phase 3
measurement stay open on the card.)
## 维护者速读
- 改了什么:`check-durability-degradation-log-level.mjs` 学会跨文件跟随 sql-driver 的
facade(facet 模块里的 `this.x()` 调到 `SqlDriver#x`,再穿过 stub 到 facet
方法体);`sql-driver-compile-refusal-seam.test.ts` 改为读取全部 `sql-driver-*.ts`
模块。codemod 因此去掉 1 个 pin 和 4 个 needle,重新生成后又有 4 个成员变成委托,登记表 73 → 69。
- 为什么改:这两个读者只认 `sql-driver.ts` 本文件,codemod 只好把这些方法留在类上;读者学会新形态后,codemod
才能把它们移走(#30147,裁决 6597555122 第 3 条)。
- 风险与回滚:方法体逐字节不变(175/175),公开 `.d.ts` 与 base 相同;durability 门禁在 base 和
head 上读到同样的 52 个 seam、同样的判定,只有两个 seam 的位置从 `sql-driver.ts` 换到
`sql-driver-rotation.ts`。回滚即 revert。
- 先看:门禁里新增的 `FACADE_LOG_HOP` / `createFacadeLogHop` 和
`collectLoggedLevels` 里的 6 行接入;测试里 `sources` 的改法。
- 两分钟验证:`node scripts/check-durability-degradation-log-level.mjs
--self-test`(新增 10 行通过)和 `node scripts/codemod-split-sql-driver.mjs
--verify --base 21510bb`(`175/175`,退出 0)。
- 需要你做的:无,席位审阅并落地。
Clause-②: no
Metadata-protocol: none
## What changes
Two readers took `sql-driver.ts` text by path, so the codemod pinned
four members on the class. Each reader now reads the facade form, and
the pins go.
**`scripts/check-durability-degradation-log-level.mjs`.** Its catch side
follows a log helper to its body by name, in the same file. A catch the
codemod moves into a facet module calls `this.logDurabilityFailure(…)`,
which that module does not declare. Once `logDurabilityFailure` itself
moves, the method the call reaches is a one-call stub. Either way the
catch read "swallowed, no log": with the pins removed and no reader
change, the gate reds the two `runWideningAlters()` catches in
`sql-driver-rotation.ts`. `FACADE_LOG_HOP` follows exactly the two
shapes the codemod writes:
- HOST CALL: `this.x(…)` in a `sql-driver-*.ts` module, inside a
function whose `this` is the module's own host interface (bare or
through a `Pick` naming `x`), whose member `x` is typed `T['x']` with
`T` the `SqlDriver` class imported from `./sql-driver.js` (directly or
as `SqlDriverClass`), resolves to `SqlDriver#x` in `sql-driver.ts`. That
is one hop, the same hop the call made before the move.
- STUB: a `SqlDriver` method whose last statement returns
`<X>Facet.x.call(<y>Host.of(this), …)` is read as the facet's static
`x`. This costs no depth.
Every other shape stays unresolved, as before. A log found across the
hop is reported at the line of the call in the file being judged. The
hop is handed in by `run()` to the log-level rule only. The read-seam
rule's scan roots do not include `driver-sql`, so the two rules still
agree on every file they both read.
**`packages/drivers/driver-sql/src/sql-driver-compile-refusal-seam.test.ts`.**
The enumeration read five named files. It now reads every
`sql-driver-*.ts` module in the directory. A facet's static `x` is named
`SqlDriver.x`, because it is that method's body. The positive control
also asserts that the five files it used to read, plus one facet module,
are still among those it reads. The pinned sets are unchanged.
**Codemod (`scripts/codemod-split-sql-driver.mjs`).** These entries are
gone:
- the `logDurabilityFailure` pin;
- the `this.runWideningAlters(` needle;
- the three `CLASS_PATH_READER_NEEDLES` rows (the table stays, empty,
with its comment rewritten).
The tree is regenerated from `21510bba`, so `logDurabilityFailure`,
`migrateMysqlDatetimeColumns`, `migrateMysqlTimeColumns` and
`resolveWithheldFilterRefusal` move. `sql-driver.ts` goes from 10,717 to
10,624 lines.
**Registry.** The four rows are deleted, so 73 rows become 69.
| card | before | after |
|:--|--:|--:|
| #30020 | 17 | 17 |
| #30054 | 16 | 16 |
| #30055 | 6 | 6 |
| #30147 | 34 | 30 (sql-driver.ts 12 → 8) |
| total | 73 | 69 |
## Tests
- The durability gate's self-test gains 10 rows, each driven through
`analyzeSourceFile` the way `run()` drives it, over multi-file fixtures:
- the hop reaches a loud body;
- the same hop to a `warn` body is judged at that level;
- with no hop the moved catch reads swallowed;
- the same files in another directory, a member typed otherwise, a
member the `Pick` omits and a class type imported from elsewhere each
resolve nowhere;
- a routed module's `SqlDriverClass` alias resolves;
- a `sql-driver.ts` catch follows the stub;
- a stub handing anything but `<y>Host.of(this)` is not followed.
The `selfTest` partition floor goes 70 → 80 and the roster total 137 →
147.
- The compile-refusal test keeps its 115 cases. Reading the old five
files over the new tree reds "only three functions build the envelope
WITHOUT the seam". Measured before the widening.
- No other test file changes. The suites below ran at base `9b8a5867`
and at head; the counts are equal.
| suite | base | head |
|:--|:--|:--|
| driver-sql (`vitest run`) | 238 files passed, 12 skipped; 3,859
passed, 216 skipped | the same |
| driver-turso (subclasses `SqlDriver`) | 97 files; 2,514 passed, 34
skipped | the same |
| driver-sqlite-wasm (subclasses `SqlDriver`) | 40 files; 750 passed |
the same |
| cli by-path pins (9 files) | 9 files; 116 passed | the same |
| types / metadata / metadata-protocol by-path tests, spec
`check-liveness.test` | 53 / 11 / 33 / 74 passed | the same |
## Acceptance notes
- `check-durability-degradation-log-level.mjs` is a by-path reader, not
the facade gate. The facade gate script and its self-test are untouched.
- No changeset, as #30139 and #30249 (`skip-changeset`): no published
behaviour or surface changes.
## Verification
Head `d3ca391c`, base `origin/main` `9b8a5867`.
<details><summary>Proof readings</summary>
- Byte-identity: `node scripts/codemod-split-sql-driver.mjs --verify
--base 21510bb` exit 0, "175/175 moved bodies identical to base (body,
parameters, return type, async); 127/127 moved top-level declarations
identical to base; sql-driver.ts 18334 -> 10624 lines; undoing the split
does rebuild the base byte-for-byte".
- Determinism: two `--write` runs from the unsplit input give tree
sha256
`5044055d6e0d47825283c7fe8d3c539a823909573a382434b0cda80e1b76326c` both
times.
- Durability gate, `--list` at base and head: 52 seams, the same
verdicts. The only change is the location of the two
`runWideningAlters()` seams, from `sql-driver.ts:5187` / `:5281` to
`sql-driver-rotation.ts:327` / `:373`, both "recovers on one branch,
loud (error … via logDurabilityFailure())". Without the hop, head reds
those two.
- Public `.d.ts`: `dts-public.mjs` over the base and head `dist` exit 0,
`pass: true`, both files raw-equal (`index.d.ts` sha256 `92e2cfb2…` on
both sides).
- Typecheck: `pnpm --filter @objectstack/driver-sql typecheck` exit 0.
- `check-tenant-chokepoint`: 24/21/3/4/0 across 39 files at base and
head; `--self-test` exit 0.
- Facade gate exit 0, "3 facade file(s) hold delegations only, 69 named
exception(s)"; `--self-test` 36 exit 0.
- `node scripts/pm/dispatch-gates.mjs --commands`: 74 derived commands,
each run, all exit 0; `--ran` reconciles 74 derived, 74 run, 0
NOT-MEASURED. Also run: the codemod, durability,
`check-tenant-chokepoint` and facade gate `--self-test`s,
`check:lean-entry-closure`, eslint over the changed files, all exit 0.
- Changed lines 740 (+542 / -198), under the 3,000 threshold.
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_01WGufzj4B2cbnRLVdgtLcDZ)_
Co-authored-by: Claude <noreply@anthropic.com>
1 parent c1240a3 commit bfca0ef
8 files changed
Lines changed: 542 additions & 198 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
| |||
79 | 80 | | |
80 | 81 | | |
81 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
82 | 89 | | |
83 | 90 | | |
84 | 91 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
| |||
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
51 | | - | |
| 53 | + | |
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
| |||
275 | 277 | | |
276 | 278 | | |
277 | 279 | | |
278 | | - | |
279 | | - | |
| 280 | + | |
280 | 281 | | |
281 | 282 | | |
282 | 283 | | |
283 | 284 | | |
| 285 | + | |
284 | 286 | | |
285 | 287 | | |
286 | 288 | | |
| |||
293 | 295 | | |
294 | 296 | | |
295 | 297 | | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
303 | 306 | | |
304 | 307 | | |
305 | 308 | | |
| |||
310 | 313 | | |
311 | 314 | | |
312 | 315 | | |
313 | | - | |
| 316 | + | |
314 | 317 | | |
315 | 318 | | |
316 | 319 | | |
| |||
357 | 360 | | |
358 | 361 | | |
359 | 362 | | |
360 | | - | |
| 363 | + | |
361 | 364 | | |
362 | 365 | | |
363 | 366 | | |
| |||
376 | 379 | | |
377 | 380 | | |
378 | 381 | | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
379 | 388 | | |
380 | 389 | | |
381 | 390 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
16 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| 42 | + | |
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
51 | 54 | | |
52 | 55 | | |
53 | 56 | | |
| |||
79 | 82 | | |
80 | 83 | | |
81 | 84 | | |
| 85 | + | |
82 | 86 | | |
83 | 87 | | |
84 | 88 | | |
| |||
430 | 434 | | |
431 | 435 | | |
432 | 436 | | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
433 | 453 | | |
434 | 454 | | |
435 | 455 | | |
| |||
0 commit comments