Skip to content

Commit cbb3623

Browse files
committed
Verify Strict review claims and preserve unresolved findings in the verdict
1 parent 091d53f commit cbb3623

43 files changed

Lines changed: 1233 additions & 176 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎README.md‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ Strict——运行完整 CLI 工作流:
150150

151151
```bash
152152
./infermatrix-copilot -p "review pr 5172"
153+
./infermatrix-copilot --playbook pr-review --task-param pr=5172 --task-param include_score=true
153154
./infermatrix-copilot -p "review pr 5172" --plan-only # 只看计划不执行
154155
./infermatrix-copilot -p "review pr 5172" --performance # 用高能力模型档
155156
```
@@ -159,6 +160,15 @@ Strict 在固定到 PR head 的 checkout 上运行,并按改动规模和风险
159160
“Use InferMatrixCopilot in Strict mode to review …”;拿到 `run_id` 后,用
160161
`get_review_status` 和 `get_review_result` 轮询。
161162

163+
Strict 根据改动承诺检查证据。性能比较需要同一工作负载下可比的原始记录,生成结果需要检查实际输出。
164+
报告会列出无法核实的主张。评审结论考虑所有独立核实的实质性发现。即使某个严重问题已有当前
165+
head 上的活跃讨论、无需再发一条行内评论,它仍可导致 `REQUEST CHANGES`。
166+
167+
需要百分制评分时,CLI 可使用上面的 `include_score=true`,MCP 可传
168+
`review(..., mode="strict", include_score=true)`,SDK 可传 `StrictReviewRequest(..., include_score=True)`。
169+
评分默认关闭。结构化结果的 `review_claim_evidence` 给出证据检查,`review_score` 仅在请求时出现。
170+
有数值时它只供参考;head 已移动、无法复核或审查不完整时,报告列出原因并保留已支持的分项。
171+
162172
## 快速上手 2 · rebase
163173

164174
把单个 PR rebase 到最新 base。工作流会识别 fork,检出 PR 分支,完成 rebase、
@@ -366,7 +376,7 @@ Agent 会先读取仓库约定、相关源码和知识,明确完成条件,
366376
zero(`vllm-omni`),可传任何已接入仓库的短名、别名或 owner/name:
367377

