Skip to content

feat(codebase): deep-enrich + graph-aware recall + team-wiki-codebase skill - #56

Merged
jeff-r2026 merged 1 commit into
Tencent:mainfrom
m0Nst3r873:feat/deep-enrich-v2
Jun 29, 2026
Merged

feat(codebase): deep-enrich + graph-aware recall + team-wiki-codebase skill#56
jeff-r2026 merged 1 commit into
Tencent:mainfrom
m0Nst3r873:feat/deep-enrich-v2

Conversation

@m0Nst3r873

@m0Nst3r873 m0Nst3r873 commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

Part 3 of 3. Depends on #55 (feat/import-enrichment-v2).

  • deep-enrich.ts: Background AI knowledge generation (component design docs + architecture overview + graph docs G1-G3) with resume support via _review/progress.json
  • code-knowledge-recall.ts: BM25 + graph-boost retrieval engine for teamwiki/ knowledge graph
  • codebase-upgrade-wiki.ts: Migration from docs/team-codebase/ to teamwiki/ format
  • codebase-wiki-lint.ts: Graph health diagnostics (connectivity, orphans, staleness)
  • team-wiki-codebase skill bundle (909-line methodology)
  • CI: MR comment API + graph change detection
  • Recall: --depth option (route/context/lookup), graph-aware agent instructions, model_hint

Critical recall pipeline fixes

Fix Description
B8 Graph boost was dead code — path format mismatch. Fixed via slug/title matching.
B10 BM25 dl used deduplicated token count → broke length normalization. Fixed.
B11 BM25 scores (20-50+) always dominated learnings (0-10). Added normalization.
B14 CJK queries couldn't match Chinese text. Added bigram segmentation.
B24 Graph boost extended to 2-hop neighbors (halved weight).
B25 deep-enrich concurrency 2→5.
camelCase splitting in tokenizer (getUserById → get, user, by, id).

How it's reachable

  • teamai deep-enrich --project <slug> → generate docs/*.md
  • teamai codebase --lint (when teamwiki/ exists) → wiki-lint health check
  • teamai codebase --upgrade-wiki → migrate legacy format
  • teamai recall --depth lookup <query> → graph-boosted retrieval

Test plan

  • npx tsc --noEmit — zero errors
  • npx vitest run — 1505 tests passed

Dependency chain

#55 (AI enrichment) → PR 3 (this)

Replaces #52 + #53.

… skill

Complete code knowledge pipeline with AI-powered deep generation and
graph-boosted retrieval.

Base layer (wiki-engine + enrichment, same as PR Tencent#55):
- Deterministic code extraction pipeline (5-language extractors)
- AI enrichment + knowledge reconciler + manifest compiler
- Wiki index rebuild with domain grouping

Deep-enrich (this PR's additions):
- deep-enrich.ts: background AI knowledge generation with resume support
  and --max-modules cost control
- code-knowledge-recall.ts: BM25 + graph-boost retrieval engine with
  CJK bigram segmentation and camelCase splitting
- codebase-upgrade-wiki.ts: migration from docs/team-codebase/ to teamwiki/
- codebase-wiki-lint.ts: graph health diagnostics

Recall improvements:
- --depth option (route/context/lookup) with per-level descriptions
- Graph boost via slug/title matching (fixes dead-code path mismatch)
- BM25 normalization to prevent score domination over learnings
- 2-hop neighbor extension for graph edges

Integration:
- CI: MR comment API + graph change detection
- import-iwiki.ts: iWiki document import
- team-wiki-codebase skill bundle (methodology + agent prompts)
- Security hardening (shell-quote, JSON parse guards, path validation)

Tests: restore 3 import-org tests (replace stale clusterRepos assertions)
@m0Nst3r873
m0Nst3r873 force-pushed the feat/deep-enrich-v2 branch from 52bfa84 to fe43de4 Compare June 29, 2026 04:05
@jeff-r2026
jeff-r2026 merged commit 9851ffa into Tencent:main Jun 29, 2026
7 checks passed
@m0Nst3r873
m0Nst3r873 deleted the feat/deep-enrich-v2 branch June 29, 2026 06:15
@hsuchifeng hsuchifeng mentioned this pull request Jul 3, 2026
3 tasks
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.

2 participants