# Phase 165.5-02 Graph Diff Runtime Summary

Status: implemented in working tree

## Goal

Close the next `999.83` slice by making concept-graph evolution durable across
topic iterations and visible in runtime-facing artifacts, instead of leaving
`graph_diff()` as an unused helper.

## What Landed

- `graph_analysis_tools.py` now supports runtime-surface materialization:
  - `graph_analysis_paths()`
  - `empty_graph_analysis()`
  - `build_graph_analysis_surface()`
  - `render_graph_analysis_markdown()`
  - `write_graph_analysis_history()`
- `topic_shell_support.py` now persists graph-analysis runtime artifacts under
  `runtime/topics/<topic>/`:
  - `graph_analysis.json`
  - `graph_analysis.md`
  - `graph_analysis_history.jsonl`
- graph-analysis runtime surfaces now include:
  - current surprising connections
  - current graph-derived question seeds
  - cross-iteration node/edge/god-node diff
  - history length across materializations
- runtime read path and status surfaces now project graph analysis:
  - `runtime_read_path_support.py`
  - `runtime_bundle_support.py`
  - topic dashboard markdown
  - `topic_status()` / `topic_next()` / `refresh_runtime_context()`
- `progressive-disclosure-runtime-bundle.schema.json` now includes a stable
  `graph_analysis` contract
- `l1_source_intake_support.py` now prefers fresh derived intake over stale
  persisted intake when new source-backed content exists, so concept-graph and
  other `L1` projections can evolve across re-materialization
- isolated acceptance now exists for the end-to-end diff path:
  - `runtime/scripts/run_l1_graph_diff_runtime_acceptance.py`

## Verification

- `python -m pytest research/knowledge-hub/tests/test_graph_analysis_tools.py -q`
- `python -m pytest research/knowledge-hub/tests/test_graph_analysis_runtime_support.py -q`
- `python -m pytest research/knowledge-hub/tests/test_literature_intake_support.py -q`
- `python -m pytest research/knowledge-hub/tests/test_aitp_service.py -q -k "graph_analysis or literature_intake_stage"`
- `python -m pytest research/knowledge-hub/tests/test_runtime_profiles_and_projections.py -q -k "graph_analysis or source_intelligence"`
- `python -m pytest research/knowledge-hub/tests/test_runtime_scripts.py -q -k "graph_analysis or mode_enforcement"`
- `python -m pytest research/knowledge-hub/tests/test_schema_contracts.py -q`
- `python research/knowledge-hub/runtime/scripts/run_l1_graph_diff_runtime_acceptance.py --json`

## Outcome

`999.83` now has a second closed runtime-facing slice:

- graph-analysis is no longer only a staging-side helper
- repeated `status` / runtime-bundle materialization can now track concept-graph
  drift across iterations
- graph evolution is visible to both machine and human runtime surfaces

## Remaining Open Work Inside 165.5-02 / 999.83

- richer graph heuristics beyond shared-label/shared-foundation bridges
- graph-diff-aware downstream actions beyond runtime reporting
- any route- or promotion-level policy that interprets graph drift as a stronger
  gating signal than ordinary staging drift
