C3: the forge module reads failed-steps' fill through the bundle's state call mesh/state.info
Builds: design 47 G §623, A-214 Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
This commit is contained in:
@@ -82,14 +82,14 @@ test("git_failed_steps shows what is held and its fill, and git_failed_steps_dro
|
||||
const { failedStepsTools } = await import("../tools/failedsteps.js");
|
||||
const { runAs } = await import("@novox/mesh-sdk/callers");
|
||||
const { st } = memory();
|
||||
const f = new FailedSteps(st as any);
|
||||
const f = new FailedSteps(st as any, () => {}, () => false, async () => ({ bytes: 4321, keys: 2, max_bytes: 64 * 1024 * 1024 }));
|
||||
await f.stepEnded(ended(C2, "failed"));
|
||||
const acts: any[] = [];
|
||||
let recorded = true;
|
||||
const [read, drop] = failedStepsTools(f, async (a) => { if (!recorded) throw new Error("no hand-act log"); acts.push(a); });
|
||||
const shown: any = await read.run({});
|
||||
assert.deepEqual([shown.failed.map((x: any) => [x.key, x.run]), shown.seen.length, shown.fill.keys, shown.fill.cap],
|
||||
[[["nats.fp-1.unit", "main.7.nats-22"]], 1, 2, 64 * 1024 * 1024]);
|
||||
assert.deepEqual([shown.failed.map((x: any) => [x.key, x.run]), shown.seen.length, shown.fill.keys, shown.fill.bytes, shown.fill.cap],
|
||||
[[["nats.fp-1.unit", "main.7.nats-22"]], 1, 2, 4321, 64 * 1024 * 1024], "the fill is the state call's answer, not counted from the keys");
|
||||
assert.equal(((await read.run({ commit: C1 })) as any).failed.length, 0, "a commit asked for filters");
|
||||
recorded = false;
|
||||
await assert.rejects(runAs({ "mesh/caller": "operator" }, {}, () => drop.run({ key: "nats.fp-1.unit", why: "stale" })), /hand act was not recorded, so nothing was dropped/);
|
||||
|
||||
Reference in New Issue
Block a user