docs: 将仓库代码注释统一为中文
CI / docs-check (push) Canceled after 0s
CI / backend-test (push) Canceled after 0s
CI / service-test (push) Canceled after 0s
CI / frontend-test (push) Canceled after 0s
CI / rust-core (push) Canceled after 0s
CI / docs-check (pull_request) Canceled after 0s
CI / backend-test (pull_request) Canceled after 0s
CI / service-test (pull_request) Canceled after 0s
CI / frontend-test (pull_request) Canceled after 0s
CI / rust-core (pull_request) Canceled after 0s

This commit is contained in:
2026-09-10 00:40:56 +08:00
parent 51c592841d
commit d703ab64e3
249 changed files with 707 additions and 900 deletions
+3 -3
View File
@@ -1,4 +1,4 @@
"""Offline Agent/runtime and task API load test; all state lives in a temporary directory."""
"""离线Agent/运行时和任务API负载测试;所有状态都位于临时目录中。"""
from __future__ import annotations
import argparse
@@ -24,7 +24,7 @@ def stats(values):
async def main(output):
# Set before importing any app modules: container has import-time initialization.
# 在导入任何应用程序模块之前设置:容器具有导入时初始化。
with tempfile.TemporaryDirectory(prefix="notes-agent-task-stress-") as directory:
root = pathlib.Path(directory)
os.environ.update(APP_DATA_DIR=str(root / 'data'), APP_DB_PATH=str(root / 'app.db'),
@@ -105,7 +105,7 @@ async def main(output):
"terminal_recovery": True, "recovery_read_ms": round(recovery_read_ms,2), "retained_records": len(runtime._records)}
save('agent_tool_runs', await measured(batch))
# Hold model calls so all 200 records remain active while testing admission.
# 保留模型调用,以便在测试准入时所有 200 条记录保持活动状态。
gate = asyncio.Event()
async def blocked(request):
await gate.wait()
+1 -1
View File
@@ -1,4 +1,4 @@
"""Development reload watches application code, never imported extension packages."""
"""开发重载手表应用代码,从未导入扩展包。"""
from pathlib import Path
import uvicorn
+2 -2
View File
@@ -12,10 +12,10 @@ if (!(Test-Path -LiteralPath $runtimePython)) {
& uv venv --python 3.12 $runtimeRoot
if ($LASTEXITCODE -ne 0) { throw '无法创建模型运行环境' }
}
# CPU is the default. CUDA wheels include the runtime, not the NVIDIA driver.
# CPU 是默认值。 CUDA 轮子包括运行时,而不是 NVIDIA 驱动程序。
$torchIndex = if ($Device -eq 'cuda') { 'https://download.pytorch.org/whl/cu128' } else { 'https://download.pytorch.org/whl/cpu' }
$wheelVariant = if ($Device -eq 'cuda') { 'cu128' } else { 'cpu' }
# Pin the local version too: ==2.9.1 alone also accepts an already-installed CPU wheel.
# 也固定本地版本:==2.9.1 单独也接受已安装的 CPU 轮。
Write-Output 'COMPONENT:torch'
& uv @uvOptions pip install --python $runtimePython --index-url $torchIndex "torch==2.9.1+$wheelVariant" "torchaudio==2.9.1+$wheelVariant"
if ($LASTEXITCODE -ne 0) { throw 'PyTorch 安装失败' }
+1 -1
View File
@@ -1,4 +1,4 @@
"""Explicit real-model smoke: run with the backend Python, never part of unit tests."""
"""显式真实模型烟雾:与后端 Python 一起运行,绝不是单元测试的一部分。"""
import argparse
import asyncio
import json
+4 -4
View File
@@ -1,7 +1,7 @@
"""Explicit, bounded connection smoke against an already configured local Provider.
"""对已配置的本地提供商执行显式、有界的连接冒烟测试。
Defaults to a plan. --execute performs one test request, never reads credentials.
The output deliberately keeps untested protocol scenarios pending.
默认仅生成计划;--execute 会发送一次测试请求,但不会读取凭据。
输出会将尚未验证的协议场景保留为待处理状态。
"""
import argparse
from datetime import datetime, timezone
@@ -39,7 +39,7 @@ def main():
result['latency_ms'] = payload.get('latency_ms')
except HTTPError as error:
result['connection'] = 'failed'
result['http_status'] = error.code # Do not persist remote error bodies or headers.
result['http_status'] = error.code # 不保存远程错误正文或响应头。
except (URLError, TimeoutError, ValueError):
result['connection'] = 'unavailable'
args.output.write_text(json.dumps(result, ensure_ascii=False, indent=2), encoding='utf-8')
+1 -1
View File
@@ -1,4 +1,4 @@
"""Score authorized reference/hypothesis JSON segment arrays without a model or network."""
"""在没有模型或网络的情况下对授权参考/假设 JSON 段阵列进行评分。"""
import argparse
import json
import sys
+1 -1
View File
@@ -1,4 +1,4 @@
"""Real loopback HTTP task load with a separate, temporary Uvicorn process."""
"""使用单独的临时 Uvicorn 进程进行真实环回 HTTP 任务负载。"""
import argparse
import asyncio
import json
+1 -1
View File
@@ -1,4 +1,4 @@
"""Synthetic, isolated exact-search comparison; does not access the user Vault."""
"""综合的、孤立的精确搜索比较;不访问用户Vault"""
import heapq
import json
import math