mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-31 04:12:10 +03:00
v3.8.40 cycle integration → main. All test gates green (Unit/Integration/Coverage/Node-compat/Quality-Ratchet). The only red check, 'PR Test Policy', is the test-masking heuristic firing on the cumulative ~57-commit release diff (legitimate assert consolidations already reviewed per-PR — Gemini CLI removal #5246, retired GPT models #5280, provider catalog refreshes); overridden with --admin per the documented release-PR convention. CodeQL/SonarQube advisory scans non-blocking; #5278's code already passed CodeQL on main. Homologated on VPS 192.168.0.15 (v3.8.40 healthy).
44 lines
1.4 KiB
TypeScript
44 lines
1.4 KiB
TypeScript
import type { CompressionConfig, CompressionResult } from "./types.ts";
|
|
import type { CachingDetectionContext } from "./cachingAware.ts";
|
|
import type { RiskGateConfig } from "./riskGate/riskGate.ts";
|
|
import { resolveRiskGate, withRiskGate } from "./riskGate/strategyWrap.ts";
|
|
import {
|
|
resolveQuantumLock,
|
|
quantumCachingContext,
|
|
withQuantumLock,
|
|
withQuantumLockAsync,
|
|
} from "./quantumLock/index.ts";
|
|
|
|
export interface CompressionEntrypointOptions {
|
|
config?: CompressionConfig;
|
|
riskGate?: RiskGateConfig;
|
|
cachingContext?: CachingDetectionContext;
|
|
}
|
|
|
|
export function withCompressionEntrypointGuards<T extends CompressionEntrypointOptions>(
|
|
body: Record<string, unknown>,
|
|
options: T | undefined,
|
|
run: (body: Record<string, unknown>) => CompressionResult
|
|
): CompressionResult {
|
|
return withQuantumLock(
|
|
body,
|
|
resolveQuantumLock(options),
|
|
quantumCachingContext(body, options),
|
|
(quantumBody) =>
|
|
withRiskGate(quantumBody, resolveRiskGate(options), (riskBody) => run(riskBody))
|
|
);
|
|
}
|
|
|
|
export function withCompressionEntrypointGuardsAsync<T extends CompressionEntrypointOptions>(
|
|
body: Record<string, unknown>,
|
|
options: T | undefined,
|
|
run: (body: Record<string, unknown>) => Promise<CompressionResult>
|
|
): Promise<CompressionResult> {
|
|
return withQuantumLockAsync(
|
|
body,
|
|
resolveQuantumLock(options),
|
|
quantumCachingContext(body, options),
|
|
run
|
|
);
|
|
}
|