fix review findings: stale service prose + catalog cleanup

Codex review of the PR1 diff surfaced docs/cleanup drift:
- LlmService class JSDoc still advertised "streaming / non-streaming call
  surfaces, both interceptable via waterfall events" — corrected to the single
  streaming surface; regenerated the cordis catalog so its mirror updates.
- Removed GenerateResult from gen-cordis-catalog.ts LINK_MAP (the type is gone).
- The adapter-change RFC's acceptance criterion named the retired
  verify-event-taxonomy gate; updated to verify-cordis-catalog.
- Dropped the now-tautological "streaming and one-shot assembly agree" property
  test (the streaming/one-shot distinction lived in the removed flush API;
  usage/finish remain covered by assembler.spec.ts and the finish property).
This commit is contained in:
Tianyi Cui
2026-06-21 01:41:02 +08:00
parent 30cd67b8a1
commit 584349f881
5 changed files with 5 additions and 18 deletions

View File

@@ -341,7 +341,7 @@ Source: [`packages/bash/bash/src/index.ts:58`](../../packages/bash/bash/src/inde
### `ctx.llm` — `LlmService`
The abstract `llm` service: an adapter registry plus streaming / non-streaming call surfaces, both interceptable via waterfall events.
The abstract `llm` service: an adapter registry plus a streaming model-call surface, interceptable via the `llm/stream` waterfall.
```ts cordis-catalog
registerAdapter(models: string[], adapter: LlmAdapter): () => void

View File

@@ -29,7 +29,7 @@ If an LLM adapter browser or dynamic model-picker needs this signal later, reint
## Acceptance criteria
- `llm/adapter-change` and its emits are gone; `pnpm run verify-event-taxonomy` passes against the updated table.
- `llm/adapter-change` and its emits are gone; `pnpm run verify-cordis-catalog` passes against the regenerated catalog.
- HMR-safety tests still pass: disposing a contributing fiber still removes the adapter.
- `tools/change` and `system-prompt/change` remain documented and tested.
- `pnpm run test:coverage` stays 100% per-file.

View File

@@ -63,8 +63,8 @@ export abstract class LlmAdapter {
}
/**
* The abstract `llm` service: an adapter registry plus streaming /
* non-streaming call surfaces, both interceptable via waterfall events.
* The abstract `llm` service: an adapter registry plus a streaming model-call
* surface, interceptable via the `llm/stream` waterfall.
*/
export class LlmService extends Service {
private adapters = new Map<string, LlmAdapter>()

View File

@@ -4,7 +4,7 @@
* The assembler is protocol-shaped: arbitrary interleavings of block-start,
* deltas, block-end, usage, and finish — valid and malformed (duplicate
* indices, stragglers after block-end, missing block-start, delta-only). The
* invariants below are the contract the agent loop and LlmService rely on.
* invariants below are the contract the agent loop relies on.
*/
import { describe, expect, it } from 'vitest'
@@ -99,16 +99,4 @@ describe('BlockAssembler properties', () => {
}
}))
})
it('streaming and one-shot assembly agree on usage and finish', () => {
fc.assert(fc.property(streamArb, (chunks) => {
// Streaming consumer: push as it goes.
const streaming = new BlockAssembler()
for (const chunk of chunks) streaming.push(chunk)
// One-shot consumer: push all, then read.
const oneShot = feed(chunks)
expect(streaming.usage).toEqual(oneShot.usage)
expect(streaming.finish).toEqual(oneShot.finish)
}))
})
})

View File

@@ -64,7 +64,6 @@ const LINK_MAP: Record<string, string> = {
Message: 'core.md',
MessageSource: 'core.md',
GenerateOptions: 'core.md',
GenerateResult: 'core.md',
SessionEvent: 'core.md',
StreamChunk: 'llm-streaming.md',
TurnEndReason: 'session.md',