Skip to content

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

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

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

Conversation

@johnjansen

Copy link
Copy Markdown
Owner

Summary

Phase 1 of the my-pr-monitor redirect (dw/ideas/2026-05-29-my-pr-monitor-redirect.md §9.4): new discover + diff + notify task that ships disabled alongside my-pr-monitor.md. Existing task untouched.

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

  • New .anvil/todos/p2/my-pr-monitor-discover.md, disabled: true, schedule */15
  • allowed_tools = sibling minus Bash(git:*), Edit, Write; plus Bash(cmux:*)
  • Recall keyspace: new events collection (pending / delivered / acked / superseded), keyed <kind>:<head_sha>:<discriminator> — disjoint from sibling's comments / checks / notifications writes
  • 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 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 — 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 — cmux pill staying Rose + Phase 4 stdout report = escalation surface

Out of scope (separate briefs)

  • §9.2 gh pr create origin-registration hook
  • §9.3 backfill 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 existing task)
  • §9.8 burn-in

Test plan

  • new file at .anvil/todos/p2/my-pr-monitor-discover.md
  • frontmatter disabled: true
  • runtime state under .anvil/runs/ etc. still ignored; only the new task file un-ignored
  • existing .anvil/todos/p2/my-pr-monitor.md unchanged
  • CI green
  • human enables later via plan §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
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