Add DeepSeek cache-aware usage accounting - #20
Merged
likun666661 merged 1 commit intoJun 16, 2026
Conversation
jackwener
pushed a commit
that referenced
this pull request
Jun 21, 2026
Add DeepSeek cache-aware usage accounting
jackwener
pushed a commit
that referenced
this pull request
Jun 21, 2026
Add DeepSeek cache-aware usage accounting
jackwener
added a commit
that referenced
this pull request
Jun 21, 2026
borrow - xuan's transparent local MEMORY.md MVP (c06e13f) — two-switch shape (enabled + agentReadEnabled), HTML-comment metadata, fail-open parser, 0700/0600 perms, 128 KB cap. - kenji's boundary (19b0996f): local transparent file MUST NOT become implicit durable memory; agent-read default OFF. - kenji's 3-way confirmation (7749c411 #3): no plugin-provider abstraction yet — alma is built-in, pilotdeck is single provider with embedding selector, only Hermes is true plugin registry. Two-of-three is NOT convergence; defer abstraction. diverge - This is a contract anchor, NOT code. Freezes field names + status semantics so V0.2 / V0.3 PRs extend predictably without breaking V0.1 disk format. If reality changes, edit here first. risk - None. Documentation only. No file Maka reads/writes references this note at runtime. What - `notes/maka-memory-whitebox-contract.md`: - V0.1 (live): xuan's settings shape, file format, parse output with the `status` enum invariants. - V0.2 (forward): origin/status/decay/tags/stable-id extensions to the HTML-comment metadata. Parser MUST stay fail-open on unknown fields so V0.1 readers don't break on V0.2 files. - V0.3 (open): provider abstraction / vector search / cross- session recall / Dream Mode / multi-workspace memory. - Decisions log table with date + decision + source-msg pointers. - Pointers section linking xuan implementation + Hermes / pilotdeck deep-dive notes. Notes - The `extract_memory` agent tool design is intentionally deferred to V0.2; when shipped it is `permissionRequired: true`, gated on both `agentReadEnabled` AND a new `extractToolEnabled` switch (you cannot extract memory the agent cannot read). - Contract test surface §"Contract test surface" lists the 5 invariants the V0.2 implementation will need to lock down.
jackwener
pushed a commit
that referenced
this pull request
Jun 21, 2026
Add DeepSeek cache-aware usage accounting
jackwener
added a commit
that referenced
this pull request
Jun 21, 2026
borrow - xuan's transparent local MEMORY.md MVP (c06e13f) — two-switch shape (enabled + agentReadEnabled), HTML-comment metadata, fail-open parser, 0700/0600 perms, 128 KB cap. - kenji's boundary (19b0996f): local transparent file MUST NOT become implicit durable memory; agent-read default OFF. - kenji's 3-way confirmation (7749c411 #3): no plugin-provider abstraction yet — alma is built-in, pilotdeck is single provider with embedding selector, only Hermes is true plugin registry. Two-of-three is NOT convergence; defer abstraction. diverge - This is a contract anchor, NOT code. Freezes field names + status semantics so V0.2 / V0.3 PRs extend predictably without breaking V0.1 disk format. If reality changes, edit here first. risk - None. Documentation only. No file Maka reads/writes references this note at runtime. What - `notes/maka-memory-whitebox-contract.md`: - V0.1 (live): xuan's settings shape, file format, parse output with the `status` enum invariants. - V0.2 (forward): origin/status/decay/tags/stable-id extensions to the HTML-comment metadata. Parser MUST stay fail-open on unknown fields so V0.1 readers don't break on V0.2 files. - V0.3 (open): provider abstraction / vector search / cross- session recall / Dream Mode / multi-workspace memory. - Decisions log table with date + decision + source-msg pointers. - Pointers section linking xuan implementation + Hermes / pilotdeck deep-dive notes. Notes - The `extract_memory` agent tool design is intentionally deferred to V0.2; when shipped it is `permissionRequired: true`, gated on both `agentReadEnabled` AND a new `extractToolEnabled` switch (you cannot extract memory the agent cannot read). - Contract test surface §"Contract test surface" lists the 5 invariants the V0.2 implementation will need to lock down.
jackwener
pushed a commit
that referenced
this pull request
Jun 21, 2026
Add DeepSeek cache-aware usage accounting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refs #19. This PR implements only the phase-1 usage/pricing/accounting surface; the broader cost-runtime issue remains open.
Verification
npm run typecheck --workspaces --if-presentnpm --workspace @maka/runtime test(458/458)npm --workspace @maka/core test(614/614)npm --workspace @maka/storage test(81/81)npm --workspace @maka/desktop test(1399/1399)git diff --checkdeepseek-chatsmoke with localDEEPSEEK_API_KEY: normalizedprompt_tokens,completion_tokens,total_tokens,prompt_cache_hit_tokens, andprompt_cache_miss_tokens; cache-hit input observed.