row 175 (#1673): scripts/mosaic sends plugins, name, names, follow, threads and thread to packages/cli (sage-1081); the tester gate test sends bad keys to organization.set and organization.revision

This commit is contained in:
dewey committed 2026-10-19 18:44:06 -05:00
1 parent c0b06ed89b
commit 3067ae93ea
3 files changed
+24 -1

No files matched your search

@@ -124,6 +124,9 @@ test('row 175: the human-only actions refuse a tester tester-refused, and the fi
['organization.set', { revision, limits: { total: 0 } }],
['routes', {}],
['organization.revision', {}],
// The gate runs before the argument checks: a bad key still refuses tester-refused.
['organization.set', { revision, nope: 1 }],
['organization.revision', { nope: 1 }],
['decision.resolve', { id: 'd-1', choice: 'yes' }],
['launch.revoke', {}],
['launch.restore', {}],
+20
View File
@@ -127,6 +127,26 @@ function mosaic(args, env) {
child.on("close", (status) => resolve({ status, out, err }));
});
}
// sage-1081: these six fell through to the seat CLI, which refused with its own usage, so W1
// (`plugins set`) and W4 (`name`) failed through the wrapper. Each now reaches packages/cli.
test("row 175: scripts/mosaic sends plugins, name, names, follow, threads and thread to packages/cli, not the seat CLI", (t) => {
const root = tmp(t, "mosaic-cli-route-");
const env = { PATH: process.env.PATH, HOME: join(root, "home"), MOSAIC_CONFIG: join(root, "none.json") };
for (const [args, message] of [
[["plugins", "x"], /^mosaic: mosaic plugins \[--business ID\]/],
[["name"], /^mosaic: name takes an instance and a name\n/],
[["names", "x"], /^mosaic: names takes no arguments\n/],
[["follow", "x"], /^mosaic: follow takes no arguments\n/],
[["threads", "x"], /^mosaic: threads takes no arguments\n/],
[["thread"], /^mosaic: usage:\n mosaic thread create /],
]) {
const r = spawnSync(MOSAIC, args, { env, encoding: "utf8" });
assert.equal(r.status, 4, args.join(" "));
assert.match(r.stderr, message, args.join(" "));
assert.doesNotMatch(r.stderr, /mosaic launch </, args.join(" "));
}
});
const listing = (dir) => readdirSync(dir, { recursive: true }).map(String).sort();
async function w7(t, vars, edit) {
const root = tmp(t, "mosaic-cli-tester-init-");