[ { "id": "T01", "file": "packages/bus/src/broker.mjs", "old": "return THREAD_DEFINITIONS.includes(this.#business(business).roles[role]?.definition);", "new": "return this.#business(business).roles[role]?.definition === 'assistant';", "test": "packages/bus/tests/threads.test.mjs", "pattern": "C2-09a: creative bindLaunch without a thread" }, { "id": "T02", "file": "packages/bus/src/broker.mjs", "old": ": identifier(a.instance);", "new": ": instances[0];", "test": "packages/bus/tests/threads.test.mjs", "pattern": "C2-09a: explicit creative" }, { "id": "T03", "file": "packages/bus/src/broker.mjs", "old": "if (!instances.length || (a.instance !== undefined && !instances.includes(instance))) fail('thread-instance-missing');", "new": "if (!instances.length) fail('thread-instance-missing');", "test": "packages/bus/tests/threads.test.mjs", "pattern": "C2-09a: explicit missing" }, { "id": "T04", "file": "packages/bus/src/broker.mjs", "old": "if (a.instance === undefined && instances.length > 1) fail('thread-instance-ambiguous');", "new": "if (false) fail('thread-instance-ambiguous');", "test": "packages/bus/tests/threads.test.mjs", "pattern": "C2-09a: explicit creative" }, { "id": "T05", "file": "packages/bus/src/broker.mjs", "old": "!this.#granted(s, 'thread.create', identifier(a.project), instance)", "new": "!this.#granted(s, 'thread.create', identifier(a.project), null)", "test": "packages/bus/tests/user-principal.test.mjs", "pattern": "C2-09a: naming an instance" }, { "id": "T06", "file": "packages/cli/src/launcher.mjs", "old": "const threaded = THREAD_DEFINITIONS.includes(b.roles[instance]?.definition);", "new": "const threaded = b.roles[instance]?.definition === \"assistant\";", "test": "packages/cli/tests/thread-launch.test.mjs", "pattern": "C2-09a: creative thread messages" }, { "id": "T07", "file": "packages/webui/src/serve.mjs", "old": ".filter(([, entry]) => THREAD_DEFINITIONS.includes(entry?.definition))", "new": ".filter(() => true)", "test": "packages/webui/tests/chat-instances.test.mjs", "pattern": "C2-09a metadata uses the human" }, { "id": "T08", "file": "packages/webui/src/serve.mjs", "old": "name: entry.vars?.['persona.name'] || instance", "new": "name: instance", "test": "packages/webui/tests/chat-instances.test.mjs", "pattern": "C2-09a metadata uses the human" }, { "id": "T09", "file": "packages/webui/src/chat-http.mjs", "old": "(Object.hasOwn(v, 'instance') && (typeof v.instance !== 'string' || !KEY.test(v.instance)))", "new": "false", "test": "packages/webui/tests/chat.test.mjs", "pattern": "C2-09a malformed instance" }, { "id": "T10", "file": "packages/webui/src/chat.mjs", "old": "createThread: ({ project, name, instance }) => channel('thread.create', { project, name, ...(instance === undefined ? {} : { instance }) }),", "new": "createThread: ({ project, name, instance }) => channel('thread.create', { project, name }),", "test": "packages/webui/tests/chat.test.mjs", "pattern": "C2-09a createThread forwards" }, { "id": "T11", "file": "packages/webui/src/public/chat.js", "old": ": { project: key, name: f.name, instance: f.instance };", "new": ": { project: key, name: f.name };", "test": "packages/webui/tests/chat-browser.test.mjs", "pattern": "C2-09a picker: no silent choice" }, { "id": "T12", "file": "packages/webui/src/public/chat.js", "old": "!f.instance && listed.rows.length === 1", "new": "!f.instance && listed.rows.length >= 1", "test": "packages/webui/tests/chat-browser.test.mjs", "pattern": "C2-09a picker: no silent choice" }, { "id": "T13", "file": "packages/webui/src/public/chat.js", "old": "current.instanceError = \"Couldn't read the thread instances; reload to try again\";", "new": "current.instanceError = '';", "test": "packages/webui/tests/chat-browser.test.mjs", "pattern": "C2-09a picker: metadata failure" }, { "id": "T14", "file": "packages/webui/src/public/chat.js", "old": "txt(row.name === row.instance ? row.instance : `${row.name} (${row.instance})`)", "new": "txt(row.name)", "test": "packages/webui/tests/chat-browser.test.mjs", "pattern": "C2-09a picker: no silent choice" }, { "id": "T15", "file": "packages/webui/src/public/chat.js", "old": "if (f.instance && !listed.rows.some(row => row.instance === f.instance)) {", "new": "if (false) {", "test": "packages/webui/tests/chat-browser.test.mjs", "pattern": "C2-09a picker: metadata failure" }, { "id": "T16", "file": "packages/webui/src/public/chat.js", "old": "f.instance = ''; f.instanceChosen = true;", "new": "f.instance = ''; f.instanceChosen = false;", "test": "packages/webui/tests/chat-browser.test.mjs", "pattern": "C2-09a picker: metadata failure" }, { "id": "T17", "file": "packages/webui/src/public/chat.js", "old": "const unavailable = !project && (!!current.instanceError || !choices.some(row => row.instance === f.instance));", "new": "const unavailable = false;", "test": "packages/webui/tests/chat-browser.test.mjs", "pattern": "C2-09a picker: no silent choice" }, { "id": "T18", "file": "packages/webui/src/serve.mjs", "old": "if (req.method !== 'GET') return json(res, 405, { error: 'method-not-allowed' });", "new": "if (false) return json(res, 405, { error: 'method-not-allowed' });", "test": "packages/webui/tests/chat-instances.test.mjs", "pattern": "C2-09a metadata uses the human" }, { "id": "T19", "file": "packages/webui/src/serve.mjs", "old": "if (search) return json(res, 400, { error: 'invalid-request' });", "new": "if (false) return json(res, 400, { error: 'invalid-request' });", "test": "packages/webui/tests/chat-instances.test.mjs", "pattern": "C2-09a metadata uses the human" }, { "id": "T20", "file": "packages/webui/src/public/chat.js", "old": "current.instances = listed.rows; current.instanceError = '';", "new": "current.instances = listed.rows;", "test": "packages/webui/tests/chat-browser.test.mjs", "pattern": "C2-09a picker: metadata failure" }, { "id": "T21", "file": "packages/webui/src/serve.mjs", "old": "({ instance, name: entry.vars?.['persona.name'] || instance })", "new": "({ instance, name: entry.vars?.['persona.name'] || instance, vars: entry.vars })", "test": "packages/webui/tests/chat-instances.test.mjs", "pattern": "C2-09a metadata uses the human" }, { "id": "T22", "file": "packages/cli/src/launcher.mjs", "old": "const threaded = THREAD_DEFINITIONS.includes(b.roles[r.instance]?.definition);", "new": "const threaded = b.roles[r.instance]?.definition === \"assistant\";", "test": "packages/cli/tests/thread-launch.test.mjs", "pattern": "C2-09a: terminating one creative thread" }, { "id": "T23", "file": "packages/cli/src/launcher.mjs", "old": "const threaded = THREAD_DEFINITIONS.includes(b.roles[instance]?.definition);", "new": "const threaded = b.roles[instance]?.definition === \"assistant\";", "test": "packages/cli/tests/thread-launch.test.mjs", "pattern": "C2-09a: fromSession refuses a creative instance outside a thread without a sandbox", "additional_edits": [ { "file": "packages/cli/src/launcher.mjs", "old": "const threaded = THREAD_DEFINITIONS.includes(b.roles[r.instance]?.definition);", "new": "const threaded = b.roles[r.instance]?.definition === \"assistant\";" } ] }, { "id": "T24", "file": "packages/bus/src/broker.mjs", "old": "if (CREATIVE_DEFINITIONS.includes(this.#business(s.business).roles[s.role]?.definition)) fail('host-creative-role');", "new": "void 0;", "test": "packages/bus/tests/grant-executor.test.mjs", "pattern": "sage-1908: once the agent of an applied grant is a creative role" } ]