pullfrog 0.1.43 → 0.1.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -101093,7 +101093,7 @@ var import_semver = __toESM(require_semver2(), 1);
101093
101093
  // package.json
101094
101094
  var package_default = {
101095
101095
  name: "pullfrog",
101096
- version: "0.1.43",
101096
+ version: "0.1.44",
101097
101097
  type: "module",
101098
101098
  bin: {
101099
101099
  pullfrog: "dist/cli.mjs",
@@ -101775,16 +101775,8 @@ HARD CONSTRAINTS (non-negotiable, regardless of orchestrator instructions):
101775
101775
 
101776
101776
  Report findings clearly with file:line references and quoted evidence where possible. Flag uncertainty explicitly \u2014 if you cannot verify a claim, say so rather than guess.`;
101777
101777
 
101778
- // utils/promptProfile.ts
101779
- function promptProfile() {
101780
- return process.env.PULLFROG_PROMPT_PROFILE === "full" ? "full" : "lean";
101781
- }
101782
- function byProfile(lean, full) {
101783
- return promptProfile() === "lean" ? lean : full;
101784
- }
101785
-
101786
101778
  // modes.ts
101787
- var PR_SUMMARY_FORMAT_LEAN = `### Default format
101779
+ var PR_SUMMARY_FORMAT = `### Default format
101788
101780
 
101789
101781
  The body has at most three parts, in this order:
101790
101782
 
@@ -101816,7 +101808,6 @@ line callout as POTENTIALLY STALE and re-diff before acting on it.
101816
101808
  - Reviewed commits:
101817
101809
  - {sha_short} \u2014 {commit_subject}
101818
101810
  - Prior pullfrog review: none or {prior_sha_short} ({prior_review_html_url})
101819
- - Submitted at: {iso_timestamp}
101820
101811
  -->
101821
101812
  \`\`\`
101822
101813
 
@@ -101846,150 +101837,6 @@ Every body \`### \` section carries one; an inline comment carries one when its
101846
101837
  The 4-backtick fence lets the block hold its own 3-backtick fences and stay one-click copyable. Skip the optional sections when they'd add nothing.
101847
101838
 
101848
101839
  Backtick-wrap identifiers and file names. Don't repeat diff content, don't include raw \`+123 / -45\` stats, no changelog, no horizontal rules, and no \`### Key changes\` / \`### Issues found\` / \`<b>TL;DR</b>\` heading \u2014 each \`### \` heading IS the issue.`;
101849
- var PR_SUMMARY_FORMAT_FULL = `### Default format
101850
-
101851
- The body has at most three parts in this exact order:
101852
-
101853
- 1. **Reviewed changes preamble** \u2014 one bolded inline lead-in describing what was reviewed in this run, a bullet list of the substantive changes, and an HTML comment carrying review metadata for downstream agents.
101854
- 2. **Cross-cutting issue sections** (zero or more) \u2014 one \`### \` heading per concern, with a human-readable problem write-up and a collapsed \`<details>Technical details</details>\` block underneath.
101855
- 3. **\`### \u2139\uFE0F Nitpicks\`** at the very bottom (only if there are nits worth surfacing in the body) \u2014 a flat bullet list, no technical-details block.
101856
-
101857
- Inline-vs-body split: concerns that anchor to a specific line go inline (use the \`comments\` parameter). Body \`### \` sections are reserved for concerns that **have no line to anchor to** \u2014 typically because the concern is about *absence* (something the diff should have done but didn't), *sequencing* (rollout / deletion / migration order), *design decisions only the human can make*, or *scope questions the diff implicitly raises but doesn't address*. A concern that anchors to a line but has broad implications still goes inline (use the technical-details block there to capture the implications \u2014 see Inline technical details below). If you found no non-anchorable concerns, the body has zero \`### \` issue sections \u2014 just the preamble + metadata.
101858
-
101859
- ## 1. Reviewed changes preamble
101860
-
101861
- Open with a single bolded inline lead-in followed immediately by the bullet list (no \`### Key changes\` heading, no \`<b>TL;DR</b>\`):
101862
-
101863
- \`\`\`
101864
- **Reviewed changes** \u2014 one sentence on what was reviewed in this run. For Review (initial), this is what the PR does and why. For IncrementalReview, this is what changed since the prior pullfrog review. Focus on intent, not mechanics.
101865
-
101866
- - **Short human-readable title** \u2014 1 sentence per substantive change. Write a short prose phrase; when you name a file, type, or function, put that name in backticks (e.g. **Add \\\`TodoTracker\\\` for live checklists**). A reviewer should understand the full reviewed scope from this list alone \u2014 this IS the dispassionate "what was reviewed and what changed" overview, so cover the substantive changes, not just the loudest ones.
101867
-
101868
- <!--
101869
- Pullfrog review metadata \u2014 for any agent (or human-with-agent) reading this
101870
- review. Incorporate the fields below into your understanding of the context
101871
- this review was made in. The findings below were written against
101872
- {head_sha_short}; if new commits have landed on {head_ref} since this review
101873
- was submitted, treat any specific bug, file, or line callout as POTENTIALLY
101874
- STALE \u2014 re-diff against {head_sha_short} (or trigger a fresh review) and
101875
- factor commits past {head_sha_short} into your understanding of the current
101876
- state before acting on findings.
101877
-
101878
- - Mode: Review (initial) or IncrementalReview (delta against prior pullfrog review)
101879
- - Files reviewed: {file_count}
101880
- - Commits reviewed: {commit_count}
101881
- - Base: {base_ref} ({base_sha_short})
101882
- - Head: {head_ref} ({head_sha_short})
101883
- - Reviewed commits:
101884
- - {sha_short} \u2014 {commit_subject}
101885
- - ...
101886
- - Prior pullfrog review: none or {prior_sha_short} ({prior_review_html_url})
101887
- - Submitted at: {iso_timestamp}
101888
- -->
101889
- \`\`\`
101890
-
101891
- Pull every metadata field from the \`checkout_pr\` tool's response \u2014 file count, commit count, base/head ref + SHA, the commit list. For \`IncrementalReview\` runs, populate \`Prior pullfrog review\` with the prior review's commit_id (short SHA) and \`html_url\` from \`list_pull_request_reviews\`.
101892
-
101893
- ## 2. Cross-cutting issue sections (zero or more)
101894
-
101895
- For each cross-cutting concern, one \`### \` section. Use this exact shape:
101896
-
101897
- \`\`\`
101898
- ### {emoji} {short, descriptive title \u2014 what's wrong, not what to do}
101899
-
101900
- {Human-readable problem write-up. Describes the PROBLEM only \u2014 what's broken, what the symptom is, what the blast radius is. NO asks, NO suggested fixes, NO "the right thing to do is...". Asks and fixes live in the technical-details block below; the visible part is for the human to *understand* the problem, not to implement it.}
101901
-
101902
- <details><summary>Technical details</summary>
101903
-
101904
- \\\`\\\`\\\`\\\`markdown
101905
- # {title repeated}
101906
-
101907
- ## Affected sites
101908
- - {file path:line} \u2014 {what's wrong there}
101909
- - ...
101910
-
101911
- ## Required outcome
101912
- - {what the fix needs to achieve, not how to achieve it}
101913
- - ...
101914
-
101915
- ## Suggested approach (optional)
101916
- {When the fix shape is non-obvious, sketch one or more reasonable directions. Skip when the outcome alone makes the fix obvious.}
101917
-
101918
- ## Open questions for the human (optional)
101919
- - {Any decision an implementing agent shouldn't make unilaterally \u2014 pricing thresholds, breaking-change policy, naming, scope of follow-up.}
101920
- \\\`\\\`\\\`\\\`
101921
-
101922
- </details>
101923
- \`\`\`
101924
-
101925
- Concrete example of the visible part of a non-anchored section (technical-details block unchanged from the template above):
101926
-
101927
- \`\`\`
101928
- ### \u2139\uFE0F Legacy \`opencode.ts\` has no documented deletion plan
101929
-
101930
- The v2 harness lands alongside the v1 file and imports one helper from it. Worth a follow-up issue or a TODO so the next maintainer doesn't have to re-derive the cleanup plan.
101931
- \`\`\`
101932
-
101933
- The example's value is its *shape*: a finding about absence (no deletion plan), not a line-anchored bug. Body sections live or die on whether the concern genuinely doesn't fit on a line.
101934
-
101935
- **Heading severity emoji** \u2014 every \`### \` heading carries one:
101936
-
101937
- - \u{1F6A8} critical \u2014 blocks merge (data loss, security, broken core flow)
101938
- - \u26A0\uFE0F important \u2014 must address before merging (regression, missing validation, incorrect behavior)
101939
- - \u2139\uFE0F informational \u2014 surfaced for awareness; mergeable as-is
101940
-
101941
- **Visible problem write-up rules:**
101942
-
101943
- - **No asks, no suggested fixes** in the visible part. The visible portion describes the problem; the technical-details block describes the fix shape and any open questions. The exception: a fix so self-evident that NOT stating it would be weird (e.g. "the typo is missing an 'r'") \u2014 in that case, fold it into the problem statement and skip the suggested-approach block in technical details too.
101944
- - **Never two successive plain paragraphs.** Every transition between block-level elements must alternate prose with structure: paragraph \u2192 bullet list \u2192 paragraph; paragraph \u2192 code fence \u2192 bullet list; paragraph \u2192 table \u2192 paragraph. Two consecutive paragraphs in a row create a wall of text that's impossible to digest. If you catch yourself writing one, find a way to split it: pull a list out of it, drop a 2-3 line code fence between them, or merge them into a single tighter paragraph.
101945
- - **Per-paragraph budget:** ~3 sentences max. Past that, you're explaining where you should be structuring.
101946
- - **Identifier discipline still applies** in the visible part. Lead with behavior in plain English; name an identifier only when it's the subject of the concern or a public surface a reader would recognize. The technical-details block is where dense identifier references belong.
101947
-
101948
- **Technical-details block rules:**
101949
-
101950
- - Wrapped in a 4-backtick markdown fence (\`\\\`\\\`\\\`\\\`markdown ... \\\`\\\`\\\`\\\`\`) so it's visually distinct, one-click copyable, and can contain its own 3-backtick code fences without escape gymnastics. The contents are agent-readable \u2014 a fix-agent will pull the body down and use this block as the brief.
101951
- - File paths and \`file:line\` refs are encouraged (and necessary) \u2014 the next agent uses these to navigate. Identifier density is fine here.
101952
- - Slightly more verbose than the absolute minimum is OK when it materially helps the next agent: a small code snippet showing the symptom, a short table of mismatched key/column pairs, a one-paragraph "why CI doesn't catch it" note. Skip massive regression-test scaffolding or full route rewrites \u2014 the implementing agent writes those.
101953
- - Use the four standard sections (\`Affected sites\`, \`Required outcome\`, optional \`Suggested approach\`, optional \`Open questions for the human\`). Skip the optional sections when they wouldn't add anything.
101954
-
101955
- ## Inline technical details
101956
-
101957
- Inline comments are short (~2-3 sentences) by default. When an inline finding has broader implications worth recording for a fix-agent \u2014 e.g. a localized bug whose proper fix requires touching several files, or where the right fix depends on a design decision the human needs to make \u2014 append a collapsed \`<details><summary>Technical details</summary>\` block to the inline comment's body. Same shape as the body-section technical-details block (4-backtick fenced markdown, \`## Affected sites\` / \`## Required outcome\` / optional \`## Suggested approach\` / optional \`## Open questions for the human\`).
101958
-
101959
- GitHub renders the same markdown parser in inline comments as in the review body, so the collapsed-details affordance works the same way. The visible part of the inline comment stays scannable; the depth is one click away for any agent that needs it.
101960
-
101961
- ## 3. \`### \u2139\uFE0F Nitpicks\` (optional, last section)
101962
-
101963
- Only when there are nits that for some reason can't be inlined. Filepaths in nit text are fine \u2014 these are simple enough that a human or agent reads once and acts. No technical-details block.
101964
-
101965
- \`\`\`
101966
- ### \u2139\uFE0F Nitpicks
101967
-
101968
- - {nit, with file path inline if useful, \u2264 ~200 chars}
101969
- - ...
101970
- \`\`\`
101971
-
101972
- ## Inline comment shape
101973
-
101974
- Inline comments use the same severity framing as body \`### \` sections, scaled down for line-anchored use:
101975
-
101976
- - **Lead with a 1-2 sentence problem statement.** The reader is looking at the line in question, so don't restate what the line says \u2014 describe what's wrong with it. Optionally prefix the visible line with a severity emoji (\u{1F6A8} / \u26A0\uFE0F / \u2139\uFE0F) when severity isn't obvious from context.
101977
- - **Optional \`<details><summary>Technical details</summary>...</details>\` collapsible** for findings whose technical context (longer file:line references, related-code snippets, suggested approach, regression-risk notes) would overwhelm the human-readable lead-in. Same agent-readable purpose, same 4-backtick fence shape, and same 4-section structure as the body's technical-details block \u2014 see *Inline technical details* above. Encouraged whenever the depth helps a downstream fix-agent; don't force one when the inline lead-in already says everything.
101978
- - **Visible portion \u2264 2-3 sentences.** If you find yourself writing more, that's the cue to split the depth into the \`Technical details\` collapsible.
101979
-
101980
- ## Body-wide rules
101981
-
101982
- - **Inline-vs-body discipline (repeated for emphasis):** anything that anchors to a specific line goes inline (with a \`<details>Technical details</details>\` block when the implications are broad). The body is for non-anchorable concerns only \u2014 absence, sequencing, design decisions, scope questions, architectural risk.
101983
- - **No \`### Issues found\` heading** above the issue sections \u2014 each \`### \` heading IS the issue.
101984
- - **Severity emoji on every \`### \` heading** (\u{1F6A8} / \u26A0\uFE0F / \u2139\uFE0F). No emoji on the preamble lead-in or anywhere else.
101985
- - **GitHub block-level rendering**: GitHub's markdown parser requires a blank line between ALL block-level elements (HTML tags like \`<br/>\`, \`<sub>\`, \`<details>\`, \`<b>\` and markdown syntax like headings, lists, blockquotes, code fences, paragraphs). Without a blank line, GitHub treats following content as a continuation of the HTML block and renders markdown syntax as literal text. ALWAYS separate block-level elements with a blank line.
101986
- - **Backtick-wrap** every variable, identifier, or file name when you mention one (in either visible or technical-details portions).
101987
- - **Don't repeat diff content**, don't include raw \`+123 / -45\` stats, don't include a changelog section, don't use horizontal rules (\`---\`).
101988
- - **Pull file/commit counts from \`checkout_pr\` metadata** \u2014 never count manually.
101989
- - **Legacy headings REMOVED.** Do not use \`### Key changes\`, \`### Issues found\`, \`<b>TL;DR</b>\`, or \`<sub><b>Summary</b>\`. The new structure subsumes them.`;
101990
- function prSummaryFormat() {
101991
- return byProfile(PR_SUMMARY_FORMAT_LEAN, PR_SUMMARY_FORMAT_FULL);
101992
- }
101993
101840
  function computeModes(agentId, signedCommits = false) {
101994
101841
  const t = (toolName) => formatMcpToolRef(agentId, toolName);
101995
101842
  const commitStep = signedCommits ? `commit via \`${t("commit_changes")}\` \u2014 it lands a GitHub-signed commit directly on the remote branch (no push step)` : `commit locally via shell (\`git add . && git commit -m "..."\`)`;
@@ -102013,8 +101860,7 @@ function computeModes(agentId, signedCommits = false) {
102013
101860
  - plan your approach before writing code: identify which files need to change, key design decisions, and edge cases. for non-trivial changes, consider whether there's a more elegant approach.
102014
101861
  - run relevant tests/lints before committing
102015
101862
 
102016
- 5. **self-review**: ${byProfile(
102017
- `unless the diff has no behavioral surface at all \u2014 docs, comments, whitespace, import reordering, lockfile or generated-code regeneration, a mechanical rename, a trusted dep patch bump \u2014 dispatch the \`${REVIEWER_AGENT_NAME}\` subagent to review it with fresh eyes against YOUR TASK. Line count is not the signal: a one-line change to auth, money, SQL, a comparison operator, a redirect, or a config default earns a pass. When in doubt, run it \u2014 a false-positive dispatch costs cents, a missed bug costs much more.
101863
+ 5. **self-review**: unless the diff has no behavioral surface at all \u2014 docs, comments, whitespace, import reordering, lockfile or generated-code regeneration, a mechanical rename, a trusted dep patch bump \u2014 dispatch the \`${REVIEWER_AGENT_NAME}\` subagent to review it with fresh eyes against YOUR TASK. Line count is not the signal: a one-line change to auth, money, SQL, a comparison operator, a redirect, or a config default earns a pass. When in doubt, run it \u2014 a false-positive dispatch costs cents, a missed bug costs much more.
102018
101864
 
102019
101865
  Before dispatching, make \`origin/<base>\` available: \`git fetch --no-tags --deepen=1000 origin <base>:refs/remotes/origin/<base>\`. The explicit destination refspec is required \u2014 a shallow single-branch checkout otherwise only updates \`FETCH_HEAD\` and never creates the tracking ref. The reviewer is read-only by contract, so fetching is your job.
102020
101866
 
@@ -102022,60 +101868,7 @@ function computeModes(agentId, signedCommits = false) {
102022
101868
 
102023
101869
  Give it the diff and the task, nothing else. Do not summarize what you implemented, curate a reading list of files, or pre-shape the output with a severity schema \u2014 each biases the reviewer toward validating your solution instead of questioning it. Where the diff rests on third-party API, SDK, framework, or DB-engine semantics, tell it to verify load-bearing claims by web search and quote sources.
102024
101870
 
102025
- Treat what comes back as hypotheses, not directives: verify each against the code before applying, and reject findings that would add ceremony without correctness \u2014 defensive checks for cases that cannot happen, single-use abstractions, comments restating code, tautological tests. After applying what you accept, re-read your own diff and revert anything that turned out to be bloat. Then ${commitStep}.`,
102026
- `judgment call \u2014 does YOUR diff warrant a fresh-eyes pass?
102027
-
102028
- Skip self-review (commit directly) when the diff is **genuinely trivial**:
102029
- - doc typos, comment-only edits, whitespace/format-only, import reordering
102030
- - lockfile or generated-code regeneration, mechanical rename whose only effect is import-path updates (size of diff is irrelevant \u2014 read the *shape*, not the line count)
102031
- - low-risk dep patch bump from a trusted source
102032
-
102033
- Run self-review when the diff has **any behavioral surface, however small**:
102034
- - 1-line changes to SQL operators / comparison logic / regexes / redirects / HTTP methods / response codes
102035
- - any change to money / tax / currency / billing / fee / refund / payout calculations or constants
102036
- - any change to auth / permissions / roles / sessions / tokens / signature verification
102037
- - any change to feature-flag defaults, retry counts, timeouts, rate limits, batch sizes
102038
- - new endpoints, new code paths, new error branches \u2014 even small ones
102039
- - mixed diffs (whitespace + a single semantic line) \u2014 the semantic line still triggers self-review
102040
- - anything you're uncertain about
102041
-
102042
- Tie-breaker: when in doubt, run self-review. One false-positive subagent dispatch costs cents; one false-negative shipped bug costs much more. There's no value in dispatching for a typo, but there's also no excuse for skipping on a 1-line change to a billing path.
102043
-
102044
- Otherwise delegate the \`${REVIEWER_AGENT_NAME}\` subagent to review your diff with fresh eyes against YOUR TASK. The subagent's baked-in system prompt enforces a non-mutative + non-recursive contract: read-only file/search/web tools and read-only MCP queries only; no writes, shell side effects, state-changing MCP calls, or nested subagent dispatch. Enforcement is prose-only \u2014 restate the constraint in your dispatch instructions and do not relax it.
102045
-
102046
- Before dispatching, ensure \`origin/<base>\` is locally available \u2014 the runner is often a shallow single-branch \`actions/checkout\` (depth=1, head-only refspec), and the reviewer's \`git diff --merge-base origin/<base>\` will fail with \`ambiguous argument\` or \`no merge base\` otherwise. Run \`git fetch --no-tags --deepen=1000 origin <base>:refs/remotes/origin/<base>\` once (the explicit destination refspec is required \u2014 a shallow single-branch checkout configures a head-only refspec, so a bare \`origin <base>\` only updates \`FETCH_HEAD\` and never creates the \`origin/<base>\` tracking ref); it's a no-op if the ref already has enough history. (The reviewer is read-only by contract, so it cannot do this itself \u2014 fetching is the orchestrator's job.)
102047
-
102048
- Compose your \`${REVIEWER_AGENT_NAME}\` dispatch prompt using this template verbatim, substituting the \`<...>\` placeholders. The preamble aligns the orchestrator side of the dispatch contract with the reviewer's baked-in system prompt \u2014 both ends say the same thing about where the work lives and what to do on an empty diff.
102049
-
102050
- \`\`\`
102051
- ## What you're reviewing
102052
- This is a PRE-COMMIT Build-mode self-review. The work to review lives in the working tree (uncommitted), NOT in committed history.
102053
-
102054
- Branch: <branch> (off <base>)
102055
- Canonical diff command: git diff --merge-base origin/<base>
102056
-
102057
- Use \`--merge-base\` (single MCP \`git\` call, no shell substitution required). NOT bare \`git diff origin/<base>\` or two-dot \`git diff origin/<base>..HEAD\` \u2014 the symmetric forms include the inverse of every commit landed on \`<base>\` since this branch forked, which is noise (and the git tool will reject those forms when the divergence is detected). \`origin/<base>...HEAD\` (three-dot) and \`--cached\` both miss the uncommitted edits self-review runs on, so they're also wrong here.
102058
-
102059
- If the merge-base diff returns empty, treat it as "no changes \u2014 nothing to review" and stop per your system prompt. Do not search for the work elsewhere.
102060
-
102061
- ## Your task
102062
- <YOUR TASK content>
102063
-
102064
- ## Build-phase failures
102065
- <tight summary \u2014 what broke, root cause, the fix \u2014 or "no build-phase failures">
102066
- \`\`\`
102067
-
102068
- Follow the template with the diff content (\`git diff --merge-base origin/<base-branch>\` \u2014 single MCP \`git\` call, captures committed + staged + unstaged, excludes base-branch progress) and your task brief. Instruct the subagent to flag bugs, logic errors, missing edge cases, gaps between request and diff, and unintended changes.
102069
-
102070
- Delegation + research discipline (distilled from \`/anneal\` canonical \u2014 these are codified learnings from many review rounds, not theoretical best practices):
102071
- - Do NOT summarize what you implemented \u2014 that biases the subagent toward validating the shape of your solution rather than questioning it.
102072
- - Do NOT curate a reading list of files. Let the subagent discover scope from the diff and codebase.
102073
- - Do NOT pre-shape output with a severity / category schema. That leaks your hypotheses; severity is your call during evaluation.
102074
- - Do NOT defect-hunt the diff yourself in parallel with the subagent. Your role is dispatch + evaluation; doing the review yourself reintroduces the implementation bias the subagent is meant to mitigate.
102075
- - For diffs that rely on third-party API contracts, SDK semantics, framework directives, or DB engine specifics, instruct the subagent to verify load-bearing claims via web search and quote source URLs rather than trust training data \u2014 this is the single most common review-quality failure mode.
102076
-
102077
- Be **discerning** about what comes back. The reviewer is an AI subagent and is fallible \u2014 treat every finding as a hypothesis, not a directive, and **verify each one yourself** against the diff and the code before deciding whether to apply. You are searching for a solution that is **complete, minimal, and elegant** \u2014 you may need to think hard to find it. Do not over-engineer, do not be over-defensive, **do not write AI slop**. Reviewers bias toward *recommending additions*, and that bias has a recognizable slop texture: defensive checks for cases that cannot happen, extra logging, new abstractions used once, comments restating code, tests asserting tautologies, "just-in-case" guards, error handlers for cases the type system already rules out. Reject those. For each surviving finding, ask: would applying it leave the code more sound, correct, AND elegant? Two-out-of-three means look harder for a fix that gets all three before settling. After applying the fixes you accept, re-read your diff and be discerning about what *you just changed*: if any fix turned out to be bloat in context, revert it. Then verify only intended changes are present, no debug artifacts or commented-out code remain, no unrelated files were modified. Then ${commitStep}.`
102078
- )}
101871
+ Treat what comes back as hypotheses, not directives: verify each against the code before applying, and reject findings that would add ceremony without correctness \u2014 defensive checks for cases that cannot happen, single-use abstractions, comments restating code, tautological tests. After applying what you accept, re-read your own diff and revert anything that turned out to be bloat. Then ${commitStep}.
102079
101872
 
102080
101873
  6. **finalize**:
102081
101874
  - ${finalizeStep} (see *SYSTEM* Git rules if this fails \u2014 prepush errors are usually the repo's tests/lint, not infra timeouts)
@@ -102128,7 +101921,7 @@ For simple, well-defined tasks, skip the plan phase and go straight to build.`
102128
101921
  //
102129
101922
  // Severity categorization is split across two surfaces: the opening
102130
101923
  // callout (CAUTION/IMPORTANT/ℹ️/✅) sets the review's overall tier, and
102131
- // per-bullet emoji prefixes (🚨/⚠️/ℹ️ in prSummaryFormat()) tag
101924
+ // per-bullet emoji prefixes (🚨/⚠️/ℹ️ in PR_SUMMARY_FORMAT) tag
102132
101925
  // individual points inside summary sections — scoping severity to the
102133
101926
  // specific bullet rather than the whole section keeps a section that
102134
101927
  // mixes a 🚨 and an ℹ️ from being mislabeled by either of them.
@@ -102141,8 +101934,9 @@ For simple, well-defined tasks, skip the plan phase and go straight to build.`
102141
101934
 
102142
101935
  2. **checkout**: call \`${t("checkout_pr")}\` \u2014 this returns PR metadata, a \`diffPath\`, and a supplemental \`impactPath\` when change-impact extraction is enabled. read the complete raw diff end-to-end, beginning with the TOC and using its file line ranges as your coverage checklist. only after that, use \`impactPath\` as an explicitly incomplete list of reference leads; it never replaces raw-diff reading or establishes coverage.
102143
101936
 
102144
- ${byProfile(
102145
- `3. **triage**: orient yourself on the PR \u2014 identify *what kind of thing this is* (domain it touches, seams it crosses, external contracts it depends on, user-facing surfaces it changes). pull as much context as you need to render a confident, well-grounded review: read related files, grep for callers of changed symbols, check tests that exercise the touched paths, fetch related GitHub state. **you are the synthesizer** \u2014 never delegate understanding to subagents.
101937
+ 3. **triage**: orient yourself on the PR \u2014 identify *what kind of thing this is* (domain it touches, seams it crosses, external contracts it depends on, user-facing surfaces it changes). pull as much context as you need to render a confident, well-grounded review: read related files, grep for callers of changed symbols, check tests that exercise the touched paths, fetch related GitHub state. **you are the synthesizer** \u2014 never delegate understanding to subagents.
101938
+
101939
+ when the diff adds or changes a test, check that it can actually fail: a test that would still pass with the bug present is theatre, not coverage. the usual tell is a loose assertion standing where an exact one belongs \u2014 \`>=\` or a truthiness check over an expected value, or a snapshot that absorbs whatever it is handed. read the assertion against the behavior it claims to pin, not against whether it currently passes.
102146
101940
 
102147
101941
  skip the deeper pass and submit a \`No new issues found.\` review per step 7 only when the diff has **no behavioral surface at all** \u2014 doc typos, whitespace/formatting, lockfile or generated-code regeneration, a mechanical rename whose only effect is import-path updates. line count is not the signal: a one-line change to auth, money, SQL, a comparison operator, a redirect, or a config default is not trivial.
102148
101942
 
@@ -102163,80 +101957,7 @@ ${byProfile(
102163
101957
  - if the question touches third-party API, SDK, or framework contracts, instruct the subagent to verify load-bearing claims via web search and quote source URLs rather than trust training data. action runs are non-interactive \u2014 nobody is in the loop to catch "I'm pretty sure Stripe does X."
102164
101958
  - ask for findings with file paths and NEW line numbers from the diff so you can validate and anchor them.
102165
101959
 
102166
- delegation discipline: do NOT summarize the PR for them (a lossy summary biases toward a validation frame; the raw diff is the source), do NOT hand them a curated reading list, do NOT pre-shape their output with a finding schema, and do NOT mention the other specialists \u2014 independence is the point, and overlapping findings are a strong signal.`,
102167
- `3. **triage**: orient yourself on the PR \u2014 identify *what kind of thing this is* (domain it touches, seams it crosses, external contracts it depends on, user-facing surfaces it changes). pull as much context as you need to render a confident, well-grounded review: read related files, grep for callers of changed symbols, check tests that exercise the touched paths, fetch related GitHub state. **you are the synthesizer** \u2014 never delegate understanding to subagents.
102168
-
102169
- if the PR is **genuinely trivial**, skip specialists entirely and submit a \`No new issues found.\` review per step 7.
102170
-
102171
- "Genuinely trivial" (skip):
102172
- - single-word doc typo, whitespace/format-only, comment-only across any number of files
102173
- - lockfile or generated-code regeneration (size of diff is irrelevant \u2014 read the *shape*)
102174
- - mechanical rename whose only effect is import-path updates
102175
- - low-risk dep patch bump
102176
-
102177
- "Looks trivial but isn't" (do **NOT** skip \u2014 small diff, big blast radius):
102178
- - any 1-line change to SQL / regex / auth / billing / permission / signature-verification code
102179
- - flipping a feature-flag default, default config value, or retry/timeout constant
102180
- - changing a money/tax/currency/fee constant by any amount
102181
- - changing an HTTP method, redirect URL, response code, or status enum
102182
- - tightening or loosening a comparison operator (\`<\` \u2194 \`<=\`, \`==\` \u2194 \`!=\`)
102183
- - renaming a public API surface (still trivial in shape, but needs an impact lens)
102184
- - adding a new direct dependency (supply-chain surface)
102185
- - any "typo fix" in user-facing copy that changes meaning ("approved" \u2192 "denied")
102186
- - mixed diffs where a semantic 1-liner is buried in whitespace/formatting changes
102187
-
102188
- 4. **specialist decision \u2014 minimum hypothesis coverage**.
102189
-
102190
- After full-diff coverage and triage, identify the load-bearing questions you still cannot resolve confidently yourself. A specialist hypothesis is load-bearing only when its answer could yield an actionable finding that changes the review disposition and warrants independent investigation, and falsifiable only when the specialist can return evidence that supports or refutes it. Generic requests for extra confidence, polish, or "another look" do not qualify.
102191
-
102192
- Route the **minimum number of \`${REVIEWER_AGENT_NAME}\` specialists** needed to cover those unresolved hypotheses. Most reviews need **0 or 1**:
102193
- - dispatch 0 when you can resolve every disposition-changing question directly
102194
- - dispatch 1 when exactly one falsifiable, load-bearing hypothesis warrants independent investigation
102195
- - dispatch 2+ in parallel when multiple orthogonal load-bearing hypotheses remain, or when the user explicitly requests an exhaustive or multi-angle review
102196
-
102197
- **There is NO one-specialist cap or fixed maximum.** Cover every orthogonal load-bearing hypothesis that remains; do not collapse multiple real questions into one broad prompt just to reduce the count. There is also no file-count, line-count, schema, quota, or hard-budget threshold \u2014 diff size is not a proxy for review uncertainty.
102198
-
102199
- The primary reviewer remains responsible for reading the complete raw diff, investigating surrounding code, validating every returned finding, and synthesizing the final review. Specialist reads supplement that work; they never replace it or satisfy the primary's diff-coverage obligation.
102200
-
102201
- Specialist hypotheses can draw on two kinds of framing:
102202
- - **themed lenses** \u2014 a perspective applied across the whole diff (correctness, security, user-journey, performance, etc.).
102203
- - **subsystem lenses** \u2014 a domain-scoped frame for high-stakes subsystems the PR touches (e.g. "the auth lens", "the billing lens", "the schema-migration lens"). **for high-stakes domains, lead with the subsystem lens rather than the generic themed equivalent** \u2014 "billing-subsystem" outperforms "correctness on billing code" because the framing primes the subagent to remember domain-specific failure modes (double-charges, refund races, currency rounding, dispute flows) the generic lens misses.
102204
-
102205
- starter menu for identifying hypotheses (combine, omit, or invent your own; do not dispatch a bare menu label without a falsifiable question):
102206
- - **correctness & invariants** \u2014 bugs, races, error handling, edge cases, state-machine boundaries
102207
- - **impact** \u2014 stale references in code/tests/docs/configs/UI after rename/remove
102208
- - **research-validated assumptions** \u2014 third-party API contracts, SDK semantics, framework directives, version-gated behavior. **only pick when the PR's correctness depends on the contract behaving a specific way** \u2014 not when the API is merely used. The bar is "if the third-party contract differs from what the diff assumes, the PR is incorrect." When dispatched, the subagent must verify load-bearing claims via web search and quote source URLs.
102209
- - **security** \u2014 new endpoints, authZ, input validation, secrets handling, replay/CSRF/injection, cross-tenant isolation
102210
- - **user-journey** \u2014 UX-touching flows: walk through happy path and failure modes as a user
102211
- - **operational readiness** \u2014 observability, alerting, migrations (forward + rollback), feature flags, on-call burden
102212
- - **integration & cross-cutting** \u2014 API contracts between modules, backward-compat of public surfaces, multi-service ordering
102213
- - **test integrity** \u2014 meaningful coverage for the changed behavior; deterministic; no shared-state pollution
102214
- - **performance** \u2014 N+1 queries, hot-path allocation, latency budgets, index coverage
102215
- - **holistic** \u2014 does the PR make sense as a whole? symmetric flows (delete for every create, rollback for every migration)?
102216
- - **subsystem lenses** (invent as the PR demands) \u2014 auth, billing, payments, schema migration, webhooks, secrets, RBAC, multi-tenant isolation, cron/scheduling, etc.
102217
-
102218
- The only subagent type is \`${REVIEWER_AGENT_NAME}\` \u2014 used for lens judgment work ("is this safe / correct / well-tested?"), runs on a mid-tier model.
102219
-
102220
- 5. **dispatch specialists (only if step 4 found unresolved hypotheses)**: dispatch one \`${REVIEWER_AGENT_NAME}\` for one hypothesis. For 2+ hypotheses, emit every Task tool_use block **IN A SINGLE ASSISTANT TURN** before reading any result so the investigations run in parallel rather than serially.
102221
-
102222
- \u2705 Right multi-specialist pattern: one assistant turn with N Task tool_use blocks \u2192 wait \u2192 N results arrive together \u2192 aggregate.
102223
- \u274C Wrong multi-specialist pattern: Task(hypothesis A) \u2192 wait for A \u2192 Task(hypothesis B).
102224
-
102225
- You can also include your own \`read\` / \`grep\` / \`webfetch\` calls in the SAME turn as the parallel \`${REVIEWER_AGENT_NAME}\` dispatches \u2014 concurrent context-pulling on the orchestrator side runs in parallel with the lens fan-out and costs zero extra wall time.
102226
-
102227
- if a specialist errors out, times out, or returns nothing usable, retry it once with the same hypothesis. if it still fails, attempt to resolve the hypothesis yourself; if it remains disposition-changing and unresolved, surface the limitation and do not approve. each specialist gets:
102228
- - **the absolute \`diffPath\` (and \`incrementalDiffPath\` if available) from step 2's \`${t("checkout_pr")}\` return, named verbatim in the dispatch prompt** (e.g. \`diffPath: /tmp/pullfrog-XXXX/pr-NNN-SHA.diff\`). the reviewer's baked-in system prompt selects its FIRST action on this token \u2014 paraphrasing ("review the diff", "look at this PR") sends it down the \`git diff origin/<base>\` fallback, which fails on shallow GHA checkouts. the subagent \`read\`s those files for scope; it must NOT re-derive the diff via \`git diff\` (bare \`git diff origin/<base>\` is symmetric and pulls in the inverse of any commits that landed on \`<base>\` since the branch forked \u2014 pure noise, and the git tool rejects it). reading and codebase exploration are still its job.
102229
- - **exactly one falsifiable hypothesis with explicit scope boundaries** \u2014 ask for evidence that supports or refutes it, never a broad "review for X, Y, and Z" prompt
102230
- - **a Task \`description\` set to a short hypothesis label** (e.g. \`"webhook-replay"\`, \`"billing-rounding"\`) \u2014 the harness reads this field to label the subagent's log lines so parallel runs can be told apart in CI output. without it, every subagent shows up as \`subagent#N\`.
102231
- - if the lens touches external contracts, instruct the subagent to verify load-bearing claims via web search rather than trust training data, and to quote source URLs in its reasoning. action runs are non-interactive \u2014 there's no human in the loop to catch "I'm pretty sure Stripe does X."
102232
- - ask the subagent to report findings with file paths and NEW line numbers from the diff so you can validate and anchor them. you must still read the complete diff yourself.
102233
-
102234
- delegation discipline:
102235
- - do NOT summarize the PR for them (a lossy summary biases toward a validation frame; the raw diff is the source)
102236
- - do NOT hand them a curated reading list (let them discover scope)
102237
- - do NOT pre-shape their output with a finding schema
102238
- - do NOT mention the other lenses (independence is the point \u2014 overlapping findings are a strong signal)`
102239
- )}
101960
+ delegation discipline: do NOT summarize the PR for them (a lossy summary biases toward a validation frame; the raw diff is the source), do NOT hand them a curated reading list, do NOT pre-shape their output with a finding schema, and do NOT mention the other specialists \u2014 independence is the point, and overlapping findings are a strong signal.
102240
101961
 
102241
101962
  6. **aggregate & draft**: when specialist results land, merge findings; de-dup overlaps (two specialists catching the same issue = higher-confidence signal); trace each finding yourself before accepting it. drop praise, style preferences, speculative/unverified claims, findings about pre-existing code unrelated to the PR (heuristic: if the finding's root cause lives in lines this PR added or modified, it's in scope; otherwise drop unless the PR plausibly introduced or amplified the regression), and anything not actionable. also drop **bloat-shaped findings** \u2014 proposed fixes that would add defensive checks for cases that can't happen, abstractions used once, comments restating obvious code, tests asserting tautologies, or "just-in-case" guards. subagents are fallible and bias toward recommending changes; the bar for an actionable inline comment is sound + correct + elegant. recommending a change that improves only one of the three (or worse, degrades elegance to nominally improve correctness) makes the codebase worse, not better.
102242
101963
 
@@ -102270,7 +101991,7 @@ ${byProfile(
102270
101991
  - **no actionable issues**:
102271
101992
  \`approved: true\`. Body opens with \`> \u2705 No new issues found.\\n\\n\` followed by the PR summary.
102272
101993
 
102273
- ${prSummaryFormat()}`
101994
+ ${PR_SUMMARY_FORMAT}`
102274
101995
  },
102275
101996
  // IncrementalReview shares Review's minimum hypothesis-covering specialist
102276
101997
  // routing and body format, scoped to the incremental delta against the
@@ -102304,8 +102025,9 @@ ${prSummaryFormat()}`
102304
102025
 
102305
102026
  The remaining open threads feed step 8's dedup filter \u2014 anything already flagged and unchanged by the new commits should not be re-raised. The rolling PR summary snapshot is the durable record of retire activity; you don't need to surface it in the review body.
102306
102027
 
102307
- ${byProfile(
102308
- `5. **triage**: orient on the *incremental* changes \u2014 domain, seams, external contracts, user-facing surfaces. pull as much context as you need to render a confident review: read related files, grep for callers of changed symbols, check tests that exercise the touched paths. **you are the synthesizer.**
102028
+ 5. **triage**: orient on the *incremental* changes \u2014 domain, seams, external contracts, user-facing surfaces. pull as much context as you need to render a confident review: read related files, grep for callers of changed symbols, check tests that exercise the touched paths. **you are the synthesizer.**
102029
+
102030
+ a test added or changed in this delta must be able to fail \u2014 one that would still pass with the bug present is theatre, not coverage. the tell is a loose assertion where an exact one belongs (\`>=\` or a truthiness check over an expected value, a snapshot that absorbs whatever it is handed).
102309
102031
 
102310
102032
  skip the deeper pass and jump to step 10's non-substantive path (do NOT submit a review) only when the incremental changes have **no behavioral surface at all** \u2014 formatting, comment tweaks, import reordering, lockfile regen, a mechanical rename of import paths. line count is not the signal: a one-line change to auth, money, SQL, a comparison operator, a redirect, or a config default is not trivial.
102311
102033
 
@@ -102326,50 +102048,7 @@ ${byProfile(
102326
102048
  - if the question touches third-party API, SDK, or framework contracts, instruct the subagent to verify load-bearing claims via web search and quote source URLs.
102327
102049
  - ask for findings with file paths and NEW line numbers from the full PR diff so you can validate and anchor them.
102328
102050
 
102329
- delegation discipline: do NOT summarize the changes for them (a lossy summary biases toward a validation frame; the raw diff is the source), do NOT hand them a curated reading list, do NOT pre-shape their output with a finding schema, and do NOT mention the other specialists \u2014 independence is the point.`,
102330
- `5. **triage**: orient on the *incremental* changes \u2014 domain, seams, external contracts, user-facing surfaces. pull as much context as you need to render a confident review: read related files, grep for callers of changed symbols, check tests that exercise the touched paths. **you are the synthesizer.**
102331
-
102332
- if the incremental changes are **genuinely trivial**, skip specialists entirely and jump to step 10's non-substantive path (do NOT submit a review).
102333
-
102334
- "Genuinely trivial" (skip): formatting/comment tweaks, import reordering, lockfile regen, mechanical rename of import paths, whitespace-only.
102335
- "Looks trivial but isn't" (do NOT skip \u2014 same anti-patterns as Review mode): 1-line changes to SQL/regex/auth/billing/permissions/signature-verification code; flipping feature-flag defaults or retry/timeout constants; money/tax/HTTP-method/redirect changes; tightening or loosening a comparison operator; mixed diffs with a semantic line buried in formatting.
102336
- When unsure, treat as non-trivial.
102337
-
102338
- 6. **specialist decision \u2014 minimum hypothesis coverage**.
102339
-
102340
- After full-diff coverage and triage, identify the load-bearing questions about the incremental changes that you still cannot resolve confidently yourself. A specialist hypothesis is load-bearing only when its answer could yield an actionable new finding that changes the review disposition and warrants independent investigation, and falsifiable only when the specialist can return evidence that supports or refutes it. Generic requests for extra confidence, polish, or "another look" do not qualify.
102341
-
102342
- Route the **minimum number of \`${REVIEWER_AGENT_NAME}\` specialists** needed to cover those unresolved hypotheses. Most incremental reviews need **0 or 1**, especially thread-reply re-reviews:
102343
- - dispatch 0 when you can resolve every disposition-changing question directly
102344
- - dispatch 1 when exactly one falsifiable, load-bearing hypothesis warrants independent investigation
102345
- - dispatch 2+ in parallel when multiple orthogonal load-bearing hypotheses remain, or when the user explicitly requests an exhaustive or multi-angle review
102346
-
102347
- **There is NO one-specialist cap or fixed maximum.** Cover every orthogonal load-bearing hypothesis that remains; do not collapse multiple real questions into one broad prompt just to reduce the count. There is also no file-count, line-count, schema, quota, or hard-budget threshold \u2014 diff size is not a proxy for review uncertainty.
102348
-
102349
- The primary reviewer remains responsible for reading the complete raw full diff plus the incremental diff, investigating surrounding code, validating every returned finding, and synthesizing the final review. Specialist reads supplement that work; they never replace it or satisfy the primary's diff-coverage obligation.
102350
-
102351
- Specialist hypotheses can draw on Review mode's themed or subsystem framings, but every dispatch must turn the framing into one falsifiable question with explicit scope boundaries.
102352
-
102353
- 7. **dispatch specialists (only if step 6 found unresolved hypotheses)**: dispatch one \`${REVIEWER_AGENT_NAME}\` for one hypothesis. For 2+ hypotheses, emit every Task tool_use block **IN A SINGLE ASSISTANT TURN** before reading any result so the investigations run in parallel rather than serially.
102354
-
102355
- \u2705 Right multi-specialist pattern: one assistant turn with N Task tool_use blocks \u2192 wait \u2192 N results arrive together \u2192 aggregate.
102356
- \u274C Wrong multi-specialist pattern: Task(hypothesis A) \u2192 wait for A \u2192 Task(hypothesis B).
102357
-
102358
- You can also include your own \`read\` / \`grep\` / \`webfetch\` calls in the SAME turn as the parallel \`${REVIEWER_AGENT_NAME}\` dispatches.
102359
-
102360
- if a specialist errors out, times out, or returns nothing usable, retry it once with the same hypothesis. if it still fails, attempt to resolve the hypothesis yourself; if it remains disposition-changing and unresolved, surface the limitation and do not approve. each specialist gets:
102361
- - **the absolute diff path(s) from step 2's \`${t("checkout_pr")}\` return, named verbatim in the dispatch prompt.** when \`incrementalDiffPath\` is present, name BOTH (\`incrementalDiffPath: /tmp/.../pr-NNN-SHA-incremental.diff\` then \`diffPath: /tmp/.../pr-NNN-SHA.diff\`) \u2014 the reviewer's baked-in prompt reads incremental first and uses full for context; when only \`diffPath\` exists, name it alone. the subagent \`read\`s those files; it must NOT re-derive via \`git diff\` (bare \`git diff origin/<base>\` is symmetric and pulls in the inverse of base-branch progress \u2014 pure noise, and the git tool rejects it), and paraphrasing ("review the new commits") sends it down that fallback, which also fails on shallow GHA checkouts. do NOT tell them to skip pre-existing issues \u2014 that suppresses regressions the new commits amplified; the "issues must be NEW" filter lives at aggregation time (step 8), not in the subagent prompt.
102362
- - **exactly one falsifiable hypothesis with explicit scope boundaries** \u2014 ask for evidence that supports or refutes it, never a broad "review for X, Y, and Z" prompt
102363
- - **a Task \`description\` set to a short hypothesis label** \u2014 the harness reads this field to label log lines so parallel runs can be told apart.
102364
- - if the lens touches external contracts, instruct the subagent to verify load-bearing claims via web search and quote source URLs.
102365
- - ask the subagent to report findings with file paths and NEW line numbers from the full PR diff so you can validate and anchor them. you must still read the complete incremental and full diff scope yourself.
102366
-
102367
- delegation discipline:
102368
- - do NOT summarize the changes for them (a lossy summary biases toward a validation frame; the raw diff is the source)
102369
- - do NOT hand them a curated reading list (let them discover scope)
102370
- - do NOT pre-shape their output with a finding schema
102371
- - do NOT mention the other lenses (independence is the point)`
102372
- )}
102051
+ delegation discipline: do NOT summarize the changes for them (a lossy summary biases toward a validation frame; the raw diff is the source), do NOT hand them a curated reading list, do NOT pre-shape their output with a finding schema, and do NOT mention the other specialists \u2014 independence is the point.
102373
102052
 
102374
102053
  8. **aggregate, draft, self-critique**: merge findings (yours + output from every specialist you dispatched); de-dup overlaps; trace each finding yourself. drop praise, style preferences, speculative/unverified claims, findings about pre-existing code unrelated to the new commits, anything not actionable, and anything that re-states prior review feedback (heuristic: if the finding's root cause lives in lines the *new commits* added or modified, it's in scope; otherwise drop). also drop **bloat-shaped findings** \u2014 proposed fixes that would add defensive checks for cases that can't happen, abstractions used once, comments restating obvious code, tests asserting tautologies, or "just-in-case" guards. subagents are fallible and bias toward recommending changes; the bar for an actionable inline comment is sound + correct + elegant. recommending a change that improves only one of the three (or degrades elegance to nominally improve correctness) makes the codebase worse, not better. To compute "lines the new commits added or modified": if \`incrementalDiffPath\` from step 2 is present, use it directly. Otherwise, take the prior Pullfrog review's \`commit_id\` (returned alongside each entry from \`${t("list_pull_request_reviews")}\` in step 4) and run \`git diff <prior-review-sha>..HEAD\` to isolate the lines added since that review.
102375
102054
 
@@ -102392,7 +102071,7 @@ ${byProfile(
102392
102071
  - ELSE IF INFORMATIONAL OBSERVATIONS (mergeable as-is, but worth surfacing \u2014 e.g. prior feedback addressed cleanly with one minor stale doc reference, or a noteworthy positive observation): call \`${t("create_pull_request_review")}\` with \`approved: true\`, NO inline comments, and the review body. body opens with \`> \u2705 No new issues found.\\n\\n\` (or similar friendly green opener), followed by the PR summary using the default format below. If a point is concrete enough to anchor to a line, downgrade the whole review to "minor suggestions only" (\`approved: false\`) instead \u2014 the \u2705 signals "no action needed", which contradicts an actionable anchor.
102393
102072
  - ELSE IF NO NEW ISSUES, SUBSTANTIVE CHANGES (new functionality, behavior changes, or fixes to prior review feedback): call \`${t("create_pull_request_review")}\` to create a PR review. If all previous reviews have been properly addressed and no new issues were discovered, set \`approved: true\`. body opens with \`> \u2705 No new issues found.\\n\\n\`, followed by the PR summary using the default format below.
102394
102073
 
102395
- ${prSummaryFormat()}`
102074
+ ${PR_SUMMARY_FORMAT}`
102396
102075
  },
102397
102076
  {
102398
102077
  name: "Plan",
@@ -102496,7 +102175,8 @@ function getUnsubmittedReview(toolState, expectsReviewOutput2 = toolState.hadPro
102496
102175
  if (!expectsReviewOutput2) return null;
102497
102176
  if (mode === "Review") return toolState.review ? null : "Review";
102498
102177
  if (mode === "IncrementalReview") {
102499
- return toolState.review || toolState.finalSummaryWritten ? null : "IncrementalReview";
102178
+ const delivered = toolState.review || toolState.finalSummaryWritten || toolState.standaloneCommentId !== void 0;
102179
+ return delivered ? null : "IncrementalReview";
102500
102180
  }
102501
102181
  return null;
102502
102182
  }
@@ -158550,6 +158230,9 @@ function CreateCommentTool(ctx) {
158550
158230
  });
158551
158231
  ctx.toolState.wasUpdated = true;
158552
158232
  log.info(`\xBB created comment ${result.data.id}`);
158233
+ if (issueNumber === ctx.payload.event.issue_number) {
158234
+ ctx.toolState.standaloneCommentId = result.data.id;
158235
+ }
158553
158236
  if (commentType === "Plan") {
158554
158237
  if (result.data.node_id) {
158555
158238
  await patchWorkflowRunFields(ctx, { planCommentNodeId: result.data.node_id });
@@ -158739,6 +158422,14 @@ function ReportProgressTool(ctx) {
158739
158422
  description: 'Share progress on the associated GitHub issue/PR. The first call creates a comment; subsequent calls update it in place. Example: `report_progress({ body: "Implemented the auth check and added tests." })`. Call this at the end of every run with a brief final summary (1-3 sentences) unless the mode guidance instructs otherwise. The current task list is automatically appended in a collapsible section \u2014 do not restate individual steps.',
158740
158423
  parameters: ReportProgress,
158741
158424
  execute: execute(async (params) => {
158425
+ if (ctx.toolState.standaloneCommentId !== void 0 && !params.target_plan_comment) {
158426
+ ctx.toolState.lastProgressBody = params.body;
158427
+ return {
158428
+ success: true,
158429
+ action: "skipped",
158430
+ message: `standalone comment ${ctx.toolState.standaloneCommentId} already delivered this run's answer to this target \u2014 that comment IS the deliverable, so this call was a no-op rather than posting a second one. Nothing further is needed.`
158431
+ };
158432
+ }
158742
158433
  let body = params.body;
158743
158434
  if (!params.target_plan_comment && ctx.toolState.todoTracker) {
158744
158435
  ctx.toolState.todoTracker.cancel();
@@ -159093,10 +158784,7 @@ var CreatePullRequestReview = type({
159093
158784
  // running. required-ness is the only pressure that empirically held.
159094
158785
  // see wiki/review-approval.md.
159095
158786
  body: type.string.describe(
159096
- byProfile(
159097
- `The review summary, plus any concern that has no diff line to anchor to. Your mode guidance defines its structure. Feedback that does anchor to a line goes in the 'comments' array. ALWAYS pass this parameter \u2014 pass an empty string "" when approving with no commentary, never omit it.`,
159098
- `1-2 sentence high-level summary with urgency level, critical callouts, and feedback about code outside the diff. Specific feedback on diff lines goes in 'comments' array. ALWAYS pass this parameter \u2014 pass an empty string "" when approving with no commentary, never omit it.`
159099
- )
158787
+ `The review summary, plus any concern that has no diff line to anchor to. Your mode guidance defines its structure. Feedback that does anchor to a line goes in the 'comments' array. ALWAYS pass this parameter \u2014 pass an empty string "" when approving with no commentary, never omit it.`
159100
158788
  ),
159101
158789
  approved: type.boolean.describe(
159102
158790
  "Set to true to submit as an approval. Use for `> \u2705 No new issues found.` reviews where the PR is mergeable as-is and nothing in the body warrants code changes \u2014 approving also suppresses the Fix-button footer affordance so users don't dispatch a fix run on non-actionable feedback. Reserve approved: false for `> \u2139\uFE0F ...` (minor suggestions inline), `> [!IMPORTANT]` (recommended changes), and `> [!CAUTION]` (critical) reviews. Defaults to false (comment-only review). Mutually exclusive with request_changes. Approval is REJECTED while any unresolved Pullfrog review thread remains open on the PR (not just the latest commit's diff): resolve the threads the current code addresses (reply + resolve_review_thread) first, or submit a non-approving review if a real issue remains."
@@ -159132,10 +158820,7 @@ function CreatePullRequestReviewTool(ctx) {
159132
158820
  return tool({
159133
158821
  name: "create_pull_request_review",
159134
158822
  mutates: true,
159135
- description: 'Submit a review for an existing pull request. Example: `create_pull_request_review({ pull_number: 1234, body: "LGTM", approved: true, comments: [{ path: "src/api.ts", line: 42, body: "nit: rename" }] })`. Each call creates a permanent, visible review on the PR \u2014 NEVER submit test or diagnostic reviews. Set `approved: true` to approve, `request_changes: true` to submit a blocking review, or neither for a plain comment review (the three are mutually exclusive). Reviews with no body AND no comments are silently skipped (nothing to post). ' + byProfile(
159136
- "Feedback that anchors to a specific line goes in the 'comments' array with file paths and line numbers. The 'body' carries the review summary plus any concern with no line to anchor to; your mode guidance defines its structure. ",
159137
- "IMPORTANT: 95%+ of feedback should be in 'comments' array with file paths and line numbers. Only use 'body' for a 1-2 sentence summary with urgency and critical callouts. "
159138
- ) + `Use 'suggestion' to propose replacement code - MUST preserve exact indentation of original code. The first submission may error once with a one-time diff-coverage nudge listing unread TOC regions \u2014 retry with the same arguments and the pre-flight will not block again. Example replacing lines 42-44 (3 lines) with 5 lines: { path: 'src/api.ts', start_line: 42, line: 44, suggestion: ' const result = await fetch(url);\\n if (!result.ok) {\\n log.error(result.status);\\n throw new Error("request failed");\\n }' } CONSTRAINT: Inline comments can ONLY target files and lines that appear in the PR diff. Comments anchored outside a diff hunk are dropped automatically (with a note appended to the review body) \u2014 the rest of the review still posts.`,
158823
+ description: `Submit a review for an existing pull request. Example: \`create_pull_request_review({ pull_number: 1234, body: "LGTM", approved: true, comments: [{ path: "src/api.ts", line: 42, body: "nit: rename" }] })\`. Each call creates a permanent, visible review on the PR \u2014 NEVER submit test or diagnostic reviews. Set \`approved: true\` to approve, \`request_changes: true\` to submit a blocking review, or neither for a plain comment review (the three are mutually exclusive). Reviews with no body AND no comments are silently skipped (nothing to post). Feedback that anchors to a specific line goes in the 'comments' array with file paths and line numbers. The 'body' carries the review summary plus any concern with no line to anchor to; your mode guidance defines its structure. Use 'suggestion' to propose replacement code - MUST preserve exact indentation of original code. The first submission may error once with a one-time diff-coverage nudge listing unread TOC regions \u2014 retry with the same arguments and the pre-flight will not block again. Example replacing lines 42-44 (3 lines) with 5 lines: { path: 'src/api.ts', start_line: 42, line: 44, suggestion: ' const result = await fetch(url);\\n if (!result.ok) {\\n log.error(result.status);\\n throw new Error("request failed");\\n }' } CONSTRAINT: Inline comments can ONLY target files and lines that appear in the PR diff. Comments anchored outside a diff hunk are dropped automatically (with a note appended to the review body) \u2014 the rest of the review still posts.`,
159139
158824
  parameters: CreatePullRequestReview,
159140
158825
  execute: execute(
159141
158826
  async ({ pull_number, body, approved, request_changes, commit_id, comments = [] }) => {
@@ -162818,10 +162503,32 @@ function SelectModeTool(ctx) {
162818
162503
  description: 'Select a mode and receive step-by-step guidance on how to handle the task. Call this to understand the best workflow for the current mode. Example: `select_mode({ mode: "Review" })` or `select_mode({ mode: "Plan", issue_number: 1234 })`.',
162819
162504
  parameters: SelectModeParams,
162820
162505
  execute: execute(async (params) => {
162821
- if (ctx.toolState.selectedMode) {
162506
+ const guidanceFor = (mode) => {
162507
+ const base = buildOrchestratorGuidance(ctx, mode);
162508
+ if (!SUMMARY_MODES.has(mode.name)) return base;
162509
+ const addendum = buildSummaryAddendum(t, ctx);
162510
+ if (addendum.length === 0) return base;
162822
162511
  return {
162823
- error: `mode already selected: "${ctx.toolState.selectedMode}". mode selection is final and cannot be changed. complete your current workflow within this mode.`
162512
+ ...base,
162513
+ orchestratorGuidance: `${base.orchestratorGuidance}
162514
+
162515
+ ${addendum}`,
162516
+ summaryFilePath: ctx.toolState.summaryFilePath
162824
162517
  };
162518
+ };
162519
+ if (ctx.toolState.selectedMode) {
162520
+ const active = ctx.toolState.selectedMode;
162521
+ const error49 = `mode already selected: "${active}". mode selection is final \u2014 this call changed NOTHING and you are still in "${active}". Do not proceed as though you switched modes. "${active}" guidance is repeated below; finish its steps. If the task genuinely belongs to another mode, do what you can within "${active}" and say so in your final summary.`;
162522
+ const activeMode = resolveMode(ctx.modes, active);
162523
+ if (!activeMode) return { error: error49 };
162524
+ if (activeMode.name === "Plan" && ctx.toolState.existingPlanCommentId !== void 0) {
162525
+ return {
162526
+ ...buildOrchestratorGuidance(ctx, activeMode, overrides.PlanEdit),
162527
+ previousPlanBody: ctx.toolState.previousPlanBody,
162528
+ error: error49
162529
+ };
162530
+ }
162531
+ return { ...guidanceFor(activeMode), error: error49 };
162825
162532
  }
162826
162533
  const modeName = params.mode;
162827
162534
  const selectedMode = resolveMode(ctx.modes, modeName);
@@ -162850,18 +162557,7 @@ function SelectModeTool(ctx) {
162850
162557
  }
162851
162558
  }
162852
162559
  }
162853
- const summaryAddendum = SUMMARY_MODES.has(selectedMode.name) ? buildSummaryAddendum(t, ctx) : "";
162854
- const base = buildOrchestratorGuidance(ctx, selectedMode);
162855
- if (summaryAddendum.length > 0) {
162856
- return {
162857
- ...base,
162858
- orchestratorGuidance: `${base.orchestratorGuidance}
162859
-
162860
- ${summaryAddendum}`,
162861
- summaryFilePath: ctx.toolState.summaryFilePath
162862
- };
162863
- }
162864
- return base;
162560
+ return guidanceFor(selectedMode);
162865
162561
  })
162866
162562
  });
162867
162563
  }
@@ -164068,10 +163764,7 @@ You execute tasks directly using your native tools and the ${pullfrogMcpName} MC
164068
163764
 
164069
163765
  Call \`${t("select_mode")}\` with the appropriate mode name. This returns **your workflow** \u2014 a step-by-step playbook you must follow.
164070
163766
 
164071
- ${byProfile(
164072
- `**Work through the returned steps in order.** It is the house playbook for this kind of task and it encodes what usually matters. Where the task in front of you genuinely calls for something better, do that instead and say why in your final summary.`,
164073
- `**Follow the returned guidance as your primary instruction set.** Do not improvise \u2014 the guidance defines the exact steps.`
164074
- )}
163767
+ **Work through the returned steps in order.** It is the house playbook for this kind of task and it encodes what usually matters. Where the task in front of you genuinely calls for something better, do that instead and say why in your final summary.
164075
163768
 
164076
163769
  Available modes:
164077
163770
  ${ctx.modes.map((m) => `- "${m.name}": ${m.description}`).join("\n")}
@@ -164109,18 +163802,9 @@ You are a diligent, detail-oriented, no-nonsense software engineering agent. You
164109
163802
 
164110
163803
  ## Persona
164111
163804
 
164112
- ${byProfile(
164113
- `- Careful, to-the-point, and kind. You only say things you know to be true.
164114
- - Write code that reads like the surrounding code: match its comment density, naming, and idiom.
164115
- - Do not break up sentences with hyphens. Use emdashes. Use backticks liberally for inline code (e.g. \`z.string()\`) even in headers.`,
164116
- `- Careful, to-the-point, and kind. You only say things you know to be true.
164117
- - Do not break up sentences with hyphens. Use emdashes.
164118
- - Strong bias toward minimalism: no dead code, no premature abstractions, no speculative features, and no comments that merely restate what the code does.
164119
- - Code is focused, elegant, and production-ready.
164120
- - Do not add unnecessary comments, tests, or documentation unless explicitly prompted to do so.
164121
- - Adapt your writing style to match existing patterns in the codebase (commit messages, PR descriptions, code comments) while never being unprofessional.
164122
- - Use backticks liberally for inline code (e.g. \`z.string()\`) even in headers.`
164123
- )}
163805
+ - Careful, to-the-point, and kind. You only say things you know to be true.
163806
+ - Write code that reads like the surrounding code: match its comment density, naming, and idiom. Match its style, not its defects \u2014 a neighbour's loose assertion or bare \`any\` is not a pattern to copy.
163807
+ - Do not break up sentences with hyphens. Use emdashes. Use backticks liberally for inline code (e.g. \`z.string()\`) even in headers.
164124
163808
 
164125
163809
  ## Environment
164126
163810
 
@@ -164140,10 +163824,7 @@ MCP servers provide tools you can call. Inspect your available MCP servers at st
164140
163824
 
164141
163825
  ### Git
164142
163826
 
164143
- ${byProfile(
164144
- `Use \`${t("git")}\` for local git commands (status, log, add, commit, checkout, branch, merge, etc.). When reviewing a PR, the diffPath returned by \`${t("checkout_pr")}\` is authoritative \u2014 read it rather than re-deriving the diff. To diff a branch against its base yourself, use \`git diff --merge-base <base>\`; the tool rejects the symmetric forms and tells you what to use instead. Note the git tool runs git directly, so \`$(\u2026)\` subshells do not interpolate. For operations requiring remote authentication, use the dedicated MCP tools:`,
164145
- `Use \`${t("git")}\` for local git commands (status, log, add, commit, checkout, branch, merge, etc.). When reviewing a PR, do NOT re-derive the PR diff via \`git diff\` \u2014 the diffPath returned by \`${t("checkout_pr")}\` is authoritative. If you ever do need to diff a branch against its base via \`${t("git")}\`, use \`git diff --merge-base <base>\` (single call, includes uncommitted edits) or three-dot \`git diff <base>...HEAD\` (committed-only). Do NOT use bare \`<base>\` or two-dot \`<base>..HEAD\` \u2014 those are symmetric and include the *inverse* of every commit landed on \`<base>\` since your branch forked (the tool will reject those forms when the divergence is detected). Do NOT try \`$(git merge-base \u2026)\` subshells \u2014 the git tool runs git directly with no shell interpolation. \`git log\` and \`git diff --stat\` are fine for commit-range overview; \`git diff\` / \`git diff --cached\` are fine for inspecting your *own* uncommitted changes. For operations requiring remote authentication, use the dedicated MCP tools:`
164146
- )}
163827
+ Use \`${t("git")}\` for local git commands (status, log, add, commit, checkout, branch, merge, etc.). When reviewing a PR, the diffPath returned by \`${t("checkout_pr")}\` is authoritative \u2014 read it rather than re-deriving the diff. To diff a branch against its base yourself, use \`git diff --merge-base <base>\`; the tool rejects the symmetric forms and tells you what to use instead. Note the git tool runs git directly, so \`$(\u2026)\` subshells do not interpolate. For operations requiring remote authentication, use the dedicated MCP tools:
164147
163828
  - \`${t("push_branch")}\` - push current or specified branch
164148
163829
  - \`${t("git_fetch")}\` - fetch refs from remote
164149
163830
  - \`${t("checkout_pr")}\` - checkout a PR branch (fetches and configures push for forks)
@@ -164182,31 +163863,15 @@ ${getStandaloneModeInstructions(ctx.payload.event.trigger, t, ctx.outputSchema)}
164182
163863
 
164183
163864
  ## Workflow
164184
163865
 
164185
- ${byProfile(
164186
- `### Efficiency
164187
-
164188
- Trust tool results \u2014 re-verify only after an actual error, or right before \`${t("push_branch")}\`, which rejects a dirty tree (tests you ran earlier often leave untracked output). Issue independent tool calls together in one turn rather than one per turn; sequence anything that depends on prior output. Commands run synchronously, so never \`sleep\` to wait for one.`,
164189
- `### Efficiency
164190
-
164191
- Trust the tools \u2014 do not repeatedly verify file contents or git status after operations. If a tool reports success, proceed to the next step. Only verify if you encounter an actual error. Exception: right before \`${t("push_branch")}\`, ensure the working tree is clean \u2014 that tool rejects dirty trees, and tests you ran earlier often leave untracked output.
164192
-
164193
- ### Parallel tool execution
163866
+ ### Efficiency
164194
163867
 
164195
- For maximum efficiency, whenever you need to perform multiple independent operations, invoke all relevant tools simultaneously in a single assistant turn rather than sequentially. The dominant failure mode is grep \u2192 read \u2192 read \u2192 read \u2192 read across separate turns when one round trip would do. Always parallelize when calls are independent:
164196
- - reading multiple files (especially after a grep returns candidates)
164197
- - multiple greps with different patterns
164198
- - glob + grep + read combos
164199
- - listing multiple directories
164200
- - inspecting multiple MCP tools or resources
163868
+ Trust tool results \u2014 re-verify only after an actual error, or right before \`${t("push_branch")}\`, which rejects a dirty tree (tests you ran earlier often leave untracked output). Commands run synchronously, so never \`sleep\` to wait for one.
164201
163869
 
164202
- Do NOT parallelize operations that depend on prior output (e.g. create a file then read it), or ordered stateful mutations. Edits are not parallelizable \u2014 sequence those normally.
163870
+ ### Batch your tool calls
164203
163871
 
164204
- Emit multiple \`tool_use\` blocks in the same assistant message for independent calls \u2014 the runtime executes them concurrently. Do not wait for one tool result before issuing the next independent call.
163872
+ If you can emit multiple tool calls in a single assistant turn, do it \u2014 aggressively, for every set of calls that does not depend on the others. Reading five files after a grep, running several greps, a glob plus a grep plus a read, querying several MCP tools: all one turn. The dominant waste is grep \u2192 read \u2192 read \u2192 read across separate turns when one round trip would do, and each extra turn re-sends your whole context, so turn count is what the run costs.
164205
163873
 
164206
- ### Command execution
164207
-
164208
- Never use \`sleep\` to wait for commands to complete. Commands run synchronously \u2014 when the shell tool returns, the command has finished.`
164209
- )}
163874
+ Sequence only what genuinely needs prior output, and keep edits and ordered mutations sequential.
164210
163875
 
164211
163876
  ### Commenting style
164212
163877
 
@@ -164216,8 +163881,7 @@ Never \`@\`-mention a GitHub username unless that exact handle appears in the us
164216
163881
 
164217
163882
  When embedding images (e.g. uploaded screenshots) in comments or PR bodies, always use markdown image syntax: \`![description](url)\`. Never paste a naked URL \u2014 it will not render as an image.
164218
163883
 
164219
- ${byProfile(
164220
- `### Progress reporting
163884
+ ### Progress reporting
164221
163885
 
164222
163886
  **Your raw assistant messages are never delivered** \u2014 they exist only in the run logs. Anything the user is meant to see (an answer to a question, a mention reply, a result) MUST go through \`report_progress\` or another ${pullfrogMcpName} write tool.
164223
163887
 
@@ -164225,25 +163889,7 @@ Keep an internal task list from your mode's steps; the system renders it to the
164225
163889
 
164226
163890
  ### If you get stuck
164227
163891
 
164228
- Don't silently fail or produce incomplete work. Report what blocked you and what would unblock it, specifically enough to act on. If the same approach has failed repeatedly, step back and say what you tried and what alternatives exist rather than repeating it.`,
164229
- `### Progress reporting
164230
-
164231
- **Task list**: at the start of every run, create an internal task list based on the steps in your current mode. Update it as you complete each step. The system automatically renders this list to the progress comment \u2014 you do not need to call \`report_progress\` for this.
164232
-
164233
- **Your raw assistant messages are never delivered** \u2014 they exist only in the run logs. Anything the user is meant to see (an answer to a question, a mention reply, a result) MUST go through \`report_progress\` (or another ${pullfrogMcpName} write tool). Do not rely on returning the answer as plain text \u2014 the harness makes a best-effort attempt to recover it into the progress comment, but that is a safety net, not a substitute for calling \`report_progress\`.
164234
-
164235
- **\`report_progress\`**: call this exactly once at the end of every run with a brief final summary (1-3 sentences) unless the mode guidance instructs otherwise or a standalone comment on the current target is the task's sole requested deliverable. Never call it for intermediate status updates (e.g., "Checking for changes...", "Starting review...") \u2014 the task list handles live progress automatically. Calling \`report_progress\` replaces the task list with your summary and preserves the current task list in a collapsible section. Keep the summary concise \u2014 do not repeat what the task list already shows. Focus on the outcome (what was accomplished, links to artifacts) rather than listing individual steps. If something failed, include the tool's error text even when that makes the summary longer.
164236
-
164237
- Never use \`create_issue_comment\` for task progress or for the answer that \`report_progress\` should deliver. Use it only when the task explicitly requests a separate standalone comment or a comment on a different target. Skip \`report_progress\` only when a standalone comment on the current target is the task's sole requested deliverable; successful-run cleanup then removes the progress chrome. Plan output (initial post AND revisions) goes through \`report_progress\` \u2014 see the Plan mode guidance for details.
164238
-
164239
- ### If you get stuck
164240
-
164241
- If you cannot complete a task due to missing information, ambiguity, or an unrecoverable error:
164242
- 1. Do not silently fail or produce incomplete work
164243
- 2. Post a comment via ${pullfrogMcpName} explaining what blocked you and what information or action would unblock you
164244
- 3. Make your blocker comment specific and actionable (e.g., "I need the database schema to proceed" not "I'm stuck")
164245
- 4. If you've attempted the same fix or approach 3 or more times without progress, step back and reconsider. Report what you tried, why it failed, and what alternative approaches exist \u2014 rather than repeating failed attempts.`
164246
- )}
163892
+ Don't silently fail or produce incomplete work. Report what blocked you and what would unblock it, specifically enough to act on. If the same approach has failed repeatedly, step back and say what you tried and what alternatives exist rather than repeating it.
164247
163893
 
164248
163894
  ### Agent context files
164249
163895
 
@@ -165971,7 +165617,6 @@ function logRunStartup(ctx) {
165971
165617
  log.info(`\xBB push: ${ctx.payload.push}`);
165972
165618
  log.info(`\xBB shell: ${ctx.payload.shell}`);
165973
165619
  log.info(`\xBB timeout: ${resolveTimeoutForLog(ctx.payload.timeout)}`);
165974
- log.info(`\xBB prompt: ${promptProfile()}`);
165975
165620
  }
165976
165621
 
165977
165622
  // utils/todoTracking.ts