Skip to content

bug: code indexing doesn't work as expected (or at all) #457

@devlsh

Description

@devlsh

What happened?

Code indexing does not work correctly for source-based repo syncs.

There appear to be two related bugs:

  1. gbrain sync --source <id> ignores sources.config.strategy
  2. full / first sync still uses the markdown-only importer even when --strategy code is passed

In practice, this means a repo source configured for code indexing still reports:

Running full import of /path/to/repo...
Found 19 markdown files

and no code symbols become queryable via code-def / code-refs.

What did you expect?

If a source is configured with config.strategy = "code", then:

  • gbrain sync --source <id> should honor that strategy automatically
  • gbrain sync --source <id> --strategy code should perform a full code-aware sync on first/full sync
  • code symbols from the repo should become available through code-def, code-refs, code-callers, and code-callees

Steps to reproduce

  1. Register a repo source:
    gbrain sources add presswork --path /home/luna/code/presswork
  2. Set sources.config.strategy for that source to code (or pass --strategy code explicitly to sync)
  3. Run:
    gbrain sync --source presswork --strategy code
  4. Observe output like:
    Running full import of /home/luna/code/presswork...
    Found 19 markdown files
    
  5. Check symbol retrieval:
    gbrain code-def <KnownSymbol>
    gbrain code-refs <KnownSymbol> --json
  6. Observe that code symbols are missing / empty

