Repository navigation
Fix #1759: porch pending hides stale gate records and counts each project once - #1760
Conversation
…ject once A pending gate record stays listed forever even when the project moved past the gate's phase, finished (verified/complete), or recorded a merged PR; and the same committed status.yaml is counted once per builder worktree. One workspace showed 810 pending gates with none live. pending() now skips those records (listing only — nothing is written and approval stays a human, named act), dedupes by project id with the root copy winning, reports how many stale records it hid, and takes --all for the raw view. Tests cover each rule and the worktree dedupe.
|
Thank you for this. The worktree dedupe is the real win here: in this workspace every one of the 40 pending records with a 3-way integration review: gemini APPROVE, codex REQUEST_CHANGES, claude REQUEST_CHANGES. I verified the two blocking findings against the code myself. I would like to see three changes before merge:
Smaller, your call: the Worth knowing for expectations: with |
…, last-entry merged rule scoped to the pr gate, unknown phase fails open; --all in docs - pending() now iterates listAllProjects() (Spec 653 order: builder worktrees first, root copy as fallback), so a stale root copy cannot hide a live gate in the active worktree. Test uses divergent copies. - The merged rule reads the LAST pr_history entry (#966) and applies only to the pr gate: SPIR/ASPIR verify after the merge, so a merged PR never hides verify-approval. Tests for checkpoint-then-open and for verify-approval. - A current phase the protocol does not list fails open (upgrade / custom / legacy state), as does an undeclared gate. - JSDoc moved onto pending(); --all mentioned in the four porch SKILL.md copies, commands/overview.md and the cheatsheet.
|
Review addressed in cdcb0e5:
Smaller items: JSDoc now sits on |
Fixes #1759.
What
porch pendinglisted every gate record still markedpending, regardless of whether the project had moved past that gate, finished, or merged its PR, and counted the same committedstatus.yamlonce per builder worktree copy. A long-lived workspace showed 810 gates pending approval, none of them live.Change (
packages/codev/src/commands/porch/index.ts)isStalePendingGate(state, gate, protocol): stale when the phase is terminal (verified/complete), whenpr_historyrecords a merged PR, or when the protocol's phase index for the gate is behind the project's current phase (a phase not in the protocol at all counts as finished). Protocol load failures fall back to the terminal/merged rules only.pending()dedupes by project id (rootcodev/projectscopy wins; a worktree-only project is still listed), hides stale records, and prints how many it hid.porch pending --allshows the raw view; help text updated.Listing only: no record is written, and approval remains a human, named act.
Tests
__tests__/pending-stale-gates.test.ts: each stale rule, the no-protocol fallback, the hidden count,--all, and the worktree dedupe. Porch suite 502/502,tsc --noEmitclean.