assay

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

assay — Mutation Review & Adversarial Quality Engine

assay —— 变异审查与对抗性质量引擎

Domain Rubric

领域评分标准

1. Review Dimensions

1. 审查维度

Inspect mutation artifacts against 4 structural dimensions:
  • Scope Integrity (Blast Radius & Anti-Bloat): Verify that every planned or modified file is strictly load-bearing. Flag accidental formatting, cosmetic churn, unrelated refactoring, or speculative files.
  • Contract & Spec Fidelity (Anti-Drift): Reconcile changes against governing specifications, SSOT documents, and established interfaces. Flag undocumented behavioral changes or broken contracts.
  • Structural Cohesion & Slicing: Verify modular encapsulation without leaky abstractions. For tasks, verify true vertical slicing (end-to-end capability) over horizontal layer fragmentation.
  • Operational Hygiene & Safety: Expose unhandled edge cases, resource leaks, lingering debug probes (
    [DEBUG-<hex>]
    ), or unredacted secrets.
从4个结构维度检查变异工件:
  • 范围完整性(爆炸半径与防膨胀):验证每个计划中或已修改的文件是否严格承担必要职责。标记意外的格式调整、无意义改动、无关重构或推测性文件。
  • 契约与规格保真度(防漂移):将变更与治理规范、单一事实来源(SSOT)文档及既有接口进行核对。标记未记录的行为变更或破坏的契约。
  • 结构内聚性与切片:验证模块化封装,避免泄漏抽象。对于任务,验证真正的垂直切片(端到端能力),避免水平分层碎片化。
  • 运维卫生与安全性:暴露未处理的边界情况、资源泄漏、残留调试探针(
    [DEBUG-<hex>]
    )或未脱敏的机密信息。

2. Review Verdicts

2. 审查结论

  • PASS
    : Zero structural or contract defects; blast radius is minimal and strictly load-bearing; ready for execution or commit.
  • CONDITIONAL
    : Minor defects observed (accidental churn, missing edge test, localized bloat); actionable remediation provided to unblock.
  • FAIL
    : Critical defects detected (contract violation, unauthorized blast radius, fake vertical slice, regression risk); reject and halt.
  • PASS
    :零结构或契约缺陷;爆炸半径最小且严格必要;可执行或提交。
  • CONDITIONAL
    :发现轻微缺陷(意外改动、缺失边界测试、局部膨胀);提供可操作的修复建议以解除阻塞。
  • FAIL
    :检测到严重缺陷(契约违反、未授权的爆炸半径、伪垂直切片、回归风险);拒绝并中止。

3. Anti-Hallucination & Grounding Guardrails

3. 反幻觉与落地护栏

  • Dual-Citation Rule: Every reported
    Contract & Spec Fidelity
    defect must explicitly cite both the offending code pointer (
    file:///path/to/code#L<N>
    ) and the violated specification or interface contract (
    file:///path/to/spec#L<M>
    ). Forbid claiming drift without contract citation.
  • Multi-Layer Contract Grounding: Ground mutations against 3 authoritative layers: explicit specifications/tasks, structural code interfaces/schemas, and baseline test invariants. Mark Contract Fidelity as
    UNGROUNDED
    only when no governing specs or code contracts exist across the repository; evaluate strictly on Scope Integrity and Hygiene. Forbid inventing imaginary requirements.
  • 双重引用规则:每个报告的
    契约与规格保真度
    缺陷必须同时引用违规代码位置(
    file:///path/to/code#L<N>
    )和被违反的规范或接口契约(
    file:///path/to/spec#L<M>
    )。禁止在没有契约引用的情况下宣称漂移。
  • 多层契约落地:将变更对接到3个权威层:显式规范/任务、结构代码接口/模式、基线测试不变量。仅当仓库中不存在任何治理规范或代码契约时,才将契约保真度标记为
    UNGROUNDED
    ;此时仅按范围完整性和运维卫生进行评估。禁止虚构需求。

Canonical Output Contract

规范输出契约

markdown
undefined
markdown
undefined

Assay Report: <Target / Scope Name>

Assay Report: <Target / Scope Name>

1. Executive Verdict

1. Executive Verdict

  • Verdict: <PASS | CONDITIONAL | FAIL>
  • Target Inspected: <Working Tree Diff | Staged Changeset | Task Breakdown | Commit <hash>>
  • Governing Contracts: <Cited specification file pointers or 'UNGROUNDED (No governing spec found)'>
  • Summary: <Single-sentence technical judgment>
  • Verdict: <PASS | CONDITIONAL | FAIL>
  • Target Inspected: <Working Tree Diff | Staged Changeset | Task Breakdown | Commit <hash>>
  • Governing Contracts: <Cited specification file pointers or 'UNGROUNDED (No governing spec found)'>
  • Summary: <Single-sentence technical judgment>

