Skip to content

feat(codebase): integrate team-wiki knowledge graph engine#46

Open
m0Nst3r873 wants to merge 5 commits into
Tencent:mainfrom
m0Nst3r873:feat/code-knowledge-graph
Open

feat(codebase): integrate team-wiki knowledge graph engine#46
m0Nst3r873 wants to merge 5 commits into
Tencent:mainfrom
m0Nst3r873:feat/code-knowledge-graph

Conversation

@m0Nst3r873

Copy link
Copy Markdown
Contributor

Summary

Replace AI-generated docs/team-codebase/ with structured teamwiki/ knowledge graph.

New capabilities

  • teamai codebase --extract: deterministic code fact extraction (7 languages)
  • teamai recall: BM25 + graph-boost codebase retrieval
  • teamai codebase --lint: graph health check
  • Module summaries + AI overview + knowledge gaps
  • Cross-repo edge detection
  • Pull protection for local changes

Architecture

  • src/wiki-engine/: vendored from team-wiki (by @lurkacai)
  • teamwiki/ directory with router.md, hot.md, index.md, evidence/, .indices/, gaps/

Test plan

  • tsc zero errors, 1436 tests pass
  • E2E: import --from-org (11 repos, 2218 nodes)
  • E2E: MR CI pipeline on real TGit repo

Replace AI-generated docs/team-codebase/ with structured teamwiki/
knowledge graph. Vendor team-wiki's code-knowledge + core packages
(by @lurkacai) as the deterministic extraction engine.

New capabilities:
- `teamai codebase --extract`: code fact extraction (TS/Python/Go/Rust/Java/TOML/SQL)
- `teamai recall`: BM25 + graph-boost codebase retrieval
- `teamai codebase --lint`: graph health check
- `teamai codebase --upgrade-wiki`: migration from old format
- Module summaries with dependency direction and ranked components
- Knowledge gaps detection (IMPL_MISSING, LOW_CONNECTIVITY, etc.)
- Cross-repo edge detection via PascalCase label + config key matching
- AI overview.md generation (non-blocking on timeout)
- Pull protection: skip overwrite when local teamwiki/ is newer

Architecture:
- src/wiki-engine/: vendored core (graph schema, protocol) + code-knowledge
  (collector, extractors, graph builder, incremental detection)
- src/wiki-engine/adapters/: teamai-specific bridge + shared templates
- teamwiki/ directory (non-hidden) with router.md, hot.md, index.md,
  evidence/, .indices/, gaps/, modules/
Document the codebase knowledge graph output format with real data
from HAI team (11 repos, 2218 nodes, 852 edges). Explains each
file's purpose: router.md, graph-index.json, evidence pages,
relation pages, and gaps detection.
- Hide 10 hook-only commands from --help (hook-dispatch, track,
  auto-recall, contribute-check, etc.) — still functional, just hidden
- Hide domains command (replaced by knowledge graph edges)
- Simplify import options: show 8 core options, hide 17 advanced ones
- Simplify codebase options: show --lint/--fix/--json, hide rest
- Streamline README command table: core commands visible, rest in
  collapsible section (EN + CN)
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