---
phase: 167
plan: 01
type: execute
wave: 1
depends_on:
  - 167-discuss
  - 166.1
files_modified:
  - research/knowledge-hub/knowledge_hub/l1_source_intake_support.py
  - research/knowledge-hub/knowledge_hub/source_distillation_support.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_schema_contracts.py
  - research/knowledge-hub/tests/test_runtime_scripts.py
autonomous: false
requirements:
  - REQ-L1CON-01
  - REQ-L1CON-02
must_haves:
  truths:
    - contradiction rows must stay source-backed and pairwise
    - richer contradiction rows must explain the bounded comparison basis rather than only carry a vague detail string
    - the phase must preserve existing contradiction-row consumers while upgrading the row contract
---

<objective>
Upgrade the current `L1` contradiction intake path into richer, source-backed
contradiction rows with explicit comparison basis, while keeping compatibility
with the current `contradiction_candidates` chain and staying out of the later
runtime/read-path cleanup assigned to Phase `167.1`.
</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/167-l1-contradiction-intake-rows-and-comparison-basis/167-CONTEXT.md
@.planning/phases/167-l1-contradiction-intake-rows-and-comparison-basis/167-RESEARCH.md
@.planning/phases/167-l1-contradiction-intake-rows-and-comparison-basis/167-VALIDATION.md
@research/knowledge-hub/knowledge_hub/l1_source_intake_support.py
@research/knowledge-hub/knowledge_hub/source_distillation_support.py
@research/knowledge-hub/runtime/scripts/run_l1_assumption_depth_acceptance.py
</context>

<tasks>

<task type="auto">
  <name>Task 1: Enrich contradiction-row normalization with explicit comparison basis</name>
  <files>research/knowledge-hub/knowledge_hub/l1_source_intake_support.py, research/knowledge-hub/tests/test_aitp_service.py, research/knowledge-hub/tests/test_schema_contracts.py</files>
  <read_first>research/knowledge-hub/knowledge_hub/l1_source_intake_support.py, research/knowledge-hub/tests/test_aitp_service.py, research/knowledge-hub/tests/test_schema_contracts.py, .planning/phases/167-l1-contradiction-intake-rows-and-comparison-basis/167-CONTEXT.md</read_first>
  <action>Upgrade `_normalize_contradiction_candidates(...)` and the contradiction row schema so rows can carry richer comparison context while preserving current compatibility. Keep the row pairwise and source-backed. Add fields that explain the compared content on both sides, such as bounded claim/regime/assumption summaries and explicit comparison basis, instead of leaving the row as only `kind + pair + detail`. Update focused service/schema tests so the richer row shape is asserted mechanically.</action>
  <verify>python -m pytest research/knowledge-hub/tests/test_aitp_service.py::AITPServiceTests::test_ensure_topic_shell_surfaces_persists_source_backed_l1_intake research/knowledge-hub/tests/test_aitp_service.py::AITPServiceTests::test_ensure_topic_shell_surfaces_persists_l1_conflict_candidates -q</verify>
  <acceptance_criteria>
    - normalized contradiction rows still load under the existing `l1_source_intake` contradiction path
    - each contradiction row carries both source refs, both reading-depth values, and explicit comparison-basis content
    - schema contracts cover the richer contradiction row shape
  </acceptance_criteria>
  <done>The contradiction row contract is rich enough to explain the conflict instead of only flagging it.</done>
</task>

<task type="auto">
  <name>Task 2: Derive richer contradiction rows from existing intake facts</name>
  <files>research/knowledge-hub/knowledge_hub/l1_source_intake_support.py, research/knowledge-hub/knowledge_hub/source_distillation_support.py, research/knowledge-hub/tests/test_aitp_service.py</files>
  <read_first>research/knowledge-hub/knowledge_hub/l1_source_intake_support.py, research/knowledge-hub/knowledge_hub/source_distillation_support.py, research/knowledge-hub/tests/test_aitp_service.py, research/knowledge-hub/knowledge_hub/source_intelligence.py, .planning/phases/167-l1-contradiction-intake-rows-and-comparison-basis/167-CONTEXT.md</read_first>
  <action>Update the contradiction derivation path so richer contradiction rows are populated from already-extracted intake facts instead of ad hoc prose. Reuse the existing assumption rows, regime rows, reading-depth posture, and detector outputs to build the bounded comparison basis. Keep notation tensions separate and keep the output pairwise. Extend service tests so contradiction rows now show concrete compared content rather than only the old thin `detail` payload.</action>
  <verify>python -m pytest research/knowledge-hub/tests/test_aitp_service.py::AITPServiceTests::test_ensure_topic_shell_surfaces_persists_source_backed_l1_intake research/knowledge-hub/tests/test_aitp_service.py::AITPServiceTests::test_ensure_topic_shell_surfaces_persists_l1_conflict_candidates -q</verify>
  <acceptance_criteria>
    - contradiction rows are derived from durable intake facts already present in `L1`
    - the richer rows remain pairwise and source-backed
    - notation tension rows are unaffected
    - service fixtures prove the contradiction row now carries bounded comparison context
  </acceptance_criteria>
  <done>The richer contradiction row content is produced by the intake pipeline rather than only normalized after the fact.</done>
