From 268835a99e13c345967487f6076c98722975c714 Mon Sep 17 00:00:00 2001 From: Rocko Date: Thu, 22 Oct 2026 20:20:56 -0500 Subject: [PATCH 1/8] wip: publish unverified row 219 inspection candidate Preserve the draft for inspection under sage-3113. Tests and mutants have not run. Old-test adaptations approved in mos-1316 and mos-1317 are recorded in OLD-TEST-CHANGES.md. --- agents/rocko/work/queue-219/BUILD.md | 181 ++++ .../rocko/work/queue-219/OLD-TEST-CHANGES.md | 58 ++ agents/rocko/work/queue-219/base.txt | 1 + agents/rocko/work/queue-219/build.patch | 777 ++++++++++++++++++ .../work/queue-219/candidate-manifest.sha256 | 14 + agents/rocko/work/queue-219/changed-paths.txt | 14 + agents/rocko/work/queue-219/mutants.json | 193 +++++ .../work/queue-219/old-persona-test.diff | 40 + .../rocko/work/queue-219/prepare-mutants.py | 39 + packages/bus/src/broker.mjs | 31 +- packages/bus/tests/creative.test.mjs | 13 +- packages/bus/tests/threads.test.mjs | 39 + packages/bus/tests/user-principal.test.mjs | 21 +- packages/cli/src/launcher.mjs | 9 +- packages/cli/tests/launcher.test.mjs | 21 +- packages/cli/tests/thread-launch.test.mjs | 84 ++ packages/webui/src/chat-http.mjs | 3 +- packages/webui/src/chat.mjs | 2 +- packages/webui/src/public/chat.js | 40 +- packages/webui/src/serve.mjs | 20 + packages/webui/tests/chat-browser.test.mjs | 66 +- packages/webui/tests/chat-instances.test.mjs | 87 ++ packages/webui/tests/chat.test.mjs | 18 + 23 files changed, 1730 insertions(+), 41 deletions(-) create mode 100644 agents/rocko/work/queue-219/BUILD.md create mode 100644 agents/rocko/work/queue-219/OLD-TEST-CHANGES.md create mode 100644 agents/rocko/work/queue-219/base.txt create mode 100644 agents/rocko/work/queue-219/build.patch create mode 100644 agents/rocko/work/queue-219/candidate-manifest.sha256 create mode 100644 agents/rocko/work/queue-219/changed-paths.txt create mode 100644 agents/rocko/work/queue-219/mutants.json create mode 100644 agents/rocko/work/queue-219/old-persona-test.diff create mode 100644 agents/rocko/work/queue-219/prepare-mutants.py create mode 100644 packages/webui/tests/chat-instances.test.mjs diff --git a/agents/rocko/work/queue-219/BUILD.md b/agents/rocko/work/queue-219/BUILD.md new file mode 100644 index 000000000..aecd29ba3 --- /dev/null +++ b/agents/rocko/work/queue-219/BUILD.md @@ -0,0 +1,181 @@ +# Row 219 / C2-09a: one thread per creative instance + +Assignment sage-2793, base aca16404c; branch rocko/row219, own worktree +/mnt/storage/scratch/rocko-r219. Claim waits for Sage's gap. No Node, tests, +HTTPS git or push while Gander's row253 gate holds the slot. + +Read both C2-09a and C2-09b briefs at aca16404c and 51cc0445c: the two +sections are byte-identical. The newer brief changes C2-06's reply limits +under Q222, not C2-09a. This row introduces no M5 limit, writer or setting. +Row265 rooms chains on this row and stays separate. + +## Implementation plan + +Broker: replace assistant-only #threaded with THREAD_DEFINITIONS membership. +thread.create gains optional instance, validates it as a declared thread +instance, and binds both the thread and default session to it. Omitted +instance retains single-instance fallback and ambiguous/missing refusals. +User grants must still cover the selected instance and project before +project lookup; an explicit selector cannot bypass FED R3. Existing tester +ownership and per-thread/per-session holder checks remain. + +Launcher: import shared THREAD_DEFINITIONS and replace its two assistant +checks (check and ending), preserving launch admission, quotas, session +isolation and stop policy. No runtime.mjs, bundle or library adapter change; +Della row224 was notified of these narrow launcher hunks. + +Console: actual shipped new-thread UI is in public/chat.js, with transport +mapping in chat.mjs and HTTP validation in chat-http.mjs, not public/bus.js. +These three files need Sage's scope addition before their edits. Proposed +metadata read GET /api/chat/instances in serve.mjs uses the existing +bus.instances read, filters using shared THREAD_DEFINITIONS, and returns +only {instance,name}, with vars['persona.name'] or instance as the label. +It adds no channel operation or bus verb; send still traverses createChat +and the existing channel dispatch. The new select sends optional instance +through chat-http validation and chat.mjs. It is disabled when metadata +cannot be read, so the UI never silently chooses between agents. + +## Acceptance evidence to build (runs await CLEAR) + +Bus: explicit creative selection binds the requested thread and default +session; omitted selector preserves assistant compatibility, missing and +ambiguous cases. Unknown/non-thread/malformed selectors refuse without +new threads; user grants cover only the selected instance, with prior +non-disclosure order intact. Real creative role definition messaging still +holds. A creative thread claims/receives independently of its peer. + +CLI: real fixture launcher starts a creative thread on pending input and +keeps peer thread/session stores separate. Direct non-thread launch of a +creative instance refuses thread-required. Existing assistant tests remain. + +WebUI: metadata lists thread definitions only with persona/name labels; +selection survives refresh and reaches thread.create exactly. Malformed +instance fails before a write, old omitted instance still works. Browser +asserts two creative options, inert hostile labels and read-only disablement. +Keep all identity/origin/content/SSO fences. Named mutants cover each new +acceptance guard; no runs until Sage's announced gap/CLEAR. + +Before review: grep source readers/hash pins, update only pins required by +owned changes, rebase onto row253 landing under a new branch, then rerun +touched files on the new tree. No schema, role-policy, live or canonical +product-path change. Handoff directly to Dewey, Mos and Sage when ready. + +## Scope ruling and picker design before UI edits + +Sage-2807 adds public/chat.js, chat.mjs and chat-http.mjs because the shipped +form is chat.js:55/235, its forwarding is chat.mjs:23, and POST validation is +chat-http.mjs:80-82. bus.js stays byte-identical. The new route sits after +existing auth/session checks and uses startServer's own bus, so the tester +socket's separately supplied testerBus is used too (Dewey U1). No new bus or +channel operation. The route projects only instance/name and keeps the +THREAD_DEFINITIONS filter server-side, rather than making the browser read +all /api/bus/instances vars (Dewey route note). + +Dewey-0849 U2-U5: multiple choices start with a required placeholder; exactly +one starts chosen and is sent explicitly; none disables Create and says no +thread instances are configured. Failed metadata reads disable Create with +"Couldn't read the thread instances; reload to try again" and recover on a +good read. Labels show persona name plus instance key when different. Picks +live in form(key); a removed pick is cleared with a status and never moved +to another option, even if only one remains. Repaints retain selection. +U6 is deferred: thread-list/header still show their existing instance keys. +The shared sign-out/redirect handling and strict HTTP write key validation +remain in force. Add unauthenticated metadata and selected-instance user +grant refusal tests as Sage requires. + +## Existing fixture adaptations (unrun) + +C2-08 creative.test's setup previously bound creative roles without threads +and sent human input with message.send. This row makes those roles threaded: +setup now selects assistant explicitly, creates each creative instance's +thread and binds its claim there; the human uses thread.send. Existing +M6/messaging refusal and count assertions stay in place. The user-principal +fixture gains optional extra threadRoles for the selected-grant regression. + +The browser fixture now answers /api/chat/instances with its one assistant. +Its existing create receipt assertion gains instance:'assistant', since the +new picker explicitly sends its single preselected choice. No existing +assertion is dropped. New tests cover multiple/empty/failed metadata, +duplicate hostile labels, selected-instance POST, refresh and disappearing +choices. No Node or test has been run under Gander's hold. + +The existing launcher.test C2-08 persona-mismatch regression cannot keep +requesting a standalone creative launch: C2-09a now correctly refuses it +thread-required before bundle construction. Its trigger is therefore the +thread pass, with an injected host threadsState snapshot (the persona +mismatch occurs before any bind). The exact mismatch reason, no persona +content leak, one refusal and no running session assertions remain. The +old per-run `['session']` directory assertion changes to `[]` and gains an +assertion for the thread-owned session directory, matching row121's actual +thread-store layout. A new e.thread assertion pins the path. This is a +fixture/expected-layout adaptation, not a product exception for that test. + +## Old-test approval: mos-1316 + +Mos approved the three adaptations in OLD-TEST-CHANGES.md (sha256 +9a1e51e6b43040593a3dd517c4a0c71f5ac42b6b57d66d474cd0517f06e97ed6) +and old-persona-test.diff (sha256 +6aaca9820b692ec659058e9b044f7f60872cdecb16fe3ac1321c2c0ed530701d). +The source commit must name mos-1316 and carry OLD-TEST-CHANGES.md. +Dewey checks each changed line against that record. + +Keep the new thread-launch test's fromSession(chief.cap, 'bean') refusal +(thread-required), and the threads test's direct human message.send refusal +for each creative definition (thread-required-use-thread-send). The former +is sandbox-dependent: its gate record must show it ran without a skip; +otherwise report to Mos rather than claiming the pin. T06 restores the old +assistant-only launcher check; T22 restores the ending check separately. +The persona mismatch fixture wraps only threadsState; all other host ops +remain real. Under mos-1272, a first-run red in launcher.test.mjs, +creative.test.mjs or chat-browser.test.mjs goes to Mos before any fix. +No run has occurred as of this approval record. + +### mos-1317: always-running standalone admission pin + +Added a separate new test next to the assistant standalone refusal: +`C2-09a: fromSession refuses a creative instance outside a thread without a sandbox`. +It has no sandbox skip. The real fixture host binds/claims the chief, and +fromSession must refuse Bean with thread-required before bundle/sandbox +construction. The existing sandbox-dependent pin remains unchanged. +T23 restores both launcher assistant-only comparisons and targets this new +exact refusal assertion. T06 and T22 remain as separate launch/ending checks: +23 mutants total. No tests run; slot scope amendment sent to Sage. +Keep the Mos-approved threadsState wrap as the only persona-test host override. + +## Inspection candidate under sage-3113 (2026-10-23) + +Explicitly UNVERIFIED. Sage authorized a local inspection commit before +runs; no claim of review readiness or green tests. Base remains aca16404c, +branch rocko/row219. No rebase has been performed. No Node, browser, test, +mutant or suite has run; the earlier gate holds and subsequent row219 hold +were honored. Static Python exact-once preparation named 23 mutant sites; +git diff --check passes. The mutant execution runner is not yet written. + +14 source/test paths: six product files and eight whole test files. The +candidate manifest excludes this packet. The new no-sandbox fromSession +Bean test and T23 record mos-1317; old test adaptations stay governed by +mos-1316 and OLD-TEST-CHANGES.md. First-run reds in launcher, creative and +chat-browser must go to Mos before any fix. Run evidence must prove the +sandbox-dependent pin ran, or report its skip to Mos. + +Remaining: Sage-directed rebase to current landing base/new branch; slot +CLEAR and claim; eight whole test files and 23 mutants with process-group +cleanup; path/hash-reader sweep, acceptance evidence and final review packet. +No product behavior is verified. Push waits for Sage's named gap; reviewers +and dependent rows may inspect this commit but must not treat it as approved. + +## Rebase under sage-3127 / exact resolution sage-3128 + +Rebased the unverified c4b4fab98 inspection candidate from aca16404c onto +062646487451993302c768c6812b827c834e952b. The only conflict was broker.mjs's +thread.create user guard: row206 added verb-sensitive #granted(s, verb, +project, instance). Sage-3128 supplied the exact resolution: retain the +selected-instance validation and call #granted(s, 'thread.create', +identifier(a.project), instance). No guessed conflict resolution. The merged +broker has no remaining three-argument #granted(s, ...) call (static balanced +argument scan). T05 now matches that four-argument call and substitutes null +only for instance; all 23 mutant old anchors, including T23's second edit, +remain exact-once. Rebuild manifest/base/patch on this base. Other auto-merges +were user-principal.test, launcher and thread-launch.test. No tests, Node, +mutants or reader audit run: CLEAR still required after 574, covering every +touched test file whole. This branch remains UNVERIFIED. diff --git a/agents/rocko/work/queue-219/OLD-TEST-CHANGES.md b/agents/rocko/work/queue-219/OLD-TEST-CHANGES.md new file mode 100644 index 000000000..ecc309cd6 --- /dev/null +++ b/agents/rocko/work/queue-219/OLD-TEST-CHANGES.md @@ -0,0 +1,58 @@ +# Old-test changes awaiting Mos under mos-1272 (sage-2822) + +No test has run. Row219's product patch is uncommitted on rocko/row219, +aca16404c, /mnt/storage/scratch/rocko-r219. + +## Persona-mismatch regression: launcher.test.mjs + +Name: `row 213 a creative instance's persona is read from /personas: +off its digest the launch fails with the mismatch as its reason`. + +Old trigger: bind/claim a chief, then +`assert.deepEqual(await launcher.fromSession(chief.cap, "bean"), { ok: false, error: "launch-failed" });`. + +New trigger: fixture-wrap only `host.op({op:'threadsState'})` to report one +pending Bean thread, then `await launcher.tick()`. No fake grant, bind, +writer or persona reader. The same actual persona bundle check fails before +any thread run binds. All other host operations use the real fixture host. + +Why: C2-08 declares companion and the shared THREAD_DEFINITIONS. Row219 now +uses that list in check(). Bean's companion definition is therefore +threaded, and fromSession's standalone request refuses thread-required +before start()/buildBundle can read the persona. Keeping that trigger would +stop testing the persona check. No product exemption is added. + +Preserved assertions: exactly one refusal; event/code = refused/launch-failed; +exact persona-mismatch reason including the fixture persona path; no +PERSONA-MARKER-d2 in logs; no running sessions; exactly one failed run dir. +The direct fromSession return assertion is replaced by a thread-id assertion +on the same refusal record. Both prove the refusal at the appropriate entry. + +Old layout assertion: +`assert.deepEqual(readdirSync(join(f.dataRoot, "launches", "acme", runs[0])), ["session"]);` + +New layout assertions: +`assert.deepEqual(readdirSync(join(f.dataRoot, "launches", "acme", runs[0])), []);` +`assert.equal(existsSync(join(f.dataRoot, "threads", "acme", thread, "session")), true);` + +This matches row121: a thread uses its thread-owned store, never a per-run +session directory. The failed persona build still writes no bundle files. +Exact diff: old-persona-test.diff. + +## Other existing-test adaptations disclosed with it + +- bus creative.test setup now explicitly chooses assistant, creates Bean and + Quill threads, and binds those runs with their own thread ids. The existing + human `message.send {to:who}` input becomes `thread.send {thread:threads[who]}`. + All original M6 decision, messaging refusal and message-count assertions + remain unchanged. This lets those same restrictions run on the now-threaded + creative roles; direct human messages are correctly thread-required. +- webui chat-browser.test fixture adds /api/chat/instances metadata. Its old + expected create body `{project:P,name:'named thread'}` becomes + `{project:P,name:'named thread',instance:'assistant'}` because the one-choice + picker explicitly sends its preselected instance (Dewey U2). Every other + existing assertion remains. The additional expected key strengthens the + forwarding check and matches the requested UI behavior. + +Please approve these adaptations before their results count. The builder +continues static packet preparation only until Sage's test CLEAR. diff --git a/agents/rocko/work/queue-219/base.txt b/agents/rocko/work/queue-219/base.txt new file mode 100644 index 000000000..593df1d00 --- /dev/null +++ b/agents/rocko/work/queue-219/base.txt @@ -0,0 +1 @@ +062646487451993302c768c6812b827c834e952b diff --git a/agents/rocko/work/queue-219/build.patch b/agents/rocko/work/queue-219/build.patch new file mode 100644 index 000000000..9794fce33 --- /dev/null +++ b/agents/rocko/work/queue-219/build.patch @@ -0,0 +1,777 @@ +diff --git a/packages/bus/src/broker.mjs b/packages/bus/src/broker.mjs +index c50f8ac23..5ee242f1d 100644 +--- a/packages/bus/src/broker.mjs ++++ b/packages/bus/src/broker.mjs +@@ -4,7 +4,7 @@ import { initializeControl, processingStatus } from '../../processing-control/sr + import { NAME as HARNESS_NAME } from '../../plugins/src/kinds.mjs'; + import { loadRequirements } from '../../tasks/src/requirements.mjs'; + import { MERGE, LandingRefusal, readLanding } from './landing.mjs'; +-import { ID_PATTERN, THREAD_DEFINITION, END_PROTECTED, forkProblem, forkUrl, credentialKind, validArgv, commandAllowed, HOST_ID, CREATIVE_DEFINITIONS, unhireableAction, giteaName, parseGiteaUrl, covers } from '../../business/src/vocabulary.mjs'; ++import { ID_PATTERN, THREAD_DEFINITIONS, END_PROTECTED, forkProblem, forkUrl, credentialKind, validArgv, commandAllowed, HOST_ID, CREATIVE_DEFINITIONS, unhireableAction, giteaName, parseGiteaUrl, covers } from '../../business/src/vocabulary.mjs'; + + // Kept closed while S1 lands; its vocabulary is the integration authority. + export const ACTIONS = Object.freeze([ +@@ -312,7 +312,7 @@ const enrollBinding = (enroll) => ({ + }); + // r6 E3: the installer line's comment, then the tag's 32 hex digits. + const INSTALLER_COMMENT = 'mosaic-installer-'; +-// Row 121 (#1615): an instance of THREAD_DEFINITION (vocabulary.mjs since row 155) talks with the ++// Row 121 (#1615): an instance of THREAD_DEFINITIONS (vocabulary.mjs since row 213) talks with the + // user in threads. Its runs claim a thread, not the role, and every message to or from it names its + // thread (REQ-MSG-1). + // Row 146 (#1640): the sender of the bus's notice to launch.by. A role instance name matches the +@@ -593,7 +593,7 @@ export class Broker { + ); + } + #threaded(business, role) { +- return this.#business(business).roles[role]?.definition === THREAD_DEFINITION; ++ return THREAD_DEFINITIONS.includes(this.#business(business).roles[role]?.definition); + } + // Row 264a (#1769): a claim holds one session of a thread, and each session has its own holder. + #sessionHolder(session) { +@@ -5790,24 +5790,27 @@ export class Broker { + .all('SELECT id,at,name,repo FROM projects WHERE business=? ORDER BY seq', s.business) + .filter((p) => !s.user || this.#granted(s, 'project.list', p.id, null)); + } +- // A thread belongs to the user who made it and to the business's one thread instance. ++ // A thread belongs to the user who made it and to one declared thread instance. + // Row 177 (#1675): a tester's thread is owned by `tester`, so neither reaches the other's. + case 'thread.create': { + if (!s.tester && !s.user) this.#human(s); +- keys(a, ['project', 'name'], ['project', 'name']); ++ keys(a, ['project', 'name', 'instance'], ['project', 'name']); + if (!name(a.name)) fail('invalid-request'); ++ const instances = Object.keys(b.roles).filter((r) => this.#threaded(s.business, r)); ++ const instance = a.instance === undefined ++ ? (instances.length === 1 ? instances[0] : null) ++ : identifier(a.instance); + // FED R3 (design 3.5): a user's grant must cover the project and the thread instance, checked + // before the project is looked up, so an ungranted id reads the same whether it exists or not. + if (s.user) { +- const threaded = Object.keys(b.roles).filter((r) => this.#threaded(s.business, r)); +- if (threaded.length !== 1 || !this.#granted(s, 'thread.create', identifier(a.project), threaded[0])) fail('access-refused'); ++ if (!instance || !instances.includes(instance) || !this.#granted(s, 'thread.create', identifier(a.project), instance)) ++ fail('access-refused'); + } + if (!this.#store.get('SELECT 1 FROM projects WHERE id=? AND business=?', identifier(a.project), s.business)) + fail('project-not-found'); +- // The bus never picks between instances; the business file declares exactly one. +- const instances = Object.keys(b.roles).filter((r) => this.#threaded(s.business, r)); +- if (!instances.length) fail('thread-instance-missing'); +- if (instances.length > 1) fail('thread-instance-ambiguous'); ++ // The human selects an instance; omission is compatible only with one candidate. ++ if (!instances.length || (a.instance !== undefined && !instances.includes(instance))) fail('thread-instance-missing'); ++ if (a.instance === undefined && instances.length > 1) fail('thread-instance-ambiguous'); + if (this.#store.get('SELECT 1 FROM threads WHERE project=? AND name=?', a.project, a.name)) fail('thread-exists'); + const tid = randomUUID(); + this.#store.run( +@@ -5816,13 +5819,13 @@ export class Broker { + this.#now(), + s.business, + a.project, +- instances[0], ++ instance, + this.#owner(s), + a.name, + ); + // Row 264a (#1769, D3): every thread has a default session from the start. +- this.#newSession(s, { id: tid, business: s.business, instance: instances[0], owner: this.#owner(s) }, 'default', 'default', true); +- return { id: tid, instance: instances[0] }; ++ this.#newSession(s, { id: tid, business: s.business, instance, owner: this.#owner(s) }, 'default', 'default', true); ++ return { id: tid, instance }; + } + // Row 177 (#1675): each lists its own threads. The human's list leaves out the tester's, + // and the tester's lists only its own (row 175 listed it the business human's). +diff --git a/packages/bus/tests/creative.test.mjs b/packages/bus/tests/creative.test.mjs +index 6cfbf1cd6..6d421ba19 100644 +--- a/packages/bus/tests/creative.test.mjs ++++ b/packages/bus/tests/creative.test.mjs +@@ -44,15 +44,18 @@ function setup(t) { + const caps = {}; + caps.human = b.bindHuman({ business: 'demo', human: 'jason', via: 'cli', outsideAgent: true }); + const project = b.request(caps.human, { verb: 'project.create', args: { name: 'demo' } }).id; +- const thread = b.request(caps.human, { verb: 'thread.create', args: { project, name: 'main' } }).id; ++ const thread = b.request(caps.human, { verb: 'thread.create', args: { project, name: 'main', instance: 'assistant' } }).id; ++ const threads = { assistant: thread }; + for (const role of Object.keys(roles)) { +- caps[role] = b.bindLaunch({ business: 'demo', role, run: `${role}-run`, harness: 'pi', ...(role === 'assistant' ? { thread } : {}) }); ++ if (['bean', 'quill'].includes(role)) ++ threads[role] = b.request(caps.human, { verb: 'thread.create', args: { project, name: role, instance: role } }).id; ++ caps[role] = b.bindLaunch({ business: 'demo', role, run: `${role}-run`, harness: 'pi', ...(threads[role] ? { thread: threads[role] } : {}) }); + b.request(caps[role], { verb: 'role.claim' }); + } + caps.tester = b.bindTester({ business: 'demo' }); + const call = (who, verb, args = {}) => b.request(caps[who], { verb, args }); + const count = (sql) => store.get(sql).n; +- return { call, count, store }; ++ return { call, count, store, threads }; + } + + const raise = { action: 'policy.change', question: 'Change?', options: [{ key: 'yes', text: 'Yes' }, { key: 'no', text: 'No' }], recommendation: 'yes', blocking: false }; +@@ -72,7 +75,7 @@ test('M6: a creative raise refuses decision-not-allowed, cited or not, and no de + }); + + test('a creative instance sends only to the user and hears only from the user', (t) => { +- const { call, count } = setup(t); ++ const { call, count, threads } = setup(t); + for (const who of ['bean', 'quill']) { + call(who, 'message.send', { to: 'human', body: 'hello' }); + for (const to of ['chief', 'assistant', 'pm', 'bean', 'quill'].filter((n) => n !== who)) { +@@ -81,7 +84,7 @@ test('a creative instance sends only to the user and hears only from the user', + for (const from of ['chief', 'pm']) { + assert.throws(() => call(from, 'message.send', { to: who, body: 'hello' }), { code: 'message-sender-refused' }, `${from} to ${who}`); + } +- call('human', 'message.send', { to: who, body: 'hello' }); ++ call('human', 'thread.send', { thread: threads[who], body: 'hello' }); + } + assert.equal(count("SELECT count(*) n FROM messages WHERE from_role IN ('bean','quill')"), 2); + assert.equal(count("SELECT count(*) n FROM messages WHERE to_role IN ('bean','quill')"), 2); +diff --git a/packages/bus/tests/threads.test.mjs b/packages/bus/tests/threads.test.mjs +index 8b31da9f9..1410ec3fa 100644 +--- a/packages/bus/tests/threads.test.mjs ++++ b/packages/bus/tests/threads.test.mjs +@@ -601,3 +601,42 @@ test('project.create keeps unrelated names with and without a repository', t => + { id: linked.id, name: 'work', repo: 'stack' }, + ]); + }); ++ ++test('C2-09a: explicit creative instances bind independent threads, default sessions and holders', t => { ++ const creative = ['companion', 'ideas', 'research', 'proofreader', 'fact-checker', 'continuity']; ++ const extra = Object.fromEntries(creative.map((definition, i) => [`writer${i}`, { definition, authority: { withinRole: ['message.send'], crossRole: [] } }])); ++ const ctx = setup(t, demo({ roles: { ...roles, ...extra }, definitions: { ++ ...definitions, ...Object.fromEntries(creative.map(definition => [definition, { messaging: shipped(definition).messaging }])), ++ } })); ++ const project = ctx.call('human', 'project.create', { name: 'Writing' }).id; ++ assert.throws(() => ctx.call('human', 'thread.create', { project, name: 'ambiguous' }), { code: 'thread-instance-ambiguous' }); ++ for (const [instance, role] of Object.entries(extra)) { ++ const receipt = ctx.call('human', 'thread.create', { project, name: instance, instance }); ++ assert.equal(receipt.instance, instance); ++ assert.equal(ctx.store.get('SELECT instance FROM threads WHERE id=?', receipt.id).instance, instance); ++ assert.equal(ctx.store.get('SELECT instance FROM sessions WHERE thread=?', receipt.id).instance, instance); ++ ctx.launch(instance, instance, { thread: receipt.id }); ++ assert.equal(ctx.claim(instance).thread, receipt.id); ++ const sent = ctx.call('human', 'thread.send', { thread: receipt.id, body: `For ${instance}` }); ++ const read = ctx.call(instance, 'message.receive'); ++ assert.deepEqual(read.map(m => m.id), [sent.id], role.definition); ++ assert.equal(ctx.threadOf(sent.id), receipt.id); ++ assert.equal(ctx.store.get('SELECT count(*) n FROM role_claims WHERE role=?', instance).n, 0); ++ assert.throws(() => ctx.call('human', 'message.send', { to: instance, body: 'No implicit thread' }), ++ { code: 'thread-required-use-thread-send' }); ++ } ++ assert.equal(ctx.count('SELECT count(*) n FROM threads'), creative.length); ++}); ++ ++test('C2-09a: explicit missing, non-thread and malformed selectors create no thread or session', t => { ++ const ctx = setup(t); ++ const project = ctx.call('human', 'project.create', { name: 'Writing' }).id; ++ for (const instance of ['not-declared', 'pm', 'coder']) ++ assert.throws(() => ctx.call('human', 'thread.create', { project, name: instance, instance }), { code: 'thread-instance-missing' }); ++ for (const instance of [null, 7, {}, [], '', 'bad name']) ++ assert.throws(() => ctx.call('human', 'thread.create', { project, name: 'bad', instance }), { code: 'invalid-request' }); ++ assert.equal(ctx.count('SELECT count(*) n FROM threads'), 0); ++ assert.equal(ctx.count('SELECT count(*) n FROM sessions'), 0); ++ const legacy = ctx.call('human', 'thread.create', { project, name: 'Default' }); ++ assert.equal(legacy.instance, 'assistant'); ++}); +diff --git a/packages/bus/tests/user-principal.test.mjs b/packages/bus/tests/user-principal.test.mjs +index 4dcd1ebeb..8471ddf85 100644 +--- a/packages/bus/tests/user-principal.test.mjs ++++ b/packages/bus/tests/user-principal.test.mjs +@@ -23,7 +23,7 @@ const grant = (over = {}) => ({ + }); + + // `processing` stands in for the halt switch, as lifecycle-verbs.test.mjs's T15 does. +-function setup(t, { grants = [grant()], processing = null } = {}) { ++function setup(t, { grants = [grant()], processing = null, threadRoles = {} } = {}) { + const root = mkdtempSync(join(tmpdir(), 'bus-user-principal-')); + const store = new Store(root); + t.after(() => { +@@ -40,6 +40,7 @@ function setup(t, { grants = [grant()], processing = null } = {}) { + roles: { + chief: { definition: 'chief-of-staff', authority: { withinRole: ['message.send'], crossRole: [] } }, + assistant: { definition: 'assistant', authority: { withinRole: ['message.send'], crossRole: [] } }, ++ ...threadRoles, + }, + definitions: { 'chief-of-staff': {}, assistant: { messaging: shipped('assistant').messaging } }, + }, +@@ -394,3 +395,21 @@ test('R3 r4: the chief\'s hire refuses an instance named user with the code it g + test('R3 r4: a non-function access throws before the store is read', () => { + assert.throws(() => new Broker({ store: null, businesses: { demo: {} }, access: 'access.json' }), /access must be a function/); + }); ++ ++test('C2-09a: naming an instance cannot bypass its collaborator grant or disclose an ungranted project', t => { ++ const ctx = setup(t, { threadRoles: { bean: { definition: 'companion', authority: { withinRole: ['message.send'], crossRole: [] } } } }); ++ const project = ctx.call('human', 'project.create', { name: 'shared' }).id; ++ const privateProject = ctx.call('human', 'project.create', { name: 'private' }).id; ++ ctx.access.doc.grants = [grant({ projects: [project] })]; ++ ctx.user('alice'); ++ assert.equal(ctx.code('alice', 'thread.create', { project, name: 'blocked bean', instance: 'bean' }), 'access-refused'); ++ for (const id of [privateProject, '00000000-0000-4000-8000-000000000000']) ++ assert.equal(ctx.code('alice', 'thread.create', { project: id, name: 'blocked project', instance: 'assistant' }), 'access-refused'); ++ assert.equal(ctx.store.get('SELECT count(*) n FROM threads').n, 0); ++ const allowed = ctx.call('alice', 'thread.create', { project, name: 'assistant work', instance: 'assistant' }); ++ assert.equal(allowed.instance, 'assistant'); ++ ctx.access.doc.grants = [grant({ projects: [project], instances: ['bean'] })]; ++ const bean = ctx.call('alice', 'thread.create', { project, name: 'bean work', instance: 'bean' }); ++ assert.equal(bean.instance, 'bean'); ++ assert.equal(ctx.code('alice', 'thread.create', { project, name: 'old instance', instance: 'assistant' }), 'access-refused'); ++}); +diff --git a/packages/cli/src/launcher.mjs b/packages/cli/src/launcher.mjs +index e044b7627..f019df83f 100644 +--- a/packages/cli/src/launcher.mjs ++++ b/packages/cli/src/launcher.mjs +@@ -53,7 +53,7 @@ + // session.json names it as gitSocket. + // + // Thread sessions (row 121, #1615). A thread instance (an instance whose +-// role definition is the assistant) runs once per thread, never on its own: ++// role definition is in THREAD_DEFINITIONS) runs once per thread, never on its own: + // a launch from a session or --pm refuses thread-required. Every tick + // (threadTickMs) the host asks the broker for the business's threads + // (launch op threadsState) and: +@@ -139,6 +139,7 @@ import { createServer } from "node:net"; + import { chmodSync, existsSync, lstatSync, mkdirSync, readFileSync, renameSync, rmSync } from "node:fs"; + import { dirname, join, relative } from "node:path"; + import { configDir, loadBusiness, resolveInstance, systemVars } from "../../business/src/index.mjs"; ++import { THREAD_DEFINITIONS } from "../../business/src/vocabulary.mjs"; + import { limitHit } from "../../business/src/launch.mjs"; + import { BundleError, buildBundle, hasFallback, readSkills, sessionModel } from "../../harness/src/bundle.mjs"; + import { createLoader } from "../../plugins/src/loader.mjs"; +@@ -175,8 +176,6 @@ const STOP_TIMEOUT_MS = 30000; + const LINE_MAX = 4096; + // How often the host asks for the threads' state; a poll period, not a limit. + const THREAD_TICK_MS = 2000; +-// The broker's thread instance definition (packages/bus/src/broker.mjs). +-const THREAD_DEFINITION = "assistant"; + // Row 194: the broker's LIFECYCLE_REQUEST_MS. A regenerate's old run must be gone by then. + const LIFECYCLE_REQUEST_MS = 60000; + +@@ -299,7 +298,7 @@ export function createLauncher({ + try { b=loadBusiness(host.business,{dir:configDir(env),rolesDir:rolesDir(env)}); } catch(e){throw new Refusal("organization-refused",e.message);} + if (!b.launch) throw new Refusal("launch-not-configured", `business ${b.id} has no launch block`); + if (!(pm ? instance === b.launch.by : b.launch.instances.includes(instance) || (human && Object.hasOwn(b.roles, instance)))) throw new Refusal("instance-not-listed"); +- const threaded = b.roles[instance]?.definition === THREAD_DEFINITION; ++ const threaded = THREAD_DEFINITIONS.includes(b.roles[instance]?.definition); + if (threaded && !thread) throw new Refusal("thread-required", `${instance} runs only for a thread`); + if (!threaded && thread) throw new Refusal("thread-not-allowed", `${instance} isn't a thread instance`); + if (threaded && !session) throw new Refusal("session-required", `${instance} runs for one session of a thread`); +@@ -854,7 +853,7 @@ export function createLauncher({ + function ending(r) { + const runs = r.runs ?? []; + const at = Date.parse(r.at); +- const threaded = b.roles[r.instance]?.definition === THREAD_DEFINITION; ++ const threaded = THREAD_DEFINITIONS.includes(b.roles[r.instance]?.definition); + return registry.sessions.filter((s) => s.business === b.id && (runs.includes(s.run) || + (!threaded && s.instance === r.instance && (spawnedAt.get(s.run) ?? Date.parse(s.startedAt)) <= at))); + } +diff --git a/packages/cli/tests/launcher.test.mjs b/packages/cli/tests/launcher.test.mjs +index 2202c7753..0a34fe27a 100644 +--- a/packages/cli/tests/launcher.test.mjs ++++ b/packages/cli/tests/launcher.test.mjs +@@ -773,21 +773,28 @@ test("row 213 a creative instance's persona is read from /personas: o + const dir = join(given.root, "config", "personas", "acme"); + mkdirSync(dir, { recursive: true, mode: 0o700 }); + writeFileSync(join(dir, "bean.md"), "Not the pinned text.\n", { mode: 0o600 }); +- const { f, host, launcher } = await setup(t, undefined, given); +- // The chief of staff holds role.launch; a test chief session bound to this process asks. +- const chief = await host.bindLaunch({ business: "acme", role: "chief", run: "chief-test", harness: "pi", pid: process.pid, startTime: startTimeOf(process.pid) }); +- await new Client({ path: host.path, cap: chief.cap }).call("role.claim"); +- // The bundle's refusal comes back as launch-failed, as webPlan's does, with its reason in the log. +- assert.deepEqual(await launcher.fromSession(chief.cap, "bean"), { ok: false, error: "launch-failed" }); ++ // Row 219: creative instances launch from their thread, not from a chief's standalone request. ++ // The mismatch occurs before bindLaunch, so only the host's thread-state snapshot is a fixture. ++ const thread = 'persona-thread'; ++ const { f, launcher } = await setup(t, undefined, given, { wrap: host => ({ ++ ...host, ++ op: message => message.op === 'threadsState' ++ ? Promise.resolve([{ thread, instance: 'bean', holder: null, pending: 1 }]) ++ : host.op(message), ++ }) }); ++ // The bundle's refusal remains launch-failed with the persona mismatch as its reason. ++ await launcher.tick(); + const [e] = log(f); + assert.deepEqual([e.event, e.code, log(f).length], ["refused", "launch-failed", 1]); ++ assert.equal(e.thread, thread); + assert.equal(e.why, `instance bean: persona file ${join(dir, "bean.md")} isn't the file persona.sha256 names`); + assert.ok(!JSON.stringify(log(f)).includes("PERSONA-MARKER-d2")); + assert.deepEqual(readSessions(f.dataRoot), []); + // The run directory exists by then (BUILD.md residual); the persona is read before any bundle file. + const runs = readdirSync(join(f.dataRoot, "launches", "acme")); + assert.equal(runs.length, 1); +- assert.deepEqual(readdirSync(join(f.dataRoot, "launches", "acme", runs[0])), ["session"]); ++ assert.deepEqual(readdirSync(join(f.dataRoot, "launches", "acme", runs[0])), []); ++ assert.equal(existsSync(join(f.dataRoot, "threads", "acme", thread, "session")), true); + }); + + test("row 64 on Claude Code a role skill that isn't enabled refuses the same way, before anything starts", { timeout: 30000 }, async (t) => { +diff --git a/packages/cli/tests/thread-launch.test.mjs b/packages/cli/tests/thread-launch.test.mjs +index 0d207a0a0..84f8ed088 100644 +--- a/packages/cli/tests/thread-launch.test.mjs ++++ b/packages/cli/tests/thread-launch.test.mjs +@@ -396,6 +396,22 @@ test("REQ-THREAD-1 REQ-LAUNCH-1 the chief can't launch the assistant outside a t + assert.deepEqual(launchLog(f).map((e) => [e.event, e.instance, e.code]), [["refused", "assistant", "thread-required"]]); + }); + ++// Admission refuses before bundle construction or a sandbox is needed. ++test('C2-09a: fromSession refuses a creative instance outside a thread without a sandbox', { timeout: 30000 }, async t => { ++ const prepared = prepare(t, { edit: doc => { ++ doc.roles.bean = { ...doc.roles.assistant, definition: 'companion' }; ++ doc.launch.instances.push('bean'); ++ return doc; ++ } }); ++ const { f } = prepared; ++ const host = await start(t, prepared); ++ const chief = await host.host.bindLaunch({ business: 'acme', role: 'chief', run: 'chief-bean-refusal', harness: 'pi', pid: process.pid, startTime: startTimeOf(process.pid) }); ++ await new Client({ path: host.host.path, cap: chief.cap }).call('role.claim'); ++ assert.deepEqual(await host.launcher.fromSession(chief.cap, 'bean'), { ok: false, error: 'thread-required' }); ++ assert.deepEqual(readSessions(f.dataRoot), []); ++ assert.deepEqual(launchLog(f).map(e => [e.event, e.instance, e.code]), [['refused', 'bean', 'thread-required']]); ++}); ++ + // Row 125 (#1619, REQ-LIMIT-3, REQ-LIMIT-4): the token-limit check switched on, with the + // assistant's limit at 0, so it is at its limit before any turn. The real check runs through the + // bus's plug-in loader. +@@ -443,3 +459,71 @@ test("REQ-LIMIT-4 a thread run at its token limit stops at the end of its turn: + assert.deepEqual(threadRuns(f, A), []); + assert.equal(host.runtime.threadsState("acme").find((x) => x.thread === A).holder, null); + }); ++ ++test('C2-09a: creative thread messages start distinct runs and keep each instance history separate', { skip, timeout: 90000 }, async t => { ++ const prepared = prepare(t, { sonnet: 2, idle: 60, edit: doc => { ++ const vars = { ...doc.roles.assistant.vars }; ++ delete doc.roles.assistant; ++ doc.roles.bean = { definition: 'companion', vars: { ...vars } }; ++ doc.roles.chet = { definition: 'continuity', vars: { ...vars } }; ++ doc.launch.instances = ['coder', 'bean', 'chet']; ++ return doc; ++ } }); ++ const host = await start(t, prepared), { f } = prepared; ++ const project = host.call('project.create', { name: 'Writing' }).id; ++ const bean = host.call('thread.create', { project, name: 'Bean', instance: 'bean' }).id; ++ const chet = host.call('thread.create', { project, name: 'Chet', instance: 'chet' }).id; ++ const send = async (thread, instance, body) => { ++ const message = host.call('thread.send', { thread, body }); ++ const outcome = await until(() => host.call('thread.messages', { thread }).find(m => m.in_reply_to === message.id) || ++ launchLog(f).find(row => row.thread === thread && row.event === 'refused')); ++ assert.notEqual(outcome.event, 'refused', `creative thread launch refused: ${outcome.code}`); ++ const reply = outcome; ++ assert.equal(reply.from_role, instance); ++ assert.equal(reply.to_role, 'human'); ++ return JSON.parse(reply.body.match(/THREAD (\{.*\})/)[1]); ++ }; ++ assert.deepEqual((await send(bean, 'bean', 'Bean input')).before, []); ++ assert.deepEqual((await send(chet, 'chet', 'Chet input')).before, []); ++ assert.deepEqual((await send(bean, 'bean', 'Bean again')).before, ['Bean input']); ++ assert.equal(readFileSync(join(f.dataRoot, 'threads', 'acme', bean, 'session', 'history'), 'utf8'), 'Bean input\nBean again\n'); ++ assert.equal(readFileSync(join(f.dataRoot, 'threads', 'acme', chet, 'session', 'history'), 'utf8'), 'Chet input\n'); ++ const launches = launchLog(f).filter(row => row.event === 'launch'); ++ assert.ok(launches.some(row => row.instance === 'bean' && row.thread === bean)); ++ assert.ok(launches.some(row => row.instance === 'chet' && row.thread === chet)); ++ const chief = await host.host.bindLaunch({ business: 'acme', role: 'chief', run: 'chief-creative-test', harness: 'pi', pid: process.pid, startTime: startTimeOf(process.pid) }); ++ await new Client({ path: host.host.path, cap: chief.cap }).call('role.claim'); ++ assert.deepEqual(await host.launcher.fromSession(chief.cap, 'bean'), { ok: false, error: 'thread-required' }); ++}); ++ ++test('C2-09a: terminating one creative thread does not signal an unselected peer of the same instance', { skip, timeout: 90000 }, async t => { ++ const prepared = prepare(t, { sonnet: 2, idle: 60, edit: doc => { ++ doc.roles.bean = { ...doc.roles.assistant, definition: 'companion' }; ++ delete doc.roles.assistant; ++ doc.launch.instances = ['coder', 'bean']; ++ return doc; ++ } }); ++ let requests = []; ++ const host = await start(t, prepared, { ops: () => ({ ++ lifecycleRequests: () => requests, ++ lifecycleTake: () => ({ ...requests[0], go: true }), ++ lifecycleDone: () => { requests = []; return {}; }, ++ }) }); ++ const { f } = prepared; ++ const project = host.call('project.create', { name: 'Writing' }).id; ++ const threads = ['one', 'two'].map(name => host.call('thread.create', { project, name, instance: 'bean' }).id); ++ for (const thread of threads) { ++ const message = host.call('thread.send', { thread, body: 'Stay in this thread' }); ++ const outcome = await until(() => host.call('thread.messages', { thread }).find(row => row.in_reply_to === message.id) || ++ launchLog(f).find(row => row.thread === thread && row.event === 'refused')); ++ assert.notEqual(outcome.event, 'refused', `creative thread launch refused: ${outcome.code}`); ++ } ++ const runs = threads.map(thread => launchLog(f).find(row => row.thread === thread && row.event === 'launch').run); ++ requests = [{ request: 'one-thread-end', state: 'open', business: 'acme', action: 'lifecycle.end', ++ instance: 'bean', runs: [runs[0]], by: f.doc.human, at: new Date(Date.now() + 1000).toISOString() }]; ++ await host.launcher.tick(); ++ await until(() => launchLog(f).some(row => row.event === 'lifecycle-end' && row.run === runs[0])); ++ assert.deepEqual(launchLog(f).filter(row => row.event === 'lifecycle-end').map(row => row.run), [runs[0]]); ++ await until(() => !readSessions(f.dataRoot).some(row => row.run === runs[0])); ++ assert.ok(readSessions(f.dataRoot).some(row => row.run === runs[1])); ++}); +diff --git a/packages/webui/src/chat-http.mjs b/packages/webui/src/chat-http.mjs +index c7770726d..396b42f3c 100644 +--- a/packages/webui/src/chat-http.mjs ++++ b/packages/webui/src/chat-http.mjs +@@ -78,7 +78,8 @@ export async function chatHTTP(req, res, { path, search, chat, named, send, prev + (Object.hasOwn(v, 'repo') && (typeof v.repo !== 'string' || !KEY.test(v.repo)))) throw Error(); + action = 'createProject'; args = v; + } else if (path === '/api/chat/threads') { +- if (!exact(v, ['project', 'name']) || !id(v.project) || !name(v.name)) throw Error(); ++ if (!exact(v, ['project', 'name', 'instance'], ['project', 'name']) || !id(v.project) || !name(v.name) || ++ (Object.hasOwn(v, 'instance') && (typeof v.instance !== 'string' || !KEY.test(v.instance)))) throw Error(); + action = 'createThread'; args = v; + } else if (match?.[2] === 'messages') { + if (!exact(v, ['body']) || typeof v.body !== 'string' || !v.body.trim() || v.body.length > 32768) throw Error(); +diff --git a/packages/webui/src/chat.mjs b/packages/webui/src/chat.mjs +index 018574ad4..65b89dab3 100644 +--- a/packages/webui/src/chat.mjs ++++ b/packages/webui/src/chat.mjs +@@ -20,7 +20,7 @@ export function createChat({ call }) { + projects: () => channel('project.list', {}), + createProject: ({ name, repo }) => channel('project.create', { name, ...(repo === undefined ? {} : { repo }) }), + threads: ({ project } = {}) => channel('thread.list', project === undefined ? {} : { project }), +- createThread: ({ project, name }) => channel('thread.create', { project, name }), ++ createThread: ({ project, name, instance }) => channel('thread.create', { project, name, ...(instance === undefined ? {} : { instance }) }), + messages: ({ thread, after, limit }) => channel('thread.messages', { thread, ...(after ? { after } : {}), limit }), + send: ({ thread, body }) => channel('thread.send', { thread, body, class: 'REQUEST' }), + open: ({ thread }) => channel('thread.open', { thread }), +diff --git a/packages/webui/src/public/chat.js b/packages/webui/src/public/chat.js +index a6b805c1b..15066bdc6 100644 +--- a/packages/webui/src/public/chat.js ++++ b/packages/webui/src/public/chat.js +@@ -14,7 +14,7 @@ + return states.get(id); + }; + const form = key => { +- if (!forms.has(key)) forms.set(key, { name: '', repo: '', receipt: '', pending: false }); ++ if (!forms.has(key)) forms.set(key, { name: '', repo: '', instance: '', instanceChosen: false, receipt: '', pending: false }); + return forms.get(key); + }; + class ChatError extends Error { +@@ -58,7 +58,11 @@ + function creation(kind, key) { + const f = form(key), project = kind === 'project'; + const repo = project && current.repos.length ? `` : ''; +- return `

New ${kind}

${repo}

${txt(f.receipt)}

`; ++ const choices = current.instances ?? []; ++ const picker = project ? '' : ``; ++ const unavailable = !project && (!!current.instanceError || !choices.some(row => row.instance === f.instance)); ++ const status = !project && current.instanceError ? current.instanceError : f.receipt || (!project && !choices.length ? 'No thread instances are configured.' : ''); ++ return `

New ${kind}

${repo}${picker}

${txt(status)}

`; + } + function threads(rows) { + return rows.length ? `
    ${rows.map(t => `
  • ${link('threads', t.id, t.name)} ${txt(t.instance)}
  • `).join('')}
` : '

No threads yet.

'; +@@ -106,7 +110,7 @@ + const f = document.getElementById(keep.field.id); + if (f && !f.disabled) { + f.focus({ preventScroll: true }); +- if (keep.field.start !== null) f.setSelectionRange(keep.field.start, keep.field.end); ++ if (keep.field.start != null && typeof f.setSelectionRange === 'function') f.setSelectionRange(keep.field.start, keep.field.end); + } + } else if (navigated) c.container.querySelector('h1')?.focus({ preventScroll: true }); + } +@@ -126,7 +130,7 @@ + paint(); return; + } + const old = current; +- current = { container, kind, id, canSend, projects: old?.projects ?? [], threads: old?.threads ?? [], repos: old?.repos ?? [], error: '', refused: false }; ++ current = { container, kind, id, canSend, projects: old?.projects ?? [], threads: old?.threads ?? [], repos: old?.repos ?? [], instances: old?.instances ?? [], instanceError: kind === 'project' ? 'Reading thread instances…' : '', error: '', refused: false }; + if (navigated || !old) container.innerHTML = '

Reading chat…

'; + try { + const s = kind === 'thread' ? state(id) : null; +@@ -147,6 +151,25 @@ + s.receipt = 'Message shown in this conversation.'; s.receiptId = null; + } + } ++ if (kind === 'project') { ++ try { ++ const listed = await request('instances', undefined, signal); ++ if (g !== generation || out()) return; ++ if (!listed.rows.every(row => typeof row?.instance === 'string' && /^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,159}$/.test(row.instance) && typeof row.name === 'string')) ++ throw new ChatError('invalid-response'); ++ current.instances = listed.rows; current.instanceError = ''; ++ const f = form(id); ++ if (f.instance && !listed.rows.some(row => row.instance === f.instance)) { ++ f.instance = ''; f.instanceChosen = true; ++ f.receipt = 'The selected instance is no longer available. Choose who this thread is with.'; ++ } ++ if (!f.instanceChosen && !f.instance && listed.rows.length === 1) f.instance = listed.rows[0].instance; ++ } catch (err) { ++ if (err.name === 'AbortError' || out() || g !== generation) return; ++ current.instances = []; ++ current.instanceError = "Couldn't read the thread instances; reload to try again"; ++ } ++ } + // Repository choices are optional metadata; an unavailable read must not block unlinked chat. + if (kind === 'list') { + try { +@@ -179,7 +202,11 @@ + if (!current || out()) return; + if (event.target.id === 'chat-body') state(current.id).draft = event.target.value; + const f = event.target.closest('.chat-create'); +- if (f && event.target.dataset.chatField) form(f.dataset.key)[event.target.dataset.chatField] = event.target.value; ++ if (f && event.target.dataset.chatField) { ++ const draft = form(f.dataset.key), field = event.target.dataset.chatField; ++ draft[field] = event.target.value; ++ if (field === 'instance') { draft.instanceChosen = true; draft.receipt = ''; paint(); } ++ } + }); + document.addEventListener('scroll', event => { + if (event.target.matches?.('.chat-log') && current?.kind === 'thread') { +@@ -232,7 +259,8 @@ + void write('send', id, { body: state(id).draft }, `threads/${id}/messages`); + } else if (event.target.classList.contains('chat-create')) { + const key = event.target.dataset.key, f = form(key), project = key === 'projects'; +- const value = project ? { name: f.name, ...(f.repo ? { repo: f.repo } : {}) } : { project: key, name: f.name }; ++ if (!project && (current.instanceError || !(current.instances ?? []).some(row => row.instance === f.instance))) return; ++ const value = project ? { name: f.name, ...(f.repo ? { repo: f.repo } : {}) } : { project: key, name: f.name, instance: f.instance }; + void write(project ? 'createProject' : 'createThread', key, value, project ? 'projects' : 'threads'); + } + }); +diff --git a/packages/webui/src/serve.mjs b/packages/webui/src/serve.mjs +index 288871d0c..d9d27a062 100644 +--- a/packages/webui/src/serve.mjs ++++ b/packages/webui/src/serve.mjs +@@ -8,6 +8,7 @@ import { BusReadError, busStatus as coreBusStatus, subjectOk, sendOutcome } from + // Row 176, sage-1111: HTTP-only tester refusals; the row-164 transport pin stays untouched. + const busStatus = code => ['tester-off', 'tester-required'].includes(code) ? 403 : coreBusStatus(code); + import { ReadError, readStatus, fieldTable } from './reads.mjs'; ++import { THREAD_DEFINITIONS } from '../../business/src/vocabulary.mjs'; + import { chatHTTP } from './chat-http.mjs'; + import { processingHTTP } from './processing-http.mjs'; + +@@ -705,6 +706,25 @@ export async function startServer({ host = '127.0.0.1', port = 7330, board = DEF + if (req.method !== 'POST') return json(res, 405, { error: 'method not allowed' }); + return busSend(req, res, { send, preview: signer, log }); + } ++ // Row 219: labels only, from this listener's own human or tester bus, after auth above. ++ if (path === '/api/chat/instances') { ++ if (req.method !== 'GET') return json(res, 405, { error: 'method-not-allowed' }); ++ if (search) return json(res, 400, { error: 'invalid-request' }); ++ if (!bus?.instances) return json(res, 503, { error: 'not-configured' }); ++ try { ++ const value = await bus.instances(); ++ if (!value || !value.instances || typeof value.instances !== 'object' || Array.isArray(value.instances)) ++ throw new BusReadError('invalid-response'); ++ const rows = Object.entries(value.instances) ++ .filter(([, entry]) => THREAD_DEFINITIONS.includes(entry?.definition)) ++ .map(([instance, entry]) => ({ instance, name: entry.vars?.['persona.name'] || instance })); ++ if (rows.some(row => typeof row.name !== 'string')) throw new BusReadError('invalid-response'); ++ return json(res, 200, { rows, at: new Date().toISOString() }); ++ } catch (err) { ++ const code = err instanceof BusReadError ? err.code : 'invalid-response'; ++ return json(res, busStatus(code), { error: code }); ++ } ++ } + if (path === '/api/chat' || path.startsWith('/api/chat/')) { + return chatHTTP(req, res, { path, search, chat, named, send, preview: writer, log }); + } +diff --git a/packages/webui/tests/chat-browser.test.mjs b/packages/webui/tests/chat-browser.test.mjs +index f3eeeca96..cc3ec093d 100644 +--- a/packages/webui/tests/chat-browser.test.mjs ++++ b/packages/webui/tests/chat-browser.test.mjs +@@ -12,6 +12,7 @@ const HOSTILE = '\u001b[31m\u202eevil'; + const stub = `(() => { + const real = fetch.bind(window); + window.__writes=[];window.__reads=[];window.__answers=[];window.__pages=[]; ++ window.__instances=[{instance:'assistant',name:'assistant'}]; + window.__projects=[{id:'${P}', name:${JSON.stringify(HOSTILE)}, repo:null},{id:'\">',name:'Invalid record'}]; + window.__threads=[{id:'${A}',project:'${P}',name:'alpha',instance:'assistant'}, {id:'${B}',project:'${P}',name:'beta',instance:'assistant'}]; + window.fetch=async (url,init={})=>{ +@@ -33,6 +34,7 @@ const stub = `(() => { + window.__reads.push(path); + if(window.__holdRead && path.includes(window.__holdRead)){window.__heldSignal=init.signal;await new Promise(r=>window.__releaseRead=r);} + if(window.__readFailure)return new Response(JSON.stringify({error:window.__readFailure}),{status:window.__readFailure==='thread-not-owned'?403:503}); ++ if(path==='/api/chat/instances')return window.__instanceFailure ? new Response(JSON.stringify({error:'not-configured'}),{status:503}) : data({rows:window.__instances}); + if(path==='/api/chat/projects')return data({rows:window.__projects}); + if(path.startsWith('/api/chat/threads')&&!path.includes('/messages'))return data({rows:window.__threads}); + if(window.__pages.length)return data(window.__pages.shift()); +@@ -82,7 +84,7 @@ test('chat browser: list/create named projects and threads, hostile labels inert + await b.evaluate(`window.__answers.push({body:{id:'${A}',instance:'assistant'}}),true`); + await click('#chat-thread-form button[type=submit]'); + await wait('document.querySelector("#chat-send-form")'); +- assert.deepEqual(await b.evaluate('window.__writes[1].body'), { project: P, name: 'named thread' }); ++ assert.deepEqual(await b.evaluate('window.__writes[1].body'), { project: P, name: 'named thread', instance: 'assistant' }); + assert.equal(await b.evaluate('window.__writes[1].path'), '/api/chat/threads'); + assert.equal(await b.evaluate('window.__writes.length'), 2); + }); +@@ -264,3 +266,65 @@ test('chat browser: a late project creation receipt cannot navigate away from an + assert.equal(await b.evaluate('location.hash'), '#/chat/threads/' + A); + assert.equal(await b.evaluate('document.querySelector("#chat-body").value'), 'stay in alpha'); + }); ++ ++test('C2-09a picker: no silent choice, duplicate hostile labels stay inert, selection survives refresh and reaches POST', async t => { ++ const { b, wait, set, click, refresh } = await setup(t); ++ await b.evaluate(`window.__instances=[{instance:'bean',name:${JSON.stringify(HOSTILE)}},{instance:'chet',name:${JSON.stringify(HOSTILE)}}];location.hash='#/chat/projects/${P}';true`); ++ await wait('document.querySelectorAll("#chat-instance option").length===3'); ++ assert.equal(await b.evaluate('document.querySelector("#chat-instance").value'), ''); ++ assert.equal(await b.evaluate('document.querySelector("#chat-instance").required'), true); ++ assert.equal(await b.evaluate('document.querySelector("#chat-thread-form button").disabled'), true); ++ const labels = await b.evaluate('[...document.querySelectorAll("#chat-instance option")].map(o=>o.textContent)'); ++ assert.match(labels[1], /\(bean\)/); ++ assert.match(labels[2], /\(chet\)/); ++ assert.doesNotMatch(labels.join(''), /[\u202a-\u202e\u2066-\u2069]/u); ++ assert.equal(await b.evaluate('!!document.querySelector("#chat-thread-form img")'), false); ++ assert.equal(await b.evaluate('window.injected'), undefined); ++ await set('#chat-thread-name', 'Bean discussion'); ++ await click('#chat-thread-form button'); ++ assert.equal(await b.evaluate('window.__writes.length'), 0); ++ await set('#chat-instance', 'bean'); ++ await refresh(); ++ assert.equal(await b.evaluate('document.querySelector("#chat-instance").value'), 'bean'); ++ assert.equal(await b.evaluate('document.querySelector("#chat-thread-name").value'), 'Bean discussion'); ++ assert.equal(await b.evaluate('document.querySelector("#chat-thread-form button").disabled'), false); ++ await b.evaluate(`window.__answers.push({body:{id:'${A}',instance:'bean'}});true`); ++ await click('#chat-thread-form button'); ++ await wait('window.__writes.length===1'); ++ assert.deepEqual(await b.evaluate('window.__writes[0]'), { path: '/api/chat/threads', body: { project: P, name: 'Bean discussion', instance: 'bean' }, redirect: 'manual' }); ++}); ++ ++test('C2-09a picker: metadata failure, empty set and removed pick explain disabled state and recover without switching', async t => { ++ const { b, wait, set, refresh } = await setup(t); ++ await b.evaluate(`window.__instanceFailure=true;location.hash='#/chat/projects/${P}';true`); ++ await wait('document.querySelector("#chat-thread-form") && !document.querySelector(".chat-loading")'); ++ assert.match(await b.evaluate('document.querySelector("#chat-thread-form [role=status]").textContent'), /read the thread instances/); ++ assert.equal(await b.evaluate('document.querySelector("#chat-thread-form button").disabled'), true); ++ await b.evaluate('window.__instanceFailure=false;window.__instances=[];true'); ++ await refresh(); ++ assert.match(await b.evaluate('document.querySelector("#chat-thread-form [role=status]").textContent'), /No thread instances/); ++ assert.equal(await b.evaluate('document.querySelector("#chat-thread-form button").disabled'), true); ++ await b.evaluate("window.__instances=[{instance:'bean',name:'Bean'},{instance:'chet',name:'Chet'}];true"); ++ await refresh(); ++ await set('#chat-instance', 'bean'); ++ await b.evaluate("window.__instances=[{instance:'chet',name:'Chet'}];true"); ++ await refresh(); ++ assert.equal(await b.evaluate('document.querySelector("#chat-instance").value'), ''); ++ assert.match(await b.evaluate('document.querySelector("#chat-thread-form [role=status]").textContent'), /no longer available/); ++ assert.equal(await b.evaluate('document.querySelector("#chat-thread-form button").disabled'), true); ++ await refresh(); ++ assert.equal(await b.evaluate('document.querySelector("#chat-instance").value'), '', 'another refresh must not silently select the one remaining instance'); ++ await set('#chat-instance', 'chet'); ++ assert.equal(await b.evaluate('document.querySelector("#chat-thread-form button").disabled'), false); ++}); ++ ++test('C2-09a picker: a single instance is chosen explicitly but read-only mode cannot create a thread', async t => { ++ const { b, wait } = await setup(t, '?readonly'); ++ await b.evaluate(`location.hash='#/chat/projects/${P}';true`); ++ await wait('document.querySelectorAll("#chat-instance option").length===2'); ++ assert.equal(await b.evaluate('document.querySelector("#chat-instance").value'), 'assistant'); ++ assert.equal(await b.evaluate('document.querySelector("#chat-instance").disabled'), true); ++ assert.equal(await b.evaluate('document.querySelector("#chat-thread-form button").disabled'), true); ++ assert.match(await b.evaluate('document.querySelector(".chat-area").textContent'), /only reads/); ++ assert.equal(await b.evaluate('window.__writes.length'), 0); ++}); +diff --git a/packages/webui/tests/chat-instances.test.mjs b/packages/webui/tests/chat-instances.test.mjs +new file mode 100644 +index 000000000..893c38f80 +--- /dev/null ++++ b/packages/webui/tests/chat-instances.test.mjs +@@ -0,0 +1,87 @@ ++import test from 'node:test'; ++import assert from 'node:assert/strict'; ++import { request } from 'node:http'; ++import { mkdtempSync, rmSync } from 'node:fs'; ++import { join } from 'node:path'; ++import { tmpdir } from 'node:os'; ++import { startServer } from '../src/serve.mjs'; ++import { startTesterSocket, TESTER_ORIGIN } from '../src/tester-socket.mjs'; ++import { close } from './fixture.mjs'; ++ ++const path = '/api/chat/instances'; ++const preview = { host: 'chat.example', header: 'x-user', user: 'jason' }; ++const snapshot = { ++ revision: 'a'.repeat(64), plugins: { private: 'do-not-project' }, ++ instances: { ++ assistant: { definition: 'assistant', vars: { model: 'private-model' } }, ++ bean: { definition: 'companion', vars: { 'persona.name': 'Bean', 'persona.sha256': 'private-hash' } }, ++ chet: { definition: 'continuity', vars: { 'persona.name': 'Bean', file: '/private/path' } }, ++ pm: { definition: 'pm', vars: { 'persona.name': 'Hidden PM' } }, ++ }, ++}; ++function get(server, { route = path, method = 'GET', headers = {} } = {}) { ++ const address = server.address(), unix = typeof address === 'string'; ++ return new Promise((resolve, reject) => { ++ const req = request({ ...(unix ? { socketPath: address } : { host: '127.0.0.1', port: address.port }), ++ path: route, method, headers: { host: unix ? new URL(TESTER_ORIGIN).host : preview.host, ...headers } }, res => { ++ let text = ''; ++ res.on('data', chunk => text += chunk); ++ res.on('end', () => resolve({ status: res.statusCode, text, value: JSON.parse(text) })); ++ }); ++ req.on('error', reject); req.end(); ++ }); ++} ++test('C2-09a metadata uses the human listener bus, projects labels only and refuses unauthenticated reads', async t => { ++ let calls = 0; ++ const server = await startServer({ port: 0, preview, bus: { instances: async () => { calls++; return snapshot; } } }); ++ t.after(() => close(server)); ++ const refused = await get(server); ++ assert.equal(refused.status, 401); ++ assert.equal(calls, 0); ++ const answer = await get(server, { headers: { 'x-user': 'jason' } }); ++ assert.equal(answer.status, 200); ++ assert.deepEqual(answer.value.rows, [{ instance: 'assistant', name: 'assistant' }, { instance: 'bean', name: 'Bean' }, { instance: 'chet', name: 'Bean' }]); ++ for (const row of answer.value.rows) assert.deepEqual(Object.keys(row).sort(), ['instance', 'name']); ++ assert.doesNotMatch(answer.text, /private|Hidden PM/); ++ assert.equal(calls, 1); ++ for (const options of [{ route: path + '?extra=1' }, { method: 'POST' }]) { ++ const result = await get(server, { ...options, headers: { 'x-user': 'jason' } }); ++ assert.ok([400, 405].includes(result.status)); ++ } ++ assert.equal(calls, 1, 'invalid metadata requests never call a bus'); ++}); ++test('C2-09a metadata uses the private tester listener own bus and no human transport', async t => { ++ const root = mkdtempSync(join(tmpdir(), 'chat219-')); t.after(() => rmSync(root, { recursive: true, force: true })); ++ let reads = 0; ++ const server = await startTesterSocket({ dataRoot: root, board: 'http://127.0.0.1:9', ++ bus: { instances: async () => { reads++; return { instances: { quill: { definition: 'proofreader', vars: { 'persona.name': 'Quill' } } } }; } } }); ++ t.after(() => close(server)); ++ const answer = await get(server); ++ assert.equal(answer.status, 200); ++ assert.deepEqual(answer.value.rows, [{ instance: 'quill', name: 'Quill' }]); ++ assert.equal(reads, 1); ++}); ++test('C2-09a metadata refuses missing or malformed reads and never echoes untrusted fields', async t => { ++ for (const bus of [null, { instances: async () => ({ instances: [] }) }, { instances: async () => { throw new Error('private-path'); } }]) { ++ const server = await startServer({ port: 0, preview, bus }); t.after(() => close(server)); ++ const answer = await get(server, { headers: { 'x-user': 'jason' } }); ++ assert.ok(answer.status >= 400); ++ assert.doesNotMatch(answer.text, /private-path/); ++ } ++}); ++ ++test('C2-09a metadata stays behind the SSO session check and a GET never refreshes session activity', async t => { ++ let session = null, reads = 0; ++ const touches = []; ++ const sso = { publicHost: 'sso-chat.example', publicOrigin: 'https://sso-chat.example', formTargets: () => [], ++ session: (_req, { touch }) => { touches.push(touch); return session; } }; ++ const server = await startServer({ port: 0, sso, bus: { instances: async () => { reads++; return snapshot; } } }); ++ t.after(() => close(server)); ++ const headers = { host: sso.publicHost }; ++ assert.equal((await get(server, { headers })).status, 401); ++ assert.equal(reads, 0); ++ session = { name: 'jason' }; ++ assert.equal((await get(server, { headers })).status, 200); ++ assert.equal(reads, 1); ++ assert.deepEqual(touches, [false, false]); ++}); +diff --git a/packages/webui/tests/chat.test.mjs b/packages/webui/tests/chat.test.mjs +index 8c11611cf..b47ecf1a7 100644 +--- a/packages/webui/tests/chat.test.mjs ++++ b/packages/webui/tests/chat.test.mjs +@@ -335,3 +335,21 @@ test('the chat seam names the transport it is given: the human one and the teste + assert.throws(() => createChat({}), { name: 'TypeError', message: 'chat needs a bus transport function' }); + assert.equal(typeof createChat({ call: async () => ({}) }).projects, 'function'); + }); ++ ++test('C2-09a createThread forwards an explicit instance through the existing channel', async t => { ++ const c = await setup(t); ++ c.state.answer = { id: T, instance: 'bean' }; ++ const answer = await c.get('/api/chat/threads', { method: 'POST', value: { project: P, name: 'Bean work', instance: 'bean' } }); ++ assert.equal(answer.status, 200); ++ assert.deepEqual(c.calls, [['thread.create', { project: P, name: 'Bean work', instance: 'bean' }]]); ++ assert.equal(answer.data.instance, 'bean'); ++}); ++test('C2-09a malformed instance and extra thread fields refuse before the channel write', async t => { ++ const c = await setup(t); ++ for (const value of [null, 7, {}, [], '', 'bad name', 'bean/../../other']) { ++ const answer = await c.get('/api/chat/threads', { method: 'POST', value: { project: P, name: 'work', instance: value } }); ++ assert.equal(answer.status, 400, JSON.stringify(value)); ++ } ++ assert.equal((await c.get('/api/chat/threads', { method: 'POST', value: { project: P, name: 'work', instance: 'bean', extra: true } })).status, 400); ++ assert.deepEqual(c.calls, []); ++}); diff --git a/agents/rocko/work/queue-219/candidate-manifest.sha256 b/agents/rocko/work/queue-219/candidate-manifest.sha256 new file mode 100644 index 000000000..562f298c7 --- /dev/null +++ b/agents/rocko/work/queue-219/candidate-manifest.sha256 @@ -0,0 +1,14 @@ +38c4cb694cb756cfc771395afbeaa0779737bb94bc55bd1ea3a72a00d5448041 packages/bus/src/broker.mjs +b0c66c8999b567896923f6c876911dba936c6eca1ccc7aaeada51369fd613594 packages/bus/tests/creative.test.mjs +de4913f50801a11fd172e3f2c2b3cb41ab04e84d32a6650d1c8662b5e227ea3d packages/bus/tests/threads.test.mjs +8f7d6745fffb2a0898ac80c012084ac48964748da6439a8c56facc6529ffb19b packages/bus/tests/user-principal.test.mjs +c905590032b6f8eb7d607d04ce6a585ed783a0c84033dd8436eab7922f2251e1 packages/cli/src/launcher.mjs +fc301cde49e6db1286e90d6ac3410f5f4d87351bec61f1bae27c235a041848b6 packages/cli/tests/launcher.test.mjs +a219036737419870e0aa9d0da20843759a66be5bafff44d3292593833f8fcb9a packages/cli/tests/thread-launch.test.mjs +cbfd54e6b375561d1e4679ee8d78a3285f970d9a7198cec9d22a06510a36afba packages/webui/src/chat-http.mjs +f49a49c6ec69783190d3f5eaf34316cb4d2c44d10d2ee9336fe1383207afefff packages/webui/src/chat.mjs +8e89df5fe8a9da35de41b5968afc6efcd92503e92ef28c6f557bb5371d10d1a4 packages/webui/src/public/chat.js +a597cc4902a873fe15650dacfce14dbc897db26310a7b6a24c293287add946c8 packages/webui/src/serve.mjs +d918e5b061ced9db28337a9b02c7042f9ddafaf09f32affce9f51190c0cba93f packages/webui/tests/chat-browser.test.mjs +2bad14535372488de326b82b791b79a61e1a4ab839458535132958ef85b746eb packages/webui/tests/chat-instances.test.mjs +7779d33d5b1dd3fe183722d0f91ff1f71e741e113cf2d5ee407f3d26428fc162 packages/webui/tests/chat.test.mjs diff --git a/agents/rocko/work/queue-219/changed-paths.txt b/agents/rocko/work/queue-219/changed-paths.txt new file mode 100644 index 000000000..689c1cf8e --- /dev/null +++ b/agents/rocko/work/queue-219/changed-paths.txt @@ -0,0 +1,14 @@ +packages/bus/src/broker.mjs +packages/bus/tests/creative.test.mjs +packages/bus/tests/threads.test.mjs +packages/bus/tests/user-principal.test.mjs +packages/cli/src/launcher.mjs +packages/cli/tests/launcher.test.mjs +packages/cli/tests/thread-launch.test.mjs +packages/webui/src/chat-http.mjs +packages/webui/src/chat.mjs +packages/webui/src/public/chat.js +packages/webui/src/serve.mjs +packages/webui/tests/chat-browser.test.mjs +packages/webui/tests/chat-instances.test.mjs +packages/webui/tests/chat.test.mjs diff --git a/agents/rocko/work/queue-219/mutants.json b/agents/rocko/work/queue-219/mutants.json new file mode 100644 index 000000000..10d146810 --- /dev/null +++ b/agents/rocko/work/queue-219/mutants.json @@ -0,0 +1,193 @@ +[ + { + "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: explicit creative" + }, + { + "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\";" + } + ] + } +] diff --git a/agents/rocko/work/queue-219/old-persona-test.diff b/agents/rocko/work/queue-219/old-persona-test.diff new file mode 100644 index 000000000..84128f45a --- /dev/null +++ b/agents/rocko/work/queue-219/old-persona-test.diff @@ -0,0 +1,40 @@ +diff --git a/packages/cli/tests/launcher.test.mjs b/packages/cli/tests/launcher.test.mjs +index 2202c7753..0a34fe27a 100644 +--- a/packages/cli/tests/launcher.test.mjs ++++ b/packages/cli/tests/launcher.test.mjs +@@ -773,21 +773,28 @@ test("row 213 a creative instance's persona is read from /personas: o + const dir = join(given.root, "config", "personas", "acme"); + mkdirSync(dir, { recursive: true, mode: 0o700 }); + writeFileSync(join(dir, "bean.md"), "Not the pinned text.\n", { mode: 0o600 }); +- const { f, host, launcher } = await setup(t, undefined, given); +- // The chief of staff holds role.launch; a test chief session bound to this process asks. +- const chief = await host.bindLaunch({ business: "acme", role: "chief", run: "chief-test", harness: "pi", pid: process.pid, startTime: startTimeOf(process.pid) }); +- await new Client({ path: host.path, cap: chief.cap }).call("role.claim"); +- // The bundle's refusal comes back as launch-failed, as webPlan's does, with its reason in the log. +- assert.deepEqual(await launcher.fromSession(chief.cap, "bean"), { ok: false, error: "launch-failed" }); ++ // Row 219: creative instances launch from their thread, not from a chief's standalone request. ++ // The mismatch occurs before bindLaunch, so only the host's thread-state snapshot is a fixture. ++ const thread = 'persona-thread'; ++ const { f, launcher } = await setup(t, undefined, given, { wrap: host => ({ ++ ...host, ++ op: message => message.op === 'threadsState' ++ ? Promise.resolve([{ thread, instance: 'bean', holder: null, pending: 1 }]) ++ : host.op(message), ++ }) }); ++ // The bundle's refusal remains launch-failed with the persona mismatch as its reason. ++ await launcher.tick(); + const [e] = log(f); + assert.deepEqual([e.event, e.code, log(f).length], ["refused", "launch-failed", 1]); ++ assert.equal(e.thread, thread); + assert.equal(e.why, `instance bean: persona file ${join(dir, "bean.md")} isn't the file persona.sha256 names`); + assert.ok(!JSON.stringify(log(f)).includes("PERSONA-MARKER-d2")); + assert.deepEqual(readSessions(f.dataRoot), []); + // The run directory exists by then (BUILD.md residual); the persona is read before any bundle file. + const runs = readdirSync(join(f.dataRoot, "launches", "acme")); + assert.equal(runs.length, 1); +- assert.deepEqual(readdirSync(join(f.dataRoot, "launches", "acme", runs[0])), ["session"]); ++ assert.deepEqual(readdirSync(join(f.dataRoot, "launches", "acme", runs[0])), []); ++ assert.equal(existsSync(join(f.dataRoot, "threads", "acme", thread, "session")), true); + }); + + test("row 64 on Claude Code a role skill that isn't enabled refuses the same way, before anything starts", { timeout: 30000 }, async (t) => { diff --git a/agents/rocko/work/queue-219/prepare-mutants.py b/agents/rocko/work/queue-219/prepare-mutants.py new file mode 100644 index 000000000..63263d48f --- /dev/null +++ b/agents/rocko/work/queue-219/prepare-mutants.py @@ -0,0 +1,39 @@ +"""Static preparation only. Executing tests requires Sage CLEAR.""" +from pathlib import Path +import json +root=Path(__file__).resolve().parents[4] +p=Path(__file__).resolve().parent +specs=[] +def site(id,file,old,new,test,pattern): + text=(root/file).read_text();assert text.count(old)==1,(id,text.count(old)) + specs.append(dict(id=id,file=file,old=old,new=new,test=test,pattern=pattern)) +bus='packages/bus/src/broker.mjs';bt='packages/bus/tests/threads.test.mjs';cli='packages/cli/src/launcher.mjs';ct='packages/cli/tests/thread-launch.test.mjs';web='packages/webui/src/serve.mjs';wt='packages/webui/tests/chat-instances.test.mjs';browser='packages/webui/src/public/chat.js';brtest='packages/webui/tests/chat-browser.test.mjs' +site('T01',bus,'return THREAD_DEFINITIONS.includes(this.#business(business).roles[role]?.definition);',"return this.#business(business).roles[role]?.definition === 'assistant';",bt,'C2-09a: explicit creative') +site('T02',bus,': identifier(a.instance);',': instances[0];',bt,'C2-09a: explicit creative') +site('T03',bus,"if (!instances.length || (a.instance !== undefined && !instances.includes(instance))) fail('thread-instance-missing');","if (!instances.length) fail('thread-instance-missing');",bt,'C2-09a: explicit missing') +site('T04',bus,"if (a.instance === undefined && instances.length > 1) fail('thread-instance-ambiguous');","if (false) fail('thread-instance-ambiguous');",bt,'C2-09a: explicit creative') +site('T05',bus,"!this.#granted(s, 'thread.create', identifier(a.project), instance)","!this.#granted(s, 'thread.create', identifier(a.project), null)",'packages/bus/tests/user-principal.test.mjs','C2-09a: naming an instance') +site('T06',cli,'const threaded = THREAD_DEFINITIONS.includes(b.roles[instance]?.definition);','const threaded = b.roles[instance]?.definition === "assistant";',ct,'C2-09a: creative thread messages') +site('T07',web,'.filter(([, entry]) => THREAD_DEFINITIONS.includes(entry?.definition))','.filter(() => true)',wt,'C2-09a metadata uses the human') +site('T08',web,"name: entry.vars?.['persona.name'] || instance",'name: instance',wt,'C2-09a metadata uses the human') +site('T09','packages/webui/src/chat-http.mjs',"(Object.hasOwn(v, 'instance') && (typeof v.instance !== 'string' || !KEY.test(v.instance)))",'false','packages/webui/tests/chat.test.mjs','C2-09a malformed instance') +site('T10','packages/webui/src/chat.mjs',"createThread: ({ project, name, instance }) => channel('thread.create', { project, name, ...(instance === undefined ? {} : { instance }) }),","createThread: ({ project, name, instance }) => channel('thread.create', { project, name }),",'packages/webui/tests/chat.test.mjs','C2-09a createThread forwards') +site('T11',browser,": { project: key, name: f.name, instance: f.instance };",": { project: key, name: f.name };",brtest,'C2-09a picker: no silent choice') +site('T12',browser,'!f.instance && listed.rows.length === 1','!f.instance && listed.rows.length >= 1',brtest,'C2-09a picker: no silent choice') +site('T13',browser,'current.instanceError = "Couldn\'t read the thread instances; reload to try again";',"current.instanceError = '';",brtest,'C2-09a picker: metadata failure') +site('T14',browser,'txt(row.name === row.instance ? row.instance : `${row.name} (${row.instance})`)','txt(row.name)',brtest,'C2-09a picker: no silent choice') +site('T15',browser,'if (f.instance && !listed.rows.some(row => row.instance === f.instance)) {','if (false) {',brtest,'C2-09a picker: metadata failure') +site('T16',browser,"f.instance = ''; f.instanceChosen = true;","f.instance = ''; f.instanceChosen = false;",brtest,'C2-09a picker: metadata failure') +site('T17',browser,"const unavailable = !project && (!!current.instanceError || !choices.some(row => row.instance === f.instance));",'const unavailable = false;',brtest,'C2-09a picker: no silent choice') +# Route-local guards include their full unique response text to avoid touching other routes. +site('T18',web,"if (req.method !== 'GET') return json(res, 405, { error: 'method-not-allowed' });","if (false) return json(res, 405, { error: 'method-not-allowed' });",wt,'C2-09a metadata uses the human') +site('T19',web,"if (search) return json(res, 400, { error: 'invalid-request' });","if (false) return json(res, 400, { error: 'invalid-request' });",wt,'C2-09a metadata uses the human') +site('T20',browser,"current.instances = listed.rows; current.instanceError = '';","current.instances = listed.rows;",brtest,'C2-09a picker: metadata failure') +site('T21',web,"({ instance, name: entry.vars?.['persona.name'] || instance })","({ instance, name: entry.vars?.['persona.name'] || instance, vars: entry.vars })",wt,'C2-09a metadata uses the human') +site('T22',cli,'const threaded = THREAD_DEFINITIONS.includes(b.roles[r.instance]?.definition);','const threaded = b.roles[r.instance]?.definition === "assistant";',ct,'C2-09a: terminating one creative thread') +site('T23',cli,'const threaded = THREAD_DEFINITIONS.includes(b.roles[instance]?.definition);','const threaded = b.roles[instance]?.definition === "assistant";',ct,'C2-09a: fromSession refuses a creative instance outside a thread without a sandbox') +ending_old='const threaded = THREAD_DEFINITIONS.includes(b.roles[r.instance]?.definition);' +assert (root/cli).read_text().count(ending_old)==1 +specs[-1]['additional_edits']=[dict(file=cli,old=ending_old,new='const threaded = b.roles[r.instance]?.definition === "assistant";')] +(p/'mutants.json').write_text(json.dumps(specs,indent=2)+'\n') +print('STATIC_PREFLIGHT',len(specs),'exact-once sites; no tests run') diff --git a/packages/bus/src/broker.mjs b/packages/bus/src/broker.mjs index d76085739..11061c778 100644 --- a/packages/bus/src/broker.mjs +++ b/packages/bus/src/broker.mjs @@ -4,7 +4,7 @@ import { initializeControl, processingStatus } from '../../processing-control/sr import { NAME as HARNESS_NAME } from '../../plugins/src/kinds.mjs'; import { loadRequirements } from '../../tasks/src/requirements.mjs'; import { MERGE, LandingRefusal, readLanding } from './landing.mjs'; -import { ID_PATTERN, THREAD_DEFINITION, END_PROTECTED, forkProblem, forkUrl, credentialKind, validArgv, commandAllowed, HOST_ID, CREATIVE_DEFINITIONS, unhireableAction, giteaName, parseGiteaUrl, covers } from '../../business/src/vocabulary.mjs'; +import { ID_PATTERN, THREAD_DEFINITIONS, END_PROTECTED, forkProblem, forkUrl, credentialKind, validArgv, commandAllowed, HOST_ID, CREATIVE_DEFINITIONS, unhireableAction, giteaName, parseGiteaUrl, covers } from '../../business/src/vocabulary.mjs'; // Kept closed while S1 lands; its vocabulary is the integration authority. export const ACTIONS = Object.freeze([ @@ -314,7 +314,7 @@ const enrollBinding = (enroll) => ({ }); // r6 E3: the installer line's comment, then the tag's 32 hex digits. const INSTALLER_COMMENT = 'mosaic-installer-'; -// Row 121 (#1615): an instance of THREAD_DEFINITION (vocabulary.mjs since row 155) talks with the +// Row 121 (#1615): an instance of THREAD_DEFINITIONS (vocabulary.mjs since row 213) talks with the // user in threads. Its runs claim a thread, not the role, and every message to or from it names its // thread (REQ-MSG-1). // Row 146 (#1640): the sender of the bus's notice to launch.by. A role instance name matches the @@ -598,7 +598,7 @@ export class Broker { ); } #threaded(business, role) { - return this.#business(business).roles[role]?.definition === THREAD_DEFINITION; + return THREAD_DEFINITIONS.includes(this.#business(business).roles[role]?.definition); } // Row 264a (#1769): a claim holds one session of a thread, and each session has its own holder. #sessionHolder(session) { @@ -6068,24 +6068,27 @@ export class Broker { .all('SELECT id,at,name,repo FROM projects WHERE business=? ORDER BY seq', s.business) .filter((p) => !s.user || this.#granted(s, 'project.list', p.id, null)); } - // A thread belongs to the user who made it and to the business's one thread instance. + // A thread belongs to the user who made it and to one declared thread instance. // Row 177 (#1675): a tester's thread is owned by `tester`, so neither reaches the other's. case 'thread.create': { if (!s.tester && !s.user) this.#human(s); - keys(a, ['project', 'name'], ['project', 'name']); + keys(a, ['project', 'name', 'instance'], ['project', 'name']); if (!name(a.name)) fail('invalid-request'); + const instances = Object.keys(b.roles).filter((r) => this.#threaded(s.business, r)); + const instance = a.instance === undefined + ? (instances.length === 1 ? instances[0] : null) + : identifier(a.instance); // FED R3 (design 3.5): a user's grant must cover the project and the thread instance, checked // before the project is looked up, so an ungranted id reads the same whether it exists or not. if (s.user) { - const threaded = Object.keys(b.roles).filter((r) => this.#threaded(s.business, r)); - if (threaded.length !== 1 || !this.#granted(s, 'thread.create', identifier(a.project), threaded[0])) fail('access-refused'); + if (!instance || !instances.includes(instance) || !this.#granted(s, 'thread.create', identifier(a.project), instance)) + fail('access-refused'); } if (!this.#store.get('SELECT 1 FROM projects WHERE id=? AND business=?', identifier(a.project), s.business)) fail('project-not-found'); - // The bus never picks between instances; the business file declares exactly one. - const instances = Object.keys(b.roles).filter((r) => this.#threaded(s.business, r)); - if (!instances.length) fail('thread-instance-missing'); - if (instances.length > 1) fail('thread-instance-ambiguous'); + // The human selects an instance; omission is compatible only with one candidate. + if (!instances.length || (a.instance !== undefined && !instances.includes(instance))) fail('thread-instance-missing'); + if (a.instance === undefined && instances.length > 1) fail('thread-instance-ambiguous'); if (this.#store.get('SELECT 1 FROM threads WHERE project=? AND name=?', a.project, a.name)) fail('thread-exists'); const tid = randomUUID(); this.#store.run( @@ -6094,13 +6097,13 @@ export class Broker { this.#now(), s.business, a.project, - instances[0], + instance, this.#owner(s), a.name, ); // Row 264a (#1769, D3): every thread has a default session from the start. - this.#newSession(s, { id: tid, business: s.business, instance: instances[0], owner: this.#owner(s) }, 'default', 'default', true); - return { id: tid, instance: instances[0] }; + this.#newSession(s, { id: tid, business: s.business, instance, owner: this.#owner(s) }, 'default', 'default', true); + return { id: tid, instance }; } // Row 177 (#1675): each lists its own threads. The human's list leaves out the tester's, // and the tester's lists only its own (row 175 listed it the business human's). diff --git a/packages/bus/tests/creative.test.mjs b/packages/bus/tests/creative.test.mjs index 6cfbf1cd6..6d421ba19 100644 --- a/packages/bus/tests/creative.test.mjs +++ b/packages/bus/tests/creative.test.mjs @@ -44,15 +44,18 @@ function setup(t) { const caps = {}; caps.human = b.bindHuman({ business: 'demo', human: 'jason', via: 'cli', outsideAgent: true }); const project = b.request(caps.human, { verb: 'project.create', args: { name: 'demo' } }).id; - const thread = b.request(caps.human, { verb: 'thread.create', args: { project, name: 'main' } }).id; + const thread = b.request(caps.human, { verb: 'thread.create', args: { project, name: 'main', instance: 'assistant' } }).id; + const threads = { assistant: thread }; for (const role of Object.keys(roles)) { - caps[role] = b.bindLaunch({ business: 'demo', role, run: `${role}-run`, harness: 'pi', ...(role === 'assistant' ? { thread } : {}) }); + if (['bean', 'quill'].includes(role)) + threads[role] = b.request(caps.human, { verb: 'thread.create', args: { project, name: role, instance: role } }).id; + caps[role] = b.bindLaunch({ business: 'demo', role, run: `${role}-run`, harness: 'pi', ...(threads[role] ? { thread: threads[role] } : {}) }); b.request(caps[role], { verb: 'role.claim' }); } caps.tester = b.bindTester({ business: 'demo' }); const call = (who, verb, args = {}) => b.request(caps[who], { verb, args }); const count = (sql) => store.get(sql).n; - return { call, count, store }; + return { call, count, store, threads }; } const raise = { action: 'policy.change', question: 'Change?', options: [{ key: 'yes', text: 'Yes' }, { key: 'no', text: 'No' }], recommendation: 'yes', blocking: false }; @@ -72,7 +75,7 @@ test('M6: a creative raise refuses decision-not-allowed, cited or not, and no de }); test('a creative instance sends only to the user and hears only from the user', (t) => { - const { call, count } = setup(t); + const { call, count, threads } = setup(t); for (const who of ['bean', 'quill']) { call(who, 'message.send', { to: 'human', body: 'hello' }); for (const to of ['chief', 'assistant', 'pm', 'bean', 'quill'].filter((n) => n !== who)) { @@ -81,7 +84,7 @@ test('a creative instance sends only to the user and hears only from the user', for (const from of ['chief', 'pm']) { assert.throws(() => call(from, 'message.send', { to: who, body: 'hello' }), { code: 'message-sender-refused' }, `${from} to ${who}`); } - call('human', 'message.send', { to: who, body: 'hello' }); + call('human', 'thread.send', { thread: threads[who], body: 'hello' }); } assert.equal(count("SELECT count(*) n FROM messages WHERE from_role IN ('bean','quill')"), 2); assert.equal(count("SELECT count(*) n FROM messages WHERE to_role IN ('bean','quill')"), 2); diff --git a/packages/bus/tests/threads.test.mjs b/packages/bus/tests/threads.test.mjs index 8b31da9f9..1410ec3fa 100644 --- a/packages/bus/tests/threads.test.mjs +++ b/packages/bus/tests/threads.test.mjs @@ -601,3 +601,42 @@ test('project.create keeps unrelated names with and without a repository', t => { id: linked.id, name: 'work', repo: 'stack' }, ]); }); + +test('C2-09a: explicit creative instances bind independent threads, default sessions and holders', t => { + const creative = ['companion', 'ideas', 'research', 'proofreader', 'fact-checker', 'continuity']; + const extra = Object.fromEntries(creative.map((definition, i) => [`writer${i}`, { definition, authority: { withinRole: ['message.send'], crossRole: [] } }])); + const ctx = setup(t, demo({ roles: { ...roles, ...extra }, definitions: { + ...definitions, ...Object.fromEntries(creative.map(definition => [definition, { messaging: shipped(definition).messaging }])), + } })); + const project = ctx.call('human', 'project.create', { name: 'Writing' }).id; + assert.throws(() => ctx.call('human', 'thread.create', { project, name: 'ambiguous' }), { code: 'thread-instance-ambiguous' }); + for (const [instance, role] of Object.entries(extra)) { + const receipt = ctx.call('human', 'thread.create', { project, name: instance, instance }); + assert.equal(receipt.instance, instance); + assert.equal(ctx.store.get('SELECT instance FROM threads WHERE id=?', receipt.id).instance, instance); + assert.equal(ctx.store.get('SELECT instance FROM sessions WHERE thread=?', receipt.id).instance, instance); + ctx.launch(instance, instance, { thread: receipt.id }); + assert.equal(ctx.claim(instance).thread, receipt.id); + const sent = ctx.call('human', 'thread.send', { thread: receipt.id, body: `For ${instance}` }); + const read = ctx.call(instance, 'message.receive'); + assert.deepEqual(read.map(m => m.id), [sent.id], role.definition); + assert.equal(ctx.threadOf(sent.id), receipt.id); + assert.equal(ctx.store.get('SELECT count(*) n FROM role_claims WHERE role=?', instance).n, 0); + assert.throws(() => ctx.call('human', 'message.send', { to: instance, body: 'No implicit thread' }), + { code: 'thread-required-use-thread-send' }); + } + assert.equal(ctx.count('SELECT count(*) n FROM threads'), creative.length); +}); + +test('C2-09a: explicit missing, non-thread and malformed selectors create no thread or session', t => { + const ctx = setup(t); + const project = ctx.call('human', 'project.create', { name: 'Writing' }).id; + for (const instance of ['not-declared', 'pm', 'coder']) + assert.throws(() => ctx.call('human', 'thread.create', { project, name: instance, instance }), { code: 'thread-instance-missing' }); + for (const instance of [null, 7, {}, [], '', 'bad name']) + assert.throws(() => ctx.call('human', 'thread.create', { project, name: 'bad', instance }), { code: 'invalid-request' }); + assert.equal(ctx.count('SELECT count(*) n FROM threads'), 0); + assert.equal(ctx.count('SELECT count(*) n FROM sessions'), 0); + const legacy = ctx.call('human', 'thread.create', { project, name: 'Default' }); + assert.equal(legacy.instance, 'assistant'); +}); diff --git a/packages/bus/tests/user-principal.test.mjs b/packages/bus/tests/user-principal.test.mjs index 4dcd1ebeb..8471ddf85 100644 --- a/packages/bus/tests/user-principal.test.mjs +++ b/packages/bus/tests/user-principal.test.mjs @@ -23,7 +23,7 @@ const grant = (over = {}) => ({ }); // `processing` stands in for the halt switch, as lifecycle-verbs.test.mjs's T15 does. -function setup(t, { grants = [grant()], processing = null } = {}) { +function setup(t, { grants = [grant()], processing = null, threadRoles = {} } = {}) { const root = mkdtempSync(join(tmpdir(), 'bus-user-principal-')); const store = new Store(root); t.after(() => { @@ -40,6 +40,7 @@ function setup(t, { grants = [grant()], processing = null } = {}) { roles: { chief: { definition: 'chief-of-staff', authority: { withinRole: ['message.send'], crossRole: [] } }, assistant: { definition: 'assistant', authority: { withinRole: ['message.send'], crossRole: [] } }, + ...threadRoles, }, definitions: { 'chief-of-staff': {}, assistant: { messaging: shipped('assistant').messaging } }, }, @@ -394,3 +395,21 @@ test('R3 r4: the chief\'s hire refuses an instance named user with the code it g test('R3 r4: a non-function access throws before the store is read', () => { assert.throws(() => new Broker({ store: null, businesses: { demo: {} }, access: 'access.json' }), /access must be a function/); }); + +test('C2-09a: naming an instance cannot bypass its collaborator grant or disclose an ungranted project', t => { + const ctx = setup(t, { threadRoles: { bean: { definition: 'companion', authority: { withinRole: ['message.send'], crossRole: [] } } } }); + const project = ctx.call('human', 'project.create', { name: 'shared' }).id; + const privateProject = ctx.call('human', 'project.create', { name: 'private' }).id; + ctx.access.doc.grants = [grant({ projects: [project] })]; + ctx.user('alice'); + assert.equal(ctx.code('alice', 'thread.create', { project, name: 'blocked bean', instance: 'bean' }), 'access-refused'); + for (const id of [privateProject, '00000000-0000-4000-8000-000000000000']) + assert.equal(ctx.code('alice', 'thread.create', { project: id, name: 'blocked project', instance: 'assistant' }), 'access-refused'); + assert.equal(ctx.store.get('SELECT count(*) n FROM threads').n, 0); + const allowed = ctx.call('alice', 'thread.create', { project, name: 'assistant work', instance: 'assistant' }); + assert.equal(allowed.instance, 'assistant'); + ctx.access.doc.grants = [grant({ projects: [project], instances: ['bean'] })]; + const bean = ctx.call('alice', 'thread.create', { project, name: 'bean work', instance: 'bean' }); + assert.equal(bean.instance, 'bean'); + assert.equal(ctx.code('alice', 'thread.create', { project, name: 'old instance', instance: 'assistant' }), 'access-refused'); +}); diff --git a/packages/cli/src/launcher.mjs b/packages/cli/src/launcher.mjs index bfe55b61e..d8248284c 100644 --- a/packages/cli/src/launcher.mjs +++ b/packages/cli/src/launcher.mjs @@ -53,7 +53,7 @@ // session.json names it as gitSocket. // // Thread sessions (row 121, #1615). A thread instance (an instance whose -// role definition is the assistant) runs once per thread, never on its own: +// role definition is in THREAD_DEFINITIONS) runs once per thread, never on its own: // a launch from a session or --pm refuses thread-required. Every tick // (threadTickMs) the host asks the broker for the business's threads // (launch op threadsState) and: @@ -139,6 +139,7 @@ import { createServer } from "node:net"; import { chmodSync, existsSync, lstatSync, mkdirSync, readFileSync, renameSync, rmSync } from "node:fs"; import { dirname, join, relative } from "node:path"; import { configDir, loadBusiness, resolveInstance, systemVars } from "../../business/src/index.mjs"; +import { THREAD_DEFINITIONS } from "../../business/src/vocabulary.mjs"; import { limitHit } from "../../business/src/launch.mjs"; import { BundleError, buildBundle, hasFallback, readSkills, sessionModel } from "../../harness/src/bundle.mjs"; import { createLoader } from "../../plugins/src/loader.mjs"; @@ -176,8 +177,6 @@ const STOP_TIMEOUT_MS = 30000; const LINE_MAX = 4096; // How often the host asks for the threads' state; a poll period, not a limit. const THREAD_TICK_MS = 2000; -// The broker's thread instance definition (packages/bus/src/broker.mjs). -const THREAD_DEFINITION = "assistant"; // Row 194: the broker's LIFECYCLE_REQUEST_MS. A regenerate's old run must be gone by then. const LIFECYCLE_REQUEST_MS = 60000; @@ -331,7 +330,7 @@ export function createLauncher({ try { b=loadBusiness(host.business,{dir:configDir(env),rolesDir:rolesDir(env)}); } catch(e){throw new Refusal("organization-refused",e.message);} if (!b.launch) throw new Refusal("launch-not-configured", `business ${b.id} has no launch block`); if (!(pm ? instance === b.launch.by : b.launch.instances.includes(instance) || (human && Object.hasOwn(b.roles, instance)))) throw new Refusal("instance-not-listed"); - const threaded = b.roles[instance]?.definition === THREAD_DEFINITION; + const threaded = THREAD_DEFINITIONS.includes(b.roles[instance]?.definition); if (threaded && !thread) throw new Refusal("thread-required", `${instance} runs only for a thread`); if (!threaded && thread) throw new Refusal("thread-not-allowed", `${instance} isn't a thread instance`); if (threaded && !session) throw new Refusal("session-required", `${instance} runs for one session of a thread`); @@ -997,7 +996,7 @@ export function createLauncher({ function ending(r) { const runs = r.runs ?? []; const at = Date.parse(r.at); - const threaded = b.roles[r.instance]?.definition === THREAD_DEFINITION; + const threaded = THREAD_DEFINITIONS.includes(b.roles[r.instance]?.definition); return registry.sessions.filter((s) => s.business === b.id && (runs.includes(s.run) || (!threaded && s.instance === r.instance && (spawnedAt.get(s.run) ?? Date.parse(s.startedAt)) <= at))); } diff --git a/packages/cli/tests/launcher.test.mjs b/packages/cli/tests/launcher.test.mjs index 2202c7753..0a34fe27a 100644 --- a/packages/cli/tests/launcher.test.mjs +++ b/packages/cli/tests/launcher.test.mjs @@ -773,21 +773,28 @@ test("row 213 a creative instance's persona is read from /personas: o const dir = join(given.root, "config", "personas", "acme"); mkdirSync(dir, { recursive: true, mode: 0o700 }); writeFileSync(join(dir, "bean.md"), "Not the pinned text.\n", { mode: 0o600 }); - const { f, host, launcher } = await setup(t, undefined, given); - // The chief of staff holds role.launch; a test chief session bound to this process asks. - const chief = await host.bindLaunch({ business: "acme", role: "chief", run: "chief-test", harness: "pi", pid: process.pid, startTime: startTimeOf(process.pid) }); - await new Client({ path: host.path, cap: chief.cap }).call("role.claim"); - // The bundle's refusal comes back as launch-failed, as webPlan's does, with its reason in the log. - assert.deepEqual(await launcher.fromSession(chief.cap, "bean"), { ok: false, error: "launch-failed" }); + // Row 219: creative instances launch from their thread, not from a chief's standalone request. + // The mismatch occurs before bindLaunch, so only the host's thread-state snapshot is a fixture. + const thread = 'persona-thread'; + const { f, launcher } = await setup(t, undefined, given, { wrap: host => ({ + ...host, + op: message => message.op === 'threadsState' + ? Promise.resolve([{ thread, instance: 'bean', holder: null, pending: 1 }]) + : host.op(message), + }) }); + // The bundle's refusal remains launch-failed with the persona mismatch as its reason. + await launcher.tick(); const [e] = log(f); assert.deepEqual([e.event, e.code, log(f).length], ["refused", "launch-failed", 1]); + assert.equal(e.thread, thread); assert.equal(e.why, `instance bean: persona file ${join(dir, "bean.md")} isn't the file persona.sha256 names`); assert.ok(!JSON.stringify(log(f)).includes("PERSONA-MARKER-d2")); assert.deepEqual(readSessions(f.dataRoot), []); // The run directory exists by then (BUILD.md residual); the persona is read before any bundle file. const runs = readdirSync(join(f.dataRoot, "launches", "acme")); assert.equal(runs.length, 1); - assert.deepEqual(readdirSync(join(f.dataRoot, "launches", "acme", runs[0])), ["session"]); + assert.deepEqual(readdirSync(join(f.dataRoot, "launches", "acme", runs[0])), []); + assert.equal(existsSync(join(f.dataRoot, "threads", "acme", thread, "session")), true); }); test("row 64 on Claude Code a role skill that isn't enabled refuses the same way, before anything starts", { timeout: 30000 }, async (t) => { diff --git a/packages/cli/tests/thread-launch.test.mjs b/packages/cli/tests/thread-launch.test.mjs index 0d207a0a0..84f8ed088 100644 --- a/packages/cli/tests/thread-launch.test.mjs +++ b/packages/cli/tests/thread-launch.test.mjs @@ -396,6 +396,22 @@ test("REQ-THREAD-1 REQ-LAUNCH-1 the chief can't launch the assistant outside a t assert.deepEqual(launchLog(f).map((e) => [e.event, e.instance, e.code]), [["refused", "assistant", "thread-required"]]); }); +// Admission refuses before bundle construction or a sandbox is needed. +test('C2-09a: fromSession refuses a creative instance outside a thread without a sandbox', { timeout: 30000 }, async t => { + const prepared = prepare(t, { edit: doc => { + doc.roles.bean = { ...doc.roles.assistant, definition: 'companion' }; + doc.launch.instances.push('bean'); + return doc; + } }); + const { f } = prepared; + const host = await start(t, prepared); + const chief = await host.host.bindLaunch({ business: 'acme', role: 'chief', run: 'chief-bean-refusal', harness: 'pi', pid: process.pid, startTime: startTimeOf(process.pid) }); + await new Client({ path: host.host.path, cap: chief.cap }).call('role.claim'); + assert.deepEqual(await host.launcher.fromSession(chief.cap, 'bean'), { ok: false, error: 'thread-required' }); + assert.deepEqual(readSessions(f.dataRoot), []); + assert.deepEqual(launchLog(f).map(e => [e.event, e.instance, e.code]), [['refused', 'bean', 'thread-required']]); +}); + // Row 125 (#1619, REQ-LIMIT-3, REQ-LIMIT-4): the token-limit check switched on, with the // assistant's limit at 0, so it is at its limit before any turn. The real check runs through the // bus's plug-in loader. @@ -443,3 +459,71 @@ test("REQ-LIMIT-4 a thread run at its token limit stops at the end of its turn: assert.deepEqual(threadRuns(f, A), []); assert.equal(host.runtime.threadsState("acme").find((x) => x.thread === A).holder, null); }); + +test('C2-09a: creative thread messages start distinct runs and keep each instance history separate', { skip, timeout: 90000 }, async t => { + const prepared = prepare(t, { sonnet: 2, idle: 60, edit: doc => { + const vars = { ...doc.roles.assistant.vars }; + delete doc.roles.assistant; + doc.roles.bean = { definition: 'companion', vars: { ...vars } }; + doc.roles.chet = { definition: 'continuity', vars: { ...vars } }; + doc.launch.instances = ['coder', 'bean', 'chet']; + return doc; + } }); + const host = await start(t, prepared), { f } = prepared; + const project = host.call('project.create', { name: 'Writing' }).id; + const bean = host.call('thread.create', { project, name: 'Bean', instance: 'bean' }).id; + const chet = host.call('thread.create', { project, name: 'Chet', instance: 'chet' }).id; + const send = async (thread, instance, body) => { + const message = host.call('thread.send', { thread, body }); + const outcome = await until(() => host.call('thread.messages', { thread }).find(m => m.in_reply_to === message.id) || + launchLog(f).find(row => row.thread === thread && row.event === 'refused')); + assert.notEqual(outcome.event, 'refused', `creative thread launch refused: ${outcome.code}`); + const reply = outcome; + assert.equal(reply.from_role, instance); + assert.equal(reply.to_role, 'human'); + return JSON.parse(reply.body.match(/THREAD (\{.*\})/)[1]); + }; + assert.deepEqual((await send(bean, 'bean', 'Bean input')).before, []); + assert.deepEqual((await send(chet, 'chet', 'Chet input')).before, []); + assert.deepEqual((await send(bean, 'bean', 'Bean again')).before, ['Bean input']); + assert.equal(readFileSync(join(f.dataRoot, 'threads', 'acme', bean, 'session', 'history'), 'utf8'), 'Bean input\nBean again\n'); + assert.equal(readFileSync(join(f.dataRoot, 'threads', 'acme', chet, 'session', 'history'), 'utf8'), 'Chet input\n'); + const launches = launchLog(f).filter(row => row.event === 'launch'); + assert.ok(launches.some(row => row.instance === 'bean' && row.thread === bean)); + assert.ok(launches.some(row => row.instance === 'chet' && row.thread === chet)); + const chief = await host.host.bindLaunch({ business: 'acme', role: 'chief', run: 'chief-creative-test', harness: 'pi', pid: process.pid, startTime: startTimeOf(process.pid) }); + await new Client({ path: host.host.path, cap: chief.cap }).call('role.claim'); + assert.deepEqual(await host.launcher.fromSession(chief.cap, 'bean'), { ok: false, error: 'thread-required' }); +}); + +test('C2-09a: terminating one creative thread does not signal an unselected peer of the same instance', { skip, timeout: 90000 }, async t => { + const prepared = prepare(t, { sonnet: 2, idle: 60, edit: doc => { + doc.roles.bean = { ...doc.roles.assistant, definition: 'companion' }; + delete doc.roles.assistant; + doc.launch.instances = ['coder', 'bean']; + return doc; + } }); + let requests = []; + const host = await start(t, prepared, { ops: () => ({ + lifecycleRequests: () => requests, + lifecycleTake: () => ({ ...requests[0], go: true }), + lifecycleDone: () => { requests = []; return {}; }, + }) }); + const { f } = prepared; + const project = host.call('project.create', { name: 'Writing' }).id; + const threads = ['one', 'two'].map(name => host.call('thread.create', { project, name, instance: 'bean' }).id); + for (const thread of threads) { + const message = host.call('thread.send', { thread, body: 'Stay in this thread' }); + const outcome = await until(() => host.call('thread.messages', { thread }).find(row => row.in_reply_to === message.id) || + launchLog(f).find(row => row.thread === thread && row.event === 'refused')); + assert.notEqual(outcome.event, 'refused', `creative thread launch refused: ${outcome.code}`); + } + const runs = threads.map(thread => launchLog(f).find(row => row.thread === thread && row.event === 'launch').run); + requests = [{ request: 'one-thread-end', state: 'open', business: 'acme', action: 'lifecycle.end', + instance: 'bean', runs: [runs[0]], by: f.doc.human, at: new Date(Date.now() + 1000).toISOString() }]; + await host.launcher.tick(); + await until(() => launchLog(f).some(row => row.event === 'lifecycle-end' && row.run === runs[0])); + assert.deepEqual(launchLog(f).filter(row => row.event === 'lifecycle-end').map(row => row.run), [runs[0]]); + await until(() => !readSessions(f.dataRoot).some(row => row.run === runs[0])); + assert.ok(readSessions(f.dataRoot).some(row => row.run === runs[1])); +}); diff --git a/packages/webui/src/chat-http.mjs b/packages/webui/src/chat-http.mjs index 7980c1442..63d3ca974 100644 --- a/packages/webui/src/chat-http.mjs +++ b/packages/webui/src/chat-http.mjs @@ -80,7 +80,8 @@ export async function chatHTTP(req, res, { path, search, chat, named, send, prev (Object.hasOwn(v, 'repo') && (typeof v.repo !== 'string' || !KEY.test(v.repo)))) throw Error(); action = 'createProject'; args = v; } else if (path === '/api/chat/threads') { - if (!exact(v, ['project', 'name']) || !id(v.project) || !name(v.name)) throw Error(); + if (!exact(v, ['project', 'name', 'instance'], ['project', 'name']) || !id(v.project) || !name(v.name) || + (Object.hasOwn(v, 'instance') && (typeof v.instance !== 'string' || !KEY.test(v.instance)))) throw Error(); action = 'createThread'; args = v; } else if (match?.[2] === 'messages') { if (!exact(v, ['body']) || typeof v.body !== 'string' || !v.body.trim() || v.body.length > 32768) throw Error(); diff --git a/packages/webui/src/chat.mjs b/packages/webui/src/chat.mjs index 1b0a41dce..5a1ed8bf1 100644 --- a/packages/webui/src/chat.mjs +++ b/packages/webui/src/chat.mjs @@ -25,7 +25,7 @@ export function createChat({ call, owner = null }) { projects: () => channel('project.list', {}), createProject: ({ name, repo }) => channel('project.create', { name, ...(repo === undefined ? {} : { repo }) }), threads: ({ project } = {}) => channel('thread.list', project === undefined ? {} : { project }), - createThread: ({ project, name }) => channel('thread.create', { project, name }), + createThread: ({ project, name, instance }) => channel('thread.create', { project, name, ...(instance === undefined ? {} : { instance }) }), messages: ({ thread, after, limit }) => channel('thread.messages', { thread, ...(after ? { after } : {}), limit }), send: ({ thread, body }) => channel('thread.send', { thread, body, class: 'REQUEST' }), open: ({ thread }) => channel('thread.open', { thread }), diff --git a/packages/webui/src/public/chat.js b/packages/webui/src/public/chat.js index a6b805c1b..15066bdc6 100644 --- a/packages/webui/src/public/chat.js +++ b/packages/webui/src/public/chat.js @@ -14,7 +14,7 @@ return states.get(id); }; const form = key => { - if (!forms.has(key)) forms.set(key, { name: '', repo: '', receipt: '', pending: false }); + if (!forms.has(key)) forms.set(key, { name: '', repo: '', instance: '', instanceChosen: false, receipt: '', pending: false }); return forms.get(key); }; class ChatError extends Error { @@ -58,7 +58,11 @@ function creation(kind, key) { const f = form(key), project = kind === 'project'; const repo = project && current.repos.length ? `` : ''; - return `

New ${kind}

${repo}

${txt(f.receipt)}

`; + const choices = current.instances ?? []; + const picker = project ? '' : ``; + const unavailable = !project && (!!current.instanceError || !choices.some(row => row.instance === f.instance)); + const status = !project && current.instanceError ? current.instanceError : f.receipt || (!project && !choices.length ? 'No thread instances are configured.' : ''); + return `

New ${kind}

${repo}${picker}

${txt(status)}

`; } function threads(rows) { return rows.length ? `
    ${rows.map(t => `
  • ${link('threads', t.id, t.name)} ${txt(t.instance)}
  • `).join('')}
` : '

No threads yet.

'; @@ -106,7 +110,7 @@ const f = document.getElementById(keep.field.id); if (f && !f.disabled) { f.focus({ preventScroll: true }); - if (keep.field.start !== null) f.setSelectionRange(keep.field.start, keep.field.end); + if (keep.field.start != null && typeof f.setSelectionRange === 'function') f.setSelectionRange(keep.field.start, keep.field.end); } } else if (navigated) c.container.querySelector('h1')?.focus({ preventScroll: true }); } @@ -126,7 +130,7 @@ paint(); return; } const old = current; - current = { container, kind, id, canSend, projects: old?.projects ?? [], threads: old?.threads ?? [], repos: old?.repos ?? [], error: '', refused: false }; + current = { container, kind, id, canSend, projects: old?.projects ?? [], threads: old?.threads ?? [], repos: old?.repos ?? [], instances: old?.instances ?? [], instanceError: kind === 'project' ? 'Reading thread instances…' : '', error: '', refused: false }; if (navigated || !old) container.innerHTML = '

Reading chat…

'; try { const s = kind === 'thread' ? state(id) : null; @@ -147,6 +151,25 @@ s.receipt = 'Message shown in this conversation.'; s.receiptId = null; } } + if (kind === 'project') { + try { + const listed = await request('instances', undefined, signal); + if (g !== generation || out()) return; + if (!listed.rows.every(row => typeof row?.instance === 'string' && /^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,159}$/.test(row.instance) && typeof row.name === 'string')) + throw new ChatError('invalid-response'); + current.instances = listed.rows; current.instanceError = ''; + const f = form(id); + if (f.instance && !listed.rows.some(row => row.instance === f.instance)) { + f.instance = ''; f.instanceChosen = true; + f.receipt = 'The selected instance is no longer available. Choose who this thread is with.'; + } + if (!f.instanceChosen && !f.instance && listed.rows.length === 1) f.instance = listed.rows[0].instance; + } catch (err) { + if (err.name === 'AbortError' || out() || g !== generation) return; + current.instances = []; + current.instanceError = "Couldn't read the thread instances; reload to try again"; + } + } // Repository choices are optional metadata; an unavailable read must not block unlinked chat. if (kind === 'list') { try { @@ -179,7 +202,11 @@ if (!current || out()) return; if (event.target.id === 'chat-body') state(current.id).draft = event.target.value; const f = event.target.closest('.chat-create'); - if (f && event.target.dataset.chatField) form(f.dataset.key)[event.target.dataset.chatField] = event.target.value; + if (f && event.target.dataset.chatField) { + const draft = form(f.dataset.key), field = event.target.dataset.chatField; + draft[field] = event.target.value; + if (field === 'instance') { draft.instanceChosen = true; draft.receipt = ''; paint(); } + } }); document.addEventListener('scroll', event => { if (event.target.matches?.('.chat-log') && current?.kind === 'thread') { @@ -232,7 +259,8 @@ void write('send', id, { body: state(id).draft }, `threads/${id}/messages`); } else if (event.target.classList.contains('chat-create')) { const key = event.target.dataset.key, f = form(key), project = key === 'projects'; - const value = project ? { name: f.name, ...(f.repo ? { repo: f.repo } : {}) } : { project: key, name: f.name }; + if (!project && (current.instanceError || !(current.instances ?? []).some(row => row.instance === f.instance))) return; + const value = project ? { name: f.name, ...(f.repo ? { repo: f.repo } : {}) } : { project: key, name: f.name, instance: f.instance }; void write(project ? 'createProject' : 'createThread', key, value, project ? 'projects' : 'threads'); } }); diff --git a/packages/webui/src/serve.mjs b/packages/webui/src/serve.mjs index cd51a0b6e..56fcdd4e1 100644 --- a/packages/webui/src/serve.mjs +++ b/packages/webui/src/serve.mjs @@ -8,6 +8,7 @@ import { BusReadError, busStatus as coreBusStatus, subjectOk, sendOutcome } from // Row 176, sage-1111: HTTP-only tester refusals; the row-164 transport pin stays untouched. const busStatus = code => ['tester-off', 'tester-required'].includes(code) ? 403 : coreBusStatus(code); import { ReadError, readStatus, fieldTable } from './reads.mjs'; +import { THREAD_DEFINITIONS } from '../../business/src/vocabulary.mjs'; import { chatHTTP } from './chat-http.mjs'; import { processingHTTP } from './processing-http.mjs'; @@ -740,6 +741,25 @@ export async function startServer({ host = '127.0.0.1', port = 7330, board = DEF if (req.method !== 'POST') return json(res, 405, { error: 'method not allowed' }); return busSend(req, res, { send, preview: signer, log }); } + // Row 219: labels only, from this listener's own human or tester bus, after auth above. + if (path === '/api/chat/instances') { + if (req.method !== 'GET') return json(res, 405, { error: 'method-not-allowed' }); + if (search) return json(res, 400, { error: 'invalid-request' }); + if (!bus?.instances) return json(res, 503, { error: 'not-configured' }); + try { + const value = await bus.instances(); + if (!value || !value.instances || typeof value.instances !== 'object' || Array.isArray(value.instances)) + throw new BusReadError('invalid-response'); + const rows = Object.entries(value.instances) + .filter(([, entry]) => THREAD_DEFINITIONS.includes(entry?.definition)) + .map(([instance, entry]) => ({ instance, name: entry.vars?.['persona.name'] || instance })); + if (rows.some(row => typeof row.name !== 'string')) throw new BusReadError('invalid-response'); + return json(res, 200, { rows, at: new Date().toISOString() }); + } catch (err) { + const code = err instanceof BusReadError ? err.code : 'invalid-response'; + return json(res, busStatus(code), { error: code }); + } + } if (path === '/api/chat' || path.startsWith('/api/chat/')) { return chatHTTP(req, res, { path, search, chat, named, send, preview: writer, log }); } diff --git a/packages/webui/tests/chat-browser.test.mjs b/packages/webui/tests/chat-browser.test.mjs index f3eeeca96..cc3ec093d 100644 --- a/packages/webui/tests/chat-browser.test.mjs +++ b/packages/webui/tests/chat-browser.test.mjs @@ -12,6 +12,7 @@ const HOSTILE = '\u001b[31m\u202eevil'; const stub = `(() => { const real = fetch.bind(window); window.__writes=[];window.__reads=[];window.__answers=[];window.__pages=[]; + window.__instances=[{instance:'assistant',name:'assistant'}]; window.__projects=[{id:'${P}', name:${JSON.stringify(HOSTILE)}, repo:null},{id:'\">',name:'Invalid record'}]; window.__threads=[{id:'${A}',project:'${P}',name:'alpha',instance:'assistant'}, {id:'${B}',project:'${P}',name:'beta',instance:'assistant'}]; window.fetch=async (url,init={})=>{ @@ -33,6 +34,7 @@ const stub = `(() => { window.__reads.push(path); if(window.__holdRead && path.includes(window.__holdRead)){window.__heldSignal=init.signal;await new Promise(r=>window.__releaseRead=r);} if(window.__readFailure)return new Response(JSON.stringify({error:window.__readFailure}),{status:window.__readFailure==='thread-not-owned'?403:503}); + if(path==='/api/chat/instances')return window.__instanceFailure ? new Response(JSON.stringify({error:'not-configured'}),{status:503}) : data({rows:window.__instances}); if(path==='/api/chat/projects')return data({rows:window.__projects}); if(path.startsWith('/api/chat/threads')&&!path.includes('/messages'))return data({rows:window.__threads}); if(window.__pages.length)return data(window.__pages.shift()); @@ -82,7 +84,7 @@ test('chat browser: list/create named projects and threads, hostile labels inert await b.evaluate(`window.__answers.push({body:{id:'${A}',instance:'assistant'}}),true`); await click('#chat-thread-form button[type=submit]'); await wait('document.querySelector("#chat-send-form")'); - assert.deepEqual(await b.evaluate('window.__writes[1].body'), { project: P, name: 'named thread' }); + assert.deepEqual(await b.evaluate('window.__writes[1].body'), { project: P, name: 'named thread', instance: 'assistant' }); assert.equal(await b.evaluate('window.__writes[1].path'), '/api/chat/threads'); assert.equal(await b.evaluate('window.__writes.length'), 2); }); @@ -264,3 +266,65 @@ test('chat browser: a late project creation receipt cannot navigate away from an assert.equal(await b.evaluate('location.hash'), '#/chat/threads/' + A); assert.equal(await b.evaluate('document.querySelector("#chat-body").value'), 'stay in alpha'); }); + +test('C2-09a picker: no silent choice, duplicate hostile labels stay inert, selection survives refresh and reaches POST', async t => { + const { b, wait, set, click, refresh } = await setup(t); + await b.evaluate(`window.__instances=[{instance:'bean',name:${JSON.stringify(HOSTILE)}},{instance:'chet',name:${JSON.stringify(HOSTILE)}}];location.hash='#/chat/projects/${P}';true`); + await wait('document.querySelectorAll("#chat-instance option").length===3'); + assert.equal(await b.evaluate('document.querySelector("#chat-instance").value'), ''); + assert.equal(await b.evaluate('document.querySelector("#chat-instance").required'), true); + assert.equal(await b.evaluate('document.querySelector("#chat-thread-form button").disabled'), true); + const labels = await b.evaluate('[...document.querySelectorAll("#chat-instance option")].map(o=>o.textContent)'); + assert.match(labels[1], /\(bean\)/); + assert.match(labels[2], /\(chet\)/); + assert.doesNotMatch(labels.join(''), /[\u202a-\u202e\u2066-\u2069]/u); + assert.equal(await b.evaluate('!!document.querySelector("#chat-thread-form img")'), false); + assert.equal(await b.evaluate('window.injected'), undefined); + await set('#chat-thread-name', 'Bean discussion'); + await click('#chat-thread-form button'); + assert.equal(await b.evaluate('window.__writes.length'), 0); + await set('#chat-instance', 'bean'); + await refresh(); + assert.equal(await b.evaluate('document.querySelector("#chat-instance").value'), 'bean'); + assert.equal(await b.evaluate('document.querySelector("#chat-thread-name").value'), 'Bean discussion'); + assert.equal(await b.evaluate('document.querySelector("#chat-thread-form button").disabled'), false); + await b.evaluate(`window.__answers.push({body:{id:'${A}',instance:'bean'}});true`); + await click('#chat-thread-form button'); + await wait('window.__writes.length===1'); + assert.deepEqual(await b.evaluate('window.__writes[0]'), { path: '/api/chat/threads', body: { project: P, name: 'Bean discussion', instance: 'bean' }, redirect: 'manual' }); +}); + +test('C2-09a picker: metadata failure, empty set and removed pick explain disabled state and recover without switching', async t => { + const { b, wait, set, refresh } = await setup(t); + await b.evaluate(`window.__instanceFailure=true;location.hash='#/chat/projects/${P}';true`); + await wait('document.querySelector("#chat-thread-form") && !document.querySelector(".chat-loading")'); + assert.match(await b.evaluate('document.querySelector("#chat-thread-form [role=status]").textContent'), /read the thread instances/); + assert.equal(await b.evaluate('document.querySelector("#chat-thread-form button").disabled'), true); + await b.evaluate('window.__instanceFailure=false;window.__instances=[];true'); + await refresh(); + assert.match(await b.evaluate('document.querySelector("#chat-thread-form [role=status]").textContent'), /No thread instances/); + assert.equal(await b.evaluate('document.querySelector("#chat-thread-form button").disabled'), true); + await b.evaluate("window.__instances=[{instance:'bean',name:'Bean'},{instance:'chet',name:'Chet'}];true"); + await refresh(); + await set('#chat-instance', 'bean'); + await b.evaluate("window.__instances=[{instance:'chet',name:'Chet'}];true"); + await refresh(); + assert.equal(await b.evaluate('document.querySelector("#chat-instance").value'), ''); + assert.match(await b.evaluate('document.querySelector("#chat-thread-form [role=status]").textContent'), /no longer available/); + assert.equal(await b.evaluate('document.querySelector("#chat-thread-form button").disabled'), true); + await refresh(); + assert.equal(await b.evaluate('document.querySelector("#chat-instance").value'), '', 'another refresh must not silently select the one remaining instance'); + await set('#chat-instance', 'chet'); + assert.equal(await b.evaluate('document.querySelector("#chat-thread-form button").disabled'), false); +}); + +test('C2-09a picker: a single instance is chosen explicitly but read-only mode cannot create a thread', async t => { + const { b, wait } = await setup(t, '?readonly'); + await b.evaluate(`location.hash='#/chat/projects/${P}';true`); + await wait('document.querySelectorAll("#chat-instance option").length===2'); + assert.equal(await b.evaluate('document.querySelector("#chat-instance").value'), 'assistant'); + assert.equal(await b.evaluate('document.querySelector("#chat-instance").disabled'), true); + assert.equal(await b.evaluate('document.querySelector("#chat-thread-form button").disabled'), true); + assert.match(await b.evaluate('document.querySelector(".chat-area").textContent'), /only reads/); + assert.equal(await b.evaluate('window.__writes.length'), 0); +}); diff --git a/packages/webui/tests/chat-instances.test.mjs b/packages/webui/tests/chat-instances.test.mjs new file mode 100644 index 000000000..893c38f80 --- /dev/null +++ b/packages/webui/tests/chat-instances.test.mjs @@ -0,0 +1,87 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import { request } from 'node:http'; +import { mkdtempSync, rmSync } from 'node:fs'; +import { join } from 'node:path'; +import { tmpdir } from 'node:os'; +import { startServer } from '../src/serve.mjs'; +import { startTesterSocket, TESTER_ORIGIN } from '../src/tester-socket.mjs'; +import { close } from './fixture.mjs'; + +const path = '/api/chat/instances'; +const preview = { host: 'chat.example', header: 'x-user', user: 'jason' }; +const snapshot = { + revision: 'a'.repeat(64), plugins: { private: 'do-not-project' }, + instances: { + assistant: { definition: 'assistant', vars: { model: 'private-model' } }, + bean: { definition: 'companion', vars: { 'persona.name': 'Bean', 'persona.sha256': 'private-hash' } }, + chet: { definition: 'continuity', vars: { 'persona.name': 'Bean', file: '/private/path' } }, + pm: { definition: 'pm', vars: { 'persona.name': 'Hidden PM' } }, + }, +}; +function get(server, { route = path, method = 'GET', headers = {} } = {}) { + const address = server.address(), unix = typeof address === 'string'; + return new Promise((resolve, reject) => { + const req = request({ ...(unix ? { socketPath: address } : { host: '127.0.0.1', port: address.port }), + path: route, method, headers: { host: unix ? new URL(TESTER_ORIGIN).host : preview.host, ...headers } }, res => { + let text = ''; + res.on('data', chunk => text += chunk); + res.on('end', () => resolve({ status: res.statusCode, text, value: JSON.parse(text) })); + }); + req.on('error', reject); req.end(); + }); +} +test('C2-09a metadata uses the human listener bus, projects labels only and refuses unauthenticated reads', async t => { + let calls = 0; + const server = await startServer({ port: 0, preview, bus: { instances: async () => { calls++; return snapshot; } } }); + t.after(() => close(server)); + const refused = await get(server); + assert.equal(refused.status, 401); + assert.equal(calls, 0); + const answer = await get(server, { headers: { 'x-user': 'jason' } }); + assert.equal(answer.status, 200); + assert.deepEqual(answer.value.rows, [{ instance: 'assistant', name: 'assistant' }, { instance: 'bean', name: 'Bean' }, { instance: 'chet', name: 'Bean' }]); + for (const row of answer.value.rows) assert.deepEqual(Object.keys(row).sort(), ['instance', 'name']); + assert.doesNotMatch(answer.text, /private|Hidden PM/); + assert.equal(calls, 1); + for (const options of [{ route: path + '?extra=1' }, { method: 'POST' }]) { + const result = await get(server, { ...options, headers: { 'x-user': 'jason' } }); + assert.ok([400, 405].includes(result.status)); + } + assert.equal(calls, 1, 'invalid metadata requests never call a bus'); +}); +test('C2-09a metadata uses the private tester listener own bus and no human transport', async t => { + const root = mkdtempSync(join(tmpdir(), 'chat219-')); t.after(() => rmSync(root, { recursive: true, force: true })); + let reads = 0; + const server = await startTesterSocket({ dataRoot: root, board: 'http://127.0.0.1:9', + bus: { instances: async () => { reads++; return { instances: { quill: { definition: 'proofreader', vars: { 'persona.name': 'Quill' } } } }; } } }); + t.after(() => close(server)); + const answer = await get(server); + assert.equal(answer.status, 200); + assert.deepEqual(answer.value.rows, [{ instance: 'quill', name: 'Quill' }]); + assert.equal(reads, 1); +}); +test('C2-09a metadata refuses missing or malformed reads and never echoes untrusted fields', async t => { + for (const bus of [null, { instances: async () => ({ instances: [] }) }, { instances: async () => { throw new Error('private-path'); } }]) { + const server = await startServer({ port: 0, preview, bus }); t.after(() => close(server)); + const answer = await get(server, { headers: { 'x-user': 'jason' } }); + assert.ok(answer.status >= 400); + assert.doesNotMatch(answer.text, /private-path/); + } +}); + +test('C2-09a metadata stays behind the SSO session check and a GET never refreshes session activity', async t => { + let session = null, reads = 0; + const touches = []; + const sso = { publicHost: 'sso-chat.example', publicOrigin: 'https://sso-chat.example', formTargets: () => [], + session: (_req, { touch }) => { touches.push(touch); return session; } }; + const server = await startServer({ port: 0, sso, bus: { instances: async () => { reads++; return snapshot; } } }); + t.after(() => close(server)); + const headers = { host: sso.publicHost }; + assert.equal((await get(server, { headers })).status, 401); + assert.equal(reads, 0); + session = { name: 'jason' }; + assert.equal((await get(server, { headers })).status, 200); + assert.equal(reads, 1); + assert.deepEqual(touches, [false, false]); +}); diff --git a/packages/webui/tests/chat.test.mjs b/packages/webui/tests/chat.test.mjs index 8c11611cf..b47ecf1a7 100644 --- a/packages/webui/tests/chat.test.mjs +++ b/packages/webui/tests/chat.test.mjs @@ -335,3 +335,21 @@ test('the chat seam names the transport it is given: the human one and the teste assert.throws(() => createChat({}), { name: 'TypeError', message: 'chat needs a bus transport function' }); assert.equal(typeof createChat({ call: async () => ({}) }).projects, 'function'); }); + +test('C2-09a createThread forwards an explicit instance through the existing channel', async t => { + const c = await setup(t); + c.state.answer = { id: T, instance: 'bean' }; + const answer = await c.get('/api/chat/threads', { method: 'POST', value: { project: P, name: 'Bean work', instance: 'bean' } }); + assert.equal(answer.status, 200); + assert.deepEqual(c.calls, [['thread.create', { project: P, name: 'Bean work', instance: 'bean' }]]); + assert.equal(answer.data.instance, 'bean'); +}); +test('C2-09a malformed instance and extra thread fields refuse before the channel write', async t => { + const c = await setup(t); + for (const value of [null, 7, {}, [], '', 'bad name', 'bean/../../other']) { + const answer = await c.get('/api/chat/threads', { method: 'POST', value: { project: P, name: 'work', instance: value } }); + assert.equal(answer.status, 400, JSON.stringify(value)); + } + assert.equal((await c.get('/api/chat/threads', { method: 'POST', value: { project: P, name: 'work', instance: 'bean', extra: true } })).status, 400); + assert.deepEqual(c.calls, []); +}); From 994860e702ad0c5c885386ac42a61b3fade513fe Mon Sep 17 00:00:00 2001 From: Rocko Date: Thu, 22 Oct 2026 23:04:19 -0500 Subject: [PATCH 2/8] docs: rebase row 219 gate packet and record run bounds --- agents/rocko/work/queue-219/BUILD.md | 26 +++++ agents/rocko/work/queue-219/base.txt | 2 +- agents/rocko/work/queue-219/build.patch | 18 ++-- .../work/queue-219/candidate-manifest.sha256 | 4 +- agents/rocko/work/queue-219/run-219.py | 96 +++++++++++++++++++ 5 files changed, 134 insertions(+), 12 deletions(-) create mode 100644 agents/rocko/work/queue-219/run-219.py diff --git a/agents/rocko/work/queue-219/BUILD.md b/agents/rocko/work/queue-219/BUILD.md index aecd29ba3..a3b7e12de 100644 --- a/agents/rocko/work/queue-219/BUILD.md +++ b/agents/rocko/work/queue-219/BUILD.md @@ -179,3 +179,29 @@ remain exact-once. Rebuild manifest/base/patch on this base. Other auto-merges were user-principal.test, launcher and thread-launch.test. No tests, Node, mutants or reader audit run: CLEAR still required after 574, covering every touched test file whole. This branch remains UNVERIFIED. + +## Full gate preparation: sage-3174 + +Clean rebase onto 4a9c536e861f1d9f9a018019b3ac4519d65eccf0, after rows270+271. +No conflicts or manual product changes. All 23 anchors remain exact-once, +including T05 and T23's second edit. All 14 candidate hashes rebuilt. + +Before first run: eight files whole, then bus/cli/webui whole, then all ten +scripts/test-*.sh, then 23 mutants, then reader audit with positive control. +Singles timeout 300s; suites 1800s; mutants 180s, each in its own process +group, TERM then KILL after 10s and restore in finally. Every stage gets a +fresh short TMPDIR under /mnt/storage/scratch/tmp/r*. DOCKER_HOST is dead for +Node runs; shell fixtures may use Docker, with project rocko-r219-gate and +owned network cleanup in finally. Live provider cases are not enabled. + +Each of the ten shell files uses `timeout -k 10 3600`, comfortably above 3x +the longest entire earlier observed builder gate (roughly 25min -> 75min +would exceed 3600; use 7200 seconds instead below). To avoid relying on +old skip-fast samples, the actual shell command is timeout -k 10 7200, +more than 3x that 25-minute conservative baseline for any individual shell. +No shell run silently retries. Log each skip verbatim. Initial timings are +in historical queue114/r1/out/full/gate-results.json (old task run skipped +live cases, so not used as the Docker worst-case estimate). + +Mos1316/1317 first-run launcher/creative/chat-browser reds, any old-test red +or a second red stop before fixes and go to Sage/Mos. No run evidence yet. diff --git a/agents/rocko/work/queue-219/base.txt b/agents/rocko/work/queue-219/base.txt index 593df1d00..1d519a39a 100644 --- a/agents/rocko/work/queue-219/base.txt +++ b/agents/rocko/work/queue-219/base.txt @@ -1 +1 @@ -062646487451993302c768c6812b827c834e952b +4a9c536e861f1d9f9a018019b3ac4519d65eccf0 diff --git a/agents/rocko/work/queue-219/build.patch b/agents/rocko/work/queue-219/build.patch index 9794fce33..c7d489802 100644 --- a/agents/rocko/work/queue-219/build.patch +++ b/agents/rocko/work/queue-219/build.patch @@ -1,5 +1,5 @@ diff --git a/packages/bus/src/broker.mjs b/packages/bus/src/broker.mjs -index c50f8ac23..5ee242f1d 100644 +index d76085739..11061c778 100644 --- a/packages/bus/src/broker.mjs +++ b/packages/bus/src/broker.mjs @@ -4,7 +4,7 @@ import { initializeControl, processingStatus } from '../../processing-control/sr @@ -11,7 +11,7 @@ index c50f8ac23..5ee242f1d 100644 // Kept closed while S1 lands; its vocabulary is the integration authority. export const ACTIONS = Object.freeze([ -@@ -312,7 +312,7 @@ const enrollBinding = (enroll) => ({ +@@ -314,7 +314,7 @@ const enrollBinding = (enroll) => ({ }); // r6 E3: the installer line's comment, then the tag's 32 hex digits. const INSTALLER_COMMENT = 'mosaic-installer-'; @@ -20,7 +20,7 @@ index c50f8ac23..5ee242f1d 100644 // user in threads. Its runs claim a thread, not the role, and every message to or from it names its // thread (REQ-MSG-1). // Row 146 (#1640): the sender of the bus's notice to launch.by. A role instance name matches the -@@ -593,7 +593,7 @@ export class Broker { +@@ -598,7 +598,7 @@ export class Broker { ); } #threaded(business, role) { @@ -29,7 +29,7 @@ index c50f8ac23..5ee242f1d 100644 } // Row 264a (#1769): a claim holds one session of a thread, and each session has its own holder. #sessionHolder(session) { -@@ -5790,24 +5790,27 @@ export class Broker { +@@ -6068,24 +6068,27 @@ export class Broker { .all('SELECT id,at,name,repo FROM projects WHERE business=? ORDER BY seq', s.business) .filter((p) => !s.user || this.#granted(s, 'project.list', p.id, null)); } @@ -65,7 +65,7 @@ index c50f8ac23..5ee242f1d 100644 if (this.#store.get('SELECT 1 FROM threads WHERE project=? AND name=?', a.project, a.name)) fail('thread-exists'); const tid = randomUUID(); this.#store.run( -@@ -5816,13 +5819,13 @@ export class Broker { +@@ -6094,13 +6097,13 @@ export class Broker { this.#now(), s.business, a.project, @@ -217,7 +217,7 @@ index 4dcd1ebeb..8471ddf85 100644 + assert.equal(ctx.code('alice', 'thread.create', { project, name: 'old instance', instance: 'assistant' }), 'access-refused'); +}); diff --git a/packages/cli/src/launcher.mjs b/packages/cli/src/launcher.mjs -index e044b7627..f019df83f 100644 +index bfe55b61e..d8248284c 100644 --- a/packages/cli/src/launcher.mjs +++ b/packages/cli/src/launcher.mjs @@ -53,7 +53,7 @@ @@ -237,7 +237,7 @@ index e044b7627..f019df83f 100644 import { limitHit } from "../../business/src/launch.mjs"; import { BundleError, buildBundle, hasFallback, readSkills, sessionModel } from "../../harness/src/bundle.mjs"; import { createLoader } from "../../plugins/src/loader.mjs"; -@@ -175,8 +176,6 @@ const STOP_TIMEOUT_MS = 30000; +@@ -176,8 +177,6 @@ const STOP_TIMEOUT_MS = 30000; const LINE_MAX = 4096; // How often the host asks for the threads' state; a poll period, not a limit. const THREAD_TICK_MS = 2000; @@ -246,7 +246,7 @@ index e044b7627..f019df83f 100644 // Row 194: the broker's LIFECYCLE_REQUEST_MS. A regenerate's old run must be gone by then. const LIFECYCLE_REQUEST_MS = 60000; -@@ -299,7 +298,7 @@ export function createLauncher({ +@@ -331,7 +330,7 @@ export function createLauncher({ try { b=loadBusiness(host.business,{dir:configDir(env),rolesDir:rolesDir(env)}); } catch(e){throw new Refusal("organization-refused",e.message);} if (!b.launch) throw new Refusal("launch-not-configured", `business ${b.id} has no launch block`); if (!(pm ? instance === b.launch.by : b.launch.instances.includes(instance) || (human && Object.hasOwn(b.roles, instance)))) throw new Refusal("instance-not-listed"); @@ -255,7 +255,7 @@ index e044b7627..f019df83f 100644 if (threaded && !thread) throw new Refusal("thread-required", `${instance} runs only for a thread`); if (!threaded && thread) throw new Refusal("thread-not-allowed", `${instance} isn't a thread instance`); if (threaded && !session) throw new Refusal("session-required", `${instance} runs for one session of a thread`); -@@ -854,7 +853,7 @@ export function createLauncher({ +@@ -997,7 +996,7 @@ export function createLauncher({ function ending(r) { const runs = r.runs ?? []; const at = Date.parse(r.at); diff --git a/agents/rocko/work/queue-219/candidate-manifest.sha256 b/agents/rocko/work/queue-219/candidate-manifest.sha256 index 562f298c7..8f29026fa 100644 --- a/agents/rocko/work/queue-219/candidate-manifest.sha256 +++ b/agents/rocko/work/queue-219/candidate-manifest.sha256 @@ -1,8 +1,8 @@ -38c4cb694cb756cfc771395afbeaa0779737bb94bc55bd1ea3a72a00d5448041 packages/bus/src/broker.mjs +142a210882535108159e045c61be288bc8703910a8ee0169137bc1eb80baff64 packages/bus/src/broker.mjs b0c66c8999b567896923f6c876911dba936c6eca1ccc7aaeada51369fd613594 packages/bus/tests/creative.test.mjs de4913f50801a11fd172e3f2c2b3cb41ab04e84d32a6650d1c8662b5e227ea3d packages/bus/tests/threads.test.mjs 8f7d6745fffb2a0898ac80c012084ac48964748da6439a8c56facc6529ffb19b packages/bus/tests/user-principal.test.mjs -c905590032b6f8eb7d607d04ce6a585ed783a0c84033dd8436eab7922f2251e1 packages/cli/src/launcher.mjs +b74275ce43249bafc97edc87a6a3aa0431c62fe1a28cd9fa265246e6d6da219b packages/cli/src/launcher.mjs fc301cde49e6db1286e90d6ac3410f5f4d87351bec61f1bae27c235a041848b6 packages/cli/tests/launcher.test.mjs a219036737419870e0aa9d0da20843759a66be5bafff44d3292593833f8fcb9a packages/cli/tests/thread-launch.test.mjs cbfd54e6b375561d1e4679ee8d78a3285f970d9a7198cec9d22a06510a36afba packages/webui/src/chat-http.mjs diff --git a/agents/rocko/work/queue-219/run-219.py b/agents/rocko/work/queue-219/run-219.py new file mode 100644 index 000000000..caf6a7ad8 --- /dev/null +++ b/agents/rocko/work/queue-219/run-219.py @@ -0,0 +1,96 @@ +#!/usr/bin/env python3 +"""Row219 serial gate. Requires Sage CLEAR; all children use a process group.""" +import os,sys,time,json,signal,subprocess,tempfile,hashlib,re,glob +from pathlib import Path +from datetime import datetime,timezone +ROOT=Path(__file__).resolve().parents[4] +PACKET=Path(__file__).resolve().parent +OUT=PACKET/'run-4a9c';OUT.mkdir(exist_ok=True) +def stamp():return datetime.now(timezone.utc).isoformat() +def verify(): + for line in (PACKET/'candidate-manifest.sha256').read_text().splitlines(): + sha,path=line.split(' ',1) + if hashlib.sha256((ROOT/path).read_bytes()).hexdigest()!=sha:raise RuntimeError('candidate drift: '+path) +def sweep(): + found=[] + for proc in Path('/proc').glob('[0-9]*'): + try: + cwd=(proc/'cwd').resolve();name=(proc/'comm').read_text().strip() + if (str(cwd).startswith(str(ROOT)) or str(cwd).startswith('/mnt/storage/scratch/tmp/')) and ('node' in name or 'chrom' in name):found.append(dict(pid=int(proc.name),name=name,cwd=str(cwd))) + except (FileNotFoundError,PermissionError,ProcessLookupError):pass + return found +def execute(label,args,cwd=ROOT,deadline=300,docker=False): + verify();short=tempfile.mkdtemp(prefix='r',dir='/mnt/storage/scratch/tmp') + env=os.environ.copy();env.update(TMPDIR=short,NO_COLOR='1',COMPOSE_PROJECT_NAME='rocko-r219-gate') + env.pop('MOSAIC_GITEA_CREDENTIAL_FILE',None);env.pop('MOSAIC_LIVE_PROVIDER',None) + if docker:env.pop('DOCKER_HOST',None) + else:env['DOCKER_HOST']='unix:///mnt/storage/scratch/rocko-r219-dead.sock' + log=OUT/(label+'.tap');begin=stamp();t=time.monotonic();timeout=False + print('START',label,begin,flush=True) + with log.open('wb') as f: + child=subprocess.Popen(args,cwd=cwd,env=env,stdout=f,stderr=subprocess.STDOUT,start_new_session=True) + try:rc=child.wait(timeout=deadline+15) + except subprocess.TimeoutExpired: + timeout=True + try:os.killpg(child.pid,signal.SIGTERM) + except ProcessLookupError:pass + try:child.wait(timeout=10) + except subprocess.TimeoutExpired: + try:os.killpg(child.pid,signal.SIGKILL) + except ProcessLookupError:pass + child.wait() + rc=child.returncode + finally: + try:os.killpg(child.pid,signal.SIGTERM) + except ProcessLookupError:pass + text=log.read_text(errors='replace') + counts={k:int(m[-1]) if (m:=re.findall(r'^# '+k+r' (\d+)\s*$',text,re.M)) else None for k in ['tests','pass','fail','cancelled','skipped']} + row=dict(label=label,args=args,start=begin,end=stamp(),seconds=round(time.monotonic()-t,3),exit=rc,timeout=timeout,counts=counts,skips=[l for l in text.splitlines() if re.search(r'^skip|# SKIP',l,re.I)],log=str(log.relative_to(ROOT)),tmpdir=short) + with (OUT/'results.jsonl').open('a') as f:f.write(json.dumps(row)+'\n') + print('END',json.dumps(row),flush=True) + if rc or timeout or re.search(r'^\s*not ok\b',text,re.M):raise RuntimeError('RED '+label+' '+str(log)) + return row +singles=[line for line in (PACKET/'changed-paths.txt').read_text().splitlines() if '/tests/' in line] +def stages(): + for path in singles:execute('single-'+Path(path).parent.parent.name+'-'+Path(path).stem,['node','--test',path],deadline=300) + for package in ['bus','cli','webui']: + files=sorted(glob.glob(str(ROOT/'packages'/package/'tests'/'*.test.mjs'))) + execute('suite-'+package,['node','--test',*files],cwd=ROOT/'packages'/package,deadline=1800) + for path in sorted(ROOT.glob('scripts/test-*.sh')): + # timeout itself implements TERM then KILL, inside the dedicated child group. + execute(path.stem,['timeout','-k','10','7200','bash',str(path)],deadline=7200,docker=True) + # Every mutant starts from verified candidate bytes and restores in finally. + for spec in json.loads((PACKET/'mutants.json').read_text()): + verify();edits=[spec]+spec.get('additional_edits',[]);saved={} + try: + for e in edits: + path=ROOT/e['file'];saved.setdefault(path,path.read_bytes());text=path.read_text() + if text.count(e['old'])!=1:raise RuntimeError('anchor '+spec['id']) + path.write_text(text.replace(e['old'],e['new'],1)) + # Mutation intentionally changes candidate bytes; execute has its own verify. + oldverify=globals()['verify'];globals()['verify']=lambda:None + try: + execute('mutant-'+spec['id'],['node','--test','--test-name-pattern',spec['pattern'],spec['test']],deadline=180) + status='survived' + except RuntimeError: + record=json.loads((OUT/'results.jsonl').read_text().splitlines()[-1]);text=(ROOT/record['log']).read_text(errors='replace') + failing=re.findall(r'^\s*not ok \d+ - (.*)$',text,re.M) + status='killed' if record['exit'] and not record['timeout'] and any(re.search(spec['pattern'],name) for name in failing) and 'SyntaxError:' not in text else 'invalid-failure' + finally:globals()['verify']=oldverify + finally: + for path,data in saved.items():path.write_bytes(data) + verify() + with (OUT/'mutants.jsonl').open('a') as f:f.write(json.dumps(dict(id=spec['id'],status=status,test=spec['test'],pattern=spec['pattern']))+'\n') + if status!='killed':raise RuntimeError(spec['id']+' '+status) +if __name__=='__main__': + if Path.cwd()!=ROOT:raise SystemExit('wrong cwd') + head=subprocess.check_output(['git','rev-parse','HEAD'],cwd=ROOT,text=True).strip() + expected=(PACKET/'run-head.txt').read_text().strip() + if head!=expected:raise SystemExit('wrong HEAD') + (OUT/'head.json').write_text(json.dumps(dict(head=head,manifest=hashlib.sha256((PACKET/'candidate-manifest.sha256').read_bytes()).hexdigest(),start=stamp()))) + verify() + try:stages() + finally: + verify();(OUT/'cwd-sweep.json').write_text(json.dumps(sweep(),indent=2)) + # Remove only the owned fixture compose network, if any; never daemon/volumes. + subprocess.run(['docker','network','rm','rocko-r219-gate_default'],stdout=(OUT/'network-cleanup.log').open('w'),stderr=subprocess.STDOUT) From 0e040cf946c72b47ebcb339460ab037ca2be5b5f Mon Sep 17 00:00:00 2001 From: Rocko Date: Thu, 22 Oct 2026 23:26:17 -0500 Subject: [PATCH 3/8] test: give row 219 persona fixture its explicit session Apply mos-1408 and sage-3178 without creating the directory being asserted. Preserve the first red evidence and select TAP explicitly for the next approved run. --- agents/rocko/work/queue-219/BUILD.md | 24 ++++ agents/rocko/work/queue-219/build.patch | 10 +- agents/rocko/work/queue-219/busy-first.py | 14 ++ .../work/queue-219/candidate-manifest.sha256 | 2 +- agents/rocko/work/queue-219/run-219.py | 3 +- .../queue-219/run-4a9c/cwd-sweep-final.json | 1 + .../work/queue-219/run-4a9c/cwd-sweep.json | 1 + .../run-4a9c/derived-counts-first-stop.json | 130 ++++++++++++++++++ .../rocko/work/queue-219/run-4a9c/head.json | 1 + .../queue-219/run-4a9c/network-cleanup.log | 2 + .../work/queue-219/run-4a9c/results.jsonl | 4 + .../run-4a9c/single-bus-creative.test.tap | 14 ++ .../run-4a9c/single-bus-threads.test.tap | 27 ++++ .../single-bus-user-principal.test.tap | 31 +++++ .../run-4a9c/single-cli-launcher.test.tap | 84 +++++++++++ packages/cli/tests/launcher.test.mjs | 6 +- 16 files changed, 346 insertions(+), 8 deletions(-) create mode 100644 agents/rocko/work/queue-219/busy-first.py create mode 100644 agents/rocko/work/queue-219/run-4a9c/cwd-sweep-final.json create mode 100644 agents/rocko/work/queue-219/run-4a9c/cwd-sweep.json create mode 100644 agents/rocko/work/queue-219/run-4a9c/derived-counts-first-stop.json create mode 100644 agents/rocko/work/queue-219/run-4a9c/head.json create mode 100644 agents/rocko/work/queue-219/run-4a9c/network-cleanup.log create mode 100644 agents/rocko/work/queue-219/run-4a9c/results.jsonl create mode 100644 agents/rocko/work/queue-219/run-4a9c/single-bus-creative.test.tap create mode 100644 agents/rocko/work/queue-219/run-4a9c/single-bus-threads.test.tap create mode 100644 agents/rocko/work/queue-219/run-4a9c/single-bus-user-principal.test.tap create mode 100644 agents/rocko/work/queue-219/run-4a9c/single-cli-launcher.test.tap diff --git a/agents/rocko/work/queue-219/BUILD.md b/agents/rocko/work/queue-219/BUILD.md index a3b7e12de..20545881d 100644 --- a/agents/rocko/work/queue-219/BUILD.md +++ b/agents/rocko/work/queue-219/BUILD.md @@ -205,3 +205,27 @@ live cases, so not used as the Docker worst-case estimate). Mos1316/1317 first-run launcher/creative/chat-browser reds, any old-test red or a second red stop before fixes and go to Sage/Mos. No run evidence yet. + +## First red and approved test-only correction: mos-1408 / sage-3178-3179 + +Run c7bf3622d stopped at launcher.test's row213 persona-mismatch assertion: +04:07:22.895-04:07:51.870Z, creative 4/0/0, threads 19/0/0, +user-principal 23/0/0, launcher 33/1/0: total 79 pass, 1 fail, 0 skip. +The approved threadsState snapshot had no session; row269's session-required +admission fired before bundle/persona reading. Original logs remain in +run-4a9c/ and derived-counts-first-stop.json reads their default spec output. +No retry or fix occurred before Mos's ruling. Slot returned after empty +Node/Chromium cwd sweep and all 14 source hashes checked. + +Mos-1408 permits only an explicit SESSION in that snapshot and literal-path +assertions: the native threads/acme//sessions//session exists, +and the legacy threads/acme//session does not. No sessionStore() call +in the assertion: it creates directories and could manufacture the evidence. +Every other assertion stays exactly as before; no second host op is wrapped. +No product change. Runner explicitly selects --test-reporter=tap (packet-only) +and uses new run-4a9c-mos1408/ output, preserving the failed first attempt. +The next CLEAR reruns from the beginning: whole files, suites, shells, all +23 mutants, reader audit. Any red or second edit must return to Sage/Mos. + +Sage-3179: commit/push during the current gap; hold re-claim until our own +slot, after 292 then 294. No tests or queue writes under another seat's slot. diff --git a/agents/rocko/work/queue-219/build.patch b/agents/rocko/work/queue-219/build.patch index c7d489802..950dbbca3 100644 --- a/agents/rocko/work/queue-219/build.patch +++ b/agents/rocko/work/queue-219/build.patch @@ -265,10 +265,10 @@ index bfe55b61e..d8248284c 100644 (!threaded && s.instance === r.instance && (spawnedAt.get(s.run) ?? Date.parse(s.startedAt)) <= at))); } diff --git a/packages/cli/tests/launcher.test.mjs b/packages/cli/tests/launcher.test.mjs -index 2202c7753..0a34fe27a 100644 +index 2202c7753..a9a7d2d40 100644 --- a/packages/cli/tests/launcher.test.mjs +++ b/packages/cli/tests/launcher.test.mjs -@@ -773,21 +773,28 @@ test("row 213 a creative instance's persona is read from /personas: o +@@ -773,21 +773,30 @@ test("row 213 a creative instance's persona is read from /personas: o const dir = join(given.root, "config", "personas", "acme"); mkdirSync(dir, { recursive: true, mode: 0o700 }); writeFileSync(join(dir, "bean.md"), "Not the pinned text.\n", { mode: 0o600 }); @@ -281,10 +281,11 @@ index 2202c7753..0a34fe27a 100644 + // Row 219: creative instances launch from their thread, not from a chief's standalone request. + // The mismatch occurs before bindLaunch, so only the host's thread-state snapshot is a fixture. + const thread = 'persona-thread'; ++ const SESSION = 'persona-session'; + const { f, launcher } = await setup(t, undefined, given, { wrap: host => ({ + ...host, + op: message => message.op === 'threadsState' -+ ? Promise.resolve([{ thread, instance: 'bean', holder: null, pending: 1 }]) ++ ? Promise.resolve([{ thread, session: SESSION, instance: 'bean', holder: null, pending: 1 }]) + : host.op(message), + }) }); + // The bundle's refusal remains launch-failed with the persona mismatch as its reason. @@ -300,7 +301,8 @@ index 2202c7753..0a34fe27a 100644 assert.equal(runs.length, 1); - assert.deepEqual(readdirSync(join(f.dataRoot, "launches", "acme", runs[0])), ["session"]); + assert.deepEqual(readdirSync(join(f.dataRoot, "launches", "acme", runs[0])), []); -+ assert.equal(existsSync(join(f.dataRoot, "threads", "acme", thread, "session")), true); ++ assert.equal(existsSync(join(f.dataRoot, "threads", "acme", thread, "sessions", SESSION, "session")), true); ++ assert.equal(existsSync(join(f.dataRoot, "threads", "acme", thread, "session")), false); }); test("row 64 on Claude Code a role skill that isn't enabled refuses the same way, before anything starts", { timeout: 30000 }, async (t) => { diff --git a/agents/rocko/work/queue-219/busy-first.py b/agents/rocko/work/queue-219/busy-first.py new file mode 100644 index 000000000..6bc807a5e --- /dev/null +++ b/agents/rocko/work/queue-219/busy-first.py @@ -0,0 +1,14 @@ +from pathlib import Path +import os,json +busy=[] +for p in Path('/proc').glob('[0-9]*'): + try: + if int(p.name)==os.getpid():continue + comm=(p/'comm').read_text().strip() + if not any(x in comm for x in ['node','python','bash']):continue + args=(p/'cmdline').read_bytes().split(b'\0') + if (comm.startswith('node') and b'--test' in args) or any(x.rsplit(b'/',1)[-1] in (b'run-mutants.py',b'gate-run.sh') for x in args): + busy.append(dict(pid=int(p.name),cwd=str((p/'cwd').resolve()),name=comm)) + except (PermissionError,FileNotFoundError,ProcessLookupError):pass +print('BUSY_CHECK',json.dumps(busy)) +raise SystemExit(bool(busy)) diff --git a/agents/rocko/work/queue-219/candidate-manifest.sha256 b/agents/rocko/work/queue-219/candidate-manifest.sha256 index 8f29026fa..ffffd8245 100644 --- a/agents/rocko/work/queue-219/candidate-manifest.sha256 +++ b/agents/rocko/work/queue-219/candidate-manifest.sha256 @@ -3,7 +3,7 @@ b0c66c8999b567896923f6c876911dba936c6eca1ccc7aaeada51369fd613594 packages/bus/t de4913f50801a11fd172e3f2c2b3cb41ab04e84d32a6650d1c8662b5e227ea3d packages/bus/tests/threads.test.mjs 8f7d6745fffb2a0898ac80c012084ac48964748da6439a8c56facc6529ffb19b packages/bus/tests/user-principal.test.mjs b74275ce43249bafc97edc87a6a3aa0431c62fe1a28cd9fa265246e6d6da219b packages/cli/src/launcher.mjs -fc301cde49e6db1286e90d6ac3410f5f4d87351bec61f1bae27c235a041848b6 packages/cli/tests/launcher.test.mjs +6e5446030f4bbec714598cc64bf096e9b2a0bd3da1d77817b848fcd67e0d2db9 packages/cli/tests/launcher.test.mjs a219036737419870e0aa9d0da20843759a66be5bafff44d3292593833f8fcb9a packages/cli/tests/thread-launch.test.mjs cbfd54e6b375561d1e4679ee8d78a3285f970d9a7198cec9d22a06510a36afba packages/webui/src/chat-http.mjs f49a49c6ec69783190d3f5eaf34316cb4d2c44d10d2ee9336fe1383207afefff packages/webui/src/chat.mjs diff --git a/agents/rocko/work/queue-219/run-219.py b/agents/rocko/work/queue-219/run-219.py index caf6a7ad8..895c91da0 100644 --- a/agents/rocko/work/queue-219/run-219.py +++ b/agents/rocko/work/queue-219/run-219.py @@ -5,7 +5,7 @@ from pathlib import Path from datetime import datetime,timezone ROOT=Path(__file__).resolve().parents[4] PACKET=Path(__file__).resolve().parent -OUT=PACKET/'run-4a9c';OUT.mkdir(exist_ok=True) +OUT=PACKET/'run-4a9c-mos1408';OUT.mkdir(exist_ok=True) def stamp():return datetime.now(timezone.utc).isoformat() def verify(): for line in (PACKET/'candidate-manifest.sha256').read_text().splitlines(): @@ -20,6 +20,7 @@ def sweep(): except (FileNotFoundError,PermissionError,ProcessLookupError):pass return found def execute(label,args,cwd=ROOT,deadline=300,docker=False): + if args[0]=='node' and '--test' in args and '--test-reporter=tap' not in args:args=[args[0],'--test-reporter=tap',*args[1:]] verify();short=tempfile.mkdtemp(prefix='r',dir='/mnt/storage/scratch/tmp') env=os.environ.copy();env.update(TMPDIR=short,NO_COLOR='1',COMPOSE_PROJECT_NAME='rocko-r219-gate') env.pop('MOSAIC_GITEA_CREDENTIAL_FILE',None);env.pop('MOSAIC_LIVE_PROVIDER',None) diff --git a/agents/rocko/work/queue-219/run-4a9c/cwd-sweep-final.json b/agents/rocko/work/queue-219/run-4a9c/cwd-sweep-final.json new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/agents/rocko/work/queue-219/run-4a9c/cwd-sweep-final.json @@ -0,0 +1 @@ +[] diff --git a/agents/rocko/work/queue-219/run-4a9c/cwd-sweep.json b/agents/rocko/work/queue-219/run-4a9c/cwd-sweep.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/agents/rocko/work/queue-219/run-4a9c/cwd-sweep.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/agents/rocko/work/queue-219/run-4a9c/derived-counts-first-stop.json b/agents/rocko/work/queue-219/run-4a9c/derived-counts-first-stop.json new file mode 100644 index 000000000..ee014fdb8 --- /dev/null +++ b/agents/rocko/work/queue-219/run-4a9c/derived-counts-first-stop.json @@ -0,0 +1,130 @@ +[ + { + "label": "single-bus-creative.test", + "args": [ + "node", + "--test", + "packages/bus/tests/creative.test.mjs" + ], + "start": "2026-10-23T04:07:22.895462+00:00", + "end": "2026-10-23T04:07:23.260724+00:00", + "seconds": 0.365, + "exit": 0, + "timeout": false, + "counts": { + "tests": null, + "pass": null, + "fail": null, + "cancelled": null, + "skipped": null + }, + "skips": [], + "log": "agents/rocko/work/queue-219/run-4a9c/single-bus-creative.test.tap", + "tmpdir": "/mnt/storage/scratch/tmp/rsrt5bzap", + "derived_spec_counts": { + "tests": 4, + "pass": 4, + "fail": 0, + "cancelled": 0, + "skipped": 0 + }, + "failed_test_names": [] + }, + { + "label": "single-bus-threads.test", + "args": [ + "node", + "--test", + "packages/bus/tests/threads.test.mjs" + ], + "start": "2026-10-23T04:07:23.262757+00:00", + "end": "2026-10-23T04:07:24.629883+00:00", + "seconds": 1.367, + "exit": 0, + "timeout": false, + "counts": { + "tests": null, + "pass": null, + "fail": null, + "cancelled": null, + "skipped": null + }, + "skips": [], + "log": "agents/rocko/work/queue-219/run-4a9c/single-bus-threads.test.tap", + "tmpdir": "/mnt/storage/scratch/tmp/r5anojtow", + "derived_spec_counts": { + "tests": 19, + "pass": 19, + "fail": 0, + "cancelled": 0, + "skipped": 0 + }, + "failed_test_names": [] + }, + { + "label": "single-bus-user-principal.test", + "args": [ + "node", + "--test", + "packages/bus/tests/user-principal.test.mjs" + ], + "start": "2026-10-23T04:07:24.631177+00:00", + "end": "2026-10-23T04:07:25.246596+00:00", + "seconds": 0.615, + "exit": 0, + "timeout": false, + "counts": { + "tests": null, + "pass": null, + "fail": null, + "cancelled": null, + "skipped": null + }, + "skips": [], + "log": "agents/rocko/work/queue-219/run-4a9c/single-bus-user-principal.test.tap", + "tmpdir": "/mnt/storage/scratch/tmp/rg47u_3c2", + "derived_spec_counts": { + "tests": 23, + "pass": 23, + "fail": 0, + "cancelled": 0, + "skipped": 0 + }, + "failed_test_names": [] + }, + { + "label": "single-cli-launcher.test", + "args": [ + "node", + "--test", + "packages/cli/tests/launcher.test.mjs" + ], + "start": "2026-10-23T04:07:25.247904+00:00", + "end": "2026-10-23T04:07:51.870129+00:00", + "seconds": 26.622, + "exit": 1, + "timeout": false, + "counts": { + "tests": null, + "pass": null, + "fail": null, + "cancelled": null, + "skipped": null + }, + "skips": [], + "log": "agents/rocko/work/queue-219/run-4a9c/single-cli-launcher.test.tap", + "tmpdir": "/mnt/storage/scratch/tmp/r8oua_z8g", + "derived_spec_counts": { + "tests": 34, + "pass": 33, + "fail": 1, + "cancelled": 0, + "skipped": 0 + }, + "failed_test_names": [ + "row 213 a creative instance's persona is read from /personas: off its digest the launch fails with the mismatch as its reason", + "failing tests:", + "row 213 a creative instance's persona is read from /personas: off its digest the launch fails with the mismatch as its reason" + ] + } +] diff --git a/agents/rocko/work/queue-219/run-4a9c/head.json b/agents/rocko/work/queue-219/run-4a9c/head.json new file mode 100644 index 000000000..1d98792f2 --- /dev/null +++ b/agents/rocko/work/queue-219/run-4a9c/head.json @@ -0,0 +1 @@ +{"head": "c7bf3622dd617ea1e3e68a1c9ce44774e2cfe9da", "manifest": "cd791883449f0d64fca06a9a855f855c93d7db74ced53ccebbcb0bad5a0206a7", "start": "2026-10-23T04:07:22.892671+00:00"} \ No newline at end of file diff --git a/agents/rocko/work/queue-219/run-4a9c/network-cleanup.log b/agents/rocko/work/queue-219/run-4a9c/network-cleanup.log new file mode 100644 index 000000000..5f00a1b72 --- /dev/null +++ b/agents/rocko/work/queue-219/run-4a9c/network-cleanup.log @@ -0,0 +1,2 @@ +Error response from daemon: network rocko-r219-gate_default not found +exit status 1 diff --git a/agents/rocko/work/queue-219/run-4a9c/results.jsonl b/agents/rocko/work/queue-219/run-4a9c/results.jsonl new file mode 100644 index 000000000..f50fdfc9e --- /dev/null +++ b/agents/rocko/work/queue-219/run-4a9c/results.jsonl @@ -0,0 +1,4 @@ +{"label": "single-bus-creative.test", "args": ["node", "--test", "packages/bus/tests/creative.test.mjs"], "start": "2026-10-23T04:07:22.895462+00:00", "end": "2026-10-23T04:07:23.260724+00:00", "seconds": 0.365, "exit": 0, "timeout": false, "counts": {"tests": null, "pass": null, "fail": null, "cancelled": null, "skipped": null}, "skips": [], "log": "agents/rocko/work/queue-219/run-4a9c/single-bus-creative.test.tap", "tmpdir": "/mnt/storage/scratch/tmp/rsrt5bzap"} +{"label": "single-bus-threads.test", "args": ["node", "--test", "packages/bus/tests/threads.test.mjs"], "start": "2026-10-23T04:07:23.262757+00:00", "end": "2026-10-23T04:07:24.629883+00:00", "seconds": 1.367, "exit": 0, "timeout": false, "counts": {"tests": null, "pass": null, "fail": null, "cancelled": null, "skipped": null}, "skips": [], "log": "agents/rocko/work/queue-219/run-4a9c/single-bus-threads.test.tap", "tmpdir": "/mnt/storage/scratch/tmp/r5anojtow"} +{"label": "single-bus-user-principal.test", "args": ["node", "--test", "packages/bus/tests/user-principal.test.mjs"], "start": "2026-10-23T04:07:24.631177+00:00", "end": "2026-10-23T04:07:25.246596+00:00", "seconds": 0.615, "exit": 0, "timeout": false, "counts": {"tests": null, "pass": null, "fail": null, "cancelled": null, "skipped": null}, "skips": [], "log": "agents/rocko/work/queue-219/run-4a9c/single-bus-user-principal.test.tap", "tmpdir": "/mnt/storage/scratch/tmp/rg47u_3c2"} +{"label": "single-cli-launcher.test", "args": ["node", "--test", "packages/cli/tests/launcher.test.mjs"], "start": "2026-10-23T04:07:25.247904+00:00", "end": "2026-10-23T04:07:51.870129+00:00", "seconds": 26.622, "exit": 1, "timeout": false, "counts": {"tests": null, "pass": null, "fail": null, "cancelled": null, "skipped": null}, "skips": [], "log": "agents/rocko/work/queue-219/run-4a9c/single-cli-launcher.test.tap", "tmpdir": "/mnt/storage/scratch/tmp/r8oua_z8g"} diff --git a/agents/rocko/work/queue-219/run-4a9c/single-bus-creative.test.tap b/agents/rocko/work/queue-219/run-4a9c/single-bus-creative.test.tap new file mode 100644 index 000000000..5061e9926 --- /dev/null +++ b/agents/rocko/work/queue-219/run-4a9c/single-bus-creative.test.tap @@ -0,0 +1,14 @@ +organization: {"event":"reload-needs-restart","business":"demo"} +organization: {"event":"reload-needs-restart","business":"demo"} +✔ M6: a creative raise refuses decision-not-allowed, cited or not, and no decision row appears; the assistant still raises (34.696206ms) +✔ a creative instance sends only to the user and hears only from the user (41.081291ms) +✔ M10 through the broker: the chief and the tester are refused on bean, the human's limits.set of its models key works (81.11191ms) +✔ row 256 T6 the human deletes a creative instance through the broker; the chief and the tester are refused at the verb (57.456912ms) +ℹ tests 4 +ℹ suites 0 +ℹ pass 4 +ℹ fail 0 +ℹ cancelled 0 +ℹ skipped 0 +ℹ todo 0 +ℹ duration_ms 334.223966 diff --git a/agents/rocko/work/queue-219/run-4a9c/single-bus-threads.test.tap b/agents/rocko/work/queue-219/run-4a9c/single-bus-threads.test.tap new file mode 100644 index 000000000..f97159b39 --- /dev/null +++ b/agents/rocko/work/queue-219/run-4a9c/single-bus-threads.test.tap @@ -0,0 +1,27 @@ +✔ REQ-ROLE-2 REQ-THREAD-1: one holder per thread, through the broker and the trigger (36.004676ms) +✔ REQ-ROLE-2 REQ-THREAD-1: the 3e triggers refuse writes that skip the broker (68.738374ms) +✔ REQ-MSG-1: a message to or from the assistant names its thread, or is refused (32.515768ms) +✔ REQ-MSG-1: the chief of staff's reply comes back to the thread that sent the work (610.990913ms) +✔ REQ-MSG-1: a reply can't carry one thread instance's thread to another thread instance (23.409918ms) +✔ REQ-THREAD-1 REQ-USER-2: one thread's messages never reach another thread's holder (28.817937ms) +✔ REQ-LAUNCH-1: a message to a thread with no holder waits, and the next holder gets it (30.260544ms) +✔ REQ-THREAD-2 REQ-LAUNCH-1: threadIdle releases only a thread with nothing waiting, and only for its holder (32.327162ms) +✔ REQ-THREAD-2 REQ-LAUNCH-1: a message delivered to a run that ended unread doesn't hold up the next holder (29.133476ms) +✔ REQ-ROLE-2 REQ-THREAD-1 Q169: a role.revoke the human approved ends every thread run of the assistant (26.476132ms) +✔ Q169 REQ-USER-2: assistant.stop ends the human's own assistant thread runs, and only the human's (39.418785ms) +✔ REQ-USER-2: the human verbs refuse another owner's thread (28.785396ms) +✔ REQ-THREAD-1: thread.create refuses when the business has no thread instance or more than one (22.979076ms) +✔ REQ-ORG-2: projects and threads are named once, and the repo names a business project (25.496215ms) +✔ REQ-THREAD-2: thread.messages returns the thread's history in pages and writes nothing (90.366693ms) +✔ project.create refuses a repository name without its matching repo before any write (16.151198ms) +✔ project.create keeps unrelated names with and without a repository (11.187274ms) +✔ C2-09a: explicit creative instances bind independent threads, default sessions and holders (47.776915ms) +✔ C2-09a: explicit missing, non-thread and malformed selectors create no thread or session (20.207317ms) +ℹ tests 19 +ℹ suites 0 +ℹ pass 19 +ℹ fail 0 +ℹ cancelled 0 +ℹ skipped 0 +ℹ todo 0 +ℹ duration_ms 1299.709199 diff --git a/agents/rocko/work/queue-219/run-4a9c/single-bus-user-principal.test.tap b/agents/rocko/work/queue-219/run-4a9c/single-bus-user-principal.test.tap new file mode 100644 index 000000000..6ffdb1c0e --- /dev/null +++ b/agents/rocko/work/queue-219/run-4a9c/single-bus-user-principal.test.tap @@ -0,0 +1,31 @@ +✔ R3: bindUser binds a granted user and refuses one with no live grant (14.786261ms) +✔ R3: a user named like the business human, the tester or a principal word is refused, whatever the grants say (9.870795ms) +✔ R3: each collaborator verb is allowed to a granted user (19.637409ms) +✔ R3: every verb off the collaborator list refuses a user access-refused before its own checks (105.182773ms) +✔ R3: task, web and host verbs refuse a user access-refused (25.672551ms) +✔ R3 leak: project.list shows granted projects only (13.27019ms) +✔ R3 leak: thread.create needs the project and the thread instance granted, and an ungranted id reads as one that does not exist (15.965771ms) +✔ R3 leak: thread.list shows the user its own threads that are still granted, never others (35.018528ms) +✔ R3 leak: names shows granted instances only (15.057536ms) +✔ R3: thread.send is from user: and writes no human.input (13.514578ms) +✔ R3: a reply-chain message.send into another user thread is refused (16.631267ms) +✔ R3: the run reply to a user message reaches that user thread.messages, with no waiting and no notice (18.899841ms) +✔ R3: a reply to: user without a matching in_reply_to is refused user-reply-required (28.916725ms) +✔ R3: a non-thread run, the human and the tester cannot send to: user (17.965675ms) +✔ R3: a user thread run cannot message the owner, while its uncited gated raise reaches only the owner inbox, B9 (19.241443ms) +✔ R3: a removed or expired grant refuses the next request access-revoked, and the file is read per request (17.997053ms) +✔ R3: a user refusal is recorded as action.refused by user: (14.840437ms) +✔ R3: a business with a role keyed user refuses invalid-business (10.081108ms) +✔ R3: name.set refuses the name user (10.301262ms) +✔ R3 r4: while halted, a granted user's thread.send refuses processing-halted and thread.messages still answers (14.447561ms) +✔ R3 r4: the chief's hire refuses an instance named user with the code it gives human and tester (15.786706ms) +✔ R3 r4: a non-function access throws before the store is read (0.121803ms) +✔ C2-09a: naming an instance cannot bypass its collaborator grant or disclose an ungranted project (16.966486ms) +ℹ tests 23 +ℹ suites 0 +ℹ pass 23 +ℹ fail 0 +ℹ cancelled 0 +ℹ skipped 0 +ℹ todo 0 +ℹ duration_ms 545.0572 diff --git a/agents/rocko/work/queue-219/run-4a9c/single-cli-launcher.test.tap b/agents/rocko/work/queue-219/run-4a9c/single-cli-launcher.test.tap new file mode 100644 index 000000000..c7b89826f --- /dev/null +++ b/agents/rocko/work/queue-219/run-4a9c/single-cli-launcher.test.tap @@ -0,0 +1,84 @@ +✔ C2-04: launcher workspace clones code but never the library (1405.320275ms) +✔ bus start --pm: the launcher instance (the chief of staff) runs under its own PID namespace, registered, with a manifest (1322.785792ms) +usage: {"event":"usage-unknown","business":"acme","run":"r6724498202ca","instance":"chief","turn":"4d5e8541-7110-44bb-8a7a-ed92208a0fd3","source":"@none","code":"baseline-unknown"} +usage: {"event":"usage-unknown","business":"acme","run":"rd57aefe67267","instance":"coder","turn":"b9afd99d-fad8-48ce-8c03-ca9f9b329cfb","source":"@none","code":"baseline-unknown"} +✔ the chief of staff launches a coder through its launch tool; the coder answers; refusals name their code (726.266248ms) +usage: {"event":"usage-unknown","business":"acme","run":"r6e78d96da940","instance":"chief","turn":"0286a736-4a58-46ff-92bb-e974030f5bd7","source":"@none","code":"baseline-unknown"} +usage: {"event":"usage-unknown","business":"acme","run":"r7a24261c88d1","instance":"pm","turn":"a6496c08-1b00-4b40-8d0e-03bc7e972248","source":"@none","code":"baseline-unknown"} +usage: {"event":"usage-unknown","business":"acme","run":"r6e78d96da940","instance":"chief","turn":"cdf4283b-3be0-415c-88d2-ea1e45163617","source":"@none","code":"baseline-unknown"} +usage: {"event":"usage-unknown","business":"acme","run":"r6e78d96da940","instance":"chief","turn":"046a20f2-e7eb-477b-b6e6-b7588b603cbd","source":"@none","code":"baseline-unknown"} +usage: {"event":"usage-unknown","business":"acme","run":"r7a24261c88d1","instance":"pm","turn":"9a07e317-c472-4f17-bb7d-2309cf341af7","source":"@none","code":"baseline-unknown"} +usage: {"event":"usage-unknown","business":"acme","run":"r7a24261c88d1","instance":"pm","turn":"b0ebda74-f2a9-440a-a173-39dcae896036","source":"@none","code":"baseline-unknown"} +usage: {"event":"usage-unknown","business":"acme","run":"r6e78d96da940","instance":"chief","turn":"15238cb8-619f-4a31-b853-fb55d9b86e79","source":"@none","code":"baseline-unknown"} +usage: {"event":"usage-unknown","business":"acme","run":"r7a24261c88d1","instance":"pm","turn":"8a3ef9b0-73bb-4a3f-bf0e-06dcbc0f60c4","source":"@none","code":"baseline-unknown"} +usage: {"event":"usage-unknown","business":"acme","run":"r6e78d96da940","instance":"chief","turn":"4077ae80-1bfc-4cdd-bfca-27c992282797","source":"@none","code":"baseline-unknown"} +✔ a launched pm's request_staff reaches the chief of staff; no other session has the tool and the launch limits still hold (1123.845931ms) +✔ each launch makes sure the workspace has a clone of the project: cloned, fast-forwarded, or fetched and logged (4152.636087ms) +✔ a role the broker says holds a merge decision gets land_work, its prompt line, its landing and the git socket; without it, none (617.243337ms) +✔ REQ-LAUNCH-1 the tick starts a listed merge decision holder once, with land_work, the Landing line and its landing turn; an unlisted holder starts nothing (412.306281ms) +usage: {"event":"usage-unknown","business":"acme","run":"rcf551273e0ad","instance":"coder","turn":"c4220d02-0bf0-4122-aa52-925afe04df92","source":"@none","code":"baseline-unknown"} +✔ a holder running since before the resolution is stopped once the broker releases it, land-relaunch, and the next tick starts it: landing turn first, then the message that waited (700.748992ms) +✔ a landing run that ended isn't started again for its decision, a spent decision starts nothing, and a new decision starts the holder (638.103132ms) +✔ after a restart, the new host's first tick starts a holder whose decision is still held (890.273051ms) +✔ a refused landing start is logged once per code with its decision, isn't a start, and the next tick with room starts the holder (632.625787ms) +✔ a project clone that can't be made refuses checkout-failed, from --chief and from a session, with no run and no clone left (266.198371ms) +✔ a runner that stops at once ends its launch with the runner's reason (345.619813ms) +✔ a Claude Code launch with no session credential refuses before it starts (189.183758ms) +✔ a pi launch needs no session credential: pi logs in through its own ENV_ALLOW variables (338.515656ms) +usage: {"event":"plugin-refused","kind":"harness","name":"down","code":"missing","message":"/mnt/storage/scratch/rocko-r219/packages/plugins/harness/down is missing","kept":[]} +plugins: {"event":"plugin-refused","kind":"harness","name":"down","code":"missing","message":"/mnt/storage/scratch/rocko-r219/packages/plugins/harness/down is missing","kept":[]} +✔ row 65 a failed primary preflight launches the fallback on a fixture harness module, recording the route and the reason (364.92973ms) +✔ a runner killed from the host ends its launch as killed, not failed (396.074165ms) +✔ a missing or failing bwrap refuses sandbox-unavailable before anything starts; there is no unconfined fallback (192.417417ms) +✔ row 64 a role skill that isn't enabled refuses skill-not-enabled, and one that isn't a plain directory skill-refused, before anything starts (190.827519ms) +✖ row 213 a creative instance's persona is read from /personas: off its digest the launch fails with the mismatch as its reason (192.548301ms) +✔ row 64 on Claude Code a role skill that isn't enabled refuses the same way, before anything starts (189.824532ms) +usage: {"event":"usage-unknown","business":"acme","run":"rf7aede34a71b","instance":"chief","turn":"799876e4-fe02-4621-aaac-dfc5cf192082","source":"@none","code":"baseline-unknown"} +usage: {"event":"usage-unknown","business":"acme","run":"ref958a5bcbb6","instance":"coder","turn":"ce0a5214-37f5-48d4-ae90-c9f6745e058d","source":"@none","code":"baseline-unknown"} +✔ a real Claude Code coder's shell can't read a stand-in secret or anything else its sandbox doesn't hold (1782.388685ms) +✔ a host that died hard leaves its sessions to the next host, which kills them and ends their runs so the role can be launched again (1025.160483ms) +✔ a host that died hard leaves its sessions to the next host, which finds one already exited (23) and ends their runs so the role can be launched again (3976.016342ms) +✔ bus start --no-launch leaves an earlier host's live session alone: no signal, no end, sessions.json as it was (236.101723ms) +✔ bus start --no-launch refuses every launch: the PM launch and a session's request, each logged, nothing spawned (195.720542ms) +✔ bus start --no-launch starts no thread tick; the same host with launches runs it (1179.765366ms) +✔ a malformed sessions.json refuses the host start with exit 3 and stays as it was (174.297238ms) +✔ an over-long launch request is refused at once, not at the 10 s idle timeout (187.137601ms) +✔ a launch client that never closes its side doesn't hold the host's close (184.807395ms) +✔ a runner that ignores SIGTERM is killed when the host closes (1359.638326ms) +✔ kill switch refuses chief and hire before launch work and a clear permits a later request (317.536928ms) +✔ kill switch stops an actual managed namespace and records the halt reason without rewriting its bundle (326.035999ms) +✔ a launch waiting across halt and resume cannot use its stale admission (196.129785ms) +ℹ tests 34 +ℹ suites 0 +ℹ pass 33 +ℹ fail 1 +ℹ cancelled 0 +ℹ skipped 0 +ℹ todo 0 +ℹ duration_ms 26568.728775 + +✖ failing tests: + +test at packages/cli/tests/launcher.test.mjs:766:1 +✖ row 213 a creative instance's persona is read from /personas: off its digest the launch fails with the mismatch as its reason (192.548301ms) + AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal: + + actual - expected + + [ + 'refused', + + 'session-required', + - 'launch-failed', + 1 + ] + + at TestContext. (file:///mnt/storage/scratch/rocko-r219/packages/cli/tests/launcher.test.mjs:788:10) + at process.processTicksAndRejections (node:internal/process/task_queues:104:5) + at async Test.run (node:internal/test_runner/test:1409:7) + at async Test.processPendingSubtests (node:internal/test_runner/test:974:7) { + generatedMessage: true, + code: 'ERR_ASSERTION', + actual: [ 'refused', 'session-required', 1 ], + expected: [ 'refused', 'launch-failed', 1 ], + operator: 'deepStrictEqual', + diff: 'simple' + } diff --git a/packages/cli/tests/launcher.test.mjs b/packages/cli/tests/launcher.test.mjs index 0a34fe27a..a9a7d2d40 100644 --- a/packages/cli/tests/launcher.test.mjs +++ b/packages/cli/tests/launcher.test.mjs @@ -776,10 +776,11 @@ test("row 213 a creative instance's persona is read from /personas: o // Row 219: creative instances launch from their thread, not from a chief's standalone request. // The mismatch occurs before bindLaunch, so only the host's thread-state snapshot is a fixture. const thread = 'persona-thread'; + const SESSION = 'persona-session'; const { f, launcher } = await setup(t, undefined, given, { wrap: host => ({ ...host, op: message => message.op === 'threadsState' - ? Promise.resolve([{ thread, instance: 'bean', holder: null, pending: 1 }]) + ? Promise.resolve([{ thread, session: SESSION, instance: 'bean', holder: null, pending: 1 }]) : host.op(message), }) }); // The bundle's refusal remains launch-failed with the persona mismatch as its reason. @@ -794,7 +795,8 @@ test("row 213 a creative instance's persona is read from /personas: o const runs = readdirSync(join(f.dataRoot, "launches", "acme")); assert.equal(runs.length, 1); assert.deepEqual(readdirSync(join(f.dataRoot, "launches", "acme", runs[0])), []); - assert.equal(existsSync(join(f.dataRoot, "threads", "acme", thread, "session")), true); + assert.equal(existsSync(join(f.dataRoot, "threads", "acme", thread, "sessions", SESSION, "session")), true); + assert.equal(existsSync(join(f.dataRoot, "threads", "acme", thread, "session")), false); }); test("row 64 on Claude Code a role skill that isn't enabled refuses the same way, before anything starts", { timeout: 30000 }, async (t) => { From 30cf1030171f27fdc97db08695de0dd9108ea4d9 Mon Sep 17 00:00:00 2001 From: Rocko Date: Fri, 23 Oct 2026 00:56:43 -0500 Subject: [PATCH 4/8] test: pin the compaction audit before the persona refusal Apply the exact two-row fixture assertion approved by mos-1418 and sage-3232. Preserve earlier red logs; no product change and no rerun before review. --- agents/rocko/work/queue-219/BUILD.md | 31 +++ agents/rocko/work/queue-219/build.patch | 19 +- .../work/queue-219/candidate-manifest.sha256 | 2 +- agents/rocko/work/queue-219/run-219.py | 1 + .../run-4a9c-mos1408/cwd-sweep-final.json | 1 + .../queue-219/run-4a9c-mos1408/cwd-sweep.json | 1 + .../work/queue-219/run-4a9c-mos1408/head.json | 1 + .../run-4a9c-mos1408/network-cleanup.log | 2 + .../queue-219/run-4a9c-mos1408/results.jsonl | 4 + .../single-bus-creative.test.tap | 36 +++ .../single-bus-threads.test.tap | 124 +++++++++ .../single-bus-user-principal.test.tap | 148 ++++++++++ .../single-cli-launcher.test.tap | 259 ++++++++++++++++++ packages/cli/tests/launcher.test.mjs | 12 +- 14 files changed, 630 insertions(+), 11 deletions(-) create mode 100644 agents/rocko/work/queue-219/run-4a9c-mos1408/cwd-sweep-final.json create mode 100644 agents/rocko/work/queue-219/run-4a9c-mos1408/cwd-sweep.json create mode 100644 agents/rocko/work/queue-219/run-4a9c-mos1408/head.json create mode 100644 agents/rocko/work/queue-219/run-4a9c-mos1408/network-cleanup.log create mode 100644 agents/rocko/work/queue-219/run-4a9c-mos1408/results.jsonl create mode 100644 agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-creative.test.tap create mode 100644 agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-threads.test.tap create mode 100644 agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-user-principal.test.tap create mode 100644 agents/rocko/work/queue-219/run-4a9c-mos1408/single-cli-launcher.test.tap diff --git a/agents/rocko/work/queue-219/BUILD.md b/agents/rocko/work/queue-219/BUILD.md index 20545881d..73d043bc9 100644 --- a/agents/rocko/work/queue-219/BUILD.md +++ b/agents/rocko/work/queue-219/BUILD.md @@ -229,3 +229,34 @@ The next CLEAR reruns from the beginning: whole files, suites, shells, all Sage-3179: commit/push during the current gap; hold re-claim until our own slot, after 292 then 294. No tests or queue writes under another seat's slot. + +## Restart scope: sage-3224 + +Run HEAD b97a3ff97, source/test manifest a973912f, unchanged. Start every +stage from the beginning; no prior passing test carry. Sage-3224 explicitly +requires timeout -k 10 per stage, so the packet driver now wraps each Node +stage in that command too (shell stages already had it); the existing process +group timeout/cleanup remains a second bound. No source or test edit. +Singles 300s, suites 1800s, shells 7200s, mutants 180s, TERM-to-KILL 10s. +Fresh short stage TMPDIR. Explicit TAP. Separate run-4a9c-mos1408 output. + +## Second old-test edit: mos-1418 / sage-3232 (no restart yet) + +The b97a restart at 05:48:57.418-05:49:26.296Z stopped at row213 again: +creative4/0/0, threads19/0/0, user-principal23/0/0, launcher33/1/0. +Original TAP is run-4a9c-mos1408/single-cli-launcher.test.tap. Row270 now +records compactions before the persona refusal: captured tuple was +['compactions',undefined,2], not the full compactions object. Static inference +of count0/known true/reason null was explicitly identified as inference. +No edit or rerun occurred before Mos's approval; slot returned after empty +cwd sweep and 14-hash check. Remaining stages unrun. + +Mos-1418 permits this exact second edit: move run-directory lookup above the +pin, require exactly two rows, deepEqual row0 minus at to event compactions, +instance bean, thread, SESSION, run runs[0], count0, known true, reason null; +then take e from row1 and require refused/launch-failed. Later e.thread, +e.why, content nonleak, no sessions, one run, empty run directory and native/ +legacy store assertions stay unchanged. Only the specified comment changes. +No product bytes change. If inference is wrong, report red, no third edit. +Dewey must inspect this test diff before the next full restart. Local commit +only while294 holds; push waits for Sage's named gap. No runs after this edit. diff --git a/agents/rocko/work/queue-219/build.patch b/agents/rocko/work/queue-219/build.patch index 950dbbca3..5cfa4fa2d 100644 --- a/agents/rocko/work/queue-219/build.patch +++ b/agents/rocko/work/queue-219/build.patch @@ -265,10 +265,10 @@ index bfe55b61e..d8248284c 100644 (!threaded && s.instance === r.instance && (spawnedAt.get(s.run) ?? Date.parse(s.startedAt)) <= at))); } diff --git a/packages/cli/tests/launcher.test.mjs b/packages/cli/tests/launcher.test.mjs -index 2202c7753..a9a7d2d40 100644 +index 2202c7753..baabd843e 100644 --- a/packages/cli/tests/launcher.test.mjs +++ b/packages/cli/tests/launcher.test.mjs -@@ -773,21 +773,30 @@ test("row 213 a creative instance's persona is read from /personas: o +@@ -773,21 +773,34 @@ test("row 213 a creative instance's persona is read from /personas: o const dir = join(given.root, "config", "personas", "acme"); mkdirSync(dir, { recursive: true, mode: 0o700 }); writeFileSync(join(dir, "bean.md"), "Not the pinned text.\n", { mode: 0o600 }); @@ -278,6 +278,8 @@ index 2202c7753..a9a7d2d40 100644 - await new Client({ path: host.path, cap: chief.cap }).call("role.claim"); - // The bundle's refusal comes back as launch-failed, as webPlan's does, with its reason in the log. - assert.deepEqual(await launcher.fromSession(chief.cap, "bean"), { ok: false, error: "launch-failed" }); +- const [e] = log(f); +- assert.deepEqual([e.event, e.code, log(f).length], ["refused", "launch-failed", 1]); + // Row 219: creative instances launch from their thread, not from a chief's standalone request. + // The mismatch occurs before bindLaunch, so only the host's thread-state snapshot is a fixture. + const thread = 'persona-thread'; @@ -288,16 +290,21 @@ index 2202c7753..a9a7d2d40 100644 + ? Promise.resolve([{ thread, session: SESSION, instance: 'bean', holder: null, pending: 1 }]) + : host.op(message), + }) }); -+ // The bundle's refusal remains launch-failed with the persona mismatch as its reason. ++ // The thread path records row 270's run-start count before the bundle's persona refusal. + await launcher.tick(); - const [e] = log(f); - assert.deepEqual([e.event, e.code, log(f).length], ["refused", "launch-failed", 1]); ++ const runs = readdirSync(join(f.dataRoot, "launches", "acme")); ++ const entries = log(f); ++ assert.equal(entries.length, 2); ++ const { at, ...compactions } = entries[0]; ++ assert.deepEqual(compactions, { event: 'compactions', instance: 'bean', thread, session: SESSION, run: runs[0], count: 0, known: true, reason: null }); ++ const e = entries[1]; ++ assert.deepEqual([e.event, e.code], ["refused", "launch-failed"]); + assert.equal(e.thread, thread); assert.equal(e.why, `instance bean: persona file ${join(dir, "bean.md")} isn't the file persona.sha256 names`); assert.ok(!JSON.stringify(log(f)).includes("PERSONA-MARKER-d2")); assert.deepEqual(readSessions(f.dataRoot), []); // The run directory exists by then (BUILD.md residual); the persona is read before any bundle file. - const runs = readdirSync(join(f.dataRoot, "launches", "acme")); +- const runs = readdirSync(join(f.dataRoot, "launches", "acme")); assert.equal(runs.length, 1); - assert.deepEqual(readdirSync(join(f.dataRoot, "launches", "acme", runs[0])), ["session"]); + assert.deepEqual(readdirSync(join(f.dataRoot, "launches", "acme", runs[0])), []); diff --git a/agents/rocko/work/queue-219/candidate-manifest.sha256 b/agents/rocko/work/queue-219/candidate-manifest.sha256 index ffffd8245..b2ef5c5a0 100644 --- a/agents/rocko/work/queue-219/candidate-manifest.sha256 +++ b/agents/rocko/work/queue-219/candidate-manifest.sha256 @@ -3,7 +3,7 @@ b0c66c8999b567896923f6c876911dba936c6eca1ccc7aaeada51369fd613594 packages/bus/t de4913f50801a11fd172e3f2c2b3cb41ab04e84d32a6650d1c8662b5e227ea3d packages/bus/tests/threads.test.mjs 8f7d6745fffb2a0898ac80c012084ac48964748da6439a8c56facc6529ffb19b packages/bus/tests/user-principal.test.mjs b74275ce43249bafc97edc87a6a3aa0431c62fe1a28cd9fa265246e6d6da219b packages/cli/src/launcher.mjs -6e5446030f4bbec714598cc64bf096e9b2a0bd3da1d77817b848fcd67e0d2db9 packages/cli/tests/launcher.test.mjs +2c3f120dfdc0b52bf8ab38a88e86251be75d4b0d218e23df489dcaf815d6bc15 packages/cli/tests/launcher.test.mjs a219036737419870e0aa9d0da20843759a66be5bafff44d3292593833f8fcb9a packages/cli/tests/thread-launch.test.mjs cbfd54e6b375561d1e4679ee8d78a3285f970d9a7198cec9d22a06510a36afba packages/webui/src/chat-http.mjs f49a49c6ec69783190d3f5eaf34316cb4d2c44d10d2ee9336fe1383207afefff packages/webui/src/chat.mjs diff --git a/agents/rocko/work/queue-219/run-219.py b/agents/rocko/work/queue-219/run-219.py index 895c91da0..5c6b7a003 100644 --- a/agents/rocko/work/queue-219/run-219.py +++ b/agents/rocko/work/queue-219/run-219.py @@ -21,6 +21,7 @@ def sweep(): return found def execute(label,args,cwd=ROOT,deadline=300,docker=False): if args[0]=='node' and '--test' in args and '--test-reporter=tap' not in args:args=[args[0],'--test-reporter=tap',*args[1:]] + if args[0]!='timeout':args=['timeout','-k','10',str(deadline),*args] verify();short=tempfile.mkdtemp(prefix='r',dir='/mnt/storage/scratch/tmp') env=os.environ.copy();env.update(TMPDIR=short,NO_COLOR='1',COMPOSE_PROJECT_NAME='rocko-r219-gate') env.pop('MOSAIC_GITEA_CREDENTIAL_FILE',None);env.pop('MOSAIC_LIVE_PROVIDER',None) diff --git a/agents/rocko/work/queue-219/run-4a9c-mos1408/cwd-sweep-final.json b/agents/rocko/work/queue-219/run-4a9c-mos1408/cwd-sweep-final.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/agents/rocko/work/queue-219/run-4a9c-mos1408/cwd-sweep-final.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/agents/rocko/work/queue-219/run-4a9c-mos1408/cwd-sweep.json b/agents/rocko/work/queue-219/run-4a9c-mos1408/cwd-sweep.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/agents/rocko/work/queue-219/run-4a9c-mos1408/cwd-sweep.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/agents/rocko/work/queue-219/run-4a9c-mos1408/head.json b/agents/rocko/work/queue-219/run-4a9c-mos1408/head.json new file mode 100644 index 000000000..07dd958dd --- /dev/null +++ b/agents/rocko/work/queue-219/run-4a9c-mos1408/head.json @@ -0,0 +1 @@ +{"head": "b97a3ff9757ec2ac39d9ab4cebb9769e471df932", "manifest": "a973912fe2fb9c64606cd99a385305b8f51498a096511b3a980bca6b0a5b98aa", "start": "2026-10-23T05:48:57.416807+00:00"} \ No newline at end of file diff --git a/agents/rocko/work/queue-219/run-4a9c-mos1408/network-cleanup.log b/agents/rocko/work/queue-219/run-4a9c-mos1408/network-cleanup.log new file mode 100644 index 000000000..5f00a1b72 --- /dev/null +++ b/agents/rocko/work/queue-219/run-4a9c-mos1408/network-cleanup.log @@ -0,0 +1,2 @@ +Error response from daemon: network rocko-r219-gate_default not found +exit status 1 diff --git a/agents/rocko/work/queue-219/run-4a9c-mos1408/results.jsonl b/agents/rocko/work/queue-219/run-4a9c-mos1408/results.jsonl new file mode 100644 index 000000000..550ae9ec5 --- /dev/null +++ b/agents/rocko/work/queue-219/run-4a9c-mos1408/results.jsonl @@ -0,0 +1,4 @@ +{"label": "single-bus-creative.test", "args": ["timeout", "-k", "10", "300", "node", "--test-reporter=tap", "--test", "packages/bus/tests/creative.test.mjs"], "start": "2026-10-23T05:48:57.418927+00:00", "end": "2026-10-23T05:48:57.834246+00:00", "seconds": 0.415, "exit": 0, "timeout": false, "counts": {"tests": 4, "pass": 4, "fail": 0, "cancelled": 0, "skipped": 0}, "skips": ["# skipped 0"], "log": "agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-creative.test.tap", "tmpdir": "/mnt/storage/scratch/tmp/rs156uowe"} +{"label": "single-bus-threads.test", "args": ["timeout", "-k", "10", "300", "node", "--test-reporter=tap", "--test", "packages/bus/tests/threads.test.mjs"], "start": "2026-10-23T05:48:57.835837+00:00", "end": "2026-10-23T05:48:59.152912+00:00", "seconds": 1.317, "exit": 0, "timeout": false, "counts": {"tests": 19, "pass": 19, "fail": 0, "cancelled": 0, "skipped": 0}, "skips": ["# skipped 0"], "log": "agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-threads.test.tap", "tmpdir": "/mnt/storage/scratch/tmp/rbqz65jtz"} +{"label": "single-bus-user-principal.test", "args": ["timeout", "-k", "10", "300", "node", "--test-reporter=tap", "--test", "packages/bus/tests/user-principal.test.mjs"], "start": "2026-10-23T05:48:59.154288+00:00", "end": "2026-10-23T05:48:59.719646+00:00", "seconds": 0.565, "exit": 0, "timeout": false, "counts": {"tests": 23, "pass": 23, "fail": 0, "cancelled": 0, "skipped": 0}, "skips": ["# skipped 0"], "log": "agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-user-principal.test.tap", "tmpdir": "/mnt/storage/scratch/tmp/rztf343rx"} +{"label": "single-cli-launcher.test", "args": ["timeout", "-k", "10", "300", "node", "--test-reporter=tap", "--test", "packages/cli/tests/launcher.test.mjs"], "start": "2026-10-23T05:48:59.721051+00:00", "end": "2026-10-23T05:49:26.296570+00:00", "seconds": 26.576, "exit": 1, "timeout": false, "counts": {"tests": 34, "pass": 33, "fail": 1, "cancelled": 0, "skipped": 0}, "skips": ["# skipped 0"], "log": "agents/rocko/work/queue-219/run-4a9c-mos1408/single-cli-launcher.test.tap", "tmpdir": "/mnt/storage/scratch/tmp/r8xucbjgl"} diff --git a/agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-creative.test.tap b/agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-creative.test.tap new file mode 100644 index 000000000..c397aec5c --- /dev/null +++ b/agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-creative.test.tap @@ -0,0 +1,36 @@ +TAP version 13 +# organization: {"event":"reload-needs-restart","business":"demo"} +# organization: {"event":"reload-needs-restart","business":"demo"} +# Subtest: M6: a creative raise refuses decision-not-allowed, cited or not, and no decision row appears; the assistant still raises +ok 1 - M6: a creative raise refuses decision-not-allowed, cited or not, and no decision row appears; the assistant still raises + --- + duration_ms: 37.235384 + type: 'test' + ... +# Subtest: a creative instance sends only to the user and hears only from the user +ok 2 - a creative instance sends only to the user and hears only from the user + --- + duration_ms: 44.266739 + type: 'test' + ... +# Subtest: M10 through the broker: the chief and the tester are refused on bean, the human's limits.set of its models key works +ok 3 - M10 through the broker: the chief and the tester are refused on bean, the human's limits.set of its models key works + --- + duration_ms: 83.079495 + type: 'test' + ... +# Subtest: row 256 T6 the human deletes a creative instance through the broker; the chief and the tester are refused at the verb +ok 4 - row 256 T6 the human deletes a creative instance through the broker; the chief and the tester are refused at the verb + --- + duration_ms: 63.576082 + type: 'test' + ... +1..4 +# tests 4 +# suites 0 +# pass 4 +# fail 0 +# cancelled 0 +# skipped 0 +# todo 0 +# duration_ms 356.82109 diff --git a/agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-threads.test.tap b/agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-threads.test.tap new file mode 100644 index 000000000..99b713932 --- /dev/null +++ b/agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-threads.test.tap @@ -0,0 +1,124 @@ +TAP version 13 +# Subtest: REQ-ROLE-2 REQ-THREAD-1: one holder per thread, through the broker and the trigger +ok 1 - REQ-ROLE-2 REQ-THREAD-1: one holder per thread, through the broker and the trigger + --- + duration_ms: 37.957781 + type: 'test' + ... +# Subtest: REQ-ROLE-2 REQ-THREAD-1: the 3e triggers refuse writes that skip the broker +ok 2 - REQ-ROLE-2 REQ-THREAD-1: the 3e triggers refuse writes that skip the broker + --- + duration_ms: 68.301373 + type: 'test' + ... +# Subtest: REQ-MSG-1: a message to or from the assistant names its thread, or is refused +ok 3 - REQ-MSG-1: a message to or from the assistant names its thread, or is refused + --- + duration_ms: 31.316512 + type: 'test' + ... +# Subtest: REQ-MSG-1: the chief of staff's reply comes back to the thread that sent the work +ok 4 - REQ-MSG-1: the chief of staff's reply comes back to the thread that sent the work + --- + duration_ms: 593.922455 + type: 'test' + ... +# Subtest: REQ-MSG-1: a reply can't carry one thread instance's thread to another thread instance +ok 5 - REQ-MSG-1: a reply can't carry one thread instance's thread to another thread instance + --- + duration_ms: 24.857971 + type: 'test' + ... +# Subtest: REQ-THREAD-1 REQ-USER-2: one thread's messages never reach another thread's holder +ok 6 - REQ-THREAD-1 REQ-USER-2: one thread's messages never reach another thread's holder + --- + duration_ms: 27.519976 + type: 'test' + ... +# Subtest: REQ-LAUNCH-1: a message to a thread with no holder waits, and the next holder gets it +ok 7 - REQ-LAUNCH-1: a message to a thread with no holder waits, and the next holder gets it + --- + duration_ms: 30.716822 + type: 'test' + ... +# Subtest: REQ-THREAD-2 REQ-LAUNCH-1: threadIdle releases only a thread with nothing waiting, and only for its holder +ok 8 - REQ-THREAD-2 REQ-LAUNCH-1: threadIdle releases only a thread with nothing waiting, and only for its holder + --- + duration_ms: 33.754906 + type: 'test' + ... +# Subtest: REQ-THREAD-2 REQ-LAUNCH-1: a message delivered to a run that ended unread doesn't hold up the next holder +ok 9 - REQ-THREAD-2 REQ-LAUNCH-1: a message delivered to a run that ended unread doesn't hold up the next holder + --- + duration_ms: 29.046481 + type: 'test' + ... +# Subtest: REQ-ROLE-2 REQ-THREAD-1 Q169: a role.revoke the human approved ends every thread run of the assistant +ok 10 - REQ-ROLE-2 REQ-THREAD-1 Q169: a role.revoke the human approved ends every thread run of the assistant + --- + duration_ms: 26.449042 + type: 'test' + ... +# Subtest: Q169 REQ-USER-2: assistant.stop ends the human's own assistant thread runs, and only the human's +ok 11 - Q169 REQ-USER-2: assistant.stop ends the human's own assistant thread runs, and only the human's + --- + duration_ms: 38.524966 + type: 'test' + ... +# Subtest: REQ-USER-2: the human verbs refuse another owner's thread +ok 12 - REQ-USER-2: the human verbs refuse another owner's thread + --- + duration_ms: 28.558392 + type: 'test' + ... +# Subtest: REQ-THREAD-1: thread.create refuses when the business has no thread instance or more than one +ok 13 - REQ-THREAD-1: thread.create refuses when the business has no thread instance or more than one + --- + duration_ms: 23.166467 + type: 'test' + ... +# Subtest: REQ-ORG-2: projects and threads are named once, and the repo names a business project +ok 14 - REQ-ORG-2: projects and threads are named once, and the repo names a business project + --- + duration_ms: 28.154835 + type: 'test' + ... +# Subtest: REQ-THREAD-2: thread.messages returns the thread's history in pages and writes nothing +ok 15 - REQ-THREAD-2: thread.messages returns the thread's history in pages and writes nothing + --- + duration_ms: 86.802213 + type: 'test' + ... +# Subtest: project.create refuses a repository name without its matching repo before any write +ok 16 - project.create refuses a repository name without its matching repo before any write + --- + duration_ms: 15.244016 + type: 'test' + ... +# Subtest: project.create keeps unrelated names with and without a repository +ok 17 - project.create keeps unrelated names with and without a repository + --- + duration_ms: 11.57841 + type: 'test' + ... +# Subtest: C2-09a: explicit creative instances bind independent threads, default sessions and holders +ok 18 - C2-09a: explicit creative instances bind independent threads, default sessions and holders + --- + duration_ms: 46.82113 + type: 'test' + ... +# Subtest: C2-09a: explicit missing, non-thread and malformed selectors create no thread or session +ok 19 - C2-09a: explicit missing, non-thread and malformed selectors create no thread or session + --- + duration_ms: 20.263528 + type: 'test' + ... +1..19 +# tests 19 +# suites 0 +# pass 19 +# fail 0 +# cancelled 0 +# skipped 0 +# todo 0 +# duration_ms 1283.575562 diff --git a/agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-user-principal.test.tap b/agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-user-principal.test.tap new file mode 100644 index 000000000..bffa47082 --- /dev/null +++ b/agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-user-principal.test.tap @@ -0,0 +1,148 @@ +TAP version 13 +# Subtest: R3: bindUser binds a granted user and refuses one with no live grant +ok 1 - R3: bindUser binds a granted user and refuses one with no live grant + --- + duration_ms: 15.216913 + type: 'test' + ... +# Subtest: R3: a user named like the business human, the tester or a principal word is refused, whatever the grants say +ok 2 - R3: a user named like the business human, the tester or a principal word is refused, whatever the grants say + --- + duration_ms: 10.127905 + type: 'test' + ... +# Subtest: R3: each collaborator verb is allowed to a granted user +ok 3 - R3: each collaborator verb is allowed to a granted user + --- + duration_ms: 18.491408 + type: 'test' + ... +# Subtest: R3: every verb off the collaborator list refuses a user access-refused before its own checks +ok 4 - R3: every verb off the collaborator list refuses a user access-refused before its own checks + --- + duration_ms: 95.840429 + type: 'test' + ... +# Subtest: R3: task, web and host verbs refuse a user access-refused +ok 5 - R3: task, web and host verbs refuse a user access-refused + --- + duration_ms: 22.333602 + type: 'test' + ... +# Subtest: R3 leak: project.list shows granted projects only +ok 6 - R3 leak: project.list shows granted projects only + --- + duration_ms: 12.494935 + type: 'test' + ... +# Subtest: R3 leak: thread.create needs the project and the thread instance granted, and an ungranted id reads as one that does not exist +ok 7 - R3 leak: thread.create needs the project and the thread instance granted, and an ungranted id reads as one that does not exist + --- + duration_ms: 15.195921 + type: 'test' + ... +# Subtest: R3 leak: thread.list shows the user its own threads that are still granted, never others +ok 8 - R3 leak: thread.list shows the user its own threads that are still granted, never others + --- + duration_ms: 33.037437 + type: 'test' + ... +# Subtest: R3 leak: names shows granted instances only +ok 9 - R3 leak: names shows granted instances only + --- + duration_ms: 14.891286 + type: 'test' + ... +# Subtest: R3: thread.send is from user: and writes no human.input +ok 10 - R3: thread.send is from user: and writes no human.input + --- + duration_ms: 13.366772 + type: 'test' + ... +# Subtest: R3: a reply-chain message.send into another user thread is refused +ok 11 - R3: a reply-chain message.send into another user thread is refused + --- + duration_ms: 15.523733 + type: 'test' + ... +# Subtest: R3: the run reply to a user message reaches that user thread.messages, with no waiting and no notice +ok 12 - R3: the run reply to a user message reaches that user thread.messages, with no waiting and no notice + --- + duration_ms: 18.163702 + type: 'test' + ... +# Subtest: R3: a reply to: user without a matching in_reply_to is refused user-reply-required +ok 13 - R3: a reply to: user without a matching in_reply_to is refused user-reply-required + --- + duration_ms: 26.445744 + type: 'test' + ... +# Subtest: R3: a non-thread run, the human and the tester cannot send to: user +ok 14 - R3: a non-thread run, the human and the tester cannot send to: user + --- + duration_ms: 17.29104 + type: 'test' + ... +# Subtest: R3: a user thread run cannot message the owner, while its uncited gated raise reaches only the owner inbox, B9 +ok 15 - R3: a user thread run cannot message the owner, while its uncited gated raise reaches only the owner inbox, B9 + --- + duration_ms: 19.258704 + type: 'test' + ... +# Subtest: R3: a removed or expired grant refuses the next request access-revoked, and the file is read per request +ok 16 - R3: a removed or expired grant refuses the next request access-revoked, and the file is read per request + --- + duration_ms: 18.231409 + type: 'test' + ... +# Subtest: R3: a user refusal is recorded as action.refused by user: +ok 17 - R3: a user refusal is recorded as action.refused by user: + --- + duration_ms: 13.797301 + type: 'test' + ... +# Subtest: R3: a business with a role keyed user refuses invalid-business +ok 18 - R3: a business with a role keyed user refuses invalid-business + --- + duration_ms: 9.468564 + type: 'test' + ... +# Subtest: R3: name.set refuses the name user +ok 19 - R3: name.set refuses the name user + --- + duration_ms: 9.752458 + type: 'test' + ... +# Subtest: R3 r4: while halted, a granted user's thread.send refuses processing-halted and thread.messages still answers +ok 20 - R3 r4: while halted, a granted user's thread.send refuses processing-halted and thread.messages still answers + --- + duration_ms: 13.617784 + type: 'test' + ... +# Subtest: R3 r4: the chief's hire refuses an instance named user with the code it gives human and tester +ok 21 - R3 r4: the chief's hire refuses an instance named user with the code it gives human and tester + --- + duration_ms: 14.726171 + type: 'test' + ... +# Subtest: R3 r4: a non-function access throws before the store is read +ok 22 - R3 r4: a non-function access throws before the store is read + --- + duration_ms: 0.105564 + type: 'test' + ... +# Subtest: C2-09a: naming an instance cannot bypass its collaborator grant or disclose an ungranted project +ok 23 - C2-09a: naming an instance cannot bypass its collaborator grant or disclose an ungranted project + --- + duration_ms: 15.883063 + type: 'test' + ... +1..23 +# tests 23 +# suites 0 +# pass 23 +# fail 0 +# cancelled 0 +# skipped 0 +# todo 0 +# duration_ms 523.149354 diff --git a/agents/rocko/work/queue-219/run-4a9c-mos1408/single-cli-launcher.test.tap b/agents/rocko/work/queue-219/run-4a9c-mos1408/single-cli-launcher.test.tap new file mode 100644 index 000000000..a43f32623 --- /dev/null +++ b/agents/rocko/work/queue-219/run-4a9c-mos1408/single-cli-launcher.test.tap @@ -0,0 +1,259 @@ +TAP version 13 +# Subtest: C2-04: launcher workspace clones code but never the library +ok 1 - C2-04: launcher workspace clones code but never the library + --- + duration_ms: 1444.885132 + type: 'test' + ... +# Subtest: bus start --pm: the launcher instance (the chief of staff) runs under its own PID namespace, registered, with a manifest +ok 2 - bus start --pm: the launcher instance (the chief of staff) runs under its own PID namespace, registered, with a manifest + --- + duration_ms: 1312.408111 + type: 'test' + ... +# usage: {"event":"usage-unknown","business":"acme","run":"r910aab09c0d6","instance":"chief","turn":"368e3045-8783-47d3-8ae1-e429b321d9b1","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r5bb5f0657d94","instance":"coder","turn":"3432d01f-ca94-4a5e-88d3-19588a40a81d","source":"@none","code":"baseline-unknown"} +# Subtest: the chief of staff launches a coder through its launch tool; the coder answers; refusals name their code +ok 3 - the chief of staff launches a coder through its launch tool; the coder answers; refusals name their code + --- + duration_ms: 745.868459 + type: 'test' + ... +# usage: {"event":"usage-unknown","business":"acme","run":"r0f3692812967","instance":"chief","turn":"3bd3e4d7-3af4-4a1c-99f1-a8f25b7ab1dd","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"re94397bc3680","instance":"pm","turn":"b2db478d-2905-49fd-a81a-0800643bed6a","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r0f3692812967","instance":"chief","turn":"ac2aa380-f3a0-40d4-960f-a543acb8c431","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"re94397bc3680","instance":"pm","turn":"e8b5124b-591b-4d5b-829c-e944bb3e24bb","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"re94397bc3680","instance":"pm","turn":"6a6e1fa4-5182-42dc-bbc2-26f136eedee3","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r0f3692812967","instance":"chief","turn":"54eb77b5-3880-4afb-9772-0b9d590eb328","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"re94397bc3680","instance":"pm","turn":"11fe8b92-1dae-416a-838b-ae305db74bc6","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r0f3692812967","instance":"chief","turn":"68266357-b477-433c-99ed-f1af37143d91","source":"@none","code":"baseline-unknown"} +# Subtest: a launched pm's request_staff reaches the chief of staff; no other session has the tool and the launch limits still hold +ok 4 - a launched pm's request_staff reaches the chief of staff; no other session has the tool and the launch limits still hold + --- + duration_ms: 1245.265675 + type: 'test' + ... +# Subtest: each launch makes sure the workspace has a clone of the project: cloned, fast-forwarded, or fetched and logged +ok 5 - each launch makes sure the workspace has a clone of the project: cloned, fast-forwarded, or fetched and logged + --- + duration_ms: 4072.119958 + type: 'test' + ... +# Subtest: a role the broker says holds a merge decision gets land_work, its prompt line, its landing and the git socket; without it, none +ok 6 - a role the broker says holds a merge decision gets land_work, its prompt line, its landing and the git socket; without it, none + --- + duration_ms: 621.888037 + type: 'test' + ... +# Subtest: REQ-LAUNCH-1 the tick starts a listed merge decision holder once, with land_work, the Landing line and its landing turn; an unlisted holder starts nothing +ok 7 - REQ-LAUNCH-1 the tick starts a listed merge decision holder once, with land_work, the Landing line and its landing turn; an unlisted holder starts nothing + --- + duration_ms: 417.133166 + type: 'test' + ... +# usage: {"event":"usage-unknown","business":"acme","run":"r8e91dd37dc4b","instance":"coder","turn":"a7b24e30-ac5e-47cf-a951-90cf0d948b4d","source":"@none","code":"baseline-unknown"} +# Subtest: a holder running since before the resolution is stopped once the broker releases it, land-relaunch, and the next tick starts it: landing turn first, then the message that waited +ok 8 - a holder running since before the resolution is stopped once the broker releases it, land-relaunch, and the next tick starts it: landing turn first, then the message that waited + --- + duration_ms: 730.904044 + type: 'test' + ... +# Subtest: a landing run that ended isn't started again for its decision, a spent decision starts nothing, and a new decision starts the holder +ok 9 - a landing run that ended isn't started again for its decision, a spent decision starts nothing, and a new decision starts the holder + --- + duration_ms: 698.470719 + type: 'test' + ... +# Subtest: after a restart, the new host's first tick starts a holder whose decision is still held +ok 10 - after a restart, the new host's first tick starts a holder whose decision is still held + --- + duration_ms: 920.432738 + type: 'test' + ... +# Subtest: a refused landing start is logged once per code with its decision, isn't a start, and the next tick with room starts the holder +ok 11 - a refused landing start is logged once per code with its decision, isn't a start, and the next tick with room starts the holder + --- + duration_ms: 641.309798 + type: 'test' + ... +# Subtest: a project clone that can't be made refuses checkout-failed, from --chief and from a session, with no run and no clone left +ok 12 - a project clone that can't be made refuses checkout-failed, from --chief and from a session, with no run and no clone left + --- + duration_ms: 267.647539 + type: 'test' + ... +# Subtest: a runner that stops at once ends its launch with the runner's reason +ok 13 - a runner that stops at once ends its launch with the runner's reason + --- + duration_ms: 332.423482 + type: 'test' + ... +# Subtest: a Claude Code launch with no session credential refuses before it starts +ok 14 - a Claude Code launch with no session credential refuses before it starts + --- + duration_ms: 181.931254 + type: 'test' + ... +# Subtest: a pi launch needs no session credential: pi logs in through its own ENV_ALLOW variables +ok 15 - a pi launch needs no session credential: pi logs in through its own ENV_ALLOW variables + --- + duration_ms: 315.27683 + type: 'test' + ... +# usage: {"event":"plugin-refused","kind":"harness","name":"down","code":"missing","message":"/mnt/storage/scratch/rocko-r219/packages/plugins/harness/down is missing","kept":[]} +# plugins: {"event":"plugin-refused","kind":"harness","name":"down","code":"missing","message":"/mnt/storage/scratch/rocko-r219/packages/plugins/harness/down is missing","kept":[]} +# Subtest: row 65 a failed primary preflight launches the fallback on a fixture harness module, recording the route and the reason +ok 16 - row 65 a failed primary preflight launches the fallback on a fixture harness module, recording the route and the reason + --- + duration_ms: 353.028786 + type: 'test' + ... +# Subtest: a runner killed from the host ends its launch as killed, not failed +ok 17 - a runner killed from the host ends its launch as killed, not failed + --- + duration_ms: 375.548364 + type: 'test' + ... +# Subtest: a missing or failing bwrap refuses sandbox-unavailable before anything starts; there is no unconfined fallback +ok 18 - a missing or failing bwrap refuses sandbox-unavailable before anything starts; there is no unconfined fallback + --- + duration_ms: 187.871873 + type: 'test' + ... +# Subtest: row 64 a role skill that isn't enabled refuses skill-not-enabled, and one that isn't a plain directory skill-refused, before anything starts +ok 19 - row 64 a role skill that isn't enabled refuses skill-not-enabled, and one that isn't a plain directory skill-refused, before anything starts + --- + duration_ms: 187.807189 + type: 'test' + ... +# Subtest: row 213 a creative instance's persona is read from /personas: off its digest the launch fails with the mismatch as its reason +not ok 20 - row 213 a creative instance's persona is read from /personas: off its digest the launch fails with the mismatch as its reason + --- + duration_ms: 255.698016 + type: 'test' + location: '/mnt/storage/scratch/rocko-r219/packages/cli/tests/launcher.test.mjs:766:1' + failureType: 'testCodeFailure' + error: |- + Expected values to be strictly deep-equal: + + actual - expected + + [ + + 'compactions', + + undefined, + + 2 + - 'refused', + - 'launch-failed', + - 1 + ] + + code: 'ERR_ASSERTION' + name: 'AssertionError' + expected: + 0: 'refused' + 1: 'launch-failed' + 2: 1 + actual: + 0: 'compactions' + 2: 2 + operator: 'deepStrictEqual' + stack: |- + TestContext. (file:///mnt/storage/scratch/rocko-r219/packages/cli/tests/launcher.test.mjs:789:10) + process.processTicksAndRejections (node:internal/process/task_queues:104:5) + async Test.run (node:internal/test_runner/test:1409:7) + async Test.processPendingSubtests (node:internal/test_runner/test:974:7) + ... +# Subtest: row 64 on Claude Code a role skill that isn't enabled refuses the same way, before anything starts +ok 21 - row 64 on Claude Code a role skill that isn't enabled refuses the same way, before anything starts + --- + duration_ms: 194.030218 + type: 'test' + ... +# usage: {"event":"usage-unknown","business":"acme","run":"r3715d40bd7fb","instance":"chief","turn":"4c85d22f-fdab-4ab7-ad8a-6b4c4d1fbf72","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r16ae936abadf","instance":"coder","turn":"2c6b06f1-8f36-4261-81b7-2689b9bb7ff4","source":"@none","code":"baseline-unknown"} +# Subtest: a real Claude Code coder's shell can't read a stand-in secret or anything else its sandbox doesn't hold +ok 22 - a real Claude Code coder's shell can't read a stand-in secret or anything else its sandbox doesn't hold + --- + duration_ms: 1456.773218 + type: 'test' + ... +# Subtest: a host that died hard leaves its sessions to the next host, which kills them and ends their runs so the role can be launched again +ok 23 - a host that died hard leaves its sessions to the next host, which kills them and ends their runs so the role can be launched again + --- + duration_ms: 1063.59923 + type: 'test' + ... +# Subtest: a host that died hard leaves its sessions to the next host, which finds one already exited (23) and ends their runs so the role can be launched again +ok 24 - a host that died hard leaves its sessions to the next host, which finds one already exited (23) and ends their runs so the role can be launched again + --- + duration_ms: 4016.888246 + type: 'test' + ... +# Subtest: bus start --no-launch leaves an earlier host's live session alone: no signal, no end, sessions.json as it was +ok 25 - bus start --no-launch leaves an earlier host's live session alone: no signal, no end, sessions.json as it was + --- + duration_ms: 237.364574 + type: 'test' + ... +# Subtest: bus start --no-launch refuses every launch: the PM launch and a session's request, each logged, nothing spawned +ok 26 - bus start --no-launch refuses every launch: the PM launch and a session's request, each logged, nothing spawned + --- + duration_ms: 197.775267 + type: 'test' + ... +# Subtest: bus start --no-launch starts no thread tick; the same host with launches runs it +ok 27 - bus start --no-launch starts no thread tick; the same host with launches runs it + --- + duration_ms: 1181.987654 + type: 'test' + ... +# Subtest: a malformed sessions.json refuses the host start with exit 3 and stays as it was +ok 28 - a malformed sessions.json refuses the host start with exit 3 and stays as it was + --- + duration_ms: 177.111363 + type: 'test' + ... +# Subtest: an over-long launch request is refused at once, not at the 10 s idle timeout +ok 29 - an over-long launch request is refused at once, not at the 10 s idle timeout + --- + duration_ms: 183.364128 + type: 'test' + ... +# Subtest: a launch client that never closes its side doesn't hold the host's close +ok 30 - a launch client that never closes its side doesn't hold the host's close + --- + duration_ms: 179.49662 + type: 'test' + ... +# Subtest: a runner that ignores SIGTERM is killed when the host closes +ok 31 - a runner that ignores SIGTERM is killed when the host closes + --- + duration_ms: 1352.083242 + type: 'test' + ... +# Subtest: kill switch refuses chief and hire before launch work and a clear permits a later request +ok 32 - kill switch refuses chief and hire before launch work and a clear permits a later request + --- + duration_ms: 319.505559 + type: 'test' + ... +# Subtest: kill switch stops an actual managed namespace and records the halt reason without rewriting its bundle +ok 33 - kill switch stops an actual managed namespace and records the halt reason without rewriting its bundle + --- + duration_ms: 334.076309 + type: 'test' + ... +# Subtest: a launch waiting across halt and resume cannot use its stale admission +ok 34 - a launch waiting across halt and resume cannot use its stale admission + --- + duration_ms: 201.932098 + type: 'test' + ... +1..34 +# tests 34 +# suites 0 +# pass 33 +# fail 1 +# cancelled 0 +# skipped 0 +# todo 0 +# duration_ms 26522.233904 diff --git a/packages/cli/tests/launcher.test.mjs b/packages/cli/tests/launcher.test.mjs index a9a7d2d40..baabd843e 100644 --- a/packages/cli/tests/launcher.test.mjs +++ b/packages/cli/tests/launcher.test.mjs @@ -783,16 +783,20 @@ test("row 213 a creative instance's persona is read from /personas: o ? Promise.resolve([{ thread, session: SESSION, instance: 'bean', holder: null, pending: 1 }]) : host.op(message), }) }); - // The bundle's refusal remains launch-failed with the persona mismatch as its reason. + // The thread path records row 270's run-start count before the bundle's persona refusal. await launcher.tick(); - const [e] = log(f); - assert.deepEqual([e.event, e.code, log(f).length], ["refused", "launch-failed", 1]); + const runs = readdirSync(join(f.dataRoot, "launches", "acme")); + const entries = log(f); + assert.equal(entries.length, 2); + const { at, ...compactions } = entries[0]; + assert.deepEqual(compactions, { event: 'compactions', instance: 'bean', thread, session: SESSION, run: runs[0], count: 0, known: true, reason: null }); + const e = entries[1]; + assert.deepEqual([e.event, e.code], ["refused", "launch-failed"]); assert.equal(e.thread, thread); assert.equal(e.why, `instance bean: persona file ${join(dir, "bean.md")} isn't the file persona.sha256 names`); assert.ok(!JSON.stringify(log(f)).includes("PERSONA-MARKER-d2")); assert.deepEqual(readSessions(f.dataRoot), []); // The run directory exists by then (BUILD.md residual); the persona is read before any bundle file. - const runs = readdirSync(join(f.dataRoot, "launches", "acme")); assert.equal(runs.length, 1); assert.deepEqual(readdirSync(join(f.dataRoot, "launches", "acme", runs[0])), []); assert.equal(existsSync(join(f.dataRoot, "threads", "acme", thread, "sessions", SESSION, "session")), true); From 28bf34f272ec8e0ad0f7155556d2c92cdb3dd5be Mon Sep 17 00:00:00 2001 From: Rocko Date: Fri, 23 Oct 2026 01:14:09 -0500 Subject: [PATCH 5/8] test: assert creative history in its native session store Apply only the paths and legacy absence pins approved by mos-1420 and sage-3243. Preserve exact expected history and the stopped run evidence. No product change or rerun. --- agents/rocko/work/queue-219/BUILD.md | 24 + .../queue-219/archive-before-mos1418.sha256 | 9 + agents/rocko/work/queue-219/build.patch | 10 +- .../work/queue-219/candidate-manifest.sha256 | 2 +- agents/rocko/work/queue-219/r2/BUILD.md | 6 + agents/rocko/work/queue-219/r2/base.txt | 1 + agents/rocko/work/queue-219/r2/build.patch | 788 ++++++++++++++++++ .../queue-219/r2/candidate-manifest.sha256 | 14 + .../rocko/work/queue-219/r2/changed-paths.txt | 14 + .../rocko/work/queue-219/r2/mos1420-test.diff | 17 + .../cwd-sweep-final.json | 1 + .../cwd-sweep.json | 1 + .../head.json | 1 + .../network-cleanup.log | 2 + .../results.jsonl | 4 + .../single-bus-creative.test.tap | 36 + .../single-bus-threads.test.tap | 124 +++ .../single-bus-user-principal.test.tap | 148 ++++ .../single-cli-launcher.test.tap | 259 ++++++ .../work/queue-219/run-4a9c-mos1408/head.json | 2 +- .../queue-219/run-4a9c-mos1408/results.jsonl | 9 +- .../single-bus-creative.test.tap | 10 +- .../single-bus-threads.test.tap | 40 +- .../single-bus-user-principal.test.tap | 48 +- .../single-cli-launcher.test.tap | 133 ++- .../single-cli-thread-launch.test.tap | 122 +++ packages/cli/tests/thread-launch.test.mjs | 6 +- 27 files changed, 1689 insertions(+), 142 deletions(-) create mode 100644 agents/rocko/work/queue-219/archive-before-mos1418.sha256 create mode 100644 agents/rocko/work/queue-219/r2/BUILD.md create mode 100644 agents/rocko/work/queue-219/r2/base.txt create mode 100644 agents/rocko/work/queue-219/r2/build.patch create mode 100644 agents/rocko/work/queue-219/r2/candidate-manifest.sha256 create mode 100644 agents/rocko/work/queue-219/r2/changed-paths.txt create mode 100644 agents/rocko/work/queue-219/r2/mos1420-test.diff create mode 100644 agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1418/cwd-sweep-final.json create mode 100644 agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1418/cwd-sweep.json create mode 100644 agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1418/head.json create mode 100644 agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1418/network-cleanup.log create mode 100644 agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1418/results.jsonl create mode 100644 agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1418/single-bus-creative.test.tap create mode 100644 agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1418/single-bus-threads.test.tap create mode 100644 agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1418/single-bus-user-principal.test.tap create mode 100644 agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1418/single-cli-launcher.test.tap create mode 100644 agents/rocko/work/queue-219/run-4a9c-mos1408/single-cli-thread-launch.test.tap diff --git a/agents/rocko/work/queue-219/BUILD.md b/agents/rocko/work/queue-219/BUILD.md index 73d043bc9..c352659a3 100644 --- a/agents/rocko/work/queue-219/BUILD.md +++ b/agents/rocko/work/queue-219/BUILD.md @@ -260,3 +260,27 @@ legacy store assertions stay unchanged. Only the specified comment changes. No product bytes change. If inference is wrong, report red, no third edit. Dewey must inspect this test diff before the next full restart. Local commit only while294 holds; push waits for Sage's named gap. No runs after this edit. + +## Third edit and new manifest round r2: mos-1420 / sage-3243 + +Full restart on7cbd839d0 began06:09:43.706Z and stopped06:10:30.695Z: +creative4/0/0, threads19/0/0, user-principal23/0/0, launcher34/0/0, +thread-launch13/1/0, total93 pass/1 fail/0 skip. Persona's exact two-row pin +passed. The new creative-history test failed ENOENT on its obsolete legacy +history path, after its real send/reply checks. Always-running Bean refusal +passed; sandbox-dependent Bean assertion followed the failed read and was +not reached. No coverage claim for that assertion. Slot returned after empty +cwd sweep and14 hashes checked. Original earlier red output was archived +byte-identically before this restart; all later stages unrun. + +Mos-1420 authorizes exactly the two history-path corrections in that new +test: obtain each default session from the real runtime threadsState and +read the literal threads/acme/T/sessions//session/history path. +Contents remain exactly Bean input\nBean again\n and Chet input\n. +Add one literal legacy-path nonexistence assertion per thread, no mkdir +helper. Every other file line stays unchanged. No product change. +The new r2/ manifest/patch snapshot is this third-edit round; root manifest +is refreshed to the same digest for the next claimant/review handoff. +Local commit only; Dewey checks mos1420 items1-3 before push/restart, and +Sage names a gap/CLEAR after294 round4. No runs after this edit. Any further +red, including later lines in this test, returns to Mos through Sage. diff --git a/agents/rocko/work/queue-219/archive-before-mos1418.sha256 b/agents/rocko/work/queue-219/archive-before-mos1418.sha256 new file mode 100644 index 000000000..c80c20651 --- /dev/null +++ b/agents/rocko/work/queue-219/archive-before-mos1418.sha256 @@ -0,0 +1,9 @@ +4f53cda18c2baa0c0354bb5f9a3ecbe5ed12ab4d8e11ba873c2f11161202b945 agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1418/cwd-sweep-final.json +4f53cda18c2baa0c0354bb5f9a3ecbe5ed12ab4d8e11ba873c2f11161202b945 agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1418/cwd-sweep.json +4c7009747c39843d6666ca54bb56d0f2bf991ab81bb514fa6d45053b8f6e4b92 agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1418/head.json +e86cfe9d1e28b8b42e9ed47c1a5836e4f9f09e700dc892935d55092785ece429 agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1418/network-cleanup.log +4fd1875a14b5da6e55effa090416b39529e5e00eb54660c2574727624d97ec4d agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1418/results.jsonl +4898d4ece63c8dcad3346c0a661087531b8b9c5471b6c49a023c4eede65726cb agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1418/single-bus-creative.test.tap +0d7e7b8a83c2d6441fe76403615839b26c0863b09e536ee77bcdafa62dd43948 agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1418/single-bus-threads.test.tap +1d4bc4439cfd51773a66efd88d22fe1d6bb826c7511a2b1b92e5040ebc293448 agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1418/single-bus-user-principal.test.tap +ededb8288ffdb04001aa39bc77d29f7f7ea9ff6cf57f814ea2bd743b4f9fbc8d agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1418/single-cli-launcher.test.tap diff --git a/agents/rocko/work/queue-219/build.patch b/agents/rocko/work/queue-219/build.patch index 5cfa4fa2d..b34097ed7 100644 --- a/agents/rocko/work/queue-219/build.patch +++ b/agents/rocko/work/queue-219/build.patch @@ -314,7 +314,7 @@ index 2202c7753..baabd843e 100644 test("row 64 on Claude Code a role skill that isn't enabled refuses the same way, before anything starts", { timeout: 30000 }, async (t) => { diff --git a/packages/cli/tests/thread-launch.test.mjs b/packages/cli/tests/thread-launch.test.mjs -index 0d207a0a0..84f8ed088 100644 +index 0d207a0a0..fa3adb866 100644 --- a/packages/cli/tests/thread-launch.test.mjs +++ b/packages/cli/tests/thread-launch.test.mjs @@ -396,6 +396,22 @@ test("REQ-THREAD-1 REQ-LAUNCH-1 the chief can't launch the assistant outside a t @@ -340,7 +340,7 @@ index 0d207a0a0..84f8ed088 100644 // Row 125 (#1619, REQ-LIMIT-3, REQ-LIMIT-4): the token-limit check switched on, with the // assistant's limit at 0, so it is at its limit before any turn. The real check runs through the // bus's plug-in loader. -@@ -443,3 +459,71 @@ test("REQ-LIMIT-4 a thread run at its token limit stops at the end of its turn: +@@ -443,3 +459,73 @@ test("REQ-LIMIT-4 a thread run at its token limit stops at the end of its turn: assert.deepEqual(threadRuns(f, A), []); assert.equal(host.runtime.threadsState("acme").find((x) => x.thread === A).holder, null); }); @@ -371,8 +371,10 @@ index 0d207a0a0..84f8ed088 100644 + assert.deepEqual((await send(bean, 'bean', 'Bean input')).before, []); + assert.deepEqual((await send(chet, 'chet', 'Chet input')).before, []); + assert.deepEqual((await send(bean, 'bean', 'Bean again')).before, ['Bean input']); -+ assert.equal(readFileSync(join(f.dataRoot, 'threads', 'acme', bean, 'session', 'history'), 'utf8'), 'Bean input\nBean again\n'); -+ assert.equal(readFileSync(join(f.dataRoot, 'threads', 'acme', chet, 'session', 'history'), 'utf8'), 'Chet input\n'); ++ assert.equal(readFileSync(join(f.dataRoot, 'threads', 'acme', bean, 'sessions', host.runtime.threadsState('acme').find(x => x.thread === bean).session, 'session', 'history'), 'utf8'), 'Bean input\nBean again\n'); ++ assert.equal(readFileSync(join(f.dataRoot, 'threads', 'acme', chet, 'sessions', host.runtime.threadsState('acme').find(x => x.thread === chet).session, 'session', 'history'), 'utf8'), 'Chet input\n'); ++ assert.equal(existsSync(join(f.dataRoot, 'threads', 'acme', bean, 'session')), false); ++ assert.equal(existsSync(join(f.dataRoot, 'threads', 'acme', chet, 'session')), false); + const launches = launchLog(f).filter(row => row.event === 'launch'); + assert.ok(launches.some(row => row.instance === 'bean' && row.thread === bean)); + assert.ok(launches.some(row => row.instance === 'chet' && row.thread === chet)); diff --git a/agents/rocko/work/queue-219/candidate-manifest.sha256 b/agents/rocko/work/queue-219/candidate-manifest.sha256 index b2ef5c5a0..841f95bd5 100644 --- a/agents/rocko/work/queue-219/candidate-manifest.sha256 +++ b/agents/rocko/work/queue-219/candidate-manifest.sha256 @@ -4,7 +4,7 @@ de4913f50801a11fd172e3f2c2b3cb41ab04e84d32a6650d1c8662b5e227ea3d packages/bus/t 8f7d6745fffb2a0898ac80c012084ac48964748da6439a8c56facc6529ffb19b packages/bus/tests/user-principal.test.mjs b74275ce43249bafc97edc87a6a3aa0431c62fe1a28cd9fa265246e6d6da219b packages/cli/src/launcher.mjs 2c3f120dfdc0b52bf8ab38a88e86251be75d4b0d218e23df489dcaf815d6bc15 packages/cli/tests/launcher.test.mjs -a219036737419870e0aa9d0da20843759a66be5bafff44d3292593833f8fcb9a packages/cli/tests/thread-launch.test.mjs +7f308fdf601e839194f026beb3fea279eba1e356ce2756aa4a42fa4873b79b30 packages/cli/tests/thread-launch.test.mjs cbfd54e6b375561d1e4679ee8d78a3285f970d9a7198cec9d22a06510a36afba packages/webui/src/chat-http.mjs f49a49c6ec69783190d3f5eaf34316cb4d2c44d10d2ee9336fe1383207afefff packages/webui/src/chat.mjs 8e89df5fe8a9da35de41b5968afc6efcd92503e92ef28c6f557bb5371d10d1a4 packages/webui/src/public/chat.js diff --git a/agents/rocko/work/queue-219/r2/BUILD.md b/agents/rocko/work/queue-219/r2/BUILD.md new file mode 100644 index 000000000..7454edd03 --- /dev/null +++ b/agents/rocko/work/queue-219/r2/BUILD.md @@ -0,0 +1,6 @@ +# Row219 r2 / mos1420 third edit + +See ../BUILD.md for the full unchanged scope and preserved red chronology. +This round changes only the new thread-launch native-history paths and adds +the two legacy-path absence assertions approved by mos1420. No run yet. +Dewey pre-restart diff check and Sage push/run CLEAR are required. diff --git a/agents/rocko/work/queue-219/r2/base.txt b/agents/rocko/work/queue-219/r2/base.txt new file mode 100644 index 000000000..1d519a39a --- /dev/null +++ b/agents/rocko/work/queue-219/r2/base.txt @@ -0,0 +1 @@ +4a9c536e861f1d9f9a018019b3ac4519d65eccf0 diff --git a/agents/rocko/work/queue-219/r2/build.patch b/agents/rocko/work/queue-219/r2/build.patch new file mode 100644 index 000000000..b34097ed7 --- /dev/null +++ b/agents/rocko/work/queue-219/r2/build.patch @@ -0,0 +1,788 @@ +diff --git a/packages/bus/src/broker.mjs b/packages/bus/src/broker.mjs +index d76085739..11061c778 100644 +--- a/packages/bus/src/broker.mjs ++++ b/packages/bus/src/broker.mjs +@@ -4,7 +4,7 @@ import { initializeControl, processingStatus } from '../../processing-control/sr + import { NAME as HARNESS_NAME } from '../../plugins/src/kinds.mjs'; + import { loadRequirements } from '../../tasks/src/requirements.mjs'; + import { MERGE, LandingRefusal, readLanding } from './landing.mjs'; +-import { ID_PATTERN, THREAD_DEFINITION, END_PROTECTED, forkProblem, forkUrl, credentialKind, validArgv, commandAllowed, HOST_ID, CREATIVE_DEFINITIONS, unhireableAction, giteaName, parseGiteaUrl, covers } from '../../business/src/vocabulary.mjs'; ++import { ID_PATTERN, THREAD_DEFINITIONS, END_PROTECTED, forkProblem, forkUrl, credentialKind, validArgv, commandAllowed, HOST_ID, CREATIVE_DEFINITIONS, unhireableAction, giteaName, parseGiteaUrl, covers } from '../../business/src/vocabulary.mjs'; + + // Kept closed while S1 lands; its vocabulary is the integration authority. + export const ACTIONS = Object.freeze([ +@@ -314,7 +314,7 @@ const enrollBinding = (enroll) => ({ + }); + // r6 E3: the installer line's comment, then the tag's 32 hex digits. + const INSTALLER_COMMENT = 'mosaic-installer-'; +-// Row 121 (#1615): an instance of THREAD_DEFINITION (vocabulary.mjs since row 155) talks with the ++// Row 121 (#1615): an instance of THREAD_DEFINITIONS (vocabulary.mjs since row 213) talks with the + // user in threads. Its runs claim a thread, not the role, and every message to or from it names its + // thread (REQ-MSG-1). + // Row 146 (#1640): the sender of the bus's notice to launch.by. A role instance name matches the +@@ -598,7 +598,7 @@ export class Broker { + ); + } + #threaded(business, role) { +- return this.#business(business).roles[role]?.definition === THREAD_DEFINITION; ++ return THREAD_DEFINITIONS.includes(this.#business(business).roles[role]?.definition); + } + // Row 264a (#1769): a claim holds one session of a thread, and each session has its own holder. + #sessionHolder(session) { +@@ -6068,24 +6068,27 @@ export class Broker { + .all('SELECT id,at,name,repo FROM projects WHERE business=? ORDER BY seq', s.business) + .filter((p) => !s.user || this.#granted(s, 'project.list', p.id, null)); + } +- // A thread belongs to the user who made it and to the business's one thread instance. ++ // A thread belongs to the user who made it and to one declared thread instance. + // Row 177 (#1675): a tester's thread is owned by `tester`, so neither reaches the other's. + case 'thread.create': { + if (!s.tester && !s.user) this.#human(s); +- keys(a, ['project', 'name'], ['project', 'name']); ++ keys(a, ['project', 'name', 'instance'], ['project', 'name']); + if (!name(a.name)) fail('invalid-request'); ++ const instances = Object.keys(b.roles).filter((r) => this.#threaded(s.business, r)); ++ const instance = a.instance === undefined ++ ? (instances.length === 1 ? instances[0] : null) ++ : identifier(a.instance); + // FED R3 (design 3.5): a user's grant must cover the project and the thread instance, checked + // before the project is looked up, so an ungranted id reads the same whether it exists or not. + if (s.user) { +- const threaded = Object.keys(b.roles).filter((r) => this.#threaded(s.business, r)); +- if (threaded.length !== 1 || !this.#granted(s, 'thread.create', identifier(a.project), threaded[0])) fail('access-refused'); ++ if (!instance || !instances.includes(instance) || !this.#granted(s, 'thread.create', identifier(a.project), instance)) ++ fail('access-refused'); + } + if (!this.#store.get('SELECT 1 FROM projects WHERE id=? AND business=?', identifier(a.project), s.business)) + fail('project-not-found'); +- // The bus never picks between instances; the business file declares exactly one. +- const instances = Object.keys(b.roles).filter((r) => this.#threaded(s.business, r)); +- if (!instances.length) fail('thread-instance-missing'); +- if (instances.length > 1) fail('thread-instance-ambiguous'); ++ // The human selects an instance; omission is compatible only with one candidate. ++ if (!instances.length || (a.instance !== undefined && !instances.includes(instance))) fail('thread-instance-missing'); ++ if (a.instance === undefined && instances.length > 1) fail('thread-instance-ambiguous'); + if (this.#store.get('SELECT 1 FROM threads WHERE project=? AND name=?', a.project, a.name)) fail('thread-exists'); + const tid = randomUUID(); + this.#store.run( +@@ -6094,13 +6097,13 @@ export class Broker { + this.#now(), + s.business, + a.project, +- instances[0], ++ instance, + this.#owner(s), + a.name, + ); + // Row 264a (#1769, D3): every thread has a default session from the start. +- this.#newSession(s, { id: tid, business: s.business, instance: instances[0], owner: this.#owner(s) }, 'default', 'default', true); +- return { id: tid, instance: instances[0] }; ++ this.#newSession(s, { id: tid, business: s.business, instance, owner: this.#owner(s) }, 'default', 'default', true); ++ return { id: tid, instance }; + } + // Row 177 (#1675): each lists its own threads. The human's list leaves out the tester's, + // and the tester's lists only its own (row 175 listed it the business human's). +diff --git a/packages/bus/tests/creative.test.mjs b/packages/bus/tests/creative.test.mjs +index 6cfbf1cd6..6d421ba19 100644 +--- a/packages/bus/tests/creative.test.mjs ++++ b/packages/bus/tests/creative.test.mjs +@@ -44,15 +44,18 @@ function setup(t) { + const caps = {}; + caps.human = b.bindHuman({ business: 'demo', human: 'jason', via: 'cli', outsideAgent: true }); + const project = b.request(caps.human, { verb: 'project.create', args: { name: 'demo' } }).id; +- const thread = b.request(caps.human, { verb: 'thread.create', args: { project, name: 'main' } }).id; ++ const thread = b.request(caps.human, { verb: 'thread.create', args: { project, name: 'main', instance: 'assistant' } }).id; ++ const threads = { assistant: thread }; + for (const role of Object.keys(roles)) { +- caps[role] = b.bindLaunch({ business: 'demo', role, run: `${role}-run`, harness: 'pi', ...(role === 'assistant' ? { thread } : {}) }); ++ if (['bean', 'quill'].includes(role)) ++ threads[role] = b.request(caps.human, { verb: 'thread.create', args: { project, name: role, instance: role } }).id; ++ caps[role] = b.bindLaunch({ business: 'demo', role, run: `${role}-run`, harness: 'pi', ...(threads[role] ? { thread: threads[role] } : {}) }); + b.request(caps[role], { verb: 'role.claim' }); + } + caps.tester = b.bindTester({ business: 'demo' }); + const call = (who, verb, args = {}) => b.request(caps[who], { verb, args }); + const count = (sql) => store.get(sql).n; +- return { call, count, store }; ++ return { call, count, store, threads }; + } + + const raise = { action: 'policy.change', question: 'Change?', options: [{ key: 'yes', text: 'Yes' }, { key: 'no', text: 'No' }], recommendation: 'yes', blocking: false }; +@@ -72,7 +75,7 @@ test('M6: a creative raise refuses decision-not-allowed, cited or not, and no de + }); + + test('a creative instance sends only to the user and hears only from the user', (t) => { +- const { call, count } = setup(t); ++ const { call, count, threads } = setup(t); + for (const who of ['bean', 'quill']) { + call(who, 'message.send', { to: 'human', body: 'hello' }); + for (const to of ['chief', 'assistant', 'pm', 'bean', 'quill'].filter((n) => n !== who)) { +@@ -81,7 +84,7 @@ test('a creative instance sends only to the user and hears only from the user', + for (const from of ['chief', 'pm']) { + assert.throws(() => call(from, 'message.send', { to: who, body: 'hello' }), { code: 'message-sender-refused' }, `${from} to ${who}`); + } +- call('human', 'message.send', { to: who, body: 'hello' }); ++ call('human', 'thread.send', { thread: threads[who], body: 'hello' }); + } + assert.equal(count("SELECT count(*) n FROM messages WHERE from_role IN ('bean','quill')"), 2); + assert.equal(count("SELECT count(*) n FROM messages WHERE to_role IN ('bean','quill')"), 2); +diff --git a/packages/bus/tests/threads.test.mjs b/packages/bus/tests/threads.test.mjs +index 8b31da9f9..1410ec3fa 100644 +--- a/packages/bus/tests/threads.test.mjs ++++ b/packages/bus/tests/threads.test.mjs +@@ -601,3 +601,42 @@ test('project.create keeps unrelated names with and without a repository', t => + { id: linked.id, name: 'work', repo: 'stack' }, + ]); + }); ++ ++test('C2-09a: explicit creative instances bind independent threads, default sessions and holders', t => { ++ const creative = ['companion', 'ideas', 'research', 'proofreader', 'fact-checker', 'continuity']; ++ const extra = Object.fromEntries(creative.map((definition, i) => [`writer${i}`, { definition, authority: { withinRole: ['message.send'], crossRole: [] } }])); ++ const ctx = setup(t, demo({ roles: { ...roles, ...extra }, definitions: { ++ ...definitions, ...Object.fromEntries(creative.map(definition => [definition, { messaging: shipped(definition).messaging }])), ++ } })); ++ const project = ctx.call('human', 'project.create', { name: 'Writing' }).id; ++ assert.throws(() => ctx.call('human', 'thread.create', { project, name: 'ambiguous' }), { code: 'thread-instance-ambiguous' }); ++ for (const [instance, role] of Object.entries(extra)) { ++ const receipt = ctx.call('human', 'thread.create', { project, name: instance, instance }); ++ assert.equal(receipt.instance, instance); ++ assert.equal(ctx.store.get('SELECT instance FROM threads WHERE id=?', receipt.id).instance, instance); ++ assert.equal(ctx.store.get('SELECT instance FROM sessions WHERE thread=?', receipt.id).instance, instance); ++ ctx.launch(instance, instance, { thread: receipt.id }); ++ assert.equal(ctx.claim(instance).thread, receipt.id); ++ const sent = ctx.call('human', 'thread.send', { thread: receipt.id, body: `For ${instance}` }); ++ const read = ctx.call(instance, 'message.receive'); ++ assert.deepEqual(read.map(m => m.id), [sent.id], role.definition); ++ assert.equal(ctx.threadOf(sent.id), receipt.id); ++ assert.equal(ctx.store.get('SELECT count(*) n FROM role_claims WHERE role=?', instance).n, 0); ++ assert.throws(() => ctx.call('human', 'message.send', { to: instance, body: 'No implicit thread' }), ++ { code: 'thread-required-use-thread-send' }); ++ } ++ assert.equal(ctx.count('SELECT count(*) n FROM threads'), creative.length); ++}); ++ ++test('C2-09a: explicit missing, non-thread and malformed selectors create no thread or session', t => { ++ const ctx = setup(t); ++ const project = ctx.call('human', 'project.create', { name: 'Writing' }).id; ++ for (const instance of ['not-declared', 'pm', 'coder']) ++ assert.throws(() => ctx.call('human', 'thread.create', { project, name: instance, instance }), { code: 'thread-instance-missing' }); ++ for (const instance of [null, 7, {}, [], '', 'bad name']) ++ assert.throws(() => ctx.call('human', 'thread.create', { project, name: 'bad', instance }), { code: 'invalid-request' }); ++ assert.equal(ctx.count('SELECT count(*) n FROM threads'), 0); ++ assert.equal(ctx.count('SELECT count(*) n FROM sessions'), 0); ++ const legacy = ctx.call('human', 'thread.create', { project, name: 'Default' }); ++ assert.equal(legacy.instance, 'assistant'); ++}); +diff --git a/packages/bus/tests/user-principal.test.mjs b/packages/bus/tests/user-principal.test.mjs +index 4dcd1ebeb..8471ddf85 100644 +--- a/packages/bus/tests/user-principal.test.mjs ++++ b/packages/bus/tests/user-principal.test.mjs +@@ -23,7 +23,7 @@ const grant = (over = {}) => ({ + }); + + // `processing` stands in for the halt switch, as lifecycle-verbs.test.mjs's T15 does. +-function setup(t, { grants = [grant()], processing = null } = {}) { ++function setup(t, { grants = [grant()], processing = null, threadRoles = {} } = {}) { + const root = mkdtempSync(join(tmpdir(), 'bus-user-principal-')); + const store = new Store(root); + t.after(() => { +@@ -40,6 +40,7 @@ function setup(t, { grants = [grant()], processing = null } = {}) { + roles: { + chief: { definition: 'chief-of-staff', authority: { withinRole: ['message.send'], crossRole: [] } }, + assistant: { definition: 'assistant', authority: { withinRole: ['message.send'], crossRole: [] } }, ++ ...threadRoles, + }, + definitions: { 'chief-of-staff': {}, assistant: { messaging: shipped('assistant').messaging } }, + }, +@@ -394,3 +395,21 @@ test('R3 r4: the chief\'s hire refuses an instance named user with the code it g + test('R3 r4: a non-function access throws before the store is read', () => { + assert.throws(() => new Broker({ store: null, businesses: { demo: {} }, access: 'access.json' }), /access must be a function/); + }); ++ ++test('C2-09a: naming an instance cannot bypass its collaborator grant or disclose an ungranted project', t => { ++ const ctx = setup(t, { threadRoles: { bean: { definition: 'companion', authority: { withinRole: ['message.send'], crossRole: [] } } } }); ++ const project = ctx.call('human', 'project.create', { name: 'shared' }).id; ++ const privateProject = ctx.call('human', 'project.create', { name: 'private' }).id; ++ ctx.access.doc.grants = [grant({ projects: [project] })]; ++ ctx.user('alice'); ++ assert.equal(ctx.code('alice', 'thread.create', { project, name: 'blocked bean', instance: 'bean' }), 'access-refused'); ++ for (const id of [privateProject, '00000000-0000-4000-8000-000000000000']) ++ assert.equal(ctx.code('alice', 'thread.create', { project: id, name: 'blocked project', instance: 'assistant' }), 'access-refused'); ++ assert.equal(ctx.store.get('SELECT count(*) n FROM threads').n, 0); ++ const allowed = ctx.call('alice', 'thread.create', { project, name: 'assistant work', instance: 'assistant' }); ++ assert.equal(allowed.instance, 'assistant'); ++ ctx.access.doc.grants = [grant({ projects: [project], instances: ['bean'] })]; ++ const bean = ctx.call('alice', 'thread.create', { project, name: 'bean work', instance: 'bean' }); ++ assert.equal(bean.instance, 'bean'); ++ assert.equal(ctx.code('alice', 'thread.create', { project, name: 'old instance', instance: 'assistant' }), 'access-refused'); ++}); +diff --git a/packages/cli/src/launcher.mjs b/packages/cli/src/launcher.mjs +index bfe55b61e..d8248284c 100644 +--- a/packages/cli/src/launcher.mjs ++++ b/packages/cli/src/launcher.mjs +@@ -53,7 +53,7 @@ + // session.json names it as gitSocket. + // + // Thread sessions (row 121, #1615). A thread instance (an instance whose +-// role definition is the assistant) runs once per thread, never on its own: ++// role definition is in THREAD_DEFINITIONS) runs once per thread, never on its own: + // a launch from a session or --pm refuses thread-required. Every tick + // (threadTickMs) the host asks the broker for the business's threads + // (launch op threadsState) and: +@@ -139,6 +139,7 @@ import { createServer } from "node:net"; + import { chmodSync, existsSync, lstatSync, mkdirSync, readFileSync, renameSync, rmSync } from "node:fs"; + import { dirname, join, relative } from "node:path"; + import { configDir, loadBusiness, resolveInstance, systemVars } from "../../business/src/index.mjs"; ++import { THREAD_DEFINITIONS } from "../../business/src/vocabulary.mjs"; + import { limitHit } from "../../business/src/launch.mjs"; + import { BundleError, buildBundle, hasFallback, readSkills, sessionModel } from "../../harness/src/bundle.mjs"; + import { createLoader } from "../../plugins/src/loader.mjs"; +@@ -176,8 +177,6 @@ const STOP_TIMEOUT_MS = 30000; + const LINE_MAX = 4096; + // How often the host asks for the threads' state; a poll period, not a limit. + const THREAD_TICK_MS = 2000; +-// The broker's thread instance definition (packages/bus/src/broker.mjs). +-const THREAD_DEFINITION = "assistant"; + // Row 194: the broker's LIFECYCLE_REQUEST_MS. A regenerate's old run must be gone by then. + const LIFECYCLE_REQUEST_MS = 60000; + +@@ -331,7 +330,7 @@ export function createLauncher({ + try { b=loadBusiness(host.business,{dir:configDir(env),rolesDir:rolesDir(env)}); } catch(e){throw new Refusal("organization-refused",e.message);} + if (!b.launch) throw new Refusal("launch-not-configured", `business ${b.id} has no launch block`); + if (!(pm ? instance === b.launch.by : b.launch.instances.includes(instance) || (human && Object.hasOwn(b.roles, instance)))) throw new Refusal("instance-not-listed"); +- const threaded = b.roles[instance]?.definition === THREAD_DEFINITION; ++ const threaded = THREAD_DEFINITIONS.includes(b.roles[instance]?.definition); + if (threaded && !thread) throw new Refusal("thread-required", `${instance} runs only for a thread`); + if (!threaded && thread) throw new Refusal("thread-not-allowed", `${instance} isn't a thread instance`); + if (threaded && !session) throw new Refusal("session-required", `${instance} runs for one session of a thread`); +@@ -997,7 +996,7 @@ export function createLauncher({ + function ending(r) { + const runs = r.runs ?? []; + const at = Date.parse(r.at); +- const threaded = b.roles[r.instance]?.definition === THREAD_DEFINITION; ++ const threaded = THREAD_DEFINITIONS.includes(b.roles[r.instance]?.definition); + return registry.sessions.filter((s) => s.business === b.id && (runs.includes(s.run) || + (!threaded && s.instance === r.instance && (spawnedAt.get(s.run) ?? Date.parse(s.startedAt)) <= at))); + } +diff --git a/packages/cli/tests/launcher.test.mjs b/packages/cli/tests/launcher.test.mjs +index 2202c7753..baabd843e 100644 +--- a/packages/cli/tests/launcher.test.mjs ++++ b/packages/cli/tests/launcher.test.mjs +@@ -773,21 +773,34 @@ test("row 213 a creative instance's persona is read from /personas: o + const dir = join(given.root, "config", "personas", "acme"); + mkdirSync(dir, { recursive: true, mode: 0o700 }); + writeFileSync(join(dir, "bean.md"), "Not the pinned text.\n", { mode: 0o600 }); +- const { f, host, launcher } = await setup(t, undefined, given); +- // The chief of staff holds role.launch; a test chief session bound to this process asks. +- const chief = await host.bindLaunch({ business: "acme", role: "chief", run: "chief-test", harness: "pi", pid: process.pid, startTime: startTimeOf(process.pid) }); +- await new Client({ path: host.path, cap: chief.cap }).call("role.claim"); +- // The bundle's refusal comes back as launch-failed, as webPlan's does, with its reason in the log. +- assert.deepEqual(await launcher.fromSession(chief.cap, "bean"), { ok: false, error: "launch-failed" }); +- const [e] = log(f); +- assert.deepEqual([e.event, e.code, log(f).length], ["refused", "launch-failed", 1]); ++ // Row 219: creative instances launch from their thread, not from a chief's standalone request. ++ // The mismatch occurs before bindLaunch, so only the host's thread-state snapshot is a fixture. ++ const thread = 'persona-thread'; ++ const SESSION = 'persona-session'; ++ const { f, launcher } = await setup(t, undefined, given, { wrap: host => ({ ++ ...host, ++ op: message => message.op === 'threadsState' ++ ? Promise.resolve([{ thread, session: SESSION, instance: 'bean', holder: null, pending: 1 }]) ++ : host.op(message), ++ }) }); ++ // The thread path records row 270's run-start count before the bundle's persona refusal. ++ await launcher.tick(); ++ const runs = readdirSync(join(f.dataRoot, "launches", "acme")); ++ const entries = log(f); ++ assert.equal(entries.length, 2); ++ const { at, ...compactions } = entries[0]; ++ assert.deepEqual(compactions, { event: 'compactions', instance: 'bean', thread, session: SESSION, run: runs[0], count: 0, known: true, reason: null }); ++ const e = entries[1]; ++ assert.deepEqual([e.event, e.code], ["refused", "launch-failed"]); ++ assert.equal(e.thread, thread); + assert.equal(e.why, `instance bean: persona file ${join(dir, "bean.md")} isn't the file persona.sha256 names`); + assert.ok(!JSON.stringify(log(f)).includes("PERSONA-MARKER-d2")); + assert.deepEqual(readSessions(f.dataRoot), []); + // The run directory exists by then (BUILD.md residual); the persona is read before any bundle file. +- const runs = readdirSync(join(f.dataRoot, "launches", "acme")); + assert.equal(runs.length, 1); +- assert.deepEqual(readdirSync(join(f.dataRoot, "launches", "acme", runs[0])), ["session"]); ++ assert.deepEqual(readdirSync(join(f.dataRoot, "launches", "acme", runs[0])), []); ++ assert.equal(existsSync(join(f.dataRoot, "threads", "acme", thread, "sessions", SESSION, "session")), true); ++ assert.equal(existsSync(join(f.dataRoot, "threads", "acme", thread, "session")), false); + }); + + test("row 64 on Claude Code a role skill that isn't enabled refuses the same way, before anything starts", { timeout: 30000 }, async (t) => { +diff --git a/packages/cli/tests/thread-launch.test.mjs b/packages/cli/tests/thread-launch.test.mjs +index 0d207a0a0..fa3adb866 100644 +--- a/packages/cli/tests/thread-launch.test.mjs ++++ b/packages/cli/tests/thread-launch.test.mjs +@@ -396,6 +396,22 @@ test("REQ-THREAD-1 REQ-LAUNCH-1 the chief can't launch the assistant outside a t + assert.deepEqual(launchLog(f).map((e) => [e.event, e.instance, e.code]), [["refused", "assistant", "thread-required"]]); + }); + ++// Admission refuses before bundle construction or a sandbox is needed. ++test('C2-09a: fromSession refuses a creative instance outside a thread without a sandbox', { timeout: 30000 }, async t => { ++ const prepared = prepare(t, { edit: doc => { ++ doc.roles.bean = { ...doc.roles.assistant, definition: 'companion' }; ++ doc.launch.instances.push('bean'); ++ return doc; ++ } }); ++ const { f } = prepared; ++ const host = await start(t, prepared); ++ const chief = await host.host.bindLaunch({ business: 'acme', role: 'chief', run: 'chief-bean-refusal', harness: 'pi', pid: process.pid, startTime: startTimeOf(process.pid) }); ++ await new Client({ path: host.host.path, cap: chief.cap }).call('role.claim'); ++ assert.deepEqual(await host.launcher.fromSession(chief.cap, 'bean'), { ok: false, error: 'thread-required' }); ++ assert.deepEqual(readSessions(f.dataRoot), []); ++ assert.deepEqual(launchLog(f).map(e => [e.event, e.instance, e.code]), [['refused', 'bean', 'thread-required']]); ++}); ++ + // Row 125 (#1619, REQ-LIMIT-3, REQ-LIMIT-4): the token-limit check switched on, with the + // assistant's limit at 0, so it is at its limit before any turn. The real check runs through the + // bus's plug-in loader. +@@ -443,3 +459,73 @@ test("REQ-LIMIT-4 a thread run at its token limit stops at the end of its turn: + assert.deepEqual(threadRuns(f, A), []); + assert.equal(host.runtime.threadsState("acme").find((x) => x.thread === A).holder, null); + }); ++ ++test('C2-09a: creative thread messages start distinct runs and keep each instance history separate', { skip, timeout: 90000 }, async t => { ++ const prepared = prepare(t, { sonnet: 2, idle: 60, edit: doc => { ++ const vars = { ...doc.roles.assistant.vars }; ++ delete doc.roles.assistant; ++ doc.roles.bean = { definition: 'companion', vars: { ...vars } }; ++ doc.roles.chet = { definition: 'continuity', vars: { ...vars } }; ++ doc.launch.instances = ['coder', 'bean', 'chet']; ++ return doc; ++ } }); ++ const host = await start(t, prepared), { f } = prepared; ++ const project = host.call('project.create', { name: 'Writing' }).id; ++ const bean = host.call('thread.create', { project, name: 'Bean', instance: 'bean' }).id; ++ const chet = host.call('thread.create', { project, name: 'Chet', instance: 'chet' }).id; ++ const send = async (thread, instance, body) => { ++ const message = host.call('thread.send', { thread, body }); ++ const outcome = await until(() => host.call('thread.messages', { thread }).find(m => m.in_reply_to === message.id) || ++ launchLog(f).find(row => row.thread === thread && row.event === 'refused')); ++ assert.notEqual(outcome.event, 'refused', `creative thread launch refused: ${outcome.code}`); ++ const reply = outcome; ++ assert.equal(reply.from_role, instance); ++ assert.equal(reply.to_role, 'human'); ++ return JSON.parse(reply.body.match(/THREAD (\{.*\})/)[1]); ++ }; ++ assert.deepEqual((await send(bean, 'bean', 'Bean input')).before, []); ++ assert.deepEqual((await send(chet, 'chet', 'Chet input')).before, []); ++ assert.deepEqual((await send(bean, 'bean', 'Bean again')).before, ['Bean input']); ++ assert.equal(readFileSync(join(f.dataRoot, 'threads', 'acme', bean, 'sessions', host.runtime.threadsState('acme').find(x => x.thread === bean).session, 'session', 'history'), 'utf8'), 'Bean input\nBean again\n'); ++ assert.equal(readFileSync(join(f.dataRoot, 'threads', 'acme', chet, 'sessions', host.runtime.threadsState('acme').find(x => x.thread === chet).session, 'session', 'history'), 'utf8'), 'Chet input\n'); ++ assert.equal(existsSync(join(f.dataRoot, 'threads', 'acme', bean, 'session')), false); ++ assert.equal(existsSync(join(f.dataRoot, 'threads', 'acme', chet, 'session')), false); ++ const launches = launchLog(f).filter(row => row.event === 'launch'); ++ assert.ok(launches.some(row => row.instance === 'bean' && row.thread === bean)); ++ assert.ok(launches.some(row => row.instance === 'chet' && row.thread === chet)); ++ const chief = await host.host.bindLaunch({ business: 'acme', role: 'chief', run: 'chief-creative-test', harness: 'pi', pid: process.pid, startTime: startTimeOf(process.pid) }); ++ await new Client({ path: host.host.path, cap: chief.cap }).call('role.claim'); ++ assert.deepEqual(await host.launcher.fromSession(chief.cap, 'bean'), { ok: false, error: 'thread-required' }); ++}); ++ ++test('C2-09a: terminating one creative thread does not signal an unselected peer of the same instance', { skip, timeout: 90000 }, async t => { ++ const prepared = prepare(t, { sonnet: 2, idle: 60, edit: doc => { ++ doc.roles.bean = { ...doc.roles.assistant, definition: 'companion' }; ++ delete doc.roles.assistant; ++ doc.launch.instances = ['coder', 'bean']; ++ return doc; ++ } }); ++ let requests = []; ++ const host = await start(t, prepared, { ops: () => ({ ++ lifecycleRequests: () => requests, ++ lifecycleTake: () => ({ ...requests[0], go: true }), ++ lifecycleDone: () => { requests = []; return {}; }, ++ }) }); ++ const { f } = prepared; ++ const project = host.call('project.create', { name: 'Writing' }).id; ++ const threads = ['one', 'two'].map(name => host.call('thread.create', { project, name, instance: 'bean' }).id); ++ for (const thread of threads) { ++ const message = host.call('thread.send', { thread, body: 'Stay in this thread' }); ++ const outcome = await until(() => host.call('thread.messages', { thread }).find(row => row.in_reply_to === message.id) || ++ launchLog(f).find(row => row.thread === thread && row.event === 'refused')); ++ assert.notEqual(outcome.event, 'refused', `creative thread launch refused: ${outcome.code}`); ++ } ++ const runs = threads.map(thread => launchLog(f).find(row => row.thread === thread && row.event === 'launch').run); ++ requests = [{ request: 'one-thread-end', state: 'open', business: 'acme', action: 'lifecycle.end', ++ instance: 'bean', runs: [runs[0]], by: f.doc.human, at: new Date(Date.now() + 1000).toISOString() }]; ++ await host.launcher.tick(); ++ await until(() => launchLog(f).some(row => row.event === 'lifecycle-end' && row.run === runs[0])); ++ assert.deepEqual(launchLog(f).filter(row => row.event === 'lifecycle-end').map(row => row.run), [runs[0]]); ++ await until(() => !readSessions(f.dataRoot).some(row => row.run === runs[0])); ++ assert.ok(readSessions(f.dataRoot).some(row => row.run === runs[1])); ++}); +diff --git a/packages/webui/src/chat-http.mjs b/packages/webui/src/chat-http.mjs +index c7770726d..396b42f3c 100644 +--- a/packages/webui/src/chat-http.mjs ++++ b/packages/webui/src/chat-http.mjs +@@ -78,7 +78,8 @@ export async function chatHTTP(req, res, { path, search, chat, named, send, prev + (Object.hasOwn(v, 'repo') && (typeof v.repo !== 'string' || !KEY.test(v.repo)))) throw Error(); + action = 'createProject'; args = v; + } else if (path === '/api/chat/threads') { +- if (!exact(v, ['project', 'name']) || !id(v.project) || !name(v.name)) throw Error(); ++ if (!exact(v, ['project', 'name', 'instance'], ['project', 'name']) || !id(v.project) || !name(v.name) || ++ (Object.hasOwn(v, 'instance') && (typeof v.instance !== 'string' || !KEY.test(v.instance)))) throw Error(); + action = 'createThread'; args = v; + } else if (match?.[2] === 'messages') { + if (!exact(v, ['body']) || typeof v.body !== 'string' || !v.body.trim() || v.body.length > 32768) throw Error(); +diff --git a/packages/webui/src/chat.mjs b/packages/webui/src/chat.mjs +index 018574ad4..65b89dab3 100644 +--- a/packages/webui/src/chat.mjs ++++ b/packages/webui/src/chat.mjs +@@ -20,7 +20,7 @@ export function createChat({ call }) { + projects: () => channel('project.list', {}), + createProject: ({ name, repo }) => channel('project.create', { name, ...(repo === undefined ? {} : { repo }) }), + threads: ({ project } = {}) => channel('thread.list', project === undefined ? {} : { project }), +- createThread: ({ project, name }) => channel('thread.create', { project, name }), ++ createThread: ({ project, name, instance }) => channel('thread.create', { project, name, ...(instance === undefined ? {} : { instance }) }), + messages: ({ thread, after, limit }) => channel('thread.messages', { thread, ...(after ? { after } : {}), limit }), + send: ({ thread, body }) => channel('thread.send', { thread, body, class: 'REQUEST' }), + open: ({ thread }) => channel('thread.open', { thread }), +diff --git a/packages/webui/src/public/chat.js b/packages/webui/src/public/chat.js +index a6b805c1b..15066bdc6 100644 +--- a/packages/webui/src/public/chat.js ++++ b/packages/webui/src/public/chat.js +@@ -14,7 +14,7 @@ + return states.get(id); + }; + const form = key => { +- if (!forms.has(key)) forms.set(key, { name: '', repo: '', receipt: '', pending: false }); ++ if (!forms.has(key)) forms.set(key, { name: '', repo: '', instance: '', instanceChosen: false, receipt: '', pending: false }); + return forms.get(key); + }; + class ChatError extends Error { +@@ -58,7 +58,11 @@ + function creation(kind, key) { + const f = form(key), project = kind === 'project'; + const repo = project && current.repos.length ? `` : ''; +- return `

New ${kind}

${repo}

${txt(f.receipt)}

`; ++ const choices = current.instances ?? []; ++ const picker = project ? '' : ``; ++ const unavailable = !project && (!!current.instanceError || !choices.some(row => row.instance === f.instance)); ++ const status = !project && current.instanceError ? current.instanceError : f.receipt || (!project && !choices.length ? 'No thread instances are configured.' : ''); ++ return `

New ${kind}

${repo}${picker}

${txt(status)}

`; + } + function threads(rows) { + return rows.length ? `
    ${rows.map(t => `
  • ${link('threads', t.id, t.name)} ${txt(t.instance)}
  • `).join('')}
` : '

No threads yet.

'; +@@ -106,7 +110,7 @@ + const f = document.getElementById(keep.field.id); + if (f && !f.disabled) { + f.focus({ preventScroll: true }); +- if (keep.field.start !== null) f.setSelectionRange(keep.field.start, keep.field.end); ++ if (keep.field.start != null && typeof f.setSelectionRange === 'function') f.setSelectionRange(keep.field.start, keep.field.end); + } + } else if (navigated) c.container.querySelector('h1')?.focus({ preventScroll: true }); + } +@@ -126,7 +130,7 @@ + paint(); return; + } + const old = current; +- current = { container, kind, id, canSend, projects: old?.projects ?? [], threads: old?.threads ?? [], repos: old?.repos ?? [], error: '', refused: false }; ++ current = { container, kind, id, canSend, projects: old?.projects ?? [], threads: old?.threads ?? [], repos: old?.repos ?? [], instances: old?.instances ?? [], instanceError: kind === 'project' ? 'Reading thread instances…' : '', error: '', refused: false }; + if (navigated || !old) container.innerHTML = '

Reading chat…

'; + try { + const s = kind === 'thread' ? state(id) : null; +@@ -147,6 +151,25 @@ + s.receipt = 'Message shown in this conversation.'; s.receiptId = null; + } + } ++ if (kind === 'project') { ++ try { ++ const listed = await request('instances', undefined, signal); ++ if (g !== generation || out()) return; ++ if (!listed.rows.every(row => typeof row?.instance === 'string' && /^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,159}$/.test(row.instance) && typeof row.name === 'string')) ++ throw new ChatError('invalid-response'); ++ current.instances = listed.rows; current.instanceError = ''; ++ const f = form(id); ++ if (f.instance && !listed.rows.some(row => row.instance === f.instance)) { ++ f.instance = ''; f.instanceChosen = true; ++ f.receipt = 'The selected instance is no longer available. Choose who this thread is with.'; ++ } ++ if (!f.instanceChosen && !f.instance && listed.rows.length === 1) f.instance = listed.rows[0].instance; ++ } catch (err) { ++ if (err.name === 'AbortError' || out() || g !== generation) return; ++ current.instances = []; ++ current.instanceError = "Couldn't read the thread instances; reload to try again"; ++ } ++ } + // Repository choices are optional metadata; an unavailable read must not block unlinked chat. + if (kind === 'list') { + try { +@@ -179,7 +202,11 @@ + if (!current || out()) return; + if (event.target.id === 'chat-body') state(current.id).draft = event.target.value; + const f = event.target.closest('.chat-create'); +- if (f && event.target.dataset.chatField) form(f.dataset.key)[event.target.dataset.chatField] = event.target.value; ++ if (f && event.target.dataset.chatField) { ++ const draft = form(f.dataset.key), field = event.target.dataset.chatField; ++ draft[field] = event.target.value; ++ if (field === 'instance') { draft.instanceChosen = true; draft.receipt = ''; paint(); } ++ } + }); + document.addEventListener('scroll', event => { + if (event.target.matches?.('.chat-log') && current?.kind === 'thread') { +@@ -232,7 +259,8 @@ + void write('send', id, { body: state(id).draft }, `threads/${id}/messages`); + } else if (event.target.classList.contains('chat-create')) { + const key = event.target.dataset.key, f = form(key), project = key === 'projects'; +- const value = project ? { name: f.name, ...(f.repo ? { repo: f.repo } : {}) } : { project: key, name: f.name }; ++ if (!project && (current.instanceError || !(current.instances ?? []).some(row => row.instance === f.instance))) return; ++ const value = project ? { name: f.name, ...(f.repo ? { repo: f.repo } : {}) } : { project: key, name: f.name, instance: f.instance }; + void write(project ? 'createProject' : 'createThread', key, value, project ? 'projects' : 'threads'); + } + }); +diff --git a/packages/webui/src/serve.mjs b/packages/webui/src/serve.mjs +index 288871d0c..d9d27a062 100644 +--- a/packages/webui/src/serve.mjs ++++ b/packages/webui/src/serve.mjs +@@ -8,6 +8,7 @@ import { BusReadError, busStatus as coreBusStatus, subjectOk, sendOutcome } from + // Row 176, sage-1111: HTTP-only tester refusals; the row-164 transport pin stays untouched. + const busStatus = code => ['tester-off', 'tester-required'].includes(code) ? 403 : coreBusStatus(code); + import { ReadError, readStatus, fieldTable } from './reads.mjs'; ++import { THREAD_DEFINITIONS } from '../../business/src/vocabulary.mjs'; + import { chatHTTP } from './chat-http.mjs'; + import { processingHTTP } from './processing-http.mjs'; + +@@ -705,6 +706,25 @@ export async function startServer({ host = '127.0.0.1', port = 7330, board = DEF + if (req.method !== 'POST') return json(res, 405, { error: 'method not allowed' }); + return busSend(req, res, { send, preview: signer, log }); + } ++ // Row 219: labels only, from this listener's own human or tester bus, after auth above. ++ if (path === '/api/chat/instances') { ++ if (req.method !== 'GET') return json(res, 405, { error: 'method-not-allowed' }); ++ if (search) return json(res, 400, { error: 'invalid-request' }); ++ if (!bus?.instances) return json(res, 503, { error: 'not-configured' }); ++ try { ++ const value = await bus.instances(); ++ if (!value || !value.instances || typeof value.instances !== 'object' || Array.isArray(value.instances)) ++ throw new BusReadError('invalid-response'); ++ const rows = Object.entries(value.instances) ++ .filter(([, entry]) => THREAD_DEFINITIONS.includes(entry?.definition)) ++ .map(([instance, entry]) => ({ instance, name: entry.vars?.['persona.name'] || instance })); ++ if (rows.some(row => typeof row.name !== 'string')) throw new BusReadError('invalid-response'); ++ return json(res, 200, { rows, at: new Date().toISOString() }); ++ } catch (err) { ++ const code = err instanceof BusReadError ? err.code : 'invalid-response'; ++ return json(res, busStatus(code), { error: code }); ++ } ++ } + if (path === '/api/chat' || path.startsWith('/api/chat/')) { + return chatHTTP(req, res, { path, search, chat, named, send, preview: writer, log }); + } +diff --git a/packages/webui/tests/chat-browser.test.mjs b/packages/webui/tests/chat-browser.test.mjs +index f3eeeca96..cc3ec093d 100644 +--- a/packages/webui/tests/chat-browser.test.mjs ++++ b/packages/webui/tests/chat-browser.test.mjs +@@ -12,6 +12,7 @@ const HOSTILE = '\u001b[31m\u202eevil'; + const stub = `(() => { + const real = fetch.bind(window); + window.__writes=[];window.__reads=[];window.__answers=[];window.__pages=[]; ++ window.__instances=[{instance:'assistant',name:'assistant'}]; + window.__projects=[{id:'${P}', name:${JSON.stringify(HOSTILE)}, repo:null},{id:'\">',name:'Invalid record'}]; + window.__threads=[{id:'${A}',project:'${P}',name:'alpha',instance:'assistant'}, {id:'${B}',project:'${P}',name:'beta',instance:'assistant'}]; + window.fetch=async (url,init={})=>{ +@@ -33,6 +34,7 @@ const stub = `(() => { + window.__reads.push(path); + if(window.__holdRead && path.includes(window.__holdRead)){window.__heldSignal=init.signal;await new Promise(r=>window.__releaseRead=r);} + if(window.__readFailure)return new Response(JSON.stringify({error:window.__readFailure}),{status:window.__readFailure==='thread-not-owned'?403:503}); ++ if(path==='/api/chat/instances')return window.__instanceFailure ? new Response(JSON.stringify({error:'not-configured'}),{status:503}) : data({rows:window.__instances}); + if(path==='/api/chat/projects')return data({rows:window.__projects}); + if(path.startsWith('/api/chat/threads')&&!path.includes('/messages'))return data({rows:window.__threads}); + if(window.__pages.length)return data(window.__pages.shift()); +@@ -82,7 +84,7 @@ test('chat browser: list/create named projects and threads, hostile labels inert + await b.evaluate(`window.__answers.push({body:{id:'${A}',instance:'assistant'}}),true`); + await click('#chat-thread-form button[type=submit]'); + await wait('document.querySelector("#chat-send-form")'); +- assert.deepEqual(await b.evaluate('window.__writes[1].body'), { project: P, name: 'named thread' }); ++ assert.deepEqual(await b.evaluate('window.__writes[1].body'), { project: P, name: 'named thread', instance: 'assistant' }); + assert.equal(await b.evaluate('window.__writes[1].path'), '/api/chat/threads'); + assert.equal(await b.evaluate('window.__writes.length'), 2); + }); +@@ -264,3 +266,65 @@ test('chat browser: a late project creation receipt cannot navigate away from an + assert.equal(await b.evaluate('location.hash'), '#/chat/threads/' + A); + assert.equal(await b.evaluate('document.querySelector("#chat-body").value'), 'stay in alpha'); + }); ++ ++test('C2-09a picker: no silent choice, duplicate hostile labels stay inert, selection survives refresh and reaches POST', async t => { ++ const { b, wait, set, click, refresh } = await setup(t); ++ await b.evaluate(`window.__instances=[{instance:'bean',name:${JSON.stringify(HOSTILE)}},{instance:'chet',name:${JSON.stringify(HOSTILE)}}];location.hash='#/chat/projects/${P}';true`); ++ await wait('document.querySelectorAll("#chat-instance option").length===3'); ++ assert.equal(await b.evaluate('document.querySelector("#chat-instance").value'), ''); ++ assert.equal(await b.evaluate('document.querySelector("#chat-instance").required'), true); ++ assert.equal(await b.evaluate('document.querySelector("#chat-thread-form button").disabled'), true); ++ const labels = await b.evaluate('[...document.querySelectorAll("#chat-instance option")].map(o=>o.textContent)'); ++ assert.match(labels[1], /\(bean\)/); ++ assert.match(labels[2], /\(chet\)/); ++ assert.doesNotMatch(labels.join(''), /[\u202a-\u202e\u2066-\u2069]/u); ++ assert.equal(await b.evaluate('!!document.querySelector("#chat-thread-form img")'), false); ++ assert.equal(await b.evaluate('window.injected'), undefined); ++ await set('#chat-thread-name', 'Bean discussion'); ++ await click('#chat-thread-form button'); ++ assert.equal(await b.evaluate('window.__writes.length'), 0); ++ await set('#chat-instance', 'bean'); ++ await refresh(); ++ assert.equal(await b.evaluate('document.querySelector("#chat-instance").value'), 'bean'); ++ assert.equal(await b.evaluate('document.querySelector("#chat-thread-name").value'), 'Bean discussion'); ++ assert.equal(await b.evaluate('document.querySelector("#chat-thread-form button").disabled'), false); ++ await b.evaluate(`window.__answers.push({body:{id:'${A}',instance:'bean'}});true`); ++ await click('#chat-thread-form button'); ++ await wait('window.__writes.length===1'); ++ assert.deepEqual(await b.evaluate('window.__writes[0]'), { path: '/api/chat/threads', body: { project: P, name: 'Bean discussion', instance: 'bean' }, redirect: 'manual' }); ++}); ++ ++test('C2-09a picker: metadata failure, empty set and removed pick explain disabled state and recover without switching', async t => { ++ const { b, wait, set, refresh } = await setup(t); ++ await b.evaluate(`window.__instanceFailure=true;location.hash='#/chat/projects/${P}';true`); ++ await wait('document.querySelector("#chat-thread-form") && !document.querySelector(".chat-loading")'); ++ assert.match(await b.evaluate('document.querySelector("#chat-thread-form [role=status]").textContent'), /read the thread instances/); ++ assert.equal(await b.evaluate('document.querySelector("#chat-thread-form button").disabled'), true); ++ await b.evaluate('window.__instanceFailure=false;window.__instances=[];true'); ++ await refresh(); ++ assert.match(await b.evaluate('document.querySelector("#chat-thread-form [role=status]").textContent'), /No thread instances/); ++ assert.equal(await b.evaluate('document.querySelector("#chat-thread-form button").disabled'), true); ++ await b.evaluate("window.__instances=[{instance:'bean',name:'Bean'},{instance:'chet',name:'Chet'}];true"); ++ await refresh(); ++ await set('#chat-instance', 'bean'); ++ await b.evaluate("window.__instances=[{instance:'chet',name:'Chet'}];true"); ++ await refresh(); ++ assert.equal(await b.evaluate('document.querySelector("#chat-instance").value'), ''); ++ assert.match(await b.evaluate('document.querySelector("#chat-thread-form [role=status]").textContent'), /no longer available/); ++ assert.equal(await b.evaluate('document.querySelector("#chat-thread-form button").disabled'), true); ++ await refresh(); ++ assert.equal(await b.evaluate('document.querySelector("#chat-instance").value'), '', 'another refresh must not silently select the one remaining instance'); ++ await set('#chat-instance', 'chet'); ++ assert.equal(await b.evaluate('document.querySelector("#chat-thread-form button").disabled'), false); ++}); ++ ++test('C2-09a picker: a single instance is chosen explicitly but read-only mode cannot create a thread', async t => { ++ const { b, wait } = await setup(t, '?readonly'); ++ await b.evaluate(`location.hash='#/chat/projects/${P}';true`); ++ await wait('document.querySelectorAll("#chat-instance option").length===2'); ++ assert.equal(await b.evaluate('document.querySelector("#chat-instance").value'), 'assistant'); ++ assert.equal(await b.evaluate('document.querySelector("#chat-instance").disabled'), true); ++ assert.equal(await b.evaluate('document.querySelector("#chat-thread-form button").disabled'), true); ++ assert.match(await b.evaluate('document.querySelector(".chat-area").textContent'), /only reads/); ++ assert.equal(await b.evaluate('window.__writes.length'), 0); ++}); +diff --git a/packages/webui/tests/chat-instances.test.mjs b/packages/webui/tests/chat-instances.test.mjs +new file mode 100644 +index 000000000..893c38f80 +--- /dev/null ++++ b/packages/webui/tests/chat-instances.test.mjs +@@ -0,0 +1,87 @@ ++import test from 'node:test'; ++import assert from 'node:assert/strict'; ++import { request } from 'node:http'; ++import { mkdtempSync, rmSync } from 'node:fs'; ++import { join } from 'node:path'; ++import { tmpdir } from 'node:os'; ++import { startServer } from '../src/serve.mjs'; ++import { startTesterSocket, TESTER_ORIGIN } from '../src/tester-socket.mjs'; ++import { close } from './fixture.mjs'; ++ ++const path = '/api/chat/instances'; ++const preview = { host: 'chat.example', header: 'x-user', user: 'jason' }; ++const snapshot = { ++ revision: 'a'.repeat(64), plugins: { private: 'do-not-project' }, ++ instances: { ++ assistant: { definition: 'assistant', vars: { model: 'private-model' } }, ++ bean: { definition: 'companion', vars: { 'persona.name': 'Bean', 'persona.sha256': 'private-hash' } }, ++ chet: { definition: 'continuity', vars: { 'persona.name': 'Bean', file: '/private/path' } }, ++ pm: { definition: 'pm', vars: { 'persona.name': 'Hidden PM' } }, ++ }, ++}; ++function get(server, { route = path, method = 'GET', headers = {} } = {}) { ++ const address = server.address(), unix = typeof address === 'string'; ++ return new Promise((resolve, reject) => { ++ const req = request({ ...(unix ? { socketPath: address } : { host: '127.0.0.1', port: address.port }), ++ path: route, method, headers: { host: unix ? new URL(TESTER_ORIGIN).host : preview.host, ...headers } }, res => { ++ let text = ''; ++ res.on('data', chunk => text += chunk); ++ res.on('end', () => resolve({ status: res.statusCode, text, value: JSON.parse(text) })); ++ }); ++ req.on('error', reject); req.end(); ++ }); ++} ++test('C2-09a metadata uses the human listener bus, projects labels only and refuses unauthenticated reads', async t => { ++ let calls = 0; ++ const server = await startServer({ port: 0, preview, bus: { instances: async () => { calls++; return snapshot; } } }); ++ t.after(() => close(server)); ++ const refused = await get(server); ++ assert.equal(refused.status, 401); ++ assert.equal(calls, 0); ++ const answer = await get(server, { headers: { 'x-user': 'jason' } }); ++ assert.equal(answer.status, 200); ++ assert.deepEqual(answer.value.rows, [{ instance: 'assistant', name: 'assistant' }, { instance: 'bean', name: 'Bean' }, { instance: 'chet', name: 'Bean' }]); ++ for (const row of answer.value.rows) assert.deepEqual(Object.keys(row).sort(), ['instance', 'name']); ++ assert.doesNotMatch(answer.text, /private|Hidden PM/); ++ assert.equal(calls, 1); ++ for (const options of [{ route: path + '?extra=1' }, { method: 'POST' }]) { ++ const result = await get(server, { ...options, headers: { 'x-user': 'jason' } }); ++ assert.ok([400, 405].includes(result.status)); ++ } ++ assert.equal(calls, 1, 'invalid metadata requests never call a bus'); ++}); ++test('C2-09a metadata uses the private tester listener own bus and no human transport', async t => { ++ const root = mkdtempSync(join(tmpdir(), 'chat219-')); t.after(() => rmSync(root, { recursive: true, force: true })); ++ let reads = 0; ++ const server = await startTesterSocket({ dataRoot: root, board: 'http://127.0.0.1:9', ++ bus: { instances: async () => { reads++; return { instances: { quill: { definition: 'proofreader', vars: { 'persona.name': 'Quill' } } } }; } } }); ++ t.after(() => close(server)); ++ const answer = await get(server); ++ assert.equal(answer.status, 200); ++ assert.deepEqual(answer.value.rows, [{ instance: 'quill', name: 'Quill' }]); ++ assert.equal(reads, 1); ++}); ++test('C2-09a metadata refuses missing or malformed reads and never echoes untrusted fields', async t => { ++ for (const bus of [null, { instances: async () => ({ instances: [] }) }, { instances: async () => { throw new Error('private-path'); } }]) { ++ const server = await startServer({ port: 0, preview, bus }); t.after(() => close(server)); ++ const answer = await get(server, { headers: { 'x-user': 'jason' } }); ++ assert.ok(answer.status >= 400); ++ assert.doesNotMatch(answer.text, /private-path/); ++ } ++}); ++ ++test('C2-09a metadata stays behind the SSO session check and a GET never refreshes session activity', async t => { ++ let session = null, reads = 0; ++ const touches = []; ++ const sso = { publicHost: 'sso-chat.example', publicOrigin: 'https://sso-chat.example', formTargets: () => [], ++ session: (_req, { touch }) => { touches.push(touch); return session; } }; ++ const server = await startServer({ port: 0, sso, bus: { instances: async () => { reads++; return snapshot; } } }); ++ t.after(() => close(server)); ++ const headers = { host: sso.publicHost }; ++ assert.equal((await get(server, { headers })).status, 401); ++ assert.equal(reads, 0); ++ session = { name: 'jason' }; ++ assert.equal((await get(server, { headers })).status, 200); ++ assert.equal(reads, 1); ++ assert.deepEqual(touches, [false, false]); ++}); +diff --git a/packages/webui/tests/chat.test.mjs b/packages/webui/tests/chat.test.mjs +index 8c11611cf..b47ecf1a7 100644 +--- a/packages/webui/tests/chat.test.mjs ++++ b/packages/webui/tests/chat.test.mjs +@@ -335,3 +335,21 @@ test('the chat seam names the transport it is given: the human one and the teste + assert.throws(() => createChat({}), { name: 'TypeError', message: 'chat needs a bus transport function' }); + assert.equal(typeof createChat({ call: async () => ({}) }).projects, 'function'); + }); ++ ++test('C2-09a createThread forwards an explicit instance through the existing channel', async t => { ++ const c = await setup(t); ++ c.state.answer = { id: T, instance: 'bean' }; ++ const answer = await c.get('/api/chat/threads', { method: 'POST', value: { project: P, name: 'Bean work', instance: 'bean' } }); ++ assert.equal(answer.status, 200); ++ assert.deepEqual(c.calls, [['thread.create', { project: P, name: 'Bean work', instance: 'bean' }]]); ++ assert.equal(answer.data.instance, 'bean'); ++}); ++test('C2-09a malformed instance and extra thread fields refuse before the channel write', async t => { ++ const c = await setup(t); ++ for (const value of [null, 7, {}, [], '', 'bad name', 'bean/../../other']) { ++ const answer = await c.get('/api/chat/threads', { method: 'POST', value: { project: P, name: 'work', instance: value } }); ++ assert.equal(answer.status, 400, JSON.stringify(value)); ++ } ++ assert.equal((await c.get('/api/chat/threads', { method: 'POST', value: { project: P, name: 'work', instance: 'bean', extra: true } })).status, 400); ++ assert.deepEqual(c.calls, []); ++}); diff --git a/agents/rocko/work/queue-219/r2/candidate-manifest.sha256 b/agents/rocko/work/queue-219/r2/candidate-manifest.sha256 new file mode 100644 index 000000000..841f95bd5 --- /dev/null +++ b/agents/rocko/work/queue-219/r2/candidate-manifest.sha256 @@ -0,0 +1,14 @@ +142a210882535108159e045c61be288bc8703910a8ee0169137bc1eb80baff64 packages/bus/src/broker.mjs +b0c66c8999b567896923f6c876911dba936c6eca1ccc7aaeada51369fd613594 packages/bus/tests/creative.test.mjs +de4913f50801a11fd172e3f2c2b3cb41ab04e84d32a6650d1c8662b5e227ea3d packages/bus/tests/threads.test.mjs +8f7d6745fffb2a0898ac80c012084ac48964748da6439a8c56facc6529ffb19b packages/bus/tests/user-principal.test.mjs +b74275ce43249bafc97edc87a6a3aa0431c62fe1a28cd9fa265246e6d6da219b packages/cli/src/launcher.mjs +2c3f120dfdc0b52bf8ab38a88e86251be75d4b0d218e23df489dcaf815d6bc15 packages/cli/tests/launcher.test.mjs +7f308fdf601e839194f026beb3fea279eba1e356ce2756aa4a42fa4873b79b30 packages/cli/tests/thread-launch.test.mjs +cbfd54e6b375561d1e4679ee8d78a3285f970d9a7198cec9d22a06510a36afba packages/webui/src/chat-http.mjs +f49a49c6ec69783190d3f5eaf34316cb4d2c44d10d2ee9336fe1383207afefff packages/webui/src/chat.mjs +8e89df5fe8a9da35de41b5968afc6efcd92503e92ef28c6f557bb5371d10d1a4 packages/webui/src/public/chat.js +a597cc4902a873fe15650dacfce14dbc897db26310a7b6a24c293287add946c8 packages/webui/src/serve.mjs +d918e5b061ced9db28337a9b02c7042f9ddafaf09f32affce9f51190c0cba93f packages/webui/tests/chat-browser.test.mjs +2bad14535372488de326b82b791b79a61e1a4ab839458535132958ef85b746eb packages/webui/tests/chat-instances.test.mjs +7779d33d5b1dd3fe183722d0f91ff1f71e741e113cf2d5ee407f3d26428fc162 packages/webui/tests/chat.test.mjs diff --git a/agents/rocko/work/queue-219/r2/changed-paths.txt b/agents/rocko/work/queue-219/r2/changed-paths.txt new file mode 100644 index 000000000..689c1cf8e --- /dev/null +++ b/agents/rocko/work/queue-219/r2/changed-paths.txt @@ -0,0 +1,14 @@ +packages/bus/src/broker.mjs +packages/bus/tests/creative.test.mjs +packages/bus/tests/threads.test.mjs +packages/bus/tests/user-principal.test.mjs +packages/cli/src/launcher.mjs +packages/cli/tests/launcher.test.mjs +packages/cli/tests/thread-launch.test.mjs +packages/webui/src/chat-http.mjs +packages/webui/src/chat.mjs +packages/webui/src/public/chat.js +packages/webui/src/serve.mjs +packages/webui/tests/chat-browser.test.mjs +packages/webui/tests/chat-instances.test.mjs +packages/webui/tests/chat.test.mjs diff --git a/agents/rocko/work/queue-219/r2/mos1420-test.diff b/agents/rocko/work/queue-219/r2/mos1420-test.diff new file mode 100644 index 000000000..9c5d0fc6a --- /dev/null +++ b/agents/rocko/work/queue-219/r2/mos1420-test.diff @@ -0,0 +1,17 @@ +diff --git a/packages/cli/tests/thread-launch.test.mjs b/packages/cli/tests/thread-launch.test.mjs +index 84f8ed088..fa3adb866 100644 +--- a/packages/cli/tests/thread-launch.test.mjs ++++ b/packages/cli/tests/thread-launch.test.mjs +@@ -486,8 +486,10 @@ test('C2-09a: creative thread messages start distinct runs and keep each instanc + assert.deepEqual((await send(bean, 'bean', 'Bean input')).before, []); + assert.deepEqual((await send(chet, 'chet', 'Chet input')).before, []); + assert.deepEqual((await send(bean, 'bean', 'Bean again')).before, ['Bean input']); +- assert.equal(readFileSync(join(f.dataRoot, 'threads', 'acme', bean, 'session', 'history'), 'utf8'), 'Bean input\nBean again\n'); +- assert.equal(readFileSync(join(f.dataRoot, 'threads', 'acme', chet, 'session', 'history'), 'utf8'), 'Chet input\n'); ++ assert.equal(readFileSync(join(f.dataRoot, 'threads', 'acme', bean, 'sessions', host.runtime.threadsState('acme').find(x => x.thread === bean).session, 'session', 'history'), 'utf8'), 'Bean input\nBean again\n'); ++ assert.equal(readFileSync(join(f.dataRoot, 'threads', 'acme', chet, 'sessions', host.runtime.threadsState('acme').find(x => x.thread === chet).session, 'session', 'history'), 'utf8'), 'Chet input\n'); ++ assert.equal(existsSync(join(f.dataRoot, 'threads', 'acme', bean, 'session')), false); ++ assert.equal(existsSync(join(f.dataRoot, 'threads', 'acme', chet, 'session')), false); + const launches = launchLog(f).filter(row => row.event === 'launch'); + assert.ok(launches.some(row => row.instance === 'bean' && row.thread === bean)); + assert.ok(launches.some(row => row.instance === 'chet' && row.thread === chet)); diff --git a/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1418/cwd-sweep-final.json b/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1418/cwd-sweep-final.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1418/cwd-sweep-final.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1418/cwd-sweep.json b/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1418/cwd-sweep.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1418/cwd-sweep.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1418/head.json b/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1418/head.json new file mode 100644 index 000000000..07dd958dd --- /dev/null +++ b/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1418/head.json @@ -0,0 +1 @@ +{"head": "b97a3ff9757ec2ac39d9ab4cebb9769e471df932", "manifest": "a973912fe2fb9c64606cd99a385305b8f51498a096511b3a980bca6b0a5b98aa", "start": "2026-10-23T05:48:57.416807+00:00"} \ No newline at end of file diff --git a/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1418/network-cleanup.log b/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1418/network-cleanup.log new file mode 100644 index 000000000..5f00a1b72 --- /dev/null +++ b/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1418/network-cleanup.log @@ -0,0 +1,2 @@ +Error response from daemon: network rocko-r219-gate_default not found +exit status 1 diff --git a/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1418/results.jsonl b/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1418/results.jsonl new file mode 100644 index 000000000..550ae9ec5 --- /dev/null +++ b/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1418/results.jsonl @@ -0,0 +1,4 @@ +{"label": "single-bus-creative.test", "args": ["timeout", "-k", "10", "300", "node", "--test-reporter=tap", "--test", "packages/bus/tests/creative.test.mjs"], "start": "2026-10-23T05:48:57.418927+00:00", "end": "2026-10-23T05:48:57.834246+00:00", "seconds": 0.415, "exit": 0, "timeout": false, "counts": {"tests": 4, "pass": 4, "fail": 0, "cancelled": 0, "skipped": 0}, "skips": ["# skipped 0"], "log": "agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-creative.test.tap", "tmpdir": "/mnt/storage/scratch/tmp/rs156uowe"} +{"label": "single-bus-threads.test", "args": ["timeout", "-k", "10", "300", "node", "--test-reporter=tap", "--test", "packages/bus/tests/threads.test.mjs"], "start": "2026-10-23T05:48:57.835837+00:00", "end": "2026-10-23T05:48:59.152912+00:00", "seconds": 1.317, "exit": 0, "timeout": false, "counts": {"tests": 19, "pass": 19, "fail": 0, "cancelled": 0, "skipped": 0}, "skips": ["# skipped 0"], "log": "agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-threads.test.tap", "tmpdir": "/mnt/storage/scratch/tmp/rbqz65jtz"} +{"label": "single-bus-user-principal.test", "args": ["timeout", "-k", "10", "300", "node", "--test-reporter=tap", "--test", "packages/bus/tests/user-principal.test.mjs"], "start": "2026-10-23T05:48:59.154288+00:00", "end": "2026-10-23T05:48:59.719646+00:00", "seconds": 0.565, "exit": 0, "timeout": false, "counts": {"tests": 23, "pass": 23, "fail": 0, "cancelled": 0, "skipped": 0}, "skips": ["# skipped 0"], "log": "agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-user-principal.test.tap", "tmpdir": "/mnt/storage/scratch/tmp/rztf343rx"} +{"label": "single-cli-launcher.test", "args": ["timeout", "-k", "10", "300", "node", "--test-reporter=tap", "--test", "packages/cli/tests/launcher.test.mjs"], "start": "2026-10-23T05:48:59.721051+00:00", "end": "2026-10-23T05:49:26.296570+00:00", "seconds": 26.576, "exit": 1, "timeout": false, "counts": {"tests": 34, "pass": 33, "fail": 1, "cancelled": 0, "skipped": 0}, "skips": ["# skipped 0"], "log": "agents/rocko/work/queue-219/run-4a9c-mos1408/single-cli-launcher.test.tap", "tmpdir": "/mnt/storage/scratch/tmp/r8xucbjgl"} diff --git a/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1418/single-bus-creative.test.tap b/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1418/single-bus-creative.test.tap new file mode 100644 index 000000000..c397aec5c --- /dev/null +++ b/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1418/single-bus-creative.test.tap @@ -0,0 +1,36 @@ +TAP version 13 +# organization: {"event":"reload-needs-restart","business":"demo"} +# organization: {"event":"reload-needs-restart","business":"demo"} +# Subtest: M6: a creative raise refuses decision-not-allowed, cited or not, and no decision row appears; the assistant still raises +ok 1 - M6: a creative raise refuses decision-not-allowed, cited or not, and no decision row appears; the assistant still raises + --- + duration_ms: 37.235384 + type: 'test' + ... +# Subtest: a creative instance sends only to the user and hears only from the user +ok 2 - a creative instance sends only to the user and hears only from the user + --- + duration_ms: 44.266739 + type: 'test' + ... +# Subtest: M10 through the broker: the chief and the tester are refused on bean, the human's limits.set of its models key works +ok 3 - M10 through the broker: the chief and the tester are refused on bean, the human's limits.set of its models key works + --- + duration_ms: 83.079495 + type: 'test' + ... +# Subtest: row 256 T6 the human deletes a creative instance through the broker; the chief and the tester are refused at the verb +ok 4 - row 256 T6 the human deletes a creative instance through the broker; the chief and the tester are refused at the verb + --- + duration_ms: 63.576082 + type: 'test' + ... +1..4 +# tests 4 +# suites 0 +# pass 4 +# fail 0 +# cancelled 0 +# skipped 0 +# todo 0 +# duration_ms 356.82109 diff --git a/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1418/single-bus-threads.test.tap b/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1418/single-bus-threads.test.tap new file mode 100644 index 000000000..99b713932 --- /dev/null +++ b/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1418/single-bus-threads.test.tap @@ -0,0 +1,124 @@ +TAP version 13 +# Subtest: REQ-ROLE-2 REQ-THREAD-1: one holder per thread, through the broker and the trigger +ok 1 - REQ-ROLE-2 REQ-THREAD-1: one holder per thread, through the broker and the trigger + --- + duration_ms: 37.957781 + type: 'test' + ... +# Subtest: REQ-ROLE-2 REQ-THREAD-1: the 3e triggers refuse writes that skip the broker +ok 2 - REQ-ROLE-2 REQ-THREAD-1: the 3e triggers refuse writes that skip the broker + --- + duration_ms: 68.301373 + type: 'test' + ... +# Subtest: REQ-MSG-1: a message to or from the assistant names its thread, or is refused +ok 3 - REQ-MSG-1: a message to or from the assistant names its thread, or is refused + --- + duration_ms: 31.316512 + type: 'test' + ... +# Subtest: REQ-MSG-1: the chief of staff's reply comes back to the thread that sent the work +ok 4 - REQ-MSG-1: the chief of staff's reply comes back to the thread that sent the work + --- + duration_ms: 593.922455 + type: 'test' + ... +# Subtest: REQ-MSG-1: a reply can't carry one thread instance's thread to another thread instance +ok 5 - REQ-MSG-1: a reply can't carry one thread instance's thread to another thread instance + --- + duration_ms: 24.857971 + type: 'test' + ... +# Subtest: REQ-THREAD-1 REQ-USER-2: one thread's messages never reach another thread's holder +ok 6 - REQ-THREAD-1 REQ-USER-2: one thread's messages never reach another thread's holder + --- + duration_ms: 27.519976 + type: 'test' + ... +# Subtest: REQ-LAUNCH-1: a message to a thread with no holder waits, and the next holder gets it +ok 7 - REQ-LAUNCH-1: a message to a thread with no holder waits, and the next holder gets it + --- + duration_ms: 30.716822 + type: 'test' + ... +# Subtest: REQ-THREAD-2 REQ-LAUNCH-1: threadIdle releases only a thread with nothing waiting, and only for its holder +ok 8 - REQ-THREAD-2 REQ-LAUNCH-1: threadIdle releases only a thread with nothing waiting, and only for its holder + --- + duration_ms: 33.754906 + type: 'test' + ... +# Subtest: REQ-THREAD-2 REQ-LAUNCH-1: a message delivered to a run that ended unread doesn't hold up the next holder +ok 9 - REQ-THREAD-2 REQ-LAUNCH-1: a message delivered to a run that ended unread doesn't hold up the next holder + --- + duration_ms: 29.046481 + type: 'test' + ... +# Subtest: REQ-ROLE-2 REQ-THREAD-1 Q169: a role.revoke the human approved ends every thread run of the assistant +ok 10 - REQ-ROLE-2 REQ-THREAD-1 Q169: a role.revoke the human approved ends every thread run of the assistant + --- + duration_ms: 26.449042 + type: 'test' + ... +# Subtest: Q169 REQ-USER-2: assistant.stop ends the human's own assistant thread runs, and only the human's +ok 11 - Q169 REQ-USER-2: assistant.stop ends the human's own assistant thread runs, and only the human's + --- + duration_ms: 38.524966 + type: 'test' + ... +# Subtest: REQ-USER-2: the human verbs refuse another owner's thread +ok 12 - REQ-USER-2: the human verbs refuse another owner's thread + --- + duration_ms: 28.558392 + type: 'test' + ... +# Subtest: REQ-THREAD-1: thread.create refuses when the business has no thread instance or more than one +ok 13 - REQ-THREAD-1: thread.create refuses when the business has no thread instance or more than one + --- + duration_ms: 23.166467 + type: 'test' + ... +# Subtest: REQ-ORG-2: projects and threads are named once, and the repo names a business project +ok 14 - REQ-ORG-2: projects and threads are named once, and the repo names a business project + --- + duration_ms: 28.154835 + type: 'test' + ... +# Subtest: REQ-THREAD-2: thread.messages returns the thread's history in pages and writes nothing +ok 15 - REQ-THREAD-2: thread.messages returns the thread's history in pages and writes nothing + --- + duration_ms: 86.802213 + type: 'test' + ... +# Subtest: project.create refuses a repository name without its matching repo before any write +ok 16 - project.create refuses a repository name without its matching repo before any write + --- + duration_ms: 15.244016 + type: 'test' + ... +# Subtest: project.create keeps unrelated names with and without a repository +ok 17 - project.create keeps unrelated names with and without a repository + --- + duration_ms: 11.57841 + type: 'test' + ... +# Subtest: C2-09a: explicit creative instances bind independent threads, default sessions and holders +ok 18 - C2-09a: explicit creative instances bind independent threads, default sessions and holders + --- + duration_ms: 46.82113 + type: 'test' + ... +# Subtest: C2-09a: explicit missing, non-thread and malformed selectors create no thread or session +ok 19 - C2-09a: explicit missing, non-thread and malformed selectors create no thread or session + --- + duration_ms: 20.263528 + type: 'test' + ... +1..19 +# tests 19 +# suites 0 +# pass 19 +# fail 0 +# cancelled 0 +# skipped 0 +# todo 0 +# duration_ms 1283.575562 diff --git a/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1418/single-bus-user-principal.test.tap b/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1418/single-bus-user-principal.test.tap new file mode 100644 index 000000000..bffa47082 --- /dev/null +++ b/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1418/single-bus-user-principal.test.tap @@ -0,0 +1,148 @@ +TAP version 13 +# Subtest: R3: bindUser binds a granted user and refuses one with no live grant +ok 1 - R3: bindUser binds a granted user and refuses one with no live grant + --- + duration_ms: 15.216913 + type: 'test' + ... +# Subtest: R3: a user named like the business human, the tester or a principal word is refused, whatever the grants say +ok 2 - R3: a user named like the business human, the tester or a principal word is refused, whatever the grants say + --- + duration_ms: 10.127905 + type: 'test' + ... +# Subtest: R3: each collaborator verb is allowed to a granted user +ok 3 - R3: each collaborator verb is allowed to a granted user + --- + duration_ms: 18.491408 + type: 'test' + ... +# Subtest: R3: every verb off the collaborator list refuses a user access-refused before its own checks +ok 4 - R3: every verb off the collaborator list refuses a user access-refused before its own checks + --- + duration_ms: 95.840429 + type: 'test' + ... +# Subtest: R3: task, web and host verbs refuse a user access-refused +ok 5 - R3: task, web and host verbs refuse a user access-refused + --- + duration_ms: 22.333602 + type: 'test' + ... +# Subtest: R3 leak: project.list shows granted projects only +ok 6 - R3 leak: project.list shows granted projects only + --- + duration_ms: 12.494935 + type: 'test' + ... +# Subtest: R3 leak: thread.create needs the project and the thread instance granted, and an ungranted id reads as one that does not exist +ok 7 - R3 leak: thread.create needs the project and the thread instance granted, and an ungranted id reads as one that does not exist + --- + duration_ms: 15.195921 + type: 'test' + ... +# Subtest: R3 leak: thread.list shows the user its own threads that are still granted, never others +ok 8 - R3 leak: thread.list shows the user its own threads that are still granted, never others + --- + duration_ms: 33.037437 + type: 'test' + ... +# Subtest: R3 leak: names shows granted instances only +ok 9 - R3 leak: names shows granted instances only + --- + duration_ms: 14.891286 + type: 'test' + ... +# Subtest: R3: thread.send is from user: and writes no human.input +ok 10 - R3: thread.send is from user: and writes no human.input + --- + duration_ms: 13.366772 + type: 'test' + ... +# Subtest: R3: a reply-chain message.send into another user thread is refused +ok 11 - R3: a reply-chain message.send into another user thread is refused + --- + duration_ms: 15.523733 + type: 'test' + ... +# Subtest: R3: the run reply to a user message reaches that user thread.messages, with no waiting and no notice +ok 12 - R3: the run reply to a user message reaches that user thread.messages, with no waiting and no notice + --- + duration_ms: 18.163702 + type: 'test' + ... +# Subtest: R3: a reply to: user without a matching in_reply_to is refused user-reply-required +ok 13 - R3: a reply to: user without a matching in_reply_to is refused user-reply-required + --- + duration_ms: 26.445744 + type: 'test' + ... +# Subtest: R3: a non-thread run, the human and the tester cannot send to: user +ok 14 - R3: a non-thread run, the human and the tester cannot send to: user + --- + duration_ms: 17.29104 + type: 'test' + ... +# Subtest: R3: a user thread run cannot message the owner, while its uncited gated raise reaches only the owner inbox, B9 +ok 15 - R3: a user thread run cannot message the owner, while its uncited gated raise reaches only the owner inbox, B9 + --- + duration_ms: 19.258704 + type: 'test' + ... +# Subtest: R3: a removed or expired grant refuses the next request access-revoked, and the file is read per request +ok 16 - R3: a removed or expired grant refuses the next request access-revoked, and the file is read per request + --- + duration_ms: 18.231409 + type: 'test' + ... +# Subtest: R3: a user refusal is recorded as action.refused by user: +ok 17 - R3: a user refusal is recorded as action.refused by user: + --- + duration_ms: 13.797301 + type: 'test' + ... +# Subtest: R3: a business with a role keyed user refuses invalid-business +ok 18 - R3: a business with a role keyed user refuses invalid-business + --- + duration_ms: 9.468564 + type: 'test' + ... +# Subtest: R3: name.set refuses the name user +ok 19 - R3: name.set refuses the name user + --- + duration_ms: 9.752458 + type: 'test' + ... +# Subtest: R3 r4: while halted, a granted user's thread.send refuses processing-halted and thread.messages still answers +ok 20 - R3 r4: while halted, a granted user's thread.send refuses processing-halted and thread.messages still answers + --- + duration_ms: 13.617784 + type: 'test' + ... +# Subtest: R3 r4: the chief's hire refuses an instance named user with the code it gives human and tester +ok 21 - R3 r4: the chief's hire refuses an instance named user with the code it gives human and tester + --- + duration_ms: 14.726171 + type: 'test' + ... +# Subtest: R3 r4: a non-function access throws before the store is read +ok 22 - R3 r4: a non-function access throws before the store is read + --- + duration_ms: 0.105564 + type: 'test' + ... +# Subtest: C2-09a: naming an instance cannot bypass its collaborator grant or disclose an ungranted project +ok 23 - C2-09a: naming an instance cannot bypass its collaborator grant or disclose an ungranted project + --- + duration_ms: 15.883063 + type: 'test' + ... +1..23 +# tests 23 +# suites 0 +# pass 23 +# fail 0 +# cancelled 0 +# skipped 0 +# todo 0 +# duration_ms 523.149354 diff --git a/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1418/single-cli-launcher.test.tap b/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1418/single-cli-launcher.test.tap new file mode 100644 index 000000000..a43f32623 --- /dev/null +++ b/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1418/single-cli-launcher.test.tap @@ -0,0 +1,259 @@ +TAP version 13 +# Subtest: C2-04: launcher workspace clones code but never the library +ok 1 - C2-04: launcher workspace clones code but never the library + --- + duration_ms: 1444.885132 + type: 'test' + ... +# Subtest: bus start --pm: the launcher instance (the chief of staff) runs under its own PID namespace, registered, with a manifest +ok 2 - bus start --pm: the launcher instance (the chief of staff) runs under its own PID namespace, registered, with a manifest + --- + duration_ms: 1312.408111 + type: 'test' + ... +# usage: {"event":"usage-unknown","business":"acme","run":"r910aab09c0d6","instance":"chief","turn":"368e3045-8783-47d3-8ae1-e429b321d9b1","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r5bb5f0657d94","instance":"coder","turn":"3432d01f-ca94-4a5e-88d3-19588a40a81d","source":"@none","code":"baseline-unknown"} +# Subtest: the chief of staff launches a coder through its launch tool; the coder answers; refusals name their code +ok 3 - the chief of staff launches a coder through its launch tool; the coder answers; refusals name their code + --- + duration_ms: 745.868459 + type: 'test' + ... +# usage: {"event":"usage-unknown","business":"acme","run":"r0f3692812967","instance":"chief","turn":"3bd3e4d7-3af4-4a1c-99f1-a8f25b7ab1dd","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"re94397bc3680","instance":"pm","turn":"b2db478d-2905-49fd-a81a-0800643bed6a","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r0f3692812967","instance":"chief","turn":"ac2aa380-f3a0-40d4-960f-a543acb8c431","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"re94397bc3680","instance":"pm","turn":"e8b5124b-591b-4d5b-829c-e944bb3e24bb","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"re94397bc3680","instance":"pm","turn":"6a6e1fa4-5182-42dc-bbc2-26f136eedee3","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r0f3692812967","instance":"chief","turn":"54eb77b5-3880-4afb-9772-0b9d590eb328","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"re94397bc3680","instance":"pm","turn":"11fe8b92-1dae-416a-838b-ae305db74bc6","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r0f3692812967","instance":"chief","turn":"68266357-b477-433c-99ed-f1af37143d91","source":"@none","code":"baseline-unknown"} +# Subtest: a launched pm's request_staff reaches the chief of staff; no other session has the tool and the launch limits still hold +ok 4 - a launched pm's request_staff reaches the chief of staff; no other session has the tool and the launch limits still hold + --- + duration_ms: 1245.265675 + type: 'test' + ... +# Subtest: each launch makes sure the workspace has a clone of the project: cloned, fast-forwarded, or fetched and logged +ok 5 - each launch makes sure the workspace has a clone of the project: cloned, fast-forwarded, or fetched and logged + --- + duration_ms: 4072.119958 + type: 'test' + ... +# Subtest: a role the broker says holds a merge decision gets land_work, its prompt line, its landing and the git socket; without it, none +ok 6 - a role the broker says holds a merge decision gets land_work, its prompt line, its landing and the git socket; without it, none + --- + duration_ms: 621.888037 + type: 'test' + ... +# Subtest: REQ-LAUNCH-1 the tick starts a listed merge decision holder once, with land_work, the Landing line and its landing turn; an unlisted holder starts nothing +ok 7 - REQ-LAUNCH-1 the tick starts a listed merge decision holder once, with land_work, the Landing line and its landing turn; an unlisted holder starts nothing + --- + duration_ms: 417.133166 + type: 'test' + ... +# usage: {"event":"usage-unknown","business":"acme","run":"r8e91dd37dc4b","instance":"coder","turn":"a7b24e30-ac5e-47cf-a951-90cf0d948b4d","source":"@none","code":"baseline-unknown"} +# Subtest: a holder running since before the resolution is stopped once the broker releases it, land-relaunch, and the next tick starts it: landing turn first, then the message that waited +ok 8 - a holder running since before the resolution is stopped once the broker releases it, land-relaunch, and the next tick starts it: landing turn first, then the message that waited + --- + duration_ms: 730.904044 + type: 'test' + ... +# Subtest: a landing run that ended isn't started again for its decision, a spent decision starts nothing, and a new decision starts the holder +ok 9 - a landing run that ended isn't started again for its decision, a spent decision starts nothing, and a new decision starts the holder + --- + duration_ms: 698.470719 + type: 'test' + ... +# Subtest: after a restart, the new host's first tick starts a holder whose decision is still held +ok 10 - after a restart, the new host's first tick starts a holder whose decision is still held + --- + duration_ms: 920.432738 + type: 'test' + ... +# Subtest: a refused landing start is logged once per code with its decision, isn't a start, and the next tick with room starts the holder +ok 11 - a refused landing start is logged once per code with its decision, isn't a start, and the next tick with room starts the holder + --- + duration_ms: 641.309798 + type: 'test' + ... +# Subtest: a project clone that can't be made refuses checkout-failed, from --chief and from a session, with no run and no clone left +ok 12 - a project clone that can't be made refuses checkout-failed, from --chief and from a session, with no run and no clone left + --- + duration_ms: 267.647539 + type: 'test' + ... +# Subtest: a runner that stops at once ends its launch with the runner's reason +ok 13 - a runner that stops at once ends its launch with the runner's reason + --- + duration_ms: 332.423482 + type: 'test' + ... +# Subtest: a Claude Code launch with no session credential refuses before it starts +ok 14 - a Claude Code launch with no session credential refuses before it starts + --- + duration_ms: 181.931254 + type: 'test' + ... +# Subtest: a pi launch needs no session credential: pi logs in through its own ENV_ALLOW variables +ok 15 - a pi launch needs no session credential: pi logs in through its own ENV_ALLOW variables + --- + duration_ms: 315.27683 + type: 'test' + ... +# usage: {"event":"plugin-refused","kind":"harness","name":"down","code":"missing","message":"/mnt/storage/scratch/rocko-r219/packages/plugins/harness/down is missing","kept":[]} +# plugins: {"event":"plugin-refused","kind":"harness","name":"down","code":"missing","message":"/mnt/storage/scratch/rocko-r219/packages/plugins/harness/down is missing","kept":[]} +# Subtest: row 65 a failed primary preflight launches the fallback on a fixture harness module, recording the route and the reason +ok 16 - row 65 a failed primary preflight launches the fallback on a fixture harness module, recording the route and the reason + --- + duration_ms: 353.028786 + type: 'test' + ... +# Subtest: a runner killed from the host ends its launch as killed, not failed +ok 17 - a runner killed from the host ends its launch as killed, not failed + --- + duration_ms: 375.548364 + type: 'test' + ... +# Subtest: a missing or failing bwrap refuses sandbox-unavailable before anything starts; there is no unconfined fallback +ok 18 - a missing or failing bwrap refuses sandbox-unavailable before anything starts; there is no unconfined fallback + --- + duration_ms: 187.871873 + type: 'test' + ... +# Subtest: row 64 a role skill that isn't enabled refuses skill-not-enabled, and one that isn't a plain directory skill-refused, before anything starts +ok 19 - row 64 a role skill that isn't enabled refuses skill-not-enabled, and one that isn't a plain directory skill-refused, before anything starts + --- + duration_ms: 187.807189 + type: 'test' + ... +# Subtest: row 213 a creative instance's persona is read from /personas: off its digest the launch fails with the mismatch as its reason +not ok 20 - row 213 a creative instance's persona is read from /personas: off its digest the launch fails with the mismatch as its reason + --- + duration_ms: 255.698016 + type: 'test' + location: '/mnt/storage/scratch/rocko-r219/packages/cli/tests/launcher.test.mjs:766:1' + failureType: 'testCodeFailure' + error: |- + Expected values to be strictly deep-equal: + + actual - expected + + [ + + 'compactions', + + undefined, + + 2 + - 'refused', + - 'launch-failed', + - 1 + ] + + code: 'ERR_ASSERTION' + name: 'AssertionError' + expected: + 0: 'refused' + 1: 'launch-failed' + 2: 1 + actual: + 0: 'compactions' + 2: 2 + operator: 'deepStrictEqual' + stack: |- + TestContext. (file:///mnt/storage/scratch/rocko-r219/packages/cli/tests/launcher.test.mjs:789:10) + process.processTicksAndRejections (node:internal/process/task_queues:104:5) + async Test.run (node:internal/test_runner/test:1409:7) + async Test.processPendingSubtests (node:internal/test_runner/test:974:7) + ... +# Subtest: row 64 on Claude Code a role skill that isn't enabled refuses the same way, before anything starts +ok 21 - row 64 on Claude Code a role skill that isn't enabled refuses the same way, before anything starts + --- + duration_ms: 194.030218 + type: 'test' + ... +# usage: {"event":"usage-unknown","business":"acme","run":"r3715d40bd7fb","instance":"chief","turn":"4c85d22f-fdab-4ab7-ad8a-6b4c4d1fbf72","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r16ae936abadf","instance":"coder","turn":"2c6b06f1-8f36-4261-81b7-2689b9bb7ff4","source":"@none","code":"baseline-unknown"} +# Subtest: a real Claude Code coder's shell can't read a stand-in secret or anything else its sandbox doesn't hold +ok 22 - a real Claude Code coder's shell can't read a stand-in secret or anything else its sandbox doesn't hold + --- + duration_ms: 1456.773218 + type: 'test' + ... +# Subtest: a host that died hard leaves its sessions to the next host, which kills them and ends their runs so the role can be launched again +ok 23 - a host that died hard leaves its sessions to the next host, which kills them and ends their runs so the role can be launched again + --- + duration_ms: 1063.59923 + type: 'test' + ... +# Subtest: a host that died hard leaves its sessions to the next host, which finds one already exited (23) and ends their runs so the role can be launched again +ok 24 - a host that died hard leaves its sessions to the next host, which finds one already exited (23) and ends their runs so the role can be launched again + --- + duration_ms: 4016.888246 + type: 'test' + ... +# Subtest: bus start --no-launch leaves an earlier host's live session alone: no signal, no end, sessions.json as it was +ok 25 - bus start --no-launch leaves an earlier host's live session alone: no signal, no end, sessions.json as it was + --- + duration_ms: 237.364574 + type: 'test' + ... +# Subtest: bus start --no-launch refuses every launch: the PM launch and a session's request, each logged, nothing spawned +ok 26 - bus start --no-launch refuses every launch: the PM launch and a session's request, each logged, nothing spawned + --- + duration_ms: 197.775267 + type: 'test' + ... +# Subtest: bus start --no-launch starts no thread tick; the same host with launches runs it +ok 27 - bus start --no-launch starts no thread tick; the same host with launches runs it + --- + duration_ms: 1181.987654 + type: 'test' + ... +# Subtest: a malformed sessions.json refuses the host start with exit 3 and stays as it was +ok 28 - a malformed sessions.json refuses the host start with exit 3 and stays as it was + --- + duration_ms: 177.111363 + type: 'test' + ... +# Subtest: an over-long launch request is refused at once, not at the 10 s idle timeout +ok 29 - an over-long launch request is refused at once, not at the 10 s idle timeout + --- + duration_ms: 183.364128 + type: 'test' + ... +# Subtest: a launch client that never closes its side doesn't hold the host's close +ok 30 - a launch client that never closes its side doesn't hold the host's close + --- + duration_ms: 179.49662 + type: 'test' + ... +# Subtest: a runner that ignores SIGTERM is killed when the host closes +ok 31 - a runner that ignores SIGTERM is killed when the host closes + --- + duration_ms: 1352.083242 + type: 'test' + ... +# Subtest: kill switch refuses chief and hire before launch work and a clear permits a later request +ok 32 - kill switch refuses chief and hire before launch work and a clear permits a later request + --- + duration_ms: 319.505559 + type: 'test' + ... +# Subtest: kill switch stops an actual managed namespace and records the halt reason without rewriting its bundle +ok 33 - kill switch stops an actual managed namespace and records the halt reason without rewriting its bundle + --- + duration_ms: 334.076309 + type: 'test' + ... +# Subtest: a launch waiting across halt and resume cannot use its stale admission +ok 34 - a launch waiting across halt and resume cannot use its stale admission + --- + duration_ms: 201.932098 + type: 'test' + ... +1..34 +# tests 34 +# suites 0 +# pass 33 +# fail 1 +# cancelled 0 +# skipped 0 +# todo 0 +# duration_ms 26522.233904 diff --git a/agents/rocko/work/queue-219/run-4a9c-mos1408/head.json b/agents/rocko/work/queue-219/run-4a9c-mos1408/head.json index 07dd958dd..7b97b61f3 100644 --- a/agents/rocko/work/queue-219/run-4a9c-mos1408/head.json +++ b/agents/rocko/work/queue-219/run-4a9c-mos1408/head.json @@ -1 +1 @@ -{"head": "b97a3ff9757ec2ac39d9ab4cebb9769e471df932", "manifest": "a973912fe2fb9c64606cd99a385305b8f51498a096511b3a980bca6b0a5b98aa", "start": "2026-10-23T05:48:57.416807+00:00"} \ No newline at end of file +{"head": "7cbd839d037f711de136108882b53597cf16d742", "manifest": "84a8bd9afc5420fc315586584aec91258a28bd728000dcd2cb61ac41b2fe711a", "start": "2026-10-23T06:09:43.704053+00:00"} \ No newline at end of file diff --git a/agents/rocko/work/queue-219/run-4a9c-mos1408/results.jsonl b/agents/rocko/work/queue-219/run-4a9c-mos1408/results.jsonl index 550ae9ec5..b5678d996 100644 --- a/agents/rocko/work/queue-219/run-4a9c-mos1408/results.jsonl +++ b/agents/rocko/work/queue-219/run-4a9c-mos1408/results.jsonl @@ -1,4 +1,5 @@ -{"label": "single-bus-creative.test", "args": ["timeout", "-k", "10", "300", "node", "--test-reporter=tap", "--test", "packages/bus/tests/creative.test.mjs"], "start": "2026-10-23T05:48:57.418927+00:00", "end": "2026-10-23T05:48:57.834246+00:00", "seconds": 0.415, "exit": 0, "timeout": false, "counts": {"tests": 4, "pass": 4, "fail": 0, "cancelled": 0, "skipped": 0}, "skips": ["# skipped 0"], "log": "agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-creative.test.tap", "tmpdir": "/mnt/storage/scratch/tmp/rs156uowe"} -{"label": "single-bus-threads.test", "args": ["timeout", "-k", "10", "300", "node", "--test-reporter=tap", "--test", "packages/bus/tests/threads.test.mjs"], "start": "2026-10-23T05:48:57.835837+00:00", "end": "2026-10-23T05:48:59.152912+00:00", "seconds": 1.317, "exit": 0, "timeout": false, "counts": {"tests": 19, "pass": 19, "fail": 0, "cancelled": 0, "skipped": 0}, "skips": ["# skipped 0"], "log": "agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-threads.test.tap", "tmpdir": "/mnt/storage/scratch/tmp/rbqz65jtz"} -{"label": "single-bus-user-principal.test", "args": ["timeout", "-k", "10", "300", "node", "--test-reporter=tap", "--test", "packages/bus/tests/user-principal.test.mjs"], "start": "2026-10-23T05:48:59.154288+00:00", "end": "2026-10-23T05:48:59.719646+00:00", "seconds": 0.565, "exit": 0, "timeout": false, "counts": {"tests": 23, "pass": 23, "fail": 0, "cancelled": 0, "skipped": 0}, "skips": ["# skipped 0"], "log": "agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-user-principal.test.tap", "tmpdir": "/mnt/storage/scratch/tmp/rztf343rx"} -{"label": "single-cli-launcher.test", "args": ["timeout", "-k", "10", "300", "node", "--test-reporter=tap", "--test", "packages/cli/tests/launcher.test.mjs"], "start": "2026-10-23T05:48:59.721051+00:00", "end": "2026-10-23T05:49:26.296570+00:00", "seconds": 26.576, "exit": 1, "timeout": false, "counts": {"tests": 34, "pass": 33, "fail": 1, "cancelled": 0, "skipped": 0}, "skips": ["# skipped 0"], "log": "agents/rocko/work/queue-219/run-4a9c-mos1408/single-cli-launcher.test.tap", "tmpdir": "/mnt/storage/scratch/tmp/r8xucbjgl"} +{"label": "single-bus-creative.test", "args": ["timeout", "-k", "10", "300", "node", "--test-reporter=tap", "--test", "packages/bus/tests/creative.test.mjs"], "start": "2026-10-23T06:09:43.706182+00:00", "end": "2026-10-23T06:09:44.121877+00:00", "seconds": 0.416, "exit": 0, "timeout": false, "counts": {"tests": 4, "pass": 4, "fail": 0, "cancelled": 0, "skipped": 0}, "skips": ["# skipped 0"], "log": "agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-creative.test.tap", "tmpdir": "/mnt/storage/scratch/tmp/rmc2uerc6"} +{"label": "single-bus-threads.test", "args": ["timeout", "-k", "10", "300", "node", "--test-reporter=tap", "--test", "packages/bus/tests/threads.test.mjs"], "start": "2026-10-23T06:09:44.123566+00:00", "end": "2026-10-23T06:09:45.490657+00:00", "seconds": 1.367, "exit": 0, "timeout": false, "counts": {"tests": 19, "pass": 19, "fail": 0, "cancelled": 0, "skipped": 0}, "skips": ["# skipped 0"], "log": "agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-threads.test.tap", "tmpdir": "/mnt/storage/scratch/tmp/rismt3po4"} +{"label": "single-bus-user-principal.test", "args": ["timeout", "-k", "10", "300", "node", "--test-reporter=tap", "--test", "packages/bus/tests/user-principal.test.mjs"], "start": "2026-10-23T06:09:45.492192+00:00", "end": "2026-10-23T06:09:46.107814+00:00", "seconds": 0.616, "exit": 0, "timeout": false, "counts": {"tests": 23, "pass": 23, "fail": 0, "cancelled": 0, "skipped": 0}, "skips": ["# skipped 0"], "log": "agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-user-principal.test.tap", "tmpdir": "/mnt/storage/scratch/tmp/repq8xlqh"} +{"label": "single-cli-launcher.test", "args": ["timeout", "-k", "10", "300", "node", "--test-reporter=tap", "--test", "packages/cli/tests/launcher.test.mjs"], "start": "2026-10-23T06:09:46.109200+00:00", "end": "2026-10-23T06:10:12.635877+00:00", "seconds": 26.527, "exit": 0, "timeout": false, "counts": {"tests": 34, "pass": 34, "fail": 0, "cancelled": 0, "skipped": 0}, "skips": ["# skipped 0"], "log": "agents/rocko/work/queue-219/run-4a9c-mos1408/single-cli-launcher.test.tap", "tmpdir": "/mnt/storage/scratch/tmp/rkqztfjx8"} +{"label": "single-cli-thread-launch.test", "args": ["timeout", "-k", "10", "300", "node", "--test-reporter=tap", "--test", "packages/cli/tests/thread-launch.test.mjs"], "start": "2026-10-23T06:10:12.637449+00:00", "end": "2026-10-23T06:10:30.695792+00:00", "seconds": 18.058, "exit": 1, "timeout": false, "counts": {"tests": 14, "pass": 13, "fail": 1, "cancelled": 0, "skipped": 0}, "skips": ["# skipped 0"], "log": "agents/rocko/work/queue-219/run-4a9c-mos1408/single-cli-thread-launch.test.tap", "tmpdir": "/mnt/storage/scratch/tmp/rbyz9a6iu"} diff --git a/agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-creative.test.tap b/agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-creative.test.tap index c397aec5c..978d05307 100644 --- a/agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-creative.test.tap +++ b/agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-creative.test.tap @@ -4,25 +4,25 @@ TAP version 13 # Subtest: M6: a creative raise refuses decision-not-allowed, cited or not, and no decision row appears; the assistant still raises ok 1 - M6: a creative raise refuses decision-not-allowed, cited or not, and no decision row appears; the assistant still raises --- - duration_ms: 37.235384 + duration_ms: 43.416235 type: 'test' ... # Subtest: a creative instance sends only to the user and hears only from the user ok 2 - a creative instance sends only to the user and hears only from the user --- - duration_ms: 44.266739 + duration_ms: 43.274527 type: 'test' ... # Subtest: M10 through the broker: the chief and the tester are refused on bean, the human's limits.set of its models key works ok 3 - M10 through the broker: the chief and the tester are refused on bean, the human's limits.set of its models key works --- - duration_ms: 83.079495 + duration_ms: 76.669863 type: 'test' ... # Subtest: row 256 T6 the human deletes a creative instance through the broker; the chief and the tester are refused at the verb ok 4 - row 256 T6 the human deletes a creative instance through the broker; the chief and the tester are refused at the verb --- - duration_ms: 63.576082 + duration_ms: 60.418493 type: 'test' ... 1..4 @@ -33,4 +33,4 @@ ok 4 - row 256 T6 the human deletes a creative instance through the broker; the # cancelled 0 # skipped 0 # todo 0 -# duration_ms 356.82109 +# duration_ms 374.784911 diff --git a/agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-threads.test.tap b/agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-threads.test.tap index 99b713932..b05384a32 100644 --- a/agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-threads.test.tap +++ b/agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-threads.test.tap @@ -2,115 +2,115 @@ TAP version 13 # Subtest: REQ-ROLE-2 REQ-THREAD-1: one holder per thread, through the broker and the trigger ok 1 - REQ-ROLE-2 REQ-THREAD-1: one holder per thread, through the broker and the trigger --- - duration_ms: 37.957781 + duration_ms: 37.977187 type: 'test' ... # Subtest: REQ-ROLE-2 REQ-THREAD-1: the 3e triggers refuse writes that skip the broker ok 2 - REQ-ROLE-2 REQ-THREAD-1: the 3e triggers refuse writes that skip the broker --- - duration_ms: 68.301373 + duration_ms: 68.5376 type: 'test' ... # Subtest: REQ-MSG-1: a message to or from the assistant names its thread, or is refused ok 3 - REQ-MSG-1: a message to or from the assistant names its thread, or is refused --- - duration_ms: 31.316512 + duration_ms: 33.043064 type: 'test' ... # Subtest: REQ-MSG-1: the chief of staff's reply comes back to the thread that sent the work ok 4 - REQ-MSG-1: the chief of staff's reply comes back to the thread that sent the work --- - duration_ms: 593.922455 + duration_ms: 616.013932 type: 'test' ... # Subtest: REQ-MSG-1: a reply can't carry one thread instance's thread to another thread instance ok 5 - REQ-MSG-1: a reply can't carry one thread instance's thread to another thread instance --- - duration_ms: 24.857971 + duration_ms: 22.785202 type: 'test' ... # Subtest: REQ-THREAD-1 REQ-USER-2: one thread's messages never reach another thread's holder ok 6 - REQ-THREAD-1 REQ-USER-2: one thread's messages never reach another thread's holder --- - duration_ms: 27.519976 + duration_ms: 27.208648 type: 'test' ... # Subtest: REQ-LAUNCH-1: a message to a thread with no holder waits, and the next holder gets it ok 7 - REQ-LAUNCH-1: a message to a thread with no holder waits, and the next holder gets it --- - duration_ms: 30.716822 + duration_ms: 29.67741 type: 'test' ... # Subtest: REQ-THREAD-2 REQ-LAUNCH-1: threadIdle releases only a thread with nothing waiting, and only for its holder ok 8 - REQ-THREAD-2 REQ-LAUNCH-1: threadIdle releases only a thread with nothing waiting, and only for its holder --- - duration_ms: 33.754906 + duration_ms: 33.136315 type: 'test' ... # Subtest: REQ-THREAD-2 REQ-LAUNCH-1: a message delivered to a run that ended unread doesn't hold up the next holder ok 9 - REQ-THREAD-2 REQ-LAUNCH-1: a message delivered to a run that ended unread doesn't hold up the next holder --- - duration_ms: 29.046481 + duration_ms: 30.610794 type: 'test' ... # Subtest: REQ-ROLE-2 REQ-THREAD-1 Q169: a role.revoke the human approved ends every thread run of the assistant ok 10 - REQ-ROLE-2 REQ-THREAD-1 Q169: a role.revoke the human approved ends every thread run of the assistant --- - duration_ms: 26.449042 + duration_ms: 27.293744 type: 'test' ... # Subtest: Q169 REQ-USER-2: assistant.stop ends the human's own assistant thread runs, and only the human's ok 11 - Q169 REQ-USER-2: assistant.stop ends the human's own assistant thread runs, and only the human's --- - duration_ms: 38.524966 + duration_ms: 39.426851 type: 'test' ... # Subtest: REQ-USER-2: the human verbs refuse another owner's thread ok 12 - REQ-USER-2: the human verbs refuse another owner's thread --- - duration_ms: 28.558392 + duration_ms: 30.185753 type: 'test' ... # Subtest: REQ-THREAD-1: thread.create refuses when the business has no thread instance or more than one ok 13 - REQ-THREAD-1: thread.create refuses when the business has no thread instance or more than one --- - duration_ms: 23.166467 + duration_ms: 25.774336 type: 'test' ... # Subtest: REQ-ORG-2: projects and threads are named once, and the repo names a business project ok 14 - REQ-ORG-2: projects and threads are named once, and the repo names a business project --- - duration_ms: 28.154835 + duration_ms: 26.886111 type: 'test' ... # Subtest: REQ-THREAD-2: thread.messages returns the thread's history in pages and writes nothing ok 15 - REQ-THREAD-2: thread.messages returns the thread's history in pages and writes nothing --- - duration_ms: 86.802213 + duration_ms: 90.298865 type: 'test' ... # Subtest: project.create refuses a repository name without its matching repo before any write ok 16 - project.create refuses a repository name without its matching repo before any write --- - duration_ms: 15.244016 + duration_ms: 16.900927 type: 'test' ... # Subtest: project.create keeps unrelated names with and without a repository ok 17 - project.create keeps unrelated names with and without a repository --- - duration_ms: 11.57841 + duration_ms: 11.07789 type: 'test' ... # Subtest: C2-09a: explicit creative instances bind independent threads, default sessions and holders ok 18 - C2-09a: explicit creative instances bind independent threads, default sessions and holders --- - duration_ms: 46.82113 + duration_ms: 47.924595 type: 'test' ... # Subtest: C2-09a: explicit missing, non-thread and malformed selectors create no thread or session ok 19 - C2-09a: explicit missing, non-thread and malformed selectors create no thread or session --- - duration_ms: 20.263528 + duration_ms: 19.917458 type: 'test' ... 1..19 @@ -121,4 +121,4 @@ ok 19 - C2-09a: explicit missing, non-thread and malformed selectors create no t # cancelled 0 # skipped 0 # todo 0 -# duration_ms 1283.575562 +# duration_ms 1316.555344 diff --git a/agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-user-principal.test.tap b/agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-user-principal.test.tap index bffa47082..fa7fb3a32 100644 --- a/agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-user-principal.test.tap +++ b/agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-user-principal.test.tap @@ -2,139 +2,139 @@ TAP version 13 # Subtest: R3: bindUser binds a granted user and refuses one with no live grant ok 1 - R3: bindUser binds a granted user and refuses one with no live grant --- - duration_ms: 15.216913 + duration_ms: 14.967712 type: 'test' ... # Subtest: R3: a user named like the business human, the tester or a principal word is refused, whatever the grants say ok 2 - R3: a user named like the business human, the tester or a principal word is refused, whatever the grants say --- - duration_ms: 10.127905 + duration_ms: 10.570753 type: 'test' ... # Subtest: R3: each collaborator verb is allowed to a granted user ok 3 - R3: each collaborator verb is allowed to a granted user --- - duration_ms: 18.491408 + duration_ms: 20.155376 type: 'test' ... # Subtest: R3: every verb off the collaborator list refuses a user access-refused before its own checks ok 4 - R3: every verb off the collaborator list refuses a user access-refused before its own checks --- - duration_ms: 95.840429 + duration_ms: 102.151204 type: 'test' ... # Subtest: R3: task, web and host verbs refuse a user access-refused ok 5 - R3: task, web and host verbs refuse a user access-refused --- - duration_ms: 22.333602 + duration_ms: 23.297818 type: 'test' ... # Subtest: R3 leak: project.list shows granted projects only ok 6 - R3 leak: project.list shows granted projects only --- - duration_ms: 12.494935 + duration_ms: 13.028484 type: 'test' ... # Subtest: R3 leak: thread.create needs the project and the thread instance granted, and an ungranted id reads as one that does not exist ok 7 - R3 leak: thread.create needs the project and the thread instance granted, and an ungranted id reads as one that does not exist --- - duration_ms: 15.195921 + duration_ms: 17.131417 type: 'test' ... # Subtest: R3 leak: thread.list shows the user its own threads that are still granted, never others ok 8 - R3 leak: thread.list shows the user its own threads that are still granted, never others --- - duration_ms: 33.037437 + duration_ms: 34.619156 type: 'test' ... # Subtest: R3 leak: names shows granted instances only ok 9 - R3 leak: names shows granted instances only --- - duration_ms: 14.891286 + duration_ms: 15.416042 type: 'test' ... # Subtest: R3: thread.send is from user: and writes no human.input ok 10 - R3: thread.send is from user: and writes no human.input --- - duration_ms: 13.366772 + duration_ms: 13.82133 type: 'test' ... # Subtest: R3: a reply-chain message.send into another user thread is refused ok 11 - R3: a reply-chain message.send into another user thread is refused --- - duration_ms: 15.523733 + duration_ms: 15.982484 type: 'test' ... # Subtest: R3: the run reply to a user message reaches that user thread.messages, with no waiting and no notice ok 12 - R3: the run reply to a user message reaches that user thread.messages, with no waiting and no notice --- - duration_ms: 18.163702 + duration_ms: 19.055939 type: 'test' ... # Subtest: R3: a reply to: user without a matching in_reply_to is refused user-reply-required ok 13 - R3: a reply to: user without a matching in_reply_to is refused user-reply-required --- - duration_ms: 26.445744 + duration_ms: 28.510227 type: 'test' ... # Subtest: R3: a non-thread run, the human and the tester cannot send to: user ok 14 - R3: a non-thread run, the human and the tester cannot send to: user --- - duration_ms: 17.29104 + duration_ms: 18.072201 type: 'test' ... # Subtest: R3: a user thread run cannot message the owner, while its uncited gated raise reaches only the owner inbox, B9 ok 15 - R3: a user thread run cannot message the owner, while its uncited gated raise reaches only the owner inbox, B9 --- - duration_ms: 19.258704 + duration_ms: 20.4668 type: 'test' ... # Subtest: R3: a removed or expired grant refuses the next request access-revoked, and the file is read per request ok 16 - R3: a removed or expired grant refuses the next request access-revoked, and the file is read per request --- - duration_ms: 18.231409 + duration_ms: 17.954184 type: 'test' ... # Subtest: R3: a user refusal is recorded as action.refused by user: ok 17 - R3: a user refusal is recorded as action.refused by user: --- - duration_ms: 13.797301 + duration_ms: 15.466589 type: 'test' ... # Subtest: R3: a business with a role keyed user refuses invalid-business ok 18 - R3: a business with a role keyed user refuses invalid-business --- - duration_ms: 9.468564 + duration_ms: 10.080838 type: 'test' ... # Subtest: R3: name.set refuses the name user ok 19 - R3: name.set refuses the name user --- - duration_ms: 9.752458 + duration_ms: 10.585336 type: 'test' ... # Subtest: R3 r4: while halted, a granted user's thread.send refuses processing-halted and thread.messages still answers ok 20 - R3 r4: while halted, a granted user's thread.send refuses processing-halted and thread.messages still answers --- - duration_ms: 13.617784 + duration_ms: 14.198383 type: 'test' ... # Subtest: R3 r4: the chief's hire refuses an instance named user with the code it gives human and tester ok 21 - R3 r4: the chief's hire refuses an instance named user with the code it gives human and tester --- - duration_ms: 14.726171 + duration_ms: 16.565998 type: 'test' ... # Subtest: R3 r4: a non-function access throws before the store is read ok 22 - R3 r4: a non-function access throws before the store is read --- - duration_ms: 0.105564 + duration_ms: 0.139037 type: 'test' ... # Subtest: C2-09a: naming an instance cannot bypass its collaborator grant or disclose an ungranted project ok 23 - C2-09a: naming an instance cannot bypass its collaborator grant or disclose an ungranted project --- - duration_ms: 15.883063 + duration_ms: 17.431688 type: 'test' ... 1..23 @@ -145,4 +145,4 @@ ok 23 - C2-09a: naming an instance cannot bypass its collaborator grant or discl # cancelled 0 # skipped 0 # todo 0 -# duration_ms 523.149354 +# duration_ms 550.515661 diff --git a/agents/rocko/work/queue-219/run-4a9c-mos1408/single-cli-launcher.test.tap b/agents/rocko/work/queue-219/run-4a9c-mos1408/single-cli-launcher.test.tap index a43f32623..2ca5baf8a 100644 --- a/agents/rocko/work/queue-219/run-4a9c-mos1408/single-cli-launcher.test.tap +++ b/agents/rocko/work/queue-219/run-4a9c-mos1408/single-cli-launcher.test.tap @@ -2,102 +2,102 @@ TAP version 13 # Subtest: C2-04: launcher workspace clones code but never the library ok 1 - C2-04: launcher workspace clones code but never the library --- - duration_ms: 1444.885132 + duration_ms: 1386.548788 type: 'test' ... # Subtest: bus start --pm: the launcher instance (the chief of staff) runs under its own PID namespace, registered, with a manifest ok 2 - bus start --pm: the launcher instance (the chief of staff) runs under its own PID namespace, registered, with a manifest --- - duration_ms: 1312.408111 + duration_ms: 1321.365393 type: 'test' ... -# usage: {"event":"usage-unknown","business":"acme","run":"r910aab09c0d6","instance":"chief","turn":"368e3045-8783-47d3-8ae1-e429b321d9b1","source":"@none","code":"baseline-unknown"} -# usage: {"event":"usage-unknown","business":"acme","run":"r5bb5f0657d94","instance":"coder","turn":"3432d01f-ca94-4a5e-88d3-19588a40a81d","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"rfeb27e280740","instance":"chief","turn":"6c7140a2-fbf2-4eb5-aade-18915e5d6071","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r4d1379ff54ed","instance":"coder","turn":"0828e9f0-3389-4d81-b773-d33ac8ed9436","source":"@none","code":"baseline-unknown"} # Subtest: the chief of staff launches a coder through its launch tool; the coder answers; refusals name their code ok 3 - the chief of staff launches a coder through its launch tool; the coder answers; refusals name their code --- - duration_ms: 745.868459 + duration_ms: 729.440258 type: 'test' ... -# usage: {"event":"usage-unknown","business":"acme","run":"r0f3692812967","instance":"chief","turn":"3bd3e4d7-3af4-4a1c-99f1-a8f25b7ab1dd","source":"@none","code":"baseline-unknown"} -# usage: {"event":"usage-unknown","business":"acme","run":"re94397bc3680","instance":"pm","turn":"b2db478d-2905-49fd-a81a-0800643bed6a","source":"@none","code":"baseline-unknown"} -# usage: {"event":"usage-unknown","business":"acme","run":"r0f3692812967","instance":"chief","turn":"ac2aa380-f3a0-40d4-960f-a543acb8c431","source":"@none","code":"baseline-unknown"} -# usage: {"event":"usage-unknown","business":"acme","run":"re94397bc3680","instance":"pm","turn":"e8b5124b-591b-4d5b-829c-e944bb3e24bb","source":"@none","code":"baseline-unknown"} -# usage: {"event":"usage-unknown","business":"acme","run":"re94397bc3680","instance":"pm","turn":"6a6e1fa4-5182-42dc-bbc2-26f136eedee3","source":"@none","code":"baseline-unknown"} -# usage: {"event":"usage-unknown","business":"acme","run":"r0f3692812967","instance":"chief","turn":"54eb77b5-3880-4afb-9772-0b9d590eb328","source":"@none","code":"baseline-unknown"} -# usage: {"event":"usage-unknown","business":"acme","run":"re94397bc3680","instance":"pm","turn":"11fe8b92-1dae-416a-838b-ae305db74bc6","source":"@none","code":"baseline-unknown"} -# usage: {"event":"usage-unknown","business":"acme","run":"r0f3692812967","instance":"chief","turn":"68266357-b477-433c-99ed-f1af37143d91","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r6b4b3482e67f","instance":"chief","turn":"aa4f1c16-5525-464e-bf32-86dce3279b86","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r1c029998bdea","instance":"pm","turn":"9bcd06eb-6a90-41fb-80ae-56a32bc1c628","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r6b4b3482e67f","instance":"chief","turn":"8bbc58a8-f1e1-478c-957b-76e1d7d3a0d4","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r1c029998bdea","instance":"pm","turn":"e1f9e391-0762-4643-bdfb-737a3f75468c","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r1c029998bdea","instance":"pm","turn":"ee01381b-77c5-4737-9963-cc39bfcf3329","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r6b4b3482e67f","instance":"chief","turn":"48edb0d5-0ec4-4e59-9eae-4f767252eaf9","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r1c029998bdea","instance":"pm","turn":"837ddcc0-6e74-408d-a21f-aeefc287e380","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r6b4b3482e67f","instance":"chief","turn":"702b0c7b-18c4-4f01-b71b-29fdf5ae1d79","source":"@none","code":"baseline-unknown"} # Subtest: a launched pm's request_staff reaches the chief of staff; no other session has the tool and the launch limits still hold ok 4 - a launched pm's request_staff reaches the chief of staff; no other session has the tool and the launch limits still hold --- - duration_ms: 1245.265675 + duration_ms: 1260.785468 type: 'test' ... # Subtest: each launch makes sure the workspace has a clone of the project: cloned, fast-forwarded, or fetched and logged ok 5 - each launch makes sure the workspace has a clone of the project: cloned, fast-forwarded, or fetched and logged --- - duration_ms: 4072.119958 + duration_ms: 4079.777924 type: 'test' ... # Subtest: a role the broker says holds a merge decision gets land_work, its prompt line, its landing and the git socket; without it, none ok 6 - a role the broker says holds a merge decision gets land_work, its prompt line, its landing and the git socket; without it, none --- - duration_ms: 621.888037 + duration_ms: 602.445534 type: 'test' ... # Subtest: REQ-LAUNCH-1 the tick starts a listed merge decision holder once, with land_work, the Landing line and its landing turn; an unlisted holder starts nothing ok 7 - REQ-LAUNCH-1 the tick starts a listed merge decision holder once, with land_work, the Landing line and its landing turn; an unlisted holder starts nothing --- - duration_ms: 417.133166 + duration_ms: 401.42897 type: 'test' ... -# usage: {"event":"usage-unknown","business":"acme","run":"r8e91dd37dc4b","instance":"coder","turn":"a7b24e30-ac5e-47cf-a951-90cf0d948b4d","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r91e3ad863ad3","instance":"coder","turn":"b80d99c8-e809-4461-9c46-6b36ca47b775","source":"@none","code":"baseline-unknown"} # Subtest: a holder running since before the resolution is stopped once the broker releases it, land-relaunch, and the next tick starts it: landing turn first, then the message that waited ok 8 - a holder running since before the resolution is stopped once the broker releases it, land-relaunch, and the next tick starts it: landing turn first, then the message that waited --- - duration_ms: 730.904044 + duration_ms: 676.724798 type: 'test' ... # Subtest: a landing run that ended isn't started again for its decision, a spent decision starts nothing, and a new decision starts the holder ok 9 - a landing run that ended isn't started again for its decision, a spent decision starts nothing, and a new decision starts the holder --- - duration_ms: 698.470719 + duration_ms: 578.985078 type: 'test' ... # Subtest: after a restart, the new host's first tick starts a holder whose decision is still held ok 10 - after a restart, the new host's first tick starts a holder whose decision is still held --- - duration_ms: 920.432738 + duration_ms: 870.835521 type: 'test' ... # Subtest: a refused landing start is logged once per code with its decision, isn't a start, and the next tick with room starts the holder ok 11 - a refused landing start is logged once per code with its decision, isn't a start, and the next tick with room starts the holder --- - duration_ms: 641.309798 + duration_ms: 633.801547 type: 'test' ... # Subtest: a project clone that can't be made refuses checkout-failed, from --chief and from a session, with no run and no clone left ok 12 - a project clone that can't be made refuses checkout-failed, from --chief and from a session, with no run and no clone left --- - duration_ms: 267.647539 + duration_ms: 281.44642 type: 'test' ... # Subtest: a runner that stops at once ends its launch with the runner's reason ok 13 - a runner that stops at once ends its launch with the runner's reason --- - duration_ms: 332.423482 + duration_ms: 350.182818 type: 'test' ... # Subtest: a Claude Code launch with no session credential refuses before it starts ok 14 - a Claude Code launch with no session credential refuses before it starts --- - duration_ms: 181.931254 + duration_ms: 227.256782 type: 'test' ... # Subtest: a pi launch needs no session credential: pi logs in through its own ENV_ALLOW variables ok 15 - a pi launch needs no session credential: pi logs in through its own ENV_ALLOW variables --- - duration_ms: 315.27683 + duration_ms: 355.020473 type: 'test' ... # usage: {"event":"plugin-refused","kind":"harness","name":"down","code":"missing","message":"/mnt/storage/scratch/rocko-r219/packages/plugins/harness/down is missing","kept":[]} @@ -105,155 +105,126 @@ ok 15 - a pi launch needs no session credential: pi logs in through its own ENV_ # Subtest: row 65 a failed primary preflight launches the fallback on a fixture harness module, recording the route and the reason ok 16 - row 65 a failed primary preflight launches the fallback on a fixture harness module, recording the route and the reason --- - duration_ms: 353.028786 + duration_ms: 395.228029 type: 'test' ... # Subtest: a runner killed from the host ends its launch as killed, not failed ok 17 - a runner killed from the host ends its launch as killed, not failed --- - duration_ms: 375.548364 + duration_ms: 426.266157 type: 'test' ... # Subtest: a missing or failing bwrap refuses sandbox-unavailable before anything starts; there is no unconfined fallback ok 18 - a missing or failing bwrap refuses sandbox-unavailable before anything starts; there is no unconfined fallback --- - duration_ms: 187.871873 + duration_ms: 224.638023 type: 'test' ... # Subtest: row 64 a role skill that isn't enabled refuses skill-not-enabled, and one that isn't a plain directory skill-refused, before anything starts ok 19 - row 64 a role skill that isn't enabled refuses skill-not-enabled, and one that isn't a plain directory skill-refused, before anything starts --- - duration_ms: 187.807189 + duration_ms: 193.63499 type: 'test' ... # Subtest: row 213 a creative instance's persona is read from /personas: off its digest the launch fails with the mismatch as its reason -not ok 20 - row 213 a creative instance's persona is read from /personas: off its digest the launch fails with the mismatch as its reason +ok 20 - row 213 a creative instance's persona is read from /personas: off its digest the launch fails with the mismatch as its reason --- - duration_ms: 255.698016 + duration_ms: 276.964378 type: 'test' - location: '/mnt/storage/scratch/rocko-r219/packages/cli/tests/launcher.test.mjs:766:1' - failureType: 'testCodeFailure' - error: |- - Expected values to be strictly deep-equal: - + actual - expected - - [ - + 'compactions', - + undefined, - + 2 - - 'refused', - - 'launch-failed', - - 1 - ] - - code: 'ERR_ASSERTION' - name: 'AssertionError' - expected: - 0: 'refused' - 1: 'launch-failed' - 2: 1 - actual: - 0: 'compactions' - 2: 2 - operator: 'deepStrictEqual' - stack: |- - TestContext. (file:///mnt/storage/scratch/rocko-r219/packages/cli/tests/launcher.test.mjs:789:10) - process.processTicksAndRejections (node:internal/process/task_queues:104:5) - async Test.run (node:internal/test_runner/test:1409:7) - async Test.processPendingSubtests (node:internal/test_runner/test:974:7) ... # Subtest: row 64 on Claude Code a role skill that isn't enabled refuses the same way, before anything starts ok 21 - row 64 on Claude Code a role skill that isn't enabled refuses the same way, before anything starts --- - duration_ms: 194.030218 + duration_ms: 199.95263 type: 'test' ... -# usage: {"event":"usage-unknown","business":"acme","run":"r3715d40bd7fb","instance":"chief","turn":"4c85d22f-fdab-4ab7-ad8a-6b4c4d1fbf72","source":"@none","code":"baseline-unknown"} -# usage: {"event":"usage-unknown","business":"acme","run":"r16ae936abadf","instance":"coder","turn":"2c6b06f1-8f36-4261-81b7-2689b9bb7ff4","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r0292ea4215c0","instance":"chief","turn":"e2a42abe-43ec-4873-a349-c93850a0b2d1","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r0292ea4215c0","instance":"chief","turn":"b84fdcd2-08f1-4c7d-a1be-edf183ecf035","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"rb645b3bdbf17","instance":"coder","turn":"8c651e69-aef3-428e-9ecb-fa2c53e86f79","source":"@none","code":"baseline-unknown"} # Subtest: a real Claude Code coder's shell can't read a stand-in secret or anything else its sandbox doesn't hold ok 22 - a real Claude Code coder's shell can't read a stand-in secret or anything else its sandbox doesn't hold --- - duration_ms: 1456.773218 + duration_ms: 1419.59525 type: 'test' ... # Subtest: a host that died hard leaves its sessions to the next host, which kills them and ends their runs so the role can be launched again ok 23 - a host that died hard leaves its sessions to the next host, which kills them and ends their runs so the role can be launched again --- - duration_ms: 1063.59923 + duration_ms: 1046.224325 type: 'test' ... # Subtest: a host that died hard leaves its sessions to the next host, which finds one already exited (23) and ends their runs so the role can be launched again ok 24 - a host that died hard leaves its sessions to the next host, which finds one already exited (23) and ends their runs so the role can be launched again --- - duration_ms: 4016.888246 + duration_ms: 3988.178511 type: 'test' ... # Subtest: bus start --no-launch leaves an earlier host's live session alone: no signal, no end, sessions.json as it was ok 25 - bus start --no-launch leaves an earlier host's live session alone: no signal, no end, sessions.json as it was --- - duration_ms: 237.364574 + duration_ms: 242.392974 type: 'test' ... # Subtest: bus start --no-launch refuses every launch: the PM launch and a session's request, each logged, nothing spawned ok 26 - bus start --no-launch refuses every launch: the PM launch and a session's request, each logged, nothing spawned --- - duration_ms: 197.775267 + duration_ms: 218.198607 type: 'test' ... # Subtest: bus start --no-launch starts no thread tick; the same host with launches runs it ok 27 - bus start --no-launch starts no thread tick; the same host with launches runs it --- - duration_ms: 1181.987654 + duration_ms: 1199.857353 type: 'test' ... # Subtest: a malformed sessions.json refuses the host start with exit 3 and stays as it was ok 28 - a malformed sessions.json refuses the host start with exit 3 and stays as it was --- - duration_ms: 177.111363 + duration_ms: 181.02391 type: 'test' ... # Subtest: an over-long launch request is refused at once, not at the 10 s idle timeout ok 29 - an over-long launch request is refused at once, not at the 10 s idle timeout --- - duration_ms: 183.364128 + duration_ms: 181.674266 type: 'test' ... # Subtest: a launch client that never closes its side doesn't hold the host's close ok 30 - a launch client that never closes its side doesn't hold the host's close --- - duration_ms: 179.49662 + duration_ms: 183.632625 type: 'test' ... # Subtest: a runner that ignores SIGTERM is killed when the host closes ok 31 - a runner that ignores SIGTERM is killed when the host closes --- - duration_ms: 1352.083242 + duration_ms: 1365.88402 type: 'test' ... # Subtest: kill switch refuses chief and hire before launch work and a clear permits a later request ok 32 - kill switch refuses chief and hire before launch work and a clear permits a later request --- - duration_ms: 319.505559 + duration_ms: 334.261623 type: 'test' ... # Subtest: kill switch stops an actual managed namespace and records the halt reason without rewriting its bundle ok 33 - kill switch stops an actual managed namespace and records the halt reason without rewriting its bundle --- - duration_ms: 334.076309 + duration_ms: 337.104395 type: 'test' ... # Subtest: a launch waiting across halt and resume cannot use its stale admission ok 34 - a launch waiting across halt and resume cannot use its stale admission --- - duration_ms: 201.932098 + duration_ms: 194.683714 type: 'test' ... 1..34 # tests 34 # suites 0 -# pass 33 -# fail 1 +# pass 34 +# fail 0 # cancelled 0 # skipped 0 # todo 0 -# duration_ms 26522.233904 +# duration_ms 26492.10694 diff --git a/agents/rocko/work/queue-219/run-4a9c-mos1408/single-cli-thread-launch.test.tap b/agents/rocko/work/queue-219/run-4a9c-mos1408/single-cli-thread-launch.test.tap new file mode 100644 index 000000000..ca9bd70c9 --- /dev/null +++ b/agents/rocko/work/queue-219/run-4a9c-mos1408/single-cli-thread-launch.test.tap @@ -0,0 +1,122 @@ +TAP version 13 +# usage: {"event":"usage-unknown","business":"acme","run":"r2204f4cc976c","instance":"assistant","turn":"fdd36b75-12af-4495-ba60-8a2fdd991676","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r42619c482fdd","instance":"assistant","turn":"4a493440-df70-4de2-a9be-f31bb9efbe67","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r65dae8bd493b","instance":"assistant","turn":"2a27c708-e430-4bcc-82b5-67dc51173d46","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r4f264ceb0a50","instance":"assistant","turn":"dedfd89c-7a7a-4bb8-ba67-ca0e6a417ee8","source":"@none","code":"baseline-unknown"} +# Subtest: REQ-THREAD-2 REQ-LAUNCH-1 REQ-MSG-1 a thread message starts the thread's session, which stops when idle; its history survives the stop and a restart and no other thread sees it +ok 1 - REQ-THREAD-2 REQ-LAUNCH-1 REQ-MSG-1 a thread message starts the thread's session, which stops when idle; its history survives the stop and a restart and no other thread sees it + --- + duration_ms: 5837.256276 + type: 'test' + ... +# usage: {"event":"usage-unknown","business":"acme","run":"red085121d9a7","instance":"assistant","turn":"536c8b62-f126-4b17-a1f2-756e2aede65e","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"ree31908db53d","instance":"assistant","turn":"f23f7966-9c87-4d7b-9d9a-93211c1431c0","source":"@none","code":"baseline-unknown"} +# Subtest: REQ-THREAD-2 REQ-LAUNCH-1 a running thread counts against its model's limit and an idle-stopped one doesn't +ok 2 - REQ-THREAD-2 REQ-LAUNCH-1 a running thread counts against its model's limit and an idle-stopped one doesn't + --- + duration_ms: 1713.759995 + type: 'test' + ... +# usage: {"event":"usage-unknown","business":"acme","run":"r5c82fe368237","instance":"assistant","turn":"081a280e-73b4-48fc-89a9-688e73704186","source":"@none","code":"baseline-unknown"} +# Subtest: REQ-THREAD-2 REQ-LAUNCH-1 a turn longer than the idle time isn't stopped, and the thread idles out after it +ok 3 - REQ-THREAD-2 REQ-LAUNCH-1 a turn longer than the idle time isn't stopped, and the thread idles out after it + --- + duration_ms: 4442.41406 + type: 'test' + ... +# usage: {"event":"usage-unknown","business":"acme","run":"r008070c44356","instance":"assistant","turn":"3175be8d-24d9-4d46-b9fe-e08c8edd0a5e","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r008070c44356","instance":"assistant","turn":"961030fd-2dd3-4deb-a9be-f10af56ba7f7","source":"@none","code":"baseline-unknown"} +# Subtest: REQ-THREAD-2 REQ-LAUNCH-1 a message sent after the idle snapshot keeps the session, which answers it +ok 4 - REQ-THREAD-2 REQ-LAUNCH-1 a message sent after the idle snapshot keeps the session, which answers it + --- + duration_ms: 2897.279317 + type: 'test' + ... +# Subtest: REQ-ROLE-2 REQ-LAUNCH-1 a thread held by a run the launcher didn't start gets no second session +ok 5 - REQ-ROLE-2 REQ-LAUNCH-1 a thread held by a run the launcher didn't start gets no second session + --- + duration_ms: 79.744891 + type: 'test' + ... +# usage: {"event":"usage-unknown","business":"acme","run":"rf65e96bfb0f4","instance":"assistant","turn":"61a6ab74-b6bd-4274-a83e-0f8fb4f61a68","source":"@none","code":"baseline-unknown"} +# Subtest: REQ-LAUNCH-1 a thread run's session file has no landing, even when landHolders names its instance +ok 6 - REQ-LAUNCH-1 a thread run's session file has no landing, even when landHolders names its instance + --- + duration_ms: 374.600592 + type: 'test' + ... +# Subtest: REQ-LAUNCH-1 a run that ends without taking its thread's message isn't started again for that message +ok 7 - REQ-LAUNCH-1 a run that ends without taking its thread's message isn't started again for that message + --- + duration_ms: 232.164242 + type: 'test' + ... +# Subtest: REQ-THREAD-2 REQ-LAUNCH-1 a thread id that isn't a safe segment, or a thread of a non-thread instance, launches nothing +ok 8 - REQ-THREAD-2 REQ-LAUNCH-1 a thread id that isn't a safe segment, or a thread of a non-thread instance, launches nothing + --- + duration_ms: 226.367358 + type: 'test' + ... +# Subtest: REQ-THREAD-1 REQ-LAUNCH-1 the chief can't launch the assistant outside a thread +ok 9 - REQ-THREAD-1 REQ-LAUNCH-1 the chief can't launch the assistant outside a thread + --- + duration_ms: 78.315815 + type: 'test' + ... +# Subtest: C2-09a: fromSession refuses a creative instance outside a thread without a sandbox +ok 10 - C2-09a: fromSession refuses a creative instance outside a thread without a sandbox + --- + duration_ms: 74.784926 + type: 'test' + ... +# limits: {"event":"limit-reached","business":"acme","check":"token-limit","export":"mayLaunch","subject":{"instance":"assistant","provider":"zai","model":"claude-sonnet-5-5","account":null},"path":["tokens","instances","assistant"],"limit":0,"count":0,"unknownTurns":0} +# limits: {"event":"limit-reached","business":"acme","check":"token-limit","export":"mayLaunch","subject":{"instance":"assistant","provider":"zai","model":"claude-sonnet-5-5","account":null},"path":["tokens","instances","assistant"],"limit":0,"count":0,"unknownTurns":0} +# Subtest: REQ-LIMIT-3 REQ-LIMIT-4 a thread start whose instance is at its token limit is refused, logged once with the limit and the count +ok 11 - REQ-LIMIT-3 REQ-LIMIT-4 a thread start whose instance is at its token limit is refused, logged once with the limit and the count + --- + duration_ms: 192.227024 + type: 'test' + ... +# usage: {"event":"usage-unknown","business":"acme","run":"r3ffa99981f81","instance":"assistant","turn":"c194605d-1b92-488c-9afe-2599f205e80e","source":"@none","code":"baseline-unknown"} +# limits: {"event":"limit-reached","business":"acme","check":"token-limit","export":"mustStop","subject":{"instance":"assistant","provider":"zai","model":"claude-sonnet-5-5","account":null},"path":["tokens","instances","assistant"],"limit":0,"count":0,"unknownTurns":1} +# Subtest: REQ-LIMIT-4 a thread run at its token limit stops at the end of its turn: the reply lands, and the end record names the limit +ok 12 - REQ-LIMIT-4 a thread run at its token limit stops at the end of its turn: the reply lands, and the end record names the limit + --- + duration_ms: 346.819478 + type: 'test' + ... +# usage: {"event":"usage-unknown","business":"acme","run":"r013acfa3de9d","instance":"bean","turn":"26896136-02b5-4948-8c84-7e0be580c485","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r13746c56cf7b","instance":"chet","turn":"2a7d4bed-79e7-4b74-b602-c07fe90be87f","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r013acfa3de9d","instance":"bean","turn":"32222fad-092d-4ac9-b5de-d40de519bf82","source":"@none","code":"baseline-unknown"} +# Subtest: C2-09a: creative thread messages start distinct runs and keep each instance history separate +not ok 13 - C2-09a: creative thread messages start distinct runs and keep each instance history separate + --- + duration_ms: 746.425172 + type: 'test' + location: '/mnt/storage/scratch/rocko-r219/packages/cli/tests/thread-launch.test.mjs:463:1' + failureType: 'testCodeFailure' + error: "ENOENT: no such file or directory, open '/mnt/storage/scratch/tmp/rbyz9a6iu/mosaic-thread-Cgx1tR/data/threads/acme/0a27cae9-cdb8-436d-8cc8-a59b316577e9/session/history'" + code: 'ENOENT' + stack: |- + readFileSync (node:fs:621:20) + TestContext. (file:///mnt/storage/scratch/rocko-r219/packages/cli/tests/thread-launch.test.mjs:489:16) + async Test.run (node:internal/test_runner/test:1409:7) + async Test.processPendingSubtests (node:internal/test_runner/test:974:7) + ... +# usage: {"event":"usage-unknown","business":"acme","run":"rb9998f7e5721","instance":"bean","turn":"6c83f086-940d-43ab-8219-0ee1b9dd4c7d","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"rdf0bd4d3e49a","instance":"bean","turn":"663ed95c-c09b-4053-aeb7-1696b6acf272","source":"@none","code":"baseline-unknown"} +# Subtest: C2-09a: terminating one creative thread does not signal an unselected peer of the same instance +ok 14 - C2-09a: terminating one creative thread does not signal an unselected peer of the same instance + --- + duration_ms: 643.667218 + type: 'test' + ... +1..14 +# tests 14 +# suites 0 +# pass 13 +# fail 1 +# cancelled 0 +# skipped 0 +# todo 0 +# duration_ms 18010.958178 diff --git a/packages/cli/tests/thread-launch.test.mjs b/packages/cli/tests/thread-launch.test.mjs index 84f8ed088..fa3adb866 100644 --- a/packages/cli/tests/thread-launch.test.mjs +++ b/packages/cli/tests/thread-launch.test.mjs @@ -486,8 +486,10 @@ test('C2-09a: creative thread messages start distinct runs and keep each instanc assert.deepEqual((await send(bean, 'bean', 'Bean input')).before, []); assert.deepEqual((await send(chet, 'chet', 'Chet input')).before, []); assert.deepEqual((await send(bean, 'bean', 'Bean again')).before, ['Bean input']); - assert.equal(readFileSync(join(f.dataRoot, 'threads', 'acme', bean, 'session', 'history'), 'utf8'), 'Bean input\nBean again\n'); - assert.equal(readFileSync(join(f.dataRoot, 'threads', 'acme', chet, 'session', 'history'), 'utf8'), 'Chet input\n'); + assert.equal(readFileSync(join(f.dataRoot, 'threads', 'acme', bean, 'sessions', host.runtime.threadsState('acme').find(x => x.thread === bean).session, 'session', 'history'), 'utf8'), 'Bean input\nBean again\n'); + assert.equal(readFileSync(join(f.dataRoot, 'threads', 'acme', chet, 'sessions', host.runtime.threadsState('acme').find(x => x.thread === chet).session, 'session', 'history'), 'utf8'), 'Chet input\n'); + assert.equal(existsSync(join(f.dataRoot, 'threads', 'acme', bean, 'session')), false); + assert.equal(existsSync(join(f.dataRoot, 'threads', 'acme', chet, 'session')), false); const launches = launchLog(f).filter(row => row.event === 'launch'); assert.ok(launches.some(row => row.instance === 'bean' && row.thread === bean)); assert.ok(launches.some(row => row.instance === 'chet' && row.thread === chet)); From bfa421b6cd9b2b54d8da119e73b004aeafe606c3 Mon Sep 17 00:00:00 2001 From: Rocko Date: Fri, 23 Oct 2026 02:12:03 -0500 Subject: [PATCH 6/8] docs: record row 219 rebase after granted-user Console --- agents/rocko/work/queue-219/BUILD.md | 23 + agents/rocko/work/queue-219/base.txt | 2 +- agents/rocko/work/queue-219/build.patch | 12 +- .../work/queue-219/candidate-manifest.sha256 | 6 +- .../queue-219/r3/294-carry-patch-ids.json | 17 + agents/rocko/work/queue-219/r3/BUILD.md | 5 + agents/rocko/work/queue-219/r3/base.txt | 1 + agents/rocko/work/queue-219/r3/build.patch | 788 ++++++++++++++++++ .../queue-219/r3/candidate-manifest.sha256 | 14 + .../rocko/work/queue-219/r3/changed-paths.txt | 14 + agents/rocko/work/queue-219/r3/conflicts.txt | 1 + .../work/queue-219/r3/overlap-readers.json | 131 +++ .../work/queue-219/r3/path-patch-ids.json | 72 ++ agents/rocko/work/queue-219/r3/range-diff.txt | 14 + .../work/queue-219/r3/rebased-source-tip.txt | 1 + 15 files changed, 1091 insertions(+), 10 deletions(-) create mode 100644 agents/rocko/work/queue-219/r3/294-carry-patch-ids.json create mode 100644 agents/rocko/work/queue-219/r3/BUILD.md create mode 100644 agents/rocko/work/queue-219/r3/base.txt create mode 100644 agents/rocko/work/queue-219/r3/build.patch create mode 100644 agents/rocko/work/queue-219/r3/candidate-manifest.sha256 create mode 100644 agents/rocko/work/queue-219/r3/changed-paths.txt create mode 100644 agents/rocko/work/queue-219/r3/conflicts.txt create mode 100644 agents/rocko/work/queue-219/r3/overlap-readers.json create mode 100644 agents/rocko/work/queue-219/r3/path-patch-ids.json create mode 100644 agents/rocko/work/queue-219/r3/range-diff.txt create mode 100644 agents/rocko/work/queue-219/r3/rebased-source-tip.txt diff --git a/agents/rocko/work/queue-219/BUILD.md b/agents/rocko/work/queue-219/BUILD.md index c352659a3..5b5fd82bb 100644 --- a/agents/rocko/work/queue-219/BUILD.md +++ b/agents/rocko/work/queue-219/BUILD.md @@ -284,3 +284,26 @@ is refreshed to the same digest for the next claimant/review handoff. Local commit only; Dewey checks mos1420 items1-3 before push/restart, and Sage names a gap/CLEAR after294 round4. No runs after this edit. Any further red, including later lines in this test, returns to Mos through Sage. + +## Rebase round r3 after row294: sage-3250 / sage-3254 + +Rebased five commits from4a9c536e8..5f2ef92e5 onto +80793d824e05baaef4820f4be7790aba55971b6f, new branch +rocko/row219-on-80793d824. No conflicts and no manual product edits. +Row294's shared chat-http status refusals, chat owner-only channel-settings +transport, and serve's user rebinding/route fencing/static federation assets +remain. Row219 still forwards the selected instance over the bound caller; +its metadata route follows the listener/session bus after row294 rebinding. + +r3/range-diff.txt records all five pairs: four are '='; the first is '!' +only because createChat's surrounding signature now includes owner=null. +No hunk body changed. Per-path patch IDs and row294 carry delta IDs are in +r3/path-patch-ids.json and r3/294-carry-patch-ids.json; conflict list is empty. +r3/overlap-readers.json lists exact source readers and whole tests via their +test-helper import closure, refreshed on this base. Root and r3 manifest, +base and build.patch are refreshed. Old r2 packet is historical and unchanged. + +Dewey's checked mos1418 and mos1420 test edits stand; this handoff requests +rebase-only static review. No tests, Node, mutants, reader gate audit or push +performed while preparing this local rebase. Full no-carry restart waits for +Sage's CLEAR. Any new red returns to Mos through Sage before fixes. diff --git a/agents/rocko/work/queue-219/base.txt b/agents/rocko/work/queue-219/base.txt index 1d519a39a..f17c9be70 100644 --- a/agents/rocko/work/queue-219/base.txt +++ b/agents/rocko/work/queue-219/base.txt @@ -1 +1 @@ -4a9c536e861f1d9f9a018019b3ac4519d65eccf0 +80793d824e05baaef4820f4be7790aba55971b6f diff --git a/agents/rocko/work/queue-219/build.patch b/agents/rocko/work/queue-219/build.patch index b34097ed7..a78ae86b5 100644 --- a/agents/rocko/work/queue-219/build.patch +++ b/agents/rocko/work/queue-219/build.patch @@ -415,10 +415,10 @@ index 0d207a0a0..fa3adb866 100644 + assert.ok(readSessions(f.dataRoot).some(row => row.run === runs[1])); +}); diff --git a/packages/webui/src/chat-http.mjs b/packages/webui/src/chat-http.mjs -index c7770726d..396b42f3c 100644 +index 7980c1442..63d3ca974 100644 --- a/packages/webui/src/chat-http.mjs +++ b/packages/webui/src/chat-http.mjs -@@ -78,7 +78,8 @@ export async function chatHTTP(req, res, { path, search, chat, named, send, prev +@@ -80,7 +80,8 @@ export async function chatHTTP(req, res, { path, search, chat, named, send, prev (Object.hasOwn(v, 'repo') && (typeof v.repo !== 'string' || !KEY.test(v.repo)))) throw Error(); action = 'createProject'; args = v; } else if (path === '/api/chat/threads') { @@ -429,10 +429,10 @@ index c7770726d..396b42f3c 100644 } else if (match?.[2] === 'messages') { if (!exact(v, ['body']) || typeof v.body !== 'string' || !v.body.trim() || v.body.length > 32768) throw Error(); diff --git a/packages/webui/src/chat.mjs b/packages/webui/src/chat.mjs -index 018574ad4..65b89dab3 100644 +index 1b0a41dce..5a1ed8bf1 100644 --- a/packages/webui/src/chat.mjs +++ b/packages/webui/src/chat.mjs -@@ -20,7 +20,7 @@ export function createChat({ call }) { +@@ -25,7 +25,7 @@ export function createChat({ call, owner = null }) { projects: () => channel('project.list', {}), createProject: ({ name, repo }) => channel('project.create', { name, ...(repo === undefined ? {} : { repo }) }), threads: ({ project } = {}) => channel('thread.list', project === undefined ? {} : { project }), @@ -535,7 +535,7 @@ index a6b805c1b..15066bdc6 100644 } }); diff --git a/packages/webui/src/serve.mjs b/packages/webui/src/serve.mjs -index 288871d0c..d9d27a062 100644 +index cd51a0b6e..56fcdd4e1 100644 --- a/packages/webui/src/serve.mjs +++ b/packages/webui/src/serve.mjs @@ -8,6 +8,7 @@ import { BusReadError, busStatus as coreBusStatus, subjectOk, sendOutcome } from @@ -546,7 +546,7 @@ index 288871d0c..d9d27a062 100644 import { chatHTTP } from './chat-http.mjs'; import { processingHTTP } from './processing-http.mjs'; -@@ -705,6 +706,25 @@ export async function startServer({ host = '127.0.0.1', port = 7330, board = DEF +@@ -740,6 +741,25 @@ export async function startServer({ host = '127.0.0.1', port = 7330, board = DEF if (req.method !== 'POST') return json(res, 405, { error: 'method not allowed' }); return busSend(req, res, { send, preview: signer, log }); } diff --git a/agents/rocko/work/queue-219/candidate-manifest.sha256 b/agents/rocko/work/queue-219/candidate-manifest.sha256 index 841f95bd5..6a46760c2 100644 --- a/agents/rocko/work/queue-219/candidate-manifest.sha256 +++ b/agents/rocko/work/queue-219/candidate-manifest.sha256 @@ -5,10 +5,10 @@ de4913f50801a11fd172e3f2c2b3cb41ab04e84d32a6650d1c8662b5e227ea3d packages/bus/t b74275ce43249bafc97edc87a6a3aa0431c62fe1a28cd9fa265246e6d6da219b packages/cli/src/launcher.mjs 2c3f120dfdc0b52bf8ab38a88e86251be75d4b0d218e23df489dcaf815d6bc15 packages/cli/tests/launcher.test.mjs 7f308fdf601e839194f026beb3fea279eba1e356ce2756aa4a42fa4873b79b30 packages/cli/tests/thread-launch.test.mjs -cbfd54e6b375561d1e4679ee8d78a3285f970d9a7198cec9d22a06510a36afba packages/webui/src/chat-http.mjs -f49a49c6ec69783190d3f5eaf34316cb4d2c44d10d2ee9336fe1383207afefff packages/webui/src/chat.mjs +39c6d207e026debb7db8aade5534503847d0f5c84d560ba28f3cd65490378363 packages/webui/src/chat-http.mjs +77878dd33fd9e0381deb996969389dde21c109eaddf46a8a5c91907ec0dfe24e packages/webui/src/chat.mjs 8e89df5fe8a9da35de41b5968afc6efcd92503e92ef28c6f557bb5371d10d1a4 packages/webui/src/public/chat.js -a597cc4902a873fe15650dacfce14dbc897db26310a7b6a24c293287add946c8 packages/webui/src/serve.mjs +443c83debe21559de2e4a6bcc07514bce9bebe209df58b8011827fcc1cabd905 packages/webui/src/serve.mjs d918e5b061ced9db28337a9b02c7042f9ddafaf09f32affce9f51190c0cba93f packages/webui/tests/chat-browser.test.mjs 2bad14535372488de326b82b791b79a61e1a4ab839458535132958ef85b746eb packages/webui/tests/chat-instances.test.mjs 7779d33d5b1dd3fe183722d0f91ff1f71e741e113cf2d5ee407f3d26428fc162 packages/webui/tests/chat.test.mjs diff --git a/agents/rocko/work/queue-219/r3/294-carry-patch-ids.json b/agents/rocko/work/queue-219/r3/294-carry-patch-ids.json new file mode 100644 index 000000000..287a30ec8 --- /dev/null +++ b/agents/rocko/work/queue-219/r3/294-carry-patch-ids.json @@ -0,0 +1,17 @@ +[ + { + "path": "packages/webui/src/chat-http.mjs", + "baseDelta": "463a78d259c86d16e4c081bd2336f666477463b8", + "tipDelta": "463a78d259c86d16e4c081bd2336f666477463b8" + }, + { + "path": "packages/webui/src/chat.mjs", + "baseDelta": "8d90d1eac27308bd93f40c2c27ff9393c670a948", + "tipDelta": "8d90d1eac27308bd93f40c2c27ff9393c670a948" + }, + { + "path": "packages/webui/src/serve.mjs", + "baseDelta": "c4b842ace73a63a7ef91645d1e30f4610e69c928", + "tipDelta": "c4b842ace73a63a7ef91645d1e30f4610e69c928" + } +] diff --git a/agents/rocko/work/queue-219/r3/BUILD.md b/agents/rocko/work/queue-219/r3/BUILD.md new file mode 100644 index 000000000..2d512262f --- /dev/null +++ b/agents/rocko/work/queue-219/r3/BUILD.md @@ -0,0 +1,5 @@ +# Row219 rebase round r3 + +See ../BUILD.md rebase round section. Base80793d824; no conflicts. +Range-diff, per-path identities, row294 carry identities and exact test +reader inventory are adjacent. No tests run. Dewey checks rebase only. diff --git a/agents/rocko/work/queue-219/r3/base.txt b/agents/rocko/work/queue-219/r3/base.txt new file mode 100644 index 000000000..f17c9be70 --- /dev/null +++ b/agents/rocko/work/queue-219/r3/base.txt @@ -0,0 +1 @@ +80793d824e05baaef4820f4be7790aba55971b6f diff --git a/agents/rocko/work/queue-219/r3/build.patch b/agents/rocko/work/queue-219/r3/build.patch new file mode 100644 index 000000000..a78ae86b5 --- /dev/null +++ b/agents/rocko/work/queue-219/r3/build.patch @@ -0,0 +1,788 @@ +diff --git a/packages/bus/src/broker.mjs b/packages/bus/src/broker.mjs +index d76085739..11061c778 100644 +--- a/packages/bus/src/broker.mjs ++++ b/packages/bus/src/broker.mjs +@@ -4,7 +4,7 @@ import { initializeControl, processingStatus } from '../../processing-control/sr + import { NAME as HARNESS_NAME } from '../../plugins/src/kinds.mjs'; + import { loadRequirements } from '../../tasks/src/requirements.mjs'; + import { MERGE, LandingRefusal, readLanding } from './landing.mjs'; +-import { ID_PATTERN, THREAD_DEFINITION, END_PROTECTED, forkProblem, forkUrl, credentialKind, validArgv, commandAllowed, HOST_ID, CREATIVE_DEFINITIONS, unhireableAction, giteaName, parseGiteaUrl, covers } from '../../business/src/vocabulary.mjs'; ++import { ID_PATTERN, THREAD_DEFINITIONS, END_PROTECTED, forkProblem, forkUrl, credentialKind, validArgv, commandAllowed, HOST_ID, CREATIVE_DEFINITIONS, unhireableAction, giteaName, parseGiteaUrl, covers } from '../../business/src/vocabulary.mjs'; + + // Kept closed while S1 lands; its vocabulary is the integration authority. + export const ACTIONS = Object.freeze([ +@@ -314,7 +314,7 @@ const enrollBinding = (enroll) => ({ + }); + // r6 E3: the installer line's comment, then the tag's 32 hex digits. + const INSTALLER_COMMENT = 'mosaic-installer-'; +-// Row 121 (#1615): an instance of THREAD_DEFINITION (vocabulary.mjs since row 155) talks with the ++// Row 121 (#1615): an instance of THREAD_DEFINITIONS (vocabulary.mjs since row 213) talks with the + // user in threads. Its runs claim a thread, not the role, and every message to or from it names its + // thread (REQ-MSG-1). + // Row 146 (#1640): the sender of the bus's notice to launch.by. A role instance name matches the +@@ -598,7 +598,7 @@ export class Broker { + ); + } + #threaded(business, role) { +- return this.#business(business).roles[role]?.definition === THREAD_DEFINITION; ++ return THREAD_DEFINITIONS.includes(this.#business(business).roles[role]?.definition); + } + // Row 264a (#1769): a claim holds one session of a thread, and each session has its own holder. + #sessionHolder(session) { +@@ -6068,24 +6068,27 @@ export class Broker { + .all('SELECT id,at,name,repo FROM projects WHERE business=? ORDER BY seq', s.business) + .filter((p) => !s.user || this.#granted(s, 'project.list', p.id, null)); + } +- // A thread belongs to the user who made it and to the business's one thread instance. ++ // A thread belongs to the user who made it and to one declared thread instance. + // Row 177 (#1675): a tester's thread is owned by `tester`, so neither reaches the other's. + case 'thread.create': { + if (!s.tester && !s.user) this.#human(s); +- keys(a, ['project', 'name'], ['project', 'name']); ++ keys(a, ['project', 'name', 'instance'], ['project', 'name']); + if (!name(a.name)) fail('invalid-request'); ++ const instances = Object.keys(b.roles).filter((r) => this.#threaded(s.business, r)); ++ const instance = a.instance === undefined ++ ? (instances.length === 1 ? instances[0] : null) ++ : identifier(a.instance); + // FED R3 (design 3.5): a user's grant must cover the project and the thread instance, checked + // before the project is looked up, so an ungranted id reads the same whether it exists or not. + if (s.user) { +- const threaded = Object.keys(b.roles).filter((r) => this.#threaded(s.business, r)); +- if (threaded.length !== 1 || !this.#granted(s, 'thread.create', identifier(a.project), threaded[0])) fail('access-refused'); ++ if (!instance || !instances.includes(instance) || !this.#granted(s, 'thread.create', identifier(a.project), instance)) ++ fail('access-refused'); + } + if (!this.#store.get('SELECT 1 FROM projects WHERE id=? AND business=?', identifier(a.project), s.business)) + fail('project-not-found'); +- // The bus never picks between instances; the business file declares exactly one. +- const instances = Object.keys(b.roles).filter((r) => this.#threaded(s.business, r)); +- if (!instances.length) fail('thread-instance-missing'); +- if (instances.length > 1) fail('thread-instance-ambiguous'); ++ // The human selects an instance; omission is compatible only with one candidate. ++ if (!instances.length || (a.instance !== undefined && !instances.includes(instance))) fail('thread-instance-missing'); ++ if (a.instance === undefined && instances.length > 1) fail('thread-instance-ambiguous'); + if (this.#store.get('SELECT 1 FROM threads WHERE project=? AND name=?', a.project, a.name)) fail('thread-exists'); + const tid = randomUUID(); + this.#store.run( +@@ -6094,13 +6097,13 @@ export class Broker { + this.#now(), + s.business, + a.project, +- instances[0], ++ instance, + this.#owner(s), + a.name, + ); + // Row 264a (#1769, D3): every thread has a default session from the start. +- this.#newSession(s, { id: tid, business: s.business, instance: instances[0], owner: this.#owner(s) }, 'default', 'default', true); +- return { id: tid, instance: instances[0] }; ++ this.#newSession(s, { id: tid, business: s.business, instance, owner: this.#owner(s) }, 'default', 'default', true); ++ return { id: tid, instance }; + } + // Row 177 (#1675): each lists its own threads. The human's list leaves out the tester's, + // and the tester's lists only its own (row 175 listed it the business human's). +diff --git a/packages/bus/tests/creative.test.mjs b/packages/bus/tests/creative.test.mjs +index 6cfbf1cd6..6d421ba19 100644 +--- a/packages/bus/tests/creative.test.mjs ++++ b/packages/bus/tests/creative.test.mjs +@@ -44,15 +44,18 @@ function setup(t) { + const caps = {}; + caps.human = b.bindHuman({ business: 'demo', human: 'jason', via: 'cli', outsideAgent: true }); + const project = b.request(caps.human, { verb: 'project.create', args: { name: 'demo' } }).id; +- const thread = b.request(caps.human, { verb: 'thread.create', args: { project, name: 'main' } }).id; ++ const thread = b.request(caps.human, { verb: 'thread.create', args: { project, name: 'main', instance: 'assistant' } }).id; ++ const threads = { assistant: thread }; + for (const role of Object.keys(roles)) { +- caps[role] = b.bindLaunch({ business: 'demo', role, run: `${role}-run`, harness: 'pi', ...(role === 'assistant' ? { thread } : {}) }); ++ if (['bean', 'quill'].includes(role)) ++ threads[role] = b.request(caps.human, { verb: 'thread.create', args: { project, name: role, instance: role } }).id; ++ caps[role] = b.bindLaunch({ business: 'demo', role, run: `${role}-run`, harness: 'pi', ...(threads[role] ? { thread: threads[role] } : {}) }); + b.request(caps[role], { verb: 'role.claim' }); + } + caps.tester = b.bindTester({ business: 'demo' }); + const call = (who, verb, args = {}) => b.request(caps[who], { verb, args }); + const count = (sql) => store.get(sql).n; +- return { call, count, store }; ++ return { call, count, store, threads }; + } + + const raise = { action: 'policy.change', question: 'Change?', options: [{ key: 'yes', text: 'Yes' }, { key: 'no', text: 'No' }], recommendation: 'yes', blocking: false }; +@@ -72,7 +75,7 @@ test('M6: a creative raise refuses decision-not-allowed, cited or not, and no de + }); + + test('a creative instance sends only to the user and hears only from the user', (t) => { +- const { call, count } = setup(t); ++ const { call, count, threads } = setup(t); + for (const who of ['bean', 'quill']) { + call(who, 'message.send', { to: 'human', body: 'hello' }); + for (const to of ['chief', 'assistant', 'pm', 'bean', 'quill'].filter((n) => n !== who)) { +@@ -81,7 +84,7 @@ test('a creative instance sends only to the user and hears only from the user', + for (const from of ['chief', 'pm']) { + assert.throws(() => call(from, 'message.send', { to: who, body: 'hello' }), { code: 'message-sender-refused' }, `${from} to ${who}`); + } +- call('human', 'message.send', { to: who, body: 'hello' }); ++ call('human', 'thread.send', { thread: threads[who], body: 'hello' }); + } + assert.equal(count("SELECT count(*) n FROM messages WHERE from_role IN ('bean','quill')"), 2); + assert.equal(count("SELECT count(*) n FROM messages WHERE to_role IN ('bean','quill')"), 2); +diff --git a/packages/bus/tests/threads.test.mjs b/packages/bus/tests/threads.test.mjs +index 8b31da9f9..1410ec3fa 100644 +--- a/packages/bus/tests/threads.test.mjs ++++ b/packages/bus/tests/threads.test.mjs +@@ -601,3 +601,42 @@ test('project.create keeps unrelated names with and without a repository', t => + { id: linked.id, name: 'work', repo: 'stack' }, + ]); + }); ++ ++test('C2-09a: explicit creative instances bind independent threads, default sessions and holders', t => { ++ const creative = ['companion', 'ideas', 'research', 'proofreader', 'fact-checker', 'continuity']; ++ const extra = Object.fromEntries(creative.map((definition, i) => [`writer${i}`, { definition, authority: { withinRole: ['message.send'], crossRole: [] } }])); ++ const ctx = setup(t, demo({ roles: { ...roles, ...extra }, definitions: { ++ ...definitions, ...Object.fromEntries(creative.map(definition => [definition, { messaging: shipped(definition).messaging }])), ++ } })); ++ const project = ctx.call('human', 'project.create', { name: 'Writing' }).id; ++ assert.throws(() => ctx.call('human', 'thread.create', { project, name: 'ambiguous' }), { code: 'thread-instance-ambiguous' }); ++ for (const [instance, role] of Object.entries(extra)) { ++ const receipt = ctx.call('human', 'thread.create', { project, name: instance, instance }); ++ assert.equal(receipt.instance, instance); ++ assert.equal(ctx.store.get('SELECT instance FROM threads WHERE id=?', receipt.id).instance, instance); ++ assert.equal(ctx.store.get('SELECT instance FROM sessions WHERE thread=?', receipt.id).instance, instance); ++ ctx.launch(instance, instance, { thread: receipt.id }); ++ assert.equal(ctx.claim(instance).thread, receipt.id); ++ const sent = ctx.call('human', 'thread.send', { thread: receipt.id, body: `For ${instance}` }); ++ const read = ctx.call(instance, 'message.receive'); ++ assert.deepEqual(read.map(m => m.id), [sent.id], role.definition); ++ assert.equal(ctx.threadOf(sent.id), receipt.id); ++ assert.equal(ctx.store.get('SELECT count(*) n FROM role_claims WHERE role=?', instance).n, 0); ++ assert.throws(() => ctx.call('human', 'message.send', { to: instance, body: 'No implicit thread' }), ++ { code: 'thread-required-use-thread-send' }); ++ } ++ assert.equal(ctx.count('SELECT count(*) n FROM threads'), creative.length); ++}); ++ ++test('C2-09a: explicit missing, non-thread and malformed selectors create no thread or session', t => { ++ const ctx = setup(t); ++ const project = ctx.call('human', 'project.create', { name: 'Writing' }).id; ++ for (const instance of ['not-declared', 'pm', 'coder']) ++ assert.throws(() => ctx.call('human', 'thread.create', { project, name: instance, instance }), { code: 'thread-instance-missing' }); ++ for (const instance of [null, 7, {}, [], '', 'bad name']) ++ assert.throws(() => ctx.call('human', 'thread.create', { project, name: 'bad', instance }), { code: 'invalid-request' }); ++ assert.equal(ctx.count('SELECT count(*) n FROM threads'), 0); ++ assert.equal(ctx.count('SELECT count(*) n FROM sessions'), 0); ++ const legacy = ctx.call('human', 'thread.create', { project, name: 'Default' }); ++ assert.equal(legacy.instance, 'assistant'); ++}); +diff --git a/packages/bus/tests/user-principal.test.mjs b/packages/bus/tests/user-principal.test.mjs +index 4dcd1ebeb..8471ddf85 100644 +--- a/packages/bus/tests/user-principal.test.mjs ++++ b/packages/bus/tests/user-principal.test.mjs +@@ -23,7 +23,7 @@ const grant = (over = {}) => ({ + }); + + // `processing` stands in for the halt switch, as lifecycle-verbs.test.mjs's T15 does. +-function setup(t, { grants = [grant()], processing = null } = {}) { ++function setup(t, { grants = [grant()], processing = null, threadRoles = {} } = {}) { + const root = mkdtempSync(join(tmpdir(), 'bus-user-principal-')); + const store = new Store(root); + t.after(() => { +@@ -40,6 +40,7 @@ function setup(t, { grants = [grant()], processing = null } = {}) { + roles: { + chief: { definition: 'chief-of-staff', authority: { withinRole: ['message.send'], crossRole: [] } }, + assistant: { definition: 'assistant', authority: { withinRole: ['message.send'], crossRole: [] } }, ++ ...threadRoles, + }, + definitions: { 'chief-of-staff': {}, assistant: { messaging: shipped('assistant').messaging } }, + }, +@@ -394,3 +395,21 @@ test('R3 r4: the chief\'s hire refuses an instance named user with the code it g + test('R3 r4: a non-function access throws before the store is read', () => { + assert.throws(() => new Broker({ store: null, businesses: { demo: {} }, access: 'access.json' }), /access must be a function/); + }); ++ ++test('C2-09a: naming an instance cannot bypass its collaborator grant or disclose an ungranted project', t => { ++ const ctx = setup(t, { threadRoles: { bean: { definition: 'companion', authority: { withinRole: ['message.send'], crossRole: [] } } } }); ++ const project = ctx.call('human', 'project.create', { name: 'shared' }).id; ++ const privateProject = ctx.call('human', 'project.create', { name: 'private' }).id; ++ ctx.access.doc.grants = [grant({ projects: [project] })]; ++ ctx.user('alice'); ++ assert.equal(ctx.code('alice', 'thread.create', { project, name: 'blocked bean', instance: 'bean' }), 'access-refused'); ++ for (const id of [privateProject, '00000000-0000-4000-8000-000000000000']) ++ assert.equal(ctx.code('alice', 'thread.create', { project: id, name: 'blocked project', instance: 'assistant' }), 'access-refused'); ++ assert.equal(ctx.store.get('SELECT count(*) n FROM threads').n, 0); ++ const allowed = ctx.call('alice', 'thread.create', { project, name: 'assistant work', instance: 'assistant' }); ++ assert.equal(allowed.instance, 'assistant'); ++ ctx.access.doc.grants = [grant({ projects: [project], instances: ['bean'] })]; ++ const bean = ctx.call('alice', 'thread.create', { project, name: 'bean work', instance: 'bean' }); ++ assert.equal(bean.instance, 'bean'); ++ assert.equal(ctx.code('alice', 'thread.create', { project, name: 'old instance', instance: 'assistant' }), 'access-refused'); ++}); +diff --git a/packages/cli/src/launcher.mjs b/packages/cli/src/launcher.mjs +index bfe55b61e..d8248284c 100644 +--- a/packages/cli/src/launcher.mjs ++++ b/packages/cli/src/launcher.mjs +@@ -53,7 +53,7 @@ + // session.json names it as gitSocket. + // + // Thread sessions (row 121, #1615). A thread instance (an instance whose +-// role definition is the assistant) runs once per thread, never on its own: ++// role definition is in THREAD_DEFINITIONS) runs once per thread, never on its own: + // a launch from a session or --pm refuses thread-required. Every tick + // (threadTickMs) the host asks the broker for the business's threads + // (launch op threadsState) and: +@@ -139,6 +139,7 @@ import { createServer } from "node:net"; + import { chmodSync, existsSync, lstatSync, mkdirSync, readFileSync, renameSync, rmSync } from "node:fs"; + import { dirname, join, relative } from "node:path"; + import { configDir, loadBusiness, resolveInstance, systemVars } from "../../business/src/index.mjs"; ++import { THREAD_DEFINITIONS } from "../../business/src/vocabulary.mjs"; + import { limitHit } from "../../business/src/launch.mjs"; + import { BundleError, buildBundle, hasFallback, readSkills, sessionModel } from "../../harness/src/bundle.mjs"; + import { createLoader } from "../../plugins/src/loader.mjs"; +@@ -176,8 +177,6 @@ const STOP_TIMEOUT_MS = 30000; + const LINE_MAX = 4096; + // How often the host asks for the threads' state; a poll period, not a limit. + const THREAD_TICK_MS = 2000; +-// The broker's thread instance definition (packages/bus/src/broker.mjs). +-const THREAD_DEFINITION = "assistant"; + // Row 194: the broker's LIFECYCLE_REQUEST_MS. A regenerate's old run must be gone by then. + const LIFECYCLE_REQUEST_MS = 60000; + +@@ -331,7 +330,7 @@ export function createLauncher({ + try { b=loadBusiness(host.business,{dir:configDir(env),rolesDir:rolesDir(env)}); } catch(e){throw new Refusal("organization-refused",e.message);} + if (!b.launch) throw new Refusal("launch-not-configured", `business ${b.id} has no launch block`); + if (!(pm ? instance === b.launch.by : b.launch.instances.includes(instance) || (human && Object.hasOwn(b.roles, instance)))) throw new Refusal("instance-not-listed"); +- const threaded = b.roles[instance]?.definition === THREAD_DEFINITION; ++ const threaded = THREAD_DEFINITIONS.includes(b.roles[instance]?.definition); + if (threaded && !thread) throw new Refusal("thread-required", `${instance} runs only for a thread`); + if (!threaded && thread) throw new Refusal("thread-not-allowed", `${instance} isn't a thread instance`); + if (threaded && !session) throw new Refusal("session-required", `${instance} runs for one session of a thread`); +@@ -997,7 +996,7 @@ export function createLauncher({ + function ending(r) { + const runs = r.runs ?? []; + const at = Date.parse(r.at); +- const threaded = b.roles[r.instance]?.definition === THREAD_DEFINITION; ++ const threaded = THREAD_DEFINITIONS.includes(b.roles[r.instance]?.definition); + return registry.sessions.filter((s) => s.business === b.id && (runs.includes(s.run) || + (!threaded && s.instance === r.instance && (spawnedAt.get(s.run) ?? Date.parse(s.startedAt)) <= at))); + } +diff --git a/packages/cli/tests/launcher.test.mjs b/packages/cli/tests/launcher.test.mjs +index 2202c7753..baabd843e 100644 +--- a/packages/cli/tests/launcher.test.mjs ++++ b/packages/cli/tests/launcher.test.mjs +@@ -773,21 +773,34 @@ test("row 213 a creative instance's persona is read from /personas: o + const dir = join(given.root, "config", "personas", "acme"); + mkdirSync(dir, { recursive: true, mode: 0o700 }); + writeFileSync(join(dir, "bean.md"), "Not the pinned text.\n", { mode: 0o600 }); +- const { f, host, launcher } = await setup(t, undefined, given); +- // The chief of staff holds role.launch; a test chief session bound to this process asks. +- const chief = await host.bindLaunch({ business: "acme", role: "chief", run: "chief-test", harness: "pi", pid: process.pid, startTime: startTimeOf(process.pid) }); +- await new Client({ path: host.path, cap: chief.cap }).call("role.claim"); +- // The bundle's refusal comes back as launch-failed, as webPlan's does, with its reason in the log. +- assert.deepEqual(await launcher.fromSession(chief.cap, "bean"), { ok: false, error: "launch-failed" }); +- const [e] = log(f); +- assert.deepEqual([e.event, e.code, log(f).length], ["refused", "launch-failed", 1]); ++ // Row 219: creative instances launch from their thread, not from a chief's standalone request. ++ // The mismatch occurs before bindLaunch, so only the host's thread-state snapshot is a fixture. ++ const thread = 'persona-thread'; ++ const SESSION = 'persona-session'; ++ const { f, launcher } = await setup(t, undefined, given, { wrap: host => ({ ++ ...host, ++ op: message => message.op === 'threadsState' ++ ? Promise.resolve([{ thread, session: SESSION, instance: 'bean', holder: null, pending: 1 }]) ++ : host.op(message), ++ }) }); ++ // The thread path records row 270's run-start count before the bundle's persona refusal. ++ await launcher.tick(); ++ const runs = readdirSync(join(f.dataRoot, "launches", "acme")); ++ const entries = log(f); ++ assert.equal(entries.length, 2); ++ const { at, ...compactions } = entries[0]; ++ assert.deepEqual(compactions, { event: 'compactions', instance: 'bean', thread, session: SESSION, run: runs[0], count: 0, known: true, reason: null }); ++ const e = entries[1]; ++ assert.deepEqual([e.event, e.code], ["refused", "launch-failed"]); ++ assert.equal(e.thread, thread); + assert.equal(e.why, `instance bean: persona file ${join(dir, "bean.md")} isn't the file persona.sha256 names`); + assert.ok(!JSON.stringify(log(f)).includes("PERSONA-MARKER-d2")); + assert.deepEqual(readSessions(f.dataRoot), []); + // The run directory exists by then (BUILD.md residual); the persona is read before any bundle file. +- const runs = readdirSync(join(f.dataRoot, "launches", "acme")); + assert.equal(runs.length, 1); +- assert.deepEqual(readdirSync(join(f.dataRoot, "launches", "acme", runs[0])), ["session"]); ++ assert.deepEqual(readdirSync(join(f.dataRoot, "launches", "acme", runs[0])), []); ++ assert.equal(existsSync(join(f.dataRoot, "threads", "acme", thread, "sessions", SESSION, "session")), true); ++ assert.equal(existsSync(join(f.dataRoot, "threads", "acme", thread, "session")), false); + }); + + test("row 64 on Claude Code a role skill that isn't enabled refuses the same way, before anything starts", { timeout: 30000 }, async (t) => { +diff --git a/packages/cli/tests/thread-launch.test.mjs b/packages/cli/tests/thread-launch.test.mjs +index 0d207a0a0..fa3adb866 100644 +--- a/packages/cli/tests/thread-launch.test.mjs ++++ b/packages/cli/tests/thread-launch.test.mjs +@@ -396,6 +396,22 @@ test("REQ-THREAD-1 REQ-LAUNCH-1 the chief can't launch the assistant outside a t + assert.deepEqual(launchLog(f).map((e) => [e.event, e.instance, e.code]), [["refused", "assistant", "thread-required"]]); + }); + ++// Admission refuses before bundle construction or a sandbox is needed. ++test('C2-09a: fromSession refuses a creative instance outside a thread without a sandbox', { timeout: 30000 }, async t => { ++ const prepared = prepare(t, { edit: doc => { ++ doc.roles.bean = { ...doc.roles.assistant, definition: 'companion' }; ++ doc.launch.instances.push('bean'); ++ return doc; ++ } }); ++ const { f } = prepared; ++ const host = await start(t, prepared); ++ const chief = await host.host.bindLaunch({ business: 'acme', role: 'chief', run: 'chief-bean-refusal', harness: 'pi', pid: process.pid, startTime: startTimeOf(process.pid) }); ++ await new Client({ path: host.host.path, cap: chief.cap }).call('role.claim'); ++ assert.deepEqual(await host.launcher.fromSession(chief.cap, 'bean'), { ok: false, error: 'thread-required' }); ++ assert.deepEqual(readSessions(f.dataRoot), []); ++ assert.deepEqual(launchLog(f).map(e => [e.event, e.instance, e.code]), [['refused', 'bean', 'thread-required']]); ++}); ++ + // Row 125 (#1619, REQ-LIMIT-3, REQ-LIMIT-4): the token-limit check switched on, with the + // assistant's limit at 0, so it is at its limit before any turn. The real check runs through the + // bus's plug-in loader. +@@ -443,3 +459,73 @@ test("REQ-LIMIT-4 a thread run at its token limit stops at the end of its turn: + assert.deepEqual(threadRuns(f, A), []); + assert.equal(host.runtime.threadsState("acme").find((x) => x.thread === A).holder, null); + }); ++ ++test('C2-09a: creative thread messages start distinct runs and keep each instance history separate', { skip, timeout: 90000 }, async t => { ++ const prepared = prepare(t, { sonnet: 2, idle: 60, edit: doc => { ++ const vars = { ...doc.roles.assistant.vars }; ++ delete doc.roles.assistant; ++ doc.roles.bean = { definition: 'companion', vars: { ...vars } }; ++ doc.roles.chet = { definition: 'continuity', vars: { ...vars } }; ++ doc.launch.instances = ['coder', 'bean', 'chet']; ++ return doc; ++ } }); ++ const host = await start(t, prepared), { f } = prepared; ++ const project = host.call('project.create', { name: 'Writing' }).id; ++ const bean = host.call('thread.create', { project, name: 'Bean', instance: 'bean' }).id; ++ const chet = host.call('thread.create', { project, name: 'Chet', instance: 'chet' }).id; ++ const send = async (thread, instance, body) => { ++ const message = host.call('thread.send', { thread, body }); ++ const outcome = await until(() => host.call('thread.messages', { thread }).find(m => m.in_reply_to === message.id) || ++ launchLog(f).find(row => row.thread === thread && row.event === 'refused')); ++ assert.notEqual(outcome.event, 'refused', `creative thread launch refused: ${outcome.code}`); ++ const reply = outcome; ++ assert.equal(reply.from_role, instance); ++ assert.equal(reply.to_role, 'human'); ++ return JSON.parse(reply.body.match(/THREAD (\{.*\})/)[1]); ++ }; ++ assert.deepEqual((await send(bean, 'bean', 'Bean input')).before, []); ++ assert.deepEqual((await send(chet, 'chet', 'Chet input')).before, []); ++ assert.deepEqual((await send(bean, 'bean', 'Bean again')).before, ['Bean input']); ++ assert.equal(readFileSync(join(f.dataRoot, 'threads', 'acme', bean, 'sessions', host.runtime.threadsState('acme').find(x => x.thread === bean).session, 'session', 'history'), 'utf8'), 'Bean input\nBean again\n'); ++ assert.equal(readFileSync(join(f.dataRoot, 'threads', 'acme', chet, 'sessions', host.runtime.threadsState('acme').find(x => x.thread === chet).session, 'session', 'history'), 'utf8'), 'Chet input\n'); ++ assert.equal(existsSync(join(f.dataRoot, 'threads', 'acme', bean, 'session')), false); ++ assert.equal(existsSync(join(f.dataRoot, 'threads', 'acme', chet, 'session')), false); ++ const launches = launchLog(f).filter(row => row.event === 'launch'); ++ assert.ok(launches.some(row => row.instance === 'bean' && row.thread === bean)); ++ assert.ok(launches.some(row => row.instance === 'chet' && row.thread === chet)); ++ const chief = await host.host.bindLaunch({ business: 'acme', role: 'chief', run: 'chief-creative-test', harness: 'pi', pid: process.pid, startTime: startTimeOf(process.pid) }); ++ await new Client({ path: host.host.path, cap: chief.cap }).call('role.claim'); ++ assert.deepEqual(await host.launcher.fromSession(chief.cap, 'bean'), { ok: false, error: 'thread-required' }); ++}); ++ ++test('C2-09a: terminating one creative thread does not signal an unselected peer of the same instance', { skip, timeout: 90000 }, async t => { ++ const prepared = prepare(t, { sonnet: 2, idle: 60, edit: doc => { ++ doc.roles.bean = { ...doc.roles.assistant, definition: 'companion' }; ++ delete doc.roles.assistant; ++ doc.launch.instances = ['coder', 'bean']; ++ return doc; ++ } }); ++ let requests = []; ++ const host = await start(t, prepared, { ops: () => ({ ++ lifecycleRequests: () => requests, ++ lifecycleTake: () => ({ ...requests[0], go: true }), ++ lifecycleDone: () => { requests = []; return {}; }, ++ }) }); ++ const { f } = prepared; ++ const project = host.call('project.create', { name: 'Writing' }).id; ++ const threads = ['one', 'two'].map(name => host.call('thread.create', { project, name, instance: 'bean' }).id); ++ for (const thread of threads) { ++ const message = host.call('thread.send', { thread, body: 'Stay in this thread' }); ++ const outcome = await until(() => host.call('thread.messages', { thread }).find(row => row.in_reply_to === message.id) || ++ launchLog(f).find(row => row.thread === thread && row.event === 'refused')); ++ assert.notEqual(outcome.event, 'refused', `creative thread launch refused: ${outcome.code}`); ++ } ++ const runs = threads.map(thread => launchLog(f).find(row => row.thread === thread && row.event === 'launch').run); ++ requests = [{ request: 'one-thread-end', state: 'open', business: 'acme', action: 'lifecycle.end', ++ instance: 'bean', runs: [runs[0]], by: f.doc.human, at: new Date(Date.now() + 1000).toISOString() }]; ++ await host.launcher.tick(); ++ await until(() => launchLog(f).some(row => row.event === 'lifecycle-end' && row.run === runs[0])); ++ assert.deepEqual(launchLog(f).filter(row => row.event === 'lifecycle-end').map(row => row.run), [runs[0]]); ++ await until(() => !readSessions(f.dataRoot).some(row => row.run === runs[0])); ++ assert.ok(readSessions(f.dataRoot).some(row => row.run === runs[1])); ++}); +diff --git a/packages/webui/src/chat-http.mjs b/packages/webui/src/chat-http.mjs +index 7980c1442..63d3ca974 100644 +--- a/packages/webui/src/chat-http.mjs ++++ b/packages/webui/src/chat-http.mjs +@@ -80,7 +80,8 @@ export async function chatHTTP(req, res, { path, search, chat, named, send, prev + (Object.hasOwn(v, 'repo') && (typeof v.repo !== 'string' || !KEY.test(v.repo)))) throw Error(); + action = 'createProject'; args = v; + } else if (path === '/api/chat/threads') { +- if (!exact(v, ['project', 'name']) || !id(v.project) || !name(v.name)) throw Error(); ++ if (!exact(v, ['project', 'name', 'instance'], ['project', 'name']) || !id(v.project) || !name(v.name) || ++ (Object.hasOwn(v, 'instance') && (typeof v.instance !== 'string' || !KEY.test(v.instance)))) throw Error(); + action = 'createThread'; args = v; + } else if (match?.[2] === 'messages') { + if (!exact(v, ['body']) || typeof v.body !== 'string' || !v.body.trim() || v.body.length > 32768) throw Error(); +diff --git a/packages/webui/src/chat.mjs b/packages/webui/src/chat.mjs +index 1b0a41dce..5a1ed8bf1 100644 +--- a/packages/webui/src/chat.mjs ++++ b/packages/webui/src/chat.mjs +@@ -25,7 +25,7 @@ export function createChat({ call, owner = null }) { + projects: () => channel('project.list', {}), + createProject: ({ name, repo }) => channel('project.create', { name, ...(repo === undefined ? {} : { repo }) }), + threads: ({ project } = {}) => channel('thread.list', project === undefined ? {} : { project }), +- createThread: ({ project, name }) => channel('thread.create', { project, name }), ++ createThread: ({ project, name, instance }) => channel('thread.create', { project, name, ...(instance === undefined ? {} : { instance }) }), + messages: ({ thread, after, limit }) => channel('thread.messages', { thread, ...(after ? { after } : {}), limit }), + send: ({ thread, body }) => channel('thread.send', { thread, body, class: 'REQUEST' }), + open: ({ thread }) => channel('thread.open', { thread }), +diff --git a/packages/webui/src/public/chat.js b/packages/webui/src/public/chat.js +index a6b805c1b..15066bdc6 100644 +--- a/packages/webui/src/public/chat.js ++++ b/packages/webui/src/public/chat.js +@@ -14,7 +14,7 @@ + return states.get(id); + }; + const form = key => { +- if (!forms.has(key)) forms.set(key, { name: '', repo: '', receipt: '', pending: false }); ++ if (!forms.has(key)) forms.set(key, { name: '', repo: '', instance: '', instanceChosen: false, receipt: '', pending: false }); + return forms.get(key); + }; + class ChatError extends Error { +@@ -58,7 +58,11 @@ + function creation(kind, key) { + const f = form(key), project = kind === 'project'; + const repo = project && current.repos.length ? `` : ''; +- return `

New ${kind}

${repo}

${txt(f.receipt)}

`; ++ const choices = current.instances ?? []; ++ const picker = project ? '' : ``; ++ const unavailable = !project && (!!current.instanceError || !choices.some(row => row.instance === f.instance)); ++ const status = !project && current.instanceError ? current.instanceError : f.receipt || (!project && !choices.length ? 'No thread instances are configured.' : ''); ++ return `

New ${kind}

${repo}${picker}

${txt(status)}

`; + } + function threads(rows) { + return rows.length ? `
    ${rows.map(t => `
  • ${link('threads', t.id, t.name)} ${txt(t.instance)}
  • `).join('')}
` : '

No threads yet.

'; +@@ -106,7 +110,7 @@ + const f = document.getElementById(keep.field.id); + if (f && !f.disabled) { + f.focus({ preventScroll: true }); +- if (keep.field.start !== null) f.setSelectionRange(keep.field.start, keep.field.end); ++ if (keep.field.start != null && typeof f.setSelectionRange === 'function') f.setSelectionRange(keep.field.start, keep.field.end); + } + } else if (navigated) c.container.querySelector('h1')?.focus({ preventScroll: true }); + } +@@ -126,7 +130,7 @@ + paint(); return; + } + const old = current; +- current = { container, kind, id, canSend, projects: old?.projects ?? [], threads: old?.threads ?? [], repos: old?.repos ?? [], error: '', refused: false }; ++ current = { container, kind, id, canSend, projects: old?.projects ?? [], threads: old?.threads ?? [], repos: old?.repos ?? [], instances: old?.instances ?? [], instanceError: kind === 'project' ? 'Reading thread instances…' : '', error: '', refused: false }; + if (navigated || !old) container.innerHTML = '

Reading chat…

'; + try { + const s = kind === 'thread' ? state(id) : null; +@@ -147,6 +151,25 @@ + s.receipt = 'Message shown in this conversation.'; s.receiptId = null; + } + } ++ if (kind === 'project') { ++ try { ++ const listed = await request('instances', undefined, signal); ++ if (g !== generation || out()) return; ++ if (!listed.rows.every(row => typeof row?.instance === 'string' && /^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,159}$/.test(row.instance) && typeof row.name === 'string')) ++ throw new ChatError('invalid-response'); ++ current.instances = listed.rows; current.instanceError = ''; ++ const f = form(id); ++ if (f.instance && !listed.rows.some(row => row.instance === f.instance)) { ++ f.instance = ''; f.instanceChosen = true; ++ f.receipt = 'The selected instance is no longer available. Choose who this thread is with.'; ++ } ++ if (!f.instanceChosen && !f.instance && listed.rows.length === 1) f.instance = listed.rows[0].instance; ++ } catch (err) { ++ if (err.name === 'AbortError' || out() || g !== generation) return; ++ current.instances = []; ++ current.instanceError = "Couldn't read the thread instances; reload to try again"; ++ } ++ } + // Repository choices are optional metadata; an unavailable read must not block unlinked chat. + if (kind === 'list') { + try { +@@ -179,7 +202,11 @@ + if (!current || out()) return; + if (event.target.id === 'chat-body') state(current.id).draft = event.target.value; + const f = event.target.closest('.chat-create'); +- if (f && event.target.dataset.chatField) form(f.dataset.key)[event.target.dataset.chatField] = event.target.value; ++ if (f && event.target.dataset.chatField) { ++ const draft = form(f.dataset.key), field = event.target.dataset.chatField; ++ draft[field] = event.target.value; ++ if (field === 'instance') { draft.instanceChosen = true; draft.receipt = ''; paint(); } ++ } + }); + document.addEventListener('scroll', event => { + if (event.target.matches?.('.chat-log') && current?.kind === 'thread') { +@@ -232,7 +259,8 @@ + void write('send', id, { body: state(id).draft }, `threads/${id}/messages`); + } else if (event.target.classList.contains('chat-create')) { + const key = event.target.dataset.key, f = form(key), project = key === 'projects'; +- const value = project ? { name: f.name, ...(f.repo ? { repo: f.repo } : {}) } : { project: key, name: f.name }; ++ if (!project && (current.instanceError || !(current.instances ?? []).some(row => row.instance === f.instance))) return; ++ const value = project ? { name: f.name, ...(f.repo ? { repo: f.repo } : {}) } : { project: key, name: f.name, instance: f.instance }; + void write(project ? 'createProject' : 'createThread', key, value, project ? 'projects' : 'threads'); + } + }); +diff --git a/packages/webui/src/serve.mjs b/packages/webui/src/serve.mjs +index cd51a0b6e..56fcdd4e1 100644 +--- a/packages/webui/src/serve.mjs ++++ b/packages/webui/src/serve.mjs +@@ -8,6 +8,7 @@ import { BusReadError, busStatus as coreBusStatus, subjectOk, sendOutcome } from + // Row 176, sage-1111: HTTP-only tester refusals; the row-164 transport pin stays untouched. + const busStatus = code => ['tester-off', 'tester-required'].includes(code) ? 403 : coreBusStatus(code); + import { ReadError, readStatus, fieldTable } from './reads.mjs'; ++import { THREAD_DEFINITIONS } from '../../business/src/vocabulary.mjs'; + import { chatHTTP } from './chat-http.mjs'; + import { processingHTTP } from './processing-http.mjs'; + +@@ -740,6 +741,25 @@ export async function startServer({ host = '127.0.0.1', port = 7330, board = DEF + if (req.method !== 'POST') return json(res, 405, { error: 'method not allowed' }); + return busSend(req, res, { send, preview: signer, log }); + } ++ // Row 219: labels only, from this listener's own human or tester bus, after auth above. ++ if (path === '/api/chat/instances') { ++ if (req.method !== 'GET') return json(res, 405, { error: 'method-not-allowed' }); ++ if (search) return json(res, 400, { error: 'invalid-request' }); ++ if (!bus?.instances) return json(res, 503, { error: 'not-configured' }); ++ try { ++ const value = await bus.instances(); ++ if (!value || !value.instances || typeof value.instances !== 'object' || Array.isArray(value.instances)) ++ throw new BusReadError('invalid-response'); ++ const rows = Object.entries(value.instances) ++ .filter(([, entry]) => THREAD_DEFINITIONS.includes(entry?.definition)) ++ .map(([instance, entry]) => ({ instance, name: entry.vars?.['persona.name'] || instance })); ++ if (rows.some(row => typeof row.name !== 'string')) throw new BusReadError('invalid-response'); ++ return json(res, 200, { rows, at: new Date().toISOString() }); ++ } catch (err) { ++ const code = err instanceof BusReadError ? err.code : 'invalid-response'; ++ return json(res, busStatus(code), { error: code }); ++ } ++ } + if (path === '/api/chat' || path.startsWith('/api/chat/')) { + return chatHTTP(req, res, { path, search, chat, named, send, preview: writer, log }); + } +diff --git a/packages/webui/tests/chat-browser.test.mjs b/packages/webui/tests/chat-browser.test.mjs +index f3eeeca96..cc3ec093d 100644 +--- a/packages/webui/tests/chat-browser.test.mjs ++++ b/packages/webui/tests/chat-browser.test.mjs +@@ -12,6 +12,7 @@ const HOSTILE = '\u001b[31m\u202eevil'; + const stub = `(() => { + const real = fetch.bind(window); + window.__writes=[];window.__reads=[];window.__answers=[];window.__pages=[]; ++ window.__instances=[{instance:'assistant',name:'assistant'}]; + window.__projects=[{id:'${P}', name:${JSON.stringify(HOSTILE)}, repo:null},{id:'\">',name:'Invalid record'}]; + window.__threads=[{id:'${A}',project:'${P}',name:'alpha',instance:'assistant'}, {id:'${B}',project:'${P}',name:'beta',instance:'assistant'}]; + window.fetch=async (url,init={})=>{ +@@ -33,6 +34,7 @@ const stub = `(() => { + window.__reads.push(path); + if(window.__holdRead && path.includes(window.__holdRead)){window.__heldSignal=init.signal;await new Promise(r=>window.__releaseRead=r);} + if(window.__readFailure)return new Response(JSON.stringify({error:window.__readFailure}),{status:window.__readFailure==='thread-not-owned'?403:503}); ++ if(path==='/api/chat/instances')return window.__instanceFailure ? new Response(JSON.stringify({error:'not-configured'}),{status:503}) : data({rows:window.__instances}); + if(path==='/api/chat/projects')return data({rows:window.__projects}); + if(path.startsWith('/api/chat/threads')&&!path.includes('/messages'))return data({rows:window.__threads}); + if(window.__pages.length)return data(window.__pages.shift()); +@@ -82,7 +84,7 @@ test('chat browser: list/create named projects and threads, hostile labels inert + await b.evaluate(`window.__answers.push({body:{id:'${A}',instance:'assistant'}}),true`); + await click('#chat-thread-form button[type=submit]'); + await wait('document.querySelector("#chat-send-form")'); +- assert.deepEqual(await b.evaluate('window.__writes[1].body'), { project: P, name: 'named thread' }); ++ assert.deepEqual(await b.evaluate('window.__writes[1].body'), { project: P, name: 'named thread', instance: 'assistant' }); + assert.equal(await b.evaluate('window.__writes[1].path'), '/api/chat/threads'); + assert.equal(await b.evaluate('window.__writes.length'), 2); + }); +@@ -264,3 +266,65 @@ test('chat browser: a late project creation receipt cannot navigate away from an + assert.equal(await b.evaluate('location.hash'), '#/chat/threads/' + A); + assert.equal(await b.evaluate('document.querySelector("#chat-body").value'), 'stay in alpha'); + }); ++ ++test('C2-09a picker: no silent choice, duplicate hostile labels stay inert, selection survives refresh and reaches POST', async t => { ++ const { b, wait, set, click, refresh } = await setup(t); ++ await b.evaluate(`window.__instances=[{instance:'bean',name:${JSON.stringify(HOSTILE)}},{instance:'chet',name:${JSON.stringify(HOSTILE)}}];location.hash='#/chat/projects/${P}';true`); ++ await wait('document.querySelectorAll("#chat-instance option").length===3'); ++ assert.equal(await b.evaluate('document.querySelector("#chat-instance").value'), ''); ++ assert.equal(await b.evaluate('document.querySelector("#chat-instance").required'), true); ++ assert.equal(await b.evaluate('document.querySelector("#chat-thread-form button").disabled'), true); ++ const labels = await b.evaluate('[...document.querySelectorAll("#chat-instance option")].map(o=>o.textContent)'); ++ assert.match(labels[1], /\(bean\)/); ++ assert.match(labels[2], /\(chet\)/); ++ assert.doesNotMatch(labels.join(''), /[\u202a-\u202e\u2066-\u2069]/u); ++ assert.equal(await b.evaluate('!!document.querySelector("#chat-thread-form img")'), false); ++ assert.equal(await b.evaluate('window.injected'), undefined); ++ await set('#chat-thread-name', 'Bean discussion'); ++ await click('#chat-thread-form button'); ++ assert.equal(await b.evaluate('window.__writes.length'), 0); ++ await set('#chat-instance', 'bean'); ++ await refresh(); ++ assert.equal(await b.evaluate('document.querySelector("#chat-instance").value'), 'bean'); ++ assert.equal(await b.evaluate('document.querySelector("#chat-thread-name").value'), 'Bean discussion'); ++ assert.equal(await b.evaluate('document.querySelector("#chat-thread-form button").disabled'), false); ++ await b.evaluate(`window.__answers.push({body:{id:'${A}',instance:'bean'}});true`); ++ await click('#chat-thread-form button'); ++ await wait('window.__writes.length===1'); ++ assert.deepEqual(await b.evaluate('window.__writes[0]'), { path: '/api/chat/threads', body: { project: P, name: 'Bean discussion', instance: 'bean' }, redirect: 'manual' }); ++}); ++ ++test('C2-09a picker: metadata failure, empty set and removed pick explain disabled state and recover without switching', async t => { ++ const { b, wait, set, refresh } = await setup(t); ++ await b.evaluate(`window.__instanceFailure=true;location.hash='#/chat/projects/${P}';true`); ++ await wait('document.querySelector("#chat-thread-form") && !document.querySelector(".chat-loading")'); ++ assert.match(await b.evaluate('document.querySelector("#chat-thread-form [role=status]").textContent'), /read the thread instances/); ++ assert.equal(await b.evaluate('document.querySelector("#chat-thread-form button").disabled'), true); ++ await b.evaluate('window.__instanceFailure=false;window.__instances=[];true'); ++ await refresh(); ++ assert.match(await b.evaluate('document.querySelector("#chat-thread-form [role=status]").textContent'), /No thread instances/); ++ assert.equal(await b.evaluate('document.querySelector("#chat-thread-form button").disabled'), true); ++ await b.evaluate("window.__instances=[{instance:'bean',name:'Bean'},{instance:'chet',name:'Chet'}];true"); ++ await refresh(); ++ await set('#chat-instance', 'bean'); ++ await b.evaluate("window.__instances=[{instance:'chet',name:'Chet'}];true"); ++ await refresh(); ++ assert.equal(await b.evaluate('document.querySelector("#chat-instance").value'), ''); ++ assert.match(await b.evaluate('document.querySelector("#chat-thread-form [role=status]").textContent'), /no longer available/); ++ assert.equal(await b.evaluate('document.querySelector("#chat-thread-form button").disabled'), true); ++ await refresh(); ++ assert.equal(await b.evaluate('document.querySelector("#chat-instance").value'), '', 'another refresh must not silently select the one remaining instance'); ++ await set('#chat-instance', 'chet'); ++ assert.equal(await b.evaluate('document.querySelector("#chat-thread-form button").disabled'), false); ++}); ++ ++test('C2-09a picker: a single instance is chosen explicitly but read-only mode cannot create a thread', async t => { ++ const { b, wait } = await setup(t, '?readonly'); ++ await b.evaluate(`location.hash='#/chat/projects/${P}';true`); ++ await wait('document.querySelectorAll("#chat-instance option").length===2'); ++ assert.equal(await b.evaluate('document.querySelector("#chat-instance").value'), 'assistant'); ++ assert.equal(await b.evaluate('document.querySelector("#chat-instance").disabled'), true); ++ assert.equal(await b.evaluate('document.querySelector("#chat-thread-form button").disabled'), true); ++ assert.match(await b.evaluate('document.querySelector(".chat-area").textContent'), /only reads/); ++ assert.equal(await b.evaluate('window.__writes.length'), 0); ++}); +diff --git a/packages/webui/tests/chat-instances.test.mjs b/packages/webui/tests/chat-instances.test.mjs +new file mode 100644 +index 000000000..893c38f80 +--- /dev/null ++++ b/packages/webui/tests/chat-instances.test.mjs +@@ -0,0 +1,87 @@ ++import test from 'node:test'; ++import assert from 'node:assert/strict'; ++import { request } from 'node:http'; ++import { mkdtempSync, rmSync } from 'node:fs'; ++import { join } from 'node:path'; ++import { tmpdir } from 'node:os'; ++import { startServer } from '../src/serve.mjs'; ++import { startTesterSocket, TESTER_ORIGIN } from '../src/tester-socket.mjs'; ++import { close } from './fixture.mjs'; ++ ++const path = '/api/chat/instances'; ++const preview = { host: 'chat.example', header: 'x-user', user: 'jason' }; ++const snapshot = { ++ revision: 'a'.repeat(64), plugins: { private: 'do-not-project' }, ++ instances: { ++ assistant: { definition: 'assistant', vars: { model: 'private-model' } }, ++ bean: { definition: 'companion', vars: { 'persona.name': 'Bean', 'persona.sha256': 'private-hash' } }, ++ chet: { definition: 'continuity', vars: { 'persona.name': 'Bean', file: '/private/path' } }, ++ pm: { definition: 'pm', vars: { 'persona.name': 'Hidden PM' } }, ++ }, ++}; ++function get(server, { route = path, method = 'GET', headers = {} } = {}) { ++ const address = server.address(), unix = typeof address === 'string'; ++ return new Promise((resolve, reject) => { ++ const req = request({ ...(unix ? { socketPath: address } : { host: '127.0.0.1', port: address.port }), ++ path: route, method, headers: { host: unix ? new URL(TESTER_ORIGIN).host : preview.host, ...headers } }, res => { ++ let text = ''; ++ res.on('data', chunk => text += chunk); ++ res.on('end', () => resolve({ status: res.statusCode, text, value: JSON.parse(text) })); ++ }); ++ req.on('error', reject); req.end(); ++ }); ++} ++test('C2-09a metadata uses the human listener bus, projects labels only and refuses unauthenticated reads', async t => { ++ let calls = 0; ++ const server = await startServer({ port: 0, preview, bus: { instances: async () => { calls++; return snapshot; } } }); ++ t.after(() => close(server)); ++ const refused = await get(server); ++ assert.equal(refused.status, 401); ++ assert.equal(calls, 0); ++ const answer = await get(server, { headers: { 'x-user': 'jason' } }); ++ assert.equal(answer.status, 200); ++ assert.deepEqual(answer.value.rows, [{ instance: 'assistant', name: 'assistant' }, { instance: 'bean', name: 'Bean' }, { instance: 'chet', name: 'Bean' }]); ++ for (const row of answer.value.rows) assert.deepEqual(Object.keys(row).sort(), ['instance', 'name']); ++ assert.doesNotMatch(answer.text, /private|Hidden PM/); ++ assert.equal(calls, 1); ++ for (const options of [{ route: path + '?extra=1' }, { method: 'POST' }]) { ++ const result = await get(server, { ...options, headers: { 'x-user': 'jason' } }); ++ assert.ok([400, 405].includes(result.status)); ++ } ++ assert.equal(calls, 1, 'invalid metadata requests never call a bus'); ++}); ++test('C2-09a metadata uses the private tester listener own bus and no human transport', async t => { ++ const root = mkdtempSync(join(tmpdir(), 'chat219-')); t.after(() => rmSync(root, { recursive: true, force: true })); ++ let reads = 0; ++ const server = await startTesterSocket({ dataRoot: root, board: 'http://127.0.0.1:9', ++ bus: { instances: async () => { reads++; return { instances: { quill: { definition: 'proofreader', vars: { 'persona.name': 'Quill' } } } }; } } }); ++ t.after(() => close(server)); ++ const answer = await get(server); ++ assert.equal(answer.status, 200); ++ assert.deepEqual(answer.value.rows, [{ instance: 'quill', name: 'Quill' }]); ++ assert.equal(reads, 1); ++}); ++test('C2-09a metadata refuses missing or malformed reads and never echoes untrusted fields', async t => { ++ for (const bus of [null, { instances: async () => ({ instances: [] }) }, { instances: async () => { throw new Error('private-path'); } }]) { ++ const server = await startServer({ port: 0, preview, bus }); t.after(() => close(server)); ++ const answer = await get(server, { headers: { 'x-user': 'jason' } }); ++ assert.ok(answer.status >= 400); ++ assert.doesNotMatch(answer.text, /private-path/); ++ } ++}); ++ ++test('C2-09a metadata stays behind the SSO session check and a GET never refreshes session activity', async t => { ++ let session = null, reads = 0; ++ const touches = []; ++ const sso = { publicHost: 'sso-chat.example', publicOrigin: 'https://sso-chat.example', formTargets: () => [], ++ session: (_req, { touch }) => { touches.push(touch); return session; } }; ++ const server = await startServer({ port: 0, sso, bus: { instances: async () => { reads++; return snapshot; } } }); ++ t.after(() => close(server)); ++ const headers = { host: sso.publicHost }; ++ assert.equal((await get(server, { headers })).status, 401); ++ assert.equal(reads, 0); ++ session = { name: 'jason' }; ++ assert.equal((await get(server, { headers })).status, 200); ++ assert.equal(reads, 1); ++ assert.deepEqual(touches, [false, false]); ++}); +diff --git a/packages/webui/tests/chat.test.mjs b/packages/webui/tests/chat.test.mjs +index 8c11611cf..b47ecf1a7 100644 +--- a/packages/webui/tests/chat.test.mjs ++++ b/packages/webui/tests/chat.test.mjs +@@ -335,3 +335,21 @@ test('the chat seam names the transport it is given: the human one and the teste + assert.throws(() => createChat({}), { name: 'TypeError', message: 'chat needs a bus transport function' }); + assert.equal(typeof createChat({ call: async () => ({}) }).projects, 'function'); + }); ++ ++test('C2-09a createThread forwards an explicit instance through the existing channel', async t => { ++ const c = await setup(t); ++ c.state.answer = { id: T, instance: 'bean' }; ++ const answer = await c.get('/api/chat/threads', { method: 'POST', value: { project: P, name: 'Bean work', instance: 'bean' } }); ++ assert.equal(answer.status, 200); ++ assert.deepEqual(c.calls, [['thread.create', { project: P, name: 'Bean work', instance: 'bean' }]]); ++ assert.equal(answer.data.instance, 'bean'); ++}); ++test('C2-09a malformed instance and extra thread fields refuse before the channel write', async t => { ++ const c = await setup(t); ++ for (const value of [null, 7, {}, [], '', 'bad name', 'bean/../../other']) { ++ const answer = await c.get('/api/chat/threads', { method: 'POST', value: { project: P, name: 'work', instance: value } }); ++ assert.equal(answer.status, 400, JSON.stringify(value)); ++ } ++ assert.equal((await c.get('/api/chat/threads', { method: 'POST', value: { project: P, name: 'work', instance: 'bean', extra: true } })).status, 400); ++ assert.deepEqual(c.calls, []); ++}); diff --git a/agents/rocko/work/queue-219/r3/candidate-manifest.sha256 b/agents/rocko/work/queue-219/r3/candidate-manifest.sha256 new file mode 100644 index 000000000..6a46760c2 --- /dev/null +++ b/agents/rocko/work/queue-219/r3/candidate-manifest.sha256 @@ -0,0 +1,14 @@ +142a210882535108159e045c61be288bc8703910a8ee0169137bc1eb80baff64 packages/bus/src/broker.mjs +b0c66c8999b567896923f6c876911dba936c6eca1ccc7aaeada51369fd613594 packages/bus/tests/creative.test.mjs +de4913f50801a11fd172e3f2c2b3cb41ab04e84d32a6650d1c8662b5e227ea3d packages/bus/tests/threads.test.mjs +8f7d6745fffb2a0898ac80c012084ac48964748da6439a8c56facc6529ffb19b packages/bus/tests/user-principal.test.mjs +b74275ce43249bafc97edc87a6a3aa0431c62fe1a28cd9fa265246e6d6da219b packages/cli/src/launcher.mjs +2c3f120dfdc0b52bf8ab38a88e86251be75d4b0d218e23df489dcaf815d6bc15 packages/cli/tests/launcher.test.mjs +7f308fdf601e839194f026beb3fea279eba1e356ce2756aa4a42fa4873b79b30 packages/cli/tests/thread-launch.test.mjs +39c6d207e026debb7db8aade5534503847d0f5c84d560ba28f3cd65490378363 packages/webui/src/chat-http.mjs +77878dd33fd9e0381deb996969389dde21c109eaddf46a8a5c91907ec0dfe24e packages/webui/src/chat.mjs +8e89df5fe8a9da35de41b5968afc6efcd92503e92ef28c6f557bb5371d10d1a4 packages/webui/src/public/chat.js +443c83debe21559de2e4a6bcc07514bce9bebe209df58b8011827fcc1cabd905 packages/webui/src/serve.mjs +d918e5b061ced9db28337a9b02c7042f9ddafaf09f32affce9f51190c0cba93f packages/webui/tests/chat-browser.test.mjs +2bad14535372488de326b82b791b79a61e1a4ab839458535132958ef85b746eb packages/webui/tests/chat-instances.test.mjs +7779d33d5b1dd3fe183722d0f91ff1f71e741e113cf2d5ee407f3d26428fc162 packages/webui/tests/chat.test.mjs diff --git a/agents/rocko/work/queue-219/r3/changed-paths.txt b/agents/rocko/work/queue-219/r3/changed-paths.txt new file mode 100644 index 000000000..689c1cf8e --- /dev/null +++ b/agents/rocko/work/queue-219/r3/changed-paths.txt @@ -0,0 +1,14 @@ +packages/bus/src/broker.mjs +packages/bus/tests/creative.test.mjs +packages/bus/tests/threads.test.mjs +packages/bus/tests/user-principal.test.mjs +packages/cli/src/launcher.mjs +packages/cli/tests/launcher.test.mjs +packages/cli/tests/thread-launch.test.mjs +packages/webui/src/chat-http.mjs +packages/webui/src/chat.mjs +packages/webui/src/public/chat.js +packages/webui/src/serve.mjs +packages/webui/tests/chat-browser.test.mjs +packages/webui/tests/chat-instances.test.mjs +packages/webui/tests/chat.test.mjs diff --git a/agents/rocko/work/queue-219/r3/conflicts.txt b/agents/rocko/work/queue-219/r3/conflicts.txt new file mode 100644 index 000000000..262f06d3a --- /dev/null +++ b/agents/rocko/work/queue-219/r3/conflicts.txt @@ -0,0 +1 @@ +No conflicts. No manual resolutions or product edits. All five commits auto-rebased. diff --git a/agents/rocko/work/queue-219/r3/overlap-readers.json b/agents/rocko/work/queue-219/r3/overlap-readers.json new file mode 100644 index 000000000..768fed6ab --- /dev/null +++ b/agents/rocko/work/queue-219/r3/overlap-readers.json @@ -0,0 +1,131 @@ +{ + "method": "resolve literal relative import/URL/file paths in packages/*/tests/**/*.mjs; reverse test-helper dependency closure; no tests run", + "readers": { + "packages/webui/src/chat-http.mjs": { + "directModules": [ + "packages/webui/tests/chat.test.mjs" + ], + "wholeTestReaders": [ + "packages/webui/tests/chat.test.mjs" + ] + }, + "packages/webui/src/chat.mjs": { + "directModules": [ + "packages/webui/tests/channel-chat.test.mjs", + "packages/webui/tests/chat.test.mjs", + "packages/webui/tests/tester-fixture.mjs" + ], + "wholeTestReaders": [ + "packages/webui/tests/channel-chat.test.mjs", + "packages/webui/tests/chat.test.mjs", + "packages/webui/tests/proof-cli.test.mjs", + "packages/webui/tests/tester-browser.test.mjs", + "packages/webui/tests/tester-cli.test.mjs", + "packages/webui/tests/tester-listener.test.mjs" + ] + }, + "packages/webui/src/serve.mjs": { + "directModules": [ + "packages/webui/tests/agents-browser.test.mjs", + "packages/webui/tests/agents.test.mjs", + "packages/webui/tests/assistant.test.mjs", + "packages/webui/tests/board-held.test.mjs", + "packages/webui/tests/browser-edge.test.mjs", + "packages/webui/tests/bus-browser.test.mjs", + "packages/webui/tests/bus.test.mjs", + "packages/webui/tests/channel-chat.test.mjs", + "packages/webui/tests/chat-browser.test.mjs", + "packages/webui/tests/chat-instances.test.mjs", + "packages/webui/tests/chat.test.mjs", + "packages/webui/tests/discord.test.mjs", + "packages/webui/tests/docs-browser.test.mjs", + "packages/webui/tests/editor-browser.test.mjs", + "packages/webui/tests/fixture.mjs", + "packages/webui/tests/granted-user.test.mjs", + "packages/webui/tests/history-fixture.mjs", + "packages/webui/tests/instances-browser.test.mjs", + "packages/webui/tests/instances.test.mjs", + "packages/webui/tests/limits-browser.test.mjs", + "packages/webui/tests/limits-route.test.mjs", + "packages/webui/tests/messages.test.mjs", + "packages/webui/tests/preview.test.mjs", + "packages/webui/tests/processing-browser.test.mjs", + "packages/webui/tests/processing.test.mjs", + "packages/webui/tests/project-file.test.mjs", + "packages/webui/tests/proof.test.mjs", + "packages/webui/tests/reads.test.mjs", + "packages/webui/tests/relaunch.test.mjs", + "packages/webui/tests/return-flow.test.mjs", + "packages/webui/tests/routes-browser.test.mjs", + "packages/webui/tests/routes.test.mjs", + "packages/webui/tests/send-browser.test.mjs", + "packages/webui/tests/send.test.mjs", + "packages/webui/tests/serve.test.mjs", + "packages/webui/tests/settings-form.test.mjs", + "packages/webui/tests/settings-write.test.mjs", + "packages/webui/tests/shell.test.mjs", + "packages/webui/tests/sso-browser.test.mjs", + "packages/webui/tests/sso.test.mjs", + "packages/webui/tests/tester-listener.test.mjs", + "packages/webui/tests/thread-claims-browser.test.mjs", + "packages/webui/tests/thread-claims.test.mjs", + "packages/webui/tests/usage-browser.test.mjs", + "packages/webui/tests/usage.test.mjs", + "packages/webui/tests/views.test.mjs" + ], + "wholeTestReaders": [ + "packages/webui/tests/agents-browser.test.mjs", + "packages/webui/tests/agents.test.mjs", + "packages/webui/tests/assistant.test.mjs", + "packages/webui/tests/board-held.test.mjs", + "packages/webui/tests/browser-edge.test.mjs", + "packages/webui/tests/browser.test.mjs", + "packages/webui/tests/bus-browser.test.mjs", + "packages/webui/tests/bus.test.mjs", + "packages/webui/tests/channel-chat.test.mjs", + "packages/webui/tests/chat-browser.test.mjs", + "packages/webui/tests/chat-instances.test.mjs", + "packages/webui/tests/chat.test.mjs", + "packages/webui/tests/conversation.test.mjs", + "packages/webui/tests/discord.test.mjs", + "packages/webui/tests/docs-browser.test.mjs", + "packages/webui/tests/editor-browser.test.mjs", + "packages/webui/tests/editor.test.mjs", + "packages/webui/tests/granted-user.test.mjs", + "packages/webui/tests/history-return-flow.test.mjs", + "packages/webui/tests/instances-browser.test.mjs", + "packages/webui/tests/instances.test.mjs", + "packages/webui/tests/limits-browser.test.mjs", + "packages/webui/tests/limits-route.test.mjs", + "packages/webui/tests/messages.test.mjs", + "packages/webui/tests/preview.test.mjs", + "packages/webui/tests/processing-browser.test.mjs", + "packages/webui/tests/processing.test.mjs", + "packages/webui/tests/project-file.test.mjs", + "packages/webui/tests/proof-cli.test.mjs", + "packages/webui/tests/proof.test.mjs", + "packages/webui/tests/reads.test.mjs", + "packages/webui/tests/relaunch.test.mjs", + "packages/webui/tests/return-flow.test.mjs", + "packages/webui/tests/routes-browser.test.mjs", + "packages/webui/tests/routes.test.mjs", + "packages/webui/tests/send-browser.test.mjs", + "packages/webui/tests/send.test.mjs", + "packages/webui/tests/serve.test.mjs", + "packages/webui/tests/settings-form.test.mjs", + "packages/webui/tests/settings-write.test.mjs", + "packages/webui/tests/shell.test.mjs", + "packages/webui/tests/sso-browser.test.mjs", + "packages/webui/tests/sso.test.mjs", + "packages/webui/tests/tester-browser.test.mjs", + "packages/webui/tests/tester-cli.test.mjs", + "packages/webui/tests/tester-listener.test.mjs", + "packages/webui/tests/thread-claims-browser.test.mjs", + "packages/webui/tests/thread-claims.test.mjs", + "packages/webui/tests/usage-browser.test.mjs", + "packages/webui/tests/usage.test.mjs", + "packages/webui/tests/views.test.mjs" + ] + } + } +} diff --git a/agents/rocko/work/queue-219/r3/path-patch-ids.json b/agents/rocko/work/queue-219/r3/path-patch-ids.json new file mode 100644 index 000000000..0cabf51e3 --- /dev/null +++ b/agents/rocko/work/queue-219/r3/path-patch-ids.json @@ -0,0 +1,72 @@ +[ + { + "path": "packages/bus/src/broker.mjs", + "old": "34f42b312c3d4ae9a975c5d27214414606cb9154", + "new": "34f42b312c3d4ae9a975c5d27214414606cb9154" + }, + { + "path": "packages/bus/tests/creative.test.mjs", + "old": "69deed0c277da57ef36d09097f4164180e744960", + "new": "69deed0c277da57ef36d09097f4164180e744960" + }, + { + "path": "packages/bus/tests/threads.test.mjs", + "old": "83597aea2f53a587b338b32a8e25e9ddac427ca1", + "new": "83597aea2f53a587b338b32a8e25e9ddac427ca1" + }, + { + "path": "packages/bus/tests/user-principal.test.mjs", + "old": "2cb1ee6201051cb338fb67dd46700ec72f7b76a3", + "new": "2cb1ee6201051cb338fb67dd46700ec72f7b76a3" + }, + { + "path": "packages/cli/src/launcher.mjs", + "old": "ef04082e6e0ce574ca3af546871838ac34a5e5ee", + "new": "ef04082e6e0ce574ca3af546871838ac34a5e5ee" + }, + { + "path": "packages/cli/tests/launcher.test.mjs", + "old": "4449e824038428b8dd4e5c299cc126ab1e842b58", + "new": "4449e824038428b8dd4e5c299cc126ab1e842b58" + }, + { + "path": "packages/cli/tests/thread-launch.test.mjs", + "old": "0fef61471873c35652605168dedd7dcd22cb4944", + "new": "0fef61471873c35652605168dedd7dcd22cb4944" + }, + { + "path": "packages/webui/src/chat-http.mjs", + "old": "ccf9e56879a90656c7061ce0d614bfaaf04987ba", + "new": "ccf9e56879a90656c7061ce0d614bfaaf04987ba" + }, + { + "path": "packages/webui/src/chat.mjs", + "old": "bf9a23689c99dea25cbfbac33d84f7074aaf40e1", + "new": "bf9a23689c99dea25cbfbac33d84f7074aaf40e1" + }, + { + "path": "packages/webui/src/public/chat.js", + "old": "f114af96936122f620ebf0a561e3a41a0ff6c955", + "new": "f114af96936122f620ebf0a561e3a41a0ff6c955" + }, + { + "path": "packages/webui/src/serve.mjs", + "old": "c3ec7940dfbdea4a5ca6865898581b2856c4b11a", + "new": "c3ec7940dfbdea4a5ca6865898581b2856c4b11a" + }, + { + "path": "packages/webui/tests/chat-browser.test.mjs", + "old": "8cb7a6270bc8c0f2191caae713842609df0deb92", + "new": "8cb7a6270bc8c0f2191caae713842609df0deb92" + }, + { + "path": "packages/webui/tests/chat-instances.test.mjs", + "old": "8018efd8ad48108293e41b77fc6c786500ef2471", + "new": "8018efd8ad48108293e41b77fc6c786500ef2471" + }, + { + "path": "packages/webui/tests/chat.test.mjs", + "old": "acb49d2d659373b56409cf144f56fe6c29ffdac5", + "new": "acb49d2d659373b56409cf144f56fe6c29ffdac5" + } +] diff --git a/agents/rocko/work/queue-219/r3/range-diff.txt b/agents/rocko/work/queue-219/r3/range-diff.txt new file mode 100644 index 000000000..40bf1c3ad --- /dev/null +++ b/agents/rocko/work/queue-219/r3/range-diff.txt @@ -0,0 +1,14 @@ +1: d5bf46ecf ! 1: 268835a99 wip: publish unverified row 219 inspection candidate + @@ packages/webui/src/chat-http.mjs: export async function chatHTTP(req, res, { pat + if (!exact(v, ['body']) || typeof v.body !== 'string' || !v.body.trim() || v.body.length > 32768) throw Error(); + + ## packages/webui/src/chat.mjs ## + -@@ packages/webui/src/chat.mjs: export function createChat({ call }) { + +@@ packages/webui/src/chat.mjs: export function createChat({ call, owner = null }) { + projects: () => channel('project.list', {}), + createProject: ({ name, repo }) => channel('project.create', { name, ...(repo === undefined ? {} : { repo }) }), + threads: ({ project } = {}) => channel('thread.list', project === undefined ? {} : { project }), +2: c7bf3622d = 2: 994860e70 docs: rebase row 219 gate packet and record run bounds +3: b97a3ff97 = 3: 0e040cf94 test: give row 219 persona fixture its explicit session +4: 7cbd839d0 = 4: 30cf10301 test: pin the compaction audit before the persona refusal +5: 5f2ef92e5 = 5: 28bf34f27 test: assert creative history in its native session store diff --git a/agents/rocko/work/queue-219/r3/rebased-source-tip.txt b/agents/rocko/work/queue-219/r3/rebased-source-tip.txt new file mode 100644 index 000000000..f48639cd7 --- /dev/null +++ b/agents/rocko/work/queue-219/r3/rebased-source-tip.txt @@ -0,0 +1 @@ +28bf34f272ec8e0ad0f7155556d2c92cdb3dd5be From 7e70de9e68ba48d761a45894d037239b5d576a38 Mon Sep 17 00:00:00 2001 From: Rocko Date: Fri, 23 Oct 2026 03:25:41 -0500 Subject: [PATCH 7/8] test: prepare row 219 admission pins under mos-1429 --- agents/rocko/work/queue-219/BUILD.md | 33 + .../queue-219/archive-before-mos1420.sha256 | 10 + agents/rocko/work/queue-219/build.patch | 48 +- .../work/queue-219/candidate-manifest.sha256 | 4 +- agents/rocko/work/queue-219/changed-paths.txt | 2 + agents/rocko/work/queue-219/mutants.json | 10 +- .../rocko/work/queue-219/prepare-mutants.py | 3 +- agents/rocko/work/queue-219/r4/BUILD.md | 7 + .../rocko/work/queue-219/r4/SHORT-RUN-PLAN.md | 26 + .../work/queue-219/r4/approved-tests.diff | 52 + .../queue-219/r4/assertion-preservation.json | 46 + agents/rocko/work/queue-219/r4/base.txt | 1 + agents/rocko/work/queue-219/r4/build.patch | 832 +++ .../queue-219/r4/candidate-manifest.sha256 | 16 + .../rocko/work/queue-219/r4/changed-paths.txt | 16 + .../work/queue-219/r4/packet-manifest.sha256 | 8 + .../queue-219/rebase-294-reader-prep.json | 64 + .../cwd-sweep-final.json | 1 + .../cwd-sweep.json | 1 + .../head.json | 1 + .../network-cleanup.log | 2 + .../results.jsonl | 5 + .../single-bus-creative.test.tap | 36 + .../single-bus-threads.test.tap | 124 + .../single-bus-user-principal.test.tap | 148 + .../single-cli-launcher.test.tap | 230 + .../single-cli-thread-launch.test.tap | 122 + .../work/queue-219/run-4a9c-mos1408/head.json | 2 +- .../queue-219/run-4a9c-mos1408/results.jsonl | 14 +- .../single-bus-creative.test.tap | 10 +- .../single-bus-threads.test.tap | 40 +- .../single-bus-user-principal.test.tap | 48 +- .../single-cli-launcher.test.tap | 97 +- .../single-cli-thread-launch.test.tap | 77 +- .../single-webui-chat-browser.test.tap | 94 + .../single-webui-chat-instances.test.tap | 34 + .../single-webui-chat.test.tap | 160 + .../queue-219/run-4a9c-mos1408/suite-bus.tap | 5363 +++++++++++++++++ packages/bus/tests/grant-executor.test.mjs | 5 +- packages/bus/tests/project-runtime.test.mjs | 3 +- packages/bus/tests/threads.test.mjs | 14 + 41 files changed, 7655 insertions(+), 154 deletions(-) create mode 100644 agents/rocko/work/queue-219/archive-before-mos1420.sha256 create mode 100644 agents/rocko/work/queue-219/r4/BUILD.md create mode 100644 agents/rocko/work/queue-219/r4/SHORT-RUN-PLAN.md create mode 100644 agents/rocko/work/queue-219/r4/approved-tests.diff create mode 100644 agents/rocko/work/queue-219/r4/assertion-preservation.json create mode 100644 agents/rocko/work/queue-219/r4/base.txt create mode 100644 agents/rocko/work/queue-219/r4/build.patch create mode 100644 agents/rocko/work/queue-219/r4/candidate-manifest.sha256 create mode 100644 agents/rocko/work/queue-219/r4/changed-paths.txt create mode 100644 agents/rocko/work/queue-219/r4/packet-manifest.sha256 create mode 100644 agents/rocko/work/queue-219/rebase-294-reader-prep.json create mode 100644 agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/cwd-sweep-final.json create mode 100644 agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/cwd-sweep.json create mode 100644 agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/head.json create mode 100644 agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/network-cleanup.log create mode 100644 agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/results.jsonl create mode 100644 agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/single-bus-creative.test.tap create mode 100644 agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/single-bus-threads.test.tap create mode 100644 agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/single-bus-user-principal.test.tap create mode 100644 agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/single-cli-launcher.test.tap create mode 100644 agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/single-cli-thread-launch.test.tap create mode 100644 agents/rocko/work/queue-219/run-4a9c-mos1408/single-webui-chat-browser.test.tap create mode 100644 agents/rocko/work/queue-219/run-4a9c-mos1408/single-webui-chat-instances.test.tap create mode 100644 agents/rocko/work/queue-219/run-4a9c-mos1408/single-webui-chat.test.tap create mode 100644 agents/rocko/work/queue-219/run-4a9c-mos1408/suite-bus.tap diff --git a/agents/rocko/work/queue-219/BUILD.md b/agents/rocko/work/queue-219/BUILD.md index 5b5fd82bb..52ac48112 100644 --- a/agents/rocko/work/queue-219/BUILD.md +++ b/agents/rocko/work/queue-219/BUILD.md @@ -307,3 +307,36 @@ Dewey's checked mos1418 and mos1420 test edits stand; this handoff requests rebase-only static review. No tests, Node, mutants, reader gate audit or push performed while preparing this local rebase. Full no-carry restart waits for Sage's CLEAR. Any new red returns to Mos through Sage before fixes. + +## Round r4: mos-1429 / sage-3291 old-test corrections, no runs yet + +bfa421 restart began08:08:37.137Z; eight whole files137/0/0, then bus +873/2/1 stopped08:10:07.389Z. Old failures: creative ops bound without a +thread in grant-executor's sage1908 test; project-runtime exact import pin +still singular THREAD_DEFINITION. Skip X-G3: no Docker/local Gitea image, +never pulls (Node stages used a dead Docker socket). No later stages ran. +Both Bean pins ran in the green thread-launch14/14; persona pin green34/34. +Returned slot with empty cwd sweep and14 hashes intact. No edit/retry before +Mos1429 approved the old-test changes. Original logs remain recorded. + +Only test changes: create a real project/thread on the restarted broker, +bind creative ops with it, preserve the host.run/refusal/request-count/sudo/ +record and restart lines byte-for-byte. Exact import pin singular->plural; +add one row219 comment, preserve all doesNotMatch checks. No product edit. +r4/assertion-preservation.json stores old/new text and preserved exact lines. + +No pre-existing bus test bound a creative role without a thread: condition6 +requires the new test in threads.test, covering all six creative definitions. +T01 retargets the old assistant-only #threaded mutant to this direct broker +pin; T24 drops only #hostAccess's creative guard and must fail the corrected +sage1908 assertion with ERR_ASSERTION. 24 mutants total;16 source/test paths, +10 whole changed test files. Source paths are the previous14 plus the two +old test files. New manifest round r4 and root snapshots match. + +Short slot plan: focused red sage1908 + exact import pin on detached bfa421, +then three whole green files (grant-executor, project-runtime, threads), +then T24 on fixed bytes (ERR_ASSERTION required), restore/hash/sweep and +push only after authorized. Estimate3-5min. No tests/mutants/Node/push until +Sage CLEAR. Dewey delta review follows; later full no-carry restart includes +all10 changed files, bus/cli/webui, all10 shells, all24 mutants and reader +control/audit. Further old-test red stops and goes to Mos through Sage. diff --git a/agents/rocko/work/queue-219/archive-before-mos1420.sha256 b/agents/rocko/work/queue-219/archive-before-mos1420.sha256 new file mode 100644 index 000000000..f1ed12aa8 --- /dev/null +++ b/agents/rocko/work/queue-219/archive-before-mos1420.sha256 @@ -0,0 +1,10 @@ +4f53cda18c2baa0c0354bb5f9a3ecbe5ed12ab4d8e11ba873c2f11161202b945 agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/cwd-sweep-final.json +4f53cda18c2baa0c0354bb5f9a3ecbe5ed12ab4d8e11ba873c2f11161202b945 agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/cwd-sweep.json +e74678a27192b58709b8afa57536678fe295e99b8b8572d0e95a131ae9b50467 agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/head.json +e86cfe9d1e28b8b42e9ed47c1a5836e4f9f09e700dc892935d55092785ece429 agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/network-cleanup.log +43cdf39a98eb06d613c9582af1e97e7af472f20e01a1220aecbac456d795e1de agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/results.jsonl +135b478b49a54826c98988b53d8f80363a94926db70862f2af1abfff51f7874b agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/single-bus-creative.test.tap +25d69420f68d14affbf4c82b8018af46570b6110c4918fa4847010386ffdd6b2 agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/single-bus-threads.test.tap +742258172b7784d3d4fe3016d8917aa85d9b67c46b538bd35e75a2e7f8c4f419 agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/single-bus-user-principal.test.tap +0cbcf144198e971d8d41e3b0a3d5a80354333043316f2f1381ccd0f79bb92ac3 agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/single-cli-launcher.test.tap +cb8b0f9dd17acc515ad23f39c1a32e4a2fb021a8e87ccebc442e9e8d424d967e agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/single-cli-thread-launch.test.tap diff --git a/agents/rocko/work/queue-219/build.patch b/agents/rocko/work/queue-219/build.patch index a78ae86b5..a63ab7a28 100644 --- a/agents/rocko/work/queue-219/build.patch +++ b/agents/rocko/work/queue-219/build.patch @@ -126,11 +126,41 @@ index 6cfbf1cd6..6d421ba19 100644 } assert.equal(count("SELECT count(*) n FROM messages WHERE from_role IN ('bean','quill')"), 2); assert.equal(count("SELECT count(*) n FROM messages WHERE to_role IN ('bean','quill')"), 2); +diff --git a/packages/bus/tests/grant-executor.test.mjs b/packages/bus/tests/grant-executor.test.mjs +index e449b7d77..46235d16b 100644 +--- a/packages/bus/tests/grant-executor.test.mjs ++++ b/packages/bus/tests/grant-executor.test.mjs +@@ -1047,7 +1047,10 @@ test('sage-1908: once the agent of an applied grant is a creative role, host.run + const f = await setup(t); + assert.equal((await f.approve()).end.action, 'grant.applied'); + const r = await restart(t, f, creativeOps(f.business)); +- const cap = r.broker.bindLaunch({ business: 'demo', role: 'ops', run: 'ops-run', harness: 'pi', address: 'ops' }); ++ const human = r.broker.bindHuman({ business: 'demo', human: 'jason', via: 'cli', outsideAgent: true }); ++ const project = r.broker.request(human, { verb: 'project.create', args: { name: 'host grant check' } }).id; ++ const thread = r.broker.request(human, { verb: 'thread.create', args: { project, name: 'ops', instance: 'ops' } }).id; ++ const cap = r.broker.bindLaunch({ business: 'demo', role: 'ops', run: 'ops-run', harness: 'pi', address: 'ops', thread }); + r.broker.request(cap, { verb: 'role.claim' }); + const executor = hostExecutor({ credentials: r.credentials, root: join(f.dir, 'host-run') }); + const before = f.requests().length; +diff --git a/packages/bus/tests/project-runtime.test.mjs b/packages/bus/tests/project-runtime.test.mjs +index a6086e56c..7275ad902 100644 +--- a/packages/bus/tests/project-runtime.test.mjs ++++ b/packages/bus/tests/project-runtime.test.mjs +@@ -32,7 +32,8 @@ test('Broker keeps the sandbox client import closure: only the listed imports, n + // (#1692, D2.4) reads unhireableAction, the hire veto's action name. + // Row 236 (#1742, #436b) reads giteaName and parseGiteaUrl for the Gitea grant path. + // FED R3 r5 (row 274, #414) reads covers, a user's grant check, from it. +- "import { ID_PATTERN, THREAD_DEFINITION, END_PROTECTED, forkProblem, forkUrl, credentialKind, validArgv, commandAllowed, HOST_ID, CREATIVE_DEFINITIONS, unhireableAction, giteaName, parseGiteaUrl, covers } from '../../business/src/vocabulary.mjs';", ++ // Row 219 reads THREAD_DEFINITIONS from the same vocabulary for creative thread admission. ++ "import { ID_PATTERN, THREAD_DEFINITIONS, END_PROTECTED, forkProblem, forkUrl, credentialKind, validArgv, commandAllowed, HOST_ID, CREATIVE_DEFINITIONS, unhireableAction, giteaName, parseGiteaUrl, covers } from '../../business/src/vocabulary.mjs';", + ]); + assert.doesNotMatch(source, /\bimport\s*\(/); + assert.doesNotMatch(readFileSync(new URL('../src/landing.mjs', import.meta.url), 'utf8'), /\bimport\b/); diff --git a/packages/bus/tests/threads.test.mjs b/packages/bus/tests/threads.test.mjs -index 8b31da9f9..1410ec3fa 100644 +index 8b31da9f9..280e03184 100644 --- a/packages/bus/tests/threads.test.mjs +++ b/packages/bus/tests/threads.test.mjs -@@ -601,3 +601,42 @@ test('project.create keeps unrelated names with and without a repository', t => +@@ -601,3 +601,56 @@ test('project.create keeps unrelated names with and without a repository', t => { id: linked.id, name: 'work', repo: 'stack' }, ]); }); @@ -173,6 +203,20 @@ index 8b31da9f9..1410ec3fa 100644 + const legacy = ctx.call('human', 'thread.create', { project, name: 'Default' }); + assert.equal(legacy.instance, 'assistant'); +}); ++ ++ ++test('C2-09a: creative bindLaunch without a thread refuses thread-required', t => { ++ const creative = ['companion', 'ideas', 'research', 'proofreader', 'fact-checker', 'continuity']; ++ const extra = Object.fromEntries(creative.map((definition, i) => [`creative${i}`, { definition, authority: { withinRole: ['message.send'], crossRole: [] } }])); ++ const ctx = setup(t, demo({ roles: { ...roles, ...extra }, definitions: { ++ ...definitions, ...Object.fromEntries(creative.map(definition => [definition, {}])), ++ } })); ++ for (const instance of Object.keys(extra)) { ++ assert.throws(() => ctx.launch(`unthreaded-${instance}`, instance), { code: 'thread-required' }); ++ } ++ assert.equal(ctx.count('SELECT count(*) n FROM threads'), 0); ++ assert.equal(ctx.count('SELECT count(*) n FROM role_claims'), 0); ++}); diff --git a/packages/bus/tests/user-principal.test.mjs b/packages/bus/tests/user-principal.test.mjs index 4dcd1ebeb..8471ddf85 100644 --- a/packages/bus/tests/user-principal.test.mjs diff --git a/agents/rocko/work/queue-219/candidate-manifest.sha256 b/agents/rocko/work/queue-219/candidate-manifest.sha256 index 6a46760c2..94db5dd71 100644 --- a/agents/rocko/work/queue-219/candidate-manifest.sha256 +++ b/agents/rocko/work/queue-219/candidate-manifest.sha256 @@ -1,6 +1,8 @@ 142a210882535108159e045c61be288bc8703910a8ee0169137bc1eb80baff64 packages/bus/src/broker.mjs b0c66c8999b567896923f6c876911dba936c6eca1ccc7aaeada51369fd613594 packages/bus/tests/creative.test.mjs -de4913f50801a11fd172e3f2c2b3cb41ab04e84d32a6650d1c8662b5e227ea3d packages/bus/tests/threads.test.mjs +3efd0238da60e0bfcd3b25e5256b9c213085119a86a7b852b13e7a60340d3a24 packages/bus/tests/grant-executor.test.mjs +b7ea857637947c7a9ca45c56cea47e37e06f0fd8446ea91316990d9fa7299a7a packages/bus/tests/project-runtime.test.mjs +264d82944c53b638bf6a14cc0706cf9ba184d668211c2b9c1031cdbe88e84bb9 packages/bus/tests/threads.test.mjs 8f7d6745fffb2a0898ac80c012084ac48964748da6439a8c56facc6529ffb19b packages/bus/tests/user-principal.test.mjs b74275ce43249bafc97edc87a6a3aa0431c62fe1a28cd9fa265246e6d6da219b packages/cli/src/launcher.mjs 2c3f120dfdc0b52bf8ab38a88e86251be75d4b0d218e23df489dcaf815d6bc15 packages/cli/tests/launcher.test.mjs diff --git a/agents/rocko/work/queue-219/changed-paths.txt b/agents/rocko/work/queue-219/changed-paths.txt index 689c1cf8e..1b56283af 100644 --- a/agents/rocko/work/queue-219/changed-paths.txt +++ b/agents/rocko/work/queue-219/changed-paths.txt @@ -1,5 +1,7 @@ packages/bus/src/broker.mjs packages/bus/tests/creative.test.mjs +packages/bus/tests/grant-executor.test.mjs +packages/bus/tests/project-runtime.test.mjs packages/bus/tests/threads.test.mjs packages/bus/tests/user-principal.test.mjs packages/cli/src/launcher.mjs diff --git a/agents/rocko/work/queue-219/mutants.json b/agents/rocko/work/queue-219/mutants.json index 10d146810..7358143dd 100644 --- a/agents/rocko/work/queue-219/mutants.json +++ b/agents/rocko/work/queue-219/mutants.json @@ -5,7 +5,7 @@ "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: explicit creative" + "pattern": "C2-09a: creative bindLaunch without a thread" }, { "id": "T02", @@ -189,5 +189,13 @@ "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" } ] diff --git a/agents/rocko/work/queue-219/prepare-mutants.py b/agents/rocko/work/queue-219/prepare-mutants.py index 63263d48f..7093f2cb3 100644 --- a/agents/rocko/work/queue-219/prepare-mutants.py +++ b/agents/rocko/work/queue-219/prepare-mutants.py @@ -8,7 +8,7 @@ def site(id,file,old,new,test,pattern): text=(root/file).read_text();assert text.count(old)==1,(id,text.count(old)) specs.append(dict(id=id,file=file,old=old,new=new,test=test,pattern=pattern)) bus='packages/bus/src/broker.mjs';bt='packages/bus/tests/threads.test.mjs';cli='packages/cli/src/launcher.mjs';ct='packages/cli/tests/thread-launch.test.mjs';web='packages/webui/src/serve.mjs';wt='packages/webui/tests/chat-instances.test.mjs';browser='packages/webui/src/public/chat.js';brtest='packages/webui/tests/chat-browser.test.mjs' -site('T01',bus,'return THREAD_DEFINITIONS.includes(this.#business(business).roles[role]?.definition);',"return this.#business(business).roles[role]?.definition === 'assistant';",bt,'C2-09a: explicit creative') +site('T01',bus,'return THREAD_DEFINITIONS.includes(this.#business(business).roles[role]?.definition);',"return this.#business(business).roles[role]?.definition === 'assistant';",bt,'C2-09a: creative bindLaunch without a thread') site('T02',bus,': identifier(a.instance);',': instances[0];',bt,'C2-09a: explicit creative') site('T03',bus,"if (!instances.length || (a.instance !== undefined && !instances.includes(instance))) fail('thread-instance-missing');","if (!instances.length) fail('thread-instance-missing');",bt,'C2-09a: explicit missing') site('T04',bus,"if (a.instance === undefined && instances.length > 1) fail('thread-instance-ambiguous');","if (false) fail('thread-instance-ambiguous');",bt,'C2-09a: explicit creative') @@ -35,5 +35,6 @@ site('T23',cli,'const threaded = THREAD_DEFINITIONS.includes(b.roles[instance]?. ending_old='const threaded = THREAD_DEFINITIONS.includes(b.roles[r.instance]?.definition);' assert (root/cli).read_text().count(ending_old)==1 specs[-1]['additional_edits']=[dict(file=cli,old=ending_old,new='const threaded = b.roles[r.instance]?.definition === "assistant";')] +site('T24',bus,"if (CREATIVE_DEFINITIONS.includes(this.#business(s.business).roles[s.role]?.definition)) fail('host-creative-role');",'void 0;','packages/bus/tests/grant-executor.test.mjs','sage-1908: once the agent of an applied grant is a creative role') (p/'mutants.json').write_text(json.dumps(specs,indent=2)+'\n') print('STATIC_PREFLIGHT',len(specs),'exact-once sites; no tests run') diff --git a/agents/rocko/work/queue-219/r4/BUILD.md b/agents/rocko/work/queue-219/r4/BUILD.md new file mode 100644 index 000000000..ef8dcfc41 --- /dev/null +++ b/agents/rocko/work/queue-219/r4/BUILD.md @@ -0,0 +1,7 @@ +# Row219 r4 / mos1429 + +Approved setup-only creative ops thread binding, exact import pin update, +and new direct broker bindLaunch regression. See root BUILD.md and the +assertion-preservation JSON/diff. Red-first evidence awaits Sage CLEAR. +No product changes; root and this round list16 paths. T24 is new; T01 now +targets the direct creative bind refusal. 24 mutants in the full run. diff --git a/agents/rocko/work/queue-219/r4/SHORT-RUN-PLAN.md b/agents/rocko/work/queue-219/r4/SHORT-RUN-PLAN.md new file mode 100644 index 000000000..ab1cef186 --- /dev/null +++ b/agents/rocko/work/queue-219/r4/SHORT-RUN-PLAN.md @@ -0,0 +1,26 @@ +# mos-1429 short slot (not run) + +Wait for Sage CLEAR. Estimate 3-5 minutes. No Docker, browser or suites. +Use a fresh short TMPDIR under /mnt/storage/scratch/tmp for each stage, +a dead DOCKER_HOST, explicit TAP, timeout -k 10 300 and a process group. +Check the green HEAD and 16-path manifest before any stage; check the red +worktree HEAD is bfa421b6cd9b2b54d8da119e73b004aeafe606c3. + +1. Red worktree /mnt/storage/scratch/rocko-r219-red-mos1429: + grant-executor.test.mjs, pattern `sage-1908: once the agent of an applied grant is a creative role`. + Require the named test to fail with thread-required at bindLaunch. +2. Same red worktree: project-runtime.test.mjs, pattern + `Broker keeps the sandbox client import closure`. + Require ERR_ASSERTION on the singular/plural import pin. +3. Green worktree: grant-executor.test.mjs, project-runtime.test.mjs, + threads.test.mjs, each whole, sequential. Require zero failed/cancelled. +4. T24: remove only the host.run creative guard using the table's exact-once + anchor. Run the sage-1908 pattern; require its named not-ok and + ERR_ASSERTION. Syntax errors and timeouts are invalid, never kills. +5. Restore exact bytes in finally, verify all 16 hashes, sweep owned + process groups and cwd node/chromium processes, return slot with counts. + Preserve raw TAP, exits, durations and skip lines. Push only as granted. + +Any unexpected red stops without retry or edit and goes to Sage for Mos. +The later full restart uses 10 touched whole files, bus/cli/webui, all shell +suites, 24 mutants and the reader audit, on a separate CLEAR after review. diff --git a/agents/rocko/work/queue-219/r4/approved-tests.diff b/agents/rocko/work/queue-219/r4/approved-tests.diff new file mode 100644 index 000000000..214be2541 --- /dev/null +++ b/agents/rocko/work/queue-219/r4/approved-tests.diff @@ -0,0 +1,52 @@ +diff --git a/packages/bus/tests/grant-executor.test.mjs b/packages/bus/tests/grant-executor.test.mjs +index e449b7d77..46235d16b 100644 +--- a/packages/bus/tests/grant-executor.test.mjs ++++ b/packages/bus/tests/grant-executor.test.mjs +@@ -1047,7 +1047,10 @@ test('sage-1908: once the agent of an applied grant is a creative role, host.run + const f = await setup(t); + assert.equal((await f.approve()).end.action, 'grant.applied'); + const r = await restart(t, f, creativeOps(f.business)); +- const cap = r.broker.bindLaunch({ business: 'demo', role: 'ops', run: 'ops-run', harness: 'pi', address: 'ops' }); ++ const human = r.broker.bindHuman({ business: 'demo', human: 'jason', via: 'cli', outsideAgent: true }); ++ const project = r.broker.request(human, { verb: 'project.create', args: { name: 'host grant check' } }).id; ++ const thread = r.broker.request(human, { verb: 'thread.create', args: { project, name: 'ops', instance: 'ops' } }).id; ++ const cap = r.broker.bindLaunch({ business: 'demo', role: 'ops', run: 'ops-run', harness: 'pi', address: 'ops', thread }); + r.broker.request(cap, { verb: 'role.claim' }); + const executor = hostExecutor({ credentials: r.credentials, root: join(f.dir, 'host-run') }); + const before = f.requests().length; +diff --git a/packages/bus/tests/project-runtime.test.mjs b/packages/bus/tests/project-runtime.test.mjs +index a6086e56c..7275ad902 100644 +--- a/packages/bus/tests/project-runtime.test.mjs ++++ b/packages/bus/tests/project-runtime.test.mjs +@@ -32,7 +32,8 @@ test('Broker keeps the sandbox client import closure: only the listed imports, n + // (#1692, D2.4) reads unhireableAction, the hire veto's action name. + // Row 236 (#1742, #436b) reads giteaName and parseGiteaUrl for the Gitea grant path. + // FED R3 r5 (row 274, #414) reads covers, a user's grant check, from it. +- "import { ID_PATTERN, THREAD_DEFINITION, END_PROTECTED, forkProblem, forkUrl, credentialKind, validArgv, commandAllowed, HOST_ID, CREATIVE_DEFINITIONS, unhireableAction, giteaName, parseGiteaUrl, covers } from '../../business/src/vocabulary.mjs';", ++ // Row 219 reads THREAD_DEFINITIONS from the same vocabulary for creative thread admission. ++ "import { ID_PATTERN, THREAD_DEFINITIONS, END_PROTECTED, forkProblem, forkUrl, credentialKind, validArgv, commandAllowed, HOST_ID, CREATIVE_DEFINITIONS, unhireableAction, giteaName, parseGiteaUrl, covers } from '../../business/src/vocabulary.mjs';", + ]); + assert.doesNotMatch(source, /\bimport\s*\(/); + assert.doesNotMatch(readFileSync(new URL('../src/landing.mjs', import.meta.url), 'utf8'), /\bimport\b/); +diff --git a/packages/bus/tests/threads.test.mjs b/packages/bus/tests/threads.test.mjs +index 1410ec3fa..280e03184 100644 +--- a/packages/bus/tests/threads.test.mjs ++++ b/packages/bus/tests/threads.test.mjs +@@ -640,3 +640,17 @@ test('C2-09a: explicit missing, non-thread and malformed selectors create no thr + const legacy = ctx.call('human', 'thread.create', { project, name: 'Default' }); + assert.equal(legacy.instance, 'assistant'); + }); ++ ++ ++test('C2-09a: creative bindLaunch without a thread refuses thread-required', t => { ++ const creative = ['companion', 'ideas', 'research', 'proofreader', 'fact-checker', 'continuity']; ++ const extra = Object.fromEntries(creative.map((definition, i) => [`creative${i}`, { definition, authority: { withinRole: ['message.send'], crossRole: [] } }])); ++ const ctx = setup(t, demo({ roles: { ...roles, ...extra }, definitions: { ++ ...definitions, ...Object.fromEntries(creative.map(definition => [definition, {}])), ++ } })); ++ for (const instance of Object.keys(extra)) { ++ assert.throws(() => ctx.launch(`unthreaded-${instance}`, instance), { code: 'thread-required' }); ++ } ++ assert.equal(ctx.count('SELECT count(*) n FROM threads'), 0); ++ assert.equal(ctx.count('SELECT count(*) n FROM role_claims'), 0); ++}); diff --git a/agents/rocko/work/queue-219/r4/assertion-preservation.json b/agents/rocko/work/queue-219/r4/assertion-preservation.json new file mode 100644 index 000000000..471f0d4d1 --- /dev/null +++ b/agents/rocko/work/queue-219/r4/assertion-preservation.json @@ -0,0 +1,46 @@ +{ + "baseHead": "bfa421b6cd9b2b54d8da119e73b004aeafe606c3", + "ruling": "mos-1429 / sage-3291", + "grantTest": { + "old": "test('sage-1908: once the agent of an applied grant is a creative role, host.run refuses host-creative-role, runs nothing remote and keeps the record', async (t) => {\n const f = await setup(t);\n assert.equal((await f.approve()).end.action, 'grant.applied');\n const r = await restart(t, f, creativeOps(f.business));\n const cap = r.broker.bindLaunch({ business: 'demo', role: 'ops', run: 'ops-run', harness: 'pi', address: 'ops' });\n r.broker.request(cap, { verb: 'role.claim' });\n const executor = hostExecutor({ credentials: r.credentials, root: join(f.dir, 'host-run') });\n const before = f.requests().length;\n await refusesWith(r.broker.requestHost(cap, { verb: 'host.run', args: { host: 'web1', argv: ['systemctl', 'status'] } }, executor), 'host-creative-role');\n assert.equal(f.requests().length, before);\n assert.equal(readOr(join(f.dir, 'sudo.log'), '').includes('systemctl'), false);\n assert.notEqual(f.record(), undefined);\n});\n", + "new": "test('sage-1908: once the agent of an applied grant is a creative role, host.run refuses host-creative-role, runs nothing remote and keeps the record', async (t) => {\n const f = await setup(t);\n assert.equal((await f.approve()).end.action, 'grant.applied');\n const r = await restart(t, f, creativeOps(f.business));\n const human = r.broker.bindHuman({ business: 'demo', human: 'jason', via: 'cli', outsideAgent: true });\n const project = r.broker.request(human, { verb: 'project.create', args: { name: 'host grant check' } }).id;\n const thread = r.broker.request(human, { verb: 'thread.create', args: { project, name: 'ops', instance: 'ops' } }).id;\n const cap = r.broker.bindLaunch({ business: 'demo', role: 'ops', run: 'ops-run', harness: 'pi', address: 'ops', thread });\n r.broker.request(cap, { verb: 'role.claim' });\n const executor = hostExecutor({ credentials: r.credentials, root: join(f.dir, 'host-run') });\n const before = f.requests().length;\n await refusesWith(r.broker.requestHost(cap, { verb: 'host.run', args: { host: 'web1', argv: ['systemctl', 'status'] } }, executor), 'host-creative-role');\n assert.equal(f.requests().length, before);\n assert.equal(readOr(join(f.dir, 'sudo.log'), '').includes('systemctl'), false);\n assert.notEqual(f.record(), undefined);\n});\n", + "preservedOldLines": [ + " assert.equal((await f.approve()).end.action, 'grant.applied');", + " const r = await restart(t, f, creativeOps(f.business));", + " const before = f.requests().length;", + " await refusesWith(r.broker.requestHost(cap, { verb: 'host.run', args: { host: 'web1', argv: ['systemctl', 'status'] } }, executor), 'host-creative-role');", + " assert.equal(f.requests().length, before);", + " assert.equal(readOr(join(f.dir, 'sudo.log'), '').includes('systemctl'), false);", + " assert.notEqual(f.record(), undefined);" + ], + "preservedNewLines": [ + " assert.equal((await f.approve()).end.action, 'grant.applied');", + " const r = await restart(t, f, creativeOps(f.business));", + " const before = f.requests().length;", + " await refusesWith(r.broker.requestHost(cap, { verb: 'host.run', args: { host: 'web1', argv: ['systemctl', 'status'] } }, executor), 'host-creative-role');", + " assert.equal(f.requests().length, before);", + " assert.equal(readOr(join(f.dir, 'sudo.log'), '').includes('systemctl'), false);", + " assert.notEqual(f.record(), undefined);" + ] + }, + "projectRuntime": { + "oldPin": [ + " \"import { ID_PATTERN, THREAD_DEFINITION, END_PROTECTED, forkProblem, forkUrl, credentialKind, validArgv, commandAllowed, HOST_ID, CREATIVE_DEFINITIONS, unhireableAction, giteaName, parseGiteaUrl, covers } from '../../business/src/vocabulary.mjs';\"," + ], + "newPin": [ + " \"import { ID_PATTERN, THREAD_DEFINITIONS, END_PROTECTED, forkProblem, forkUrl, credentialKind, validArgv, commandAllowed, HOST_ID, CREATIVE_DEFINITIONS, unhireableAction, giteaName, parseGiteaUrl, covers } from '../../business/src/vocabulary.mjs';\"," + ], + "oldDoesNotMatch": [ + " assert.doesNotMatch(source, /\\bimport\\s*\\(/);", + " assert.doesNotMatch(readFileSync(new URL('../src/landing.mjs', import.meta.url), 'utf8'), /\\bimport\\b/);", + " assert.doesNotMatch(readFileSync(new URL('../../business/src/vocabulary.mjs', import.meta.url), 'utf8'), /\\bimport\\b/);", + " assert.doesNotMatch(readFileSync(new URL('../../plugins/src/kinds.mjs', import.meta.url), 'utf8'), /\\bimport\\b/);" + ], + "newDoesNotMatch": [ + " assert.doesNotMatch(source, /\\bimport\\s*\\(/);", + " assert.doesNotMatch(readFileSync(new URL('../src/landing.mjs', import.meta.url), 'utf8'), /\\bimport\\b/);", + " assert.doesNotMatch(readFileSync(new URL('../../business/src/vocabulary.mjs', import.meta.url), 'utf8'), /\\bimport\\b/);", + " assert.doesNotMatch(readFileSync(new URL('../../plugins/src/kinds.mjs', import.meta.url), 'utf8'), /\\bimport\\b/);" + ] + } +} diff --git a/agents/rocko/work/queue-219/r4/base.txt b/agents/rocko/work/queue-219/r4/base.txt new file mode 100644 index 000000000..f17c9be70 --- /dev/null +++ b/agents/rocko/work/queue-219/r4/base.txt @@ -0,0 +1 @@ +80793d824e05baaef4820f4be7790aba55971b6f diff --git a/agents/rocko/work/queue-219/r4/build.patch b/agents/rocko/work/queue-219/r4/build.patch new file mode 100644 index 000000000..a63ab7a28 --- /dev/null +++ b/agents/rocko/work/queue-219/r4/build.patch @@ -0,0 +1,832 @@ +diff --git a/packages/bus/src/broker.mjs b/packages/bus/src/broker.mjs +index d76085739..11061c778 100644 +--- a/packages/bus/src/broker.mjs ++++ b/packages/bus/src/broker.mjs +@@ -4,7 +4,7 @@ import { initializeControl, processingStatus } from '../../processing-control/sr + import { NAME as HARNESS_NAME } from '../../plugins/src/kinds.mjs'; + import { loadRequirements } from '../../tasks/src/requirements.mjs'; + import { MERGE, LandingRefusal, readLanding } from './landing.mjs'; +-import { ID_PATTERN, THREAD_DEFINITION, END_PROTECTED, forkProblem, forkUrl, credentialKind, validArgv, commandAllowed, HOST_ID, CREATIVE_DEFINITIONS, unhireableAction, giteaName, parseGiteaUrl, covers } from '../../business/src/vocabulary.mjs'; ++import { ID_PATTERN, THREAD_DEFINITIONS, END_PROTECTED, forkProblem, forkUrl, credentialKind, validArgv, commandAllowed, HOST_ID, CREATIVE_DEFINITIONS, unhireableAction, giteaName, parseGiteaUrl, covers } from '../../business/src/vocabulary.mjs'; + + // Kept closed while S1 lands; its vocabulary is the integration authority. + export const ACTIONS = Object.freeze([ +@@ -314,7 +314,7 @@ const enrollBinding = (enroll) => ({ + }); + // r6 E3: the installer line's comment, then the tag's 32 hex digits. + const INSTALLER_COMMENT = 'mosaic-installer-'; +-// Row 121 (#1615): an instance of THREAD_DEFINITION (vocabulary.mjs since row 155) talks with the ++// Row 121 (#1615): an instance of THREAD_DEFINITIONS (vocabulary.mjs since row 213) talks with the + // user in threads. Its runs claim a thread, not the role, and every message to or from it names its + // thread (REQ-MSG-1). + // Row 146 (#1640): the sender of the bus's notice to launch.by. A role instance name matches the +@@ -598,7 +598,7 @@ export class Broker { + ); + } + #threaded(business, role) { +- return this.#business(business).roles[role]?.definition === THREAD_DEFINITION; ++ return THREAD_DEFINITIONS.includes(this.#business(business).roles[role]?.definition); + } + // Row 264a (#1769): a claim holds one session of a thread, and each session has its own holder. + #sessionHolder(session) { +@@ -6068,24 +6068,27 @@ export class Broker { + .all('SELECT id,at,name,repo FROM projects WHERE business=? ORDER BY seq', s.business) + .filter((p) => !s.user || this.#granted(s, 'project.list', p.id, null)); + } +- // A thread belongs to the user who made it and to the business's one thread instance. ++ // A thread belongs to the user who made it and to one declared thread instance. + // Row 177 (#1675): a tester's thread is owned by `tester`, so neither reaches the other's. + case 'thread.create': { + if (!s.tester && !s.user) this.#human(s); +- keys(a, ['project', 'name'], ['project', 'name']); ++ keys(a, ['project', 'name', 'instance'], ['project', 'name']); + if (!name(a.name)) fail('invalid-request'); ++ const instances = Object.keys(b.roles).filter((r) => this.#threaded(s.business, r)); ++ const instance = a.instance === undefined ++ ? (instances.length === 1 ? instances[0] : null) ++ : identifier(a.instance); + // FED R3 (design 3.5): a user's grant must cover the project and the thread instance, checked + // before the project is looked up, so an ungranted id reads the same whether it exists or not. + if (s.user) { +- const threaded = Object.keys(b.roles).filter((r) => this.#threaded(s.business, r)); +- if (threaded.length !== 1 || !this.#granted(s, 'thread.create', identifier(a.project), threaded[0])) fail('access-refused'); ++ if (!instance || !instances.includes(instance) || !this.#granted(s, 'thread.create', identifier(a.project), instance)) ++ fail('access-refused'); + } + if (!this.#store.get('SELECT 1 FROM projects WHERE id=? AND business=?', identifier(a.project), s.business)) + fail('project-not-found'); +- // The bus never picks between instances; the business file declares exactly one. +- const instances = Object.keys(b.roles).filter((r) => this.#threaded(s.business, r)); +- if (!instances.length) fail('thread-instance-missing'); +- if (instances.length > 1) fail('thread-instance-ambiguous'); ++ // The human selects an instance; omission is compatible only with one candidate. ++ if (!instances.length || (a.instance !== undefined && !instances.includes(instance))) fail('thread-instance-missing'); ++ if (a.instance === undefined && instances.length > 1) fail('thread-instance-ambiguous'); + if (this.#store.get('SELECT 1 FROM threads WHERE project=? AND name=?', a.project, a.name)) fail('thread-exists'); + const tid = randomUUID(); + this.#store.run( +@@ -6094,13 +6097,13 @@ export class Broker { + this.#now(), + s.business, + a.project, +- instances[0], ++ instance, + this.#owner(s), + a.name, + ); + // Row 264a (#1769, D3): every thread has a default session from the start. +- this.#newSession(s, { id: tid, business: s.business, instance: instances[0], owner: this.#owner(s) }, 'default', 'default', true); +- return { id: tid, instance: instances[0] }; ++ this.#newSession(s, { id: tid, business: s.business, instance, owner: this.#owner(s) }, 'default', 'default', true); ++ return { id: tid, instance }; + } + // Row 177 (#1675): each lists its own threads. The human's list leaves out the tester's, + // and the tester's lists only its own (row 175 listed it the business human's). +diff --git a/packages/bus/tests/creative.test.mjs b/packages/bus/tests/creative.test.mjs +index 6cfbf1cd6..6d421ba19 100644 +--- a/packages/bus/tests/creative.test.mjs ++++ b/packages/bus/tests/creative.test.mjs +@@ -44,15 +44,18 @@ function setup(t) { + const caps = {}; + caps.human = b.bindHuman({ business: 'demo', human: 'jason', via: 'cli', outsideAgent: true }); + const project = b.request(caps.human, { verb: 'project.create', args: { name: 'demo' } }).id; +- const thread = b.request(caps.human, { verb: 'thread.create', args: { project, name: 'main' } }).id; ++ const thread = b.request(caps.human, { verb: 'thread.create', args: { project, name: 'main', instance: 'assistant' } }).id; ++ const threads = { assistant: thread }; + for (const role of Object.keys(roles)) { +- caps[role] = b.bindLaunch({ business: 'demo', role, run: `${role}-run`, harness: 'pi', ...(role === 'assistant' ? { thread } : {}) }); ++ if (['bean', 'quill'].includes(role)) ++ threads[role] = b.request(caps.human, { verb: 'thread.create', args: { project, name: role, instance: role } }).id; ++ caps[role] = b.bindLaunch({ business: 'demo', role, run: `${role}-run`, harness: 'pi', ...(threads[role] ? { thread: threads[role] } : {}) }); + b.request(caps[role], { verb: 'role.claim' }); + } + caps.tester = b.bindTester({ business: 'demo' }); + const call = (who, verb, args = {}) => b.request(caps[who], { verb, args }); + const count = (sql) => store.get(sql).n; +- return { call, count, store }; ++ return { call, count, store, threads }; + } + + const raise = { action: 'policy.change', question: 'Change?', options: [{ key: 'yes', text: 'Yes' }, { key: 'no', text: 'No' }], recommendation: 'yes', blocking: false }; +@@ -72,7 +75,7 @@ test('M6: a creative raise refuses decision-not-allowed, cited or not, and no de + }); + + test('a creative instance sends only to the user and hears only from the user', (t) => { +- const { call, count } = setup(t); ++ const { call, count, threads } = setup(t); + for (const who of ['bean', 'quill']) { + call(who, 'message.send', { to: 'human', body: 'hello' }); + for (const to of ['chief', 'assistant', 'pm', 'bean', 'quill'].filter((n) => n !== who)) { +@@ -81,7 +84,7 @@ test('a creative instance sends only to the user and hears only from the user', + for (const from of ['chief', 'pm']) { + assert.throws(() => call(from, 'message.send', { to: who, body: 'hello' }), { code: 'message-sender-refused' }, `${from} to ${who}`); + } +- call('human', 'message.send', { to: who, body: 'hello' }); ++ call('human', 'thread.send', { thread: threads[who], body: 'hello' }); + } + assert.equal(count("SELECT count(*) n FROM messages WHERE from_role IN ('bean','quill')"), 2); + assert.equal(count("SELECT count(*) n FROM messages WHERE to_role IN ('bean','quill')"), 2); +diff --git a/packages/bus/tests/grant-executor.test.mjs b/packages/bus/tests/grant-executor.test.mjs +index e449b7d77..46235d16b 100644 +--- a/packages/bus/tests/grant-executor.test.mjs ++++ b/packages/bus/tests/grant-executor.test.mjs +@@ -1047,7 +1047,10 @@ test('sage-1908: once the agent of an applied grant is a creative role, host.run + const f = await setup(t); + assert.equal((await f.approve()).end.action, 'grant.applied'); + const r = await restart(t, f, creativeOps(f.business)); +- const cap = r.broker.bindLaunch({ business: 'demo', role: 'ops', run: 'ops-run', harness: 'pi', address: 'ops' }); ++ const human = r.broker.bindHuman({ business: 'demo', human: 'jason', via: 'cli', outsideAgent: true }); ++ const project = r.broker.request(human, { verb: 'project.create', args: { name: 'host grant check' } }).id; ++ const thread = r.broker.request(human, { verb: 'thread.create', args: { project, name: 'ops', instance: 'ops' } }).id; ++ const cap = r.broker.bindLaunch({ business: 'demo', role: 'ops', run: 'ops-run', harness: 'pi', address: 'ops', thread }); + r.broker.request(cap, { verb: 'role.claim' }); + const executor = hostExecutor({ credentials: r.credentials, root: join(f.dir, 'host-run') }); + const before = f.requests().length; +diff --git a/packages/bus/tests/project-runtime.test.mjs b/packages/bus/tests/project-runtime.test.mjs +index a6086e56c..7275ad902 100644 +--- a/packages/bus/tests/project-runtime.test.mjs ++++ b/packages/bus/tests/project-runtime.test.mjs +@@ -32,7 +32,8 @@ test('Broker keeps the sandbox client import closure: only the listed imports, n + // (#1692, D2.4) reads unhireableAction, the hire veto's action name. + // Row 236 (#1742, #436b) reads giteaName and parseGiteaUrl for the Gitea grant path. + // FED R3 r5 (row 274, #414) reads covers, a user's grant check, from it. +- "import { ID_PATTERN, THREAD_DEFINITION, END_PROTECTED, forkProblem, forkUrl, credentialKind, validArgv, commandAllowed, HOST_ID, CREATIVE_DEFINITIONS, unhireableAction, giteaName, parseGiteaUrl, covers } from '../../business/src/vocabulary.mjs';", ++ // Row 219 reads THREAD_DEFINITIONS from the same vocabulary for creative thread admission. ++ "import { ID_PATTERN, THREAD_DEFINITIONS, END_PROTECTED, forkProblem, forkUrl, credentialKind, validArgv, commandAllowed, HOST_ID, CREATIVE_DEFINITIONS, unhireableAction, giteaName, parseGiteaUrl, covers } from '../../business/src/vocabulary.mjs';", + ]); + assert.doesNotMatch(source, /\bimport\s*\(/); + assert.doesNotMatch(readFileSync(new URL('../src/landing.mjs', import.meta.url), 'utf8'), /\bimport\b/); +diff --git a/packages/bus/tests/threads.test.mjs b/packages/bus/tests/threads.test.mjs +index 8b31da9f9..280e03184 100644 +--- a/packages/bus/tests/threads.test.mjs ++++ b/packages/bus/tests/threads.test.mjs +@@ -601,3 +601,56 @@ test('project.create keeps unrelated names with and without a repository', t => + { id: linked.id, name: 'work', repo: 'stack' }, + ]); + }); ++ ++test('C2-09a: explicit creative instances bind independent threads, default sessions and holders', t => { ++ const creative = ['companion', 'ideas', 'research', 'proofreader', 'fact-checker', 'continuity']; ++ const extra = Object.fromEntries(creative.map((definition, i) => [`writer${i}`, { definition, authority: { withinRole: ['message.send'], crossRole: [] } }])); ++ const ctx = setup(t, demo({ roles: { ...roles, ...extra }, definitions: { ++ ...definitions, ...Object.fromEntries(creative.map(definition => [definition, { messaging: shipped(definition).messaging }])), ++ } })); ++ const project = ctx.call('human', 'project.create', { name: 'Writing' }).id; ++ assert.throws(() => ctx.call('human', 'thread.create', { project, name: 'ambiguous' }), { code: 'thread-instance-ambiguous' }); ++ for (const [instance, role] of Object.entries(extra)) { ++ const receipt = ctx.call('human', 'thread.create', { project, name: instance, instance }); ++ assert.equal(receipt.instance, instance); ++ assert.equal(ctx.store.get('SELECT instance FROM threads WHERE id=?', receipt.id).instance, instance); ++ assert.equal(ctx.store.get('SELECT instance FROM sessions WHERE thread=?', receipt.id).instance, instance); ++ ctx.launch(instance, instance, { thread: receipt.id }); ++ assert.equal(ctx.claim(instance).thread, receipt.id); ++ const sent = ctx.call('human', 'thread.send', { thread: receipt.id, body: `For ${instance}` }); ++ const read = ctx.call(instance, 'message.receive'); ++ assert.deepEqual(read.map(m => m.id), [sent.id], role.definition); ++ assert.equal(ctx.threadOf(sent.id), receipt.id); ++ assert.equal(ctx.store.get('SELECT count(*) n FROM role_claims WHERE role=?', instance).n, 0); ++ assert.throws(() => ctx.call('human', 'message.send', { to: instance, body: 'No implicit thread' }), ++ { code: 'thread-required-use-thread-send' }); ++ } ++ assert.equal(ctx.count('SELECT count(*) n FROM threads'), creative.length); ++}); ++ ++test('C2-09a: explicit missing, non-thread and malformed selectors create no thread or session', t => { ++ const ctx = setup(t); ++ const project = ctx.call('human', 'project.create', { name: 'Writing' }).id; ++ for (const instance of ['not-declared', 'pm', 'coder']) ++ assert.throws(() => ctx.call('human', 'thread.create', { project, name: instance, instance }), { code: 'thread-instance-missing' }); ++ for (const instance of [null, 7, {}, [], '', 'bad name']) ++ assert.throws(() => ctx.call('human', 'thread.create', { project, name: 'bad', instance }), { code: 'invalid-request' }); ++ assert.equal(ctx.count('SELECT count(*) n FROM threads'), 0); ++ assert.equal(ctx.count('SELECT count(*) n FROM sessions'), 0); ++ const legacy = ctx.call('human', 'thread.create', { project, name: 'Default' }); ++ assert.equal(legacy.instance, 'assistant'); ++}); ++ ++ ++test('C2-09a: creative bindLaunch without a thread refuses thread-required', t => { ++ const creative = ['companion', 'ideas', 'research', 'proofreader', 'fact-checker', 'continuity']; ++ const extra = Object.fromEntries(creative.map((definition, i) => [`creative${i}`, { definition, authority: { withinRole: ['message.send'], crossRole: [] } }])); ++ const ctx = setup(t, demo({ roles: { ...roles, ...extra }, definitions: { ++ ...definitions, ...Object.fromEntries(creative.map(definition => [definition, {}])), ++ } })); ++ for (const instance of Object.keys(extra)) { ++ assert.throws(() => ctx.launch(`unthreaded-${instance}`, instance), { code: 'thread-required' }); ++ } ++ assert.equal(ctx.count('SELECT count(*) n FROM threads'), 0); ++ assert.equal(ctx.count('SELECT count(*) n FROM role_claims'), 0); ++}); +diff --git a/packages/bus/tests/user-principal.test.mjs b/packages/bus/tests/user-principal.test.mjs +index 4dcd1ebeb..8471ddf85 100644 +--- a/packages/bus/tests/user-principal.test.mjs ++++ b/packages/bus/tests/user-principal.test.mjs +@@ -23,7 +23,7 @@ const grant = (over = {}) => ({ + }); + + // `processing` stands in for the halt switch, as lifecycle-verbs.test.mjs's T15 does. +-function setup(t, { grants = [grant()], processing = null } = {}) { ++function setup(t, { grants = [grant()], processing = null, threadRoles = {} } = {}) { + const root = mkdtempSync(join(tmpdir(), 'bus-user-principal-')); + const store = new Store(root); + t.after(() => { +@@ -40,6 +40,7 @@ function setup(t, { grants = [grant()], processing = null } = {}) { + roles: { + chief: { definition: 'chief-of-staff', authority: { withinRole: ['message.send'], crossRole: [] } }, + assistant: { definition: 'assistant', authority: { withinRole: ['message.send'], crossRole: [] } }, ++ ...threadRoles, + }, + definitions: { 'chief-of-staff': {}, assistant: { messaging: shipped('assistant').messaging } }, + }, +@@ -394,3 +395,21 @@ test('R3 r4: the chief\'s hire refuses an instance named user with the code it g + test('R3 r4: a non-function access throws before the store is read', () => { + assert.throws(() => new Broker({ store: null, businesses: { demo: {} }, access: 'access.json' }), /access must be a function/); + }); ++ ++test('C2-09a: naming an instance cannot bypass its collaborator grant or disclose an ungranted project', t => { ++ const ctx = setup(t, { threadRoles: { bean: { definition: 'companion', authority: { withinRole: ['message.send'], crossRole: [] } } } }); ++ const project = ctx.call('human', 'project.create', { name: 'shared' }).id; ++ const privateProject = ctx.call('human', 'project.create', { name: 'private' }).id; ++ ctx.access.doc.grants = [grant({ projects: [project] })]; ++ ctx.user('alice'); ++ assert.equal(ctx.code('alice', 'thread.create', { project, name: 'blocked bean', instance: 'bean' }), 'access-refused'); ++ for (const id of [privateProject, '00000000-0000-4000-8000-000000000000']) ++ assert.equal(ctx.code('alice', 'thread.create', { project: id, name: 'blocked project', instance: 'assistant' }), 'access-refused'); ++ assert.equal(ctx.store.get('SELECT count(*) n FROM threads').n, 0); ++ const allowed = ctx.call('alice', 'thread.create', { project, name: 'assistant work', instance: 'assistant' }); ++ assert.equal(allowed.instance, 'assistant'); ++ ctx.access.doc.grants = [grant({ projects: [project], instances: ['bean'] })]; ++ const bean = ctx.call('alice', 'thread.create', { project, name: 'bean work', instance: 'bean' }); ++ assert.equal(bean.instance, 'bean'); ++ assert.equal(ctx.code('alice', 'thread.create', { project, name: 'old instance', instance: 'assistant' }), 'access-refused'); ++}); +diff --git a/packages/cli/src/launcher.mjs b/packages/cli/src/launcher.mjs +index bfe55b61e..d8248284c 100644 +--- a/packages/cli/src/launcher.mjs ++++ b/packages/cli/src/launcher.mjs +@@ -53,7 +53,7 @@ + // session.json names it as gitSocket. + // + // Thread sessions (row 121, #1615). A thread instance (an instance whose +-// role definition is the assistant) runs once per thread, never on its own: ++// role definition is in THREAD_DEFINITIONS) runs once per thread, never on its own: + // a launch from a session or --pm refuses thread-required. Every tick + // (threadTickMs) the host asks the broker for the business's threads + // (launch op threadsState) and: +@@ -139,6 +139,7 @@ import { createServer } from "node:net"; + import { chmodSync, existsSync, lstatSync, mkdirSync, readFileSync, renameSync, rmSync } from "node:fs"; + import { dirname, join, relative } from "node:path"; + import { configDir, loadBusiness, resolveInstance, systemVars } from "../../business/src/index.mjs"; ++import { THREAD_DEFINITIONS } from "../../business/src/vocabulary.mjs"; + import { limitHit } from "../../business/src/launch.mjs"; + import { BundleError, buildBundle, hasFallback, readSkills, sessionModel } from "../../harness/src/bundle.mjs"; + import { createLoader } from "../../plugins/src/loader.mjs"; +@@ -176,8 +177,6 @@ const STOP_TIMEOUT_MS = 30000; + const LINE_MAX = 4096; + // How often the host asks for the threads' state; a poll period, not a limit. + const THREAD_TICK_MS = 2000; +-// The broker's thread instance definition (packages/bus/src/broker.mjs). +-const THREAD_DEFINITION = "assistant"; + // Row 194: the broker's LIFECYCLE_REQUEST_MS. A regenerate's old run must be gone by then. + const LIFECYCLE_REQUEST_MS = 60000; + +@@ -331,7 +330,7 @@ export function createLauncher({ + try { b=loadBusiness(host.business,{dir:configDir(env),rolesDir:rolesDir(env)}); } catch(e){throw new Refusal("organization-refused",e.message);} + if (!b.launch) throw new Refusal("launch-not-configured", `business ${b.id} has no launch block`); + if (!(pm ? instance === b.launch.by : b.launch.instances.includes(instance) || (human && Object.hasOwn(b.roles, instance)))) throw new Refusal("instance-not-listed"); +- const threaded = b.roles[instance]?.definition === THREAD_DEFINITION; ++ const threaded = THREAD_DEFINITIONS.includes(b.roles[instance]?.definition); + if (threaded && !thread) throw new Refusal("thread-required", `${instance} runs only for a thread`); + if (!threaded && thread) throw new Refusal("thread-not-allowed", `${instance} isn't a thread instance`); + if (threaded && !session) throw new Refusal("session-required", `${instance} runs for one session of a thread`); +@@ -997,7 +996,7 @@ export function createLauncher({ + function ending(r) { + const runs = r.runs ?? []; + const at = Date.parse(r.at); +- const threaded = b.roles[r.instance]?.definition === THREAD_DEFINITION; ++ const threaded = THREAD_DEFINITIONS.includes(b.roles[r.instance]?.definition); + return registry.sessions.filter((s) => s.business === b.id && (runs.includes(s.run) || + (!threaded && s.instance === r.instance && (spawnedAt.get(s.run) ?? Date.parse(s.startedAt)) <= at))); + } +diff --git a/packages/cli/tests/launcher.test.mjs b/packages/cli/tests/launcher.test.mjs +index 2202c7753..baabd843e 100644 +--- a/packages/cli/tests/launcher.test.mjs ++++ b/packages/cli/tests/launcher.test.mjs +@@ -773,21 +773,34 @@ test("row 213 a creative instance's persona is read from /personas: o + const dir = join(given.root, "config", "personas", "acme"); + mkdirSync(dir, { recursive: true, mode: 0o700 }); + writeFileSync(join(dir, "bean.md"), "Not the pinned text.\n", { mode: 0o600 }); +- const { f, host, launcher } = await setup(t, undefined, given); +- // The chief of staff holds role.launch; a test chief session bound to this process asks. +- const chief = await host.bindLaunch({ business: "acme", role: "chief", run: "chief-test", harness: "pi", pid: process.pid, startTime: startTimeOf(process.pid) }); +- await new Client({ path: host.path, cap: chief.cap }).call("role.claim"); +- // The bundle's refusal comes back as launch-failed, as webPlan's does, with its reason in the log. +- assert.deepEqual(await launcher.fromSession(chief.cap, "bean"), { ok: false, error: "launch-failed" }); +- const [e] = log(f); +- assert.deepEqual([e.event, e.code, log(f).length], ["refused", "launch-failed", 1]); ++ // Row 219: creative instances launch from their thread, not from a chief's standalone request. ++ // The mismatch occurs before bindLaunch, so only the host's thread-state snapshot is a fixture. ++ const thread = 'persona-thread'; ++ const SESSION = 'persona-session'; ++ const { f, launcher } = await setup(t, undefined, given, { wrap: host => ({ ++ ...host, ++ op: message => message.op === 'threadsState' ++ ? Promise.resolve([{ thread, session: SESSION, instance: 'bean', holder: null, pending: 1 }]) ++ : host.op(message), ++ }) }); ++ // The thread path records row 270's run-start count before the bundle's persona refusal. ++ await launcher.tick(); ++ const runs = readdirSync(join(f.dataRoot, "launches", "acme")); ++ const entries = log(f); ++ assert.equal(entries.length, 2); ++ const { at, ...compactions } = entries[0]; ++ assert.deepEqual(compactions, { event: 'compactions', instance: 'bean', thread, session: SESSION, run: runs[0], count: 0, known: true, reason: null }); ++ const e = entries[1]; ++ assert.deepEqual([e.event, e.code], ["refused", "launch-failed"]); ++ assert.equal(e.thread, thread); + assert.equal(e.why, `instance bean: persona file ${join(dir, "bean.md")} isn't the file persona.sha256 names`); + assert.ok(!JSON.stringify(log(f)).includes("PERSONA-MARKER-d2")); + assert.deepEqual(readSessions(f.dataRoot), []); + // The run directory exists by then (BUILD.md residual); the persona is read before any bundle file. +- const runs = readdirSync(join(f.dataRoot, "launches", "acme")); + assert.equal(runs.length, 1); +- assert.deepEqual(readdirSync(join(f.dataRoot, "launches", "acme", runs[0])), ["session"]); ++ assert.deepEqual(readdirSync(join(f.dataRoot, "launches", "acme", runs[0])), []); ++ assert.equal(existsSync(join(f.dataRoot, "threads", "acme", thread, "sessions", SESSION, "session")), true); ++ assert.equal(existsSync(join(f.dataRoot, "threads", "acme", thread, "session")), false); + }); + + test("row 64 on Claude Code a role skill that isn't enabled refuses the same way, before anything starts", { timeout: 30000 }, async (t) => { +diff --git a/packages/cli/tests/thread-launch.test.mjs b/packages/cli/tests/thread-launch.test.mjs +index 0d207a0a0..fa3adb866 100644 +--- a/packages/cli/tests/thread-launch.test.mjs ++++ b/packages/cli/tests/thread-launch.test.mjs +@@ -396,6 +396,22 @@ test("REQ-THREAD-1 REQ-LAUNCH-1 the chief can't launch the assistant outside a t + assert.deepEqual(launchLog(f).map((e) => [e.event, e.instance, e.code]), [["refused", "assistant", "thread-required"]]); + }); + ++// Admission refuses before bundle construction or a sandbox is needed. ++test('C2-09a: fromSession refuses a creative instance outside a thread without a sandbox', { timeout: 30000 }, async t => { ++ const prepared = prepare(t, { edit: doc => { ++ doc.roles.bean = { ...doc.roles.assistant, definition: 'companion' }; ++ doc.launch.instances.push('bean'); ++ return doc; ++ } }); ++ const { f } = prepared; ++ const host = await start(t, prepared); ++ const chief = await host.host.bindLaunch({ business: 'acme', role: 'chief', run: 'chief-bean-refusal', harness: 'pi', pid: process.pid, startTime: startTimeOf(process.pid) }); ++ await new Client({ path: host.host.path, cap: chief.cap }).call('role.claim'); ++ assert.deepEqual(await host.launcher.fromSession(chief.cap, 'bean'), { ok: false, error: 'thread-required' }); ++ assert.deepEqual(readSessions(f.dataRoot), []); ++ assert.deepEqual(launchLog(f).map(e => [e.event, e.instance, e.code]), [['refused', 'bean', 'thread-required']]); ++}); ++ + // Row 125 (#1619, REQ-LIMIT-3, REQ-LIMIT-4): the token-limit check switched on, with the + // assistant's limit at 0, so it is at its limit before any turn. The real check runs through the + // bus's plug-in loader. +@@ -443,3 +459,73 @@ test("REQ-LIMIT-4 a thread run at its token limit stops at the end of its turn: + assert.deepEqual(threadRuns(f, A), []); + assert.equal(host.runtime.threadsState("acme").find((x) => x.thread === A).holder, null); + }); ++ ++test('C2-09a: creative thread messages start distinct runs and keep each instance history separate', { skip, timeout: 90000 }, async t => { ++ const prepared = prepare(t, { sonnet: 2, idle: 60, edit: doc => { ++ const vars = { ...doc.roles.assistant.vars }; ++ delete doc.roles.assistant; ++ doc.roles.bean = { definition: 'companion', vars: { ...vars } }; ++ doc.roles.chet = { definition: 'continuity', vars: { ...vars } }; ++ doc.launch.instances = ['coder', 'bean', 'chet']; ++ return doc; ++ } }); ++ const host = await start(t, prepared), { f } = prepared; ++ const project = host.call('project.create', { name: 'Writing' }).id; ++ const bean = host.call('thread.create', { project, name: 'Bean', instance: 'bean' }).id; ++ const chet = host.call('thread.create', { project, name: 'Chet', instance: 'chet' }).id; ++ const send = async (thread, instance, body) => { ++ const message = host.call('thread.send', { thread, body }); ++ const outcome = await until(() => host.call('thread.messages', { thread }).find(m => m.in_reply_to === message.id) || ++ launchLog(f).find(row => row.thread === thread && row.event === 'refused')); ++ assert.notEqual(outcome.event, 'refused', `creative thread launch refused: ${outcome.code}`); ++ const reply = outcome; ++ assert.equal(reply.from_role, instance); ++ assert.equal(reply.to_role, 'human'); ++ return JSON.parse(reply.body.match(/THREAD (\{.*\})/)[1]); ++ }; ++ assert.deepEqual((await send(bean, 'bean', 'Bean input')).before, []); ++ assert.deepEqual((await send(chet, 'chet', 'Chet input')).before, []); ++ assert.deepEqual((await send(bean, 'bean', 'Bean again')).before, ['Bean input']); ++ assert.equal(readFileSync(join(f.dataRoot, 'threads', 'acme', bean, 'sessions', host.runtime.threadsState('acme').find(x => x.thread === bean).session, 'session', 'history'), 'utf8'), 'Bean input\nBean again\n'); ++ assert.equal(readFileSync(join(f.dataRoot, 'threads', 'acme', chet, 'sessions', host.runtime.threadsState('acme').find(x => x.thread === chet).session, 'session', 'history'), 'utf8'), 'Chet input\n'); ++ assert.equal(existsSync(join(f.dataRoot, 'threads', 'acme', bean, 'session')), false); ++ assert.equal(existsSync(join(f.dataRoot, 'threads', 'acme', chet, 'session')), false); ++ const launches = launchLog(f).filter(row => row.event === 'launch'); ++ assert.ok(launches.some(row => row.instance === 'bean' && row.thread === bean)); ++ assert.ok(launches.some(row => row.instance === 'chet' && row.thread === chet)); ++ const chief = await host.host.bindLaunch({ business: 'acme', role: 'chief', run: 'chief-creative-test', harness: 'pi', pid: process.pid, startTime: startTimeOf(process.pid) }); ++ await new Client({ path: host.host.path, cap: chief.cap }).call('role.claim'); ++ assert.deepEqual(await host.launcher.fromSession(chief.cap, 'bean'), { ok: false, error: 'thread-required' }); ++}); ++ ++test('C2-09a: terminating one creative thread does not signal an unselected peer of the same instance', { skip, timeout: 90000 }, async t => { ++ const prepared = prepare(t, { sonnet: 2, idle: 60, edit: doc => { ++ doc.roles.bean = { ...doc.roles.assistant, definition: 'companion' }; ++ delete doc.roles.assistant; ++ doc.launch.instances = ['coder', 'bean']; ++ return doc; ++ } }); ++ let requests = []; ++ const host = await start(t, prepared, { ops: () => ({ ++ lifecycleRequests: () => requests, ++ lifecycleTake: () => ({ ...requests[0], go: true }), ++ lifecycleDone: () => { requests = []; return {}; }, ++ }) }); ++ const { f } = prepared; ++ const project = host.call('project.create', { name: 'Writing' }).id; ++ const threads = ['one', 'two'].map(name => host.call('thread.create', { project, name, instance: 'bean' }).id); ++ for (const thread of threads) { ++ const message = host.call('thread.send', { thread, body: 'Stay in this thread' }); ++ const outcome = await until(() => host.call('thread.messages', { thread }).find(row => row.in_reply_to === message.id) || ++ launchLog(f).find(row => row.thread === thread && row.event === 'refused')); ++ assert.notEqual(outcome.event, 'refused', `creative thread launch refused: ${outcome.code}`); ++ } ++ const runs = threads.map(thread => launchLog(f).find(row => row.thread === thread && row.event === 'launch').run); ++ requests = [{ request: 'one-thread-end', state: 'open', business: 'acme', action: 'lifecycle.end', ++ instance: 'bean', runs: [runs[0]], by: f.doc.human, at: new Date(Date.now() + 1000).toISOString() }]; ++ await host.launcher.tick(); ++ await until(() => launchLog(f).some(row => row.event === 'lifecycle-end' && row.run === runs[0])); ++ assert.deepEqual(launchLog(f).filter(row => row.event === 'lifecycle-end').map(row => row.run), [runs[0]]); ++ await until(() => !readSessions(f.dataRoot).some(row => row.run === runs[0])); ++ assert.ok(readSessions(f.dataRoot).some(row => row.run === runs[1])); ++}); +diff --git a/packages/webui/src/chat-http.mjs b/packages/webui/src/chat-http.mjs +index 7980c1442..63d3ca974 100644 +--- a/packages/webui/src/chat-http.mjs ++++ b/packages/webui/src/chat-http.mjs +@@ -80,7 +80,8 @@ export async function chatHTTP(req, res, { path, search, chat, named, send, prev + (Object.hasOwn(v, 'repo') && (typeof v.repo !== 'string' || !KEY.test(v.repo)))) throw Error(); + action = 'createProject'; args = v; + } else if (path === '/api/chat/threads') { +- if (!exact(v, ['project', 'name']) || !id(v.project) || !name(v.name)) throw Error(); ++ if (!exact(v, ['project', 'name', 'instance'], ['project', 'name']) || !id(v.project) || !name(v.name) || ++ (Object.hasOwn(v, 'instance') && (typeof v.instance !== 'string' || !KEY.test(v.instance)))) throw Error(); + action = 'createThread'; args = v; + } else if (match?.[2] === 'messages') { + if (!exact(v, ['body']) || typeof v.body !== 'string' || !v.body.trim() || v.body.length > 32768) throw Error(); +diff --git a/packages/webui/src/chat.mjs b/packages/webui/src/chat.mjs +index 1b0a41dce..5a1ed8bf1 100644 +--- a/packages/webui/src/chat.mjs ++++ b/packages/webui/src/chat.mjs +@@ -25,7 +25,7 @@ export function createChat({ call, owner = null }) { + projects: () => channel('project.list', {}), + createProject: ({ name, repo }) => channel('project.create', { name, ...(repo === undefined ? {} : { repo }) }), + threads: ({ project } = {}) => channel('thread.list', project === undefined ? {} : { project }), +- createThread: ({ project, name }) => channel('thread.create', { project, name }), ++ createThread: ({ project, name, instance }) => channel('thread.create', { project, name, ...(instance === undefined ? {} : { instance }) }), + messages: ({ thread, after, limit }) => channel('thread.messages', { thread, ...(after ? { after } : {}), limit }), + send: ({ thread, body }) => channel('thread.send', { thread, body, class: 'REQUEST' }), + open: ({ thread }) => channel('thread.open', { thread }), +diff --git a/packages/webui/src/public/chat.js b/packages/webui/src/public/chat.js +index a6b805c1b..15066bdc6 100644 +--- a/packages/webui/src/public/chat.js ++++ b/packages/webui/src/public/chat.js +@@ -14,7 +14,7 @@ + return states.get(id); + }; + const form = key => { +- if (!forms.has(key)) forms.set(key, { name: '', repo: '', receipt: '', pending: false }); ++ if (!forms.has(key)) forms.set(key, { name: '', repo: '', instance: '', instanceChosen: false, receipt: '', pending: false }); + return forms.get(key); + }; + class ChatError extends Error { +@@ -58,7 +58,11 @@ + function creation(kind, key) { + const f = form(key), project = kind === 'project'; + const repo = project && current.repos.length ? `` : ''; +- return `

New ${kind}

${repo}

${txt(f.receipt)}

`; ++ const choices = current.instances ?? []; ++ const picker = project ? '' : ``; ++ const unavailable = !project && (!!current.instanceError || !choices.some(row => row.instance === f.instance)); ++ const status = !project && current.instanceError ? current.instanceError : f.receipt || (!project && !choices.length ? 'No thread instances are configured.' : ''); ++ return `

New ${kind}

${repo}${picker}

${txt(status)}

`; + } + function threads(rows) { + return rows.length ? `
    ${rows.map(t => `
  • ${link('threads', t.id, t.name)} ${txt(t.instance)}
  • `).join('')}
` : '

No threads yet.

'; +@@ -106,7 +110,7 @@ + const f = document.getElementById(keep.field.id); + if (f && !f.disabled) { + f.focus({ preventScroll: true }); +- if (keep.field.start !== null) f.setSelectionRange(keep.field.start, keep.field.end); ++ if (keep.field.start != null && typeof f.setSelectionRange === 'function') f.setSelectionRange(keep.field.start, keep.field.end); + } + } else if (navigated) c.container.querySelector('h1')?.focus({ preventScroll: true }); + } +@@ -126,7 +130,7 @@ + paint(); return; + } + const old = current; +- current = { container, kind, id, canSend, projects: old?.projects ?? [], threads: old?.threads ?? [], repos: old?.repos ?? [], error: '', refused: false }; ++ current = { container, kind, id, canSend, projects: old?.projects ?? [], threads: old?.threads ?? [], repos: old?.repos ?? [], instances: old?.instances ?? [], instanceError: kind === 'project' ? 'Reading thread instances…' : '', error: '', refused: false }; + if (navigated || !old) container.innerHTML = '

Reading chat…

'; + try { + const s = kind === 'thread' ? state(id) : null; +@@ -147,6 +151,25 @@ + s.receipt = 'Message shown in this conversation.'; s.receiptId = null; + } + } ++ if (kind === 'project') { ++ try { ++ const listed = await request('instances', undefined, signal); ++ if (g !== generation || out()) return; ++ if (!listed.rows.every(row => typeof row?.instance === 'string' && /^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,159}$/.test(row.instance) && typeof row.name === 'string')) ++ throw new ChatError('invalid-response'); ++ current.instances = listed.rows; current.instanceError = ''; ++ const f = form(id); ++ if (f.instance && !listed.rows.some(row => row.instance === f.instance)) { ++ f.instance = ''; f.instanceChosen = true; ++ f.receipt = 'The selected instance is no longer available. Choose who this thread is with.'; ++ } ++ if (!f.instanceChosen && !f.instance && listed.rows.length === 1) f.instance = listed.rows[0].instance; ++ } catch (err) { ++ if (err.name === 'AbortError' || out() || g !== generation) return; ++ current.instances = []; ++ current.instanceError = "Couldn't read the thread instances; reload to try again"; ++ } ++ } + // Repository choices are optional metadata; an unavailable read must not block unlinked chat. + if (kind === 'list') { + try { +@@ -179,7 +202,11 @@ + if (!current || out()) return; + if (event.target.id === 'chat-body') state(current.id).draft = event.target.value; + const f = event.target.closest('.chat-create'); +- if (f && event.target.dataset.chatField) form(f.dataset.key)[event.target.dataset.chatField] = event.target.value; ++ if (f && event.target.dataset.chatField) { ++ const draft = form(f.dataset.key), field = event.target.dataset.chatField; ++ draft[field] = event.target.value; ++ if (field === 'instance') { draft.instanceChosen = true; draft.receipt = ''; paint(); } ++ } + }); + document.addEventListener('scroll', event => { + if (event.target.matches?.('.chat-log') && current?.kind === 'thread') { +@@ -232,7 +259,8 @@ + void write('send', id, { body: state(id).draft }, `threads/${id}/messages`); + } else if (event.target.classList.contains('chat-create')) { + const key = event.target.dataset.key, f = form(key), project = key === 'projects'; +- const value = project ? { name: f.name, ...(f.repo ? { repo: f.repo } : {}) } : { project: key, name: f.name }; ++ if (!project && (current.instanceError || !(current.instances ?? []).some(row => row.instance === f.instance))) return; ++ const value = project ? { name: f.name, ...(f.repo ? { repo: f.repo } : {}) } : { project: key, name: f.name, instance: f.instance }; + void write(project ? 'createProject' : 'createThread', key, value, project ? 'projects' : 'threads'); + } + }); +diff --git a/packages/webui/src/serve.mjs b/packages/webui/src/serve.mjs +index cd51a0b6e..56fcdd4e1 100644 +--- a/packages/webui/src/serve.mjs ++++ b/packages/webui/src/serve.mjs +@@ -8,6 +8,7 @@ import { BusReadError, busStatus as coreBusStatus, subjectOk, sendOutcome } from + // Row 176, sage-1111: HTTP-only tester refusals; the row-164 transport pin stays untouched. + const busStatus = code => ['tester-off', 'tester-required'].includes(code) ? 403 : coreBusStatus(code); + import { ReadError, readStatus, fieldTable } from './reads.mjs'; ++import { THREAD_DEFINITIONS } from '../../business/src/vocabulary.mjs'; + import { chatHTTP } from './chat-http.mjs'; + import { processingHTTP } from './processing-http.mjs'; + +@@ -740,6 +741,25 @@ export async function startServer({ host = '127.0.0.1', port = 7330, board = DEF + if (req.method !== 'POST') return json(res, 405, { error: 'method not allowed' }); + return busSend(req, res, { send, preview: signer, log }); + } ++ // Row 219: labels only, from this listener's own human or tester bus, after auth above. ++ if (path === '/api/chat/instances') { ++ if (req.method !== 'GET') return json(res, 405, { error: 'method-not-allowed' }); ++ if (search) return json(res, 400, { error: 'invalid-request' }); ++ if (!bus?.instances) return json(res, 503, { error: 'not-configured' }); ++ try { ++ const value = await bus.instances(); ++ if (!value || !value.instances || typeof value.instances !== 'object' || Array.isArray(value.instances)) ++ throw new BusReadError('invalid-response'); ++ const rows = Object.entries(value.instances) ++ .filter(([, entry]) => THREAD_DEFINITIONS.includes(entry?.definition)) ++ .map(([instance, entry]) => ({ instance, name: entry.vars?.['persona.name'] || instance })); ++ if (rows.some(row => typeof row.name !== 'string')) throw new BusReadError('invalid-response'); ++ return json(res, 200, { rows, at: new Date().toISOString() }); ++ } catch (err) { ++ const code = err instanceof BusReadError ? err.code : 'invalid-response'; ++ return json(res, busStatus(code), { error: code }); ++ } ++ } + if (path === '/api/chat' || path.startsWith('/api/chat/')) { + return chatHTTP(req, res, { path, search, chat, named, send, preview: writer, log }); + } +diff --git a/packages/webui/tests/chat-browser.test.mjs b/packages/webui/tests/chat-browser.test.mjs +index f3eeeca96..cc3ec093d 100644 +--- a/packages/webui/tests/chat-browser.test.mjs ++++ b/packages/webui/tests/chat-browser.test.mjs +@@ -12,6 +12,7 @@ const HOSTILE = '\u001b[31m\u202eevil'; + const stub = `(() => { + const real = fetch.bind(window); + window.__writes=[];window.__reads=[];window.__answers=[];window.__pages=[]; ++ window.__instances=[{instance:'assistant',name:'assistant'}]; + window.__projects=[{id:'${P}', name:${JSON.stringify(HOSTILE)}, repo:null},{id:'\">',name:'Invalid record'}]; + window.__threads=[{id:'${A}',project:'${P}',name:'alpha',instance:'assistant'}, {id:'${B}',project:'${P}',name:'beta',instance:'assistant'}]; + window.fetch=async (url,init={})=>{ +@@ -33,6 +34,7 @@ const stub = `(() => { + window.__reads.push(path); + if(window.__holdRead && path.includes(window.__holdRead)){window.__heldSignal=init.signal;await new Promise(r=>window.__releaseRead=r);} + if(window.__readFailure)return new Response(JSON.stringify({error:window.__readFailure}),{status:window.__readFailure==='thread-not-owned'?403:503}); ++ if(path==='/api/chat/instances')return window.__instanceFailure ? new Response(JSON.stringify({error:'not-configured'}),{status:503}) : data({rows:window.__instances}); + if(path==='/api/chat/projects')return data({rows:window.__projects}); + if(path.startsWith('/api/chat/threads')&&!path.includes('/messages'))return data({rows:window.__threads}); + if(window.__pages.length)return data(window.__pages.shift()); +@@ -82,7 +84,7 @@ test('chat browser: list/create named projects and threads, hostile labels inert + await b.evaluate(`window.__answers.push({body:{id:'${A}',instance:'assistant'}}),true`); + await click('#chat-thread-form button[type=submit]'); + await wait('document.querySelector("#chat-send-form")'); +- assert.deepEqual(await b.evaluate('window.__writes[1].body'), { project: P, name: 'named thread' }); ++ assert.deepEqual(await b.evaluate('window.__writes[1].body'), { project: P, name: 'named thread', instance: 'assistant' }); + assert.equal(await b.evaluate('window.__writes[1].path'), '/api/chat/threads'); + assert.equal(await b.evaluate('window.__writes.length'), 2); + }); +@@ -264,3 +266,65 @@ test('chat browser: a late project creation receipt cannot navigate away from an + assert.equal(await b.evaluate('location.hash'), '#/chat/threads/' + A); + assert.equal(await b.evaluate('document.querySelector("#chat-body").value'), 'stay in alpha'); + }); ++ ++test('C2-09a picker: no silent choice, duplicate hostile labels stay inert, selection survives refresh and reaches POST', async t => { ++ const { b, wait, set, click, refresh } = await setup(t); ++ await b.evaluate(`window.__instances=[{instance:'bean',name:${JSON.stringify(HOSTILE)}},{instance:'chet',name:${JSON.stringify(HOSTILE)}}];location.hash='#/chat/projects/${P}';true`); ++ await wait('document.querySelectorAll("#chat-instance option").length===3'); ++ assert.equal(await b.evaluate('document.querySelector("#chat-instance").value'), ''); ++ assert.equal(await b.evaluate('document.querySelector("#chat-instance").required'), true); ++ assert.equal(await b.evaluate('document.querySelector("#chat-thread-form button").disabled'), true); ++ const labels = await b.evaluate('[...document.querySelectorAll("#chat-instance option")].map(o=>o.textContent)'); ++ assert.match(labels[1], /\(bean\)/); ++ assert.match(labels[2], /\(chet\)/); ++ assert.doesNotMatch(labels.join(''), /[\u202a-\u202e\u2066-\u2069]/u); ++ assert.equal(await b.evaluate('!!document.querySelector("#chat-thread-form img")'), false); ++ assert.equal(await b.evaluate('window.injected'), undefined); ++ await set('#chat-thread-name', 'Bean discussion'); ++ await click('#chat-thread-form button'); ++ assert.equal(await b.evaluate('window.__writes.length'), 0); ++ await set('#chat-instance', 'bean'); ++ await refresh(); ++ assert.equal(await b.evaluate('document.querySelector("#chat-instance").value'), 'bean'); ++ assert.equal(await b.evaluate('document.querySelector("#chat-thread-name").value'), 'Bean discussion'); ++ assert.equal(await b.evaluate('document.querySelector("#chat-thread-form button").disabled'), false); ++ await b.evaluate(`window.__answers.push({body:{id:'${A}',instance:'bean'}});true`); ++ await click('#chat-thread-form button'); ++ await wait('window.__writes.length===1'); ++ assert.deepEqual(await b.evaluate('window.__writes[0]'), { path: '/api/chat/threads', body: { project: P, name: 'Bean discussion', instance: 'bean' }, redirect: 'manual' }); ++}); ++ ++test('C2-09a picker: metadata failure, empty set and removed pick explain disabled state and recover without switching', async t => { ++ const { b, wait, set, refresh } = await setup(t); ++ await b.evaluate(`window.__instanceFailure=true;location.hash='#/chat/projects/${P}';true`); ++ await wait('document.querySelector("#chat-thread-form") && !document.querySelector(".chat-loading")'); ++ assert.match(await b.evaluate('document.querySelector("#chat-thread-form [role=status]").textContent'), /read the thread instances/); ++ assert.equal(await b.evaluate('document.querySelector("#chat-thread-form button").disabled'), true); ++ await b.evaluate('window.__instanceFailure=false;window.__instances=[];true'); ++ await refresh(); ++ assert.match(await b.evaluate('document.querySelector("#chat-thread-form [role=status]").textContent'), /No thread instances/); ++ assert.equal(await b.evaluate('document.querySelector("#chat-thread-form button").disabled'), true); ++ await b.evaluate("window.__instances=[{instance:'bean',name:'Bean'},{instance:'chet',name:'Chet'}];true"); ++ await refresh(); ++ await set('#chat-instance', 'bean'); ++ await b.evaluate("window.__instances=[{instance:'chet',name:'Chet'}];true"); ++ await refresh(); ++ assert.equal(await b.evaluate('document.querySelector("#chat-instance").value'), ''); ++ assert.match(await b.evaluate('document.querySelector("#chat-thread-form [role=status]").textContent'), /no longer available/); ++ assert.equal(await b.evaluate('document.querySelector("#chat-thread-form button").disabled'), true); ++ await refresh(); ++ assert.equal(await b.evaluate('document.querySelector("#chat-instance").value'), '', 'another refresh must not silently select the one remaining instance'); ++ await set('#chat-instance', 'chet'); ++ assert.equal(await b.evaluate('document.querySelector("#chat-thread-form button").disabled'), false); ++}); ++ ++test('C2-09a picker: a single instance is chosen explicitly but read-only mode cannot create a thread', async t => { ++ const { b, wait } = await setup(t, '?readonly'); ++ await b.evaluate(`location.hash='#/chat/projects/${P}';true`); ++ await wait('document.querySelectorAll("#chat-instance option").length===2'); ++ assert.equal(await b.evaluate('document.querySelector("#chat-instance").value'), 'assistant'); ++ assert.equal(await b.evaluate('document.querySelector("#chat-instance").disabled'), true); ++ assert.equal(await b.evaluate('document.querySelector("#chat-thread-form button").disabled'), true); ++ assert.match(await b.evaluate('document.querySelector(".chat-area").textContent'), /only reads/); ++ assert.equal(await b.evaluate('window.__writes.length'), 0); ++}); +diff --git a/packages/webui/tests/chat-instances.test.mjs b/packages/webui/tests/chat-instances.test.mjs +new file mode 100644 +index 000000000..893c38f80 +--- /dev/null ++++ b/packages/webui/tests/chat-instances.test.mjs +@@ -0,0 +1,87 @@ ++import test from 'node:test'; ++import assert from 'node:assert/strict'; ++import { request } from 'node:http'; ++import { mkdtempSync, rmSync } from 'node:fs'; ++import { join } from 'node:path'; ++import { tmpdir } from 'node:os'; ++import { startServer } from '../src/serve.mjs'; ++import { startTesterSocket, TESTER_ORIGIN } from '../src/tester-socket.mjs'; ++import { close } from './fixture.mjs'; ++ ++const path = '/api/chat/instances'; ++const preview = { host: 'chat.example', header: 'x-user', user: 'jason' }; ++const snapshot = { ++ revision: 'a'.repeat(64), plugins: { private: 'do-not-project' }, ++ instances: { ++ assistant: { definition: 'assistant', vars: { model: 'private-model' } }, ++ bean: { definition: 'companion', vars: { 'persona.name': 'Bean', 'persona.sha256': 'private-hash' } }, ++ chet: { definition: 'continuity', vars: { 'persona.name': 'Bean', file: '/private/path' } }, ++ pm: { definition: 'pm', vars: { 'persona.name': 'Hidden PM' } }, ++ }, ++}; ++function get(server, { route = path, method = 'GET', headers = {} } = {}) { ++ const address = server.address(), unix = typeof address === 'string'; ++ return new Promise((resolve, reject) => { ++ const req = request({ ...(unix ? { socketPath: address } : { host: '127.0.0.1', port: address.port }), ++ path: route, method, headers: { host: unix ? new URL(TESTER_ORIGIN).host : preview.host, ...headers } }, res => { ++ let text = ''; ++ res.on('data', chunk => text += chunk); ++ res.on('end', () => resolve({ status: res.statusCode, text, value: JSON.parse(text) })); ++ }); ++ req.on('error', reject); req.end(); ++ }); ++} ++test('C2-09a metadata uses the human listener bus, projects labels only and refuses unauthenticated reads', async t => { ++ let calls = 0; ++ const server = await startServer({ port: 0, preview, bus: { instances: async () => { calls++; return snapshot; } } }); ++ t.after(() => close(server)); ++ const refused = await get(server); ++ assert.equal(refused.status, 401); ++ assert.equal(calls, 0); ++ const answer = await get(server, { headers: { 'x-user': 'jason' } }); ++ assert.equal(answer.status, 200); ++ assert.deepEqual(answer.value.rows, [{ instance: 'assistant', name: 'assistant' }, { instance: 'bean', name: 'Bean' }, { instance: 'chet', name: 'Bean' }]); ++ for (const row of answer.value.rows) assert.deepEqual(Object.keys(row).sort(), ['instance', 'name']); ++ assert.doesNotMatch(answer.text, /private|Hidden PM/); ++ assert.equal(calls, 1); ++ for (const options of [{ route: path + '?extra=1' }, { method: 'POST' }]) { ++ const result = await get(server, { ...options, headers: { 'x-user': 'jason' } }); ++ assert.ok([400, 405].includes(result.status)); ++ } ++ assert.equal(calls, 1, 'invalid metadata requests never call a bus'); ++}); ++test('C2-09a metadata uses the private tester listener own bus and no human transport', async t => { ++ const root = mkdtempSync(join(tmpdir(), 'chat219-')); t.after(() => rmSync(root, { recursive: true, force: true })); ++ let reads = 0; ++ const server = await startTesterSocket({ dataRoot: root, board: 'http://127.0.0.1:9', ++ bus: { instances: async () => { reads++; return { instances: { quill: { definition: 'proofreader', vars: { 'persona.name': 'Quill' } } } }; } } }); ++ t.after(() => close(server)); ++ const answer = await get(server); ++ assert.equal(answer.status, 200); ++ assert.deepEqual(answer.value.rows, [{ instance: 'quill', name: 'Quill' }]); ++ assert.equal(reads, 1); ++}); ++test('C2-09a metadata refuses missing or malformed reads and never echoes untrusted fields', async t => { ++ for (const bus of [null, { instances: async () => ({ instances: [] }) }, { instances: async () => { throw new Error('private-path'); } }]) { ++ const server = await startServer({ port: 0, preview, bus }); t.after(() => close(server)); ++ const answer = await get(server, { headers: { 'x-user': 'jason' } }); ++ assert.ok(answer.status >= 400); ++ assert.doesNotMatch(answer.text, /private-path/); ++ } ++}); ++ ++test('C2-09a metadata stays behind the SSO session check and a GET never refreshes session activity', async t => { ++ let session = null, reads = 0; ++ const touches = []; ++ const sso = { publicHost: 'sso-chat.example', publicOrigin: 'https://sso-chat.example', formTargets: () => [], ++ session: (_req, { touch }) => { touches.push(touch); return session; } }; ++ const server = await startServer({ port: 0, sso, bus: { instances: async () => { reads++; return snapshot; } } }); ++ t.after(() => close(server)); ++ const headers = { host: sso.publicHost }; ++ assert.equal((await get(server, { headers })).status, 401); ++ assert.equal(reads, 0); ++ session = { name: 'jason' }; ++ assert.equal((await get(server, { headers })).status, 200); ++ assert.equal(reads, 1); ++ assert.deepEqual(touches, [false, false]); ++}); +diff --git a/packages/webui/tests/chat.test.mjs b/packages/webui/tests/chat.test.mjs +index 8c11611cf..b47ecf1a7 100644 +--- a/packages/webui/tests/chat.test.mjs ++++ b/packages/webui/tests/chat.test.mjs +@@ -335,3 +335,21 @@ test('the chat seam names the transport it is given: the human one and the teste + assert.throws(() => createChat({}), { name: 'TypeError', message: 'chat needs a bus transport function' }); + assert.equal(typeof createChat({ call: async () => ({}) }).projects, 'function'); + }); ++ ++test('C2-09a createThread forwards an explicit instance through the existing channel', async t => { ++ const c = await setup(t); ++ c.state.answer = { id: T, instance: 'bean' }; ++ const answer = await c.get('/api/chat/threads', { method: 'POST', value: { project: P, name: 'Bean work', instance: 'bean' } }); ++ assert.equal(answer.status, 200); ++ assert.deepEqual(c.calls, [['thread.create', { project: P, name: 'Bean work', instance: 'bean' }]]); ++ assert.equal(answer.data.instance, 'bean'); ++}); ++test('C2-09a malformed instance and extra thread fields refuse before the channel write', async t => { ++ const c = await setup(t); ++ for (const value of [null, 7, {}, [], '', 'bad name', 'bean/../../other']) { ++ const answer = await c.get('/api/chat/threads', { method: 'POST', value: { project: P, name: 'work', instance: value } }); ++ assert.equal(answer.status, 400, JSON.stringify(value)); ++ } ++ assert.equal((await c.get('/api/chat/threads', { method: 'POST', value: { project: P, name: 'work', instance: 'bean', extra: true } })).status, 400); ++ assert.deepEqual(c.calls, []); ++}); diff --git a/agents/rocko/work/queue-219/r4/candidate-manifest.sha256 b/agents/rocko/work/queue-219/r4/candidate-manifest.sha256 new file mode 100644 index 000000000..94db5dd71 --- /dev/null +++ b/agents/rocko/work/queue-219/r4/candidate-manifest.sha256 @@ -0,0 +1,16 @@ +142a210882535108159e045c61be288bc8703910a8ee0169137bc1eb80baff64 packages/bus/src/broker.mjs +b0c66c8999b567896923f6c876911dba936c6eca1ccc7aaeada51369fd613594 packages/bus/tests/creative.test.mjs +3efd0238da60e0bfcd3b25e5256b9c213085119a86a7b852b13e7a60340d3a24 packages/bus/tests/grant-executor.test.mjs +b7ea857637947c7a9ca45c56cea47e37e06f0fd8446ea91316990d9fa7299a7a packages/bus/tests/project-runtime.test.mjs +264d82944c53b638bf6a14cc0706cf9ba184d668211c2b9c1031cdbe88e84bb9 packages/bus/tests/threads.test.mjs +8f7d6745fffb2a0898ac80c012084ac48964748da6439a8c56facc6529ffb19b packages/bus/tests/user-principal.test.mjs +b74275ce43249bafc97edc87a6a3aa0431c62fe1a28cd9fa265246e6d6da219b packages/cli/src/launcher.mjs +2c3f120dfdc0b52bf8ab38a88e86251be75d4b0d218e23df489dcaf815d6bc15 packages/cli/tests/launcher.test.mjs +7f308fdf601e839194f026beb3fea279eba1e356ce2756aa4a42fa4873b79b30 packages/cli/tests/thread-launch.test.mjs +39c6d207e026debb7db8aade5534503847d0f5c84d560ba28f3cd65490378363 packages/webui/src/chat-http.mjs +77878dd33fd9e0381deb996969389dde21c109eaddf46a8a5c91907ec0dfe24e packages/webui/src/chat.mjs +8e89df5fe8a9da35de41b5968afc6efcd92503e92ef28c6f557bb5371d10d1a4 packages/webui/src/public/chat.js +443c83debe21559de2e4a6bcc07514bce9bebe209df58b8011827fcc1cabd905 packages/webui/src/serve.mjs +d918e5b061ced9db28337a9b02c7042f9ddafaf09f32affce9f51190c0cba93f packages/webui/tests/chat-browser.test.mjs +2bad14535372488de326b82b791b79a61e1a4ab839458535132958ef85b746eb packages/webui/tests/chat-instances.test.mjs +7779d33d5b1dd3fe183722d0f91ff1f71e741e113cf2d5ee407f3d26428fc162 packages/webui/tests/chat.test.mjs diff --git a/agents/rocko/work/queue-219/r4/changed-paths.txt b/agents/rocko/work/queue-219/r4/changed-paths.txt new file mode 100644 index 000000000..1b56283af --- /dev/null +++ b/agents/rocko/work/queue-219/r4/changed-paths.txt @@ -0,0 +1,16 @@ +packages/bus/src/broker.mjs +packages/bus/tests/creative.test.mjs +packages/bus/tests/grant-executor.test.mjs +packages/bus/tests/project-runtime.test.mjs +packages/bus/tests/threads.test.mjs +packages/bus/tests/user-principal.test.mjs +packages/cli/src/launcher.mjs +packages/cli/tests/launcher.test.mjs +packages/cli/tests/thread-launch.test.mjs +packages/webui/src/chat-http.mjs +packages/webui/src/chat.mjs +packages/webui/src/public/chat.js +packages/webui/src/serve.mjs +packages/webui/tests/chat-browser.test.mjs +packages/webui/tests/chat-instances.test.mjs +packages/webui/tests/chat.test.mjs diff --git a/agents/rocko/work/queue-219/r4/packet-manifest.sha256 b/agents/rocko/work/queue-219/r4/packet-manifest.sha256 new file mode 100644 index 000000000..28b121e5e --- /dev/null +++ b/agents/rocko/work/queue-219/r4/packet-manifest.sha256 @@ -0,0 +1,8 @@ +5d6dae09c07f34332cc939a58610cb0659e1be36400304e0d3eef479bbcdc0d0 BUILD.md +2ce65e27aeb4cc563dbe179efbf5a120d6ac48f597e477c3648e58d28d829082 SHORT-RUN-PLAN.md +5209e39f588a709962baae627fa0e66a3bf6ed7d6fe66ca3ec4dce16850ddc47 approved-tests.diff +b05b00cd9f352219b88772e78c055c329fddf5e6b3ad4d4b1067e81ab235e418 assertion-preservation.json +d7e1b464a314c7b079385f0a14a53189fe839d72d7666729026ffcb9d16a0faa base.txt +deb5e2ff721c3b5adc1390c4aaef2d8aaf4f792edbd4e6b2d4766421222c406a build.patch +451d3fcbeb6a41c3a505600898ba2025985f44d8391e2cd823ab84f1d4b50621 candidate-manifest.sha256 +5222c9f6d7c1da26f5b9447626ba8e005a7ab36006183ed36df40190b9133fb4 changed-paths.txt diff --git a/agents/rocko/work/queue-219/rebase-294-reader-prep.json b/agents/rocko/work/queue-219/rebase-294-reader-prep.json new file mode 100644 index 000000000..e5cca55df --- /dev/null +++ b/agents/rocko/work/queue-219/rebase-294-reader-prep.json @@ -0,0 +1,64 @@ +{ + "status": "preliminary on 5f2ef92e5; rerun on new base before static handoff", + "readers": { + "chat-http.mjs": [ + "packages/webui/tests/chat.test.mjs" + ], + "chat.mjs": [ + "packages/webui/tests/chat.test.mjs", + "packages/webui/tests/tester-fixture.mjs", + "packages/webui/tests/channel-chat.test.mjs" + ], + "serve.mjs": [ + "packages/control-board/tests/discord.test.mjs", + "packages/webui/tests/views.test.mjs", + "packages/webui/tests/usage-browser.test.mjs", + "packages/control-board/tests/serve.test.mjs", + "packages/webui/tests/bus.test.mjs", + "packages/webui/tests/thread-claims-browser.test.mjs", + "packages/webui/tests/history-fixture.mjs", + "packages/webui/tests/instances-browser.test.mjs", + "packages/webui/tests/chat.test.mjs", + "packages/webui/tests/chat-browser.test.mjs", + "packages/webui/tests/library-cli.test.mjs", + "packages/webui/tests/instances.test.mjs", + "packages/webui/tests/settings-form.test.mjs", + "packages/webui/tests/assistant.test.mjs", + "packages/webui/tests/editor-browser.test.mjs", + "packages/webui/tests/limits-route.test.mjs", + "packages/webui/tests/limits-browser.test.mjs", + "packages/webui/tests/sso-browser.test.mjs", + "packages/webui/tests/shell.test.mjs", + "packages/webui/tests/proof.test.mjs", + "packages/webui/tests/docs-browser.test.mjs", + "packages/webui/tests/usage.test.mjs", + "packages/webui/tests/messages.test.mjs", + "packages/webui/tests/sso.test.mjs", + "packages/webui/tests/processing.test.mjs", + "packages/webui/tests/send.test.mjs", + "packages/webui/tests/fixture.mjs", + "packages/webui/tests/project-file.test.mjs", + "packages/webui/tests/agents.test.mjs", + "packages/webui/tests/return-flow.test.mjs", + "packages/webui/tests/browser-edge.test.mjs", + "packages/webui/tests/agents-browser.test.mjs", + "packages/webui/tests/send-browser.test.mjs", + "packages/webui/tests/discord.test.mjs", + "packages/webui/tests/bus-browser.test.mjs", + "packages/webui/tests/reads.test.mjs", + "packages/webui/tests/routes-browser.test.mjs", + "packages/webui/tests/preview.test.mjs", + "packages/webui/tests/board-held.test.mjs", + "packages/webui/tests/tester-listener.test.mjs", + "packages/webui/tests/channel-chat.test.mjs", + "packages/webui/tests/processing-browser.test.mjs", + "packages/webui/tests/serve.test.mjs", + "packages/webui/tests/chat-instances.test.mjs", + "packages/webui/tests/routes.test.mjs", + "packages/webui/tests/settings-write.test.mjs", + "packages/webui/tests/thread-claims.test.mjs", + "packages/webui/tests/relaunch.test.mjs", + "packages/conversation/tests/flows.test.mjs" + ] + } +} diff --git a/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/cwd-sweep-final.json b/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/cwd-sweep-final.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/cwd-sweep-final.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/cwd-sweep.json b/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/cwd-sweep.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/cwd-sweep.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/head.json b/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/head.json new file mode 100644 index 000000000..7b97b61f3 --- /dev/null +++ b/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/head.json @@ -0,0 +1 @@ +{"head": "7cbd839d037f711de136108882b53597cf16d742", "manifest": "84a8bd9afc5420fc315586584aec91258a28bd728000dcd2cb61ac41b2fe711a", "start": "2026-10-23T06:09:43.704053+00:00"} \ No newline at end of file diff --git a/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/network-cleanup.log b/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/network-cleanup.log new file mode 100644 index 000000000..5f00a1b72 --- /dev/null +++ b/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/network-cleanup.log @@ -0,0 +1,2 @@ +Error response from daemon: network rocko-r219-gate_default not found +exit status 1 diff --git a/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/results.jsonl b/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/results.jsonl new file mode 100644 index 000000000..b5678d996 --- /dev/null +++ b/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/results.jsonl @@ -0,0 +1,5 @@ +{"label": "single-bus-creative.test", "args": ["timeout", "-k", "10", "300", "node", "--test-reporter=tap", "--test", "packages/bus/tests/creative.test.mjs"], "start": "2026-10-23T06:09:43.706182+00:00", "end": "2026-10-23T06:09:44.121877+00:00", "seconds": 0.416, "exit": 0, "timeout": false, "counts": {"tests": 4, "pass": 4, "fail": 0, "cancelled": 0, "skipped": 0}, "skips": ["# skipped 0"], "log": "agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-creative.test.tap", "tmpdir": "/mnt/storage/scratch/tmp/rmc2uerc6"} +{"label": "single-bus-threads.test", "args": ["timeout", "-k", "10", "300", "node", "--test-reporter=tap", "--test", "packages/bus/tests/threads.test.mjs"], "start": "2026-10-23T06:09:44.123566+00:00", "end": "2026-10-23T06:09:45.490657+00:00", "seconds": 1.367, "exit": 0, "timeout": false, "counts": {"tests": 19, "pass": 19, "fail": 0, "cancelled": 0, "skipped": 0}, "skips": ["# skipped 0"], "log": "agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-threads.test.tap", "tmpdir": "/mnt/storage/scratch/tmp/rismt3po4"} +{"label": "single-bus-user-principal.test", "args": ["timeout", "-k", "10", "300", "node", "--test-reporter=tap", "--test", "packages/bus/tests/user-principal.test.mjs"], "start": "2026-10-23T06:09:45.492192+00:00", "end": "2026-10-23T06:09:46.107814+00:00", "seconds": 0.616, "exit": 0, "timeout": false, "counts": {"tests": 23, "pass": 23, "fail": 0, "cancelled": 0, "skipped": 0}, "skips": ["# skipped 0"], "log": "agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-user-principal.test.tap", "tmpdir": "/mnt/storage/scratch/tmp/repq8xlqh"} +{"label": "single-cli-launcher.test", "args": ["timeout", "-k", "10", "300", "node", "--test-reporter=tap", "--test", "packages/cli/tests/launcher.test.mjs"], "start": "2026-10-23T06:09:46.109200+00:00", "end": "2026-10-23T06:10:12.635877+00:00", "seconds": 26.527, "exit": 0, "timeout": false, "counts": {"tests": 34, "pass": 34, "fail": 0, "cancelled": 0, "skipped": 0}, "skips": ["# skipped 0"], "log": "agents/rocko/work/queue-219/run-4a9c-mos1408/single-cli-launcher.test.tap", "tmpdir": "/mnt/storage/scratch/tmp/rkqztfjx8"} +{"label": "single-cli-thread-launch.test", "args": ["timeout", "-k", "10", "300", "node", "--test-reporter=tap", "--test", "packages/cli/tests/thread-launch.test.mjs"], "start": "2026-10-23T06:10:12.637449+00:00", "end": "2026-10-23T06:10:30.695792+00:00", "seconds": 18.058, "exit": 1, "timeout": false, "counts": {"tests": 14, "pass": 13, "fail": 1, "cancelled": 0, "skipped": 0}, "skips": ["# skipped 0"], "log": "agents/rocko/work/queue-219/run-4a9c-mos1408/single-cli-thread-launch.test.tap", "tmpdir": "/mnt/storage/scratch/tmp/rbyz9a6iu"} diff --git a/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/single-bus-creative.test.tap b/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/single-bus-creative.test.tap new file mode 100644 index 000000000..978d05307 --- /dev/null +++ b/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/single-bus-creative.test.tap @@ -0,0 +1,36 @@ +TAP version 13 +# organization: {"event":"reload-needs-restart","business":"demo"} +# organization: {"event":"reload-needs-restart","business":"demo"} +# Subtest: M6: a creative raise refuses decision-not-allowed, cited or not, and no decision row appears; the assistant still raises +ok 1 - M6: a creative raise refuses decision-not-allowed, cited or not, and no decision row appears; the assistant still raises + --- + duration_ms: 43.416235 + type: 'test' + ... +# Subtest: a creative instance sends only to the user and hears only from the user +ok 2 - a creative instance sends only to the user and hears only from the user + --- + duration_ms: 43.274527 + type: 'test' + ... +# Subtest: M10 through the broker: the chief and the tester are refused on bean, the human's limits.set of its models key works +ok 3 - M10 through the broker: the chief and the tester are refused on bean, the human's limits.set of its models key works + --- + duration_ms: 76.669863 + type: 'test' + ... +# Subtest: row 256 T6 the human deletes a creative instance through the broker; the chief and the tester are refused at the verb +ok 4 - row 256 T6 the human deletes a creative instance through the broker; the chief and the tester are refused at the verb + --- + duration_ms: 60.418493 + type: 'test' + ... +1..4 +# tests 4 +# suites 0 +# pass 4 +# fail 0 +# cancelled 0 +# skipped 0 +# todo 0 +# duration_ms 374.784911 diff --git a/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/single-bus-threads.test.tap b/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/single-bus-threads.test.tap new file mode 100644 index 000000000..b05384a32 --- /dev/null +++ b/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/single-bus-threads.test.tap @@ -0,0 +1,124 @@ +TAP version 13 +# Subtest: REQ-ROLE-2 REQ-THREAD-1: one holder per thread, through the broker and the trigger +ok 1 - REQ-ROLE-2 REQ-THREAD-1: one holder per thread, through the broker and the trigger + --- + duration_ms: 37.977187 + type: 'test' + ... +# Subtest: REQ-ROLE-2 REQ-THREAD-1: the 3e triggers refuse writes that skip the broker +ok 2 - REQ-ROLE-2 REQ-THREAD-1: the 3e triggers refuse writes that skip the broker + --- + duration_ms: 68.5376 + type: 'test' + ... +# Subtest: REQ-MSG-1: a message to or from the assistant names its thread, or is refused +ok 3 - REQ-MSG-1: a message to or from the assistant names its thread, or is refused + --- + duration_ms: 33.043064 + type: 'test' + ... +# Subtest: REQ-MSG-1: the chief of staff's reply comes back to the thread that sent the work +ok 4 - REQ-MSG-1: the chief of staff's reply comes back to the thread that sent the work + --- + duration_ms: 616.013932 + type: 'test' + ... +# Subtest: REQ-MSG-1: a reply can't carry one thread instance's thread to another thread instance +ok 5 - REQ-MSG-1: a reply can't carry one thread instance's thread to another thread instance + --- + duration_ms: 22.785202 + type: 'test' + ... +# Subtest: REQ-THREAD-1 REQ-USER-2: one thread's messages never reach another thread's holder +ok 6 - REQ-THREAD-1 REQ-USER-2: one thread's messages never reach another thread's holder + --- + duration_ms: 27.208648 + type: 'test' + ... +# Subtest: REQ-LAUNCH-1: a message to a thread with no holder waits, and the next holder gets it +ok 7 - REQ-LAUNCH-1: a message to a thread with no holder waits, and the next holder gets it + --- + duration_ms: 29.67741 + type: 'test' + ... +# Subtest: REQ-THREAD-2 REQ-LAUNCH-1: threadIdle releases only a thread with nothing waiting, and only for its holder +ok 8 - REQ-THREAD-2 REQ-LAUNCH-1: threadIdle releases only a thread with nothing waiting, and only for its holder + --- + duration_ms: 33.136315 + type: 'test' + ... +# Subtest: REQ-THREAD-2 REQ-LAUNCH-1: a message delivered to a run that ended unread doesn't hold up the next holder +ok 9 - REQ-THREAD-2 REQ-LAUNCH-1: a message delivered to a run that ended unread doesn't hold up the next holder + --- + duration_ms: 30.610794 + type: 'test' + ... +# Subtest: REQ-ROLE-2 REQ-THREAD-1 Q169: a role.revoke the human approved ends every thread run of the assistant +ok 10 - REQ-ROLE-2 REQ-THREAD-1 Q169: a role.revoke the human approved ends every thread run of the assistant + --- + duration_ms: 27.293744 + type: 'test' + ... +# Subtest: Q169 REQ-USER-2: assistant.stop ends the human's own assistant thread runs, and only the human's +ok 11 - Q169 REQ-USER-2: assistant.stop ends the human's own assistant thread runs, and only the human's + --- + duration_ms: 39.426851 + type: 'test' + ... +# Subtest: REQ-USER-2: the human verbs refuse another owner's thread +ok 12 - REQ-USER-2: the human verbs refuse another owner's thread + --- + duration_ms: 30.185753 + type: 'test' + ... +# Subtest: REQ-THREAD-1: thread.create refuses when the business has no thread instance or more than one +ok 13 - REQ-THREAD-1: thread.create refuses when the business has no thread instance or more than one + --- + duration_ms: 25.774336 + type: 'test' + ... +# Subtest: REQ-ORG-2: projects and threads are named once, and the repo names a business project +ok 14 - REQ-ORG-2: projects and threads are named once, and the repo names a business project + --- + duration_ms: 26.886111 + type: 'test' + ... +# Subtest: REQ-THREAD-2: thread.messages returns the thread's history in pages and writes nothing +ok 15 - REQ-THREAD-2: thread.messages returns the thread's history in pages and writes nothing + --- + duration_ms: 90.298865 + type: 'test' + ... +# Subtest: project.create refuses a repository name without its matching repo before any write +ok 16 - project.create refuses a repository name without its matching repo before any write + --- + duration_ms: 16.900927 + type: 'test' + ... +# Subtest: project.create keeps unrelated names with and without a repository +ok 17 - project.create keeps unrelated names with and without a repository + --- + duration_ms: 11.07789 + type: 'test' + ... +# Subtest: C2-09a: explicit creative instances bind independent threads, default sessions and holders +ok 18 - C2-09a: explicit creative instances bind independent threads, default sessions and holders + --- + duration_ms: 47.924595 + type: 'test' + ... +# Subtest: C2-09a: explicit missing, non-thread and malformed selectors create no thread or session +ok 19 - C2-09a: explicit missing, non-thread and malformed selectors create no thread or session + --- + duration_ms: 19.917458 + type: 'test' + ... +1..19 +# tests 19 +# suites 0 +# pass 19 +# fail 0 +# cancelled 0 +# skipped 0 +# todo 0 +# duration_ms 1316.555344 diff --git a/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/single-bus-user-principal.test.tap b/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/single-bus-user-principal.test.tap new file mode 100644 index 000000000..fa7fb3a32 --- /dev/null +++ b/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/single-bus-user-principal.test.tap @@ -0,0 +1,148 @@ +TAP version 13 +# Subtest: R3: bindUser binds a granted user and refuses one with no live grant +ok 1 - R3: bindUser binds a granted user and refuses one with no live grant + --- + duration_ms: 14.967712 + type: 'test' + ... +# Subtest: R3: a user named like the business human, the tester or a principal word is refused, whatever the grants say +ok 2 - R3: a user named like the business human, the tester or a principal word is refused, whatever the grants say + --- + duration_ms: 10.570753 + type: 'test' + ... +# Subtest: R3: each collaborator verb is allowed to a granted user +ok 3 - R3: each collaborator verb is allowed to a granted user + --- + duration_ms: 20.155376 + type: 'test' + ... +# Subtest: R3: every verb off the collaborator list refuses a user access-refused before its own checks +ok 4 - R3: every verb off the collaborator list refuses a user access-refused before its own checks + --- + duration_ms: 102.151204 + type: 'test' + ... +# Subtest: R3: task, web and host verbs refuse a user access-refused +ok 5 - R3: task, web and host verbs refuse a user access-refused + --- + duration_ms: 23.297818 + type: 'test' + ... +# Subtest: R3 leak: project.list shows granted projects only +ok 6 - R3 leak: project.list shows granted projects only + --- + duration_ms: 13.028484 + type: 'test' + ... +# Subtest: R3 leak: thread.create needs the project and the thread instance granted, and an ungranted id reads as one that does not exist +ok 7 - R3 leak: thread.create needs the project and the thread instance granted, and an ungranted id reads as one that does not exist + --- + duration_ms: 17.131417 + type: 'test' + ... +# Subtest: R3 leak: thread.list shows the user its own threads that are still granted, never others +ok 8 - R3 leak: thread.list shows the user its own threads that are still granted, never others + --- + duration_ms: 34.619156 + type: 'test' + ... +# Subtest: R3 leak: names shows granted instances only +ok 9 - R3 leak: names shows granted instances only + --- + duration_ms: 15.416042 + type: 'test' + ... +# Subtest: R3: thread.send is from user: and writes no human.input +ok 10 - R3: thread.send is from user: and writes no human.input + --- + duration_ms: 13.82133 + type: 'test' + ... +# Subtest: R3: a reply-chain message.send into another user thread is refused +ok 11 - R3: a reply-chain message.send into another user thread is refused + --- + duration_ms: 15.982484 + type: 'test' + ... +# Subtest: R3: the run reply to a user message reaches that user thread.messages, with no waiting and no notice +ok 12 - R3: the run reply to a user message reaches that user thread.messages, with no waiting and no notice + --- + duration_ms: 19.055939 + type: 'test' + ... +# Subtest: R3: a reply to: user without a matching in_reply_to is refused user-reply-required +ok 13 - R3: a reply to: user without a matching in_reply_to is refused user-reply-required + --- + duration_ms: 28.510227 + type: 'test' + ... +# Subtest: R3: a non-thread run, the human and the tester cannot send to: user +ok 14 - R3: a non-thread run, the human and the tester cannot send to: user + --- + duration_ms: 18.072201 + type: 'test' + ... +# Subtest: R3: a user thread run cannot message the owner, while its uncited gated raise reaches only the owner inbox, B9 +ok 15 - R3: a user thread run cannot message the owner, while its uncited gated raise reaches only the owner inbox, B9 + --- + duration_ms: 20.4668 + type: 'test' + ... +# Subtest: R3: a removed or expired grant refuses the next request access-revoked, and the file is read per request +ok 16 - R3: a removed or expired grant refuses the next request access-revoked, and the file is read per request + --- + duration_ms: 17.954184 + type: 'test' + ... +# Subtest: R3: a user refusal is recorded as action.refused by user: +ok 17 - R3: a user refusal is recorded as action.refused by user: + --- + duration_ms: 15.466589 + type: 'test' + ... +# Subtest: R3: a business with a role keyed user refuses invalid-business +ok 18 - R3: a business with a role keyed user refuses invalid-business + --- + duration_ms: 10.080838 + type: 'test' + ... +# Subtest: R3: name.set refuses the name user +ok 19 - R3: name.set refuses the name user + --- + duration_ms: 10.585336 + type: 'test' + ... +# Subtest: R3 r4: while halted, a granted user's thread.send refuses processing-halted and thread.messages still answers +ok 20 - R3 r4: while halted, a granted user's thread.send refuses processing-halted and thread.messages still answers + --- + duration_ms: 14.198383 + type: 'test' + ... +# Subtest: R3 r4: the chief's hire refuses an instance named user with the code it gives human and tester +ok 21 - R3 r4: the chief's hire refuses an instance named user with the code it gives human and tester + --- + duration_ms: 16.565998 + type: 'test' + ... +# Subtest: R3 r4: a non-function access throws before the store is read +ok 22 - R3 r4: a non-function access throws before the store is read + --- + duration_ms: 0.139037 + type: 'test' + ... +# Subtest: C2-09a: naming an instance cannot bypass its collaborator grant or disclose an ungranted project +ok 23 - C2-09a: naming an instance cannot bypass its collaborator grant or disclose an ungranted project + --- + duration_ms: 17.431688 + type: 'test' + ... +1..23 +# tests 23 +# suites 0 +# pass 23 +# fail 0 +# cancelled 0 +# skipped 0 +# todo 0 +# duration_ms 550.515661 diff --git a/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/single-cli-launcher.test.tap b/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/single-cli-launcher.test.tap new file mode 100644 index 000000000..2ca5baf8a --- /dev/null +++ b/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/single-cli-launcher.test.tap @@ -0,0 +1,230 @@ +TAP version 13 +# Subtest: C2-04: launcher workspace clones code but never the library +ok 1 - C2-04: launcher workspace clones code but never the library + --- + duration_ms: 1386.548788 + type: 'test' + ... +# Subtest: bus start --pm: the launcher instance (the chief of staff) runs under its own PID namespace, registered, with a manifest +ok 2 - bus start --pm: the launcher instance (the chief of staff) runs under its own PID namespace, registered, with a manifest + --- + duration_ms: 1321.365393 + type: 'test' + ... +# usage: {"event":"usage-unknown","business":"acme","run":"rfeb27e280740","instance":"chief","turn":"6c7140a2-fbf2-4eb5-aade-18915e5d6071","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r4d1379ff54ed","instance":"coder","turn":"0828e9f0-3389-4d81-b773-d33ac8ed9436","source":"@none","code":"baseline-unknown"} +# Subtest: the chief of staff launches a coder through its launch tool; the coder answers; refusals name their code +ok 3 - the chief of staff launches a coder through its launch tool; the coder answers; refusals name their code + --- + duration_ms: 729.440258 + type: 'test' + ... +# usage: {"event":"usage-unknown","business":"acme","run":"r6b4b3482e67f","instance":"chief","turn":"aa4f1c16-5525-464e-bf32-86dce3279b86","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r1c029998bdea","instance":"pm","turn":"9bcd06eb-6a90-41fb-80ae-56a32bc1c628","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r6b4b3482e67f","instance":"chief","turn":"8bbc58a8-f1e1-478c-957b-76e1d7d3a0d4","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r1c029998bdea","instance":"pm","turn":"e1f9e391-0762-4643-bdfb-737a3f75468c","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r1c029998bdea","instance":"pm","turn":"ee01381b-77c5-4737-9963-cc39bfcf3329","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r6b4b3482e67f","instance":"chief","turn":"48edb0d5-0ec4-4e59-9eae-4f767252eaf9","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r1c029998bdea","instance":"pm","turn":"837ddcc0-6e74-408d-a21f-aeefc287e380","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r6b4b3482e67f","instance":"chief","turn":"702b0c7b-18c4-4f01-b71b-29fdf5ae1d79","source":"@none","code":"baseline-unknown"} +# Subtest: a launched pm's request_staff reaches the chief of staff; no other session has the tool and the launch limits still hold +ok 4 - a launched pm's request_staff reaches the chief of staff; no other session has the tool and the launch limits still hold + --- + duration_ms: 1260.785468 + type: 'test' + ... +# Subtest: each launch makes sure the workspace has a clone of the project: cloned, fast-forwarded, or fetched and logged +ok 5 - each launch makes sure the workspace has a clone of the project: cloned, fast-forwarded, or fetched and logged + --- + duration_ms: 4079.777924 + type: 'test' + ... +# Subtest: a role the broker says holds a merge decision gets land_work, its prompt line, its landing and the git socket; without it, none +ok 6 - a role the broker says holds a merge decision gets land_work, its prompt line, its landing and the git socket; without it, none + --- + duration_ms: 602.445534 + type: 'test' + ... +# Subtest: REQ-LAUNCH-1 the tick starts a listed merge decision holder once, with land_work, the Landing line and its landing turn; an unlisted holder starts nothing +ok 7 - REQ-LAUNCH-1 the tick starts a listed merge decision holder once, with land_work, the Landing line and its landing turn; an unlisted holder starts nothing + --- + duration_ms: 401.42897 + type: 'test' + ... +# usage: {"event":"usage-unknown","business":"acme","run":"r91e3ad863ad3","instance":"coder","turn":"b80d99c8-e809-4461-9c46-6b36ca47b775","source":"@none","code":"baseline-unknown"} +# Subtest: a holder running since before the resolution is stopped once the broker releases it, land-relaunch, and the next tick starts it: landing turn first, then the message that waited +ok 8 - a holder running since before the resolution is stopped once the broker releases it, land-relaunch, and the next tick starts it: landing turn first, then the message that waited + --- + duration_ms: 676.724798 + type: 'test' + ... +# Subtest: a landing run that ended isn't started again for its decision, a spent decision starts nothing, and a new decision starts the holder +ok 9 - a landing run that ended isn't started again for its decision, a spent decision starts nothing, and a new decision starts the holder + --- + duration_ms: 578.985078 + type: 'test' + ... +# Subtest: after a restart, the new host's first tick starts a holder whose decision is still held +ok 10 - after a restart, the new host's first tick starts a holder whose decision is still held + --- + duration_ms: 870.835521 + type: 'test' + ... +# Subtest: a refused landing start is logged once per code with its decision, isn't a start, and the next tick with room starts the holder +ok 11 - a refused landing start is logged once per code with its decision, isn't a start, and the next tick with room starts the holder + --- + duration_ms: 633.801547 + type: 'test' + ... +# Subtest: a project clone that can't be made refuses checkout-failed, from --chief and from a session, with no run and no clone left +ok 12 - a project clone that can't be made refuses checkout-failed, from --chief and from a session, with no run and no clone left + --- + duration_ms: 281.44642 + type: 'test' + ... +# Subtest: a runner that stops at once ends its launch with the runner's reason +ok 13 - a runner that stops at once ends its launch with the runner's reason + --- + duration_ms: 350.182818 + type: 'test' + ... +# Subtest: a Claude Code launch with no session credential refuses before it starts +ok 14 - a Claude Code launch with no session credential refuses before it starts + --- + duration_ms: 227.256782 + type: 'test' + ... +# Subtest: a pi launch needs no session credential: pi logs in through its own ENV_ALLOW variables +ok 15 - a pi launch needs no session credential: pi logs in through its own ENV_ALLOW variables + --- + duration_ms: 355.020473 + type: 'test' + ... +# usage: {"event":"plugin-refused","kind":"harness","name":"down","code":"missing","message":"/mnt/storage/scratch/rocko-r219/packages/plugins/harness/down is missing","kept":[]} +# plugins: {"event":"plugin-refused","kind":"harness","name":"down","code":"missing","message":"/mnt/storage/scratch/rocko-r219/packages/plugins/harness/down is missing","kept":[]} +# Subtest: row 65 a failed primary preflight launches the fallback on a fixture harness module, recording the route and the reason +ok 16 - row 65 a failed primary preflight launches the fallback on a fixture harness module, recording the route and the reason + --- + duration_ms: 395.228029 + type: 'test' + ... +# Subtest: a runner killed from the host ends its launch as killed, not failed +ok 17 - a runner killed from the host ends its launch as killed, not failed + --- + duration_ms: 426.266157 + type: 'test' + ... +# Subtest: a missing or failing bwrap refuses sandbox-unavailable before anything starts; there is no unconfined fallback +ok 18 - a missing or failing bwrap refuses sandbox-unavailable before anything starts; there is no unconfined fallback + --- + duration_ms: 224.638023 + type: 'test' + ... +# Subtest: row 64 a role skill that isn't enabled refuses skill-not-enabled, and one that isn't a plain directory skill-refused, before anything starts +ok 19 - row 64 a role skill that isn't enabled refuses skill-not-enabled, and one that isn't a plain directory skill-refused, before anything starts + --- + duration_ms: 193.63499 + type: 'test' + ... +# Subtest: row 213 a creative instance's persona is read from /personas: off its digest the launch fails with the mismatch as its reason +ok 20 - row 213 a creative instance's persona is read from /personas: off its digest the launch fails with the mismatch as its reason + --- + duration_ms: 276.964378 + type: 'test' + ... +# Subtest: row 64 on Claude Code a role skill that isn't enabled refuses the same way, before anything starts +ok 21 - row 64 on Claude Code a role skill that isn't enabled refuses the same way, before anything starts + --- + duration_ms: 199.95263 + type: 'test' + ... +# usage: {"event":"usage-unknown","business":"acme","run":"r0292ea4215c0","instance":"chief","turn":"e2a42abe-43ec-4873-a349-c93850a0b2d1","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r0292ea4215c0","instance":"chief","turn":"b84fdcd2-08f1-4c7d-a1be-edf183ecf035","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"rb645b3bdbf17","instance":"coder","turn":"8c651e69-aef3-428e-9ecb-fa2c53e86f79","source":"@none","code":"baseline-unknown"} +# Subtest: a real Claude Code coder's shell can't read a stand-in secret or anything else its sandbox doesn't hold +ok 22 - a real Claude Code coder's shell can't read a stand-in secret or anything else its sandbox doesn't hold + --- + duration_ms: 1419.59525 + type: 'test' + ... +# Subtest: a host that died hard leaves its sessions to the next host, which kills them and ends their runs so the role can be launched again +ok 23 - a host that died hard leaves its sessions to the next host, which kills them and ends their runs so the role can be launched again + --- + duration_ms: 1046.224325 + type: 'test' + ... +# Subtest: a host that died hard leaves its sessions to the next host, which finds one already exited (23) and ends their runs so the role can be launched again +ok 24 - a host that died hard leaves its sessions to the next host, which finds one already exited (23) and ends their runs so the role can be launched again + --- + duration_ms: 3988.178511 + type: 'test' + ... +# Subtest: bus start --no-launch leaves an earlier host's live session alone: no signal, no end, sessions.json as it was +ok 25 - bus start --no-launch leaves an earlier host's live session alone: no signal, no end, sessions.json as it was + --- + duration_ms: 242.392974 + type: 'test' + ... +# Subtest: bus start --no-launch refuses every launch: the PM launch and a session's request, each logged, nothing spawned +ok 26 - bus start --no-launch refuses every launch: the PM launch and a session's request, each logged, nothing spawned + --- + duration_ms: 218.198607 + type: 'test' + ... +# Subtest: bus start --no-launch starts no thread tick; the same host with launches runs it +ok 27 - bus start --no-launch starts no thread tick; the same host with launches runs it + --- + duration_ms: 1199.857353 + type: 'test' + ... +# Subtest: a malformed sessions.json refuses the host start with exit 3 and stays as it was +ok 28 - a malformed sessions.json refuses the host start with exit 3 and stays as it was + --- + duration_ms: 181.02391 + type: 'test' + ... +# Subtest: an over-long launch request is refused at once, not at the 10 s idle timeout +ok 29 - an over-long launch request is refused at once, not at the 10 s idle timeout + --- + duration_ms: 181.674266 + type: 'test' + ... +# Subtest: a launch client that never closes its side doesn't hold the host's close +ok 30 - a launch client that never closes its side doesn't hold the host's close + --- + duration_ms: 183.632625 + type: 'test' + ... +# Subtest: a runner that ignores SIGTERM is killed when the host closes +ok 31 - a runner that ignores SIGTERM is killed when the host closes + --- + duration_ms: 1365.88402 + type: 'test' + ... +# Subtest: kill switch refuses chief and hire before launch work and a clear permits a later request +ok 32 - kill switch refuses chief and hire before launch work and a clear permits a later request + --- + duration_ms: 334.261623 + type: 'test' + ... +# Subtest: kill switch stops an actual managed namespace and records the halt reason without rewriting its bundle +ok 33 - kill switch stops an actual managed namespace and records the halt reason without rewriting its bundle + --- + duration_ms: 337.104395 + type: 'test' + ... +# Subtest: a launch waiting across halt and resume cannot use its stale admission +ok 34 - a launch waiting across halt and resume cannot use its stale admission + --- + duration_ms: 194.683714 + type: 'test' + ... +1..34 +# tests 34 +# suites 0 +# pass 34 +# fail 0 +# cancelled 0 +# skipped 0 +# todo 0 +# duration_ms 26492.10694 diff --git a/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/single-cli-thread-launch.test.tap b/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/single-cli-thread-launch.test.tap new file mode 100644 index 000000000..ca9bd70c9 --- /dev/null +++ b/agents/rocko/work/queue-219/run-4a9c-mos1408-red-before-mos1420/single-cli-thread-launch.test.tap @@ -0,0 +1,122 @@ +TAP version 13 +# usage: {"event":"usage-unknown","business":"acme","run":"r2204f4cc976c","instance":"assistant","turn":"fdd36b75-12af-4495-ba60-8a2fdd991676","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r42619c482fdd","instance":"assistant","turn":"4a493440-df70-4de2-a9be-f31bb9efbe67","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r65dae8bd493b","instance":"assistant","turn":"2a27c708-e430-4bcc-82b5-67dc51173d46","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r4f264ceb0a50","instance":"assistant","turn":"dedfd89c-7a7a-4bb8-ba67-ca0e6a417ee8","source":"@none","code":"baseline-unknown"} +# Subtest: REQ-THREAD-2 REQ-LAUNCH-1 REQ-MSG-1 a thread message starts the thread's session, which stops when idle; its history survives the stop and a restart and no other thread sees it +ok 1 - REQ-THREAD-2 REQ-LAUNCH-1 REQ-MSG-1 a thread message starts the thread's session, which stops when idle; its history survives the stop and a restart and no other thread sees it + --- + duration_ms: 5837.256276 + type: 'test' + ... +# usage: {"event":"usage-unknown","business":"acme","run":"red085121d9a7","instance":"assistant","turn":"536c8b62-f126-4b17-a1f2-756e2aede65e","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"ree31908db53d","instance":"assistant","turn":"f23f7966-9c87-4d7b-9d9a-93211c1431c0","source":"@none","code":"baseline-unknown"} +# Subtest: REQ-THREAD-2 REQ-LAUNCH-1 a running thread counts against its model's limit and an idle-stopped one doesn't +ok 2 - REQ-THREAD-2 REQ-LAUNCH-1 a running thread counts against its model's limit and an idle-stopped one doesn't + --- + duration_ms: 1713.759995 + type: 'test' + ... +# usage: {"event":"usage-unknown","business":"acme","run":"r5c82fe368237","instance":"assistant","turn":"081a280e-73b4-48fc-89a9-688e73704186","source":"@none","code":"baseline-unknown"} +# Subtest: REQ-THREAD-2 REQ-LAUNCH-1 a turn longer than the idle time isn't stopped, and the thread idles out after it +ok 3 - REQ-THREAD-2 REQ-LAUNCH-1 a turn longer than the idle time isn't stopped, and the thread idles out after it + --- + duration_ms: 4442.41406 + type: 'test' + ... +# usage: {"event":"usage-unknown","business":"acme","run":"r008070c44356","instance":"assistant","turn":"3175be8d-24d9-4d46-b9fe-e08c8edd0a5e","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r008070c44356","instance":"assistant","turn":"961030fd-2dd3-4deb-a9be-f10af56ba7f7","source":"@none","code":"baseline-unknown"} +# Subtest: REQ-THREAD-2 REQ-LAUNCH-1 a message sent after the idle snapshot keeps the session, which answers it +ok 4 - REQ-THREAD-2 REQ-LAUNCH-1 a message sent after the idle snapshot keeps the session, which answers it + --- + duration_ms: 2897.279317 + type: 'test' + ... +# Subtest: REQ-ROLE-2 REQ-LAUNCH-1 a thread held by a run the launcher didn't start gets no second session +ok 5 - REQ-ROLE-2 REQ-LAUNCH-1 a thread held by a run the launcher didn't start gets no second session + --- + duration_ms: 79.744891 + type: 'test' + ... +# usage: {"event":"usage-unknown","business":"acme","run":"rf65e96bfb0f4","instance":"assistant","turn":"61a6ab74-b6bd-4274-a83e-0f8fb4f61a68","source":"@none","code":"baseline-unknown"} +# Subtest: REQ-LAUNCH-1 a thread run's session file has no landing, even when landHolders names its instance +ok 6 - REQ-LAUNCH-1 a thread run's session file has no landing, even when landHolders names its instance + --- + duration_ms: 374.600592 + type: 'test' + ... +# Subtest: REQ-LAUNCH-1 a run that ends without taking its thread's message isn't started again for that message +ok 7 - REQ-LAUNCH-1 a run that ends without taking its thread's message isn't started again for that message + --- + duration_ms: 232.164242 + type: 'test' + ... +# Subtest: REQ-THREAD-2 REQ-LAUNCH-1 a thread id that isn't a safe segment, or a thread of a non-thread instance, launches nothing +ok 8 - REQ-THREAD-2 REQ-LAUNCH-1 a thread id that isn't a safe segment, or a thread of a non-thread instance, launches nothing + --- + duration_ms: 226.367358 + type: 'test' + ... +# Subtest: REQ-THREAD-1 REQ-LAUNCH-1 the chief can't launch the assistant outside a thread +ok 9 - REQ-THREAD-1 REQ-LAUNCH-1 the chief can't launch the assistant outside a thread + --- + duration_ms: 78.315815 + type: 'test' + ... +# Subtest: C2-09a: fromSession refuses a creative instance outside a thread without a sandbox +ok 10 - C2-09a: fromSession refuses a creative instance outside a thread without a sandbox + --- + duration_ms: 74.784926 + type: 'test' + ... +# limits: {"event":"limit-reached","business":"acme","check":"token-limit","export":"mayLaunch","subject":{"instance":"assistant","provider":"zai","model":"claude-sonnet-5-5","account":null},"path":["tokens","instances","assistant"],"limit":0,"count":0,"unknownTurns":0} +# limits: {"event":"limit-reached","business":"acme","check":"token-limit","export":"mayLaunch","subject":{"instance":"assistant","provider":"zai","model":"claude-sonnet-5-5","account":null},"path":["tokens","instances","assistant"],"limit":0,"count":0,"unknownTurns":0} +# Subtest: REQ-LIMIT-3 REQ-LIMIT-4 a thread start whose instance is at its token limit is refused, logged once with the limit and the count +ok 11 - REQ-LIMIT-3 REQ-LIMIT-4 a thread start whose instance is at its token limit is refused, logged once with the limit and the count + --- + duration_ms: 192.227024 + type: 'test' + ... +# usage: {"event":"usage-unknown","business":"acme","run":"r3ffa99981f81","instance":"assistant","turn":"c194605d-1b92-488c-9afe-2599f205e80e","source":"@none","code":"baseline-unknown"} +# limits: {"event":"limit-reached","business":"acme","check":"token-limit","export":"mustStop","subject":{"instance":"assistant","provider":"zai","model":"claude-sonnet-5-5","account":null},"path":["tokens","instances","assistant"],"limit":0,"count":0,"unknownTurns":1} +# Subtest: REQ-LIMIT-4 a thread run at its token limit stops at the end of its turn: the reply lands, and the end record names the limit +ok 12 - REQ-LIMIT-4 a thread run at its token limit stops at the end of its turn: the reply lands, and the end record names the limit + --- + duration_ms: 346.819478 + type: 'test' + ... +# usage: {"event":"usage-unknown","business":"acme","run":"r013acfa3de9d","instance":"bean","turn":"26896136-02b5-4948-8c84-7e0be580c485","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r13746c56cf7b","instance":"chet","turn":"2a7d4bed-79e7-4b74-b602-c07fe90be87f","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r013acfa3de9d","instance":"bean","turn":"32222fad-092d-4ac9-b5de-d40de519bf82","source":"@none","code":"baseline-unknown"} +# Subtest: C2-09a: creative thread messages start distinct runs and keep each instance history separate +not ok 13 - C2-09a: creative thread messages start distinct runs and keep each instance history separate + --- + duration_ms: 746.425172 + type: 'test' + location: '/mnt/storage/scratch/rocko-r219/packages/cli/tests/thread-launch.test.mjs:463:1' + failureType: 'testCodeFailure' + error: "ENOENT: no such file or directory, open '/mnt/storage/scratch/tmp/rbyz9a6iu/mosaic-thread-Cgx1tR/data/threads/acme/0a27cae9-cdb8-436d-8cc8-a59b316577e9/session/history'" + code: 'ENOENT' + stack: |- + readFileSync (node:fs:621:20) + TestContext. (file:///mnt/storage/scratch/rocko-r219/packages/cli/tests/thread-launch.test.mjs:489:16) + async Test.run (node:internal/test_runner/test:1409:7) + async Test.processPendingSubtests (node:internal/test_runner/test:974:7) + ... +# usage: {"event":"usage-unknown","business":"acme","run":"rb9998f7e5721","instance":"bean","turn":"6c83f086-940d-43ab-8219-0ee1b9dd4c7d","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"rdf0bd4d3e49a","instance":"bean","turn":"663ed95c-c09b-4053-aeb7-1696b6acf272","source":"@none","code":"baseline-unknown"} +# Subtest: C2-09a: terminating one creative thread does not signal an unselected peer of the same instance +ok 14 - C2-09a: terminating one creative thread does not signal an unselected peer of the same instance + --- + duration_ms: 643.667218 + type: 'test' + ... +1..14 +# tests 14 +# suites 0 +# pass 13 +# fail 1 +# cancelled 0 +# skipped 0 +# todo 0 +# duration_ms 18010.958178 diff --git a/agents/rocko/work/queue-219/run-4a9c-mos1408/head.json b/agents/rocko/work/queue-219/run-4a9c-mos1408/head.json index 7b97b61f3..28e44fb02 100644 --- a/agents/rocko/work/queue-219/run-4a9c-mos1408/head.json +++ b/agents/rocko/work/queue-219/run-4a9c-mos1408/head.json @@ -1 +1 @@ -{"head": "7cbd839d037f711de136108882b53597cf16d742", "manifest": "84a8bd9afc5420fc315586584aec91258a28bd728000dcd2cb61ac41b2fe711a", "start": "2026-10-23T06:09:43.704053+00:00"} \ No newline at end of file +{"head": "bfa421b6cd9b2b54d8da119e73b004aeafe606c3", "manifest": "2f7dfb7e41a33b89616edc5ce796e5d351c6f436284aa1e2dbfa773915be1820", "start": "2026-10-23T08:08:37.133924+00:00"} \ No newline at end of file diff --git a/agents/rocko/work/queue-219/run-4a9c-mos1408/results.jsonl b/agents/rocko/work/queue-219/run-4a9c-mos1408/results.jsonl index b5678d996..980e6b65d 100644 --- a/agents/rocko/work/queue-219/run-4a9c-mos1408/results.jsonl +++ b/agents/rocko/work/queue-219/run-4a9c-mos1408/results.jsonl @@ -1,5 +1,9 @@ -{"label": "single-bus-creative.test", "args": ["timeout", "-k", "10", "300", "node", "--test-reporter=tap", "--test", "packages/bus/tests/creative.test.mjs"], "start": "2026-10-23T06:09:43.706182+00:00", "end": "2026-10-23T06:09:44.121877+00:00", "seconds": 0.416, "exit": 0, "timeout": false, "counts": {"tests": 4, "pass": 4, "fail": 0, "cancelled": 0, "skipped": 0}, "skips": ["# skipped 0"], "log": "agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-creative.test.tap", "tmpdir": "/mnt/storage/scratch/tmp/rmc2uerc6"} -{"label": "single-bus-threads.test", "args": ["timeout", "-k", "10", "300", "node", "--test-reporter=tap", "--test", "packages/bus/tests/threads.test.mjs"], "start": "2026-10-23T06:09:44.123566+00:00", "end": "2026-10-23T06:09:45.490657+00:00", "seconds": 1.367, "exit": 0, "timeout": false, "counts": {"tests": 19, "pass": 19, "fail": 0, "cancelled": 0, "skipped": 0}, "skips": ["# skipped 0"], "log": "agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-threads.test.tap", "tmpdir": "/mnt/storage/scratch/tmp/rismt3po4"} -{"label": "single-bus-user-principal.test", "args": ["timeout", "-k", "10", "300", "node", "--test-reporter=tap", "--test", "packages/bus/tests/user-principal.test.mjs"], "start": "2026-10-23T06:09:45.492192+00:00", "end": "2026-10-23T06:09:46.107814+00:00", "seconds": 0.616, "exit": 0, "timeout": false, "counts": {"tests": 23, "pass": 23, "fail": 0, "cancelled": 0, "skipped": 0}, "skips": ["# skipped 0"], "log": "agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-user-principal.test.tap", "tmpdir": "/mnt/storage/scratch/tmp/repq8xlqh"} -{"label": "single-cli-launcher.test", "args": ["timeout", "-k", "10", "300", "node", "--test-reporter=tap", "--test", "packages/cli/tests/launcher.test.mjs"], "start": "2026-10-23T06:09:46.109200+00:00", "end": "2026-10-23T06:10:12.635877+00:00", "seconds": 26.527, "exit": 0, "timeout": false, "counts": {"tests": 34, "pass": 34, "fail": 0, "cancelled": 0, "skipped": 0}, "skips": ["# skipped 0"], "log": "agents/rocko/work/queue-219/run-4a9c-mos1408/single-cli-launcher.test.tap", "tmpdir": "/mnt/storage/scratch/tmp/rkqztfjx8"} -{"label": "single-cli-thread-launch.test", "args": ["timeout", "-k", "10", "300", "node", "--test-reporter=tap", "--test", "packages/cli/tests/thread-launch.test.mjs"], "start": "2026-10-23T06:10:12.637449+00:00", "end": "2026-10-23T06:10:30.695792+00:00", "seconds": 18.058, "exit": 1, "timeout": false, "counts": {"tests": 14, "pass": 13, "fail": 1, "cancelled": 0, "skipped": 0}, "skips": ["# skipped 0"], "log": "agents/rocko/work/queue-219/run-4a9c-mos1408/single-cli-thread-launch.test.tap", "tmpdir": "/mnt/storage/scratch/tmp/rbyz9a6iu"} +{"label": "single-bus-creative.test", "args": ["timeout", "-k", "10", "300", "node", "--test-reporter=tap", "--test", "packages/bus/tests/creative.test.mjs"], "start": "2026-10-23T08:08:37.137065+00:00", "end": "2026-10-23T08:08:37.553450+00:00", "seconds": 0.416, "exit": 0, "timeout": false, "counts": {"tests": 4, "pass": 4, "fail": 0, "cancelled": 0, "skipped": 0}, "skips": ["# skipped 0"], "log": "agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-creative.test.tap", "tmpdir": "/mnt/storage/scratch/tmp/ruqo1xw54"} +{"label": "single-bus-threads.test", "args": ["timeout", "-k", "10", "300", "node", "--test-reporter=tap", "--test", "packages/bus/tests/threads.test.mjs"], "start": "2026-10-23T08:08:37.554878+00:00", "end": "2026-10-23T08:08:38.871766+00:00", "seconds": 1.317, "exit": 0, "timeout": false, "counts": {"tests": 19, "pass": 19, "fail": 0, "cancelled": 0, "skipped": 0}, "skips": ["# skipped 0"], "log": "agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-threads.test.tap", "tmpdir": "/mnt/storage/scratch/tmp/rc8231nhf"} +{"label": "single-bus-user-principal.test", "args": ["timeout", "-k", "10", "300", "node", "--test-reporter=tap", "--test", "packages/bus/tests/user-principal.test.mjs"], "start": "2026-10-23T08:08:38.873280+00:00", "end": "2026-10-23T08:08:39.438646+00:00", "seconds": 0.565, "exit": 0, "timeout": false, "counts": {"tests": 23, "pass": 23, "fail": 0, "cancelled": 0, "skipped": 0}, "skips": ["# skipped 0"], "log": "agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-user-principal.test.tap", "tmpdir": "/mnt/storage/scratch/tmp/r8q2inpml"} +{"label": "single-cli-launcher.test", "args": ["timeout", "-k", "10", "300", "node", "--test-reporter=tap", "--test", "packages/cli/tests/launcher.test.mjs"], "start": "2026-10-23T08:08:39.440174+00:00", "end": "2026-10-23T08:09:06.064398+00:00", "seconds": 26.624, "exit": 0, "timeout": false, "counts": {"tests": 34, "pass": 34, "fail": 0, "cancelled": 0, "skipped": 0}, "skips": ["# skipped 0"], "log": "agents/rocko/work/queue-219/run-4a9c-mos1408/single-cli-launcher.test.tap", "tmpdir": "/mnt/storage/scratch/tmp/r1v5ginj7"} +{"label": "single-cli-thread-launch.test", "args": ["timeout", "-k", "10", "300", "node", "--test-reporter=tap", "--test", "packages/cli/tests/thread-launch.test.mjs"], "start": "2026-10-23T08:09:06.066057+00:00", "end": "2026-10-23T08:09:24.118779+00:00", "seconds": 18.053, "exit": 0, "timeout": false, "counts": {"tests": 14, "pass": 14, "fail": 0, "cancelled": 0, "skipped": 0}, "skips": ["# skipped 0"], "log": "agents/rocko/work/queue-219/run-4a9c-mos1408/single-cli-thread-launch.test.tap", "tmpdir": "/mnt/storage/scratch/tmp/rkqddfdec"} +{"label": "single-webui-chat-browser.test", "args": ["timeout", "-k", "10", "300", "node", "--test-reporter=tap", "--test", "packages/webui/tests/chat-browser.test.mjs"], "start": "2026-10-23T08:09:24.120216+00:00", "end": "2026-10-23T08:09:43.026298+00:00", "seconds": 18.906, "exit": 0, "timeout": false, "counts": {"tests": 14, "pass": 14, "fail": 0, "cancelled": 0, "skipped": 0}, "skips": ["# skipped 0"], "log": "agents/rocko/work/queue-219/run-4a9c-mos1408/single-webui-chat-browser.test.tap", "tmpdir": "/mnt/storage/scratch/tmp/rgr2ixw_2"} +{"label": "single-webui-chat-instances.test", "args": ["timeout", "-k", "10", "300", "node", "--test-reporter=tap", "--test", "packages/webui/tests/chat-instances.test.mjs"], "start": "2026-10-23T08:09:43.027683+00:00", "end": "2026-10-23T08:09:43.191979+00:00", "seconds": 0.164, "exit": 0, "timeout": false, "counts": {"tests": 4, "pass": 4, "fail": 0, "cancelled": 0, "skipped": 0}, "skips": ["# skipped 0"], "log": "agents/rocko/work/queue-219/run-4a9c-mos1408/single-webui-chat-instances.test.tap", "tmpdir": "/mnt/storage/scratch/tmp/rjrq7rm3e"} +{"label": "single-webui-chat.test", "args": ["timeout", "-k", "10", "300", "node", "--test-reporter=tap", "--test", "packages/webui/tests/chat.test.mjs"], "start": "2026-10-23T08:09:43.193338+00:00", "end": "2026-10-23T08:09:43.708659+00:00", "seconds": 0.515, "exit": 0, "timeout": false, "counts": {"tests": 25, "pass": 25, "fail": 0, "cancelled": 0, "skipped": 0}, "skips": ["# skipped 0"], "log": "agents/rocko/work/queue-219/run-4a9c-mos1408/single-webui-chat.test.tap", "tmpdir": "/mnt/storage/scratch/tmp/r2t2knykp"} +{"label": "suite-bus", "args": ["timeout", "-k", "10", "1800", "node", "--test-reporter=tap", "--test", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/account-migration.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/agents.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/approval-binding.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/broker.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/business.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/channel-proof.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/chief-of-staff.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/comment-cursors.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/comment-migration.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/creative.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/credential-claim.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/credential-status.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/credential-store.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/credential-verbs.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/credentials.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/csuite-messaging.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/daily-quota-runtime.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/decision-close.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/decision-route.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/decisions.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/end-launch.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/fire-revokes-grants.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/gitea-grant-docker.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/gitea-grant.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/gitea-migration.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/grant-enroll.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/grant-executor.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/grant-host.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/grant-migration.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/hard-waits.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/host-run.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/host-tools.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/human.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/instances-verb.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/interpreter.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/land.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/launch-notice.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/library-sync.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/library.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/lifecycle-revoke.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/lifecycle-verbs.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/limit-checks.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/limit-stop.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/limits-runtime.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/limits.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/message-citation.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/message-filter.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/messages.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/messaging.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/name-migration.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/names.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/peer-transport.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/peercred.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/plugins-verb.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/principal.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/process.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/processing-runtime.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/processing-timeout.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/processing-web.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/processing.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/project-await.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/project-files.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/project-runtime.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/publish.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/reload.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/replies.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/requirements.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/review.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/routes-verb.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/schema.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/session-clear.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/session-compactions.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/sessions.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/single-use.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/spec-migration.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/spec-review.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/spec-socket.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/spec.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/staff-request.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/state.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/store.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/task-page.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/task-read.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/tasks.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/tester-threads.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/tester-writes.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/tester.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/thread-claims.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/thread-migration.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/thread-shares.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/threads.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/transport.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/usage-broker.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/usage-migration.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/usage-runtime.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/usage.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/user-principal.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/viewer.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/web.test.mjs", "/mnt/storage/scratch/rocko-r219/packages/bus/tests/workflow-roles.test.mjs"], "start": "2026-10-23T08:09:43.719557+00:00", "end": "2026-10-23T08:10:07.389095+00:00", "seconds": 23.67, "exit": 1, "timeout": false, "counts": {"tests": 876, "pass": 873, "fail": 2, "cancelled": 0, "skipped": 1}, "skips": ["ok 193 - X-G3: on scratch 1.27.1, a grant makes the user, mints, forks, checks reach, writes the file, and revoke deletes the token # SKIP no Docker or no local gitea/gitea:1.27.1; this test never pulls", "# skipped 1"], "log": "agents/rocko/work/queue-219/run-4a9c-mos1408/suite-bus.tap", "tmpdir": "/mnt/storage/scratch/tmp/r8gssqutl"} diff --git a/agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-creative.test.tap b/agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-creative.test.tap index 978d05307..dcfb11535 100644 --- a/agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-creative.test.tap +++ b/agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-creative.test.tap @@ -4,25 +4,25 @@ TAP version 13 # Subtest: M6: a creative raise refuses decision-not-allowed, cited or not, and no decision row appears; the assistant still raises ok 1 - M6: a creative raise refuses decision-not-allowed, cited or not, and no decision row appears; the assistant still raises --- - duration_ms: 43.416235 + duration_ms: 34.682331 type: 'test' ... # Subtest: a creative instance sends only to the user and hears only from the user ok 2 - a creative instance sends only to the user and hears only from the user --- - duration_ms: 43.274527 + duration_ms: 40.110807 type: 'test' ... # Subtest: M10 through the broker: the chief and the tester are refused on bean, the human's limits.set of its models key works ok 3 - M10 through the broker: the chief and the tester are refused on bean, the human's limits.set of its models key works --- - duration_ms: 76.669863 + duration_ms: 73.937403 type: 'test' ... # Subtest: row 256 T6 the human deletes a creative instance through the broker; the chief and the tester are refused at the verb ok 4 - row 256 T6 the human deletes a creative instance through the broker; the chief and the tester are refused at the verb --- - duration_ms: 60.418493 + duration_ms: 55.55064 type: 'test' ... 1..4 @@ -33,4 +33,4 @@ ok 4 - row 256 T6 the human deletes a creative instance through the broker; the # cancelled 0 # skipped 0 # todo 0 -# duration_ms 374.784911 +# duration_ms 330.224744 diff --git a/agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-threads.test.tap b/agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-threads.test.tap index b05384a32..874557db8 100644 --- a/agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-threads.test.tap +++ b/agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-threads.test.tap @@ -2,115 +2,115 @@ TAP version 13 # Subtest: REQ-ROLE-2 REQ-THREAD-1: one holder per thread, through the broker and the trigger ok 1 - REQ-ROLE-2 REQ-THREAD-1: one holder per thread, through the broker and the trigger --- - duration_ms: 37.977187 + duration_ms: 38.52476 type: 'test' ... # Subtest: REQ-ROLE-2 REQ-THREAD-1: the 3e triggers refuse writes that skip the broker ok 2 - REQ-ROLE-2 REQ-THREAD-1: the 3e triggers refuse writes that skip the broker --- - duration_ms: 68.5376 + duration_ms: 64.995866 type: 'test' ... # Subtest: REQ-MSG-1: a message to or from the assistant names its thread, or is refused ok 3 - REQ-MSG-1: a message to or from the assistant names its thread, or is refused --- - duration_ms: 33.043064 + duration_ms: 32.003231 type: 'test' ... # Subtest: REQ-MSG-1: the chief of staff's reply comes back to the thread that sent the work ok 4 - REQ-MSG-1: the chief of staff's reply comes back to the thread that sent the work --- - duration_ms: 616.013932 + duration_ms: 593.185752 type: 'test' ... # Subtest: REQ-MSG-1: a reply can't carry one thread instance's thread to another thread instance ok 5 - REQ-MSG-1: a reply can't carry one thread instance's thread to another thread instance --- - duration_ms: 22.785202 + duration_ms: 24.74469 type: 'test' ... # Subtest: REQ-THREAD-1 REQ-USER-2: one thread's messages never reach another thread's holder ok 6 - REQ-THREAD-1 REQ-USER-2: one thread's messages never reach another thread's holder --- - duration_ms: 27.208648 + duration_ms: 28.552018 type: 'test' ... # Subtest: REQ-LAUNCH-1: a message to a thread with no holder waits, and the next holder gets it ok 7 - REQ-LAUNCH-1: a message to a thread with no holder waits, and the next holder gets it --- - duration_ms: 29.67741 + duration_ms: 31.22843 type: 'test' ... # Subtest: REQ-THREAD-2 REQ-LAUNCH-1: threadIdle releases only a thread with nothing waiting, and only for its holder ok 8 - REQ-THREAD-2 REQ-LAUNCH-1: threadIdle releases only a thread with nothing waiting, and only for its holder --- - duration_ms: 33.136315 + duration_ms: 32.904321 type: 'test' ... # Subtest: REQ-THREAD-2 REQ-LAUNCH-1: a message delivered to a run that ended unread doesn't hold up the next holder ok 9 - REQ-THREAD-2 REQ-LAUNCH-1: a message delivered to a run that ended unread doesn't hold up the next holder --- - duration_ms: 30.610794 + duration_ms: 28.44647 type: 'test' ... # Subtest: REQ-ROLE-2 REQ-THREAD-1 Q169: a role.revoke the human approved ends every thread run of the assistant ok 10 - REQ-ROLE-2 REQ-THREAD-1 Q169: a role.revoke the human approved ends every thread run of the assistant --- - duration_ms: 27.293744 + duration_ms: 24.975254 type: 'test' ... # Subtest: Q169 REQ-USER-2: assistant.stop ends the human's own assistant thread runs, and only the human's ok 11 - Q169 REQ-USER-2: assistant.stop ends the human's own assistant thread runs, and only the human's --- - duration_ms: 39.426851 + duration_ms: 37.074551 type: 'test' ... # Subtest: REQ-USER-2: the human verbs refuse another owner's thread ok 12 - REQ-USER-2: the human verbs refuse another owner's thread --- - duration_ms: 30.185753 + duration_ms: 28.633018 type: 'test' ... # Subtest: REQ-THREAD-1: thread.create refuses when the business has no thread instance or more than one ok 13 - REQ-THREAD-1: thread.create refuses when the business has no thread instance or more than one --- - duration_ms: 25.774336 + duration_ms: 22.573463 type: 'test' ... # Subtest: REQ-ORG-2: projects and threads are named once, and the repo names a business project ok 14 - REQ-ORG-2: projects and threads are named once, and the repo names a business project --- - duration_ms: 26.886111 + duration_ms: 24.854088 type: 'test' ... # Subtest: REQ-THREAD-2: thread.messages returns the thread's history in pages and writes nothing ok 15 - REQ-THREAD-2: thread.messages returns the thread's history in pages and writes nothing --- - duration_ms: 90.298865 + duration_ms: 87.902895 type: 'test' ... # Subtest: project.create refuses a repository name without its matching repo before any write ok 16 - project.create refuses a repository name without its matching repo before any write --- - duration_ms: 16.900927 + duration_ms: 16.647696 type: 'test' ... # Subtest: project.create keeps unrelated names with and without a repository ok 17 - project.create keeps unrelated names with and without a repository --- - duration_ms: 11.07789 + duration_ms: 11.154646 type: 'test' ... # Subtest: C2-09a: explicit creative instances bind independent threads, default sessions and holders ok 18 - C2-09a: explicit creative instances bind independent threads, default sessions and holders --- - duration_ms: 47.924595 + duration_ms: 47.242783 type: 'test' ... # Subtest: C2-09a: explicit missing, non-thread and malformed selectors create no thread or session ok 19 - C2-09a: explicit missing, non-thread and malformed selectors create no thread or session --- - duration_ms: 19.917458 + duration_ms: 21.669855 type: 'test' ... 1..19 @@ -121,4 +121,4 @@ ok 19 - C2-09a: explicit missing, non-thread and malformed selectors create no t # cancelled 0 # skipped 0 # todo 0 -# duration_ms 1316.555344 +# duration_ms 1277.767202 diff --git a/agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-user-principal.test.tap b/agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-user-principal.test.tap index fa7fb3a32..3f2cd7cb3 100644 --- a/agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-user-principal.test.tap +++ b/agents/rocko/work/queue-219/run-4a9c-mos1408/single-bus-user-principal.test.tap @@ -2,139 +2,139 @@ TAP version 13 # Subtest: R3: bindUser binds a granted user and refuses one with no live grant ok 1 - R3: bindUser binds a granted user and refuses one with no live grant --- - duration_ms: 14.967712 + duration_ms: 13.924459 type: 'test' ... # Subtest: R3: a user named like the business human, the tester or a principal word is refused, whatever the grants say ok 2 - R3: a user named like the business human, the tester or a principal word is refused, whatever the grants say --- - duration_ms: 10.570753 + duration_ms: 9.64513 type: 'test' ... # Subtest: R3: each collaborator verb is allowed to a granted user ok 3 - R3: each collaborator verb is allowed to a granted user --- - duration_ms: 20.155376 + duration_ms: 18.606176 type: 'test' ... # Subtest: R3: every verb off the collaborator list refuses a user access-refused before its own checks ok 4 - R3: every verb off the collaborator list refuses a user access-refused before its own checks --- - duration_ms: 102.151204 + duration_ms: 97.018766 type: 'test' ... # Subtest: R3: task, web and host verbs refuse a user access-refused ok 5 - R3: task, web and host verbs refuse a user access-refused --- - duration_ms: 23.297818 + duration_ms: 22.278844 type: 'test' ... # Subtest: R3 leak: project.list shows granted projects only ok 6 - R3 leak: project.list shows granted projects only --- - duration_ms: 13.028484 + duration_ms: 12.700951 type: 'test' ... # Subtest: R3 leak: thread.create needs the project and the thread instance granted, and an ungranted id reads as one that does not exist ok 7 - R3 leak: thread.create needs the project and the thread instance granted, and an ungranted id reads as one that does not exist --- - duration_ms: 17.131417 + duration_ms: 15.363337 type: 'test' ... # Subtest: R3 leak: thread.list shows the user its own threads that are still granted, never others ok 8 - R3 leak: thread.list shows the user its own threads that are still granted, never others --- - duration_ms: 34.619156 + duration_ms: 31.965026 type: 'test' ... # Subtest: R3 leak: names shows granted instances only ok 9 - R3 leak: names shows granted instances only --- - duration_ms: 15.416042 + duration_ms: 14.127917 type: 'test' ... # Subtest: R3: thread.send is from user: and writes no human.input ok 10 - R3: thread.send is from user: and writes no human.input --- - duration_ms: 13.82133 + duration_ms: 12.458443 type: 'test' ... # Subtest: R3: a reply-chain message.send into another user thread is refused ok 11 - R3: a reply-chain message.send into another user thread is refused --- - duration_ms: 15.982484 + duration_ms: 14.424409 type: 'test' ... # Subtest: R3: the run reply to a user message reaches that user thread.messages, with no waiting and no notice ok 12 - R3: the run reply to a user message reaches that user thread.messages, with no waiting and no notice --- - duration_ms: 19.055939 + duration_ms: 19.043152 type: 'test' ... # Subtest: R3: a reply to: user without a matching in_reply_to is refused user-reply-required ok 13 - R3: a reply to: user without a matching in_reply_to is refused user-reply-required --- - duration_ms: 28.510227 + duration_ms: 28.314095 type: 'test' ... # Subtest: R3: a non-thread run, the human and the tester cannot send to: user ok 14 - R3: a non-thread run, the human and the tester cannot send to: user --- - duration_ms: 18.072201 + duration_ms: 18.345488 type: 'test' ... # Subtest: R3: a user thread run cannot message the owner, while its uncited gated raise reaches only the owner inbox, B9 ok 15 - R3: a user thread run cannot message the owner, while its uncited gated raise reaches only the owner inbox, B9 --- - duration_ms: 20.4668 + duration_ms: 19.2905 type: 'test' ... # Subtest: R3: a removed or expired grant refuses the next request access-revoked, and the file is read per request ok 16 - R3: a removed or expired grant refuses the next request access-revoked, and the file is read per request --- - duration_ms: 17.954184 + duration_ms: 16.768862 type: 'test' ... # Subtest: R3: a user refusal is recorded as action.refused by user: ok 17 - R3: a user refusal is recorded as action.refused by user: --- - duration_ms: 15.466589 + duration_ms: 13.097341 type: 'test' ... # Subtest: R3: a business with a role keyed user refuses invalid-business ok 18 - R3: a business with a role keyed user refuses invalid-business --- - duration_ms: 10.080838 + duration_ms: 9.101012 type: 'test' ... # Subtest: R3: name.set refuses the name user ok 19 - R3: name.set refuses the name user --- - duration_ms: 10.585336 + duration_ms: 9.51256 type: 'test' ... # Subtest: R3 r4: while halted, a granted user's thread.send refuses processing-halted and thread.messages still answers ok 20 - R3 r4: while halted, a granted user's thread.send refuses processing-halted and thread.messages still answers --- - duration_ms: 14.198383 + duration_ms: 13.740514 type: 'test' ... # Subtest: R3 r4: the chief's hire refuses an instance named user with the code it gives human and tester ok 21 - R3 r4: the chief's hire refuses an instance named user with the code it gives human and tester --- - duration_ms: 16.565998 + duration_ms: 15.133919 type: 'test' ... # Subtest: R3 r4: a non-function access throws before the store is read ok 22 - R3 r4: a non-function access throws before the store is read --- - duration_ms: 0.139037 + duration_ms: 0.104353 type: 'test' ... # Subtest: C2-09a: naming an instance cannot bypass its collaborator grant or disclose an ungranted project ok 23 - C2-09a: naming an instance cannot bypass its collaborator grant or disclose an ungranted project --- - duration_ms: 17.431688 + duration_ms: 15.763241 type: 'test' ... 1..23 @@ -145,4 +145,4 @@ ok 23 - C2-09a: naming an instance cannot bypass its collaborator grant or discl # cancelled 0 # skipped 0 # todo 0 -# duration_ms 550.515661 +# duration_ms 519.847477 diff --git a/agents/rocko/work/queue-219/run-4a9c-mos1408/single-cli-launcher.test.tap b/agents/rocko/work/queue-219/run-4a9c-mos1408/single-cli-launcher.test.tap index 2ca5baf8a..af2cc0d6b 100644 --- a/agents/rocko/work/queue-219/run-4a9c-mos1408/single-cli-launcher.test.tap +++ b/agents/rocko/work/queue-219/run-4a9c-mos1408/single-cli-launcher.test.tap @@ -2,102 +2,102 @@ TAP version 13 # Subtest: C2-04: launcher workspace clones code but never the library ok 1 - C2-04: launcher workspace clones code but never the library --- - duration_ms: 1386.548788 + duration_ms: 1398.187431 type: 'test' ... # Subtest: bus start --pm: the launcher instance (the chief of staff) runs under its own PID namespace, registered, with a manifest ok 2 - bus start --pm: the launcher instance (the chief of staff) runs under its own PID namespace, registered, with a manifest --- - duration_ms: 1321.365393 + duration_ms: 1322.865907 type: 'test' ... -# usage: {"event":"usage-unknown","business":"acme","run":"rfeb27e280740","instance":"chief","turn":"6c7140a2-fbf2-4eb5-aade-18915e5d6071","source":"@none","code":"baseline-unknown"} -# usage: {"event":"usage-unknown","business":"acme","run":"r4d1379ff54ed","instance":"coder","turn":"0828e9f0-3389-4d81-b773-d33ac8ed9436","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"ra61e58b80d9d","instance":"chief","turn":"3525a183-23ba-49e0-b22d-e3b30769d70b","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r04fb94e1138e","instance":"coder","turn":"98345cf4-0180-45bb-8d5d-c2160653bd22","source":"@none","code":"baseline-unknown"} # Subtest: the chief of staff launches a coder through its launch tool; the coder answers; refusals name their code ok 3 - the chief of staff launches a coder through its launch tool; the coder answers; refusals name their code --- - duration_ms: 729.440258 + duration_ms: 725.031053 type: 'test' ... -# usage: {"event":"usage-unknown","business":"acme","run":"r6b4b3482e67f","instance":"chief","turn":"aa4f1c16-5525-464e-bf32-86dce3279b86","source":"@none","code":"baseline-unknown"} -# usage: {"event":"usage-unknown","business":"acme","run":"r1c029998bdea","instance":"pm","turn":"9bcd06eb-6a90-41fb-80ae-56a32bc1c628","source":"@none","code":"baseline-unknown"} -# usage: {"event":"usage-unknown","business":"acme","run":"r6b4b3482e67f","instance":"chief","turn":"8bbc58a8-f1e1-478c-957b-76e1d7d3a0d4","source":"@none","code":"baseline-unknown"} -# usage: {"event":"usage-unknown","business":"acme","run":"r1c029998bdea","instance":"pm","turn":"e1f9e391-0762-4643-bdfb-737a3f75468c","source":"@none","code":"baseline-unknown"} -# usage: {"event":"usage-unknown","business":"acme","run":"r1c029998bdea","instance":"pm","turn":"ee01381b-77c5-4737-9963-cc39bfcf3329","source":"@none","code":"baseline-unknown"} -# usage: {"event":"usage-unknown","business":"acme","run":"r6b4b3482e67f","instance":"chief","turn":"48edb0d5-0ec4-4e59-9eae-4f767252eaf9","source":"@none","code":"baseline-unknown"} -# usage: {"event":"usage-unknown","business":"acme","run":"r1c029998bdea","instance":"pm","turn":"837ddcc0-6e74-408d-a21f-aeefc287e380","source":"@none","code":"baseline-unknown"} -# usage: {"event":"usage-unknown","business":"acme","run":"r6b4b3482e67f","instance":"chief","turn":"702b0c7b-18c4-4f01-b71b-29fdf5ae1d79","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"rb6d76aacd130","instance":"chief","turn":"5f3f43e7-dd01-49bb-8952-4d4352c5e7a9","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"rf6fac07d1c93","instance":"pm","turn":"ea6dd415-3ed9-4ea9-974c-82099bff050a","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"rb6d76aacd130","instance":"chief","turn":"db418684-9d51-4f2b-97aa-094ed9964411","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"rf6fac07d1c93","instance":"pm","turn":"a95af522-8a95-40f8-bff1-fbd87ca56f8e","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"rf6fac07d1c93","instance":"pm","turn":"889654ce-750b-49ed-9722-9c0f3d7ea0fa","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"rb6d76aacd130","instance":"chief","turn":"85616e3b-f44c-4754-8154-4a4eb28e8008","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"rf6fac07d1c93","instance":"pm","turn":"14d21ceb-82a6-43f4-91c0-e96168f2bb5c","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"rb6d76aacd130","instance":"chief","turn":"fd1a6765-8c4a-445a-97aa-bceb3fde79dc","source":"@none","code":"baseline-unknown"} # Subtest: a launched pm's request_staff reaches the chief of staff; no other session has the tool and the launch limits still hold ok 4 - a launched pm's request_staff reaches the chief of staff; no other session has the tool and the launch limits still hold --- - duration_ms: 1260.785468 + duration_ms: 1238.624524 type: 'test' ... # Subtest: each launch makes sure the workspace has a clone of the project: cloned, fast-forwarded, or fetched and logged ok 5 - each launch makes sure the workspace has a clone of the project: cloned, fast-forwarded, or fetched and logged --- - duration_ms: 4079.777924 + duration_ms: 4045.23068 type: 'test' ... # Subtest: a role the broker says holds a merge decision gets land_work, its prompt line, its landing and the git socket; without it, none ok 6 - a role the broker says holds a merge decision gets land_work, its prompt line, its landing and the git socket; without it, none --- - duration_ms: 602.445534 + duration_ms: 597.835066 type: 'test' ... # Subtest: REQ-LAUNCH-1 the tick starts a listed merge decision holder once, with land_work, the Landing line and its landing turn; an unlisted holder starts nothing ok 7 - REQ-LAUNCH-1 the tick starts a listed merge decision holder once, with land_work, the Landing line and its landing turn; an unlisted holder starts nothing --- - duration_ms: 401.42897 + duration_ms: 353.154987 type: 'test' ... -# usage: {"event":"usage-unknown","business":"acme","run":"r91e3ad863ad3","instance":"coder","turn":"b80d99c8-e809-4461-9c46-6b36ca47b775","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r4652c5115528","instance":"coder","turn":"51a1a049-358f-438c-b27b-fca9a3396b36","source":"@none","code":"baseline-unknown"} # Subtest: a holder running since before the resolution is stopped once the broker releases it, land-relaunch, and the next tick starts it: landing turn first, then the message that waited ok 8 - a holder running since before the resolution is stopped once the broker releases it, land-relaunch, and the next tick starts it: landing turn first, then the message that waited --- - duration_ms: 676.724798 + duration_ms: 684.451138 type: 'test' ... # Subtest: a landing run that ended isn't started again for its decision, a spent decision starts nothing, and a new decision starts the holder ok 9 - a landing run that ended isn't started again for its decision, a spent decision starts nothing, and a new decision starts the holder --- - duration_ms: 578.985078 + duration_ms: 629.428309 type: 'test' ... # Subtest: after a restart, the new host's first tick starts a holder whose decision is still held ok 10 - after a restart, the new host's first tick starts a holder whose decision is still held --- - duration_ms: 870.835521 + duration_ms: 904.62602 type: 'test' ... # Subtest: a refused landing start is logged once per code with its decision, isn't a start, and the next tick with room starts the holder ok 11 - a refused landing start is logged once per code with its decision, isn't a start, and the next tick with room starts the holder --- - duration_ms: 633.801547 + duration_ms: 626.261549 type: 'test' ... # Subtest: a project clone that can't be made refuses checkout-failed, from --chief and from a session, with no run and no clone left ok 12 - a project clone that can't be made refuses checkout-failed, from --chief and from a session, with no run and no clone left --- - duration_ms: 281.44642 + duration_ms: 267.648666 type: 'test' ... # Subtest: a runner that stops at once ends its launch with the runner's reason ok 13 - a runner that stops at once ends its launch with the runner's reason --- - duration_ms: 350.182818 + duration_ms: 333.589161 type: 'test' ... # Subtest: a Claude Code launch with no session credential refuses before it starts ok 14 - a Claude Code launch with no session credential refuses before it starts --- - duration_ms: 227.256782 + duration_ms: 196.204688 type: 'test' ... # Subtest: a pi launch needs no session credential: pi logs in through its own ENV_ALLOW variables ok 15 - a pi launch needs no session credential: pi logs in through its own ENV_ALLOW variables --- - duration_ms: 355.020473 + duration_ms: 324.7864 type: 'test' ... # usage: {"event":"plugin-refused","kind":"harness","name":"down","code":"missing","message":"/mnt/storage/scratch/rocko-r219/packages/plugins/harness/down is missing","kept":[]} @@ -105,118 +105,117 @@ ok 15 - a pi launch needs no session credential: pi logs in through its own ENV_ # Subtest: row 65 a failed primary preflight launches the fallback on a fixture harness module, recording the route and the reason ok 16 - row 65 a failed primary preflight launches the fallback on a fixture harness module, recording the route and the reason --- - duration_ms: 395.228029 + duration_ms: 371.866314 type: 'test' ... # Subtest: a runner killed from the host ends its launch as killed, not failed ok 17 - a runner killed from the host ends its launch as killed, not failed --- - duration_ms: 426.266157 + duration_ms: 392.194089 type: 'test' ... # Subtest: a missing or failing bwrap refuses sandbox-unavailable before anything starts; there is no unconfined fallback ok 18 - a missing or failing bwrap refuses sandbox-unavailable before anything starts; there is no unconfined fallback --- - duration_ms: 224.638023 + duration_ms: 202.884427 type: 'test' ... # Subtest: row 64 a role skill that isn't enabled refuses skill-not-enabled, and one that isn't a plain directory skill-refused, before anything starts ok 19 - row 64 a role skill that isn't enabled refuses skill-not-enabled, and one that isn't a plain directory skill-refused, before anything starts --- - duration_ms: 193.63499 + duration_ms: 194.743064 type: 'test' ... # Subtest: row 213 a creative instance's persona is read from /personas: off its digest the launch fails with the mismatch as its reason ok 20 - row 213 a creative instance's persona is read from /personas: off its digest the launch fails with the mismatch as its reason --- - duration_ms: 276.964378 + duration_ms: 259.238364 type: 'test' ... # Subtest: row 64 on Claude Code a role skill that isn't enabled refuses the same way, before anything starts ok 21 - row 64 on Claude Code a role skill that isn't enabled refuses the same way, before anything starts --- - duration_ms: 199.95263 + duration_ms: 195.621694 type: 'test' ... -# usage: {"event":"usage-unknown","business":"acme","run":"r0292ea4215c0","instance":"chief","turn":"e2a42abe-43ec-4873-a349-c93850a0b2d1","source":"@none","code":"baseline-unknown"} -# usage: {"event":"usage-unknown","business":"acme","run":"r0292ea4215c0","instance":"chief","turn":"b84fdcd2-08f1-4c7d-a1be-edf183ecf035","source":"@none","code":"baseline-unknown"} -# usage: {"event":"usage-unknown","business":"acme","run":"rb645b3bdbf17","instance":"coder","turn":"8c651e69-aef3-428e-9ecb-fa2c53e86f79","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r9cf2ba4aaf31","instance":"chief","turn":"2c73ea95-2667-418b-bc55-e6718bf2dfad","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"rc573a1b42fc5","instance":"coder","turn":"bea54efe-2383-4813-95e2-88f78fb5c666","source":"@none","code":"baseline-unknown"} # Subtest: a real Claude Code coder's shell can't read a stand-in secret or anything else its sandbox doesn't hold ok 22 - a real Claude Code coder's shell can't read a stand-in secret or anything else its sandbox doesn't hold --- - duration_ms: 1419.59525 + duration_ms: 1629.531256 type: 'test' ... # Subtest: a host that died hard leaves its sessions to the next host, which kills them and ends their runs so the role can be launched again ok 23 - a host that died hard leaves its sessions to the next host, which kills them and ends their runs so the role can be launched again --- - duration_ms: 1046.224325 + duration_ms: 1167.026862 type: 'test' ... # Subtest: a host that died hard leaves its sessions to the next host, which finds one already exited (23) and ends their runs so the role can be launched again ok 24 - a host that died hard leaves its sessions to the next host, which finds one already exited (23) and ends their runs so the role can be launched again --- - duration_ms: 3988.178511 + duration_ms: 4007.66668 type: 'test' ... # Subtest: bus start --no-launch leaves an earlier host's live session alone: no signal, no end, sessions.json as it was ok 25 - bus start --no-launch leaves an earlier host's live session alone: no signal, no end, sessions.json as it was --- - duration_ms: 242.392974 + duration_ms: 239.242108 type: 'test' ... # Subtest: bus start --no-launch refuses every launch: the PM launch and a session's request, each logged, nothing spawned ok 26 - bus start --no-launch refuses every launch: the PM launch and a session's request, each logged, nothing spawned --- - duration_ms: 218.198607 + duration_ms: 199.521317 type: 'test' ... # Subtest: bus start --no-launch starts no thread tick; the same host with launches runs it ok 27 - bus start --no-launch starts no thread tick; the same host with launches runs it --- - duration_ms: 1199.857353 + duration_ms: 1177.497521 type: 'test' ... # Subtest: a malformed sessions.json refuses the host start with exit 3 and stays as it was ok 28 - a malformed sessions.json refuses the host start with exit 3 and stays as it was --- - duration_ms: 181.02391 + duration_ms: 178.077896 type: 'test' ... # Subtest: an over-long launch request is refused at once, not at the 10 s idle timeout ok 29 - an over-long launch request is refused at once, not at the 10 s idle timeout --- - duration_ms: 181.674266 + duration_ms: 188.573981 type: 'test' ... # Subtest: a launch client that never closes its side doesn't hold the host's close ok 30 - a launch client that never closes its side doesn't hold the host's close --- - duration_ms: 183.632625 + duration_ms: 184.053738 type: 'test' ... # Subtest: a runner that ignores SIGTERM is killed when the host closes ok 31 - a runner that ignores SIGTERM is killed when the host closes --- - duration_ms: 1365.88402 + duration_ms: 1355.882576 type: 'test' ... # Subtest: kill switch refuses chief and hire before launch work and a clear permits a later request ok 32 - kill switch refuses chief and hire before launch work and a clear permits a later request --- - duration_ms: 334.261623 + duration_ms: 313.50548 type: 'test' ... # Subtest: kill switch stops an actual managed namespace and records the halt reason without rewriting its bundle ok 33 - kill switch stops an actual managed namespace and records the halt reason without rewriting its bundle --- - duration_ms: 337.104395 + duration_ms: 323.703188 type: 'test' ... # Subtest: a launch waiting across halt and resume cannot use its stale admission ok 34 - a launch waiting across halt and resume cannot use its stale admission --- - duration_ms: 194.683714 + duration_ms: 196.26668 type: 'test' ... 1..34 @@ -227,4 +226,4 @@ ok 34 - a launch waiting across halt and resume cannot use its stale admission # cancelled 0 # skipped 0 # todo 0 -# duration_ms 26492.10694 +# duration_ms 26550.340355 diff --git a/agents/rocko/work/queue-219/run-4a9c-mos1408/single-cli-thread-launch.test.tap b/agents/rocko/work/queue-219/run-4a9c-mos1408/single-cli-thread-launch.test.tap index ca9bd70c9..c6c244702 100644 --- a/agents/rocko/work/queue-219/run-4a9c-mos1408/single-cli-thread-launch.test.tap +++ b/agents/rocko/work/queue-219/run-4a9c-mos1408/single-cli-thread-launch.test.tap @@ -1,72 +1,72 @@ TAP version 13 -# usage: {"event":"usage-unknown","business":"acme","run":"r2204f4cc976c","instance":"assistant","turn":"fdd36b75-12af-4495-ba60-8a2fdd991676","source":"@none","code":"baseline-unknown"} -# usage: {"event":"usage-unknown","business":"acme","run":"r42619c482fdd","instance":"assistant","turn":"4a493440-df70-4de2-a9be-f31bb9efbe67","source":"@none","code":"baseline-unknown"} -# usage: {"event":"usage-unknown","business":"acme","run":"r65dae8bd493b","instance":"assistant","turn":"2a27c708-e430-4bcc-82b5-67dc51173d46","source":"@none","code":"baseline-unknown"} -# usage: {"event":"usage-unknown","business":"acme","run":"r4f264ceb0a50","instance":"assistant","turn":"dedfd89c-7a7a-4bb8-ba67-ca0e6a417ee8","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r3cbaedb93e9e","instance":"assistant","turn":"e9d9b5c9-7927-4afe-bbec-09ebb7e3c2d8","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"rdd4958ee00ee","instance":"assistant","turn":"691b3b36-ad3a-4a36-b0c0-c1cbe3bb9718","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r1410d16d8724","instance":"assistant","turn":"44a08edb-5d78-4422-9cc3-3de2dcbcc446","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r985e2dd44866","instance":"assistant","turn":"c19c4a62-eca2-4b50-aa07-a3039c941951","source":"@none","code":"baseline-unknown"} # Subtest: REQ-THREAD-2 REQ-LAUNCH-1 REQ-MSG-1 a thread message starts the thread's session, which stops when idle; its history survives the stop and a restart and no other thread sees it ok 1 - REQ-THREAD-2 REQ-LAUNCH-1 REQ-MSG-1 a thread message starts the thread's session, which stops when idle; its history survives the stop and a restart and no other thread sees it --- - duration_ms: 5837.256276 + duration_ms: 5834.488965 type: 'test' ... -# usage: {"event":"usage-unknown","business":"acme","run":"red085121d9a7","instance":"assistant","turn":"536c8b62-f126-4b17-a1f2-756e2aede65e","source":"@none","code":"baseline-unknown"} -# usage: {"event":"usage-unknown","business":"acme","run":"ree31908db53d","instance":"assistant","turn":"f23f7966-9c87-4d7b-9d9a-93211c1431c0","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r04a576c1f8c7","instance":"assistant","turn":"3dc2be1d-3ab4-42eb-96b2-fe2f23f9a098","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r71b29c392723","instance":"assistant","turn":"c4afa895-0e71-4e02-a6a8-93ee33a3149f","source":"@none","code":"baseline-unknown"} # Subtest: REQ-THREAD-2 REQ-LAUNCH-1 a running thread counts against its model's limit and an idle-stopped one doesn't ok 2 - REQ-THREAD-2 REQ-LAUNCH-1 a running thread counts against its model's limit and an idle-stopped one doesn't --- - duration_ms: 1713.759995 + duration_ms: 1705.349475 type: 'test' ... -# usage: {"event":"usage-unknown","business":"acme","run":"r5c82fe368237","instance":"assistant","turn":"081a280e-73b4-48fc-89a9-688e73704186","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r6a44bba72669","instance":"assistant","turn":"465d12fa-1123-481e-9f66-13cae16356a9","source":"@none","code":"baseline-unknown"} # Subtest: REQ-THREAD-2 REQ-LAUNCH-1 a turn longer than the idle time isn't stopped, and the thread idles out after it ok 3 - REQ-THREAD-2 REQ-LAUNCH-1 a turn longer than the idle time isn't stopped, and the thread idles out after it --- - duration_ms: 4442.41406 + duration_ms: 4414.175885 type: 'test' ... -# usage: {"event":"usage-unknown","business":"acme","run":"r008070c44356","instance":"assistant","turn":"3175be8d-24d9-4d46-b9fe-e08c8edd0a5e","source":"@none","code":"baseline-unknown"} -# usage: {"event":"usage-unknown","business":"acme","run":"r008070c44356","instance":"assistant","turn":"961030fd-2dd3-4deb-a9be-f10af56ba7f7","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r754792f99f16","instance":"assistant","turn":"a938a0f9-3876-4178-b3c0-3d993a88b6d1","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r754792f99f16","instance":"assistant","turn":"52f8b51f-968c-4168-b45a-0dbb31a8062e","source":"@none","code":"baseline-unknown"} # Subtest: REQ-THREAD-2 REQ-LAUNCH-1 a message sent after the idle snapshot keeps the session, which answers it ok 4 - REQ-THREAD-2 REQ-LAUNCH-1 a message sent after the idle snapshot keeps the session, which answers it --- - duration_ms: 2897.279317 + duration_ms: 2896.8825 type: 'test' ... # Subtest: REQ-ROLE-2 REQ-LAUNCH-1 a thread held by a run the launcher didn't start gets no second session ok 5 - REQ-ROLE-2 REQ-LAUNCH-1 a thread held by a run the launcher didn't start gets no second session --- - duration_ms: 79.744891 + duration_ms: 80.27078 type: 'test' ... -# usage: {"event":"usage-unknown","business":"acme","run":"rf65e96bfb0f4","instance":"assistant","turn":"61a6ab74-b6bd-4274-a83e-0f8fb4f61a68","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"raeec2e45fadf","instance":"assistant","turn":"9feca456-d42b-4fef-a90c-e9e0bc42900d","source":"@none","code":"baseline-unknown"} # Subtest: REQ-LAUNCH-1 a thread run's session file has no landing, even when landHolders names its instance ok 6 - REQ-LAUNCH-1 a thread run's session file has no landing, even when landHolders names its instance --- - duration_ms: 374.600592 + duration_ms: 375.325022 type: 'test' ... # Subtest: REQ-LAUNCH-1 a run that ends without taking its thread's message isn't started again for that message ok 7 - REQ-LAUNCH-1 a run that ends without taking its thread's message isn't started again for that message --- - duration_ms: 232.164242 + duration_ms: 224.817609 type: 'test' ... # Subtest: REQ-THREAD-2 REQ-LAUNCH-1 a thread id that isn't a safe segment, or a thread of a non-thread instance, launches nothing ok 8 - REQ-THREAD-2 REQ-LAUNCH-1 a thread id that isn't a safe segment, or a thread of a non-thread instance, launches nothing --- - duration_ms: 226.367358 + duration_ms: 218.942512 type: 'test' ... # Subtest: REQ-THREAD-1 REQ-LAUNCH-1 the chief can't launch the assistant outside a thread ok 9 - REQ-THREAD-1 REQ-LAUNCH-1 the chief can't launch the assistant outside a thread --- - duration_ms: 78.315815 + duration_ms: 78.217748 type: 'test' ... # Subtest: C2-09a: fromSession refuses a creative instance outside a thread without a sandbox ok 10 - C2-09a: fromSession refuses a creative instance outside a thread without a sandbox --- - duration_ms: 74.784926 + duration_ms: 77.300657 type: 'test' ... # limits: {"event":"limit-reached","business":"acme","check":"token-limit","export":"mayLaunch","subject":{"instance":"assistant","provider":"zai","model":"claude-sonnet-5-5","account":null},"path":["tokens","instances","assistant"],"limit":0,"count":0,"unknownTurns":0} @@ -74,49 +74,40 @@ ok 10 - C2-09a: fromSession refuses a creative instance outside a thread without # Subtest: REQ-LIMIT-3 REQ-LIMIT-4 a thread start whose instance is at its token limit is refused, logged once with the limit and the count ok 11 - REQ-LIMIT-3 REQ-LIMIT-4 a thread start whose instance is at its token limit is refused, logged once with the limit and the count --- - duration_ms: 192.227024 + duration_ms: 193.556032 type: 'test' ... -# usage: {"event":"usage-unknown","business":"acme","run":"r3ffa99981f81","instance":"assistant","turn":"c194605d-1b92-488c-9afe-2599f205e80e","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r88480b9d9bb0","instance":"assistant","turn":"608959cc-73cd-4dec-afb1-b6173eef917a","source":"@none","code":"baseline-unknown"} # limits: {"event":"limit-reached","business":"acme","check":"token-limit","export":"mustStop","subject":{"instance":"assistant","provider":"zai","model":"claude-sonnet-5-5","account":null},"path":["tokens","instances","assistant"],"limit":0,"count":0,"unknownTurns":1} # Subtest: REQ-LIMIT-4 a thread run at its token limit stops at the end of its turn: the reply lands, and the end record names the limit ok 12 - REQ-LIMIT-4 a thread run at its token limit stops at the end of its turn: the reply lands, and the end record names the limit --- - duration_ms: 346.819478 + duration_ms: 344.672866 type: 'test' ... -# usage: {"event":"usage-unknown","business":"acme","run":"r013acfa3de9d","instance":"bean","turn":"26896136-02b5-4948-8c84-7e0be580c485","source":"@none","code":"baseline-unknown"} -# usage: {"event":"usage-unknown","business":"acme","run":"r13746c56cf7b","instance":"chet","turn":"2a7d4bed-79e7-4b74-b602-c07fe90be87f","source":"@none","code":"baseline-unknown"} -# usage: {"event":"usage-unknown","business":"acme","run":"r013acfa3de9d","instance":"bean","turn":"32222fad-092d-4ac9-b5de-d40de519bf82","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r757ceeb5a4e2","instance":"bean","turn":"aaba8e84-43ad-4d80-9f91-e47c4eb738a7","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r66f34e40ffb8","instance":"chet","turn":"49ba0ae9-1bf3-4f55-9890-89b3517fc2bd","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r757ceeb5a4e2","instance":"bean","turn":"48ba94a2-7b25-444e-a32a-38d665ee402e","source":"@none","code":"baseline-unknown"} # Subtest: C2-09a: creative thread messages start distinct runs and keep each instance history separate -not ok 13 - C2-09a: creative thread messages start distinct runs and keep each instance history separate +ok 13 - C2-09a: creative thread messages start distinct runs and keep each instance history separate --- - duration_ms: 746.425172 + duration_ms: 752.885702 type: 'test' - location: '/mnt/storage/scratch/rocko-r219/packages/cli/tests/thread-launch.test.mjs:463:1' - failureType: 'testCodeFailure' - error: "ENOENT: no such file or directory, open '/mnt/storage/scratch/tmp/rbyz9a6iu/mosaic-thread-Cgx1tR/data/threads/acme/0a27cae9-cdb8-436d-8cc8-a59b316577e9/session/history'" - code: 'ENOENT' - stack: |- - readFileSync (node:fs:621:20) - TestContext. (file:///mnt/storage/scratch/rocko-r219/packages/cli/tests/thread-launch.test.mjs:489:16) - async Test.run (node:internal/test_runner/test:1409:7) - async Test.processPendingSubtests (node:internal/test_runner/test:974:7) ... -# usage: {"event":"usage-unknown","business":"acme","run":"rb9998f7e5721","instance":"bean","turn":"6c83f086-940d-43ab-8219-0ee1b9dd4c7d","source":"@none","code":"baseline-unknown"} -# usage: {"event":"usage-unknown","business":"acme","run":"rdf0bd4d3e49a","instance":"bean","turn":"663ed95c-c09b-4053-aeb7-1696b6acf272","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"rbe602f558670","instance":"bean","turn":"9dd6de47-7f91-48a8-9bcb-4d0e23181d0a","source":"@none","code":"baseline-unknown"} +# usage: {"event":"usage-unknown","business":"acme","run":"r5c59dde2201a","instance":"bean","turn":"43b0b391-ccea-406f-bba4-b03f17ebe184","source":"@none","code":"baseline-unknown"} # Subtest: C2-09a: terminating one creative thread does not signal an unselected peer of the same instance ok 14 - C2-09a: terminating one creative thread does not signal an unselected peer of the same instance --- - duration_ms: 643.667218 + duration_ms: 653.641213 type: 'test' ... 1..14 # tests 14 # suites 0 -# pass 13 -# fail 1 +# pass 14 +# fail 0 # cancelled 0 # skipped 0 # todo 0 -# duration_ms 18010.958178 +# duration_ms 17977.782085 diff --git a/agents/rocko/work/queue-219/run-4a9c-mos1408/single-webui-chat-browser.test.tap b/agents/rocko/work/queue-219/run-4a9c-mos1408/single-webui-chat-browser.test.tap new file mode 100644 index 000000000..c9b7b9cf1 --- /dev/null +++ b/agents/rocko/work/queue-219/run-4a9c-mos1408/single-webui-chat-browser.test.tap @@ -0,0 +1,94 @@ +TAP version 13 +# Subtest: chat browser: list/create named projects and threads, hostile labels inert and no implicit writes +ok 1 - chat browser: list/create named projects and threads, hostile labels inert and no implicit writes + --- + duration_ms: 936.268368 + type: 'test' + ... +# Subtest: chat browser: thread drafts, receipts and cursor history stay isolated; refresh never writes +ok 2 - chat browser: thread drafts, receipts and cursor history stay isolated; refresh never writes + --- + duration_ms: 602.776985 + type: 'test' + ... +# Subtest: chat browser: uncertain writes retain draft, ownership refusal clears it, read-only cannot send +ok 3 - chat browser: uncertain writes retain draft, ownership refusal clears it, read-only cannot send + --- + duration_ms: 748.487224 + type: 'test' + ... +# Subtest: chat browser: a late read from A cannot paint B; sign-out clears private state and stops reads +ok 4 - chat browser: a late read from A cannot paint B; sign-out clears private state and stops reads + --- + duration_ms: 808.240338 + type: 'test' + ... +# Subtest: chat browser: page forward and deduplicate replies; pending and byte-limit submissions do not duplicate +ok 5 - chat browser: page forward and deduplicate replies; pending and byte-limit submissions do not duplicate + --- + duration_ms: 612.785782 + type: 'test' + ... +# Subtest: chat browser: scrolled history stays put, New messages and an own send return to the tail +ok 6 - chat browser: scrolled history stays put, New messages and an own send return to the tail + --- + duration_ms: 587.664991 + type: 'test' + ... +# Subtest: chat browser: automatic polling follows a reply without a POST or a lost draft +ok 7 - chat browser: automatic polling follows a reply without a POST or a lost draft + --- + duration_ms: 10575.301338 + type: 'test' + ... +# Subtest: chat browser: display stays bounded while every forward page remains reachable +ok 8 - chat browser: display stays bounded while every forward page remains reachable + --- + duration_ms: 465.055105 + type: 'test' + ... +# Subtest: chat browser: a confirmed visible message replaces its pending receipt; malformed receipts stay unknown +ok 9 - chat browser: a confirmed visible message replaces its pending receipt; malformed receipts stay unknown + --- + duration_ms: 543.602626 + type: 'test' + ... +# Subtest: chat browser: a refusal elsewhere forgets private chat drafts +ok 10 - chat browser: a refusal elsewhere forgets private chat drafts + --- + duration_ms: 472.966826 + type: 'test' + ... +# Subtest: chat browser: a late project creation receipt cannot navigate away from another thread +ok 11 - chat browser: a late project creation receipt cannot navigate away from another thread + --- + duration_ms: 549.648649 + type: 'test' + ... +# Subtest: C2-09a picker: no silent choice, duplicate hostile labels stay inert, selection survives refresh and reaches POST +ok 12 - C2-09a picker: no silent choice, duplicate hostile labels stay inert, selection survives refresh and reaches POST + --- + duration_ms: 608.893729 + type: 'test' + ... +# Subtest: C2-09a picker: metadata failure, empty set and removed pick explain disabled state and recover without switching +ok 13 - C2-09a picker: metadata failure, empty set and removed pick explain disabled state and recover without switching + --- + duration_ms: 653.667293 + type: 'test' + ... +# Subtest: C2-09a picker: a single instance is chosen explicitly but read-only mode cannot create a thread +ok 14 - C2-09a picker: a single instance is chosen explicitly but read-only mode cannot create a thread + --- + duration_ms: 584.468742 + type: 'test' + ... +1..14 +# tests 14 +# suites 0 +# pass 14 +# fail 0 +# cancelled 0 +# skipped 0 +# todo 0 +# duration_ms 18856.847319 diff --git a/agents/rocko/work/queue-219/run-4a9c-mos1408/single-webui-chat-instances.test.tap b/agents/rocko/work/queue-219/run-4a9c-mos1408/single-webui-chat-instances.test.tap new file mode 100644 index 000000000..32c002c9a --- /dev/null +++ b/agents/rocko/work/queue-219/run-4a9c-mos1408/single-webui-chat-instances.test.tap @@ -0,0 +1,34 @@ +TAP version 13 +# Subtest: C2-09a metadata uses the human listener bus, projects labels only and refuses unauthenticated reads +ok 1 - C2-09a metadata uses the human listener bus, projects labels only and refuses unauthenticated reads + --- + duration_ms: 16.694095 + type: 'test' + ... +# Subtest: C2-09a metadata uses the private tester listener own bus and no human transport +ok 2 - C2-09a metadata uses the private tester listener own bus and no human transport + --- + duration_ms: 2.7219 + type: 'test' + ... +# Subtest: C2-09a metadata refuses missing or malformed reads and never echoes untrusted fields +ok 3 - C2-09a metadata refuses missing or malformed reads and never echoes untrusted fields + --- + duration_ms: 3.349671 + type: 'test' + ... +# Subtest: C2-09a metadata stays behind the SSO session check and a GET never refreshes session activity +ok 4 - C2-09a metadata stays behind the SSO session check and a GET never refreshes session activity + --- + duration_ms: 2.024242 + type: 'test' + ... +1..4 +# tests 4 +# suites 0 +# pass 4 +# fail 0 +# cancelled 0 +# skipped 0 +# todo 0 +# duration_ms 122.008979 diff --git a/agents/rocko/work/queue-219/run-4a9c-mos1408/single-webui-chat.test.tap b/agents/rocko/work/queue-219/run-4a9c-mos1408/single-webui-chat.test.tap new file mode 100644 index 000000000..a8b3df6c9 --- /dev/null +++ b/agents/rocko/work/queue-219/run-4a9c-mos1408/single-webui-chat.test.tap @@ -0,0 +1,160 @@ +TAP version 13 +# Subtest: chat reads map only fixed verbs, strict forward paging and pure GET +ok 1 - chat reads map only fixed verbs, strict forward paging and pure GET + --- + duration_ms: 32.994704 + type: 'test' + ... +# Subtest: chat refuses malformed and repeated query/id values before transport +ok 2 - chat refuses malformed and repeated query/id values before transport + --- + duration_ms: 4.672731 + type: 'test' + ... +# Subtest: chat project.create: one verified write, fixed identity/class and private log +ok 3 - chat project.create: one verified write, fixed identity/class and private log + --- + duration_ms: 2.784231 + type: 'test' + ... +# Subtest: chat project.create: each existing Console write fence makes zero bus calls +ok 4 - chat project.create: each existing Console write fence makes zero bus calls + --- + duration_ms: 6.854048 + type: 'test' + ... +# Subtest: chat project.create: refusal or lost/malformed receipt never retries or invents success +ok 5 - chat project.create: refusal or lost/malformed receipt never retries or invents success + --- + duration_ms: 3.53835 + type: 'test' + ... +# Subtest: chat thread.create: one verified write, fixed identity/class and private log +ok 6 - chat thread.create: one verified write, fixed identity/class and private log + --- + duration_ms: 1.26663 + type: 'test' + ... +# Subtest: chat thread.create: each existing Console write fence makes zero bus calls +ok 7 - chat thread.create: each existing Console write fence makes zero bus calls + --- + duration_ms: 5.658165 + type: 'test' + ... +# Subtest: chat thread.create: refusal or lost/malformed receipt never retries or invents success +ok 8 - chat thread.create: refusal or lost/malformed receipt never retries or invents success + --- + duration_ms: 3.756541 + type: 'test' + ... +# Subtest: chat thread.send: one verified write, fixed identity/class and private log +ok 9 - chat thread.send: one verified write, fixed identity/class and private log + --- + duration_ms: 1.052634 + type: 'test' + ... +# Subtest: chat thread.send: each existing Console write fence makes zero bus calls +ok 10 - chat thread.send: each existing Console write fence makes zero bus calls + --- + duration_ms: 4.98916 + type: 'test' + ... +# Subtest: chat thread.send: refusal or lost/malformed receipt never retries or invents success +ok 11 - chat thread.send: refusal or lost/malformed receipt never retries or invents success + --- + duration_ms: 2.799871 + type: 'test' + ... +# Subtest: chat thread.open: one verified write, fixed identity/class and private log +ok 12 - chat thread.open: one verified write, fixed identity/class and private log + --- + duration_ms: 0.924357 + type: 'test' + ... +# Subtest: chat thread.open: each existing Console write fence makes zero bus calls +ok 13 - chat thread.open: each existing Console write fence makes zero bus calls + --- + duration_ms: 5.935949 + type: 'test' + ... +# Subtest: chat thread.open: refusal or lost/malformed receipt never retries or invents success +ok 14 - chat thread.open: refusal or lost/malformed receipt never retries or invents success + --- + duration_ms: 4.265801 + type: 'test' + ... +# Subtest: chat createThread receipt requires an instance even when its id is valid +ok 15 - chat createThread receipt requires an instance even when its id is valid + --- + duration_ms: 1.94677 + type: 'test' + ... +# Subtest: chat write receipts expose only the fields belonging to their operation +ok 16 - chat write receipts expose only the fields belonging to their operation + --- + duration_ms: 3.157564 + type: 'test' + ... +# Subtest: chat validates names, body, project and strict empty open payload +ok 17 - chat validates names, body, project and strict empty open payload + --- + duration_ms: 3.454696 + type: 'test' + ... +# Subtest: chat read failures redact ownership and refuse invalid transport arrays +ok 18 - chat read failures redact ownership and refuse invalid transport arrays + --- + duration_ms: 3.332048 + type: 'test' + ... +# Subtest: REQ-USER-2 real broker: owned catalog, create/name/filter, isolated history and 403/404 without mutations +ok 19 - REQ-USER-2 real broker: owned catalog, create/name/filter, isolated history and 403/404 without mutations + --- + duration_ms: 83.632528 + type: 'test' + ... +# Subtest: chat repeats every POST boundary even when called behind an admitted request +ok 20 - chat repeats every POST boundary even when called behind an admitted request + --- + duration_ms: 0.989385 + type: 'test' + ... +# Subtest: configured Console process injects chat through its existing human transport +ok 21 - configured Console process injects chat through its existing human transport + --- + duration_ms: 134.070265 + type: 'test' + ... +# Subtest: chat assets, GET purity, method and unknown-route refusals are explicit +ok 22 - chat assets, GET purity, method and unknown-route refusals are explicit + --- + duration_ms: 11.62792 + type: 'test' + ... +# Subtest: the chat seam names the transport it is given: the human one and the tester one both pass, anything else is a TypeError +ok 23 - the chat seam names the transport it is given: the human one and the tester one both pass, anything else is a TypeError + --- + duration_ms: 0.497628 + type: 'test' + ... +# Subtest: C2-09a createThread forwards an explicit instance through the existing channel +ok 24 - C2-09a createThread forwards an explicit instance through the existing channel + --- + duration_ms: 3.577119 + type: 'test' + ... +# Subtest: C2-09a malformed instance and extra thread fields refuse before the channel write +ok 25 - C2-09a malformed instance and extra thread fields refuse before the channel write + --- + duration_ms: 3.204303 + type: 'test' + ... +1..25 +# tests 25 +# suites 0 +# pass 25 +# fail 0 +# cancelled 0 +# skipped 0 +# todo 0 +# duration_ms 441.402332 diff --git a/agents/rocko/work/queue-219/run-4a9c-mos1408/suite-bus.tap b/agents/rocko/work/queue-219/run-4a9c-mos1408/suite-bus.tap new file mode 100644 index 000000000..b5e32e117 --- /dev/null +++ b/agents/rocko/work/queue-219/run-4a9c-mos1408/suite-bus.tap @@ -0,0 +1,5363 @@ +TAP version 13 +# Subtest: REQ-LIMIT-4 3h copy migrates to 3i: every row keeps its seq, the sequence carries over, and only the account CHECK changes +ok 1 - REQ-LIMIT-4 3h copy migrates to 3i: every row keeps its seq, the sequence carries over, and only the account CHECK changes + --- + duration_ms: 176.494712 + type: 'test' + ... +# Subtest: REQ-LIMIT-4 a 3h→3i step that fails partway leaves the store at 3h with every row, the sequence and the schema intact +ok 2 - REQ-LIMIT-4 a 3h→3i step that fails partway leaves the store at 3h with every row, the sequence and the schema intact + --- + duration_ms: 208.838552 + type: 'test' + ... +# Subtest: REQ-LIMIT-4 the 3h engine refuses a migrated store, migrating or not, and leaves it as it was +ok 3 - REQ-LIMIT-4 the 3h engine refuses a migrated store, migrating or not, and leaves it as it was + --- + duration_ms: 200.092473 + type: 'test' + ... +# Subtest: agents: a held role with nothing on the bus is idle; a role session gets the claim rows unchanged +ok 4 - agents: a held role with nothing on the bus is idle; a role session gets the claim rows unchanged + --- + duration_ms: 42.665803 + type: 'test' + ... +# Subtest: agents: working counts what the holder received and has not read; routed alone is not working +ok 5 - agents: working counts what the holder received and has not read; routed alone is not working + --- + duration_ms: 43.634409 + type: 'test' + ... +# Subtest: agents: input needed is the role's open decisions routed to the human, gated first, then oldest +ok 6 - agents: input needed is the role's open decisions routed to the human, gated first, then oldest + --- + duration_ms: 71.213079 + type: 'test' + ... +# Subtest: agents: working wins over waiting, and Input needed still shows +ok 7 - agents: working wins over waiting, and Input needed still shows + --- + duration_ms: 35.055063 + type: 'test' + ... +# Subtest: agents: a new holder doesn't inherit what the last one left unread; decisions stay with the role +ok 8 - agents: a new holder doesn't inherit what the last one left unread; decisions stay with the role + --- + duration_ms: 36.780425 + type: 'test' + ... +# Subtest: agents: state reads only its own business, even for a run name both use +ok 9 - agents: state reads only its own business, even for a run name both use + --- + duration_ms: 36.17732 + type: 'test' + ... +# Subtest: agents: a message the holder released unread is stranded; the next holder gets nothing and cannot read it +ok 10 - agents: a message the holder released unread is stranded; the next holder gets nothing and cannot read it + --- + duration_ms: 42.835927 + type: 'test' + ... +# Subtest: agents: a message the holder read is not stranded; one the current holder has not read is not listed +ok 11 - agents: a message the holder read is not stranded; one the current holder has not read is not listed + --- + duration_ms: 48.996301 + type: 'test' + ... +# Subtest: agents: stranded is oldest first and capped at 50 for a role +ok 12 - agents: stranded is oldest first and capped at 50 for a role + --- + duration_ms: 176.842005 + type: 'test' + ... +# Subtest: agents: stranded is per role and per business +ok 13 - agents: stranded is per role and per business + --- + duration_ms: 74.199989 + type: 'test' + ... +# Subtest: agents: a message routed to a held role and not yet received is not stranded +ok 14 - agents: a message routed to a held role and not yet received is not stranded + --- + duration_ms: 28.442217 + type: 'test' + ... +# Subtest: REQ-DEC an approval outlives its run and a broker restart; a new run of the instance consumes it once +ok 15 - REQ-DEC an approval outlives its run and a broker restart; a new run of the instance consumes it once + --- + duration_ms: 62.752023 + type: 'test' + ... +# Subtest: REQ-DEC another instance of the same definition cannot consume an approval, and its refusal consumes nothing +ok 16 - REQ-DEC another instance of the same definition cannot consume an approval, and its refusal consumes nothing + --- + duration_ms: 37.736579 + type: 'test' + ... +# Subtest: REQ-DEC REQ-THREAD-1 a thread approval is consumed only by a run holding the same thread +ok 17 - REQ-DEC REQ-THREAD-1 a thread approval is consumed only by a run holding the same thread + --- + duration_ms: 55.773953 + type: 'test' + ... +# Subtest: REQ-DEC a later run of the same instance supersedes an open decision; another instance cannot +ok 18 - REQ-DEC a later run of the same instance supersedes an open decision; another instance cannot + --- + duration_ms: 45.724862 + type: 'test' + ... +# Subtest: REQ-DEC REQ-THREAD-1 a thread decision is superseded only from the same thread +ok 19 - REQ-DEC REQ-THREAD-1 a thread decision is superseded only from the same thread + --- + duration_ms: 45.672208 + type: 'test' + ... +# Subtest: REQ-DEC REQ-THREAD-1 a thread instance decision raised before row 121 is not consumed or superseded by any thread run +ok 20 - REQ-DEC REQ-THREAD-1 a thread instance decision raised before row 121 is not consumed or superseded by any thread run + --- + duration_ms: 64.730184 + type: 'test' + ... +# Subtest: launch identity is stamped, payload identity is refused and stale holder cannot send +ok 21 - launch identity is stamped, payload identity is refused and stale holder cannot send + --- + duration_ms: 41.798644 + type: 'test' + ... +# Subtest: decision classes route from policy; gated resolution is human-only, choice and target must match +ok 22 - decision classes route from policy; gated resolution is human-only, choice and target must match + --- + duration_ms: 55.352003 + type: 'test' + ... +# Subtest: claim exclusion, holder release, gated revoke and rerouting to a new holder are atomic +ok 23 - claim exclusion, holder release, gated revoke and rerouting to a new holder are atomic + --- + duration_ms: 52.114758 + type: 'test' + ... +# Subtest: launch events require a human CLI capability; generic emit cannot forge authority events +ok 24 - launch events require a human CLI capability; generic emit cannot forge authority events + --- + duration_ms: 32.55528 + type: 'test' + ... +# Subtest: within-role decisions close atomically and invalid options or blocking omissions refuse +ok 25 - within-role decisions close atomically and invalid options or blocking omissions refuse + --- + duration_ms: 33.485292 + type: 'test' + ... +# Subtest: a recommendation that is not exactly one option key refuses invalid-recommendation after the options +ok 26 - a recommendation that is not exactly one option key refuses invalid-recommendation after the options + --- + duration_ms: 49.134566 + type: 'test' + ... +# Subtest: observer capabilities read human inbox but cannot mutate or forge launch identity +ok 27 - observer capabilities read human inbox but cannot mutate or forge launch identity + --- + duration_ms: 31.072436 + type: 'test' + ... +# Subtest: task action subjects and linked decision trail are complete and ordered +ok 28 - task action subjects and linked decision trail are complete and ordered + --- + duration_ms: 54.746446 + type: 'test' + ... +# Subtest: launch binding is durable and reconnecting requires the identical trusted record +ok 29 - launch binding is durable and reconnecting requires the identical trusted record + --- + duration_ms: 30.575733 + type: 'test' + ... +# Subtest: business isolation includes inherited object names and cross-business message references +ok 30 - business isolation includes inherited object names and cross-business message references + --- + duration_ms: 37.387224 + type: 'test' + ... +# Subtest: authority never transfers between action, target, unresolved or replaced role holder; a later run of the instance keeps it +ok 31 - authority never transfers between action, target, unresolved or replaced role holder; a later run of the instance keeps it + --- + duration_ms: 60.276851 + type: 'test' + ... +# Subtest: task projection uses schema current view, skipping earlier and equal-start polls +ok 32 - task projection uses schema current view, skipping earlier and equal-start polls + --- + duration_ms: 33.584693 + type: 'test' + ... +# Subtest: revocation permanently bars the old run from reclaiming first, including after broker restart +ok 33 - revocation permanently bars the old run from reclaiming first, including after broker restart + --- + duration_ms: 44.055499 + type: 'test' + ... +# Subtest: empty message references refuse before storage; refusal-evidence failure stays a typed error +ok 34 - empty message references refuse before storage; refusal-evidence failure stays a typed error + --- + duration_ms: 37.320648 + type: 'test' + ... +# Subtest: both arbiters require human resolution when their cross-role route is themselves +ok 35 - both arbiters require human resolution when their cross-role route is themselves + --- + duration_ms: 44.33164 + type: 'test' + ... +# Subtest: the shipped coder role raises task.reassign as gated to the human; task.scope.change stays cross-role +ok 36 - the shipped coder role raises task.reassign as gated to the human; task.scope.change stays cross-role + --- + duration_ms: 48.429877 + type: 'test' + ... +# Subtest: S1 adapter takes resolved limits and refs, rejects mismatched instance, never mutates input +ok 37 - S1 adapter takes resolved limits and refs, rejects mismatched instance, never mutates input + --- + duration_ms: 3.30794 + type: 'test' + ... +# Subtest: channel conversion preserves the four proof/transport byte baselines and modules cannot import a proof caller +ok 38 - channel conversion preserves the four proof/transport byte baselines and modules cannot import a proof caller + --- + duration_ms: 1.674184 + type: 'test' + ... +# Subtest: channel recovery still requires the same shim path and rejects an absent or forged proof +ok 39 - channel recovery still requires the same shim path and rejects an absent or forged proof + --- + duration_ms: 623.276606 + type: 'test' + ... +# organization: {"event":"reload-needs-restart","business":"demo"} +# organization: {"event":"reload-needs-restart","business":"demo"} +# organization: {"event":"reload-needs-restart","business":"demo"} +# organization: {"event":"reload-needs-restart","business":"demo"} +# organization: {"event":"reload-needs-restart","business":"demo"} +# organization: {"event":"reload-needs-restart","business":"demo"} +# organization: {"event":"reload-needs-restart","business":"demo"} +# organization: {"event":"reload-needs-restart","business":"demo"} +# organization: {"event":"reload-needs-restart","business":"demo"} +# Subtest: REQ-COS-1, REQ-ROLE-2: the chief of staff ends a run with a reason and no decision, and the reason is logged +ok 40 - REQ-COS-1, REQ-ROLE-2: the chief of staff ends a run with a reason and no decision, and the reason is logged + --- + duration_ms: 59.789357 + type: 'test' + ... +# Subtest: REQ-ROLE-2: a role without role.end still needs a resolved decision to revoke +ok 41 - REQ-ROLE-2: a role without role.end still needs a resolved decision to revoke + --- + duration_ms: 58.893484 + type: 'test' + ... +# Subtest: REQ-ROLE-2: storage accepts a revoke with a reason or a decision and aborts one with neither +ok 42 - REQ-ROLE-2: storage accepts a revoke with a reason or a decision and aborts one with neither + --- + duration_ms: 42.218078 + type: 'test' + ... +# Subtest: REQ-ROLE-2: the chief of staff may still cite a decision, and a decision alone is the old path +ok 43 - REQ-ROLE-2: the chief of staff may still cite a decision, and a decision alone is the old path + --- + duration_ms: 42.04664 + type: 'test' + ... +# Subtest: REQ-ROLE-2: a role without role.end still ends a run through a resolved decision, which is recorded and has no reason +ok 44 - REQ-ROLE-2: a role without role.end still ends a run through a resolved decision, which is recorded and has no reason + --- + duration_ms: 62.0604 + type: 'test' + ... +# Subtest: REQ-ROLE-2: a reason is required, bounded, and never sent with a decision +ok 45 - REQ-ROLE-2: a reason is required, bounded, and never sent with a decision + --- + duration_ms: 55.149496 + type: 'test' + ... +# Subtest: REQ-COS-1: the chief of staff cannot end its own run; its end of the assistant stops the assistant's thread run +ok 46 - REQ-COS-1: the chief of staff cannot end its own run; its end of the assistant stops the assistant's thread run + --- + duration_ms: 53.645199 + type: 'test' + ... +# Subtest: REQ-LIMIT-1, REQ-COS-1: organization.set from the chief of staff reaches the shared writer, named as the actor +ok 47 - REQ-LIMIT-1, REQ-COS-1: organization.set from the chief of staff reaches the shared writer, named as the actor + --- + duration_ms: 49.042178 + type: 'test' + ... +# Subtest: REQ-LIMIT-1, REQ-COS-1: a refused organization.set logs action.refused and no action.allowed, like a refused limits.set +ok 48 - REQ-LIMIT-1, REQ-COS-1: a refused organization.set logs action.refused and no action.allowed, like a refused limits.set + --- + duration_ms: 59.344877 + type: 'test' + ... +# Subtest: REQ-LIMIT-1: organization.set is refused for every caller whose role file lacks organization.change +ok 49 - REQ-LIMIT-1: organization.set is refused for every caller whose role file lacks organization.change + --- + duration_ms: 71.728785 + type: 'test' + ... +# Subtest: REQ-LIMIT-1: the chief of staff is logged as allowed, and organization.set takes only the human's keys +ok 50 - REQ-LIMIT-1: the chief of staff is logged as allowed, and organization.set takes only the human's keys + --- + duration_ms: 70.081833 + type: 'test' + ... +# Subtest: REQ-COS-1: organization.revision answers the revision alone to the chief of staff and spends nothing +ok 51 - REQ-COS-1: organization.revision answers the revision alone to the chief of staff and spends nothing + --- + duration_ms: 54.894304 + type: 'test' + ... +# Subtest: REQ-COS-1, REQ-LIMIT-1: organization.revision is refused for every caller whose role file lacks organization.change +ok 52 - REQ-COS-1, REQ-LIMIT-1: organization.revision is refused for every caller whose role file lacks organization.change + --- + duration_ms: 58.874372 + type: 'test' + ... +# Subtest: REQ-ROLE-3, REQ-LIMIT-1: a chief-of-staff change is validated, written and logged like a human's; an invalid one is refused +ok 53 - REQ-ROLE-3, REQ-LIMIT-1: a chief-of-staff change is validated, written and logged like a human's; an invalid one is refused + --- + duration_ms: 180.991385 + type: 'test' + ... +# Subtest: REQ-COS-1: the chief of staff reads the revision, changes the file with it, and reads again after a stale one is refused +ok 54 - REQ-COS-1: the chief of staff reads the revision, changes the file with it, and reads again after a stale one is refused + --- + duration_ms: 157.372219 + type: 'test' + ... +# Subtest: Q169: the chief of staff's change of the assistant is validated, written and logged; a stale or protection-stripping one is refused +ok 55 - Q169: the chief of staff's change of the assistant is validated, written and logged; a stale or protection-stripping one is refused + --- + duration_ms: 176.225668 + type: 'test' + ... +# Subtest: row 65, Q169: the chief's change of the assistant's route runs the routing checks, and a valid one saves as the chief +ok 56 - row 65, Q169: the chief's change of the assistant's route runs the routing checks, and a valid one saves as the chief + --- + duration_ms: 110.755093 + type: 'test' + ... +# Subtest: REQ-ROLE-2, REQ-COS-1: the 3c→3d migration lets the chief of staff end a held role with a reason; neither is still refused +ok 57 - REQ-ROLE-2, REQ-COS-1: the 3c→3d migration lets the chief of staff end a held role with a reason; neither is still refused + --- + duration_ms: 143.685527 + type: 'test' + ... +# Subtest: row 194 T10: the chief's reason end of a kept instance refuses instance-kept, holds the claim and spends nothing +ok 58 - row 194 T10: the chief's reason end of a kept instance refuses instance-kept, holds the claim and spends nothing + --- + duration_ms: 42.562604 + type: 'test' + ... +# Subtest: row 194 T10 (Q2): a role.revoke citing a decision the human resolved still ends a kept run +ok 59 - row 194 T10 (Q2): a role.revoke citing a decision the human resolved still ends a kept run + --- + duration_ms: 46.768768 + type: 'test' + ... +# Subtest: row 194 T10 (B7): the chief's organization.set of a kept instance's model refuses before the writer; the human's limits.set does not +ok 60 - row 194 T10 (B7): the chief's organization.set of a kept instance's model refuses before the writer; the human's limits.set does not + --- + duration_ms: 45.491886 + type: 'test' + ... +# Subtest: row 194 T13: organization.set and limits.set refuse the launch, retired, keep and noHire keys before the writer +ok 61 - row 194 T13: organization.set and limits.set refuse the launch, retired, keep and noHire keys before the writer + --- + duration_ms: 58.002792 + type: 'test' + ... +# Subtest: row 194 T18 (D2.4): from a chief session veto.set and instances.set refuse, and nothing reaches the writer +ok 62 - row 194 T18 (D2.4): from a chief session veto.set and instances.set refuse, and nothing reaches the writer + --- + duration_ms: 55.410963 + type: 'test' + ... +# Subtest: row 194 T8: the chief hires with a reason and no decision, the writer gets the reason as context, and the log names it +ok 63 - row 194 T8: the chief hires with a reason and no decision, the writer gets the reason as context, and the log names it + --- + duration_ms: 43.804149 + type: 'test' + ... +# Subtest: row 194 T11: on a bus with two businesses, the chief of one hires and fires only in its own +ok 64 - row 194 T11: on a bus with two businesses, the chief of one hires and fires only in its own + --- + duration_ms: 40.632205 + type: 'test' + ... +# Subtest: row 194 T8: hire and fire need a reason of 1 to 500 characters and refuse a decision key +ok 65 - row 194 T8: hire and fire need a reason of 1 to 500 characters and refuse a decision key + --- + duration_ms: 65.71762 + type: 'test' + ... +# Subtest: row 194 T8 (sage-1471): only the chief hires or fires; every other role refuses role-not-chief, even one granted the actions +ok 66 - row 194 T8 (sage-1471): only the chief hires or fires; every other role refuses role-not-chief, even one granted the actions + --- + duration_ms: 59.577894 + type: 'test' + ... +# Subtest: row 194 T8 (sage-1471): a chief whose authority lacks role.hire or role.fire refuses decision-required before the writer +ok 67 - row 194 T8 (sage-1471): a chief whose authority lacks role.hire or role.fire refuses decision-required before the writer + --- + duration_ms: 100.213131 + type: 'test' + ... +# Subtest: row 194 T8a: a re-hire of a fired name goes to the writer like a hire, and the writer's refusals pass through by name +ok 68 - row 194 T8a: a re-hire of a fired name goes to the writer like a hire, and the writer's refusals pass through by name + --- + duration_ms: 48.182916 + type: 'test' + ... +# Subtest: row 194 T8b: a definition is hireable only when every action is on HIRE_ALLOWED, it is version 2, the chief lists it and noHire doesn't +ok 69 - row 194 T8b: a definition is hireable only when every action is on HIRE_ALLOWED, it is version 2, the chief lists it and noHire doesn't + --- + duration_ms: 1528.419916 + type: 'test' + ... +# Subtest: row 194 T8b: a hire without the role files configured refuses not-configured +ok 70 - row 194 T8b: a hire without the role files configured refuses not-configured + --- + duration_ms: 40.483552 + type: 'test' + ... +# Subtest: row 194 T9: a fire revokes the claim, cancels open requests, asks the launcher to kill the runs, then delists and logs +ok 71 - row 194 T9: a fire revokes the claim, cancels open requests, asks the launcher to kill the runs, then delists and logs + --- + duration_ms: 46.408753 + type: 'test' + ... +# Subtest: row 194 T9a (bus): a fire end's done writes lifecycle.end.killed and lifecycle.end.alive with run and pid, and an unknown stop's reason; a terminate's done or a bad stop refuses +ok 72 - row 194 T9a (bus): a fire end's done writes lifecycle.end.killed and lifecycle.end.alive with run and pid, and an unknown stop's reason; a terminate's done or a bad stop refuses + --- + duration_ms: 54.293174 + type: 'test' + ... +# Subtest: row 194 T9: fire refusals come before step A and leave the claim, the requests and the file alone +ok 73 - row 194 T9: fire refusals come before step A and leave the claim, the requests and the file alone + --- + duration_ms: 46.226492 + type: 'test' + ... +# Subtest: row 194 T9c: a writer failure at B leaves the instance firing, and the repeat delists and logs once +ok 74 - row 194 T9c: a writer failure at B leaves the instance firing, and the repeat delists and logs once + --- + duration_ms: 54.491227 + type: 'test' + ... +# Subtest: row 194 T9c: a failure at C leaves the fire unlogged and the instance firing, and the repeat logs it +ok 75 - row 194 T9c: a failure at C leaves the fire unlogged and the instance firing, and the repeat logs it + --- + duration_ms: 50.442486 + type: 'test' + ... +# Subtest: row 194 W-N1: a fire.done before a later fire.stopped of the same instance leaves it firing; another instance's done does not end it +ok 76 - row 194 W-N1: a fire.done before a later fire.stopped of the same instance leaves it firing; another instance's done does not end it + --- + duration_ms: 45.597492 + type: 'test' + ... +# Subtest: row 194 T10: a hire or fire of a kept name refuses instance-kept before the writer +ok 77 - row 194 T10: a hire or fire of a kept name refuses instance-kept before the writer + --- + duration_ms: 42.757086 + type: 'test' + ... +# Subtest: row 194 T10: a fire the writer's check refuses from the file stops nothing and leaves the instance launchable +ok 78 - row 194 T10: a fire the writer's check refuses from the file stops nothing and leaves the instance launchable + --- + duration_ms: 50.558654 + type: 'test' + ... +# Subtest: row 194 T18: hire and fire take only their own keys, and a refused call writes nothing +ok 79 - row 194 T18: hire and fire take only their own keys, and a refused call writes nothing + --- + duration_ms: 52.522279 + type: 'test' + ... +# Subtest: row 194 T8, T9, T18: through the runtime the chief hires and fires with the real writer, the receipt carries the reason, and a refusal leaves the file alone +ok 80 - row 194 T8, T9, T18: through the runtime the chief hires and fires with the real writer, the receipt carries the reason, and a refusal leaves the file alone + --- + duration_ms: 125.328859 + type: 'test' + ... +# Subtest: row 194 W-N1: the launcher's take of a launch or regenerate of a firing instance closes it as instance-firing +ok 81 - row 194 W-N1: the launcher's take of a launch or regenerate of a firing instance closes it as instance-firing + --- + duration_ms: 50.167105 + type: 'test' + ... +# Subtest: comment cursors isolate businesses, move only forward and remain append-only +ok 82 - comment cursors isolate businesses, move only forward and remain append-only + --- + duration_ms: 32.428593 + type: 'test' + ... +# Subtest: only trusted sync writes validated cursors; events and cursor share rollback +ok 83 - only trusted sync writes validated cursors; events and cursor share rollback + --- + duration_ms: 25.593861 + type: 'test' + ... +# Subtest: explicit 3b copy migration preserves evidence and opens as 3g; normal startup never migrates +ok 84 - explicit 3b copy migration preserves evidence and opens as 3g; normal startup never migrates + --- + duration_ms: 139.454972 + type: 'test' + ... +# Subtest: migration refuses active writers and drifted legacy schemas, with no partial upgrade +ok 85 - migration refuses active writers and drifted legacy schemas, with no partial upgrade + --- + duration_ms: 196.939558 + type: 'test' + ... +# Subtest: named migration registry chains 3b through 3g to a fixture-only future version in order +ok 86 - named migration registry chains 3b through 3g to a fixture-only future version in order + --- + duration_ms: 181.913079 + type: 'test' + ... +# Subtest: migration refuses mismatched source metadata without changing schema or evidence +ok 87 - migration refuses mismatched source metadata without changing schema or evidence + --- + duration_ms: 75.670439 + type: 'test' + ... +# Subtest: offline command migrates only the supplied fixture root and reports usage errors +ok 88 - offline command migrates only the supplied fixture root and reports usage errors + --- + duration_ms: 303.348052 + type: 'test' + ... +# organization: {"event":"reload-needs-restart","business":"demo"} +# organization: {"event":"reload-needs-restart","business":"demo"} +# Subtest: M6: a creative raise refuses decision-not-allowed, cited or not, and no decision row appears; the assistant still raises +ok 89 - M6: a creative raise refuses decision-not-allowed, cited or not, and no decision row appears; the assistant still raises + --- + duration_ms: 75.92826 + type: 'test' + ... +# Subtest: a creative instance sends only to the user and hears only from the user +ok 90 - a creative instance sends only to the user and hears only from the user + --- + duration_ms: 89.021214 + type: 'test' + ... +# Subtest: M10 through the broker: the chief and the tester are refused on bean, the human's limits.set of its models key works +ok 91 - M10 through the broker: the chief and the tester are refused on bean, the human's limits.set of its models key works + --- + duration_ms: 151.210641 + type: 'test' + ... +# Subtest: row 256 T6 the human deletes a creative instance through the broker; the chief and the tester are refused at the verb +ok 92 - row 256 T6 the human deletes a creative instance through the broker; the chief and the tester are refused at the verb + --- + duration_ms: 122.583772 + type: 'test' + ... +# Subtest: X4: register adds a store reference to the running bus, and issue then writes the key +ok 93 - X4: register adds a store reference to the running bus, and issue then writes the key + --- + duration_ms: 46.622415 + type: 'test' + ... +# Subtest: X4: register runs the constructor's reference checks +ok 94 - X4: register runs the constructor's reference checks + --- + duration_ms: 1.322973 + type: 'test' + ... +# Subtest: X4: register reads no file, so a key file left at the path stays unused, and a live token refuses +ok 95 - X4: register reads no file, so a key file left at the path stays unused, and a live token refuses + --- + duration_ms: 16.884101 + type: 'test' + ... +# Subtest: X3, X4: unregister drops an entry with no token and refuses one with a live token +ok 96 - X3, X4: unregister drops an entry with no token and refuses one with a live token + --- + duration_ms: 14.770905 + type: 'test' + ... +# Subtest: X5: a claim holds the slot, so a second claim and a host.run refuse host-busy until release +ok 97 - X5: a claim holds the slot, so a second claim and a host.run refuse host-busy until release + --- + duration_ms: 9.970572 + type: 'test' + ... +# Subtest: X5: a claim made while a host.run is in flight refuses host-busy +ok 98 - X5: a claim made while a host.run is in flight refuses host-busy + --- + duration_ms: 8.864169 + type: 'test' + ... +# Subtest: X5: a stale release leaves a later claim in place +ok 99 - X5: a stale release leaves a later claim in place + --- + duration_ms: 0.598444 + type: 'test' + ... +# Subtest: X5: abortClaim aborts a live claim and says pending, and revoke's abort reaches a claim too +ok 100 - X5: abortClaim aborts a live claim and says pending, and revoke's abort reaches a claim too + --- + duration_ms: 10.14603 + type: 'test' + ... +# Subtest: credentials gives human and reader sessions service, account, role, date and state, and nothing else +ok 101 - credentials gives human and reader sessions service, account, role, date and state, and nothing else + --- + duration_ms: 31.93948 + type: 'test' + ... +# Subtest: credentials refuses a role session and any argument +ok 102 - credentials refuses a role session and any argument + --- + duration_ms: 34.150179 + type: 'test' + ... +# Subtest: credentials reads the status on each request, and a broker without one lists none +ok 103 - credentials reads the status on each request, and a broker without one lists none + --- + duration_ms: 50.496362 + type: 'test' + ... +# Subtest: the broker process answers credentials without a token, path or variable in its output, log or store +ok 104 - the broker process answers credentials without a token, path or variable in its output, log or store + --- + duration_ms: 250.168854 + type: 'test' + ... +# Subtest: T1: a store reference with no file yet starts, and the agent is not-issued until issue +ok 105 - T1: a store reference with no file yet starts, and the agent is not-issued until issue + --- + duration_ms: 9.352125 + type: 'test' + ... +# Subtest: T1: a store path the reference does not own, or no store root, refuses the reference +ok 106 - T1: a store path the reference does not own, or no store root, refuses the reference + --- + duration_ms: 0.815639 + type: 'test' + ... +# Subtest: T1: a wrong mode on the store root, a business dir, an agent dir or the file refuses start +ok 107 - T1: a wrong mode on the store root, a business dir, an agent dir or the file refuses start + --- + duration_ms: 3.0483 + type: 'test' + ... +# Subtest: T1: a missing store root refuses start; a missing {file} reference still refuses start +ok 108 - T1: a missing store root refuses start; a missing {file} reference still refuses start + --- + duration_ms: 0.809547 + type: 'test' + ... +# Subtest: T1: a store file that is a directory or a symlink refuses start +ok 109 - T1: a store file that is a directory or a symlink refuses start + --- + duration_ms: 1.239307 + type: 'test' + ... +# Subtest: T2: useFor keys from the session only +ok 110 - T2: useFor keys from the session only + --- + duration_ms: 2.615823 + type: 'test' + ... +# Subtest: T5: issue, rotate, revoke and delete are live with no restart, and revoke holds across one +ok 111 - T5: issue, rotate, revoke and delete are live with no restart, and revoke holds across one + --- + duration_ms: 7.945255 + type: 'test' + ... +# Subtest: T5: a failed commit leaves the token on disk but not in memory, and a bad token or date writes nothing +ok 112 - T5: a failed commit leaves the token on disk but not in memory, and a bad token or date writes nothing + --- + duration_ms: 3.097495 + type: 'test' + ... +# Subtest: T5: revoke drops the token from memory before the unlink, so a failed unlink still leaves it revoked +ok 113 - T5: revoke drops the token from memory before the unlink, so a failed unlink still leaves it revoked + --- + duration_ms: 2.842915 + type: 'test' + ... +# Subtest: T5: revoke of a {file} reference forgets the token and never unlinks the file +ok 114 - T5: revoke of a {file} reference forgets the token and never unlinks the file + --- + duration_ms: 1.122183 + type: 'test' + ... +# Subtest: T5: delete refuses an agent dir holding anything but tokens +ok 115 - T5: delete refuses an agent dir holding anything but tokens + --- + duration_ms: 2.955104 + type: 'test' + ... +# Subtest: D5: every credentials use( call site is on the allowlist +ok 116 - D5: every credentials use( call site is on the allowlist + --- + duration_ms: 39.932478 + type: 'test' + ... +# Subtest: row 199: the lifecycle verbs refuse every session but the human, and the tester revokes only +ok 117 - row 199: the lifecycle verbs refuse every session but the human, and the tester revokes only + --- + duration_ms: 68.639071 + type: 'test' + ... +# Subtest: T5: issue, rotate, revoke and delete are live, rewrite the business file and leave one receipt each, with no value anywhere +ok 118 - T5: issue, rotate, revoke and delete are live, rewrite the business file and leave one receipt each, with no value anywhere + --- + duration_ms: 182.219569 + type: 'test' + ... +# Subtest: only validated broker references load; returned data and exceptions cannot expose a known token +ok 119 - only validated broker references load; returned data and exceptions cannot expose a known token + --- + duration_ms: 4.041582 + type: 'test' + ... +# Subtest: bad file modes, symlinks, repository/data paths, malformed tokens and missing dates refuse +ok 120 - bad file modes, symlinks, repository/data paths, malformed tokens and missing dates refuse + --- + duration_ms: 2.336218 + type: 'test' + ... +# Subtest: expiry refuses use and env references never become client data +ok 121 - expiry refuses use and env references never become client data + --- + duration_ms: 0.706998 + type: 'test' + ... +# Subtest: S1 parsed service refs work, service mismatch refuses, Gitea rotation due is a warning state +ok 122 - S1 parsed service refs work, service mismatch refuses, Gitea rotation due is a warning state + --- + duration_ms: 1.850826 + type: 'test' + ... +# Subtest: opaque tokens shorter than 16 characters refuse before use +ok 123 - opaque tokens shorter than 16 characters refuse before use + --- + duration_ms: 0.378282 + type: 'test' + ... +# Subtest: each C-suite role file carries the same two lists: human, chief-of-staff, pm, cto +ok 124 - each C-suite role file carries the same two lists: human, chief-of-staff, pm, cto + --- + duration_ms: 2.014736 + type: 'test' + ... +# Subtest: chief-executive-officer: messages to and from the user, chief of staff, pm and cto pass +ok 125 - chief-executive-officer: messages to and from the user, chief of staff, pm and cto pass + --- + duration_ms: 98.391215 + type: 'test' + ... +# Subtest: chief-executive-officer: a message to or from the coder, reviewer or assistant is refused and logged, and nothing is stored +ok 126 - chief-executive-officer: a message to or from the coder, reviewer or assistant is refused and logged, and nothing is stored + --- + duration_ms: 80.357221 + type: 'test' + ... +# Subtest: chief-executive-officer: another C-suite role isn't on the lists either +ok 127 - chief-executive-officer: another C-suite role isn't on the lists either + --- + duration_ms: 77.689524 + type: 'test' + ... +# Subtest: chief-financial-officer: messages to and from the user, chief of staff, pm and cto pass +ok 128 - chief-financial-officer: messages to and from the user, chief of staff, pm and cto pass + --- + duration_ms: 88.074588 + type: 'test' + ... +# Subtest: chief-financial-officer: a message to or from the coder, reviewer or assistant is refused and logged, and nothing is stored +ok 129 - chief-financial-officer: a message to or from the coder, reviewer or assistant is refused and logged, and nothing is stored + --- + duration_ms: 86.437451 + type: 'test' + ... +# Subtest: chief-financial-officer: another C-suite role isn't on the lists either +ok 130 - chief-financial-officer: another C-suite role isn't on the lists either + --- + duration_ms: 70.52947 + type: 'test' + ... +# Subtest: chief-information-officer: messages to and from the user, chief of staff, pm and cto pass +ok 131 - chief-information-officer: messages to and from the user, chief of staff, pm and cto pass + --- + duration_ms: 91.776876 + type: 'test' + ... +# Subtest: chief-information-officer: a message to or from the coder, reviewer or assistant is refused and logged, and nothing is stored +ok 132 - chief-information-officer: a message to or from the coder, reviewer or assistant is refused and logged, and nothing is stored + --- + duration_ms: 80.630169 + type: 'test' + ... +# Subtest: chief-information-officer: another C-suite role isn't on the lists either +ok 133 - chief-information-officer: another C-suite role isn't on the lists either + --- + duration_ms: 67.814216 + type: 'test' + ... +# Subtest: chief-information-security-officer: messages to and from the user, chief of staff, pm and cto pass +ok 134 - chief-information-security-officer: messages to and from the user, chief of staff, pm and cto pass + --- + duration_ms: 89.022256 + type: 'test' + ... +# Subtest: chief-information-security-officer: a message to or from the coder, reviewer or assistant is refused and logged, and nothing is stored +ok 135 - chief-information-security-officer: a message to or from the coder, reviewer or assistant is refused and logged, and nothing is stored + --- + duration_ms: 83.487832 + type: 'test' + ... +# Subtest: chief-information-security-officer: another C-suite role isn't on the lists either +ok 136 - chief-information-security-officer: another C-suite role isn't on the lists either + --- + duration_ms: 68.442026 + type: 'test' + ... +# Subtest: chief-marketing-officer: messages to and from the user, chief of staff, pm and cto pass +ok 137 - chief-marketing-officer: messages to and from the user, chief of staff, pm and cto pass + --- + duration_ms: 86.40901 + type: 'test' + ... +# Subtest: chief-marketing-officer: a message to or from the coder, reviewer or assistant is refused and logged, and nothing is stored +ok 138 - chief-marketing-officer: a message to or from the coder, reviewer or assistant is refused and logged, and nothing is stored + --- + duration_ms: 98.341574 + type: 'test' + ... +# Subtest: chief-marketing-officer: another C-suite role isn't on the lists either +ok 139 - chief-marketing-officer: another C-suite role isn't on the lists either + --- + duration_ms: 76.890534 + type: 'test' + ... +# limits: {"event":"limit-reached","business":"demo","check":"daily-quota","export":"mayLaunch","subject":{"instance":"coder","provider":"anthropic","model":"opus","account":"jason-max"},"path":["tokens","daily","jason-max"],"limit":0,"count":0,"unknownTurns":0} +# usage: {"event":"usage-unknown","business":"demo","run":"run1","instance":"coder","turn":"2bbbb5e5-0806-424c-a2ac-088341dcc6d3","source":"@none","code":"baseline-unknown"} +# limits: {"event":"limit-reached","business":"demo","check":"daily-quota","export":"mustStop","subject":{"instance":"coder","provider":"anthropic","model":"opus","account":"jason-max"},"path":["tokens","daily","jason-max"],"limit":0,"count":0,"unknownTurns":1} +# usage: {"event":"usage-unknown","business":"demo","run":"run1","instance":"coder","turn":"56d8cacf-e9cb-4a82-a3fb-63dfae771f87","source":"@none","code":"baseline-unknown"} +# Subtest: REQ-LIMIT-2 runtime: limits counts the daily quota, and mayLaunch refuses only the account at it +ok 140 - REQ-LIMIT-2 runtime: limits counts the daily quota, and mayLaunch refuses only the account at it + --- + duration_ms: 205.522866 + type: 'test' + ... +# Subtest: REQ-LIMIT-4 runtime: a run bound with the account writes it on its usage records and stops at the quota +ok 141 - REQ-LIMIT-4 runtime: a run bound with the account writes it on its usage records and stops at the quota + --- + duration_ms: 95.088613 + type: 'test' + ... +# Subtest: REQ-LIMIT-4 runtime: a run bound without an account records null and the daily quota never stops it +ok 142 - REQ-LIMIT-4 runtime: a run bound without an account records null and the daily quota never stops it + --- + duration_ms: 92.644647 + type: 'test' + ... +# Subtest: REQ-LIMIT-4 bindLaunch keeps the account off session.launched, refuses one that is not an identifier, and takes null as none +ok 143 - REQ-LIMIT-4 bindLaunch keeps the account off session.launched, refuses one that is not an identifier, and takes null as none + --- + duration_ms: 27.42557 + type: 'test' + ... +# Subtest: a human resolve sends the raising role one message from the human, and its request is the answer +ok 144 - a human resolve sends the raising role one message from the human, and its request is the answer + --- + duration_ms: 70.918915 + type: 'test' + ... +# Subtest: a cross-role decision resolved by its arbiter comes from that role and run, with no request +ok 145 - a cross-role decision resolved by its arbiter comes from that role and run, with no request + --- + duration_ms: 42.664148 + type: 'test' + ... +# Subtest: a human withdraw sends one message with the note +ok 146 - a human withdraw sends one message with the note + --- + duration_ms: 53.717127 + type: 'test' + ... +# Subtest: a human seen before the close leaves the request on the close's answer, not the seen +ok 147 - a human seen before the close leaves the request on the close's answer, not the seen + --- + duration_ms: 55.061406 + type: 'test' + ... +# Subtest: the raising run's withdraw, a supersede, a within-role raise and seen send nothing +ok 148 - the raising run's withdraw, a supersede, a within-role raise and seen send nothing + --- + duration_ms: 57.838351 + type: 'test' + ... +# Subtest: refused closes send nothing: invalid-choice, decision-closed, not-resolver +ok 149 - refused closes send nothing: invalid-choice, decision-closed, not-resolver + --- + duration_ms: 64.925409 + type: 'test' + ... +# Subtest: a raising role nobody holds at the close gets the message on the next claim +ok 150 - a raising role nobody holds at the close gets the message on the next claim + --- + duration_ms: 52.030062 + type: 'test' + ... +# Subtest: a human DECISION send keeps its own instruction as the request, not a close's answer +ok 151 - a human DECISION send keeps its own instruction as the request, not a close's answer + --- + duration_ms: 46.249753 + type: 'test' + ... +# Subtest: a cross-role raise whose arbiter the raiser does not hear from is refused and stores nothing +ok 152 - a cross-role raise whose arbiter the raiser does not hear from is refused and stores nothing + --- + duration_ms: 61.327917 + type: 'test' + ... +# Subtest: a gated raise by a role that does not hear from the human is refused and stores nothing +ok 153 - a gated raise by a role that does not hear from the human is refused and stores nothing + --- + duration_ms: 63.067407 + type: 'test' + ... +# Subtest: a route the raiser hears from is allowed, checked from the route to the raiser +ok 154 - a route the raiser hears from is allowed, checked from the route to the raiser + --- + duration_ms: 70.976909 + type: 'test' + ... +# Subtest: a refused supersede withdraws nothing +ok 155 - a refused supersede withdraws nothing + --- + duration_ms: 58.655971 + type: 'test' + ... +# Subtest: the assistant's within-role and gated raises still work +ok 156 - the assistant's within-role and gated raises still work + --- + duration_ms: 59.90278 + type: 'test' + ... +# Subtest: roles lists open decisions routed to a role, and never the human inbox +ok 157 - roles lists open decisions routed to a role, and never the human inbox + --- + duration_ms: 55.611942 + type: 'test' + ... +# Subtest: recent lists closed decisions of every route, newest close first, with how each closed +ok 158 - recent lists closed decisions of every route, newest close first, with how each closed + --- + duration_ms: 67.374877 + type: 'test' + ... +# Subtest: recent gives the closing event as closed when the decision was seen first +ok 159 - recent gives the closing event as closed when the decision was seen first + --- + duration_ms: 60.933891 + type: 'test' + ... +# Subtest: recent stops at RECENT rows +ok 160 - recent stops at RECENT rows + --- + duration_ms: 175.140662 + type: 'test' + ... +# Subtest: every row is what trail already gives the same session for that id +ok 161 - every row is what trail already gives the same session for that id + --- + duration_ms: 71.668866 + type: 'test' + ... +# Subtest: a role session can't list decisions, so it can't read another role's open decisions +ok 162 - a role session can't list decisions, so it can't read another role's open decisions + --- + duration_ms: 82.44822 + type: 'test' + ... +# Subtest: decisions is a read: one business, strict arguments, nothing written +ok 163 - decisions is a read: one business, strict arguments, nothing written + --- + duration_ms: 76.706242 + type: 'test' + ... +# Subtest: endLaunch writes session.ended, releases the run claim and kills its capabilities +ok 164 - endLaunch writes session.ended, releases the run claim and kills its capabilities + --- + duration_ms: 40.701498 + type: 'test' + ... +# Subtest: endLaunch refuses an unknown run, a second end and a rebind of the ended run +ok 165 - endLaunch refuses an unknown run, a second end and a rebind of the ended run + --- + duration_ms: 30.649139 + type: 'test' + ... +# Subtest: a restarted broker refuses to rebind an ended run; a refused rebind leaves the run unbound +ok 166 - a restarted broker refuses to rebind an ended run; a refused rebind leaves the run unbound + --- + duration_ms: 36.453673 + type: 'test' + ... +# Subtest: endLaunch leaves a claim another run took alone +ok 167 - endLaunch leaves a claim another run took alone + --- + duration_ms: 35.43383 + type: 'test' + ... +# Subtest: refuse records action.refused against the caller with the code only +ok 168 - refuse records action.refused against the caller with the code only + --- + duration_ms: 27.442572 + type: 'test' + ... +# Subtest: launches off refuses role.launch with launch-revoked until launches on +ok 169 - launches off refuses role.launch with launch-revoked until launches on + --- + duration_ms: 36.545542 + type: 'test' + ... +# Subtest: broker process: launch ops authorize role.launch, record refusals and end runs +ok 170 - broker process: launch ops authorize role.launch, record refusals and end runs + --- + duration_ms: 275.931389 + type: 'test' + ... +# Subtest: row 281 T2: a fire with host grants on two hosts and a Gitea grant answers with a job, then revokes all three +ok 171 - row 281 T2: a fire with host grants on two hosts and a Gitea grant answers with a job, then revokes all three + --- + duration_ms: 456.010954 + type: 'test' + ... +# Subtest: row 281 T3 (sage-2575): a delete with grants takes two requests: the first starts the job, the next completes +ok 172 - row 281 T3 (sage-2575): a delete with grants takes two requests: the first starts the job, the next completes + --- + duration_ms: 434.281489 + type: 'test' + ... +# Subtest: row 281 T3b (Q2): a delete whose job refuses on host B; the retry refuses grant-revoke-failed and revokes only B and Gitea +ok 173 - row 281 T3b (Q2): a delete whose job refuses on host B; the retry refuses grant-revoke-failed and revokes only B and Gitea + --- + duration_ms: 398.553309 + type: 'test' + ... +# Subtest: row 281 T3b: B cleared by hand with hosts.revoke; the next delete starts a job for Gitea and the leftover line only +ok 174 - row 281 T3b: B cleared by hand with hosts.revoke; the next delete starts a job for Gitea and the leftover line only + --- + duration_ms: 417.595857 + type: 'test' + ... +# Subtest: row 281 T3c (sage-2575 condition 4): a delete of an instance with no grant completes in one request +ok 175 - row 281 T3c (sage-2575 condition 4): a delete of an instance with no grant completes in one request + --- + duration_ms: 109.573804 + type: 'test' + ... +# Subtest: row 281 T4: host B unreachable in a fire: the job refuses, A stays revoked, B and Gitea untouched; a repeat completes +ok 176 - row 281 T4: host B unreachable in a fire: the job refuses, A stays revoked, B and Gitea untouched; a repeat completes + --- + duration_ms: 414.91296 + type: 'test' + ... +# Subtest: row 281 T4b (Q1): a line a manual hosts.revoke left on C is removed by the fire, with its close +ok 177 - row 281 T4b (Q1): a line a manual hosts.revoke left on C is removed by the fire, with its close + --- + duration_ms: 167.856484 + type: 'test' + ... +# Subtest: row 281 T4b (Q1): with C unreachable, the fire completes and names the line in grantsLeft +ok 178 - row 281 T4b (Q1): with C unreachable, the fire completes and names the line in grantsLeft + --- + duration_ms: 159.388146 + type: 'test' + ... +# Subtest: row 281 T5: Gitea's admin token can't be checked: the job refuses with the Gitea grant intact +ok 179 - row 281 T5: Gitea's admin token can't be checked: the job refuses with the Gitea grant intact + --- + duration_ms: 232.057435 + type: 'test' + ... +# Subtest: row 281 T5b (N1): a failed token DELETE refuses gitea-left; the repeat retries only this agent's entries +ok 180 - row 281 T5b (N1): a failed token DELETE refuses gitea-left; the repeat retries only this agent's entries + --- + duration_ms: 571.519535 + type: 'test' + ... +# Subtest: row 281 T6 (sage-2574): a host decision approved before the fire and run after it ends revoked, with nothing applied +ok 181 - row 281 T6 (sage-2574): a host decision approved before the fire and run after it ends revoked, with nothing applied + --- + duration_ms: 112.289668 + type: 'test' + ... +# Subtest: row 281 T6b (sage-2574): a Gitea decision approved before the fire and run after it ends revoked before any Gitea write +ok 182 - row 281 T6b (sage-2574): a Gitea decision approved before the fire and run after it ends revoked before any Gitea write + --- + duration_ms: 144.714855 + type: 'test' + ... +# Subtest: row 281 T6c: a host executor in flight aborts and ends revoked; a Gitea executor in flight is awaited and leaves no token +ok 183 - row 281 T6c: a host executor in flight aborts and ends revoked; a Gitea executor in flight is awaited and leaves no token + --- + duration_ms: 410.421013 + type: 'test' + ... +# Subtest: row 281 T6d (B1): undecided host and Gitea decisions are in the set, and approved after the fire both end revoked +ok 184 - row 281 T6d (B1): undecided host and Gitea decisions are in the set, and approved after the fire both end revoked + --- + duration_ms: 186.53836 + type: 'test' + ... +# Subtest: row 281 T6e (B1): a grant raise refuses instance-fired while firing and after the fire, goes through after a rehire, and refuses grant-revoke-running during a delete job +ok 185 - row 281 T6e (B1): a grant raise refuses instance-fired while firing and after the fire, goes through after a rehire, and refuses grant-revoke-running during a delete job + --- + duration_ms: 203.105774 + type: 'test' + ... +# Subtest: row 281 T7: an instance with no grant fires as today, synchronously, with the same events +ok 186 - row 281 T7: an instance with no grant fires as today, synchronously, with the same events + --- + duration_ms: 110.303951 + type: 'test' + ... +# Subtest: row 281 T9 (B3): one step G per agent; the manual verbs refuse while it runs, and sweep names it running +ok 187 - row 281 T9 (B3): one step G per agent; the manual verbs refuse while it runs, and sweep names it running + --- + duration_ms: 453.266667 + type: 'test' + ... +# Subtest: row 281 T10 (B2): the fire and the delete answer while their jobs are held, and the broker answers other verbs +ok 188 - row 281 T10 (B2): the fire and the delete answer while their jobs are held, and the broker answers other verbs + --- + duration_ms: 385.556142 + type: 'test' + ... +# Subtest: row 281 T11 (C1): a fire's job completes after the chief's run ends and processing halts +ok 189 - row 281 T11 (C1): a fire's job completes after the chief's run ends and processing halts + --- + duration_ms: 147.551191 + type: 'test' + ... +# Subtest: row 281 T12 (C1, N7): a step B refusal in the job is fire.failed, and the repeat runs B and C synchronously +ok 190 - row 281 T12 (C1, N7): a step B refusal in the job is fire.failed, and the repeat runs B and C synchronously + --- + duration_ms: 158.792679 + type: 'test' + ... +# Subtest: row 281 T13 (N4): a restart records each held job interrupted once, with one message each; an ended job gets none +ok 191 - row 281 T13 (N4): a restart records each held job interrupted once, with one message each; an ended job gets none + --- + duration_ms: 233.955312 + type: 'test' + ... +# Subtest: row 281 T14 (N1, sage-2653): a host removed under an undecided decision stops the fire on host-unknown; the human's no closes it, and the repeat fire has no job +ok 192 - row 281 T14 (N1, sage-2653): a host removed under an undecided decision stops the fire on host-unknown; the human's no closes it, and the repeat fire has no job + --- + duration_ms: 131.566269 + type: 'test' + ... +# Subtest: X-G3: on scratch 1.27.1, a grant makes the user, mints, forks, checks reach, writes the file, and revoke deletes the token +ok 193 - X-G3: on scratch 1.27.1, a grant makes the user, mints, forks, checks reach, writes the file, and revoke deletes the token # SKIP no Docker or no local gitea/gitea:1.27.1; this test never pulls + --- + duration_ms: 1.025101 + type: 'test' + ... +# Subtest: versionAtLeast compares numbers and refuses a prerelease of 1.27.0 +ok 194 - versionAtLeast compares numbers and refuses a prerelease of 1.27.0 + --- + duration_ms: 1.655582 + type: 'test' + ... +# Subtest: X-G1: a raise that fails a check refuses and stores nothing +ok 195 - X-G1: a raise that fails a check refuses and stores nothing + --- + duration_ms: 119.847796 + type: 'test' + ... +# Subtest: X-G1: a creative role, a role without identity and a missing or due slot refuse at raise +ok 196 - X-G1: a creative role, a role without identity and a missing or due slot refuse at raise + --- + duration_ms: 357.709881 + type: 'test' + ... +# Subtest: X-G2: admin set refuses each failed check and writes nothing, then writes the slot once +ok 197 - X-G2: admin set refuses each failed check and writes nothing, then writes the slot once + --- + duration_ms: 309.098599 + type: 'test' + ... +# Subtest: X-G3 to X-G8: an approve makes the user, mints the token, forks, checks reach and writes the file, record and grant.applied +ok 198 - X-G3 to X-G8: an approve makes the user, mints the token, forks, checks reach and writes the file, record and grant.applied + --- + duration_ms: 189.686848 + type: 'test' + ... +# Subtest: X-G4: a user this stack did not make, an admin, a disabled user and a remade user each refuse +ok 199 - X-G4: a user this stack did not make, an admin, a disabled user and a remade user each refuse + --- + duration_ms: 551.820482 + type: 'test' + ... +# Subtest: X-G6 and X-G8: the user and mint steps are written before their calls, and each result after its call +ok 200 - X-G6 and X-G8: the user and mint steps are written before their calls, and each result after its call + --- + duration_ms: 187.325174 + type: 'test' + ... +# Subtest: X-G4: a fork by the seat user of another repository than the project refuses fork-foreign +ok 201 - X-G4: a fork by the seat user of another repository than the project refuses fork-foreign + --- + duration_ms: 182.859629 + type: 'test' + ... +# Subtest: X-G5: a failure after the mint deletes the token, unloads nothing it did not load and leaves no file +ok 202 - X-G5: a failure after the mint deletes the token, unloads nothing it did not load and leaves no file + --- + duration_ms: 302.935108 + type: 'test' + ... +# Subtest: X-G5: a token delete that fails is left at Gitea, shown by status and taken by sweep +ok 203 - X-G5: a token delete that fails is left at Gitea, shown by status and taken by sweep + --- + duration_ms: 207.401832 + type: 'test' + ... +# Subtest: X-G5: a mint that fails deletes by name, and a refusal at step 0 leaves the decision unspent +ok 204 - X-G5: a mint that fails deletes by name, and a refusal at step 0 leaves the decision unspent + --- + duration_ms: 349.649875 + type: 'test' + ... +# Subtest: X-G5: an agent held for an unknown token is refused at step 0 with no Gitea call +ok 205 - X-G5: an agent held for an unknown token is refused at step 0 with no Gitea call + --- + duration_ms: 116.490611 + type: 'test' + ... +# Subtest: X-G5 and X-G9 (step 7): a rotation whose old-token delete fails stays applied with the old id left +ok 206 - X-G5 and X-G9 (step 7): a rotation whose old-token delete fails stays applied with the old id left + --- + duration_ms: 311.487512 + type: 'test' + ... +# Subtest: X-G10: in a rotation the store file holds the new token before the old one is deleted +ok 207 - X-G10: in a rotation the store file holds the new token before the old one is deleted + --- + duration_ms: 274.143984 + type: 'test' + ... +# Subtest: X-G6: a rotation cut before the rename settles back at once, and the old token stays live +ok 208 - X-G6: a rotation cut before the rename settles back at once, and the old token stays live + --- + duration_ms: 304.264113 + type: 'test' + ... +# Subtest: X-G6: a rotation whose step 8 write fails is settle-pending, and a restart settles it forward +ok 209 - X-G6: a rotation whose step 8 write fails is settle-pending, and a restart settles it forward + --- + duration_ms: 354.565696 + type: 'test' + ... +# Subtest: X-G6: a restart settles an open rotation back when the file still holds the old token +ok 210 - X-G6: a restart settles an open rotation back when the file still holds the old token + --- + duration_ms: 253.805182 + type: 'test' + ... +# Subtest: X-G6: a restart settles an open rotation forward when the file holds the new token +ok 211 - X-G6: a restart settles an open rotation forward when the file holds the new token + --- + duration_ms: 260.042025 + type: 'test' + ... +# Subtest: X-G6: a 401 on the file token loses the grant: both tokens go, the record goes and memory unloads +ok 212 - X-G6: a 401 on the file token loses the grant: both tokens go, the record goes and memory unloads + --- + duration_ms: 277.312152 + type: 'test' + ... +# Subtest: X-G6: a 403, 404, 500, a hang and a dropped socket each leave the rotation settle-pending with nothing deleted +ok 213 - X-G6: a 403, 404, 500, a hang and a dropped socket each leave the rotation settle-pending with nothing deleted + --- + duration_ms: 1554.990197 + type: 'test' + ... +# Subtest: X-G6: a file token no grant minted is held; the next restart says so again; a revoke clears it and takes both ids +ok 214 - X-G6: a file token no grant minted is held; the next restart says so again; a revoke clears it and takes both ids + --- + duration_ms: 218.040915 + type: 'test' + ... +# Subtest: N9: a revoke of an open rotation, then a restart: no settle, no Gitea call and no message +ok 215 - N9: a revoke of an open rotation, then a restart: no settle, no Gitea call and no message + --- + duration_ms: 154.339335 + type: 'test' + ... +# Subtest: N9: a 404 on a delete by id counts as done +ok 216 - N9: a 404 on a delete by id counts as done + --- + duration_ms: 139.192122 + type: 'test' + ... +# Subtest: X-G6: a restart undoes each step a killed child left, and spends an approved unspent decision +ok 217 - X-G6: a restart undoes each step a killed child left, and spends an approved unspent decision + --- + duration_ms: 461.002952 + type: 'test' + ... +# Subtest: X-G6: a restart with no admin slot leaves the user an orphan and the token left +ok 218 - X-G6: a restart with no admin slot leaves the user an orphan and the token left + --- + duration_ms: 57.886328 + type: 'test' + ... +# Subtest: X-G7: a change to the definition, identity, publish remotes or admin slot after the raise ends decision-mismatch +ok 219 - X-G7: a change to the definition, identity, publish remotes or admin slot after the raise ends decision-mismatch + --- + duration_ms: 118.62192 + type: 'test' + ... +# Subtest: X-G7 and X-G9: an admin rotate voids open decisions, and rotate --finish deletes what was left +ok 220 - X-G7 and X-G9: an admin rotate voids open decisions, and rotate --finish deletes what was left + --- + duration_ms: 109.757285 + type: 'test' + ... +# Subtest: X-G9: a rotate whose name is taken refuses and writes nothing; remove takes the slot away +ok 221 - X-G9: a rotate whose name is taken refuses and writes nothing; remove takes the slot away + --- + duration_ms: 64.888869 + type: 'test' + ... +# Subtest: X-G9: a slot past its rotate-by date refuses a run at step 0, leaving the decision unspent +ok 222 - X-G9: a slot past its rotate-by date refuses a run at step 0, leaving the decision unspent + --- + duration_ms: 50.639468 + type: 'test' + ... +# Subtest: X-G11: run refuses every caller but the human, an unapproved, a spent and a busy decision +ok 223 - X-G11: run refuses every caller but the human, an unapproved, a spent and a busy decision + --- + duration_ms: 104.18991 + type: 'test' + ... +# Subtest: kill switch (plan :16): while halted the chief still reads grants.status, and an agent grants.revoke refuses +ok 224 - kill switch (plan :16): while halted the chief still reads grants.status, and an agent grants.revoke refuses + --- + duration_ms: 111.352966 + type: 'test' + ... +# Subtest: X-G11: a revoke while the executor runs aborts it and the grant ends revoked +ok 225 - X-G11: a revoke while the executor runs aborts it and the grant ends revoked + --- + duration_ms: 109.918381 + type: 'test' + ... +# Subtest: X-G11: a revoke unloads memory and removes the file before its Gitea delete +ok 226 - X-G11: a revoke unloads memory and removes the file before its Gitea delete + --- + duration_ms: 112.562885 + type: 'test' + ... +# Subtest: X-G11: a revoke during a rotation step 7 ends it revoked, and step 8 writes no record back +ok 227 - X-G11: a revoke during a rotation step 7 ends it revoked, and step 8 writes no record back + --- + duration_ms: 158.474738 + type: 'test' + ... +# Subtest: X-G11: a revoke while a sweep settles a rotation, forward or back, ends it revoked with no record +ok 228 - X-G11: a revoke while a sweep settles a rotation, forward or back, ends it revoked with no record + --- + duration_ms: 329.887191 + type: 'test' + ... +# Subtest: X-G11: a revoke during a settle whoami that finds a foreign token ends it revoked, not held +ok 229 - X-G11: a revoke during a settle whoami that finds a foreign token ends it revoked, not held + --- + duration_ms: 173.487983 + type: 'test' + ... +# Subtest: X-G11: a revoke during a settle whoami that gets a 401 ends it revoked, not lost +ok 230 - X-G11: a revoke during a settle whoami that gets a 401 ends it revoked, not lost + --- + duration_ms: 182.82004 + type: 'test' + ... +# Subtest: X-G12: a token that reaches wider than its forks fails with the repository named +ok 231 - X-G12: a token that reaches wider than its forks fails with the repository named + --- + duration_ms: 376.694248 + type: 'test' + ... +# Subtest: X-G12: reach is paged by X-Total-Count and a count that does not add up refuses +ok 232 - X-G12: reach is paged by X-Total-Count and a count that does not add up refuses + --- + duration_ms: 265.037797 + type: 'test' + ... +# Subtest: X-G13: an agent cannot record a grant event, and the trigger refuses one from any writer but the grant writer +ok 233 - X-G13: an agent cannot record a grant event, and the trigger refuses one from any writer but the grant writer + --- + duration_ms: 42.669653 + type: 'test' + ... +# Subtest: X-G14: credentials delete fires the user: tokens go, login is prohibited, and grant.revoke.closed records it +ok 234 - X-G14: credentials delete fires the user: tokens go, login is prohibited, and grant.revoke.closed records it + --- + duration_ms: 255.760173 + type: 'test' + ... +# Subtest: X-G14: a fire whose token delete or login PATCH fails lands it in serviceLeft +ok 235 - X-G14: a fire whose token delete or login PATCH fails lands it in serviceLeft + --- + duration_ms: 148.229391 + type: 'test' + ... +# Subtest: X-G14: a fire whose user is gone or remade skips the fire steps and says why +ok 236 - X-G14: a fire whose user is gone or remade skips the fire steps and says why + --- + duration_ms: 293.896506 + type: 'test' + ... +# Subtest: X-G14: a sweep retries a fire only for the user it fired: a remade or gone user is skipped and named +ok 237 - X-G14: a sweep retries a fire only for the user it fired: a remade or gone user is skipped and named + --- + duration_ms: 309.146026 + type: 'test' + ... +# Subtest: X-G14: a revoke Gitea cannot reach stays open, and a restart closes it +ok 238 - X-G14: a revoke Gitea cannot reach stays open, and a restart closes it + --- + duration_ms: 134.089162 + type: 'test' + ... +# Subtest: row 281 T8: a tester grants.revoke refuses tester-dev-only once bus.tester is off; the human revoke keeps its records and starts no job +ok 239 - row 281 T8: a tester grants.revoke refuses tester-dev-only once bus.tester is off; the human revoke keeps its records and starts no job + --- + duration_ms: 130.455379 + type: 'test' + ... +# Subtest: X-G15: look-alike commit steps outside the grant writer are ignored at start, by revoke and by status +ok 240 - X-G15: look-alike commit steps outside the grant writer are ignored at start, by revoke and by status + --- + duration_ms: 135.842383 + type: 'test' + ... +# Subtest: X-G15: a look-alike spend under another kind with the grant writer pair is not an open grant +ok 241 - X-G15: a look-alike spend under another kind with the grant writer pair is not an open grant + --- + duration_ms: 43.323441 + type: 'test' + ... +# Subtest: status lists the slot, users, grants and nothing secret, and every grants verb needs service gitea +ok 242 - status lists the slot, users, grants and nothing secret, and every grants verb needs service gitea + --- + duration_ms: 112.851359 + type: 'test' + ... +# Subtest: 3j copy migrates to 3k: every row kept, and sqlite_master gains only the two tables and their keys +ok 243 - 3j copy migrates to 3k: every row kept, and sqlite_master gains only the two tables and their keys + --- + duration_ms: 176.193524 + type: 'test' + ... +# Subtest: a 3j→3k step that fails partway leaves the store at 3j with every row and the schema intact +ok 244 - a 3j→3k step that fails partway leaves the store at 3j with every row and the schema intact + --- + duration_ms: 201.139024 + type: 'test' + ... +# Subtest: the 3j engine refuses a migrated store, migrating or not, and leaves it as it was +ok 245 - the 3j engine refuses a migrated store, migrating or not, and leaves it as it was + --- + duration_ms: 174.819135 + type: 'test' + ... +# Subtest: gitea_users: one user per business and agent, an id above 0, a 16-hex nonce and a real decision +ok 246 - gitea_users: one user per business and agent, an id above 0, a 16-hex nonce and a real decision + --- + duration_ms: 25.145228 + type: 'test' + ... +# Subtest: gitea_grants: one grant per agent, a projects array, a token id above 0, and only for a recorded user +ok 247 - gitea_grants: one grant per agent, a projects array, a token id above 0, and only for a recorded user + --- + duration_ms: 38.426293 + type: 'test' + ... +# Subtest: G1, A1: only the chief raises a grant, and a refused raise stores nothing and runs no keyscan +ok 248 - G1, A1: only the chief raises a grant, and a refused raise stores nothing and runs no keyscan + --- + duration_ms: 63.243861 + type: 'test' + ... +# Subtest: G1: grant goes only with credential.mint, row a takes only host-enroll, and E1 refuses each bad field +ok 249 - G1: grant goes only with credential.mint, row a takes only host-enroll, and E1 refuses each bad field + --- + duration_ms: 92.784781 + type: 'test' + ... +# Subtest: G5, A5, A6: the scanned key set must equal the requested set, or host-key-mismatch and nothing stored +ok 250 - G5, A5, A6: the scanned key set must equal the requested set, or host-key-mismatch and nothing stored + --- + duration_ms: 61.509677 + type: 'test' + ... +# Subtest: G4 (host-enroll block, M1): the broker appends the keys, fingerprints and sudo line, and the cap counts the block +ok 251 - G4 (host-enroll block, M1): the broker appends the keys, fingerprints and sudo line, and the cap counts the block + --- + duration_ms: 58.289732 + type: 'test' + ... +# Subtest: G6, X1: the human's cli yes starts enrollment, which writes the record, the key file and the events in order +ok 252 - G6, X1: the human's cli yes starts enrollment, which writes the record, the key file and the events in order + --- + duration_ms: 82.115616 + type: 'test' + ... +# Subtest: A2, A4: a credential.mint without grant, and a no, start nothing +ok 253 - A2, A4: a credential.mint without grant, and a no, start nothing + --- + duration_ms: 255.169324 + type: 'test' + ... +# Subtest: A3, X1: a resolve by the tester or an agent starts nothing +ok 254 - A3, X1: a resolve by the tester or an agent starts nothing + --- + duration_ms: 267.409191 + type: 'test' + ... +# Subtest: G6 (duckworth-0081 B3): a withdraw by the chief or the human, and an arbiter resolve, start nothing +ok 255 - G6 (duckworth-0081 B3): a withdraw by the chief or the human, and an arbiter resolve, start nothing + --- + duration_ms: 260.469761 + type: 'test' + ... +# Subtest: G10 (duckworth-0081 B1): a second start for a spent decision refuses decision-consumed, and an unresolved or agent-resolved one not-authorized +ok 256 - G10 (duckworth-0081 B1): a second start for a spent decision refuses decision-consumed, and an unresolved or agent-resolved one not-authorized + --- + duration_ms: 81.477702 + type: 'test' + ... +# Subtest: A8, S1: two approved enrollments for one host: the second ends host-enrolled and the pin stays +ok 257 - A8, S1: two approved enrollments for one host: the second ends host-enrolled and the pin stays + --- + duration_ms: 100.102014 + type: 'test' + ... +# Subtest: A9: the hosts primary key refuses a second record for (business, host) +ok 258 - A9: the hosts primary key refuses a second record for (business, host) + --- + duration_ms: 50.14164 + type: 'test' + ... +# Subtest: X3: a failure at step 2 deletes the record again and ends grant.failed, with no key file +ok 259 - X3: a failure at step 2 deletes the record again and ends grant.failed, with no key file + --- + duration_ms: 78.999244 + type: 'test' + ... +# Subtest: A10, X3: at start a resolved, unspent enrollment is spent and ends interrupted, and never runs late +ok 260 - A10, X3: at start a resolved, unspent enrollment is spent and ends interrupted, and never runs late + --- + duration_ms: 58.980537 + type: 'test' + ... +# Subtest: X3: at start an enrollment that stopped after its registry step loses its record and key file +ok 261 - X3: at start an enrollment that stopped after its registry step loses its record and key file + --- + duration_ms: 72.693699 + type: 'test' + ... +# Subtest: G24 first sentence, M2, A12: tags are mosaic- and 32 hex, and differ by business, agent and host +ok 262 - G24 first sentence, M2, A12: tags are mosaic- and 32 hex, and differ by business, agent and host + --- + duration_ms: 0.464348 + type: 'test' + ... +# Subtest: E4: hosts.check sets the record ready and records grant.host.checked; a non-zero list leaves it pending +ok 263 - E4: hosts.check sets the record ready and records grant.host.checked; a non-zero list leaves it pending + --- + duration_ms: 78.498442 + type: 'test' + ... +# Subtest: G20 (duckworth-0081 B3): the human's hosts.check marks the host ready, and the reader refuses +ok 264 - G20 (duckworth-0081 B3): the human's hosts.check marks the host ready, and the reader refuses + --- + duration_ms: 76.520253 + type: 'test' + ... +# Subtest: G18 (duckworth-0081 B2), broker half: a check refused host-key-mismatch leaves the host pending-install with no grant.host.checked +ok 265 - G18 (duckworth-0081 B2), broker half: a check refused host-key-mismatch leaves the host pending-install with no grant.host.checked + --- + duration_ms: 76.83755 + type: 'test' + ... +# Subtest: E4: a check whose installer fingerprint differs from the record refuses host-changed +ok 266 - E4: a check whose installer fingerprint differs from the record refuses host-changed + --- + duration_ms: 85.273856 + type: 'test' + ... +# Subtest: E4, G21: hosts.remove is the human's or the tester's, deletes the key and the record, and records grant.host.removed +ok 267 - E4, G21: hosts.remove is the human's or the tester's, deletes the key and the record, and records grant.host.removed + --- + duration_ms: 80.842915 + type: 'test' + ... +# Subtest: G21, F1, F2, M4, A22: hosts.remove refuses host-line-left on a guarded hostLineLeft, and ignores look-alikes +ok 268 - G21, F1, F2, M4, A22: hosts.remove refuses host-line-left on a guarded hostLineLeft, and ignores look-alikes + --- + duration_ms: 86.715458 + type: 'test' + ... +# Subtest: hosts.remove refuses host-in-use while a grant record names the host +ok 269 - hosts.remove refuses host-in-use while a grant record names the host + --- + duration_ms: 87.647043 + type: 'test' + ... +# Subtest: the grant writer refuses a body outside section 7's shape +ok 270 - the grant writer refuses a body outside section 7's shape + --- + duration_ms: 46.123798 + type: 'test' + ... +# Subtest: recordEvent refuses reserved-event for a grant.* action or operation +ok 271 - recordEvent refuses reserved-event for a grant.* action or operation + --- + duration_ms: 41.015774 + type: 'test' + ... +# Subtest: row 280: an occupied TCP port is attempted, refused, and retried with our sshd +ok 272 - row 280: an occupied TCP port is attempted, refused, and retried with our sshd + --- + duration_ms: 110.779051 + type: 'test' + ... +# Subtest: row 280: every injected picker sample is unprivileged and outside the ephemeral range +ok 273 - row 280: every injected picker sample is unprivileged and outside the ephemeral range + --- + duration_ms: 0.570735 + type: 'test' + ... +# Subtest: G7: an Approve installs the tagged line, logs in with the new key, and writes the key file, record and grant.applied +ok 274 - G7: an Approve installs the tagged line, logs in with the new key, and writes the key file, record and grant.applied + --- + duration_ms: 792.55576 + type: 'test' + ... +# Subtest: G7: a commands change on a live grant updates the record in one transaction and keeps the key and line +ok 275 - G7: a commands change on a live grant updates the record in one transaction and keeps the key and line + --- + duration_ms: 634.62163 + type: 'test' + ... +# Subtest: G8: a failure at install or verify removes the line and leaves no record, key file or reference +ok 276 - G8: a failure at install or verify removes the line and leaves no record, key file or reference + --- + duration_ms: 1840.652476 + type: 'test' + ... +# Subtest: G8: a failed remove adds hostLineLeft and tells the human to sweep +ok 277 - G8: a failed remove adds hostLineLeft and tells the human to sweep + --- + duration_ms: 766.662778 + type: 'test' + ... +# Subtest: G8: a failure in step 5 before commit unlinks the key file, drops the reference and removes the line +ok 278 - G8: a failure in step 5 before commit unlinks the key file, drops the reference and removes the line + --- + duration_ms: 789.353703 + type: 'test' + ... +# Subtest: G8: a store fault in the commit transaction ends host-failed with no record, key file, reference or line +ok 279 - G8: a store fault in the commit transaction ends host-failed with no record, key file, reference or line + --- + duration_ms: 774.449133 + type: 'test' + ... +# Subtest: G8: a failed step 1 check spends the decision and runs nothing remote +ok 280 - G8: a failed step 1 check spends the decision and runs nothing remote + --- + duration_ms: 126.274789 + type: 'test' + ... +# Subtest: G9: a registry, definition or commands change between raise and Approve ends decision-mismatch before any remote step +ok 281 - G9: a registry, definition or commands change between raise and Approve ends decision-mismatch before any remote step + --- + duration_ms: 594.703154 + type: 'test' + ... +# Subtest: G9: an agent no longer a role or no longer declaring host ends with its code, spent +ok 282 - G9: an agent no longer a role or no longer declaring host ends with its code, spent + --- + duration_ms: 92.061489 + type: 'test' + ... +# Subtest: G10: a second start refuses decision-consumed, and an unresolved or agent-resolved decision not-authorized, writing nothing +ok 283 - G10: a second start refuses decision-consumed, and an unresolved or agent-resolved decision not-authorized, writing nothing + --- + duration_ms: 525.550743 + type: 'test' + ... +# Subtest: G15: no event, message or decision holds the private key +ok 284 - G15: no event, message or decision holds the private key + --- + duration_ms: 522.780684 + type: 'test' + ... +# Subtest: G23: a revoke during install ends grant.failed revoked with no key file, no grant and no line +ok 285 - G23: a revoke during install ends grant.failed revoked with no key file, no grant and no line + --- + duration_ms: 506.196251 + type: 'test' + ... +# Subtest: G23 (row 249): an add that writes after an abort's remove leaves hostLineLeft until the sweep +ok 286 - G23 (row 249): an add that writes after an abort's remove leaves hostLineLeft until the sweep + --- + duration_ms: 853.986597 + type: 'test' + ... +# Subtest: G23 (row 249): an add that writes after a timed-out install's remove leaves hostLineLeft until the sweep +ok 287 - G23 (row 249): an add that writes after a timed-out install's remove leaves hostLineLeft until the sweep + --- + duration_ms: 855.099444 + type: 'test' + ... +# Subtest: G23: a revoke recorded after the raise and before the start ends step 1 revoked, and a held slot ends host-busy +ok 288 - G23: a revoke recorded after the raise and before the start ends step 1 revoked, and a held slot ends host-busy + --- + duration_ms: 508.615269 + type: 'test' + ... +# Subtest: G24: names at 64 characters with . and _ give distinct tags of the fixed length +ok 289 - G24: names at 64 characters with . and _ give distinct tags of the fixed length + --- + duration_ms: 0.356726 + type: 'test' + ... +# Subtest: G11: a restart after install removes the line, then ends interrupted with the tag, holding the slot until then +ok 290 - G11: a restart after install removes the line, then ends interrupted with the tag, holding the slot until then + --- + duration_ms: 213.325103 + type: 'test' + ... +# Subtest: G11: a restart after a new key's commit, with the key file written, ends with no key file, record, reference or line +ok 291 - G11: a restart after a new key's commit, with the key file written, ends with no key file, record, reference or line + --- + duration_ms: 215.380379 + type: 'test' + ... +# Subtest: G11: a restart after a commands change's commit leaves the record as it was and asks nothing of the host +ok 292 - G11: a restart after a commands change's commit leaves the record as it was and asks nothing of the host + --- + duration_ms: 515.170122 + type: 'test' + ... +# Subtest: G11 (B2): a restart before step 1, spent or not yet spent, ends interrupted and nothing runs later +ok 293 - G11 (B2): a restart before step 1, spent or not yet spent, ends interrupted and nothing runs later + --- + duration_ms: 68.825846 + type: 'test' + ... +# Subtest: G11: a remote undo that fails ends interrupted with hostLineLeft and the sweep hint +ok 294 - G11: a remote undo that fails ends interrupted with hostLineLeft and the sweep hint + --- + duration_ms: 276.189823 + type: 'test' + ... +# Subtest: G11: a restart leaves a finished grant alone, and the reconcile adds nothing for it +ok 295 - G11: a restart leaves a finished grant alone, and the reconcile adds nothing for it + --- + duration_ms: 509.370545 + type: 'test' + ... +# Subtest: N1 (G27): the start sweep unlinks host. files with no record in loaded businesses only, and refuses a store dir that is not private +ok 296 - N1 (G27): the start sweep unlinks host. files with no record in loaded businesses only, and refuses a store dir that is not private + --- + duration_ms: 6.122155 + type: 'test' + ... +# Subtest: G12: the human's hosts.revoke deletes the record, the key file, the reference and the line, with a closed marker +ok 297 - G12: the human's hosts.revoke deletes the record, the key file, the reference and the line, with a closed marker + --- + duration_ms: 680.373658 + type: 'test' + ... +# Subtest: G12 (N4): a revoke with no record still removes the computed tag's line, with granted false; bad args refuse +ok 298 - G12 (N4): a revoke with no record still removes the computed tag's line, with granted false; bad args refuse + --- + duration_ms: 224.319205 + type: 'test' + ... +# Subtest: G13: a revoke during install aborts the executor, which ends revoked, and the line goes +ok 299 - G13: a revoke during install aborts the executor, which ends revoked, and the line goes + --- + duration_ms: 579.89503 + type: 'test' + ... +# Subtest: G26: the human, the assistant and the tester revoke; the chief and a pm refuse; sweep is the human's or the tester's +ok 300 - G26: the human, the assistant and the tester revoke; the chief and a pm refuse; sweep is the human's or the tester's + --- + duration_ms: 532.236651 + type: 'test' + ... +# Subtest: row 281 T8: a tester hosts.revoke refuses tester-dev-only once bus.tester is off, and a human revoke writes no job records +ok 301 - row 281 T8: a tester hosts.revoke refuses tester-dev-only once bus.tester is off, and a human revoke writes no job records + --- + duration_ms: 658.931488 + type: 'test' + ... +# Subtest: G27: a restart after step 1 sweeps the key file and runs step 3 once the bus is up; status shows the revoke until then +ok 302 - G27: a restart after step 1 sweeps the key file and runs step 3 once the bus is up; status shows the revoke until then + --- + duration_ms: 662.921263 + type: 'test' + ... +# Subtest: G27: after step 2 with the host down, the restart closes the marker with hostLineLeft; a marker without a revoke id is not reopened +ok 303 - G27: after step 2 with the host down, the restart closes the marker with hostLineLeft; a marker without a revoke id is not reopened + --- + duration_ms: 975.93503 + type: 'test' + ... +# Subtest: G27: a key file a revoke could not unlink is reported left and goes at the next start +ok 304 - G27: a key file a revoke could not unlink is reported left and goes at the next start + --- + duration_ms: 645.716856 + type: 'test' + ... +# Subtest: G28: a commands change, then a revoke, then a restart leave no record, key, reference or line +ok 305 - G28: a commands change, then a revoke, then a restart leave no record, key, reference or line + --- + duration_ms: 693.20941 + type: 'test' + ... +# Subtest: G24 (B4): hosts.sweep removes only this business's recorded tags no live grant holds, and records what it left +ok 306 - G24 (B4): hosts.sweep removes only this business's recorded tags no live grant holds, and records what it left + --- + duration_ms: 954.912486 + type: 'test' + ... +# Subtest: G12: the local steps finish before the host step, so a host that hangs leaves the agent no access +ok 307 - G12: the local steps finish before the host step, so a host that hangs leaves the agent no access + --- + duration_ms: 724.969936 + type: 'test' + ... +# Subtest: G23 (X5): a revoke right after the spend reaches the executor's claim, so the grant ends revoked +ok 308 - G23 (X5): a revoke right after the spend reaches the executor's claim, so the grant ends revoked + --- + duration_ms: 219.724918 + type: 'test' + ... +# Subtest: G23 (X5): a revoke that lands as verify returns ends revoked with no record, key file or line +ok 309 - G23 (X5): a revoke that lands as verify returns ends revoked with no record, key file or line + --- + duration_ms: 651.555431 + type: 'test' + ... +# Subtest: G13: a revoke whose host remove fails still drops the record and key, and reports the line left for a sweep +ok 310 - G13: a revoke whose host remove fails still drops the record and key, and reports the line left for a sweep + --- + duration_ms: 662.255636 + type: 'test' + ... +# Subtest: G22: enroll, check, grant, host.run, a commands change the next host.run uses, and a revoke that kills a run in flight +ok 311 - G22: enroll, check, grant, host.run, a commands change the next host.run uses, and a revoke that kills a run in flight + --- + duration_ms: 1203.388514 + type: 'test' + ... +# Subtest: mos-1163: a grant whose agent became a creative role after the raise ends host-creative-role at step 1, spent, with nothing remote +ok 312 - mos-1163: a grant whose agent became a creative role after the raise ends host-creative-role at step 1, spent, with nothing remote + --- + duration_ms: 65.237647 + type: 'test' + ... +# Subtest: sage-1908: once the agent of an applied grant is a creative role, host.run refuses host-creative-role, runs nothing remote and keeps the record +not ok 313 - sage-1908: once the agent of an applied grant is a creative role, host.run refuses host-creative-role, runs nothing remote and keeps the record + --- + duration_ms: 541.617762 + type: 'test' + location: '/mnt/storage/scratch/rocko-r219/packages/bus/tests/grant-executor.test.mjs:1046:1' + failureType: 'testCodeFailure' + error: 'thread-required' + code: 'thread-required' + stack: |- + fail (file:///mnt/storage/scratch/rocko-r219/packages/bus/src/broker.mjs:209:9) + Broker.bindLaunch (file:///mnt/storage/scratch/rocko-r219/packages/bus/src/broker.mjs:1258:40) + TestContext. (file:///mnt/storage/scratch/rocko-r219/packages/bus/tests/grant-executor.test.mjs:1050:24) + async Test.run (node:internal/test_runner/test:1409:7) + async Test.processPendingSubtests (node:internal/test_runner/test:974:7) + ... +# Subtest: G1 (host): only the chief raises a host grant, a grant on any other action refuses, and nothing is stored +ok 314 - G1 (host): only the chief raises a host grant, a grant on any other action refuses, and nothing is stored + --- + duration_ms: 60.465186 + type: 'test' + ... +# Subtest: G1, R4: the grant takes exactly method, agent, host, commands and rotateBy, and an unknown method refuses +ok 315 - G1, R4: the grant takes exactly method, agent, host, commands and rotateBy, and an unknown method refuses + --- + duration_ms: 68.85005 + type: 'test' + ... +# Subtest: row 236 (\#1742): a gitea grant on a broker with no Gitea path refuses gitea-not-configured, and nothing is stored +ok 316 - row 236 (\#1742): a gitea grant on a broker with no Gitea path refuses gitea-not-configured, and nothing is stored + --- + duration_ms: 43.61455 + type: 'test' + ... +# Subtest: G2: an agent whose definition lacks host refuses host-not-declared, and an unknown agent unknown-role +ok 317 - G2: an agent whose definition lacks host refuses host-not-declared, and an unknown agent unknown-role + --- + duration_ms: 54.947029 + type: 'test' + ... +# Subtest: mos-1163: a grant whose agent is a creative role refuses host-creative-role, even when its definition declares host +ok 318 - mos-1163: a grant whose agent is a creative role refuses host-creative-role, even when its definition declares host + --- + duration_ms: 48.497152 + type: 'test' + ... +# Subtest: G3: wildcard, shell, empty and other 210 D6 argv prefixes refuse invalid-request +ok 319 - G3: wildcard, shell, empty and other 210 D6 argv prefixes refuse invalid-request + --- + duration_ms: 93.147801 + type: 'test' + ... +# Subtest: R4 rotateBy (sage-1782): a real calendar day after today UTC, or invalid-request +ok 320 - R4 rotateBy (sage-1782): a real calendar day after today UTC, or invalid-request + --- + duration_ms: 68.817652 + type: 'test' + ... +# Subtest: G19: a grant naming a host that is pending-install refuses host-not-ready, and an unknown host host-unknown +ok 321 - G19: a grant naming a host that is pending-install refuses host-not-ready, and an unknown host host-unknown + --- + duration_ms: 53.881995 + type: 'test' + ... +# Subtest: R4, G5: the raise routes to the human and its event body binds the eight fields with their hashes +ok 322 - R4, G5: the raise routes to the human and its event body binds the eight fields with their hashes + --- + duration_ms: 60.318141 + type: 'test' + ... +# Subtest: G4 (host block): the broker appends the host, each prefix, the rotate date and new key or change +ok 323 - G4 (host block): the broker appends the host, each prefix, the rotate date and new key or change + --- + duration_ms: 89.317357 + type: 'test' + ... +# Subtest: 3i copy migrates to 3j: every row kept, and sqlite_master gains only the two tables, their keys and the guard +ok 324 - 3i copy migrates to 3j: every row kept, and sqlite_master gains only the two tables, their keys and the guard + --- + duration_ms: 163.850039 + type: 'test' + ... +# Subtest: a 3i→3j step that fails partway leaves the store at 3i with every row and the schema intact +ok 325 - a 3i→3j step that fails partway leaves the store at 3i with every row and the schema intact + --- + duration_ms: 201.656523 + type: 'test' + ... +# Subtest: the 3i engine refuses a migrated store, migrating or not, and leaves it as it was +ok 326 - the 3i engine refuses a migrated store, migrating or not, and leaves it as it was + --- + duration_ms: 199.15572 + type: 'test' + ... +# Subtest: A22b, sage-1703: a session-written grant.* row from before the step survives it, and the grant readers ignore it +ok 327 - A22b, sage-1703: a session-written grant.* row from before the step survives it, and the grant readers ignore it + --- + duration_ms: 151.790544 + type: 'test' + ... +# Subtest: the guard: a grant.* action or operation on action.allowed needs the (NULL, grant) actor +ok 328 - the guard: a grant.* action or operation on action.allowed needs the (NULL, grant) actor + --- + duration_ms: 31.591116 + type: 'test' + ... +# Subtest: hosts: one record per business and host, a ready host has its installer and check, grants need the host +ok 329 - hosts: one record per business and host, a ready host has its installer and check, grants need the host + --- + duration_ms: 27.568366 + type: 'test' + ... +# Subtest: REQ-WAIT-1: the broker hard waits are exactly the list, and match the business vocabulary +ok 330 - REQ-WAIT-1: the broker hard waits are exactly the list, and match the business vocabulary + --- + duration_ms: 1.926105 + type: 'test' + ... +# Subtest: REQ-WAIT-2: a business granting a hard wait at either class is refused; the actions that left are grantable +ok 331 - REQ-WAIT-2: a business granting a hard wait at either class is refused; the actions that left are grantable + --- + duration_ms: 37.191973 + type: 'test' + ... +# Subtest: REQ-DEC-2: every hard wait goes to the human, cited or not, and the arbiter cannot resolve it +ok 332 - REQ-DEC-2: every hard wait goes to the human, cited or not, and the arbiter cannot resolve it + --- + duration_ms: 850.396404 + type: 'test' + ... +# Subtest: REQ-DEC-2: a gated raise citing the current spec goes to the arbiter for its domain; uncited, to the human +ok 333 - REQ-DEC-2: a gated raise citing the current spec goes to the arbiter for its domain; uncited, to the human + --- + duration_ms: 331.093055 + type: 'test' + ... +# Subtest: REQ-DEC-2: an arbiter-approved cited gated decision authorizes the raiser, and the human cannot resolve it +ok 334 - REQ-DEC-2: an arbiter-approved cited gated decision authorizes the raiser, and the human cannot resolve it + --- + duration_ms: 95.672732 + type: 'test' + ... +# Subtest: REQ-DEC-2: a cited merge raised by merge-gate goes to the technical arbiter; a merge raised without the grant routes by citation +ok 335 - REQ-DEC-2: a cited merge raised by merge-gate goes to the technical arbiter; a merge raised without the grant routes by citation + --- + duration_ms: 143.518014 + type: 'test' + ... +# Subtest: REQ-DEC-2: a stale or unconfirmed citation refuses without a decision; an arbiter raising its own goes to the human +ok 336 - REQ-DEC-2: a stale or unconfirmed citation refuses without a decision; an arbiter raising its own goes to the human + --- + duration_ms: 212.434769 + type: 'test' + ... +# Subtest: Q169: the chief of staff's end of the assistant stops every thread run; its own run and another ender's are refused +ok 337 - Q169: the chief of staff's end of the assistant stops every thread run; its own run and another ender's are refused + --- + duration_ms: 114.589652 + type: 'test' + ... +# Subtest: Q169: a revoke of the assistant the chief of staff raises goes to the human, cited or not, and no arbiter resolves it +ok 338 - Q169: a revoke of the assistant the chief of staff raises goes to the human, cited or not, and no arbiter resolves it + --- + duration_ms: 278.112737 + type: 'test' + ... +# Subtest: Q169: another role's cited revoke of the assistant, resolved by an arbiter, is refused +ok 339 - Q169: another role's cited revoke of the assistant, resolved by an arbiter, is refused + --- + duration_ms: 133.928381 + type: 'test' + ... +# Subtest: Q169: a revoke of the assistant citing a decision the human resolved stops its thread run +ok 340 - Q169: a revoke of the assistant citing a decision the human resolved stops its thread run + --- + duration_ms: 102.581957 + type: 'test' + ... +# Subtest: Q169: a cited revoke of a role not in END_PROTECTED still goes to the arbiter, and executes +ok 341 - Q169: a cited revoke of a role not in END_PROTECTED still goes to the arbiter, and executes + --- + duration_ms: 104.80932 + type: 'test' + ... +# Subtest: Q169: a role granted role.revoke at either class still sends a revoke of the assistant to the human +ok 342 - Q169: a role granted role.revoke at either class still sends a revoke of the assistant to the human + --- + duration_ms: 149.313309 + type: 'test' + ... +# Subtest: row 280: an occupied TCP port is attempted, refused, and retried with our sshd +ok 343 - row 280: an occupied TCP port is attempted, refused, and retried with our sshd + --- + duration_ms: 108.88074 + type: 'test' + ... +# Subtest: row 280: every injected picker sample is unprivileged and outside the ephemeral range +ok 344 - row 280: every injected picker sample is unprivileged and outside the ephemeral range + --- + duration_ms: 0.586948 + type: 'test' + ... +# Subtest: the executor tests need sshd, ssh, ssh-agent, ssh-add, ssh-keygen and setpriv: a missing one fails, never skips +ok 345 - the executor tests need sshd, ssh, ssh-agent, ssh-add, ssh-keygen and setpriv: a missing one fails, never skips + --- + duration_ms: 0.309125 + type: 'test' + ... +# Subtest: T3: organization.set, limits.set and instances.set refuse hosts, and the writer never runs +ok 346 - T3: organization.set, limits.set and instances.set refuse hosts, and the writer never runs + --- + duration_ms: 47.779628 + type: 'test' + ... +# Subtest: T4: the value check takes one unencrypted ed25519 key and nothing else +ok 347 - T4: the value check takes one unencrypted ed25519 key and nothing else + --- + duration_ms: 325.414916 + type: 'test' + ... +# Subtest: T5 to T8: registry, grant, argv shape and allowlist refusals +ok 348 - T5 to T8: registry, grant, argv shape and allowlist refusals + --- + duration_ms: 671.784838 + type: 'test' + ... +# Subtest: T9: under 1.7 every call needs a decision bound to its host, argv and stdin, spent once +ok 349 - T9: under 1.7 every call needs a decision bound to its host, argv and stdin, spent once + --- + duration_ms: 422.645722 + type: 'test' + ... +# Subtest: T10, T11: argv reaches sudo unchanged after sudo -n -- +ok 350 - T10, T11: argv reaches sudo unchanged after sudo -n -- + --- + duration_ms: 394.873565 + type: 'test' + ... +# Subtest: T12, T13: exit code passes through, the timeout kills the group, output is capped +ok 351 - T12, T13: exit code passes through, the timeout kills the group, output is capped + --- + duration_ms: 1696.796321 + type: 'test' + ... +# Subtest: T14: a host key not in the registry refuses and nothing runs +ok 352 - T14: a host key not in the registry refuses and nothing runs + --- + duration_ms: 259.100968 + type: 'test' + ... +# Subtest: G18: hosts.check with a wrong pin refuses host-key-mismatch and runs nothing on the host +ok 353 - G18: hosts.check with a wrong pin refuses host-key-mismatch and runs nothing on the host + --- + duration_ms: 408.377642 + type: 'test' + ... +# Subtest: N3: a remote exit 255 that prints the pin refusal text is the command result, and an ssh failure keeps its message +ok 354 - N3: a remote exit 255 that prints the pin refusal text is the command result, and an ssh failure keeps its message + --- + duration_ms: 423.11001 + type: 'test' + ... +# Subtest: T15: ssh reads no config file and no user known_hosts +ok 355 - T15: ssh reads no config file and no user known_hosts + --- + duration_ms: 359.261211 + type: 'test' + ... +# Subtest: T16, T17: key material in output or stdin refuses credential-leak, and no event holds it +ok 356 - T16, T17: key material in output or stdin refuses credential-leak, and no event holds it + --- + duration_ms: 771.958736 + type: 'test' + ... +# Subtest: T18, T19, T20: one call at a time, no key in any argv or env, and nothing left after +ok 357 - T18, T19, T20: one call at a time, no key in any argv or env, and nothing left after + --- + duration_ms: 4691.28771 + type: 'test' + ... +# Subtest: T21: revoke kills the call in flight, and the next call refuses +ok 358 - T21: revoke kills the call in flight, and the next call refuses + --- + duration_ms: 285.877455 + type: 'test' + ... +# Subtest: T22: events carry host, address, user and argv in clear, and sizes and hashes only +ok 359 - T22: events carry host, address, user and argv in clear, and sizes and hashes only + --- + duration_ms: 255.38952 + type: 'test' + ... +# Subtest: T24: no literal gitea and vikunja kind list outside vocabulary.mjs, and the credential use sites are known +ok 360 - T24: no literal gitea and vikunja kind list outside vocabulary.mjs, and the credential use sites are known + --- + duration_ms: 15.424648 + type: 'test' + ... +# Subtest: T25: no role definition lists host.sudo while it is a hard wait +ok 361 - T25: no role definition lists host.sudo while it is a hard wait + --- + duration_ms: 0.413184 + type: 'test' + ... +# Subtest: T27: the bus child dying takes ssh and ssh-agent with it +ok 362 - T27: the bus child dying takes ssh and ssh-agent with it + --- + duration_ms: 310.866887 + type: 'test' + ... +# Subtest: T27: ssh-add -t drops the key from an agent the test keeps alive +ok 363 - T27: ssh-add -t drops the key from an agent the test keeps alive + --- + duration_ms: 3553.577308 + type: 'test' + ... +# Subtest: N2: a hung ssh-add is killed at its limit or on abort, and nothing is left running +ok 364 - N2: a hung ssh-add is killed at its limit or on abort, and nothing is left running + --- + duration_ms: 427.067282 + type: 'test' + ... +# Subtest: T27: the start sweep keeps a live bus dir and kills only a matching live process +ok 365 - T27: the start sweep keeps a live bus dir and kills only a matching live process + --- + duration_ms: 26.25375 + type: 'test' + ... +# Subtest: T27: the bus start sweeps /secrets/run before it listens, and a stray entry stops the start +ok 366 - T27: the bus start sweeps /secrets/run before it listens, and a stray entry stops the start + --- + duration_ms: 59.960039 + type: 'test' + ... +# Subtest: M3: host.run refuses host-not-granted unless the grant record has an approved, spent host grant +ok 367 - M3: host.run refuses host-not-granted unless the grant record has an approved, spent host grant + --- + duration_ms: 136.052066 + type: 'test' + ... +# Subtest: M3: a host_grants record gives Credentials a store reference at start, and a restart reads its key +ok 368 - M3: a host_grants record gives Credentials a store reference at start, and a restart reads its key + --- + duration_ms: 96.153985 + type: 'test' + ... +# Subtest: G16: the writer refuses each user, tag and key the design names, before any key file +ok 369 - G16: the writer refuses each user, tag and key the design names, before any key file + --- + duration_ms: 3776.686603 + type: 'test' + ... +# Subtest: G16: from= comes from the host file, a privileged user skips the group and sudo checks, and the line is exact +ok 370 - G16: from= comes from the host file, a privileged user skips the group and sudo checks, and the line is exact + --- + duration_ms: 974.045313 + type: 'test' + ... +# Subtest: G16: list shows tagged lines only, and add and remove never touch a line outside the tag pattern +ok 371 - G16: list shows tagged lines only, and add and remove never touch a line outside the tag pattern + --- + duration_ms: 484.649201 + type: 'test' + ... +# Subtest: G25: the writer refuses a symlinked dir or user file, a group-writable dir and an odd tmp, and writes 0644 +ok 372 - G25: the writer refuses a symlinked dir or user file, a group-writable dir and an odd tmp, and writes 0644 + --- + duration_ms: 654.117495 + type: 'test' + ... +# Subtest: G16: mosaic-keys passes the three requests to the writer through sudo and refuses anything else without it +ok 373 - G16: mosaic-keys passes the three requests to the writer through sudo and refuses anything else without it + --- + duration_ms: 116.999472 + type: 'test' + ... +# Subtest: E3: the sudoers line and the sshd drop-in are the design lines and parse +ok 374 - E3: the sudoers line and the sshd drop-in are the design lines and parse + --- + duration_ms: 30.075371 + type: 'test' + ... +# Subtest: human proof binds CLI entry, process start and nonce; agents and incomplete ancestry refuse +ok 375 - human proof binds CLI entry, process start and nonce; agents and incomplete ancestry refuse + --- + duration_ms: 2.470759 + type: 'test' + ... +# Subtest: process reader gets own kernel identity without exposing environment values +ok 376 - process reader gets own kernel identity without exposing environment values + --- + duration_ms: 0.671409 + type: 'test' + ... +# Subtest: EACCES ancestor environments skip only markers; commands and registered launches still refuse +ok 377 - EACCES ancestor environments skip only markers; commands and registered launches still refuse + --- + duration_ms: 1.081706 + type: 'test' + ... +# Subtest: real pid 1 remains inspectable when its environment is protected +ok 378 - real pid 1 remains inspectable when its environment is protected + --- + duration_ms: 0.391405 + type: 'test' + ... +# organization: {"event":"reload-needs-restart","business":"demo"} +# organization: {"event":"reload-needs-restart","business":"demo"} +# Subtest: row 165: instances and instances.set refuse every non-human session but the tester, the chief of staff included, and pass the verified actor +ok 379 - row 165: instances and instances.set refuse every non-human session but the tester, the chief of staff included, and pass the verified actor + --- + duration_ms: 65.827226 + type: 'test' + ... +# Subtest: row 165 runtime: an add and a change reach the organization file with the human as actor; each refusal keeps the bytes and logs nothing +ok 380 - row 165 runtime: an add and a change reach the organization file with the human as actor; each refusal keeps the bytes and logs nothing + --- + duration_ms: 234.755388 + type: 'test' + ... +# Subtest: row 194 T12: agent and reader sessions refuse veto.set; the tester gets add and change but not delete or veto.set; the human passes the hook for each listed verb +ok 381 - row 194 T12: agent and reader sessions refuse veto.set; the tester gets add and change but not delete or veto.set; the human passes the hook for each listed verb + --- + duration_ms: 49.521058 + type: 'test' + ... +# Subtest: system Python is a resolved root-owned ELF, never a shim or home interpreter +ok 382 - system Python is a resolved root-owned ELF, never a shim or home interpreter + --- + duration_ms: 4.625795 + type: 'test' + ... +# Subtest: real system interpreter is available and safely inspected +ok 383 - real system interpreter is available and safely inspected + --- + duration_ms: 32.150913 + type: 'test' + ... +# Subtest: restart receipt appends actual replacement identity and refuses unsafe files +ok 384 - restart receipt appends actual replacement identity and refuses unsafe files + --- + duration_ms: 5.100802 + type: 'test' + ... +# Subtest: activation gate compares fresh startup receipt to the current interpreter identity +ok 385 - activation gate compares fresh startup receipt to the current interpreter identity + --- + duration_ms: 2.322355 + type: 'test' + ... +# Subtest: non-regular startup receipt refuses promptly without waiting on a FIFO peer +ok 386 - non-regular startup receipt refuses promptly without waiting on a FIFO peer + --- + duration_ms: 48.02169 + type: 'test' + ... +# Subtest: REQ-DEC-2: a merge-gate raise its arbiter resolved lands through the host op: checkLand answers the facts and a ticket, records nothing, and recordLand spends the decision once +ok 387 - REQ-DEC-2: a merge-gate raise its arbiter resolved lands through the host op: checkLand answers the facts and a ticket, records nothing, and recordLand spends the decision once + --- + duration_ms: 69.027412 + type: 'test' + ... +# Subtest: checkLand refuses on the decision and the review +ok 388 - checkLand refuses on the decision and the review + --- + duration_ms: 67.722031 + type: 'test' + ... +# Subtest: REQ-LAND-1: a gated merge decision refuses not-authorized, cited and approved by the arbiter or uncited and approved by the human +ok 389 - REQ-LAND-1: a gated merge decision refuses not-authorized, cited and approved by the arbiter or uncited and approved by the human + --- + duration_ms: 183.288549 + type: 'test' + ... +# Subtest: REQ-LAND-1: a within-role merge grant refuses not-authorized at the land +ok 390 - REQ-LAND-1: a within-role merge grant refuses not-authorized at the land + --- + duration_ms: 44.291601 + type: 'test' + ... +# Subtest: a cross-role merge that routes to the human, because merge-gate is its own arbiter, lands on the human's CLI answer +ok 391 - a cross-role merge that routes to the human, because merge-gate is its own arbiter, lands on the human's CLI answer + --- + duration_ms: 55.749541 + type: 'test' + ... +# Subtest: a merge option with no first line refuses no-subject, as land-work does +ok 392 - a merge option with no first line refuses no-subject, as land-work does + --- + duration_ms: 49.611553 + type: 'test' + ... +# Subtest: checkLand refuses with land-work's codes past the authority check, and a decision raised for refactor never lands +ok 393 - checkLand refuses with land-work's codes past the authority check, and a decision raised for refactor never lands + --- + duration_ms: 115.315788 + type: 'test' + ... +# Subtest: a ticket outlives the run that asked, and recordLand checks the task again +ok 394 - a ticket outlives the run that asked, and recordLand checks the task again + --- + duration_ms: 56.722266 + type: 'test' + ... +# Subtest: two tickets on one decision: the first recordLand lands, the second refuses decision-consumed and records nothing +ok 395 - two tickets on one decision: the first recordLand lands, the second refuses decision-consumed and records nothing + --- + duration_ms: 58.632121 + type: 'test' + ... +# Subtest: landRefused files the code on the task, tells the role only with notify, and ends the ticket +ok 396 - landRefused files the code on the task, tells the role only with notify, and ends the ticket + --- + duration_ms: 55.994014 + type: 'test' + ... +# Subtest: landHeld is true only for an approved, unspent cross-role merge decision this role raised for a task in this thread +ok 397 - landHeld is true only for an approved, unspent cross-role merge decision this role raised for a task in this thread + --- + duration_ms: 57.729331 + type: 'test' + ... +# Subtest: landHolders lists a merge decision exactly while landHeld is true for its non-thread instance, in decision order +ok 398 - landHolders lists a merge decision exactly while landHeld is true for its non-thread instance, in decision order + --- + duration_ms: 68.13637 + type: 'test' + ... +# Subtest: landHolders leaves out a thread instance's decision, even one raised before its role became one +ok 399 - landHolders leaves out a thread instance's decision, even one raised before its role became one + --- + duration_ms: 53.577937 + type: 'test' + ... +# Subtest: landRelease releases the holding run by land-relaunch once it has asked message.receive and nothing delivered to it is unread, and waiting messages go to the next holder +ok 400 - landRelease releases the holding run by land-relaunch once it has asked message.receive and nothing delivered to it is unread, and waiting messages go to the next holder + --- + duration_ms: 79.74998 + type: 'test' + ... +# Subtest: a landing run started after the resolution passes checkLand for its held decision before any message.receive, and lands it +ok 401 - a landing run started after the resolution passes checkLand for its held decision before any message.receive, and lands it + --- + duration_ms: 64.725523 + type: 'test' + ... +# Subtest: the bus process answers landHolders and landRelease from their own lines, not as credentialStatus +ok 402 - the bus process answers landHolders and landRelease from their own lines, not as credentialStatus + --- + duration_ms: 244.727883 + type: 'test' + ... +# Subtest: usage.begin with a decision id needs it held for the run's instance, usage.end needs the begin, and the limit checks see the landing turn +ok 403 - usage.begin with a decision id needs it held for the run's instance, usage.end needs the begin, and the limit checks see the landing turn + --- + duration_ms: 76.243089 + type: 'test' + ... +# Subtest: no run may write the action.allowed for git.merge.protected itself +ok 404 - no run may write the action.allowed for git.merge.protected itself + --- + duration_ms: 41.360907 + type: 'test' + ... +# Subtest: a message to a stopped role sends launch.by one notice, and the result says so +ok 405 - a message to a stopped role sends launch.by one notice, and the result says so + --- + duration_ms: 62.104993 + type: 'test' + ... +# Subtest: a message to a role outside launch.instances says so in its result and in the notice +ok 406 - a message to a role outside launch.instances says so in its result and in the notice + --- + duration_ms: 47.425309 + type: 'test' + ... +# Subtest: a message to a running role sends no notice and its result is unchanged +ok 407 - a message to a running role sends no notice and its result is unchanged + --- + duration_ms: 26.605136 + type: 'test' + ... +# Subtest: a re-route at a claim, a release and claim, and a broker restart send no second notice +ok 408 - a re-route at a claim, a release and claim, and a broker restart send no second notice + --- + duration_ms: 40.469631 + type: 'test' + ... +# Subtest: a run launched but not yet claimed counts as no holder +ok 409 - a run launched but not yet claimed counts as no holder + --- + duration_ms: 26.103832 + type: 'test' + ... +# Subtest: no notice for a message to launch.by, from it, a refused one from a tester, to the human, or in a thread to a thread instance +ok 410 - no notice for a message to launch.by, from it, a refused one from a tester, to the human, or in a thread to a thread instance + --- + duration_ms: 53.204083 + type: 'test' + ... +# Subtest: a business with no launch block tells nobody and says there is no launcher +ok 411 - a business with no launch block tells nobody and says there is no launcher + --- + duration_ms: 22.26327 + type: 'test' + ... +# Subtest: the notice sender stays internal: no role is named _bus and no caller can send as it or to it +ok 412 - the notice sender stays internal: no role is named _bus and no caller can send as it or to it + --- + duration_ms: 62.340968 + type: 'test' + ... +# Subtest: C2-03a library.sync: every agent, the tester and a reader are refused before the adapter runs +ok 413 - C2-03a library.sync: every agent, the tester and a reader are refused before the adapter runs + --- + duration_ms: 39.495431 + type: 'test' + ... +# Subtest: C2-03a library.sync: the human fetches, accept passes through, and a held sync is a recorded refusal +ok 414 - C2-03a library.sync: the human fetches, accept passes through, and a held sync is a recorded refusal + --- + duration_ms: 32.42338 + type: 'test' + ... +# Subtest: C2-03a library.sync: a LibraryError keeps its code and a host without sync is not configured +ok 415 - C2-03a library.sync: a LibraryError keeps its code and a host without sync is not configured + --- + duration_ms: 46.486395 + type: 'test' + ... +# Subtest: C2-03a runtime: a librarySync from a boot config, with no function, is refused +ok 416 - C2-03a runtime: a librarySync from a boot config, with no function, is refused + --- + duration_ms: 2.158931 + type: 'test' + ... +# Subtest: C2-03a runtime: the timer syncs each entry with a user at start and on each tick, logs codes only, and stops on close +ok 417 - C2-03a runtime: the timer syncs each entry with a user at start and on each tick, logs codes only, and stops on close + --- + duration_ms: 818.558973 + type: 'test' + ... +# Subtest: row 254 human-cli: library.sync outlasts the 5 s client default, and library.status does not +ok 418 - row 254 human-cli: library.sync outlasts the 5 s client default, and library.status does not + --- + duration_ms: 6136.765479 + type: 'test' + ... +# Subtest: C2-04 M4: both verbs reject every agent before arguments or adapter access +ok 419 - C2-04 M4: both verbs reject every agent before arguments or adapter access + --- + duration_ms: 65.381779 + type: 'test' + ... +# Subtest: C2-04 bus: human reads validate keys and return adapter results without path leakage +ok 420 - C2-04 bus: human reads validate keys and return adapter results without path leakage + --- + duration_ms: 29.441245 + type: 'test' + ... +# Subtest: C2-04 socket: each async library verb resolves its result rather than serializing {} +ok 421 - C2-04 socket: each async library verb resolves its result rather than serializing {} + --- + duration_ms: 123.12537 + type: 'test' + ... +# Subtest: C2-04 runtime: protectedRoots skips library but retains real code-root credential protection +ok 422 - C2-04 runtime: protectedRoots skips library but retains real code-root credential protection + --- + duration_ms: 186.459859 + type: 'test' + ... +# Subtest: C2-04 runtime: unsafe existing mirror refuses boot and never publishes a socket +ok 423 - C2-04 runtime: unsafe existing mirror refuses boot and never publishes a socket + --- + duration_ms: 46.096461 + type: 'test' + ... +# Subtest: C2-04 runtime: real library adapters reach the socket and lock waits leave other bus reads responsive +ok 424 - C2-04 runtime: real library adapters reach the socket and lock waits leave other bus reads responsive + --- + duration_ms: 388.674555 + type: 'test' + ... +# organization: {"event":"reload-needs-restart","business":"demo"} +# Subtest: T20 fire: a revoke that fails stops the fire with the file unchanged; one that succeeds revokes, keeps the directory and names the services outside the store +ok 425 - T20 fire: a revoke that fails stops the fire with the file unchanged; one that succeeds revokes, keeps the directory and names the services outside the store + --- + duration_ms: 155.340879 + type: 'test' + ... +# Subtest: T20 fire: an instance already delisted still has its tokens revoked and the file is left alone +ok 426 - T20 fire: an instance already delisted still has its tokens revoked and the file is left alone + --- + duration_ms: 100.157588 + type: 'test' + ... +# Subtest: T20 fire: with no entry in the running bus, a token on disk refuses and an empty store goes on +ok 427 - T20 fire: with no entry in the running bus, a token on disk refuses and an empty store goes on + --- + duration_ms: 106.662173 + type: 'test' + ... +# Subtest: T20 delete: a revoke that fails keeps the file; one that succeeds clears the store, deletes, and names the tracker bot +ok 428 - T20 delete: a revoke that fails keeps the file; one that succeeds clears the store, deletes, and names the tracker bot + --- + duration_ms: 137.362913 + type: 'test' + ... +# Subtest: T20 delete: with no entry in the running bus, a token file is cleared and the delete goes on; a file reference refuses +ok 429 - T20 delete: with no entry in the running bus, a token file is cleared and the delete goes on; a file reference refuses + --- + duration_ms: 113.859122 + type: 'test' + ... +# Subtest: T21 delete: a write between the raise and the take makes the delete refuse revision-conflict before it revokes anything +ok 430 - T21 delete: a write between the raise and the take makes the delete refuse revision-conflict before it revokes anything + --- + duration_ms: 108.119334 + type: 'test' + ... +# Subtest: row 281 T1 fire: a host. or granted gitea file in the store refuses step B credential-revoke-failed, file unchanged +ok 431 - row 281 T1 fire: a host. or granted gitea file in the store refuses step B credential-revoke-failed, file unchanged + --- + duration_ms: 104.831992 + type: 'test' + ... +# Subtest: row 281 T1 start: a host grant record whose key file is gone starts and reads not-issued +ok 432 - row 281 T1 start: a host grant record whose key file is gone starts and reads not-issued + --- + duration_ms: 109.006152 + type: 'test' + ... +# Subtest: row 194 T12: agent and reader sessions refuse the lifecycle verbs before any effect; the tester gets launch, end and the request read, never regenerate +ok 433 - row 194 T12: agent and reader sessions refuse the lifecycle verbs before any effect; the tester gets launch, end and the request read, never regenerate + --- + duration_ms: 69.018843 + type: 'test' + ... +# Subtest: row 194 V2 and V4 at the verb: the request is open, by the human, with a human.input; thread, retired, unknown and revoked refuse with no event +ok 434 - row 194 V2 and V4 at the verb: the request is open, by the human, with a human.input; thread, retired, unknown and revoked refuse with no event + --- + duration_ms: 47.931663 + type: 'test' + ... +# Subtest: row 194 D1.1 take: a request is taken once, closes once, and lifecycleRequests lists only what is not closed +ok 435 - row 194 D1.1 take: a request is taken once, closes once, and lifecycleRequests lists only what is not closed + --- + duration_ms: 30.283728 + type: 'test' + ... +# Subtest: row 194 D1.1 take: a launch.revoke after the request closes it launch-revoked, and a request past 60 s closes request-expired +ok 436 - row 194 D1.1 take: a launch.revoke after the request closes it launch-revoked, and a request past 60 s closes request-expired + --- + duration_ms: 39.03299 + type: 'test' + ... +# Subtest: row 194 T15 (bus): while halted, launch and regenerate refuse processing-halted at the verb and at the take, hire and fire refuse, terminate goes; an unreadable switch refuses with its code +ok 437 - row 194 T15 (bus): while halted, launch and regenerate refuse processing-halted at the verb and at the take, hire and fire refuse, terminate goes; an unreadable switch refuses with its code + --- + duration_ms: 62.579559 + type: 'test' + ... +# Subtest: row 194 T12a: the tester launches and ends on its own business with actor tester; bus.tester off in the file refuses the call and the take tester-off +ok 438 - row 194 T12a: the tester launches and ends on its own business with actor tester; bus.tester off in the file refuses the call and the take tester-off + --- + duration_ms: 46.328474 + type: 'test' + ... +# Subtest: row 194 V3 terminate: claims revoked, open requests cancelled, bound runs named, taken requests listed; nothing at all answers not-held +ok 439 - row 194 V3 terminate: claims revoked, open requests cancelled, bound runs named, taken requests listed; nothing at all answers not-held + --- + duration_ms: 61.814144 + type: 'test' + ... +# Subtest: row 194 V3 terminate of a thread instance: the human ends every thread, the tester only its own +ok 440 - row 194 V3 terminate of a thread instance: the human ends every thread, the tester only its own + --- + duration_ms: 41.985798 + type: 'test' + ... +# Subtest: row 194 T6 V5 order at the verb: the writer's named refusals, then instance-running, instance-starting, the last-listed refusal and the revision +ok 441 - row 194 T6 V5 order at the verb: the writer's named refusals, then instance-running, instance-starting, the last-listed refusal and the revision + --- + duration_ms: 62.983629 + type: 'test' + ... +# Subtest: row 194 V5: an open launch past its 60 s is not starting, as it can only close request-expired +ok 442 - row 194 V5: an open launch past its 60 s is not starting, as it can only close request-expired + --- + duration_ms: 28.699949 + type: 'test' + ... +# Subtest: row 194 V5 after the take: lifecycleDelete re-checks running and starting, then commits through the writer with the human as actor +ok 443 - row 194 V5 after the take: lifecycleDelete re-checks running and starting, then commits through the writer with the human as actor + --- + duration_ms: 50.109522 + type: 'test' + ... +# Subtest: row 194 V5 retry: a retired name deletes again only after workspace-rename-failed, and that request commits nothing +ok 444 - row 194 V5 retry: a retired name deletes again only after workspace-rename-failed, and that request commits nothing + --- + duration_ms: 43.076528 + type: 'test' + ... +# Subtest: row 194 V5 runtime: a delete request, the take and lifecycleDelete commit the file with retired, log the human and reload so the name no longer binds +ok 445 - row 194 V5 runtime: a delete request, the take and lifecycleDelete commit the file with retired, log the human and reload so the name no longer binds + --- + duration_ms: 241.473766 + type: 'test' + ... +# Subtest: REQ-LIMIT-3 limitLeaves finds every limit object and skips the agent numbers +ok 446 - REQ-LIMIT-3 limitLeaves finds every limit object and skips the agent numbers + --- + duration_ms: 2.082934 + type: 'test' + ... +# Subtest: REQ-LIMIT-3 limitLeaves takes token limits at schema depth only, whatever their names +ok 447 - REQ-LIMIT-3 limitLeaves takes token limits at schema depth only, whatever their names + --- + duration_ms: 0.35304 + type: 'test' + ... +# Subtest: REQ-LIMIT-3 with no check switched on a launch is allowed, a turn never stops, and every limit is not enforced +ok 448 - REQ-LIMIT-3 with no check switched on a launch is allowed, a turn never stops, and every limit is not enforced + --- + duration_ms: 25.043174 + type: 'test' + ... +# Subtest: REQ-LIMIT-3 a fixture check that refuses refuses the launch and stops the turn, logged with the limit and the count +ok 449 - REQ-LIMIT-3 a fixture check that refuses refuses the launch and stops the turn, logged with the limit and the count + --- + duration_ms: 23.773746 + type: 'test' + ... +# Subtest: REQ-LIMIT-3 a report that omits a limit shows it not enforced; a counted entry and a reason come through +ok 450 - REQ-LIMIT-3 a report that omits a limit shows it not enforced; a counted entry and a reason come through + --- + duration_ms: 25.98849 + type: 'test' + ... +# Subtest: REQ-LIMIT-4 each check gets the business, a copy of the limits, the subject, the records and the time +ok 451 - REQ-LIMIT-4 each check gets the business, a copy of the limits, the subject, the records and the time + --- + duration_ms: 27.005515 + type: 'test' + ... +# Subtest: REQ-LIMIT-4 fail closed: a throw refuses, stops and fails the report, naming the check and the code +ok 452 - REQ-LIMIT-4 fail closed: a throw refuses, stops and fails the report, naming the check and the code + --- + duration_ms: 30.427015 + type: 'test' + ... +# Subtest: REQ-LIMIT-4 fail closed: a malformed answer, a promise, a rejected promise, a non-boolean or a bad hit is malformed-answer +ok 453 - REQ-LIMIT-4 fail closed: a malformed answer, a promise, a rejected promise, a non-boolean or a bad hit is malformed-answer + --- + duration_ms: 30.982443 + type: 'test' + ... +# Subtest: REQ-LIMIT-4 fail closed: a check switched on but not loaded refuses, stops and fails every limit as not-loaded +ok 454 - REQ-LIMIT-4 fail closed: a check switched on but not loaded refuses, stops and fails every limit as not-loaded + --- + duration_ms: 22.517386 + type: 'test' + ... +# Subtest: REQ-LIMIT-4 state(), never-loaded case: before any load the report shows not enforced, or not-loaded for a switched-on check +ok 455 - REQ-LIMIT-4 state(), never-loaded case: before any load the report shows not enforced, or not-loaded for a switched-on check + --- + duration_ms: 21.189033 + type: 'test' + ... +# Subtest: REQ-LIMIT-4 state(), first-load-refused case: a check refused on its first load is not-loaded in mayLaunch, mustStop and report +ok 456 - REQ-LIMIT-4 state(), first-load-refused case: a check refused on its first load is not-loaded in mayLaunch, mustStop and report + --- + duration_ms: 23.44254 + type: 'test' + ... +# Subtest: REQ-LIMIT-4 fail closed: an unreadable organization file refuses and stops with check null; the report throws +ok 457 - REQ-LIMIT-4 fail closed: an unreadable organization file refuses and stops with check null; the report throws + --- + duration_ms: 21.567067 + type: 'test' + ... +# Subtest: REQ-LIMIT-4 fail closed: unreadable records refuse and stop with check null and fail the report +ok 458 - REQ-LIMIT-4 fail closed: unreadable records refuse and stop with check null and fail the report + --- + duration_ms: 0.972041 + type: 'test' + ... +# Subtest: REQ-LIMIT-3 the shipped token-limit, through the real loader, counts known records only since the limit was set +ok 459 - REQ-LIMIT-3 the shipped token-limit, through the real loader, counts known records only since the limit was set + --- + duration_ms: 32.532413 + type: 'test' + ... +# Subtest: REQ-LIMIT-3 a token limit for a provider named limit is counted and refuses, beside an agent limit of the same name +ok 460 - REQ-LIMIT-3 a token limit for a provider named limit is counted and refuses, beside an agent limit of the same name + --- + duration_ms: 21.055827 + type: 'test' + ... +# Subtest: REQ-LIMIT-3 core reaches limit checks only through the plug-in loader +ok 461 - REQ-LIMIT-3 core reaches limit checks only through the plug-in loader + --- + duration_ms: 1.483246 + type: 'test' + ... +# Subtest: REQ-LIMIT-4 a role run at its limit stops at the end of its turn: RESULT and read land first, the claim is revoked by limit-check +ok 462 - REQ-LIMIT-4 a role run at its limit stops at the end of its turn: RESULT and read land first, the claim is revoked by limit-check + --- + duration_ms: 63.515947 + type: 'test' + ... +# Subtest: REQ-LIMIT-4 the stop also lands on state; a run with no stop ends without a limit +ok 463 - REQ-LIMIT-4 the stop also lands on state; a run with no stop ends without a limit + --- + duration_ms: 69.43795 + type: 'test' + ... +# Subtest: REQ-LIMIT-4 fail closed: a mustStop throw or a malformed answer stops the run, naming the bus and the code +ok 464 - REQ-LIMIT-4 fail closed: a mustStop throw or a malformed answer stops the run, naming the bus and the code + --- + duration_ms: 166.921773 + type: 'test' + ... +# Subtest: REQ-LIMIT-4 a thread run at its limit is released with the reason, and its end record names the limit +ok 465 - REQ-LIMIT-4 a thread run at its limit is released with the reason, and its end record names the limit + --- + duration_ms: 50.260232 + type: 'test' + ... +# Subtest: REQ-LIMIT-4 a broker with no limit checks configured never stops a run +ok 466 - REQ-LIMIT-4 a broker with no limit checks configured never stops a run + --- + duration_ms: 36.695904 + type: 'test' + ... +# limits: {"event":"limit-reached","business":"demo","check":"token-limit","export":"mayLaunch","subject":{"instance":"coder","provider":"zai","model":"glm-5.3-flash","account":null},"path":["tokens","instances","coder"],"limit":0,"count":0,"unknownTurns":0} +# organization: {"event":"reload-needs-restart","business":"demo"} +# usage: {"event":"usage-unknown","business":"demo","run":"run1","instance":"coder","turn":"c81bf32f-fc24-4097-bd24-b580659f4f19","source":"@none","code":"baseline-unknown"} +# limits: {"event":"limit-reached","business":"demo","check":"token-limit","export":"mustStop","subject":{"instance":"coder","provider":"zai","model":"glm-5.3-flash","account":null},"path":["tokens","instances","coder"],"limit":0,"count":0,"unknownTurns":1} +# usage: {"event":"usage-unknown","business":"demo","run":"run1","instance":"coder","turn":"fde0626b-d01d-498c-86b1-a4496d582ce6","source":"@none","code":"baseline-unknown"} +# Subtest: REQ-LIMIT-3 REQ-LIMIT-4 runtime: limits carries the token count, mayLaunch refuses at the limit, a reset moves since +# organization: {"event":"reload-needs-restart","business":"demo"} +ok 467 - REQ-LIMIT-3 REQ-LIMIT-4 runtime: limits carries the token count, mayLaunch refuses at the limit, a reset moves since + --- + duration_ms: 259.59212 + type: 'test' + ... +# Subtest: REQ-LIMIT-3 runtime: with no limit check switched on, the limit shows not enforced and every launch is allowed +ok 468 - REQ-LIMIT-3 runtime: with no limit check switched on, the limit shows not enforced and every launch is allowed + --- + duration_ms: 70.442965 + type: 'test' + ... +# Subtest: REQ-LIMIT-4 runtime: the broker asks the shipped token-limit after a turn, and the run at its limit stops on its next receive +ok 469 - REQ-LIMIT-4 runtime: the broker asks the shipped token-limit after a turn, and the run at its limit stops on its next receive + --- + duration_ms: 99.576057 + type: 'test' + ... +# Subtest: REQ-LIMIT-4 runtime: with no usage source a turn is unknown, counts zero and stops nothing under a limit of 1 +ok 470 - REQ-LIMIT-4 runtime: with no usage source a turn is unknown, counts zero and stops nothing under a limit of 1 + --- + duration_ms: 102.076666 + type: 'test' + ... +# Subtest: REQ-LIMIT-3 runtime: switching a limit check on with plugins.set loads it without a launch or a turn +ok 471 - REQ-LIMIT-3 runtime: switching a limit check on with plugins.set loads it without a launch or a turn + --- + duration_ms: 115.113412 + type: 'test' + ... +# organization: {"event":"reload-needs-restart","business":"demo"} +# organization: {"event":"reload-needs-restart","business":"demo"} +# Subtest: limits binds actor from human proof and rejects role, reader, a tester set and forged actor +ok 472 - limits binds actor from human proof and rejects role, reader, a tester set and forged actor + --- + duration_ms: 37.070233 + type: 'test' + ... +# Subtest: runtime wires verified human settings to the actual shared file writer and actor receipt +ok 473 - runtime wires verified human settings to the actual shared file writer and actor receipt + --- + duration_ms: 193.82476 + type: 'test' + ... +# Subtest: uncertain organization receipts leave bus startup and reads alone but refuse writes until reconciled +ok 474 - uncertain organization receipts leave bus startup and reads alone but refuse writes until reconciled + --- + duration_ms: 118.007805 + type: 'test' + ... +# Subtest: within-role sends cite an open gated launch decision without spending it or naming it in grants +ok 475 - within-role sends cite an open gated launch decision without spending it or naming it in grants + --- + duration_ms: 55.844683 + type: 'test' + ... +# Subtest: missing and foreign-business citations refuse and roll back message and grant +ok 476 - missing and foreign-business citations refuse and roll back message and grant + --- + duration_ms: 47.122575 + type: 'test' + ... +# Subtest: cross-role sends still need a matching resolved decision and consume it once +ok 477 - cross-role sends still need a matching resolved decision and consume it once + --- + duration_ms: 53.779256 + type: 'test' + ... +# Subtest: trail on a hidden message id answers exactly as on an unknown id, for the owner, a reader and the tester +ok 478 - trail on a hidden message id answers exactly as on an unknown id, for the owner, a reader and the tester + --- + duration_ms: 61.999153 + type: 'test' + ... +# Subtest: replies on a hidden message id answers exactly as on an unknown id, for the owner, a reader and the tester +ok 479 - replies on a hidden message id answers exactly as on an unknown id, for the owner, a reader and the tester + --- + duration_ms: 63.712076 + type: 'test' + ... +# Subtest: trail on a decision keeps the decision and drops the user thread messages, their deliveries and their events +ok 480 - trail on a decision keeps the decision and drops the user thread messages, their deliveries and their events + --- + duration_ms: 63.804803 + type: 'test' + ... +# Subtest: replies leaves out other users thread messages and still fills a page +ok 481 - replies leaves out other users thread messages and still fills a page + --- + duration_ms: 389.390937 + type: 'test' + ... +# Subtest: messages in the business human and tester threads are not hidden (row 177 unchanged) +ok 482 - messages in the business human and tester threads are not hidden (row 177 unchanged) + --- + duration_ms: 77.009696 + type: 'test' + ... +# Subtest: governance pin: the owner sees decisions, inbox entries, claims, tasks and project files, but not the user messages +ok 483 - governance pin: the owner sees decisions, inbox entries, claims, tasks and project files, but not the user messages + --- + duration_ms: 202.110239 + type: 'test' + ... +# Subtest: messages pages all human messages newest first without writes; read state is history +ok 484 - messages pages all human messages newest first without writes; read state is history + --- + duration_ms: 611.946186 + type: 'test' + ... +# Subtest: messages refuses role callers, invalid paging and cursors outside this human feed +ok 485 - messages refuses role callers, invalid paging and cursors outside this human feed + --- + duration_ms: 62.945746 + type: 'test' + ... +# Subtest: views messages passes only its paging arguments through +ok 486 - views messages passes only its paging arguments through + --- + duration_ms: 0.606347 + type: 'test' + ... +# Subtest: messages isolates businesses even with a valid foreign cursor +ok 487 - messages isolates businesses even with a valid foreign cursor + --- + duration_ms: 51.123952 + type: 'test' + ... +# Subtest: the assistant sends to the user and to the chief of staff only +ok 488 - the assistant sends to the user and to the chief of staff only + --- + duration_ms: 77.309261 + type: 'test' + ... +# Subtest: an assistant send to any other role, or to the tester, is refused and logged +ok 489 - an assistant send to any other role, or to the tester, is refused and logged + --- + duration_ms: 75.303178 + type: 'test' + ... +# Subtest: only the user and the chief of staff may send to the assistant; the tester is refused by default +ok 490 - only the user and the chief of staff may send to the assistant; the tester is refused by default + --- + duration_ms: 74.313978 + type: 'test' + ... +# Subtest: REQ-ASSIST-2 REQ-THREAD-1 thread.send to an instance that does not hear from the user is refused and stores nothing +ok 491 - REQ-ASSIST-2 REQ-THREAD-1 thread.send to an instance that does not hear from the user is refused and stores nothing + --- + duration_ms: 49.054939 + type: 'test' + ... +# Subtest: a sender-side list alone refuses a send to a role that has no list +ok 492 - a sender-side list alone refuses a send to a role that has no list + --- + duration_ms: 61.052863 + type: 'test' + ... +# Subtest: a target-side list alone refuses a send from a role that has no list +ok 493 - a target-side list alone refuses a send from a role that has no list + --- + duration_ms: 58.117907 + type: 'test' + ... +# Subtest: the sender list is checked before the target list +ok 494 - the sender list is checked before the target list + --- + duration_ms: 55.226943 + type: 'test' + ... +# Subtest: roles without the field behave exactly as before +ok 495 - roles without the field behave exactly as before + --- + duration_ms: 77.138491 + type: 'test' + ... +# Subtest: a business with no role definitions at all is unlimited +ok 496 - a business with no role definitions at all is unlimited + --- + duration_ms: 63.737605 + type: 'test' + ... +# Subtest: a malformed messaging field refuses at boot +ok 497 - a malformed messaging field refuses at boot + --- + duration_ms: 24.412058 + type: 'test' + ... +# Subtest: the assistant's review.request to a reviewer is refused and logged, even with an approved decision +ok 498 - the assistant's review.request to a reviewer is refused and logged, even with an approved decision + --- + duration_ms: 89.531241 + type: 'test' + ... +# Subtest: a review.verdict to the assistant from a role outside its receiveFrom is refused and logged +ok 499 - a review.verdict to the assistant from a role outside its receiveFrom is refused and logged + --- + duration_ms: 98.426029 + type: 'test' + ... +# Subtest: review requests and verdicts between roles without the field are unchanged +ok 500 - review requests and verdicts between roles without the field are unchanged + --- + duration_ms: 56.007432 + type: 'test' + ... +# Subtest: 3f copy migrates to 3g preserving every old column/row, with an empty instance_names and null to_name +ok 501 - 3f copy migrates to 3g preserving every old column/row, with an empty instance_names and null to_name + --- + duration_ms: 201.26117 + type: 'test' + ... +# Subtest: REQ-MSG-2: the chief of staff names an instance under its within-role grant, and the write is logged +ok 502 - REQ-MSG-2: the chief of staff names an instance under its within-role grant, and the write is logged + --- + duration_ms: 52.844822 + type: 'test' + ... +# Subtest: REQ-MSG-2: the human names an instance through the CLI +ok 503 - REQ-MSG-2: the human names an instance through the CLI + --- + duration_ms: 37.114228 + type: 'test' + ... +# Subtest: REQ-MSG-2: a role without the grant, or holding it cross-role, is refused not-authorized +ok 504 - REQ-MSG-2: a role without the grant, or holding it cross-role, is refused not-authorized + --- + duration_ms: 44.625598 + type: 'test' + ... +# Subtest: REQ-MSG-2: a name is unique in the business and is never an instance key or a role name +ok 505 - REQ-MSG-2: a name is unique in the business and is never an instance key or a role name + --- + duration_ms: 68.79088 + type: 'test' + ... +# Subtest: REQ-MSG-2: a send by name reaches the instance and records both; a send by instance key is unchanged +ok 506 - REQ-MSG-2: a send by name reaches the instance and records both; a send by instance key is unchanged + --- + duration_ms: 57.160635 + type: 'test' + ... +# Subtest: REQ-MSG-2: an instance key beats a name that equals it, as when a later instance takes the key +ok 507 - REQ-MSG-2: an instance key beats a name that equals it, as when a later instance takes the key + --- + duration_ms: 37.579776 + type: 'test' + ... +# Subtest: REQ-MSG-2: a role name beats a name that equals it, as when a later definition takes the word (sage-0590) +ok 508 - REQ-MSG-2: a role name beats a name that equals it, as when a later definition takes the word (sage-0590) + --- + duration_ms: 42.581001 + type: 'test' + ... +# Subtest: proof receives actual peer, cap traffic never invokes helper and transient cap disconnects +ok 509 - proof receives actual peer, cap traffic never invokes helper and transient cap disconnects + --- + duration_ms: 11.034422 + type: 'test' + ... +# Subtest: proof helper error and disconnect during verification never dispatch or bind +ok 510 - proof helper error and disconnect during verification never dispatch or bind + --- + duration_ms: 2.470545 + type: 'test' + ... +# Subtest: Client receives explicit proof refusal codes without dispatch, not outcome-unknown +ok 511 - Client receives explicit proof refusal codes without dispatch, not outcome-unknown + --- + duration_ms: 76.30573 + type: 'test' + ... +# Subtest: asynchronous proof calls release their transient session on success, failure and timeout +ok 512 - asynchronous proof calls release their transient session on success, failure and timeout + --- + duration_ms: 30.39862 + type: 'test' + ... +# Subtest: T2 eight proof callers and a racing copier bind the exact accepted socket, which survives helper exit +ok 513 - T2 eight proof callers and a racing copier bind the exact accepted socket, which survives helper exit + --- + duration_ms: 402.693401 + type: 'test' + ... +# Subtest: helper output and failures fail closed including unsafe gid +ok 514 - helper output and failures fail closed including unsafe gid + --- + duration_ms: 3.081728 + type: 'test' + ... +# Subtest: helper timeout, capacity and shutdown refuse without leaving children +ok 515 - helper timeout, capacity and shutdown refuse without leaving children + --- + duration_ms: 27.04299 + type: 'test' + ... +# Subtest: missing or non-regular peer helper refuses at construction before opening the bus +ok 516 - missing or non-regular peer helper refuses at construction before opening the bus + --- + duration_ms: 0.521296 + type: 'test' + ... +# Subtest: shutdown waits for killed helper close before returning +ok 517 - shutdown waits for killed helper close before returning + --- + duration_ms: 5.867376 + type: 'test' + ... +# organization: {"event":"reload-needs-restart","business":"demo"} +# organization: {"event":"reload-needs-restart","business":"demo"} +# organization: {"event":"reload-needs-restart","business":"demo"} +# organization: {"event":"reload-needs-restart","business":"demo"} +# Subtest: plugins and plugins.set refuse every non-human session and a forged actor, and pass only the patch with the verified actor +ok 518 - plugins and plugins.set refuse every non-human session and a forged actor, and pass only the patch with the verified actor + --- + duration_ms: 41.800562 + type: 'test' + ... +# Subtest: runtime: the switch changes the organization file, the receipt carries the actor, and a bad shape, an unknown module and a stale revision are refused with nothing written +ok 519 - runtime: the switch changes the organization file, the receipt carries the actor, and a bad shape, an unknown module and a stale revision are refused with nothing written + --- + duration_ms: 204.441012 + type: 'test' + ... +# Subtest: vikunja:19/309 through the broker, a patch switches the kinds it names and keeps the rest; null removes one kind and is trailed +ok 520 - vikunja:19/309 through the broker, a patch switches the kinds it names and keeps the rest; null removes one kind and is trailed + --- + duration_ms: 131.993237 + type: 'test' + ... +# Subtest: principal binds kernel peer PID and uid, maps owner, and never takes identity or role from body +ok 521 - principal binds kernel peer PID and uid, maps owner, and never takes identity or role from body + --- + duration_ms: 2.675322 + type: 'test' + ... +# Subtest: user requires its own nonce and full walk plus immediate same-tree Console parent +ok 522 - user requires its own nonce and full walk plus immediate same-tree Console parent + --- + duration_ms: 0.881982 + type: 'test' + ... +# Subtest: tester deliberately admits agent parents but rejects managed runs and another nonce +ok 523 - tester deliberately admits agent parents but rejects managed runs and another nonce + --- + duration_ms: 0.547364 + type: 'test' + ... +# Subtest: human leaf identity is reread after walking the parents +ok 524 - human leaf identity is reread after walking the parents + --- + duration_ms: 0.305214 + type: 'test' + ... +# Subtest: broker process binds trusted launches, offers reader capabilities, refuses human mutation, closes cleanly +ok 525 - broker process binds trusted launches, offers reader capabilities, refuses human mutation, closes cleanly + --- + duration_ms: 322.781071 + type: 'test' + ... +# Subtest: startup token refusal returns safe code without value or partial listening broker +ok 526 - startup token refusal returns safe code without value or partial listening broker + --- + duration_ms: 207.988061 + type: 'test' + ... +# Subtest: loaded fixture token is absent from socket replies and SQLite, including refusal evidence +ok 527 - loaded fixture token is absent from socket replies and SQLite, including refusal evidence + --- + duration_ms: 242.548303 + type: 'test' + ... +# Subtest: killed broker leaves an explicit stale lock; another process cannot silently reclaim it +ok 528 - killed broker leaves an explicit stale lock; another process cannot silently reclaim it + --- + duration_ms: 361.815743 + type: 'test' + ... +# Subtest: trusted host registers later launches; socket clients never have a registration verb +ok 529 - trusted host registers later launches; socket clients never have a registration verb + --- + duration_ms: 252.160905 + type: 'test' + ... +# Subtest: REQ-LIMIT-4 the broker process answers the launcher's mayLaunch op with the limits' awaited decision +ok 530 - REQ-LIMIT-4 the broker process answers the launcher's mayLaunch op with the limits' awaited decision + --- + duration_ms: 250.403994 + type: 'test' + ... +# Subtest: runtime excludes declared project roots even when host supplies no repoRoots +ok 531 - runtime excludes declared project roots even when host supplies no repoRoots + --- + duration_ms: 188.31213 + type: 'test' + ... +# Subtest: a refused launch binding leaves the broker and existing capabilities alive; bad protocol stops it +ok 532 - a refused launch binding leaves the broker and existing capabilities alive; bad protocol stops it + --- + duration_ms: 239.308062 + type: 'test' + ... +# Subtest: real runtime injects the coordinator, stops its workload and mirrors stable stop events across restart +ok 533 - real runtime injects the coordinator, stops its workload and mirrors stable stop events across restart + --- + duration_ms: 306.946485 + type: 'test' + ... +# Subtest: invalid state still starts the control bus and human halt then resume repairs it +ok 534 - invalid state still starts the control bus and human halt then resume repairs it + --- + duration_ms: 117.461906 + type: 'test' + ... +# Subtest: processing halt and resume extend only the socket timeout while ordinary status retains the explicit timeout +ok 535 - processing halt and resume extend only the socket timeout while ordinary status retains the explicit timeout + --- + duration_ms: 192.441476 + type: 'test' + ... +# Subtest: a root halt aborts the active search-source signal before the normal web deadline +ok 536 - a root halt aborts the active search-source signal before the normal web deadline + --- + duration_ms: 37.853267 + type: 'test' + ... +# Subtest: processing.halt refuses agent reader and tester before any transition +ok 537 - processing.halt refuses agent reader and tester before any transition + --- + duration_ms: 38.767981 + type: 'test' + ... +# Subtest: processing.resume refuses agent reader and tester before any transition +ok 538 - processing.resume refuses agent reader and tester before any transition + --- + duration_ms: 27.032868 + type: 'test' + ... +# Subtest: human halt and clear each have one event with verified actor; launch.restore cannot clear +ok 539 - human halt and clear each have one event with verified actor; launch.restore cannot clear + --- + duration_ms: 38.132944 + type: 'test' + ... +# Subtest: all ordinary work verbs refuse before dispatch while pure reads remain available +ok 540 - all ordinary work verbs refuse before dispatch while pure reads remain available + --- + duration_ms: 59.830454 + type: 'test' + ... +# Subtest: task web authorization and bind paths refuse before external work +ok 541 - task web authorization and bind paths refuse before external work + --- + duration_ms: 32.615257 + type: 'test' + ... +# Subtest: recordEvent cannot forge processing.halt +ok 542 - recordEvent cannot forge processing.halt + --- + duration_ms: 25.234716 + type: 'test' + ... +# Subtest: recordEvent cannot forge processing.resume +ok 543 - recordEvent cannot forge processing.resume + --- + duration_ms: 24.236639 + type: 'test' + ... +# Subtest: recordEvent cannot forge processing.stop +ok 544 - recordEvent cannot forge processing.stop + --- + duration_ms: 24.455702 + type: 'test' + ... +# Subtest: recordTask poll cannot forge a processing action through its kinds filter +ok 545 - recordTask poll cannot forge a processing action through its kinds filter + --- + duration_ms: 24.363874 + type: 'test' + ... +# Subtest: recordTask self cannot forge a processing action through its kinds filter +ok 546 - recordTask self cannot forge a processing action through its kinds filter + --- + duration_ms: 24.19174 + type: 'test' + ... +# Subtest: spec read remains a read but cannot release new write work after an await +ok 547 - spec read remains a read but cannot release new write work after an await + --- + duration_ms: 30.574999 + type: 'test' + ... +# Subtest: the real socket awaits halt and resume beyond the ordinary idle deadline +ok 548 - the real socket awaits halt and resume beyond the ordinary idle deadline + --- + duration_ms: 75.47607 + type: 'test' + ... +# Subtest: a malformed processing reader never silently admits agent work +ok 549 - a malformed processing reader never silently admits agent work + --- + duration_ms: 30.215931 + type: 'test' + ... +# Subtest: halt refuses the newly landed host executor path before credentials or effects +ok 550 - halt refuses the newly landed host executor path before credentials or effects + --- + duration_ms: 28.076605 + type: 'test' + ... +# Subtest: D1: committed write with a failed receipt refuses outcome-unknown without action.allowed +ok 551 - D1: committed write with a failed receipt refuses outcome-unknown without action.allowed + --- + duration_ms: 37.55273 + type: 'test' + ... +# Subtest: D2: spec.read refuses without content if its role is released during the read +ok 552 - D2: spec.read refuses without content if its role is released during the read + --- + duration_ms: 25.943862 + type: 'test' + ... +# Subtest: D3: spec.read secret check refuses flagged content without content +ok 553 - D3: spec.read secret check refuses flagged content without content + --- + duration_ms: 27.932987 + type: 'test' + ... +# Subtest: D3: spec.read secret check refuses flagged subject without content +ok 554 - D3: spec.read secret check refuses flagged subject without content + --- + duration_ms: 25.560851 + type: 'test' + ... +# Subtest: a human lists, opens and saves; the save is one commit by the business human +ok 555 - a human lists, opens and saves; the save is one commit by the business human + --- + duration_ms: 209.741458 + type: 'test' + ... +# Subtest: an agent and a reader refuse every file verb and nothing is written +ok 556 - an agent and a reader refuse every file verb and nothing is written + --- + duration_ms: 82.359057 + type: 'test' + ... +# Subtest: a stale base refuses stale-base and writes nothing +ok 557 - a stale base refuses stale-base and writes nothing + --- + duration_ms: 130.872326 + type: 'test' + ... +# Subtest: paths outside the spec and docs refuse, as do unknown projects, missing files and odd arguments +ok 558 - paths outside the spec and docs refuse, as do unknown projects, missing files and odd arguments + --- + duration_ms: 106.523581 + type: 'test' + ... +# Subtest: without a project adapter the file verbs refuse project-not-configured +ok 559 - without a project adapter the file verbs refuse project-not-configured + --- + duration_ms: 50.928313 + type: 'test' + ... +# Subtest: on the socket a save may carry 1 MiB of text; every other request keeps the 64 KiB limit +ok 560 - on the socket a save may carry 1 MiB of text; every other request keeps the 64 KiB limit + --- + duration_ms: 441.263517 + type: 'test' + ... +# Subtest: a request that names the save verb first and another verb last is refused at 64 KiB +ok 561 - a request that names the save verb first and another verb last is refused at 64 KiB + --- + duration_ms: 120.863119 + type: 'test' + ... +# Subtest: two saves racing for one repository make one commit +ok 562 - two saves racing for one repository make one commit + --- + duration_ms: 263.344817 + type: 'test' + ... +# Subtest: Broker keeps the sandbox client import closure: only the listed imports, no lazy project import +not ok 563 - Broker keeps the sandbox client import closure: only the listed imports, no lazy project import + --- + duration_ms: 4.080313 + type: 'test' + location: '/mnt/storage/scratch/rocko-r219/packages/bus/tests/project-runtime.test.mjs:12:1' + failureType: 'testCodeFailure' + error: |- + Expected values to be strictly deep-equal: + + actual - expected + + [ + "import { randomUUID, randomBytes, createHash } from 'node:crypto';", + "import { isAbsolute, dirname } from 'node:path';", + "import { initializeControl, processingStatus } from '../../processing-control/src/state.mjs';", + "import { NAME as HARNESS_NAME } from '../../plugins/src/kinds.mjs';", + "import { loadRequirements } from '../../tasks/src/requirements.mjs';", + "import { MERGE, LandingRefusal, readLanding } from './landing.mjs';", + + "import { ID_PATTERN, THREAD_DEFINITIONS, END_PROTECTED, forkProblem, forkUrl, credentialKind, validArgv, commandAllowed, HOST_ID, CREATIVE_DEFINITIONS, unhireableAction, giteaName, parseGiteaUrl, covers } from '../../business/src/vocabulary.mjs';" + - "import { ID_PATTERN, THREAD_DEFINITION, END_PROTECTED, forkProblem, forkUrl, credentialKind, validArgv, commandAllowed, HOST_ID, CREATIVE_DEFINITIONS, unhireableAction, giteaName, parseGiteaUrl, covers } from '../../business/src/vocabulary.mjs';" + ] + + code: 'ERR_ASSERTION' + name: 'AssertionError' + expected: + 0: "import { randomUUID, randomBytes, createHash } from 'node:crypto';" + 1: "import { isAbsolute, dirname } from 'node:path';" + 2: "import { initializeControl, processingStatus } from '../../processing-control/src/state.mjs';" + 3: "import { NAME as HARNESS_NAME } from '../../plugins/src/kinds.mjs';" + 4: "import { loadRequirements } from '../../tasks/src/requirements.mjs';" + 5: "import { MERGE, LandingRefusal, readLanding } from './landing.mjs';" + 6: "import { ID_PATTERN, THREAD_DEFINITION, END_PROTECTED, forkProblem, forkUrl, credentialKind, validArgv, commandAllowed, HOST_ID, CREATIVE_DEFINITIONS, unhireableAction, giteaName, parseGiteaUrl, covers } from '../../business/src/vocabulary.mjs';" + actual: + 0: "import { randomUUID, randomBytes, createHash } from 'node:crypto';" + 1: "import { isAbsolute, dirname } from 'node:path';" + 2: "import { initializeControl, processingStatus } from '../../processing-control/src/state.mjs';" + 3: "import { NAME as HARNESS_NAME } from '../../plugins/src/kinds.mjs';" + 4: "import { loadRequirements } from '../../tasks/src/requirements.mjs';" + 5: "import { MERGE, LandingRefusal, readLanding } from './landing.mjs';" + 6: "import { ID_PATTERN, THREAD_DEFINITIONS, END_PROTECTED, forkProblem, forkUrl, credentialKind, validArgv, commandAllowed, HOST_ID, CREATIVE_DEFINITIONS, unhireableAction, giteaName, parseGiteaUrl, covers } from '../../business/src/vocabulary.mjs';" + operator: 'deepStrictEqual' + stack: |- + TestContext. (file:///mnt/storage/scratch/rocko-r219/packages/bus/tests/project-runtime.test.mjs:14:10) + Test.runInAsyncScope (node:async_hooks:226:14) + Test.run (node:internal/test_runner/test:1402:25) + Test.start (node:internal/test_runner/test:1262:17) + startSubtestAfterBootstrap (node:internal/test_runner/harness:387:17) + ... +# Subtest: without a trusted project adapter all three async paths refuse project-not-configured +ok 564 - without a trusted project adapter all three async paths refuse project-not-configured + --- + duration_ms: 76.940584 + type: 'test' + ... +# Subtest: real startBroker injects the project adapter for socket reads and bound-author record writes +ok 565 - real startBroker injects the project adapter for socket reads and bound-author record writes + --- + duration_ms: 333.499241 + type: 'test' + ... +# Subtest: a raise with no recorded push refuses no-push; a raise binds the latest push and shows it +ok 566 - a raise with no recorded push refuses no-push; a raise binds the latest push and shows it + --- + duration_ms: 53.22392 + type: 'test' + ... +# Subtest: happy path: the fork is the upstream repo under the agent's own user, the destination is host-built +ok 567 - happy path: the fork is the upstream repo under the agent's own user, the destination is host-built + --- + duration_ms: 51.099976 + type: 'test' + ... +# Subtest: a hard wait: no decision refuses, and a decision for another task refuses +ok 568 - a hard wait: no decision refuses, and a decision for another task refuses + --- + duration_ms: 47.707699 + type: 'test' + ... +# Subtest: r4 B4: approve while the latest push is A, push B, publish refuses decision-mismatch +ok 569 - r4 B4: approve while the latest push is A, push B, publish refuses decision-mismatch + --- + duration_ms: 86.782775 + type: 'test' + ... +# Subtest: grant and fork refusals +ok 570 - grant and fork refusals + --- + duration_ms: 89.391227 + type: 'test' + ... +# Subtest: remote-not-fork, compared without case, and remote-host-mismatch, at push +ok 571 - remote-not-fork, compared without case, and remote-host-mismatch, at push + --- + duration_ms: 157.046312 + type: 'test' + ... +# Subtest: two agents granted one project each get their own fork +ok 572 - two agents granted one project each get their own fork + --- + duration_ms: 82.506681 + type: 'test' + ... +# Subtest: the request cannot name the fork, the user or the destination +ok 573 - the request cannot name the fork, the user or the destination + --- + duration_ms: 38.57176 + type: 'test' + ... +# Subtest: one decision, one open publish: a second ticket refuses publish-busy, whatever its branch +ok 574 - one decision, one open publish: a second ticket refuses publish-busy, whatever its branch + --- + duration_ms: 94.708945 + type: 'test' + ... +# Subtest: publishRefused files the code on the task's trail and drops the ticket +ok 575 - publishRefused files the code on the task's trail and drops the ticket + --- + duration_ms: 39.39562 + type: 'test' + ... +# Subtest: git.push.remote is in neither ROUTED list and no shipped role grants it +ok 576 - git.push.remote is in neither ROUTED list and no shipped role grants it + --- + duration_ms: 0.939627 + type: 'test' + ... +# Subtest: runtime: withGitea keys from the open ticket only, and the store root is the organization dir +ok 577 - runtime: withGitea keys from the open ticket only, and the store root is the organization dir + --- + duration_ms: 196.09845 + type: 'test' + ... +# Subtest: the bus process answers the publish ops from their own lines, not launch-op-refused +ok 578 - the bus process answers the publish ops from their own lines, not launch-op-refused + --- + duration_ms: 257.115298 + type: 'test' + ... +# organization: {"event":"reload-needs-restart","business":"demo"} +# organization: {"event":"reload-needs-restart","business":"demo"} +# Subtest: T14 a create goes live with no restart: the new instance binds at once and the answer says restart false +ok 579 - T14 a create goes live with no restart: the new instance binds at once and the answer says restart false + --- + duration_ms: 116.407615 + type: 'test' + ... +# organization: {"event":"reload-needs-restart","business":"demo"} +# organization: {"event":"reload-needs-restart","business":"demo"} +# organization: {"event":"reload-needs-restart","business":"demo"} +# organization: {"event":"reload-needs-restart","business":"demo"} +# organization: {"event":"reload-needs-restart","business":"demo"} +# organization: {"event":"reload-needs-restart","business":"demo"} +# Subtest: T14 every committed verb reloads once, limits.set, routes.set, plugins.set and veto.set included, and a refused one does not +ok 580 - T14 every committed verb reloads once, limits.set, routes.set, plugins.set and veto.set included, and a refused one does not + --- + duration_ms: 154.505732 + type: 'test' + ... +# Subtest: T14 a definition change on a running instance refuses instance-running; a vars change still goes live +ok 581 - T14 a definition change on a running instance refuses instance-running; a vars change still goes live + --- + duration_ms: 113.188191 + type: 'test' + ... +# Subtest: T14 a file whose credential references differ from the boot copy is not reloaded and the write answers restart true +ok 582 - T14 a file whose credential references differ from the boot copy is not reloaded and the write answers restart true + --- + duration_ms: 81.44087 + type: 'test' + ... +# Subtest: T14 a date-only change to a credential reference still reloads: row 199 issue rewrites the date outside the reload +ok 583 - T14 a date-only change to a credential reference still reloads: row 199 issue rewrites the date outside the reload + --- + duration_ms: 84.757337 + type: 'test' + ... +# Subtest: T19 a credentialed create answers restart true; issue works only after a restart, and a later vars change goes live +ok 584 - T19 a credentialed create answers restart true; issue works only after a restart, and a later vars change goes live + --- + duration_ms: 201.791617 + type: 'test' + ... +# Subtest: T14 after a refused reload veto.set, instance.hire and instance.fire answer restart true, and a fire of a name kept since refuses before step A +ok 585 - T14 after a refused reload veto.set, instance.hire and instance.fire answer restart true, and a fire of a name kept since refuses before step A + --- + duration_ms: 221.843859 + type: 'test' + ... +# Subtest: T14 a file whose project root differs from the boot copy is not reloaded, because the Credentials store protects the boot roots +ok 586 - T14 a file whose project root differs from the boot copy is not reloaded, because the Credentials store protects the boot roots + --- + duration_ms: 83.685906 + type: 'test' + ... +# organization: {"event":"reload-needs-restart","business":"demo"} +# Subtest: T14 a file whose library mapping differs from the boot copy is not reloaded, because the mirror is ensured at start +ok 587 - T14 a file whose library mapping differs from the boot copy is not reloaded, because the mirror is ensured at start + --- + duration_ms: 356.898179 + type: 'test' + ... +# Subtest: T14 reloadBusiness refuses an unknown business, a changed human and a document the boot check refuses +ok 588 - T14 reloadBusiness refuses an unknown business, a changed human and a document the boot check refuses + --- + duration_ms: 25.021163 + type: 'test' + ... +# Subtest: a reply is listed for human and reader sessions, and its delivery rows are unchanged +ok 589 - a reply is listed for human and reader sessions, and its delivery rows are unchanged + --- + duration_ms: 63.99958 + type: 'test' + ... +# Subtest: the reply still reaches the human message.receive (mosaic talk) after the Console showed it +ok 590 - the reply still reaches the human message.receive (mosaic talk) after the Console showed it + --- + duration_ms: 35.205014 + type: 'test' + ... +# Subtest: a message with no reply gives an empty list +ok 591 - a message with no reply gives an empty list + --- + duration_ms: 29.096513 + type: 'test' + ... +# Subtest: replies come oldest first and stop at REPLIES +ok 592 - replies come oldest first and stop at REPLIES + --- + duration_ms: 139.813274 + type: 'test' + ... +# Subtest: an id that names no message in the business refuses message-not-found, and the refusal is recorded +ok 593 - an id that names no message in the business refuses message-not-found, and the refusal is recorded + --- + duration_ms: 49.147439 + type: 'test' + ... +# Subtest: strict arguments; a role session gets human-required +ok 594 - strict arguments; a role session gets human-required + --- + duration_ms: 65.589118 + type: 'test' + ... +# Subtest: views passes replies through as one call with the id +ok 595 - views passes replies through as one call with the id + --- + duration_ms: 0.359601 + type: 'test' + ... +# Subtest: requirements returns the committed list to a holding role session, and no one else +ok 596 - requirements returns the committed list to a holding role session, and no one else + --- + duration_ms: 46.61546 + type: 'test' + ... +# Subtest: the PM's prd.approve with no task, when no id fits, reaches the human's Inbox +ok 597 - the PM's prd.approve with no task, when no id fits, reaches the human's Inbox + --- + duration_ms: 29.189824 + type: 'test' + ... +# Subtest: the PM's non-blocking role.revoke with no task reaches the human's Inbox +ok 598 - the PM's non-blocking role.revoke with no task reaches the human's Inbox + --- + duration_ms: 30.808668 + type: 'test' + ... +# Subtest: a push is recorded as the action.allowed for git.push.working on the task, and only the host records one +ok 599 - a push is recorded as the action.allowed for git.push.working on the task, and only the host records one + --- + duration_ms: 50.580202 + type: 'test' + ... +# Subtest: review.request names the latest pushed commit and sends the reviewer a REVIEW-REQUEST +ok 600 - review.request names the latest pushed commit and sends the reviewer a REVIEW-REQUEST + --- + duration_ms: 41.512164 + type: 'test' + ... +# Subtest: review.request says which run holds the reviewer role, or null, and a null request waits for a claim +ok 601 - review.request says which run holds the reviewer role, or null, and a null request waits for a claim + --- + duration_ms: 48.861782 + type: 'test' + ... +# Subtest: review.request refuses a commit that isn't the latest push, a non-reviewer and a role without the action +ok 602 - review.request refuses a commit that isn't the latest push, a non-reviewer and a role without the action + --- + duration_ms: 65.183802 + type: 'test' + ... +# Subtest: reviewFetch answers only the addressed reviewer, for the request it cites +ok 603 - reviewFetch answers only the addressed reviewer, for the request it cites + --- + duration_ms: 40.68475 + type: 'test' + ... +# Subtest: review.verdict answers one request once, to the role that asked +ok 604 - review.verdict answers one request once, to the role that asked + --- + duration_ms: 56.903995 + type: 'test' + ... +# Subtest: task.close on a pushed task needs an approve verdict for the latest push +ok 605 - task.close on a pushed task needs an approve verdict for the latest push + --- + duration_ms: 66.113969 + type: 'test' + ... +# Subtest: a refusal the host decided is filed on the task it names, and only a task ref counts +ok 606 - a refusal the host decided is filed on the task it names, and only a task ref counts + --- + duration_ms: 46.768635 + type: 'test' + ... +# organization: {"event":"reload-needs-restart","business":"demo"} +# Subtest: row 65: routes and routes.set refuse every non-human session, the chief of staff included, the tester may read and set, and each passes the verified actor +ok 607 - row 65: routes and routes.set refuse every non-human session, the chief of staff included, the tester may read and set, and each passes the verified actor + --- + duration_ms: 62.410088 + type: 'test' + ... +# Subtest: row 65: a new launch binds only on a switched-on harness with a module name, and a run an earlier broker bound binds again after its harness is switched off +ok 608 - row 65: a new launch binds only on a switched-on harness with a module name, and a run an earlier broker bound binds again after its harness is switched off + --- + duration_ms: 41.888284 + type: 'test' + ... +# Subtest: row 65 runtime: harnessLevels answers each module in the tree, and null for a name with no module +ok 609 - row 65 runtime: harnessLevels answers each module in the tree, and null for a name with no module + --- + duration_ms: 60.42799 + type: 'test' + ... +# Subtest: row 65 runtime: routes and routes.set reach the organization file with the human as actor, a new bind reads plugins.harness, and each refusal keeps the bytes and logs nothing +ok 610 - row 65 runtime: routes and routes.set reach the organization file with the human as actor, a new bind reads plugins.harness, and each refusal keeps the bytes and logs nothing + --- + duration_ms: 162.699802 + type: 'test' + ... +# Subtest: v3b prototype refusals, views and append-only mutations +ok 611 - v3b prototype refusals, views and append-only mutations + --- + duration_ms: 157.263043 + type: 'test' + ... +# Subtest: T4 D7: a clear of a held default session fences it, drains at the next receive, retires at the exit proof and moves the default +ok 612 - T4 D7: a clear of a held default session fences it, drains at the next receive, retires at the exit proof and moves the default + --- + duration_ms: 78.447482 + type: 'test' + ... +# Subtest: T4 D7: an unheld session drains at accept, its proof is run null, and a non-default clear leaves the default +ok 613 - T4 D7: an unheld session drains at accept, its proof is run null, and a non-default clear leaves the default + --- + duration_ms: 33.195266 + type: 'test' + ... +# Subtest: T4 D7: a run that ends before its next receive drains at its end, with its generation +ok 614 - T4 D7: a run that ends before its next receive drains at its end, with its generation + --- + duration_ms: 34.368556 + type: 'test' + ... +# Subtest: T4 D7: a run whose turn is running (delivered, unread) stays clearing; uncertain is recorded once and nothing more +ok 615 - T4 D7: a run whose turn is running (delivered, unread) stays clearing; uncertain is recorded once and nothing more + --- + duration_ms: 53.960434 + type: 'test' + ... +# Subtest: T4 D7 B1: undelivered inputs are cancelled with receipts at accept, never delivered to the successor, and a routed reply is cancelled at arrival +ok 616 - T4 D7 B1: undelivered inputs are cancelled with receipts at accept, never delivered to the successor, and a routed reply is cancelled at arrival + --- + duration_ms: 78.769752 + type: 'test' + ... +# Subtest: T4 D7: repeat, conflict, a second op, a stale revision, confirm and a halt +ok 617 - T4 D7: repeat, conflict, a second op, a stale revision, confirm and a halt + --- + duration_ms: 64.932361 + type: 'test' + ... +# Subtest: T4 Q4: the successor takes -N, the next N free, and a bound name stays taken +ok 618 - T4 Q4: the successor takes -N, the next N free, and a bound name stays taken + --- + duration_ms: 50.162395 + type: 'test' + ... +# Subtest: T4 D8: the successor start is held, refused or started, each report on its own counter +ok 619 - T4 D8: the successor start is held, refused or started, each report on its own counter + --- + duration_ms: 48.463143 + type: 'test' + ... +# Subtest: T4 D7 N4: a halt at retirement waits and writes nothing; retirement goes once processing resumes +ok 620 - T4 D7 N4: a halt at retirement waits and writes nothing; retirement goes once processing resumes + --- + duration_ms: 37.880314 + type: 'test' + ... +# Subtest: T4 sage-2828: a cancel before retirement makes the session active again, keeps the claim and the cancelled messages, and never makes the successor +ok 621 - T4 sage-2828: a cancel before retirement makes the session active again, keeps the claim and the cancelled messages, and never makes the successor + --- + duration_ms: 55.915125 + type: 'test' + ... +# Subtest: T4 sage-2828 sage-2830: a cancel after retirement ends the startup only, and a later thread-only send makes the successor pending as new input +ok 622 - T4 sage-2828 sage-2830: a cancel after retirement ends the startup only, and a later thread-only send makes the successor pending as new input + --- + duration_ms: 42.62368 + type: 'test' + ... +# Subtest: T4 N4: a user's thread whose grant is gone by retirement ends the clear failed, writes no successor, and leaves the session as it was +ok 623 - T4 N4: a user's thread whose grant is gone by retirement ends the clear failed, writes no successor, and leaves the session as it was + --- + duration_ms: 44.390716 + type: 'test' + ... +# Subtest: T4 N4: a user's thread whose grant is live at retirement retires the session and makes its successor +ok 624 - T4 N4: a user's thread whose grant is live at retirement retires the session and makes its successor + --- + duration_ms: 45.967719 + type: 'test' + ... +# Subtest: T4 sage-2828: a cancel after the successor started refuses session-clear-complete +ok 625 - T4 sage-2828: a cancel after the successor started refuses session-clear-complete + --- + duration_ms: 41.344248 + type: 'test' + ... +# Subtest: T4 B2: a run bound to a clearing session refuses its claim, and claims again once the clear is cancelled +ok 626 - T4 B2: a run bound to a clearing session refuses its claim, and claims again once the clear is cancelled + --- + duration_ms: 41.662392 + type: 'test' + ... +# Subtest: T4 mos-1325: the tester clears its own thread; its clear, cancel and operation on a human-owned thread refuse thread-not-owned and write nothing +ok 627 - T4 mos-1325: the tester clears its own thread; its clear, cancel and operation on a human-owned thread refuse thread-not-owned and write nothing + --- + duration_ms: 55.045152 + type: 'test' + ... +# Subtest: T4 schema: session_ops and message_cancels are append-only, and a second open clear of a session is refused below the broker +ok 628 - T4 schema: session_ops and message_cancels are append-only, and a second open clear of a session is refused below the broker + --- + duration_ms: 33.104602 + type: 'test' + ... +# Subtest: T4 schema: a 3m store migrates to 3n, session_ops and message_cancels are new and empty, and every other row stays as it was +ok 629 - T4 schema: a 3m store migrates to 3n, session_ops and message_cancels are new and empty, and every other row stays as it was + --- + duration_ms: 205.387211 + type: 'test' + ... +# Subtest: T4 schema: the 3m engine refuses a 3n store, migrating or not, and leaves it as it was +ok 630 - T4 schema: the 3m engine refuses a 3n store, migrating or not, and leaves it as it was + --- + duration_ms: 393.565035 + type: 'test' + ... +# Subtest: session.list rows carry the reader count for each session, with its store identity +ok 631 - session.list rows carry the reader count for each session, with its store identity + --- + duration_ms: 42.955258 + type: 'test' + ... +# Subtest: a legacy session is asked for with legacy true +ok 632 - a legacy session is asked for with legacy true + --- + duration_ms: 32.974849 + type: 'test' + ... +# Subtest: without a reader the count is unknown, never 0; a reader that throws is store-unreadable +ok 633 - without a reader the count is unknown, never 0; a reader that throws is store-unreadable + --- + duration_ms: 59.062666 + type: 'test' + ... +# Subtest: compactions must be a function +ok 634 - compactions must be a function + --- + duration_ms: 22.079236 + type: 'test' + ... +# Subtest: T1 REQ-ROLE-2: two sessions of one thread keep their own history, delivery and replies +ok 635 - T1 REQ-ROLE-2: two sessions of one thread keep their own history, delivery and replies + --- + duration_ms: 94.222575 + type: 'test' + ... +# Subtest: T2 REQ-ROLE-2: one holder per session, generations count its claims, and a sibling session's message never reaches the other holder +ok 636 - T2 REQ-ROLE-2: one holder per session, generations count its claims, and a sibling session's message never reaches the other holder + --- + duration_ms: 77.832011 + type: 'test' + ... +# Subtest: T2 sage-2257: a released or revoked run's retired generation refuses its approval, delivery and read, and writes nothing +ok 637 - T2 sage-2257: a released or revoked run's retired generation refuses its approval, delivery and read, and writes nothing + --- + duration_ms: 84.003975 + type: 'test' + ... +# Subtest: session.create is idempotent on its op, refuses a reused op or a taken name, and reaches only the owner's threads +ok 638 - session.create is idempotent on its op, refuses a reused op or a taken name, and reaches only the owner's threads + --- + duration_ms: 67.283168 + type: 'test' + ... +# Subtest: the 3l triggers keep sessions in their thread and session ids apart from thread ids +ok 639 - the 3l triggers keep sessions in their thread and session ids apart from thread ids + --- + duration_ms: 147.919031 + type: 'test' + ... +# Subtest: T7: a 3k store migrates to 3l, each thread's default session has the thread's id, and old rows keep their seqs +ok 640 - T7: a 3k store migrates to 3l, each thread's default session has the thread's id, and old rows keep their seqs + --- + duration_ms: 221.023165 + type: 'test' + ... +# Subtest: T7 D9: the 3k engine refuses a 3l store, migrating or not, and leaves it as it was +ok 641 - T7 D9: the 3k engine refuses a 3l store, migrating or not, and leaves it as it was + --- + duration_ms: 357.286977 + type: 'test' + ... +# Subtest: gated approval authorizes once, survives store reopen, and fresh approval works +ok 642 - gated approval authorizes once, survives store reopen, and fresh approval works + --- + duration_ms: 63.668117 + type: 'test' + ... +# Subtest: another run of the same instance consumes an approval once; a failed check leaves it usable +ok 643 - another run of the same instance consumes an approval once; a failed check leaves it usable + --- + duration_ms: 45.96283 + type: 'test' + ... +# Subtest: two scheduled callers have exactly one grant and one consumed refusal +ok 644 - two scheduled callers have exactly one grant and one consumed refusal + --- + duration_ms: 34.184904 + type: 'test' + ... +# Subtest: failed commit rolls consumption back; cross-role consumes and within-role stays reusable +ok 645 - failed commit rolls consumption back; cross-role consumes and within-role stays reusable + --- + duration_ms: 56.095515 + type: 'test' + ... +# Subtest: class drift gated to cross-role refuses before consumption +ok 646 - class drift gated to cross-role refuses before consumption + --- + duration_ms: 41.253463 + type: 'test' + ... +# Subtest: class drift cross-role to gated refuses before consumption +ok 647 - class drift cross-role to gated refuses before consumption + --- + duration_ms: 46.97558 + type: 'test' + ... +# Subtest: class drift gated to within-role refuses before consumption +ok 648 - class drift gated to within-role refuses before consumption + --- + duration_ms: 48.515138 + type: 'test' + ... +# Subtest: class drift cross-role to within-role refuses before consumption +ok 649 - class drift cross-role to within-role refuses before consumption + --- + duration_ms: 50.833394 + type: 'test' + ... +# Subtest: class drift within-role to gated refuses before consumption +ok 650 - class drift within-role to gated refuses before consumption + --- + duration_ms: 39.804918 + type: 'test' + ... +# Subtest: class drift within-role to cross-role refuses before consumption +ok 651 - class drift within-role to cross-role refuses before consumption + --- + duration_ms: 40.485535 + type: 'test' + ... +# Subtest: message.send consumes approval and prevents a later send or authorize +ok 652 - message.send consumes approval and prevents a later send or authorize + --- + duration_ms: 49.002946 + type: 'test' + ... +# Subtest: role.revoke consumes approval and prevents a later revoke or authorize +ok 653 - role.revoke consumes approval and prevents a later revoke or authorize + --- + duration_ms: 47.289848 + type: 'test' + ... +# Subtest: 3e copy migrates through 3f to 3g preserving every old column/row and adding null spec citations +ok 654 - 3e copy migrates through 3f to 3g preserving every old column/row and adding null spec citations + --- + duration_ms: 196.71743 + type: 'test' + ... +# Subtest: a human spec save sends one notice to each pm and cto, naming the commit, and each commit sends its own +ok 655 - a human spec save sends one notice to each pm and cto, naming the commit, and each commit sends its own + --- + duration_ms: 229.858989 + type: 'test' + ... +# Subtest: no notice for a docs save, an agent record commit, a git commit outside the Console, or a refused save +ok 656 - no notice for a docs save, an agent record commit, a git commit outside the Console, or a refused save + --- + duration_ms: 278.889406 + type: 'test' + ... +# Subtest: a notice to a role no run holds waits for a claim, and launches nobody and tells nobody +ok 657 - a notice to a role no run holds waits for a claim, and launches nobody and tells nobody + --- + duration_ms: 182.932181 + type: 'test' + ... +# Subtest: a business without a pm or a cto saves the spec and sends nothing +ok 658 - a business without a pm or a cto saves the spec and sends nothing + --- + duration_ms: 130.918548 + type: 'test' + ... +# Subtest: a notice that cannot be stored answers outcome-unknown, and the commit stands +ok 659 - a notice that cannot be stored answers outcome-unknown, and the commit stands + --- + duration_ms: 148.665423 + type: 'test' + ... +# Subtest: a BLOCK reaches the chief of staff, the chief relays it to the assistant in the user's thread, and the commit stands +ok 660 - a BLOCK reaches the chief of staff, the chief relays it to the assistant in the user's thread, and the commit stands + --- + duration_ms: 168.823852 + type: 'test' + ... +# Subtest: with no thread a BLOCK still reaches the chief of staff, and the relay to the assistant is refused +ok 661 - with no thread a BLOCK still reaches the chief of staff, and the relay to the assistant is refused + --- + duration_ms: 142.904486 + type: 'test' + ... +# Subtest: within the notice's project the relay lands in the user's most recently opened thread +ok 662 - within the notice's project the relay lands in the user's most recently opened thread + --- + duration_ms: 158.169994 + type: 'test' + ... +# Subtest: a more recently opened thread in another project does not take the relay +ok 663 - a more recently opened thread in another project does not take the relay + --- + duration_ms: 156.248896 + type: 'test' + ... +# Subtest: a BLOCK is refused from anyone but a pm or cto, to anyone but the chief of staff, and outside a reply to its own notice +ok 664 - a BLOCK is refused from anyone but a pm or cto, to anyone but the chief of staff, and outside a reply to its own notice + --- + duration_ms: 157.704026 + type: 'test' + ... +# Subtest: a role cannot forge a spec notice: its text opens neither a BLOCK nor the assistant's thread +ok 665 - a role cannot forge a spec notice: its text opens neither a BLOCK nor the assistant's thread + --- + duration_ms: 162.489954 + type: 'test' + ... +# Subtest: the bus receives nothing: a reply to a notice addressed to _bus is refused +ok 666 - the bus receives nothing: a reply to a notice addressed to _bus is refused + --- + duration_ms: 132.495936 + type: 'test' + ... +# Subtest: real socket awaits spec reads, record writes and cited raises; other requests still return normally +ok 667 - real socket awaits spec reads, record writes and cited raises; other requests still return normally + --- + duration_ms: 207.918598 + type: 'test' + ... +# Subtest: real socket preserves asynchronous refusal codes and disconnects its transient proof +ok 668 - real socket preserves asynchronous refusal codes and disconnects its transient proof + --- + duration_ms: 128.28192 + type: 'test' + ... +# Subtest: two real socket writes to one repository yield one commit and one project-busy refusal +ok 669 - two real socket writes to one repository yield one commit and one project-busy refusal + --- + duration_ms: 153.295915 + type: 'test' + ... +# Subtest: client disconnect during await tolerates late reply +ok 670 - client disconnect during await tolerates late reply + --- + duration_ms: 129.11062 + type: 'test' + ... +# Subtest: client disconnect during await tolerates late refusal +ok 671 - client disconnect during await tolerates late refusal + --- + duration_ms: 83.151624 + type: 'test' + ... +# Subtest: N-a: slow admitted record.write returns its committed result after the idle deadline +ok 672 - N-a: slow admitted record.write returns its committed result after the idle deadline + --- + duration_ms: 274.890784 + type: 'test' + ... +# Subtest: current citation is recorded; docs commits do not stale it and a new spec never reopens settlement +ok 673 - current citation is recorded; docs commits do not stale it and a new spec never reopens settlement + --- + duration_ms: 182.338862 + type: 'test' + ... +# Subtest: stale, unconfirmed, missing and partial spec citations refuse without inserting a decision +ok 674 - stale, unconfirmed, missing and partial spec citations refuse without inserting a decision + --- + duration_ms: 238.551685 + type: 'test' + ... +# Subtest: uncited raises retain their synchronous path and spec read is available to any held role in its business +ok 675 - uncited raises retain their synchronous path and spec read is available to any held role in its business + --- + duration_ms: 98.961931 + type: 'test' + ... +# Subtest: record writes bind the session author, require authority and refuse spec and impersonation paths +ok 676 - record writes bind the session author, require authority and refuse spec and impersonation paths + --- + duration_ms: 105.616269 + type: 'test' + ... +# Subtest: REQ-COS-1: the pm asks the chief of staff for roles and counts; the chief receives a STAFF-REQUEST and answers it +ok 677 - REQ-COS-1: the pm asks the chief of staff for roles and counts; the chief receives a STAFF-REQUEST and answers it + --- + duration_ms: 59.106381 + type: 'test' + ... +# Subtest: REQ-COS-1: only the pm can send a staff request; every other session is refused and the chief of staff hears nothing +ok 678 - REQ-COS-1: only the pm can send a staff request; every other session is refused and the chief of staff hears nothing + --- + duration_ms: 57.85086 + type: 'test' + ... +# Subtest: REQ-COS-1: a pm without message.send is refused like any other gated action +ok 679 - REQ-COS-1: a pm without message.send is refused like any other gated action + --- + duration_ms: 33.374735 + type: 'test' + ... +# Subtest: REQ-COS-1: the request goes to the business launcher, and only when that is a chief of staff +ok 680 - REQ-COS-1: the request goes to the business launcher, and only when that is a chief of staff + --- + duration_ms: 103.899935 + type: 'test' + ... +# Subtest: REQ-COS-1: the sender is judged by definition: an instance `lead` of the pm definition can ask, an instance `pm` of the coder definition can't +ok 681 - REQ-COS-1: the sender is judged by definition: an instance `lead` of the pm definition can ask, an instance `pm` of the coder definition can't + --- + duration_ms: 86.692389 + type: 'test' + ... +# Subtest: REQ-COS-1: the launcher is judged by definition: an instance `boss` of the chief-of-staff definition receives, a `chief` of the coder definition gives no-chief-of-staff +ok 682 - REQ-COS-1: the launcher is judged by definition: an instance `boss` of the chief-of-staff definition receives, a `chief` of the coder definition gives no-chief-of-staff + --- + duration_ms: 76.438944 + type: 'test' + ... +# Subtest: REQ-COS-1: a refused staff request leaves no staff.request action.allowed event +ok 683 - REQ-COS-1: a refused staff request leaves no staff.request action.allowed event + --- + duration_ms: 47.568178 + type: 'test' + ... +# Subtest: REQ-ASSIST-2: the role definitions' messaging lists hold for a staff request, sender and recipient +ok 684 - REQ-ASSIST-2: the role definitions' messaging lists hold for a staff request, sender and recipient + --- + duration_ms: 116.395792 + type: 'test' + ... +# Subtest: a staff request names a task, 1 to 10 distinct roles and counts of 1 to 20; nothing else is accepted +ok 685 - a staff request names a task, 1 to 10 distinct roles and counts of 1 to 20; nothing else is accepted + --- + duration_ms: 81.703276 + type: 'test' + ... +# Subtest: REQ-COS-1: a staff request grants nothing: the pm still can't launch and the chief of staff launches as before +ok 686 - REQ-COS-1: a staff request grants nothing: the pm still can't launch and the chief of staff launches as before + --- + duration_ms: 45.508457 + type: 'test' + ... +# Subtest: a business that never switched launches reads allowed with no time and no event +ok 687 - a business that never switched launches reads allowed with no time and no event + --- + duration_ms: 45.354512 + type: 'test' + ... +# Subtest: launches revoked and then restored read allowed, with the restore time and event id +ok 688 - launches revoked and then restored read allowed, with the restore time and event id + --- + duration_ms: 43.039862 + type: 'test' + ... +# Subtest: a task closed on the tracker leaves the open list, and total counts the open ones +ok 689 - a task closed on the tracker leaves the open list, and total counts the open ones + --- + duration_ms: 40.83642 + type: 'test' + ... +# Subtest: a tombstone is not open +ok 690 - a tombstone is not open + --- + duration_ms: 29.613966 + type: 'test' + ... +# Subtest: the open list stops at the cap and says so; total still counts every open task +ok 691 - the open list stops at the cap and says so; total still counts every open task + --- + duration_ms: 33.06903 + type: 'test' + ... +# Subtest: a role and a reader session read state; arguments, and an unbound cap, refuse +ok 692 - a role and a reader session read state; arguments, and an unbound cap, refuse + --- + duration_ms: 37.843924 + type: 'test' + ... +# Subtest: a human session reads the same state, with the same cap +ok 693 - a human session reads the same state, with the same cap + --- + duration_ms: 38.517095 + type: 'test' + ... +# Subtest: reading state writes nothing: every table keeps its row count +ok 694 - reading state writes nothing: every table keeps its row count + --- + duration_ms: 30.698376 + type: 'test' + ... +# Subtest: creates private WAL store and excludes a second writer until explicit close +ok 695 - creates private WAL store and excludes a second writer until explicit close + --- + duration_ms: 32.476209 + type: 'test' + ... +# Subtest: rollback is atomic and schema metadata is checked against trusted DDL, not just itself +ok 696 - rollback is atomic and schema metadata is checked against trusted DDL, not just itself + --- + duration_ms: 37.54034 + type: 'test' + ... +# Subtest: existing empty database and symlink runtime directory refuse, never initialize over damage +ok 697 - existing empty database and symlink runtime directory refuse, never initialize over damage + --- + duration_ms: 32.624866 + type: 'test' + ... +# Subtest: crash during a transaction recovers no partial event after explicit fixture-only lock removal +ok 698 - crash during a transaction recovers no partial event after explicit fixture-only lock removal + --- + duration_ms: 121.970367 + type: 'test' + ... +# Subtest: writer refuses mixed at/read_at forms atomically, even through trusted SQL helpers +ok 699 - writer refuses mixed at/read_at forms atomically, even through trusted SQL helpers + --- + duration_ms: 23.544926 + type: 'test' + ... +# Subtest: async transactions refuse before invoking their function +ok 700 - async transactions refuse before invoking their function + --- + duration_ms: 15.566559 + type: 'test' + ... +# Subtest: usage_records refuses non-canonical timestamps atomically +ok 701 - usage_records refuses non-canonical timestamps atomically + --- + duration_ms: 18.540318 + type: 'test' + ... +# Subtest: the session default fits under the reply cap and pages to the end with next +ok 702 - the session default fits under the reply cap and pages to the end with next + --- + duration_ms: 237.649313 + type: 'test' + ... +# Subtest: the short form: no description, assignees by role, every listed key +ok 703 - the short form: no description, assignees by role, every listed key + --- + duration_ms: 150.229965 + type: 'test' + ... +# Subtest: each filter, alone and together, and total counts every match +ok 704 - each filter, alone and together, and total counts every match + --- + duration_ms: 284.772283 + type: 'test' + ... +# Subtest: task_ref reads one task in full, as the whole board has it +ok 705 - task_ref reads one task in full, as the whole board has it + --- + duration_ms: 184.34922 + type: 'test' + ... +# Subtest: no arguments is the read the Console and mosaic make, unchanged +ok 706 - no arguments is the read the Console and mosaic make, unchanged + --- + duration_ms: 133.593619 + type: 'test' + ... +# Subtest: an unknown argument or a bad value refuses invalid-request +ok 707 - an unknown argument or a bad value refuses invalid-request + --- + duration_ms: 569.432361 + type: 'test' + ... +# Subtest: tasks rows carry priority and requirement for every session that reads tasks +ok 708 - tasks rows carry priority and requirement for every session that reads tasks + --- + duration_ms: 67.27419 + type: 'test' + ... +# Subtest: the read model rebuilds from the ledger: a reopened bus and each trail give the same values +ok 709 - the read model rebuilds from the ledger: a reopened bus and each trail give the same values + --- + duration_ms: 84.881052 + type: 'test' + ... +# Subtest: an empty business and one with snapshots but no task.created read cleanly +ok 710 - an empty business and one with snapshots but no task.created read cleanly + --- + duration_ms: 27.746515 + type: 'test' + ... +# Subtest: recordTask keeps sync reads and a role write apart +ok 711 - recordTask keeps sync reads and a role write apart + --- + duration_ms: 44.332353 + type: 'test' + ... +# Subtest: read_at must be one canonical UTC format, so the projection compares strings safely +ok 712 - read_at must be one canonical UTC format, so the projection compares strings safely + --- + duration_ms: 19.150621 + type: 'test' + ... +# Subtest: a bad entry refuses the whole record +ok 713 - a bad entry refuses the whole record + --- + duration_ms: 19.596296 + type: 'test' + ... +# Subtest: taskView reads the projection for one business +ok 714 - taskView reads the projection for one business + --- + duration_ms: 27.306017 + type: 'test' + ... +# Subtest: requestTask hands only a holder and a task verb to the handler, and records refusals +ok 715 - requestTask hands only a holder and a task verb to the handler, and records refusals + --- + duration_ms: 47.754641 + type: 'test' + ... +# Subtest: the server sends task verbs to the adapter with its own timeout; other verbs stay synchronous +ok 716 - the server sends task verbs to the adapter with its own timeout; other verbs stay synchronous + --- + duration_ms: 332.266949 + type: 'test' + ... +# Subtest: without an adapter the server refuses every task verb +ok 717 - without an adapter the server refuses every task verb + --- + duration_ms: 73.430904 + type: 'test' + ... +# Subtest: the runtime refuses an invalid adapter and closes a valid one +ok 718 - the runtime refuses an invalid adapter and closes a valid one + --- + duration_ms: 101.656583 + type: 'test' + ... +# Subtest: the process loads the S3 adapter from plain-data trackers +ok 719 - the process loads the S3 adapter from plain-data trackers + --- + duration_ms: 434.83971 + type: 'test' + ... +# Subtest: row 177 T1: a tester thread is owned by tester, and neither side reaches or lists the other +ok 720 - row 177 T1: a tester thread is owned by tester, and neither side reaches or lists the other + --- + duration_ms: 61.020074 + type: 'test' + ... +# Subtest: row 177 T2: the tester thread.send is from tester-cli with no human.input; its open is by tester +ok 721 - row 177 T2: the tester thread.send is from tester-cli with no human.input; its open is by tester + --- + duration_ms: 35.118331 + type: 'test' + ... +# Subtest: row 177 T3: the lists read the tester as the human in its own thread, and nowhere else +ok 722 - row 177 T3: the lists read the tester as the human in its own thread, and nowhere else + --- + duration_ms: 30.364429 + type: 'test' + ... +# Subtest: row 177 T3: an assistant that would not hear the human refuses the tester too +ok 723 - row 177 T3: an assistant that would not hear the human refuses the tester too + --- + duration_ms: 29.620262 + type: 'test' + ... +# Subtest: row 177 T4: the tester thread run answers the tester, never the human +ok 724 - row 177 T4: the tester thread run answers the tester, never the human + --- + duration_ms: 56.403767 + type: 'test' + ... +# Subtest: row 177 T5: each stop revokes only its own threads, recorded by its own actor +ok 725 - row 177 T5: each stop revokes only its own threads, recorded by its own actor + --- + duration_ms: 41.978554 + type: 'test' + ... +# Subtest: row 177 T5: the human stop never ends a tester run +ok 726 - row 177 T5: the human stop never ends a tester run + --- + duration_ms: 33.33217 + type: 'test' + ... +# Subtest: row 177 T6: a business whose human is tester refuses invalid-business +ok 727 - row 177 T6: a business whose human is tester refuses invalid-business + --- + duration_ms: 23.506832 + type: 'test' + ... +# Subtest: row 177 T7: the human trail shows a tester thread message as the tester +ok 728 - row 177 T7: the human trail shows a tester thread message as the tester + --- + duration_ms: 36.917058 + type: 'test' + ... +# Subtest: row 177 T8: a tester-thread run never raises a decision to the human; a human-thread run still does +ok 729 - row 177 T8: a tester-thread run never raises a decision to the human; a human-thread run still does + --- + duration_ms: 42.091725 + type: 'test' + ... +# Subtest: row 177 T8: a tester-thread raise routed to the arbiter stays allowed +ok 730 - row 177 T8: a tester-thread raise routed to the arbiter stays allowed + --- + duration_ms: 42.490629 + type: 'test' + ... +# Subtest: row 182 T9: a tester reply into the human's thread refuses thread-not-owned and stores nothing +ok 731 - row 182 T9: a tester reply into the human's thread refuses thread-not-owned and stores nothing + --- + duration_ms: 39.665728 + type: 'test' + ... +# Subtest: row 182 T9: a tester reply into its own thread lands there +ok 732 - row 182 T9: a tester reply into its own thread lands there + --- + duration_ms: 48.437864 + type: 'test' + ... +# Subtest: row 182 T9: the chief's reply up a chain into a tester's thread lands there +ok 733 - row 182 T9: the chief's reply up a chain into a tester's thread lands there + --- + duration_ms: 47.818144 + type: 'test' + ... +# Subtest: row 182 T9: a tester reply to a spec notice refuses thread-not-owned; the chief's relay still lands +ok 734 - row 182 T9: a tester reply to a spec notice refuses thread-not-owned; the chief's relay still lands + --- + duration_ms: 41.790227 + type: 'test' + ... +# organization: {"event":"reload-needs-restart","business":"demo"} +# organization: {"event":"reload-needs-restart","business":"demo"} +# organization: {"event":"reload-needs-restart","business":"demo"} +# organization: {"event":"reload-needs-restart","business":"demo"} +# organization: {"event":"reload-needs-restart","business":"demo"} +# Subtest: row 175: TESTER_VERBS and the organization branch tester set are pinned +ok 735 - row 175: TESTER_VERBS and the organization branch tester set are pinned + --- + duration_ms: 1.626332 + type: 'test' + ... +# Subtest: row 175: each of the six reads as the tester deep-equals the human read +ok 736 - row 175: each of the six reads as the tester deep-equals the human read + --- + duration_ms: 114.726979 + type: 'test' + ... +# Subtest: row 175: W1-W3 as the tester land with receipt actor tester; the human still logs the human +ok 737 - row 175: W1-W3 as the tester land with receipt actor tester; the human still logs the human + --- + duration_ms: 135.806093 + type: 'test' + ... +# Subtest: row 175: W2 as the tester refuses credentials, protected definitions, human, tester and bus.tester, and changes nothing +ok 738 - row 175: W2 as the tester refuses credentials, protected definitions, human, tester and bus.tester, and changes nothing + --- + duration_ms: 125.059821 + type: 'test' + ... +# Subtest: row 175: the human-only actions refuse a tester tester-refused, and the file and store stay as they were +ok 739 - row 175: the human-only actions refuse a tester tester-refused, and the file and store stay as they were + --- + duration_ms: 122.777613 + type: 'test' + ... +# Subtest: row 175: W4 as the tester writes by tester and keeps every name check +ok 740 - row 175: W4 as the tester writes by tester and keeps every name check + --- + duration_ms: 35.198826 + type: 'test' + ... +# Subtest: row 175: W6 as the tester records created_by tester; the human records the human +ok 741 - row 175: W6 as the tester records created_by tester; the human records the human + --- + duration_ms: 26.922159 + type: 'test' + ... +# Subtest: row 175: with bus.tester unset or not exactly true no tester binds, so no read or write runs +ok 742 - row 175: with bus.tester unset or not exactly true no tester binds, so no read or write runs + --- + duration_ms: 102.67721 + type: 'test' + ... +# Subtest: the tester binds only when the business sets bus.tester to exactly true +ok 743 - the tester binds only when the business sets bus.tester to exactly true + --- + duration_ms: 154.926421 + type: 'test' + ... +# Subtest: a business may not name a role tester, so the tester address is never a role +ok 744 - a business may not name a role tester, so the tester address is never a role + --- + duration_ms: 53.065815 + type: 'test' + ... +# Subtest: every verb outside the tester list refuses tester-refused and is recorded against the tester +ok 745 - every verb outside the tester list refuses tester-refused and is recorded against the tester + --- + duration_ms: 104.019187 + type: 'test' + ... +# Subtest: a tester message is from tester, needs no prefix, and writes no human.input or authority +ok 746 - a tester message is from tester, needs no prefix, and writes no human.input or authority + --- + duration_ms: 45.383598 + type: 'test' + ... +# Subtest: a tester message to a role no run holds refuses tester-target-not-running and stores nothing +ok 747 - a tester message to a role no run holds refuses tester-target-not-running and stores nothing + --- + duration_ms: 26.246707 + type: 'test' + ... +# Subtest: a tester message is refused while the run is only launched, and routes once it claims +ok 748 - a tester message is refused while the run is only launched, and routes once it claims + --- + duration_ms: 31.908603 + type: 'test' + ... +# Subtest: a human message to a role no run holds still waits and tells launch.by +ok 749 - a human message to a role no run holds still waits and tells launch.by + --- + duration_ms: 26.758991 + type: 'test' + ... +# Subtest: a role answers a tester only in reply to a tester message, and the answer never reaches the human +ok 750 - a role answers a tester only in reply to a tester message, and the answer never reaches the human + --- + duration_ms: 47.764743 + type: 'test' + ... +# Subtest: the tester reads the human views a reader reads +ok 751 - the tester reads the human views a reader reads + --- + duration_ms: 56.507081 + type: 'test' + ... +# Subtest: tester proof binds its own CLI, start time and nonce, refuses a managed run and allows an agent +ok 752 - tester proof binds its own CLI, start time and nonce, refuses a managed run and allows an agent + --- + duration_ms: 1.602876 + type: 'test' + ... +# Subtest: neither CLI's nonce proves the other: each proof is bound to its own CLI and nonce variable +ok 753 - neither CLI's nonce proves the other: each proof is bound to its own CLI and nonce variable + --- + duration_ms: 0.525292 + type: 'test' + ... +# Subtest: testerNonce reads only the tester's variable and gives null on any read error +ok 754 - testerNonce reads only the tester's variable and gives null on any read error + --- + duration_ms: 0.263634 + type: 'test' + ... +# Subtest: an envelope carries exactly one of cap, human and tester; no tester authenticator refuses +ok 755 - an envelope carries exactly one of cap, human and tester; no tester authenticator refuses + --- + duration_ms: 180.988347 + type: 'test' + ... +# Subtest: tester-cli.mjs binds through the runtime when the switch is on, and refuses off or under a run marker +ok 756 - tester-cli.mjs binds through the runtime when the switch is on, and refuses off or under a run marker + --- + duration_ms: 1249.849215 + type: 'test' + ... +# Subtest: T1: the human and the reader see a held thread claim; agents still lists the role only +ok 757 - T1: the human and the reader see a held thread claim; agents still lists the role only + --- + duration_ms: 47.082212 + type: 'test' + ... +# Subtest: T2: a released or revoked thread claim is not listed, though its thread has an earlier claim row +ok 758 - T2: a released or revoked thread claim is not listed, though its thread has an earlier claim row + --- + duration_ms: 46.129993 + type: 'test' + ... +# Subtest: T3: a role session refuses human-required and the tester refuses tester-refused +ok 759 - T3: a role session refuses human-required and the tester refuses tester-refused + --- + duration_ms: 39.130379 + type: 'test' + ... +# Subtest: T4: agents answers each session the same before and after a thread run claims +ok 760 - T4: agents answers each session the same before and after a thread run claims + --- + duration_ms: 47.375648 + type: 'test' + ... +# Subtest: T5: the result carries neither the thread name a user wrote nor a message body +ok 761 - T5: the result carries neither the thread name a user wrote nor a message body + --- + duration_ms: 43.762526 + type: 'test' + ... +# Subtest: T6: two held sessions of one thread list as two rows, each its session's latest claim +ok 762 - T6: two held sessions of one thread list as two rows, each its session's latest claim + --- + duration_ms: 48.67367 + type: 'test' + ... +# Subtest: REQ-THREAD-1 REQ-ORG-2: the 3d→3e migration adds the thread tables and leaves messages from before threads as written +ok 763 - REQ-THREAD-1 REQ-ORG-2: the 3d→3e migration adds the thread tables and leaves messages from before threads as written + --- + duration_ms: 178.427856 + type: 'test' + ... +# Subtest: REQ-THREAD-1: a 3d bus with a changed schema is refused and keeps its version and tables +ok 764 - REQ-THREAD-1: a 3d bus with a changed schema is refused and keeps its version and tables + --- + duration_ms: 97.576539 + type: 'test' + ... +# Subtest: REQ-THREAD-1: the offline command prints the kept-message counts before the ready line +ok 765 - REQ-THREAD-1: the offline command prints the kept-message counts before the ready line + --- + duration_ms: 210.945457 + type: 'test' + ... +# Subtest: a share lets the sharee read the thread and nothing else: every write verb stays the owner's (mutants 7, 9) +ok 766 - a share lets the sharee read the thread and nothing else: every write verb stays the owner's (mutants 7, 9) + --- + duration_ms: 68.856161 + type: 'test' + ... +# Subtest: the business human shares too, and a `*` share reaches every covered principal but the tester +ok 767 - the business human shares too, and a `*` share reaches every covered principal but the tester + --- + duration_ms: 52.62427 + type: 'test' + ... +# Subtest: mutant 2: a share never widens a grant; when the sharee's grant stops covering the thread, its reads end +ok 768 - mutant 2: a share never widens a grant; when the sharee's grant stops covering the thread, its reads end + --- + duration_ms: 52.767802 + type: 'test' + ... +# Subtest: mutant 3: a thread whose user owner has lost coverage is hidden from its sharees, the owner's board included +ok 769 - mutant 3: a thread whose user owner has lost coverage is hidden from its sharees, the owner's board included + --- + duration_ms: 76.742387 + type: 'test' + ... +# Subtest: mutant 4: a share's state is its latest row, so an unshare ends it and a share after it starts it again +ok 770 - mutant 4: a share's state is its latest row, so an unshare ends it and a share after it starts it again + --- + duration_ms: 56.908186 + type: 'test' + ... +# Subtest: mutant 8: a user target needs a live grant of any level covering the thread, else share-not-covered +ok 771 - mutant 8: a user target needs a live grant of any level covering the thread, else share-not-covered + --- + duration_ms: 39.735164 + type: 'test' + ... +# Subtest: a viewer reads a thread shared with it, and share, unshare and shares refuse a viewer access-refused (design 4.3) +ok 772 - a viewer reads a thread shared with it, and share, unshare and shares refuse a viewer access-refused (design 4.3) + --- + duration_ms: 44.918379 + type: 'test' + ... +# Subtest: a share target is `user:`, the business human or `*`, and never the sharer +ok 773 - a share target is `user:`, the business human or `*`, and never the sharer + --- + duration_ms: 85.291743 + type: 'test' + ... +# Subtest: a user whose collaborator grant no longer covers its own thread can't share, unshare or list its shares +ok 774 - a user whose collaborator grant no longer covers its own thread can't share, unshare or list its shares + --- + duration_ms: 43.176413 + type: 'test' + ... +# Subtest: the tester and a reader session never share: each verb refuses and writes nothing +ok 775 - the tester and a reader session never share: each verb refuses and writes nothing + --- + duration_ms: 69.184817 + type: 'test' + ... +# Subtest: the owner's trail and replies show a user's message only while that user's thread is shared with the owner +ok 776 - the owner's trail and replies show a user's message only while that user's thread is shared with the owner + --- + duration_ms: 54.897059 + type: 'test' + ... +# Subtest: a share covers every session of the thread +ok 777 - a share covers every session of the thread + --- + duration_ms: 38.220864 + type: 'test' + ... +# Subtest: a sharee can't list the thread's sessions: session.list stays owner-only (Q7, sage-2818 Q1) +ok 778 - a sharee can't list the thread's sessions: session.list stays owner-only (Q7, sage-2818 Q1) + --- + duration_ms: 39.045308 + type: 'test' + ... +# Subtest: only a human principal matches a share: an agent bound to the thread and the tester match none (sage-2818 Q2) +ok 779 - only a human principal matches a share: an agent bound to the thread and the tester match none (sage-2818 Q2) + --- + duration_ms: 57.102732 + type: 'test' + ... +# Subtest: a 3l store migrates to 3m: thread_shares is new and empty, and every other row stays as it was +ok 780 - a 3l store migrates to 3m: thread_shares is new and empty, and every other row stays as it was + --- + duration_ms: 156.871289 + type: 'test' + ... +# Subtest: the 3l engine refuses a 3m store, migrating or not, and leaves it as it was +ok 781 - the 3l engine refuses a 3m store, migrating or not, and leaves it as it was + --- + duration_ms: 276.243402 + type: 'test' + ... +# Subtest: REQ-ROLE-2 REQ-THREAD-1: one holder per thread, through the broker and the trigger +ok 782 - REQ-ROLE-2 REQ-THREAD-1: one holder per thread, through the broker and the trigger + --- + duration_ms: 68.160117 + type: 'test' + ... +# Subtest: REQ-ROLE-2 REQ-THREAD-1: the 3e triggers refuse writes that skip the broker +ok 783 - REQ-ROLE-2 REQ-THREAD-1: the 3e triggers refuse writes that skip the broker + --- + duration_ms: 146.168964 + type: 'test' + ... +# Subtest: REQ-MSG-1: a message to or from the assistant names its thread, or is refused +ok 784 - REQ-MSG-1: a message to or from the assistant names its thread, or is refused + --- + duration_ms: 64.307463 + type: 'test' + ... +# Subtest: REQ-MSG-1: the chief of staff's reply comes back to the thread that sent the work +ok 785 - REQ-MSG-1: the chief of staff's reply comes back to the thread that sent the work + --- + duration_ms: 910.523881 + type: 'test' + ... +# Subtest: REQ-MSG-1: a reply can't carry one thread instance's thread to another thread instance +ok 786 - REQ-MSG-1: a reply can't carry one thread instance's thread to another thread instance + --- + duration_ms: 28.667694 + type: 'test' + ... +# Subtest: REQ-THREAD-1 REQ-USER-2: one thread's messages never reach another thread's holder +ok 787 - REQ-THREAD-1 REQ-USER-2: one thread's messages never reach another thread's holder + --- + duration_ms: 30.930758 + type: 'test' + ... +# Subtest: REQ-LAUNCH-1: a message to a thread with no holder waits, and the next holder gets it +ok 788 - REQ-LAUNCH-1: a message to a thread with no holder waits, and the next holder gets it + --- + duration_ms: 34.857804 + type: 'test' + ... +# Subtest: REQ-THREAD-2 REQ-LAUNCH-1: threadIdle releases only a thread with nothing waiting, and only for its holder +ok 789 - REQ-THREAD-2 REQ-LAUNCH-1: threadIdle releases only a thread with nothing waiting, and only for its holder + --- + duration_ms: 35.976924 + type: 'test' + ... +# Subtest: REQ-THREAD-2 REQ-LAUNCH-1: a message delivered to a run that ended unread doesn't hold up the next holder +ok 790 - REQ-THREAD-2 REQ-LAUNCH-1: a message delivered to a run that ended unread doesn't hold up the next holder + --- + duration_ms: 32.114623 + type: 'test' + ... +# Subtest: REQ-ROLE-2 REQ-THREAD-1 Q169: a role.revoke the human approved ends every thread run of the assistant +ok 791 - REQ-ROLE-2 REQ-THREAD-1 Q169: a role.revoke the human approved ends every thread run of the assistant + --- + duration_ms: 29.017691 + type: 'test' + ... +# Subtest: Q169 REQ-USER-2: assistant.stop ends the human's own assistant thread runs, and only the human's +ok 792 - Q169 REQ-USER-2: assistant.stop ends the human's own assistant thread runs, and only the human's + --- + duration_ms: 42.752028 + type: 'test' + ... +# Subtest: REQ-USER-2: the human verbs refuse another owner's thread +ok 793 - REQ-USER-2: the human verbs refuse another owner's thread + --- + duration_ms: 31.861988 + type: 'test' + ... +# Subtest: REQ-THREAD-1: thread.create refuses when the business has no thread instance or more than one +ok 794 - REQ-THREAD-1: thread.create refuses when the business has no thread instance or more than one + --- + duration_ms: 36.088633 + type: 'test' + ... +# Subtest: REQ-ORG-2: projects and threads are named once, and the repo names a business project +ok 795 - REQ-ORG-2: projects and threads are named once, and the repo names a business project + --- + duration_ms: 37.127199 + type: 'test' + ... +# Subtest: REQ-THREAD-2: thread.messages returns the thread's history in pages and writes nothing +ok 796 - REQ-THREAD-2: thread.messages returns the thread's history in pages and writes nothing + --- + duration_ms: 98.967825 + type: 'test' + ... +# Subtest: project.create refuses a repository name without its matching repo before any write +ok 797 - project.create refuses a repository name without its matching repo before any write + --- + duration_ms: 16.718484 + type: 'test' + ... +# Subtest: project.create keeps unrelated names with and without a repository +ok 798 - project.create keeps unrelated names with and without a repository + --- + duration_ms: 11.270789 + type: 'test' + ... +# Subtest: C2-09a: explicit creative instances bind independent threads, default sessions and holders +ok 799 - C2-09a: explicit creative instances bind independent threads, default sessions and holders + --- + duration_ms: 54.826658 + type: 'test' + ... +# Subtest: C2-09a: explicit missing, non-thread and malformed selectors create no thread or session +ok 800 - C2-09a: explicit missing, non-thread and malformed selectors create no thread or session + --- + duration_ms: 20.704222 + type: 'test' + ... +# Subtest: socket capability stamps launch identity; shared views use wire, no SQL client +ok 801 - socket capability stamps launch identity; shared views use wire, no SQL client + --- + duration_ms: 91.882247 + type: 'test' + ... +# Subtest: two wire claims serialize; a lost reply never automatically retries +ok 802 - two wire claims serialize; a lost reply never automatically retries + --- + duration_ms: 69.535358 + type: 'test' + ... +# Subtest: malformed, oversized and identity-forging envelopes refuse without echoing input +ok 803 - malformed, oversized and identity-forging envelopes refuse without echoing input + --- + duration_ms: 54.002898 + type: 'test' + ... +# Subtest: client preserves UTF-8 when a response divides a multibyte character +ok 804 - client preserves UTF-8 when a response divides a multibyte character + --- + duration_ms: 13.106666 + type: 'test' + ... +# Subtest: committed mutation followed by dropped reply reports unknown and is never retried +ok 805 - committed mutation followed by dropped reply reports unknown and is never retried + --- + duration_ms: 56.806348 + type: 'test' + ... +# Subtest: REQ-LIMIT-4 usage protocol binds run identity, requires a delivered turn and isolates businesses +ok 806 - REQ-LIMIT-4 usage protocol binds run identity, requires a delivered turn and isolates businesses + --- + duration_ms: 46.166172 + type: 'test' + ... +# Subtest: REQ-LIMIT-4 3g copy migrates through 3h, 3i, 3j and 3k to 3l preserving every old column, row and sequence; new usage table is empty +ok 807 - REQ-LIMIT-4 3g copy migrates through 3h, 3i, 3j and 3k to 3l preserving every old column, row and sequence; new usage table is empty + --- + duration_ms: 152.980924 + type: 'test' + ... +# Subtest: REQ-PLUG-1 runtime reaches transcript only through loader, over the real bus socket +ok 808 - REQ-PLUG-1 runtime reaches transcript only through loader, over the real bus socket + --- + duration_ms: 93.773273 + type: 'test' + ... +# Subtest: REQ-LIMIT-4 loader source records new turn kinds, excludes history and retries exactly once +ok 809 - REQ-LIMIT-4 loader source records new turn kinds, excludes history and retries exactly once + --- + duration_ms: 26.696799 + type: 'test' + ... +# Subtest: REQ-LIMIT-4 cut: unknown is durable and logged next to every total +ok 810 - REQ-LIMIT-4 cut: unknown is durable and logged next to every total + --- + duration_ms: 21.463536 + type: 'test' + ... +# Subtest: REQ-LIMIT-4 disabled: unknown is durable and logged next to every total +ok 811 - REQ-LIMIT-4 disabled: unknown is durable and logged next to every total + --- + duration_ms: 19.018013 + type: 'test' + ... +# Subtest: REQ-LIMIT-4 missing-begin: unknown is durable and logged next to every total +ok 812 - REQ-LIMIT-4 missing-begin: unknown is durable and logged next to every total + --- + duration_ms: 15.720181 + type: 'test' + ... +# Subtest: REQ-LIMIT-4 no-new-usage: unknown is durable and logged next to every total +ok 813 - REQ-LIMIT-4 no-new-usage: unknown is durable and logged next to every total + --- + duration_ms: 17.902013 + type: 'test' + ... +# Subtest: REQ-LIMIT-4 rewrite: unknown is durable and logged next to every total +ok 814 - REQ-LIMIT-4 rewrite: unknown is durable and logged next to every total + --- + duration_ms: 20.530373 + type: 'test' + ... +# Subtest: REQ-LIMIT-4 unfinished turn remains visibly unknown after accounting restarts +ok 815 - REQ-LIMIT-4 unfinished turn remains visibly unknown after accounting restarts + --- + duration_ms: 20.14814 + type: 'test' + ... +# Subtest: usage records are append-only +ok 816 - usage records are append-only + --- + duration_ms: 18.004446 + type: 'test' + ... +# Subtest: REQ-LIMIT-4 parse failure logs its safe code, never transcript content +ok 817 - REQ-LIMIT-4 parse failure logs its safe code, never transcript content + --- + duration_ms: 18.080501 + type: 'test' + ... +# Subtest: REQ-LIMIT-4 resumed run baselines history and exact totals do not overflow +ok 818 - REQ-LIMIT-4 resumed run baselines history and exact totals do not overflow + --- + duration_ms: 20.487821 + type: 'test' + ... +# Subtest: REQ-PLUG-1 core has no transcript import and disabled sources do not read any transcript +ok 819 - REQ-PLUG-1 core has no transcript import and disabled sources do not read any transcript + --- + duration_ms: 17.151889 + type: 'test' + ... +# Subtest: REQ-LIMIT-4 a resumed thread bills only new assistant messages to its next run +ok 820 - REQ-LIMIT-4 a resumed thread bills only new assistant messages to its next run + --- + duration_ms: 19.330416 + type: 'test' + ... +# Subtest: REQ-LIMIT-4 every enabled source is called; failure is unknown and a partial total stays labelled +ok 821 - REQ-LIMIT-4 every enabled source is called; failure is unknown and a partial total stays labelled + --- + duration_ms: 24.33096 + type: 'test' + ... +# Subtest: REQ-LIMIT-4 a turn whose reported sum exceeds safe precision is unknown, not rounded +ok 822 - REQ-LIMIT-4 a turn whose reported sum exceeds safe precision is unknown, not rounded + --- + duration_ms: 18.461178 + type: 'test' + ... +# Subtest: row 65 a run bound without a transcript directory records no-transcript +ok 823 - row 65 a run bound without a transcript directory records no-transcript + --- + duration_ms: 17.477013 + type: 'test' + ... +# Subtest: R3: bindUser binds a granted user and refuses one with no live grant +ok 824 - R3: bindUser binds a granted user and refuses one with no live grant + --- + duration_ms: 25.79742 + type: 'test' + ... +# Subtest: R3: a user named like the business human, the tester or a principal word is refused, whatever the grants say +ok 825 - R3: a user named like the business human, the tester or a principal word is refused, whatever the grants say + --- + duration_ms: 19.738777 + type: 'test' + ... +# Subtest: R3: each collaborator verb is allowed to a granted user +ok 826 - R3: each collaborator verb is allowed to a granted user + --- + duration_ms: 32.829349 + type: 'test' + ... +# Subtest: R3: every verb off the collaborator list refuses a user access-refused before its own checks +ok 827 - R3: every verb off the collaborator list refuses a user access-refused before its own checks + --- + duration_ms: 182.997036 + type: 'test' + ... +# Subtest: R3: task, web and host verbs refuse a user access-refused +ok 828 - R3: task, web and host verbs refuse a user access-refused + --- + duration_ms: 39.734586 + type: 'test' + ... +# Subtest: R3 leak: project.list shows granted projects only +ok 829 - R3 leak: project.list shows granted projects only + --- + duration_ms: 20.288967 + type: 'test' + ... +# Subtest: R3 leak: thread.create needs the project and the thread instance granted, and an ungranted id reads as one that does not exist +ok 830 - R3 leak: thread.create needs the project and the thread instance granted, and an ungranted id reads as one that does not exist + --- + duration_ms: 24.210552 + type: 'test' + ... +# Subtest: R3 leak: thread.list shows the user its own threads that are still granted, never others +ok 831 - R3 leak: thread.list shows the user its own threads that are still granted, never others + --- + duration_ms: 56.041988 + type: 'test' + ... +# Subtest: R3 leak: names shows granted instances only +ok 832 - R3 leak: names shows granted instances only + --- + duration_ms: 24.501342 + type: 'test' + ... +# Subtest: R3: thread.send is from user: and writes no human.input +ok 833 - R3: thread.send is from user: and writes no human.input + --- + duration_ms: 20.337753 + type: 'test' + ... +# Subtest: R3: a reply-chain message.send into another user thread is refused +ok 834 - R3: a reply-chain message.send into another user thread is refused + --- + duration_ms: 19.511955 + type: 'test' + ... +# Subtest: R3: the run reply to a user message reaches that user thread.messages, with no waiting and no notice +ok 835 - R3: the run reply to a user message reaches that user thread.messages, with no waiting and no notice + --- + duration_ms: 24.431708 + type: 'test' + ... +# Subtest: R3: a reply to: user without a matching in_reply_to is refused user-reply-required +ok 836 - R3: a reply to: user without a matching in_reply_to is refused user-reply-required + --- + duration_ms: 34.688751 + type: 'test' + ... +# Subtest: R3: a non-thread run, the human and the tester cannot send to: user +ok 837 - R3: a non-thread run, the human and the tester cannot send to: user + --- + duration_ms: 24.159005 + type: 'test' + ... +# Subtest: R3: a user thread run cannot message the owner, while its uncited gated raise reaches only the owner inbox, B9 +ok 838 - R3: a user thread run cannot message the owner, while its uncited gated raise reaches only the owner inbox, B9 + --- + duration_ms: 24.089476 + type: 'test' + ... +# Subtest: R3: a removed or expired grant refuses the next request access-revoked, and the file is read per request +ok 839 - R3: a removed or expired grant refuses the next request access-revoked, and the file is read per request + --- + duration_ms: 24.246817 + type: 'test' + ... +# Subtest: R3: a user refusal is recorded as action.refused by user: +ok 840 - R3: a user refusal is recorded as action.refused by user: + --- + duration_ms: 18.417837 + type: 'test' + ... +# Subtest: R3: a business with a role keyed user refuses invalid-business +ok 841 - R3: a business with a role keyed user refuses invalid-business + --- + duration_ms: 14.219976 + type: 'test' + ... +# Subtest: R3: name.set refuses the name user +ok 842 - R3: name.set refuses the name user + --- + duration_ms: 11.669457 + type: 'test' + ... +# Subtest: R3 r4: while halted, a granted user's thread.send refuses processing-halted and thread.messages still answers +ok 843 - R3 r4: while halted, a granted user's thread.send refuses processing-halted and thread.messages still answers + --- + duration_ms: 18.335023 + type: 'test' + ... +# Subtest: R3 r4: the chief's hire refuses an instance named user with the code it gives human and tester +ok 844 - R3 r4: the chief's hire refuses an instance named user with the code it gives human and tester + --- + duration_ms: 19.098984 + type: 'test' + ... +# Subtest: R3 r4: a non-function access throws before the store is read +ok 845 - R3 r4: a non-function access throws before the store is read + --- + duration_ms: 0.1404 + type: 'test' + ... +# Subtest: C2-09a: naming an instance cannot bypass its collaborator grant or disclose an ungranted project +ok 846 - C2-09a: naming an instance cannot bypass its collaborator grant or disclose an ungranted project + --- + duration_ms: 22.627395 + type: 'test' + ... +# Subtest: 275: VIEWER_VERBS is the ruled read list, inside USER_VERBS +ok 847 - 275: VIEWER_VERBS is the ruled read list, inside USER_VERBS + --- + duration_ms: 1.869758 + type: 'test' + ... +# Subtest: 275: a viewer binds, and each viewer verb answers with what its grant covers +ok 848 - 275: a viewer binds, and each viewer verb answers with what its grant covers + --- + duration_ms: 44.872185 + type: 'test' + ... +# Subtest: 275: a viewer is refused thread.create, thread.open and thread.send access-refused, and nothing is stored +ok 849 - 275: a viewer is refused thread.create, thread.open and thread.send access-refused, and nothing is stored + --- + duration_ms: 31.547498 + type: 'test' + ... +# Subtest: 275: every verb off the user list refuses a viewer access-refused before its own checks +ok 850 - 275: every verb off the user list refuses a viewer access-refused before its own checks + --- + duration_ms: 128.286224 + type: 'test' + ... +# Subtest: 275: mixed grants, collaborator on one project and viewer on another, take the level per project +ok 851 - 275: mixed grants, collaborator on one project and viewer on another, take the level per project + --- + duration_ms: 37.126552 + type: 'test' + ... +# Subtest: 275: board reads refuse users and viewers access-refused +ok 852 - 275: board reads refuse users and viewers access-refused + --- + duration_ms: 94.038642 + type: 'test' + ... +# Subtest: governance pin, user side: decisions, inbox entries, claims, tasks and project files are the owner's, the user reads its messages +ok 853 - governance pin, user side: decisions, inbox entries, claims, tasks and project files are the owner's, the user reads its messages + --- + duration_ms: 54.243573 + type: 'test' + ... +# Subtest: web.search: a granted role gets labelled results, and the call is trailed with role, run, verb and query +ok 854 - web.search: a granted role gets labelled results, and the call is trailed with role, run, verb and query + --- + duration_ms: 33.826629 + type: 'test' + ... +# Subtest: web.fetch: a granted role gets the page as labelled text, and the call is trailed with the url +ok 855 - web.fetch: a granted role gets the page as labelled text, and the call is trailed with the url + --- + duration_ms: 33.285251 + type: 'test' + ... +# Subtest: a role without the grant is refused, the refusal is logged with the verb, and nothing is fetched +ok 856 - a role without the grant is refused, the refusal is logged with the verb, and nothing is fetched + --- + duration_ms: 34.391063 + type: 'test' + ... +# Subtest: a broker with no web service refuses a granted role +ok 857 - a broker with no web service refuses a granted role + --- + duration_ms: 24.284986 + type: 'test' + ... +# Subtest: bad requests are refused: unknown verb, extra or missing argument, not a string, a human or reader session +ok 858 - bad requests are refused: unknown verb, extra or missing argument, not a string, a human or reader session + --- + duration_ms: 31.402265 + type: 'test' + ... +# Subtest: a session that is not the role holder is refused +ok 859 - a session that is not the role holder is refused + --- + duration_ms: 24.71339 + type: 'test' + ... +# Subtest: web.mjs's fences hold on the broker side: refusals are normal results with the fixed reason +ok 860 - web.mjs's fences hold on the broker side: refusals are normal results with the fixed reason + --- + duration_ms: 64.10922 + type: 'test' + ... +# Subtest: web.search with no search source configured is a refused result, not an error +ok 861 - web.search with no search source configured is a refused result, not an error + --- + duration_ms: 22.35323 + type: 'test' + ... +# Subtest: a search source that fails with its own refusal, or that throws, is handled +ok 862 - a search source that fails with its own refusal, or that throws, is handled + --- + duration_ms: 28.082871 + type: 'test' + ... +# Subtest: a slow search source ends in a refusal at the deadline +ok 863 - a slow search source ends in a refusal at the deadline + --- + duration_ms: 72.99413 + type: 'test' + ... +# Subtest: a secret in the arguments is refused before anything is trailed or fetched +ok 864 - a secret in the arguments is refused before anything is trailed or fetched + --- + duration_ms: 17.114739 + type: 'test' + ... +# Subtest: over the socket: the server routes web verbs to the service; other roles are refused; no service is web-not-configured +ok 865 - over the socket: the server routes web verbs to the service; other roles are refused; no service is web-not-configured + --- + duration_ms: 76.207853 + type: 'test' + ... +# Subtest: busBusiness: the web grant comes from "web" in the resolved tool limit +ok 866 - busBusiness: the web grant comes from "web" in the resolved tool limit + --- + duration_ms: 0.306131 + type: 'test' + ... +# Subtest: webServices: the business's search-source plug-in and web.searxng var make web.search work; without either it is refused as not configured +ok 867 - webServices: the business's search-source plug-in and web.searxng var make web.search work; without either it is refused as not configured + --- + duration_ms: 54.418497 + type: 'test' + ... +# Subtest: an ungranted call is refused at once: no admission, no wait, nothing touched +ok 868 - an ungranted call is refused at once: no admission, no wait, nothing touched + --- + duration_ms: 22.35967 + type: 'test' + ... +# Subtest: over the socket an ungranted caller is dropped by the server timeout and a granted one gets the longer wait +ok 869 - over the socket an ungranted caller is dropped by the server timeout and a granted one gets the longer wait + --- + duration_ms: 351.189179 + type: 'test' + ... +# Subtest: a search that never answers is aborted at the deadline, the module sees the signal, and the call is trailed as refused (timeout) +ok 870 - a search that never answers is aborted at the deadline, the module sees the signal, and the call is trailed as refused (timeout) + --- + duration_ms: 79.853895 + type: 'test' + ... +# Subtest: a fetch that stalls is cut off at the deadline: the request is destroyed, not left running +ok 871 - a fetch that stalls is cut off at the deadline: the request is destroyed, not left running + --- + duration_ms: 97.159194 + type: 'test' + ... +# Subtest: one query limit: over SEARCH_MAX_QUERY_CHARS or empty is refused with the same reason before any backend, and the tool schema carries the same number +ok 872 - one query limit: over SEARCH_MAX_QUERY_CHARS or empty is refused with the same reason before any backend, and the tool schema carries the same number + --- + duration_ms: 21.959833 + type: 'test' + ... +# Subtest: merge-gate's technical raise is cross-role, goes to the cto, and only merge-gate can use the approval +ok 873 - merge-gate's technical raise is cross-role, goes to the cto, and only merge-gate can use the approval + --- + duration_ms: 58.822197 + type: 'test' + ... +# Subtest: merge-gate has no message.send, and without a domain its raise goes to the delivery arbiter +ok 874 - merge-gate has no message.send, and without a domain its raise goes to the delivery arbiter + --- + duration_ms: 38.592414 + type: 'test' + ... +# Subtest: the cto must be able to message merge-gate, or the technical raise is refused (row 133) +ok 875 - the cto must be able to message merge-gate, or the technical raise is refused (row 133) + --- + duration_ms: 37.658744 + type: 'test' + ... +# Subtest: security-reviewer answers a review with its verdict alone; it holds no message.send +ok 876 - security-reviewer answers a review with its verdict alone; it holds no message.send + --- + duration_ms: 45.261779 + type: 'test' + ... +1..876 +# tests 876 +# suites 0 +# pass 873 +# fail 2 +# cancelled 0 +# skipped 1 +# todo 0 +# duration_ms 23597.723198 diff --git a/packages/bus/tests/grant-executor.test.mjs b/packages/bus/tests/grant-executor.test.mjs index e449b7d77..46235d16b 100644 --- a/packages/bus/tests/grant-executor.test.mjs +++ b/packages/bus/tests/grant-executor.test.mjs @@ -1047,7 +1047,10 @@ test('sage-1908: once the agent of an applied grant is a creative role, host.run const f = await setup(t); assert.equal((await f.approve()).end.action, 'grant.applied'); const r = await restart(t, f, creativeOps(f.business)); - const cap = r.broker.bindLaunch({ business: 'demo', role: 'ops', run: 'ops-run', harness: 'pi', address: 'ops' }); + const human = r.broker.bindHuman({ business: 'demo', human: 'jason', via: 'cli', outsideAgent: true }); + const project = r.broker.request(human, { verb: 'project.create', args: { name: 'host grant check' } }).id; + const thread = r.broker.request(human, { verb: 'thread.create', args: { project, name: 'ops', instance: 'ops' } }).id; + const cap = r.broker.bindLaunch({ business: 'demo', role: 'ops', run: 'ops-run', harness: 'pi', address: 'ops', thread }); r.broker.request(cap, { verb: 'role.claim' }); const executor = hostExecutor({ credentials: r.credentials, root: join(f.dir, 'host-run') }); const before = f.requests().length; diff --git a/packages/bus/tests/project-runtime.test.mjs b/packages/bus/tests/project-runtime.test.mjs index a6086e56c..7275ad902 100644 --- a/packages/bus/tests/project-runtime.test.mjs +++ b/packages/bus/tests/project-runtime.test.mjs @@ -32,7 +32,8 @@ test('Broker keeps the sandbox client import closure: only the listed imports, n // (#1692, D2.4) reads unhireableAction, the hire veto's action name. // Row 236 (#1742, #436b) reads giteaName and parseGiteaUrl for the Gitea grant path. // FED R3 r5 (row 274, #414) reads covers, a user's grant check, from it. - "import { ID_PATTERN, THREAD_DEFINITION, END_PROTECTED, forkProblem, forkUrl, credentialKind, validArgv, commandAllowed, HOST_ID, CREATIVE_DEFINITIONS, unhireableAction, giteaName, parseGiteaUrl, covers } from '../../business/src/vocabulary.mjs';", + // Row 219 reads THREAD_DEFINITIONS from the same vocabulary for creative thread admission. + "import { ID_PATTERN, THREAD_DEFINITIONS, END_PROTECTED, forkProblem, forkUrl, credentialKind, validArgv, commandAllowed, HOST_ID, CREATIVE_DEFINITIONS, unhireableAction, giteaName, parseGiteaUrl, covers } from '../../business/src/vocabulary.mjs';", ]); assert.doesNotMatch(source, /\bimport\s*\(/); assert.doesNotMatch(readFileSync(new URL('../src/landing.mjs', import.meta.url), 'utf8'), /\bimport\b/); diff --git a/packages/bus/tests/threads.test.mjs b/packages/bus/tests/threads.test.mjs index 1410ec3fa..280e03184 100644 --- a/packages/bus/tests/threads.test.mjs +++ b/packages/bus/tests/threads.test.mjs @@ -640,3 +640,17 @@ test('C2-09a: explicit missing, non-thread and malformed selectors create no thr const legacy = ctx.call('human', 'thread.create', { project, name: 'Default' }); assert.equal(legacy.instance, 'assistant'); }); + + +test('C2-09a: creative bindLaunch without a thread refuses thread-required', t => { + const creative = ['companion', 'ideas', 'research', 'proofreader', 'fact-checker', 'continuity']; + const extra = Object.fromEntries(creative.map((definition, i) => [`creative${i}`, { definition, authority: { withinRole: ['message.send'], crossRole: [] } }])); + const ctx = setup(t, demo({ roles: { ...roles, ...extra }, definitions: { + ...definitions, ...Object.fromEntries(creative.map(definition => [definition, {}])), + } })); + for (const instance of Object.keys(extra)) { + assert.throws(() => ctx.launch(`unthreaded-${instance}`, instance), { code: 'thread-required' }); + } + assert.equal(ctx.count('SELECT count(*) n FROM threads'), 0); + assert.equal(ctx.count('SELECT count(*) n FROM role_claims'), 0); +}); From b899095e482cb2b68919efff1e332f272203e017 Mon Sep 17 00:00:00 2001 From: Rocko Date: Fri, 23 Oct 2026 03:43:53 -0500 Subject: [PATCH 8/8] docs: preserve row 219 mos-1429 short-run evidence --- agents/rocko/work/queue-219/r4/BUILD.md | 15 + .../work/queue-219/r4/packet-manifest.sha256 | 15 +- .../queue-219/r4/short-run/T24-receipt.txt | 38 +++ .../rocko/work/queue-219/r4/short-run/T24.tap | 38 +++ .../r4/short-run/cwd-sweep-final.json | 1 + .../queue-219/r4/short-run/cwd-sweep.json | 1 + .../r4/short-run/green-grant-executor.tap | 262 ++++++++++++++++++ .../r4/short-run/green-project-runtime.tap | 28 ++ .../queue-219/r4/short-run/green-threads.tap | 130 +++++++++ .../work/queue-219/r4/short-run/head.json | 1 + .../work/queue-219/r4/short-run/red-grant.tap | 26 ++ .../work/queue-219/r4/short-run/red-pin.tap | 58 ++++ .../work/queue-219/r4/short-run/restored.json | 1 + .../work/queue-219/r4/short-run/results.jsonl | 6 + .../work/queue-219/r4/short-run/runner.py | 55 ++++ 15 files changed, 674 insertions(+), 1 deletion(-) create mode 100644 agents/rocko/work/queue-219/r4/short-run/T24-receipt.txt create mode 100644 agents/rocko/work/queue-219/r4/short-run/T24.tap create mode 100644 agents/rocko/work/queue-219/r4/short-run/cwd-sweep-final.json create mode 100644 agents/rocko/work/queue-219/r4/short-run/cwd-sweep.json create mode 100644 agents/rocko/work/queue-219/r4/short-run/green-grant-executor.tap create mode 100644 agents/rocko/work/queue-219/r4/short-run/green-project-runtime.tap create mode 100644 agents/rocko/work/queue-219/r4/short-run/green-threads.tap create mode 100644 agents/rocko/work/queue-219/r4/short-run/head.json create mode 100644 agents/rocko/work/queue-219/r4/short-run/red-grant.tap create mode 100644 agents/rocko/work/queue-219/r4/short-run/red-pin.tap create mode 100644 agents/rocko/work/queue-219/r4/short-run/restored.json create mode 100644 agents/rocko/work/queue-219/r4/short-run/results.jsonl create mode 100644 agents/rocko/work/queue-219/r4/short-run/runner.py diff --git a/agents/rocko/work/queue-219/r4/BUILD.md b/agents/rocko/work/queue-219/r4/BUILD.md index ef8dcfc41..ef570bc34 100644 --- a/agents/rocko/work/queue-219/r4/BUILD.md +++ b/agents/rocko/work/queue-219/r4/BUILD.md @@ -5,3 +5,18 @@ and new direct broker bindLaunch regression. See root BUILD.md and the assertion-preservation JSON/diff. Red-first evidence awaits Sage CLEAR. No product changes; root and this round list16 paths. T24 is new; T01 now targets the direct creative bind refusal. 24 mutants in the full run. + +## Short slot receipt, sage-3302 + +2026-10-23 08:41:20Z-08:41:45Z, HEAD 7e70de9e6, manifest +451d3fcbeb6a41c3a505600898ba2025985f44d8391e2cd823ab84f1d4b50621. +Detached bfa421b6c reds: sage-1908 thread-required at bindLaunch; +project-runtime ERR_ASSERTION on exact singular/plural import pin. +Whole green files: grant-executor 42/0/0, project-runtime 3/0/0, +threads 20/0/0, total 65/0/0, no cancellations or skips. +T24 assertion-killed. Its exact failure was "Expected values to be strictly +equal", actual 'decision-required', expected 'host-creative-role', code +ERR_ASSERTION. Removing the creative guard reaches the later decision-required +fence; this is a code-mismatch kill, not proof that host.run executed. +All 16 hashes restored, cwd node/chromium sweep empty. Raw TAP and per-stage +exit/duration/counts are in short-run/. No unexpected red and no retry. diff --git a/agents/rocko/work/queue-219/r4/packet-manifest.sha256 b/agents/rocko/work/queue-219/r4/packet-manifest.sha256 index 28b121e5e..54c10218a 100644 --- a/agents/rocko/work/queue-219/r4/packet-manifest.sha256 +++ b/agents/rocko/work/queue-219/r4/packet-manifest.sha256 @@ -1,4 +1,4 @@ -5d6dae09c07f34332cc939a58610cb0659e1be36400304e0d3eef479bbcdc0d0 BUILD.md +cc98e830b5f8d0a34149e602775f154642e3f5e09cd42427e9deb49c84663fca BUILD.md 2ce65e27aeb4cc563dbe179efbf5a120d6ac48f597e477c3648e58d28d829082 SHORT-RUN-PLAN.md 5209e39f588a709962baae627fa0e66a3bf6ed7d6fe66ca3ec4dce16850ddc47 approved-tests.diff b05b00cd9f352219b88772e78c055c329fddf5e6b3ad4d4b1067e81ab235e418 assertion-preservation.json @@ -6,3 +6,16 @@ d7e1b464a314c7b079385f0a14a53189fe839d72d7666729026ffcb9d16a0faa base.txt deb5e2ff721c3b5adc1390c4aaef2d8aaf4f792edbd4e6b2d4766421222c406a build.patch 451d3fcbeb6a41c3a505600898ba2025985f44d8391e2cd823ab84f1d4b50621 candidate-manifest.sha256 5222c9f6d7c1da26f5b9447626ba8e005a7ab36006183ed36df40190b9133fb4 changed-paths.txt +0cd14e6b9ea80f71ede6757e8430052246bb1f5c96c165133b1fa9b467d05262 short-run/T24-receipt.txt +0cd14e6b9ea80f71ede6757e8430052246bb1f5c96c165133b1fa9b467d05262 short-run/T24.tap +4f53cda18c2baa0c0354bb5f9a3ecbe5ed12ab4d8e11ba873c2f11161202b945 short-run/cwd-sweep-final.json +4f53cda18c2baa0c0354bb5f9a3ecbe5ed12ab4d8e11ba873c2f11161202b945 short-run/cwd-sweep.json +37c331032ac90730c9a3cabae0c467fb0dd5c1991cda5ff98b0fc5d1a553e7b4 short-run/green-grant-executor.tap +d47f011e509107304b01c7f9037af7dfe1d06a45959309d21066c9755a3353b5 short-run/green-project-runtime.tap +f52f3afbd058dd2c6dcf84ed1f3eb69bd4040df599c6f80b30fc60e7837de85b short-run/green-threads.tap +b85b47bbd1cea535817b3077f109be91c703fbaacee4a1fd8d1d6f08acf24c8c short-run/head.json +fdc8c9854f7dbed2d7ebb3da403dac0c88bc2ae6596fb1fa0d9fc5f865f244a0 short-run/red-grant.tap +3033a3f85b738ff2a4c06e90973348fadfa6fc7c16c8192f6c4407bccffdb587 short-run/red-pin.tap +1294cda16078dc1800b800fcf4d4410c89bce9687bd510068d22c3b1eed32c16 short-run/restored.json +72675fa1a56c9e567bea82b4f6897ee3766472b8545f69b3b9e3909532a24500 short-run/results.jsonl +835ab90ef7f52aca6260e13017795cc4102c6dd3267f5ce6d5ca0684aa606029 short-run/runner.py diff --git a/agents/rocko/work/queue-219/r4/short-run/T24-receipt.txt b/agents/rocko/work/queue-219/r4/short-run/T24-receipt.txt new file mode 100644 index 000000000..637ba221c --- /dev/null +++ b/agents/rocko/work/queue-219/r4/short-run/T24-receipt.txt @@ -0,0 +1,38 @@ +TAP version 13 +# Subtest: sage-1908: once the agent of an applied grant is a creative role, host.run refuses host-creative-role, runs nothing remote and keeps the record +not ok 1 - sage-1908: once the agent of an applied grant is a creative role, host.run refuses host-creative-role, runs nothing remote and keeps the record + --- + duration_ms: 541.339182 + type: 'test' + location: '/mnt/storage/scratch/rocko-r219/packages/bus/tests/grant-executor.test.mjs:1046:1' + failureType: 'testCodeFailure' + error: |- + Expected values to be strictly equal: + + actual - expected + + + 'decision-required' + - 'host-creative-role' + + code: 'ERR_ASSERTION' + name: 'AssertionError' + expected: 'host-creative-role' + actual: 'decision-required' + operator: 'strictEqual' + stack: |- + Object. (file:///mnt/storage/scratch/rocko-r219/packages/bus/tests/grant-executor.test.mjs:703:103) + expectedException (node:assert:547:17) + expectsError (node:assert:672:21) + strict.rejects (node:assert:738:3) + async TestContext. (file:///mnt/storage/scratch/rocko-r219/packages/bus/tests/grant-executor.test.mjs:1057:3) + async Test.run (node:internal/test_runner/test:1409:7) + async startSubtestAfterBootstrap (node:internal/test_runner/harness:387:3) + ... +1..1 +# tests 1 +# suites 0 +# pass 0 +# fail 1 +# cancelled 0 +# skipped 0 +# todo 0 +# duration_ms 619.444691 diff --git a/agents/rocko/work/queue-219/r4/short-run/T24.tap b/agents/rocko/work/queue-219/r4/short-run/T24.tap new file mode 100644 index 000000000..637ba221c --- /dev/null +++ b/agents/rocko/work/queue-219/r4/short-run/T24.tap @@ -0,0 +1,38 @@ +TAP version 13 +# Subtest: sage-1908: once the agent of an applied grant is a creative role, host.run refuses host-creative-role, runs nothing remote and keeps the record +not ok 1 - sage-1908: once the agent of an applied grant is a creative role, host.run refuses host-creative-role, runs nothing remote and keeps the record + --- + duration_ms: 541.339182 + type: 'test' + location: '/mnt/storage/scratch/rocko-r219/packages/bus/tests/grant-executor.test.mjs:1046:1' + failureType: 'testCodeFailure' + error: |- + Expected values to be strictly equal: + + actual - expected + + + 'decision-required' + - 'host-creative-role' + + code: 'ERR_ASSERTION' + name: 'AssertionError' + expected: 'host-creative-role' + actual: 'decision-required' + operator: 'strictEqual' + stack: |- + Object. (file:///mnt/storage/scratch/rocko-r219/packages/bus/tests/grant-executor.test.mjs:703:103) + expectedException (node:assert:547:17) + expectsError (node:assert:672:21) + strict.rejects (node:assert:738:3) + async TestContext. (file:///mnt/storage/scratch/rocko-r219/packages/bus/tests/grant-executor.test.mjs:1057:3) + async Test.run (node:internal/test_runner/test:1409:7) + async startSubtestAfterBootstrap (node:internal/test_runner/harness:387:3) + ... +1..1 +# tests 1 +# suites 0 +# pass 0 +# fail 1 +# cancelled 0 +# skipped 0 +# todo 0 +# duration_ms 619.444691 diff --git a/agents/rocko/work/queue-219/r4/short-run/cwd-sweep-final.json b/agents/rocko/work/queue-219/r4/short-run/cwd-sweep-final.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/agents/rocko/work/queue-219/r4/short-run/cwd-sweep-final.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/agents/rocko/work/queue-219/r4/short-run/cwd-sweep.json b/agents/rocko/work/queue-219/r4/short-run/cwd-sweep.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/agents/rocko/work/queue-219/r4/short-run/cwd-sweep.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/agents/rocko/work/queue-219/r4/short-run/green-grant-executor.tap b/agents/rocko/work/queue-219/r4/short-run/green-grant-executor.tap new file mode 100644 index 000000000..4e1156315 --- /dev/null +++ b/agents/rocko/work/queue-219/r4/short-run/green-grant-executor.tap @@ -0,0 +1,262 @@ +TAP version 13 +# Subtest: row 280: an occupied TCP port is attempted, refused, and retried with our sshd +ok 1 - row 280: an occupied TCP port is attempted, refused, and retried with our sshd + --- + duration_ms: 84.725551 + type: 'test' + ... +# Subtest: row 280: every injected picker sample is unprivileged and outside the ephemeral range +ok 2 - row 280: every injected picker sample is unprivileged and outside the ephemeral range + --- + duration_ms: 0.343983 + type: 'test' + ... +# Subtest: G7: an Approve installs the tagged line, logs in with the new key, and writes the key file, record and grant.applied +ok 3 - G7: an Approve installs the tagged line, logs in with the new key, and writes the key file, record and grant.applied + --- + duration_ms: 657.889711 + type: 'test' + ... +# Subtest: G7: a commands change on a live grant updates the record in one transaction and keeps the key and line +ok 4 - G7: a commands change on a live grant updates the record in one transaction and keeps the key and line + --- + duration_ms: 531.188801 + type: 'test' + ... +# Subtest: G8: a failure at install or verify removes the line and leaves no record, key file or reference +ok 5 - G8: a failure at install or verify removes the line and leaves no record, key file or reference + --- + duration_ms: 1502.744543 + type: 'test' + ... +# Subtest: G8: a failed remove adds hostLineLeft and tells the human to sweep +ok 6 - G8: a failed remove adds hostLineLeft and tells the human to sweep + --- + duration_ms: 645.757376 + type: 'test' + ... +# Subtest: G8: a failure in step 5 before commit unlinks the key file, drops the reference and removes the line +ok 7 - G8: a failure in step 5 before commit unlinks the key file, drops the reference and removes the line + --- + duration_ms: 632.923531 + type: 'test' + ... +# Subtest: G8: a store fault in the commit transaction ends host-failed with no record, key file, reference or line +ok 8 - G8: a store fault in the commit transaction ends host-failed with no record, key file, reference or line + --- + duration_ms: 648.03379 + type: 'test' + ... +# Subtest: G8: a failed step 1 check spends the decision and runs nothing remote +ok 9 - G8: a failed step 1 check spends the decision and runs nothing remote + --- + duration_ms: 82.428566 + type: 'test' + ... +# Subtest: G9: a registry, definition or commands change between raise and Approve ends decision-mismatch before any remote step +ok 10 - G9: a registry, definition or commands change between raise and Approve ends decision-mismatch before any remote step + --- + duration_ms: 519.400918 + type: 'test' + ... +# Subtest: G9: an agent no longer a role or no longer declaring host ends with its code, spent +ok 11 - G9: an agent no longer a role or no longer declaring host ends with its code, spent + --- + duration_ms: 69.103063 + type: 'test' + ... +# Subtest: G10: a second start refuses decision-consumed, and an unresolved or agent-resolved decision not-authorized, writing nothing +ok 12 - G10: a second start refuses decision-consumed, and an unresolved or agent-resolved decision not-authorized, writing nothing + --- + duration_ms: 511.259562 + type: 'test' + ... +# Subtest: G15: no event, message or decision holds the private key +ok 13 - G15: no event, message or decision holds the private key + --- + duration_ms: 490.757332 + type: 'test' + ... +# Subtest: G23: a revoke during install ends grant.failed revoked with no key file, no grant and no line +ok 14 - G23: a revoke during install ends grant.failed revoked with no key file, no grant and no line + --- + duration_ms: 526.257653 + type: 'test' + ... +# Subtest: G23 (row 249): an add that writes after an abort's remove leaves hostLineLeft until the sweep +ok 15 - G23 (row 249): an add that writes after an abort's remove leaves hostLineLeft until the sweep + --- + duration_ms: 871.678557 + type: 'test' + ... +# Subtest: G23 (row 249): an add that writes after a timed-out install's remove leaves hostLineLeft until the sweep +ok 16 - G23 (row 249): an add that writes after a timed-out install's remove leaves hostLineLeft until the sweep + --- + duration_ms: 864.787135 + type: 'test' + ... +# Subtest: G23: a revoke recorded after the raise and before the start ends step 1 revoked, and a held slot ends host-busy +ok 17 - G23: a revoke recorded after the raise and before the start ends step 1 revoked, and a held slot ends host-busy + --- + duration_ms: 523.685406 + type: 'test' + ... +# Subtest: G24: names at 64 characters with . and _ give distinct tags of the fixed length +ok 18 - G24: names at 64 characters with . and _ give distinct tags of the fixed length + --- + duration_ms: 0.44828 + type: 'test' + ... +# Subtest: G11: a restart after install removes the line, then ends interrupted with the tag, holding the slot until then +ok 19 - G11: a restart after install removes the line, then ends interrupted with the tag, holding the slot until then + --- + duration_ms: 217.311491 + type: 'test' + ... +# Subtest: G11: a restart after a new key's commit, with the key file written, ends with no key file, record, reference or line +ok 20 - G11: a restart after a new key's commit, with the key file written, ends with no key file, record, reference or line + --- + duration_ms: 213.431823 + type: 'test' + ... +# Subtest: G11: a restart after a commands change's commit leaves the record as it was and asks nothing of the host +ok 21 - G11: a restart after a commands change's commit leaves the record as it was and asks nothing of the host + --- + duration_ms: 514.743857 + type: 'test' + ... +# Subtest: G11 (B2): a restart before step 1, spent or not yet spent, ends interrupted and nothing runs later +ok 22 - G11 (B2): a restart before step 1, spent or not yet spent, ends interrupted and nothing runs later + --- + duration_ms: 67.778309 + type: 'test' + ... +# Subtest: G11: a remote undo that fails ends interrupted with hostLineLeft and the sweep hint +ok 23 - G11: a remote undo that fails ends interrupted with hostLineLeft and the sweep hint + --- + duration_ms: 283.505936 + type: 'test' + ... +# Subtest: G11: a restart leaves a finished grant alone, and the reconcile adds nothing for it +ok 24 - G11: a restart leaves a finished grant alone, and the reconcile adds nothing for it + --- + duration_ms: 532.803771 + type: 'test' + ... +# Subtest: N1 (G27): the start sweep unlinks host. files with no record in loaded businesses only, and refuses a store dir that is not private +ok 25 - N1 (G27): the start sweep unlinks host. files with no record in loaded businesses only, and refuses a store dir that is not private + --- + duration_ms: 10.401722 + type: 'test' + ... +# Subtest: G12: the human's hosts.revoke deletes the record, the key file, the reference and the line, with a closed marker +ok 26 - G12: the human's hosts.revoke deletes the record, the key file, the reference and the line, with a closed marker + --- + duration_ms: 680.673474 + type: 'test' + ... +# Subtest: G12 (N4): a revoke with no record still removes the computed tag's line, with granted false; bad args refuse +ok 27 - G12 (N4): a revoke with no record still removes the computed tag's line, with granted false; bad args refuse + --- + duration_ms: 210.775767 + type: 'test' + ... +# Subtest: G13: a revoke during install aborts the executor, which ends revoked, and the line goes +ok 28 - G13: a revoke during install aborts the executor, which ends revoked, and the line goes + --- + duration_ms: 539.460127 + type: 'test' + ... +# Subtest: G26: the human, the assistant and the tester revoke; the chief and a pm refuse; sweep is the human's or the tester's +ok 29 - G26: the human, the assistant and the tester revoke; the chief and a pm refuse; sweep is the human's or the tester's + --- + duration_ms: 509.503577 + type: 'test' + ... +# Subtest: row 281 T8: a tester hosts.revoke refuses tester-dev-only once bus.tester is off, and a human revoke writes no job records +ok 30 - row 281 T8: a tester hosts.revoke refuses tester-dev-only once bus.tester is off, and a human revoke writes no job records + --- + duration_ms: 651.604822 + type: 'test' + ... +# Subtest: G27: a restart after step 1 sweeps the key file and runs step 3 once the bus is up; status shows the revoke until then +ok 31 - G27: a restart after step 1 sweeps the key file and runs step 3 once the bus is up; status shows the revoke until then + --- + duration_ms: 660.602104 + type: 'test' + ... +# Subtest: G27: after step 2 with the host down, the restart closes the marker with hostLineLeft; a marker without a revoke id is not reopened +ok 32 - G27: after step 2 with the host down, the restart closes the marker with hostLineLeft; a marker without a revoke id is not reopened + --- + duration_ms: 960.616547 + type: 'test' + ... +# Subtest: G27: a key file a revoke could not unlink is reported left and goes at the next start +ok 33 - G27: a key file a revoke could not unlink is reported left and goes at the next start + --- + duration_ms: 659.246715 + type: 'test' + ... +# Subtest: G28: a commands change, then a revoke, then a restart leave no record, key, reference or line +ok 34 - G28: a commands change, then a revoke, then a restart leave no record, key, reference or line + --- + duration_ms: 679.404671 + type: 'test' + ... +# Subtest: G24 (B4): hosts.sweep removes only this business's recorded tags no live grant holds, and records what it left +ok 35 - G24 (B4): hosts.sweep removes only this business's recorded tags no live grant holds, and records what it left + --- + duration_ms: 957.711463 + type: 'test' + ... +# Subtest: G12: the local steps finish before the host step, so a host that hangs leaves the agent no access +ok 36 - G12: the local steps finish before the host step, so a host that hangs leaves the agent no access + --- + duration_ms: 707.712192 + type: 'test' + ... +# Subtest: G23 (X5): a revoke right after the spend reaches the executor's claim, so the grant ends revoked +ok 37 - G23 (X5): a revoke right after the spend reaches the executor's claim, so the grant ends revoked + --- + duration_ms: 213.272659 + type: 'test' + ... +# Subtest: G23 (X5): a revoke that lands as verify returns ends revoked with no record, key file or line +ok 38 - G23 (X5): a revoke that lands as verify returns ends revoked with no record, key file or line + --- + duration_ms: 650.086388 + type: 'test' + ... +# Subtest: G13: a revoke whose host remove fails still drops the record and key, and reports the line left for a sweep +ok 39 - G13: a revoke whose host remove fails still drops the record and key, and reports the line left for a sweep + --- + duration_ms: 656.97494 + type: 'test' + ... +# Subtest: G22: enroll, check, grant, host.run, a commands change the next host.run uses, and a revoke that kills a run in flight +ok 40 - G22: enroll, check, grant, host.run, a commands change the next host.run uses, and a revoke that kills a run in flight + --- + duration_ms: 1161.98276 + type: 'test' + ... +# Subtest: mos-1163: a grant whose agent became a creative role after the raise ends host-creative-role at step 1, spent, with nothing remote +ok 41 - mos-1163: a grant whose agent became a creative role after the raise ends host-creative-role at step 1, spent, with nothing remote + --- + duration_ms: 64.270391 + type: 'test' + ... +# Subtest: sage-1908: once the agent of an applied grant is a creative role, host.run refuses host-creative-role, runs nothing remote and keeps the record +ok 42 - sage-1908: once the agent of an applied grant is a creative role, host.run refuses host-creative-role, runs nothing remote and keeps the record + --- + duration_ms: 513.54277 + type: 'test' + ... +1..42 +# tests 42 +# suites 0 +# pass 42 +# fail 0 +# cancelled 0 +# skipped 0 +# todo 0 +# duration_ms 21560.094474 diff --git a/agents/rocko/work/queue-219/r4/short-run/green-project-runtime.tap b/agents/rocko/work/queue-219/r4/short-run/green-project-runtime.tap new file mode 100644 index 000000000..ef3c6d9a2 --- /dev/null +++ b/agents/rocko/work/queue-219/r4/short-run/green-project-runtime.tap @@ -0,0 +1,28 @@ +TAP version 13 +# Subtest: Broker keeps the sandbox client import closure: only the listed imports, no lazy project import +ok 1 - Broker keeps the sandbox client import closure: only the listed imports, no lazy project import + --- + duration_ms: 2.134902 + type: 'test' + ... +# Subtest: without a trusted project adapter all three async paths refuse project-not-configured +ok 2 - without a trusted project adapter all three async paths refuse project-not-configured + --- + duration_ms: 40.098809 + type: 'test' + ... +# Subtest: real startBroker injects the project adapter for socket reads and bound-author record writes +ok 3 - real startBroker injects the project adapter for socket reads and bound-author record writes + --- + duration_ms: 195.816084 + type: 'test' + ... +1..3 +# tests 3 +# suites 0 +# pass 3 +# fail 0 +# cancelled 0 +# skipped 0 +# todo 0 +# duration_ms 346.858932 diff --git a/agents/rocko/work/queue-219/r4/short-run/green-threads.tap b/agents/rocko/work/queue-219/r4/short-run/green-threads.tap new file mode 100644 index 000000000..ddb6aef40 --- /dev/null +++ b/agents/rocko/work/queue-219/r4/short-run/green-threads.tap @@ -0,0 +1,130 @@ +TAP version 13 +# Subtest: REQ-ROLE-2 REQ-THREAD-1: one holder per thread, through the broker and the trigger +ok 1 - REQ-ROLE-2 REQ-THREAD-1: one holder per thread, through the broker and the trigger + --- + duration_ms: 37.881537 + type: 'test' + ... +# Subtest: REQ-ROLE-2 REQ-THREAD-1: the 3e triggers refuse writes that skip the broker +ok 2 - REQ-ROLE-2 REQ-THREAD-1: the 3e triggers refuse writes that skip the broker + --- + duration_ms: 66.86806 + type: 'test' + ... +# Subtest: REQ-MSG-1: a message to or from the assistant names its thread, or is refused +ok 3 - REQ-MSG-1: a message to or from the assistant names its thread, or is refused + --- + duration_ms: 31.783414 + type: 'test' + ... +# Subtest: REQ-MSG-1: the chief of staff's reply comes back to the thread that sent the work +ok 4 - REQ-MSG-1: the chief of staff's reply comes back to the thread that sent the work + --- + duration_ms: 612.146473 + type: 'test' + ... +# Subtest: REQ-MSG-1: a reply can't carry one thread instance's thread to another thread instance +ok 5 - REQ-MSG-1: a reply can't carry one thread instance's thread to another thread instance + --- + duration_ms: 25.313669 + type: 'test' + ... +# Subtest: REQ-THREAD-1 REQ-USER-2: one thread's messages never reach another thread's holder +ok 6 - REQ-THREAD-1 REQ-USER-2: one thread's messages never reach another thread's holder + --- + duration_ms: 29.786654 + type: 'test' + ... +# Subtest: REQ-LAUNCH-1: a message to a thread with no holder waits, and the next holder gets it +ok 7 - REQ-LAUNCH-1: a message to a thread with no holder waits, and the next holder gets it + --- + duration_ms: 32.078895 + type: 'test' + ... +# Subtest: REQ-THREAD-2 REQ-LAUNCH-1: threadIdle releases only a thread with nothing waiting, and only for its holder +ok 8 - REQ-THREAD-2 REQ-LAUNCH-1: threadIdle releases only a thread with nothing waiting, and only for its holder + --- + duration_ms: 36.18567 + type: 'test' + ... +# Subtest: REQ-THREAD-2 REQ-LAUNCH-1: a message delivered to a run that ended unread doesn't hold up the next holder +ok 9 - REQ-THREAD-2 REQ-LAUNCH-1: a message delivered to a run that ended unread doesn't hold up the next holder + --- + duration_ms: 30.574839 + type: 'test' + ... +# Subtest: REQ-ROLE-2 REQ-THREAD-1 Q169: a role.revoke the human approved ends every thread run of the assistant +ok 10 - REQ-ROLE-2 REQ-THREAD-1 Q169: a role.revoke the human approved ends every thread run of the assistant + --- + duration_ms: 28.11449 + type: 'test' + ... +# Subtest: Q169 REQ-USER-2: assistant.stop ends the human's own assistant thread runs, and only the human's +ok 11 - Q169 REQ-USER-2: assistant.stop ends the human's own assistant thread runs, and only the human's + --- + duration_ms: 40.031837 + type: 'test' + ... +# Subtest: REQ-USER-2: the human verbs refuse another owner's thread +ok 12 - REQ-USER-2: the human verbs refuse another owner's thread + --- + duration_ms: 28.629823 + type: 'test' + ... +# Subtest: REQ-THREAD-1: thread.create refuses when the business has no thread instance or more than one +ok 13 - REQ-THREAD-1: thread.create refuses when the business has no thread instance or more than one + --- + duration_ms: 23.227988 + type: 'test' + ... +# Subtest: REQ-ORG-2: projects and threads are named once, and the repo names a business project +ok 14 - REQ-ORG-2: projects and threads are named once, and the repo names a business project + --- + duration_ms: 24.842387 + type: 'test' + ... +# Subtest: REQ-THREAD-2: thread.messages returns the thread's history in pages and writes nothing +ok 15 - REQ-THREAD-2: thread.messages returns the thread's history in pages and writes nothing + --- + duration_ms: 90.053907 + type: 'test' + ... +# Subtest: project.create refuses a repository name without its matching repo before any write +ok 16 - project.create refuses a repository name without its matching repo before any write + --- + duration_ms: 16.171096 + type: 'test' + ... +# Subtest: project.create keeps unrelated names with and without a repository +ok 17 - project.create keeps unrelated names with and without a repository + --- + duration_ms: 12.013106 + type: 'test' + ... +# Subtest: C2-09a: explicit creative instances bind independent threads, default sessions and holders +ok 18 - C2-09a: explicit creative instances bind independent threads, default sessions and holders + --- + duration_ms: 48.182262 + type: 'test' + ... +# Subtest: C2-09a: explicit missing, non-thread and malformed selectors create no thread or session +ok 19 - C2-09a: explicit missing, non-thread and malformed selectors create no thread or session + --- + duration_ms: 21.103961 + type: 'test' + ... +# Subtest: C2-09a: creative bindLaunch without a thread refuses thread-required +ok 20 - C2-09a: creative bindLaunch without a thread refuses thread-required + --- + duration_ms: 10.557239 + type: 'test' + ... +1..20 +# tests 20 +# suites 0 +# pass 20 +# fail 0 +# cancelled 0 +# skipped 0 +# todo 0 +# duration_ms 1330.269155 diff --git a/agents/rocko/work/queue-219/r4/short-run/head.json b/agents/rocko/work/queue-219/r4/short-run/head.json new file mode 100644 index 000000000..dcfcc928b --- /dev/null +++ b/agents/rocko/work/queue-219/r4/short-run/head.json @@ -0,0 +1 @@ +{"head": "7e70de9e68ba48d761a45894d037239b5d576a38", "red": "bfa421b6cd9b2b54d8da119e73b004aeafe606c3", "manifest": "451d3fcbeb6a41c3a505600898ba2025985f44d8391e2cd823ab84f1d4b50621", "start": "2026-10-23T08:41:20.461140+00:00"} \ No newline at end of file diff --git a/agents/rocko/work/queue-219/r4/short-run/red-grant.tap b/agents/rocko/work/queue-219/r4/short-run/red-grant.tap new file mode 100644 index 000000000..4c3cba0a5 --- /dev/null +++ b/agents/rocko/work/queue-219/r4/short-run/red-grant.tap @@ -0,0 +1,26 @@ +TAP version 13 +# Subtest: sage-1908: once the agent of an applied grant is a creative role, host.run refuses host-creative-role, runs nothing remote and keeps the record +not ok 1 - sage-1908: once the agent of an applied grant is a creative role, host.run refuses host-creative-role, runs nothing remote and keeps the record + --- + duration_ms: 526.66272 + type: 'test' + location: '/mnt/storage/scratch/rocko-r219-red-mos1429/packages/bus/tests/grant-executor.test.mjs:1046:1' + failureType: 'testCodeFailure' + error: 'thread-required' + code: 'thread-required' + stack: |- + fail (file:///mnt/storage/scratch/rocko-r219-red-mos1429/packages/bus/src/broker.mjs:209:9) + Broker.bindLaunch (file:///mnt/storage/scratch/rocko-r219-red-mos1429/packages/bus/src/broker.mjs:1258:40) + TestContext. (file:///mnt/storage/scratch/rocko-r219-red-mos1429/packages/bus/tests/grant-executor.test.mjs:1050:24) + async Test.run (node:internal/test_runner/test:1409:7) + async startSubtestAfterBootstrap (node:internal/test_runner/harness:387:3) + ... +1..1 +# tests 1 +# suites 0 +# pass 0 +# fail 1 +# cancelled 0 +# skipped 0 +# todo 0 +# duration_ms 610.366811 diff --git a/agents/rocko/work/queue-219/r4/short-run/red-pin.tap b/agents/rocko/work/queue-219/r4/short-run/red-pin.tap new file mode 100644 index 000000000..edf6a1acb --- /dev/null +++ b/agents/rocko/work/queue-219/r4/short-run/red-pin.tap @@ -0,0 +1,58 @@ +TAP version 13 +# Subtest: Broker keeps the sandbox client import closure: only the listed imports, no lazy project import +not ok 1 - Broker keeps the sandbox client import closure: only the listed imports, no lazy project import + --- + duration_ms: 2.490892 + type: 'test' + location: '/mnt/storage/scratch/rocko-r219-red-mos1429/packages/bus/tests/project-runtime.test.mjs:12:1' + failureType: 'testCodeFailure' + error: |- + Expected values to be strictly deep-equal: + + actual - expected + + [ + "import { randomUUID, randomBytes, createHash } from 'node:crypto';", + "import { isAbsolute, dirname } from 'node:path';", + "import { initializeControl, processingStatus } from '../../processing-control/src/state.mjs';", + "import { NAME as HARNESS_NAME } from '../../plugins/src/kinds.mjs';", + "import { loadRequirements } from '../../tasks/src/requirements.mjs';", + "import { MERGE, LandingRefusal, readLanding } from './landing.mjs';", + + "import { ID_PATTERN, THREAD_DEFINITIONS, END_PROTECTED, forkProblem, forkUrl, credentialKind, validArgv, commandAllowed, HOST_ID, CREATIVE_DEFINITIONS, unhireableAction, giteaName, parseGiteaUrl, covers } from '../../business/src/vocabulary.mjs';" + - "import { ID_PATTERN, THREAD_DEFINITION, END_PROTECTED, forkProblem, forkUrl, credentialKind, validArgv, commandAllowed, HOST_ID, CREATIVE_DEFINITIONS, unhireableAction, giteaName, parseGiteaUrl, covers } from '../../business/src/vocabulary.mjs';" + ] + + code: 'ERR_ASSERTION' + name: 'AssertionError' + expected: + 0: "import { randomUUID, randomBytes, createHash } from 'node:crypto';" + 1: "import { isAbsolute, dirname } from 'node:path';" + 2: "import { initializeControl, processingStatus } from '../../processing-control/src/state.mjs';" + 3: "import { NAME as HARNESS_NAME } from '../../plugins/src/kinds.mjs';" + 4: "import { loadRequirements } from '../../tasks/src/requirements.mjs';" + 5: "import { MERGE, LandingRefusal, readLanding } from './landing.mjs';" + 6: "import { ID_PATTERN, THREAD_DEFINITION, END_PROTECTED, forkProblem, forkUrl, credentialKind, validArgv, commandAllowed, HOST_ID, CREATIVE_DEFINITIONS, unhireableAction, giteaName, parseGiteaUrl, covers } from '../../business/src/vocabulary.mjs';" + actual: + 0: "import { randomUUID, randomBytes, createHash } from 'node:crypto';" + 1: "import { isAbsolute, dirname } from 'node:path';" + 2: "import { initializeControl, processingStatus } from '../../processing-control/src/state.mjs';" + 3: "import { NAME as HARNESS_NAME } from '../../plugins/src/kinds.mjs';" + 4: "import { loadRequirements } from '../../tasks/src/requirements.mjs';" + 5: "import { MERGE, LandingRefusal, readLanding } from './landing.mjs';" + 6: "import { ID_PATTERN, THREAD_DEFINITIONS, END_PROTECTED, forkProblem, forkUrl, credentialKind, validArgv, commandAllowed, HOST_ID, CREATIVE_DEFINITIONS, unhireableAction, giteaName, parseGiteaUrl, covers } from '../../business/src/vocabulary.mjs';" + operator: 'deepStrictEqual' + stack: |- + TestContext. (file:///mnt/storage/scratch/rocko-r219-red-mos1429/packages/bus/tests/project-runtime.test.mjs:14:10) + Test.runInAsyncScope (node:async_hooks:226:14) + Test.run (node:internal/test_runner/test:1402:25) + Test.start (node:internal/test_runner/test:1262:17) + startSubtestAfterBootstrap (node:internal/test_runner/harness:387:17) + ... +1..1 +# tests 1 +# suites 0 +# pass 0 +# fail 1 +# cancelled 0 +# skipped 0 +# todo 0 +# duration_ms 119.366042 diff --git a/agents/rocko/work/queue-219/r4/short-run/restored.json b/agents/rocko/work/queue-219/r4/short-run/restored.json new file mode 100644 index 000000000..ed97d4a33 --- /dev/null +++ b/agents/rocko/work/queue-219/r4/short-run/restored.json @@ -0,0 +1 @@ +{"paths": 16, "drift": [], "head": "7e70de9e68ba48d761a45894d037239b5d576a38", "end": "2026-10-23T08:41:45.374077+00:00"} \ No newline at end of file diff --git a/agents/rocko/work/queue-219/r4/short-run/results.jsonl b/agents/rocko/work/queue-219/r4/short-run/results.jsonl new file mode 100644 index 000000000..a727f9dec --- /dev/null +++ b/agents/rocko/work/queue-219/r4/short-run/results.jsonl @@ -0,0 +1,6 @@ +{"label": "red-grant", "start": "2026-10-23T08:41:20.461387+00:00", "end": "2026-10-23T08:41:21.126907+00:00", "seconds": 0.666, "exit": 1, "counts": {"tests": 1, "pass": 0, "fail": 1, "cancelled": 0, "skipped": 0}, "skips": [], "log": "agents/rocko/work/queue-219/r4/short-run/red-grant.tap"} +{"label": "red-pin", "start": "2026-10-23T08:41:21.130846+00:00", "end": "2026-10-23T08:41:21.295380+00:00", "seconds": 0.165, "exit": 1, "counts": {"tests": 1, "pass": 0, "fail": 1, "cancelled": 0, "skipped": 0}, "skips": [], "log": "agents/rocko/work/queue-219/r4/short-run/red-pin.tap"} +{"label": "green-grant-executor", "start": "2026-10-23T08:41:21.299531+00:00", "end": "2026-10-23T08:41:42.908967+00:00", "seconds": 21.609, "exit": 0, "counts": {"tests": 42, "pass": 42, "fail": 0, "cancelled": 0, "skipped": 0}, "skips": [], "log": "agents/rocko/work/queue-219/r4/short-run/green-grant-executor.tap"} +{"label": "green-project-runtime", "start": "2026-10-23T08:41:42.913276+00:00", "end": "2026-10-23T08:41:43.327996+00:00", "seconds": 0.415, "exit": 0, "counts": {"tests": 3, "pass": 3, "fail": 0, "cancelled": 0, "skipped": 0}, "skips": [], "log": "agents/rocko/work/queue-219/r4/short-run/green-project-runtime.tap"} +{"label": "green-threads", "start": "2026-10-23T08:41:43.331886+00:00", "end": "2026-10-23T08:41:44.698643+00:00", "seconds": 1.367, "exit": 0, "counts": {"tests": 20, "pass": 20, "fail": 0, "cancelled": 0, "skipped": 0}, "skips": [], "log": "agents/rocko/work/queue-219/r4/short-run/green-threads.tap"} +{"label": "T24", "start": "2026-10-23T08:41:44.704293+00:00", "end": "2026-10-23T08:41:45.369841+00:00", "seconds": 0.666, "exit": 1, "counts": {"tests": 1, "pass": 0, "fail": 1, "cancelled": 0, "skipped": 0}, "skips": [], "log": "agents/rocko/work/queue-219/r4/short-run/T24.tap"} diff --git a/agents/rocko/work/queue-219/r4/short-run/runner.py b/agents/rocko/work/queue-219/r4/short-run/runner.py new file mode 100644 index 000000000..d30d8280a --- /dev/null +++ b/agents/rocko/work/queue-219/r4/short-run/runner.py @@ -0,0 +1,55 @@ +from pathlib import Path +import os,subprocess,signal,tempfile,json,re,time,hashlib,shlex +from datetime import datetime,timezone +ROOT=Path('/mnt/storage/scratch/rocko-r219'); RED=Path('/mnt/storage/scratch/rocko-r219-red-mos1429') +P=ROOT/'agents/rocko/work/queue-219';OUT=P/'r4/short-run';OUT.mkdir(exist_ok=True) +HEAD='7e70de9e68ba48d761a45894d037239b5d576a38';OLD='bfa421b6cd9b2b54d8da119e73b004aeafe606c3' +def stamp():return datetime.now(timezone.utc).isoformat() +def verify(): + assert subprocess.check_output(['git','rev-parse','HEAD'],cwd=ROOT,text=True).strip()==HEAD + assert subprocess.check_output(['git','rev-parse','HEAD'],cwd=RED,text=True).strip()==OLD + for line in (P/'candidate-manifest.sha256').read_text().splitlines(): + sha,path=line.split(' ',1);assert hashlib.sha256((ROOT/path).read_bytes()).hexdigest()==sha,path + +def execute(label,root,file,pattern=None): + args=['node','--test','--test-reporter=tap'] + if pattern:args+=['--test-name-pattern',pattern] + args+=[file] + env=os.environ.copy();env.update(TMPDIR=tempfile.mkdtemp(prefix='r',dir='/mnt/storage/scratch/tmp'),DOCKER_HOST='unix:///mnt/storage/scratch/rocko-r219-dead.sock',NO_COLOR='1') + env.pop('MOSAIC_GITEA_CREDENTIAL_FILE',None);env.pop('MOSAIC_LIVE_PROVIDER',None) + log=OUT/(label+'.tap');start=stamp();begin=time.monotonic() + cmd=shlex.join(['timeout','-k','10','300',*args])+' | tee '+shlex.quote(str(log)) + child=subprocess.Popen(['bash','-o','pipefail','-c',cmd],cwd=root,env=env,stdout=subprocess.DEVNULL,stderr=subprocess.STDOUT,start_new_session=True) + try:rc=child.wait(timeout=315) + except subprocess.TimeoutExpired: + os.killpg(child.pid,signal.SIGKILL);child.wait();rc=124 + finally: + try:os.killpg(child.pid,signal.SIGTERM) + except ProcessLookupError:pass + text=log.read_text(errors='replace');counts={k:int(m[-1]) if (m:=re.findall(r'^# '+k+r' (\d+)\s*$',text,re.M)) else None for k in ['tests','pass','fail','cancelled','skipped']} + row=dict(label=label,start=start,end=stamp(),seconds=round(time.monotonic()-begin,3),exit=rc,counts=counts,skips=[x for x in text.splitlines() if re.search(r'^skip\b|# SKIP\b',x,re.I)],log=str(log.relative_to(ROOT))) + with (OUT/'results.jsonl').open('a') as f:f.write(json.dumps(row)+'\n') + print(json.dumps(row),flush=True) + assert rc not in (124,137,-9) and 'SyntaxError:' not in text, 'timeout/syntax '+label + return row,text + +def green(label,file): + verify();r,t=execute(label,ROOT,file) + assert r['exit']==0 and r['counts']['fail']==0 and r['counts']['cancelled']==0 and not re.search(r'^\s*not ok\b',t,re.M),'unexpected red '+label + +verify();(OUT/'head.json').write_text(json.dumps(dict(head=HEAD,red=OLD,manifest=hashlib.sha256((P/'candidate-manifest.sha256').read_bytes()).hexdigest(),start=stamp()))) +pattern='sage-1908: once the agent of an applied grant is a creative role' +r,t=execute('red-grant',RED,'packages/bus/tests/grant-executor.test.mjs',pattern) +assert r['exit']!=0 and r['counts']['fail']==1 and "code: 'thread-required'" in t and 'bindLaunch' in t,'wrong grant red' +verify();r,t=execute('red-pin',RED,'packages/bus/tests/project-runtime.test.mjs','Broker keeps the sandbox client import closure') +assert r['exit']!=0 and r['counts']['fail']==1 and 'ERR_ASSERTION' in t and 'THREAD_DEFINITION' in t,'wrong pin red' +for name in ['grant-executor','project-runtime','threads']:green('green-'+name,'packages/bus/tests/'+name+'.test.mjs') +verify();s=next(x for x in json.loads((P/'mutants.json').read_text()) if x['id']=='T24');path=ROOT/s['file'];saved=path.read_bytes() +try: + text=path.read_text();assert text.count(s['old'])==1;path.write_text(text.replace(s['old'],s['new'],1)) + r,t=execute('T24',ROOT,s['test'],s['pattern']) + assert r['exit']!=0 and r['counts']['fail']==1 and 'ERR_ASSERTION' in t and re.search(r'^\s*not ok \d+ - '+re.escape(pattern),t,re.M),'T24 invalid or survivor' + (OUT/'T24-receipt.txt').write_text(t) +finally:path.write_bytes(saved) +verify();(OUT/'restored.json').write_text(json.dumps(dict(paths=16,drift=[],head=HEAD,end=stamp()))) +print('SHORT_RUN_GREEN',stamp(),flush=True)