Skip to content

fix(import): run reconcile and deep enrich in --dir mode - #362

Merged
jeff-r2026 merged 1 commit into
Tencent:mainfrom
m0Nst3r873:fix/dir-deep-enrich
Aug 28, 2026
Merged

jeff-r2026 merged 1 commit into
Tencent:mainfrom
m0Nst3r873:fix/dir-deep-enrich

Conversation

@m0Nst3r873

Copy link
Copy Markdown
Collaborator

Summary

import --dir extracted code knowledge but stopped short of the reconcile and deep-enrich stages that --from-repo runs. As a result, local-directory imports produced only shallow evidence — no per-component design docs, no architecture overview, and no AI graph docs (G5/G6).

This PR adds the reconcile → deep-enrich stages to both --dir sub-paths, mirroring the --from-repo pipeline:

  • --output sub-path (writes to a target dir, no push) — enriches against the output teamwiki/.
  • default team-repo push sub-path — enriches against the team repo teamwiki/, before aggregateGlobalGraph/rebuildWikiIndex/push, so all content lands in one MR.

The shared logic is factored into a reconcileAndDeepEnrich helper to avoid duplication across the two sub-paths.

Behavior guards (unchanged from --from-repo):

  • Deep enrich runs only when AI enrichment produced a _manifest.json and --skip-enrich is not set.
  • Both stages are non-blocking — failures are logged at debug level and never abort the import.

Test Plan

  • npx tsc --noEmit — clean
  • npm run build — success
  • npx vitest run src/__tests__/import-org.test.ts — pass
  • Real e2e: teamai import --dir <sample> --output <tmp> against a multi-service sample codebase — log confirms the ordering AI enrich → reconcile → deep-enrich Phase 1–5 → Deep enrich complete, and the enriched artifacts (docs/architecture.md, per-component design doc, G1/G2/G3/G6 graph docs, _manifest.json) are written under evidence/code/<slug>/.

Note: --dir --output was used for e2e so the run stays fully local (no team-repo push).

🤖 Generated with Claude Code

The `import --dir` flow extracted code knowledge but stopped short of the
reconcile and deep-enrich stages that `--from-repo` runs, so local-directory
imports produced only shallow evidence without component design docs, the
architecture overview, or the AI graph docs (G5/G6).

Add the reconcile -> deep-enrich stages to both --dir sub-paths (--output and
the default team-repo push), mirroring the --from-repo pipeline, and factor the
shared logic into a `reconcileAndDeepEnrich` helper to avoid duplication. Deep
enrich still runs only when AI enrichment produced a _manifest.json and
--skip-enrich is not set; both stages remain non-blocking.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@jeff-r2026
jeff-r2026 merged commit d7ea457 into Tencent:main Aug 28, 2026
7 checks passed
Walternater pushed a commit to Walternater/teamai-cli that referenced this pull request Nov 2, 2026
The `import --dir` flow extracted code knowledge but stopped short of the
reconcile and deep-enrich stages that `--from-repo` runs, so local-directory
imports produced only shallow evidence without component design docs, the
architecture overview, or the AI graph docs (G5/G6).

Add the reconcile -> deep-enrich stages to both --dir sub-paths (--output and
the default team-repo push), mirroring the --from-repo pipeline, and factor the
shared logic into a `reconcileAndDeepEnrich` helper to avoid duplication. Deep
enrich still runs only when AI enrichment produced a _manifest.json and
--skip-enrich is not set; both stages remain non-blocking.
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