Type: refactor / consistency · Difficulty: medium
The active flat-folder ingestion casts LLM JSON with as T and hand-shapes fields, while the concept-graph path already validates with Zod (concept-graph/phases/enrich-one-file.ts:122 via perFileEnrichmentSchema.safeParse). CLAUDE.md Rule of LLM Provider requires LLM output validated against a schema before use.
Files: packages/llm/src/jsonClient.ts:24 (JSON.parse(...) as T), packages/ingest-github/src/adapters/llm-file-analyzer.ts:48, packages/ingest-github/src/strategies/flat-folder/repo-summary.ts:107.
Do: add Zod schemas for file-analysis and repo-summary outputs and safeParse them, mirroring concept-graph/enrichment-schema.ts.
Done when: both flat-folder LLM calls parse through a schema; malformed output is rejected/normalized, not cast.
Type: refactor / consistency · Difficulty: medium
The active flat-folder ingestion casts LLM JSON with
as Tand hand-shapes fields, while the concept-graph path already validates with Zod (concept-graph/phases/enrich-one-file.ts:122viaperFileEnrichmentSchema.safeParse). CLAUDE.md Rule of LLM Provider requires LLM output validated against a schema before use.Files:
packages/llm/src/jsonClient.ts:24(JSON.parse(...) as T),packages/ingest-github/src/adapters/llm-file-analyzer.ts:48,packages/ingest-github/src/strategies/flat-folder/repo-summary.ts:107.Do: add Zod schemas for file-analysis and repo-summary outputs and
safeParsethem, mirroringconcept-graph/enrichment-schema.ts.Done when: both flat-folder LLM calls parse through a schema; malformed output is rejected/normalized, not cast.