Skip to content

Commit 999ce80

Browse files
authored
Merge pull request #4854 from songoow/codex/jev-drift-shadow-upstream
feat(progress-review): raise the existing replan obligation from typed drift receipts of an optional Jev observer
2 parents bd37525 + 4e974dd commit 999ce80

176 files changed

Lines changed: 18689 additions & 36 deletions

File tree

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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,7 @@ write boundary:
486486
| --- | --- | --- |
487487
| Turn a public issue into a reviewable, evidence-backed change | [Issue Fix](loopx/capabilities/issue_fix/README.md) | `loopx capability show issue-fix --format json` |
488488
| Qualify the exact final diff before delivery | [Change Quality](loopx/capabilities/change_quality/README.md) | `loopx capability show change-quality-qualification --format json` |
489+
| Notice busy-but-off-goal work rounds before the periodic review | [Progress-Review Sentinel](loopx/capabilities/progress_review/README.md) | `loopx capability show progress-review-sentinel --format json` |
489490
| Preserve a changing stack of already reviewed branches | [Integration Branch](loopx/capabilities/integration_branch/README.md) | `loopx capability show integration-branch-reconcile --format json` |
490491
| Explore uncertain research without losing hypotheses and findings | [Explore](loopx/capabilities/explore/README.md) | `loopx capability show explore --format json` |
491492
| Rebase decisions on current evidence and verified outcomes | [Decision Context](loopx/capabilities/decision_context/README.md) | `loopx capability show decision-context --format json` |

‎README.zh-CN.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,7 @@ Capability 把上述通用原语组成 outcome-owned 工作泳道。先按结果
434434
| --- | --- | --- |
435435
| 把公开 issue 推进为可审查、有证据的变更 | [Issue Fix](loopx/capabilities/issue_fix/README.zh-CN.md) | `loopx capability show issue-fix --format json` |
436436
| 在交付前对精确 final diff 做质量验收 | [Change Quality](loopx/capabilities/change_quality/README.md) | `loopx capability show change-quality-qualification --format json` |
437+
| 在周期复审之前发现“忙碌但偏离目标”的工作轮次 | [进展评估哨兵](loopx/capabilities/progress_review/README.zh-CN.md) | `loopx capability show progress-review-sentinel --format json` |
437438
| 维护由多个已审查分支组成、持续变化的集成栈 | [Integration Branch](loopx/capabilities/integration_branch/README.md) | `loopx capability show integration-branch-reconcile --format json` |
438439
| 在不丢失假设和发现的前提下探索不确定研究问题 | [Explore](loopx/capabilities/explore/README.zh-CN.md) | `loopx capability show explore --format json` |
439440
| 基于当前证据和已验证结果重新建立决策上下文 | [Decision Context](loopx/capabilities/decision_context/README.zh-CN.md) | `loopx capability show decision-context --format json` |

