aba35f9f4a
Per user feedback (2026-06-06): instead of a follow-up 'TypedDict Migration' track, add a NEW deliverable: an auto-generated type registry in docs/type_registry/ that captures the field information in docs form. New files: - scripts/generate_type_registry.py (NEW): AST-based tool that reads src/ and writes per-source-file .md files with the fields of every @dataclass, NamedTuple, TypeAlias, TypedDict. Has --check (CI mode, exits 1 if registry would change) and --diff (dry run) modes. - docs/type_registry/ (NEW, generated): index.md + per-source-file references (type_aliases.md, ai_client.md, models.md, etc.). - tests/test_generate_type_registry.py (NEW): verify the generator. Architecture updates: - Section 3.6 (NEW): Type Registry architecture with example output. - Section 3.7 (NEW): Why per-source-file docs (locality of reference). - Section 1.1 (NEW): 'Why docs over TypedDict' analysis (3 reasons: lower upfront cost, better fit for AI workflow, auto-maintained). - Goals table: registry added as a C (innovation) goal. - Module layout: docs/type_registry/ and scripts/generate_type_registry.py added to the new files list. - Migration: Phase 2 now includes the registry generator + initial docs. - Out of scope: TypedDict migration REMOVED; 'auto-typing the field shape' added with the docs as the chosen approach. - See Also: TypedDict follow-up REPLACED with 'Registry Maintenance & CI Integration' (smaller scope, just wires the generator into CI). The 'cost we eat' is the LLM reading 200-500 lines of markdown per query. This is bounded and proportional to actual information need. The upfront cost of designing TypedDict schemas for every type is unbounded. Tradeoffs favor the docs approach for v1; TypedDict can come later as a future track if desired.