feat(python): query selected pyc code-object facts (#6928)

* feat(python): query retained pyc code-object facts

* test(python): bind complete pyc selection benchmark tasks

* test(python): include server instructions in token accounting

* docs(perf): record pyc selected-facts task measurements

* test(python): keep oracle dependencies separate from selected targets

* docs(perf): record guarded oracle requalification

* test(python): narrow complete Evidence through its owning contract
This commit is contained in:
gensokyo-dev
2026-10-24 10:23:06 +08:00
committed by GitHub
parent 315b23403f
commit e2463372ea
22 changed files with 3664 additions and 156 deletions
+2 -30
View File
@@ -3,12 +3,9 @@ import {
javaScriptRoutesDeliverySchema,
webRoutesDeliverySchema,
} from "../domain/analysisView/javascriptRoutesView.js";
import { AnalysisInputError } from "../domain/analysisErrorCore.js";
import { analysisInputErrorFromIssues } from "../domain/inputIssueProjection.js";
import { err, ok } from "../domain/result.js";
import {
analysisEvidenceDeliveryOptions,
cliEvidenceDeliveryInputError,
parseCliAnalysisEvidenceDelivery,
} from "./analysisEvidenceDelivery.js";
export const javascriptRouteDeliveryOptions = {
@@ -30,34 +27,9 @@ export const parseJavaScriptRouteDelivery = (
view?: string | undefined;
},
) => {
let view: unknown;
try {
view = options.view === undefined ? undefined : JSON.parse(options.view);
} catch (cause) {
return err(
new AnalysisInputError(operation, { cause }, [
{
path: ["view"],
reason: "invalid_format",
message: "view must be valid JSON",
},
]),
);
}
const raw = {
detail: options.detail,
...(view === undefined ? {} : { view }),
};
const schema =
operation === "analyze_web_bundle"
? webRoutesDeliverySchema
: javaScriptRoutesDeliverySchema;
const parsed = schema.safeParse(raw);
if (!parsed.success)
return err(
analysisInputErrorFromIssues(operation, parsed.error.issues, raw),
);
const value = { ...parsed.data, evidenceOutput: options.evidence_output };
const invalid = cliEvidenceDeliveryInputError({ ...value, operation });
return invalid === undefined ? ok(value) : err(invalid);
return parseCliAnalysisEvidenceDelivery(operation, options, schema);
};