# Plan: 185.2-01 - Materialize global L2 reuse contexts and runtime capability plane

**Phase:** 185.2
**Axis:** Axis 1 (layer-internal optimization) + Axis 2 (inter-layer connection) + Axis 3 (durable evidence)

## Goal

Make `L3` planning reusable and executable by giving it:

- a global `L2` read system,
- topic-linked reuse evidence,
- a runtime capability plane,
- and explicit resource references in planning artifacts.

## Planned Route

### Step 1: Add failing tests for the new contracts

**Files:**
- `research/knowledge-hub/tests/test_capability_plane_contracts.py`
- `research/knowledge-hub/tests/test_aitp_service.py`
- `research/knowledge-hub/tests/test_runtime_path_hygiene_contracts.py`

Add red tests that require:

- capability cards and a registry,
- progressive reuse-context artifacts,
- explicit execution-resource context,
- and plan contracts that reference real resource ids.

### Step 2: Implement the runtime capability plane

**Files:**
- `research/knowledge-hub/knowledge_hub/capability_plane_support.py`
- `research/knowledge-hub/knowledge_hub/aitp_service.py`

Materialize:

- stable capability cards,
- a registry,
- Markdown mirrors,
- and one natural-language declaration write-in path that normalizes human input
  into durable cards.

### Step 3: Extend reusable `L2` units with topic-linked evidence and Obsidian mirror output

**Files:**
- `research/knowledge-hub/canonical/canonical-unit.schema.json`
- `research/knowledge-hub/knowledge_hub/l2_compiler.py`
- `research/knowledge-hub/tests/test_schema_contracts.py`
- `research/knowledge-hub/tests/test_l2_compiler.py`

Add topic/run/reuse evidence links and compile one fixed-folder Markdown mirror
for human browsing without changing canonical authority semantics.

### Step 4: Materialize progressive reuse contexts for `L3`

**Files:**
- `research/knowledge-hub/knowledge_hub/l2_reuse_context_support.py`
- `research/knowledge-hub/knowledge_hub/topic_shell_support.py`
- `research/knowledge-hub/knowledge_hub/runtime_bundle_support.py`
- `research/knowledge-hub/tests/test_aitp_service.py`
- `research/knowledge-hub/tests/test_runtime_profiles_and_projections.py`

Generate:

- `idea_reuse_context`
- `plan_reuse_context`
- `execution_resource_context`

and wire them into topic-shell and runtime-bundle surfaces.

### Step 5: Bind resource refs into `L3` planning contracts

**Files:**
- `research/knowledge-hub/knowledge_hub/iteration_journal_support.py`
- `research/knowledge-hub/tests/test_aitp_service.py`

Extend iteration plan contracts so they name:

- `server_ref`
- `environment_ref`
- `tool_refs`
- optional workflow/script refs

instead of relying only on generic executor hints.

### Step 6: Re-verify and document the integrated slice

**Files:**
- `.planning/ROADMAP.md`
- `research/knowledge-hub/runtime/README.md`
- `docs/PROJECT_INDEX.md`

Re-run the integrated slice, preserve the verification commands, and document:

- the capability plane,
- the global Markdown mirror,
- the reuse contexts,
- and the explicit resource-ref planning rule.

## Acceptance Criteria

- [ ] `L3` receives bounded `idea_reuse_context` and `plan_reuse_context` artifacts
- [ ] execution resources are exposed through a durable capability plane
- [ ] humans may populate capability cards directly or through bounded natural-language declarations
- [ ] iteration plans name explicit resource ids instead of relying only on prose
- [ ] the Markdown mirror remains derived and non-authoritative
