# Knowledge Vault Context Management Policy ## 1. Purpose Long discussion files can exceed a single model context and degrade judgment quality. Knowledge Vault workflows must process long sources through file-based ranges, worker threads, and continuation handoffs. ## 2. Main Rule The main session must not load or reason over an entire long source document when the task can be split by source range. The main session is responsible for: ```text - source registration - output directory creation - invocation packet creation - worker dispatch - returned-output collection - cross-range consistency checks - user confirmation gates ``` For coherent long sources that fit a high-context participant, Knowledge Vault should first run a real whole-source gestalt sub-session before range splitting. This does not relax the main-session rule: the main session prepares the invocation, records the returned output, and uses the gestalt as orientation. The whole-source gestalt sub-session is responsible for: ```text - reading the full source when it fits the agreed high-context limit - judging whether the source is one coherent topic or should be split into macro-topics - producing the global topic portrait, main structure, core tensions, and model-evolution line - flagging parent/child/tool/case/action-layer distinctions that range workers may flatten - giving segmentation guidance for downstream workers ``` Worker sessions are responsible for: ```text - one H1 round - one source block batch - one bounded participant task - one explicit output contract ``` ## 3. Default Split Strategy Use this sequence: ```text 0. Run or record an exception to the whole-source gestalt pass. 1. Split by Markdown H1 round. 2. If a round is too large, split by H2 section. 3. If a section is still too large, split by source block batch. 4. Assign stable range ids such as R01, R04-S02, or R04-B001-B030. ``` ## 4. Thread Strategy Use worker threads when a processing pass needs to read large source ranges or preserve participant focus. Each worker thread should receive a thread-start packet and return a thread-return packet. Worker thread-start packets should include the accepted whole-source gestalt summary when it exists. Workers may challenge that global portrait, but must label the challenge and cite local evidence. Run-specific packet paths: ```text handoff/thread-start-packets/ handoff/thread-return-packets/ ``` Worker outputs must be written to files before the main session synthesizes them. ## 5. Continuation Handoff Create a continuation handoff when any condition is met: ```text - a major pass is complete - several large source ranges have been read - a participant boundary changes - the run is blocked waiting for external output - a user confirmation gate is reached - context pressure may affect judgment quality - the next session must continue without relying on chat history ``` Recommended path: ```text handoff/continuation/{date}-{stage}.md ``` ## 6. What The Main Session May Read The main session may read: ```text - source-map - topic-map - routing-log indexes - worker return summaries - audit summaries - unresolved issue lists - bounded excerpts needed to verify a claim ``` The main session should avoid repeatedly loading: ```text - full original source - all worker outputs at once - all topic documents at once - all external returned outputs at once ``` ## 7. Quality Gate Before starting a large pass, the run must define: ```text - input range - output path - expected record file - acceptance check - continuation point ``` If these are missing, pause and create the missing run-control files first.