Rocko's packet agents/rocko/work/queue-73/ (candidate manifest bf4e5ed6, packet manifest 41ffcd5c, 53 files), their BUILD-LOG entry and SESSIONS line. Sage's SESSIONS line for the review request (comment 27467) and row 79 (#1573) for the stale text the packet names. Co-Authored-By: Claude Opus 5.5 <[email protected]>
28 lines
1.9 KiB
JavaScript
28 lines
1.9 KiB
JavaScript
// Probe: what the broker and harness do today with the shipped coder role.
|
|
import { mkdtempSync, rmSync } from 'node:fs';
|
|
import { tmpdir } from 'node:os';
|
|
import { join } from 'node:path';
|
|
const tree = process.argv[2];
|
|
const { Store } = await import(join(tree, 'packages/bus/src/store.mjs'));
|
|
const { Broker } = await import(join(tree, 'packages/bus/src/broker.mjs'));
|
|
const { busBusiness } = await import(join(tree, 'packages/bus/src/business.mjs'));
|
|
const { validateBusinessDocument, resolveInstance } = await import(join(tree, 'packages/business/src/index.mjs'));
|
|
const { businessDoc, REPO_ROLES, systemFor } = await import(join(tree, 'packages/business/tests/helpers.mjs'));
|
|
const { typedTools } = await import(join(tree, 'packages/harness/src/tools.mjs'));
|
|
const root = mkdtempSync(join(tmpdir(), 'r73-probe-'));
|
|
try {
|
|
const business = validateBusinessDocument(businessDoc(root, 'demo'), join(root, 'businesses', 'demo.json'), { rolesDir: REPO_ROLES });
|
|
const resolved = Object.fromEntries(Object.keys(business.roles).map((i) => [i, resolveInstance({ system: systemFor(root), business, instance: i })]));
|
|
const store = new Store(root);
|
|
const b = new Broker({ store, businesses: { demo: busBusiness(business, resolved) } });
|
|
const c = b.bindLaunch({ business: 'demo', role: 'coder', run: 'coder-run', harness: 'pi', address: 'coder-run' });
|
|
b.request(c, { verb: 'role.claim', args: {} });
|
|
const options = [{ key: 'yes', text: 'Allow' }, { key: 'no', text: 'Decline' }];
|
|
for (const action of ['task.reassign', 'task.scope.change']) {
|
|
const d = b.request(c, { verb: 'decision.raise', args: { action, question: 'Allow?', options, recommendation: 'no', blocking: false } });
|
|
console.log(action, 'class', d.class, 'route_to', d.route_to);
|
|
}
|
|
console.log('coder tools with tracker:', typedTools({ resolved: resolved.coder, tracker: true }).map((t) => t.name).join(','));
|
|
store.close();
|
|
} finally { rmSync(root, { recursive: true, force: true }); }
|