Skip to content

perf(ai): avoid full root execution hydration for history usage - #318

Merged
ice-black-tea merged 1 commit into
masterfrom
perf/history-usage-root-metadata-264
Nov 15, 2026
Merged

ice-black-tea merged 1 commit into
masterfrom
perf/history-usage-root-metadata-264

Conversation

@ice-black-tea

Copy link
Copy Markdown
Collaborator

Refs #264. This slice removes unnecessary payload hydration from the built-in History.usage(include_children=True) root admission. It reuses the existing metadata projection, preserving tenant authorization, stored-owner comparison, pending/fresh handling, and per-execution usage authorization. Custom repositories preserve their existing read contract. No new cache, public API, or schema; fresh pending terminal handling may still read the result where required.

Scoped evidence on base c9f92ebd: 27 tests passed (memory and SQLite plus existing owner, source and pending guards); configured Ruff and diff check passed. Matched cold SQLite root+child with 128 KB stored input: 9 → 9 SELECTs, projected SQL result text/binary bytes 93,254 → 19,438; input projection rows 4 → 3 and same UsageSummary. Bytes are measured by replaying captured queries, not network/disk bytes or elapsed time. MySQL and PostgreSQL were not run. Further consumer/backend work remains under #264; this PR does not close the issue.

@ice-black-tea
ice-black-tea merged commit 18165a4 into master Nov 15, 2026
15 checks passed
@ice-black-tea
ice-black-tea deleted the perf/history-usage-root-metadata-264 branch November 15, 2026 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant