Skip to content

✨ feat(reviewer): gate deep review on repository scope - #33

Merged
SigureMo merged 4 commits into
codex/review-finding-sortfrom
codex/review-scope
Sep 26, 2026
Merged

SigureMo merged 4 commits into
codex/review-finding-sortfrom
codex/review-scope

Conversation

@SigureMo

@SigureMo SigureMo commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

审查把一次性验收材料的“有助于证明功能”误当成“值得长期随仓库维护”,于是继续逐行修补 demos、实验日志和模拟器测试,消耗大量深审资源,却没有提出移出这些材料。

Changes

在现有 review task-control 中增加提交范围决策:程序从固定 Git head/base 生成完整文件清单,Agent 依据需求、调用方和仓库规则给出接收、移出或待确认及替代去向。程序拒绝遗漏、重复和过期清单;所有深审角色及其嵌套子任务只能领取已接收范围。独立设计继续使用同一 merge-base,作者文件分配不进入其设计 prompt。

同一 gh-slate 展示各范围的决策和依据;存在移出或待确认项时拒绝 approved。范围报告按被审 head 存储,模板拒绝旧 head 的报告;恢复子任务前校验固定清单、接收范围和版本。非 UTF-8 路径无损编码后经过 JSON、持久化和派发。常规审查继续异步交付已接收范围。测试审查先确认实际执行了生产代码,区分模拟器自身测试与生产回归证据。有效的无变化 follow-up 保持静默。

此门禁控制子任务派发,不隔离 Agent 的任意文件读取,也不替代 Agent 对维护必要性的语义判断;并非禁止所有 demos。

Validation

  • 303 项 Python 测试通过;Ruff lint/format、ty 和 diff 检查通过。
  • 行为测试使用真实 Git、SQLite 和 AgentService,覆盖文件清单、持久化、派发拦截、父子责任范围、固定版本及独立设计输入隔离。
  • 使用 Relax #370 的 4c137803 做离线验证:51 个文件统计与 GitHub 一致;人工基于本次调查提交范围判断后,得到接收 20、移出 28、待确认 3。没有把此结果宣称为模型自动判断,也没有发布新 review。
  • 真实 gh-slate 渲染验证了范围展示,以及移出/待确认时拒绝 approved、全部接收时接受 approved。

Related Issues

由 redai-studio/Relax#370 的验收材料审查问题触发。接在 #31 之后。

This PR is co-authored with @codex (gpt-6 astra xhigh)

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-26T04:47:31.658762Z 29be65a New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@SigureMo
SigureMo added this pull request to stack #23 September 26, 2026 03:38

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 62eb99e6e0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cd9327499b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ee325de18b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +40 to +42
manager = WorktreeManager(config)
manager.ensure_base_workspace(workspace)
manager.fetch_revision(workspace)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Serialize inventory access to the shared repository

With the default root concurrency greater than one, two reviews for different PRs in the same repository can enter build_inventory concurrently, but each call constructs a separate WorktreeManager, whose workspace locks are instance-local. On a cold repository both calls can therefore attempt to clone into the same local_path, causing one review to fail; subsequent fetches also bypass the shared manager used by AgentService. Reuse a shared manager and hold its workspace lock across inventory preparation instead of hiding shared-repository mutation behind a per-call instance.

AGENTS.md reference: AGENTS.md:L6-L6

Useful? React with 👍 / 👎.

raise ValueError("review scope requires a repository")
manager = WorktreeManager(config)
manager.ensure_base_workspace(workspace)
manager.fetch_revision(workspace)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Fetch the pinned head rather than only the moving PR ref

When a PR is force-pushed after _fetch_pr records head H1 but before inventory preparation, fetch_revision fetches the moving pull/<n>/head ref at H2 and returns without ensuring H1 exists locally. The subsequent rev-parse of H1 then fails the entire review instead of producing the promised pinned inventory; fetch or verify the recorded head SHA explicitly, as the clone path already does for pinned revisions.

AGENTS.md reference: AGENTS.md:L4-L4

Useful? React with 👍 / 👎.

"clarify": { "type": "integer", "minimum": 0 }
}
},
"groups": { "type": "array", "items": { "$ref": "#/$defs/scopeGroup" } }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Bind approved dashboard scope to the validated report

Fresh evidence after requiring scope for approval is that an approved document can still provide an arbitrary 64-character inventory_id, zero counts, and an empty groups array; this schema accepts it and the template renders a clean approval even when the service-persisted plan contains relocated or clarification paths. The manually copied dashboard value must be checked against the authoritative service report—or generated from it—rather than maintaining an independently editable second scope state.

AGENTS.md reference: AGENTS.md:L8-L8

Useful? React with 👍 / 👎.

SigureMo and others added 4 commits September 26, 2026 12:43
@SigureMo
SigureMo merged commit 3ab9881 into main Sep 26, 2026
12 checks passed
@SigureMo
SigureMo deleted the codex/review-scope branch September 26, 2026 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant