@sabaiway/agent-workflow-kit 23.3.1 → 23.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/README.md +1 -1
- package/SKILL.md +1 -1
- package/bridges/antigravity-cli-bridge/SKILL.md +2 -2
- package/bridges/antigravity-cli-bridge/bin/agy-review-harness.test.mjs +7 -1
- package/bridges/antigravity-cli-bridge/bin/agy-review-honesty.test.mjs +2 -1
- package/bridges/antigravity-cli-bridge/bin/agy-review-model-screen.test.mjs +2 -1
- package/bridges/antigravity-cli-bridge/bin/agy-review.sh +18 -10
- package/bridges/antigravity-cli-bridge/bin/agy-review.test.mjs +50 -50
- package/bridges/antigravity-cli-bridge/bin/agy.sh +6 -2
- package/bridges/antigravity-cli-bridge/bin/agy.test.mjs +5 -5
- package/bridges/antigravity-cli-bridge/capability.json +2 -2
- package/bridges/antigravity-cli-bridge/references/models-and-flags.md +1 -1
- package/bridges/antigravity-cli-bridge/setup/README.md +1 -1
- package/bridges/codex-cli-bridge/SKILL.md +1 -1
- package/bridges/codex-cli-bridge/bin/codex-exec-jev.test.mjs +73 -93
- package/bridges/codex-cli-bridge/bin/codex-exec.sh +7 -3
- package/bridges/codex-cli-bridge/bin/codex-exec.test.mjs +6 -10
- package/bridges/codex-cli-bridge/bin/codex-fixtures-harness.test.mjs +77 -0
- package/bridges/codex-cli-bridge/bin/codex-fixtures.test.mjs +215 -0
- package/bridges/codex-cli-bridge/bin/codex-model-posture.test.mjs +18 -18
- package/bridges/codex-cli-bridge/bin/codex-review-honesty.test.mjs +2 -1
- package/bridges/codex-cli-bridge/bin/codex-review-jev.test.mjs +13 -13
- package/bridges/codex-cli-bridge/bin/codex-review.sh +17 -10
- package/bridges/codex-cli-bridge/bin/codex-review.test.mjs +30 -29
- package/bridges/codex-cli-bridge/capability.json +1 -1
- package/bridges/typesafe-jev-bridge/SKILL.md +19 -12
- package/bridges/typesafe-jev-bridge/bin/jev-ask-harness.test.mjs +109 -0
- package/bridges/typesafe-jev-bridge/bin/jev-ask.sh +9 -4
- package/bridges/typesafe-jev-bridge/bin/jev-ask.test.mjs +108 -104
- package/bridges/typesafe-jev-bridge/bin/jev-client.mjs +27 -13
- package/bridges/typesafe-jev-bridge/capability.json +11 -1
- package/capability.json +1 -1
- package/package.json +1 -1
- package/references/modes/bridge-settings.md +6 -5
- package/tools/bridge-settings-read.mjs +8 -3
- package/tools/bridge-settings.mjs +28 -43
- package/tools/detect-backends.mjs +1 -1
- package/tools/manifest/schema.md +4 -1
- package/tools/manifest/validate.mjs +10 -0
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { it } from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { existsSync, lstatSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, readlinkSync, realpathSync, rmSync, symlinkSync, writeFileSync } from 'node:fs';
|
|
4
|
+
import { tmpdir } from 'node:os';
|
|
5
|
+
import { dirname, isAbsolute, join, relative } from 'node:path';
|
|
6
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
7
|
+
import { spawn, spawnSync } from 'node:child_process';
|
|
8
|
+
import { setTimeout as delay } from 'node:timers/promises';
|
|
9
|
+
|
|
10
|
+
const HARNESS = new URL('./codex-fixtures-harness.test.mjs', import.meta.url).href;
|
|
11
|
+
const HERE = dirname(fileURLToPath(import.meta.url));
|
|
12
|
+
const WAIT_MS = 10_000;
|
|
13
|
+
const POLL_MS = 20;
|
|
14
|
+
const CHILDREN = new Map();
|
|
15
|
+
const stripGitLocationEnv = (env) => Object.fromEntries(Object.entries(env).filter(([key]) => !/^[Gg][Ii][Tt]_/.test(key)));
|
|
16
|
+
const childEnv = (home, env = process.env) => ({
|
|
17
|
+
...Object.fromEntries(Object.entries(stripGitLocationEnv(env)).filter(([key]) => key !== 'NODE_TEST_CONTEXT')),
|
|
18
|
+
HOME: home, XDG_CONFIG_HOME: join(home, '.config'), GIT_CONFIG_GLOBAL: '/dev/null', GIT_CONFIG_SYSTEM: '/dev/null',
|
|
19
|
+
GIT_CONFIG_NOSYSTEM: '1', GIT_ATTR_NOSYSTEM: '1', LC_ALL: 'C',
|
|
20
|
+
});
|
|
21
|
+
const isInside = (parent, path) => {
|
|
22
|
+
const suffix = relative(parent, path);
|
|
23
|
+
return suffix === '' || (suffix !== '..' && !suffix.startsWith(`..${process.platform === 'win32' ? '\\' : '/'}`) && !isAbsolute(suffix));
|
|
24
|
+
};
|
|
25
|
+
const makeOwnedFolder = (test, parent = tmpdir()) => {
|
|
26
|
+
const folder = realpathSync(mkdtempSync(join(parent, 'codex-fixtures-')));
|
|
27
|
+
CHILDREN.set(folder, []);
|
|
28
|
+
test.after(async () => {
|
|
29
|
+
try { await Promise.all(CHILDREN.get(folder).map((stop) => stop())); }
|
|
30
|
+
finally { CHILDREN.delete(folder); rmSync(folder, { recursive: true, force: true }); }
|
|
31
|
+
});
|
|
32
|
+
return folder;
|
|
33
|
+
};
|
|
34
|
+
const takeSnapshot = (folder) => ['', ...readdirSync(folder, { recursive: true })].sort().map((name) => {
|
|
35
|
+
const path = join(folder, name);
|
|
36
|
+
const stats = lstatSync(path);
|
|
37
|
+
return { name, mode: stats.mode, mtime: stats.mtimeMs,
|
|
38
|
+
content: stats.isFile() ? readFileSync(path, 'base64') : stats.isSymbolicLink() ? readlinkSync(path) : null };
|
|
39
|
+
});
|
|
40
|
+
const makeCheckout = (makeFixtureRepo, folder, options = {}) => {
|
|
41
|
+
const top = join(folder, 'checkout');
|
|
42
|
+
for (const path of ['codex-cli-bridge/bin', 'agent-workflow-kit/bridges/codex-cli-bridge/bin', 'pkg-a/inner', 'scripts/release']) {
|
|
43
|
+
mkdirSync(join(top, path), { recursive: true });
|
|
44
|
+
}
|
|
45
|
+
writeFileSync(join(top, 'scripts/release/version-sync.mjs'), "export const FAMILY_DIRS = Object.freeze(['pkg-a', 'codex-cli-bridge', 'agent-workflow-kit']);\n");
|
|
46
|
+
if (!options.noSync) writeFileSync(join(top, 'scripts/sync-mirrors.mjs'), '');
|
|
47
|
+
writeFileSync(join(top, '.gitignore'), options.unignored ? '' : '.test-repos/\n');
|
|
48
|
+
const run = (args) => {
|
|
49
|
+
const result = spawnSync('git', ['-c', 'user.name=coder-tool', '-c', 'user.email=coder-tools@proton.me', ...args], {
|
|
50
|
+
cwd: top, env: childEnv(folder), encoding: 'utf8', timeout: WAIT_MS,
|
|
51
|
+
});
|
|
52
|
+
assert.ifError(result.error);
|
|
53
|
+
assert.equal(result.signal, null);
|
|
54
|
+
assert.equal(result.status, 0, result.stderr);
|
|
55
|
+
return result;
|
|
56
|
+
};
|
|
57
|
+
makeFixtureRepo(run, top);
|
|
58
|
+
return { top: realpathSync(top), root: join(realpathSync(top), '.test-repos'), here: join(top, 'codex-cli-bridge/bin') };
|
|
59
|
+
};
|
|
60
|
+
const startSuite = (folder, here, tmp, release = null) => {
|
|
61
|
+
const suiteFolder = mkdtempSync(join(folder, 'child-'));
|
|
62
|
+
const suite = join(suiteFolder, 'suite.mjs');
|
|
63
|
+
writeFileSync(suite, [
|
|
64
|
+
"import { it } from 'node:test'; import { existsSync } from 'node:fs'; import { setTimeout as delay } from 'node:timers/promises';",
|
|
65
|
+
`import { openSuiteScopes } from ${JSON.stringify(HARNESS)};`,
|
|
66
|
+
`const { repos, tmp } = await openSuiteScopes('pair', ${JSON.stringify({ here, tmp })});`,
|
|
67
|
+
'console.log(JSON.stringify({ repos, tmp }));',
|
|
68
|
+
`it('holds its scopes', async () => { const release = ${JSON.stringify(release)}; const deadline = Date.now() + ${WAIT_MS};`,
|
|
69
|
+
`while (release && !existsSync(release)) { if (Date.now() > deadline) throw new Error('release deadline'); await delay(${POLL_MS}); } });`,
|
|
70
|
+
].join('\n'));
|
|
71
|
+
const child = spawn(process.execPath, ['--test', suite], {
|
|
72
|
+
cwd: folder, env: childEnv(folder), stdio: ['ignore', 'pipe', 'pipe'], timeout: WAIT_MS * 2,
|
|
73
|
+
});
|
|
74
|
+
const output = [];
|
|
75
|
+
child.stdout.on('data', (chunk) => output.push(String(chunk)));
|
|
76
|
+
child.stderr.on('data', (chunk) => output.push(String(chunk)));
|
|
77
|
+
const done = new Promise((resolve, reject) => { child.once('error', reject); child.once('close', (code, signal) => resolve({ code, signal })); });
|
|
78
|
+
CHILDREN.get(folder).push(async () => { if (child.exitCode === null && child.signalCode === null) child.kill('SIGKILL'); await done; });
|
|
79
|
+
const report = async () => {
|
|
80
|
+
const deadline = Date.now() + WAIT_MS;
|
|
81
|
+
for (;;) {
|
|
82
|
+
const line = output.join('').split('\n').slice(0, -1).find((entry) => /^(?:# )?\{"repos":/.test(entry));
|
|
83
|
+
if (line) return JSON.parse(line.replace(/^# /, ''));
|
|
84
|
+
assert.ok(child.exitCode === null && child.signalCode === null && Date.now() < deadline, output.join(''));
|
|
85
|
+
await delay(POLL_MS);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
const finish = async () => { assert.deepEqual(await done, { code: 0, signal: null }, output.join('')); };
|
|
89
|
+
return { report, finish };
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
it('spec:fixture-isolation/S1', async (test) => {
|
|
93
|
+
const { makeFixtureRepo, resolveTestReposRoot } = await import('./codex-fixtures-harness.test.mjs');
|
|
94
|
+
const folder = makeOwnedFolder(test);
|
|
95
|
+
const fixture = makeCheckout(makeFixtureRepo, folder);
|
|
96
|
+
mkdirSync(join(folder, 'tmp'));
|
|
97
|
+
const tmp = realpathSync(join(folder, 'tmp'));
|
|
98
|
+
assert.equal(existsSync(fixture.root), false);
|
|
99
|
+
const first = startSuite(folder, fixture.here, tmp);
|
|
100
|
+
const scopes = await first.report();
|
|
101
|
+
assert.equal(dirname(scopes.repos), fixture.root);
|
|
102
|
+
assert.ok(relative(fixture.root, scopes.repos).startsWith('pair-'));
|
|
103
|
+
assert.equal(dirname(scopes.tmp), tmp);
|
|
104
|
+
await first.finish();
|
|
105
|
+
for (const path of [scopes.repos, scopes.tmp]) assert.equal(existsSync(path), false);
|
|
106
|
+
assert.ok(existsSync(fixture.root));
|
|
107
|
+
const release = join(folder, 'release');
|
|
108
|
+
const children = [startSuite(folder, fixture.here, tmp, release), startSuite(folder, fixture.here, tmp, release)];
|
|
109
|
+
const reports = await Promise.all(children.map((child) => child.report()));
|
|
110
|
+
assert.notEqual(reports[0].repos, reports[1].repos);
|
|
111
|
+
assert.notEqual(reports[0].tmp, reports[1].tmp);
|
|
112
|
+
for (const report of reports) for (const path of [report.repos, report.tmp]) assert.ok(existsSync(path));
|
|
113
|
+
writeFileSync(release, '');
|
|
114
|
+
await Promise.all(children.map((child) => child.finish()));
|
|
115
|
+
for (const report of reports) for (const path of [report.repos, report.tmp]) assert.equal(existsSync(path), false);
|
|
116
|
+
const mirrorHere = join(fixture.top, 'agent-workflow-kit/bridges/codex-cli-bridge/bin');
|
|
117
|
+
assert.deepEqual(await resolveTestReposRoot({ here: mirrorHere }), { top: fixture.top, root: fixture.root });
|
|
118
|
+
const mirror = startSuite(folder, mirrorHere, tmp);
|
|
119
|
+
const mirrorScopes = await mirror.report();
|
|
120
|
+
assert.equal(dirname(mirrorScopes.repos), fixture.root);
|
|
121
|
+
await mirror.finish();
|
|
122
|
+
for (const path of [mirrorScopes.repos, mirrorScopes.tmp]) assert.equal(existsSync(path), false);
|
|
123
|
+
assert.ok(existsSync(fixture.root));
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
it('spec:fixture-isolation/S2', async (test) => {
|
|
127
|
+
const { makeFixtureRepo, openSuiteScopes, judgeTestReposRoot, resolveTestReposRoot } = await import('./codex-fixtures-harness.test.mjs');
|
|
128
|
+
const messages = [];
|
|
129
|
+
for (const refusal of ['symlink', 'wrong-here', 'no-git', 'unignored', 'inside-tmp', 'no-sync']) {
|
|
130
|
+
const folder = makeOwnedFolder(test);
|
|
131
|
+
const fixture = makeCheckout(makeFixtureRepo, folder, { unignored: refusal === 'unignored', noSync: refusal === 'no-sync' });
|
|
132
|
+
const outside = join(folder, 'no-git');
|
|
133
|
+
mkdirSync(outside);
|
|
134
|
+
if (refusal === 'symlink') symlinkSync(join(fixture.top, 'pkg-a/inner'), fixture.root, 'dir');
|
|
135
|
+
const here = refusal === 'wrong-here' ? join(fixture.top, 'pkg-a/inner') : refusal === 'no-git' ? outside : fixture.here;
|
|
136
|
+
const tmp = refusal === 'inside-tmp' ? join(fixture.top, 'tmp') : join(folder, 'tmp');
|
|
137
|
+
mkdirSync(tmp);
|
|
138
|
+
const expected = { symlink: join(fixture.top, 'pkg-a'), 'wrong-here': here, 'no-git': here,
|
|
139
|
+
unignored: fixture.root, 'inside-tmp': realpathSync(tmp), 'no-sync': join(fixture.top, 'scripts/sync-mirrors.mjs') }[refusal];
|
|
140
|
+
const before = takeSnapshot(folder);
|
|
141
|
+
if (refusal === 'no-git') assert.equal(await resolveTestReposRoot({ here }), null);
|
|
142
|
+
await assert.rejects(() => openSuiteScopes('refused', { here, tmp }), (error) => {
|
|
143
|
+
assert.ok(error.message.includes(expected), `${refusal}: ${error.message}`);
|
|
144
|
+
messages.push(error.message);
|
|
145
|
+
return true;
|
|
146
|
+
});
|
|
147
|
+
assert.deepEqual(readdirSync(tmp), []);
|
|
148
|
+
assert.deepEqual(takeSnapshot(folder), before);
|
|
149
|
+
if (refusal !== 'symlink') assert.equal(existsSync(fixture.root), false);
|
|
150
|
+
}
|
|
151
|
+
assert.equal(new Set(messages).size, messages.length);
|
|
152
|
+
const folder = makeOwnedFolder(test);
|
|
153
|
+
const fixture = makeCheckout(makeFixtureRepo, folder);
|
|
154
|
+
const judged = await judgeTestReposRoot({ here: fixture.here, tmp: folder });
|
|
155
|
+
assert.deepEqual({ ok: judged.ok, top: judged.top, root: judged.root }, { ok: true, top: fixture.top, root: fixture.root });
|
|
156
|
+
const record = join(folder, 'calls');
|
|
157
|
+
const preload = join(folder, 'preload.mjs');
|
|
158
|
+
writeFileSync(record, '');
|
|
159
|
+
writeFileSync(preload, [
|
|
160
|
+
"import childProcess from 'node:child_process'; import { syncBuiltinESMExports } from 'node:module'; import { appendFileSync } from 'node:fs';",
|
|
161
|
+
"for (const name of ['spawn', 'spawnSync', 'execFile', 'execFileSync', 'exec', 'execSync', 'fork']) {",
|
|
162
|
+
`const original = childProcess[name]; childProcess[name] = (...args) => { appendFileSync(${JSON.stringify(record)}, name + '\\n'); return original(...args); }; }`,
|
|
163
|
+
'syncBuiltinESMExports();',
|
|
164
|
+
].join('\n'));
|
|
165
|
+
const before = takeSnapshot(folder);
|
|
166
|
+
const result = spawnSync(process.execPath, ['--import', pathToFileURL(preload).href, '--input-type=module', '--eval', `await import(${JSON.stringify(HARNESS)});`], {
|
|
167
|
+
cwd: fixture.here, env: childEnv(folder), encoding: 'utf8', timeout: WAIT_MS,
|
|
168
|
+
});
|
|
169
|
+
assert.ifError(result.error);
|
|
170
|
+
assert.equal(result.status, 0, result.stderr);
|
|
171
|
+
assert.equal(readFileSync(record, 'utf8'), '');
|
|
172
|
+
assert.deepEqual(takeSnapshot(folder), before);
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
it('spec:fixture-isolation/S3', async (test) => {
|
|
176
|
+
const { makeFixtureRepo, resolveTestReposRoot } = await import('./codex-fixtures-harness.test.mjs');
|
|
177
|
+
const folder = makeOwnedFolder(test);
|
|
178
|
+
const fixture = makeCheckout(makeFixtureRepo, folder);
|
|
179
|
+
const otherFolder = makeOwnedFolder(test);
|
|
180
|
+
const other = makeCheckout(makeFixtureRepo, otherFolder);
|
|
181
|
+
const env = childEnv(folder);
|
|
182
|
+
const polluted = { ...env, GIT_DIR: join(other.top, '.git'), GIT_WORK_TREE: other.top, GIT_COMMON_DIR: join(other.top, '.git'),
|
|
183
|
+
GIT_INDEX_FILE: join(other.top, '.git/index'), GIT_PREFIX: 'wrong/', GIT_CONFIG_PARAMETERS: 'invalid', GIT_EXEC_PATH: other.top,
|
|
184
|
+
gIt_dIr: join(other.top, '.git') };
|
|
185
|
+
const expected = { top: fixture.top, root: fixture.root };
|
|
186
|
+
assert.deepEqual(await resolveTestReposRoot({ here: fixture.here, env }), expected);
|
|
187
|
+
assert.deepEqual(await resolveTestReposRoot({ here: fixture.here, env: polluted }), expected);
|
|
188
|
+
const real = await resolveTestReposRoot({ env });
|
|
189
|
+
assert.ok(real);
|
|
190
|
+
assert.deepEqual(await resolveTestReposRoot({ env: polluted }), real);
|
|
191
|
+
assert.deepEqual(await resolveTestReposRoot({ here: HERE, env }), real);
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
it('spec:fixture-isolation/S4', async (test) => {
|
|
195
|
+
const { makeFixtureRepo, openSuiteScopes } = await import('./codex-fixtures-harness.test.mjs');
|
|
196
|
+
const slashTmp = realpathSync('/tmp');
|
|
197
|
+
await test.test('checkout under /tmp', async (cell) => {
|
|
198
|
+
if (!isInside(slashTmp, realpathSync(tmpdir()))) return cell.skip('os.tmpdir() is outside realpath /tmp');
|
|
199
|
+
const folder = makeOwnedFolder(cell);
|
|
200
|
+
const fixture = makeCheckout(makeFixtureRepo, folder);
|
|
201
|
+
const scopes = await openSuiteScopes('under-tmp', { here: fixture.here, tmp: folder });
|
|
202
|
+
assert.equal(typeof scopes.profileSkip, 'string');
|
|
203
|
+
assert.ok(scopes.profileSkip.includes('/tmp'));
|
|
204
|
+
assert.equal(isInside(scopes.tmp, fixture.top), false);
|
|
205
|
+
});
|
|
206
|
+
await test.test('checkout under host TMPDIR outside /tmp', async (cell) => {
|
|
207
|
+
const host = await openSuiteScopes('codex-fixtures');
|
|
208
|
+
if (isInside(slashTmp, realpathSync(host.repos))) return cell.skip('real checkout test-repos subroot lies under /tmp');
|
|
209
|
+
const folder = makeOwnedFolder(cell, host.repos);
|
|
210
|
+
const fixture = makeCheckout(makeFixtureRepo, folder);
|
|
211
|
+
const scopes = await openSuiteScopes('outside-tmp', { here: fixture.here, tmp: folder });
|
|
212
|
+
assert.equal(scopes.profileSkip, false);
|
|
213
|
+
assert.equal(isInside(scopes.tmp, fixture.top), false);
|
|
214
|
+
});
|
|
215
|
+
});
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { describe, it
|
|
1
|
+
import { describe, it } from 'node:test';
|
|
2
2
|
import assert from 'node:assert/strict';
|
|
3
|
-
import { mkdtempSync, mkdirSync, writeFileSync,
|
|
3
|
+
import { mkdtempSync, mkdirSync, writeFileSync, readFileSync, existsSync, cpSync, readdirSync, symlinkSync } from 'node:fs';
|
|
4
4
|
import { join, dirname, resolve } from 'node:path';
|
|
5
5
|
import { fileURLToPath } from 'node:url';
|
|
6
6
|
import { spawnSync } from 'node:child_process';
|
|
7
|
+
import { makeFixtureRepo, openSuiteScopes } from './codex-fixtures-harness.test.mjs';
|
|
7
8
|
|
|
8
9
|
const HERE = dirname(fileURLToPath(import.meta.url));
|
|
9
10
|
const EXEC = join(HERE, 'codex-exec.sh');
|
|
@@ -53,20 +54,22 @@ const ALL = ['low', 'medium', 'high', 'xhigh'];
|
|
|
53
54
|
const STANDARD = { models: [entry('gpt-6.1-sol', 1, ALL, 'low'), entry('gpt-6-astra', 2, ALL), entry('gpt-6-luna', 3, ['low', 'medium', 'high'])] };
|
|
54
55
|
const HOST_SETTING = 'CODEX_MODEL=gpt-6-luna\nCODEX_EFFORT=medium\n';
|
|
55
56
|
|
|
56
|
-
|
|
57
|
-
const FIXTURES = join(HERE, '..', 'node_modules', '.aw-fixtures');
|
|
58
|
-
for (const dir of ['repos', 'tmp']) mkdirSync(join(FIXTURES, dir), { recursive: true });
|
|
59
|
-
const SHARED = mkdtempSync(join(FIXTURES, 'repos', 'codex-posture-'));
|
|
60
|
-
after(() => rmSync(SHARED, { recursive: true, force: true }));
|
|
57
|
+
const { repos, tmp, profileSkip } = await openSuiteScopes('codex-model-posture');
|
|
61
58
|
const TEMPLATE = (() => {
|
|
62
|
-
const home = join(
|
|
59
|
+
const home = join(tmp, 'template');
|
|
63
60
|
const repo = join(home, 'repo');
|
|
64
61
|
mkdirSync(join(home, 'bin'), { recursive: true });
|
|
65
62
|
mkdirSync(repo);
|
|
66
63
|
writeFileSync(join(home, 'bin', 'codex'), FAKE_CODEX, { mode: 0o755 });
|
|
67
64
|
writeFileSync(join(home, 'bin', 'uname'), FAKE_UNAME, { mode: 0o755 });
|
|
68
|
-
const git = (...args) =>
|
|
69
|
-
|
|
65
|
+
const git = (...args) => {
|
|
66
|
+
const env = Object.fromEntries(Object.entries(process.env).filter(([key]) => !/^[Gg][Ii][Tt]_/.test(key)));
|
|
67
|
+
const result = spawnSync('git', args, { cwd: repo, encoding: 'utf8', env });
|
|
68
|
+
assert.ifError(result.error);
|
|
69
|
+
assert.equal(result.signal, null, result.stderr);
|
|
70
|
+
assert.equal(result.status, 0, result.stderr);
|
|
71
|
+
};
|
|
72
|
+
makeFixtureRepo((args) => git(...args), repo, ['-q']);
|
|
70
73
|
git('config', 'user.email', 'probe@example.com');
|
|
71
74
|
git('config', 'user.name', 'probe');
|
|
72
75
|
writeFileSync(join(repo, 'AGENTS.md'), '# AGENTS\n\nHard Constraints: none (test fixture).\n');
|
|
@@ -75,10 +78,8 @@ const TEMPLATE = (() => {
|
|
|
75
78
|
writeFileSync(join(repo, 'plan.md'), '# a plan under review\n');
|
|
76
79
|
return home;
|
|
77
80
|
})();
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
const sandbox = ({ settings, catalog = STANDARD, catalogText, userCatalog, fakeTimeout = false } = {}) => {
|
|
81
|
-
const home = join(SHARED, `sb-${++sequence}`);
|
|
81
|
+
const sandbox = ({ settings, catalog = STANDARD, catalogText, userCatalog, fakeTimeout = false, root = tmp } = {}) => {
|
|
82
|
+
const home = mkdtempSync(join(root, 'sb-'));
|
|
82
83
|
cpSync(TEMPLATE, home, { recursive: true });
|
|
83
84
|
const sb = {
|
|
84
85
|
home, repo: join(home, 'repo'), bin: join(home, 'bin'), log: join(home, 'calls.log'),
|
|
@@ -94,12 +95,11 @@ const sandbox = ({ settings, catalog = STANDARD, catalogText, userCatalog, fakeT
|
|
|
94
95
|
if (fakeTimeout) writeFileSync(join(sb.bin, 'timeout'), FAKE_TIMEOUT, { mode: 0o755 });
|
|
95
96
|
return sb;
|
|
96
97
|
};
|
|
97
|
-
|
|
98
98
|
const drive = (sb, [wrapper, args], env = {}) => {
|
|
99
99
|
const r = spawnSync('bash', [wrapper, ...args], {
|
|
100
100
|
cwd: sb.repo, input: 'do the thing', encoding: 'utf8', timeout: 60000,
|
|
101
101
|
env: {
|
|
102
|
-
PATH: `${sb.bin}:${process.env.PATH}`, HOME: sb.home, TMPDIR:
|
|
102
|
+
PATH: `${sb.bin}:${process.env.PATH}`, HOME: sb.home, TMPDIR: tmp,
|
|
103
103
|
CODEX_FAKE_LOG: sb.log, CODEX_FAKE_CATALOG: sb.catalog, CODEX_FAKE_USER_CATALOG: sb.userCatalog, ...env,
|
|
104
104
|
},
|
|
105
105
|
});
|
|
@@ -138,8 +138,8 @@ const assertRefusedUnspent = (r) => {
|
|
|
138
138
|
};
|
|
139
139
|
|
|
140
140
|
describe('a fresh host runs the built-in default — spec:bridge-model/S1', () => {
|
|
141
|
-
it('codex-exec and codex-review run gpt-6.1-sol at effort high and the banner names source default', () => {
|
|
142
|
-
const exec = drive(sandbox(), FRESH_EXEC);
|
|
141
|
+
it('codex-exec and codex-review run gpt-6.1-sol at effort high and the banner names source default', { skip: profileSkip }, () => {
|
|
142
|
+
const exec = drive(sandbox({ root: repos }), FRESH_EXEC);
|
|
143
143
|
assertRan(exec, 'gpt-6.1-sol', 'high');
|
|
144
144
|
assert.equal(bannerOf(exec.stderr), 'exec posture: model=gpt-6.1-sol effort=high tier=standard sandbox=jev-profile session=fresh '
|
|
145
145
|
+ 'jev=api.typesafe.ai,docs.typesafe.ai source=model:default,effort:default timeout=3600s');
|
|
@@ -12,6 +12,7 @@ import { tmpdir } from 'node:os';
|
|
|
12
12
|
import { join, dirname, resolve } from 'node:path';
|
|
13
13
|
import { fileURLToPath } from 'node:url';
|
|
14
14
|
import { spawnSync } from 'node:child_process';
|
|
15
|
+
import { makeFixtureRepo } from './codex-fixtures-harness.test.mjs';
|
|
15
16
|
|
|
16
17
|
const HERE = dirname(fileURLToPath(import.meta.url));
|
|
17
18
|
const WRAPPER = join(HERE, 'codex-review.sh');
|
|
@@ -61,7 +62,7 @@ const TEMPLATE_ROOT = (() => {
|
|
|
61
62
|
const repo = join(root, 'repo');
|
|
62
63
|
mkdirSync(repo);
|
|
63
64
|
const g = (...args) => spawnSync('git', args, { cwd: repo, encoding: 'utf8' });
|
|
64
|
-
g(
|
|
65
|
+
makeFixtureRepo((args) => g(...args), repo, ['-q']);
|
|
65
66
|
g('config', 'user.email', 'probe@example.com');
|
|
66
67
|
g('config', 'user.name', 'probe');
|
|
67
68
|
writeFileSync(join(repo, 'AGENTS.md'), '# Hard Constraints\n');
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
// codex-review-jev.test.mjs — spec jev-every-run on codex-review: the key rule, the review profile (no write entry),
|
|
2
2
|
// the fallback, the loud failure on each attempt's own trace, the banner, the fence home's skill link and the
|
|
3
3
|
// directives. Standalone harness with its own fake codex and a fake uname.
|
|
4
|
-
import { describe, it
|
|
4
|
+
import { describe, it } from 'node:test';
|
|
5
5
|
import assert from 'node:assert/strict';
|
|
6
6
|
import { mkdirSync, mkdtempSync, writeFileSync, readFileSync, existsSync, rmSync, cpSync, chmodSync, realpathSync, symlinkSync } from 'node:fs';
|
|
7
7
|
import { join, dirname } from 'node:path';
|
|
8
8
|
import { fileURLToPath } from 'node:url';
|
|
9
9
|
import { spawnSync } from 'node:child_process';
|
|
10
|
+
import { makeFixtureRepo, openSuiteScopes } from './codex-fixtures-harness.test.mjs';
|
|
10
11
|
const stripGitLocationEnv = (env) => Object.fromEntries(Object.entries(env).filter(([key]) => !/^[Gg][Ii][Tt]_/.test(key)));
|
|
11
12
|
|
|
12
13
|
const HERE = dirname(fileURLToPath(import.meta.url));
|
|
@@ -14,13 +15,7 @@ const REVIEW = join(HERE, 'codex-review.sh');
|
|
|
14
15
|
const HOSTS = 'api.typesafe.ai,docs.typesafe.ai';
|
|
15
16
|
const childEnv = (home, env = {}) => ({ ...stripGitLocationEnv(env), HOME: home, XDG_CONFIG_HOME: join(home, '.config'),
|
|
16
17
|
GIT_CONFIG_GLOBAL: '/dev/null', GIT_CONFIG_SYSTEM: '/dev/null', GIT_CONFIG_NOSYSTEM: '1', GIT_ATTR_NOSYSTEM: '1', LC_ALL: 'C' });
|
|
17
|
-
|
|
18
|
-
const FIXTURES = join(HERE, '..', 'node_modules', '.aw-fixtures');
|
|
19
|
-
const TMP = join(FIXTURES, 'tmp');
|
|
20
|
-
mkdirSync(TMP, { recursive: true });
|
|
21
|
-
mkdirSync(join(FIXTURES, 'repos'), { recursive: true });
|
|
22
|
-
const ROOT = mkdtempSync(join(FIXTURES, 'repos', 'review-jev-'));
|
|
23
|
-
after(() => rmSync(ROOT, { recursive: true, force: true }));
|
|
18
|
+
const { tmp } = await openSuiteScopes('codex-review-jev');
|
|
24
19
|
const REAL_UNAME = spawnSync('bash', ['-c', 'type -P uname'], { encoding: 'utf8' }).stdout.trim();
|
|
25
20
|
|
|
26
21
|
// Every spawn appends its kind and key states; a run also records argv, stdin and what $HOME/.agents/skills is.
|
|
@@ -57,15 +52,20 @@ const FAKE_CODEX = [
|
|
|
57
52
|
const FAKE_UNAME = ['#!/usr/bin/env bash', 'if [[ $# -eq 0 || "$1" == "-s" ]]; then echo "${CODEX_FAKE_UNAME:-Linux}"; exit 0; fi',
|
|
58
53
|
`exec "${REAL_UNAME}" "$@"`, ''].join('\n');
|
|
59
54
|
|
|
60
|
-
const TEMPLATE = join(
|
|
55
|
+
const TEMPLATE = join(tmp, 'template');
|
|
61
56
|
mkdirSync(join(TEMPLATE, 'bin'), { recursive: true });
|
|
62
57
|
mkdirSync(join(TEMPLATE, 'home'));
|
|
63
58
|
mkdirSync(join(TEMPLATE, 'repo'));
|
|
64
59
|
writeFileSync(join(TEMPLATE, 'bin', 'codex'), FAKE_CODEX);
|
|
65
60
|
writeFileSync(join(TEMPLATE, 'bin', 'uname'), FAKE_UNAME);
|
|
66
61
|
{
|
|
67
|
-
const git = (...args) =>
|
|
68
|
-
|
|
62
|
+
const git = (...args) => {
|
|
63
|
+
const result = spawnSync('git', args, { cwd: join(TEMPLATE, 'repo'), encoding: 'utf8', env: childEnv(join(TEMPLATE, 'home'), { PATH: process.env.PATH }) });
|
|
64
|
+
assert.ifError(result.error);
|
|
65
|
+
assert.equal(result.signal, null, result.stderr);
|
|
66
|
+
assert.equal(result.status, 0, result.stderr);
|
|
67
|
+
};
|
|
68
|
+
makeFixtureRepo((args) => git(...args), join(TEMPLATE, 'repo'), ['-q']);
|
|
69
69
|
git('config', 'user.email', 'probe@example.com');
|
|
70
70
|
git('config', 'user.name', 'probe');
|
|
71
71
|
writeFileSync(join(TEMPLATE, 'repo', 'AGENTS.md'), '# AGENTS\n\nHard Constraints: none (test fixture).\n');
|
|
@@ -75,7 +75,7 @@ writeFileSync(join(TEMPLATE, 'bin', 'uname'), FAKE_UNAME);
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
const sandbox = ({ skills = true } = {}) => {
|
|
78
|
-
const dir = mkdtempSync(join(
|
|
78
|
+
const dir = mkdtempSync(join(tmp, 'sb-'));
|
|
79
79
|
cpSync(TEMPLATE, dir, { recursive: true });
|
|
80
80
|
for (const name of ['codex', 'uname']) chmodSync(join(dir, 'bin', name), 0o755);
|
|
81
81
|
const sb = { dir, bin: join(dir, 'bin'), home: join(dir, 'home'), repo: join(dir, 'repo'),
|
|
@@ -93,7 +93,7 @@ const drive = (sb, args, env = {}, cwd = sb.repo) => {
|
|
|
93
93
|
for (const name of ['log', 'argv', 'stdin', 'skills']) rmSync(cap(name), { force: true });
|
|
94
94
|
const r = spawnSync('bash', [sb.wrapper ?? REVIEW, ...args], {
|
|
95
95
|
cwd, input: '', encoding: 'utf8', timeout: 60000,
|
|
96
|
-
env: childEnv(sb.home, { PATH: `${sb.bin}:${process.env.PATH}`, TMPDIR:
|
|
96
|
+
env: childEnv(sb.home, { PATH: `${sb.bin}:${process.env.PATH}`, TMPDIR: tmp, CODEX_FAKE_LOG: cap('log'), CODEX_FAKE_ARGV: cap('argv'),
|
|
97
97
|
CODEX_FAKE_STDIN: cap('stdin'), CODEX_FAKE_SKILLS: cap('skills'), ...env }),
|
|
98
98
|
});
|
|
99
99
|
assert.ifError(r.error);
|
|
@@ -194,7 +194,7 @@ Honesty + posture (D4/D5):
|
|
|
194
194
|
refuses pre-spend in every mode.
|
|
195
195
|
|
|
196
196
|
Environment: CODEX_REVIEW_SCHEMA=1 (structured JSON findings), CODEX_HARD_TIMEOUT (seconds, default 1800), CODEX_PROBE=1 (throwaway probe only), AW_REVIEW_RECEIPTS (receipt file override), AW_REVIEW_NONCE (dispatch nonce — mints the finding manifest beside the receipt; the --nonce <n> flag is its plain-argument equivalent).
|
|
197
|
-
Requires at run time: the codex CLI on PATH, a ChatGPT-subscription login, Node >= 22, a git work tree with a root AGENTS.md (--help needs none of these).
|
|
197
|
+
Requires at run time: the codex CLI on PATH, a ChatGPT-subscription login, Node >= 22.21, a git work tree with a root AGENTS.md (--help needs none of these).
|
|
198
198
|
HELP
|
|
199
199
|
exit 0
|
|
200
200
|
;;
|
|
@@ -227,7 +227,7 @@ aw_settings_file() {
|
|
|
227
227
|
printf '%s/agent-workflow/bridge-settings.conf' "${XDG_CONFIG_HOME:-$HOME/.config}"
|
|
228
228
|
}
|
|
229
229
|
aw_settings_known() {
|
|
230
|
-
case " CODEX_SERVICE_TIER CODEX_HARD_TIMEOUT CODEX_REVIEW_MAX_TOTAL_BYTES AGY_HARD_TIMEOUT AGY_REVIEW_ALLOW_ADDDIR AGY_REVIEW_MAX_TOTAL_BYTES CODEX_MODEL CODEX_EFFORT AGY_MODEL " in
|
|
230
|
+
case " CODEX_SERVICE_TIER CODEX_HARD_TIMEOUT CODEX_REVIEW_MAX_TOTAL_BYTES AGY_HARD_TIMEOUT AGY_REVIEW_ALLOW_ADDDIR AGY_REVIEW_MAX_TOTAL_BYTES CODEX_MODEL CODEX_EFFORT AGY_MODEL JEV_MODEL " in
|
|
231
231
|
*" $1 "*) return 0 ;;
|
|
232
232
|
*) return 1 ;;
|
|
233
233
|
esac
|
|
@@ -327,7 +327,11 @@ aw_read_posture() {
|
|
|
327
327
|
AW_HOST_VALUE="$value"
|
|
328
328
|
AW_HOST_SOURCE="setting"
|
|
329
329
|
elif (( notify )); then
|
|
330
|
-
|
|
330
|
+
if [[ -n "$default" ]]; then
|
|
331
|
+
echo "warning: $key in bridge settings file '$file' is empty or carries a control byte — using the built-in default '$default'." >&2
|
|
332
|
+
else
|
|
333
|
+
echo "warning: $key in bridge settings file '$file' is empty or carries a control byte — using the manifest's default." >&2
|
|
334
|
+
fi
|
|
331
335
|
fi
|
|
332
336
|
fi
|
|
333
337
|
fi
|
|
@@ -412,7 +416,7 @@ aw_scrub_billing_keys() {
|
|
|
412
416
|
# Review-receipt identity (AD-038). AW_BRIDGE_VERSION mirrors this bridge's SKILL.md/capability.json
|
|
413
417
|
# version (drift-guarded by codex-review.test.mjs against capability.json).
|
|
414
418
|
AW_RECEIPT_BACKEND="codex"
|
|
415
|
-
AW_BRIDGE_VERSION="6.0.
|
|
419
|
+
AW_BRIDGE_VERSION="6.0.2" # aw-version-anchor
|
|
416
420
|
# Generous hard cap for a slow review at the host posture's effort (subscription latency varies).
|
|
417
421
|
CODEX_HARD_TIMEOUT="${CODEX_HARD_TIMEOUT:-1800}"
|
|
418
422
|
# Above this assembled-payload size (bytes), the diff goes via a git-dir-local temp
|
|
@@ -1241,17 +1245,20 @@ set -- "${scan_args[@]+"${scan_args[@]}"}"
|
|
|
1241
1245
|
# parse and the nonce finding-manifest mint run in node, so a missing or too-old node refuses by
|
|
1242
1246
|
# name BEFORE any codex run — never a spent run with the wrong diagnostic.
|
|
1243
1247
|
AW_MIN_NODE_MAJOR=22
|
|
1248
|
+
AW_MIN_NODE_MINOR=21
|
|
1244
1249
|
if ! command -v node >/dev/null 2>&1; then
|
|
1245
1250
|
echo "error: 'node' is not on PATH. This review runs node for the plan artifact-path normalization," >&2
|
|
1246
|
-
echo " the CODEX_REVIEW_SCHEMA parse and the nonce finding-manifest mint (family floor: Node >= ${AW_MIN_NODE_MAJOR})." >&2
|
|
1247
|
-
echo " Refusing BEFORE any run is spent. Install Node >= ${AW_MIN_NODE_MAJOR}, then re-run." >&2
|
|
1251
|
+
echo " the CODEX_REVIEW_SCHEMA parse and the nonce finding-manifest mint (family floor: Node >= ${AW_MIN_NODE_MAJOR}.${AW_MIN_NODE_MINOR})." >&2
|
|
1252
|
+
echo " Refusing BEFORE any run is spent. Install Node >= ${AW_MIN_NODE_MAJOR}.${AW_MIN_NODE_MINOR}, then re-run." >&2
|
|
1248
1253
|
exit 127
|
|
1249
1254
|
fi
|
|
1250
1255
|
aw_node_version="$(node --version 2>/dev/null || true)"
|
|
1251
1256
|
aw_node_major="${aw_node_version#v}"; aw_node_major="${aw_node_major%%.*}"
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1257
|
+
aw_node_minor="${aw_node_version#*.}"; aw_node_minor="${aw_node_minor%%.*}"
|
|
1258
|
+
if [[ ! "$aw_node_major" =~ ^[0-9]+$ || ! "$aw_node_minor" =~ ^[0-9]+$ ]] ||
|
|
1259
|
+
(( 10#$aw_node_major < AW_MIN_NODE_MAJOR || (10#$aw_node_major == AW_MIN_NODE_MAJOR && 10#$aw_node_minor < AW_MIN_NODE_MINOR) )); then
|
|
1260
|
+
echo "error: node '${aw_node_version:-<unreadable>}' is below the family floor (Node >= ${AW_MIN_NODE_MAJOR}.${AW_MIN_NODE_MINOR}) this review needs." >&2
|
|
1261
|
+
echo " Refusing BEFORE any run is spent. Upgrade Node to >= ${AW_MIN_NODE_MAJOR}.${AW_MIN_NODE_MINOR}, then re-run." >&2
|
|
1255
1262
|
exit 127
|
|
1256
1263
|
fi
|
|
1257
1264
|
|
|
@@ -1482,7 +1489,7 @@ if [[ -f "$out" && -s "$out" ]]; then
|
|
|
1482
1489
|
# every item carries a severity inside the closed enum, read ONCE — a legal multiline layout
|
|
1483
1490
|
# parses, a decoy "verdict" inside a findings string never substitutes, malformed / out-of-enum /
|
|
1484
1491
|
# uncountable stays empty (the D4 failed-run arm): a payload the wrapper cannot count is never
|
|
1485
|
-
# receipted as "0 blocking". Node >=22 is a family floor, so the one-liner adds no dependency.
|
|
1492
|
+
# receipted as "0 blocking". Node >=22.21 is a family floor, so the one-liner adds no dependency.
|
|
1486
1493
|
schema_parse="$(node -e 'try{const v=JSON.parse(require("node:fs").readFileSync(process.argv[1],"utf8"));const sev=["blocker","major","minor","nit"];if(["ship","revise","rethink"].includes(v.verdict)&&Array.isArray(v.findings)&&v.findings.every((f)=>f!==null&&typeof f==="object"&&sev.includes(f.severity)))process.stdout.write(v.verdict+"\t"+v.findings.filter((f)=>f.severity==="blocker"||f.severity==="major").length);}catch{}' "$out" 2>/dev/null || true)"
|
|
1487
1494
|
verdict="${schema_parse%%$'\t'*}"
|
|
1488
1495
|
blocking_count="${schema_parse#*$'\t'}"
|
|
@@ -9,6 +9,7 @@ import { join, dirname, resolve } from 'node:path';
|
|
|
9
9
|
import { fileURLToPath } from 'node:url';
|
|
10
10
|
import { spawnSync, execFile } from 'node:child_process';
|
|
11
11
|
import { createHash } from 'node:crypto';
|
|
12
|
+
import { makeFixtureRepo } from './codex-fixtures-harness.test.mjs';
|
|
12
13
|
|
|
13
14
|
const HERE = dirname(fileURLToPath(import.meta.url));
|
|
14
15
|
const WRAPPER = join(HERE, 'codex-review.sh');
|
|
@@ -79,7 +80,7 @@ const TEMPLATE_ROOT = (() => {
|
|
|
79
80
|
const repo = join(root, 'repo');
|
|
80
81
|
mkdirSync(repo);
|
|
81
82
|
const g = (...args) => spawnSync('git', args, { cwd: repo, encoding: 'utf8' });
|
|
82
|
-
g(
|
|
83
|
+
makeFixtureRepo((args) => g(...args), repo, ['-q']);
|
|
83
84
|
g('config', 'user.email', 'probe@example.com');
|
|
84
85
|
g('config', 'user.name', 'probe');
|
|
85
86
|
writeFileSync(join(repo, 'AGENTS.md'), '# AGENTS\n\nHard Constraints: none (test fixture).\n');
|
|
@@ -303,23 +304,30 @@ describe('codex-review.sh — hard timeout (1.3)', { concurrency: 2 }, () => {
|
|
|
303
304
|
assert.equal(r.capStdin, '', 'codex must NOT be invoked when the preflight refuses');
|
|
304
305
|
});
|
|
305
306
|
|
|
306
|
-
it('
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
const
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
307
|
+
it('checks the numeric Node 22.21 floor before any run, in help and shipped text spec:jev-judge/S10', async (context) => {
|
|
308
|
+
await context.test('missing node refuses before any run', async () => {
|
|
309
|
+
const missing = makeSandbox();
|
|
310
|
+
const r1 = await run(missing, { path: `${missing.bin}:${farmFor(['node'])}` });
|
|
311
|
+
rmSync(missing.root, { recursive: true, force: true });
|
|
312
|
+
assert.equal(r1.status, 127);
|
|
313
|
+
assert.match(r1.stderr, /'node' is not on PATH/);
|
|
314
|
+
assert.equal(r1.capStdin, '', 'codex must NOT be invoked without node');
|
|
315
|
+
});
|
|
316
|
+
for (const [version, admitted] of [['v22.3.0', false], ['v22.20.0', false], ['v22.21.0', true], ['v23.0.0', true]]) await context.test(version, async () => {
|
|
317
|
+
const sandbox = makeSandbox();
|
|
318
|
+
writeFileSync(join(sandbox.bin, 'node'), `#!/bin/sh\nif [ "$1" = --version ]; then echo ${version}; else exec '${process.execPath.replaceAll("'", "'\\''")}' "$@"; fi\n`, { mode: 0o755 });
|
|
319
|
+
const result = await run(sandbox, { path: `${sandbox.bin}:${farmFor(['node'])}` });
|
|
320
|
+
rmSync(sandbox.root, { recursive: true, force: true });
|
|
321
|
+
assert.equal(result.status, admitted ? 0 : 127, `${version}: ${result.stderr}`);
|
|
322
|
+
if (admitted) { assert.doesNotMatch(result.stderr, /below the family floor/); assert.notEqual(result.capStdin, '', 'codex runs after the check'); }
|
|
323
|
+
else { assert.equal(result.capStdin, '', 'codex must NOT run below the floor'); assert.match(result.stderr, /family floor[^\n]*Node[^\n]*22\.21\b/); }
|
|
324
|
+
});
|
|
325
|
+
await context.test('--help names Node 22.21', () => assert.match(runHelp('--help').stdout, /\bNode\s*(?:>=\s*|\u2265\s*)?22\.21\b/));
|
|
326
|
+
await context.test('Markdown and bin/*.sh name the full floor', () => {
|
|
327
|
+
const paths = readdirSync(join(HERE, '..'), { recursive: true }).filter((path) => !path.split('/').includes('node_modules') && (path.endsWith('.md') || /^bin\/[^/]+\.sh$/.test(path)));
|
|
328
|
+
const stale = paths.flatMap((path) => readFileSync(join(HERE, '..', path), 'utf8').split('\n').flatMap((line, index) => /\bNode(?:\.js)?\s*(?:>=\s*|\u2265\s*)?22(?!\.21\b)(?=\D|$)/.test(line) ? [`${path}:${index + 1}: ${line}`] : []));
|
|
329
|
+
assert.deepEqual(stale, [], 'every shipped floor names the minor 21');
|
|
330
|
+
});
|
|
323
331
|
});
|
|
324
332
|
});
|
|
325
333
|
|
|
@@ -559,7 +567,7 @@ describe('codex-review.sh — assemble & output edge cases', { concurrency: 2 },
|
|
|
559
567
|
const nested = join(sb.repo, 'nested');
|
|
560
568
|
mkdirSync(nested, { recursive: true });
|
|
561
569
|
const g = (...a) => spawnSync('git', a, { cwd: nested, encoding: 'utf8' });
|
|
562
|
-
g(
|
|
570
|
+
makeFixtureRepo((args) => g(...args), nested, ['-q']);
|
|
563
571
|
writeFileSync(join(nested, 'inner.txt'), 'INNER_SHOULD_NOT_BE_INLINED\n');
|
|
564
572
|
const r = await run(sb, { args: ['code'] });
|
|
565
573
|
rmSync(sb.root, { recursive: true, force: true });
|
|
@@ -1538,12 +1546,9 @@ describe('codex-review.sh — bridge settings file semantics (bridges 2.3.0)', {
|
|
|
1538
1546
|
});
|
|
1539
1547
|
});
|
|
1540
1548
|
|
|
1541
|
-
// ── settings surface ⟷ manifest (drift guard, D6) — same contract as codex-exec ──
|
|
1542
1549
|
const SETTINGS_HEADER = 'Settings file (KEY=VALUE, parsed never sourced; env wins over file, file wins over built-in default):';
|
|
1543
|
-
const
|
|
1544
|
-
const ALL_SETTINGS = [...(MANIFEST.settings ?? []), ...(SIBLING_MANIFEST.settings ?? [])];
|
|
1550
|
+
const ALL_SETTINGS = [MANIFEST, ...['antigravity-cli-bridge', 'typesafe-jev-bridge'].map((directory) => JSON.parse(readFileSync(join(HERE, '..', '..', directory, 'capability.json'), 'utf8')))].flatMap((manifest) => manifest.settings ?? []);
|
|
1545
1551
|
const SETTINGS_CMD = 'codex-review';
|
|
1546
|
-
|
|
1547
1552
|
describe('codex-review.sh — settings surface ⟷ manifest (D6, manifest-pinned)', { concurrency: 2 }, () => {
|
|
1548
1553
|
it('--help Settings section keys set-EQUAL the manifest appliesTo subset', async () => {
|
|
1549
1554
|
const help = runHelp('--help').stdout;
|
|
@@ -1554,16 +1559,13 @@ describe('codex-review.sh — settings surface ⟷ manifest (D6, manifest-pinned
|
|
|
1554
1559
|
setEq(got, want, 'help Settings keys ⟷ manifest settings.appliesTo');
|
|
1555
1560
|
assert.ok(section.some((l) => l.includes('agent-workflow/bridge-settings.conf')), 'the section names the settings file');
|
|
1556
1561
|
});
|
|
1557
|
-
|
|
1558
1562
|
const source = readFileSync(WRAPPER, 'utf8');
|
|
1559
|
-
|
|
1560
|
-
it('aw_settings_known carries exactly the UNION of both bridges settings keys', async () => {
|
|
1563
|
+
it('aw_settings_known carries exactly the UNION of three bridges settings keys spec:bridge-model/S18', async () => {
|
|
1561
1564
|
const m = source.match(/aw_settings_known\(\) \{\n case " ([^"]+) " in/);
|
|
1562
1565
|
assert.ok(m, 'aw_settings_known registry case not found');
|
|
1563
|
-
assert.ok(ALL_SETTINGS.length >= 5, 'both manifests must contribute settings');
|
|
1564
1566
|
setEq(m[1].trim().split(/\s+/), ALL_SETTINGS.map((s) => s.key), 'shell registry ⟷ manifest union');
|
|
1567
|
+
assert.ok(m[1].trim().split(/\s+/).includes('JEV_MODEL'), 'the three-manifest union includes JEV_MODEL');
|
|
1565
1568
|
});
|
|
1566
|
-
|
|
1567
1569
|
it('AW_SETTINGS_APPLIED equals the manifest appliesTo subset for this wrapper', async () => {
|
|
1568
1570
|
const m = source.match(/^AW_SETTINGS_APPLIED="([^"]*)"$/m);
|
|
1569
1571
|
assert.ok(m, 'AW_SETTINGS_APPLIED not found');
|
|
@@ -1571,7 +1573,6 @@ describe('codex-review.sh — settings surface ⟷ manifest (D6, manifest-pinned
|
|
|
1571
1573
|
assert.ok(want.length > 0);
|
|
1572
1574
|
setEq(m[1].trim().split(/\s+/), want, 'applied subset ⟷ manifest appliesTo');
|
|
1573
1575
|
});
|
|
1574
|
-
|
|
1575
1576
|
it('aw_settings_valid arms carry the manifest typed constants per key', async () => {
|
|
1576
1577
|
const body = source.match(/aw_settings_valid\(\) \{[\s\S]*?\n\}/);
|
|
1577
1578
|
assert.ok(body, 'aw_settings_valid not found');
|