gbrain sync ingests files and assigns slugs to each
page. The slug strips file extensions:
docs/auth.md → docs/auth
README.md → readme
_superstack/docs/code-map.md → _superstack/docs/code-map
src/auth/users.ts → src-auth-users-ts (different
shape entirely — flattened to dashes)
The TypeScript case is more aggressive: directory
separators become dashes AND the extension becomes part
of the slug (-ts suffix).
This makes slug-pattern filtering brittle. A consumer
wanting "all markdown documentation pages" can't filter
by *.md because the slug doesn't have .md. They have
to either:
- Filter by negation (
-ts, -json, -yaml slug
suffixes for code/config files)
- Cross-reference against the page-type column from
gbrain list (which reports code, note, concept)
- Detect prose-vs-code by inspecting chunk preview
content (Superstack's schema-tracker v2 settled on
this approach)
Expected: slugs preserve the original file
extension, OR the ingested page exposes a mime_type
or extension field queryable via gbrain list.
Suggested fix (least disruptive): add an
extension column to the pages table populated from
the source file. gbrain list could surface it as a
flag; query results could include it in JSON output.
The existing slug shape stays for backwards-
compatibility.
Reproduction:
echo "# Test" > /tmp/test.md
mkdir /tmp/test-project && cp /tmp/test.md /tmp/test-project/
cd /tmp/test-project && git init -q && git add -A && git commit -qm init
gbrain sources add slug-demo --path /tmp/test-project
OPENAI_API_KEY=sk-... gbrain sync --source slug-demo --strategy auto
gbrain list --source slug-demo
# observed: slug is "test", not "test.md"
Severity: low individually; medium when combined
with downstream parsers that need to distinguish prose
from code (which Superstack's gbrain-using subagents do).
gbrain syncingests files and assigns slugs to eachpage. The slug strips file extensions:
docs/auth.md→docs/authREADME.md→readme_superstack/docs/code-map.md→_superstack/docs/code-mapsrc/auth/users.ts→src-auth-users-ts(differentshape entirely — flattened to dashes)
The TypeScript case is more aggressive: directory
separators become dashes AND the extension becomes part
of the slug (
-tssuffix).This makes slug-pattern filtering brittle. A consumer
wanting "all markdown documentation pages" can't filter
by
*.mdbecause the slug doesn't have.md. They haveto either:
-ts,-json,-yamlslugsuffixes for code/config files)
gbrain list(which reportscode,note,concept)content (Superstack's
schema-trackerv2 settled onthis approach)
Expected: slugs preserve the original file
extension, OR the ingested page exposes a
mime_typeor
extensionfield queryable viagbrain list.Suggested fix (least disruptive): add an
extensioncolumn to thepagestable populated fromthe source file.
gbrain listcould surface it as aflag; query results could include it in JSON output.
The existing slug shape stays for backwards-
compatibility.
Reproduction:
Severity: low individually; medium when combined
with downstream parsers that need to distinguish prose
from code (which Superstack's gbrain-using subagents do).