noLogMode now defaults to false so the HF dataset collects structural
metadata from 100k MAU. Settings copy clarifies: "helps improve model
routing and reliability. Does not send prompt or response text. Turn
off anytime." All NoLog protections remain intact.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
grok-3-fast doesn't exist in OpenRouter's catalog. Swap to grok-4.5
in the combo registry and max tokens map.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
classifyModelError() categorizes errors (auth/credits/not_found/rate_limit/
timeout/server). diagnoseAllModelsFailed() picks the dominant failure type
and returns a specific message with provider links instead of the generic
"All models failed in ULTRAPLINIAN mode." Telemetry error_type now uses
the classifier too.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- finish() now calls controller.abort() to cancel in-flight straggler requests
- Export bumped to v2: excludes plaintext API keys, fixes stale field names
- Import allowlist expanded to cover all settings, migrates v1 field names
- Credentials (apiKey, veniceApiKey) intentionally excluded from backup
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Restore harmPromise as a defined variable (Promise.resolve(null) under No-Log)
Fixes crash: harmPromise was awaited in 4 places but undefined when noLogMode=true
- Cap MIN_RESULTS_FOR_GRACE at 5 so large races don't require too many successes
- Call buildTierSelect() after credential decryption and on Settings open
- Replace stale x-ai/grok-3 with x-ai/grok-3-fast in combo registry + max tokens
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- classifyHarm() skipped when noLogMode is true (saves OpenRouter credits + up to 4s latency)
- flushTelemetry() no-log early return no longer resets _telemetry.flushing
(prevents concurrent flushes when an in-flight request is still pending)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- MIN_RESULTS_FOR_GRACE now scales to 50% of actual race size (min 2)
Fixes Venice-only Fast (6 models) waiting full 45s when only 4 succeed
- Tier selector shows combined OpenRouter + Venice model counts via _tierCount()
- buildTierSelect() called on settings save so counts update when keys change
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- flushTelemetry() clears buffer and returns immediately when noLogMode is true
- Failed flush never requeues events if noLogMode became true during flight
- beforeunload beacon guarded by !state.noLogMode
- Import path clears telemetry buffer when imported backup has noLogMode enabled
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- trackEvent() returns early when state.noLogMode is true (no events buffered or sent)
- Toggling No-Log on immediately clears pending buffer
- Remove dead no_log field from telemetry context
- Update UI description to accurately state it disables G0DM0D3 telemetry
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Coerce variants_succeeded/variants_total in Parseltongue summaryText via parseInt
- Coerce msg.liquidIterations via parseInt and msg.liquidImprovement via Number
- Guard autoTune params with Number.isFinite before .toFixed() (prevents crash on crafted strings)
- Coerce at.confidence/at.conversationLength via Number, at.godmodeBoost via strict boolean
- Escape at.strategy/at.context fallback paths through escapeHtml(String(...))
- Add full magic metadata sanitization in both sanitizeLoadedState and import validator:
mode, score, duration, variants_*, topScore, combos_*, autoTune.* all normalized on load
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Coerce current.score to Number in race navigator (prevents innerHTML XSS)
- Escape magic.mode in badge, coerce magic.topScore/magic.score/s.score/variants_* via Number/parseInt
- Escape magic.duration via escapeHtml(String(...)) in PLINY/CLASSIC mode
- Filter null/non-object entries from liquidVersions and strategyLogs.results (prevents crashes)
- Add raceResponses sanitization in both sanitizeLoadedState and import validator
- clearAllData now removes g0dm0d3-apikey and g0dm0d3-venice-apikey from localStorage
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Show Magic version tooltip: escapeAttr() on v.label and improvements
in title attribute — prevents quote-breakout to onmouseover.
Message role: hardcoded to 'user'|'assistant' in class attribute —
arbitrary role strings can no longer inject HTML via class="message X".
Strategy logs: all fields (model, strategy, error, score, duration)
now escaped/coerced before innerHTML insertion.
Image rendering: strict base64 data:image/ regex rejects embedded
quotes; both src and alt use escapeAttr(); onclick removed (was an
XSS amplifier for injected src values).
Import schema hardened:
- Non-object conversations/messages filtered out (null, string, array)
- msg.role restricted to user/assistant/system
- imageDataUrl strict base64 regex; imageName stripped of HTML chars
- liquidVersions: all fields typed/bounded
- strategyLogs: all fields typed/bounded
- Runs BEFORE size check (validate-then-commit preserved)
Load-time sanitization: sanitizeLoadedState() runs on every page load
with the same rules — existing stored XSS payloads are neutralized
even without a fresh import.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Liquid XSS (version history modal):
- All LLM-derived fields (label, grade, improvements) now escaped via
escapeHtml() before innerHTML insertion
- score/delta coerced to finite numbers
- improvements filtered to string[], bounded to 10 items x 200 chars
Refiner JSON normalization:
- Parse result now strictly validated: numbers clamped [0,100],
improvements filtered/bounded, refinedContent typed as string
- Malformed LLM output can no longer inject HTML via stored versions
Backup import hardening:
- Validate-then-commit: build candidate state, check size, sanitize,
THEN apply to live state — rejected imports no longer corrupt state
- Sanitize imageDataUrl: only data:image/ prefixed URLs survive import
- Sanitize liquidVersions: improvements bounded, label/grade truncated,
score/delta forced to finite numbers
- Imported API key increments _apiKeyGeneration
Image URL render-time guard:
- Inline image rendering now validates data:image/ prefix before
inserting into src attribute — existing stored payloads blocked
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
XSS (critical): updateLiquidIndicator now escapes all model-derived
strings (improvements, subtext) via escapeHtml() before innerHTML
insertion. LLM-produced JSON can no longer execute arbitrary JS.
Credential race: added _apiKeyGeneration counter incremented at every
state.apiKey assignment. The async decryptApiKey callback on page load
checks the generation matches before writing — if the user clears the
key before decryption finishes, the stale value is discarded.
Venice image badge: vision badge now only renders when
msg.visionAnalyzed is true (set on successful Gemini Flash call).
Venice-only users no longer see "analyzed via Gemini Flash" on
images that were never analyzed.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When the user clears their OpenRouter key (switching to Venice-only),
_flushSaveState now removes the g0dm0d3-apikey localStorage entry.
Previously the encrypted key survived and was restored on reload,
silently resuming OpenRouter requests.
Also guards against a race where an older async encryptApiKey resolves
after the key was already changed — only writes if state.apiKey still
matches the value that was encrypted.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Venice-only guards added to:
- generateSmartPrefill: returns random prefill without LLM call
- llmRefusalCheck: falls back to regex-only detection
- llmAccuracyCheck: returns optimistic result without LLM verification
- liquidResponseLoop: early-returns (refinement requires OpenRouter)
Pong game leak: regenerateFromMessage now wraps both branches in
try/finally that always calls hidePongGame(), hideTyping(), and
resets streaming state — success, failure, and abort all clean up.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- regenerateFromMessage: routes through ULTRAPLINIAN pipeline when in
ultraplinian mode (previously called OpenRouter directly with empty key)
- plinyImprovementLoop: early-return when !state.apiKey (no point coaching
via OpenRouter that will 401)
- llmJudgeResponses: skip LLM judge, use tastemaker-only winner when no
OpenRouter key
- classifyQueryWithLLM: early-return with default classification when no key
Venice-only users now get the full ULTRAPLINIAN race (via Venice models)
without any stalling on failed OpenRouter calls.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Users can now use G0DM0D3 with just a Venice API key:
- Send guard accepts either OpenRouter or Venice key
- Auto-switches to ULTRAPLINIAN when Venice-only (other modes need OpenRouter)
- Race entries conditionally include OpenRouter models only when key exists
- Warning banner updated to mention Venice as an option
- Regeneration guard accepts either key
- Vision processing degrades gracefully without OpenRouter
All three key combinations work:
- OpenRouter only: all modes, full feature set
- Both keys: ULTRAPLINIAN races both providers
- Venice only: ULTRAPLINIAN with Venice models, local scoring
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The old slug returns 404 from OpenRouter — caught during smoke testing.
Affects tastemaker FAST_MODELS and VISION_MODEL.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Venice fetch requests were blocked by Content-Security-Policy in both
the HTML meta tag and the Cloudflare _headers file.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Venice returns {"error": "string"} while OpenRouter returns
{"error": {"message": "..."}}. All three error parse sites
(index.html queryModel, backend queryModel, frontend Venice helper)
now handle both shapes.
Error classifier now catches Venice-specific auth strings:
- "Authentication failed" (Venice bad key)
- "User not found." (OpenRouter bad key)
Diagnostic messages updated to reference both providers.
Verified 7/7 against real API error strings from smoke tests.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Live app (index.html):
- Venice API key field in Settings → API Keys tab
- 44 Venice models (VENICE_MODELS + VENICE_TIER_SIZES) race alongside
OpenRouter in ULTRAPLINIAN when a Venice key is set
- queryModel() accepts provider param — routes to Venice or OpenRouter
endpoint with correct auth headers
- veniceApiKey added to state, STATE_KEYS, save/load cycle
Telemetry:
- Reject batches exceeding 24 MiB with 413 before KV.put() (CF KV
values cap at 25 MiB)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Live app (index.html):
- Remove 11 stale OpenRouter models (grok-code-fast-1, both MiMo,
claude-3.5-sonnet, gpt-5.4-chat, gemini-3-pro-preview,
llama-3.1-405b, grok-4, both grok-fast variants, qwq-32b)
- Add replacements: grok-4.5, claude-opus-4.8/fable-5/sonnet-5,
gpt-5.3-5.6 series, qwen3.7-max, glm-5.2, gemini-3.5-flash, etc.
- Update TIER_SIZES to {fast:12, standard:27, smart:41, power:53, ultra:60}
- Update both model dropdowns (header + settings)
- Migrate HALL_OF_FAME combo from dead claude-3.5-sonnet to claude-sonnet-4.6
Telemetry:
- Replace btoa() with UTF-8-safe base64 encoding (btoa crashes on
non-Latin-1 characters in telemetry JSONL)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>