Make Codex and Claude Code subscriptions go further: a local model router that gives routine agent work to economical models and keeps your strongest model for the hard parts.
Rust ai-agentsai-gatewayclaude-codecodexcoding-agentcost-optimizationdeepseekllm-gatewayllm-routerlocal-firstmodel-routingrusttask-routingtauri
docs: refine public language navigation (#2)
澄潭d21c5bfd7518
diff --git a/.github/workflows/gateway-core.yml b/.github/workflows/gateway-core.ymlindex 71cc985c..06ee0315 100644--- a/.github/workflows/gateway-core.yml+++ b/.github/workflows/gateway-core.yml@@ -22,10 +22,7 @@ jobs:fetch-depth: 0persist-credentials: false- name: Validate selection rules- run: |- python3 scripts/test-test-plan.py- python3 scripts/test-public-language.py- python3 scripts/check-public-language.py+ run: python3 scripts/test-test-plan.py- id: planenv:BASE_SHA: ${{ github.event.pull_request.base.sha }}diff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex 65215685..792ca5ac 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -37,7 +37,9 @@ such checks that you could not run.English is the default language for source comments, GitHub metadata, and Markdown fileswithout a language suffix. Put a Simplified Chinese translation in a sibling`*.zh-CN.md` file and keep links within the reader's current language whenever a translated-page exists. Website guide sources use the existing `*.en.md` and `*.zh.md` convention.+page exists. Label each language switch in the target language: use `简体中文` from English+and `English` from Chinese. Website guide sources use the existing `*.en.md` and `*.zh.md`+convention.Desktop and website components may contain both locales in source, but every user-visiblesentence must be selected by the active locale; do not leave English decorative copy on a@@ -45,9 +47,8 @@ Chinese page or Chinese fallback copy on an English page. Product names, protococommands, paths, code, API fields, and model/provider identifiers remain unchanged. Syntheticmultilingual fixtures are allowed when they test Unicode or localized behavior.-Run `python3 scripts/check-public-language.py` after changing public documentation. Internal-issue specifications, handoffs, and workflow instructions are outside this public-language-boundary.+Internal issue specifications, handoffs, and workflow instructions are outside this+public-language boundary.Do not commit API keys, account data, real conversation content, diagnostic archives, ormachine-specific configuration. Use synthetic fixtures in tests. Security issues and crashdiff --git a/README.md b/README.mdindex aed3c9bd..74bb52ee 100644--- a/README.md+++ b/README.md@@ -1,6 +1,6 @@# HiRoute-[Simplified Chinese](README.zh-CN.md)+[简体中文](README.zh-CN.md)HiRoute is a local model-routing and agent-coordination engine for long-running tasks. Itkeeps model sources, routing plans, agent connections and execution evidence in one place,diff --git a/apps/desktop/README.md b/apps/desktop/README.mdindex 8f5d7deb..4573c62f 100644--- a/apps/desktop/README.md+++ b/apps/desktop/README.md@@ -1,6 +1,6 @@# HiRoute Desktop-[Simplified Chinese](README.zh-CN.md)+[简体中文](README.zh-CN.md)Desktop provides model management, routing configuration, Agent integration, task results,and session history. It reaches the real local service through the shared Client Core. Seediff --git a/apps/desktop/src-tauri/DISTRIBUTION-NOTICE.md b/apps/desktop/src-tauri/DISTRIBUTION-NOTICE.mdindex 6ddb9461..0835cfd2 100644--- a/apps/desktop/src-tauri/DISTRIBUTION-NOTICE.md+++ b/apps/desktop/src-tauri/DISTRIBUTION-NOTICE.md@@ -1,6 +1,6 @@# HiRoute distribution candidate component notice-[Simplified Chinese](DISTRIBUTION-NOTICE.zh-CN.md)+[简体中文](DISTRIBUTION-NOTICE.zh-CN.md)The HiRoute Rust workspace is licensed under Apache-2.0. The package contains HiRouteDesktop, `hirouted`, `hiroute`, frontend resources, the built-in model catalog, and a pinneddiff --git a/apps/website/scripts/validate-build.mjs b/apps/website/scripts/validate-build.mjsindex 60530f91..b85ea9b9 100644--- a/apps/website/scripts/validate-build.mjs+++ b/apps/website/scripts/validate-build.mjs@@ -36,7 +36,7 @@ for (const file of htmlFiles) {}for (const file of htmlFiles.filter(file => path.relative(dist, file).startsWith(`en${path.sep}`))) {- const html = fs.readFileSync(file, 'utf8').replaceAll('中文', '');+ const html = fs.readFileSync(file, 'utf8').replaceAll('简体中文', '').replaceAll('中文', '');if (/[\u3400-\u9fff]/u.test(html)) throw new Error(`Chinese copy leaked into English page: ${file}`);}diff --git a/crates/observation/src/managed_text/README.md b/crates/observation/src/managed_text/README.mdindex a75b432a..a63e81d1 100644--- a/crates/observation/src/managed_text/README.md+++ b/crates/observation/src/managed_text/README.md@@ -1,6 +1,6 @@# MVP-15 → MVP-20 managed-text internal interface-[Simplified Chinese](README.zh-CN.md)+[简体中文](README.zh-CN.md)The entry points are the types in `hiroute_observation::managed_text` and the`LocalObservationStore::managed_text_*` methods. They are not public RPCs and do not grantdiff --git a/decision-extensions/README.md b/decision-extensions/README.mdindex 78596bbd..45ca0277 100644--- a/decision-extensions/README.md+++ b/decision-extensions/README.md@@ -1,6 +1,6 @@# HiRoute decision extensions-[Simplified Chinese](README.zh-CN.md) · [Decision API](api/README.md) · [Official Jev extension](extensions/jev-decider/README.md)+[简体中文](README.zh-CN.md) · [Decision API](api/README.md) · [Official Jev extension](extensions/jev-decider/README.md)HiRoute can ask a trusted decision service which branch should handle a routing execution round. The same response can assess how well the model handled the preceding execution stage. The protocol describes branch decisions and competence assessments; it is not inherently a simple/complex binary classifier. The current smart-saving integration supplies two branches, while the API's `branches` map and the Jev extension's `auto` mode support multiple allowed branches. This does not add new routing modes to the current product.diff --git a/decision-extensions/api/README.md b/decision-extensions/api/README.mdindex e972aab9..716f6e0a 100644--- a/decision-extensions/api/README.md+++ b/decision-extensions/api/README.md@@ -1,6 +1,6 @@# Decision API-[Simplified Chinese](README.zh-CN.md) · [Mechanism and usage](../README.md)+[简体中文](README.zh-CN.md) · [Mechanism and usage](../README.md)[Download the canonical OpenAPI 3.1 JSON](decision.openapi.json). This single schema is also embedded by Desktop's protocol dialog and Save OpenAPI action. The request represents an arbitrary map of allowed branches, not a hard-coded binary choice. Do not maintain a second schema in an extension.diff --git a/decision-extensions/extensions/jev-decider/README.md b/decision-extensions/extensions/jev-decider/README.mdindex 326e097d..73996674 100644--- a/decision-extensions/extensions/jev-decider/README.md+++ b/decision-extensions/extensions/jev-decider/README.md@@ -1,6 +1,6 @@# HiRoute Jev decider-[Simplified Chinese](README.zh-CN.md) · [Decision mechanism](../../README.md) · [API and OpenAPI](../../api/README.md)+[简体中文](README.zh-CN.md) · [Decision mechanism](../../README.md) · [API and OpenAPI](../../api/README.md)This is HiRoute's deployable reference implementation of the five-field REST branch-decision protocol. It accepts a HiRoute decision request, makes exactly one OpenRouter Decisions call with `typesafe/jev-1.13`, and returns `branch_id` plus an optional assessment of the preceding execution segment.diff --git a/docs/macos-installation.md b/docs/macos-installation.mdindex 767ab73e..5030b1dd 100644--- a/docs/macos-installation.md+++ b/docs/macos-installation.md@@ -1,6 +1,6 @@# macOS installation candidate-[Simplified Chinese](macos-installation.zh-CN.md)+[简体中文](macos-installation.zh-CN.md)The target is macOS 15+, with separate single-architecture packages for Apple Silicon(`arm64`) and Intel (`x86_64`). The minimum version comes from the actual build facts of thediff --git a/docs/smart-saving-model-classification.md b/docs/smart-saving-model-classification.mdindex c60adf1d..31a44915 100644--- a/docs/smart-saving-model-classification.md+++ b/docs/smart-saving-model-classification.md@@ -1,6 +1,6 @@# Custom decision service for smart saving-[Simplified Chinese](smart-saving-model-classification.zh-CN.md)+[简体中文](smart-saving-model-classification.zh-CN.md)Smart saving uses HiRoute's deterministic built-in rules by default. To use a custom policy,select “Custom decision service” in the plan editor and enter its address. Authentication maydiff --git a/docs/standalone-cli.md b/docs/standalone-cli.mdindex ba346362..f2106698 100644--- a/docs/standalone-cli.md+++ b/docs/standalone-cli.md@@ -1,6 +1,6 @@# HiRoute Linux headless CLI-[Simplified Chinese](standalone-cli.zh-CN.md)+[简体中文](standalone-cli.zh-CN.md)Standalone is the single-user mode that does not install Desktop. The production `hiroute`CLI, role-all `hirouted` daemon, Local Control, Gateway, business storage, and observationdiff --git a/e2e/README.md b/e2e/README.mdindex cf6f09f5..935b122a 100644--- a/e2e/README.md+++ b/e2e/README.md@@ -1,6 +1,6 @@# HiRoute black-box E2E-[Simplified Chinese](README.zh-CN.md)+[简体中文](README.zh-CN.md)This directory holds environment-independent product-path contracts. It sits above unit,component, and `gateway-core` lifecycle tests and verifies user-visible behavior across adiff --git a/scripts/check-public-language.py b/scripts/check-public-language.pydeleted file mode 100644index d1fdb763..00000000--- a/scripts/check-public-language.py+++ /dev/null@@ -1,120 +0,0 @@-#!/usr/bin/env python3-"""Reject Simplified-Chinese prose in public Markdown's English/default files."""--import argparse-import fnmatch-import json-import os-from pathlib import Path-import re-import subprocess---HAN = re.compile(r"[\u3400-\u9fff]")-INLINE_CODE = re.compile(r"`[^`]*`")-CHINESE_LINK = re.compile(r"\[[^\]]*[\u3400-\u9fff][^\]]*\]\([^)]*\.(?:zh|zh-CN)\.md(?:#[^)]*)?\)")-MANIFEST = Path(".agents/skills/hiroute-public-pr/references/public-surface.v1.json")-DISCOVERY_EXCLUDES = {".git", "dist", "node_modules", "target", "vendor"}---def working_markdown(root: Path) -> list[Path]:- files = []- for directory, children, names in os.walk(root):- children[:] = [child for child in children if child not in DISCOVERY_EXCLUDES]- files.extend(Path(directory) / name for name in names if name.endswith(".md"))- return files---def tracked_markdown(root: Path) -> list[Path]:- files = set(working_markdown(root))- try:- output = subprocess.run(- ["git", "ls-files", "-z", "--", "*.md"],- cwd=root,- check=True,- capture_output=True,- ).stdout- files.update(root / value.decode() for value in output.split(b"\0") if value)- except (OSError, subprocess.CalledProcessError):- pass- return sorted(path for path in files if path.is_file())---def public_markdown(root: Path) -> list[Path]:- files = tracked_markdown(root)- manifest_path = root / MANIFEST- if not manifest_path.is_file():- return [path for path in files if "vendor" not in path.relative_to(root).parts]-- manifest = json.loads(manifest_path.read_text(encoding="utf-8"))- include_files = set(manifest["include_files"])- include_docs = set(manifest["include_docs"])- include_roots = tuple(manifest["include_roots"])- exclude_files = set(manifest["exclude_files"])- exclude_roots = tuple(manifest["exclude_roots"])- exclude_globs = tuple(manifest["exclude_doc_globs"])- selected = []- for path in files:- relative = path.relative_to(root).as_posix()- included = relative in include_files or relative in include_docs or relative.startswith(include_roots)- excluded = (- relative in exclude_files- or relative.startswith(exclude_roots)- or any(fnmatch.fnmatch(relative, pattern) for pattern in exclude_globs)- )- if included and not excluded and not relative.startswith("vendor/"):- selected.append(path)- return selected---def is_english_default(path: Path) -> bool:- return not path.name.endswith((".zh.md", ".zh-CN.md"))---def prose_violations(path: Path) -> list[tuple[int, str]]:- violations = []- fence = None- for number, raw in enumerate(path.read_text(encoding="utf-8").splitlines(), 1):- stripped = raw.lstrip()- marker = stripped[:3]- if marker in {"```", "~~~"}:- if fence is None:- fence = marker- elif marker == fence:- fence = None- continue- if fence is not None:- continue- prose = CHINESE_LINK.sub("", raw)- prose = INLINE_CODE.sub("", prose)- if HAN.search(prose):- violations.append((number, raw.strip()))- return violations---def check(root: Path) -> list[str]:- failures = []- for path in public_markdown(root):- if not is_english_default(path):- continue- for number, line in prose_violations(path):- failures.append(f"{path.relative_to(root)}:{number}: {line}")- return failures---def main() -> int:- parser = argparse.ArgumentParser(description=__doc__)- parser.add_argument("--root", type=Path, default=Path(__file__).resolve().parent.parent)- args = parser.parse_args()- root = args.root.resolve()- failures = check(root)- if failures:- print("public English/default Markdown contains Chinese prose:")- print("\n".join(f"- {failure}" for failure in failures))- return 1- print(f"public language boundary: {len(public_markdown(root))} Markdown files checked")- return 0---if __name__ == "__main__":- raise SystemExit(main())diff --git a/scripts/test-public-language.py b/scripts/test-public-language.pydeleted file mode 100644index bdc6eb69..00000000--- a/scripts/test-public-language.py+++ /dev/null@@ -1,50 +0,0 @@-#!/usr/bin/env python3-"""Tests for the public Markdown language boundary."""--import importlib.util-from pathlib import Path-import subprocess-import tempfile-import unittest---SCRIPT = Path(__file__).with_name("check-public-language.py")-SPEC = importlib.util.spec_from_file_location("check_public_language", SCRIPT)-MODULE = importlib.util.module_from_spec(SPEC)-SPEC.loader.exec_module(MODULE)---class PublicLanguageTest(unittest.TestCase):- def test_detects_chinese_prose_but_ignores_code_and_translation_link(self):- with tempfile.TemporaryDirectory() as value:- path = Path(value) / "README.md"- path.write_text(- "# English\n\n[Simplified Chinese / 简体中文](README.zh-CN.md)\n\n"- "Inline `中文 fixture` is code.\n\n```json\n{\"zh\": \"中文\"}\n```\n\n中文泄漏。\n",- encoding="utf-8",- )- self.assertEqual(MODULE.prose_violations(path), [(11, "中文泄漏。")])-- def test_chinese_translation_is_not_an_english_default(self):- self.assertFalse(MODULE.is_english_default(Path("guide.zh-CN.md")))- self.assertFalse(MODULE.is_english_default(Path("guide.zh.md")))- self.assertTrue(MODULE.is_english_default(Path("guide.en.md")))- self.assertTrue(MODULE.is_english_default(Path("README.md")))-- def test_discovery_includes_untracked_markdown(self):- with tempfile.TemporaryDirectory() as value:- root = Path(value)- subprocess.run(["git", "init", "-q"], cwd=root, check=True)- (root / "README.md").write_text("# Tracked\n", encoding="utf-8")- subprocess.run(["git", "add", "README.md"], cwd=root, check=True)- untracked = root / "NEW.md"- untracked.write_text("# New\n", encoding="utf-8")- self.assertIn(untracked, MODULE.tracked_markdown(root))-- def test_repository_public_surface_is_clean(self):- root = Path(__file__).resolve().parent.parent- self.assertEqual(MODULE.check(root), [])---if __name__ == "__main__":- unittest.main()diff --git a/tools/e2e-harness/SHARDING.md b/tools/e2e-harness/SHARDING.mdindex acd5ad4d..3b38f6a7 100644--- a/tools/e2e-harness/SHARDING.md+++ b/tools/e2e-harness/SHARDING.md@@ -1,6 +1,6 @@# E2E case sharding-[Simplified Chinese](SHARDING.zh-CN.md)+[简体中文](SHARDING.zh-CN.md)A general `hiroute-e2e` scenario may declare complete shards in `case_shards`. Each shardlists the steps that must execute together, and every step must belong to exactly one shard.diff --git a/tools/product-e2e/SMOKE.md b/tools/product-e2e/SMOKE.mdindex e529b6c0..2a0b2d69 100644--- a/tools/product-e2e/SMOKE.md+++ b/tools/product-e2e/SMOKE.md@@ -1,6 +1,6 @@# Current-candidate production smoke-[Simplified Chinese](SMOKE.zh-CN.md)+[简体中文](SMOKE.zh-CN.md)`hiroute-smoke` is a development-validation entry point. Its default quick run has threerequired cases: a controlled Responses request through the production Gateway; real