markitect-main/examples/infospace-with-history/INFRA-TASKS.md

39 lines
1.9 KiB
Markdown
Raw Normal View History

# 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}}`.