morgana: row 277 (#1782) r3: a refused thread.claims prints the role lines and the refusal code (N1), cli README agents usage (N2), per sage-2505
This commit is contained in:
@@ -228,3 +228,19 @@ Early look (sage-2504, 05:27Z), on c050bb90b: thread-claims.test.mjs failed 5/5.
|
||||
helper took any string as a session name, but a run's capability is a string too, so the run's calls
|
||||
went out unauthenticated. T1 also compared null-prototype store rows strictly. Both are test bugs, and
|
||||
the fix is r2 of the build. On r2, thread-claims 5/5, cli tester 9/9, other-tree 4/4 pass, 0 skipped.
|
||||
|
||||
## r3: Duckworth notes N1/N2 (duckworth-0119, ruled sage-2505), for the post-194 rebase round
|
||||
|
||||
- **N1.** A human `mosaic agents` no longer fails as a whole when `thread.claims` is refused.
|
||||
cli.mjs prints the role lines, then `thread claims: refused <code>`, and exits 0. The choice of
|
||||
exit 0 follows D1: `agents` stays as it was, and it exited 0 before this row. Only an error with a
|
||||
bus code is caught (the same `^[a-z-]{1,64}$` shape `markRead` checks); any other error still
|
||||
throws. Pinned by a new test in cli tester.test.mjs: a stand-in transport refuses thread.claims
|
||||
with `processing-halted`, the role row prints, then the refusal line. This matches row 278 item 4
|
||||
for the Console. M8 (the catch drops the refusal line, or rethrows) is killed by that test.
|
||||
- **N2.** packages/cli/README.md: the usage line gains `[--tester]`, and a bullet describes the
|
||||
`thread` lines, the refusal line, `--json` and `--tester`. host.test.mjs:855 reads this README
|
||||
for a unit file name, which is still there. host.test.mjs joins the gate's whole-file runs.
|
||||
|
||||
Manifest adds packages/cli/README.md (10 paths). Nothing here has run yet. It runs whole after the
|
||||
rebase onto 194, on Sage's CLEAR.
|
||||
|
||||
@@ -28,7 +28,7 @@ mosaic inbox [--business <id>] [--json]
|
||||
mosaic inbox --read <id>... | --read-all [--business <id>]
|
||||
mosaic decide <decision> <option> [--note <text>] [--yes] [--business <id>]
|
||||
mosaic tasks [--business <id>] [--json]
|
||||
mosaic agents [--business <id>] [--json]
|
||||
mosaic agents [--business <id>] [--json] [--tester]
|
||||
mosaic trail <task|decision> [--business <id>] [--json]
|
||||
mosaic talk <role> <text> [--wait <seconds> | --follow] [--business <id>]
|
||||
mosaic follow [--business <id>]
|
||||
@@ -78,6 +78,12 @@ mosaic launches list [--json]
|
||||
message that call receives drops out of a later `follow`, like the ones
|
||||
plain `talk` skips, and stays unread in `inbox` until marked. Neither flag
|
||||
takes `--json` or `--tester` (exit 4).
|
||||
- `agents` (row 277, #1782) prints the held roles, then a `thread` line for
|
||||
each held thread claim from the bus verb `thread.claims`: thread id,
|
||||
instance, run, harness and since when. It never prints a thread's name. If
|
||||
the bus refuses `thread.claims`, the role lines still print, then `thread
|
||||
claims: refused <code>`, and the command exits 0. `--json` prints the
|
||||
`agents` array alone, and `--tester` makes only the `agents` call.
|
||||
- `decide` takes the full id, or a unique prefix of at least 8 characters,
|
||||
from the inbox. It prints the decision and whether the choice authorizes
|
||||
or declines, then asks `[y/N]` on a terminal. Without a terminal it needs
|
||||
|
||||
@@ -317,7 +317,15 @@ async function human(verb, rest, io, deps) {
|
||||
// Row 277 (#1782, C1/C2): the human's text output adds the held thread claims. A tester can't read
|
||||
// thread.claims, so --tester makes the one call, and --json stays the agents array.
|
||||
if (json || parsed.flags.has("--tester")) return print(agents, formatAgents);
|
||||
const threads = await call("thread.claims");
|
||||
// Row 277 N1 (sage-2505): `agents` stays as it was, so a refused thread.claims still prints the
|
||||
// role rows, then the refusal with its code. An error without a bus code still throws.
|
||||
let threads;
|
||||
try {
|
||||
threads = await call("thread.claims");
|
||||
} catch (e) {
|
||||
if (typeof e?.code !== "string" || !/^[a-z-]{1,64}$/.test(e.code)) throw e;
|
||||
return print(agents, (list) => `${formatAgents(list)}thread claims: refused ${e.code}\n`);
|
||||
}
|
||||
return print(agents, (list) => formatAgents(list, threads));
|
||||
}
|
||||
|
||||
|
||||
@@ -144,6 +144,22 @@ test("agents --tester makes one call; the human's agents also reads thread.claim
|
||||
assert.deepEqual(JSON.parse(j.out.text), s.b.request(s.human, { verb: "agents", args: {} }));
|
||||
});
|
||||
|
||||
// Row 277 N1 (sage-2505): a refused thread.claims doesn't fail the human's agents. The role rows
|
||||
// print, then the refusal with its code.
|
||||
test("a refused thread.claims still prints the role rows and the refusal's code", async (t) => {
|
||||
const s = setup(t);
|
||||
const refusing = (business) => async (verb, args) => {
|
||||
if (verb !== "thread.claims") return s.deps.transport(business)(verb, args);
|
||||
const error = new Error("processing-halted");
|
||||
error.code = "processing-halted";
|
||||
throw error;
|
||||
};
|
||||
const x = io();
|
||||
await main(["agents", "--business", "demo"], x, { ...s.deps, transport: refusing });
|
||||
assert.match(x.out.text, /^coder coder-run pi since .+\nthread claims: refused processing-halted\n$/);
|
||||
assert.deepEqual(s.calls.human.map((c) => c.verb), ["agents"]);
|
||||
});
|
||||
|
||||
// Row 170 (#1667): the bus refuses a tester's message to a stopped role and stores nothing, and
|
||||
// talk says so and exits 3.
|
||||
test("talk --tester to a stopped role exits 3, prints no sent line and stores nothing", async (t) => {
|
||||
|
||||
Reference in New Issue
Block a user