2. Findings & Actionable Remediations

2. Findings & Actionable Remediations

(If PASS: 'No defects observed across scope integrity, contract fidelity, structural cohesion, and operational hygiene.')
  • [<Dimension>] <Defect Title>: <Concise technical description of defect and failure risk>
    • Offending Code: <file>#L<N>
    • Violated Contract: <spec_or_interface>#L<M>
    • Remediation: <Exact minimal correction needed>
(If PASS: 'No defects observed across scope integrity, contract fidelity, structural cohesion, and operational hygiene.')
  • [<Dimension>] <Defect Title>: <Concise technical description of defect and failure risk>
    • Offending Code: <file>#L<N>
    • Violated Contract: <spec_or_interface>#L<M>
    • Remediation: <Exact minimal correction needed>

3. Pipeline Routing

3. Pipeline Routing

  • /forge
    ── Target is PASS; proceed to implementation or commit handoff.
  • /changeset
    ── Blast radius bloat or structural defects require re-planning.
  • /clarify
    ── Contract drift or ungrounded architectural tensions detected.
undefined
  • /forge
    ── Target is PASS; proceed to implementation or commit handoff.
  • /changeset
    ── Blast radius bloat or structural defects require re-planning.
  • /clarify
    ── Contract drift or ungrounded architectural tensions detected.
undefined

Execution Protocol

执行协议

Phase 1: Scope & Contract Grounding

阶段1:范围与契约落地

  1. Ingest target mutation artifact (uncommitted diff, staged changeset,
    .agents/tasks/
    , or commit range).
  2. Trace and ground governing boundaries across the codebase per Multi-Layer Contract Grounding guardrails.
  1. 摄取目标变更工件(未提交的diff、已暂存的变更集、
    .agents/tasks/
    或提交范围)。
  2. 按照多层契约落地护栏,在代码库中追踪并确定治理边界。

Phase 2: Scale-Adaptive Adversarial Review

阶段2:规模自适应的对抗性审查

  1. Evaluate mutation scope scale:
    • In-Turn Review (localized diff, 1–5 files, or single task card): Audit mutations directly in-turn against review dimensions.
    • Subagent Fan-Out (multi-package changesets or broad PR diffs): Launch 2–3
      research
      subagents (Role:
      Mutation Reviewer (<Slice>)
      ). Seed each with target diff slice, discovered contracts, and Canonical Output Contract.
  2. Seed each subagent with:
    • Its allocated diff slice and target file pointers.
    • Discovered governing contracts and invariant baselines.
    • The Dual-Citation Rule and Canonical Output Contract as the mandatory output contract.
  3. Assign subagent role:
    Mutation & Architecture Reviewer (<Target Slice/Subsystem>)
    .
  1. 评估变更范围规模:
    • 回合内审查(局部diff,1–5个文件,或单个任务卡片):在回合内直接按审查维度审计变更。
    • 子代理扇出(多包变更集或大型PR diff):启动2–3个
      research
      子代理(角色:
      Mutation Reviewer (<Slice>)
      )。为每个子代理提供目标diff切片、已发现的契约和规范输出契约。
  2. 为每个子代理提供:
    • 分配的diff切片和目标文件指针。
    • 已发现的治理契约和不变量基线。
    • 双重引用规则和规范输出契约作为强制输出契约。
  3. 分配子代理角色:
    Mutation & Architecture Reviewer (<Target Slice/Subsystem>)
    。

Phase 3: Synthesis & Turn-Halt Gate (Fan-in)

阶段3:汇总与回合暂停门(扇入)

  1. Reconcile and deduplicate subagent findings into the Canonical Output Contract.
  2. Compute the definitive Executive Verdict (
    PASS
    only if all slices pass; downgrade to
    CONDITIONAL
    or
    FAIL
    based on highest defect severity).
  3. Emit the report into the conversation stream and halt turn immediately.
  1. 将子代理发现汇总并去重到规范输出契约中。
  2. 计算最终执行结论(仅当所有切片通过时才是
    PASS
    ;根据最高缺陷严重性降级为
    CONDITIONAL
    或
    FAIL
    )。
  3. 将报告输出到对话流中,并立即暂停回合。