---
phase: 54-control-plane-ontology-freeze-and-runtime-contracts
plan: 01
type: execute
wave: 1
depends_on: []
files_modified:
  - research/knowledge-hub/knowledge_hub/runtime_bundle_support.py
  - research/knowledge-hub/knowledge_hub/capability_audit_support.py
  - research/knowledge-hub/knowledge_hub/aitp_service.py
  - research/knowledge-hub/knowledge_hub/aitp_cli.py
  - research/knowledge-hub/tests/test_aitp_service.py
  - research/knowledge-hub/tests/test_aitp_cli.py
  - research/knowledge-hub/tests/test_runtime_profiles_and_projections.py
autonomous: true
requirements:
  - REQ-CTRL-01
  - REQ-CTRL-02
  - REQ-HPLANE-01
  - REQ-HPLANE-02
must_haves:
  truths:
    - control-plane semantics must stay orthogonal instead of collapsing lane, layer, mode, and H-plane together
    - runtime truth and audit surfaces must expose the control plane directly
    - this phase closes only with production behavior plus targeted verification, not docs alone
---

<objective>
Materialize the first explicit AITP control-plane contract in production code
and expose it through runtime, service, CLI, and capability-audit surfaces.
</objective>

<execution_context>
@D:/BaiduSyncdisk/Theoretical-Physics/.codex-home/get-shit-done/workflows/execute-plan.md
@D:/BaiduSyncdisk/Theoretical-Physics/.codex-home/get-shit-done/templates/summary.md
</execution_context>

<context>
@.planning/phases/54-control-plane-ontology-freeze-and-runtime-contracts/54-CONTEXT.md
@docs/V142_ARCHITECTURE_VISION.md
@docs/AITP_UNIFIED_RESEARCH_ARCHITECTURE.md
@research/knowledge-hub/runtime/README.md
@research/knowledge-hub/knowledge_hub/runtime_bundle_support.py
@research/knowledge-hub/knowledge_hub/capability_audit_support.py
@research/knowledge-hub/knowledge_hub/aitp_service.py
@research/knowledge-hub/knowledge_hub/aitp_cli.py
</context>

<tasks>

<task type="auto">
  <name>Task 1: Add failing tests for the explicit control-plane contract</name>
  <files>research/knowledge-hub/tests/test_aitp_service.py, research/knowledge-hub/tests/test_aitp_cli.py, research/knowledge-hub/tests/test_runtime_profiles_and_projections.py</files>
  <read_first>research/knowledge-hub/tests/test_aitp_service.py, research/knowledge-hub/tests/test_aitp_cli.py, research/knowledge-hub/tests/test_runtime_profiles_and_projections.py</read_first>
  <action>Add failing tests that require runtime/status/audit surfaces to expose a first-class `control_plane` payload with distinct `task_type`, `lane`, `layer`, `mode`, transition, and `H-plane` state.</action>
  <verify>python -m pytest research/knowledge-hub/tests/test_aitp_service.py research/knowledge-hub/tests/test_aitp_cli.py research/knowledge-hub/tests/test_runtime_profiles_and_projections.py -q</verify>
  <acceptance_criteria>
    - tests fail before implementation
    - the failure proves the missing control-plane contract rather than an unrelated regression
  </acceptance_criteria>
  <done>A real failing contract exists for Phase `54`.</done>
</task>

<task type="auto">
  <name>Task 2: Implement runtime and audit control-plane builders</name>
  <files>research/knowledge-hub/knowledge_hub/runtime_bundle_support.py, research/knowledge-hub/knowledge_hub/capability_audit_support.py, research/knowledge-hub/knowledge_hub/aitp_service.py</files>
  <read_first>research/knowledge-hub/knowledge_hub/runtime_bundle_support.py, research/knowledge-hub/knowledge_hub/capability_audit_support.py, research/knowledge-hub/knowledge_hub/aitp_service.py</read_first>
  <action>Implement one explicit production `control_plane` payload and reuse it across runtime bundle, topic status, and capability-audit surfaces without regrowing the service facade.</action>
  <verify>python -m pytest research/knowledge-hub/tests/test_aitp_service.py research/knowledge-hub/tests/test_runtime_profiles_and_projections.py -q</verify>
  <acceptance_criteria>
    - runtime bundle exposes one bounded control-plane section
    - capability audit reports a control-plane section
    - topic status returns the same control-plane truth rather than a second incompatible view
  </acceptance_criteria>
  <done>The runtime truth model now includes an explicit control-plane contract.</done>
</task>

<task type="auto">
  <name>Task 3: Wire CLI exposure and keep human/operator surfaces honest</name>
  <files>research/knowledge-hub/knowledge_hub/aitp_cli.py, research/knowledge-hub/knowledge_hub/aitp_service.py</files>
  <read_first>research/knowledge-hub/knowledge_hub/aitp_cli.py, research/knowledge-hub/knowledge_hub/aitp_service.py</read_first>
  <action>Expose the new control-plane contract through the existing CLI status or audit surfaces so operators can inspect it without reading raw internal files first.</action>
  <verify>python -m pytest research/knowledge-hub/tests/test_aitp_cli.py research/knowledge-hub/tests/test_aitp_service.py -q</verify>
  <acceptance_criteria>
    - CLI-visible payloads can reach the control-plane section
    - H-plane state is explicit instead of implied by scattered notes
  </acceptance_criteria>
  <done>The control plane is inspectable through service and CLI entrypoints.</done>
</task>

<task type="auto">
  <name>Task 4: Re-run the targeted integrated slice</name>
  <files>research/knowledge-hub/tests/test_aitp_service.py, research/knowledge-hub/tests/test_aitp_cli.py, research/knowledge-hub/tests/test_runtime_profiles_and_projections.py</files>
  <read_first>.planning/REQUIREMENTS.md</read_first>
  <action>Re-run the targeted integrated slice to prove the control-plane contract lands cleanly in the current runtime stack.</action>
  <verify>python -m pytest research/knowledge-hub/tests/test_aitp_service.py research/knowledge-hub/tests/test_aitp_cli.py research/knowledge-hub/tests/test_runtime_profiles_and_projections.py -q</verify>
  <acceptance_criteria>
    - the targeted slice exits 0
  </acceptance_criteria>
  <done>Phase `54` lands on a stable tested baseline.</done>
</task>

</tasks>
