Parent: #398
Depends on: Context Builder MVP and token estimates.
Goal
Add a first, narrow code-map implementation that lets users include signature-only API context for large files at much lower token cost.
Implementation Notes
Do not attempt the full multi-language RepoPrompt code-map system in one issue. Start with a vertical slice, preferably Swift first because AgentHub itself is Swift-heavy.
Suggested first slice:
- signature/API model for one language
- content fingerprint cache
- per-file mode in Context Builder: full / code map / exclude
- assembled
<file_map> section for mapped files
- token estimate uses code-map text instead of full file text
- unsupported languages degrade to full/exclude without crashing
Tree-sitter may be used, but isolate dependencies so the rest of AgentHub does not pay unnecessary build complexity. If adding grammars, include license attribution for vendored grammar dependencies.
Acceptance Criteria
- A large Swift file can be added as code map and contributes signatures without function bodies.
- Code-map token estimate is materially lower than full-file estimate.
- Re-running on unchanged content uses the cache.
- Unsupported files do not crash context assembly.
Tests
Add tests for extraction output, cache invalidation by content fingerprint, fallback behavior, and assembly into the <file_map> section.
Parent: #398
Depends on: Context Builder MVP and token estimates.
Goal
Add a first, narrow code-map implementation that lets users include signature-only API context for large files at much lower token cost.
Implementation Notes
Do not attempt the full multi-language RepoPrompt code-map system in one issue. Start with a vertical slice, preferably Swift first because AgentHub itself is Swift-heavy.
Suggested first slice:
<file_map>section for mapped filesTree-sitter may be used, but isolate dependencies so the rest of AgentHub does not pay unnecessary build complexity. If adding grammars, include license attribution for vendored grammar dependencies.
Acceptance Criteria
Tests
Add tests for extraction output, cache invalidation by content fingerprint, fallback behavior, and assembly into the
<file_map>section.