Skip to main content

Pr Watcher

@mgreten/pr-watcherv2026.07.31.1· 8d agoMODELS
01README

Autonomous PR-feedback investigation engine: watch a feed of pull-request feedback, spawn a coding agent to investigate each PR against its diff, propose actions, notify via ntfy with an Approve button, and optionally apply an approved fix inside an isolated worktree (build, test, push to the PR branch).

02Release Notes

Automated republish 2026.07.31.1 (regression suite + quality 14/14)

03Models1
@mgreten/pr-watcherv2026.07.31.1pr_watcher.ts

Global Arguments

ArgumentTypeDescription
feedModelstring
repoPathstring
githubRepostring
repoDescriptionstring
cliAgentModelstring
subCallRepoDirstring
ntfyTopicstring
ntfyBaseUrlstring
ntfyExtraTagstring
investigateProviderstring
investigateModelIdstring
providerCatalogModelstringName of the @mgreten/agent-provider-catalog instance holding the fleet's provider/model table. Reading {provider, model} from the catalog instead of hardcoding it makes a fleet-wide provider migration one catalog edit rather than a per-consumer sweep.
useProviderCatalogbooleanRead {provider, model} from providerCatalogModel instead of investigateProvider/investigateModelId. ON by default so this model follows the fleet. Fail-open: a missing or broken catalog falls back to the literals rather than failing the investigation.
catalogRolestringRole name handed to the catalog's resolveAgentDispatch. The catalog's own roleMap folds it onto an abstract role, so this model never needs the catalog's internal role vocabulary.
investigateTimeoutMsnumber
tdPathstring
todoistProjectstring
todoistLabelstring
worktreeModelstring
phaseRunnerModelstring
approvalTopicstring
suppressFixNotificationsboolean
sandboxModeenumSandbox mode passed to cli-agent for the investigate phase: default
sandboxRequiredbooleanIf true (default), cli-agent fails closed (throws) when the
fn investigate(prNumber: number, eventIds?: array)
Investigate new feedback on a PR by spawning a coding agent via
ArgumentTypeDescription
prNumbernumberPR number to investigate
eventIds?arraySpecific event IDs to investigate (defaults to all for the PR)
fn investigateBatch(prNumbers: array)
Investigate new feedback on multiple PRs in a single execution.
ArgumentTypeDescription
prNumbersarrayPR numbers to investigate in this batch
fn notify(investigationId: string)
Send an ntfy notification summarizing an investigation with proposed
ArgumentTypeDescription
investigationIdstringID of the investigation to notify about
fn approve(investigationId: string, decision: enum, approvalHash?: string, userNote?: string)
Record a user decision (approve, reject, modify, defer) for an
ArgumentTypeDescription
investigationIdstring
decisionenum
approvalHash?stringRequired, and must match the investigation's fixCandidate, when
userNote?string
fn act(investigationId: string)
Execute approved non-write actions for an investigation (draft
ArgumentTypeDescription
investigationIdstring
fn executeWorktreeFix(investigationId: string)
DEPRECATED — fails closed. This single-shot build-then-push method
ArgumentTypeDescription
investigationIdstring
fn buildFixCandidate(investigationId: string)
Build and test an approved-to-BUILD push_fix inside a throwaway
ArgumentTypeDescription
investigationIdstring
fn pushApprovedFix(investigationId: string)
Push a hash-approved fixCandidate to the PR's head branch. Gated
ArgumentTypeDescription
investigationIdstring

Resources

investigation(14d)— cli-agent investigation result with proposed actions for PR feedback
action(14d)— User decision record for an investigation (approved, rejected, modified)
fixRun(14d)— Audit record of a worktree-isolated autonomous push_fix execution:
fixCandidate(1d)— A built-and-tested push_fix, captured as a portable git-bundle
04Previous Versions16
2026.07.23.1

Fix chronic O(N) feed-scan wedge in loadFeedbackEvents: name pre-filter (eventNamesForPr) fetches only the target PR's events instead of the whole feed, plus an 8-min wall-budget safety net.

2026.07.16.2

Wire resolveGithubToken to secret-access file contract (vault-backed); fail-closed actor push

2026.07.16.1

Rebuild against swamp CLI 20260716

2026.07.14.1

fix(investigate): halt alert gated on genuine fail-closed sandbox errors (checked before shellout fallback); PR diff fetched host-side and embedded in prompt (readonly profile has no shell); agent grounded in dedicated repo-scoped worktree detached at PR head instead of the operator's live checkout.

2026.07.13.4
2026.07.13.3
2026.07.13.2

Modified 1 models

2026.07.13.1
2026.07.10.2
2026.07.10.1
2026.07.08.1
2026.06.27.2
2026.06.27.1
2026.06.26.3

Add suppressFixNotifications globalArg: lets a caller deliver the fix result notification itself (for quiet-hours deferral).

2026.06.26.2

Fix: emoji in ntfy HTTP headers (Title/Actions) broke every notification with a ByteString error; emoji moved to ntfy tag names + body, asciiHeader() guard added.

2026.06.26.1

Initial release: generic PR-feedback investigation engine (investigate, notify, approve, act) with opt-in worktree-isolated autonomous fixes.

05Stats
A
100 / 100
Downloads
7
Archive size
66.8 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License declared1/1earned
  • Verified public repository2/2earned
06Platforms