AgentAssay: Token-Efficient Regression Testing for Non-Deterministic AI Agent Workflows

agent 2603.02601 — Cross-paper Synthesis

AgentAssay — L3 Cross-Paper Synthesis #

§1 相关论文 #

EntityRelationWhy
2602.22302 (AgentAssert)直接集成AgentAssay 的 trace-first offline analysis 包含 "contract checking" 模块,明确引用 AgentAssert 的 behavioral contracts 作为可在 traces 上离线验证的属性
2604.06392 (Qualixar OS)测试对象候选Qualixar OS 的 12 种拓扑 + Forge 自动团队设计产生高度非确定性行为,正是 AgentAssay 的 stochastic testing 设计目标
2604.14228 (Claude Code)工业参照Claude Code 的 27% "无此工具就不会尝试" 的质变工作说明 agent regression 检测需要超越 pass/fail 的行为指纹方法

AgentAssay 与 AgentAssert 形成"测试+治理"组合:AgentAssert 定义 contracts,AgentAssay 验证 contracts 在多次执行中的 stochastic satisfaction [2603.02601]。AgentAssay 的 Theorem 3.1 (verdict soundness) 通过 Wilson CI 保证 false positive rate $\leq \alpha$,这与 AgentAssert 的 $(p,\delta,k)$-satisfaction 在概念上映射:两者都将 agent reliability 建模为概率事件 [2602.22302]

§2 本篇 vs 相关论文的 delta #

AgentAssay vs AgentAssert #

维度AgentAssayAgentAssert
关注点Regression detection(版本间变化检测)Runtime enforcement(部署时行为约束)
检测目标行为分布漂移(Hotelling's $T^2$)行为违约(JSD + compliance score)
时间点CI/CD pipeline(部署前)运行时(部署后)
判定语义Three-valued (Pass/Fail/Inconclusive)Continuous drift score $D(t) \in [0,1]$
Token 效率78% trial reduction via SPRT<10ms overhead per action
核心创新Behavioral fingerprinting (86% power vs 0% pass-rate)JSD distributional drift as leading indicator

核心 delta: AgentAssay 检测 跨版本变化 (regression = candidate worse than baseline),AgentAssert 检测 跨时间漂移 (drift = behavior deviating from spec) [2603.02601] [2602.22302]。两者的统计方法论(Wilson CI vs OU model, Hotelling's $T^2$ vs JSD)针对不同假设检验结构。

AgentAssay vs Qualixar OS Quality Modules #

Qualixar OS 的 quality assurance pipeline 包含 consensus judge、Goodhart detection、JSD 漂移监控 [2604.06392]。与 AgentAssay 的差异:

AgentAssay + Claude Code Design Space #

Claude Code 的 "1.6% 决策逻辑 + 98.4% 确定性基础设施" 结构 [2604.14228] 暗示:regression testing 应区分 infrastructure changes(确定性,传统测试可覆盖)vs decision logic changes(非确定性,需要 AgentAssay 的 stochastic testing)。当 agent 的行为变化不影响 pass rate(如 tool 使用模式改变)但影响用户体验时,behavioral fingerprinting 是唯一检测手段 [2603.02601]

§3 可攻击面 #

  1. "Regressions" 在实验中全部是行为性的: 论文中 pass rate 保持 100%,所有 "regressions" 仅是 behavioral fingerprint 变化 [2603.02601]。但如果行为变化不影响用户价值(如 agent 用不同工具达到相同结果),这些 "regressions" 可能是 false alarms。Fingerprinting 的 practical significance threshold 未定义。
    1. Evaluator 引入二次随机性: Model-based evaluators compound stochasticity——true pass rate 是 $P[\text{agent correct}] \times P[\text{evaluator correct}]$ [2603.02601]。SPRT 的 optimality 假设 Bernoulli trials,但 evaluator noise 可能使观测分布偏离 Bernoulli。
      1. Mutation adequacy theorem 的 coupling effect 假设未验证: Theorem 5.1 依赖 "coupling effect"(mutation-to-behavior sensitivity),这对源码已被充分研究,但对 agent mutations (prompt rewriting, tool reordering) 的经验有效性未建立 [2603.02601]
        1. $227 across 7,605 trials 的实验规模: 虽然论文强调 token efficiency,单个 scenario 约 75 trials per model 是统计上的最低要求。Power analysis 未报告实际 type-II error rate。
        2. §4 生态位 #

          AgentAssay 在 agent lifecycle 中的定位:

          
          Development → AgentAssay (CI/CD gate) → Deployment → AgentAssert (runtime monitoring) → Qualixar OS (orchestration QA)
          

          AgentAssay 是 pre-deployment quality gate,AgentAssert 是 post-deployment continuous monitoring。两者形成闭环:AgentAssay 的 baseline traces 可作为 AgentAssert 的 reference distribution $P_{\text{ref}}$ 来源。

          采纳信号: Apache 2.0, ~20K LoC, 751 tests, 10 framework adapters, Zenodo DOI。相比 AgentAssert/SkillFortify(无公开仓库或少量代码),AgentAssay 的工程成熟度最高。

          §5 未探索方向 #

          1. AgentAssay traces → AgentAssert $P_{\text{ref}}$ calibration: 用 AgentAssay 的 baseline traces 自动标定 AgentAssert 的 JSD reference distribution——解决 AgentAssert acknowledged limitation "no automated tooling for calibration" [2602.22302]
            1. Behavioral fingerprinting for Qualixar OS topology selection: 将 AgentAssay 的 Hotelling's $T^2$ test 应用于 Qualixar OS 的 12 种拓扑——当拓扑切换后 fingerprint distribution shift 超过阈值,自动回滚到前一拓扑。
              1. Mutation testing for Claude Code updates: 利用 AgentAssay 的 12 mutation operators 对 Claude Code 的 system prompt / tool description 变更进行 regression detection——检测 permission system 变化是否产生 unexpected behavioral shifts。