Kontextual Engine Integration Boundary

This commit is contained in:
2026-05-14 16:43:29 +02:00
parent e78e5d8f43
commit 5d53c33d3e
16 changed files with 500 additions and 6 deletions

View File

@@ -28,6 +28,7 @@ Start with:
- `docs/successor-boundary-interface-map.md`
- `docs/replacement-acceptance-matrix.md`
- `infospaces/bootstrap-pilot/`
- `infospaces/wealth-vsm-legacy-slice/`
- `workplans/`
Current development command:

View File

@@ -28,7 +28,7 @@ considered a replacement for each in-scope legacy infospace behavior from
| Process source chapters | Explicit infospace workflow stages | Deterministic runner tests, generated artifact provenance | `IB-WP-0009` | deterministic baseline done |
| Track stale outputs | Digest/provenance comparison | Tests after workflow provenance exists | `IB-WP-0009` | deferred |
| Persist durable assets | Optional engine-backed repository adapter | Dry-run sync tests and integration design | `IB-WP-0010` | boundary done |
| Run a legacy-derived pilot | Pruned `infospace-with-history` migration | Pilot corpus, migration report, parity comparison | `IB-WP-0011` | planned |
| Run a legacy-derived pilot | Pruned `infospace-with-history` migration | Pilot corpus, migration report, parity comparison | `IB-WP-0011` | done |
| Provide command migration path | Legacy command parity guide | Command table and examples | `IB-WP-0012` | planned |
## Replacement Gates

View File

@@ -0,0 +1,25 @@
# Division of Labour
## Definition
The separation of a work process into distinct tasks performed by specialised workers, increasing productivity through greater dexterity, saved time, and the invention of labour-saving machinery, originally arising from the propensity to truck, barter, and exchange.
## Source Chapter
Book I, Chapter 2
## Context
The chapter's central concept, described as the necessary consequence of human propensity to exchange, which allows individuals to specialise in particular occupations and thereby increase overall productivity and wealth.
## Economic Domain
Production
## Original Wording
Smith describes the division of labour as arising from the power of exchange and as a source of increased productive powers.
## Modern Interpretation
Specialisation increases throughput by improving skill, reducing switching costs, and encouraging process innovation.

View File

@@ -0,0 +1,25 @@
# Market Extent
## Definition
The geographical and economic reach of a market, determining the potential size of demand for goods and services. The extent of the market directly limits the degree to which division of labour can be developed, as a larger market provides greater opportunity for exchange and specialisation.
## Source Chapter
Book I, Chapter 3
## Context
The central thesis of the chapter, establishing that the division of labour is fundamentally constrained by how far goods can be exchanged. Smith argues that when markets are small, individuals cannot specialise fully because they cannot exchange their surplus production for other goods they need.
## Economic Domain
Exchange
## Original Wording
Smith states that the extent of the division of labour must always be limited by the extent of the market.
## Modern Interpretation
Market size determines the viability of specialised production because producers need sufficient demand to exchange specialised output.

View File

@@ -0,0 +1,40 @@
artifacts:
- id: source/book-1-chapter-03.md
path: artifacts/sources/book-1-chapter-03.md
kind: source
title: Book I Chapter III
provenance:
legacy_path: markitect-main/examples/infospace-with-history/artifacts/sources/book-1-chapter-03.md
migration: pruned excerpt
relationships: []
- id: entity/division-of-labour.md
path: artifacts/entities/division-of-labour.md
kind: entity
title: Division of Labour
provenance:
legacy_path: markitect-main/examples/infospace-with-history/output/entities/division-of-labour.md
workflow_id: legacy-migration
relationships: []
- id: entity/market-extent.md
path: artifacts/entities/market-extent.md
kind: entity
title: Market Extent
provenance:
legacy_path: markitect-main/examples/infospace-with-history/output/entities/market-extent.md
workflow_id: legacy-migration
relationships: []
- id: relation/division-of-labour-constrains-market-extent.md
path: artifacts/relations/division-of-labour-constrains-market-extent.md
kind: relation
title: Division of Labour constrains Market Extent
provenance:
legacy_path: markitect-main/examples/infospace-with-history/output/relations/division_of_labour--constrains--market_extent.md
workflow_id: legacy-migration
input_artifact_id: source/book-1-chapter-03.md
relationships:
- type: subject
target: entity/division-of-labour.md
- type: object
target: entity/market-extent.md
- type: evidence
target: source/book-1-chapter-03.md

View File

