packages/control-board/tests/creative-hidden.test.mjs:23:  doc.roles.bean = { definition: "companion" };
packages/control-board/tests/discord.test.mjs:61:  writeFileSync(join(root, 'discord', 'demo.json'), JSON.stringify({ name: 'demo', seat: 'researcher', tokenFile: '/never-read-secret', guildId: 'PRIVATE-ID', users: ['PRIVATE-USER'] }), { mode: 0o600 });
packages/tasks/tests/fields.test.mjs:173:      const file = join(dir, 'researcher.token');
packages/tasks/tests/fields.test.mjs:176:      b.roles.researcher = {
packages/tasks/tests/fields.test.mjs:184:  assert.deepEqual(w.businesses.demo.roles.researcher.authority, { withinRole: [], crossRole: [] });
packages/webui/tests/thread-sharing-fixture.mjs:28:    roles: { chief: { definition: 'chief-of-staff', authority: { withinRole: ['message.send'], crossRole: [] } }, assistant: { definition: 'assistant', authority: { withinRole: ['message.send'], crossRole: [] } } },
packages/business/tests/spec-review-contracts.test.mjs:9:import { REPO_ROLES } from "./helpers.mjs";
packages/business/tests/spec-review-contracts.test.mjs:11:const contract = (name) => readFileSync(join(REPO_ROLES, `${name}.md`), "utf8");
packages/webui/tests/chat-sessions-access.test.mjs:20:    roles:{chief:{definition:'chief-of-staff',authority:{withinRole:['message.send'],crossRole:[]}},assistant:{definition:'assistant',authority:{withinRole:['message.send'],crossRole:[]}}},
packages/business/tests/resolve.test.mjs:7:import { businessDoc, FAR_DATE, REPO_ROLES, systemFor, tmp } from "./helpers.mjs";
packages/business/tests/resolve.test.mjs:22:  const business = validateBusinessDocument(doc, join(root, "businesses", "acme.json"), { rolesDir: REPO_ROLES });
packages/business/tests/resolve.test.mjs:117:    d.roles.chief2 = { definition: "chief-of-staff", credentials: { gitea: { store: true, rotateBy: FAR_DATE } } };
packages/business/tests/resolve.test.mjs:169:  assert.equal(pm.contract, join(REPO_ROLES, "pm.md"));
packages/business/tests/resolve.test.mjs:183:    return validateBusinessDocument(doc, file, { rolesDir: REPO_ROLES });
packages/webui/tests/views.test.mjs:17:import { writeJson, REPO_ROLES } from '../../business/tests/helpers.mjs';
packages/webui/tests/views.test.mjs:207:  const web = await startServer({ port: 0, board: 'http://127.0.0.1:9', reads: consoleReads({ root: repo.root, env: repo.env, system: s.system, configDir: s.configDir, rolesDir: REPO_ROLES, business: 'acme' }) });
packages/business/tests/library-seats.test.mjs:13:import { businessDoc, writeJson, REPO_ROLES } from "./helpers.mjs";
packages/business/tests/library-seats.test.mjs:24:const sets = (dir) => loadSeatSets({ dir, rolesDir: REPO_ROLES });
packages/business/tests/library-seats.test.mjs:30:  doc.roles.bean = { definition: "companion" };
packages/business/tests/library-seats.test.mjs:41:  doc.roles.bean = { definition: "companion" };
packages/business/tests/library-projects-protected.test.mjs:7:import { businessDoc, rolesCopy, tmp, writeJson } from './helpers.mjs';
packages/business/tests/library-projects-protected.test.mjs:18:  const writer = organizationWriter({ dir, rolesDir: rolesCopy(root) });
packages/webui/tests/reads.test.mjs:13:import { writeJson, REPO_ROLES } from '../../business/tests/helpers.mjs';
packages/webui/tests/reads.test.mjs:53:  const base = await serve(t, consoleReads({ root: repo.root, env: repo.env, rolesDir: REPO_ROLES }));
packages/webui/tests/reads.test.mjs:80:  const base = await serve(t, consoleReads({ root: repo.root, env: { ...repo.env, GIT_DIR: join(repo.root, '.git') }, rolesDir: REPO_ROLES }));
packages/webui/tests/reads.test.mjs:97:    const base = await serve(t, consoleReads({ root: repo.root, env: repo.env, rolesDir: REPO_ROLES }));
packages/webui/tests/reads.test.mjs:113:  const base = await serve(t, consoleReads({ root: SRC, system: s.system, configDir: s.configDir, rolesDir: REPO_ROLES, business: 'acme' }));
packages/webui/tests/reads.test.mjs:145:  const reads = consoleReads({ root: SRC, system: s.system, configDir: s.configDir, rolesDir: REPO_ROLES, business: 'acme' });
packages/webui/tests/reads.test.mjs:167:  let base = await serve(t, consoleReads({ root: SRC, system: s.system, configDir: s.configDir, rolesDir: REPO_ROLES }));
packages/webui/tests/reads.test.mjs:171:  base = await serve(t, consoleReads({ root: SRC, system: null, configDir: s.configDir, rolesDir: REPO_ROLES }));
packages/webui/tests/reads.test.mjs:181:  let base = await serve(t, consoleReads({ root: repo.root, env: repo.env, system: s.system, configDir: s.configDir, rolesDir: REPO_ROLES, business: 'acme' }));
packages/webui/tests/reads.test.mjs:192:  base = await serve(t, consoleReads({ root: repo.root, env: repo.env, system: bare.system, configDir: bare.configDir, rolesDir: REPO_ROLES, business: 'acme' }));
packages/webui/tests/reads.test.mjs:204:  base = await serve(t, consoleReads({ root: repo.root, env: repo.env, system: null, configDir: s.configDir, rolesDir: REPO_ROLES, business: 'acme' }));
packages/webui/tests/reads.test.mjs:251:  const reads = consoleReads({ root: dataRoot, system: { dataRoot }, configDir: '/home/u/.config/mosaic-dev', rolesDir: REPO_ROLES, now: () => Date.parse('2026-10-15T13:00:00Z') });
packages/cli/tests/lifecycle.test.mjs:851:  const roleFile = join(p.f.env.MOSAIC_ROLES_DIR, "chief-of-staff.json");
packages/business/tests/record-grants.test.mjs:5:import { REPO_ROLES } from './helpers.mjs';
packages/business/tests/record-grants.test.mjs:13:    const role = loadRole(REPO_ROLES, name);
packages/business/tests/chief-of-staff.test.mjs:13:import { businessDoc, FAR_DATE, launchDoc, REPO_ROLES, systemFor, tmp, writeJson } from "./helpers.mjs";
packages/business/tests/chief-of-staff.test.mjs:48:  return { root, business: loadBusiness("acme", { dir: root, rolesDir: REPO_ROLES }) };
packages/business/tests/chief-of-staff.test.mjs:57:  const role = loadRole(REPO_ROLES, "chief-of-staff");
packages/business/tests/chief-of-staff.test.mjs:61:  assert.equal(role.contractPath, join(REPO_ROLES, "chief-of-staff.md"));
packages/business/tests/chief-of-staff.test.mjs:65:  assert.equal(record.contract, join(REPO_ROLES, "chief-of-staff.md"));
packages/business/tests/chief-of-staff.test.mjs:71:  const raw = JSON.parse(readFileSync(join(REPO_ROLES, "chief-of-staff.json"), "utf8"));
packages/business/tests/chief-of-staff.test.mjs:92:    gitea: { service: "gitea", file: join(fixture.root, "secrets", "chief-of-staff-gitea.token"), rotateBy: FAR_DATE },
packages/business/tests/chief-of-staff.test.mjs:108:  const role = loadRole(REPO_ROLES, "pm");
packages/business/tests/chief-of-staff.test.mjs:146:  const chief = readFileSync(join(REPO_ROLES, "chief-of-staff.md"), "utf8");
packages/business/tests/chief-of-staff.test.mjs:152:  const pm = readFileSync(join(REPO_ROLES, "pm.md"), "utf8");
packages/cli/tests/launcher.test.mjs:745:  const chief = join(given.f.roles, "chief-of-staff.json");
packages/cli/tests/launcher.test.mjs:769:    doc.roles.bean = { definition: "companion", credentials: { gitea: { store: true, rotateBy: FAR_DATE } }, vars: { harness: "pi", model: "claude-sonnet-5-5", thinking: "high", "persona.name": "Bean", "persona.sha256": createHash("sha256").update(text).digest("hex") } };
packages/cli/tests/launcher.test.mjs:812:  const chief = join(given.f.roles, "chief-of-staff.json");
packages/business/tests/business.test.mjs:10:import { launchDoc, businessDoc, REPO, REPO_ROLES, rolesCopy, tmp, writeJson } from "./helpers.mjs";
packages/business/tests/business.test.mjs:18:  const loaded = validateBusinessDocument(doc, file, { rolesDir: REPO_ROLES });
packages/business/tests/business.test.mjs:24:  assert.deepEqual(Object.keys(validateBusinessDocument(only, file, { rolesDir: REPO_ROLES }).projects), ['books']);
packages/business/tests/business.test.mjs:28:  assert.deepEqual(validateBusinessDocument(doc, file, { rolesDir: REPO_ROLES }).projects.books.universes.harbor.playground, ['Elsewhere/Playground/']);
packages/business/tests/business.test.mjs:30:  refuses(() => validateBusinessDocument(doc, file, { rolesDir: REPO_ROLES }), /library-playground-other-universe/);
packages/business/tests/business.test.mjs:34:  refuses(() => validateBusinessDocument(doc, file, { rolesDir: REPO_ROLES }), /library-supporting-other-universe/);
packages/business/tests/business.test.mjs:36:  refuses(() => validateBusinessDocument(doc, file, { rolesDir: REPO_ROLES }), /library-mapping-invalid/);
packages/business/tests/business.test.mjs:47:  refuses(() => validateBusinessDocument(doc, join(root, 'businesses/acme.json'), { rolesDir: REPO_ROLES }), /publish.*library/);
packages/business/tests/business.test.mjs:60:function check(mutate, { rolesDir = REPO_ROLES } = {}) {
packages/business/tests/business.test.mjs:119:  refuses(() => check((d) => { d.roles.pm.definition = "researcher"; }), /version 1 and can't back/);
packages/business/tests/business.test.mjs:142:  const rolesDir = rolesCopy(root);
packages/business/tests/business.test.mjs:193:  refuses(() => loadBusiness("acme", { dir, rolesDir: REPO_ROLES }), /business file not found/, 4);
packages/business/tests/business.test.mjs:196:  assert.equal(loadBusiness("acme", { dir, rolesDir: REPO_ROLES }).file, file);
packages/business/tests/business.test.mjs:199:  refuses(() => loadBusiness("acme", { dir, rolesDir: REPO_ROLES }), /writable by group or other \(mode 620\)/);
packages/business/tests/business.test.mjs:201:  refuses(() => loadBusiness("acme", { dir, rolesDir: REPO_ROLES }), /writable by group or other/);
packages/business/tests/business.test.mjs:203:  assert.equal(loadBusiness("acme", { dir, rolesDir: REPO_ROLES }).id, "acme");
packages/business/tests/business.test.mjs:207:  refuses(() => loadBusiness("linked", { dir, rolesDir: REPO_ROLES }), /non-symbolic-link/, 4);
packages/business/tests/business.test.mjs:210:  refuses(() => loadBusiness("broken", { dir, rolesDir: REPO_ROLES }), /not valid JSON/);
packages/business/tests/business.test.mjs:214:  refuses(() => loadBusiness("broken", { dir, rolesDir: REPO_ROLES }), /writable by group or other \(mode 660\)/);
packages/business/tests/business.test.mjs:224:  refuses(() => loadBusiness("folder", { dir, rolesDir: REPO_ROLES }), /must be a regular, non-symbolic-link file/, 4);
packages/business/tests/business.test.mjs:229:    try { loadBusiness("pipe", { dir: ${JSON.stringify(dir)}, rolesDir: ${JSON.stringify(REPO_ROLES)} }); }
packages/business/tests/business.test.mjs:242:  loadBusiness("acme", { dir, rolesDir: REPO_ROLES });
packages/business/tests/business.test.mjs:263:  refuses(() => validateBusinessDocument(JSON.parse(example), file, { rolesDir: REPO_ROLES }), /botId must be a positive integer/);
packages/business/tests/business.test.mjs:269:  const business = validateBusinessDocument(filled, file, { rolesDir: REPO_ROLES });
packages/business/tests/business.test.mjs:286:  const business = check((d) => { d.roles.bean = { definition: "companion", credentials: CREATIVE_GITEA, vars: { ...persona } }; });
packages/business/tests/business.test.mjs:288:  assert.doesNotThrow(() => check((d) => { d.roles.bean = { definition: "ideas", credentials: CREATIVE_GITEA }; }));
packages/business/tests/business.test.mjs:292:  refuses(() => check((d) => { d.roles.chief.vars = { ...persona }; }), /chief-of-staff isn't one/);
packages/business/tests/business.test.mjs:294:    refuses(() => check((d) => { d.roles.bean = { definition: "research", credentials: CREATIVE_GITEA, vars: { [key]: persona[key] } }; }),
packages/business/tests/business.test.mjs:299:    refuses(() => check((d) => { d.roles.bean = { definition: "companion", credentials: CREATIVE_GITEA, vars: { ...persona, [key]: value } }; }), new RegExp(`variable ${key.replace(".", "\\.")}`), 2);
packages/business/tests/business.test.mjs:321:    d.roles.bean = { definition: "companion", credentials: CREATIVE_GITEA, identity, publish: ["stack"] };
packages/cli/tests/thread-launch.test.mjs:402:    doc.roles.bean = { ...doc.roles.assistant, definition: 'companion' };
packages/cli/tests/thread-launch.test.mjs:467:    doc.roles.bean = { definition: 'companion', vars: { ...vars } };
packages/cli/tests/thread-launch.test.mjs:468:    doc.roles.chet = { definition: 'continuity', vars: { ...vars } };
packages/cli/tests/thread-launch.test.mjs:503:    doc.roles.bean = { ...doc.roles.assistant, definition: 'companion' };
packages/cli/tests/session-cli.test.mjs:101:  const b = new Broker({store,businesses:{demo:{id:'demo',human:'jason',arbiters:{technical:'chief',delivery:'chief'},roles:{chief:{definition:'chief-of-staff',authority:{withinRole:[],crossRole:[]}},assistant:{definition:'assistant',authority:{withinRole:[],crossRole:[]}}},definitions:{assistant:{},'chief-of-staff':{}}}}});
packages/cli/tests/optional-tracker.test.mjs:10:import { businessDoc, launchDoc, REPO_ROLES, systemConfig, tmp, writeJson } from "../../business/tests/helpers.mjs";
packages/cli/tests/optional-tracker.test.mjs:34:  const env = { HOME: root, MOSAIC_CONFIG: config, MOSAIC_ROLES_DIR: REPO_ROLES };
packages/cli/tests/optional-tracker.test.mjs:35:  return { root, doc, system, env, b: loadBusiness("acme", { dir: join(root, "config"), rolesDir: REPO_ROLES }) };
packages/business/tests/plugin-settings.test.mjs:7:import { businessDoc, rolesCopy, tmp as makeRoot, writeJson } from "./helpers.mjs";
packages/business/tests/plugin-settings.test.mjs:19:  const rolesDir = rolesCopy(root);
packages/business/tests/case1-project-key.test.mjs:7:import { REPO, REPO_ROLES, systemConfig, tmp, writeJson } from "./helpers.mjs";
packages/business/tests/case1-project-key.test.mjs:32:      env: { ...process.env, HOME: root, MOSAIC_CONFIG: config, MOSAIC_ROLES_DIR: REPO_ROLES },
packages/webui/tests/tester-fixture.mjs:79:    vars: { 'bus.tester': enabled }, roles: { assistant: { definition: 'assistant', ...none }, chief: { definition: 'chief-of-staff', ...none } },
packages/cli/tests/case2-install.test.mjs:54:    doc.roles.bean = { definition: "companion", vars: { harness: "pi" } };
packages/cli/tests/case2-install.test.mjs:55:    doc.roles.chet = { definition: "companion", vars: { harness: "pi" } };
packages/cli/tests/stack-instances.test.mjs:15:import { businessDoc, rolesCopy, writeJson } from "../../business/tests/helpers.mjs";
packages/cli/tests/stack-instances.test.mjs:393:  const roles = rolesCopy(files);
packages/business/tests/launch-settings.test.mjs:6:import {businessDoc,rolesCopy,tmp as makeRoot,writeJson,tokenFile,FAR_DATE} from './helpers.mjs';
packages/business/tests/launch-settings.test.mjs:9:function fixture(){const root=makeRoot();roots.push(root);const rolesDir=rolesCopy(root),doc=businessDoc(root,'acme');for(const r of Object.values(doc.roles))r.vars={...r.vars,model:'sonnet'};doc.roles.pm.vars.model='opus';doc.launch={by:'chief',instances:['coder','reviewer'],models:{opus:{provider:'anthropic',model:'claude-opus-5-5'},sonnet:{provider:'anthropic',model:'claude-sonnet-5-5'}},limits:{models:{anthropic:{'claude-opus-5-5':4,'claude-sonnet-5-5':4}}}};const file=join(root,'businesses/acme.json');writeJson(file,doc);return {root,rolesDir,doc,file};}
packages/business/tests/launch-settings.test.mjs:184: const f=fixture();const doc=structuredClone(f.doc);doc.roles.bean={definition:'companion',credentials:{gitea:{store:true,rotateBy:FAR_DATE}},vars:{model:'sonnet'}};writeJson(f.file,doc);
packages/business/tests/token-limit-settings.test.mjs:7:import {businessDoc,rolesCopy,tmp as makeRoot,writeJson} from './helpers.mjs';
packages/business/tests/token-limit-settings.test.mjs:14: const root=makeRoot();roots.push(root);const rolesDir=rolesCopy(root),doc=businessDoc(root,'acme');
packages/business/tests/grant-scope.test.mjs:12:import { businessDoc, rolesCopy, systemFor, tmp, writeJson } from "./helpers.mjs";
packages/business/tests/grant-scope.test.mjs:25:  const rolesDir = rolesCopy(root);
packages/cli/tests/helpers.mjs:12:import { businessDoc, rolesCopy, systemConfig, writeJson } from "../../business/tests/helpers.mjs";
packages/cli/tests/helpers.mjs:40:  const roles = rolesCopy(root);
packages/business/tests/cli.test.mjs:7:import { businessDoc, REPO, rolesCopy, systemConfig, tmp, tokenFile, writeJson } from "./helpers.mjs";
packages/business/tests/cli.test.mjs:37:  const env = { PATH: process.env.PATH, HOME: join(root, "home"), MOSAIC_CONFIG: config, MOSAIC_ROLES_DIR: rolesCopy(root) };
packages/business/tests/instance-settings.test.mjs:12:import { businessDoc, FAR_DATE, REPO, rolesCopy, systemConfig, systemFor, tmp, writeJson } from "./helpers.mjs";
packages/business/tests/instance-settings.test.mjs:36:  const rolesDir = rolesCopy(root);
packages/business/tests/instance-settings.test.mjs:335:    doc.roles.bean = { definition: "companion", credentials: { gitea: { store: true, rotateBy: FAR_DATE } } };
packages/business/tests/instance-settings.test.mjs:336:    doc.roles.muse = { definition: "ideas", credentials: { gitea: { store: true, rotateBy: FAR_DATE } } };
packages/business/tests/instance-settings.test.mjs:381:    doc.roles.bean = { definition: "companion", credentials: { gitea: { store: true, rotateBy: FAR_DATE } } };
packages/cli/tests/publish-socket.test.mjs:14:import { businessDoc, rolesCopy, systemFor, writeJson } from "../../business/tests/helpers.mjs";
packages/cli/tests/publish-socket.test.mjs:81:  const rolesDir = rolesCopy(root);
packages/business/tests/helpers.mjs:10:export const REPO_ROLES = join(REPO, "roles");
packages/business/tests/helpers.mjs:34:export function rolesCopy(root) {
packages/business/tests/helpers.mjs:36:  cpSync(REPO_ROLES, dir, { recursive: true });
packages/webui/tests/chat.test.mjs:198:  const roles = { assistant: { definition: 'assistant', authority: { withinRole: ['message.send'], crossRole: [] } }, chief: { definition: 'chief-of-staff', authority: { withinRole: ['message.send'], crossRole: [] } } };
packages/business/tests/role.test.mjs:6:import { REPO_ROLES, tmp, writeJson } from "./helpers.mjs";
packages/business/tests/role.test.mjs:37:    const role = loadRole(REPO_ROLES, name);
packages/business/tests/role.test.mjs:39:    assert.equal(role.contractPath, join(REPO_ROLES, `${name}.md`));
packages/business/tests/role.test.mjs:49:  const scopes = (name, service) => loadRole(REPO_ROLES, name).credentials.find((c) => c.service === service).scopes;
packages/business/tests/role.test.mjs:63:  const auth = (name) => loadRole(REPO_ROLES, name).authority;
packages/business/tests/role.test.mjs:73:  const others = readdirSync(REPO_ROLES).filter((f) => f.endsWith(".json") && !["conductor-policy.json", "chief-of-staff.json"].includes(f));
packages/business/tests/role.test.mjs:91:  const names = readdirSync(REPO_ROLES).filter((f) => f.endsWith(".json") && f !== "conductor-policy.json").map((f) => f.slice(0, -5));
packages/business/tests/role.test.mjs:94:    const role = loadRole(REPO_ROLES, name);
packages/business/tests/role.test.mjs:101:  const role = loadRole(REPO_ROLES, "researcher");
packages/business/tests/role.test.mjs:114:  refuses(() => loadRole(REPO_ROLES, "conductor-policy"), /roleVersion/);
packages/business/tests/role.test.mjs:233:    const role = loadRole(REPO_ROLES, name);
packages/business/tests/role.test.mjs:340:  assert.deepEqual(loadRole(REPO_ROLES, "chief-of-staff").hireable, []);
packages/business/tests/csuite.test.mjs:10:import { businessDoc, launchDoc, REPO_ROLES, systemFor, tmp, writeJson } from "./helpers.mjs";
packages/business/tests/csuite.test.mjs:32:  return { root, business: loadBusiness("acme", { dir: root, rolesDir: REPO_ROLES }) };
packages/business/tests/csuite.test.mjs:38:    const role = loadRole(REPO_ROLES, name);
packages/business/tests/csuite.test.mjs:42:    assert.ok(existsSync(join(REPO_ROLES, `${name}.md`)), name);
packages/business/tests/csuite.test.mjs:43:    const { title, ...rest } = JSON.parse(readFileSync(join(REPO_ROLES, `${name}.json`), "utf8"));
packages/business/tests/csuite.test.mjs:46:    const text = readFileSync(join(REPO_ROLES, `${name}.md`), "utf8");
packages/business/tests/csuite.test.mjs:90:  const base = JSON.parse(readFileSync(join(REPO_ROLES, "chief-executive-officer.json"), "utf8"));
packages/business/tests/workflow-roles.test.mjs:10:import { businessDoc, REPO_ROLES, systemFor, tmp, writeJson } from "./helpers.mjs";
packages/business/tests/workflow-roles.test.mjs:46:  return { root, business: loadBusiness("acme", { dir: root, rolesDir: REPO_ROLES }) };
packages/business/tests/workflow-roles.test.mjs:52:    const role = loadRole(REPO_ROLES, name);
packages/business/tests/workflow-roles.test.mjs:55:    assert.ok(existsSync(join(REPO_ROLES, `${name}.md`)), name);
packages/business/tests/workflow-roles.test.mjs:56:    const { title, ...rest } = JSON.parse(readFileSync(join(REPO_ROLES, `${name}.json`), "utf8"));
packages/business/tests/workflow-roles.test.mjs:59:    assert.match(readFileSync(join(REPO_ROLES, `${name}.md`), "utf8"), new RegExp(`^# Role contract: ${name}\\n`), name);
packages/business/tests/workflow-roles.test.mjs:64:  const role = loadRole(REPO_ROLES, "security-reviewer");
packages/business/tests/workflow-roles.test.mjs:73:  const role = loadRole(REPO_ROLES, "merge-gate");
packages/business/tests/workflow-roles.test.mjs:92:  const contracts = readdirSync(REPO_ROLES).filter((f) => f.endsWith(".md"));
packages/business/tests/workflow-roles.test.mjs:97:    const text = readFileSync(join(REPO_ROLES, file), "utf8");
packages/business/tests/workflow-roles.test.mjs:107:    const text = readFileSync(join(REPO_ROLES, `${name}.md`), "utf8").replace(/\s+/g, " ");
packages/business/tests/workflow-roles.test.mjs:126:  const read = (name) => readFileSync(join(REPO_ROLES, `${name}.md`), "utf8").replace(/\s+/g, " ");
packages/business/tests/agent-identity.test.mjs:8:import { businessDoc, FAR_DATE, REPO_ROLES, tmp } from "./helpers.mjs";
packages/business/tests/agent-identity.test.mjs:29:  return validateBusinessDocument(doc, join(root, "businesses", "acme.json"), { rolesDir: REPO_ROLES });
packages/business/tests/agent-identity.test.mjs:34:  const business = validateBusinessDocument(businessDoc(root), join(root, "businesses", "acme.json"), { rolesDir: REPO_ROLES });
packages/business/tests/assistant.test.mjs:10:import { businessDoc, REPO_ROLES, systemFor, tmp, writeJson } from "./helpers.mjs";
packages/business/tests/assistant.test.mjs:41:  return { root, business: loadBusiness("acme", { dir: root, rolesDir: REPO_ROLES }) };
packages/business/tests/assistant.test.mjs:49:  const role = loadRole(REPO_ROLES, "assistant");
packages/business/tests/assistant.test.mjs:53:  assert.equal(role.contractPath, join(REPO_ROLES, "assistant.md"));
packages/business/tests/assistant.test.mjs:58:  assert.equal(record.contract, join(REPO_ROLES, "assistant.md"));
packages/business/tests/assistant.test.mjs:64:  const raw = JSON.parse(readFileSync(join(REPO_ROLES, "assistant.json"), "utf8"));
packages/business/tests/assistant.test.mjs:71:  const role = loadRole(REPO_ROLES, "assistant");
packages/business/tests/assistant.test.mjs:84:  const role = loadRole(REPO_ROLES, "assistant");
packages/business/tests/assistant.test.mjs:89:    assert.equal(loadRole(REPO_ROLES, name).messaging, null, name);
packages/business/tests/assistant.test.mjs:151:  const text = readFileSync(join(REPO_ROLES, "assistant.md"), "utf8");
packages/business/tests/assistant.test.mjs:164:  const names = readdirSync(REPO_ROLES).filter((f) => f.endsWith(".json") && f !== "conductor-policy.json").map((f) => f.slice(0, -5));
packages/business/tests/assistant.test.mjs:165:  const granted = names.filter((name) => loadRole(REPO_ROLES, name).tools.includes("web"));
packages/business/tests/assistant.test.mjs:168:    assert.ok(!loadRole(REPO_ROLES, name).tools.includes("web"), name);
packages/business/tests/lifecycle-settings.test.mjs:12:import { businessDoc, FAR_DATE, REPO, rolesCopy, systemConfig, systemFor, tmp, writeJson } from "./helpers.mjs";
packages/business/tests/lifecycle-settings.test.mjs:25:  const rolesDir = rolesCopy(root);
packages/business/tests/lifecycle-settings.test.mjs:238:    doc.roles.bean = { definition: "companion", credentials: { gitea: { store: true, rotateBy: FAR_DATE } } };
packages/business/tests/case1-business-file.test.mjs:8:import { REPO, REPO_ROLES, systemConfig, tmp, writeJson } from "./helpers.mjs";
packages/business/tests/case1-business-file.test.mjs:37:    MOSAIC_CONFIG: config, MOSAIC_ROLES_DIR: REPO_ROLES, CASE2_STACK_COPY: copy,
packages/business/tests/case1-business-file.test.mjs:62:  const b = loadBusiness("mosaic-stack", { dir: x.configDir, rolesDir: REPO_ROLES });
packages/business/tests/optional-tracker.test.mjs:8:import { businessDoc, REPO, REPO_ROLES, systemConfig, tmp, writeJson } from "./helpers.mjs";
packages/business/tests/optional-tracker.test.mjs:19:const check = (x) => validateBusinessDocument(x.doc, x.file, { rolesDir: REPO_ROLES });
packages/business/tests/optional-tracker.test.mjs:25:  const b = loadBusiness("acme", { dir: join(x.root, "config"), rolesDir: REPO_ROLES });
packages/business/tests/optional-tracker.test.mjs:38:    env: { ...process.env, HOME: x.root, MOSAIC_CONFIG: x.config, MOSAIC_ROLES_DIR: REPO_ROLES },
packages/business/tests/project-repo.test.mjs:4:import { businessDoc, REPO_ROLES, tmp } from './helpers.mjs';
packages/business/tests/project-repo.test.mjs:9:  const check = () => validateBusinessDocument(doc, file, { rolesDir: REPO_ROLES });
packages/business/tests/project-repo.test.mjs:23:  const business = validateBusinessDocument(doc, file, { rolesDir: REPO_ROLES });
packages/business/tests/project-repo.test.mjs:27:  const safe = validateBusinessDocument(doc, file, { rolesDir: REPO_ROLES });
packages/business/tests/hosts.test.mjs:9:import { businessDoc, rolesCopy, tmp, tokenFile, FAR_DATE } from "./helpers.mjs";
packages/business/tests/hosts.test.mjs:24:  const rolesDir = rolesCopy(root);
packages/bus/tests/workflow-roles.test.mjs:14:import { businessDoc, REPO_ROLES, systemFor } from '../../business/tests/helpers.mjs';
packages/bus/tests/workflow-roles.test.mjs:30:  const business = validateBusinessDocument(doc, join(root, 'businesses', 'demo.json'), { rolesDir: REPO_ROLES });
packages/bus/tests/thread-claims.test.mjs:34:        roles: { chief: { definition: 'chief-of-staff', ...within(['message.send']) }, assistant: { definition: 'assistant', ...within(['message.send']) } },
packages/bus/tests/rooms.test.mjs:18:  const roles = { continuity: role('continuity'), chet: role('companion'), bean: role('companion'), chief: role('chief-of-staff') };
packages/harness/tests/helpers.mjs:12:import { businessDoc, REPO_ROLES, systemFor } from "../../business/tests/helpers.mjs";
packages/harness/tests/helpers.mjs:46:  const business = validateBusinessDocument(doc, join(root, "businesses", "acme.json"), { rolesDir: REPO_ROLES });
packages/bus/tests/lifecycle-verbs.test.mjs:372:  const { businessDoc, rolesCopy, systemFor, writeJson } = await import('../../business/tests/helpers.mjs');
packages/bus/tests/lifecycle-verbs.test.mjs:374:  const rolesDir = rolesCopy(root);
packages/bus/tests/publish.test.mjs:235:  const { businessDoc, rolesCopy, systemFor, writeJson } = await import('../../business/tests/helpers.mjs');
packages/bus/tests/publish.test.mjs:239:  const rolesDir = rolesCopy(root);
packages/bus/tests/broker.test.mjs:9:import { businessDoc, REPO_ROLES, systemFor } from '../../business/tests/helpers.mjs';
packages/bus/tests/broker.test.mjs:397:    rolesDir: REPO_ROLES,
packages/bus/tests/plugins-verb.test.mjs:35:  const { businessDoc, rolesCopy, systemFor, writeJson } = await import('../../business/tests/helpers.mjs');
packages/bus/tests/plugins-verb.test.mjs:37:  const rolesDir = rolesCopy(root);
packages/bus/tests/plugins-verb.test.mjs:70:  const { businessDoc, rolesCopy, systemFor, writeJson } = await import('../../business/tests/helpers.mjs');
packages/bus/tests/plugins-verb.test.mjs:72:  const rolesDir = rolesCopy(root);
packages/bus/tests/grant-scope-runtime.test.mjs:9:import { businessDoc, rolesCopy, systemFor, writeJson } from '../../business/tests/helpers.mjs';
packages/bus/tests/grant-scope-runtime.test.mjs:16:  const rolesDir = rolesCopy(root);
packages/bus/tests/limits.test.mjs:20: const {startBroker}=await import('../src/runtime.mjs');const {businessDoc,rolesCopy,systemFor,writeJson}=await import('../../business/tests/helpers.mjs');const {readFileSync}=await import('node:fs');
packages/bus/tests/limits.test.mjs:21: const root=mkdtempSync(join(tmpdir(),'mosaic-limits-runtime-')),rolesDir=rolesCopy(root),doc=businessDoc(root,'demo');writeJson(join(root,'businesses/demo.json'),doc);mkdirSync(join(root,'data'),{mode:0o700});
packages/bus/tests/limits.test.mjs:27: const {startBroker}=await import('../src/runtime.mjs');const {businessDoc,rolesCopy,systemFor,writeJson}=await import('../../business/tests/helpers.mjs');const {organizationWriter}=await import('../../business/src/organization.mjs');const {readFileSync}=await import('node:fs');
packages/bus/tests/limits.test.mjs:28: const root=mkdtempSync(join(tmpdir(),'mosaic-limits-recovery-')),rolesDir=rolesCopy(root),doc=businessDoc(root,'demo'),file=writeJson(join(root,'businesses/demo.json'),doc);mkdirSync(join(root,'data'),{mode:0o700});
packages/plugins/tests/loader.test.mjs:10:import { businessDoc, rolesCopy, tmp as businessRoot, writeJson } from "../../business/tests/helpers.mjs";
packages/plugins/tests/loader.test.mjs:55:  const business = validateBusinessDocument(doc, file, { rolesDir: rolesCopy(root) });
packages/bus/tests/gitea-grant.test.mjs:246:  const creative = await setup(t, { business: (b) => (b.roles.coder.definition = 'research') });
packages/bus/tests/host-run.test.mjs:20:import { businessDoc, rolesCopy, systemFor, writeJson } from '../../business/tests/helpers.mjs';
packages/bus/tests/host-run.test.mjs:158:  const chiefAuthority = JSON.parse(readFileSync(join(REPO, 'roles', 'chief-of-staff.json'), 'utf8')).authority;
packages/bus/tests/host-run.test.mjs:162:      roles: { chief: { definition: 'chief-of-staff', authority: chiefAuthority } }, projects: {},
packages/bus/tests/host-run.test.mjs:565:  const rolesDir = rolesCopy(root);
packages/bus/tests/host-run.test.mjs:638:  const rolesDir = rolesCopy(root);
packages/bus/tests/fire-revokes-grants.test.mjs:31:const chiefAuthority = JSON.parse(readFileSync(fileURLToPath(new URL('../../../roles/chief-of-staff.json', import.meta.url)), 'utf8')).authority;
packages/bus/tests/message-filter.test.mjs:79:        roles: { chief: { definition: 'chief-of-staff', ...within(['message.send']) }, assistant: { definition: 'assistant', ...within(['message.send']) } },
packages/bus/tests/credential-verbs.test.mjs:13:import { businessDoc, rolesCopy, systemFor, writeJson } from '../../business/tests/helpers.mjs';
packages/bus/tests/credential-verbs.test.mjs:24:  const rolesDir = rolesCopy(root);
packages/bus/tests/instances-verb.test.mjs:13:const chiefAuthority = JSON.parse(readFileSync(fileURLToPath(new URL('../../../roles/chief-of-staff.json', import.meta.url)), 'utf8')).authority;
packages/bus/tests/instances-verb.test.mjs:18:    roles: { chief: { definition: 'chief-of-staff', authority: chiefAuthority }, pm: { definition: 'pm', ...none } },
packages/bus/tests/instances-verb.test.mjs:63:  const { businessDoc, rolesCopy, systemFor, writeJson } = await import('../../business/tests/helpers.mjs');
packages/bus/tests/instances-verb.test.mjs:65:  const rolesDir = rolesCopy(root);
packages/bus/tests/tester-writes.test.mjs:12:import { businessDoc, rolesCopy, systemFor, writeJson } from '../../business/tests/helpers.mjs';
packages/bus/tests/tester-writes.test.mjs:38:  const rolesDir = rolesCopy(root);
packages/bus/tests/lifecycle-revoke.test.mjs:16:import { businessDoc, FAR_DATE, rolesCopy, systemFor, writeJson } from '../../business/tests/helpers.mjs';
packages/bus/tests/lifecycle-revoke.test.mjs:26:  const rolesDir = rolesCopy(root);
packages/bus/tests/hard-waits.test.mjs:160:  const f = await fixture(t, { roles: { ...seats, chief: { definition: 'chief-of-staff', ...grants(['role.end']) } } });
packages/bus/tests/daily-quota-runtime.test.mjs:18:  const { businessDoc, rolesCopy, systemFor, writeJson } = await import('../../business/tests/helpers.mjs');
packages/bus/tests/daily-quota-runtime.test.mjs:19:  const root = mkdtempSync(join(tmpdir(), 'mosaic-daily-quota-')), rolesDir = rolesCopy(root), doc = businessDoc(root, 'demo');
packages/bus/tests/grant-executor.test.mjs:231:  roles: { ...structuredClone(business.roles), ops: { ...structuredClone(business.roles.ops), definition: 'research' } },
packages/bus/tests/routes-verb.test.mjs:15:const chiefAuthority = JSON.parse(readFileSync(fileURLToPath(new URL('../../../roles/chief-of-staff.json', import.meta.url)), 'utf8')).authority;
packages/bus/tests/routes-verb.test.mjs:20:    roles: { chief: { definition: 'chief-of-staff', authority: chiefAuthority }, pm: { definition: 'pm', ...none } },
packages/bus/tests/routes-verb.test.mjs:104:  const { businessDoc, rolesCopy, systemFor, writeJson } = await import('../../business/tests/helpers.mjs');
packages/bus/tests/routes-verb.test.mjs:106:  const rolesDir = rolesCopy(root);
packages/bus/tests/reload.test.mjs:15:import { businessDoc, rolesCopy, systemFor, writeJson } from '../../business/tests/helpers.mjs';
packages/bus/tests/reload.test.mjs:28:  const rolesDir = rolesCopy(root);
packages/bus/tests/reload.test.mjs:152:  const roleFile = join(f.rolesDir, 'chief-of-staff.json');
packages/bus/tests/creative.test.mjs:10:import { businessDoc, FAR_DATE, rolesCopy, systemFor, writeJson } from '../../business/tests/helpers.mjs';
packages/bus/tests/creative.test.mjs:98:  const rolesDir = rolesCopy(root);
packages/bus/tests/creative.test.mjs:101:  doc.roles.bean = { definition: 'companion', credentials: { gitea: { store: true, rotateBy: FAR_DATE } } };
packages/bus/tests/creative.test.mjs:114:        roles: { chief: { definition: 'chief-of-staff', authority: shipped('chief-of-staff').authority }, bean: { definition: 'companion', ...within } },
packages/bus/tests/names.test.mjs:12:// within-role. The grant is read from the shipped roles/chief-of-staff.json, so removing it there
packages/bus/tests/chief-of-staff.test.mjs:13:import { businessDoc, rolesCopy, systemFor, writeJson } from '../../business/tests/helpers.mjs';
packages/bus/tests/chief-of-staff.test.mjs:21:// organization). The grant is read from the shipped roles/chief-of-staff.json, so the test pins the
packages/bus/tests/chief-of-staff.test.mjs:356:  const rolesDir = rolesCopy(root);
packages/bus/tests/chief-of-staff.test.mjs:424:  const rolesDir = rolesCopy(root);
packages/bus/tests/chief-of-staff.test.mjs:486:  const rolesDir = rolesCopy(root);
packages/bus/tests/chief-of-staff.test.mjs:544:  const rolesDir = rolesCopy(root);
packages/bus/tests/chief-of-staff.test.mjs:816:    const { call, organization, lastClaim } = hireSetup(t, { ...LISTED, roles: { ...roles, chief: { definition: 'chief-of-staff', authority } } });
packages/bus/tests/chief-of-staff.test.mjs:1025:  const rolesDir = rolesCopy(root);
packages/bus/tests/chief-of-staff.test.mjs:1032:  const chiefFile = join(rolesDir, 'chief-of-staff.json');
packages/bus/tests/limits-runtime.test.mjs:16:  const { businessDoc, rolesCopy, systemFor, writeJson } = await import('../../business/tests/helpers.mjs');
packages/bus/tests/limits-runtime.test.mjs:17:  const root = mkdtempSync(join(tmpdir(), 'mosaic-limits-tokens-')), rolesDir = rolesCopy(root), doc = businessDoc(root, 'demo');
