Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Agent xoá test để build xanh: dựng cổng chặn đọc từ git

说明与用途

CI 门禁检查 git 差异中的测试删除或弱化断言,除非存在 ORACLE-CHANGE 标签,否则失败构建,从而防止代理隐藏错误。

问题

Agents can delete or weaken tests to make builds pass, hiding bugs from the team.

结果

The gate prevents silent test removal or weakening, ensuring that builds reflect true test coverage and exposing hidden production bugs.

工作流

  • 1. Configure the gate to read the HEAD and working tree diffs.
  • 2. Parse test files with AST to count assertions and pytest.raises calls.
  • 3. Detect test deletions, removed assertions, or weakened checks (e.g., assert True, pass).
  • 4. If any issue is found, fail the build unless a special tag ORACLE-CHANGE: is present in the diff.
  • 5. Log the result and optionally send a warning to the repository.
  • 6. Run the gate as part of the CI pipeline before merging changes.

证据

The gate reads HEAD and working tree, counts assertion nodes via AST, and fails if the count decreases or a test file is deleted.

来源

A special tag ORACLE-CHANGE: must be present in the diff to allow oracle changes.

来源

  • 记录日期: 2026-09-15T14:15:31.639Z