{
  "_meta": {
    "test": "Test 0.8 \u2014 single-valuedness audit",
    "jiraTicket": "SAIL-157",
    "purpose": "Go/no-go gate: can CLRerNet (self-driving lane-detection model) serve as a challenger stripe-finder? Requires every stripe to be single-valued (a function, never doubling back) along the luff->leech axis once the photo is conceptually rotated 90deg so that axis becomes the lane-detector row axis. That rotation maps onto the ORIGINAL image's x-axis, so this is pure geometry on stored label points -- no pixels rotated, no model run.",
    "holdoutFile": "server/inference/test-holdout-ids-canonical.json",
    "holdoutFrozen": "2026-08-25",
    "holdoutCount": 332,
    "holdoutSources": {
      "unified-300": 300,
      "live-v1": 32
    },
    "photosAudited": 332,
    "photosMissingFromAudit": [],
    "dataProvenance": {
      "local_labels_jsonl": 209,
      "r2_fetch_live": 123,
      "note": "209/332 holdout ids are north-sails-sourced records already present in server/inference/training-data/labels.jsonl (a local training-time cache, not the source of truth). The remaining 123 are app-uploaded photos whose ids are UUID-form and are NOT in that local cache (it's a fallback; R2 is authoritative per train.py's load_labels()). Those 123 were fetched read-only directly from the sailscan-labels R2 bucket via labels/<id>.json GETs (same lookup labelStore.js::getLabel() performs), no images, no writes."
    },
    "generatedBy": "server/inference/gate0-singlevalued-audit (SAIL-157, ad hoc script, geometry-only)",
    "methodology": "Per stripe: take the x-coordinate sequence of its labeled points in stored order. Dominant direction = sign(x_last - x_first) (ties broken by sign of the sum of signed steps). A step against that direction is a 'backward excursion'; we take the single largest backward step per stripe (in px) and also express it as % of the stripe's own x-span. Three severity tiers are reported because hand-labeled 7-9 point polylines carry pixel jitter that is not a real curl-back.",
    "tierDefinitions": {
      "strict": "any backward step, any magnitude (px > 0)",
      "moderate_2px": "backward excursion > 2px",
      "tolerant_1pct_span": "backward excursion > 1% of the stripe's own x-span (jitter-tolerant; primary go/no-go tier)"
    },
    "primaryTierForVerdict": "tolerant_1pct_span",
    "verdictThresholds": {
      "greenlight": "< 2% tolerant-tier stripe violation rate",
      "borderline_go": "2%-3%",
      "no_go": "> 3%"
    }
  },
  "verdict": {
    "call": "GREENLIGHT",
    "primaryTier": "tolerant_1pct_span",
    "primaryStripeViolationRate": 0.012797,
    "primaryStripeViolationRatePct": 1.28,
    "summary": "14 of 1094 labeled stripes (1.28%) double back on themselves by more than 1% of their own luff->leech span. This clears the ~2-3% bar: CLRerNet's single-valued-per-row lane assumption holds for SailScan stripes."
  },
  "tierSummaries": {
    "strict": {
      "definition": "any backward step, any magnitude (px > 0)",
      "stripeViolations": 16,
      "totalStripes": 1094,
      "stripeViolationRate": 0.014625,
      "photosWithAnyViolation": 6,
      "totalPhotos": 332,
      "photoViolationRate": 0.018072,
      "bySource": {
        "app-r2": {
          "stripes": 405,
          "violations": 8,
          "rate": 0.019753
        },
        "north-sails": {
          "stripes": 689,
          "violations": 8,
          "rate": 0.011611
        }
      },
      "worstOffenders": [
        {
          "photoId": "3393ed66-2f9e-43b1-91cf-a96d30b1904d",
          "stripeIndex": 0,
          "stripeHeight": "top",
          "maxBackwardPx": 61,
          "xSpanPx": 120,
          "backwardPctOfSpan": 50.83,
          "source": "app-r2"
        },
        {
          "photoId": "618f2d8b-6489-48fc-b168-ec657df98db3",
          "stripeIndex": 4,
          "stripeHeight": "Bottom stripe",
          "maxBackwardPx": 41.689,
          "xSpanPx": 1500,
          "backwardPctOfSpan": 2.78,
          "source": "app-r2"
        },
        {
          "photoId": "3393ed66-2f9e-43b1-91cf-a96d30b1904d",
          "stripeIndex": 1,
          "stripeHeight": "stripe-2",
          "maxBackwardPx": 26,
          "xSpanPx": 92,
          "backwardPctOfSpan": 28.26,
          "source": "app-r2"
        },
        {
          "photoId": "564c75e1-f65c-4a8b-ae98-ec19a0fc951d",
          "stripeIndex": 3,
          "stripeHeight": "bottom",
          "maxBackwardPx": 21,
          "xSpanPx": 123,
          "backwardPctOfSpan": 17.07,
          "source": "app-r2"
        },
        {
          "photoId": "564c75e1-f65c-4a8b-ae98-ec19a0fc951d",
          "stripeIndex": 1,
          "stripeHeight": "stripe-2",
          "maxBackwardPx": 17,
          "xSpanPx": 53,
          "backwardPctOfSpan": 32.08,
          "source": "app-r2"
        },
        {
          "photoId": "699c7862f3202f4810796f7b",
          "stripeIndex": 1,
          "stripeHeight": "50%",
          "maxBackwardPx": 9,
          "xSpanPx": 339,
          "backwardPctOfSpan": 2.65,
          "source": "north-sails"
        },
        {
          "photoId": "699c7862f3202f4810796f7b",
          "stripeIndex": 0,
          "stripeHeight": "25%",
          "maxBackwardPx": 8,
          "xSpanPx": 1259,
          "backwardPctOfSpan": 0.64,
          "source": "north-sails"
        },
        {
          "photoId": "69a4c2667974572cf817c9c0",
          "stripeIndex": 0,
          "stripeHeight": "25%",
          "maxBackwardPx": 8,
          "xSpanPx": 658,
          "backwardPctOfSpan": 1.22,
          "source": "north-sails"
        },
        {
          "photoId": "564c75e1-f65c-4a8b-ae98-ec19a0fc951d",
          "stripeIndex": 2,
          "stripeHeight": "stripe-3",
          "maxBackwardPx": 7,
          "xSpanPx": 36,
          "backwardPctOfSpan": 19.44,
          "source": "app-r2"
        },
        {
          "photoId": "69a4c2667974572cf817c9c0",
          "stripeIndex": 1,
          "stripeHeight": "50%",
          "maxBackwardPx": 7,
          "xSpanPx": 203,
          "backwardPctOfSpan": 3.45,
          "source": "north-sails"
        },
        {
          "photoId": "69a4c2667974572cf817c9c0",
          "stripeIndex": 2,
          "stripeHeight": "75%",
          "maxBackwardPx": 5,
          "xSpanPx": 63,
          "backwardPctOfSpan": 7.94,
          "source": "north-sails"
        },
        {
          "photoId": "3393ed66-2f9e-43b1-91cf-a96d30b1904d",
          "stripeIndex": 3,
          "stripeHeight": "bottom",
          "maxBackwardPx": 4,
          "xSpanPx": 58,
          "backwardPctOfSpan": 6.9,
          "source": "app-r2"
        },
        {
          "photoId": "564c75e1-f65c-4a8b-ae98-ec19a0fc951d",
          "stripeIndex": 0,
          "stripeHeight": "top",
          "maxBackwardPx": 2,
          "xSpanPx": 24,
          "backwardPctOfSpan": 8.33,
          "source": "app-r2"
        },
        {
          "photoId": "699c7862f3202f4810796f7b",
          "stripeIndex": 2,
          "stripeHeight": "75%",
          "maxBackwardPx": 2,
          "xSpanPx": 99,
          "backwardPctOfSpan": 2.02,
          "source": "north-sails"
        },
        {
          "photoId": "69f37dc11c24feac644bdb63",
          "stripeIndex": 1,
          "stripeHeight": "50%",
          "maxBackwardPx": 2,
          "xSpanPx": 265,
          "backwardPctOfSpan": 0.75,
          "source": "north-sails"
        }
      ]
    },
    "moderate_2px": {
      "definition": "backward excursion > 2px",
      "stripeViolations": 12,
      "totalStripes": 1094,
      "stripeViolationRate": 0.010969,
      "photosWithAnyViolation": 5,
      "totalPhotos": 332,
      "photoViolationRate": 0.01506,
      "bySource": {
        "app-r2": {
          "stripes": 405,
          "violations": 7,
          "rate": 0.017284
        },
        "north-sails": {
          "stripes": 689,
          "violations": 5,
          "rate": 0.007257
        }
      },
      "worstOffenders": [
        {
          "photoId": "3393ed66-2f9e-43b1-91cf-a96d30b1904d",
          "stripeIndex": 0,
          "stripeHeight": "top",
          "maxBackwardPx": 61,
          "xSpanPx": 120,
          "backwardPctOfSpan": 50.83,
          "source": "app-r2"
        },
        {
          "photoId": "618f2d8b-6489-48fc-b168-ec657df98db3",
          "stripeIndex": 4,
          "stripeHeight": "Bottom stripe",
          "maxBackwardPx": 41.689,
          "xSpanPx": 1500,
          "backwardPctOfSpan": 2.78,
          "source": "app-r2"
        },
        {
          "photoId": "3393ed66-2f9e-43b1-91cf-a96d30b1904d",
          "stripeIndex": 1,
          "stripeHeight": "stripe-2",
          "maxBackwardPx": 26,
          "xSpanPx": 92,
          "backwardPctOfSpan": 28.26,
          "source": "app-r2"
        },
        {
          "photoId": "564c75e1-f65c-4a8b-ae98-ec19a0fc951d",
          "stripeIndex": 3,
          "stripeHeight": "bottom",
          "maxBackwardPx": 21,
          "xSpanPx": 123,
          "backwardPctOfSpan": 17.07,
          "source": "app-r2"
        },
        {
          "photoId": "564c75e1-f65c-4a8b-ae98-ec19a0fc951d",
          "stripeIndex": 1,
          "stripeHeight": "stripe-2",
          "maxBackwardPx": 17,
          "xSpanPx": 53,
          "backwardPctOfSpan": 32.08,
          "source": "app-r2"
        },
        {
          "photoId": "699c7862f3202f4810796f7b",
          "stripeIndex": 1,
          "stripeHeight": "50%",
          "maxBackwardPx": 9,
          "xSpanPx": 339,
          "backwardPctOfSpan": 2.65,
          "source": "north-sails"
        },
        {
          "photoId": "699c7862f3202f4810796f7b",
          "stripeIndex": 0,
          "stripeHeight": "25%",
          "maxBackwardPx": 8,
          "xSpanPx": 1259,
          "backwardPctOfSpan": 0.64,
          "source": "north-sails"
        },
        {
          "photoId": "69a4c2667974572cf817c9c0",
          "stripeIndex": 0,
          "stripeHeight": "25%",
          "maxBackwardPx": 8,
          "xSpanPx": 658,
          "backwardPctOfSpan": 1.22,
          "source": "north-sails"
        },
        {
          "photoId": "564c75e1-f65c-4a8b-ae98-ec19a0fc951d",
          "stripeIndex": 2,
          "stripeHeight": "stripe-3",
          "maxBackwardPx": 7,
          "xSpanPx": 36,
          "backwardPctOfSpan": 19.44,
          "source": "app-r2"
        },
        {
          "photoId": "69a4c2667974572cf817c9c0",
          "stripeIndex": 1,
          "stripeHeight": "50%",
          "maxBackwardPx": 7,
          "xSpanPx": 203,
          "backwardPctOfSpan": 3.45,
          "source": "north-sails"
        },
        {
          "photoId": "69a4c2667974572cf817c9c0",
          "stripeIndex": 2,
          "stripeHeight": "75%",
          "maxBackwardPx": 5,
          "xSpanPx": 63,
          "backwardPctOfSpan": 7.94,
          "source": "north-sails"
        },
        {
          "photoId": "3393ed66-2f9e-43b1-91cf-a96d30b1904d",
          "stripeIndex": 3,
          "stripeHeight": "bottom",
          "maxBackwardPx": 4,
          "xSpanPx": 58,
          "backwardPctOfSpan": 6.9,
          "source": "app-r2"
        }
      ]
    },
    "tolerant_1pct_span": {
      "definition": "backward excursion > 1% of the stripe's own x-span (jitter-tolerant; primary go/no-go tier)",
      "stripeViolations": 14,
      "totalStripes": 1094,
      "stripeViolationRate": 0.012797,
      "photosWithAnyViolation": 6,
      "totalPhotos": 332,
      "photoViolationRate": 0.018072,
      "bySource": {
        "app-r2": {
          "stripes": 405,
          "violations": 8,
          "rate": 0.019753
        },
        "north-sails": {
          "stripes": 689,
          "violations": 6,
          "rate": 0.008708
        }
      },
      "worstOffenders": [
        {
          "photoId": "3393ed66-2f9e-43b1-91cf-a96d30b1904d",
          "stripeIndex": 0,
          "stripeHeight": "top",
          "maxBackwardPx": 61,
          "xSpanPx": 120,
          "backwardPctOfSpan": 50.83,
          "source": "app-r2"
        },
        {
          "photoId": "618f2d8b-6489-48fc-b168-ec657df98db3",
          "stripeIndex": 4,
          "stripeHeight": "Bottom stripe",
          "maxBackwardPx": 41.689,
          "xSpanPx": 1500,
          "backwardPctOfSpan": 2.78,
          "source": "app-r2"
        },
        {
          "photoId": "3393ed66-2f9e-43b1-91cf-a96d30b1904d",
          "stripeIndex": 1,
          "stripeHeight": "stripe-2",
          "maxBackwardPx": 26,
          "xSpanPx": 92,
          "backwardPctOfSpan": 28.26,
          "source": "app-r2"
        },
        {
          "photoId": "564c75e1-f65c-4a8b-ae98-ec19a0fc951d",
          "stripeIndex": 3,
          "stripeHeight": "bottom",
          "maxBackwardPx": 21,
          "xSpanPx": 123,
          "backwardPctOfSpan": 17.07,
          "source": "app-r2"
        },
        {
          "photoId": "564c75e1-f65c-4a8b-ae98-ec19a0fc951d",
          "stripeIndex": 1,
          "stripeHeight": "stripe-2",
          "maxBackwardPx": 17,
          "xSpanPx": 53,
          "backwardPctOfSpan": 32.08,
          "source": "app-r2"
        },
        {
          "photoId": "699c7862f3202f4810796f7b",
          "stripeIndex": 1,
          "stripeHeight": "50%",
          "maxBackwardPx": 9,
          "xSpanPx": 339,
          "backwardPctOfSpan": 2.65,
          "source": "north-sails"
        },
        {
          "photoId": "69a4c2667974572cf817c9c0",
          "stripeIndex": 0,
          "stripeHeight": "25%",
          "maxBackwardPx": 8,
          "xSpanPx": 658,
          "backwardPctOfSpan": 1.22,
          "source": "north-sails"
        },
        {
          "photoId": "564c75e1-f65c-4a8b-ae98-ec19a0fc951d",
          "stripeIndex": 2,
          "stripeHeight": "stripe-3",
          "maxBackwardPx": 7,
          "xSpanPx": 36,
          "backwardPctOfSpan": 19.44,
          "source": "app-r2"
        },
        {
          "photoId": "69a4c2667974572cf817c9c0",
          "stripeIndex": 1,
          "stripeHeight": "50%",
          "maxBackwardPx": 7,
          "xSpanPx": 203,
          "backwardPctOfSpan": 3.45,
          "source": "north-sails"
        },
        {
          "photoId": "69a4c2667974572cf817c9c0",
          "stripeIndex": 2,
          "stripeHeight": "75%",
          "maxBackwardPx": 5,
          "xSpanPx": 63,
          "backwardPctOfSpan": 7.94,
          "source": "north-sails"
        },
        {
          "photoId": "3393ed66-2f9e-43b1-91cf-a96d30b1904d",
          "stripeIndex": 3,
          "stripeHeight": "bottom",
          "maxBackwardPx": 4,
          "xSpanPx": 58,
          "backwardPctOfSpan": 6.9,
          "source": "app-r2"
        },
        {
          "photoId": "564c75e1-f65c-4a8b-ae98-ec19a0fc951d",
          "stripeIndex": 0,
          "stripeHeight": "top",
          "maxBackwardPx": 2,
          "xSpanPx": 24,
          "backwardPctOfSpan": 8.33,
          "source": "app-r2"
        },
        {
          "photoId": "699c7862f3202f4810796f7b",
          "stripeIndex": 2,
          "stripeHeight": "75%",
          "maxBackwardPx": 2,
          "xSpanPx": 99,
          "backwardPctOfSpan": 2.02,
          "source": "north-sails"
        },
        {
          "photoId": "69f37dc11c24feac644bdb63",
          "stripeIndex": 2,
          "stripeHeight": "75%",
          "maxBackwardPx": 1,
          "xSpanPx": 85,
          "backwardPctOfSpan": 1.18,
          "source": "north-sails"
        }
      ]
    }
  },
  "spanStats": {
    "stripesWithDegenerateSpan": 0,
    "note": "degenerate span = stripe's points span <1e-6px in x (should not occur with real labels)",
    "medianXSpanPx": 399.5,
    "minXSpanPx": 24,
    "maxXSpanPx": 4683
  }
}