fix(web): address the second review round on context provenance

- An empty replacement catalog is a real catalog: `renderCatalogUpdate()`
  publishes zero entries when the last skill disappears, and falling back
  would hide that every earlier name was retired.
- The opaque fallback keeps a `form` declaration this version cannot present.
  It is the one place a newer or foreign log's declared shape would otherwise
  vanish from the UI entirely, since the row marker is also absent there.
- An instruction change with an unrecognized `action` disqualifies the record.
  The action decides the word the row shows, so an unknown one would be
  presented as loaded or updated.
- The catalog list bounds itself and reports the withheld count. Entry count
  is unbounded and the scrollport bounds height, not node count.
- A catalog message keeps content blocks this version does not know, instead
  of dropping model-visible content the extensible union may carry.
- `core.md` defines `ContextFormed`, the interface actually carrying the
  optional field, beside `ContextForm`.
- The superseded-in-part bullet states the affected clauses as one rule rather
  than enumerating them; two rounds of enumeration each missed some, which is
  the shape being fragile rather than the list being wrong.
- The note records the one migration case that does not self-heal: an
  old-format catalog as the only one, with an empty current view, leaves a
  stale catalog nothing replaces.
This commit is contained in:
creatixchu
2026-08-05 16:51:01 +08:00
parent aeb718688e
commit ccd27f3775
16 changed files with 160 additions and 59 deletions

View File

@@ -2,5 +2,5 @@
# side as of the last confirmed-consistent state. Both languages carry equal authority;
# after editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write docs/core-data-structures/core.md
core.md: d91e84a7066b004567ed9f668ded52ee486a1c99
core.zh.md: f9cf2c14fe1021d7862d8bb14696044b7d8f7fbb
core.md: 7761930b7f133600e89befd1bda96cfc7d2f05f5
core.zh.md: 1a68b47229e3c961e772e7b0db33ded91b025e2e

View File

@@ -193,6 +193,13 @@ type ContextForm =
| 'catalog'
```
```ts type-equiv
/** Optional producer-declared {@link ContextForm}, mixed into the source shapes that carry one. */
interface ContextFormed {
readonly form?: ContextForm
}
```
## Streaming
Adapters emit a raw **chunk** protocol; the loop logs the chunks (replay fidelity) while feeding the same chunks through a `BlockAssembler` to rebuild blocks and messages. `StreamChunk` is a closed discriminated union over `type` — `block-start`, `text-delta`, `reasoning-delta`, `tool-call-delta`, `block-end`, `usage`, `finish`.

View File

@@ -199,6 +199,13 @@ type ContextForm =
| 'catalog'
```
```ts type-equiv
/** Optional producer-declared {@link ContextForm}, mixed into the source shapes that carry one. */
interface ContextFormed {
readonly form?: ContextForm
}
```
## 流式输出
适配器发出原始**分片**协议;循环记录分片(回放保真度),同时将同一批分片送入 `BlockAssembler` 以重建块和消息。`StreamChunk` 是基于 `type` 的封闭判别联合——`block-start`、`text-delta`、`reasoning-delta`、`tool-call-delta`、`block-end`、`usage`、`finish`。