mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-18 22:24:17 +01:00
Merge main e85005482 (v1.93.27.0, train 94) into wave/review-53cfb5bfe011 (rule 19 grant)
Conflicts resolved keeping both sides: bin/gstack-review-dispatch (main's targetedRead record plus the wave's exclude digest on the rendered event); bin/gstack-ship-receipt (main's receiptTargetedAtHead and targetedClassesSince plus the wave's receiptReviewAtHead and receiptExclude; both help paragraphs); docs/troubleshooting.md (main's targeted-refusal fix plus the wave's review_exclude, REVIEW_DIFF_TOO_LARGE, REVIEW_DIFF_UNREADABLE and REVIEW_EXCLUDE_REFERENCE entries); ship/DRIVER.md.tmpl (main's line, DRIVER.md 12,241 B); test/review-packets-removed.test.ts (both replay lists, the wave's placeholder brief-body hashes under main's GST-986 test). test/review-targeted.test.ts follows main's DRIVER wording ([--review-targeted @<f>]), which main's own copy of that check in test/review-targeted-record.test.ts pins.
This commit is contained in:
commit
feeec2e760
74 files changed
+1618
-316
No files matched your search
@@ -92,6 +92,7 @@ export const FREE_FIXTURES: Readonly<Record<string, readonly string[]>> = {
|
||||
'test/fixtures/design-ui-focus-capture-40664336141.json': ['test/plan-design-with-ui-fixture.test.ts'],
|
||||
'test/fixtures/design-ui-focus-capture-41178131219.json': ['test/plan-design-with-ui-fixture.test.ts'],
|
||||
'test/fixtures/design-ui-focus-capture-41186376825.json': ['test/plan-design-with-ui-fixture.test.ts'],
|
||||
'test/fixtures/design-ui-focus-capture-41414111284.json': ['test/plan-design-with-ui-fixture.test.ts'],
|
||||
'test/fixtures/design-ui-focus-capture.json': ['test/plan-design-with-ui-fixture.test.ts'],
|
||||
'test/fixtures/detector-corpora/auto-decide-preserved/**': ['test/detector-corpus-auto-decide-preserved.test.ts'],
|
||||
'test/fixtures/detector-corpora/plan-ceo-section-loading/**': ['test/detector-corpus-plan-ceo-section-loading.test.ts'],
|
||||
|
||||
@@ -54,8 +54,9 @@ export function rebindGitDir(gitDir: string, from: string, to: string): void {
|
||||
|
||||
/**
|
||||
* Files and symlinks under dir (and the template's meta value) that still name templateRoot. Skipped: zlib-compressed object
|
||||
* storage, and the log Capy's /usr/bin/git shim appends to in whatever HOME it runs under (.capy/git-shim.log), which names
|
||||
* the template whenever a fixture home ran git during build; nothing reads it back.
|
||||
* storage, and every .capy directory: Capy's /usr/bin/git shim creates $HOME/.capy in whatever HOME it runs under and logs
|
||||
* there, so a fixture home that ran git during build holds the machine's writes, not gstack's (install-fixture's tree() skips
|
||||
* it for the same reason); nothing reads them back.
|
||||
*/
|
||||
export function templateReferences(dir: string, templateRoot: string, meta?: unknown): string[] {
|
||||
const needles = pathSpellings(templateRoot).map(s => Buffer.from(s));
|
||||
@@ -65,8 +66,8 @@ export function templateReferences(dir: string, templateRoot: string, meta?: unk
|
||||
for (const entry of fs.readdirSync(d, { withFileTypes: true })) {
|
||||
const p = path.join(d, entry.name);
|
||||
if (entry.isSymbolicLink()) { if (names(Buffer.from(fs.readlinkSync(p)))) hits.push(p); }
|
||||
else if (entry.isDirectory()) { if (!(path.basename(d) === 'objects' && /^(pack|[0-9a-f]{2})$/.test(entry.name))) walk(p); }
|
||||
else if (entry.isFile() && !(entry.name === 'git-shim.log' && path.basename(d) === '.capy') && names(fs.readFileSync(p))) hits.push(p);
|
||||
else if (entry.isDirectory()) { if (entry.name !== '.capy' && !(path.basename(d) === 'objects' && /^(pack|[0-9a-f]{2})$/.test(entry.name))) walk(p); }
|
||||
else if (entry.isFile() && names(fs.readFileSync(p))) hits.push(p);
|
||||
}
|
||||
};
|
||||
walk(dir);
|
||||
|
||||
@@ -61,10 +61,18 @@ const LATER_COOKIE_ORDER_EDITS: Array<[string, string]> = [
|
||||
["# view the page; only --verify-auth proves sign-in", "# confirm the intended account"],
|
||||
];
|
||||
|
||||
// The #3338 trust warning (GSTA-84) added one paragraph after step 3's goto
|
||||
// (two lines longer). Removing it first lets the GSTA-49 reversal match.
|
||||
const LATER_TRUST_PARAGRAPH = "Tell the user once, before the import: gstack's headless browser trusts the root store built into gstack's bundled Chromium, which still accepts certificates from the compromised eMudhra intermediates. Until gstack moves to a Playwright release that drops them, don't use the imported sessions on a network the user does not trust. That same root's `BROWSER.md`, **TLS trust: the bundled Chromium's root store**, has the details and the check.\n\n";
|
||||
|
||||
export function approvedCookieWorkflowSource(source: string): string {
|
||||
let removedLines = 0;
|
||||
let removedEntrypointLines = 0;
|
||||
let reordered = source;
|
||||
if (reordered.includes(LATER_TRUST_PARAGRAPH)) {
|
||||
removedEntrypointLines += LATER_TRUST_PARAGRAPH.split('\n').length - 1;
|
||||
reordered = reordered.replace(LATER_TRUST_PARAGRAPH, '');
|
||||
}
|
||||
for (const [later, earlier] of LATER_COOKIE_ORDER_EDITS) {
|
||||
if (!reordered.includes(later)) continue;
|
||||
removedEntrypointLines += later.split('\n').length - earlier.split('\n').length;
|
||||
|
||||
@@ -107,7 +107,7 @@ function fixtureRepoAt(root: string): FixtureRepo {
|
||||
const origin = path.join(root, 'origin.git');
|
||||
const work = path.join(root, 'work');
|
||||
const home = path.join(root, 'home');
|
||||
const env = { GSTACK_HOME: home, GSTACK_STATE_DIR: home, HOME: home, GIT_CONFIG_GLOBAL: path.join(root, 'gitconfig'), GIT_CONFIG_NOSYSTEM: '1' };
|
||||
const env = { GSTACK_STATE_ROOT: home, GSTACK_HOME: home, GSTACK_STATE_DIR: home, HOME: home, GIT_CONFIG_GLOBAL: path.join(root, 'gitconfig'), GIT_CONFIG_NOSYSTEM: '1' };
|
||||
const git = (...args: string[]): string => {
|
||||
const r = gitArgvIn(work, args, 30_000, { ...process.env, ...env });
|
||||
if (r.status !== 0) throw new Error(`git ${args.join(' ')} failed: status=${r.status} signal=${r.signal} error=${r.error?.message ?? ''} stderr=${r.stderr?.toString() ?? ''}`);
|
||||
|
||||
@@ -46,7 +46,7 @@ export function fixtureRepoAt(root: string): FixtureRepo {
|
||||
const origin = path.join(root, 'origin.git');
|
||||
const work = path.join(root, 'work');
|
||||
const home = path.join(root, 'home');
|
||||
const env = { GSTACK_HOME: home, GSTACK_STATE_DIR: home, HOME: home, GIT_CONFIG_GLOBAL: path.join(root, 'gitconfig'), GIT_CONFIG_NOSYSTEM: '1' };
|
||||
const env = { GSTACK_STATE_ROOT: home, GSTACK_HOME: home, GSTACK_STATE_DIR: home, HOME: home, GIT_CONFIG_GLOBAL: path.join(root, 'gitconfig'), GIT_CONFIG_NOSYSTEM: '1' };
|
||||
const git = (...args: string[]): string => {
|
||||
const r = gitArgvIn(work, args, 30_000, { ...process.env, ...env });
|
||||
if (r.status !== 0) throw new Error(`git ${args.join(' ')} failed: ${r.stderr?.toString()}`);
|
||||
|
||||
@@ -99,7 +99,7 @@ export async function capture(change: string, prepared?: PathEligibilityFixture,
|
||||
branch: fixtureGit(f, 'symbolic-ref', '--quiet', '--short', 'HEAD'), wtree: fixtureWorkingTree(f),
|
||||
startedAt: receipt.review_start.started_at, finding: current, reusable: change === 'unchanged',
|
||||
coveredPaths: receipt.snapshot.covered_paths,
|
||||
...(prepared ? { sources: Object.fromEntries(current!.evidence_paths.map((file: string) => [file, fs.readFileSync(path.join(f.repo, file), 'utf8')])) } : {}) };
|
||||
sources: Object.fromEntries(current!.evidence_paths.map((file: string) => [file, fs.readFileSync(path.join(f.repo, file), 'utf8')])) };
|
||||
return { f, current, token, receipt, events, checkAt, finishAt, expected, prepared, resumed, prerequisites, ...(declared ? { questions } : {}) };
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user