Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# Changelog

## [1.48.2.0] - 2026-05-28

**`eval:list --limit` now rejects malformed values instead of silently hiding runs.**

`bun run eval:list -- --limit 1abc` used to silently show only 1 row; `--limit nope` would show zero rows while reporting the full count in the footer. Both cases now exit 1 with a clear error. Closes #1683.

### The numbers that matter

| Input | Before | After |
|-------|--------|-------|
| `--limit 1abc` | Shows 1 row, exit 0 | Error: must be positive integer, exit 1 |
| `--limit nope` | Shows 0 rows (NaN slice), exit 0 | Error: must be positive integer, exit 1 |
| `--limit 5` | Works | Works (unchanged) |

### Itemized changes

#### Fixed
- `scripts/eval-list.ts`: `--limit` parsing uses `Number.parseInt` + `Number.isSafeInteger` + string round-trip check. Malformed/negative/zero values print a clear stderr error and exit 1.

#### For contributors
- `test/eval-list-limit.test.ts`: 6 gate-tier regression tests covering float, suffixed, non-numeric, zero, negative, and valid inputs.

## [1.48.0.0] - 2026-05-26

## **Agents stop dropping AskUserQuestion options when there are 5+.** A new canonical preamble rule + runtime gate makes Conductor's 4-option cap a split-or-batch decision, not a silent trim.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.48.0.0
1.48.2.0
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gstack",
"version": "1.48.0.0",
"version": "1.48.2.0",
"description": "Garry's Stack — Claude Code skills + fast headless browser. One repo, one install, entire AI engineering workflow.",
"license": "MIT",
"type": "module",
Expand Down
10 changes: 9 additions & 1 deletion scripts/eval-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,15 @@ let limit = 20;
for (let i = 0; i < args.length; i++) {
if (args[i] === '--branch' && args[i + 1]) { filterBranch = args[++i]; }
else if (args[i] === '--tier' && args[i + 1]) { filterTier = args[++i]; }
else if (args[i] === '--limit' && args[i + 1]) { limit = parseInt(args[++i], 10); }
else if (args[i] === '--limit' && args[i + 1]) {
const raw = args[++i];
const parsed = Number.parseInt(raw, 10);
if (!Number.isSafeInteger(parsed) || parsed < 1 || String(parsed) !== raw) {
console.error(`Error: --limit must be a positive integer, got: ${raw}`);
process.exit(1);
}
limit = parsed;
}
}

// Read eval files
Expand Down
60 changes: 60 additions & 0 deletions test/eval-list-limit.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import { describe, test, expect, beforeEach, afterEach } from 'bun:test';
import { spawnSync } from 'child_process';
import * as fs from 'fs';
import * as path from 'path';
import * as os from 'os';

const ROOT = path.resolve(import.meta.dir, '..');
const SCRIPT = path.join(ROOT, 'scripts', 'eval-list.ts');

function run(args: string[], evalDir?: string): { stdout: string; stderr: string; exitCode: number } {
const result = spawnSync('bun', [SCRIPT, ...args], {
encoding: 'utf-8',
timeout: 15000,
env: evalDir ? { ...process.env, GSTACK_DEV_HOME: evalDir } : process.env,
});
return {
stdout: result.stdout ?? '',
stderr: result.stderr ?? '',
exitCode: result.status ?? 1,
};
}

describe('eval-list --limit validation', () => {
test('rejects float (1.5) with exit 1', () => {
const { exitCode, stderr } = run(['--limit', '1.5']);
expect(exitCode).toBe(1);
expect(stderr).toContain('--limit');
});

test('rejects suffix (1abc) with exit 1', () => {
const { exitCode, stderr } = run(['--limit', '1abc']);
expect(exitCode).toBe(1);
expect(stderr).toContain('--limit');
});

test('rejects non-numeric (nope) with exit 1', () => {
const { exitCode, stderr } = run(['--limit', 'nope']);
expect(exitCode).toBe(1);
expect(stderr).toContain('--limit');
});

test('rejects zero with exit 1', () => {
const { exitCode, stderr } = run(['--limit', '0']);
expect(exitCode).toBe(1);
expect(stderr).toContain('--limit');
});

test('rejects negative with exit 1', () => {
const { exitCode, stderr } = run(['--limit', '-3']);
expect(exitCode).toBe(1);
expect(stderr).toContain('--limit');
});

test('accepts valid positive integer without error', () => {
const { exitCode, stderr } = run(['--limit', '5']);
// May exit 0 (no eval dir) or print "No eval runs yet" — must NOT exit 1
expect(exitCode).not.toBe(1);
expect(stderr).not.toContain('--limit must');
});
});