@@ -0,0 +1,29 @@
# Division of Labour constrains Market Extent
## Subject
Division of Labour
## Predicate
limited by
## Object
Market Extent
## Relation Type
constrains
## VSM Channel
S2 <- S1
## Evidence
Book I, Chapter 3: "the extent of this division must always be limited by the extent of that power, or, in other words, by the extent of the market."
## Feedback Role
Market Expansion loop: market extent enables greater division of labour; greater division of labour raises productive powers; surplus and trade can then expand market extent. This edge records the structural constraint in the loop.

View File

@@ -0,0 +1,27 @@
---
id: book-1-chapter-03
title: THAT THE DIVISION OF LABOUR IS LIMITED BY THE EXTENT OF THE MARKET.
book: "1"
chapter: 3
artifact_type: content
legacy_source: markitect-main/examples/infospace-with-history/artifacts/sources/book-1-chapter-03.md
---
# Book I Chapter III
## Excerpt
As it is the power of exchanging that gives occasion to the division of
labour, so the extent of this division must always be limited by the extent of
that power, or, in other words, by the extent of the market.
When the market is very small, no person can have any encouragement to dedicate
himself entirely to one employment, for want of the power to exchange all that
surplus part of the produce of his own labour, which is over and above his own
consumption, for such parts of the produce of other men's labour as he has
occasion for.
## Migration Note
This is a pruned excerpt of the legacy source chapter, selected because it
grounds both migrated entities and the relation triplet in the pilot.

View File

@@ -0,0 +1,27 @@
# Economic Entity Contract
```yaml contract
id: economic-entity-pruned-legacy
document:
type: economic-entity
sections:
- id: definition
title: Definition
presence: required
level: 2
- id: source-chapter
title: Source Chapter
presence: required
level: 2
- id: context
title: Context
presence: required
level: 2
- id: economic-domain
title: Economic Domain
presence: required
level: 2
```
This compact contract is derived from the legacy economic entity schema and
keeps the required sections needed by the successor entity parser.

View File

@@ -0,0 +1,35 @@
# Relation Triplet Contract
```yaml contract
id: relation-triplet-pruned-legacy
document:
type: relation-triplet
sections:
- id: subject
title: Subject
presence: required
level: 2
- id: predicate
title: Predicate
presence: required
level: 2
- id: object
title: Object
presence: required
level: 2
- id: relation-type
title: Relation Type
presence: required
level: 2
- id: vsm-channel
title: VSM Channel
presence: required
level: 2
- id: evidence
title: Evidence
presence: required
level: 2
```
This compact contract is derived from the legacy relation triplet schema and
keeps the required sections needed by the successor relation parser.

View File

@@ -0,0 +1,34 @@
slug: wealth-vsm-legacy-slice
name: Wealth/VSM Legacy Slice
topic:
name: The Wealth of Nations / VSM Legacy Slice
domain: Classical Economics
sources: artifacts/sources
disciplines:
- name: Viable System Model
path: artifacts/vsm-reference
schemas:
entity: contracts/economic-entity.contract.md
relation: contracts/relation.contract.md
workflows:
- id: legacy-migration
description: Documents the pruned migration from markitect-main examples.
inputs:
source:
kind: source
stages:
- id: migrated-fixtures
kind: manual
input: source
template: reports/migration-report.md
viability:
coverage_ratio:
min: 0.5
redundancy_ratio:
max: 0.1
coherence_components:
max: 3
consistency_cycles:
max: 0
per_artifact_mean:
min: 3.5

View File

@@ -0,0 +1,51 @@
---
artifact_id: entity/division-of-labour.md
evaluator: legacy-migration
evaluated_at: "2026-02-23T05:07:06.567121+00:00"
overall_score: 4.6
scores:
- name: definition_precision
value: 4.0
max_value: 5.0
rationale: The definition is precise and captures the core concept clearly.
- name: source_grounding
value: 5.0
max_value: 5.0
rationale: The entity is directly grounded in Smith's text.
- name: domain_placement
value: 5.0
max_value: 5.0
rationale: The Production domain assignment is appropriate.
- name: vsm_relevance
value: 4.0
max_value: 5.0
rationale: The entity maps well to VSM operational and coordination concerns.
- name: explanatory_value
value: 5.0
max_value: 5.0
rationale: The entity explains a central mechanism of productivity and wealth creation.
notes:
- Migrated from legacy evaluation output and rewritten with artifact_id.
---
# Evaluation: Division of Labour
## definition_precision - 4.0 / 5.0
The definition is precise and captures the core concept clearly, identifying mechanisms of dexterity, time-saving, machinery invention, and exchange.
## source_grounding - 5.0 / 5.0
This entity is directly grounded in Smith's text and reflects the argument about specialization emerging from exchange relationships.
## domain_placement - 5.0 / 5.0
The Production domain assignment is correct because the entity concerns the organization and execution of productive work.
## vsm_relevance - 4.0 / 5.0
The entity maps well to System 1 operations and has relevance to System 2 coordination because specialization requires coordination mechanisms.
## explanatory_value - 5.0 / 5.0
The entity has strong explanatory power because it names the mechanism through which specialization increases productivity and wealth creation.

