---
phase: 01-topic-start-hardening
plan: 01
type: execute
wave: 1
depends_on: []
files_modified:
  - research/knowledge-hub/knowledge_hub/aitp_service.py
  - research/knowledge-hub/tests/test_aitp_service.py
autonomous: true
requirements:
  - START-01
  - START-02
  - START-03
user_setup: []
must_haves:
  truths:
    - Source-heavy topic starts derive a better initial idea from durable source content when it exists.
    - The first validation route becomes lane-aware and bounded instead of always falling back to a generic sentence.
    - Explicit human-provided idea_packet values still override heuristic distillation.
  artifacts:
    - path: research/knowledge-hub/knowledge_hub/aitp_service.py
      provides: Source-driven idea_packet distillation and fallback ordering
      min_lines: 200
      contains: "_distill_from_sources"
    - path: research/knowledge-hub/tests/test_aitp_service.py
      provides: Service-level regression coverage for source-heavy topic starts
      contains: "distill"
  key_links:
    - from: research/knowledge-hub/knowledge_hub/aitp_service.py
      to: research/knowledge-hub/tests/test_aitp_service.py
      via: service-level regression tests
      pattern: "_distill_from_sources|distill"
---

<objective>
Sharpen source-to-question distillation in the topic-start path so source-heavy
requests produce better `idea_packet` defaults without overriding explicit human
input.

Purpose: Close the biggest current AITP product bottleneck at topic start.
Output: Updated source-distillation logic in `aitp_service.py` plus targeted
service-level regression tests.
</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/01-topic-start-hardening/01-CONTEXT.md
@research/knowledge-hub/knowledge_hub/aitp_service.py
@research/knowledge-hub/tests/test_aitp_service.py
@docs/HUMAN_IDEA_AI_EXECUTION_STEERING_PROTOCOL_VNEXT.md
</context>

<tasks>

<task type="auto">
  <name>Task 1: Tighten source-driven `idea_packet` distillation</name>
  <files>research/knowledge-hub/knowledge_hub/aitp_service.py</files>
  <read_first>research/knowledge-hub/knowledge_hub/aitp_service.py, docs/HUMAN_IDEA_AI_EXECUTION_STEERING_PROTOCOL_VNEXT.md, .planning/phases/01-topic-start-hardening/01-CONTEXT.md</read_first>
  <action>Refine `_distill_from_sources` and the surrounding topic-start fallback path so it reads durable source content in this order: snapshot preview, original source text when available, then source summary. Keep `%` comment lines and empty previews from becoming the effective idea text. Preserve explicit human-authored `idea_packet` fields as higher priority than distilled values. Keep the distilled outputs limited to `initial_idea`, `novelty_target`, inferred lane, and a bounded `first_validation_route` sentence.</action>
  <verify>python -m pytest research/knowledge-hub/tests/test_aitp_service.py -q</verify>
  <acceptance_criteria>
    - research/knowledge-hub/knowledge_hub/aitp_service.py contains `def _distill_from_sources(`
    - research/knowledge-hub/knowledge_hub/aitp_service.py contains `distilled_first_validation_route`
    - research/knowledge-hub/knowledge_hub/aitp_service.py contains `_coalesce_string(` and `distilled_initial_idea`
  </acceptance_criteria>
  <done>`aitp_service.py` derives bounded source-driven defaults without demoting explicit human inputs.</done>
</task>

<task type="auto">
  <name>Task 2: Add service-level regressions for source-heavy starts</name>
  <files>research/knowledge-hub/tests/test_aitp_service.py</files>
  <read_first>research/knowledge-hub/tests/test_aitp_service.py, research/knowledge-hub/knowledge_hub/aitp_service.py</read_first>
  <action>Add or update focused tests that cover at least these cases: a snapshot preview dominated by comments falls back to original source text or summary; lane inference produces a bounded first validation route; and explicit pre-existing `idea_packet` values still win over distilled defaults. Keep the tests local to `AITPService` behavior and avoid introducing filesystem dependence outside the test temp root.</action>
  <verify>python -m pytest research/knowledge-hub/tests/test_aitp_service.py -q</verify>
  <acceptance_criteria>
    - research/knowledge-hub/tests/test_aitp_service.py contains `test_`
    - research/knowledge-hub/tests/test_aitp_service.py contains `idea_packet`
    - `python -m pytest research/knowledge-hub/tests/test_aitp_service.py -q` exits 0
  </acceptance_criteria>
  <done>Service-level regressions lock the topic-start distillation behavior.</done>
</task>

</tasks>

<verification>
Before declaring plan complete:
- [ ] `python -m pytest research/knowledge-hub/tests/test_aitp_service.py -q`
- [ ] Distilled values are only used as fallbacks, not as replacements for explicit human input.
- [ ] The topic-start path stays source-grounded and bounded.
</verification>

<success_criteria>

- All tasks completed
- All verification checks pass
- No errors or warnings introduced
- Source-heavy starts produce sharper bounded defaults from durable source content

  </success_criteria>

<output>
After completion, create `.planning/phases/01-topic-start-hardening/01-01-SUMMARY.md`
</output>