</task>

<task type="auto">
  <name>Task 3: Keep current contradiction-aware acceptance wiring compatible</name>
  <files>research/knowledge-hub/tests/test_runtime_scripts.py, research/knowledge-hub/runtime/scripts/run_l1_assumption_depth_acceptance.py, research/knowledge-hub/tests/test_aitp_service.py</files>
  <read_first>research/knowledge-hub/tests/test_runtime_scripts.py, research/knowledge-hub/runtime/scripts/run_l1_assumption_depth_acceptance.py, research/knowledge-hub/tests/test_aitp_service.py, .planning/phases/167-l1-contradiction-intake-rows-and-comparison-basis/167-CONTEXT.md</read_first>
  <action>Keep the existing contradiction-aware acceptance lane and its invocation coverage working after the richer row-shape upgrade. Adjust only what is necessary for compatibility in the assumption/depth acceptance path; do not widen into the broader runtime/read-path redesign reserved for Phase `167.1`. If richer contradiction rows make better assertions possible inside the existing lane, tighten them there without expanding the lane into a new milestone-proof script yet.</action>
  <verify>python -m pytest research/knowledge-hub/tests/test_runtime_scripts.py -k "l1_assumption_depth_acceptance" -q</verify>
  <acceptance_criteria>
    - `run_l1_assumption_depth_acceptance.py` still exits 0 through its current harness
    - runtime-script coverage still proves the contradiction-aware acceptance script remains callable
    - no Phase `167.1` read-path redesign is smuggled into this task
  </acceptance_criteria>
  <done>The richer contradiction row contract lands on a stable compatibility baseline.</done>
</task>

<task type="auto">
  <name>Task 4: Run the targeted contradiction-row regression slice</name>
  <files>research/knowledge-hub/tests/test_aitp_service.py, research/knowledge-hub/tests/test_schema_contracts.py, research/knowledge-hub/tests/test_runtime_scripts.py</files>
  <read_first>.planning/phases/167-l1-contradiction-intake-rows-and-comparison-basis/167-VALIDATION.md, research/knowledge-hub/tests/test_aitp_service.py, research/knowledge-hub/tests/test_schema_contracts.py, research/knowledge-hub/tests/test_runtime_scripts.py</read_first>
  <action>Run the validation commands declared in `167-VALIDATION.md`: first the focused service contradiction slice, then schema contracts, then the combined contradiction-row phase slice using the exact contradiction-related test node ids and the existing assumption-depth acceptance invocation test. If a regression appears, fix only the files already in scope for this plan and rerun until the declared slice is green.</action>
  <verify>python -m pytest research/knowledge-hub/tests/test_aitp_service.py::AITPServiceTests::test_ensure_topic_shell_surfaces_persists_source_backed_l1_intake research/knowledge-hub/tests/test_aitp_service.py::AITPServiceTests::test_ensure_topic_shell_surfaces_persists_l1_conflict_candidates research/knowledge-hub/tests/test_schema_contracts.py research/knowledge-hub/tests/test_runtime_scripts.py::RuntimeScriptTests::test_l1_assumption_depth_acceptance_script_runs_on_isolated_work_root -q</verify>
  <acceptance_criteria>
    - contradiction-focused service tests exit 0
    - schema contracts exit 0
    - the final contradiction-row phase slice exits 0
  </acceptance_criteria>
  <done>The contradiction-row upgrade sits on a green targeted regression baseline.</done>
</task>

</tasks>
