Auwai

Language depth: current coverage and remaining edges

This note records the language-depth work completed in 0.6.0 and unchanged in 0.7.0, plus the remaining edge cases. The 0.5.0 provider matrix, indented Sass and method-level depth are now implemented; the sections below describe the final mechanics and what is still intentionally out of scope.

Current provider matrix

Family Boundary level Nested members?
python top-level def / class + class methods yes — Class.method, nested classes
go top-level func / type methods are top-level receiver declarations
rust top-level items + impl/trait methods yes — Type::method
java type + constructor/method yes
cpp (C/C++) namespace/type + methods yes for class/struct methods
csharp namespace/type + methods/properties yes
ruby module/class + methods yes
php namespace/type + methods/functions yes
lua function declarations methods via M.foo / M:foo
javascript top-level declarations, React components, class members yes: Class.method
sass indentation-based selectors / at-rules / mixins yes — nested selectors
html landmarks / ids / custom elements n/a
css selectors / at-rules (nested SCSS/Less) yes
sfc (Vue/Svelte/Astro) delegated template/script/style follows the block provider
sql CREATE statements n/a
yaml/hcl/puppet/systemd/shell/markdown grammar-specific sections/blocks n/a

Chunker mechanics

Decl(start, end, label, kind) is a flat boundary hint. Providers may return overlapping ranges; the chunker sorts by start, extends each declaration to the next start, and emits the parent header before its children. That is how a class and its methods coexist without a hierarchy field:

The doctor coverage metric now merges line intervals as a union, so a parent and child cannot double-count. tests/test_depth.py checks that parent headers, qualified children and plan selection survive a small chunk ceiling.

Indented Sass

sass.py parses .sass as an indentation grammar, not as CSS with braces:

  1. Indentation stack. Spaces and tabs are compared with a fixed tab width (TAB_WIDTH = 2); a block ends when indentation returns to its parent.
  2. Selector vs property. A line that has a deeper following code line is a block opener; a line ending in : is a property namespace (for example font: + indented properties) and is not a declaration. A selector such as &:hover is recognised by the deeper block below it.
  3. Multiline selectors. Lines ending in commas are joined until the selector is complete.
  4. Comments. // and /* ... */ comments are masked while preserving line numbers; block comments can span lines.
  5. Directives and mixins. @media, @supports, @mixin, @function, @if, @each, @for and @while become at-rule boundaries; =name mixin definitions become mixin; @include/@extend are statements.
  6. Extents. A block ends at its last nonblank line before dedent, so chunks never claim trailing blank lines.

Fixtures cover nesting, media, mixins, multiline selectors, property namespaces and block comments. .scss and .less remain on the brace-based css provider.

Still out of scope: SassScript expression semantics, @use/@forward module resolution, generated selectors, and a true mixed tab/space policy. The parser treats those as boundary hints and keeps the generic fallback for anything it cannot classify.

Method-level depth: remaining edges

The recommended order is complete:

  1. coverage union — done;
  2. Python class methods — done;
  3. Rust impl/trait methods — done;
  4. JavaScript/TypeScript class members — done;
  5. chunker invariants and a class-heavy plan check — done.

Remaining, intentionally limited cases:

No Decl schema change is required for the current depth. If the map later needs an explicit hierarchy, add optional depth and parent fields and carry them into chunks.jsonl; do that only when a consumer needs them.