Implements markitect/llm/ package with concrete LLMAdapter implementations:
- OpenRouterAdapter: HTTP via urllib with retry/backoff on 429/5xx
- ClaudeCodeAdapter: subprocess-based Claude CLI with stdin piping
- Factory pattern: create_adapter("openrouter") or create_adapter("claude-code")
- API key resolution chain: constructor > env var > project-root key file
- 42 unit tests, 2 integration tests (gated on API key / CLI availability)
Also adds the infospace-with-history example with Wealth of Nations VSM
analysis pipeline, templates, schemas, source chapters, and processed
output for chapters 1-2. process_chapters.py now supports --provider
and --model flags for automatic LLM-driven processing.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
39 lines
1.9 KiB
Markdown
39 lines
1.9 KiB
Markdown
# Markitect Infrastructure Tasks
|
|
|
|
Issues discovered while building the infospace-with-history example.
|
|
These should be addressed in the markitect infrastructure, then the
|
|
experiment re-run.
|
|
|
|
## 1. Artifact Repository does not store content
|
|
|
|
**File:** `markitect/prompts/resolver/resolver.py`, line 147-148
|
|
**Issue:** `content = f"[Content of {artifact.name} from {space_id}]"` — the
|
|
resolver returns placeholder text instead of actual artifact content because
|
|
the SQLiteArtifactRepository stores metadata (digest, name, type) but not
|
|
the content itself.
|
|
**Impact:** Consumers must maintain their own content cache alongside the
|
|
repository, defeating the purpose of centralised artifact storage.
|
|
**Fix:** Add a `content` column to the artifacts table, or use a separate
|
|
content-addressable store keyed by digest.
|
|
|
|
## 2. ContentMacro raw_text defaults to empty string
|
|
|
|
**File:** `markitect/prompts/templates/models.py`, line 46
|
|
**Issue:** `raw_text: str = ""` — when macros are constructed programmatically
|
|
(not parsed from template text), `raw_text` defaults to `""`. The
|
|
ContextCompiler then calls `str.replace("", resolved.content)` which inserts
|
|
content between every character, producing multi-gigabyte output.
|
|
**Impact:** Silent data corruption; compiled prompts become unusable.
|
|
**Fix:** Either require `raw_text` in the constructor, or derive it
|
|
automatically from `target` (e.g., `raw_text = f"@{{{target}}}"` if not
|
|
provided).
|
|
|
|
## 3. No TemplateAnalyzer support for @{target} syntax
|
|
|
|
**File:** `markitect/prompts/templates/analyzer.py`
|
|
**Issue:** The TemplateAnalyzer parses `{{kind:target}}` syntax but the
|
|
templates in this example use the simplified `@{target}` syntax. There's
|
|
no automatic parsing for this format, requiring manual macro construction.
|
|
**Fix:** Add `@{target}` as a recognised shorthand syntax in the analyzer,
|
|
auto-detecting it as `{{require:target}}`.
|