View File

@@ -0,0 +1,49 @@
- snapshot_id: legacy-slice
created_at: "2026-02-23T05:07:06.567121+00:00"
schema_name: economic-entity-pruned-legacy
artifact_count: 2
artifact_evaluations:
- artifact_id: entity/division-of-labour.md
evaluator: legacy-migration
evaluated_at: "2026-02-23T05:07:06.567121+00:00"
overall_score: 4.6
scores:
- name: definition_precision
value: 4.0
max_value: 5.0
- name: source_grounding
value: 5.0
max_value: 5.0
- name: domain_placement
value: 5.0
max_value: 5.0
- name: vsm_relevance
value: 4.0
max_value: 5.0
- name: explanatory_value
value: 5.0
max_value: 5.0
notes:
- Migrated from legacy evaluation output and rewritten with artifact_id.
collection_metrics:
- name: coverage_ratio
value: 1.0
concern: C2
- name: redundancy_ratio
value: 0.0
concern: C1
- name: coherence_components
value: 1.0
concern: C3
- name: consistency_cycles
value: 0.0
concern: C4
- name: granularity_entropy
value: 1.0
concern: C5
- name: per_artifact_mean
value: 4.6
concern: evaluation
metadata:
legacy_source: markitect-main/examples/infospace-with-history
migration: pruned Division of Labour / Market Extent slice

View File

@@ -0,0 +1,10 @@
coherence_components: 1.0
consistency_cycles: 0.0
coverage_ratio: 1.0
granularity_entropy: 1.0
per_artifact_mean: 4.6
redundancy_ratio: 0.0
type_distribution:
entity: 2
relation: 1
source: 1

View File

@@ -0,0 +1,55 @@
# Pruned Legacy Reference Pilot
## Selection
This pilot migrates a compact slice of
`markitect-main/examples/infospace-with-history`:
- source excerpt: `book-1-chapter-03.md`
- entities: `Division of Labour`, `Market Extent`
- relation: `Division of Labour limited by Market Extent`
- evaluation: migrated `Division of Labour` score set
- metrics snapshot: compact successor snapshot with legacy methodology labels
The generated bulk was intentionally not migrated. The slice is large enough to
exercise successor parsing, validation, entity and relation semantics,
evaluation history, metrics, graph inspection, and engine sync planning.
## Replaced
The legacy `output/entities`, `output/relations`, `output/evaluations`, and
`output/metrics` artifacts are represented using the successor manifest,
artifact IDs, evaluation I/O, and metrics history formats.
The legacy `pipeline` concept is represented as a `legacy-migration` workflow
record in `infospace.yaml`; the committed artifacts are the migration result,
not a replay of LLM generation.
## Delegated
Markdown parsing, section extraction, contract validation, and template syntax
remain delegated to `markitect-tool` through the `markdown_adapter` boundary.
Durable asset identity and future operational sync remain outside this pilot
and are represented by the `engine` dry-run sync plan.
## Remaining gaps
- Full legacy generated analyses, classifications, mappings, and raw prompts are
intentionally excluded.
- Provider-backed evaluation and generation are still represented by explicit
adapter boundaries rather than live calls.
- A later replacement-readiness pass should map old CLI commands to successor
commands and note any intentionally dropped behavior.
## Evidence
Run:
```bash
python3 -m pytest tests/test_legacy_pilot.py
python3 -m infospace_bench validate infospaces/wealth-vsm-legacy-slice
python3 -m infospace_bench entities infospaces/wealth-vsm-legacy-slice
python3 -m infospace_bench relations infospaces/wealth-vsm-legacy-slice
python3 -m infospace_bench engine plan-sync infospaces/wealth-vsm-legacy-slice
```

View File

