feat(codebase): wiki-engine extraction + AI enrichment + knowledge reconciler - #55
Merged
Merged
Conversation
This was referenced Jun 26, 2026
m0Nst3r873
force-pushed
the
feat/import-enrichment-v2
branch
from
June 29, 2026 03:04
f2dcc2f to
492b8f2
Compare
m0Nst3r873
pushed a commit
to m0Nst3r873/teamai-cli
that referenced
this pull request
Jun 29, 2026
… 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
pushed a commit
to m0Nst3r873/teamai-cli
that referenced
this pull request
Jun 29, 2026
… 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)
…conciler Deterministic code knowledge pipeline: extract → enrich → reconcile → compile → index. Wiki-engine modules: - Interface scanner (HTTP/MQ/RPC, 5 languages) - Dependency path tracer + code-graph overlay - Doc-graph extractor + manifest schema Extraction pipeline (teamai codebase --extract): - Code collector with priority sorting + incremental mode - Per-language extractors (TS/Go/Java/Python/Rust/Config) - Graph-index builder + evidence page renderer AI enrichment layer: - enrich-with-ai.ts: per-module responsibility inference - knowledge-reconciler.ts: 9-phase product↔code cross-mapping - manifest-compiler.ts: structured component docs with wiki-links - rebuild-wiki-index.ts: domain-grouped router.md + stats index.md Import integration: - import-repo: full pipeline (extract + enrich + compile + reconcile) - import-org: simplified whitelist-based flow (no AI clustering) - Remove legacy domain classification (domains.yaml) Tests: 39 new unit tests for wiki-engine modules + hook-output
m0Nst3r873
force-pushed
the
feat/import-enrichment-v2
branch
from
June 29, 2026 03:26
492b8f2 to
e31c518
Compare
m0Nst3r873
pushed a commit
to m0Nst3r873/teamai-cli
that referenced
this pull request
Jun 29, 2026
… 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
pushed a commit
to m0Nst3r873/teamai-cli
that referenced
this pull request
Jun 29, 2026
… 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)
jeff-r2026
pushed a commit
that referenced
this pull request
Jun 29, 2026
… skill (#56) Complete code knowledge pipeline with AI-powered deep generation and graph-boosted retrieval. Base layer (wiki-engine + enrichment, same as PR #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) Co-authored-by: jaelgeng <jaelgeng@tencent.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Full deterministic code knowledge pipeline: extract → enrich → reconcile → compile → index.
Part 1 of 2 — this PR is functionally complete. PR #56 builds on top (deep-enrich + recall + skill).
Phase 1: Wiki-engine + code extraction pipeline
codebase-extract.ts: full pipeline (collect → extract facts → build graph → write evidence pages + overview.md)teamai codebase --extract [path]with--incremental,--project,--max-filesoverview.md,graph-index.json,router.md,index.md,gaps/detected.mdPhase 2: AI enrichment + reconciler + wiki index
enrich-with-ai.ts: Per-module AI responsibility inference + repo-level domain classificationknowledge-reconciler.ts: 9-phase product↔code cross-mapping with confidence scoringmanifest-compiler.ts: Compile AI-enriched manifest into structured component docs with wiki-linksrebuild-wiki-index.ts: Domain-groupedrouter.md+ stats-enrichedindex.mddomains.yaml)How it's reachable (no dead code)
teamai import --from-repo <url>→ extractCodebase + enrichWithAI + compileFromManifest + reconcileKnowledgeteamai import --from-org <org>→ batch import + rebuildWikiIndexteamai codebase --extract .→ enrichWithAI + compiledocs/<slug>.mdQuality fixes
.indices/evidence/code/prefix)teamwikito safeIgnorecompileFromManifest()into pipeline (was dead code)GraphIndexoverview.mdwithout AIkind:name/v\d*/prefixTest plan
npx tsc --noEmit— zero errorsnpx vitest run— all tests passedteamai codebase --extract .producesteamwiki/evidence/code/<project>/teamai import --from-repo <url>runs full pipeline end-to-endDependency chain
Replaces #50 and #51. Subsumes #54 (now closed).