Environment

  • gbrain version: (0.21.0, technically 0.22.0 but you didn't change the package.json version on release for that)
  • OS: Linux
  • Bun version: (1.3.13)
  • Database: self-hosted Postgres

gbrain doctor --json output

{"schema_version":2,"status":"warnings","health_score":85,"checks":[{"name":"resolver_health","status":"warn","message":"31 issue(s): 0 error(s), 31 warning(s)","issues":[{"type":"mece_overlap","skill":"citation-fixer, maintain","action":"Add disambiguation rule in RESOLVER.md or narrow triggers in one skill's frontmatter"},{"type":"mece_gap","skill":"backup","action":"Add a triggers: array to the frontmatter of skills/backup/SKILL.md","fix":{"type":"add_frontmatter","file":"/home/luna/.openclaw/skills/backup/SKILL.md","skill_path":"skills/backup/SKILL.md"}},{"type":"mece_gap","skill":"calendar-enrich","action":"Add a triggers: array to the frontmatter of skills/calendar-enrich/SKILL.md","fix":{"type":"add_frontmatter","file":"/home/luna/.openclaw/skills/calendar-enrich/SKILL.md","skill_path":"skills/calendar-enrich/SKILL.md"}},{"type":"mece_gap","skill":"conventional-commits","action":"Add a triggers: array to the frontmatter of skills/conventional-commits/SKILL.md","fix":{"type":"add_frontmatter","file":"/home/luna/.openclaw/skills/conventional-commits/SKILL.md","skill_path":"skills/conventional-commits/SKILL.md"}},{"type":"mece_gap","skill":"discord","action":"Add a triggers: array to the frontmatter of skills/discord/SKILL.md","fix":{"type":"add_frontmatter","file":"/home/luna/.openclaw/skills/discord/SKILL.md","skill_path":"skills/discord/SKILL.md"}},{"type":"mece_gap","skill":"dream-cycle-runtime","action":"Add a triggers: array to the frontmatter of skills/dream-cycle-runtime/SKILL.md","fix":{"type":"add_frontmatter","file":"/home/luna/.openclaw/skills/dream-cycle-runtime/SKILL.md","skill_path":"skills/dream-cycle-runtime/SKILL.md"}},{"type":"mece_gap","skill":"email-enrich","action":"Add a triggers: array to the frontmatter of skills/email-enrich/SKILL.md","fix":{"type":"add_frontmatter","file":"/home/luna/.openclaw/skills/email-enrich/SKILL.md","skill_path":"skills/email-enrich/SKILL.md"}},{"type":"mece_gap","skill":"git","action":"Add a triggers: array to the frontmatter of skills/git/SKILL.md","fix":{"type":"add_frontmatter","file":"/home/luna/.openclaw/skills/git/SKILL.md","skill_path":"skills/git/SKILL.md"}},{"type":"mece_gap","skill":"github","action":"Add a triggers: array to the frontmatter of skills/github/SKILL.md","fix":{"type":"add_frontmatter","file":"/home/luna/.openclaw/skills/github/SKILL.md","skill_path":"skills/github/SKILL.md"}},{"type":"mece_gap","skill":"gog","action":"Add a triggers: array to the frontmatter of skills/gog/SKILL.md","fix":{"type":"add_frontmatter","file":"/home/luna/.openclaw/skills/gog/SKILL.md","skill_path":"skills/gog/SKILL.md"}},{"type":"mece_gap","skill":"gstack-ceo-review","action":"Add a triggers: array to the frontmatter of skills/gstack-ceo-review/SKILL.md","fix":{"type":"add_frontmatter","file":"/home/luna/.openclaw/skills/gstack-ceo-review/SKILL.md","skill_path":"skills/gstack-ceo-review/SKILL.md"}},{"type":"mece_gap","skill":"gstack-investigate","action":"Add a triggers: array to the frontmatter of skills/gstack-investigate/SKILL.md","fix":{"type":"add_frontmatter","file":"/home/luna/.openclaw/skills/gstack-investigate/SKILL.md","skill_path":"skills/gstack-investigate/SKILL.md"}},{"type":"mece_gap","skill":"gstack-office-hours","action":"Add a triggers: array to the frontmatter of skills/gstack-office-hours/SKILL.md","fix":{"type":"add_frontmatter","file":"/home/luna/.openclaw/skills/gstack-office-hours/SKILL.md","skill_path":"skills/gstack-office-hours/SKILL.md"}},{"type":"mece_gap","skill":"gstack-retro","action":"Add a triggers: array to the frontmatter of skills/gstack-retro/SKILL.md","fix":{"type":"add_frontmatter","file":"/home/luna/.openclaw/skills/gstack-retro/SKILL.md","skill_path":"skills/gstack-retro/SKILL.md"}},{"type":"mece_gap","skill":"healthcheck","action":"Add a triggers: array to the frontmatter of skills/healthcheck/SKILL.md","fix":{"type":"add_frontmatter","file":"/home/luna/.openclaw/skills/healthcheck/SKILL.md","skill_path":"skills/healthcheck/SKILL.md"}},{"type":"mece_gap","skill":"jira","action":"Add a triggers: array to the frontmatter of skills/jira/SKILL.md","fix":{"type":"add_frontmatter","file":"/home/luna/.openclaw/skills/jira/SKILL.md","skill_path":"skills/jira/SKILL.md"}},{"type":"mece_gap","skill":"osint-investigator","action":"Add a triggers: array to the frontmatter of skills/osint-investigator/SKILL.md","fix":{"type":"add_frontmatter","file":"/home/luna/.openclaw/skills/osint-investigator/SKILL.md","skill_path":"skills/osint-investigator/SKILL.md"}},{"type":"mece_gap","skill":"skill-vetter","action":"Add a triggers: array to the frontmatter of skills/skill-vetter/SKILL.md","fix":{"type":"add_frontmatter","file":"/home/luna/.openclaw/skills/skill-vetter/SKILL.md","skill_path":"skills/skill-vetter/SKILL.md"}},{"type":"mece_gap","skill":"weather","action":"Add a triggers: array to the frontmatter of skills/weather/SKILL.md","fix":{"type":"add_frontmatter","file":"/home/luna/.openclaw/skills/weather/SKILL.md","skill_path":"skills/weather/SKILL.md"}},{"type":"mece_gap","skill":"x-early-signal-detection","action":"Add a triggers: array to the frontmatter of skills/x-early-signal-detection/SKILL.md","fix":{"type":"add_frontmatter","file":"/home/luna/.openclaw/skills/x-early-signal-detection/SKILL.md","skill_path":"skills/x-early-signal-detection/SKILL.md"}},{"type":"mece_gap","skill":"x-entity-discovery","action":"Add a triggers: array to the frontmatter of skills/x-entity-discovery/SKILL.md","fix":{"type":"add_frontmatter","file":"/home/luna/.openclaw/skills/x-entity-discovery/SKILL.md","skill_path":"skills/x-entity-discovery/SKILL.md"}},{"type":"mece_gap","skill":"x-research-augmentation","action":"Add a triggers: array to the frontmatter of skills/x-research-augmentation/SKILL.md","fix":{"type":"add_frontmatter","file":"/home/luna/.openclaw/skills/x-research-augmentation/SKILL.md","skill_path":"skills/x-research-augmentation/SKILL.md"}},{"type":"mece_gap","skill":"x-seed-intake","action":"Add a triggers: array to the frontmatter of skills/x-seed-intake/SKILL.md","fix":{"type":"add_frontmatter","file":"/home/luna/.openclaw/skills/x-seed-intake/SKILL.md","skill_path":"skills/x-seed-intake/SKILL.md"}},{"type":"mece_gap","skill":"x-topic-watchlists","action":"Add a triggers: array to the frontmatter of skills/x-topic-watchlists/SKILL.md","fix":{"type":"add_frontmatter","file":"/home/luna/.openclaw/skills/x-topic-watchlists/SKILL.md","skill_path":"skills/x-topic-watchlists/SKILL.md"}},{"type":"mece_gap","skill":"xurl","action":"Add a triggers: array to the frontmatter of skills/xurl/SKILL.md","fix":{"type":"add_frontmatter","file":"/home/luna/.openclaw/skills/xurl/SKILL.md","skill_path":"skills/xurl/SKILL.md"}},{"type":"dry_violation","skill":"enrich","action":"Replace inlined rules with a reference to one of: conventions/quality.md, _brain-filing-rules.md"},{"type":"routing_miss","skill":"query","action":"Update routing-eval.jsonl fixture or broaden resolver triggers in RESOLVER.md (no matches)"},{"type":"routing_miss","skill":"query","action":"Update routing-eval.jsonl fixture or broaden resolver triggers in RESOLVER.md (no matches)"},{"type":"routing_miss","skill":"query","action":"Update routing-eval.jsonl fixture or broaden resolver triggers in RESOLVER.md (no matches)"},{"type":"routing_miss","skill":"citation-fixer","action":"Update routing-eval.jsonl fixture or broaden resolver triggers in RESOLVER.md (matched instead: gstack-investigate)"},{"type":"routing_miss","skill":"citation-fixer","action":"Update routing-eval.jsonl fixture or broaden resolver triggers in RESOLVER.md (matched instead: gstack-investigate)"}]},{"name":"skill_conformance","status":"warn","message":"manifest.json not found"},{"name":"connection","status":"ok","message":"Connected, 117 pages"},{"name":"pgvector","status":"ok","message":"Extension installed"},{"name":"rls","status":"ok","message":"RLS enabled on 25/25 public tables"},{"name":"schema_version","status":"ok","message":"Version 29 (latest: 29)"},{"name":"embeddings","status":"ok","message":"100% coverage, 0 missing"},{"name":"graph_coverage","status":"ok","message":"Entity link coverage 93%, timeline 90%"},{"name":"brain_score","status":"ok","message":"Brain score 85/100 (embed 35/35, links 25/25, timeline 4/15, orphans 11/15, dead-links 10/10)"},{"name":"integrity","status":"ok","message":"Sampled 117 pages; 32 external link(s) (no bare tweets)."},{"name":"jsonb_integrity","status":"ok","message":"All JSONB columns store objects/arrays"},{"name":"markdown_body_completeness","status":"ok","message":"No truncated bodies detected"},{"name":"queue_health","status":"ok","message":"No stalled-forever jobs; no queue over depth 10."}]}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions