mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-26 09:52:11 +03:00
Release v3.8.42 — full CHANGELOG in CHANGELOG.md. CI: 103 checks green incl. CodeQL (all languages), Semgrep, all 8 unit shards, coverage, Node 24 compat, and integration tests. Full unit suite validated locally: 19437 pass / 0 fail. The 3 red checks are advisory and do not gate main (no required status checks): SonarCloud/SonarQube new-code coverage gate, and PR Test Policy (test-masking detector flagging the legitimate dead-Phind provider removal in #5530 — reviewed, correct). Includes cycle-close reconciliation + repair of inherited base-red tests from #5480/#5527/#5427/#5521 that the PR->release fast-path did not exercise.
101 lines
2.2 KiB
TypeScript
101 lines
2.2 KiB
TypeScript
import test from "node:test";
|
|
import assert from "node:assert/strict";
|
|
|
|
import { updateSettingsSchema } from "../../src/shared/validation/settingsSchemas.ts";
|
|
|
|
const commonOperations = [
|
|
{
|
|
kind: "drop_paragraph_if_contains",
|
|
needles: ["needle"],
|
|
caseSensitive: true,
|
|
},
|
|
{
|
|
kind: "drop_paragraph_if_starts_with",
|
|
prefixes: ["prefix"],
|
|
},
|
|
{
|
|
kind: "replace_text",
|
|
match: "before",
|
|
replacement: "after",
|
|
allOccurrences: true,
|
|
},
|
|
{
|
|
kind: "replace_regex",
|
|
pattern: "before",
|
|
flags: "gi",
|
|
replacement: "after",
|
|
},
|
|
{
|
|
kind: "drop_block_if_contains",
|
|
needles: ["needle"],
|
|
},
|
|
{
|
|
kind: "prepend_system_block",
|
|
text: "prefix block",
|
|
idempotencyKey: "prefix-key",
|
|
},
|
|
{
|
|
kind: "append_system_block",
|
|
text: "suffix block",
|
|
},
|
|
{
|
|
kind: "inject_billing_header",
|
|
entrypoint: "claude-code",
|
|
versionFormat: "ex-machina",
|
|
cchAlgo: "sha256-first-user",
|
|
version: "1.0.0",
|
|
},
|
|
] as const;
|
|
|
|
test("settings schema accepts the shared transform operations in legacy and v2 configs", () => {
|
|
const parsed = updateSettingsSchema.parse({
|
|
ccBridgeTransforms: {
|
|
enabled: true,
|
|
pipeline: commonOperations,
|
|
},
|
|
systemTransforms: {
|
|
providers: {
|
|
claude: {
|
|
enabled: true,
|
|
pipeline: commonOperations,
|
|
},
|
|
},
|
|
},
|
|
});
|
|
|
|
assert.equal(parsed.ccBridgeTransforms?.pipeline.length, commonOperations.length);
|
|
assert.equal(parsed.systemTransforms?.providers.claude.pipeline.length, commonOperations.length);
|
|
});
|
|
|
|
test("settings schema keeps obfuscate_words limited to systemTransforms", () => {
|
|
const obfuscateWords = {
|
|
kind: "obfuscate_words",
|
|
words: ["opencode"],
|
|
targets: ["system"],
|
|
} as const;
|
|
|
|
assert.equal(
|
|
updateSettingsSchema.safeParse({
|
|
systemTransforms: {
|
|
providers: {
|
|
claude: {
|
|
enabled: true,
|
|
pipeline: [obfuscateWords],
|
|
},
|
|
},
|
|
},
|
|
}).success,
|
|
true
|
|
);
|
|
|
|
assert.equal(
|
|
updateSettingsSchema.safeParse({
|
|
ccBridgeTransforms: {
|
|
enabled: true,
|
|
pipeline: [obfuscateWords],
|
|
},
|
|
}).success,
|
|
false
|
|
);
|
|
});
|