Diagnostic category comment disagrees with its tests

未关闭 适合新手
#666 1 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@woohsin 已经在做这个了。

开始于 2026年11月13日。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
66/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
rust
领域
backend, testing

调研方向

阅读 src/agent/integrity.rs:150-157 中关于 sanitizer 的注释,同时查看 src/agent/evidence/run_signals.rs:53-68 中的 diagnostic() 和 tests/unit/agent/evidence.rs 中固定的三个测试。判断应该修改注释还是行为;issue 指出,修正注释是改动较小的方案。选定的行为及其测试与注释一致时,即为完成。

由索引模型根据 Issue 内容生成。

描述

Observed behavior

The comment above the diagnostic sanitizer in src/agent/integrity.rs:150-157 says a category is counted as other only when the run carries a setup error, and that a category on a run that did not fail to start is counted as nothing. The code does otherwise.

diagnostic() in src/agent/evidence/run_signals.rs:53-68 returns a result whenever the runner names a valid category, with or without setupError, using structured:<Category> as its material. a_structured_category_is_recorded_without_setup_text (tests/unit/agent/evidence.rs:1470) and a_runner_naming_other_without_prose_is_still_a_diagnostic (tests/unit/agent/evidence.rs:2257) pin that.

So a run that executed and passed everything still counts as a runner failure when it names a category, and the prompt can print 1 runs failed to start (src/agent/evidence.rs:580) beside 5 of 5 passing.

Expected behavior

The comment and the behavior agree. Either of these resolves it:

  • Correct the comment to say a runner-named category is counted without prose, and keep the code and tests.
  • Stop counting a category on a run that executed, and change the two tests above with it.
Reproduction
  1. Call record_test with {"passed":5,"total":5,"diagnostic":{"category":"syntax"}}.
  2. Read the ledger's diagnostics: the syntax counter is 1 and the compile or runner failure count is non-zero.

Read from the code and the pinned tests, not run against this exact payload.

CodeTrial version

desktop-latest-25-g55597864

Environment

Not environment specific.

Sanitized evidence

The line is labelled as browser-reported and unverified, so the impact on the report is small.

Dropping the fallback also fails test_claims_keep_browser_provenance_in_every_prompt_view (tests/unit/agent/evidence.rs:3150) in addition to the two tests above, so the intended behavior should be decided first. Deciding which of the two is intended is the whole task; the first option is the smaller change.

Public data confirmation
  • I removed credentials, session tokens, candidate recordings, and personal interview content from this public report.
主要语言
Rust
星标
228
派生
150
平均合并
1 天 3 小时
30 天内合并 PR
226

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

sysprog21/codetrial 的其他 Issue

查看 sysprog21/codetrial 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。