From fb794ae833d1683877953b37c04cfb65e1ce245d Mon Sep 17 00:00:00 2001 From: Chili Palmer Date: Sat, 30 May 2026 13:35:06 +0200 Subject: [PATCH] Fix C-1: add cache_read_tokens/cache_write_tokens to schema.allium ChatMessage --- SPECGAPS.md | 4 ++-- specs/schema.allium | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/SPECGAPS.md b/SPECGAPS.md index 2d5406f..3ba9fc7 100644 --- a/SPECGAPS.md +++ b/SPECGAPS.md @@ -102,8 +102,8 @@ Gap categories: **SC** = spec correct, fix code | **CS** = code correct, update All reconciled to follow code. Specs must be self-consistent and match code. | ID | Conflict | Resolution | Path | -|---|---|---|---| -| C-1 | schema.allium ChatMessage has no cache tokens; ai.allium ChatMessage has `cache_read_tokens`/`cache_write_tokens` | Code has cache tokens → align schema.allium with ai.allium | Update schema.allium | +|---|---|---|---|---| +| C-1 | ~~schema.allium ChatMessage has no cache tokens; ai.allium ChatMessage has `cache_read_tokens`/`cache_write_tokens`~~ | Code has cache tokens → align schema.allium with ai.allium | **Resolved:** added cache_read_tokens + cache_write_tokens to ChatMessage entity and ChatMessageRecordSurface in schema.allium | | C-2 | ~~media.allium SidecarFile mentions `linkedPostIds`; frontmatter.allium MediaSidecar does NOT list it~~ | Code writes `linkedPostIds` → add to frontmatter.allium | **Resolved:** linkedPostIds added to MediaSidecar in frontmatter.allium (with A2-15) | | C-3 | ~~translation.allium says status/timestamps omitted; frontmatter.allium TranslationFrontmatter defines only 5 fields; code writes 8+ fields~~ | Code writes status/timestamps → update both specs to match code | **Resolved:** both specs updated (see A2-5) | diff --git a/specs/schema.allium b/specs/schema.allium index 2449dcb..7b3b992 100644 --- a/specs/schema.allium +++ b/specs/schema.allium @@ -239,6 +239,8 @@ entity ChatMessage { content: String? tool_call_id: String? -- For tool responses tool_calls: String? -- JSON array of tool calls + cache_read_tokens: Integer? + cache_write_tokens: Integer? created_at: Timestamp } @@ -522,6 +524,8 @@ surface ChatMessageRecordSurface { message.content when message.content != null message.tool_call_id when message.tool_call_id != null message.tool_calls when message.tool_calls != null + message.cache_read_tokens when message.cache_read_tokens != null + message.cache_write_tokens when message.cache_write_tokens != null message.created_at }