feat(mcp): add opt-in paging for retained unknown heads
Keep complete default delivery and exact filters. Select stable ID pages at the ledger owner before cloning, return filtered totals and continuation offsets, and preserve detached records through the shared session port. Validate public MCP paging, safe-integer edges, snapshot replay and converted JSON Schemas. Document the bounded Flameox workflow comparison and its token/CPU/latency measurement limits; no real model performance claim.
This commit is contained in:
@@ -139,7 +139,7 @@ export const SESSION_TOOL_CONTRACTS = [
|
||||
),
|
||||
session(
|
||||
"list_unknowns",
|
||||
"List every current residual-unknown head in deterministic ID order, with optional exact status, severity, and domain filters. Results are complete and inline. This is read-only; unresolved, contradicted, and non-truth dispositions remain distinct.",
|
||||
"List current residual-unknown heads in deterministic ID order, with optional exact status, severity, and domain filters. Results are complete inline by default; supply offset and limit to page the filtered order. total is the matching-head count and next_offset is null when the page exhausts the result. This is read-only; unresolved, contradicted, and non-truth dispositions remain distinct.",
|
||||
listUnknownsInputSchema,
|
||||
),
|
||||
session(
|
||||
|
||||
@@ -52,6 +52,22 @@ export const listUnknownsInputSchema = z.strictObject({
|
||||
.optional(),
|
||||
severity: z.enum(["low", "medium", "high", "critical"]).optional(),
|
||||
domain: z.string().trim().min(1).optional(),
|
||||
offset: z
|
||||
.number()
|
||||
.int()
|
||||
.min(0)
|
||||
.max(Number.MAX_SAFE_INTEGER)
|
||||
.default(0)
|
||||
.describe("Zero-based offset in the stable filtered unknown ID order."),
|
||||
limit: z
|
||||
.number()
|
||||
.int()
|
||||
.positive()
|
||||
.max(Number.MAX_SAFE_INTEGER)
|
||||
.optional()
|
||||
.describe(
|
||||
"Optional maximum number of heads to return. Omit to return every matching head from offset.",
|
||||
),
|
||||
});
|
||||
|
||||
/** Exact residual-unknown identity to revalidate. */
|
||||
|
||||
@@ -555,6 +555,8 @@ export const sessionOutputSchemas = {
|
||||
z.object({
|
||||
items: z.array(residualUnknownSchema),
|
||||
total: z.number().int().min(0),
|
||||
offset: z.number().int().min(0),
|
||||
next_offset: z.number().int().min(0).nullable(),
|
||||
}),
|
||||
),
|
||||
record_unknown: lifecycleResultOf(residualUnknownSchema),
|
||||
|
||||
@@ -2,7 +2,7 @@ import type { JsonValue } from "../domain/jsonValue.js";
|
||||
|
||||
/** Exact example inputs for residual-unknown lifecycle contracts. */
|
||||
export const UNKNOWN_CONTRACT_EXAMPLES = {
|
||||
list_unknowns: {},
|
||||
list_unknowns: { offset: 0, limit: 50 },
|
||||
record_unknown: {
|
||||
question: "Does this branch require an unavailable external service?",
|
||||
severity: "medium",
|
||||
|
||||
Reference in New Issue
Block a user