Repository navigation
fix(codebase): write fallback evidence manifest so deep-enrich can start - #522
Merged
jeff-r2026 merged 1 commit intoSep 12, 2026
Merged
Conversation
Extract now writes teamwiki/evidence/code/<project>/_manifest.json from module or component facts when AI enrichment is skipped, fails, or finds no qualifying modules. Public empty-manifest errors no longer tell the user to re-run extract. Hidden teamai deep-enrich exits non-zero when there are no components. Fixes Tencent#508.
5 of 9 tasks
Walternater
pushed a commit
to Walternater/teamai-cli
that referenced
this pull request
Nov 2, 2026
…art (Tencent#522) Extract now writes teamwiki/evidence/code/<project>/_manifest.json from module or component facts when AI enrichment is skipped, fails, or finds no qualifying modules. Public empty-manifest errors no longer tell the user to re-run extract. Hidden teamai deep-enrich exits non-zero when there are no components. Fixes Tencent#508.
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
codebase --extractreportedkind === 'component'facts but only wroteteamwiki/evidence/code/<project>/_manifest.jsonwhen AI enrichment succeeded. Small repos (no module with>= 5facts),--skip-enrich, and AI failures left that file missing, sodeep-enrichaborted withNo components in _manifest.jsonwhile--lintstill passed.Extract now always writes a usable v2 evidence manifest when it has modules or component facts: AI output when enrich succeeds, otherwise a deterministic fallback (
components[]withslug/docPath). User-facing English /--jsonoutput says when the fallback was written, or that deep-enrich will have no components when nothing can be written. Public empty-manifest errors no longer say to re-run extract. Hiddenteamai deep-enrichexits non-zero when there are no components (previously exit 0).Option C (lowering the
>= 5facts AI threshold) is intentionally not done; fallback covers that case without changing when AI is called.Fixes #508.
Type of Change
Test Plan
npx tsc --noEmit— cleannpx vitest run— 218 files / 3017 tests passednpx vitest run src/__tests__/codebase-extract-fallback.test.ts src/__tests__/codebase-deep-enrich.test.ts src/__tests__/deep-enrich-graph-preserve.test.ts src/__tests__/import-dir.test.ts— 31/31 (includes Widget fixture,--skip-enrich, AI-fail, AI-success not overwritten, hidden after extract, empty-manifest exit 1)npm run buildthennpx vitest run --config vitest.e2e.config.ts src/__tests__/e2e/codebase-extract-cli.test.ts— 9/9node dist/index.js codebase --extract <fixture> --project widget— exit 0,Facts: 1 (component:1),Wrote fallback _manifest.json (1 component, no AI enrich), bothsource-manifest.jsonandevidence/code/widget/_manifest.jsonpresent (components[0].slug+docPathset)node dist/index.js deep-enrich --project widget --wiki-root <fixture>/teamwiki— startsPhase 1 — Generating 1 component design docs, does not abort withNo components in _manifest.jsonnode dist/index.js codebase --lint --output <fixture>— exit 0,✓ 无问题teamai deep-enrich --project widget --wiki-root <empty>— exit 1,No components in _manifest.json, abortingteamai codebase --deep-enrich --project widget --output <empty>— exit 1,No components in _manifest.json for project "widget"., does not sayRun extract firstgit diff --check— cleanCLI test report
_manifest.jsonsource-manifest.jsonstill writtendeep-enrichafter extract does not abort--linton the same tree_manifest.jsonexits 1Related Issues
Fixes #508.
Notes for Reviewers
srcforsrc/widget.ts). If there are no modules, it useskind === 'component'fact names.AI enrich: N modules, domain=...).teamai deep-enrichnow setsprocess.exitCode = 1whenever the engine returnscomplete: false(empty manifest or missing AI docs), matching the public command from fix(deep-enrich): retry missing AI docs after temporary failures #491. Import still callsdeepEnrich()directly and does not use that wrapper.import --dir/--from-repowill now run deep-enrich on small repos because a fallback_manifest.jsonexists;--skip-enrichstill skips that stage.