Repository navigation
Conversation
…, by its tool key (LLP 0620 part B)
|
Server-suite gate at head e74dc5f: pass.
|
|
Independent review (steward-server) at head e74dc5f. Rating: MEDIUM. This rewrites stored local rows, and the rewrite cannot be undone locally. The merged-away copies survive only in the retired generation until it is swept, and in a synced user's hosted archive until a server pass runs. The claim is conservative and a failed rewrite keeps both copies. Privacy: low. Server-suite gate: pass. Comment 7114068627 ran the full suite, 344 of 344 files and 788 of 788 tests, on server master 87e696c with this head as the hypaware sibling. The server cache cannot run this merge: its maintainCache passes no storage and no getSettleHook. Verified on real storage (the storage service, the flush settle hook, and maintainCache with getResettlePairs):
Must-fix:
Should-fix:
CI: green except test-windows, which was still running at review time. Verdict: not final. Yes once must-fix 1 is in and test-windows is green, with the server-suite gate re-run at the landing head if the fix touches code the server imports. |
…ks; deferral and counts tested with the transcript on disk; smoke in the release battery
|
Review fixes and server-suite gate at head 661d28e. Must-fix, pass 1 memory. Pass 1 now keeps one number per keyed row in one Map (
Should-fixes:
Checks:
Server-suite gate: pass. hypaware-server master 87e696c, with this head as its |
|
Delta review (steward-server) at head 661d28e: final yes. Rating MEDIUM. Server-suite gate: pass. Comment 7114771057 ran the full suite, 344 of 344 files and 788 of 788 tests, on server master 87e696c with this head as the sibling. CI is 11 of 11 green, test-windows included. Must-fix, pass 1 memory: fixed.
Should-fixes: done.
Real storage, re-run at this head:
What a user's machine does after this ships:
|
Part B of LLP 0620 (design: #3055; part A, the shared merge function, landed in #3057). This is a draft.
What changes
When a Claude tool call or result was stored twice, once by the OTEL lane under a fallback hash and once by the transcript sweep under its native uuid, the cache's re-settle rewrite now merges the two by their tool key (LLP 0620 #local).
Today that pair stays two rows until the transcript happens to be readable at maintenance. When it is, the de-twin keeps the native copy and drops the live one, and with it the response's usage.
scanNativeIdentity, which replacesscanNativePartIds):mergeClaudeToolPair(from A) builds the one row it keeps.compact_batch_bytes, checked when a new key is admitted (one admitted key may cross it, as one fallback row may).DatasetRegistration.resettlePairs(key columns, key, merge) andMaintenanceOptions.getResettlePairs.hyp query maintainand the daemon tick wire them likegetColumnBackfill.cache.resettle_pairswith the claimed, merged, deferred and ambiguous counts and the discarded usage copies.When it runs: unchanged (LLP 0310 #in-place-by-default). Only on a whole-generation rewrite: a growth tick with pending fallbacks,
--force, or the transcript-settleable escape. The in-place path and its probe are untouched, and the escape is not widened.Durable formats and maintenance output
pendingFallbackskeeps its meaning: the rewrite still records the exact remainder, deferred keys included (tested).compact_batch_bytes: 1, admits one key at a time, and defers the other with its fallback counted.Tests
test/core/cache-resettle-tool-pairs.test.js(6) runs the real storage service andmaintainCachewith the gateway's own schema and no transcript on disk:Hermetic smoke
claude_tool_pair_merge:hyp query maintain --force --compact-onlyleaves 2 native rows with 34 output tokens, and a second pass leaves the same.ai_gateway.settle_miss(no transcript) andcache.resettle_pairswith merged = 2.getResettlePairswiring stubbed out, the smoke fails at the first maintenance pass.Checks
status-hostile-non-status-file.test.js:384(status-hostile-non-status-file.test.js fails locally when Claude Code is attached: the test reads the real HOME #2987, which reads the real HOME); CI passes it.CPU and memory
compact_batch_bytes.Gates
ai-gateway/src/dataset.js, whose registration now carriesresettlePairs. Its result goes on this PR before it leaves draft.