23de4f77c7
Add explicit MCP Dart AOT summary delivery and exact retained string-pool pages while preserving complete defaults, CLI behavior, ABI selection, original Evidence identity, partial coverage and lower bounds. Real LocalSend SDK replies shrink 92.05% with approximately unchanged SDK time. Two actual Codex pairs preserve all selected facts and reduce total input 48.75% / 42.38%, uncached input 33.63% / 42.52%, and task time 23.95% / 30.30%; all client errors/repeated calls remain counted. Preserve old portable Evidence and the real CLI complete result after rebasing onto SAZ/qlog main. Curated results keep measured and integration runtime pins separate; raw artifacts stay outside Git. Refs #2016. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
41 lines
1.8 KiB
TypeScript
41 lines
1.8 KiB
TypeScript
import type { ExecutionOptions } from "../AnalysisProvider.js";
|
|
import type { FlutterBuildAnalysisService } from "./FlutterBuildAnalysisService.js";
|
|
import {
|
|
requireAnalysisViewRetention,
|
|
summarizeRetainedAnalysis,
|
|
type AnalysisViewRetention,
|
|
} from "../analysisView/AnalysisViewService.js";
|
|
import type { AnalysisError } from "../../domain/analysisErrorBase.js";
|
|
import { AnalysisCancelledError } from "../../domain/analysisErrorCore.js";
|
|
import { dartAotInspectionInputSchema } from "../../domain/flutter/flutterBuildAnalysis.js";
|
|
import type { Evidence } from "../../domain/evidence.js";
|
|
import { analysisInputErrorFromIssues } from "../../domain/inputIssueProjection.js";
|
|
import { err, type Result } from "../../domain/result.js";
|
|
|
|
/** Keep the caller's ABI choice and complete analysis; select only its delivery. */
|
|
export const inspectDartAot = async (
|
|
service: FlutterBuildAnalysisService,
|
|
rawInput: unknown,
|
|
retention: AnalysisViewRetention,
|
|
options?: ExecutionOptions,
|
|
): Promise<Result<Evidence, AnalysisError>> => {
|
|
const operation = "inspect_dart_aot";
|
|
if (options?.signal?.aborted === true)
|
|
return err(new AnalysisCancelledError(operation));
|
|
const parsed = dartAotInspectionInputSchema.safeParse(rawInput);
|
|
if (!parsed.success)
|
|
return err(
|
|
analysisInputErrorFromIssues(operation, parsed.error.issues, rawInput, {
|
|
cause: parsed.error,
|
|
}),
|
|
);
|
|
if (parsed.data.detail === "summary") {
|
|
const ready = requireAnalysisViewRetention(operation, retention);
|
|
if (!ready.ok) return ready;
|
|
}
|
|
const { detail, ...providerInput } = parsed.data;
|
|
const executed = await service.execute(operation, providerInput, options);
|
|
if (!executed.ok || detail !== "summary") return executed;
|
|
return summarizeRetainedAnalysis(executed.value, retention);
|
|
};
|