‎apps/presentation/dashboard/src/features/personal-workspace/capability-localization.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ const capabilityCopy: Record<WorkspaceLocale, Record<string, LocalizedCopy>> = {
2525
displayName: "Change quality qualification",
2626
description: "Prepares a provider-neutral review packet, allows at most one policy-authorized safe-fix pass, and can require an exact-diff receipt.",
2727
},
28+
progress_review: {
29+
displayName: "Progress-review sentinel",
30+
description: "Records typed drift receipts from an external bounded review of scoped file deltas; assist may raise the existing autonomous replan obligation.",
31+
},
2832
explore_graph: {
2933
displayName: "Explore Graph",
3034
description: "Organizes bounded exploration as a typed evidence graph so branches, findings, and synthesis remain inspectable.",
@@ -85,6 +89,10 @@ const capabilityCopy: Record<WorkspaceLocale, Record<string, LocalizedCopy>> = {
8589
displayName: "变更质量验证",
8690
description: "生成与 Provider 无关的审阅包,最多允许一次策略授权的安全修复,并可要求精确 diff 回执。",
8791
},
92+
progress_review: {
93+
displayName: "进展评估哨兵",
94+
description: "记录外部有界评估对限定文件变化给出的类型化漂移回执;assist 模式可触发已有的自主重规划义务。",
95+
},
8896
explore_graph: {
8997
displayName: "探索图谱",
9098
description: "把有界探索组织为 typed 证据图,让探索分支、发现与综合结论都可检查、可追溯。",

‎docs/architecture/rfcs/optional-semantic-assistance-jev-v0.md‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# RFC: Agent Judgment and Optional Independent Assessment — Jev as a Candidate (v0)
22

33
- **RFC status:** Draft; M0 **accepted-for-discussion** ([maintainer decision](https://github.com/loopx-project/loopx/pull/4749#pullrequestreview-5259253204)). Q1–Q7 remain pending; the research/design is not accepted for implementation.
4-
- **Delivery maturity:** Proposal; documentation only, no integration or model qualification.
4+
- **Delivery maturity:** Research proposal; a separate D1-only optional shadow implementation is proposed in Appendix A. No model qualification or automatic correction is established. The default-off sentinel capability and its recorded differential live in [`loopx/capabilities/progress_review`](../../../loopx/capabilities/progress_review/README.md); those numbers do not change this Draft's status.
55
- **Created:** 2026-09-19. **Last normative revision:** 2026-09-20.
66
- **Implementation baseline:** `9f1916960306b3650d795895b89f331eeae2516e`; source ownership and trigger behavior rechecked at PR revision `27812bd0fb437f831a541b564bcb5be8a96ff77e`. Historical upstream inspection is recorded in Appendix A, not a whole-system certification.
77
- **Authors / owners:** Proposal author; existing domain maintainers own any direction selected. No new runtime authority or assigned implementation owner.
@@ -355,8 +355,19 @@ No default D1 implementation, automatic worker adoption or hidden mandatory-mode
355355
- **Delta:** D7/D8, provisional opportunity ordering, expected-value decomposition and bounded ranking comparisons; bilingual text and index updated.
356356
- **Evidence/remaining gap:** source inspection and documentation only. No live provider comparison, production ranker or new authority; Q1–Q7 remain pending.
357357

358+
### 2026-09-21 — Task-progress shadow implementation proposal (RFC D1)
359+
360+
- **Baseline:** upstream `62d18677c`; the implementation includes only the optional D1 command, without D2–D8 ranking or selector changes.
361+
- **Proposal:** scoped checkpoint capture around actual refresh-state, separate inference, off/shadow configuration and historical readback. See the [operation guide](../../../packages/loopx-jev/DRIFT_SHADOW.md).
362+
- **Evidence boundary:** [discussion evolution and current-implementation measurements](../../../packages/loopx-jev/DESIGN_DECISIONS.md); deterministic integration checks are distinct from provider accuracy and task benefit. No automatic intervention or native host-hook rollout.
363+
- **Pending:** maintainer acceptance of this optional-tool scope and independently evaluated comparative value. The earlier M0 intake is not retroactive implementation approval.
364+
358365
## Appendix B: Decision log
359366

367+
The separately proposed [Task-progress observation tool and decision record](../../../packages/loopx-jev/DESIGN_DECISIONS.md)
368+
do not change the historical M0 decision or settle Q1–Q7. Maintainers review that
369+
optional-tool scope separately; experimental results do not establish product adoption.
370+
360371
| Date | Proposal / decision | Owner / approval state | Alternatives | Sections |
361372
| --- | --- | --- | --- | --- |
362373
| 2026-09-19 | D1 CLI, optional Jev package and profile v1 recommended | Not approved; superseded as the default recommendation by this revision | D2 or separate configuration | 3, 5, 11, 12 |
@@ -376,6 +387,7 @@ Record any future accepting decision with its actual public link and exact scope
376387
| E4 | PR #4749 and its linked maintainer review | Public request and request-changes rationale; no accepted research/adoption decision |
377388
| E5 | A/B/C and F01–F12 | Proposed experiments/obligations; unexecuted for this feature |
378389
| E6 | [Jev external evidence supplement v0 (Chinese)](../../research/agent-workflow-audits/jev-external-evidence-supplement-v0.zh-CN.md) | Third-party quality and implementation evidence as of 2026-09-21; no change to Q1-Q7 or research/adoption status |
390+
| E7 | [Task-progress observation decision record](../../../packages/loopx-jev/DESIGN_DECISIONS.md) | Public synthesis and current-implementation observations; not independent qualification, complete A/B/C or automatic-correction evidence |
379391

380392
## Appendix D: Deferred mechanisms and rejected shortcuts
381393

‎docs/architecture/rfcs/optional-semantic-assistance-jev-v0.zh-CN.md‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# RFC:Agent 判断与可选独立评估——以 Jev 为候选方案(v0)
22

33
- **RFC status:** Draft;M0 **accepted-for-discussion(接受为讨论稿)**([维护者决定](https://github.com/loopx-project/loopx/pull/4749#pullrequestreview-5259253204))。Q1–Q7 仍待决;研究/设计未获实施批准。
4-
- **Delivery maturity:** Proposal;仅文档,没有接入实现或模型质量验收。
4+
- **Delivery maturity:** 研究提案;附录 A 单独提出仅 D1 的可选 shadow 实现,没有建立模型质量资格或自动纠正效果。默认关闭的哨兵 capability 及其录制对照见 [`loopx/capabilities/progress_review`](../../../loopx/capabilities/progress_review/README.zh-CN.md);这些数字不改变本 Draft 的状态。
55
- **Created:** 2026-09-19。**Last normative revision:** 2026-09-20。
66
- **Implementation baseline:** `9f1916960306b3650d795895b89f331eeae2516e`;在 PR 版本 `27812bd0fb437f831a541b564bcb5be8a96ff77e` 重新核对源码归属与触发器行为。历史 upstream 检查记于附录 A,不构成全系统认证。
77
- **Authors / owners:** 提案作者;被选方向由现有领域维护者负责。不新增运行时权威,也未指派实施 owner。
@@ -355,8 +355,18 @@ M0 不默认批准 D1 实施、自动 worker 采纳或隐藏的必需模型阶
355355
- **增量:** D7/D8、暂定机会顺序、预期价值分解与有界排序比较;同步双语正文及索引。
356356
- **证据/剩余缺口:** 仅源码检查和文档。没有 live 提供方比较、生产 ranker 或新权限;Q1–Q7 仍待决。
357357

358+
### 2026-09-21 — 任务进展旁路观察实现提案(RFC D1)
359+
360+
- **基线:** upstream `62d18677c`;当前实现只包含可选 D1 命令,不引入 D2–D8 排序或选择器改动。
361+
- **提案:** 真实 refresh-state 前后限定检查点采集、独立推理、off/shadow 配置和历史读回。参见[操作指南](../../../packages/loopx-jev/DRIFT_SHADOW.zh-CN.md)。
362+
- **证据边界:** [讨论演进与当前实现的运行结果](../../../packages/loopx-jev/DESIGN_DECISIONS.zh-CN.md);确定性集成检查不同于模型准确率或任务收益。没有自动干预或原生宿主 hook 推广。
363+
- **待决:** 维护者是否接受这个可选工具范围,以及独立评估的比较价值。不能将原 M0 收录倒推为实现已获批准。
364+
358365
## 附录 B:决策日志
359366

367+
单独提出的 [任务进展旁路观察工具及决策记录](../../../packages/loopx-jev/DESIGN_DECISIONS.zh-CN.md)
368+
不改变历史 M0 决定,也不替代 Q1–Q7。维护者单独评审可选工具范围,实验结果不等于产品采用。
369+
360370
| 日期 | 提案 / 决定 | owner / 批准状态 | 替代方案 | 章节 |
361371
| --- | --- | --- | --- | --- |
362372
| 2026-09-19 | 曾推荐 D1 CLI、可选 Jev 包和 profile v1 | 未批准;本修订撤下其默认推荐地位 | D2 或独立配置 | 3、5、11、12 |
@@ -376,6 +386,7 @@ M0 不默认批准 D1 实施、自动 worker 采纳或隐藏的必需模型阶
376386
| E4 | PR #4749 及链接的维护者评审 | 公开请求和请求修改理由,不是研究/采用已获接受 |
377387
| E5 | A/B/C 与 F01–F12 | 拟议实验/义务,该功能尚未执行 |
378388
| E6 | [Jev 外部证据补充 v0](../../research/agent-workflow-audits/jev-external-evidence-supplement-v0.zh-CN.md) | 截至 2026-09-21 的第三方质量与实现证据,不改变 Q1-Q7、研究或采用状态 |
389+
| E7 | [任务进展观察决策记录](../../../packages/loopx-jev/DESIGN_DECISIONS.zh-CN.md) | 公开论证摘要和当前实现的观察,不是独立资格、完整 A/B/C 或自动纠正证据 |
379390

380391
## 附录 D:延后机制与排除的捷径
381392

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
#!/usr/bin/env python3
2+
"""Smoke-test the progress-review sentinel differential from recorded answers.
3+
4+
Replays the committed comparison matrix against the committed provider
5+
recordings, so it needs no credential and no network. It asserts the harness
6+
shape and that the replay reproduces the committed summary: the typed repeat
7+
fuse stays quiet on every self-declared `advanced` round, while each receipt
8+
signal's first-flag rounds match what the live run recorded.
9+
"""
10+
11+
from __future__ import annotations
12+
13+
import json
14+
from pathlib import Path
15+
import sys
16+
import tempfile
17+
18+
REPO_ROOT = Path(__file__).resolve().parents[1]
19+
sys.path.insert(0, str(REPO_ROOT))
20+
sys.path.insert(1, str(REPO_ROOT / "packages" / "loopx-jev" / "src"))
21+
22+
from loopx_jev.sentinel_compare import COMPARISON_SCHEMA, compare # noqa: E402
23+
from loopx_jev.sentinel_matrix import load_sentinel_matrix # noqa: E402
24+
25+
FIXTURES = REPO_ROOT / "packages" / "loopx-jev" / "tests" / "fixtures" / "sentinel"
26+
27+
28+
def deterministic_view(comparison: dict) -> dict:
29+
"""Project the fields that must reproduce from recordings alone."""
30+
31+
return {
32+
case["case_id"]: {
33+
"first_flag_round": case["first_flag_round"],
34+
"first_obligation_round": case["first_obligation_round"],
35+
"typed_repeat_first_round": case["baseline"]["typed_repeat_first_round"],
36+
"statuses": [row["status"] for row in case["rounds"]],
37+
}
38+
for case in comparison["cases"]
39+
}
40+
41+
42+
def main() -> int:
43+
matrix = load_sentinel_matrix(FIXTURES / "matrix.json")
44+
expected_path = FIXTURES / "expected_summary.json"
45+
if not expected_path.is_file():
46+
print("expected_summary.json is missing; record it with `loopx-jev sentinel compare --live`")
47+
return 1
48+
expected = json.loads(expected_path.read_text(encoding="utf-8"))
49+
with tempfile.TemporaryDirectory(prefix="loopx-sentinel-smoke-") as temporary:
50+
comparison = compare(
51+
matrix,
52+
responses=FIXTURES / "responses",
53+
live=False,
54+
model=expected["model"],
55+
deadline_ms=5000,
56+
drift_threshold=2,
57+
)
58+
Path(temporary, "comparison.json").write_text(json.dumps(comparison), encoding="utf-8")
59+
assert comparison["schema_version"] == COMPARISON_SCHEMA
60+
assert comparison["execution"] == "recorded_replay"
61+
assert comparison["aggregate"]["cases"] == 16
62+
assert comparison["aggregate"]["baseline"]["typed_repeat_fired_cases"] == 0
63+
assert comparison["aggregate"]["signals"] == expected["live_aggregate"]["signals"]
64+
for case in comparison["cases"]:
65+
assert all(row["status"] != "not_captured" for row in case["rounds"]), case["case_id"]
66+
assert all(
67+
row["execution_kind"] == "recorded_replay"
68+
for row in case["rounds"]
69+
if row["status"] in {"completed", "abstained", "failed"}
70+
), case["case_id"]
71+
actual = deterministic_view(comparison)
72+
if actual != expected["deterministic_view"]:
73+
for case_id, view in actual.items():
74+
if view != expected["deterministic_view"].get(case_id):
75+
print("mismatch", case_id, json.dumps(view), json.dumps(expected["deterministic_view"].get(case_id)))
76+
return 1
77+
print(
78+
json.dumps(
79+
{
80+
"status": "ok",
81+
"cases": comparison["aggregate"]["cases"],
82+
"signals": comparison["aggregate"]["signals"],
83+
"baseline": comparison["aggregate"]["baseline"]["typed_repeat_fired_cases"],
84+
},
85+
indent=2,
86+
sort_keys=True,
87+
)
88+
)
89+
return 0
90+
91+
92+
if __name__ == "__main__":
93+
raise SystemExit(main())

‎loopx/capabilities/catalog.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
from .connector_registry.catalog_entry import CONNECTOR_REGISTRY_CATALOG_ENTRY
2929
from .external_research.catalog_entry import EXTERNAL_RESEARCH_CATALOG_ENTRY
3030
from .reliability_diagnostics.catalog_entry import RELIABILITY_DIAGNOSTICS_CATALOG_ENTRY
31+
from .progress_review.catalog_entry import PROGRESS_REVIEW_CATALOG_ENTRY
3132
from .registry import CapabilityRegistry
3233

3334
CAPABILITY_CATALOG_SCHEMA_VERSION = "loopx_capability_catalog_v0"
@@ -56,6 +57,7 @@
5657
CONNECTOR_REGISTRY_CATALOG_ENTRY,
5758
EXTERNAL_RESEARCH_CATALOG_ENTRY,
5859
RELIABILITY_DIAGNOSTICS_CATALOG_ENTRY,
60+
PROGRESS_REVIEW_CATALOG_ENTRY,
5961
)
6062
# Preserve the original import surface while routing all reads through the registry.
6163
CAPABILITIES = BUILTIN_CAPABILITIES

‎loopx/capabilities/configuration_ui.py‎

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@
66

77
from ..configuration_transaction import configuration_payload_revision
88

9+
from .progress_review.policy import (
10+
PROGRESS_REVIEW_MAX_DRIFT_THRESHOLD,
11+
PROGRESS_REVIEW_MIN_DRIFT_THRESHOLD,
12+
PROGRESS_REVIEW_MODES,
13+
PROGRESS_REVIEW_SIGNALS,
14+
)
15+
916
CAPABILITY_CONFIGURATION_CATALOG_SCHEMA = "capability_configuration_catalog_v0"
1017
CAPABILITY_CONFIGURATION_EDITOR_SCHEMA = "capability_configuration_editor_v0"
1118
CAPABILITY_CONFIGURATION_RESOLUTION_SCHEMA = "capability_configuration_resolution_v0"
@@ -288,6 +295,52 @@ def capability_configuration_editor(
288295
_field("strict_receipt", "Require an exact-diff receipt", "boolean"),
289296
],
290297
},
298+
"progress_review": {
299+
"supported_scopes": ["goal"],
300+
"writable_scopes": ["goal"],
301+
"fields": [
302+
_field(
303+
"mode",
304+
"Mode",
305+
"select",
306+
options=PROGRESS_REVIEW_MODES,
307+
required=True,
308+
description=(
309+
"off records nothing; shadow records typed receipts only; "
310+
"assist lets consecutive drift receipts raise the existing "
311+
"autonomous replan obligation. No pause or gate authority."
312+
),
313+
),
314+
_field(
315+
"signal",
316+
"Drift signal",
317+
"select",
318+
options=PROGRESS_REVIEW_SIGNALS,
319+
description=(
320+
"Which receipt judgment counts as drift: the Noul behavior/"
321+
"acceptance pair or the Choice relation/increment pair."
322+
),
323+
),
324+
_field(
325+
"drift_threshold",
326+
"Consecutive drift receipts before an obligation",
327+
"integer",
328+
minimum=PROGRESS_REVIEW_MIN_DRIFT_THRESHOLD,
329+
maximum=PROGRESS_REVIEW_MAX_DRIFT_THRESHOLD,
330+
),
331+
_field(
332+
"contract_revision",
333+
"Pinned goal contract revision",
334+
"text",
335+
nullable=True,
336+
description=(
337+
"sha256 of the observer basis the receipts must be bound to; "
338+
"printed by `loopx-jev drift init`. assist raises nothing "
339+
"without it, and receipts for other revisions are stale."
340+
),
341+
),
342+
],
343+
},
291344
"pull_request_review": {
292345
"supported_scopes": ["machine", "goal"],
293346
"writable_scopes": ["machine", "goal"],

0 commit comments

Comments
 (0)