Add SQLite database page attribution - #4993
Merged
Merged
Conversation
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
database_size_attributionblock to full CLI and MCP status JSON, including physical main/WAL/SHM sizes, logical page bytes, table/index/object totals, page-type totals, payload/unused/structural overhead, freelist bytes, residual bytes, and bounded top objects.dbstatand fall back to a bounded read-only b-tree/WAL parser with explicit unavailable reasons instead of reporting missing measurements as zero.Root cause
Status exposed only coarse database and WAL file sizes, so support automation could not reconcile logical SQLite allocation by object, page type, freelist, payload, or overhead. The file-parser fallback also needed to be bound to the active SQLite read snapshot so a concurrent WAL commit could not mix generations within one status response.
Validation
dotnet build CodeIndex.sln -c Release --no-restore -p:UseSharedCompilation=false— passed with 0 warnings and 0 errors.net8.0andnet9.0, including corruption, limits, cancellation, WAL truncation, and concurrent WAL snapshot consistency.net8.0: 10,896 passed, 7 skipped, 0 failed;net9.0: 10,422 passed, 420 skipped, 0 failed.make lint— passed.dotnet run --project tools/CodeIndex.Changelog -- check— 64 fragments valid.status --check --jsonreportedindex_matches_workspace=trueand no failed checks.Documentation and changelog
README.md,DEVELOPER_GUIDE.md,TESTING_GUIDE.md, andAGENT_GUIDE.md.changelog.d/unreleased/4888.added.md.Follow-ups
Fixes #4888