mirror of
https://github.com/garrytan/gstack.git
synced 2026-10-05 10:57:15 +02:00
v1.91.7.0 feat: add functional QA and pre-publication docs checks (#2983)
* feat: add surface-aware exploratory QA and ship documentation gates * test: preserve delegated QA setup authority after main integration * fix(qa): clarify exploration order and preserve report artifacts * test(qa): follow the shared setup reference directly * refactor(ship): make verification and recovery routes explicit * test(ship): align evidence and review guards with explicit routes * fix(workflows): clarify ship recovery and functional QA evidence * fix(workflows): clarify approval recovery and full QA coverage * refactor(workflows): order review transactions and clarify ship state * fix(ship): clarify final verification and fail closed at publication * fix(evals): attribute native atomic documentation writes * fix(ship): clarify recovery and documentation lifecycle guidance * fix(test): preserve observed native placeholder styling in CI * fix(codex): report watchdog timeouts without a process-exit race * Checkpoint functional QA implementation and workflow validation repairs * Fix documentation and shared-review fixture contracts * docs: clarify judge reuse and evaluation supervision * test: align review evidence and selected case contracts * test: verify append-only documentation checkpoints and recovery * fix: qualify QA workflows and CI validation repairs * fix: launch shared-libs fixture scripts on Windows * fix: qualify QA deadlines, fixture isolation, and shard cleanup * fix: preserve qualified QA and cancellation repairs * fix: enforce functional fixture authority and share strict event decoding * fix: retain free-test evidence and explain recovery * fix: reject malformed native evidence after decoder consolidation * test: use reliable capture for telemetry privacy filters * test: refresh measured quick coverage and document validation costs * Fix native fixture receipts and preserve VM validation evidence * Align negative judge controls with upstream clarity policy * Fix report-only QA preparation and public evidence handling * Clarify QA-only preparation and current-report preservation * Stream Ship quality judgments with an explicit 64k response contract * Validate compact judge reasoning locally with supported wire schema * Align functional QA fixture instructions with evidence acceptance * Bind native browser diagnostics to execution evidence and align review verdicts * Preserve native diagnostic line boundaries * Serialize functional QA evidence from native captures * Keep large QA evidence fixture payload out of Windows argv
This commit is contained in:
1 parent
65bfb0ce49
commit
dcaea52800
333 files changed
+41755
-7357
No files matched your search
+43
-14
@@ -44,13 +44,16 @@ export interface PtyScreenFrame {
|
||||
|
||||
export interface PtyScreen {
|
||||
write(text: string): void;
|
||||
read(): Promise<string>;
|
||||
readFrame(): Promise<PtyScreenFrame>;
|
||||
read(deadlineAt?: number): Promise<string>;
|
||||
readFrame(deadlineAt?: number): Promise<PtyScreenFrame>;
|
||||
dispose(): Promise<void>;
|
||||
}
|
||||
|
||||
/** One terminal per session; read only the actual viewport, never scrollback. */
|
||||
export async function createPtyScreen(cols: number, rows: number): Promise<PtyScreen> {
|
||||
export async function createPtyScreen(cols: number, rows: number,
|
||||
options: { deadlineAt?: number; signal?: AbortSignal } = {}): Promise<PtyScreen> {
|
||||
const deadlineAt = options.deadlineAt ?? performance.now() + 5_000;
|
||||
if (!Number.isFinite(deadlineAt)) throw new RangeError('PTY screen requires a finite absolute deadline.');
|
||||
const Terminal = await loadTerminal();
|
||||
const terminal = new Terminal({ cols, rows, scrollback: 0, allowProposedApi: true });
|
||||
// Match current CLI scalar column widths instead of xterm5's Unicode 6
|
||||
@@ -70,10 +73,31 @@ export async function createPtyScreen(cols: number, rows: number): Promise<PtySc
|
||||
let final: PtyScreenFrame | undefined;
|
||||
let closing: Promise<void> | undefined;
|
||||
const waiting = new Set<() => void>();
|
||||
const settled = () => { if (pending === 0) { for (const done of waiting) done(); waiting.clear(); } };
|
||||
const drain = async () => {
|
||||
while (pending > 0) await new Promise<void>(resolve => waiting.add(resolve));
|
||||
if (failure) throw new Error('PTY screen parse failed.', { cause: failure });
|
||||
const settled = () => { if (pending === 0 || failure) { for (const done of waiting) done(); waiting.clear(); } };
|
||||
const fail = (error: unknown) => {
|
||||
failure ??= new Error('PTY screen parse failed; viewport is incomplete.', { cause: error });
|
||||
settled();
|
||||
};
|
||||
const drain = async (readDeadline = deadlineAt) => {
|
||||
if (!Number.isFinite(readDeadline)) throw new RangeError('PTY screen requires a finite absolute deadline.');
|
||||
while (pending > 0 && !failure) {
|
||||
if (options.signal?.aborted) { fail(options.signal.reason); break; }
|
||||
const remaining = Math.min(deadlineAt, readDeadline) - performance.now();
|
||||
if (remaining <= 0) { fail(new Error('PTY screen write callback deadline exceeded.')); break; }
|
||||
await new Promise<void>(resolve => {
|
||||
const done = () => {
|
||||
clearTimeout(timer);
|
||||
options.signal?.removeEventListener('abort', abort);
|
||||
waiting.delete(done);
|
||||
resolve();
|
||||
};
|
||||
const abort = () => fail(options.signal?.reason);
|
||||
const timer = setTimeout(() => fail(new Error('PTY screen write callback deadline exceeded.')), remaining);
|
||||
waiting.add(done);
|
||||
options.signal?.addEventListener('abort', abort, { once: true });
|
||||
});
|
||||
}
|
||||
if (failure) throw failure;
|
||||
};
|
||||
const viewport = () => {
|
||||
const buffer = terminal.buffer.active;
|
||||
@@ -94,9 +118,9 @@ export async function createPtyScreen(cols: number, rows: number): Promise<PtySc
|
||||
});
|
||||
return {text: lines.join('\n'), inputOffset, styledText};
|
||||
};
|
||||
const readFrame = async () => {
|
||||
const readFrame = async (readDeadline?: number) => {
|
||||
await drain(readDeadline);
|
||||
if (closing) { await closing; return final!; }
|
||||
await drain();
|
||||
return viewport();
|
||||
};
|
||||
return {
|
||||
@@ -105,17 +129,22 @@ export async function createPtyScreen(cols: number, rows: number): Promise<PtySc
|
||||
if (!text) return;
|
||||
pending++;
|
||||
inputOffset += text.length;
|
||||
try { terminal.write(text, () => { pending--; settled(); }); }
|
||||
catch (error) { failure = error; pending--; settled(); }
|
||||
let completed = false;
|
||||
const complete = () => { if (!completed) { completed = true; pending--; settled(); } };
|
||||
try { terminal.write(text, complete); }
|
||||
catch (error) { fail(error); complete(); }
|
||||
},
|
||||
async read() {
|
||||
return (await readFrame()).text;
|
||||
async read(readDeadline) {
|
||||
return (await readFrame(readDeadline)).text;
|
||||
},
|
||||
readFrame,
|
||||
dispose() {
|
||||
return closing ??= (async () => {
|
||||
try { await drain(); final = viewport(); }
|
||||
finally { terminal.dispose(); }
|
||||
finally {
|
||||
try { terminal.dispose(); }
|
||||
catch (error) { if (!failure) throw error; }
|
||||
}
|
||||
})();
|
||||
},
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user