Auditor drill: OpenRouter lane sweep + warren Gitea repoint (post-PR11 polish) #14

Open
profit wants to merge 65 commits from demo/post-pr11-polish-2026-04-28 into main
2 changed files with 20 additions and 13 deletions
Showing only changes of commit 0661c2cb83 - Show all commits
+10 -5
View File
@@ -28,11 +28,16 @@ const GATEWAY = process.env.LH_GATEWAY_URL ?? "http://localhost:3100";
// retries — verified with trivial 8-token probes). Swapped default to // retries — verified with trivial 8-token probes). Swapped default to
// deepseek-v3.1:671b which is proven working end-to-end through the // deepseek-v3.1:671b which is proven working end-to-end through the
// pr_audit mode runner during Phase 5 distillation acceptance testing. // pr_audit mode runner during Phase 5 distillation acceptance testing.
// kimi-k2:1t can be re-selected via LH_AUDITOR_REVIEW_MODEL env when //
// the upstream returns. Tie-breaker stays grok-4.1-fast (different // 2026-09-02 update: Ollama Cloud subscription lapsed — every
// vendor lineage so consensus + tie-break won't fail-correlate). // ollama_cloud model 402s ("requires a subscription"). J's call: sweep
const MODEL = process.env.LH_AUDITOR_REVIEW_MODEL ?? "deepseek-v3.1:671b"; // the auditor to OpenRouter. Same deepseek lineage via OpenRouter;
const TIEBREAKER_MODEL = process.env.LH_AUDITOR_TIEBREAKER_MODEL ?? "x-ai/grok-4.1-fast"; // tie-breaker moves to grok-4.3 because OpenRouter 404s grok-4.1-fast
// as deprecated. Both probed live through the gateway before landing.
// Vendor lineages stay distinct so consensus + tie-break won't
// fail-correlate.
const MODEL = process.env.LH_AUDITOR_REVIEW_MODEL ?? "openrouter/deepseek/deepseek-chat-v3.1";
const TIEBREAKER_MODEL = process.env.LH_AUDITOR_TIEBREAKER_MODEL ?? "openrouter/x-ai/grok-4.3";
const N_CONSENSUS = Number(process.env.LH_AUDITOR_CONSENSUS_N ?? 3); const N_CONSENSUS = Number(process.env.LH_AUDITOR_CONSENSUS_N ?? 3);
const AUDIT_DISCREPANCIES_JSONL = "/home/profit/lakehouse/data/_kb/audit_discrepancies.jsonl"; const AUDIT_DISCREPANCIES_JSONL = "/home/profit/lakehouse/data/_kb/audit_discrepancies.jsonl";
// 40KB comfortably fits the consensus models' context windows // 40KB comfortably fits the consensus models' context windows
+10 -8
View File
@@ -51,13 +51,15 @@ const CALL_TIMEOUT_MS = 900_000;
const CACHE_TTL_MS = 24 * 60 * 60 * 1000; const CACHE_TTL_MS = 24 * 60 * 60 * 1000;
const MAX_DIFF_CHARS = 180_000; const MAX_DIFF_CHARS = 180_000;
const MAX_PRIOR_FINDINGS = 50; const MAX_PRIOR_FINDINGS = 50;
// Default provider/model = ollama_cloud/kimi-k2.6. Pre-2026-04-27 we // Default provider/model = openrouter/moonshotai/kimi-k2.6.
// went direct to api.kimi.com, but Ollama Cloud Pro now exposes the // History: pre-2026-04-27 direct api.kimi.com (User-Agent gating),
// same model legitimately, so we route there to avoid User-Agent // then ollama_cloud/kimi-k2.6 while the sub was active. 2026-09-02:
// gating. The api.kimi.com path (provider=kimi) remains wired in the // Ollama Cloud subscription lapsed (402 on every cloud model), J's
// gateway as a fallback for when Ollama Cloud is upstream-broken. // call was to sweep the auditor to OpenRouter — same Moonshot model,
const KIMI_PROVIDER = process.env.LH_AUDITOR_KIMI_PROVIDER ?? "ollama_cloud"; // probed live through the gateway. The api.kimi.com path
const KIMI_MODEL = process.env.LH_AUDITOR_KIMI_MODEL ?? "kimi-k2.6"; // (provider=kimi) remains wired in the gateway as a fallback.
const KIMI_PROVIDER = process.env.LH_AUDITOR_KIMI_PROVIDER ?? "openrouter";
const KIMI_MODEL = process.env.LH_AUDITOR_KIMI_MODEL ?? "moonshotai/kimi-k2.6";
// Cross-lineage alternation. 2026-04-27 J's call: Opus is too // Cross-lineage alternation. 2026-04-27 J's call: Opus is too
// expensive to auto-fire (~$0.30/audit). Kimi K2.6 via Go-sub is // expensive to auto-fire (~$0.30/audit). Kimi K2.6 via Go-sub is
// effectively free; Haiku 4.5 via Zen is ~$0.04. Alternate between // effectively free; Haiku 4.5 via Zen is ~$0.04. Alternate between
@@ -111,7 +113,7 @@ function maxTokensFor(model: string): number {
if (MAX_TOKENS_OVERRIDE > 0) return MAX_TOKENS_OVERRIDE; if (MAX_TOKENS_OVERRIDE > 0) return MAX_TOKENS_OVERRIDE;
if (model.startsWith("claude-opus")) return 32_000; if (model.startsWith("claude-opus")) return 32_000;
if (model.startsWith("claude-haiku") || model.startsWith("claude-sonnet")) return 8_192; if (model.startsWith("claude-haiku") || model.startsWith("claude-sonnet")) return 8_192;
if (model.startsWith("kimi-")) return 128_000; if (model.startsWith("kimi-") || model.includes("/kimi-")) return 128_000;
if (model.startsWith("gpt-5") || model.startsWith("o1") || model.startsWith("o3") || model.startsWith("o4")) return 32_000; if (model.startsWith("gpt-5") || model.startsWith("o1") || model.startsWith("o3") || model.startsWith("o4")) return 32_000;
return 16_000; return 16_000;
} }