mirror of
https://github.com/morluto/rea
synced 2026-10-28 23:11:11 -04:00
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:
@@ -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);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user