feat(qa): helpers answer --help, and the QA eval interfaces declare it

Approved by Garry: asking gstack-qa-evidence or gstack-qa-deadline for usage
is read-only, so both helpers print usage and exit 0 on --help (the evidence
usage now names the annotation shape), and the functional and caller command
allowlists accept exactly 'bun <path>/bin/gstack-qa-{evidence,deadline} --help'.
Two CI runs failed only on that call.
This commit is contained in:
garrytan committed 2026-09-30 19:14:59 +00:00
1 parent 4643cb8550
commit ee929ff710
5 files changed
+37 -3

No files matched your search

+2 -1
View File
@@ -11,7 +11,7 @@ import { runSkillTest, SESSION_DRAIN_GRACE_MS } from './session-runner';
import { CAPTURE_MS } from './eval-budgets';
import { refreshHermeticSkillRuntime } from './hermetic-skill-runtime';
import { seedHermeticGstackHome } from './hermetic-env';
import { observeQAWrites, type QAWriteObservation } from './qa-functional-observer';
import { observeQAWrites, qaHelperUsageCommand, type QAWriteObservation } from './qa-functional-observer';
import { nativeCalls, readQACheckpointFiles, validateQACheckpoints } from './qa-checkpoint-evidence';
import { ownedPath } from './qa-functional-fixture';
import { qaEvidenceCommand, qaNativeCapture, qaProducerReceipt, type QaEvidenceContext } from './qa-evidence-producer';
@@ -214,6 +214,7 @@ function callerDeadlineCommand(command: string, context?: CallerDeadlineContext)
export function qaCallerCommandAllowed(command: string, workflowCommands: string[] = [], deadline?: CallerDeadlineContext): boolean {
const text = command.trim();
if (qaHelperUsageCommand(text)) return true;
if (callerEvidenceCommand(text, deadline)) return true;
if (callerDeadlineCommand(text, deadline)) return true;
if (/\bgstack-qa-(?:deadline|evidence)\b/.test(text) && !literalCallerCLI.test(text)
+6
View File
@@ -281,7 +281,13 @@ export function qaWriteVerdict(observation: QAWriteObservation, mode: QAMode): s
return failures;
}
/** 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());
}
export function qaCommandAllowed(command: string, root?: string): boolean {
if (qaHelperUsageCommand(command)) return true;
const producer = root ? qaEvidenceCommand(command, { cwd: root, reportRoot: path.join(root, 'qa-reports'), executable: path.join(root, 'bin/gstack-qa-evidence') }) : undefined;
if (producer) {
try { ownedPath(root!, 'bin/gstack-qa-evidence'); } catch { return false; }