feat: compute the knowledge index via ctx index; drop stored INDEX …#138
Merged
Conversation
…blocks Replace the hand-maintained `<!-- INDEX -->` blocks in DECISIONS.md and LEARNINGS.md with a computed, generic `ctx index <file>` heading projector. The index is recomputed on demand and never stored, so it cannot drift, clobber entries, or double the merge-conflict surface of contributor PRs (the class of bug the old `index.Validate` guard existed to catch). - New `ctx index <file> [--depth N] [--json]`: projects any Markdown file's ATX headings (DECISIONS/LEARNINGS entries, CONVENTIONS, TASKS `## Phase`). Code-fence- and HTML-comment-aware, so template legends and fenced blocks are not mistaken for headings. - Rename `internal/index` -> `internal/heading`; keep the entry parsers (`ParseHeaders`/`ParseEntryBlocks`, still used by `ctx agent` scoring) and add the generic `Headings()` matcher. - Remove `ctx reindex`, `ctx decision reindex`, `ctx learning reindex` and the block-maintenance API; the entry-write path no longer mutates an index. - Strip the stored INDEX blocks from DECISIONS.md and LEARNINGS.md. - Sweep the dead exports the removal exposed (index table formatters, reindex/index-update errors, drift-index writers, column headers). Net deletion. KB indexing is intentionally untouched. Spec: specs/computed-index-projection.md Plan: specs/plans/computed-index-projection.md Signed-off-by: Jose Alekhinne <jose@ctx.ist>
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.
…blocks
Replace the hand-maintained
<!-- INDEX -->blocks in DECISIONS.md and LEARNINGS.md with a computed, genericctx index <file>heading projector. The index is recomputed on demand and never stored, so it cannot drift, clobber entries, or double the merge-conflict surface of contributor PRs (the class of bug the oldindex.Validateguard existed to catch).ctx index <file> [--depth N] [--json]: projects any Markdown file's ATX headings (DECISIONS/LEARNINGS entries, CONVENTIONS, TASKS## Phase). Code-fence- and HTML-comment-aware, so template legends and fenced blocks are not mistaken for headings.internal/index->internal/heading; keep the entry parsers (ParseHeaders/ParseEntryBlocks, still used byctx agentscoring) and add the genericHeadings()matcher.ctx reindex,ctx decision reindex,ctx learning reindexand the block-maintenance API; the entry-write path no longer mutates an index.Net deletion. KB indexing is intentionally untouched.
Spec: specs/computed-index-projection.md
Plan: specs/plans/computed-index-projection.md