---
phase: 34-runtime-schema-and-memory-closure
plan: 01
type: execute
wave: 1
depends_on: []
files_modified:
  - research/knowledge-hub/runtime/schemas/progressive-disclosure-runtime-bundle.schema.json
  - research/knowledge-hub/tests/test_schema_contracts.py
  - research/knowledge-hub/tests/test_runtime_profiles_and_projections.py
  - research/knowledge-hub/tests/test_aitp_service.py
autonomous: true
requirements:
  - REQ-INT-01
  - REQ-L2-02
user_setup: []
must_haves:
  truths:
    - Runtime bundle schema and emitted payload must agree about `collaborator_memory`.
    - Collaborator memory stays explicitly noncanonical in semantics.
    - Phase completion must be evidenced by green runtime/schema regressions, not by planning text alone.
  artifacts:
    - path: research/knowledge-hub/runtime/schemas/progressive-disclosure-runtime-bundle.schema.json
      provides: Top-level runtime schema closure for collaborator memory
      contains: "\"collaborator_memory\""
    - path: research/knowledge-hub/tests/test_schema_contracts.py
      provides: Schema contract coverage for collaborator memory exposure
      contains: "collaborator_memory"
  key_links:
    - from: research/knowledge-hub/knowledge_hub/aitp_service.py
      to: research/knowledge-hub/runtime/schemas/progressive-disclosure-runtime-bundle.schema.json
      via: runtime bundle validation
      pattern: "collaborator_memory"
---

<objective>
Close the currently broken collaborator-memory runtime integration so the
runtime bundle, runtime schema, and service-level projections are aligned and
green again.

Purpose: restore an honest baseline before Phase `35` claims seeded `L2`
memory activation.
Output: schema wiring fix plus restored runtime/schema regression evidence.
</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/PROJECT.md
@.planning/ROADMAP.md
@.planning/STATE.md
@.planning/phases/34-runtime-schema-and-memory-closure/34-CONTEXT.md
@research/knowledge-hub/knowledge_hub/aitp_service.py
@research/knowledge-hub/runtime/schemas/progressive-disclosure-runtime-bundle.schema.json
@research/knowledge-hub/tests/test_schema_contracts.py
@research/knowledge-hub/tests/test_runtime_profiles_and_projections.py
@research/knowledge-hub/tests/test_aitp_service.py
</context>

<tasks>

<task type="auto">
  <name>Task 1: Restore runtime schema closure for collaborator memory</name>
  <files>research/knowledge-hub/runtime/schemas/progressive-disclosure-runtime-bundle.schema.json</files>
  <read_first>research/knowledge-hub/runtime/schemas/progressive-disclosure-runtime-bundle.schema.json, research/knowledge-hub/knowledge_hub/aitp_service.py, .planning/phases/34-runtime-schema-and-memory-closure/34-CONTEXT.md</read_first>
  <action>Add the missing top-level `properties.collaborator_memory` schema entry that references `#/$defs/collaborator_memory`, keeping the field required and noncanonical by meaning rather than removing it from the runtime payload.</action>
  <verify>python -m pytest research/knowledge-hub/tests/test_schema_contracts.py -q</verify>
  <acceptance_criteria>
    - `progressive-disclosure-runtime-bundle.schema.json` contains a top-level `collaborator_memory` property reference
    - `python -m pytest research/knowledge-hub/tests/test_schema_contracts.py -q` exits 0
  </acceptance_criteria>
  <done>The runtime schema accepts the emitted collaborator-memory field.</done>
</task>

<task type="auto">
  <name>Task 2: Re-lock runtime bundle regressions</name>
  <files>research/knowledge-hub/tests/test_runtime_profiles_and_projections.py, research/knowledge-hub/tests/test_aitp_service.py</files>
  <read_first>research/knowledge-hub/tests/test_runtime_profiles_and_projections.py, research/knowledge-hub/tests/test_aitp_service.py, research/knowledge-hub/knowledge_hub/aitp_service.py</read_first>
  <action>Run and, only if necessary, tighten the targeted runtime-bundle tests so they assert the collaborator-memory surface as noncanonical context while preserving the existing runtime expectations for `must_read_now`, projection files, and bundle validation.</action>
  <verify>python -m pytest research/knowledge-hub/tests/test_runtime_profiles_and_projections.py -q && python -m pytest research/knowledge-hub/tests/test_aitp_service.py -k "collaborator_memory or materialize_runtime_protocol_bundle_writes_expected_artifacts" -q</verify>
  <acceptance_criteria>
    - runtime bundle tests validate the emitted schema without additional-property failures
    - service-level runtime bundle tests pass with collaborator-memory present
  </acceptance_criteria>
  <done>The emitted runtime bundle and tests agree about collaborator-memory semantics.</done>
</task>

<task type="auto">
  <name>Task 3: Re-run the integrated closure suite</name>
  <files>research/knowledge-hub/tests/test_aitp_service.py, research/knowledge-hub/tests/test_aitp_cli.py, research/knowledge-hub/tests/test_aitp_cli_e2e.py, research/knowledge-hub/tests/test_runtime_profiles_and_projections.py, research/knowledge-hub/tests/test_schema_contracts.py, research/knowledge-hub/tests/test_l2_graph_activation.py, research/knowledge-hub/tests/test_topic_start_regressions.py</files>
  <read_first>.planning/V1.33_SLICE1_AUDIT.md</read_first>
  <action>Re-run the integrated regression slice that previously represented the live closure point so Phase `34` ends with a genuinely green baseline instead of isolated spot-fixes.</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_aitp_cli_e2e.py research/knowledge-hub/tests/test_runtime_profiles_and_projections.py research/knowledge-hub/tests/test_schema_contracts.py research/knowledge-hub/tests/test_l2_graph_activation.py research/knowledge-hub/tests/test_topic_start_regressions.py -q</verify>
  <acceptance_criteria>
    - the integrated regression slice exits 0
    - no claim of Phase `34` closure is made without the integrated green run
  </acceptance_criteria>
  <done>Phase `34` restores a trustworthy runtime/schema baseline for the next milestone phases.</done>
</task>

</tasks>

<verification>
Before declaring plan complete:
- [ ] `python -m pytest research/knowledge-hub/tests/test_schema_contracts.py -q`
- [ ] `python -m pytest research/knowledge-hub/tests/test_runtime_profiles_and_projections.py -q`
- [ ] `python -m pytest research/knowledge-hub/tests/test_aitp_service.py -k "collaborator_memory or materialize_runtime_protocol_bundle_writes_expected_artifacts" -q`
- [ ] `python -m pytest research/knowledge-hub/tests/test_aitp_service.py research/knowledge-hub/tests/test_aitp_cli.py research/knowledge-hub/tests/test_aitp_cli_e2e.py research/knowledge-hub/tests/test_runtime_profiles_and_projections.py research/knowledge-hub/tests/test_schema_contracts.py research/knowledge-hub/tests/test_l2_graph_activation.py research/knowledge-hub/tests/test_topic_start_regressions.py -q`
</verification>

<success_criteria>

- All tasks completed
- All verification checks pass
- Runtime bundle and schema agree on collaborator-memory exposure
- Collaborator memory remains explicitly noncanonical in meaning

</success_criteria>

<output>
After completion, create `.planning/phases/34-runtime-schema-and-memory-closure/34-01-SUMMARY.md`
</output>
