Skip to content

Commit bc68bf0

Browse files
AsiaOstrichclaude
andcommitted
fix(test,hooks): a spawnSync option that does not exist, and the gate that would have caught it. 一個並不存在的 spawnSync 選項,以及本來該抓到它的閘門。
0.12.0-rc.1 failed to publish on `tsc --noEmit`: the new concurrency test passed `detached: true` to `spawnSync`, which is not in SpawnSyncOptions — spawnSync is synchronous, so the option never meant anything. Removed. The local run was green, which is the part worth fixing. The last `tsc` on this machine predated the file: after adding the test I only ran vitest, and vitest executes code without typing it. Same shape this project has recorded before — it ran, but it ran against the previous version of the tree. So `pre-commit` now typechecks before testing. A few seconds locally against minutes of CI round-trip, and it catches the class rather than this instance. 0.12.0-rc.1 在 `tsc --noEmit` 上發布失敗:新的併發測試傳了 `detached: true` 給 `spawnSync`,而它不在 SpawnSyncOptions 裡——spawnSync 是同步的,這個選項 從來就沒有意義。已移除。 本機是綠的,而那才是值得修的部分。這台機器上最後一次 `tsc` 早於這個檔案: 加完測試之後我只跑了 vitest,而 vitest 執行程式碼但不對它做型別檢查。與本專案 先前記錄過的形狀相同——它跑過了,但跑的是這棵樹的上一個版本。 因此 `pre-commit` 現在會先 typecheck 再跑測試。用本機的幾秒換 CI 的數分鐘往返, 而且它抓的是整個類別,不是這一個實例。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 67b4ba9 commit bc68bf0

3 files changed

Lines changed: 12 additions & 2 deletions

File tree

‎.husky/pre-commit‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# Typecheck before tests: vitest runs the code, it does not type it, so a type
2+
# error passes here and fails in CI minutes later. That happened on
3+
# 0.12.0-rc.1 — a `spawnSync` option that does not exist in SpawnSyncOptions
4+
# sailed through a green 788-test run because the last local typecheck predated
5+
# the file. Costs a few seconds.
6+
npm run typecheck
7+
18
npm test
29

310
# UDS Standard Check

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "engramgraph",
3-
"version": "0.12.0-rc.1",
3+
"version": "0.12.0-rc.2",
44
"description": "Open-source code + knowledge graph memory engine (SAGE + CodeGraph). AsiaOstrich is only a reference consumer.",
55
"license": "MIT",
66
"author": "AsiaOstrich",

‎test/read-only-concurrency.test.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ describe("read-only opens (XSPEC-374)", () => {
7373
new Connection(db);
7474
setTimeout(()=>{},1500);`,
7575
],
76-
{ detached: true, stdio: "ignore", timeout: 8000 },
76+
// No `detached` — spawnSync is synchronous, so it never meant anything;
77+
// it is also not in SpawnSyncOptions, which CI's typecheck caught and the
78+
// local run did not, because the last typecheck predated this file.
79+
{ stdio: "ignore", timeout: 8000 },
7780
);
7881
expect(holder.error).toBeUndefined();
7982

0 commit comments

Comments
 (0)