jonah-fleet 1.21.0 → 1.23.0

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 CHANGED
@@ -5,6 +5,20 @@ 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.23.0](https://github.com/juliendurandeu/jonah-fleet/compare/v1.22.0...v1.23.0) (2026-09-20)
9
+
10
+
11
+ ### Features
12
+
13
+ * **guard:** exempt manage_subagents list polling and prevent busy-waiting on unchanged files ([#319](https://github.com/juliendurandeu/jonah-fleet/issues/319)) ([7a7168f](https://github.com/juliendurandeu/jonah-fleet/commit/7a7168f51c670e62efb15c210def8ca8df282161))
14
+
15
+ ## [1.22.0](https://github.com/juliendurandeu/jonah-fleet/compare/v1.21.0...v1.22.0) (2026-09-20)
16
+
17
+
18
+ ### Features
19
+
20
+ * **orchestration:** adopt Chief of Staff verification and Red Gate discipline ([#308](https://github.com/juliendurandeu/jonah-fleet/issues/308)) ([7e669de](https://github.com/juliendurandeu/jonah-fleet/commit/7e669de7e56a0fbe0feb0f694b2d29439416b421))
21
+
8
22
  ## [1.21.0](https://github.com/juliendurandeu/jonah-fleet/compare/v1.20.0...v1.21.0) (2026-09-20)
9
23
 
10
24
 
@@ -16,9 +30,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
16
30
 
17
31
  ### Features
18
32
 
19
- * **guard:** exempt `manage_task` status and list polling from action repetition and ping-pong circuit breaker trips in `run-with-loop-guard.js`.
20
- * **housekeeping:** close `status:failure` routine log issues immediately (0-hour delay) if target is already closed or merged, and lower untargeted runner crash threshold to 12 hours.
21
- * **autowork:** update Step 9 idle sweep to close resolved-target failures immediately and untargeted crashes after 12 hours.
33
+ * **guard:** exempt `manage_subagents` list polling from action repetition and ping-pong circuit breaker trips in loop guard and runner scripts.
34
+ * **orchestration:** clarify background task wait guidance in prompts and runner guardrails to prohibit busy-waiting on unchanged files (`view_file`) during headless execution.
22
35
 
23
36
  ## [1.20.0](https://github.com/juliendurandeu/jonah-fleet/compare/v1.19.0...v1.20.0) (2026-09-20)
24
37
 
package/dist/index.js CHANGED
@@ -3585,7 +3585,7 @@ var LoopGuard = class {
3585
3585
  if (this.trippedResult) {
3586
3586
  return this.trippedResult;
3587
3587
  }
3588
- const isStatusPolling = toolName === "manage_task" && (args?.Action === "status" || args?.action === "status" || args?.Action === "list" || args?.action === "list");
3588
+ 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");
3589
3589
  const hash = computeActionHash(toolName, args);
3590
3590
  const record = {
3591
3591
  toolName,
@@ -3638,7 +3638,7 @@ var LoopGuard = class {
3638
3638
  if (this.history.length >= requiredPingPongLength) {
3639
3639
  const pingPongSlice = this.history.slice(-requiredPingPongLength);
3640
3640
  const hasStatusPolling = pingPongSlice.some(
3641
- (item) => item.toolName === "manage_task" && (item.args?.Action === "status" || item.args?.action === "status" || item.args?.Action === "list" || item.args?.action === "list")
3641
+ (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")
3642
3642
  );
3643
3643
  if (!hasStatusPolling) {
3644
3644
  const hashA = pingPongSlice[0].hash;
@@ -3865,7 +3865,7 @@ function buildRoutinePrompt(targetDir, routine, options = {}) {
3865
3865
  const promptFile = `.github/prompts/${routine}.md`;
3866
3866
  const repoContext = `Working repository is located at ${targetDir}. All git, gh, and workspace commands must execute strictly within this repository.`;
3867
3867
  const logPrompt = options.routineIssueNumber ? ` Tracking run log issue: #${options.routineIssueNumber}.` : "";
3868
- const headlessGuardrail = ` Execution Guardrail: You are executing in a headless autonomous session. You MUST NEVER call schedule or yield your turn with plain text to wait on background tasks or verification checks. If a verification command (tests, type-check, lint) runs in the background, actively inspect its completion with manage_task or execute commands with sufficient WaitMsBeforeAsync. Never stop calling tools or yield your turn until the routine's terminal Definition of Done is fully reached.`;
3868
+ const headlessGuardrail = ` Execution Guardrail: You are executing in a headless autonomous session. You MUST NEVER call schedule or yield your turn with plain text to wait on background tasks or verification checks. If a verification command (tests, type-check, lint) runs in the background, inspect its completion with manage_task(Action='status') or manage_subagents(Action='list') (status polling with these tools is explicitly exempted from loop guard circuit breakers), or execute commands with sufficient WaitMsBeforeAsync (up to 10000 ms). DO NOT busy-wait by repeatedly calling read tools (such as view_file) on unchanged files to pass time while waiting, as calling non-polling tools with identical parameters will trip the loop circuit breaker. Never stop calling tools or yield your turn until the routine's terminal Definition of Done is fully reached.`;
3869
3869
  if (routine === "autowork") {
3870
3870
  if (options.issue) {
3871
3871
  return `You are the Autowork routine for this repository. ${repoContext} Read and follow the instructions in ${promptFile} exactly. ${skillsPrompt}Your target is issue #${options.issue}. You are in Targeted mode: work issue #${options.issue} directly, ahead of Phase 1 convergence and priority scan.${logPrompt}${headlessGuardrail}`;
@@ -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;CACf;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,E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S,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,2BAA2B,GAAG,MAAM,CAqBvF;AAED,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,aAAa,CAAC;CACrB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,sBAAsB,GAAG,MAAM,CA0B7E"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jonah-fleet",
3
- "version": "1.21.0",
3
+ "version": "1.23.0",
4
4
  "description": "Standalone autonomous agent fleet with Symphony orchestration, claim protocols, and continuous improvement loops",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -40,6 +40,11 @@ tests/ # Test suites
40
40
  - **Separation of Concerns**: Keep business logic pure and isolated from UI rendering and framework adapters.
41
41
  - **Error Handling**: Validate inputs at server and module boundaries. Return explicit structured errors.
42
42
  - **Testing Philosophy**: Write regression unit tests for every bug fix and integration tests for key workflows.
43
+ - **The Red Gate Invariant**: Always execute a failing test or verifier before modifying code. If the check passes before changes, diagnose immediately whether the issue is already resolved or the test is a vacuous assertion.
44
+ - **Defect Taxonomy of Bogus Green Checks**: Interrogate verification against the 6 defect shapes (Vacuous assertion, Silent no-match, Errored check, Wrong reference, Stale premise, Scope mismatch). Always prove a positive before believing a negative.
45
+ - **Anti-Hallucination Disk Read-Back**: Verify generated code, configs, and artifacts by reading values directly back from the file on disk, never from in-memory variables or shell command echoes.
46
+ - **Precision Git Scoping**: Never run bare `git commit` or blind `git add .` in multi-agent environments. Scope commits explicitly (`git commit -m "..." -- <paths>`).
47
+ - **Autonomous Surfacing Cadence**: Timeboxing is for surfacing progress, never for stopping. Checkpoints report status without halting execution. Never yield the turn or ask rhetorical permission questions ("Shall I continue?").
43
48
 
44
49
  ## Requirements Discovery & Inquisitive Stance
45
50
 
@@ -321,6 +321,48 @@ How autonomous routines escalate decisions, ambiguities, and blockers to human m
321
321
 
322
322
  ---
323
323
 
324
+ ## The Red Gate Protocol & Verification Discipline
325
+
326
+ How agent routines ensure that tests, benchmarks, and verification commands are authoritative rather than vacuous:
327
+
328
+ 1. **The Red Gate (Pre-Implementation Failure Proof)**:
329
+ - Before writing any production code, the agent MUST formulate a reproduction test or verifier and execute it.
330
+ - **The check MUST fail** (red). If the check passes before any source code is changed, the subsequent work proves nothing.
331
+ - **Already Green Check**: If the check passes before changes, stop and evaluate:
332
+ - *Already Resolved*: If the requested behavior is already present in `origin/main`, close the issue as resolved, release the claim, and proceed to the next candidate. This single command check saves hours of redundant implementation.
333
+ - *Vacuous Assertion*: If the feature is missing but the test is green, the test is vacuous. Refactor the test until it reliably fails against the baseline before modifying code.
334
+ 2. **Defect Taxonomy of Bogus Green Checks**:
335
+ The most expensive errors in agentic engineering come from checks that report success for work they did not do. Verifiers and peer reviewers must audit for the 6 bogus green defect classes:
336
+ - **Vacuous assertion**: A test that passes whether or not the feature works (deleting the implementation under test leaves it green).
337
+ - **Silent no-match**: A grep, regex, linter, or predicate that matches nothing; zero matches falsely reads as "clean".
338
+ - **Errored check**: A command that failed to run or crashed (e.g. exit code 127 or syntax error), but the error was swallowed, reading absence as success. Exit codes are authoritative; agent summaries are intent.
339
+ - **Wrong reference**: A filter or diff baseline keyed on the wrong commit or tag (e.g. `HEAD~1` instead of `origin/main`), letting regressions slip through.
340
+ - **Stale premise**: An assertion whose expected value was copied directly off existing broken code, cementing the bug it was meant to catch.
341
+ - **Scope mismatch**: A green check executed only over a narrow subset presented as the whole (missing denominator).
342
+ 3. **Prove a Positive Before Believing a Negative**:
343
+ Before accepting an assertion that a defect or pattern is absent, verify that the check or tool flags a known-bad positive control. A tool that reports "clean" and a tool that is broken produce identical zero output.
344
+ 4. **Anti-Hallucination Disk Read-Back Verification**:
345
+ Always verify generated files, configs, and artifacts by reading values directly back from the written artifact on disk (`cat`, `jq`, file assertions), never from an in-memory variable, shell echo, or assumption.
346
+
347
+ ---
348
+
349
+ ## Durable Channels Beat Ephemeral Ones
350
+
351
+ How autonomous agents manage state, handoffs, and communication across sessions:
352
+
353
+ 1. **Messages are Nudges, Files are Contracts**: Direct messaging between agents or subagents is useful for lightweight coordination, but can be dropped, delayed, or compacted. Anything that must survive and govern execution belongs in a durable channel:
354
+ - **Committed Policy**: Coding standards, conventions, and invariants belong in committed files (`AGENTS.md`, `.github/prompts/`).
355
+ - **Work Contracts**: Task descriptions, acceptance criteria, and status belong on the board (GitHub Issues, PR descriptions, or committed markdown briefs like `docs/briefs/`).
356
+ - **Pointer-Based Dispatch**: Pass links or file paths (`Context: <url>` or `Read docs/briefs/task.md`) in subagent launch prompts rather than pasting massive volatile blobs of text into prompts.
357
+ 2. **Policy vs. Ephemeral Separation**:
358
+ Keep long-lived policy (rules that govern every cycle) strictly separate from ephemeral session scratch. Never mix temporary task artifacts into long-lived documentation.
359
+ 3. **Autonomous Surfacing Cadence (No Permission Traps)**:
360
+ Timeboxing in autonomous runs is for surfacing progress, never for stopping. Checkpoints report status without halting execution. Autonomous agents MUST NEVER yield turns or ask rhetorical permission questions (e.g. "Shall I continue?", "Proceed to merge?").
361
+ 4. **Precision Git Scoping in Multi-Agent Environments**:
362
+ In environments where multiple agents, subagents, or local background commands operate, never execute bare `git commit` or blind `git add .`. Always scope commits explicitly with `git commit -m "..." -- <paths>` or verify `git status --porcelain` to avoid sweeping in uncommitted scratch files or parallel agent artifacts.
363
+
364
+ ---
365
+
324
366
  ## 3-Tier Prompt Prefix Caching Architecture
325
367
 
326
368
  How Jonah Fleet partitions prompt structures into Static $\rightarrow$ Semi-Stable $\rightarrow$ Dynamic tiers inspired by Orbital v0.4.2's prefix-caching architecture to achieve $>90\%$ cache hit rates on modern LLMs (Gemini, Anthropic, OpenAI), drastically reducing invocation latency and safeguarding the 70% weekly token budget ceiling:
@@ -49,12 +49,19 @@ If any criterion cannot be met, stop immediately and log FAILURE with the reason
49
49
  - **No speculative work**: only take actions directly required by the Definition of Done. Do not refactor adjacent code, open bonus issues, or add improvements not requested.
50
50
  - **Language Requirement**: All GitHub issue titles, descriptions, task checklists, and comments MUST be written in **English**.
51
51
  - **Session link footer**: sign every GitHub post with the Antigravity run footer (`_Generated by [Antigravity](${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID})_`).
52
+ - **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 ask rhetorical permission questions (e.g. "Shall I continue?"). Proceed autonomously.
53
+ - **Defect Taxonomy of Bogus Green Checks**: The most expensive errors in agentic engineering come from checks reporting success for work they did not do. Interrogate verification against the 6 defect classes (Vacuous assertion, Silent no-match, Errored check, Wrong reference, Stale premise, Scope mismatch). Exit codes decide, summaries are intent.
54
+ - **Anti-Hallucination Disk Read-Back Verification**: Always verify generated code, configs, and artifacts by reading values directly back from the written artifact on disk, never from in-memory variables or shell echoes.
55
+ - **Precision Git Scoping**: Never execute bare `git commit` or blind `git add .`. Scope commits explicitly with `git commit -m "..." -- <paths>` or verify `git status --porcelain` to avoid sweeping in uncommitted scratch files or parallel agent artifacts.
52
56
 
53
57
  ## Negative examples (DO NOT do these)
54
58
 
55
59
  - {Example of a wasteful pattern, e.g. "Do not re-read files you already read in this run"}
56
60
  - {Example of scope creep, e.g. "Do not fix lint warnings unrelated to the task"}
57
61
  - {Example of token burn, e.g. "Do not retry a failing API call more than twice"}
62
+ - Do not pause or prompt rhetorical questions ("Shall I proceed?", "Do you want me to continue?")—execute the steps autonomously.
63
+ - Do not use bare `git commit` or blind `git add .` without scoping specific paths (`git commit -m "..." -- <paths>`).
64
+ - Do not verify generated files by checking in-memory strings; read values back out of the file on disk.
58
65
 
59
66
  ## Instructions
60
67
 
@@ -37,7 +37,11 @@ If any criterion cannot be met, stop immediately and log FAILURE with the reason
37
37
  - **Single-flight per issue & PR**: multiple autowork runs can execute concurrently. Both issues and pull requests are shared resources — never begin implementing an issue without first claiming it (see Claim protocol in Phase 2), and never begin addressing findings on an open PR without first claiming it (see PR Claim protocol in Phase 1).
38
38
  - **Language Requirement**: All GitHub issue titles, descriptions, task checklists, and comments MUST be written in **English**.
39
39
  - **Session link footer**: sign every GitHub post (issue comments, PR comments, PR descriptions) with the Antigravity run footer (`_Generated by [Antigravity](${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID})_`). Inline review-thread line comments are exempt.
40
- - **Headless Execution & Asynchronous Non-Yielding Guardrail**: You are running in a headless autonomous session. You MUST NEVER call `schedule` or yield the turn with plain text while waiting for background tasks or verification checks. If a verification command runs in the background, actively inspect its completion with `manage_task` or run with sufficient `WaitMsBeforeAsync` (up to `10000` ms). Never stop calling tools or yield your turn until the routine's terminal Definition of Done is fully reached.
40
+ - **Headless Execution & Asynchronous Non-Yielding Guardrail**: You are running in a headless autonomous session. You MUST NEVER call `schedule` or yield the turn with plain text while waiting for background tasks or verification checks. When running verification commands (`run_command`), specify `WaitMsBeforeAsync: 10000` so fast checks complete synchronously. If a verification command or subagent runs in the background, actively inspect its completion with `manage_task(Action='status')` or `manage_subagents(Action='list')` (both status polling tools are explicitly exempted from loop guards). DO NOT "busy-wait" by repeatedly calling read tools (such as `view_file`) on unchanged files while waiting for tasks, as calling non-polling tools with identical arguments trips the loop circuit breaker. Never stop calling tools or yield your turn until the routine's terminal Definition of Done is fully reached.
41
+ - **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 ask rhetorical permission questions (e.g. "Shall I continue?", "Proceed with implementation?"). Proceed with the next step autonomously.
42
+ - **Defect Taxonomy of Bogus Green Checks & Red Gate Verification**: Always establish a failing reproduction check or verifier before modifying code (the Red Gate). Interrogate checks against the 6 bogus green defect classes (Vacuous assertion, Silent no-match, Errored check, Wrong reference, Stale premise, Scope mismatch). Exit codes decide; summaries are intent.
43
+ - **Anti-Hallucination Disk Read-Back Verification**: Always verify generated code, configs, and artifacts by reading values directly back out of the written artifact on disk, never from in-memory variables or shell command echoes.
44
+ - **Precision Git Scoping**: Never execute bare `git commit` or blind `git add .` without scoping. Always commit designated paths explicitly (`git commit -m "..." -- <paths>`) or verify `git status --porcelain` to avoid sweeping in uncommitted scratch artifacts or concurrent session files.
41
45
 
42
46
  ## Negative examples (DO NOT do these)
43
47
 
@@ -55,6 +59,10 @@ If any criterion cannot be met, stop immediately and log FAILURE with the reason
55
59
  - Do not fall into the **Telemetry Rabbit Hole**: do not spend cycles instrumenting elaborate fallback telemetry or defensive error handling for features that suffer from lack of user intent rather than software bugs.
56
60
  - Do not guess or invent arbitrary specifications for ambiguous issues — post the 4-part escalation card ('Why I believe this'), label `needs-info`, and release the claim instead of blindly writing code.
57
61
  - Do not call `schedule` or yield the turn with plain text while waiting for background verification tasks — stay in the tool loop until the Definition of Done is met.
62
+ - Do not write implementation code before proving that the reproduction test or verifier fails (the Red Gate).
63
+ - Do not pause or prompt rhetorical questions ("Shall I continue?", "Should I start implementing?")—proceed autonomously.
64
+ - Do not use bare `git commit` or blind `git add .` without scoping specific paths (`git commit -m "..." -- <paths>`).
65
+ - Do not verify generated files by checking in-memory strings or shell variables; read values back out of the file on disk.
58
66
 
59
67
  ## Instructions
60
68
 
@@ -206,6 +214,11 @@ _Generated by [Antigravity](${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/ru
206
214
  - If bug: use `/diagnosing-bugs` to establish reproduction test before fixing.
207
215
  - If large/complex: use `/domain-modeling` and `/codebase-design`.
208
216
  - **Pre-Flight Memory Scan**: If `LESSONS.md` exists, grep matching subsystem tags (`grep -E "^### \[(subsystem)\]" LESSONS.md -A 4`) to incorporate known landmines into implementation plans before writing code.
217
+ - **The Red Gate Protocol (Pre-Implementation Verifier Check)**: Before writing ANY production implementation code, define the verifier or write a reproduction test, and execute it:
218
+ - **The check MUST fail** (red). If the verifier passes before you touch production code, the subsequent work proves nothing.
219
+ - **Already Green Check**: If the verifier passes *before* code changes, stop immediately and evaluate:
220
+ 1. *Already Resolved*: If the requested behavior or fix is already present in `origin/main` (e.g. shipped under another card or refactor), verify thoroughly, close the issue immediately (`gh issue close <ISSUE_NUMBER> --comment "Closed: verified already resolved on main."`), release the claim, and proceed to the next candidate. Running the Red Gate first catches stale work in seconds and saves hours of redundant coding.
221
+ 2. *Vacuous Assertion (Bogus Green)*: If the feature is missing but the test passes, the test is vacuous (silent no-match, erring swallowed command, or trivial assertion). Refactor the test until it reliably fails against the baseline before implementing.
209
222
  - **Ambiguity & Missing Acceptance Criteria Gate**: Challenge underspecified or incomplete requests before writing any code. If the issue lacks observable acceptance criteria, relies on unverified assumptions, or leaves critical technical/UX decisions ambiguous:
210
223
  - Do NOT guess or invent arbitrary requirements to force completion.
211
224
  - Post the mandatory 4-part escalation card on the issue:
@@ -242,9 +255,11 @@ _Generated by [Antigravity](${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/ru
242
255
  ```
243
256
  13. **Implementation & PR creation:**
244
257
  - Branch from freshly fetched `origin/main` with descriptive name (e.g. `feat/...` or `fix/...`).
245
- - Drive implementation via `/tdd` (red-green-refactor).
258
+ - Drive implementation via `/tdd` (red-green-refactor): execute the Red Gate test first, write minimal code to pass, and refactor cleanly.
259
+ - **Precision Git Scoping**: Never use bare `git commit` or `git add .` blindly. Stage and commit only designated paths explicitly: `git commit -m "<type>(<scope>): <subject>" -- <paths>`, or verify `git status --porcelain` before committing to avoid sweeping in scratch files or parallel artifacts.
246
260
  - **Diagnostic Reflex**: On unexpected test/build failure during TDD, grep symptom text in `LESSONS.md` before making speculative code edits.
247
261
  - Run repository tests and verification.
262
+ - **Disk Read-Back Verification**: Verify written configs, schemas, and generated files by reading values directly back from disk files (`cat`, `jq`, test assertions), never from shell variables or memory.
248
263
  - **Pre-PR Lessons Capture Gate**: If solving the issue required overcoming a non-obvious quirk not caught by tests/linters, append a 3-line structured entry on the active PR branch adhering to the 25-entry hard cap. Never write to `LESSONS.md` directly on `main`.
249
264
  - **Milestone 2 (Verification & Tests)**: Once implementation passes tests and type checks, emit milestone card if `$ROUTINE_ISSUE_NUMBER` is set:
250
265
  ```bash
@@ -41,8 +41,12 @@ If any criterion cannot be met, stop immediately and log FAILURE with the reason
41
41
  - **No speculative work**: review only the diff in the PR.
42
42
  - **Language Requirement**: All GitHub comments, review notes, and follow-up issues MUST be written in **English**.
43
43
  - **Session link footer**: sign every GitHub post with the Antigravity run footer (`_Generated by [Antigravity](${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID})_`).
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) or if a command moves to the background, keep your execution turn active by checking task status (`manage_task(Action='status')`) or inspecting files; NEVER call `schedule` or emit a terminal turn with plain text before taking the final action.
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
+ - **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
+ - **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
+ - **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
+ - **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.
46
50
 
47
51
  ## Final action: merge or bounce to draft
48
52
 
@@ -70,6 +74,9 @@ Every review ends in exactly one of two states:
70
74
  - Do not bounce an external contributor PR purely for missing `Closes #N` when the PR description provides a clear specification.
71
75
  - 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.
72
76
  - Do not rerun full local test suites when remote CI checks on the head commit are already green and passing.
77
+ - Do not write implementation code or modify the PR branch directly—bounce to draft with specific actionable findings instead.
78
+ - Do not accept checks or tests that pass vacantly or match zero items without positive controls.
79
+ - Do not pause or prompt rhetorical questions ("Shall I proceed?", "Do you want me to merge?")—execute the final action autonomously.
73
80
 
74
81
  ## Instructions
75
82
 
@@ -135,7 +142,17 @@ Check if `$PR_NUMBER` is set:
135
142
  - **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).
136
143
  - **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.
137
144
  5. If PR modifies rendered UI, verify screenshots or visual components if tooling/scripts are available.
138
- 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.
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.
146
+ 7. **Anti-Vacuity & Verifier Audit Pass (The 6 Bogus Green Shapes)**:
147
+ Actively interrogate new or modified tests and verification commands against the 6 bogus green defect classes:
148
+ - **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.
149
+ - **Silent no-match**: A grep, regex, linter, or predicate that matches nothing; 0 matches falsely reads as "clean / no errors".
150
+ - **Errored check**: A command that failed to run or crashed (e.g. exit code 127 or syntax error), but the failure was swallowed, reading absence as success. Exit codes decide; summaries are merely intent.
151
+ - **Wrong reference**: A filter or diff baseline keyed on the wrong commit, tag, or branch (e.g. `HEAD~1` instead of `origin/main`), letting intervening regressions slip through.
152
+ - **Stale premise**: An assertion whose expected value was copied directly off existing broken code, cementing the bug it was meant to catch.
153
+ - **Scope mismatch**: A green check executed only over a narrow subset presented as the whole (missing denominator).
154
+ - **Prove a positive before believing a negative**: Before accepting an assertion that a defect or pattern is absent, verify that the check flags a known-bad positive control.
155
+ - **Disk Read-Back Verification**: Verify written configs, schemas, and generated artifacts by reading values directly back from the file on disk, not from shell variables or memory.
139
156
 
140
157
  ### Step 5: Classify Findings & Make Decision
141
158
 
@@ -253,4 +270,3 @@ The dynamic execution context for this specific review run is injected strictly
253
270
  - **Runtime Metadata**: `$ROUTINE_ISSUE_NUMBER`, `$GITHUB_RUN_ID`, runner timestamp, and trigger event.
254
271
  - **Pull Request Payload**: Head commit SHA, base branch diff, status check rollup (CI status), and unaddressed comments.
255
272
  - **Prefix Caching Invariant**: Harnesses and runners MUST NEVER interpolate dynamic timestamps, run IDs, or target identifiers into Tier 1 or Tier 2 prefix blocks.
256
-
@@ -64,11 +64,14 @@ export class LoopGuard {
64
64
  if (this.trippedResult) return this.trippedResult;
65
65
 
66
66
  const isStatusPolling =
67
- toolName === 'manage_task' &&
68
- (args?.Action === 'status' ||
69
- args?.action === 'status' ||
70
- args?.Action === 'list' ||
71
- args?.action === 'list');
67
+ (toolName === 'manage_task' &&
68
+ (args?.Action === 'status' ||
69
+ args?.action === 'status' ||
70
+ args?.Action === 'list' ||
71
+ args?.action === 'list')) ||
72
+ (toolName === 'manage_subagents' &&
73
+ (args?.Action === 'list' ||
74
+ args?.action === 'list'));
72
75
 
73
76
  const hash = computeActionHash(toolName, args);
74
77
  const record = {
@@ -133,11 +136,14 @@ export class LoopGuard {
133
136
  const pingPongSlice = this.history.slice(-requiredPingPongLength);
134
137
  const hasStatusPolling = pingPongSlice.some(
135
138
  (item) =>
136
- item.toolName === 'manage_task' &&
137
- (item.args?.Action === 'status' ||
138
- item.args?.action === 'status' ||
139
- item.args?.Action === 'list' ||
140
- item.args?.action === 'list')
139
+ (item.toolName === 'manage_task' &&
140
+ (item.args?.Action === 'status' ||
141
+ item.args?.action === 'status' ||
142
+ item.args?.Action === 'list' ||
143
+ item.args?.action === 'list')) ||
144
+ (item.toolName === 'manage_subagents' &&
145
+ (item.args?.Action === 'list' ||
146
+ item.args?.action === 'list'))
141
147
  );
142
148
 
143
149
  if (!hasStatusPolling) {
@@ -67,7 +67,7 @@ Each smell reads *what it is* → *how to fix*; match it against the diff:
67
67
 
68
68
  - The diff command and commit list.
69
69
  - The path or fetched contents of the spec.
70
- - The brief: "Report: (a) requirements the spec asked for that are missing or partial; (b) behaviour in the diff that wasn't asked for (scope creep); (c) requirements that look implemented but where the implementation looks wrong. Quote the spec line for each finding. Under 400 words."
70
+ - The brief: "Report: (a) requirements the spec asked for that are missing or partial; (b) behaviour in the diff that wasn't asked for (scope creep); (c) requirements that look implemented but where the implementation looks wrong. Quote the spec line for each finding. (d) Anti-Vacuity / Bogus Green Check audit: evaluate any new or modified tests against the 6 defect shapes (Vacuous assertion, Silent no-match, Errored check, Wrong reference, Stale premise, Scope mismatch). Verify that tests would actually fail if the implementation were removed, and that checks asserting absence prove a positive control first. Under 400 words."
71
71
 
72
72
  If the spec is missing, skip the Spec sub-agent and note this in the final report.
73
73
 
@@ -28,11 +28,14 @@ When the shape of that interface is itself in question (how deep the module is,
28
28
  ## Anti-patterns
29
29
 
30
30
  - **Implementation-coupled**: mocks internal collaborators, tests private methods, or verifies through a side channel (querying the database instead of using the interface). The tell: the test breaks when you refactor but behavior hasn't changed.
31
- - **Tautological**: the assertion recomputes the expected value the way the code does (`expect(add(a, b)).toBe(a + b)`, a snapshot derived by hand the same way, a constant asserted equal to itself), so it passes by construction and can never disagree with the code. Expected values must come from an independent source of truth: a known-good literal, a worked example, the spec.
31
+ - **Tautological / Vacuous Assertion**: the assertion recomputes the expected value the way the code does (`expect(add(a, b)).toBe(a + b)`, a snapshot derived by hand the same way, a constant asserted equal to itself), or asserts a condition that passes whether or not the feature works. Deleting the code under test must make the test fail.
32
+ - **Silent No-Match**: a test filter, grep, or predicate that matches zero cases and reads as clean. Always prove a positive control before believing absence.
33
+ - **Stale Premise**: an assertion whose expected value was copied directly off broken code, cementing the bug it was meant to catch.
32
34
  - **Horizontal slicing**: writing all tests first, then all implementation. Bulk tests verify _imagined_ behavior: you test the _shape_ of things rather than user-facing behavior, the tests go insensitive to real changes, and you commit to test structure before understanding the implementation. Work in **vertical slices** instead: one test → one implementation → repeat, each test a **tracer bullet** that responds to what the last cycle taught you.
33
35
 
34
36
  ## Rules of the loop
35
37
 
36
- - **Red before green.** Write the failing test first, then only enough code to pass it. Don't anticipate future tests or add speculative features.
38
+ - **The Red Gate (Red before green).** Write the failing test first, run it, and confirm it fails. If it passes before code is written, STOP: either the feature already exists (avoiding redundant work), or the test is vacuous. Only write enough code to turn the red gate green. Don't anticipate future tests or add speculative features.
37
39
  - **One slice at a time.** One seam, one test, one minimal implementation per cycle.
40
+ - **Disk Read-Back Verification.** Verify artifacts and written configs by reading values directly back from the file on disk (`cat`, `jq`, file assertions), never from in-memory variables.
38
41
  - **Refactoring is not part of the loop.** It belongs to the review stage (see the `code-review` skill), not the red → green implementation cycle.