@@ -0,0 +1,86 @@
from pathlib import Path
from infospace_bench import load_infospace
from infospace_bench.engine import plan_asset_sync
from infospace_bench.evaluation_io import read_entity_evaluation, read_history
from infospace_bench.history import read_metrics_file
from infospace_bench.inspection import export_mermaid, relationship_summary
from infospace_bench.markdown_adapter import validate_infospace_artifacts
from infospace_bench.semantics import list_entities, list_relations
from infospace_bench.viability import evaluate_viability
ROOT = Path("infospaces/wealth-vsm-legacy-slice")
def test_legacy_slice_is_loadable_and_pruned() -> None:
infospace = load_infospace(ROOT)
assert infospace.config.slug == "wealth-vsm-legacy-slice"
assert infospace.config.topic.name == "The Wealth of Nations / VSM Legacy Slice"
assert [artifact.kind for artifact in infospace.artifacts] == [
"source",
"entity",
"entity",
"relation",
]
assert len(list(ROOT.rglob("*.md"))) < 20
def test_legacy_slice_validates_and_parses_entities_and_relations() -> None:
validation = validate_infospace_artifacts(ROOT)
entities = list_entities(ROOT)
relations = list_relations(ROOT)
assert validation
assert all(result.valid for result in validation)
assert [entity.slug for entity in entities] == [
"division-of-labour",
"market-extent",
]
assert relations[0].subject_entity_id == "entity/division-of-labour.md"
assert relations[0].object_entity_id == "entity/market-extent.md"
assert relations[0].is_feedback_member is True
def test_legacy_slice_evaluation_metrics_and_viability() -> None:
evaluation = read_entity_evaluation(
ROOT / "output" / "evaluations" / "division-of-labour.md"
)
metrics = read_metrics_file(ROOT / "output" / "metrics" / "metrics.yaml")
history = read_history(ROOT / "output" / "metrics" / "history.yaml")
viability = evaluate_viability(metrics, load_infospace(ROOT).config.viability)
assert evaluation.artifact_id == "entity/division-of-labour.md"
assert round(evaluation.overall_score, 2) == 4.60
assert metrics["per_artifact_mean"] == 4.6
assert history[0].artifact_count == 2
assert history[0].metadata["legacy_source"] == "markitect-main/examples/infospace-with-history"
assert viability.passed is True
def test_legacy_slice_graph_and_engine_plan_are_traceable() -> None:
infospace = load_infospace(ROOT)
summary = relationship_summary(infospace.artifacts)
mermaid = export_mermaid(summary)
plan = plan_asset_sync(ROOT)
assert summary.edge_count == 3
assert "relation/division-of-labour-constrains-market-extent.md" in mermaid
assert [action.action for action in plan.actions] == [
"create",
"create",
"create",
"create",
]
assert plan.actions[3].workflow_id == "legacy-migration"
def test_legacy_slice_migration_report_names_parity_and_gaps() -> None:
report = (ROOT / "reports" / "migration-report.md").read_text(encoding="utf-8")
assert "Pruned Legacy Reference Pilot" in report
assert "Replaced" in report
assert "Delegated" in report
assert "Remaining gaps" in report
assert "generated bulk was intentionally not migrated" in report

View File

@@ -4,7 +4,7 @@ type: workplan
title: "Pruned Legacy Reference Pilot"
domain: markitect
repo: infospace-bench
status: planned
status: completed
owner: markitect
topic_slug: markitect
created: "2026-05-14"
@@ -27,7 +27,7 @@ successor behavior against real legacy content.
```task
id: IB-WP-0011-T01
status: todo
status: done
priority: high
state_hub_task_id: "49d4865b-38b0-4994-a0f9-1cbdf718689c"
```
@@ -41,7 +41,7 @@ state_hub_task_id: "49d4865b-38b0-4994-a0f9-1cbdf718689c"
```task
id: IB-WP-0011-T02
status: todo
status: done
priority: high
state_hub_task_id: "3bea0589-cd48-4a12-b2c5-e8996d383195"
```
@@ -55,7 +55,7 @@ state_hub_task_id: "3bea0589-cd48-4a12-b2c5-e8996d383195"
```task
id: IB-WP-0011-T03
status: todo
status: done
priority: high
state_hub_task_id: "fe012682-7af3-42a0-8d14-07685a663242"
```
@@ -68,7 +68,7 @@ state_hub_task_id: "fe012682-7af3-42a0-8d14-07685a663242"
```task
id: IB-WP-0011-T04
status: todo
status: done
priority: medium
state_hub_task_id: "5a6c885f-6acb-4d18-9aff-f710423e0198"
```