refactor: simplify pass (trekexecute)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kjell Tore Guttormsen 2026-10-29 00:18:29 +01:00
commit 7cb038cce3
Signed by: ktg
SSH key fingerprint: SHA256:JakMjO6FTBBzN0Bhfj9saOoEjaFxlSdYuZQQpM/lF9Q
2 changed files with 3 additions and 8 deletions

View file

@ -353,11 +353,7 @@ function argsShellOpeners(text) {
if (k !== second + 1) unreadable = true;
k = skip(k + 1);
}
while (k < n) {
if (text[k] === ' ' || text[k] === '\t') k += 1;
else if (text[k] === '\\' && text[k + 1] === '\n') k += 2;
else break;
}
while (text[k] === ' ' || text[k] === '\t') k = skip(k + 1);
const start = k;
let word = '';
let quoted = false;

View file

@ -35,6 +35,7 @@ async function expectArgsBlocked(command) {
const { code, stderr } = await runHook(PRE_BASH, bashInput(command));
assert.match(stderr, ARGS_RULE, `the guard did not name args-heredoc-closed-early for: ${JSON.stringify(command)}`);
assert.strictEqual(code, 2, `the guard did not block: ${JSON.stringify(command)}`);
return stderr;
}
async function expectArgsAllowed(command) {
@ -47,9 +48,7 @@ async function expectArgsAllowed(command) {
const UNQUOTED = /opens VOYAGE_ARGS_EOF_7F3C9E unquoted/;
async function expectUnquoted(command) {
const { code, stderr } = await runHook(PRE_BASH, bashInput(command));
assert.match(stderr, ARGS_RULE, `the guard did not name args-heredoc-closed-early for: ${JSON.stringify(command)}`);
assert.strictEqual(code, 2, `the guard did not block: ${JSON.stringify(command)}`);
const stderr = await expectArgsBlocked(command);
assert.match(stderr, UNQUOTED, `the guard did not give the unquoted reason for: ${JSON.stringify(command)}`);
}