FORGE-4: a member the forge refuses after judging raises merge-partial
The call stops merging, says merge-called with what landed and refused, and raises merge-partial (scope delivery, id the call, urgent, resolver operator) in the module's findings; a later call landing every refused member clears it, and forge_partial_clear clears one by hand after the hand-act log took it. Builds: design 47 H §767; H-A-1, H-A-18, H-A-81 Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
// The tools of the forge module's merge calls (novox/hq design 47 H §766, §767): forge_partial_clear clears a call's
|
||||
// merge-partial by hand, written in the hand-act log before it is done.
|
||||
|
||||
import type { ToolDefinition } from "@novox/mesh-sdk/tools";
|
||||
import { callerOf } from "@novox/mesh-sdk/callers";
|
||||
import type { HandAct } from "@novox/mesh-sdk/views";
|
||||
import type { Partials } from "../partials.js";
|
||||
|
||||
const word = (v: unknown): string => (typeof v === "string" ? v.trim() : "");
|
||||
|
||||
export function callTools(partials: Partials, acts: (act: HandAct) => Promise<void>): ToolDefinition[] {
|
||||
return [
|
||||
{
|
||||
name: "forge_partial_clear",
|
||||
description: "Clears the finding merge-partial of one merge call (a call the forge refused a member of after every member was judged), " +
|
||||
"with why, when its refused members are not to be merged. Written in the hand-act log first (design 47 H §767).",
|
||||
input: { type: "object", required: ["call", "why"], properties: {
|
||||
call: { type: "string", description: "the merge call, 16 lowercase hex characters" },
|
||||
why: { type: "string", description: "why it is cleared, in plain words" } } },
|
||||
run: async (args: Record<string, unknown>) => {
|
||||
const call = word(args.call), why = word(args.why);
|
||||
if (!/^[0-9a-f]{16}$/.test(call) || !why) throw new Error("forge_partial_clear names the call (16 lowercase hex characters) and why");
|
||||
const by = callerOf(args);
|
||||
try {
|
||||
await acts({ what: `cleared the merge-partial of the merge call ${call}`, why: `${why} (${by})`, cause: "merge-partial-cleared", verb: "forge_partial_clear" });
|
||||
} catch (err) {
|
||||
throw new Error(`the hand act was not recorded, so nothing was cleared: ${err instanceof Error ? err.message : String(err)}`);
|
||||
}
|
||||
return { call, cleared: await partials.clear(call), why, by };
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user