Fix/kb reindex nesting#106
Merged
Merged
Conversation
ctx kb reindex enumerated topics one level deep, so a kb that groups topics into subfolders (topics/<group>/<slug>/index.md) reindexed to zero and BLANKED the CTX:KB:TOPICS managed block (observed in the things-wtf-dr kb after it regrouped 49 topics). ListTopics now recurses (topic.go + new scan.go): it records every directory holding a topic index.md, keyed by its slash-separated path relative to the topics root, and keeps the leaves — a directory whose index.md sits above nested topics is a group-landing (orientation) page and is excluded. Flat, grouped, mixed, and arbitrary-depth layouts all enumerate; a non-existent topics dir still yields the "no topics yet" placeholder, never an error-blank. RenderBlock is unchanged: the topics/<slug>/ link template already targets nested paths, and sorted slashed slugs cluster by group prefix. Per-group headings would change the managed-block format and are deferred. The helpers live in scan.go (all-unexported) so topic.go keeps a single exported ListTopics, per the mixed-visibility convention. Tests (new): topic_test.go covers flat / grouped / mixed / group-landing-excluded / deep-nesting / bare-dir / empty / non-existent; block_test.go covers nested-slug + empty rendering. Bundled housekeeping (no functional code; inherits this commit's spec per specs/meta/chores.md's bundling rule): - Archived 61 completed tasks -> .context/archive/tasks-2026-05-28.md and 27 skipped tasks -> tasks-2026-05-28-skipped.md (phase-grouped), trimming TASKS.md by ~700 lines (236 open tasks remain). - Reconciled the shipped-but-open Phase BT ctxctl bootstrap (marked done; the separate-module deviation noted), un-blocked the lint-style task (ctxctl now exists), and annotated the audit-channel Phase 2 parts the ctxctl migration already shipped. Spec: specs/kb-reindex-nesting.md Signed-off-by: Jose Alekhinne <jose@ctx.ist>
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.
No description provided.