Skip to content

Needs Attention: surface PRs via the universal pr gate; delete gateless builder-derived fallbacks #927

@waleedkadous

Description

@waleedkadous

Problem

Needs Attention has accreted a builder-state-derived model that is fragile and wrong. It surfaces builder rows (not just PRs), keeps merged PRs showing, and hides ready PRs — three faces of one root cause: bugfix attention is derived from porch terminal/builder state (derivePrReady's bugfix && phase==='verified' fallback, the pr_ready_for_human field, and the defensive builder-emit branch in NeedsAttentionList.buildItems) instead of from the PR.

Key finding: the universal signal already exists

Every PR-producing protocol already has a pr gate — bugfix, air (on the pr phase), spir, aspir, pir (on the review phase). The pr gate going pending (set by porch after the PR phase / CMAP completes) is the uniform "PR ready for human, after CMAP" signal across all protocols. No new marker/abstraction is needed.

The entire mess traces to one deviation: a gateless bugfix variant (observed on an external adopter, codev 3.1.4, 4-phase investigate/fix/verify/pr with no pr gate). With no pr gate, the dashboard fell back to the fragile bugfix && verified derivation + builder-emit. The gated path never broke (it self-heals through rollback by re-requesting the pr gate).

Desired behavior

Needs Attention = (A) open PRs whose linked builder has a pending pr gate, surfaced as PR rows ∪ (B) genuine pre-PR/post-merge human gate rows (spec-approval, plan-approval, dev-approval, verify-approval). Never a builder standing in for a PR.

Direction (spec to flesh this out)

  1. Surface open PRs whose builder's pr gate is pending (the universal post-CMAP signal). Emit PR rows only — find the open PR; if not found (cache miss), do not emit a builder row.
  2. Delete the bugfix && phase==='verified' fallback in derivePrReady and the builder-emit branch in NeedsAttentionList.buildItems. These exist only to cope with the gateless case.
  3. Keep the gate-row path for spec/plan/dev/verify-approval, and the unaffiliated/human-PR reviewDecision === REVIEW_REQUIRED fallback.
  4. A protocol must carry a pr gate for its PR to surface (the universal contract). Gateless PR-producing variants won't surface PR rows by design — adopters use the pr-gated protocol.
  5. EXPERIMENT/MAINTAIN don't follow the CMAP-PR pattern (they have experiment-complete/maintain-complete gates) — they surface via those completion gates, not PR rows. State this explicitly.

Relationships

Out of scope

  • Per-protocol bespoke markers (the pr gate is the universal signal).
  • Changing pre-PR gate semantics.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions