feat(llm): add LLM integration module with OpenRouter and Claude Code adapters
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>
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
# VSM Mapping Schema v1.0
|
||||
|
||||
Schema definition for entity-to-VSM concept mapping documents.
|
||||
|
||||
## Required Sections
|
||||
|
||||
### Economic Entity Reference
|
||||
The name and identifier of the economic entity being mapped.
|
||||
Must correspond to an existing entity in the entities collection.
|
||||
|
||||
### VSM Concept Reference
|
||||
The name and identifier of the VSM concept being mapped to.
|
||||
Must correspond to an existing concept in the concepts collection.
|
||||
|
||||
### Mapping Rationale
|
||||
A detailed explanation of why this economic entity maps to this VSM concept.
|
||||
Should reference specific properties of both the entity and the concept
|
||||
that justify the mapping (minimum 30 words).
|
||||
|
||||
### Mapping Strength
|
||||
One of:
|
||||
- **Strong**: Direct structural or functional correspondence
|
||||
- **Moderate**: Clear conceptual parallel with some differences
|
||||
- **Weak**: Loose analogy or partial overlap
|
||||
|
||||
## Optional Sections
|
||||
|
||||
### Counter-arguments
|
||||
Reasons why this mapping might be contested or why the entity
|
||||
might not fit the VSM concept perfectly.
|
||||
|
||||
### Alternative Mappings
|
||||
Other VSM concepts this entity could plausibly map to,
|
||||
with brief rationale for each alternative.
|
||||
|
||||
## Validation Rules
|
||||
|
||||
1. The document MUST contain an H1 heading in the format "Entity Name -> VSM Concept Name".
|
||||
2. The document MUST contain all four required sections: Economic Entity Reference, VSM Concept Reference, Mapping Rationale, Mapping Strength.
|
||||
3. The Mapping Strength MUST be one of: Strong, Moderate, Weak.
|
||||
4. The document MUST reference both an economic entity and a VSM concept.
|
||||
Reference in New Issue
Block a user