---
phase: 59-lightweight-l2-entry-and-seed-command-family
plan: 01
type: execute
wave: 1
depends_on:
  - 58-mvp-node-family-activation-and-physical-picture-closure
files_modified:
  - 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_aitp_cli_e2e.py
autonomous: true
requirements:
  - REQ-L2MVP-03
  - REQ-L2MVP-04
  - REQ-L2MVP-05
  - REQ-L2MVP-06
must_haves:
  truths:
    - bounded MVP L2 graph operations must be reachable through production service and CLI surfaces
    - staging remains non-authoritative and distinct from promotion
    - closure requires at least one real CLI-backed proof
---

<objective>
Expose the MVP `L2` seed and consult capabilities through real production
service and CLI entrypoints.
</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/59-lightweight-l2-entry-and-seed-command-family/59-CONTEXT.md
@.planning/REQUIREMENTS.md
@research/knowledge-hub/knowledge_hub/l2_graph.py
@research/knowledge-hub/knowledge_hub/l2_staging.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 L2 seed and consult production entrypoints</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</files>
  <read_first>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/knowledge_hub/l2_graph.py, research/knowledge-hub/knowledge_hub/aitp_cli.py</read_first>
  <action>Add failing tests that require public service wrappers and CLI commands for bounded MVP L2 graph seeding and consultation, including one CLI-backed proof that can retrieve the seeded `physical_picture`.</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 -q</verify>
  <acceptance_criteria>
    - tests fail before implementation
    - failures prove that seed/consult capability is still helper-only
  </acceptance_criteria>
  <done>A red contract exists for Phase `59`.</done>
</task>

<task type="auto">
  <name>Task 2: Implement service entrypoints for bounded L2 seed and consult</name>
  <files>research/knowledge-hub/knowledge_hub/aitp_service.py</files>
  <read_first>research/knowledge-hub/knowledge_hub/aitp_service.py, research/knowledge-hub/knowledge_hub/l2_graph.py, research/knowledge-hub/tests/test_aitp_service.py</read_first>
  <action>Add `AITPService.seed_l2_direction(...)` and `AITPService.consult_l2(...)` as thin production wrappers over the current bounded L2 graph helper path.</action>
  <verify>python -m pytest research/knowledge-hub/tests/test_aitp_service.py -q</verify>
  <acceptance_criteria>
    - service exposes both bounded operations
    - consult can return seeded hits and optional staging hits through production code
  </acceptance_criteria>
  <done>Service exposes the MVP L2 graph operations directly.</done>
</task>

<task type="auto">
  <name>Task 3: Implement CLI command family and subprocess proof</name>
  <files>research/knowledge-hub/knowledge_hub/aitp_cli.py, research/knowledge-hub/tests/test_aitp_cli.py, research/knowledge-hub/tests/test_aitp_cli_e2e.py</files>
  <read_first>research/knowledge-hub/knowledge_hub/aitp_cli.py, research/knowledge-hub/tests/test_aitp_cli.py, research/knowledge-hub/tests/test_aitp_cli_e2e.py</read_first>
  <action>Add `aitp seed-l2-direction` and `aitp consult-l2`, wire them through the new service wrappers, and prove them with a subprocess E2E path that seeds TFIM MVP memory then retrieves the `physical_picture` via CLI JSON output.</action>
  <verify>python -m pytest research/knowledge-hub/tests/test_aitp_cli.py research/knowledge-hub/tests/test_aitp_cli_e2e.py -q</verify>
  <acceptance_criteria>
    - parser registers both commands
    - dispatch reaches service wrappers
    - CLI E2E can seed and consult the bounded MVP graph successfully
  </acceptance_criteria>
  <done>Operators can reach the MVP graph surface through production CLI commands.</done>
</task>

<task type="auto">
  <name>Task 4: Re-run the integrated Phase 59 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</files>
  <read_first>.planning/REQUIREMENTS.md</read_first>
  <action>Re-run the service/CLI slice and then the full suite to confirm Phase `59` lands cleanly on top of Phase `58`.</action>
  <verify>python -m pytest research/knowledge-hub/tests -q</verify>
  <acceptance_criteria>
    - targeted slice exits 0
    - full knowledge-hub suite exits 0
  </acceptance_criteria>
  <done>Phase `59` lands on a stable tested baseline.</done>
</task>

</tasks>
