{
  "status": "PASS_FOR_ASSUMED_LOCAL_SIMULATION_ONLY",
  "validatedAt": "2026-10-28T10:05:31.133Z",
  "unitTests": {
    "status": "PASS",
    "checks": [
      "complete default green/yellow/all-red sequence and unknown red",
      "manual requests preserve full yellow/all-red without restarting or skipping clearance",
      "latest request during clearance is applied only after full clearance",
      "invalid inputs reject atomically, including oversized dt",
      "global pause and deterministic reset",
      "large dt follows every phase and relief expiry, equivalent to fine stepping",
      "green-only discharge and explicitly simulated relief expiry",
      "queues bounded and conflicting greens absent under repeated manual commands",
      "extensible phases require explicit compatible groups; EW/NS conflict cannot be overridden",
      "snapshots detached and road IDs qualified by junction",
      "unmapped or explicitly ineligible roads are not given simulated signal throughput or relief",
      "explicitly ineligible signals remain red even if their input group is configured"
    ]
  },
  "integration": {
    "status": "PASS",
    "dataFile": "outputs/shuinan-vector-scope/simulation/data.json",
    "junctions": 3,
    "roads": 55,
    "eligibleRoads": 21,
    "excludedRoads": 34,
    "signals": 19,
    "unknownAlwaysRed": 11,
    "elapsedSimulationSeconds": 3605,
    "checks": [
      "all three manual requests pass through yellow and all-red",
      "no simultaneous EW and NS greens",
      "all unknown signals stay red",
      "ineligible roads remain excluded from throughput and relief",
      "normalized congestion remains bounded after large dt",
      "road IDs retain junction prefixes",
      "reset reproduces initial state",
      "data explicitly declares officialTimingAvailable=false"
    ]
  },
  "fixedBug": {
    "input": "signal {group:EW, simulationEligible:false}",
    "before": "green was incorrectly possible because eligibility was ignored",
    "after": "explicitly excluded signals are forced to UNKNOWN and red",
    "regressionTest": "included in 12 unit-test checks",
    "currentDataImpact": "Current excluded input signals already use UNKNOWN, so the observed production dataset did not trigger the bug."
  },
  "sourceDirectionReview": {
    "result": "GEOMETRIC_GROUPS_ARE_NOT_ACTUAL_SIGNAL_PHASES",
    "evidence": [
      "data.assumptions states EW/NS derive from road tangent axes and exact node/way connectivity",
      "signal.evidence.groupIsActualSignalPhase=false and officialControllerConfirmed=false",
      "junction.phaseEvidence is ASSUMED_DEMONSTRATION_ONLY_NOT_OFFICIAL_TIMING",
      "engine exposes local-only control and assumed rates/timings"
    ],
    "requiredUILabels": [
      "假設方向群組／模擬時相，不是現場相序",
      "30秒綠／3秒黃／2秒全紅為示範假設",
      "UNKNOWN：未分組；紅燈是模擬保守狀態，不代表現場正在紅燈",
      "未納入號誌控制推演的道路保留參考色，不能用congestion=0宣稱暢通",
      "舒緩只修改模擬queue與需求，不能暗示正在控制真實路口"
    ],
    "remainingLimits": [
      "EW/NS互斥只驗證粗分組模型；尚未校核同組左轉、右轉、行人及其他實際衝突動作。",
      "OSM號誌節點與道路連接不證明共用控制器、真實燈頭數量或真實放行方向。",
      "全部路口以同一全域時鐘與初始EW啟動，不代表實際路口協調或綠波。",
      "crossings保留來源資料，但引擎尚未推演行人燈相；UI不得顯示已核實的行人相序。",
      "來源幾何或可納入推演資格不是交通量、道路容量或路寬實測。"
    ]
  },
  "hashes": {
    "engine": "6050ace9607f00b60158dd91f20fcfcabada1039cb305b5fe59f43875e6adbd1",
    "tests": "19e492f39053dabe011fb71aa4bf0b50a82d7bf30b8fd519e784c1274de542c3",
    "data": "6143fb14b11442195349c7d69b29f6e0bb39ae2812ffd3ffd0d2b3494bf583e8"
  },
  "physicalControllerConnection": false,
  "uiReview": {
    "status": "ALL_SIX_REPORTED_FIXES_VERIFIED_BY_CODE_REVIEW_ONLY",
    "reviewedAt": "2026-10-28T10:10:09.703Z",
    "method": "Read-only source re-review of fixes; no browser opened and no visual acceptance claimed. Runtime UI checks are the parent task responsibility.",
    "files": {
      "work/shuinan-vector-scope/simulation-overlay.mjs": "f26a6194d2985d8b710c9dcedf68f103e3498c17093bc7616e98e9669988d71f",
      "work/shuinan-vector-scope/stream-viewer.mjs": "aa21ced173dff2e0f1823906cfe9bcc87df79aecafa16b507855e0e1a59d6782",
      "work/shuinan-vector-scope/stream-viewer.html": "836560f70aa03a57dbcc3f1b7f0267f845d760789379085c478d6d0a654db667"
    },
    "passedByCodeInspection": [
      "Only selected.roads are drawn; choose() clears geometry/hit caches, so shared source ways across independent junction scenarios are not simultaneously colored.",
      "Engine state is retained in one sim instance and one global clock; viewport movement only changes graphic caches.",
      "Road Path2D cache is bounded to 64 records and non-wanted records are evicted; disabled/hidden/pagehide states clear caches and stop simulation timer.",
      "Ineligible source roads are not drawn as congestion lines; road selector explicitly labels them outside the signal-control scenario.",
      "Unknown current-data signal groups are drawn as gray question circles rather than presented as observed red lights.",
      "The warning identifies assumed timings and simplified direction groups; crossings are explicitly described as source positions without known markings/phase sizes."
    ],
    "findings": [
      {
        "id": "UI01",
        "priority": "P2",
        "status": "verified_code_fix",
        "file": "work/shuinan-vector-scope/stream-viewer.mjs",
        "evidence": "mountSimulation({...,focus:fit}) plus choose() calling focus(selected.viewBounds); fit() does not clear styled/proof.",
        "problem": "Enabling simulation after a PNG comparison or engineering-proof mode changes the camera to a different junction while retaining a restricted/diagnostic base layer. The first junction may then sit on gray blank area outside the nine PNG cells, or on the non-original line proof.",
        "requestedFix": "Use a dedicated simulation-focus callback that disables restricted styled/proof layers before fitting the selected junction, or explicitly requires a compatible base mode.",
        "fixReview": "Dedicated simulation focus now disables styled/proof, resets reference zoom to auto, clears local images and fits the selected bounds."
      },
      {
        "id": "UI02",
        "priority": "P2",
        "status": "verified_code_fix",
        "file": "work/shuinan-vector-scope/simulation-overlay.mjs",
        "evidence": "activate(): if(!data){ loading??=fetch(...); data=await loading; ... sim=createSimulation(data); ... append(new Option(...)) }",
        "problem": "Rapid enable-disable-enable while data is loading can leave multiple activate continuations awaiting the same promise. Each continuation initializes sim and appends options; this can reset the scenario clock and duplicate junction choices.",
        "requestedFix": "Use one initialization promise that includes data validation, sim creation and option population, with enabled/disposed checks before activation; do not run initialization in each await continuation.",
        "fixReview": "Initialization after shared loading promise is guarded by if(!sim), so only one synchronous continuation creates simulation/options."
      },
      {
        "id": "UI03",
        "priority": "P2",
        "status": "verified_code_fix",
        "file": "work/shuinan-vector-scope/stream-viewer.mjs",
        "evidence": "Simulation panel is mounted for areaKey views, while areaKey replaces index bounds/scopeRing with independent bridge windows.",
        "problem": "Manual enabling on the independent Guangfu bridge page still offers the three core junction scenarios. choose() focuses their bounds but constrain()/clip retain the bridge-only extent, so signals and roads can be clipped or absent.",
        "requestedFix": "Hide or disable this three-junction scenario on independent bridge review views, or navigate to the main candidate scope before enabling it.",
        "fixReview": "areaKey now hides the simulation panel immediately after mount, before the stream-index fetch; URL auto-enable remains restricted to !areaKey."
      },
      {
        "id": "UI04",
        "priority": "P3",
        "status": "verified_code_fix",
        "file": "work/shuinan-vector-scope/simulation-overlay.mjs",
        "evidence": "draw() clips to scopeRing, but inView(), hitSignals and hitRoads are filtered only by rectangular viewport bounds; pointerup uses those hit lists without a scope check.",
        "problem": "Geometry outside the visible scope clip can remain in hit-test lists, allowing clicks on visually clipped map objects.",
        "requestedFix": "Reject pointer hit testing outside the scope polygon, and filter displayed/hit signals by effective clip membership.",
        "fixReview": "Pointer hit tests now reject clicks outside scopeRing and only include signal centers inside scope."
      },
      {
        "id": "UI05",
        "priority": "P2",
        "status": "verified_code_fix",
        "file": "work/shuinan-vector-scope/stream-viewer.mjs",
        "evidence": "retryTimer is created once and cleared on pagehide with once:true; pageshow only schedules render.",
        "problem": "After a BFCache restore, the base/local/overview image retry timer is not recreated. A failed image load may remain failed after its initial attempt unless another viewport event triggers pump().",
        "requestedFix": "Start/stop the image retry timer with page lifecycle using an idempotent start method, including pageshow restart.",
        "fixReview": "Image retry timer now uses idempotent startRetry and is restarted on pageshow after pagehide clears it."
      },
      {
        "id": "UI06",
        "priority": "P3",
        "status": "verified_code_fix",
        "file": "work/shuinan-vector-scope/simulation-overlay.mjs",
        "evidence": "Unknown marker styling and click behavior read raw s.group; engine normalizes simulationEligible:false signals to UNKNOWN regardless of raw group.",
        "problem": "For future data with simulationEligible:false but group EW/NS, engine remains safely red but UI still styles the marker as assigned and lets the user request that direction. Current data does not trigger this case.",
        "requestedFix": "Use engine-normalized state.group, or require simulationEligible!==false as well as a known raw group, when styling and allowing marker clicks.",
        "fixReview": "Marker styling and hit signal groups now use engine-normalized state.group."
      }
    ],
    "directionInterpretation": "Current warning is appropriate for an assumed local demo. Preserve it on every enabled scenario. Do not promote EW/NS source geometry into verified physical controller phase groups; left/right-turn and pedestrian conflicts remain outside this coarse model.",
    "notVerified": [
      "Browser visual rendering, pointer alignment, rapid-toggle reproduction and BFCache behavior were not exercised here.",
      "No measured traffic or official timing was validated."
    ],
    "rereviewedAt": "2026-10-28T10:13:28.161Z",
    "remainingFindings": [],
    "additionalFixObserved": "Re-enabling an existing scenario now calls focus(selected.viewBounds); the dedicated focus callback clears incompatible layers and fit() restores the base viewer paused=false state."
  }
}