Remove provider stream sentinel assertions

This commit is contained in:
elpresidank 2026-06-02 02:55:06 -05:00
parent 3070ce2b47
commit bfb5494552
7 changed files with 30 additions and 10 deletions

View file

@ -12,8 +12,8 @@ Verified source roots:
- Effect v4 subtree: `/home/elpresidank/YeeBois/projects/beep-effect2/.repos/effect-v4`
- Installed Effect beta used by this workspace: `ts/node_modules/effect`
Current signal counts from `ts/packages` after the 2026-06-02 Base flow
definition schema slice:
Current signal counts from `ts/packages` after the 2026-06-02 Text completion
stream sentinel slice:
| Signal | Count |
| --- | ---: |
@ -68,6 +68,10 @@ Notes:
- The base flow definition schema slice removed hand-rolled
`Predicate`/object narrowing from `flow-processor.ts`; signal counts are
unchanged because this was a validation-quality migration.
- The text completion stream sentinel slice removed the duplicated
`Effect.void as Effect.Effect<undefined>` assertions from provider stream
unfold branches. Counts are unchanged because this was an Effect diagnostic
and type-channel cleanup.
- `Record<string, any>` and `throwLibrarianServiceError` are now clean in
`ts/packages`.
@ -543,6 +547,24 @@ Notes:
- `cd ts && bun run test`
- `git diff --check`
### 2026-06-02: Text Completion Stream Sentinel Slice
- Status: migrated and root-verified.
- Completed:
- `ts/packages/flow/src/model/text-completion/{ollama,openai,mistral,azure-openai,claude,openai-compatible}.ts`
now return the `Stream.unfold` end sentinel with
`Effect.as(Effect.void, undefined)`.
- Removed six `Effect.void as Effect.Effect<undefined>` assertions without
replacing them with `Effect.succeed(undefined)`, which `@effect/tsgo`
flags as a diagnostic.
- Verification:
- `bun run --cwd ts/packages/flow build`
- `cd ts && bun run check`
- `bun run --cwd ts/packages/flow test`
- `cd ts && bun run build`
- `cd ts && bun run test`
- `git diff --check`
## Subagent Findings To Preserve
- MCP/workbench:
@ -627,8 +649,6 @@ Notes:
- Rewrite shape:
- Move env/config reading into `Config` loaders and provider-specific layers.
- Scope SDK clients that need explicit close/disconnect.
- Remove `Effect.void as Effect.Effect<undefined>` stream assertions by
letting branch return types infer or by restructuring the stream parser.
- Tests:
- Provider config tests with `ConfigProvider.fromMap`.
- Storage tests with fake clients before changing real resource lifetimes.

View file

@ -164,7 +164,7 @@ export function makeAzureOpenAIProvider(config: AzureOpenAIProcessorConfig): Llm
return Stream.unfold<"pulling" | "done", LlmChunk, TextCompletionRuntimeError, never>(
"pulling",
(state) => {
if (state === "done") return Effect.void as Effect.Effect<undefined>;
if (state === "done") return Effect.as(Effect.void, undefined);
return Effect.gen(function* () {
while (true) {

View file

@ -142,7 +142,7 @@ export function makeClaudeProvider(config: ClaudeProcessorConfig): LlmProvider {
return Stream.unfold<"pulling" | "done", LlmChunk, TextCompletionRuntimeError, never>(
"pulling",
(state) => {
if (state === "done") return Effect.void as Effect.Effect<undefined>;
if (state === "done") return Effect.as(Effect.void, undefined);
return Effect.gen(function* () {
while (true) {

View file

@ -142,7 +142,7 @@ export function makeMistralProvider(config: MistralProcessorConfig): LlmProvider
return Stream.unfold<"pulling" | "done", LlmChunk, TextCompletionRuntimeError, never>(
"pulling",
(state) => {
if (state === "done") return Effect.void as Effect.Effect<undefined>;
if (state === "done") return Effect.as(Effect.void, undefined);
return Effect.gen(function* () {
while (true) {

View file

@ -120,7 +120,7 @@ export function makeOllamaProvider(config: OllamaProcessorConfig): LlmProvider {
return Stream.unfold<"pulling" | "done", LlmChunk, TextCompletionRuntimeError, never>(
"pulling",
(state) => {
if (state === "done") return Effect.void as Effect.Effect<undefined>;
if (state === "done") return Effect.as(Effect.void, undefined);
return Effect.gen(function* () {
while (true) {

View file

@ -155,7 +155,7 @@ export function makeOpenAICompatibleProvider(
return Stream.unfold<"pulling" | "done", LlmChunk, TextCompletionRuntimeError, never>(
"pulling",
(state) => {
if (state === "done") return Effect.void as Effect.Effect<undefined>;
if (state === "done") return Effect.as(Effect.void, undefined);
return Effect.gen(function* () {
while (true) {

View file

@ -146,7 +146,7 @@ export function makeOpenAIProvider(config: OpenAIProcessorConfig): LlmProvider {
return Stream.unfold<"pulling" | "done", LlmChunk, TextCompletionRuntimeError, never>(
"pulling",
(state) => {
if (state === "done") return Effect.void as Effect.Effect<undefined>;
if (state === "done") return Effect.as(Effect.void, undefined);
return Effect.gen(function* () {
while (true) {