refactor: move the IndexedDB runtime onto the kernel

2902 -> 2744줄 (코드 2807 -> 2563, 주석 12 -> 111). 네 번째이자 마지막
사본이다. 손수 abort 리스너가 0이 되어 래칫을 22에서 21로 조인다.

RT-1을 보존했다: 번역기가 CLOSED -> unavailable을 명시 매핑한다. 빠뜨리면
close() 중 진행 중이던 open이 ABORTED로 보고된다.

RT-2는 보존하지 못했다. 사양은 "의미 동일"이라고 썼지만 실제로는 blocked
데드라인 이후 재시도가 새 factory.open()을 띄운다(이행 전에는 안 띄웠다).
커널에 "settle 이후에도 살아 있는 요청"을 알려줄 훅이 없어서 커널을 고치지
않고는 불가능하다. 연결 누수나 데이터 위험은 없고 낭비되는 요청만 는다.
다음 커밋에서 커널에 onSettled를 추가해 복원한다.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
DongHyeonka
2026-09-16 20:17:19 +09:00
co-authored by Claude Opus 5
parent 217c1dd52a
commit a91e78f035
3 changed files with 997 additions and 962 deletions
+3 -1
View File
@@ -199,7 +199,9 @@ async function main(): Promise<void> {
// 24 → 23: `browser-transfer/resumable-upload/indexeddb-checkpoint-store.ts`가
// IndexedDB 커널로 옮겨가면서 자기 abort 리스너를 지웠다.
// 23 → 22: `storage/indexeddb/indexeddb-maintenance.ts`가 같은 이유로 지웠다.
const HAND_ROLLED_ABORT_CEILING = 22;
// 22 → 21: `storage/indexeddb/indexeddb-runtime.ts`가 같은 이유로 지웠다.
// 이것으로 IndexedDB 어댑터 4벌이 모두 커널을 쓴다.
const HAND_ROLLED_ABORT_CEILING = 21;
const handRolledScan = spawnSync(
"git",
["grep", "-l", 'addEventListener("abort"', "--", "src/adapters"],