Add GeminiAdapter calling Google's Generative Language REST API (default model: gemini-2.5-flash). Register "gemini" as third provider in the factory and CLI. Add rate-limit retry with exponential backoff to the pipeline's _call_llm helper. Increase default max_tokens from 2000 to 4096. Process book-1-chapter-05 via Gemini free tier — 1 new entity extracted (necessaries-conveniencies-and-amusements-of-life), 41 existing entities correctly skipped by dedup. Canonical set now at 42 unique entities. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
40 lines
2.1 KiB
Markdown
40 lines
2.1 KiB
Markdown
# Markitect Infrastructure Tasks
|
|
|
|
Issues discovered while building the infospace-with-history example.
|
|
All three have been fixed in commit `706981c` and the pipeline script
|
|
refactored to use the fixed infrastructure directly.
|
|
|
|
## 1. Artifact Repository does not store content — RESOLVED
|
|
|
|
**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 applied:** Added `content` field to `Artifact` model, `content TEXT`
|
|
column to SQLite schema (with migration for existing DBs), and replaced
|
|
the resolver placeholder with `artifact.content`.
|
|
|
|
## 2. ContentMacro raw_text defaults to empty string — RESOLVED
|
|
|
|
**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 applied:** Added `__post_init__` to `ContentMacro` that auto-derives
|
|
`raw_text = f"@{{{self.target}}}"` when not provided.
|
|
|
|
## 3. No TemplateAnalyzer support for @{target} syntax — RESOLVED
|
|
|
|
**File:** `markitect/prompts/templates/parser.py`
|
|
**Issue:** The MacroParser 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 applied:** Added `SHORTHAND_PATTERN` to `MacroParser` that recognises
|
|
`@{target}` and maps it to `MacroKind.REQUIRED`. Updated `has_macros()`,
|
|
`count_macros()`, and `find_macro_positions()` accordingly.
|