用哲学视角约束AI代码审查,让其发现人类难察觉的深层问题。
Philosophical Dispositions as Behavioral Constraints for AI-Assisted Code Review: An Empirical Study
- 用四种哲学思想定义AI审查行为,明确不做什么来聚焦不同问题。
- 识别出75%独特问题,46%与人工评审一致,且无误报。
- 适合想提升代码质量、探索AI行为控制的研究者和开发者。
AI代码审查工具通常作为通用‘专家评审’运行,输出结果同质化。本文提出一种通过哲学立场(皮浪怀疑主义、那瓦-尼雅逻辑、第欧根尼犬儒主义、儒家关系伦理)约束AI行为的系统,这些立场基于特定认识论传统,引导关注结构性差异的问题。每种立场以否定式定义(说明其拒绝的行为),配备自我监控故障模式(hamartia),并通过角色协议有序执行。在涵盖5种语言(Python、Go、C++、Java、Terraform)、7个仓库、5个组织(2家企、3个开源)、两个时期(2020年前、2024–2026年后)的50个合并请求上评估,该系统实现46%与人工评审的一致性,75%的发现为独有,601次输出中无一被作者判定为假阳性(未评估评分者间一致性,为局限)。对照实验显示,51%的发现无法通过通用‘专家’提示获得,且聚焦结构、操作与逻辑层面,非标准代码问题。初步跨模型验证(Claude Opus vs. GPT Codex 5.3-xhigh)在3个PR上显示100%框架结构一致,发现层面一致性达39%,表明框架有效约束行为并保留模型特性。
原文摘要 · Abstract (English)
AI-assisted code review tools typically operate as generic "expert reviewer" agents, producing homogeneous findings regardless of the analysis type needed. We present a system that constrains AI reviewer behavior through philosophical dispositions -- coherent personality lenses grounded in specific epistemological traditions (Pyrrhonist Skepticism, Navya-Ny=aya logic, Diogenes' Cynicism, Confucian relational ethics) that direct attention to structurally different types of issues. Each disposition is defined apophatically (by what it refuses to do), equipped with a self-monitoring failure mode (hamartia), and orchestrated in sequence by role protocols. We evaluate this system on 50 merged pull requests across 7 repositories spanning 5 programming languages (Python, Go, C++, Java, Terraform), 5 organizations (2 enterprise, 3 open-source), and 2 temporal eras (pre-AI 2020, post-AI 2024--2026). The disposition system achieves 46% convergence with human reviewers (validating signal quality), identifies unique findings at a 75% rate, and produces no findings judged false-positive by the author across 601 total findings (inter-rater agreement was not assessed and remains a limitation). A controlled baseline comparison demonstrates that 51% of disposition findings are not produced by the same model using generic "expert reviewer" prompting, and these unique findings target structural, operational, and logical concerns rather than standard code-level issues. Preliminary cross-model validation (Claude Opus vs.\ GPT Codex 5.3-xhigh) on 3 PRs shows 100% framework-structure adherence with 39% finding-level agreement, suggesting the framework provides real behavioral constraint while preserving model-specific analytical perspective.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。