368378
- `review(target, repo="vllm-omni", mode="direct", post=false,
369-
review_depth="", title="", body="", changed_files=[], repo_path="")`:
379+
review_depth="", title="", body="", changed_files=[], repo_path="", include_score=false)`:
370380
Direct 返回至多 3 条精确知识路由和审查门禁;Strict 返回 `run_id`。
371381
`repo_path` 可临时指定 Strict 使用的本地 checkout。
372382
- `validate_direct_review(subtraction_signal, subtraction?,

‎doc/architecture/SPEC/app/request_policy.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# app/request_policy.py — request safety policy
22

3-
<!-- verified-against: 2026-09-26 -->
3+
<!-- verified-against: 2026-11-25 -->
44

55
This headless application module validates untrusted read-only requests for
66
the SDK, MCP transport, and reserved-run worker. It derives a new `TaskSpec`
@@ -11,7 +11,8 @@ reading `request.json`; persisted input alone is not an authority.
1111
`post=False`, limits repositories to the configured allowlist, checks positive
1212
PR/issue numbers, validates full expected-head SHAs, and strips unknown
1313
params. A bounded `deterministic_signals` list applies only to quality review;
14-
carried findings are validated for PR review. `authorize_repo_path` verifies
14+
carried findings are validated for PR review. PR review accepts boolean
15+
`include_score`. False and omission have the same idempotency fingerprint. `authorize_repo_path` verifies
1516
both checkout origin identity and containment under allowed roots.
1617

1718
`enforce_strict_review_policy` accepts only PR review, forces eco mode, and

‎doc/architecture/SPEC/contract.md‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# contract.py —— 规范
22

3-
<!-- verified-against: 2026-09-30 -->
3+
<!-- verified-against: 2026-11-25 -->
44

55
`旧版跨仓库契约兼容层 · refactor-status: compatibility-shim`
66

@@ -13,7 +13,7 @@
1313

1414
## 公开契约(`__all__`)
1515
`SDK_API_VERSION` / `DIRECT_API_VERSION` / `STRICT_API_VERSION` /
16-
`QUALITY_API_VERSION` / `KNOWLEDGE_API_VERSION`(SDK、Quality 为 `"1.0.0"`,Direct 为 `"1.1.0"`,Strict 为 `"1.4.0"`,Knowledge 为 `"1.1.0"`,且都从 `sdk.v1.models`
16+
`QUALITY_API_VERSION` / `KNOWLEDGE_API_VERSION`(SDK、Quality 为 `"1.0.0"`,Direct 为 `"1.1.0"`,Strict 为 `"1.5.0"`,Knowledge 为 `"1.1.0"`,且都从 `sdk.v1.models`
1717
取唯一值)。`capabilities(max_strict_workers=1,
1818
supports_file_locking=True) -> dict` 委托 SDK typed handshake 再投影为兼容
1919
dict;它包含 distribution/SDK/Direct/Strict/Quality/Knowledge 版本、resource
@@ -23,7 +23,8 @@ revision、supported repositories,以及 `supports_expected_head`、
2323
`max_strict_workers`(服务真实的并发 worker 数,即 `STRICT_MAX_WORKERS`,
2424
同一 checkout+PR 的 run 仍逐个执行)。其余兼容导出包括 `build_review_result(run_dir) -> dict`(结构化评审
2525
结果:`contract_version`、`run_id`、`state`、`reviewed_head_sha`、`verdict`、
26-
`summary_markdown`、`comments`、`finding_dispositions`、`findings`、
26+
`summary_markdown`、`comments`、`finding_dispositions`、`findings`、本次运行记录的
27+
`review_claim_evidence` 及按请求生成的 `review_score`、
2728
`stale`/`expected_head_sha`/`actual_head_sha`、`diagnostics`);`unknown_run_result(run_id)`(显式
2829
`state: unknown`,绝不抛错 —— 丢响应和还在跑必须可区分);
2930
`sanitize_comments` 与 `COMMENT_FIELDS`,以及 `finding_id` / `build_findings`;另有从 `direct_routing` 再导出的

‎doc/architecture/SPEC/engine/agent_runtime.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@
5555
- briefing 只在 `profile_briefing_enabled` 时进 prompt(消融开关)。
5656
- 输出:base+extension schema、一轮修复、状态→FailureKind;预算耗尽会**强制最终答复**。
5757
全程 trace(`agent_dispatch`/`agent_output`)。
58+
- Strict 的每个调查可以返回 `claim_checks`。请求评分时还会返回 `dimension_ratings`。
59+
重试和深度升级保留已获取的证据。reducer 独立合并调查记录,即使所有评论都被丢弃,
60+
证据仍会进入固定版本的核验和结果输出。
5861
- ensemble reducer:逐编号候选做 keep/drop/dup、确定性组装、**未提及即保留**
5962
(fail-open)、共识门控的快路径。
6063
- **零产出的 lens 单独重问一次**(`ensemble_zero_yield_retry`),

‎doc/architecture/SPEC/engine/steps/_common.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,7 @@ step 样板的收敛就落在这个文件。`require_repo`(K3)、`no_llm_gap
6161
`store_for(adapter)`(K3)。
6262
已落地与待抽取的每一个都必须**保住它所包裹的那条保证**(B1 类型化返回、B2 交接、
6363
E2 `capability_gap` 事件)。**只在 ≥2 个真实现场时才抽取**。
64+
65+
Strict review passes `issue_comments=False` to `gh_read_tools`. Its issue reader
66+
can inspect issue title, body and labels without exposing conversation on a PR
67+
addressed by the same number. Issue workflows retain the default comment access.

‎doc/architecture/SPEC/engine/steps/pr.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,9 @@ K3/K4/K7 的精简(require_repo/published/from_state)已在各子模块落
129129
## 自进化接入(2026-10-04)
130130

131131
影子模式下 `pr.fetch_diff`、gate 和 CI 取数从可信控制器准备的 `pr_snapshot` 读取;快照缺少必要字段即阻塞,不回退到实时网络。基线和候选共用冻结的 base/head 与上下文。
132+
133+
Strict review fetches the PR description, commit subjects and linked issue
134+
acceptance criteria before source investigation. Its initial GitHub query omits
135+
PR discussion and review threads. Full PR quality assessments may still include
136+
discussion. The checkpoint records whether the fetched context is independent of
137+
feedback, so reviews resumed from older combined bundles can exclude discussion.

‎doc/architecture/SPEC/engine/steps/review.md‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,23 @@ Direct 1.1 / Strict 1.3 accept typed `CarriedFinding` inputs (unique IDs, source
138138
## 自进化接入(2026-10-04)
139139

140140
影子评审继承严格工具 scope;PR 文件、基础版本与历史工具只能读取冻结仓库,涉及生产写入的步骤由执行器拒绝。
141+
142+
## Independent findings and publication
143+
144+
`publication.py` derives the verdict from selected findings before applying
145+
thread suppression, the unit-test comment cap or the inline comment budget.
146+
Current-head rechecks may contribute a confirmed carried defect. An open recheck
147+
gap is reported and precludes an otherwise empty approval.
148+
149+
`feedback.py` compares at most the latest 50 inline threads after candidate
150+
selection. Suppression requires an active, current RIGHT-side thread at the same
151+
path and line with matching concern text on the reviewed head. The review links
152+
the existing thread and retains its impact in the verdict. Missing feedback and
153+
a moved head preserve the independently selected findings. No-discussion and
154+
isolated snapshot reviews perform no GitHub feedback lookup.
155+
156+
The host verifies claim evidence against the pinned source or raw CI log
157+
records tied to the reviewed revision. A verified acceptance requirement can
158+
affect the verdict. When the caller requests `include_score`, missing required
159+
artifacts zero the claim-evidence dimension. The scoring result explains a
160+
withheld total when the head is stale or material checks remain incomplete.

‎doc/architecture/SPEC/improve.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# improve/ —— 规范(元改进引擎)
22

3-
<!-- verified-against: 2026-10-09 -->
3+
<!-- verified-against: 2026-11-25 -->
44

55
`设计:/data/zhoutaichang/copilot/meta-improvement-engine-design.md v1(GPT-6 sol 批准 2026-09-29) · refactor-status: building (P0–P4 已落地)`
66

@@ -16,7 +16,8 @@
1616

1717
Replay envelope 保留完整文件与引用,由 TraceStore 脱敏、压缩和按内容寻址;未压缩 UTF-8 JSON 上限为 64,000,000 bytes。超限只记录 `replay_capture_deferred` 的大小、上限和摘要并抛出专用 `ReplayCaptureLimit`,不保存截断输入,也不进入 replay 数据集。知识起草无活动进化工作流时继续原生固定生成器;活动工作流(含已禁用项)缺少完整 replay 时保持事件 pending。其他捕获错误不能走此延期路径。
1818

19-
`runtime.py` 重新应用补丁核验实际评估树,原子采用本地不可变 release,原生 PR 评审、知识草稿、lint 和归因在活动制品的沙箱中运行。宿主记录运行指纹才更新部署基线。首次八个不同 item 与上一版比较,七日缺证据自动恢复;保留后每周最多八个新 item 持续比较。契约、凭据/隔离/预算、指纹失败或资源显著退化自动恢复上一版;恢复制品不可验证则禁用执行。执行/切换锁及持久化激活、回滚意图支持重启恢复。
19+
`runtime.py` 重新应用补丁核验实际评估树,原子采用本地不可变 release,原生 PR 评审、知识草稿、lint 和归因在活动制品的沙箱中运行。PR 评分和主张证据在宿主的真实评审版本上验证,沙箱重建的 Git SHA 不作为实际 PR 的标识。
20+
宿主记录运行指纹才更新部署基线。首次八个不同 item 与上一版比较,七日缺证据自动恢复;保留后每周最多八个新 item 持续比较。契约、凭据/隔离/预算、指纹失败或资源显著退化自动恢复上一版;恢复制品不可验证则禁用执行。执行/切换锁及持久化激活、回滚意图支持重启恢复。
2021

2122
默认 `IMPROVE_EVALUATION_MODE=objective`、`IMPROVE_PROMOTION_MODE=automatic`,不要求人工标签、判官或 performance 模型。总开关仍关闭,固定模型取 `IMPROVE_EVOLVE_MODEL` 或 eco;每周一个候选、一次修复及共享 20 美元预算不变。`gold/pr` 模式保留原有双家族取证及人工流程。无隔离生产驱动的机械工作流仍可 lint,但不自动采用。当前主机命名空间关闭,代码候选实际执行延期。
2223

‎doc/architecture/SPEC/intent.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# intent.py —— 规范
22

3-
<!-- verified-against: 2026-10-04 -->
3+
<!-- verified-against: 2026-11-25 -->
44

55
`LOC ~379 · 任务层 · refactor-status: ok`
66

@@ -30,6 +30,8 @@ LLM 把命令(kind / pr / issue / flags)分类成 `TaskSpec`;低于置信
3030
推理模型会先把预算花在思考上,500 的上限下它**一个 JSON 字符都吐不出来**,于是一条
3131
完全清楚的命令被答成"I couldn't parse that"。`review/planner.py` 踩过同一个坑并定在
3232
8000;**修复轮同样要给足**——那正是被饿死的模型会落到的地方。
33+
- PR 评审可以按明确请求附加数值评分,例如 `review PR 7 with a score`。
34+
省略或否定评分请求时保留默认值。
3335
- 空命令或未配置 LLM → 澄清(绝不猜测)。
3436
- **有歧义就澄清 —— 绝不猜测**:LLM 置信度 < 0.7、显式澄清、畸形回复、未知 kind,
3537
全都 → 澄清。

‎doc/architecture/SPEC/mcp_server.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# mcp_server.py —— 规范
22

3-
<!-- verified-against: 2026-09-26 -->
3+
<!-- verified-against: 2026-11-25 -->
44

55
`MCP 协议适配器 · refactor-status: ok`
66

@@ -18,7 +18,7 @@
1818
`CopilotMCP` 是 `RunService` 的兼容别名;`build_mcp()` 注册 start/poll 工具,外加
1919
`get_capabilities()`(包 `contract.capabilities`,含
2020
`MAX_STRICT_WORKERS=1` 与文件锁能力上报)。`start_review` 接受
21-
`expected_head_sha`;`start_strict_review` 接受 `idempotency_key` 并把
21+
`expected_head_sha` 及默认关闭的 `include_score`;`start_strict_review` 接受 `idempotency_key` 并把
2222
`(run_id, created)` 语义(见下)落到入队决定上。新增内部
2323
`reserve_strict_review` 原样返回该 tuple,供 typed SDK 准确报告幂等复用;
2424
`start_strict_review` 继续只返 `run_id`,保持 MCP/既有调用兼容;

0 commit comments

Comments
 (0)