← Back to Pull requests

Keep headless sessions out of route-feedback votes (#1370) #600

Merged
knyttes-bot merged 6 files (42 lines) on Nov 11, 2026 00:03 UTC
View on GitHub
knyttes-bot knyttes-bot commented on Nov 10, 2026 23:59 UTC
Author

Beacon now sends an auto flag (same test as base.html); server stores it as a trailing CSV column; summary counts auto rows as excluded_auto and leaves them out of votes/texts. Old 7-column rows read as human.

🤖 Generated with Claude Code

<!-- greptile_comment -->

<!-- greptile_summary -->

<h2><a href="https://app.greptile.com/api/retrigger?id=102586352&amp;sig=a88296f4de6d850a29ceca4068cb75116cb38928f173d705c34412c687cc5507"><picture><source media="(prefers-color-scheme: dark)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/RetriggerDark.svg?v=2"><source media="(prefers-color-scheme: light)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2"><img alt="Retrigger" src="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2" align="right"></picture></a><a href="https://app.greptile.com/-/switch-tenant?tenant=hitchwiki&amp;next=%2FHitchwiki%2Fmaps.hitchwiki.org%2Fpull%2F600&amp;utm_source=greptile_review&amp;utm_medium=github&amp;utm_campaign=view_in_greptile"><picture><source media="(prefers-color-scheme: dark)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/ViewInGreptileDark.svg?v=2"><source media="(prefers-color-scheme: light)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/ViewInGreptile.svg?v=2"><img alt="View in Greptile" src="https://greptile-static-assets.s3.amazonaws.com/badges/ViewInGreptile.svg?v=2" align="right"></picture></a>Confidence Score: 4/5</h2>

<!-- greptile-risk -->

The PR appears safe to merge, with a non-blocking gap in tests for saving and reading the automation flag.

<h2>Findings</h2>

1. <img alt="P2" src="https://greptile-static-assets.s3.amazonaws.com/badges/p2.svg?v=9" align="top">&nbsp;Lost flags escape these tests <a href="https://github.com/Hitchwiki/maps.hitchwiki.org/pull/600#discussion_r4532134654">▶</a>

<h3>Summary</h3>

Adds an auto flag to route-feedback requests and saves it as a trailing CSV column.

  • Route-feedback summaries leave headless browser votes out of their totals.
  • <!-- greptile_confidence_score:4 -->

    <sub>Reviews (1) · Last reviewed commit: "Fix line length (ruff)" · Reviewed by Greptile</sub>

    <!-- /greptile_comment -->

    Diff: 42 lines (+37 / -5) across 6 files Reviewer: greptile-apps[bot] Review duration: 4m
    All Vouch review confidence checks passed
    Residual risk 0.15 = Change Risk (0.48) × (1 − Review Confidence (0.68)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.48 · 42 lines diff across 6 files
    0.48
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.62 · 2 substantive comment(s)
    0.62
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    68%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.225
    Rapid Merge rapid_merge
    0.100
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    3 items
    github-actions[bot] github-actions[bot] commented on Nov 11, 2026 00:01 UTC
    Bot

    <!-- hitchwiki-maps-coverage-report -->

    Coverage overview

    | Suite | Status | Lines | Branches | Functions |
    | --- | --- | ---: | ---: | ---: |
    | Python (hitch/) | ✅ Passing | 51.90% | 42.42% | — |
    | JavaScript unit tests | ✅ Passing | 92.83% | 93.11% | 91.42% |

    Coverage is collected from the deterministic pull-request suite. Live Nostr
    relay checks remain excluded so a third-party outage cannot make a PR flaky.

    greptile-apps[bot] greptile-apps[bot] commented on code on Nov 11, 2026 00:02 UTC
    Code Review
    tests/test_route_demand.py:1
    @@ -83,3 +83,16 @@ def test_route_feedback_counts_only():
         assert (out["votes_up"], out["votes_down"], out["with_text"], out["unparsable_rows"]) == (1, 1, 1, 1)
         assert out["corridors"][0]["up"] == 1 and out["corridors"][0]["down"] == 1
         assert "secret" not in str(out)
    +
    +
    +def test_route_feedback_excludes_auto_rows():
    +    from hitch.blueprints.utils.route_demand import summarise_route_feedback
    +
    +    base = {"start_lat": "47.1", "start_lon": "7.1", "dest_lat": "52.1", "dest_lon": "13.1"}
    +    rows = [
    +        {**base, "vote": "up", "text": "", "auto": "1"},
    +        {**base, "vote": "down", "text": "x", None: ["1"]},  # legacy 7-col header, 8th value
    +        {**base, "vote": "up", "text": "", "auto": "0"},
    +    ]
    +    out = summarise_route_feedback(rows)
    +    assert (out["votes_up"], out["votes_down"], out["excluded_auto"]) == (1, 0, 2)

    <a href="#"><img alt="P2" src="https://greptile-static-assets.s3.amazonaws.com/badges/p2.svg?v=9" align="top"></a> Lost flags escape these tests

    The new test builds rows by hand, so it still passes if the server drops auto or the logger stops saving it. Automated votes could then silently count as human feedback.

    Add a test that posts automated and human feedback, reads the saved CSV, and checks the summary. Include an existing seven-column file to cover appending rows to an old log.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

    Assignees
    knyttes-bot knyttes-bot
    Labels
    risk: low confidence: 68.4% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 47.8% (MEDIUM) · Higher = larger blast radius
    47.8%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 68.4% · Lower = rushed or shallow review
    68.4%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 15.1% · Safe to merge
    15.1%