---
phase: 36-consultation-and-human-facing-memory-maps
plan: 01
type: execute
wave: 1
depends_on:
  - 35-01
files_modified:
  - research/knowledge-hub/knowledge_hub/aitp_service.py
  - research/knowledge-hub/runtime/schemas/progressive-disclosure-runtime-bundle.schema.json
  - research/knowledge-hub/tests/test_aitp_service.py
  - research/knowledge-hub/tests/test_runtime_profiles_and_projections.py
  - research/knowledge-hub/tests/test_schema_contracts.py
autonomous: true
requirements:
  - REQ-L2-03
  - REQ-L2-04
user_setup: []
must_haves:
  truths:
    - Human-facing and AI-facing consultation surfaces must point to the same selected canonical identities.
    - The new memory-map artifact must help a physicist inspect the latest consultation without reading raw JSONL.
    - Staged tensions and warning notes must remain visible instead of being flattened away by a friendly summary.
  artifacts:
    - path: research/knowledge-hub/knowledge_hub/aitp_service.py
      provides: Latest-consultation human-facing memory map generation and runtime exposure
      contains: "memory_map"
    - path: research/knowledge-hub/runtime/schemas/progressive-disclosure-runtime-bundle.schema.json
      provides: Runtime contract for the latest consultation memory-map surface
      contains: "latest_memory_map_path"
  key_links:
    - from: research/knowledge-hub/knowledge_hub/aitp_service.py
      to: research/knowledge-hub/L2_CONSULTATION_PROTOCOL.md
      via: human-facing and AI-facing consultation alignment
      pattern: "consultation|memory_map"
---

<objective>
Add a human-facing latest-consultation memory-map surface derived from the same
canonical/staging selection used by AI-facing `L2` consultation packets.

Purpose: make seeded `L2` consultation inspectable and practically useful for a
theoretical physicist.
Output: memory-map artifact generation plus runtime exposure and regression
coverage.
</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/36-consultation-and-human-facing-memory-maps/36-CONTEXT.md
@research/knowledge-hub/L2_CONSULTATION_PROTOCOL.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_aitp_service.py
@research/knowledge-hub/tests/test_runtime_profiles_and_projections.py
@research/knowledge-hub/tests/test_schema_contracts.py
</context>

<tasks>

<task type="auto">
  <name>Task 1: Add failing tests for latest consultation memory-map exposure</name>
  <files>research/knowledge-hub/tests/test_aitp_service.py, research/knowledge-hub/tests/test_runtime_profiles_and_projections.py, research/knowledge-hub/tests/test_schema_contracts.py</files>
  <read_first>research/knowledge-hub/tests/test_aitp_service.py, research/knowledge-hub/tests/test_runtime_profiles_and_projections.py, research/knowledge-hub/tests/test_schema_contracts.py, .planning/phases/36-consultation-and-human-facing-memory-maps/36-CONTEXT.md</read_first>
  <action>Add failing tests that require a latest-consultation memory-map artifact path in the runtime `l2_memory` consultation surface and verify that the memory map includes primary hits, expanded hits, warning notes, staged hits, and the graph activation summary.</action>
  <verify>python -m pytest research/knowledge-hub/tests/test_aitp_service.py research/knowledge-hub/tests/test_runtime_profiles_and_projections.py research/knowledge-hub/tests/test_schema_contracts.py -q</verify>
  <acceptance_criteria>
    - tests fail before implementation
    - runtime schema requires the new consultation memory-map path
  </acceptance_criteria>
  <done>A real failing contract exists for human-facing consultation memory maps.</done>
</task>

<task type="auto">
  <name>Task 2: Implement latest consultation memory-map generation</name>
  <files>research/knowledge-hub/knowledge_hub/aitp_service.py, research/knowledge-hub/runtime/schemas/progressive-disclosure-runtime-bundle.schema.json</files>
  <read_first>research/knowledge-hub/knowledge_hub/aitp_service.py, research/knowledge-hub/L2_CONSULTATION_PROTOCOL.md, research/knowledge-hub/runtime/schemas/progressive-disclosure-runtime-bundle.schema.json</read_first>
  <action>Generate a derived latest-consultation memory-map JSON/Markdown artifact from the same retrieved refs used by `consult_topic_l2()`, then expose its path and summary through runtime `l2_memory.consultation_surface` without changing trust semantics.</action>
  <verify>python -m pytest research/knowledge-hub/tests/test_aitp_service.py research/knowledge-hub/tests/test_runtime_profiles_and_projections.py research/knowledge-hub/tests/test_schema_contracts.py -q</verify>
  <acceptance_criteria>
    - the latest consultation memory-map files are materialized
    - runtime `l2_memory` points to the memory map
    - human-facing and AI-facing surfaces stay aligned on ids and warnings
  </acceptance_criteria>
  <done>Consultation becomes materially easier for a physicist to inspect.</done>
</task>

<task type="auto">
  <name>Task 3: Re-run the integrated regression slice</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/phases/35-seeded-l2-graph-mvp/35-01-SUMMARY.md</read_first>
  <action>Re-run the current integrated regression slice so the new consultation memory-map layer lands without regressing the restored runtime/schema baseline or seeded-graph activation behavior.</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
  </acceptance_criteria>
  <done>Phase `36` lands on top of the Phase `35` green baseline.</done>
</task>

</tasks>

<verification>
Before declaring plan complete:
- [ ] `python -m pytest research/knowledge-hub/tests/test_aitp_service.py research/knowledge-hub/tests/test_runtime_profiles_and_projections.py research/knowledge-hub/tests/test_schema_contracts.py -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
- Latest consultation memory maps are available to the human and consistent with AI-facing consultation state

</success_criteria>

<output>
After completion, create `.planning/phases/36-consultation-and-human-facing-memory-maps/36-01-SUMMARY.md`
</output>
