jonah-fleet 1.35.2 → 1.36.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 +11 -0
- package/dist/index.js +151 -0
- package/dist/lib/runner.d.ts +70 -0
- package/dist/lib/runner.d.ts.map +1 -1
- package/package.json +1 -1
- package/templates/prompts/autowork.md +2 -0
- package/templates/prompts/peer-review.md +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,13 @@ 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.36.0](https://github.com/Jonah-Projects/jonah-fleet/compare/v1.35.2...v1.36.0) (2026-10-11)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **runner:** add head-tail truncation guard for tool outputs ([#698](https://github.com/Jonah-Projects/jonah-fleet/issues/698)) ([2982cda](https://github.com/Jonah-Projects/jonah-fleet/commit/2982cdacbd9b4b20ad808851f044dd19dae4a258))
|
|
14
|
+
|
|
8
15
|
## [1.35.2](https://github.com/Jonah-Projects/jonah-fleet/compare/v1.35.1...v1.35.2) (2026-10-11)
|
|
9
16
|
|
|
10
17
|
|
|
@@ -14,6 +21,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
14
21
|
|
|
15
22
|
## [Unreleased] - 2026-10-11
|
|
16
23
|
|
|
24
|
+
### Added
|
|
25
|
+
|
|
26
|
+
- **runner:** add head-tail streaming truncation circuit breaker (`DEFAULT_MAX_LINES = 500`, `DEFAULT_MAX_BYTES = 64KB`) for command execution and large tool outputs to prevent context overflow and worker stalls
|
|
27
|
+
|
|
17
28
|
### Fixed
|
|
18
29
|
|
|
19
30
|
- **terminal-card:** refine backlog triage hints to provide targeted unblock advice for radar digests and `needs-attention` issues instead of generic `needs-human` prompts
|
package/dist/index.js
CHANGED
|
@@ -5241,6 +5241,153 @@ function formatLoopGuardReport(options) {
|
|
|
5241
5241
|
// src/lib/runner.ts
|
|
5242
5242
|
import pc11 from "picocolors";
|
|
5243
5243
|
var execFileAsync5 = promisify5(execFile5);
|
|
5244
|
+
var DEFAULT_MAX_LINES = 500;
|
|
5245
|
+
var DEFAULT_MAX_BYTES = 64 * 1024;
|
|
5246
|
+
var DEFAULT_HEAD_LINES = 50;
|
|
5247
|
+
var DEFAULT_TAIL_LINES = 100;
|
|
5248
|
+
var HeadTailStreamTruncator = class {
|
|
5249
|
+
maxLines;
|
|
5250
|
+
maxBytes;
|
|
5251
|
+
headLines;
|
|
5252
|
+
tailLines;
|
|
5253
|
+
buffer = "";
|
|
5254
|
+
head = [];
|
|
5255
|
+
tail = [];
|
|
5256
|
+
allLines = [];
|
|
5257
|
+
totalLines = 0;
|
|
5258
|
+
totalBytes = 0;
|
|
5259
|
+
hasExceeded = false;
|
|
5260
|
+
flushed = false;
|
|
5261
|
+
constructor(options = {}) {
|
|
5262
|
+
this.maxLines = options.maxLines ?? DEFAULT_MAX_LINES;
|
|
5263
|
+
this.maxBytes = options.maxBytes ?? DEFAULT_MAX_BYTES;
|
|
5264
|
+
this.headLines = options.headLines ?? DEFAULT_HEAD_LINES;
|
|
5265
|
+
this.tailLines = options.tailLines ?? DEFAULT_TAIL_LINES;
|
|
5266
|
+
}
|
|
5267
|
+
feed(chunk) {
|
|
5268
|
+
if (!chunk) return;
|
|
5269
|
+
this.totalBytes += Buffer.byteLength(chunk, "utf8");
|
|
5270
|
+
this.buffer += chunk;
|
|
5271
|
+
const parts = this.buffer.split("\n");
|
|
5272
|
+
this.buffer = parts.pop() ?? "";
|
|
5273
|
+
for (const line of parts) {
|
|
5274
|
+
this.processLine(line);
|
|
5275
|
+
}
|
|
5276
|
+
if (!this.hasExceeded && this.totalBytes > this.maxBytes) {
|
|
5277
|
+
this.triggerExceeded();
|
|
5278
|
+
}
|
|
5279
|
+
}
|
|
5280
|
+
processLine(line) {
|
|
5281
|
+
this.totalLines++;
|
|
5282
|
+
if (!this.hasExceeded) {
|
|
5283
|
+
this.allLines.push(line);
|
|
5284
|
+
if (this.totalLines > this.maxLines || this.totalBytes > this.maxBytes) {
|
|
5285
|
+
this.triggerExceeded();
|
|
5286
|
+
}
|
|
5287
|
+
} else {
|
|
5288
|
+
if (this.head.length < this.headLines) {
|
|
5289
|
+
this.head.push(line);
|
|
5290
|
+
} else {
|
|
5291
|
+
this.tail.push(line);
|
|
5292
|
+
if (this.tail.length > this.tailLines) {
|
|
5293
|
+
this.tail.shift();
|
|
5294
|
+
}
|
|
5295
|
+
}
|
|
5296
|
+
}
|
|
5297
|
+
}
|
|
5298
|
+
triggerExceeded() {
|
|
5299
|
+
this.hasExceeded = true;
|
|
5300
|
+
this.head = this.allLines.slice(0, this.headLines);
|
|
5301
|
+
const remaining = this.allLines.slice(this.headLines);
|
|
5302
|
+
this.tail = remaining.slice(-this.tailLines);
|
|
5303
|
+
this.allLines = [];
|
|
5304
|
+
}
|
|
5305
|
+
flush() {
|
|
5306
|
+
if (this.flushed) return;
|
|
5307
|
+
this.flushed = true;
|
|
5308
|
+
if (this.buffer.length > 0) {
|
|
5309
|
+
const line = this.buffer;
|
|
5310
|
+
this.buffer = "";
|
|
5311
|
+
this.processLine(line);
|
|
5312
|
+
}
|
|
5313
|
+
if (!this.hasExceeded && (this.totalLines > this.maxLines || this.totalBytes > this.maxBytes)) {
|
|
5314
|
+
this.triggerExceeded();
|
|
5315
|
+
}
|
|
5316
|
+
}
|
|
5317
|
+
isTruncated() {
|
|
5318
|
+
if (!this.flushed) {
|
|
5319
|
+
this.flush();
|
|
5320
|
+
}
|
|
5321
|
+
return this.hasExceeded;
|
|
5322
|
+
}
|
|
5323
|
+
getResult() {
|
|
5324
|
+
if (!this.flushed) {
|
|
5325
|
+
this.flush();
|
|
5326
|
+
}
|
|
5327
|
+
if (!this.hasExceeded) {
|
|
5328
|
+
const text2 = this.allLines.join("\n");
|
|
5329
|
+
return {
|
|
5330
|
+
text: text2,
|
|
5331
|
+
truncated: false,
|
|
5332
|
+
totalLines: this.totalLines,
|
|
5333
|
+
totalBytes: this.totalBytes,
|
|
5334
|
+
truncatedLines: 0,
|
|
5335
|
+
truncatedBytes: 0
|
|
5336
|
+
};
|
|
5337
|
+
}
|
|
5338
|
+
let finalHead = this.head.join("\n");
|
|
5339
|
+
let finalTail = this.tail.join("\n");
|
|
5340
|
+
if (this.head.length <= 1 && this.tail.length === 0 && finalHead.length > 0) {
|
|
5341
|
+
const line = finalHead;
|
|
5342
|
+
const targetHead = Math.floor(this.maxBytes * 0.35);
|
|
5343
|
+
const targetTail = Math.floor(this.maxBytes * 0.55);
|
|
5344
|
+
finalHead = Buffer.from(line, "utf8").subarray(0, targetHead).toString("utf8");
|
|
5345
|
+
const lineBuf = Buffer.from(line, "utf8");
|
|
5346
|
+
finalTail = lineBuf.subarray(Math.max(0, lineBuf.length - targetTail)).toString("utf8");
|
|
5347
|
+
} else {
|
|
5348
|
+
const maxAllowedBytes = this.maxBytes;
|
|
5349
|
+
const currentHeadBytes = Buffer.byteLength(finalHead, "utf8");
|
|
5350
|
+
const currentTailBytes = Buffer.byteLength(finalTail, "utf8");
|
|
5351
|
+
if (currentHeadBytes + currentTailBytes > maxAllowedBytes) {
|
|
5352
|
+
const targetHeadBytes = Math.floor(maxAllowedBytes * 0.35);
|
|
5353
|
+
const targetTailBytes = Math.floor(maxAllowedBytes * 0.55);
|
|
5354
|
+
if (currentHeadBytes > targetHeadBytes) {
|
|
5355
|
+
finalHead = Buffer.from(finalHead, "utf8").subarray(0, targetHeadBytes).toString("utf8");
|
|
5356
|
+
}
|
|
5357
|
+
if (currentTailBytes > targetTailBytes) {
|
|
5358
|
+
const tailBuf = Buffer.from(finalTail, "utf8");
|
|
5359
|
+
finalTail = tailBuf.subarray(Math.max(0, tailBuf.length - targetTailBytes)).toString("utf8");
|
|
5360
|
+
}
|
|
5361
|
+
}
|
|
5362
|
+
}
|
|
5363
|
+
const omittedLines = Math.max(0, this.totalLines - (this.head.length + this.tail.length));
|
|
5364
|
+
const retainedBytes = Buffer.byteLength(finalHead, "utf8") + Buffer.byteLength(finalTail, "utf8");
|
|
5365
|
+
const truncatedBytes = Math.max(0, this.totalBytes - retainedBytes);
|
|
5366
|
+
const truncatedKb = (truncatedBytes / 1024).toFixed(1);
|
|
5367
|
+
const separator = `
|
|
5368
|
+
... [${omittedLines} lines / ${truncatedKb} KB truncated to preserve context window] ...
|
|
5369
|
+
`;
|
|
5370
|
+
const text = `${finalHead}${separator}${finalTail}`;
|
|
5371
|
+
return {
|
|
5372
|
+
text,
|
|
5373
|
+
truncated: true,
|
|
5374
|
+
totalLines: this.totalLines,
|
|
5375
|
+
totalBytes: this.totalBytes,
|
|
5376
|
+
truncatedLines: omittedLines,
|
|
5377
|
+
truncatedBytes
|
|
5378
|
+
};
|
|
5379
|
+
}
|
|
5380
|
+
getOutput() {
|
|
5381
|
+
return this.getResult().text;
|
|
5382
|
+
}
|
|
5383
|
+
};
|
|
5384
|
+
function truncateHeadTail(output, options = {}) {
|
|
5385
|
+
if (!output) return "";
|
|
5386
|
+
const truncator = new HeadTailStreamTruncator(options);
|
|
5387
|
+
truncator.feed(output);
|
|
5388
|
+
truncator.flush();
|
|
5389
|
+
return truncator.getOutput();
|
|
5390
|
+
}
|
|
5244
5391
|
var LineBufferedStreamParser = class {
|
|
5245
5392
|
buffer = "";
|
|
5246
5393
|
onLine;
|
|
@@ -5270,6 +5417,9 @@ function parseStreamJsonEvent(line) {
|
|
|
5270
5417
|
try {
|
|
5271
5418
|
const parsed = JSON.parse(line);
|
|
5272
5419
|
if (parsed && typeof parsed === "object") {
|
|
5420
|
+
if (parsed.step_update?.tool_info?.output && typeof parsed.step_update.tool_info.output === "string") {
|
|
5421
|
+
parsed.step_update.tool_info.output = truncateHeadTail(parsed.step_update.tool_info.output);
|
|
5422
|
+
}
|
|
5273
5423
|
return parsed;
|
|
5274
5424
|
}
|
|
5275
5425
|
return null;
|
|
@@ -6042,6 +6192,7 @@ Timeout: ${printTimeout}`,
|
|
|
6042
6192
|
executedAnyTool = true;
|
|
6043
6193
|
lastActionDesc = null;
|
|
6044
6194
|
if (su.tool_info?.output) {
|
|
6195
|
+
su.tool_info.output = truncateHeadTail(su.tool_info.output);
|
|
6045
6196
|
checkTargetDetection(su.tool_info.output);
|
|
6046
6197
|
}
|
|
6047
6198
|
if (spinner) {
|
package/dist/lib/runner.d.ts
CHANGED
|
@@ -90,6 +90,76 @@ export interface StreamJsonEvent {
|
|
|
90
90
|
};
|
|
91
91
|
[key: string]: any;
|
|
92
92
|
}
|
|
93
|
+
export declare const DEFAULT_MAX_LINES = 500;
|
|
94
|
+
export declare const DEFAULT_MAX_BYTES: number;
|
|
95
|
+
export declare const DEFAULT_HEAD_LINES = 50;
|
|
96
|
+
export declare const DEFAULT_TAIL_LINES = 100;
|
|
97
|
+
export interface HeadTailTruncationOptions {
|
|
98
|
+
maxLines?: number;
|
|
99
|
+
maxBytes?: number;
|
|
100
|
+
headLines?: number;
|
|
101
|
+
tailLines?: number;
|
|
102
|
+
}
|
|
103
|
+
export interface HeadTailTruncationResult {
|
|
104
|
+
text: string;
|
|
105
|
+
truncated: boolean;
|
|
106
|
+
totalLines: number;
|
|
107
|
+
totalBytes: number;
|
|
108
|
+
truncatedLines: number;
|
|
109
|
+
truncatedBytes: number;
|
|
110
|
+
}
|
|
111
|
+
export interface CommandExecutionOptions {
|
|
112
|
+
cwd?: string;
|
|
113
|
+
env?: NodeJS.ProcessEnv;
|
|
114
|
+
timeout?: number;
|
|
115
|
+
maxLines?: number;
|
|
116
|
+
maxBytes?: number;
|
|
117
|
+
headLines?: number;
|
|
118
|
+
tailLines?: number;
|
|
119
|
+
}
|
|
120
|
+
export interface CommandExecutionResult {
|
|
121
|
+
stdout: string;
|
|
122
|
+
stderr: string;
|
|
123
|
+
exitCode: number;
|
|
124
|
+
truncated: boolean;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Streaming truncator that preserves head and tail of output when line or byte thresholds are exceeded.
|
|
128
|
+
*/
|
|
129
|
+
export declare class HeadTailStreamTruncator {
|
|
130
|
+
private maxLines;
|
|
131
|
+
private maxBytes;
|
|
132
|
+
private headLines;
|
|
133
|
+
private tailLines;
|
|
134
|
+
private buffer;
|
|
135
|
+
private head;
|
|
136
|
+
private tail;
|
|
137
|
+
private allLines;
|
|
138
|
+
private totalLines;
|
|
139
|
+
private totalBytes;
|
|
140
|
+
private hasExceeded;
|
|
141
|
+
private flushed;
|
|
142
|
+
constructor(options?: HeadTailTruncationOptions);
|
|
143
|
+
feed(chunk: string): void;
|
|
144
|
+
private processLine;
|
|
145
|
+
private triggerExceeded;
|
|
146
|
+
flush(): void;
|
|
147
|
+
isTruncated(): boolean;
|
|
148
|
+
getResult(): HeadTailTruncationResult;
|
|
149
|
+
getOutput(): string;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Truncates text output using head-tail preservation when line or byte ceilings are exceeded.
|
|
153
|
+
*/
|
|
154
|
+
export declare function truncateHeadTail(output: string, options?: HeadTailTruncationOptions): string;
|
|
155
|
+
/**
|
|
156
|
+
* Truncates text output returning detailed metadata about lines and bytes truncated.
|
|
157
|
+
*/
|
|
158
|
+
export declare function truncateHeadTailDetails(output: string, options?: HeadTailTruncationOptions): HeadTailTruncationResult;
|
|
159
|
+
/**
|
|
160
|
+
* Safely executes an external command with head-tail streaming truncation on stdout and stderr.
|
|
161
|
+
*/
|
|
162
|
+
export declare function executeCommand(file: string, args: string[], options?: CommandExecutionOptions): Promise<CommandExecutionResult>;
|
|
93
163
|
/**
|
|
94
164
|
* Line buffer for incremental stream-json chunk processing.
|
|
95
165
|
*/
|
package/dist/lib/runner.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/lib/runner.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;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG,MAAM,GAAG,IAAI,GAAG,MAAM,CAEnG;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAsDzF;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,qBAAqB,GAAG,MAAM,CA4D9E;AAED;;;GAGG;AACH,wBAAsB,uBAAuB,CAC3C,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC;IAAE,SAAS,EAAE,OAAO,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAkBzE;AAED;;GAEG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CA0mBrG"}
|
package/package.json
CHANGED
|
@@ -43,6 +43,7 @@ If any criterion cannot be met, stop immediately and log FAILURE with the reason
|
|
|
43
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
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.
|
|
45
45
|
- **Incremental Commits**: Commit early and incrementally. Do NOT accumulate dozens of edits across many files without committing. Once your implementation passes the Red Gate test and local tests, commit your changes immediately (`git commit -m "<type>(<scope>): <subject>" -- <paths>`). Then run formatting and linting as a separate commit. This guarantees your work is persisted in git and immune to mid-session crashes.
|
|
46
|
+
- **Streaming Truncation & Log Inspection Guardrail**: When executing commands or inspecting large files, test outputs, or git diffs, never dump unbounded streams that could exhaust the LLM context window or stall IPC buffers. Always inspect voluminous outputs with paging, line/byte limits, or head/tail/grep filters (e.g. `git log -n <N>`, `head -n 50`, `tail -n 100`, `grep`). Tool outputs exceeding 500 lines or 64 KB are automatically truncated by the runner circuit breaker using head-tail preservation to protect context.
|
|
46
47
|
|
|
47
48
|
## Negative examples (DO NOT do these)
|
|
48
49
|
|
|
@@ -65,6 +66,7 @@ If any criterion cannot be met, stop immediately and log FAILURE with the reason
|
|
|
65
66
|
- Do not use bare `git commit` or blind `git add .` without scoping specific paths (`git commit -m "..." -- <paths>`).
|
|
66
67
|
- Do not verify generated files by checking in-memory strings or shell variables; read values back out of the file on disk.
|
|
67
68
|
- Do not accumulate changes across many files without committing — commit incrementally as soon as tests pass, then format/lint.
|
|
69
|
+
- Do not dump full unbounded command outputs or large file contents into context — use paging, head/tail, or grep.
|
|
68
70
|
|
|
69
71
|
## Instructions
|
|
70
72
|
|
|
@@ -48,6 +48,7 @@ If any criterion cannot be met, stop immediately and log FAILURE with the reason
|
|
|
48
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.
|
|
49
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.
|
|
50
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.
|
|
51
|
+
- **Streaming Truncation & Log Inspection Guardrail**: When inspecting command outputs, CI logs, or large diffs, never dump unbounded streams that could exhaust the LLM context window or stall IPC buffers. Always inspect voluminous outputs with paging, line/byte limits, or head/tail/grep filters (e.g. `gh pr diff | head -n 100`, `gh run view --log | tail -n 50`). Tool outputs exceeding 500 lines or 64 KB are automatically truncated by the runner circuit breaker using head-tail preservation to protect context.
|
|
51
52
|
|
|
52
53
|
## Final action: merge, bounce to draft, or approve & defer merge
|
|
53
54
|
|
|
@@ -78,6 +79,7 @@ Every review ends in exactly one of three states:
|
|
|
78
79
|
- On re-review, do not raise new findings in code that was unchanged since the prior review — only inspect the delta commits.
|
|
79
80
|
- Do not bounce a PR for non-blocking style/preference findings when all correctness checks pass.
|
|
80
81
|
- Do not bounce an external contributor PR purely for missing `Closes #N` when the PR description provides a clear specification.
|
|
82
|
+
- Do not dump full unbounded command outputs or large file contents into context — use paging, head/tail, or grep.
|
|
81
83
|
- 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
84
|
- 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.
|
|
83
85
|
- Do not rerun full local test suites when remote CI checks on the head commit are already green and passing.
|