refactor(mcp): make analysis states unrepresentable (#468)
* refactor(config): parse capability settings into exact states * refactor(runtime): encode replay and process outcomes exactly * refactor: make analysis states unrepresentable * refactor(mcp): register canonical schemas with SDK * fix: preserve capability and catalog invariants * fix(build): remove stale compiled modules * fix(replay): update real verifier policy dependency * fix(package): verify the complete MCP catalog * fix(test): supply complete replay reload policy * refactor(contracts): centralize output schema lookup * refactor(mcp): delegate protocol boundaries to SDK * fix(browser): approve real source capture * fix(mcp): preserve catalog guidance
This commit is contained in:
@@ -27,8 +27,7 @@ interface ReconciliationProjection {
|
||||
|
||||
interface CompletionFlags {
|
||||
readonly outputTruncated: boolean;
|
||||
readonly inputTruncated: boolean;
|
||||
readonly inputPartial: boolean;
|
||||
readonly inputStatus: "complete" | "partial" | "truncated";
|
||||
}
|
||||
|
||||
/** Build and verify the deterministic caller-visible reconciliation result. */
|
||||
@@ -150,36 +149,44 @@ const reconciliationCoverage = (
|
||||
completion: CompletionFlags,
|
||||
): JavaScriptRuntimeReconciliationResult["coverage"] => ({
|
||||
status:
|
||||
completion.outputTruncated || completion.inputTruncated
|
||||
completion.outputTruncated || completion.inputStatus === "truncated"
|
||||
? "truncated"
|
||||
: completion.inputPartial
|
||||
: completion.inputStatus === "partial"
|
||||
? "partial"
|
||||
: "complete-within-inputs",
|
||||
truncated: completion.outputTruncated || completion.inputTruncated,
|
||||
truncated:
|
||||
completion.outputTruncated || completion.inputStatus === "truncated",
|
||||
omitted_runtime_entities: input.runtime.omittedEntities,
|
||||
omitted_reconciliation_items: input.matching.omittedItems,
|
||||
omitted_static_load_states: input.loadStates.omittedStates,
|
||||
omitted_graph_items: input.omittedGraphItems,
|
||||
});
|
||||
|
||||
const completionFlags = (input: ReconciliationProjection): CompletionFlags => ({
|
||||
outputTruncated:
|
||||
input.runtime.omittedEntities > 0 ||
|
||||
input.matching.omittedItems > 0 ||
|
||||
input.loadStates.omittedStates > 0 ||
|
||||
input.omittedGraphItems > 0,
|
||||
inputTruncated:
|
||||
const completionFlags = (input: ReconciliationProjection): CompletionFlags => {
|
||||
const inputTruncated =
|
||||
input.layers.some(({ graph }) => graph.coverage.truncated) ||
|
||||
input.captures.some(({ inspection }) =>
|
||||
inspection.completeness.conditions.includes("truncated"),
|
||||
),
|
||||
inputPartial:
|
||||
);
|
||||
const inputPartial =
|
||||
input.layers.some(({ graph }) => graph.coverage.status !== "complete") ||
|
||||
input.captures.some(
|
||||
({ inspection }) =>
|
||||
inspection.completeness.status !== "complete_within_window",
|
||||
),
|
||||
});
|
||||
);
|
||||
return {
|
||||
outputTruncated:
|
||||
input.runtime.omittedEntities > 0 ||
|
||||
input.matching.omittedItems > 0 ||
|
||||
input.loadStates.omittedStates > 0 ||
|
||||
input.omittedGraphItems > 0,
|
||||
inputStatus: inputTruncated
|
||||
? "truncated"
|
||||
: inputPartial
|
||||
? "partial"
|
||||
: "complete",
|
||||
};
|
||||
};
|
||||
|
||||
const reconciliationLimitations = (completion: CompletionFlags): string[] =>
|
||||
uniqueSorted([
|
||||
@@ -189,7 +196,7 @@ const reconciliationLimitations = (completion: CompletionFlags): string[] =>
|
||||
"Not-observed means absent from the bounded captures in scope, never globally unloaded.",
|
||||
"Caller-declared file and URL mappings are inference inputs and do not expand CDP origin or filesystem-root authority.",
|
||||
"Source-map authority remains separate from passive runtime authority.",
|
||||
...(completion.inputPartial
|
||||
...(completion.inputStatus !== "complete"
|
||||
? ["One or more static graphs or passive captures were incomplete."]
|
||||
: []),
|
||||
...(completion.outputTruncated
|
||||
|
||||
Reference in New Issue
Block a user