Skip to content

fix(corpus): trust verified OpenRouter free aliases - #7

Open
Audacity88 wants to merge 1 commit into
ncz-os:masterfrom
Audacity88:codex/openrouter-free-alias-policy
Open

fix(corpus): trust verified OpenRouter free aliases#7
Audacity88 wants to merge 1 commit into
ncz-os:masterfrom
Audacity88:codex/openrouter-free-alias-policy

Conversation

@Audacity88

Copy link
Copy Markdown

Summary

  • Base branch: master
  • What changed and why:
    • Preserve a live OpenRouter marker when an exact :free alias reports zero prompt and completion prices.
    • Allow that verified marker to override the commercial-vendor placeholder heuristic.
    • Add regressions proving that suffix-only and non-:free commercial aliases remain blocked.
  • Scope boundary: This does not trust arbitrary zero-price feed rows, weaken post-call cost verification, or change fallback behavior.
  • Blast radius: Public corpus generation and free-model route eligibility. Runtime paid/free telemetry enforcement is unchanged.
  • Linked issue(s): None.

Validation Evidence

Commands run:

$ python3 scripts/tests/build-public-corpus-tests.py
...
Ran 3 tests in 0.002s

OK

$ python3 -m py_compile scripts/build-public-corpus.py scripts/tests/build-public-corpus-tests.py
(no output)

$ python3 scripts/build-public-corpus.py --out-dir <temporary-directory> --date 2026-08-13
wrote corpus (2579 models, 79 routable) + pricing (2579 models) [generated 2026-08-13]

$ zoder exec --model google/gemma-4-31b-it:free --require-free --dry-run --explain
[route] pinned google/gemma-4-31b-it:free (explicit -m); fallbacks suppressed by operator pin
[dry-run] would call google/gemma-4-31b-it:free via openrouter-review (chain: google/gemma-4-31b-it:free)
  • Beyond CI: Rebuilt the corpus from the current public feeds and confirmed google/gemma-4-31b-it:free became free=true, paid=false, and route_candidate=true. The Zoder dry route then accepted it under --require-free without making an inference call.
  • Intentionally skipped: The full Rust workspace gate. This patch changes only the Python corpus generator and its Python regression tests; CI remains authoritative for the unchanged Rust workspace.

Security & Privacy Impact

  • New permissions, capabilities, or filesystem access scope? No
  • New external network calls? No
  • Secrets / tokens / credentials handling changed? No
  • PII / real identities / personal data in diff, tests, fixtures, or docs? No

The pre-call exception is deliberately narrow: the exact model ID must end in :free, and OpenRouter's live feed must independently report both prices as zero. Post-call cost and fallback verification remains unchanged.

Compatibility

  • Backward compatible? Yes
  • Config / env / CLI surface changed? No

Rollback

Low-risk: revert the commit. The previous commercial-vendor heuristic will again block these aliases until manually classified.

@Audacity88
Audacity88 marked this pull request as ready for review August 13, 2026 06:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant