jonah-fleet 1.28.0 → 1.28.2
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/CHANGELOG.md +21 -0
- package/dist/index.js +6 -2
- package/dist/lib/loop-guard.d.ts +2 -0
- package/dist/lib/loop-guard.d.ts.map +1 -1
- package/dist/lib/runner.d.ts.map +1 -1
- package/package.json +1 -1
- package/templates/prompts/ORCHESTRATION.md +3 -0
- package/templates/prompts/peer-review.md +34 -11
- package/templates/scripts/run-with-loop-guard.js +46 -14
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,26 @@ All notable changes to `jonah-fleet` will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.28.2](https://github.com/Jonah-Projects/jonah-fleet/compare/v1.28.1...v1.28.2) (2026-09-24)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **guard:** exempt analytics-review from repetition and ping-pong loop circuit breakers ([#447](https://github.com/Jonah-Projects/jonah-fleet/issues/447)) ([#450](https://github.com/Jonah-Projects/jonah-fleet/issues/450)) ([839873c](https://github.com/Jonah-Projects/jonah-fleet/commit/839873c1c9e40b633a3e52a77aa74fc66374b8df))
|
|
14
|
+
|
|
15
|
+
## [Unreleased]
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **guard:** exempt `analytics-review` routine from repetition and ping-pong loop circuit breaker false-positives while preserving consecutive error protection ([#447](https://github.com/Jonah-Projects/jonah-fleet/issues/447))
|
|
20
|
+
|
|
21
|
+
## [1.28.1](https://github.com/Jonah-Projects/jonah-fleet/compare/v1.28.0...v1.28.1) (2026-09-24)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Bug Fixes
|
|
25
|
+
|
|
26
|
+
* **peer-review:** add In-Progress CI Protocol and Zero-Polling Guardrail ([#438](https://github.com/Jonah-Projects/jonah-fleet/issues/438)) ([78922eb](https://github.com/Jonah-Projects/jonah-fleet/commit/78922eb4efda5071d709e292e406d6896c7920e4))
|
|
27
|
+
|
|
8
28
|
## [1.28.0](https://github.com/Jonah-Projects/jonah-fleet/compare/v1.27.2...v1.28.0) (2026-09-24)
|
|
9
29
|
|
|
10
30
|
|
|
@@ -30,6 +50,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
30
50
|
### Bug Fixes
|
|
31
51
|
|
|
32
52
|
* **daemon:** classify draft PRs needing convergence as actionable instead of in-progress to prevent zero-token preflight bypass from stalling draft PR recovery
|
|
53
|
+
* **peer-review:** add In-Progress CI Protocol and Zero-Polling Guardrail to `peer-review.md` and `ORCHESTRATION.md` to prevent loop guard circuit breaker trips on running checks
|
|
33
54
|
|
|
34
55
|
## [1.27.1](https://github.com/Jonah-Projects/jonah-fleet/compare/v1.27.0...v1.27.1) (2026-09-23)
|
|
35
56
|
|
package/dist/index.js
CHANGED
|
@@ -3833,6 +3833,7 @@ function computeActionHash(toolName, args) {
|
|
|
3833
3833
|
return crypto.createHash("sha256").update(`${toolName}:${canonicalArgs}`).digest("hex");
|
|
3834
3834
|
}
|
|
3835
3835
|
var LoopGuard = class {
|
|
3836
|
+
routine;
|
|
3836
3837
|
repetitionThreshold;
|
|
3837
3838
|
pingPongThreshold;
|
|
3838
3839
|
consecutiveErrorThreshold;
|
|
@@ -3843,6 +3844,7 @@ var LoopGuard = class {
|
|
|
3843
3844
|
consecutiveErrorCount = 0;
|
|
3844
3845
|
trippedResult = null;
|
|
3845
3846
|
constructor(options = {}) {
|
|
3847
|
+
this.routine = options.routine;
|
|
3846
3848
|
this.repetitionThreshold = options.repetitionThreshold ?? 5;
|
|
3847
3849
|
this.pingPongThreshold = options.pingPongThreshold ?? 3;
|
|
3848
3850
|
this.consecutiveErrorThreshold = options.consecutiveErrorThreshold ?? 2;
|
|
@@ -3875,7 +3877,8 @@ var LoopGuard = class {
|
|
|
3875
3877
|
return this.trippedResult;
|
|
3876
3878
|
}
|
|
3877
3879
|
const isStatusPolling = toolName === "manage_task" && (args?.Action === "status" || args?.action === "status" || args?.Action === "list" || args?.action === "list") || toolName === "manage_subagents" && (args?.Action === "list" || args?.action === "list");
|
|
3878
|
-
const
|
|
3880
|
+
const isAnalyticsRoutine = this.routine === "analytics-review";
|
|
3881
|
+
const isExemptFromRepetition = isStatusPolling || isAnalyticsRoutine || toolName === "view_file" || toolName === "read_file" || toolName === "replace_file_content" || toolName === "write_to_file";
|
|
3879
3882
|
const hash = computeActionHash(toolName, args);
|
|
3880
3883
|
const record = {
|
|
3881
3884
|
toolName,
|
|
@@ -3929,7 +3932,7 @@ var LoopGuard = class {
|
|
|
3929
3932
|
const requiredPingPongLength = this.pingPongThreshold * 2;
|
|
3930
3933
|
if (this.history.length >= requiredPingPongLength) {
|
|
3931
3934
|
const pingPongSlice = this.history.slice(-requiredPingPongLength);
|
|
3932
|
-
const hasExemptPingPongAction = pingPongSlice.some(
|
|
3935
|
+
const hasExemptPingPongAction = isAnalyticsRoutine || pingPongSlice.some(
|
|
3933
3936
|
(item) => item.toolName === "manage_task" && (item.args?.Action === "status" || item.args?.action === "status" || item.args?.Action === "list" || item.args?.action === "list") || item.toolName === "manage_subagents" && (item.args?.Action === "list" || item.args?.action === "list") || item.toolName === "replace_file_content" || item.toolName === "write_to_file"
|
|
3934
3937
|
);
|
|
3935
3938
|
if (!hasExemptPingPongAction) {
|
|
@@ -4697,6 +4700,7 @@ Timeout: ${printTimeout}`,
|
|
|
4697
4700
|
let loopGuardTrip = null;
|
|
4698
4701
|
let activeChild = null;
|
|
4699
4702
|
const loopGuard = new LoopGuard({
|
|
4703
|
+
routine: options.routine,
|
|
4700
4704
|
repetitionThreshold: 5,
|
|
4701
4705
|
pingPongThreshold: 3,
|
|
4702
4706
|
consecutiveErrorThreshold: 2,
|
package/dist/lib/loop-guard.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export interface ActionRecord {
|
|
|
15
15
|
timestamp: number;
|
|
16
16
|
}
|
|
17
17
|
export interface LoopGuardOptions {
|
|
18
|
+
routine?: string;
|
|
18
19
|
repetitionThreshold?: number;
|
|
19
20
|
pingPongThreshold?: number;
|
|
20
21
|
consecutiveErrorThreshold?: number;
|
|
@@ -33,6 +34,7 @@ export declare function computeActionHash(toolName: string, args: any): string;
|
|
|
33
34
|
* Deterministic Loop Guard & Circuit Breaker monitoring tool calls and execution events.
|
|
34
35
|
*/
|
|
35
36
|
export declare class LoopGuard {
|
|
37
|
+
private routine?;
|
|
36
38
|
private repetitionThreshold;
|
|
37
39
|
private pingPongThreshold;
|
|
38
40
|
private consecutiveErrorThreshold;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loop-guard.d.ts","sourceRoot":"","sources":["../../src/lib/loop-guard.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,mBAAmB,GAAG,YAAY,GAAG,WAAW,GAAG,oBAAoB,CAAC;AAEpF,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,mBAAmB,CAAC;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,GAAG,CAAC;CACZ;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,GAAG,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,iB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B,eAAe,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAogBrG"}
|
package/package.json
CHANGED
|
@@ -292,6 +292,9 @@ In headless CLI environments (`agy -p` / GitHub Actions), agent sessions termina
|
|
|
292
292
|
1. **Zero-Yield Waiting Invariant**: Agents MUST NEVER call `schedule` or emit a terminal turn with plain text to "wait" for background commands, timers, or long-running checks. In headless mode, yielding the turn halts the process immediately with exit code 0 before reaching the Definition of Done.
|
|
293
293
|
2. **Active Task Supervision**: If a verification command (`npm test`, `npm run type-check`) is sent to the background by `run_command`, the agent must actively poll `manage_task(Action='status')` or inspect code while waiting within the continuous tool-calling loop.
|
|
294
294
|
3. **CI Trust Bar & Test Discipline**: Peer review routines should trust green passing remote CI checks (GitHub Actions or Vercel preview deployments) on the PR's head commit rather than initiating slow, background-prone full test runs. Run repository verification locally ONLY if CI status is unconfirmed, missing, or failing.
|
|
295
|
+
4. **In-Progress CI Protocol**: When remote CI checks (e.g. GitHub Actions, Vercel deployments) are actively running (`PENDING`, `IN_PROGRESS`, `QUEUED`) during peer review:
|
|
296
|
+
- If the PR has blocking review findings, bounce to draft immediately (`gh pr ready <N> --undo`) without waiting for CI.
|
|
297
|
+
- If the PR is clean, NEVER busy-poll `run_command: gh run view` or `gh pr checks` in a loop (which trips the loop guard circuit breaker after 5 calls). Instead, run local verification once synchronously (`WaitMsBeforeAsync: 10000`); if passing, post an approval note confirming code health and defer merging to the next sweep once CI concludes.
|
|
295
298
|
|
|
296
299
|
---
|
|
297
300
|
|
|
@@ -10,7 +10,7 @@ Routine objective, Definition of Done, constraints, instructions, and logging.
|
|
|
10
10
|
|
|
11
11
|
## Objective
|
|
12
12
|
|
|
13
|
-
Review a pull request (in Targeted mode for a specific `$PR_NUMBER`, or in Scan mode selecting the highest-priority open PR), evaluate code quality, security, and specification compliance via multi-angle subagent code reviews (`/code-review`), and take exactly one final action: squash-merge if clean,
|
|
13
|
+
Review a pull request (in Targeted mode for a specific `$PR_NUMBER`, or in Scan mode selecting the highest-priority open PR), evaluate code quality, security, and specification compliance via multi-angle subagent code reviews (`/code-review`), and take exactly one final action: squash-merge if clean, post findings and bounce the PR back to draft (`gh pr ready <N> --undo`) for in-session author fixes, or post an approval note and defer merge if clean while remote CI is in-progress.
|
|
14
14
|
|
|
15
15
|
## FIRST ACTION — determine the target PR before anything else
|
|
16
16
|
|
|
@@ -27,7 +27,7 @@ The run is SUCCESS only if ALL of these are true:
|
|
|
27
27
|
|
|
28
28
|
- [ ] Identified the target PR: if one was named in the invocation, reviewed exactly that PR; otherwise listed open PRs and selected one by priority
|
|
29
29
|
- [ ] Ran the code-review pass (`/code-review` and security pass), and posted findings as inline review comments
|
|
30
|
-
- [ ] Took exactly one final action: squash-merged (if PR is good, CI green and present; executed Autonomous Issue Synthesis if unlinked; closed tracking issue explicitly if referenced) OR posted findings and **converted the PR back to draft** (`gh pr ready <N> --undo`) for author/autowork in-session fixes OR, if round cap reached at round 5 with blocking findings, converted to draft and escalated to human via the 4-part escalation card with `needs-human`
|
|
30
|
+
- [ ] Took exactly one final action: squash-merged (if PR is good, CI green and present; executed Autonomous Issue Synthesis if unlinked; closed tracking issue explicitly if referenced) OR posted findings and **converted the PR back to draft** (`gh pr ready <N> --undo`) for author/autowork in-session fixes OR approved and deferred merge pending in-progress remote CI checks OR, if round cap reached at round 5 with blocking findings, converted to draft and escalated to human via the 4-part escalation card with `needs-human`
|
|
31
31
|
- [ ] If merging: captured deferred non-blocking findings per materiality bar (filed follow-up issues for material ones, batched or dropped immaterial ones)
|
|
32
32
|
- [ ] If in Scan mode and no eligible PRs exist, logged SUCCESS with "No PRs to review"
|
|
33
33
|
|
|
@@ -43,23 +43,29 @@ If any criterion cannot be met, stop immediately and log FAILURE with the reason
|
|
|
43
43
|
- **Session link footer**: sign every GitHub post with the unified Fleet footer and run badge: `[](${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID})\n\n_Generated by [Antigravity](${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID})_`.
|
|
44
44
|
- **Headless Execution & Asynchronous Non-Yielding Guardrail**: You are running in a headless autonomous CLI session. You MUST NEVER call `schedule` or yield the turn with plain text to "wait" for background tasks, timers, or long-running commands. In headless CLI mode, yielding the turn terminates the session immediately before reaching the Definition of Done. When invoking `run_command` for test runs or type checks, ALWAYS set `WaitMsBeforeAsync` high enough (up to the maximum `10000` ms) so fast checks finish synchronously. If a command or subagent moves to the background, keep your execution turn active by polling status (`manage_task(Action='status')` or `manage_subagents(Action='list')`); status polling with these tools is explicitly exempted from loop guard circuit breakers. DO NOT "busy-wait" by repeatedly reading unchanged files (`view_file`) or running redundant commands to pass time while waiting, as calling non-polling tools with identical arguments will trip the loop guard. NEVER call `schedule` or emit a terminal turn with plain text before taking the final action.
|
|
45
45
|
- **Verification Command & CI Discipline**: When remote CI checks (e.g. GitHub Actions, Vercel preview deployments) are already present and passed on the PR's head commit, treat CI as verified and green. Avoid executing slow, redundant local full test suites or full type-checks when CI is already green. Run local verification commands (`npm test`, `npm run type-check`) ONLY if CI is missing, unconfirmed, or failing.
|
|
46
|
+
- **In-Progress CI & Zero-Polling Guardrail**: When remote CI checks (e.g. GitHub Actions, Vercel deployments) on the PR's head commit are actively running (`PENDING`, `IN_PROGRESS`, `QUEUED`), NEVER busy-poll `run_command` in a tight loop (e.g. repeated `gh run view` or `gh pr checks`). Calling `run_command` 5 times with identical parameters within a sliding window of 20 trips the deterministic loop guard circuit breaker (`loop_circuit_breaker`). If the PR has blocking review findings, bounce to draft immediately without waiting for CI. If the PR is clean, run local verification once synchronously; if passing, post an approval comment and defer merging to the next sweep once CI concludes.
|
|
46
47
|
- **Autonomous Surfacing Cadence (No Permission Traps)**: Timeboxing is for surfacing progress, never for stopping. Checkpoints report status without halting execution. Never yield the turn or prompt rhetorical permission questions (e.g. "Shall I continue?", "Proceed to merge?"). Take authoritative final action autonomously.
|
|
47
48
|
- **Defect Taxonomy of Bogus Green Checks**: The most expensive errors in agentic engineering come from checks reporting success for work they did not do. Audit verification against the 6 defect shapes (Vacuous assertion, Silent no-match, Errored check, Wrong reference, Stale premise, Scope mismatch). Exit codes and concrete diffs are authoritative; agent summaries are merely intent.
|
|
48
49
|
- **Anti-Hallucination Disk Read-Back Verification**: Verify artifacts, generated configs, or outputs by reading values directly back out of the written artifact on disk, never from an in-memory variable, shell echo, or assumption.
|
|
49
50
|
- **Reader / Writer Separation**: Peer Review is strictly an evaluator and merge authority. Never write or commit code modifications to the PR branch directly; bounce to draft so the author or autowork session applies the fix in their warm context.
|
|
50
51
|
|
|
51
|
-
## Final action: merge
|
|
52
|
+
## Final action: merge, bounce to draft, or approve & defer merge
|
|
52
53
|
|
|
53
|
-
Every review ends in exactly one of
|
|
54
|
+
Every review ends in exactly one of three states:
|
|
54
55
|
|
|
55
56
|
- **Merge** — only if PR is good, CI is green and verified on the head commit. If the PR does not reference a tracked issue (`Closes #N`), execute Autonomous Issue Synthesis prior to merge.
|
|
56
57
|
- Sequence: (1) if unlinked, synthesize tracking issue (`gh issue create`) and link to PR (`gh pr edit`), (2) squash-merge (`gh pr merge <N> --squash --delete-branch`), (3) explicitly close tracking issue if referenced (`gh issue close <ISSUE_NUMBER>`), (4) submit held review comments, (5) file follow-up issues for deferred material findings.
|
|
57
58
|
- Immaterial findings (style/preference) default to dying in the review thread or getting batched.
|
|
58
59
|
- Mechanical doc fixes (missing changelog line, doc typo in diff) can be committed directly to `main` after squash-merge.
|
|
59
|
-
- **Bounce to draft** — if any **blocking** finding remains (correctness bug, security flaw, failing/
|
|
60
|
+
- **Bounce to draft** — if any **blocking** finding remains (correctness bug, security flaw, failing/broken CI, broken contract):
|
|
60
61
|
- Submit review as `COMMENT` (never `REQUEST_CHANGES` on same-account PRs).
|
|
61
62
|
- Convert PR back to draft: `gh pr ready <N> --undo`.
|
|
62
63
|
- Autowork in-session polling detects the bounce, applies fixes, and re-marks ready.
|
|
64
|
+
- **Approve & defer merge (in-progress CI)** — if code is clean and zero blocking findings exist, but remote CI checks are still actively running (`PENDING` / `IN_PROGRESS` / `QUEUED`):
|
|
65
|
+
- Run local verification commands once synchronously.
|
|
66
|
+
- Post approval comment confirming clean review pending CI completion.
|
|
67
|
+
- Do NOT convert to draft; leave PR ready for review.
|
|
68
|
+
- Defer squash-merge to the next scan cycle/daemon sweep once CI concludes.
|
|
63
69
|
|
|
64
70
|
## Negative examples (DO NOT do these)
|
|
65
71
|
|
|
@@ -67,12 +73,13 @@ Every review ends in exactly one of two states:
|
|
|
67
73
|
- Do not continue reviewing a PR after discovering it is already merged or closed.
|
|
68
74
|
- Do not review automated release PRs (`release-please--*` / `chore(main): release*`).
|
|
69
75
|
- Do not merge a PR with failing or absent CI checks.
|
|
70
|
-
- Do not leave a PR in limbo — always merge
|
|
76
|
+
- Do not leave a PR in limbo — always merge, convert back to draft, or approve and defer merge with an explicit comment.
|
|
71
77
|
- Do not attempt `REQUEST_CHANGES` or `APPROVE` on own PRs (GitHub rejects same-account review states). Always use `COMMENT` + draft toggle.
|
|
72
78
|
- On re-review, do not raise new findings in code that was unchanged since the prior review — only inspect the delta commits.
|
|
73
79
|
- Do not bounce a PR for non-blocking style/preference findings when all correctness checks pass.
|
|
74
80
|
- Do not bounce an external contributor PR purely for missing `Closes #N` when the PR description provides a clear specification.
|
|
75
81
|
- Do not call `schedule` or yield the turn with plain text while waiting for background verification tasks — stay in the tool loop until the final action is taken.
|
|
82
|
+
- Do not busy-poll `gh run view` or `gh pr checks` in a loop when remote CI is in progress—verify locally once and defer merge, or bounce to draft immediately if blocking findings exist.
|
|
76
83
|
- Do not rerun full local test suites when remote CI checks on the head commit are already green and passing.
|
|
77
84
|
- Do not write implementation code or modify the PR branch directly—bounce to draft with specific actionable findings instead.
|
|
78
85
|
- Do not accept checks or tests that pass vacantly or match zero items without positive controls.
|
|
@@ -96,6 +103,8 @@ Check if `$PR_NUMBER` is set:
|
|
|
96
103
|
3. Prioritize:
|
|
97
104
|
- **Category A (re-review)**: PRs with prior review comments where author has pushed new fix commits.
|
|
98
105
|
- **Category B (first review / unreviewed)**: Brand new PRs ready for review, or ready PRs whose previous review session failed or timed out.
|
|
106
|
+
- **Category C (ready to merge / CI-cleared)**: Ready PRs whose code review was completed/approved pending CI and whose CI checks have now completed and passed (`SUCCESS`). Prioritize these for immediate squash-merge.
|
|
107
|
+
4. **CI State Gating**: In Scan mode, check status (`gh pr checks <PR_NUMBER>`). Prioritize PRs whose CI runs are already completed (`SUCCESS` or `FAILURE`). If a candidate PR's CI is still actively `IN_PROGRESS` or `QUEUED`, deprioritize it behind PRs with completed checks so CI can conclude naturally without stalling the review queue.
|
|
99
108
|
|
|
100
109
|
### Step 3: Round tracking, Target Binding, Failure Ingestion & Starting Review marker
|
|
101
110
|
|
|
@@ -142,7 +151,7 @@ Check if `$PR_NUMBER` is set:
|
|
|
142
151
|
- **Question-First Validation**: Verify that any new custom analytics events answer a clear, decision-driving question per the 3-Tier Taxonomy in `AGENTS.md`. Flag vanity click-trackers on Tier 3 passive chrome/easter eggs as non-blocking cleanup (recommend removal).
|
|
143
152
|
- **Funnel Completeness**: For new Tier 1 user funnels or critical workflows, verify the telemetry contract: impression denominator (`_shown`), interaction (`_clicked`), and failure states (`_failed` with `reason`) are captured, and events are documented in the custom events catalog (`ARCHITECTURE.md` / `DATA_CONTEXT.md`). Flag missing denominators on core funnels as blocking.
|
|
144
153
|
5. If PR modifies rendered UI, verify screenshots or visual components if tooling/scripts are available.
|
|
145
|
-
6. Run repository verification commands (tests, type-check) ONLY if CI status is unconfirmed or failing. If remote CI (such as GitHub Actions or Vercel preview) is already green and passing on the head commit, treat CI as verified. If verification commands must be run locally, specify `WaitMsBeforeAsync: 10000` and NEVER call `schedule` or yield the turn with plain text while waiting for background tasks. If a command runs in the background, poll its completion with `manage_task(Action='status')` without busy-waiting on unchanged files.
|
|
154
|
+
6. Run repository verification commands (tests, type-check) ONLY if CI status is unconfirmed or failing. If remote CI (such as GitHub Actions or Vercel preview) is already green and passing on the head commit, treat CI as verified. If verification commands must be run locally, specify `WaitMsBeforeAsync: 10000` and NEVER call `schedule` or yield the turn with plain text while waiting for background tasks. If a command runs in the background, poll its completion with `manage_task(Action='status')` without busy-waiting on unchanged files. If remote CI is currently in-progress (`PENDING` / `IN_PROGRESS` / `QUEUED`), proceed through the remaining review passes first. If blocking findings exist, bounce to draft immediately without waiting for CI. NEVER busy-poll `gh run view` or `gh pr checks` repeatedly with `run_command`.
|
|
146
155
|
7. **Anti-Vacuity & Verifier Audit Pass (The 6 Bogus Green Shapes)**:
|
|
147
156
|
Actively interrogate new or modified tests and verification commands against the 6 bogus green defect classes:
|
|
148
157
|
- **Vacuous assertion**: Test passes whether or not the feature works (e.g. deleting the implementation under test leaves it green). Require a red-gate failure or mutation check.
|
|
@@ -189,7 +198,7 @@ If the PR is clean and approved for merge, but lacks a `Closes #N` tracking link
|
|
|
189
198
|
- *Option B*: [Pros / Cons]
|
|
190
199
|
- **Recommended Path**: [Agent recommendation]
|
|
191
200
|
```
|
|
192
|
-
- **If Clean (or only Non-blocking findings)**:
|
|
201
|
+
- **If Clean (or only Non-blocking findings) and CI is Green**:
|
|
193
202
|
- If the PR branch has minor mechanical merge conflicts against `origin/main` (e.g. adjacent `CHANGELOG.md` entries from concurrent merges) while code and tests are sound, resolve the conflict mechanically via `/resolving-merge-conflicts` before squash-merging rather than bouncing the PR back to draft.
|
|
194
203
|
- If PR lacks `Closes #N`, execute Autonomous Issue Synthesis (Step 5.5).
|
|
195
204
|
- Extract the tracking issue number `$ISSUE_NUMBER` from the PR description or title (e.g. `Closes #<N>`, `Fixes #<N>`, `Resolves #<N>`).
|
|
@@ -204,7 +213,21 @@ _Generated by [Antigravity](${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/ru
|
|
|
204
213
|
- In any review summary, decision comment, or escalation comment posted to the PR, include the run log reference if `$ROUTINE_ISSUE_NUMBER` is set (e.g. `- **Run Log**: [#$ROUTINE_ISSUE_NUMBER](${GITHUB_SERVER_URL:-https://github.com}/${GITHUB_REPOSITORY}/issues/${ROUTINE_ISSUE_NUMBER})`).
|
|
205
214
|
- File follow-up issues for material non-blocking findings.
|
|
206
215
|
- If mechanical doc fixes are needed, commit directly to `main`.
|
|
207
|
-
- **
|
|
216
|
+
- **If Clean (or only Non-blocking findings) but Remote CI is In-Progress**:
|
|
217
|
+
- If local verification (`npm test`, `npm run type-check`) passed cleanly and zero blocking findings exist, do NOT busy-poll `gh run view` or `gh pr checks` in a loop, and do NOT bounce the PR to draft (the code is sound).
|
|
218
|
+
- Post an approval note on the PR indicating code review passed and merge is pending CI completion:
|
|
219
|
+
```bash
|
|
220
|
+
gh pr comment <PR_NUMBER> --body "✅ Code review completed: clean (no blocking findings). Waiting for in-progress remote CI checks to conclude before merge.
|
|
221
|
+
|
|
222
|
+
[](${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID})
|
|
223
|
+
|
|
224
|
+
_Generated by [Antigravity](${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID})_"
|
|
225
|
+
```
|
|
226
|
+
- Submit held review comments (if any).
|
|
227
|
+
- Leave the PR open and ready for review (do NOT run `gh pr ready <N> --undo`).
|
|
228
|
+
- Emit Milestone 4 to `$ROUTINE_ISSUE_NUMBER` (if set) and record run details to `.jonah-fleet/run-report.md`.
|
|
229
|
+
- Log SUCCESS with "Review clean: awaiting completion of in-progress remote CI checks". The next daemon cycle or scan sweep will automatically detect the completed, passing CI checks and squash-merge the PR immediately.
|
|
230
|
+
- **Resolve Past Failed Review Runs**: After the terminal action (merge, bounce to draft, or CI-deferred approval) completes successfully, resolve and close any open past failed routine issues for `PR #<PR_NUMBER>`:
|
|
208
231
|
```bash
|
|
209
232
|
PAST_FAILURES=$(gh issue list --label routine-log --search "PR #<PR_NUMBER>" --state open --json number --jq '.[].number' || true)
|
|
210
233
|
for past_num in $PAST_FAILURES; do
|
|
@@ -222,7 +245,7 @@ _Generated by [Antigravity](${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/ru
|
|
|
222
245
|
After completing (SUCCESS or FAILURE), record run execution details to `.jonah-fleet/run-report.md`. Include:
|
|
223
246
|
|
|
224
247
|
- Prompt SHA
|
|
225
|
-
- Target PR number and decision (MERGE / BOUNCE / ESCALATE)
|
|
248
|
+
- Target PR number and decision (MERGE / BOUNCE / ESCALATE / DEFER_CI)
|
|
226
249
|
- Execution trace and findings summary
|
|
227
250
|
|
|
228
251
|
**Issue Logging Protocol**:
|
|
@@ -232,7 +255,7 @@ After completing (SUCCESS or FAILURE), record run execution details to `.jonah-f
|
|
|
232
255
|
- **Phase**: \`Phase 4 · Reconciliation\`
|
|
233
256
|
- **Status**: ✅ SUCCESS
|
|
234
257
|
- **Target / Context**: \`PR #<PR_NUMBER>\`
|
|
235
|
-
- **Key Decision / Finding**: Review completed with decision \`<MERGE | BOUNCE | ESCALATE>\`.
|
|
258
|
+
- **Key Decision / Finding**: Review completed with decision \`<MERGE | BOUNCE | ESCALATE | DEFER_CI>\`.
|
|
236
259
|
- **Next**: Routine finished; issue closed by harness" || true
|
|
237
260
|
```
|
|
238
261
|
- Follow the Routine Issue Logging & Telemetry Protocol in `ORCHESTRATION.md`. Never commit run logs to git branches.
|
|
@@ -40,6 +40,7 @@ export function computeActionHash(toolName, args) {
|
|
|
40
40
|
|
|
41
41
|
export class LoopGuard {
|
|
42
42
|
constructor(options = {}) {
|
|
43
|
+
this.routine = options.routine;
|
|
43
44
|
this.repetitionThreshold = options.repetitionThreshold ?? 5;
|
|
44
45
|
this.pingPongThreshold = options.pingPongThreshold ?? 3;
|
|
45
46
|
this.consecutiveErrorThreshold = options.consecutiveErrorThreshold ?? 2;
|
|
@@ -73,8 +74,11 @@ export class LoopGuard {
|
|
|
73
74
|
(args?.Action === 'list' ||
|
|
74
75
|
args?.action === 'list'));
|
|
75
76
|
|
|
77
|
+
const isAnalyticsRoutine = this.routine === 'analytics-review';
|
|
78
|
+
|
|
76
79
|
const isExemptFromRepetition =
|
|
77
80
|
isStatusPolling ||
|
|
81
|
+
isAnalyticsRoutine ||
|
|
78
82
|
toolName === 'view_file' ||
|
|
79
83
|
toolName === 'read_file' ||
|
|
80
84
|
toolName === 'replace_file_content' ||
|
|
@@ -143,19 +147,21 @@ export class LoopGuard {
|
|
|
143
147
|
const requiredPingPongLength = this.pingPongThreshold * 2;
|
|
144
148
|
if (this.history.length >= requiredPingPongLength) {
|
|
145
149
|
const pingPongSlice = this.history.slice(-requiredPingPongLength);
|
|
146
|
-
const hasExemptPingPongAction =
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
item.args?.Action === '
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
150
|
+
const hasExemptPingPongAction =
|
|
151
|
+
isAnalyticsRoutine ||
|
|
152
|
+
pingPongSlice.some(
|
|
153
|
+
(item) =>
|
|
154
|
+
(item.toolName === 'manage_task' &&
|
|
155
|
+
(item.args?.Action === 'status' ||
|
|
156
|
+
item.args?.action === 'status' ||
|
|
157
|
+
item.args?.Action === 'list' ||
|
|
158
|
+
item.args?.action === 'list')) ||
|
|
159
|
+
(item.toolName === 'manage_subagents' &&
|
|
160
|
+
(item.args?.Action === 'list' ||
|
|
161
|
+
item.args?.action === 'list')) ||
|
|
162
|
+
item.toolName === 'replace_file_content' ||
|
|
163
|
+
item.toolName === 'write_to_file'
|
|
164
|
+
);
|
|
159
165
|
|
|
160
166
|
if (!hasExemptPingPongAction) {
|
|
161
167
|
const hashA = pingPongSlice[0].hash;
|
|
@@ -335,7 +341,32 @@ async function main() {
|
|
|
335
341
|
const commandArgs = rawArgs[0] === 'agy' ? rawArgs.slice(1) : rawArgs;
|
|
336
342
|
|
|
337
343
|
// Detect routine name from environment or prompt
|
|
338
|
-
|
|
344
|
+
let routine = process.env.ROUTINE;
|
|
345
|
+
if (!routine) {
|
|
346
|
+
for (let i = 0; i < commandArgs.length; i++) {
|
|
347
|
+
if (commandArgs[i] === '-p' || commandArgs[i] === '--prompt') {
|
|
348
|
+
const promptText = commandArgs[i + 1] || '';
|
|
349
|
+
if (/analytics[-_ ]review/i.test(promptText)) {
|
|
350
|
+
routine = 'analytics-review';
|
|
351
|
+
} else if (/peer[-_ ]review/i.test(promptText)) {
|
|
352
|
+
routine = 'peer-review';
|
|
353
|
+
} else if (/design[-_ ]review/i.test(promptText)) {
|
|
354
|
+
routine = 'design-review';
|
|
355
|
+
} else if (/issues[-_ ]housekeeping/i.test(promptText)) {
|
|
356
|
+
routine = 'issues-housekeeping';
|
|
357
|
+
} else if (/dependency[-_ ]update/i.test(promptText)) {
|
|
358
|
+
routine = 'dependency-update-security-check';
|
|
359
|
+
} else if (/product[-_ ]planning/i.test(promptText)) {
|
|
360
|
+
routine = 'product-planning';
|
|
361
|
+
} else if (/optimizer/i.test(promptText)) {
|
|
362
|
+
routine = 'optimizer';
|
|
363
|
+
}
|
|
364
|
+
break;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
routine = routine || 'autowork';
|
|
369
|
+
|
|
339
370
|
const routineIssueNumber = process.env.ROUTINE_ISSUE_NUMBER;
|
|
340
371
|
const cwd = process.cwd();
|
|
341
372
|
|
|
@@ -367,6 +398,7 @@ async function main() {
|
|
|
367
398
|
let tripped = null;
|
|
368
399
|
|
|
369
400
|
const guard = new LoopGuard({
|
|
401
|
+
routine,
|
|
370
402
|
repetitionThreshold: 5,
|
|
371
403
|
pingPongThreshold: 3,
|
|
372
404
|
consecutiveErrorThreshold: 2,
|