test: a bare QA helper invocation is a usage probe, like --help (CI run ship-exploratory-unavailable)

This commit is contained in:
garrytan committed 2026-10-03 05:30:21 +00:00
1 parent 0c06a743a8
commit 5773a8fcad
2 files changed
+3 -1

No files matched your search

+1 -1
View File
@@ -285,7 +285,7 @@ export function qaWriteVerdict(observation: QAWriteObservation, mode: QAMode): s
/** Asking an installed gstack QA helper for its own usage text is read-only and always declared. */
export function qaHelperUsageCommand(command: string): boolean {
return /^bun (?:[\w./-]+\/)?bin\/gstack-qa-(?:evidence|deadline) --help$/.test(command.trim());
return /^bun (?:[\w./-]+\/)?bin\/gstack-qa-(?:evidence|deadline)(?: --help)?$/.test(command.trim());
}
export function qaCommandAllowed(command: string, root?: string): boolean {
+2
View File
@@ -55,6 +55,8 @@ describe('QA command-observation boundary', () => {
test('admits native fixture commands and rejects unobserved shell effects', () => {
for (const command of ['date -u +%Y-%m-%dT%H:%M:%SZ', 'bun run probe -- apply credit 7junk', 'bun run probe -- apply UPPER 7', 'bun run probe -- apply 9bad 7', 'bun run probe -- apply', 'bun run probe -- apply credit', 'bun run probe -- apply credit 7 extra', 'bun run probe -- partial', 'bun test test/regression.test.ts', 'git status --short']) expect(qaCommandAllowed(command)).toBe(true);
for (const command of ['bun bin/gstack-qa-evidence', 'bun /abs/runtime/bin/gstack-qa-deadline', 'bun bin/gstack-qa-evidence --help']) expect(qaCommandAllowed(command), command).toBe(true);
for (const command of ['bun bin/gstack-qa-evidence capture', 'bun bin/gstack-qa-deadline start x 1', 'bun bin/gstack-qa-evidence; touch bad']) expect(qaCommandAllowed(command), command).toBe(false);
for (const command of ['date', 'date -u', 'date -u +%s', ' date -u +%Y-%m-%dT%H:%M:%SZ', 'date -u +%Y-%m-%dT%H:%M:%SZ ', 'date -u +%Y-%m-%dT%H:%M:%SZ --set tomorrow', 'python3 mutate-with-mmap.py', 'echo ok; git commit -am fix', 'bun test > result.txt', 'curl https://example.com', 'bun -e "42"', 'git stash', 'git reset --hard', 'bun run probe -- partial && true', 'bun run probe -- apply $(touch bad) 7', 'bun run probe -- apply * 7', 'bun run probe -- apply credit 7; touch bad']) expect(qaCommandAllowed(command)).toBe(false);
});
test('malformed event buffers cannot become empty successful observations', () => {