fix(bootstrap): align the package version and block it from run-fns - #763
Conversation
`model.effort` on a pre-4.6 Claude id builds `thinking.type = "enabled"`,
and three constraints on that shape were unenforced:
- `effort: "low"` mapped to `budget_tokens: 512`, below Anthropic's
documented 1024 minimum. Clamp the legacy budget (and its `max_tokens`
padding). The adaptive path keeps 512 — there it is `max_tokens`
headroom, not a budget — and an explicit native
`provider_config.thinking.budget_tokens` is left alone, since silently
rewriting a provider-level opt-in hides the config error.
- Extended thinking rejects `temperature` / `top_p`, but
`claude-haiku-4-5` is on the sampling-accepting list, so a
thinking-configured run with a pinned temperature sent both. Drop
sampling when the built request carries `thinking.type = "enabled"`;
`{type: "adaptive"}` on 4.6+ does accept sampling and is untouched.
- A forced tool choice cannot carry legacy extended thinking. Structured
generation always forces `{type: "tool"}`, and tool calling forces
`{type: "any"}` for `toolChoice: "required"`. Skip thinking on a forced
choice; `{type: "auto"}` — the mapper's default — is not forced.
The guards read what has already been built, which establishes an ordering
invariant for every run-fn: assign `tool_choice`, then thinking, then
sampling. `Anthropic_ToolCalling` assigned tools last and sampling first;
both moved. Cache annotation still runs after the tools assignment.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H797qbH356jjznKgUax63o
A usage sink belongs to one run, and two things kept one alive past it.
`TaskRunner.handleStart` assigned each of the three sinks only when the
run config supplied one, so a run supplying none silently inherited the
previous run's. Assign all three unconditionally.
That alone does not close it: `own()` stamps the sinks into the child's
long-lived `runConfig`, and `Task.run` merges `{...this.runConfig,
...runConfig}` — so a later standalone `child.run()` arrives at
`handleStart` carrying the finished run's sinks as *supplied* values.
Record each child's prior values at stamp time and restore them in
`run()`'s `finally`, mirroring how `resourceScope` is already treated.
Restored rather than deleted so a nested `own()` chain hands each level
back what it had, and recorded only on the first stamp of a run so a
re-`own()` cannot overwrite the original.
`lateUsageSink` is still not cleared at `run()`'s end — a charge that
settles after the run belongs to it — but it is now replaced by the next
`handleStart` whether or not one is supplied. The field comment said the
opposite invariant.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H797qbH356jjznKgUax63o
A charge settling after an owned child finished travels two channels: `Task.chargeLateUsage` re-emits the child's new cumulative total on the `usage` event, and `reportLateUsage` sends the bare delta to the late-usage sink. `own()`'s bridge subscribed to the first and republished it as a live cumulative bucket for a child whose bucket was already retired on completion — so the aggregate became `2*spend + 2*charge`, and `sweep()` folded the duplicate live bucket into the persisted total rather than discarding it. Measured before the fix: a 10/5 execution plus a 100/0 charge reported 220/10. Keep the delta channel, which is what the aggregator's `chargeLate` is for, and suppress the re-emit in the bridge. `Task.chargeLateUsage` is left alone — it must keep updating `task.runUsage` and ordinary listeners, whose contract is replace-not-accumulate. The lifecycle subscription is installed before the `usage` one so the flag is already set when the charge arrives, and a `start` subscription clears it so a reused owned child's next execution still publishes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01H797qbH356jjznKgUax63o
Providers that report no billed totals mid-stream drive the live counter from `createEstimatedOutputUsageReporter`, which guesses tokens as `ceil(chars / 4)`. Those guesses were indistinguishable from provider-stated counts once emitted: `StreamProcessor` promoted the last snapshot into the settled total when `finish` carried no usage, the aggregator retired it into `retired`, `attachUsageRecorder` wrote it to `run_usage`, and `estimateCost` multiplied it by a real rate card. Mark them instead of trying to trace them. `Usage` gains one optional `estimated?: true`, set by the reporter's `snapshot()` — one line that covers roughly forty call sites across eight providers — and propagated by `mergeUsage`, since nothing in a merged total records which counter came from which side. Four rules then read the mark: - `StreamProcessor` refuses to settle on an estimate at both promotion sites (the `finish` fallback and the `finally` that promotes an aborted stream's last snapshot). `publishRunning` now assigns `runUsage` unconditionally, or clearing an unpromotable estimate would leave it holding that estimate as the settled total. - `GraphUsageAggregator.retireBucket` drops an estimated row rather than folding it into `retired`. This fits the class's existing split: live is display, retired is accounting. `chargeLate` is untouched. - `estimateCost` returns `undefined`, and `formatUsageWithCost` renders the counters with a `~` and no dollar figure. Also gates `accumulateOpenAIChatStream`'s reporter on `promptText`, matching `accumulateOpenAIResponsesStream`. Accepted trade-off: a provider that never states usage (HFI omits `include_usage`) shows a moving counter during the call and records no usage at the end — the pre-estimate recorded state, with the mid-stream feedback kept. The alternative is persisting a character count as billed spend. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01H797qbH356jjznKgUax63o
`assertHfModelExists` ran the whole model id through `encodeURIComponent`, turning the namespace separator in `org/model` into `%2F`. The Hub answers that request with 400, so every namespaced id — nearly all of them — failed its existence check before generation could start. Encode per segment instead, and validate the id shape first so a three-segment id or a `..` traversal segment is rejected without spending a request. A non-404 4xx is now reported as a rejected request rather than a generic lookup failure, which is what made the 400 read as "model missing". Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01H797qbH356jjznKgUax63o
A 723 KB incremental-build artifact was committed. Nothing in `scripts/`, `turbo.json` or `examples/web/` references it, and no `tsconfig.norefs.json` exists to regenerate it. Broaden the ignore rule from the single `tsconfig.tsbuildinfo` name to `*.tsbuildinfo` so a differently-named build info file cannot be committed the same way. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01H797qbH356jjznKgUax63o
…h-encoding fix(huggingface-inference): encode Hub model ids per path segment
Extended thinking bounds top_p rather than forbidding it — the API accepts 0.95 and above — so dropping every value discarded a setting the request was entitled to send. Pass an in-range value through and drop only what the API would refuse. temperature is still dropped unconditionally. Its only legal value under thinking is the default, so removing it cannot change the result, and keeping it beside a surviving top_p would trip the separate rule that the two may not both be specified — turning a legal request into a 400. Measured against the live API on claude-haiku-4-5: top_p 0.9 is refused with "must be greater than or equal to 0.95 or unset when thinking is enabled"; 0.98 alongside thinking is accepted. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LhpyaargNQnT64dEPYBnHZ
…-thinking-request fix(anthropic): build a legal request under legacy extended thinking
…un-fns Every other OpenAI-shaped provider reads the terminal chunk's `usage` inside its stream loop and forwards it on `finish.usage` — DeepSeek, OpenRouter and xAI all do, and so does HFI's own tool-calling run-fn via `accumulateOpenAIChatStream`. HFI's three text run-fns hand-roll the loop and read only `choices[0].delta.content`, so a billed total the upstream had already sent was dropped on the floor and the character-count estimate was all that survived. Read `chunk.usage` outside the delta guard, since the usage-bearing chunk arrives last with an empty `choices` array and contributes no text. No `include_usage` opt-in is added: HF Inference routes to third-party providers whose support for it varies, matching the reasoning already recorded in the tool-calling run-fn. When nothing is volunteered `usage` stays undefined rather than becoming a zeroed total, which would read as "billed nothing" instead of "never reported". The three behavioural assertions fail against the pre-fix source; the six scope guards pass either way. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LhpyaargNQnT64dEPYBnHZ
The two halves of this branch meet here and neither side tests the seam alone. Mid-stream snapshots are character-count guesses and must carry `estimated` so the aggregator drops them; the provider's own total must not, since that marker is exactly what would keep it out of the retired total and out of every cost figure derived from it. Without the stated total being forwarded, an HFI run shows a live counter and then records nothing — which is what made the accounting fix's trade-off worth closing rather than accepting. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LhpyaargNQnT64dEPYBnHZ
…-run-lifetime fix(task-graph,ai): three usage-accounting defects — sink lifetime, owned-child double count, priced estimates
…e usage line updates - Updated `useModelPricing` to manage state with a single object containing `modelId` and `pricing`, enhancing clarity and reducing unnecessary state updates. - Refactored `useTaskUsageLine` to utilize `useSyncExternalStore` for clock synchronization, improving performance and ensuring consistent updates for live usage rows. - Removed redundant state management in `useTaskUsageLine`, streamlining the component's logic for better readability and efficiency.
## @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
…stries `bootstrapWorkglow()` and the vitest harness's `bootstrapTestRegistry()` each made the same 14 default-registration calls in the same order. The two were provably equivalent — every registration function defaults its registry parameter to `globalServiceRegistry`, so the no-argument test variant and the explicit-registry production variant did identical work. Promote the shared logic to a new `@workglow/bootstrap` package sitting below both consumers, depending only on util, storage, task-graph, knowledge-base, ai, and mcp. - `registerAllDefaults(registry = globalServiceRegistry)` is now the single definition, with the signature widened so both call styles are served. - `bootstrapWorkglow()`, `createOrchestrationContext()`, `BootstrapOptions`, and `WorkglowContext` move alongside it. - `packages/workglow/src/bootstrap.ts` becomes a re-export, so the `workglow/bootstrap` subpath and the root barrel keep working unchanged. `auto-bootstrap.ts` stays in the meta-package, which carries the tslog dependency its logger needs. - `vitest.setup.ts` calls `registerAllDefaults()` directly, imported by source path because the isolated linker keeps workspace packages out of the repo root's node_modules. Claude-Session: https://claude.ai/code/session_01PwyJuFrJnibKvrrk8Fa4Fn
…ts test, docs Follow-up polish on the @workglow/bootstrap extraction. No correctness, security, or data-integrity change — the registration set and order are untouched. - Add the missing `license` field (Apache-2.0) and a LICENSE file. The package sets `publishConfig.access: "public"` and its sources carry SPDX Apache-2.0 headers, but npm would have listed it as unlicensed. (Note: no other workspace in this repo declares a `license` field either — a repo-wide sweep is worth doing separately.) - Align the version to 0.3.38. It was 0.3.37 while root and all 13 siblings were 0.3.38, so `bunset --patch --all` would have opened a permanent one-patch offset between bootstrap and everything that depends on it. - Make `registerAllDefaults(registry)` required again, as it was when the function was module-private. It mutates whichever container it is handed, and it is now exported three ways; a defaulted global turns "installed defaults on the wrong registry" from a compile error into silent behavior. This matches the repo convention of forcing callers to be explicit rather than defaulting. - `vitest.setup.ts` now calls `bootstrapWorkglow()` (equivalent with no logger option). It cannot pass `globalServiceRegistry` explicitly: `@workglow/util` does not resolve from the repo root under the isolated linker, and importing `packages/util/src` directly would load a second copy of the module and populate a different registry object than the tests read. - Add `packages/test/src/test/util/BootstrapPackageExports.test.ts`, covering the published contract: every `exports` leaf resolves to a file that exists, and the node entry point really exports the bootstrap API. Nothing in CI exercised the build output before, so a typo'd exports path or a build that emitted nothing would have shipped silently. - Add README (including the all-defaults dependency-weight tradeoff) and CHANGELOG, and document the package in .claude/CLAUDE.md so contributors add registrations here rather than in the now-inert re-export shim. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…ated-context example
The README and `.claude/CLAUDE.md` both stated the package's raison d'être as
"Workglow does not self-register defaults at import time" / "Nothing
self-registers at import time". That is inverted: all 14 `register*Defaults`
functions run at module scope against `globalServiceRegistry`, and each defaults
its `registry` parameter to it. A reader who trusts the old text concludes the
global registry is empty until `bootstrapWorkglow()` runs and will mis-diagnose
ordering bugs — `getLogger()` also lazily self-registers, so "it worked without
bootstrap" looks impossible.
State the real invariant instead: registrars self-register on the global
registry when their module happens to be imported, so what is populated is
import-order dependent; `bootstrapWorkglow()` is the guarantee that installs the
full set in dependency order; an isolated registry gets nothing until
`registerAllDefaults(registry)` is called explicitly.
Second defect: the isolated-context example passed an option no run API accepts.
`Task.run(overrides, runConfig)` takes input overrides first, and neither
`IRunConfig` nor `TaskGraphRunConfig` has a `context` key — `IRunConfig` carries
`registry?: ServiceRegistry`. With a loosely typed Input, `run({ context: ctx })`
is treated as an input override named `context`, `TaskRunner` keeps its
`globalServiceRegistry` default, and `ctx.dispose()` tears down a registry the
run never touched — the exact process-wide-mutation hazard the rest of the
README argues against. Corrected to `run({}, { registry: ctx.registry })` in the
README and in the `createOrchestrationContext` JSDoc, and pinned by a new
doc-conformance test that asserts both the correct routing and the old snippet's
silent fallback to the global registry.
Also splits `ServiceRegistry` into a top-level `import type` in
`registerAllDefaults.ts` (it is used solely as a parameter type), and syncs
`bun.lock` with the 0.3.38 version bump.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K6huUY7hSkRbjun1P9HKsz
The bootstrap package shipped a third `bun` entry whose source was byte-identical to `src/node.ts`, so Bun loaded the same code through a separate bundle and a separate declaration file. Removing it makes Bun resolve the default `import` condition to `dist/node.js` and restores the two-target build every other non-vendor package uses. This also unbreaks the BunExportConditions fixture, which pins the set of packages whose Bun implementation genuinely differs. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013oVdDSRMJeALBPLDQf3DgH
The package holds no test files, so `bun test` exits non-zero with "0 test files matching". Every workspace that does declare `test` uses the shared vitest project form, and a package with no tests omits the key entirely — turbo then produces no task for it, and the dependent `@workglow/test` project still covers the package on a changed-files run. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013oVdDSRMJeALBPLDQf3DgH
…havior
The file claimed both halves of the isolated-context example were pinned,
but it only reproduced the shapes in TypeScript — nothing read the README or
the `createOrchestrationContext` JSDoc, so either could rot back to
`task.run({ context: ctx })` with the suite still green.
Adds three cases that read the two documents: the README shows the registry
in the run config, no README fence passes the context as an input override,
and the JSDoc example matches. Blocks are selected by content rather than by
the heading above them, so a heading rename cannot make them pass vacuously.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013oVdDSRMJeALBPLDQf3DgH
Rebased onto main first: at the previous branch head every workspace including root was 0.3.38, so the defect only exists relative to main's 0.3.39. After the rebase packages/bootstrap sits at 0.3.38 while the root and the other 41 workspaces are 0.3.39. `bunset --patch --all` bumps each manifest from its own value, so it would take the family to 0.3.40 and publish bootstrap at 0.3.39 — one behind forever — and `workglow` declares `workspace:*`, so the meta-package would ship depending on a stale version. Set to 0.3.39; the lockfile diff is that field alone. The run-fn `no-restricted-imports` guard also gains @workglow/bootstrap and workglow/bootstrap. It is a package at the `ai` tier that `providers/*` can import directly, and `bootstrapWorkglow()` mutates globalServiceRegistry — a registry a worker does not share. Blocked wholesale rather than by importNames: the package's entire public surface is registry mutation, so a name list would drift. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RomTUtZSTgUbFCYqFs4pcu
|
Superseded by a8f1f30 on This branch was a divergent re-do of #672 rather than a stack on top of it — its merge-base with #672 is Comparing the two heads directly, every
The first three were applied to #672 unchanged. The version bump was deliberately not carried over: it is only correct in the presence of this branch's Verified on #672 after the cherry-pick: Bringing Generated by Claude Code |
Stacked on #672 (
claude/libs-issues-triage-prs-mh6x2o-574). This branch is #672 rebased ontoorigin/main, plus one commit.The rebase finding (reported first, because it changes the story)
At the #672 branch head there is nothing to fix. Verified before touching anything: every workspace and the root manifest read
0.3.38— 43 manifests, one distinct version. The defect exists only relative tomain, which released0.3.39(f9f4b34b chore: release 0.3.39 for 41 packages) afterpackages/bootstrapwas branched.After rebasing onto
origin/main(clean — no conflicts, not even inbun.lock), the counts are:42 = the root plus 41 workspaces; the straggler is the new package.
(a) What breaks
bunset --patch --allbumps each manifest from its own current value, not from a family value. So the next release takes the other 42 to0.3.40and publishes@workglow/bootstrapat0.3.39— still one behind, and one behind forever, since every subsequent release repeats the offset.packages/workglowdeclares"@workglow/bootstrap": "workspace:*"(verified), which resolves at publish time to whatever is on disk, so the meta-package would ship declaring a dependency on the stale version. Nothing in the release path notices.Fixed by setting
packages/bootstrapto0.3.39and regenerating the lockfile. Thebun.lockdiff is that version field and nothing else (shown in the commit).Test:
packages/test/src/test/util/WorkspaceVersions.test.tsasserts the set ofversionvalues across the root manifest and everypackages/*,providers/*,examples/*manifest has size 1, and names the manifests per version so a failure says which file to edit. Private workspaces are included on purpose —bunset --allbumpspackages/test,providers/awsandproviders/cloudflaretoo, so exempting them would recreate the same hole one tier down. RED immediately after the rebase (expected 2 to be 1, listingpackages/bootstrap/package.jsonalone against the other 42), green after the bump.(b)
bootstrapWorkglowis importable from a run-fneslint.config.js:73blocksglobalServiceRegistry/ credential-store imports inside**/*_JobRunFns.ts— but only from@workglow/utiland@workglow/util/worker.@workglow/bootstrapnow exportsbootstrapWorkglow(), which callsregisterAllDefaults(globalServiceRegistry)andsetLogger(..., globalServiceRegistry). It sits at theaitier, so anyproviders/*run-fn can import it directly and the existing guard says nothing.@workglow/bootstrapandworkglow/bootstrap(the meta-package republishes the same surface, one specifier away) are added topaths, blocking the modules wholesale rather than byimportNames: the package's entire public surface is registry mutation, so a name list would be the whole surface and would drift the moment one was added. The message keeps the voice of the existing two — a run-fn executes in a worker with its ownglobalServiceRegistry, sobootstrapWorkglowmutates a registry the main thread never sees; resolve the services in the task class and pass them through the serialized job input.Test:
scripts/eslintRestrictedImports.test.ts, using the ESLint Node API withlintTextand a syntheticproviders/openai/src/ai/common/Fixture_JobRunFns.tsfilePath. No file is written — the path only has to match the config glob — and the config uses a plain parser with no type-aware project service, so the whole file runs in ~6s. Asserts:no-restricted-importserror (RED today: zero);workglow/bootstrapsubpath likewise (RED today: zero);globalServiceRegistryfrom@workglow/utilcase still errors;@workglow/utilimport (uuid4) still passes — proving that entry stays name-scoped while the new ones are wholesale.Verification
bun scripts/test.ts util unit vitest— 56 files, 767 passed / 10 skipped.bun scripts/test.ts scripts vitest— 3 files, 15 tests, all passing.bun scripts/test.ts --check-sections— every test file still reachable, so both new files run in CI.npx prettier --checkon all changed files — clean.Two notes on the environment, stated rather than glossed:
utilrun failed 2 files (BootstrapReadme,BootstrapPackageExports) becausepackages/bootstrap/distdid not exist in this checkout —use-sourcehad been run before the package was added, so it had no stubs.bun run use-source(which writes only gitignored stubs) fixed it and both went green. Not related to this change, but worth knowing for anyone else picking the branch up after a rebase.npx tsgo -p packages/test/tsconfig.jsonreports ~4925 error lines in this checkout with and without this change, identically, and none mention the new files. That config is not a usable signal here (source-stub mode with no built declarations), so the new tests were verified by running them rather than by typechecking that project.Generated by Claude Code