## @workglow/browser-control
### Bug Fixes
#### test
- close the gaps the Turbo/projects wiring opened
### Chores
#### eslint
- enforce consistent-type-imports and apply the repo-wide autofix (#683)
## @workglow/task-graph
### Features
- add tests for task usage duration and enhance usage line handling
#### web-example
- show the run's cumulative token total
#### task-graph
- add an opt-in run-usage recorder
- report a cache hit as a stated zero cost
- aggregate token usage per run
- add a task-level usage event
- fold mid-stream usage snapshots without double-counting
- add the mid-stream usage event
- ship InMemoryTaskOutputRepository from ./test
### Bug Fixes
- improve usage tracking
- usage tracking for owned subtasks in Task Graph
#### ai,task-graph
- keep heuristic usage estimates out of accounting
#### task-graph
- count an owned child's late charge once
- scope usage sinks to the run that supplied them
- drop the run_usage columns nothing can populate
- roll usage up by task and by model, not one slice each
- count a nested task's spend once, not once per hop
- break the Task/ConditionalTask module cycle
- detach the run's usage listeners at run end
- reset the usage aggregator per run instead of replacing it
- key usage buckets without string collision
- defer the pipe-function wrapper past the Task cycle
#### task-graph,ai
- route a checkpoint's storage charge into the run total
#### test
- satisfy typecheck:tests across the usage test helpers
- close the gaps the Turbo/projects wiring opened
#### util
- last complete object wins when skipping JSON preamble (#718)
### Refactors
- decompose BaseTabularStorage.ts and Task.ts along functional seams (#682)
#### task-graph
- name run-usage columns like every sibling schema
#### test
- drop the FsFolderTaskOutputRepository shim
### Tests
- run tests through Turbo and per-package vitest projects
- move 174 more unit tests into their owning packages
- discover test files instead of enumerating sections
#### task-graph
- cover the cache-hit usage emit
- cover usage survival on aborted and finish-less streams
- make the StreamUsage type assertion actually enforceable
- relocate the remaining task-graph test infrastructure
- move TestTasks into the package's ./test entry
- extract the streaming task-output repository contract
#### ai
- pin the Usage field contract and assert disjointness
### Chores
- upgrade to catalog for many deps and update the deps themselves
#### eslint
- enforce consistent-type-imports and apply the repo-wide autofix (#683)
## @workglow/javascript
### Bug Fixes
#### test
- close the gaps the Turbo/projects wiring opened
### Chores
#### eslint
- enforce consistent-type-imports and apply the repo-wide autofix (#683)
## @workglow/ai
### Features
- enhance provisional usage reporting in AI provider streams
- implement CLI duration formatting and enhance task usage tracking
#### ai
- add ModelConfig.effort coarse thinking dial
- add a shared usage and cost formatter
- charge checkpoint cache storage at disposal
- add estimateCost over disjoint usage buckets
- add optional per-model pricing to the model schema
- fold usage snapshots in the accumulator and publish from AiTask
- add a ./test entry and drop _testOnly from the public API
#### providers
- emit cumulative usage snapshots mid-stream
### Bug Fixes
- improve usage tracking
- make the ./test entries survive a real build
#### ai,task-graph
- keep heuristic usage estimates out of accounting
#### task-graph,ai
- route a checkpoint's storage charge into the run total
#### ai
- delete the CheckpointEntry fields nothing reads
- attribute chat spend to the chat model
- charge every checkpoint's storage cost, not just the last link
- count the whole prompt in the usage arrow
- keep checkpoint teardown from stranding registry entries
- require explicit ModelPricing rates and make the type assertion enforceable
- make the OpenAI-shaped usage mappers report disjoint input
#### task-graph
- detach the run's usage listeners at run end
#### test
- close the gaps the Turbo/projects wiring opened
### Tests
- run tests through Turbo and per-package vitest projects
- move 174 more unit tests into their owning packages
#### ai
- verify OpenAI cache counters are portions of input_tokens
- drop the unused binding without gutting the pricing check
- pin the cumulative detail level and the detailed cached counter
- drop the non-falsifiable ModelPricing round-trip
### Chores
- add Lezer dependencies and update Vite configuration
#### eslint
- enforce consistent-type-imports and apply the repo-wide autofix (#683)
## @workglow/knowledge-base
### Bug Fixes
#### test
- close the gaps the Turbo/projects wiring opened
### Tests
- run tests through Turbo and per-package vitest projects
### Chores
#### eslint
- enforce consistent-type-imports and apply the repo-wide autofix (#683)
## workglow
### Features
#### ai
- add a ./test entry and drop _testOnly from the public API
### Bug Fixes
#### test
- close the gaps the Turbo/projects wiring opened
### Documentation
#### build
- correct the surviving bun-condition count and pin it with a test (#716)
## @workglow/storage
### Features
#### storage
- enhance query operators to support null handling and inequality checks
### Bug Fixes
#### test
- close the gaps the Turbo/projects wiring opened
### Refactors
- decompose BaseTabularStorage.ts and Task.ts along functional seams (#682)
### Tests
- run tests through Turbo and per-package vitest projects
- move 174 more unit tests into their owning packages
### Chores
#### eslint
- enforce consistent-type-imports and apply the repo-wide autofix (#683)
## @workglow/mcp
### Bug Fixes
#### test
- close the gaps the Turbo/projects wiring opened
### Tests
- run tests through Turbo and per-package vitest projects
- settle the Bun policy, close a CI gap, and pilot the __tests__ move
### Chores
#### eslint
- enforce consistent-type-imports and apply the repo-wide autofix (#683)
## @workglow/util
### Features
#### util
- add a ./test entry and drop _testOnly from the public API
### Bug Fixes
- reunite the graph test helper with its dependents
- make the ./test entries survive a real build
#### util
- last complete object wins when skipping JSON preamble (#718)
- resolve repo-root script imports independently of the vitest root
- stop TestingLogger inlining a second ConsoleLogger
#### test
- close the gaps the Turbo/projects wiring opened
### Performance
#### util
- add an incremental partial-JSON stream parser (#681)
### Tests
- run tests through Turbo and per-package vitest projects
- move 174 more unit tests into their owning packages
- settle the Bun policy, close a CI gap, and pilot the __tests__ move
- discover test files instead of enumerating sections
### Chores
#### eslint
- enforce consistent-type-imports and apply the repo-wide autofix (#683)
## @workglow/test
### Features
- enhance model existence verification in AI provider streams
- enhance provisional usage reporting in AI provider streams
- dd prefill phase emission to HFT streaming
#### models
- update pricing and add new model for DeepSeek
#### anthropic
- honor model.effort for extended/adaptive thinking
#### deepseek
- map model.effort to reasoning_allowance
#### openrouter
- map model.effort into reasoning extras
#### openai
- map model.effort to Responses reasoning
#### hft
- report local token counts as usage, not a phase message
#### gemini
- report checkpoint write tokens and cache lifetime
- add support for reproducible generation with sampling seed
#### providers
- report cache-checkpoint warm-up token cost
- emit cumulative usage snapshots mid-stream
#### storage
- enhance query operators to support null handling and inequality checks
#### task-graph
- ship InMemoryTaskOutputRepository from ./test
#### ai
- add a ./test entry and drop _testOnly from the public API
#### util
- add a ./test entry and drop _testOnly from the public API
### Bug Fixes
- improve usage tracking
- usage tracking for owned subtasks in Task Graph
- reunite the graph test helper with its dependents
- make the ./test entries survive a real build
#### huggingface-inference
- forward provider-stated usage from text run-fns
- encode Hub model ids per path segment
#### anthropic
- keep an in-range top_p under legacy extended thinking
- build a legal request under legacy extended thinking
#### ai,task-graph
- keep heuristic usage estimates out of accounting
#### task-graph
- count an owned child's late charge once
- scope usage sinks to the run that supplied them
- count a nested task's spend once, not once per hop
- break the Task/ConditionalTask module cycle
- key usage buckets without string collision
#### gemini
- remove structured-generation 2048 thinking default
- return cache disposal result through the queued path
- report disjoint input and fold thoughts into output
#### tasks
- handle the SafeFetch body-pipe rejection instead of crashing the process
- keep resolved credentials out of queued job payloads, add credential schemes (#677)
#### task-graph,ai
- route a checkpoint's storage charge into the run total
#### test
- satisfy typecheck:tests across the usage test helpers
- update provider-api usage expectations to the disjoint contract
- guard against getAll() returning undefined in PostgresTabularDateTime test
#### deepseek
- map the stated cache-miss count to disjoint input
#### ai
- make the OpenAI-shaped usage mappers report disjoint input
#### job-queue
- retry promptly when an idle peek finds a ready job
### Refactors
- decompose BaseTabularStorage.ts and Task.ts along functional seams (#682)
#### tests
- streamline model info test function calls (fix type errors)
#### test
- drop the FsFolderTaskOutputRepository shim
#### job-queue
- collapse per-backend queue adapters onto wrapQueueStorage (#684)
### Performance
#### util
- add an incremental partial-JSON stream parser (#681)
### Tests
- fix out of date assertion in test
- run tests through Turbo and per-package vitest projects
- delete the unused Postgres task-output and task-graph repositories
- move 174 more unit tests into their owning packages
- settle the Bun policy, close a CI gap, and pilot the __tests__ move
- discover test files instead of enumerating sections
- add unit tests for OpenAI reasoning and temperature coupling, and Postgres date handling
#### huggingface-inference
- pin the estimate/stated boundary for HFI
#### ai
- verify OpenAI cache counters are portions of input_tokens
- pin the Usage field contract and assert disjointness
#### task-graph
- cover a nested task's spend reaching the run total
- relocate the remaining task-graph test infrastructure
- move TestTasks into the package's ./test entry
- extract the streaming task-output repository contract
#### providers
- drop a plan reference from a test comment
- cover checkpoint warm-up usage wiring
#### storage
- exercise a null criterion against a real index
### Documentation
#### build
- correct the surviving bun-condition count and pin it with a test (#716)
### Chores
- update deps
- add Lezer dependencies and update Vite configuration
- upgrade to catalog for many deps and update the deps themselves
- update deps
#### eslint
- enforce consistent-type-imports and apply the repo-wide autofix (#683)
### Updated Dependencies
- `@aws-sdk/client-sqs`: catalog:
- `@cloudflare/workers-types`: catalog:
- `@types/dom-chromium-ai`: catalog:
- `@types/pg`: catalog:
- `aws-sdk-client-mock`: catalog:
- `fake-indexeddb`: catalog:
- `miniflare`: ^5.20260811.0-alpha
- `vitest`: catalog:
## @workglow/tasks
### Bug Fixes
#### tasks
- handle the SafeFetch body-pipe rejection instead of crashing the process
- keep resolved credentials out of queued job payloads, add credential schemes (#677)
#### test
- close the gaps the Turbo/projects wiring opened
### Chores
- update deps
#### eslint
- enforce consistent-type-imports and apply the repo-wide autofix (#683)
### Updated Dependencies
- `ipaddr.js`: ^2.5.0
- `undici`: ^8.10.0
## @workglow/job-queue
### Bug Fixes
#### test
- close the gaps the Turbo/projects wiring opened
#### job-queue
- retry promptly when an idle peek finds a ready job
### Refactors
#### job-queue
- collapse per-backend queue adapters onto wrapQueueStorage (#684)
### Tests
- run tests through Turbo and per-package vitest projects
- move 174 more unit tests into their owning packages
### Chores
#### eslint
- enforce consistent-type-imports and apply the repo-wide autofix (#683)
## @workglow/indexeddb
### Features
#### storage
- enhance query operators to support null handling and inequality checks
### Bug Fixes
#### indexeddb
- keep a null equality criterion out of IDBKeyRange
#### test
- close the gaps the Turbo/projects wiring opened
### Refactors
#### job-queue
- collapse per-backend queue adapters onto wrapQueueStorage (#684)
### Chores
- upgrade to catalog for many deps and update the deps themselves
#### eslint
- enforce consistent-type-imports and apply the repo-wide autofix (#683)
### Updated Dependencies
- `fake-indexeddb`: catalog:
## @workglow/openai
### Features
- enhance model existence verification in AI provider streams
- enhance provisional usage reporting in AI provider streams
#### openai
- map model.effort to Responses reasoning
#### providers
- report cache-checkpoint warm-up token cost
### Bug Fixes
#### ai
- require explicit ModelPricing rates and make the type assertion enforceable
#### util
- last complete object wins when skipping JSON preamble (#718)
### Performance
#### util
- add an incremental partial-JSON stream parser (#681)
### Tests
- add unit tests for OpenAI reasoning and temperature coupling, and Postgres date handling
### Chores
#### eslint
- enforce consistent-type-imports and apply the repo-wide autofix (#683)
## @workglow/llamacpp-server
### Features
- enhance usage tracking in AI providers
### Bug Fixes
#### ai
- require explicit ModelPricing rates and make the type assertion enforceable
## @workglow/electron
### Bug Fixes
#### test
- close the gaps the Turbo/projects wiring opened
## @workglow/ollama
### Features
- enhance provisional usage reporting in AI provider streams
### Bug Fixes
#### ai
- require explicit ModelPricing rates and make the type assertion enforceable
#### util
- last complete object wins when skipping JSON preamble (#718)
### Performance
#### util
- add an incremental partial-JSON stream parser (#681)
### Chores
#### eslint
- enforce consistent-type-imports and apply the repo-wide autofix (#683)
## @workglow/node-llama-cpp
### Features
- enhance usage tracking in AI providers
### Bug Fixes
#### ai
- require explicit ModelPricing rates and make the type assertion enforceable
#### util
- last complete object wins when skipping JSON preamble (#718)
### Performance
#### util
- add an incremental partial-JSON stream parser (#681)
### Chores
#### eslint
- enforce consistent-type-imports and apply the repo-wide autofix (#683)
## @workglow/aws
### Bug Fixes
#### test
- close the gaps the Turbo/projects wiring opened
### Refactors
#### job-queue
- collapse per-backend queue adapters onto wrapQueueStorage (#684)
### Chores
- upgrade to catalog for many deps and update the deps themselves
- update deps
### Updated Dependencies
- `@aws-sdk/client-sqs`: catalog:
- `aws-sdk-client-mock`: catalog:
## @workglow/anthropic
### Features
- enhance model existence verification in AI provider streams
#### anthropic
- honor model.effort for extended/adaptive thinking
#### providers
- report cache-checkpoint warm-up token cost
- emit cumulative usage snapshots mid-stream
### Bug Fixes
#### anthropic
- keep an in-range top_p under legacy extended thinking
- build a legal request under legacy extended thinking
#### ai
- require explicit ModelPricing rates and make the type assertion enforceable
#### util
- last complete object wins when skipping JSON preamble (#718)
### Refactors
#### tests
- streamline model info test function calls (fix type errors)
### Performance
#### util
- add an incremental partial-JSON stream parser (#681)
### Chores
#### eslint
- enforce consistent-type-imports and apply the repo-wide autofix (#683)
## @workglow/duckdb
### Bug Fixes
#### test
- close the gaps the Turbo/projects wiring opened
### Chores
#### eslint
- enforce consistent-type-imports and apply the repo-wide autofix (#683)
## @workglow/google-gemini
### Features
- enhance model existence verification in AI provider streams
#### gemini
- map model.effort to thinking_budget
- report checkpoint write tokens and cache lifetime
- add support for reproducible generation with sampling seed
#### ai
- charge checkpoint cache storage at disposal
#### providers
- emit cumulative usage snapshots mid-stream
### Bug Fixes
#### gemini
- remove structured-generation 2048 thinking default
- return cache disposal result through the queued path
- report disjoint input and fold thoughts into output
#### ai
- keep checkpoint teardown from stranding registry entries
- require explicit ModelPricing rates and make the type assertion enforceable
#### util
- last complete object wins when skipping JSON preamble (#718)
### Performance
#### util
- add an incremental partial-JSON stream parser (#681)
### Chores
#### eslint
- enforce consistent-type-imports and apply the repo-wide autofix (#683)
## @workglow/postgres
### Bug Fixes
#### test
- close the gaps the Turbo/projects wiring opened
### Refactors
#### job-queue
- collapse per-backend queue adapters onto wrapQueueStorage (#684)
### Tests
- add unit tests for OpenAI reasoning and temperature coupling, and Postgres date handling
### Chores
- upgrade to catalog for many deps and update the deps themselves
- update deps
#### eslint
- enforce consistent-type-imports and apply the repo-wide autofix (#683)
### Updated Dependencies
- `@types/pg`: catalog:
## @workglow/stable-diffusion-server
### Bug Fixes
#### ai
- require explicit ModelPricing rates and make the type assertion enforceable
## @workglow/supabase
### Features
#### storage
- enhance query operators to support null handling and inequality checks
### Bug Fixes
#### supabase
- keep deleteSearch's filter builder off the generic path
#### test
- close the gaps the Turbo/projects wiring opened
### Refactors
#### job-queue
- collapse per-backend queue adapters onto wrapQueueStorage (#684)
### Chores
#### eslint
- enforce consistent-type-imports and apply the repo-wide autofix (#683)
## @workglow/xai
### Features
- enhance model existence verification in AI provider streams
- enhance provisional usage reporting in AI provider streams
#### models
- update pricing and add new model for DeepSeek
### Bug Fixes
#### ai
- require explicit ModelPricing rates and make the type assertion enforceable
#### util
- last complete object wins when skipping JSON preamble (#718)
### Performance
#### util
- add an incremental partial-JSON stream parser (#681)
### Chores
#### eslint
- enforce consistent-type-imports and apply the repo-wide autofix (#683)
## @workglow/deepseek
### Features
- enhance model existence verification in AI provider streams
- enhance provisional usage reporting in AI provider streams
#### models
- update pricing and add new model for DeepSeek
#### deepseek
- map model.effort to reasoning_allowance
### Bug Fixes
#### ai
- require explicit ModelPricing rates and make the type assertion enforceable
#### deepseek
- map the stated cache-miss count to disjoint input
#### util
- last complete object wins when skipping JSON preamble (#718)
### Performance
#### util
- add an incremental partial-JSON stream parser (#681)
### Chores
#### eslint
- enforce consistent-type-imports and apply the repo-wide autofix (#683)
## @workglow/playwright
### Bug Fixes
#### test
- close the gaps the Turbo/projects wiring opened
## @workglow/sqlite
### Bug Fixes
#### test
- close the gaps the Turbo/projects wiring opened
### Refactors
#### job-queue
- collapse per-backend queue adapters onto wrapQueueStorage (#684)
### Chores
#### eslint
- enforce consistent-type-imports and apply the repo-wide autofix (#683)
## @workglow/cloudflare
### Bug Fixes
#### test
- close the gaps the Turbo/projects wiring opened
### Refactors
#### job-queue
- collapse per-backend queue adapters onto wrapQueueStorage (#684)
### Chores
- upgrade to catalog for many deps and update the deps themselves
- update deps
### Updated Dependencies
- `@cloudflare/workers-types`: catalog:
## @workglow/huggingface-transformers
### Features
- dd prefill phase emission to HFT streaming
#### hft
- report local token counts as usage, not a phase message
### Bug Fixes
- better error message when HFT has issues importing
#### task-graph
- count a nested task's spend once, not once per hop
#### ai
- require explicit ModelPricing rates and make the type assertion enforceable
#### HFT_Device
- remove "webgpu" from device resolution logic
#### util
- last complete object wins when skipping JSON preamble (#718)
### Refactors
- update @huggingface/transformers to peerDependency and add to devDependencies
### Performance
#### util
- add an incremental partial-JSON stream parser (#681)
### Chores
- upgrade to catalog for many deps and update the deps themselves
#### eslint
- enforce consistent-type-imports and apply the repo-wide autofix (#683)
## @workglow/tf-mediapipe
### Bug Fixes
#### ai
- require explicit ModelPricing rates and make the type assertion enforceable
#### util
- last complete object wins when skipping JSON preamble (#718)
### Performance
#### util
- add an incremental partial-JSON stream parser (#681)
### Chores
#### eslint
- enforce consistent-type-imports and apply the repo-wide autofix (#683)
## @workglow/chrome-ai
### Bug Fixes
#### ai
- require explicit ModelPricing rates and make the type assertion enforceable
#### util
- last complete object wins when skipping JSON preamble (#718)
### Performance
#### util
- add an incremental partial-JSON stream parser (#681)
### Tests
- discover test files instead of enumerating sections
### Chores
- upgrade to catalog for many deps and update the deps themselves
#### eslint
- enforce consistent-type-imports and apply the repo-wide autofix (#683)
### Updated Dependencies
- `@types/dom-chromium-ai`: catalog:
## @workglow/openrouter
### Features
- enhance model existence verification in AI provider streams
#### openrouter
- map model.effort into reasoning extras
### Bug Fixes
- improve usage tracking
#### ai
- require explicit ModelPricing rates and make the type assertion enforceable
#### util
- last complete object wins when skipping JSON preamble (#718)
### Performance
#### util
- add an incremental partial-JSON stream parser (#681)
### Chores
#### eslint
- enforce consistent-type-imports and apply the repo-wide autofix (#683)
## @workglow/huggingface-inference
### Features
- enhance model existence verification in AI provider streams
- enhance provisional usage reporting in AI provider streams
### Bug Fixes
#### huggingface-inference
- forward provider-stated usage from text run-fns
- encode Hub model ids per path segment
#### ai
- require explicit ModelPricing rates and make the type assertion enforceable
### Chores
#### eslint
- enforce consistent-type-imports and apply the repo-wide autofix (#683)
## @workglow/cactus
### Bug Fixes
#### ai
- require explicit ModelPricing rates and make the type assertion enforceable
### Tests
- discover test files instead of enumerating sections
### Chores
#### eslint
- enforce consistent-type-imports and apply the repo-wide autofix (#683)
## @workglow/bun-webview
### Bug Fixes
#### test
- close the gaps the Turbo/projects wiring opened
## @workglow/eval
### Features
#### models
- update pricing and add new model for DeepSeek
#### eval-example
- record and rank token usage and cost
### Bug Fixes
#### eval
- price the gpt-5.6 family, drop the bogus Anthropic max_tokens
### Tests
- run tests through Turbo and per-package vitest projects
#### eval-example
- cover the token-accounting logic the crux review flagged
### Documentation
#### eval-example
- stop the rate card asserting a provenance it lacks
### Chores
- update CodeMirror dependencies and improve TypeScript configuration
- upgrade to catalog for many deps and update the deps themselves
### Updated Dependencies
- `commander`: catalog:
- `hyparquet`: ^1.28.1
## @workglow/cli
### Features
- add tests for task usage duration and enhance usage line handling
- implement CLI duration formatting and enhance task usage tracking
#### cli-example
- show live input and output token counts
### Bug Fixes
- usage tracking for owned subtasks in Task Graph
#### cli-example
- render token usage on the actual rendered path
#### ai
- require explicit ModelPricing rates and make the type assertion enforceable
### Refactors
#### pricing
- optimize model pricing state management and improve usage line updates
#### cli-example
- hoist the footer's format call and drop a needless cast
### Tests
- run tests through Turbo and per-package vitest projects
#### cli-example
- gate usage emission on a mounted row, not a fixed sleep
### Chores
- update deps
- update CodeMirror dependencies and improve TypeScript configuration
- upgrade to catalog for many deps and update the deps themselves
#### eslint
- enforce consistent-type-imports and apply the repo-wide autofix (#683)
### Updated Dependencies
- `commander`: catalog:
- `react`: catalog:
- `smol-toml`: ^1.8.0
- `@types/react`: catalog:
## @workglow/web
### Features
#### web-example
- show the run's cumulative token total
### Bug Fixes
- improve usage tracking
#### task-graph,ai
- route a checkpoint's storage charge into the run total
#### task-graph
- roll usage up by task and by model, not one slice each
### Chores
- untrack examples/web/tsconfig.norefs.tsbuildinfo
- update deps
- add Lezer dependencies and update Vite configuration
- update CodeMirror dependencies and improve TypeScript configuration
- upgrade to catalog for many deps and update the deps themselves
- update deps
#### eslint
- enforce consistent-type-imports and apply the repo-wide autofix (#683)
### Updated Dependencies
- `@xyflow/react`: ^12.11.3
- `react`: catalog:
- `@types/react`: catalog:
- `vite`: ^8.2.1
Refs #568
Mechanical decomposition of two of the three flagship files named in the issue.
TaskRunner.tsis deliberately deferred — see below.Why TaskRunner.ts is deferred
Open PR #621 (
full-stream, 108 files, 83 commits) rewritesTaskRunner.tswith +243/−8 across 7 hunks, including an insertion insidehandleStart's cache-resolution block — squarely inside theRunLifecyclecluster the issue proposes to extract.Moving
handleStartinto a new file now would create a delete/modify conflict on brand-new logic, and would force whoever rebases #621 to hand-port those hunks into a file that did not exist when they were written. That is a bad trade for a purely mechanical refactor.Recommendation: re-plan the
TaskRunner.tssplit against the post-#621 file. The seam will look different once streaming lands, and the split is cheap to redo against the settled version.By contrast:
BaseTabularStorage.tsis untouched by all three open PRs.Task.tsgets only +45/−4 from Full stream #621, confined to the schema-validation region (roughly lines 837-967). Every hunk in this PR is textually disjoint from it — the closest edits are at old-file lines 568-634 and 976-1007. TheschemaWithoutPorts/validateInputregion is not touched.The issue's "SubscriptionMixin" does not map onto real code
The issue proposes splitting
BaseTabularStorage.tsintoCursorCodec + QueryHelpers + SubscriptionMixin. The first two map cleanly; the third does not.Subscriptions in this file are ~45 LOC total: a ~10-line
subscribeToChangesthat just throws ("override in subclasses"), plus thinon/off/once/emit/waitOndelegation to anEventEmitter. There is no machinery to extract — the real subscription logic lives in the concrete backends and inpackages/storage/src/util/{Hybrid,Polling}SubscriptionManager.ts, which are already separate modules. Extracting a "mixin" here would move a throw statement into its own file and add an indirection for nothing.What was split instead — four clusters that are genuinely large and genuinely self-contained:
cursorValues.tstoCursorValue,compareKeyValues(pure, module-level)keysetPage.tsrunPageengine asrunKeysetPage(deps, criteria, request), plusbuildEffectiveOrderBy/sortInMemory/applyKeysetFilter/buildCursorbodiestabularValidation.tsvalidate*bodies, taking schema properties as their first argumenttabularSchemaSetup.tsdetermineGenerationStrategycursorValues.ts+keysetPage.tstogether are the issue's "CursorCodec";tabularValidation.tsis its "QueryHelpers";tabularSchemaSetup.tsis an additional seam the issue did not name but which is where the constructor's bulk actually lives.LOC, before and after
The issue's numbers are stale — the files have grown since it was filed.
BaseTabularStorage.tsTask.tsTaskRunner.tsNew modules: storage 69 + 321 + 154 + 245; task-graph 119 (
TaskCloneOps) + 81 (TaskCacheOps) + 83 (TaskJsonOps).Follow-up:
Task.tsis still ~1000 LOC. The clone/JSON/cache seam the issue names is now fully harvested; getting it meaningfully below that needs an unlisted input-ops seam (setInput/addInput/ defaults handling, ~240 LOC), which is a separate judgement call about whether input merging belongs outside the class. I did not over-cut to hit a number.Correctness constraints held
These are what make the refactor safe for out-of-repo subclasses, and none of them are covered by tests in this repo:
protectedmethod keeps its signature on the class as a one-line delegation. Bodies moved to free functions; the methods stayed. A scripted comparison of the class member surface before vs after reports 69 → 69 members forBaseTabularStorageand 86 → 86 forTask, with zero removed, changed, or added. Same forTask'sgetCachePolicy(subclass-overridden),getCacheVersion,hasDeterministicId, and thecacheablegetter.runKeysetPagetakes aKeysetPageDeps<Entity>bag of closures bound to the instance (theStreamProcessor.tspattern) and never calls a sibling free function directly. Subclasses overridequery/getAll/generateKeyValue/sortInMemory; had the engine short-circuited to a free function, an out-of-repo override would have silently stopped taking effect with no test failure here.Task.toJSONremains a method —GraphAsTask,FallbackTaskandArrayTaskoverride it and callsuper.toJSON(). Its body becamebuildTaskJson(task), which reads statics viatask.constructor as typeof Taskand callscanSerializeConfig()on the instance so subclass overrides still gate serialization.Taskis imported as a type only, so no value cycle is introduced.tabularSchemaSetup.ts; the byte was verified in the committed git blob (2 NUL bytes, injoin("\0")on both lines), not just on disk — including after the pre-commit prettier/eslint hooks ran.TABULAR_REPOSITORY,ClientProvidedKeysOptionandKeyGenerationStrategystay physically inBaseTabularStorage.ts, whichcommon.tsre-exports wholesale. The new helper modules are internal and were not added to anycommon.ts/index.ts.as unknown as Array<keyof Entity>casts were left alone).Verification
All commands run from a clean build of this branch.
bun scripts/test.ts storage vitestbun scripts/test.ts queue vitestbun scripts/test.ts rag vitestbun scripts/test.ts task graph vitestbun run build:typesbun run buildnpx eslint(9 touched files)Confirming the non-SQL backends actually exercised the new keyset engine
The default
runPagepath is the riskiest part of this change, and it is exercised only by the non-SQL backends — SQLite / Postgres / DuckDB / Supabase all overridegetPage, and their integration suites skip without credentials. A green aggregate run therefore proves nothing on its own.To confirm, the relevant files were re-run with
--reporter=verboseand the full log inspected per test (not just the summary):Filtering that log for cursor/paging test names gives 66 individually-passing (
✓) keyset tests, distributed across the three backends that inherit the default path:InMemoryTabularStorage— 27IndexedDbTabularStorage— 29FsFolderTabularStorage— 10Named cases include "iterates the entire table by following nextCursor", "paginates filtered results via queryPage", "paginates by a non-PK orderBy with primary key as tiebreaker", "paginates compound (nullable DESC, non-null ASC) — mixed direction with NULLs trailing", and "is stable under concurrent inserts that sort before the cursor".
All 14 skipped tests were enumerated and none are pagination tests — they are
withTransactionRollback(backends without native transactions),vectorColumnFormat, and FsFolder'sinListCriterion/countMatchesQuerygroup. So no keyset test was silently skipped.The FsFolder tests are also what cover the
StorageUnsupportedError→getAllfallback branch insiderunKeysetPage, since FsFolder does not implementquery().🤖 Generated with Claude Code
https://claude.ai/code/session_01PwyJuFrJnibKvrrk8Fa4Fn
Generated by Claude Code