Skip to content

feat(my-pr-monitor): redirect Phase 1 — disabled discovery task#406

Closed
johnjansen wants to merge 1 commit into
mainfrom
feat/pr-monitor-redirect
Closed

feat(my-pr-monitor): redirect Phase 1 — disabled discovery task#406
johnjansen wants to merge 1 commit into
mainfrom
feat/pr-monitor-redirect

Conversation

@johnjansen

Copy link
Copy Markdown
Owner

Summary

Lands Phase 1 of the my-pr-monitor redirect (dw/ideas/2026-05-29-my-pr-monitor-redirect.md §9.4): a new discover + diff + notify task that ships disabled alongside the existing my-pr-monitor.md. The existing task is not edited.

When eventually enabled (plan step 9.6, behind a separate brief that ships the workspace-side responder), this task replaces JJ-Monitor's triage loop with a routing model — anvil sees, the originating workspace acts.

  • New task .anvil/todos/p2/my-pr-monitor-discover.md, disabled: true, schedule */15 ready for activation
  • Allowed_tools = sibling task's set minus Bash(git:*), Edit, Write; plus Bash(cmux:*)
  • Recall keyspace: new events collection (pending / delivered / acked / superseded), keyed <kind>:<head_sha>:<discriminator>; disjoint from the existing task's comments / checks / notifications writes so the two coexist without collision during the validation window
  • Four event kinds: new_review_comment, ci_failure, merge_conflict, ready_to_merge
  • Origin resolution: cached origin_workspace_ref → branch-prefix lookup against cmux list --jsonparking:pr-triage synthetic ref
  • Three-channel delivery: recall (truth) + cmux paint (color/progress/status, idempotent re-paint on stale delivered) + terminal-notifier for ready_to_merge only (gated by the existing notifications/ready-to-merge key)
  • head_sha rollover supersedes events / comments / checks cleanly

Hard rules preserved + sharpened

  • never merge any PR
  • no git, no worktrees, no yarn, no typecheck (workspace concerns now)
  • no PR comments, no review replies, no gh pr ready, no update-branch, no requested_reviewers, no force-push, no API merge — this task is silent on GitHub
  • terminal-notifier only for ready_to_merge; never re-fired for the same head_sha
  • PrimerAI org filter retained
  • anvil never escalates — the cmux pill staying Rose and the Phase 4 stdout report are the escalation surface

Out of scope (separate briefs)

  • §9.2 origin-registration shell hook on gh pr create
  • §9.3 backfill of origin_workspace_ref for currently-open PRs
  • §9.5 parking workspace + workspace-side responder
  • §9.6 enable + 5-cycle validation
  • §9.7 cutover (schedule: '' on the existing task)
  • §9.8 burn-in

Test plan

  • new file present at .anvil/todos/p2/my-pr-monitor-discover.md
  • frontmatter has disabled: true
  • git check-ignore reports the new file as not ignored; runtime state under .anvil/runs/, .anvil/git-state/, etc. remains ignored
  • existing .anvil/todos/p2/my-pr-monitor.md unchanged (zero diff)
  • CI green
  • human enable later via plan step 9.6

… Phase 1)

Lands `.anvil/todos/p2/my-pr-monitor-discover.md` per the redirect plan
(`dw/ideas/2026-05-29-my-pr-monitor-redirect.md` §9.4). The new task
coexists with the existing `my-pr-monitor.md` until plan step 9.6
validates ≥ 5 cycles with no recall keyspace conflict; the existing task
is not edited.

The new task is **discover + diff + notify**, full stop:

  - reads `gh search prs author:@me` + `gh pr view` + GraphQL review
    threads (read-only on the repo)
  - diffs against recall and emits four event kinds keyed by
    `<kind>:<head_sha>:<discriminator>`: `new_review_comment`,
    `ci_failure`, `merge_conflict`, `ready_to_merge`
  - resolves the originating workspace via cached
    `origin_workspace_ref`, falling back to branch-prefix lookup against
    `cmux list --json`, then to a `parking:pr-triage` synthetic ref
  - delivers events through three layered channels: recall (truth),
    `cmux color/progress/status` paint of the target workspace
    (visible projection), and `terminal-notifier` for `ready_to_merge`
    only (gated by the existing `notifications/ready-to-merge` key for
    cross-task idempotency)
  - re-paints stale `delivered` events idempotently but never re-fires
    `terminal-notifier`
  - supersedes events / comments / checks on `head_sha` rollover

Hard rules preserved from the sibling task and sharpened for the
redirect: no `git`, no worktrees, no `yarn`, no PR comments, no review
replies, no `gh pr ready`, no `update-branch`, no `requested_reviewers`,
no force-push, no API merge. PrimerAI org filter retained. Anvil never
escalates — the cmux pill staying Rose and the Phase 4 stdout report are
the escalation surface.

Ships `disabled: true` so it never runs until plan step 9.6 explicitly
enables it. Recall keyspace `events` is disjoint from the existing
task's `comments` / `checks` / `notifications` writes, so the two tasks
can run side-by-side during the validation window without collision.

Refs: dw/ideas/2026-05-29-my-pr-monitor-redirect.md
@johnjansen johnjansen closed this May 29, 2026
@johnjansen johnjansen deleted the feat/pr-monitor-redirect branch May 29, 2026 04:46
@johnjansen johnjansen restored the feat/pr-monitor-redirect branch May 29, 2026 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant