docs(design): the brain index, shared reads and separate writes - #1437
Closed
santoshkumarradha wants to merge 2 commits into
Closed
santoshkumarradha wants to merge 2 commits into
santoshkumarradha wants to merge 2 commits into
Conversation
A design for one index of every run across chats and projects, written only by the engine at run start and end, feeding the existing <elsewhere> block, the tasks tool and a planning check. Includes the overlap measurement and the code map for a later single plan store.
Member
Author
|
Combined into #1443, which now carries this design doc and its change entry together with the first steps. |
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.
Design only. No product code.
docs/design/brain/DESIGN.mddesigns one small index of every run across chats and projects:~/.codeaf/v3/brain.db, one row per run, written only by the engine at run start and run end. Each run keeps its own plan store for writes, so thePLANDB_RUNisolation from #1417 stays.Four layers
(conversation_id, run_id). The engine is the only writer. It covers crash safety, size bounds, and a read-only backfill from the plan stores,tasks.json,tasks.jsonlandgraph.db.<elsewhere>block reads the index too. It keeps its grammar and caps. Rows are ranked by shared files first, then repo, project and title.taskstool withscope: "everywhere"also searches finished work in every chat. No new tool./taskplans, it checks the index for overlap and then waits, joins or narrows. It never writes into another run.Later: read-only cross-chat links, one scheduler and budget across runs, and a code map for one universal plandb, with verified counts and risks.
Measurement (aggregates only)
Every chat folder on one working machine over 9 days: 87 chats in 7 project folders, 481 tasks.
<elsewhere>could show 9 of them. The other 17 were on the same repository from chats filed under a different project folder.Findings from the code, beyond the brief
<elsewhere>already sees closed chats, but only in the same project folder, and the project folder is the launch folder, not the repository.transactthensaveState). That is fine per run, but it has to become row-level writes before any single store.RootID()is called 43 times in 10 non-test files, as estimated.internal/plandbis imported by 11 other packages (7 in non-test code), not 22.Change entry:
docs/changes/unreleased/<this PR>-brain-index-design.md.