{
  "id": "result_migration_gui_2_20260619",
  "name": "Result Migration - Sub-Track 4 (gui_2.py)",
  "date": "2026-06-19",
  "type": "refactor",
  "priority": "A",
  "spec": "conductor/tracks/result_migration_gui_2_20260619/spec.md",
  "plan": "conductor/tracks/result_migration_gui_2_20260619/plan.md",
  "status": "active",
  "umbrella": "result_migration_20260616",
  "sub_track_index": 4,
  "blocked_by": {
    "result_migration_app_controller_20260618": "shipped 2026-06-19 (with Phase 7); the data plane (8 controller state attributes) is ready"
  },
  "blocks": {
    "result_migration_baseline_cleanup": "blocked by this track; date TBD when this track ships"
  },
  "scope": {
    "new_files": [
      "tests/test_gui_2_result.py",
      "docs/reports/TRACK_COMPLETION_result_migration_gui_2_20260619.md",
      "tests/artifacts/PHASE1_SITE_INVENTORY.md"
    ],
    "modified_files": [
      "src/gui_2.py",
      "conductor/tracks.md",
      "conductor/tracks/result_migration_gui_2_20260619/state.toml",
      "conductor/tracks/result_migration_gui_2_20260619/metadata.json",
      "conductor/tracks/result_migration_gui_2_20260619/plan.md",
      "conductor/tracks/result_migration_gui_2_20260619/spec.md",
      "conductor/tracks/result_migration_20260616/spec.md"
    ],
    "deleted_files": []
  },
  "verification_criteria": [
    "src/gui_2.py has zero INTERNAL_BROAD_CATCH sites (38 migrated across Phases 3, 4, 5)",
    "src/gui_2.py has zero INTERNAL_SILENT_SWALLOW sites (13 migrated in Phase 10; per error_handling.md:530 logging is NOT a drain)",
    "src/gui_2.py has zero INTERNAL_RETHROW sites (2 classified or migrated in Phase 11 per Pattern 1/2/3)",
    "src/gui_2.py has zero UNCLEAR sites (2 classified in Phase 12)",
    "src/gui_2.py has the 3 new drain-plane render functions: render_controller_error_modal, _render_worker_error_indicator, _render_last_request_errors_modal (Phase 2)",
    "tests/test_gui_2_result.py has 55+ tests (42 site tests + 13 invariant tests), all pass",
    "uv run python scripts/audit_exception_handling.py --src src/gui_2.py --strict exits 0",
    "11-tier batched test suite passes with no new regressions",
    "Per-phase audit gates verified: each phase's invariant test confirms the expected count drop",
    "TIER-2 READ styleguide acknowledged in commit message at start of every phase (13 styleguide-ack commits)",
    "Git history shows 60+ atomic commits (42 site migrations + 13 phase setup commits + 3 infra commits + 2 docs commits)",
    "docs/reports/TRACK_COMPLETION_result_migration_gui_2_20260619.md covers all 13 phases",
    "conductor/tracks.md row updated to 'shipped 2026-06-XX'",
    "umbrella spec count updated to reflect actual scope (42 migration + 6 infra = 48 sites in this sub-track)"
  ],
  "regressions_and_pre_existing_failures": [],
  "pre_existing_failures_remaining": [],
  "deferred_to_followup_tracks": [
    {
      "title": "Sub-track 5: result_migration_baseline_cleanup",
      "description": "Close the remaining 77 violations in the 3 refactored baseline files (mcp_client.py, ai_client.py, rag_engine.py). Per umbrella sub-track 5.",
      "track_status": "planned (blocked by this track)"
    }
  ],
  "estimated_effort": {
    "method": "scope (per workflow.md Tier 1 Track Initialization Rules). NO day estimates.",
    "scope": "1 source file (src/gui_2.py) modified across 13 phases; 42 migration sites + 6 infra sites organized into 12 migration phases (3-12) + 1 setup phase (0) + 1 inventory phase (1) + 1 drain-plane phase (2) + 1 verification phase (13); 1 new test file (tests/test_gui_2_result.py) with 55+ tests; 4 metadata/plan/state/spec files; 1 end-of-track report; 1 site inventory doc. 60+ atomic commits."
  },
  "risk_register": [
    {
      "risk": "Tier 2 invents a laundering heuristic for the 2 UNCLEAR sites (L1349 from sub-track 1's review pass)",
      "likelihood": "medium",
      "mitigation": "Phase 12 forces explicit classification with comment per site; the Phase 7 heuristic (sub-track 3) already classifies correctly; 5 regression-guard tests in tests/test_audit_heuristics.py lock the heuristic"
    },
    {
      "risk": "Tier 2 doesn't migrate INTERNAL_SILENT_SWALLOW sites that 'look like' logging-only but aren't actually drained (the sliming pattern)",
      "likelihood": "medium",
      "mitigation": "Phase 1 inventory forces explicit classification per site BEFORE coding (tests/artifacts/PHASE1_SITE_INVENTORY.md); Phase 10's audit gate enforces 0 INTERNAL_SILENT_SWALLOW; styleguide re-read at start of Phase 10 explicitly calls out the sliming risk"
    },
    {
      "risk": "gui_2.py's render loop changes break the immediate-mode frame",
      "likelihood": "medium",
      "mitigation": "Render-loop sites are isolated in Phase 3 (Batch A); visual verification via live_gui tests; per-site unit tests verify success-path output is identical"
    },
    {
      "risk": "Scope grows as Tier 2 finds more sites mid-migration",
      "likelihood": "low",
      "mitigation": "Phase 1 inventory freezes the 42-site list; new sites discovered mid-migration are tracked but NOT migrated in this track (added to a follow-up)"
    },
    {
      "risk": "User's principle ('logging is NOT a drain') is misapplied",
      "likelihood": "low",
      "mitigation": "Styleguide re-read at start of each phase; commit-message acknowledgment ('TIER-2 READ ...'); 13 invariant tests verify per-phase progress"
    },
    {
      "risk": "Thread-safety violation in worker sites (Phase 7)",
      "likelihood": "low",
      "mitigation": "app._worker_errors_lock is already in place (sub-track 3 Phase 6); multi-thread unit test (test_worker_<site>_thread_safe_under_concurrent_appends) verifies"
    },
    {
      "risk": "11-tier batched suite times out before all tiers run (per result_migration_small_files_20260617 Phase 12->13 incident)",
      "likelihood": "medium",
      "mitigation": "Phase 13 uses uv run python scripts/run_tests_batched.py (the fixed script from sub-track 2 Phase 13.1); if it times out, Tier 2 reports and the user decides"
    },
    {
      "risk": "Per-phase audit gate shows wrong count (heuristic misclassification)",
      "likelihood": "low",
      "mitigation": "The audit heuristic was verified by 5 regression-guard tests in sub-track 3 Phase 7; if a count is wrong, Tier 2 reports"
    }
  ]
}