/** * Public Secretariat (中书省) terminating receipt contracts. * Public terminal domain: converged (署) | escalate (上呈). * (#924) — 原卷保真: the verdict is recognized read-only; no field * is defaulted, rewritten, or dropped (ADR 0055). */ import { Type, type Static } from "typebox"; import { withTerminatingOutputDeclarations } from "./package-contracts/terminating-infrastructure.ts"; export const SECRETARIAT_OUTPUT_TOOL_NAME = "ak_secretariat_output"; /** * 中书省终局回执形状。 * #1134: `secretariatStatus` alone is the trajectory field * (src/packaged-role-registry.ts receiptStatusKey; the public settlement reads * converged | escalate to route); its words ride the description. note/evidence/ * decisionGate are declared name + semantic description only — the string type, the * number type, the nested question/options object shape and the required constraint * are deleted, because the package declaration IS the host's pre-dispatch validator. * (ticketNumber keeps its own declaration: it is the declared seat identity the * activation flag and settlement read, not narrative content.) */ export const secretariatVerdictSchema = withTerminatingOutputDeclarations( Type.Object( { secretariatStatus: Type.Unknown({ description: "converged | escalate", }), ticketNumber: Type.Optional( Type.Unknown({ description: "本票号;署时指向最终正文所在票" }), ), note: Type.Unknown({ description: "附注;署(converged)时逐题列答案、依据与落在哪一句;封还(escalate)时首写「封还」。原样留存。", }), evidence: Type.Optional(Type.Unknown({ description: "留存证据" })), decisionGate: Type.Unknown({ description: "本轮题目:每题 question、options(稿里做法/另一做法)、两边代价、建议。原样留存。", }), }, { additionalProperties: true }, ), ); (secretariatVerdictSchema as unknown as { required: string[] }).required = []; // Reflect the declaration's empty required set and open additional properties, // including the shared terminating fields composed at runtime. export type SecretariatVerdict = Partial> & Record;