mirror of
https://github.com/garrytan/gstack.git
synced 2026-10-31 14:06:50 +01:00
fix: pre-landing review fixes (Git Bash path for the preflight probe; empty-source control)
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
b10259048b
commit
f28fbdffb9
2 files changed
+7
-3
No files matched your search
@@ -25,8 +25,11 @@ type Scenario = { kind: string; table?: string; exitReason?: string; open?: bool
|
|||||||
// Run the copied section's real Outside Voice preflight against a state root.
|
// Run the copied section's real Outside Voice preflight against a state root.
|
||||||
function outsideMode(section: string, home: string, gstackHome?: string): string {
|
function outsideMode(section: string, home: string, gstackHome?: string): string {
|
||||||
const block = section.slice(section.indexOf('**Preflight — decide whether and how the outside voice runs:**')).match(/```bash\n([\s\S]*?)```/)![1];
|
const block = section.slice(section.indexOf('**Preflight — decide whether and how the outside voice runs:**')).match(/```bash\n([\s\S]*?)```/)![1];
|
||||||
const child = Bun.spawnSync(['bash', '-c', block.replaceAll('"$HOME/.claude/skills/gstack/bin/gstack-config"', JSON.stringify(path.join(ROOT, 'bin/gstack-config')))], {
|
// Git Bash on Windows needs its own spelling of the checkout path.
|
||||||
env: { PATH: process.env.PATH ?? '', HOME: home, ...(gstackHome ? { GSTACK_HOME: gstackHome } : {}) }, timeout: 10_000 });
|
const bin = Bun.spawnSync(['bash', '-c', 'cd "$1" && pwd', '_', path.join(ROOT, 'bin')], { timeout: 10_000 }).stdout.toString().trim();
|
||||||
|
const child = Bun.spawnSync(['bash', '-c', block.replaceAll('"$HOME/.claude/skills/gstack/bin/gstack-config"', '"$GSTACK_CONFIG_BIN"')], {
|
||||||
|
env: { PATH: process.env.PATH ?? '', HOME: home, GSTACK_CONFIG_BIN: `${bin}/gstack-config`,
|
||||||
|
...(process.env.SystemRoot ? { SystemRoot: process.env.SystemRoot } : {}), ...(gstackHome ? { GSTACK_HOME: gstackHome } : {}) }, timeout: 10_000 });
|
||||||
return child.stdout.toString().trim();
|
return child.stdout.toString().trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -704,10 +704,11 @@ describe('errored Bash reads from the captured ignored-path review', () => {
|
|||||||
expect(hasTrustedSharedLibsCheck(events, erroredRead.expected)).toBe(true);
|
expect(hasTrustedSharedLibsCheck(events, erroredRead.expected)).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each(['no expected sources', 'last source line missing', 'missing file', 'errored single read', 'errored native Read', 'errored checker'])('%s is still rejected', shape => {
|
test.each(['no expected sources', 'empty expected source', 'last source line missing', 'missing file', 'errored single read', 'errored native Read', 'errored checker'])('%s is still rejected', shape => {
|
||||||
const events = structuredClone(erroredRead.events), call = read(events), result = output(events, call.id);
|
const events = structuredClone(erroredRead.events), call = read(events), result = output(events, call.id);
|
||||||
const expected: any = structuredClone(erroredRead.expected);
|
const expected: any = structuredClone(erroredRead.expected);
|
||||||
if (shape === 'no expected sources') delete expected.sources;
|
if (shape === 'no expected sources') delete expected.sources;
|
||||||
|
if (shape === 'empty expected source') expected.sources['src/retry-worker.ts'] = '';
|
||||||
if (shape === 'last source line missing') result.content = result.content.replace(/\n +15\t\}\n/, '\n');
|
if (shape === 'last source line missing') result.content = result.content.replace(/\n +15\t\}\n/, '\n');
|
||||||
if (shape === 'missing file') result.content = 'Exit code 1\ncat: src/retry-worker.ts: No such file or directory';
|
if (shape === 'missing file') result.content = 'Exit code 1\ncat: src/retry-worker.ts: No such file or directory';
|
||||||
if (shape === 'errored single read') call.input.command = 'cat -n src/retry-worker.ts';
|
if (shape === 'errored single read') call.input.command = 'cat -n src/retry-worker.ts';
|
||||||
|
|||||||
Reference in new issue
Block a user