feat(infospace): flat canonical entity set with cross-chapter deduplication

Restructure entity storage from per-chapter subdirectories to a flat
canonical set in output/entities/. Each entity exists as a single file;
duplicates across chapters are detected by slug collision and skipped
(first occurrence wins). Chapter views use {{ include }} transclusion
to reference shared entity files.

Add @{existing_entities} macro to extract-entities template so the LLM
knows which entities already exist and focuses on genuinely new ones.
Refactor _call_llm() from _execute_llm() for callers that handle their
own file I/O. 41 unique entities from 4 chapters (2 duplicates removed).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-11 22:24:20 +01:00
parent 706981c39f
commit 2d1282a61e
52 changed files with 1738 additions and 1376 deletions

View File

@@ -20,22 +20,33 @@ but do not exclude entities simply because they lack an obvious mapping.
@{vsm_framework}
## Existing Entities
The following entities have already been extracted from previous chapters
of this work. Do NOT re-extract any of these. If one of these entities
appears in the current chapter, you may omit it entirely — the infospace
already contains it. Only extract entities that are genuinely new.
@{existing_entities}
## Instructions
1. Read the source chapter carefully.
2. Identify all distinct economic concepts, actors, mechanisms, and institutions.
3. For each entity, produce a separate markdown document following the
2. Review the list of existing entities above and do not duplicate them.
3. Identify all distinct economic concepts, actors, mechanisms, and institutions
that are NOT already in the existing entities list.
4. For each new entity, produce a separate markdown document following the
Economic Entity Schema v1.0.
4. Each entity document must include:
5. Each entity document must include:
- An H1 heading with the entity name
- A Definition section (20-150 words)
- A Source Chapter section citing the specific chapter
- A Context section describing where in the argument the entity appears
- An Economic Domain section classifying the entity
5. Optionally include Smith's Original Wording (direct quote) and
6. Optionally include Smith's Original Wording (direct quote) and
Modern Interpretation sections.
6. Use neutral, analytical language throughout.
7. Ensure each entity is distinct and self-contained.
7. Use neutral, analytical language throughout.
8. Ensure each entity is distinct and self-contained.
## Output Format