mirror of
https://github.com/garrytan/gstack.git
synced 2026-09-10 06:58:59 +02:00
test+docs: codex probe cache invalidation coverage, make-pdf --no-* structural pin, file the review-batch deferrals
- test/codex-model-probe.test.ts: the 1h TTL and the auth.json half of the mtime signature had no coverage — a regression in either would silently serve a stale MODEL_OK after re-login or forever. Added TTL-expiry (backdated cache line re-probes) and auth.json-mtime invalidation cases, mirroring the existing config.toml case. - make-pdf/test/cli-args.test.ts: structural assertion derived from the commands.ts registry — every --no-* flag must be in BOOLEAN_FLAGS, so a new negation flag can't silently re-open #2514 (swallowing the next positional). - TODOS.md: filed five review-batch deferrals under the v1.67 queue with rationale and effort: setup host-function dedup, cmd.exe %VAR% quoting in gbrainInvocation (cross-spawn direction), make-pdf flag registry metadata (derive BOOLEAN_FLAGS), legacy codex/factory/kiro uninstall provenance gating (parity with the cursor gate), and cursor auto-detect breadth (product call). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
594ecf818d
commit
084e2edbb8
@@ -9,6 +9,7 @@ import { describe, test, expect } from "bun:test";
|
||||
import * as fs from "fs";
|
||||
import * as path from "path";
|
||||
import { parseArgs, BOOLEAN_FLAGS } from "../src/cli";
|
||||
import { COMMANDS } from "../src/commands";
|
||||
|
||||
// parseArgs slices argv from index 2 (node/bun + script path).
|
||||
const parse = (...args: string[]) => parseArgs(["bun", "cli.ts", ...args]);
|
||||
@@ -75,4 +76,19 @@ describe("#2514 boolean flags do not swallow positionals", () => {
|
||||
expect(b.flags.confidential).toBe(true);
|
||||
expect(b.positional).toEqual(["memo.md"]);
|
||||
});
|
||||
|
||||
test("structural (T4): every --no-* flag in the commands.ts registry is boolean", () => {
|
||||
// A --no-* flag is a negation — it never takes a value. A new one added
|
||||
// to the registry but missed in BOOLEAN_FLAGS silently re-opens #2514
|
||||
// (it would swallow the next positional). Derived from the registry, so
|
||||
// this cannot rot as commands grow.
|
||||
const missing: string[] = [];
|
||||
for (const [cmd, spec] of COMMANDS) {
|
||||
for (const flag of spec.flags ?? []) {
|
||||
if (!/^--no-/.test(flag)) continue;
|
||||
if (!BOOLEAN_FLAGS.has(flag.replace(/^--/, ""))) missing.push(`${cmd}: ${flag}`);
|
||||
}
|
||||
}
|
||||
expect(missing).toEqual([]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user