Skip to content

Prevent two rows both showing the same pull request ready for review #2154

Closed

Description

@JacobStephens2
Screenshot 2026-11-13 at 10 34 57 AM

PR 116 was probably worked on by both of these hosts, so now shows with two rows, which I don't need - makes it look like there are more PRs to review than there actually are

Activity

  1. added
    enhancement
    needs-triage
    in-progress
    and removed
    needs-triage
    on Nov 13, 2026
  2. JacobStephens2 commented on Nov 13, 2026

    @JacobStephens2
    OwnerAuthor

    This was generated by AI during triage.

    Investigation summary

    Confirmed on Base main at c84de08. The supplied screenshot shows five Ready for review rows for four distinct PRs: #116 appears under both factory and orchestrate.

    An isolated reproduction using the current binary, temporary records and a loopback Fleet server returned two Ready for review rows for one PR in status --json. With the Console's /events stream open, its HTML also rendered two rows and displayed a section count of 2.

    Diagnosis

    • src/logs/status/fleet.rs:138 appends remote Commands; subsequent sorting does not consolidate matching PRs.
    • src/logs/status/inbox.rs:236-270 independently appends remote Console rows without cross-host consolidation.
    • src/logs/reading/inbox.rs:994 implements later-Command take-up using starts captured on the owning machine. A later Command on another host cannot supersede that machine's waiting row.
    • src/console/inbox.html counts section.rows.len(), so duplicate rows inflate the review count.

    This confirms a presentation problem. It does not establish that PR #116 was dispatched twice.

    Decision and proposed split

    Use a Spec to settle grouped-row and Dismissal semantics, followed by two dependent Tickets:

    1. Define a shared Ready for review grouping projection keyed by normalized full PR identity, retaining each contributing Command's machine, account, selector and facts. Test cross-host duplicates, overlapping local Commands, URL normalization and equal PR numbers in different repositories.
    2. Use that projection for Console and CLI presentation and unique-PR counts, preserve access to member details and correctly authorized actions, and update documentation. This depends on Ticket 1.

    The decision matters because current Dismissal forms identify one machine and Command (src/console/dismiss.rs:11), and Fleet actions route to one owner. Silently dropping a duplicate would also hide its details and controls. Preserve owning-machine records and active-run accounting. Existing regression coverage includes tests/console/fleet.rs:258, tests/status.rs:797 and src/logs/reading/tests.rs:879.

    No matching open issue was found. No GitHub writes or source changes were made.

    Questionnaire

    For the Day shift: #2154 is reproduced. Two machines reporting the same PR produce two Ready for review rows and inflate its count. The requested single-row behavior needs decisions about the Commands represented by that row.

    1. Approve a two-Ticket Spec: first, shared grouping by full PR identity with retained member Commands and regression tests; second, Console/CLI presentation, unique-PR counts, controls and documentation, depending on the first. Should the row summarize the latest completion and expose all contributing Commands in its details?
    2. Should Dismiss affect one member Command, selectable in the grouped details, or every represented Command? If every member, how should partial failures, read-only members and unavailable hosts appear, and what should Undo restore?
    3. Should status --json preserve its existing commands array and add a derived grouping representation, or change the array to grouped entries? Preserving the raw Commands is recommended for existing consumers.
  3. added
    ready-for-human
    and removed
    in-progress
    on Nov 13, 2026
  4. JacobStephens2 commented on Nov 20, 2026

    @JacobStephens2
    OwnerAuthor

    This was generated by AI during triage.

    Agent Brief

    Category: enhancement
    Summary: Show each pull request once in Ready for review, retaining access to every contributing Command.

    Scope decision: Treat #2154 as one standalone Ticket. This brief supersedes the earlier two-Ticket Spec proposal and questionnaire. Keep Dismissal per contributing Command's existing Dismissal target, and preserve the existing JSON contract. There is no cross-machine bulk action to design.

    Current behavior and evidence:
    The original screenshot and the November 13 triage reproduction show the same PR under two machines, inflating Ready for review's row count. Inspection at Base commit ff56084a confirms that Fleet status appends remote Commands and the Console separately appends their presentation rows; neither consolidates Ready for review by PR identity. The Console counts those rows. Existing local Pass/dispatched-run deduplication does not cover independent Commands across machines. The earlier runtime reproduction was not rerun during this shaping pass. Duplicate display does not establish duplicate dispatch.

    Desired behavior:

    • After existing owning-machine evaluation, visibility and machine/repository selection, project the visible Ready for review entries into one top-level row per validated GitHub PR identity. Use parsed repository identity (case-insensitive owner/repository) plus PR number, including the parser's supported trailing-slash variants. Reuse existing PR parsing, repository-link validation and IssueUrl::identity(); missing, invalid or mismatched PR identities remain independent entries. Never group by PR number alone, issue number, title or branch.
    • Apply the same grouping rule to the Console Inbox and human-readable thirdshift status, including local-only and selected-machine views. Only entries already in Ready for review participate: a live Command or Needs you row on the same PR stays in its own section. Keep owning-machine hand-off, retention and GitHub evaluation rules.
    • A Console group has one PR heading/link, latest-completion title/timing summary, contributing-Command count and machine/account labels. Order groups by their newest member using the existing Ready for review ordering; use a deterministic member-identity tie-break. Keep the group identity stable across member changes and refreshes.
    • For a group with multiple members, expose every contributing Command in expandable details, preserving its machine, account, exact selector, timestamps, state, child-run context, logs, Session traces and existing authorized controls. These are contributing Commands, not newly invented parent/child Run relationships. A single-member group keeps the ordinary usable row.
    • Show CI/conflict/staleness facts with their contributing Command. Do not synthesize an all-clear CI summary from one member while another member reports red, conflict, unknown or stale facts. Multi-member summaries must visibly flag any member's CI red, Merge conflict or stale/unavailable state; details retain the individual evidence.
    • Dismiss and Undo remain operations on a specifically identified member's existing Dismissal target, including whatever Commands that target already covers. Put those controls beside the member, labelled with its owner; offer no ambiguous whole-PR Dismiss button. Dismissing one member leaves the PR row while another visible member still waits. Undo restores that member subject to existing evaluation rules. Other-account, report-only, stale and unavailable members retain existing action restrictions. Use existing owning-machine authorization and routing.
    • Human-readable status prints one PR heading per group, followed by indented member identity/details sufficient to inspect or act on each Command with existing CLI commands.
    • Preserve the raw commands array and current schema/version of status --json and the Console status API. Grouping is a derived presentation; no new JSON representation is required. Preserve Command records, history, active-run accounting and per-machine totals.

    Key interfaces:

    • Read, Fleet Document and the existing Console/text Inbox presentations: share the PR grouping rule after selection, retaining member observations rather than discarding duplicates.
    • PullRequestUrl and IssueUrl::identity(): reuse supported URL validation and identity normalization.
    • Inbox, Section and Row: Ready for review counts represent top-level PR groups; member details preserve their own identities and permissions.
    • Existing Dismiss/Undo forms, CLI selectors and owning-machine action routes: retain their contracts. Follow the Console API ADR's ownership and authorization rules.

    Acceptance criteria:

    • With two machines reporting PR User config, with merge.always and --no-merge #116 plus three other distinct PRs, Console Ready for review shows four top-level rows and all its counts show 4; PR User config, with merge.always and --no-merge #116 exposes both members. Human-readable status also has one top-level entry for User config, with merge.always and --no-merge #116.
    • Distinct eligible Commands on one machine, including different OS accounts, group by the same rule. Supported URL spelling variants group together; the same PR number in different repositories stays separate. Missing/invalid/mismatched PR identities remain separate and visible.
    • Member order, group order and group identity are deterministic regardless of Fleet response order. Machine/repository selection includes only matching members and recomputes counts. Refreshes preserve one top-level PR row as members arrive or leave.
    • All member details/log links remain reachable. Existing Pass/dispatched-run behavior remains correct; rendered IDs stay unique and keyboard/expand behavior works.
    • Regression coverage exercises per-member Dismiss and Undo with two members, and mixed actionable/read-only or stale members. An action reaches only its existing owning-machine target; it cannot dismiss another independent member or gain permissions through grouping.
    • Conflicting CI evidence and stale/unavailable member evidence remain visible. Selecting a newer member cannot silently erase another member's warning.
    • JSON/API regression coverage retains both original member Commands with their metadata and the existing schema/version. Active-run totals, history, unrelated sections, local take-up and retention remain unchanged.
    • Add meaningful shared-grouping, CLI/Fleet and rendered Console/browser regression coverage. Use the repo's Console/UI verification workflows and capture the required Visual evidence. Update Inbox/Dismissal documentation for PR groups and member controls, regenerate affected documentation, and correct relevant hand-written site descriptions. Run the repository's required affected-tests validation before delivery.

    Out of scope:
    Cross-host dispatch prevention or take-up changes; grouping other Inbox sections; whole-PR/bulk Dismissal, distributed Undo or new permissions; JSON/API schema changes; data migrations, releases or production-host changes.

  5. added
    ready-for-agent
    in-progress
    and removed
    ready-for-human
    ready-for-agent
    on Nov 20, 2026
  6. removed
    in-progress
    on Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions