---
phase: 139-compiled-knowledge-surface-and-acceptance
plan: 01
type: execute
wave: 1
depends_on:
  - 138-01
files_modified:
  - research/knowledge-hub/runtime/scripts/run_l2_knowledge_report_acceptance.py
  - research/knowledge-hub/README.md
  - research/knowledge-hub/runtime/README.md
  - research/knowledge-hub/runtime/AITP_TEST_RUNBOOK.md
  - research/knowledge-hub/tests/test_l2_backend_contracts.py
  - research/knowledge-hub/tests/test_runtime_scripts.py
autonomous: true
requirements:
  - REQ-KCOMP-03
  - REQ-KCOMP-04
must_haves:
  truths:
    - the compiled-knowledge surface must remain explicitly non-authoritative
    - the new acceptance path must use real artifacts, not mocks
    - docs should extend the existing L2 compiler cluster rather than branching into a separate lane
---

<objective>
Make the compiled-knowledge surface operator-visible and acceptance-backed
through one dedicated bounded runtime script plus aligned L2 compiler docs.
</objective>

<context>
@.planning/phases/139-compiled-knowledge-surface-and-acceptance/139-CONTEXT.md
@.planning/REQUIREMENTS.md
@research/knowledge-hub/knowledge_hub/l2_compiler.py
@research/knowledge-hub/runtime/README.md
@research/knowledge-hub/runtime/AITP_TEST_RUNBOOK.md
</context>

<tasks>

<task type="auto">
  <name>Task 1: Add a dedicated compiled-knowledge acceptance script</name>
  <files>research/knowledge-hub/runtime/scripts/run_l2_knowledge_report_acceptance.py, research/knowledge-hub/tests/test_runtime_scripts.py</files>
  <read_first>research/knowledge-hub/runtime/scripts/run_l2_mvp_direction_acceptance.py, research/knowledge-hub/knowledge_hub/l2_compiler.py</read_first>
  <action>Create one isolated acceptance script that seeds bounded canonical plus staging state, runs `compile-l2-knowledge-report`, and verifies the compiled report artifacts and change summary.</action>
  <verify>python -m pytest research/knowledge-hub/tests/test_runtime_scripts.py -q -k \"knowledge_report\"</verify>
  <acceptance_criteria>
    - the script exists and exercises the real compiler path
    - the script verifies change summary plus non-authoritative staging semantics
  </acceptance_criteria>
  <done>The compiled-knowledge surface has its own bounded acceptance lane.</done>
</task>

<task type="auto">
  <name>Task 2: Document the compiled-knowledge surface in the L2 compiler docs cluster</name>
  <files>research/knowledge-hub/README.md, research/knowledge-hub/runtime/README.md, research/knowledge-hub/runtime/AITP_TEST_RUNBOOK.md, research/knowledge-hub/tests/test_l2_backend_contracts.py</files>
  <read_first>research/knowledge-hub/README.md, research/knowledge-hub/runtime/README.md, research/knowledge-hub/runtime/AITP_TEST_RUNBOOK.md</read_first>
  <action>Document `compile-l2-knowledge-report` alongside the existing map/report/hygiene surfaces and keep the wording explicitly non-authoritative.</action>
  <verify>python -m pytest research/knowledge-hub/tests/test_l2_backend_contracts.py -q -k \"knowledge_report or l2_mvp_commands_and_acceptance_are_documented\"</verify>
  <acceptance_criteria>
    - docs mention the command and artifact paths
    - docs state the non-authoritative/staging-aware boundary explicitly
  </acceptance_criteria>
  <done>The compiled-knowledge surface is discoverable to operators.</done>
</task>

</tasks>
