jonah-fleet 1.25.1 → 1.26.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.26.0](https://github.com/juliendurandeu/jonah-fleet/compare/v1.25.2...v1.26.0) (2026-09-23)
9
+
10
+
11
+ ### Features
12
+
13
+ * **daemon:** autowork backlog zero-token preflight and diagnostic reporting ([#362](https://github.com/juliendurandeu/jonah-fleet/issues/362)) ([#387](https://github.com/juliendurandeu/jonah-fleet/issues/387)) ([4671829](https://github.com/juliendurandeu/jonah-fleet/commit/4671829701c0daf6e10544a22b59265a237630e6))
14
+
15
+ ## [1.25.2](https://github.com/juliendurandeu/jonah-fleet/compare/v1.25.1...v1.25.2) (2026-09-23)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * **guard:** exempt view_file and read_file from repetition circuit breaker ([#382](https://github.com/juliendurandeu/jonah-fleet/issues/382)) ([bc04e90](https://github.com/juliendurandeu/jonah-fleet/commit/bc04e90fe9d59de0e30f7d2ff36a202d2588d4f0))
21
+
8
22
  ## [1.25.1](https://github.com/juliendurandeu/jonah-fleet/compare/v1.25.0...v1.25.1) (2026-09-23)
9
23
 
10
24
 
@@ -23,11 +37,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
23
37
 
24
38
  ### Features
25
39
 
40
+ * **daemon:** autowork backlog zero-token preflight and diagnostic reporting ([#362](https://github.com/juliendurandeu/jonah-fleet/issues/362)).
26
41
  * **guard:** capture action arguments on LoopGuard circuit breaker trips, enrich failure cards and reports with formatted action details, and surface active tool commands in runner stdout.
27
42
  * **workflows:** provision MCP servers for Antigravity CLI in `analytics-review-cron.yml` and `design-review-cron.yml`.
28
43
 
29
44
  ### Bug Fixes
30
45
 
46
+ * **guard:** exempt read-only file inspection tools (`view_file`, `read_file`) from sliding-window repetition circuit breaker, preventing false-positive runner aborts during large-file slice reading.
31
47
  * **radar:** calibrate upstream heuristic classifier to filter release chores, non-GitHub platforms, and internal build details, eliminating false Category A/B alerts in weekly digests.
32
48
 
33
49
  ## [1.24.0](https://github.com/juliendurandeu/jonah-fleet/compare/v1.23.1...v1.24.0) (2026-09-23)
package/dist/index.js CHANGED
@@ -3538,6 +3538,115 @@ var TerminalSpinner = class {
3538
3538
  }
3539
3539
  }
3540
3540
  };
3541
+ function renderBacklogDiagnosticCard(report, options) {
3542
+ const width = options?.width || Math.min(Math.max((process.stdout.columns || 80) - 4, 64), 90);
3543
+ const horizontal = "\u2500".repeat(width - 2);
3544
+ const lines = [];
3545
+ lines.push(pc9.cyan(`\u250C${horizontal}\u2510`));
3546
+ const total = report.total ?? (report.actionable?.length || 0) + (report.inProgress?.length || 0) + (report.gatedHuman?.length || 0) + (report.awaitingInfo?.length || 0) + (report.guardrails?.length || 0) + (report.routineLogs?.length || 0);
3547
+ const actionableCount = report.actionable?.length || 0;
3548
+ const headerParts = [
3549
+ pc9.bold(pc9.white("AUTOWORK BACKLOG TRIAGE")),
3550
+ pc9.yellow(`${actionableCount} Actionable`),
3551
+ pc9.dim("(0 tokens used)")
3552
+ ];
3553
+ const headerContent = headerParts.join(" \xB7 ");
3554
+ const headerPlain = stripAnsi(headerContent);
3555
+ lines.push(
3556
+ pc9.cyan("\u2502") + ` ${headerContent}` + " ".repeat(Math.max(1, width - 3 - headerPlain.length)) + pc9.cyan("\u2502")
3557
+ );
3558
+ const hasNoGated = (report.inProgress?.length || 0) === 0 && (report.gatedHuman?.length || 0) === 0 && (report.awaitingInfo?.length || 0) === 0 && (report.guardrails?.length || 0) === 0;
3559
+ if (total === 0 || hasNoGated && actionableCount === 0) {
3560
+ lines.push(pc9.cyan(`\u251C${horizontal}\u2524`));
3561
+ const emptyMsg = "Backlog is completely empty. 0 open issues found.";
3562
+ lines.push(
3563
+ pc9.cyan("\u2502") + ` ${pc9.bold(emptyMsg)}` + " ".repeat(Math.max(1, width - 4 - stripAnsi(emptyMsg).length)) + pc9.cyan("\u2502")
3564
+ );
3565
+ const tipMsg = "Tip: Create an issue with priority/P1 or priority/P2 to trigger Autowork.";
3566
+ lines.push(
3567
+ pc9.cyan("\u2502") + ` ${pc9.dim(tipMsg)}` + " ".repeat(Math.max(1, width - 4 - stripAnsi(tipMsg).length)) + pc9.cyan("\u2502")
3568
+ );
3569
+ lines.push(pc9.cyan(`\u2514${horizontal}\u2518`));
3570
+ return lines.join("\n");
3571
+ }
3572
+ const statusMsg = `Preflight: Zero-token bypass active (no worktrees spawned)`;
3573
+ lines.push(
3574
+ pc9.cyan("\u2502") + ` ${pc9.dim(statusMsg)}` + " ".repeat(Math.max(1, width - 4 - stripAnsi(statusMsg).length)) + pc9.cyan("\u2502")
3575
+ );
3576
+ lines.push(pc9.cyan(`\u251C${horizontal}\u2524`));
3577
+ const renderSection = (title, colorFn, items, reasonLabel) => {
3578
+ if (!items || items.length === 0) return;
3579
+ const sectionHeader = ` ${colorFn(pc9.bold(title))}`;
3580
+ lines.push(
3581
+ pc9.cyan("\u2502") + sectionHeader + " ".repeat(Math.max(1, width - 2 - stripAnsi(sectionHeader).length)) + pc9.cyan("\u2502")
3582
+ );
3583
+ for (const item of items) {
3584
+ const itemTitle = cleanTargetTitle(item.title, width - 36);
3585
+ const text = `\u2022 #${item.number}: ${itemTitle} (${reasonLabel})`;
3586
+ const wrapped = wrapText(text, width - 8);
3587
+ for (let i = 0; i < wrapped.length; i++) {
3588
+ const wLine = wrapped[i];
3589
+ const wPlain = stripAnsi(wLine);
3590
+ lines.push(
3591
+ pc9.cyan("\u2502") + ` ${wLine}` + " ".repeat(Math.max(1, width - 5 - wPlain.length)) + pc9.cyan("\u2502")
3592
+ );
3593
+ }
3594
+ }
3595
+ };
3596
+ if (report.gatedHuman && report.gatedHuman.length > 0) {
3597
+ renderSection("Gated by Human Decision (needs-human):", pc9.red, report.gatedHuman, "Gated: needs-human");
3598
+ }
3599
+ if (report.awaitingInfo && report.awaitingInfo.length > 0) {
3600
+ renderSection(
3601
+ "Awaiting Specifications (needs-info / needs-design):",
3602
+ pc9.yellow,
3603
+ report.awaitingInfo,
3604
+ "Awaiting info: needs-info"
3605
+ );
3606
+ }
3607
+ if (report.inProgress && report.inProgress.length > 0) {
3608
+ renderSection("Already In Progress:", pc9.blue, report.inProgress, "In Progress");
3609
+ }
3610
+ if (report.guardrails && report.guardrails.length > 0) {
3611
+ renderSection("Metrics & Guardrails (measurement / wontfix):", pc9.magenta, report.guardrails, "Guardrail: measurement");
3612
+ }
3613
+ if (report.routineLogs && report.routineLogs.length > 0) {
3614
+ const routineText = ` Operational Logs: ${report.routineLogs.length} routine run log(s) filtered`;
3615
+ lines.push(
3616
+ pc9.cyan("\u2502") + pc9.dim(routineText) + " ".repeat(Math.max(1, width - 2 - stripAnsi(routineText).length)) + pc9.cyan("\u2502")
3617
+ );
3618
+ }
3619
+ lines.push(pc9.cyan(`\u251C${horizontal}\u2524`));
3620
+ const hintsHeader = ` ${pc9.bold("Hints to unblock:")}`;
3621
+ lines.push(
3622
+ pc9.cyan("\u2502") + hintsHeader + " ".repeat(Math.max(1, width - 2 - stripAnsi(hintsHeader).length)) + pc9.cyan("\u2502")
3623
+ );
3624
+ const hints = [];
3625
+ if (report.awaitingInfo && report.awaitingInfo.length > 0) {
3626
+ hints.push("Remove 'needs-info' or 'needs-design' once specifications are clarified.");
3627
+ }
3628
+ if (report.gatedHuman && report.gatedHuman.length > 0) {
3629
+ hints.push("Remove 'needs-human' if autonomous implementation is appropriate.");
3630
+ }
3631
+ if (report.inProgress && report.inProgress.length > 0) {
3632
+ hints.push("Merge or close open PRs, or unassign human assignees to allow agent pickup.");
3633
+ }
3634
+ if (hints.length === 0) {
3635
+ hints.push("Add priority/P1 or priority/P2 label to an issue to schedule autonomous work.");
3636
+ }
3637
+ for (const hint of hints) {
3638
+ const text = `\u2022 ${hint}`;
3639
+ const wrapped = wrapText(text, width - 8);
3640
+ for (const wLine of wrapped) {
3641
+ const wPlain = stripAnsi(wLine);
3642
+ lines.push(
3643
+ pc9.cyan("\u2502") + ` ${pc9.dim(wLine)}` + " ".repeat(Math.max(1, width - 5 - wPlain.length)) + pc9.cyan("\u2502")
3644
+ );
3645
+ }
3646
+ }
3647
+ lines.push(pc9.cyan(`\u2514${horizontal}\u2518`));
3648
+ return lines.join("\n");
3649
+ }
3541
3650
 
3542
3651
  // src/lib/loop-guard.ts
3543
3652
  import crypto from "crypto";
@@ -3602,6 +3711,7 @@ var LoopGuard = class {
3602
3711
  return this.trippedResult;
3603
3712
  }
3604
3713
  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");
3714
+ const isExemptFromRepetition = isStatusPolling || toolName === "view_file" || toolName === "read_file";
3605
3715
  const hash = computeActionHash(toolName, args);
3606
3716
  const record = {
3607
3717
  toolName,
@@ -3634,7 +3744,7 @@ var LoopGuard = class {
3634
3744
  this.history.push(record);
3635
3745
  const windowStart = Math.max(0, this.history.length - this.slidingWindowSize);
3636
3746
  const currentWindow = this.history.slice(windowStart);
3637
- if (!isStatusPolling) {
3747
+ if (!isExemptFromRepetition) {
3638
3748
  let repetitionCount = 0;
3639
3749
  for (const item of currentWindow) {
3640
3750
  if (item.hash === hash) {
@@ -5203,6 +5313,103 @@ async function getOpenReviewablePRs(repoRoot) {
5203
5313
  return [];
5204
5314
  }
5205
5315
  }
5316
+ function isBotLogin(login) {
5317
+ if (!login) return false;
5318
+ const l = login.toLowerCase().trim();
5319
+ const configuredBot = process.env.AGENT_BOT_LOGIN?.toLowerCase().replace(/^@/, "");
5320
+ if (configuredBot && l === configuredBot) {
5321
+ return true;
5322
+ }
5323
+ return l.endsWith("[bot]") || l.endsWith("-bot") || l.endsWith("_bot") || l === "github-actions" || l === "github-actions[bot]" || l === "jonah-fleet-bot";
5324
+ }
5325
+ function classifyBacklogIssues(issues, openPRs = []) {
5326
+ const actionable = [];
5327
+ const inProgress = [];
5328
+ const gatedHuman = [];
5329
+ const awaitingInfo = [];
5330
+ const guardrails = [];
5331
+ const routineLogs = [];
5332
+ const prReferencedIssues = /* @__PURE__ */ new Set();
5333
+ for (const pr of openPRs) {
5334
+ const textToScan = `${pr.title || ""} ${pr.body || ""} ${pr.headRefName || ""}`;
5335
+ const matches = textToScan.matchAll(/#(\d+)\b/g);
5336
+ for (const m of matches) {
5337
+ prReferencedIssues.add(parseInt(m[1], 10));
5338
+ }
5339
+ const branchMatch = (pr.headRefName || "").match(/(?:^|[-_/])(\d+)(?:[-_/]|$)/);
5340
+ if (branchMatch) {
5341
+ prReferencedIssues.add(parseInt(branchMatch[1], 10));
5342
+ }
5343
+ }
5344
+ for (const issue of issues) {
5345
+ const labelNames = (issue.labels || []).map(
5346
+ (l) => (typeof l === "string" ? l : l.name).toLowerCase()
5347
+ );
5348
+ if (labelNames.includes("routine-log") || isRoutineRunTitle(issue.title)) {
5349
+ routineLogs.push(issue);
5350
+ continue;
5351
+ }
5352
+ if (labelNames.includes("needs-human")) {
5353
+ gatedHuman.push(issue);
5354
+ continue;
5355
+ }
5356
+ if (labelNames.includes("needs-info") || labelNames.includes("needs-design")) {
5357
+ awaitingInfo.push(issue);
5358
+ continue;
5359
+ }
5360
+ if (labelNames.includes("measurement") || labelNames.includes("wontfix")) {
5361
+ guardrails.push(issue);
5362
+ continue;
5363
+ }
5364
+ const hasMatchingPR = prReferencedIssues.has(issue.number);
5365
+ const hasHumanAssignee = (issue.assignees || []).some((a) => !isBotLogin(a.login));
5366
+ if (hasMatchingPR || hasHumanAssignee) {
5367
+ inProgress.push(issue);
5368
+ continue;
5369
+ }
5370
+ actionable.push(issue);
5371
+ }
5372
+ return {
5373
+ actionable,
5374
+ inProgress,
5375
+ gatedHuman,
5376
+ awaitingInfo,
5377
+ guardrails,
5378
+ routineLogs,
5379
+ total: issues.length
5380
+ };
5381
+ }
5382
+ async function getBacklogIssues(repoRoot) {
5383
+ try {
5384
+ const { stdout } = await execFileAsync5(
5385
+ "gh",
5386
+ ["issue", "list", "--state", "open", "--json", "number,title,labels,assignees,url", "--limit", "50"],
5387
+ { cwd: repoRoot, timeout: 5e3 }
5388
+ );
5389
+ return JSON.parse(stdout || "[]");
5390
+ } catch {
5391
+ return [];
5392
+ }
5393
+ }
5394
+ async function getOpenPRsForBacklog(repoRoot) {
5395
+ try {
5396
+ const { stdout } = await execFileAsync5(
5397
+ "gh",
5398
+ ["pr", "list", "--state", "open", "--json", "number,title,body,headRefName", "--limit", "30"],
5399
+ { cwd: repoRoot, timeout: 5e3 }
5400
+ );
5401
+ return JSON.parse(stdout || "[]");
5402
+ } catch {
5403
+ return [];
5404
+ }
5405
+ }
5406
+ async function getBacklogTriageReport(repoRoot) {
5407
+ const [issues, openPRs] = await Promise.all([
5408
+ getBacklogIssues(repoRoot),
5409
+ getOpenPRsForBacklog(repoRoot)
5410
+ ]);
5411
+ return classifyBacklogIssues(issues, openPRs);
5412
+ }
5206
5413
  async function startBackgroundDaemon(repoRoot, options = {}) {
5207
5414
  if (isDaemonRunning(repoRoot)) {
5208
5415
  const existing = readDaemonState(repoRoot);
@@ -5452,6 +5659,94 @@ async function drainReviewQueue(drainOptions) {
5452
5659
  reviewablePRs = await getPRs(repoRoot);
5453
5660
  }
5454
5661
  }
5662
+ async function performAutoworkScan(scanOptions) {
5663
+ const {
5664
+ repoRoot,
5665
+ state,
5666
+ options = {},
5667
+ isStopping = () => false,
5668
+ clearTicker,
5669
+ getPRs = getOpenReviewablePRs,
5670
+ getBacklog = options.getBacklog || getBacklogTriageReport,
5671
+ runRoutine = options.runRoutine || runLocalRoutine,
5672
+ onDiagnosticCard
5673
+ } = scanOptions;
5674
+ if (isStopping()) return { executed: false, reason: "stopping" };
5675
+ const routines = options.routines || ["peer-review", "autowork"];
5676
+ if (routines.includes("peer-review")) {
5677
+ const pendingPRs = (await getPRs(repoRoot)).length;
5678
+ if (pendingPRs > 0) {
5679
+ console.log(
5680
+ pc13.cyan(
5681
+ `
5682
+ [${(/* @__PURE__ */ new Date()).toLocaleTimeString()}] \u23F3 Autowork paused: draining ${pendingPRs} reviewable PR(s) first...`
5683
+ )
5684
+ );
5685
+ await drainReviewQueue({
5686
+ repoRoot,
5687
+ state,
5688
+ options,
5689
+ isStopping,
5690
+ clearTicker,
5691
+ getPRs,
5692
+ runRoutine
5693
+ });
5694
+ const remainingPRs = (await getPRs(repoRoot)).length;
5695
+ if (remainingPRs > 0) {
5696
+ console.log(
5697
+ pc13.yellow(
5698
+ `
5699
+ [${(/* @__PURE__ */ new Date()).toLocaleTimeString()}] \u26A0\uFE0F Review backlog still has ${remainingPRs} pending PR(s). Postponing autowork session.`
5700
+ )
5701
+ );
5702
+ return { executed: false, reason: "pending_prs" };
5703
+ }
5704
+ }
5705
+ }
5706
+ const report = await getBacklog(repoRoot);
5707
+ if (report.actionable.length === 0) {
5708
+ if (clearTicker) clearTicker();
5709
+ const card = renderBacklogDiagnosticCard(report);
5710
+ console.log("\n" + card + "\n");
5711
+ onDiagnosticCard?.(card);
5712
+ return { executed: false, reason: "zero_actionable" };
5713
+ }
5714
+ if (state) {
5715
+ state.lastAutoworkCheckAt = (/* @__PURE__ */ new Date()).toISOString();
5716
+ state.status = "working";
5717
+ state.activeRoutine = "autowork";
5718
+ writeDaemonState(repoRoot, state);
5719
+ }
5720
+ if (clearTicker) clearTicker();
5721
+ console.log(
5722
+ pc13.cyan(
5723
+ `
5724
+ [${(/* @__PURE__ */ new Date()).toLocaleTimeString()}] \u{1F680} Autowork Backlog Scan: Found ${report.actionable.length} actionable issue(s). Starting session...`
5725
+ )
5726
+ );
5727
+ await cleanupStaleWorktrees(repoRoot);
5728
+ const result = await runRoutine({
5729
+ targetDir: repoRoot,
5730
+ routine: "autowork",
5731
+ model: options.model,
5732
+ verbose: options.verbose,
5733
+ noWorktree: false,
5734
+ onTargetDetected: (target) => {
5735
+ if (state) {
5736
+ state.activeTarget = target;
5737
+ writeDaemonState(repoRoot, state);
5738
+ }
5739
+ }
5740
+ });
5741
+ if (result.success) {
5742
+ console.log(pc13.green(`\u2713 Local autowork completed successfully.
5743
+ `));
5744
+ } else {
5745
+ console.warn(pc13.yellow(`\u26A0\uFE0F Local autowork completed with code ${result.exitCode}.
5746
+ `));
5747
+ }
5748
+ return { executed: true };
5749
+ }
5455
5750
  async function runDaemonLoop(repoRoot, options = {}) {
5456
5751
  const reviewInterval = options.reviewInterval || 3;
5457
5752
  const autoworkInterval = options.autoworkInterval || options.interval || 30;
@@ -5572,64 +5867,18 @@ Stopping local agent daemon...`));
5572
5867
  try {
5573
5868
  isWorking = true;
5574
5869
  nextAutoworkCheckTime = Date.now() + autoworkIntervalMs;
5575
- if (routines.includes("peer-review")) {
5576
- const pendingPRs = (await getPRsFn(repoRoot)).length;
5577
- if (pendingPRs > 0) {
5578
- console.log(
5579
- pc13.cyan(
5580
- `
5581
- [${(/* @__PURE__ */ new Date()).toLocaleTimeString()}] \u23F3 Autowork paused: draining ${pendingPRs} reviewable PR(s) first...`
5582
- )
5583
- );
5584
- await drainReviewQueue({
5585
- repoRoot,
5586
- state,
5587
- options,
5588
- isStopping: () => isStopping,
5589
- clearTicker,
5590
- getPRs: getPRsFn,
5591
- runRoutine: runRoutineFn
5592
- });
5593
- const prs = await getPRsFn(repoRoot);
5594
- lastOpenPRCount = prs.length;
5595
- const remainingPRs = (await getPRsFn(repoRoot)).length;
5596
- if (remainingPRs > 0) {
5597
- console.log(
5598
- pc13.yellow(
5599
- `
5600
- [${(/* @__PURE__ */ new Date()).toLocaleTimeString()}] \u26A0\uFE0F Review backlog still has ${remainingPRs} pending PR(s). Postponing autowork session.`
5601
- )
5602
- );
5603
- return;
5604
- }
5605
- }
5606
- }
5607
- state.lastAutoworkCheckAt = (/* @__PURE__ */ new Date()).toISOString();
5608
- clearTicker();
5609
- state.status = "working";
5610
- state.activeRoutine = "autowork";
5611
- writeDaemonState(repoRoot, state);
5612
- console.log(pc13.cyan(`
5613
- [${(/* @__PURE__ */ new Date()).toLocaleTimeString()}] \u{1F680} Autowork Backlog Scan: Starting session...`));
5614
- await cleanupStaleWorktrees(repoRoot);
5615
- const result = await runRoutineFn({
5616
- targetDir: repoRoot,
5617
- routine: "autowork",
5618
- model: options.model,
5619
- verbose: options.verbose,
5620
- noWorktree: false,
5621
- onTargetDetected: (target) => {
5622
- state.activeTarget = target;
5623
- writeDaemonState(repoRoot, state);
5624
- }
5870
+ await performAutoworkScan({
5871
+ repoRoot,
5872
+ state,
5873
+ options,
5874
+ isStopping: () => isStopping,
5875
+ clearTicker,
5876
+ getPRs: getPRsFn,
5877
+ getBacklog: options.getBacklog || getBacklogTriageReport,
5878
+ runRoutine: runRoutineFn
5625
5879
  });
5626
- if (result.success) {
5627
- console.log(pc13.green(`\u2713 Local autowork completed successfully.
5628
- `));
5629
- } else {
5630
- console.warn(pc13.yellow(`\u26A0\uFE0F Local autowork completed with code ${result.exitCode}.
5631
- `));
5632
- }
5880
+ const prs = await getPRsFn(repoRoot);
5881
+ lastOpenPRCount = prs.length;
5633
5882
  } catch (err) {
5634
5883
  console.error(pc13.red(`\u2717 Error in autowork: ${err.message}`));
5635
5884
  } finally {
@@ -1,3 +1,6 @@
1
+ import { type BacklogTriageReport, type BacklogIssueInfo } from './terminal-card.js';
2
+ export type BacklogIssue = BacklogIssueInfo;
3
+ export type { BacklogTriageReport };
1
4
  export interface DaemonState {
2
5
  pid: number;
3
6
  startedAt: string;
@@ -21,6 +24,7 @@ export interface DaemonOptions {
21
24
  verbose?: boolean;
22
25
  stdin?: any;
23
26
  getPRs?: (repoRoot: string) => Promise<ReviewablePR[]>;
27
+ getBacklog?: (repoRoot: string) => Promise<BacklogTriageReport>;
24
28
  runRoutine?: (opts: any) => Promise<{
25
29
  success: boolean;
26
30
  exitCode?: number;
@@ -50,6 +54,36 @@ export declare function getOpenReviewablePRs(repoRoot: string): Promise<Reviewab
50
54
  * Fast pre-flight check to query number of open ready PRs in ~100ms with 0 token cost.
51
55
  */
52
56
  export declare function countOpenReadyPRs(repoRoot: string): Promise<number>;
57
+ /**
58
+ * Checks if a GitHub user login corresponds to a bot account or designated agent persona.
59
+ */
60
+ export declare function isBotLogin(login?: string | null): boolean;
61
+ /**
62
+ * Classifies a list of open GitHub issues according to the Autowork backlog taxonomy.
63
+ */
64
+ export declare function classifyBacklogIssues(issues: BacklogIssue[], openPRs?: Array<{
65
+ number: number;
66
+ title?: string;
67
+ body?: string;
68
+ headRefName?: string;
69
+ }>): BacklogTriageReport;
70
+ /**
71
+ * Fast GitHub CLI query for open issues in ~150ms with 0 token cost.
72
+ */
73
+ export declare function getBacklogIssues(repoRoot: string): Promise<BacklogIssue[]>;
74
+ /**
75
+ * Fast GitHub CLI query for open pull requests with titles and bodies.
76
+ */
77
+ export declare function getOpenPRsForBacklog(repoRoot: string): Promise<Array<{
78
+ number: number;
79
+ title?: string;
80
+ body?: string;
81
+ headRefName?: string;
82
+ }>>;
83
+ /**
84
+ * Preflight query and classification for the full repository backlog with 0 token cost.
85
+ */
86
+ export declare function getBacklogTriageReport(repoRoot: string): Promise<BacklogTriageReport>;
53
87
  /**
54
88
  * Starts the daemon in the background by detaching a child process.
55
89
  */
@@ -96,6 +130,29 @@ export interface DrainReviewQueueOptions {
96
130
  * Tracks attempted PRs per pass to prevent infinite loops on stalled or repeatedly unmerged PRs.
97
131
  */
98
132
  export declare function drainReviewQueue(drainOptions: DrainReviewQueueOptions): Promise<void>;
133
+ export interface PerformAutoworkScanOptions {
134
+ repoRoot: string;
135
+ state?: DaemonState;
136
+ options?: DaemonOptions;
137
+ isStopping?: () => boolean;
138
+ clearTicker?: () => void;
139
+ getPRs?: (repoRoot: string) => Promise<ReviewablePR[]>;
140
+ getBacklog?: (repoRoot: string) => Promise<BacklogTriageReport>;
141
+ runRoutine?: (opts: any) => Promise<{
142
+ success: boolean;
143
+ exitCode?: number;
144
+ }>;
145
+ onDiagnosticCard?: (card: string) => void;
146
+ }
147
+ /**
148
+ * Performs an autowork backlog scan with zero-token preflight check.
149
+ * Drains reviewable PRs first, evaluates backlog, and bypasses worktree creation
150
+ * when zero actionable issues exist.
151
+ */
152
+ export declare function performAutoworkScan(scanOptions: PerformAutoworkScanOptions): Promise<{
153
+ executed: boolean;
154
+ reason?: string;
155
+ }>;
99
156
  /**
100
157
  * Runs the multi-cadence polling daemon loop in the current process with interactive controls.
101
158
  */
@@ -1 +1 @@
1
- {"version":3,"file":"daemon.d.ts","sourceRoot":"","sources":["../../src/lib/daemon.ts"],"names":[],"mappings":"AA0BA,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,uBAAuB,EAAE,MAAM,CAAC;IAChC,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;IAClD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,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G;IACI,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAwBlD;IAED,OAAO,CAAC,WAAW;CAWpB;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,MAAM,CAWvE;AAED,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,aAAa,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,2BAA2B,GAAG,MAAM,CA0BvF;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,CAmC7E"}
@@ -124,4 +124,32 @@ export declare class TerminalSpinner {
124
124
  private render;
125
125
  stop(): void;
126
126
  }
127
+ export interface BacklogIssueInfo {
128
+ number: number;
129
+ title: string;
130
+ labels?: Array<{
131
+ name: string;
132
+ }>;
133
+ assignees?: Array<{
134
+ login: string;
135
+ }>;
136
+ url?: string;
137
+ }
138
+ export interface BacklogTriageReport {
139
+ actionable: BacklogIssueInfo[];
140
+ inProgress: BacklogIssueInfo[];
141
+ gatedHuman: BacklogIssueInfo[];
142
+ awaitingInfo: BacklogIssueInfo[];
143
+ guardrails: BacklogIssueInfo[];
144
+ routineLogs: BacklogIssueInfo[];
145
+ total: number;
146
+ }
147
+ export interface BacklogCardOptions {
148
+ width?: number;
149
+ repoRoot?: string;
150
+ }
151
+ /**
152
+ * Renders a formatted diagnostic card when Autowork backlog preflight finds 0 actionable issues.
153
+ */
154
+ export declare function renderBacklogDiagnosticCard(report: BacklogTriageReport, options?: BacklogCardOptions): string;
127
155
  //# sourceMappingURL=terminal-card.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"terminal-card.d.ts","sourceRoot":"","sources":["../../src/lib/terminal-card.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACpF,OAAO,CAAC,EAAE,MAAM,EAAE,CA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AC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACrC,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,gBAAgB,EAAE,CAAC;IAC/B,UAAU,EAAE,gBAAgB,EAAE,CAAC;IAC/B,UAAU,EAAE,gBAAgB,EAAE,CAAC;IAC/B,YAAY,EAAE,gBAAgB,EAAE,CAAC;IACjC,UAAU,EAAE,gBAAgB,EAAE,CAAC;IAC/B,WAAW,EAAE,gBAAgB,EAAE,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,mBAAmB,EAC3B,OAAO,CAAC,EAAE,kBAAkB,GAC3B,MAAM,CA+KR"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jonah-fleet",
3
- "version": "1.25.1",
3
+ "version": "1.26.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",
@@ -73,6 +73,11 @@ export class LoopGuard {
73
73
  (args?.Action === 'list' ||
74
74
  args?.action === 'list'));
75
75
 
76
+ const isExemptFromRepetition =
77
+ isStatusPolling ||
78
+ toolName === 'view_file' ||
79
+ toolName === 'read_file';
80
+
76
81
  const hash = computeActionHash(toolName, args);
77
82
  const record = {
78
83
  toolName,
@@ -109,7 +114,7 @@ export class LoopGuard {
109
114
  this.history.push(record);
110
115
 
111
116
  // 2. Repetition Guard within sliding window
112
- if (!isStatusPolling) {
117
+ if (!isExemptFromRepetition) {
113
118
  const windowStart = Math.max(0, this.history.length - this.slidingWindowSize);
114
119
  const currentWindow = this.history.slice(windowStart);
115
120