You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.astro files are skipped by gbrain sync --strategy code because the extension isn't in CODE_EXTENSIONS at src/core/sync.ts:46-75. Astro projects (a popular static-site framework — official template count is in the low thousands on GitHub) have most of their app surface in .astro files; gbrain currently treats them as invisible.
Note .vue is included (Vue single-file components). .astro is the structural equivalent for Astro: a top frontmatter block (TypeScript) plus a JSX-like template body. Same single-file-component shape, same need for code-aware indexing.
The comment at line 35-44 says this allowlist is "kept as-is for now for isAllowedByStrategy fast-path + tests" while detectCodeLanguage is the long-term source of truth — so .astro may also need adding to whatever map detectCodeLanguage uses, depending on which one wins at runtime.
Suggested fix
Add .astro to CODE_EXTENSIONS:
'.vue','.astro',
Tree-sitter doesn't ship a first-party Astro grammar, but the existing fallback path that handles .vue and .html should chunk .astro reasonably (frontmatter as TS-ish, body as HTML-ish). If a richer parse is wanted later, @astrojs/compiler exposes a tokenizer that returns spans usable by the chunker.
Why it matters
Astro is the framework behind many docs sites and Field-CTO-style personal hubs (this repo is one — bradshaw.cloud). Without .astro support, gbrain code-def / code-refs / code-callers return empty for the bulk of the app code, even after the source-routing bug in #457 is fixed.
bug: code indexing doesn't work as expected (or at all) #457 (source-routing + --strategy code ignored). My v0.28.7 reproduction comment on that issue surfaced this gap as adjacent. Filing separately per the maintainer's labeling cadence — this one is small enough to be a good-first-issue candidate.
Summary
.astrofiles are skipped bygbrain sync --strategy codebecause the extension isn't inCODE_EXTENSIONSatsrc/core/sync.ts:46-75. Astro projects (a popular static-site framework — official template count is in the low thousands on GitHub) have most of their app surface in.astrofiles; gbrain currently treats them as invisible.Repro
(
InsightLayoutis defined insrc/layouts/InsightLayout.astro— invisible to the walker.)Root cause
src/core/sync.ts:46-75declares the allowlist:Note
.vueis included (Vue single-file components)..astrois the structural equivalent for Astro: a top frontmatter block (TypeScript) plus a JSX-like template body. Same single-file-component shape, same need for code-aware indexing.The comment at line 35-44 says this allowlist is "kept as-is for now for
isAllowedByStrategyfast-path + tests" whiledetectCodeLanguageis the long-term source of truth — so.astromay also need adding to whatever mapdetectCodeLanguageuses, depending on which one wins at runtime.Suggested fix
Add
.astrotoCODE_EXTENSIONS:Tree-sitter doesn't ship a first-party Astro grammar, but the existing fallback path that handles
.vueand.htmlshould chunk.astroreasonably (frontmatter as TS-ish, body as HTML-ish). If a richer parse is wanted later,@astrojs/compilerexposes a tokenizer that returns spans usable by the chunker.Why it matters
Astro is the framework behind many docs sites and Field-CTO-style personal hubs (this repo is one — bradshaw.cloud). Without
.astrosupport,gbrain code-def/code-refs/code-callersreturn empty for the bulk of the app code, even after the source-routing bug in #457 is fixed.Environment
.astrofiles)Related
--strategy codeignored). My v0.28.7 reproduction comment on that issue surfaced this gap as adjacent. Filing separately per the maintainer's labeling cadence — this one is small enough to be a good-first-issue candidate.