pullfrog 0.1.42 → 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/cli.mjs +111 -300
- package/dist/index.js +110 -299
- package/dist/internal.js +59 -248
- package/dist/modes.d.ts +0 -1
- package/dist/toolState.d.ts +1 -0
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -103022,7 +103022,7 @@ var import_semver = __toESM(require_semver2(), 1);
|
|
|
103022
103022
|
// package.json
|
|
103023
103023
|
var package_default = {
|
|
103024
103024
|
name: "pullfrog",
|
|
103025
|
-
version: "0.1.
|
|
103025
|
+
version: "0.1.44",
|
|
103026
103026
|
type: "module",
|
|
103027
103027
|
bin: {
|
|
103028
103028
|
pullfrog: "dist/cli.mjs",
|
|
@@ -103707,32 +103707,27 @@ Report findings clearly with file:line references and quoted evidence where poss
|
|
|
103707
103707
|
// modes.ts
|
|
103708
103708
|
var PR_SUMMARY_FORMAT = `### Default format
|
|
103709
103709
|
|
|
103710
|
-
The body has at most three parts in this
|
|
103710
|
+
The body has at most three parts, in this order:
|
|
103711
103711
|
|
|
103712
|
-
1. **Reviewed changes preamble** \u2014
|
|
103713
|
-
2. **Cross-cutting issue sections** (zero or more) \u2014 one \`###
|
|
103714
|
-
3. **\`### \u2139\uFE0F Nitpicks\`** at the very bottom
|
|
103712
|
+
1. **Reviewed changes preamble** \u2014 a bolded \`**Reviewed changes**\` lead-in with one sentence on what was reviewed in this run (for \`IncrementalReview\`: what changed since the prior pullfrog review), then a bullet list of the substantive changes \u2014 short bolded title, one sentence each. A reviewer should understand the full reviewed scope from this list alone. Close the preamble with the metadata comment below.
|
|
103713
|
+
2. **Cross-cutting issue sections** (zero or more) \u2014 one \`### {emoji} {what's wrong, not what to do}\` heading per concern.
|
|
103714
|
+
3. **\`### \u2139\uFE0F Nitpicks\`** at the very bottom, if any \u2014 a flat bullet list, no technical-details block.
|
|
103715
103715
|
|
|
103716
|
-
Inline
|
|
103716
|
+
**Inline vs. body.** Concerns that anchor to a specific line go inline (the \`comments\` parameter), even when their implications are broad. Body \`### \` sections are reserved for concerns that have **no line to anchor to** \u2014 *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 raises but doesn't address*. With no non-anchorable concerns, the body is just the preamble + metadata.
|
|
103717
103717
|
|
|
103718
|
-
|
|
103718
|
+
**Severity emoji** on every \`### \` heading, and nowhere else: \u{1F6A8} critical (blocks merge \u2014 data loss, security, broken core flow) \xB7 \u26A0\uFE0F important (must address before merging) \xB7 \u2139\uFE0F informational (mergeable as-is).
|
|
103719
103719
|
|
|
103720
|
-
|
|
103720
|
+
**Blank line between every block-level element.** GitHub's markdown parser requires one before and after HTML tags (\`<details>\`, \`<summary>\`, \`<sub>\`, \`<br/>\`) \u2014 without it GitHub treats what follows as a continuation of the HTML block and renders your markdown as literal text. This is a parser quirk, not a style preference, and it permanently breaks the posted review.
|
|
103721
103721
|
|
|
103722
|
-
|
|
103723
|
-
**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.
|
|
103722
|
+
## Metadata comment
|
|
103724
103723
|
|
|
103725
|
-
|
|
103724
|
+
Fill every field from the \`checkout_pr\` response \u2014 never count files or commits by hand. For \`IncrementalReview\`, fill \`Prior pullfrog review\` from \`list_pull_request_reviews\`.
|
|
103726
103725
|
|
|
103726
|
+
\`\`\`
|
|
103727
103727
|
<!--
|
|
103728
|
-
Pullfrog review metadata
|
|
103729
|
-
|
|
103730
|
-
|
|
103731
|
-
{head_sha_short}; if new commits have landed on {head_ref} since this review
|
|
103732
|
-
was submitted, treat any specific bug, file, or line callout as POTENTIALLY
|
|
103733
|
-
STALE \u2014 re-diff against {head_sha_short} (or trigger a fresh review) and
|
|
103734
|
-
factor commits past {head_sha_short} into your understanding of the current
|
|
103735
|
-
state before acting on findings.
|
|
103728
|
+
Pullfrog review metadata. These findings were written against {head_sha_short};
|
|
103729
|
+
if commits have landed on {head_ref} since, treat every specific bug, file, or
|
|
103730
|
+
line callout as POTENTIALLY STALE and re-diff before acting on it.
|
|
103736
103731
|
|
|
103737
103732
|
- Mode: Review (initial) or IncrementalReview (delta against prior pullfrog review)
|
|
103738
103733
|
- Files reviewed: {file_count}
|
|
@@ -103741,111 +103736,36 @@ state before acting on findings.
|
|
|
103741
103736
|
- Head: {head_ref} ({head_sha_short})
|
|
103742
103737
|
- Reviewed commits:
|
|
103743
103738
|
- {sha_short} \u2014 {commit_subject}
|
|
103744
|
-
- ...
|
|
103745
103739
|
- Prior pullfrog review: none or {prior_sha_short} ({prior_review_html_url})
|
|
103746
|
-
- Submitted at: {iso_timestamp}
|
|
103747
103740
|
-->
|
|
103748
103741
|
\`\`\`
|
|
103749
103742
|
|
|
103750
|
-
|
|
103751
|
-
|
|
103752
|
-
## 2. Cross-cutting issue sections (zero or more)
|
|
103743
|
+
## Technical details
|
|
103753
103744
|
|
|
103754
|
-
|
|
103745
|
+
Every body \`### \` section carries one; an inline comment carries one when its fix is non-trivial or spans files. The visible part above it states the PROBLEM in 2-3 sentences \u2014 what's broken and what the blast radius is. Asks, fixes, and open questions live inside the block, which a downstream fix-agent pulls down as its brief, so \`file:line\` refs and identifier density belong here.
|
|
103755
103746
|
|
|
103756
103747
|
\`\`\`
|
|
103757
|
-
### {emoji} {short, descriptive title \u2014 what's wrong, not what to do}
|
|
103758
|
-
|
|
103759
|
-
{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.}
|
|
103760
|
-
|
|
103761
103748
|
<details><summary>Technical details</summary>
|
|
103762
103749
|
|
|
103763
103750
|
\\\`\\\`\\\`\\\`markdown
|
|
103764
|
-
# {title
|
|
103751
|
+
# {title}
|
|
103765
103752
|
|
|
103766
103753
|
## Affected sites
|
|
103767
103754
|
- {file path:line} \u2014 {what's wrong there}
|
|
103768
|
-
- ...
|
|
103769
103755
|
|
|
103770
103756
|
## Required outcome
|
|
103771
103757
|
- {what the fix needs to achieve, not how to achieve it}
|
|
103772
|
-
- ...
|
|
103773
103758
|
|
|
103774
103759
|
## Suggested approach (optional)
|
|
103775
|
-
{When the fix shape is non-obvious, sketch one or more reasonable directions. Skip when the outcome alone makes the fix obvious.}
|
|
103776
|
-
|
|
103777
103760
|
## Open questions for the human (optional)
|
|
103778
|
-
- {Any decision an implementing agent shouldn't make unilaterally \u2014 pricing thresholds, breaking-change policy, naming, scope of follow-up.}
|
|
103779
103761
|
\\\`\\\`\\\`\\\`
|
|
103780
103762
|
|
|
103781
103763
|
</details>
|
|
103782
103764
|
\`\`\`
|
|
103783
103765
|
|
|
103784
|
-
|
|
103785
|
-
|
|
103786
|
-
\`\`\`
|
|
103787
|
-
### \u2139\uFE0F Legacy \`opencode.ts\` has no documented deletion plan
|
|
103788
|
-
|
|
103789
|
-
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.
|
|
103790
|
-
\`\`\`
|
|
103791
|
-
|
|
103792
|
-
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.
|
|
103793
|
-
|
|
103794
|
-
**Heading severity emoji** \u2014 every \`### \` heading carries one:
|
|
103795
|
-
|
|
103796
|
-
- \u{1F6A8} critical \u2014 blocks merge (data loss, security, broken core flow)
|
|
103797
|
-
- \u26A0\uFE0F important \u2014 must address before merging (regression, missing validation, incorrect behavior)
|
|
103798
|
-
- \u2139\uFE0F informational \u2014 surfaced for awareness; mergeable as-is
|
|
103799
|
-
|
|
103800
|
-
**Visible problem write-up rules:**
|
|
103801
|
-
|
|
103802
|
-
- **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.
|
|
103803
|
-
- **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.
|
|
103804
|
-
- **Per-paragraph budget:** ~3 sentences max. Past that, you're explaining where you should be structuring.
|
|
103805
|
-
- **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.
|
|
103806
|
-
|
|
103807
|
-
**Technical-details block rules:**
|
|
103808
|
-
|
|
103809
|
-
- 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.
|
|
103810
|
-
- File paths and \`file:line\` refs are encouraged (and necessary) \u2014 the next agent uses these to navigate. Identifier density is fine here.
|
|
103811
|
-
- 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.
|
|
103812
|
-
- 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.
|
|
103813
|
-
|
|
103814
|
-
## Inline technical details
|
|
103815
|
-
|
|
103816
|
-
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\`).
|
|
103817
|
-
|
|
103818
|
-
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.
|
|
103819
|
-
|
|
103820
|
-
## 3. \`### \u2139\uFE0F Nitpicks\` (optional, last section)
|
|
103766
|
+
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.
|
|
103821
103767
|
|
|
103822
|
-
|
|
103823
|
-
|
|
103824
|
-
\`\`\`
|
|
103825
|
-
### \u2139\uFE0F Nitpicks
|
|
103826
|
-
|
|
103827
|
-
- {nit, with file path inline if useful, \u2264 ~200 chars}
|
|
103828
|
-
- ...
|
|
103829
|
-
\`\`\`
|
|
103830
|
-
|
|
103831
|
-
## Inline comment shape
|
|
103832
|
-
|
|
103833
|
-
Inline comments use the same severity framing as body \`### \` sections, scaled down for line-anchored use:
|
|
103834
|
-
|
|
103835
|
-
- **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.
|
|
103836
|
-
- **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.
|
|
103837
|
-
- **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.
|
|
103838
|
-
|
|
103839
|
-
## Body-wide rules
|
|
103840
|
-
|
|
103841
|
-
- **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.
|
|
103842
|
-
- **No \`### Issues found\` heading** above the issue sections \u2014 each \`### \` heading IS the issue.
|
|
103843
|
-
- **Severity emoji on every \`### \` heading** (\u{1F6A8} / \u26A0\uFE0F / \u2139\uFE0F). No emoji on the preamble lead-in or anywhere else.
|
|
103844
|
-
- **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.
|
|
103845
|
-
- **Backtick-wrap** every variable, identifier, or file name when you mention one (in either visible or technical-details portions).
|
|
103846
|
-
- **Don't repeat diff content**, don't include raw \`+123 / -45\` stats, don't include a changelog section, don't use horizontal rules (\`---\`).
|
|
103847
|
-
- **Pull file/commit counts from \`checkout_pr\` metadata** \u2014 never count manually.
|
|
103848
|
-
- **Legacy headings REMOVED.** Do not use \`### Key changes\`, \`### Issues found\`, \`<b>TL;DR</b>\`, or \`<sub><b>Summary</b>\`. The new structure subsumes them.`;
|
|
103768
|
+
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.`;
|
|
103849
103769
|
function computeModes(agentId, signedCommits = false) {
|
|
103850
103770
|
const t2 = (toolName) => formatMcpToolRef(agentId, toolName);
|
|
103851
103771
|
const commitStep = signedCommits ? `commit via \`${t2("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 "..."\`)`;
|
|
@@ -103869,58 +103789,15 @@ function computeModes(agentId, signedCommits = false) {
|
|
|
103869
103789
|
- 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.
|
|
103870
103790
|
- run relevant tests/lints before committing
|
|
103871
103791
|
|
|
103872
|
-
5. **self-review**:
|
|
103873
|
-
|
|
103874
|
-
Skip self-review (commit directly) when the diff is **genuinely trivial**:
|
|
103875
|
-
- doc typos, comment-only edits, whitespace/format-only, import reordering
|
|
103876
|
-
- 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)
|
|
103877
|
-
- low-risk dep patch bump from a trusted source
|
|
103878
|
-
|
|
103879
|
-
Run self-review when the diff has **any behavioral surface, however small**:
|
|
103880
|
-
- 1-line changes to SQL operators / comparison logic / regexes / redirects / HTTP methods / response codes
|
|
103881
|
-
- any change to money / tax / currency / billing / fee / refund / payout calculations or constants
|
|
103882
|
-
- any change to auth / permissions / roles / sessions / tokens / signature verification
|
|
103883
|
-
- any change to feature-flag defaults, retry counts, timeouts, rate limits, batch sizes
|
|
103884
|
-
- new endpoints, new code paths, new error branches \u2014 even small ones
|
|
103885
|
-
- mixed diffs (whitespace + a single semantic line) \u2014 the semantic line still triggers self-review
|
|
103886
|
-
- anything you're uncertain about
|
|
103887
|
-
|
|
103888
|
-
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.
|
|
103889
|
-
|
|
103890
|
-
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.
|
|
103891
|
-
|
|
103892
|
-
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.)
|
|
103893
|
-
|
|
103894
|
-
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.
|
|
103895
|
-
|
|
103896
|
-
\`\`\`
|
|
103897
|
-
## What you're reviewing
|
|
103898
|
-
This is a PRE-COMMIT Build-mode self-review. The work to review lives in the working tree (uncommitted), NOT in committed history.
|
|
103899
|
-
|
|
103900
|
-
Branch: <branch> (off <base>)
|
|
103901
|
-
Canonical diff command: git diff --merge-base origin/<base>
|
|
103902
|
-
|
|
103903
|
-
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.
|
|
103904
|
-
|
|
103905
|
-
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.
|
|
103906
|
-
|
|
103907
|
-
## Your task
|
|
103908
|
-
<YOUR TASK content>
|
|
103792
|
+
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.
|
|
103909
103793
|
|
|
103910
|
-
|
|
103911
|
-
<tight summary \u2014 what broke, root cause, the fix \u2014 or "no build-phase failures">
|
|
103912
|
-
\`\`\`
|
|
103794
|
+
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.
|
|
103913
103795
|
|
|
103914
|
-
|
|
103796
|
+
In the dispatch prompt: say this is a PRE-COMMIT self-review whose work is uncommitted in the working tree, give the branch and base, name \`git diff --merge-base origin/<base>\` as the canonical diff command, paste YOUR TASK, and summarize any build-phase failures. If that diff comes back empty, there is nothing to review \u2014 stop.
|
|
103915
103797
|
|
|
103916
|
-
|
|
103917
|
-
- Do NOT summarize what you implemented \u2014 that biases the subagent toward validating the shape of your solution rather than questioning it.
|
|
103918
|
-
- Do NOT curate a reading list of files. Let the subagent discover scope from the diff and codebase.
|
|
103919
|
-
- Do NOT pre-shape output with a severity / category schema. That leaks your hypotheses; severity is your call during evaluation.
|
|
103920
|
-
- 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.
|
|
103921
|
-
- 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.
|
|
103798
|
+
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.
|
|
103922
103799
|
|
|
103923
|
-
|
|
103800
|
+
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}.
|
|
103924
103801
|
|
|
103925
103802
|
6. **finalize**:
|
|
103926
103803
|
- ${finalizeStep} (see *SYSTEM* Git rules if this fails \u2014 prepush errors are usually the repo's tests/lint, not infra timeouts)
|
|
@@ -103988,76 +103865,28 @@ For simple, well-defined tasks, skip the plan phase and go straight to build.`
|
|
|
103988
103865
|
|
|
103989
103866
|
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.
|
|
103990
103867
|
|
|
103991
|
-
|
|
103992
|
-
|
|
103993
|
-
|
|
103994
|
-
|
|
103995
|
-
|
|
103996
|
-
|
|
103997
|
-
-
|
|
103998
|
-
|
|
103999
|
-
"
|
|
104000
|
-
|
|
104001
|
-
|
|
104002
|
-
|
|
104003
|
-
|
|
104004
|
-
|
|
104005
|
-
|
|
104006
|
-
-
|
|
104007
|
-
-
|
|
104008
|
-
-
|
|
104009
|
-
|
|
104010
|
-
|
|
104011
|
-
|
|
104012
|
-
|
|
104013
|
-
|
|
104014
|
-
Route the **minimum number of \`${REVIEWER_AGENT_NAME}\` specialists** needed to cover those unresolved hypotheses. Most reviews need **0 or 1**:
|
|
104015
|
-
- dispatch 0 when you can resolve every disposition-changing question directly
|
|
104016
|
-
- dispatch 1 when exactly one falsifiable, load-bearing hypothesis warrants independent investigation
|
|
104017
|
-
- dispatch 2+ in parallel when multiple orthogonal load-bearing hypotheses remain, or when the user explicitly requests an exhaustive or multi-angle review
|
|
104018
|
-
|
|
104019
|
-
**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.
|
|
104020
|
-
|
|
104021
|
-
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.
|
|
104022
|
-
|
|
104023
|
-
Specialist hypotheses can draw on two kinds of framing:
|
|
104024
|
-
- **themed lenses** \u2014 a perspective applied across the whole diff (correctness, security, user-journey, performance, etc.).
|
|
104025
|
-
- **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.
|
|
104026
|
-
|
|
104027
|
-
starter menu for identifying hypotheses (combine, omit, or invent your own; do not dispatch a bare menu label without a falsifiable question):
|
|
104028
|
-
- **correctness & invariants** \u2014 bugs, races, error handling, edge cases, state-machine boundaries
|
|
104029
|
-
- **impact** \u2014 stale references in code/tests/docs/configs/UI after rename/remove
|
|
104030
|
-
- **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.
|
|
104031
|
-
- **security** \u2014 new endpoints, authZ, input validation, secrets handling, replay/CSRF/injection, cross-tenant isolation
|
|
104032
|
-
- **user-journey** \u2014 UX-touching flows: walk through happy path and failure modes as a user
|
|
104033
|
-
- **operational readiness** \u2014 observability, alerting, migrations (forward + rollback), feature flags, on-call burden
|
|
104034
|
-
- **integration & cross-cutting** \u2014 API contracts between modules, backward-compat of public surfaces, multi-service ordering
|
|
104035
|
-
- **test integrity** \u2014 meaningful coverage for the changed behavior; deterministic; no shared-state pollution
|
|
104036
|
-
- **performance** \u2014 N+1 queries, hot-path allocation, latency budgets, index coverage
|
|
104037
|
-
- **holistic** \u2014 does the PR make sense as a whole? symmetric flows (delete for every create, rollback for every migration)?
|
|
104038
|
-
- **subsystem lenses** (invent as the PR demands) \u2014 auth, billing, payments, schema migration, webhooks, secrets, RBAC, multi-tenant isolation, cron/scheduling, etc.
|
|
104039
|
-
|
|
104040
|
-
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.
|
|
104041
|
-
|
|
104042
|
-
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.
|
|
104043
|
-
|
|
104044
|
-
\u2705 Right multi-specialist pattern: one assistant turn with N Task tool_use blocks \u2192 wait \u2192 N results arrive together \u2192 aggregate.
|
|
104045
|
-
\u274C Wrong multi-specialist pattern: Task(hypothesis A) \u2192 wait for A \u2192 Task(hypothesis B).
|
|
104046
|
-
|
|
104047
|
-
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.
|
|
104048
|
-
|
|
104049
|
-
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:
|
|
104050
|
-
- **the absolute \`diffPath\` (and \`incrementalDiffPath\` if available) from step 2's \`${t2("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.
|
|
104051
|
-
- **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
|
|
104052
|
-
- **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\`.
|
|
104053
|
-
- 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."
|
|
104054
|
-
- 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.
|
|
104055
|
-
|
|
104056
|
-
delegation discipline:
|
|
104057
|
-
- do NOT summarize the PR for them (a lossy summary biases toward a validation frame; the raw diff is the source)
|
|
104058
|
-
- do NOT hand them a curated reading list (let them discover scope)
|
|
104059
|
-
- do NOT pre-shape their output with a finding schema
|
|
104060
|
-
- do NOT mention the other lenses (independence is the point \u2014 overlapping findings are a strong signal)
|
|
103868
|
+
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.
|
|
103869
|
+
|
|
103870
|
+
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.
|
|
103871
|
+
|
|
103872
|
+
4. **specialist decision**: after reading the complete diff, name the questions you still cannot answer confidently yourself, and dispatch one \`${REVIEWER_AGENT_NAME}\` specialist per question. a question qualifies only when a specialist could return evidence that **changes your disposition** on the PR \u2014 generic requests for another look, extra confidence, or polish do not. most reviews need zero or one; some need several.
|
|
103873
|
+
|
|
103874
|
+
**There is NO one-specialist cap or fixed maximum.** cover every orthogonal question that remains; do not collapse several real questions into one broad prompt just to reduce the count. there is no file-count, line-count, or budget threshold either \u2014 diff size is not a proxy for review uncertainty.
|
|
103875
|
+
|
|
103876
|
+
frame each question through the lens that primes the right failure modes. for high-stakes subsystems, lead with the **domain** ("the billing lens", "the auth lens", "the schema-migration lens") rather than the generic equivalent ("correctness on billing code") \u2014 the domain framing makes the subagent recall double-charges, refund races, currency rounding, and dispute flows that a generic lens misses.
|
|
103877
|
+
|
|
103878
|
+
you remain the synthesizer: reading the complete raw diff, investigating surrounding code, validating every returned finding, and writing the review are yours. specialist reads supplement that work; they never satisfy your own coverage obligation.
|
|
103879
|
+
|
|
103880
|
+
5. **dispatch specialists (only if step 4 found unresolved questions)**: for 2+ questions, emit every Task tool_use block **IN A SINGLE ASSISTANT TURN** before reading any result, so the investigations run in parallel rather than serially. your own \`read\` / \`grep\` / \`webfetch\` calls can ride in that same turn at zero extra wall time.
|
|
103881
|
+
|
|
103882
|
+
if a specialist errors out, times out, or returns nothing usable, retry it once. if it still fails, resolve the question yourself; if it remains disposition-changing and unresolved, surface the limitation and do not approve. each dispatch carries:
|
|
103883
|
+
- **the absolute \`diffPath\` (and \`incrementalDiffPath\` if available) from step 2's \`${t2("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 a \`git diff origin/<base>\` fallback that fails on shallow GHA checkouts. it \`read\`s those files for scope and must NOT re-derive the diff itself; reading and codebase exploration are still its job.
|
|
103884
|
+
- **exactly one falsifiable question with explicit scope boundaries** \u2014 ask for evidence that supports or refutes it, never a broad "review for X, Y, and Z" prompt.
|
|
103885
|
+
- **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. without it, every subagent shows up as \`subagent#N\`.
|
|
103886
|
+
- 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."
|
|
103887
|
+
- ask for findings with file paths and NEW line numbers from the diff so you can validate and anchor them.
|
|
103888
|
+
|
|
103889
|
+
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.
|
|
104061
103890
|
|
|
104062
103891
|
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.
|
|
104063
103892
|
|
|
@@ -104127,46 +103956,28 @@ ${PR_SUMMARY_FORMAT}`
|
|
|
104127
103956
|
|
|
104128
103957
|
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.**
|
|
104129
103958
|
|
|
104130
|
-
|
|
104131
|
-
|
|
104132
|
-
"Genuinely trivial" (skip): formatting/comment tweaks, import reordering, lockfile regen, mechanical rename of import paths, whitespace-only.
|
|
104133
|
-
"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.
|
|
104134
|
-
When unsure, treat as non-trivial.
|
|
104135
|
-
|
|
104136
|
-
6. **specialist decision \u2014 minimum hypothesis coverage**.
|
|
103959
|
+
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).
|
|
104137
103960
|
|
|
104138
|
-
|
|
103961
|
+
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.
|
|
104139
103962
|
|
|
104140
|
-
|
|
104141
|
-
- dispatch 0 when you can resolve every disposition-changing question directly
|
|
104142
|
-
- dispatch 1 when exactly one falsifiable, load-bearing hypothesis warrants independent investigation
|
|
104143
|
-
- dispatch 2+ in parallel when multiple orthogonal load-bearing hypotheses remain, or when the user explicitly requests an exhaustive or multi-angle review
|
|
103963
|
+
6. **specialist decision**: after covering the incremental and full diffs, name the questions about the new changes that you still cannot answer confidently yourself, and dispatch one \`${REVIEWER_AGENT_NAME}\` specialist per question. a question qualifies only when a specialist could return evidence that **changes your disposition** on the PR \u2014 generic requests for another look, extra confidence, or polish do not. most incremental reviews need zero or one, especially thread-reply re-reviews; some need several.
|
|
104144
103964
|
|
|
104145
|
-
**There is NO one-specialist cap or fixed maximum.**
|
|
103965
|
+
**There is NO one-specialist cap or fixed maximum.** cover every orthogonal question that remains; do not collapse several real questions into one broad prompt just to reduce the count. there is no file-count, line-count, or budget threshold either \u2014 diff size is not a proxy for review uncertainty.
|
|
104146
103966
|
|
|
104147
|
-
|
|
103967
|
+
frame each question through the lens that primes the right failure modes. for high-stakes subsystems, lead with the **domain** ("the billing lens", "the auth lens", "the schema-migration lens") rather than the generic equivalent \u2014 the domain framing makes the subagent recall failure modes a generic lens misses.
|
|
104148
103968
|
|
|
104149
|
-
|
|
103969
|
+
you remain the synthesizer: reading the complete raw full diff plus the incremental diff, investigating surrounding code, validating every returned finding, and writing the review are yours. specialist reads supplement that work; they never satisfy your own coverage obligation.
|
|
104150
103970
|
|
|
104151
|
-
7. **dispatch specialists (only if step 6 found unresolved
|
|
103971
|
+
7. **dispatch specialists (only if step 6 found unresolved questions)**: for 2+ questions, emit every Task tool_use block **IN A SINGLE ASSISTANT TURN** before reading any result, so the investigations run in parallel rather than serially. your own \`read\` / \`grep\` / \`webfetch\` calls can ride in that same turn.
|
|
104152
103972
|
|
|
104153
|
-
|
|
104154
|
-
|
|
104155
|
-
|
|
104156
|
-
You can also include your own \`read\` / \`grep\` / \`webfetch\` calls in the SAME turn as the parallel \`${REVIEWER_AGENT_NAME}\` dispatches.
|
|
104157
|
-
|
|
104158
|
-
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:
|
|
104159
|
-
- **the absolute diff path(s) from step 2's \`${t2("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.
|
|
104160
|
-
- **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
|
|
103973
|
+
if a specialist errors out, times out, or returns nothing usable, retry it once. if it still fails, resolve the question yourself; if it remains disposition-changing and unresolved, surface the limitation and do not approve. each dispatch carries:
|
|
103974
|
+
- **the absolute diff path(s) from step 2's \`${t2("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. it \`read\`s those files and must NOT re-derive the diff itself; paraphrasing ("review the new commits") sends it down a \`git diff\` fallback that 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.
|
|
103975
|
+
- **exactly one falsifiable question with explicit scope boundaries** \u2014 ask for evidence that supports or refutes it, never a broad "review for X, Y, and Z" prompt.
|
|
104161
103976
|
- **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.
|
|
104162
|
-
- if the
|
|
104163
|
-
- ask
|
|
103977
|
+
- 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.
|
|
103978
|
+
- ask for findings with file paths and NEW line numbers from the full PR diff so you can validate and anchor them.
|
|
104164
103979
|
|
|
104165
|
-
delegation discipline:
|
|
104166
|
-
- do NOT summarize the changes for them (a lossy summary biases toward a validation frame; the raw diff is the source)
|
|
104167
|
-
- do NOT hand them a curated reading list (let them discover scope)
|
|
104168
|
-
- do NOT pre-shape their output with a finding schema
|
|
104169
|
-
- do NOT mention the other lenses (independence is the point)
|
|
103980
|
+
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.
|
|
104170
103981
|
|
|
104171
103982
|
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 \`${t2("list_pull_request_reviews")}\` in step 4) and run \`git diff <prior-review-sha>..HEAD\` to isolate the lines added since that review.
|
|
104172
103983
|
|
|
@@ -104293,7 +104104,8 @@ function getUnsubmittedReview(toolState, expectsReviewOutput2 = toolState.hadPro
|
|
|
104293
104104
|
if (!expectsReviewOutput2) return null;
|
|
104294
104105
|
if (mode === "Review") return toolState.review ? null : "Review";
|
|
104295
104106
|
if (mode === "IncrementalReview") {
|
|
104296
|
-
|
|
104107
|
+
const delivered = toolState.review || toolState.finalSummaryWritten || toolState.standaloneCommentId !== void 0;
|
|
104108
|
+
return delivered ? null : "IncrementalReview";
|
|
104297
104109
|
}
|
|
104298
104110
|
return null;
|
|
104299
104111
|
}
|
|
@@ -160305,6 +160117,9 @@ function CreateCommentTool(ctx) {
|
|
|
160305
160117
|
});
|
|
160306
160118
|
ctx.toolState.wasUpdated = true;
|
|
160307
160119
|
log.info(`\xBB created comment ${result.data.id}`);
|
|
160120
|
+
if (issueNumber === ctx.payload.event.issue_number) {
|
|
160121
|
+
ctx.toolState.standaloneCommentId = result.data.id;
|
|
160122
|
+
}
|
|
160308
160123
|
if (commentType === "Plan") {
|
|
160309
160124
|
if (result.data.node_id) {
|
|
160310
160125
|
await patchWorkflowRunFields(ctx, { planCommentNodeId: result.data.node_id });
|
|
@@ -160494,6 +160309,14 @@ function ReportProgressTool(ctx) {
|
|
|
160494
160309
|
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.',
|
|
160495
160310
|
parameters: ReportProgress,
|
|
160496
160311
|
execute: execute(async (params) => {
|
|
160312
|
+
if (ctx.toolState.standaloneCommentId !== void 0 && !params.target_plan_comment) {
|
|
160313
|
+
ctx.toolState.lastProgressBody = params.body;
|
|
160314
|
+
return {
|
|
160315
|
+
success: true,
|
|
160316
|
+
action: "skipped",
|
|
160317
|
+
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.`
|
|
160318
|
+
};
|
|
160319
|
+
}
|
|
160497
160320
|
let body = params.body;
|
|
160498
160321
|
if (!params.target_plan_comment && ctx.toolState.todoTracker) {
|
|
160499
160322
|
ctx.toolState.todoTracker.cancel();
|
|
@@ -160848,7 +160671,7 @@ var CreatePullRequestReview = type({
|
|
|
160848
160671
|
// running. required-ness is the only pressure that empirically held.
|
|
160849
160672
|
// see wiki/review-approval.md.
|
|
160850
160673
|
body: type.string.describe(
|
|
160851
|
-
`
|
|
160674
|
+
`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.`
|
|
160852
160675
|
),
|
|
160853
160676
|
approved: type.boolean.describe(
|
|
160854
160677
|
"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."
|
|
@@ -160884,7 +160707,7 @@ function CreatePullRequestReviewTool(ctx) {
|
|
|
160884
160707
|
return tool({
|
|
160885
160708
|
name: "create_pull_request_review",
|
|
160886
160709
|
mutates: true,
|
|
160887
|
-
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).
|
|
160710
|
+
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.`,
|
|
160888
160711
|
parameters: CreatePullRequestReview,
|
|
160889
160712
|
execute: execute(
|
|
160890
160713
|
async ({ pull_number, body, approved, request_changes, commit_id, comments = [] }) => {
|
|
@@ -164567,10 +164390,32 @@ function SelectModeTool(ctx) {
|
|
|
164567
164390
|
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 })`.',
|
|
164568
164391
|
parameters: SelectModeParams,
|
|
164569
164392
|
execute: execute(async (params) => {
|
|
164570
|
-
|
|
164393
|
+
const guidanceFor = (mode) => {
|
|
164394
|
+
const base = buildOrchestratorGuidance(ctx, mode);
|
|
164395
|
+
if (!SUMMARY_MODES.has(mode.name)) return base;
|
|
164396
|
+
const addendum = buildSummaryAddendum(t2, ctx);
|
|
164397
|
+
if (addendum.length === 0) return base;
|
|
164571
164398
|
return {
|
|
164572
|
-
|
|
164399
|
+
...base,
|
|
164400
|
+
orchestratorGuidance: `${base.orchestratorGuidance}
|
|
164401
|
+
|
|
164402
|
+
${addendum}`,
|
|
164403
|
+
summaryFilePath: ctx.toolState.summaryFilePath
|
|
164573
164404
|
};
|
|
164405
|
+
};
|
|
164406
|
+
if (ctx.toolState.selectedMode) {
|
|
164407
|
+
const active = ctx.toolState.selectedMode;
|
|
164408
|
+
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.`;
|
|
164409
|
+
const activeMode = resolveMode(ctx.modes, active);
|
|
164410
|
+
if (!activeMode) return { error: error49 };
|
|
164411
|
+
if (activeMode.name === "Plan" && ctx.toolState.existingPlanCommentId !== void 0) {
|
|
164412
|
+
return {
|
|
164413
|
+
...buildOrchestratorGuidance(ctx, activeMode, overrides.PlanEdit),
|
|
164414
|
+
previousPlanBody: ctx.toolState.previousPlanBody,
|
|
164415
|
+
error: error49
|
|
164416
|
+
};
|
|
164417
|
+
}
|
|
164418
|
+
return { ...guidanceFor(activeMode), error: error49 };
|
|
164574
164419
|
}
|
|
164575
164420
|
const modeName = params.mode;
|
|
164576
164421
|
const selectedMode = resolveMode(ctx.modes, modeName);
|
|
@@ -164599,18 +164444,7 @@ function SelectModeTool(ctx) {
|
|
|
164599
164444
|
}
|
|
164600
164445
|
}
|
|
164601
164446
|
}
|
|
164602
|
-
|
|
164603
|
-
const base = buildOrchestratorGuidance(ctx, selectedMode);
|
|
164604
|
-
if (summaryAddendum.length > 0) {
|
|
164605
|
-
return {
|
|
164606
|
-
...base,
|
|
164607
|
-
orchestratorGuidance: `${base.orchestratorGuidance}
|
|
164608
|
-
|
|
164609
|
-
${summaryAddendum}`,
|
|
164610
|
-
summaryFilePath: ctx.toolState.summaryFilePath
|
|
164611
|
-
};
|
|
164612
|
-
}
|
|
164613
|
-
return base;
|
|
164447
|
+
return guidanceFor(selectedMode);
|
|
164614
164448
|
})
|
|
164615
164449
|
});
|
|
164616
164450
|
}
|
|
@@ -165817,7 +165651,7 @@ You execute tasks directly using your native tools and the ${pullfrogMcpName} MC
|
|
|
165817
165651
|
|
|
165818
165652
|
Call \`${t2("select_mode")}\` with the appropriate mode name. This returns **your workflow** \u2014 a step-by-step playbook you must follow.
|
|
165819
165653
|
|
|
165820
|
-
**
|
|
165654
|
+
**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.
|
|
165821
165655
|
|
|
165822
165656
|
Available modes:
|
|
165823
165657
|
${ctx.modes.map((m) => `- "${m.name}": ${m.description}`).join("\n")}
|
|
@@ -165856,12 +165690,8 @@ You are a diligent, detail-oriented, no-nonsense software engineering agent. You
|
|
|
165856
165690
|
## Persona
|
|
165857
165691
|
|
|
165858
165692
|
- Careful, to-the-point, and kind. You only say things you know to be true.
|
|
165859
|
-
-
|
|
165860
|
-
-
|
|
165861
|
-
- Code is focused, elegant, and production-ready.
|
|
165862
|
-
- Do not add unnecessary comments, tests, or documentation unless explicitly prompted to do so.
|
|
165863
|
-
- Adapt your writing style to match existing patterns in the codebase (commit messages, PR descriptions, code comments) while never being unprofessional.
|
|
165864
|
-
- Use backticks liberally for inline code (e.g. \`z.string()\`) even in headers.
|
|
165693
|
+
- 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.
|
|
165694
|
+
- Do not break up sentences with hyphens. Use emdashes. Use backticks liberally for inline code (e.g. \`z.string()\`) even in headers.
|
|
165865
165695
|
|
|
165866
165696
|
## Environment
|
|
165867
165697
|
|
|
@@ -165881,7 +165711,7 @@ MCP servers provide tools you can call. Inspect your available MCP servers at st
|
|
|
165881
165711
|
|
|
165882
165712
|
### Git
|
|
165883
165713
|
|
|
165884
|
-
Use \`${t2("git")}\` for local git commands (status, log, add, commit, checkout, branch, merge, etc.). When reviewing a PR,
|
|
165714
|
+
Use \`${t2("git")}\` for local git commands (status, log, add, commit, checkout, branch, merge, etc.). When reviewing a PR, the diffPath returned by \`${t2("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:
|
|
165885
165715
|
- \`${t2("push_branch")}\` - push current or specified branch
|
|
165886
165716
|
- \`${t2("git_fetch")}\` - fetch refs from remote
|
|
165887
165717
|
- \`${t2("checkout_pr")}\` - checkout a PR branch (fetches and configures push for forks)
|
|
@@ -165922,24 +165752,13 @@ ${getStandaloneModeInstructions(ctx.payload.event.trigger, t2, ctx.outputSchema)
|
|
|
165922
165752
|
|
|
165923
165753
|
### Efficiency
|
|
165924
165754
|
|
|
165925
|
-
Trust
|
|
165755
|
+
Trust tool results \u2014 re-verify only after an actual error, or right before \`${t2("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.
|
|
165926
165756
|
|
|
165927
|
-
###
|
|
165757
|
+
### Batch your tool calls
|
|
165928
165758
|
|
|
165929
|
-
|
|
165930
|
-
- reading multiple files (especially after a grep returns candidates)
|
|
165931
|
-
- multiple greps with different patterns
|
|
165932
|
-
- glob + grep + read combos
|
|
165933
|
-
- listing multiple directories
|
|
165934
|
-
- inspecting multiple MCP tools or resources
|
|
165759
|
+
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.
|
|
165935
165760
|
|
|
165936
|
-
|
|
165937
|
-
|
|
165938
|
-
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.
|
|
165939
|
-
|
|
165940
|
-
### Command execution
|
|
165941
|
-
|
|
165942
|
-
Never use \`sleep\` to wait for commands to complete. Commands run synchronously \u2014 when the shell tool returns, the command has finished.
|
|
165761
|
+
Sequence only what genuinely needs prior output, and keep edits and ordered mutations sequential.
|
|
165943
165762
|
|
|
165944
165763
|
### Commenting style
|
|
165945
165764
|
|
|
@@ -165951,21 +165770,13 @@ When embedding images (e.g. uploaded screenshots) in comments or PR bodies, alwa
|
|
|
165951
165770
|
|
|
165952
165771
|
### Progress reporting
|
|
165953
165772
|
|
|
165954
|
-
**
|
|
165955
|
-
|
|
165956
|
-
**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\`.
|
|
165957
|
-
|
|
165958
|
-
**\`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.
|
|
165773
|
+
**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.
|
|
165959
165774
|
|
|
165960
|
-
|
|
165775
|
+
Keep an internal task list from your mode's steps; the system renders it to the progress comment on its own, so don't call \`report_progress\` for intermediate status. Call it once at the end with a short outcome-focused summary \u2014 what was accomplished and links to artifacts, not a replay of the steps. If something failed, include the tool's exact error text. Use \`create_issue_comment\` only when a standalone comment is the explicit deliverable; when it is, that replaces the final \`report_progress\` call rather than adding to it.
|
|
165961
165776
|
|
|
165962
165777
|
### If you get stuck
|
|
165963
165778
|
|
|
165964
|
-
|
|
165965
|
-
1. Do not silently fail or produce incomplete work
|
|
165966
|
-
2. Post a comment via ${pullfrogMcpName} explaining what blocked you and what information or action would unblock you
|
|
165967
|
-
3. Make your blocker comment specific and actionable (e.g., "I need the database schema to proceed" not "I'm stuck")
|
|
165968
|
-
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.
|
|
165779
|
+
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.
|
|
165969
165780
|
|
|
165970
165781
|
### Agent context files
|
|
165971
165782
|
|
|
@@ -169330,7 +169141,7 @@ async function runCli4(input) {
|
|
|
169330
169141
|
}
|
|
169331
169142
|
|
|
169332
169143
|
// cli.ts
|
|
169333
|
-
var VERSION10 = "0.1.
|
|
169144
|
+
var VERSION10 = "0.1.44";
|
|
169334
169145
|
var bin = basename2(process.argv[1] || "");
|
|
169335
169146
|
var PROG = bin === "pf" || bin === "pullfrog" ? bin : "pullfrog";
|
|
169336
169147
|
var rawArgs = process.argv.slice(2);
|