harness-audit
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseharness-audit — Test Suite & Harness Quality Inspector
harness-audit — 测试套件与 Harness 质量检查器
Domain Rubric
领域准则
1. The Audit Hierarchy
1. 审计层级
Inspect target test suites across progressive architectural layers:
- Harness Anchor & Foundation Layer:
- Inspect the authoritative project harness anchor at and follow its
.agents/harness-anchor.mdroutes to read project testing standards.Governing Testing SSOTs - If missing: Check for legacy test guides (,
test/AGENTS.md). If found, use as temporary SSOT and advise runningtests/AGENTS.mdto establish canonical/zenforge-init. If absent, mark anchor as.agents/harness-anchor.mdand route toUNGROUNDED./zenforge-init - Verify existence on disk of registered hermetic primitives (Deterministic Clock, Storage Sandbox, Fixtures / Factories, Transport / Network Mock, Lifecycle / Cleanup).
- Inspect the authoritative project harness anchor at
- Smells & Flakiness Traps:
- Evaluate tests against anti-patterns and flakiness traps detailed in .
references/test-smells.md
- Evaluate tests against anti-patterns and flakiness traps detailed in
- Invariant Dimension Blind Spots:
- Audit test coverage against invariant dimensions detailed in .
references/invariant-dimensions.md
- Audit test coverage against invariant dimensions detailed in
按渐进式架构层级检查目标测试套件:
- Harness Anchor 与基础层:
- 检查位于 的权威项目 Harness Anchor,并遵循其中的
.agents/harness-anchor.md路由,以读取项目测试标准。Governing Testing SSOTs - 如果缺失:检查旧版测试指南(、
test/AGENTS.md)。如果找到,则将其作为临时 SSOT,并建议运行tests/AGENTS.md以建立规范的/zenforge-init。如果均不存在,则将 Anchor 标记为.agents/harness-anchor.md,并路由至UNGROUNDED。/zenforge-init - 验证已注册的 hermetic 原语(Deterministic Clock、Storage Sandbox、Fixtures / Factories、Transport / Network Mock、Lifecycle / Cleanup)在磁盘上是否存在。
- 检查位于
- 异味与 Flakiness 陷阱:
- 根据 中详述的反模式和 flakiness 陷阱评估测试。
references/test-smells.md
- 根据
- 不变量维度盲区:
- 根据 中详述的不变量维度审计测试覆盖情况。
references/invariant-dimensions.md
- 根据
2. Mandatory Reference Grounding
2. 强制参考依据
Before executing audit passes, agents MUST read and ground themselves in:
- for concrete smell definitions and remedies.
references/test-smells.md - for invariant testing vectors.
references/invariant-dimensions.md
执行审计前,Agent 必须阅读并依据以下内容:
- :具体的异味定义和修复方案。
references/test-smells.md - :不变量测试向量。
references/invariant-dimensions.md
3. Review Verdicts & Citation Rule
3. 审查结论与引用规则
- : Harness anchor active; hermetic foundation verified; zero flakiness smells; balanced invariant dimension coverage.
PASS - : Infrastructure present but maintenance debt observed (duplicate setup, missing assertion messages).
WARN - : Harness anchor absent, foundation missing (no virtual clock/ephemeral storage), or flakiness smells detected (clock leaks, sleeps).
CRITICAL - Dual-Citation Rule: Every defect must cite both the offending code pointer () and the violated invariant/remediation.
file:///path/to/test#L<N>
- :Harness Anchor 已启用;hermetic 基础已验证;不存在 flakiness 异味;不变量维度覆盖均衡。
PASS - :基础设施已到位,但发现维护债务(重复 setup、缺少 assertion message)。
WARN - :Harness Anchor 缺失、基础缺失(无 virtual clock/ephemeral storage),或检测到 flakiness 异味(clock leak、sleep)。
CRITICAL - 双重引用规则:每个缺陷必须同时引用问题代码指针()以及被违反的不变量或修复方案。
file:///path/to/test#L<N>
Canonical Output Contract
规范输出契约
markdown
undefinedmarkdown
undefinedHarness Audit Report: <Target Scope>
Harness Audit Report: <Target Scope>
1. Executive Verdict
1. Executive Verdict
- Verdict: <PASS | WARN | CRITICAL>
- Target Inspected: <Directory or Test Files>
- Harness Anchor (SSOT): <Cited anchor pointer or 'UNGROUNDED (Missing .agents/harness-anchor.md)'>
- Flakiness Risk: <LOW | MEDIUM | HIGH>
- Summary: <Single-sentence technical judgment>
- Verdict: <PASS | WARN | CRITICAL>
- Target Inspected: <Directory or Test Files>
- Harness Anchor (SSOT): <Cited anchor pointer or 'UNGROUNDED (Missing .agents/harness-anchor.md)'>
- Flakiness Risk: <LOW | MEDIUM | HIGH>
- Summary: <Single-sentence technical judgment>
2. Infrastructure & Anchor Gaps
2. Infrastructure & Anchor Gaps
(If clean: 'Harness anchor verified; foundational hermetic primitives active.')
- [<Anchor / Primitive>] <Gap Title>: <Deficit description>
- Impact: <Why this causes flakiness or maintenance debt>
- Recommendation: <Architecture fix or seed anchor pointer>
(If clean: 'Harness anchor verified; foundational hermetic primitives active.')
- [<Anchor / Primitive>] <Gap Title>: <Deficit description>
- Impact: <Why this causes flakiness or maintenance debt>
- Recommendation: <Architecture fix or seed anchor pointer>
3. Findings & Invariant Blind Spots
3. Findings & Invariant Blind Spots
- [<Smell / Dimension>] <Title>: <Defect description>
- Offending Code: <file>#L<N>
- Remediation: <Exact architectural correction required>
undefined- [<Smell / Dimension>] <Title>: <Defect description>
- Offending Code: <file>#L<N>
- Remediation: <Exact architectural correction required>
undefinedRouting
路由
- Missing harness anchor requires setup → (via /zenforge-init).
- Missing foundational hermetic primitives requiring architectural trade-off deliberation → (via /clarify).
- Discovered gaps or invariant blind spots ready for remediation planning → (via /changeset).
- A supported changeset authorizes localized test remediation and its acceptance criteria/verification → (via /forge).
- 缺少 Harness Anchor,需要初始化 →(通过 )。
/zenforge-init - 缺少需要权衡架构取舍的基础 hermetic 原语 →(通过 )。
/clarify - 发现可供修复规划使用的缺口或不变量盲区 →(通过 )。
/changeset - 已支持的 changeset 可授权局部测试修复及其验收标准与验证 →(通过 )。
/forge
Execution Protocol
执行协议
- Grounding & Scope Intake:
- Inspect if present.
.agents/harness-anchor.md - Read and
references/test-smells.md.references/invariant-dimensions.md
- Inspect
- Scale-Adaptive Audit Dispatch:
- In-Turn Execution (< 10 test files or localized suite): Inspect test suite against Audit Hierarchy directly in-turn.
- Subagent Fan-Out (broad multi-package test suites): Launch concurrent subagents dynamically scaled to partitioned directories or caller-declared budget, seeding with anchor and reference paths (offload raw test traces to
research)..agents/scratch/harness-<slice>-dossier.md
- Synthesis & Turn-Halt Gate (Fan-in):
- Deduplicate findings into the Canonical Output Contract with pointers to any offloaded dossiers.
- Present completed report into conversation stream and halt turn immediately.
- 依据与范围接收:
- 如果存在 ,则检查该文件。
.agents/harness-anchor.md - 阅读 和
references/test-smells.md。references/invariant-dimensions.md
- 如果存在
- 规模自适应审计调度:
- 轮内执行(少于 10 个测试文件或局部套件):直接在本轮中依据审计层级检查测试套件。
- Subagent 扇出(广泛的多包测试套件):按目录分区或调用方声明的预算,动态调整并启动并发 Subagent,并向其提供 Anchor 和参考路径(将原始测试跟踪结果卸载到
research)。.agents/scratch/harness-<slice>-dossier.md
- 综合与轮次停止门(Fan-in):
- 将发现去重并整合为规范输出契约,同时指向任何已卸载的 dossier。
- 将完成的报告呈现在对话流中,并立即停止本轮。