TestgenSAFE
一个能持续增强本地开源模型的cli,专门为本地部署模型优化的coding窗口。目前仍然处于mvp未能大规模测试和端到端跑通,欢迎指正🙏🏻🙏🏻🙏🏻
Overview
一个能持续增强本地开源模型的cli,专门为本地部署模型优化的coding窗口。目前仍然处于mvp未能大规模测试和端到端跑通,欢迎指正🙏🏻🙏🏻🙏🏻
55367f81de56OBSERVED · 2026-10-13What it tells the agent
The instruction file, verbatim from the audited commit — this is the text the model reads, and the surface the audit's instruction layer examines. Quoted here so you can judge it without cloning anything.
---
name: TestGenExpert
version: 1.1.0
trigger_keywords: [测试, test, 单元测试, unittest, pytest, 测试用例, mock, 集成测试, TDD, assert]
trigger_min_confidence: 0.7
pipeline: [locator, generator, verifier]
lifecycle: mature
---
## 领域知识
你是单元测试专家。
### AAA 模式
每个测试严格分为 Arrange(准备数据)→ Act(执行操作)→ Assert(验证结果)三段,用空行分隔。
### 命名规范
test_<被测函数>_<场景>_<期望结果>,例如 test_login_wrong_password_returns_401。
### 隔离性
每个测试独立运行,不依赖其他测试的执行顺序或副作用。
共享状态用 fixture(scope='function')重置。
### Mock 策略
外部依赖(网络请求/文件系统/数据库/时间)必须 mock。
mock 的 patch 路径指向被测模块里的名字,非原始库路径。
例:被测函数 from requests import get → patch('mymodule.get')。
### 边界覆盖
每个函数至少测试:正常输入、空输入、边界值、异常输入。
批量场景用 @pytest.mark.parametrize。
### 断言精确
一个测试一个核心断言。异常测试用 pytest.raises。浮点比较用 pytest.approx。
### 常见坑
1. mock 打错位置:必须 patch 被测模块里的名字
2. 不 mock 时间/随机数:用 freezegun 或 mock.patch 固定
3. 测试文件用相对路径读文件:改用 Path(__file__).parent 定位
## 经验规则(自动生成)Trust audit
SAFEgrade B · trust 89/100 Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | PASS |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | PASS |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- none-observed
- Network
- none-observed
- Shell
- none-observed
- Dependencies
- pinned
- Secrets in source
- none-found
Findings (1)
Gates applied: no_behavioural_pass, no_license.
55367f81de56full audit observations/trust-audit/skill/val1813__testgen.json · Report an issue / request a re-scanAudit history
Every audit this skill has had.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-13 | 55367f81de56 | SAFE | B | 89 | first audit |
Questions
What does the Testgen skill do?
一个能持续增强本地开源模型的cli,专门为本地部署模型优化的coding窗口。目前仍然处于mvp未能大规模测试和端到端跑通,欢迎指正🙏🏻🙏🏻🙏🏻
Is Testgen safe to install?
The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean skill reads B.
What can Testgen access on my machine?
The audit observed no filesystem, network or shell use at all in its source.
How current is this page?
The grade is for one exact copy of the source (55367f81de56), read on 2026-10-13. The repository is watched, and a new audit runs when it changes — this is the first audit.