Skip to content

feat: add model index routing - #35

Draft
damusix wants to merge 1 commit into
mainfrom
worktree-model-index-routing
Draft

feat: add model index routing#35
damusix wants to merge 1 commit into
mainfrom
worktree-model-index-routing

Conversation

@damusix

@damusix damusix commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Generates a navigable index.md router into every organizing folder of a model root, with digests that roll up to the root so ignatius validate --index catches drift, and optional in-folder agent guidance via index --agents. Design: docs/design/model-index-routing.md. Contract: docs/spec/model-index-routing.md.

models/llm-memory-db-mssql/ is the fully realized example: description: on all 74 authored files, routers carrying real routing text, and the three guidance files. Start at its index.md.

Decisions worth a second opinion

  • index.stale is Class B, so a stale router fails the build. The flag is opt-in and the fix is one command.
  • A line starting with <ignatius- inside a generated file is always a region boundary, and column-0 boundaries must pair open and close by name. To mention a tag in a hand-authored rules block, indent the line or write &lt;ignatius-index&gt;. Three delimiter-based exemptions (fence, inline code, full containment) each let real markup hide, twice as silent truncation; a position cannot be accidental.
  • Key style is derived structurally: a single-column PK is surrogate unless its entity sources an identifying edge, and mixed needs the minority signature above a 20% share. The mssql model resolves mixed, matching its own ignatius.yml comment.
  • index creates flows/, externals/, and stores/ for models that lack them, so orm-pure and orm-hybrid gained empty registries. Skip absent registries, or accept the directories.
  • harness: auto walks to /, and ~/.claude exists on any Claude Code machine, so every model under $HOME resolves to Claude. Bound the walk at the git root, or document it.
  • The commit ends with a Claude-Session: trailer from a session-level directive that overrode the repo's no-attribution rule. Amend before merge, or accept.
  • An unreadable router target is reported only by validate --index, not by index itself.

@damusix damusix changed the title feat: model index routing feat: add model index routing Sep 6, 2026
Every organizing folder of a model root gets a generated index.md
router: a table of the folder's children with name, kind, description,
and a relative link, so a reader descends root → group → entity
through small tables instead of globbing the tree. Per-file hashes
roll up into folder digests and a root digest; `validate --index`
reports drift as a Class B finding. `index --agents` adds an
in-folder AGENTS.md, a CLAUDE.md shim, and SKILL.md so the folder
orients any agent that opens it, written only inside the model root.

Routers mirror the filesystem, not declared groups: `group:` is
declarative and a model may keep entities flat, so paths come from the
parser's discovered sourcePath. The generator owns only the bytes inside
its own <ignatius-*> tags, so hand-authored <ignatius-rules> blocks and
an existing CLAUDE.md survive regeneration. A tag is a region boundary
only at column 0 ending its line; anywhere else it is text, since a
delimiter can be accidental and a position cannot. SKILL.md frontmatter
is the one exception to region-only writes, because the harness needs
it to discover the skill.

`description:` is a new top-level field on all five file kinds and is
the router's payload. The reserved index_file name is skipped by every
scan. models/llm-memory-db-mssql is the fully realized exemplar.

Claude-Session: https://claude.ai/code/session_019fHbm44mjjSyPgGaFh81T9
@damusix
damusix force-pushed the worktree-model-index-routing branch from 72074da to 85a6a59 Compare September 6, 2026 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant