mirror of
https://github.com/garrytan/gstack.git
synced 2026-10-11 21:49:00 +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
@@ -3,6 +3,7 @@ import { describe, expect, test } from 'bun:test';
|
||||
import * as fs from 'node:fs';
|
||||
import * as os from 'node:os';
|
||||
import * as path from 'node:path';
|
||||
import { runFreeShard } from '../scripts/test-free-shards';
|
||||
|
||||
const ROOT = path.resolve(import.meta.dir, '..');
|
||||
const SUMMARY = 'Ran 3 tests across 1 files. [12.00ms]';
|
||||
@@ -40,6 +41,72 @@ function runCapture(mode: Mode, exitCode = 0) {
|
||||
}
|
||||
|
||||
describe('free shard capture integrity', () => {
|
||||
test('an unavailable evidence log fails despite a successful child and complete summary', async () => {
|
||||
const fixture = fs.mkdtempSync(path.join(os.tmpdir(), 'free-log-failure-'));
|
||||
const diagnostics: string[] = [];
|
||||
try {
|
||||
const outcome = await runFreeShard(['test/log-fixture.test.ts'], 1, 1, {
|
||||
rootDir: fixture, quiet: true, log: line => diagnostics.push(line),
|
||||
logFilePath: path.join(fixture, 'missing', 'capture.log'),
|
||||
commandFor: () => ({ command: process.execPath,
|
||||
args: ['-e', 'console.error("test/log-fixture.test.ts:\\n(pass) fixture\\n\\n 1 pass\\n 0 fail\\nRan 1 test across 1 file. [1.00ms]")'] }),
|
||||
});
|
||||
expect(outcome.exitCode).toBe(0);
|
||||
expect(outcome.status).toBe('failed');
|
||||
expect(outcome.unattributedFailures).toBeGreaterThan(0);
|
||||
expect(diagnostics.some(line => /log.*retained.*repair/i.test(line))).toBe(true);
|
||||
expect(diagnostics.some(line => line.includes('docs/TESTING_INTERNALS.md'))).toBe(true);
|
||||
expect(diagnostics.some(line => line.includes('focused check:'))).toBe(false);
|
||||
} finally {
|
||||
fs.rmSync(fixture, { recursive: true, force: true });
|
||||
}
|
||||
}, 10000);
|
||||
|
||||
test('default evidence survives shard cleanup with private modes and actionable failure recovery', async () => {
|
||||
const fixture = fs.realpathSync(fs.mkdtempSync(path.join(os.tmpdir(), 'free-log-retained-')));
|
||||
const diagnostics: string[] = [];
|
||||
const failure = '(fa' + 'il) fixture [0.10ms]';
|
||||
fs.writeFileSync(path.join(fixture, 'failure.test.ts'), '');
|
||||
try {
|
||||
const outcome = await runFreeShard(['failure.test.ts'], 1, 1, {
|
||||
rootDir: fixture, quiet: true, log: line => diagnostics.push(line),
|
||||
commandFor: () => ({ command: process.execPath,
|
||||
args: ['-e', `console.error(${JSON.stringify(`failure.test.ts:\n${failure}\n\n 0 pass\n 1 fail\nRan 1 test across 1 file. [1.00ms]`)});process.exit(1)`] }),
|
||||
});
|
||||
expect(outcome.status).toBe('failed');
|
||||
const directory = path.join(fixture, '.context/free-test-logs');
|
||||
if (process.platform !== 'win32') expect(fs.statSync(directory).mode & 0o777).toBe(0o700);
|
||||
const logs = fs.readdirSync(directory);
|
||||
expect(logs).toHaveLength(1);
|
||||
const file = path.join(directory, logs[0]);
|
||||
if (process.platform !== 'win32') expect(fs.statSync(file).mode & 0o777).toBe(0o600);
|
||||
expect(fs.readFileSync(file, 'utf8')).toContain(failure);
|
||||
expect(diagnostics.some(line => line.includes('root cause is not established'))).toBe(true);
|
||||
expect(diagnostics.some(line => line.includes("bun test 'failure.test.ts'"))).toBe(true);
|
||||
} finally {
|
||||
fs.rmSync(fixture, { recursive: true, force: true });
|
||||
}
|
||||
}, 10000);
|
||||
|
||||
test('default log ownership rejects a redirected context before launching a child', async () => {
|
||||
const fixture = fs.realpathSync(fs.mkdtempSync(path.join(os.tmpdir(), 'free-log-link-')));
|
||||
const root = path.join(fixture, 'repo');
|
||||
const outside = path.join(fixture, 'outside');
|
||||
fs.mkdirSync(root);
|
||||
fs.mkdirSync(outside);
|
||||
fs.symlinkSync(outside, path.join(root, '.context'), process.platform === 'win32' ? 'junction' : 'dir');
|
||||
let launched = false;
|
||||
try {
|
||||
await expect(runFreeShard(['fixture.test.ts'], 1, 1, { rootDir: root, quiet: true, log: () => {},
|
||||
commandFor: () => { launched = true; return { command: process.execPath, args: ['--version'] }; },
|
||||
})).rejects.toThrow();
|
||||
expect(launched).toBe(false);
|
||||
expect(fs.readdirSync(outside)).toEqual([]);
|
||||
} finally {
|
||||
fs.rmSync(fixture, { recursive: true, force: true });
|
||||
}
|
||||
});
|
||||
|
||||
test('normal end followed by close preserves complete capture and passes', () => {
|
||||
const result = runCapture('clean');
|
||||
expect(result.outcome.status).toBe('passed');
|
||||
|
||||
Reference in new issue
Block a user