mirror of
https://github.com/morluto/rea.git
synced 2026-11-20 05:32:44 +00:00
feat(native): make function matching allowance configurable (#7159)
Allow native matching representation budgets to be selected at runtime or launch while retaining the 96 MiB default and main shared-provenance accounting. Preserve actionable configuration recovery through the setting owner and verify complete CLI/MCP matches for 20k/50k synthetic inventories and real stripped LLVM 14/15 inventories. Fixes #6406. Based on #7112 by Kaoru0822; original authorship and co-author credit retained. Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
27 files changed
+1511
-27
No files matched your search
@@ -18,9 +18,15 @@ import { err, ok, type Result } from "../../domain/result.js";
|
||||
import type { EvidenceLookup } from "../EvidenceInputResolver.js";
|
||||
import { resolveNativeMatchingSources } from "./NativeMatchingSources.js";
|
||||
import type { ExecutionOptions } from "../AnalysisProvider.js";
|
||||
import type { NativeMatchingAllowance } from "../../config/nativeMatchingAllowance.js";
|
||||
import { FUNCTION_COMPARISON_PROVIDER } from "../../domain/comparisonEvidenceIdentity.js";
|
||||
|
||||
const OPERATION = "match_native_functions";
|
||||
|
||||
/** Effective admission budget, separate from caller-authored Evidence parameters. */
|
||||
export interface NativeFunctionMatchingOptions extends ExecutionOptions {
|
||||
readonly representationAllowance?: NativeMatchingAllowance;
|
||||
}
|
||||
export interface NativeFunctionMatchingResult {
|
||||
readonly evidence: Evidence;
|
||||
readonly sources: readonly Evidence[];
|
||||
@@ -30,10 +36,14 @@ export interface NativeFunctionMatchingResult {
|
||||
/** Pair existing observations through one source/analysis admission. */
|
||||
export const matchNativeFunctions = async (
|
||||
rawInput: unknown,
|
||||
options?: ExecutionOptions,
|
||||
options?: NativeFunctionMatchingOptions,
|
||||
lookup?: EvidenceLookup,
|
||||
): Promise<Result<NativeFunctionMatchingResult, AnalysisError>> => {
|
||||
const admission = new NativeMatchingAdmission(OPERATION, options?.signal);
|
||||
const admission = new NativeMatchingAdmission(
|
||||
OPERATION,
|
||||
options?.signal,
|
||||
options?.representationAllowance,
|
||||
);
|
||||
try {
|
||||
await setImmediate();
|
||||
await admission.checkpoint();
|
||||
@@ -171,10 +181,14 @@ export const matchNativeFunctionsFromBundles = async (
|
||||
input: MatchNativeFunctionsInput,
|
||||
paths: readonly string[],
|
||||
resources: ArtifactResourceScope,
|
||||
options?: ExecutionOptions,
|
||||
options?: NativeFunctionMatchingOptions,
|
||||
): Promise<Result<NativeFunctionMatchingResult, AnalysisError>> => {
|
||||
try {
|
||||
const admission = new NativeMatchingAdmission(OPERATION, options?.signal);
|
||||
const admission = new NativeMatchingAdmission(
|
||||
OPERATION,
|
||||
options?.signal,
|
||||
options?.representationAllowance,
|
||||
);
|
||||
await admission.admit(input);
|
||||
const loaded = await loadNativeMatchingBundleSources({
|
||||
input,
|
||||
|
||||
Reference in new issue
Block a user