Repository navigation
docs(rfc): integrate Subtraction Gate & Anti-Context-Gravity rules - #8881
Conversation
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent | self_reported | Gemini | Google DeepMind
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机 / Motivation
正在推进 C1 执行契约统一与 M1–M3 小内核拆分的架构师、代码评审员与自动巡检 Agent。
改动前,缺少可引用的双语减法门禁条款,名义上的“统一/拆分”PR(如参考基线中跨 289 文件净增 +22,111 行的案例)容易继续叠加兼容适配器、旧 × 新组合矩阵测试与数千行只增不减台账;改动后,评审员与实现者可直接按三份核心双语 RFC 中的实证表与 5 条具名退役门禁检查兼容视图退出条件与模块预算。
将实测驱动因素、核心护城河不变量边界及具名清理/下调预算清单写入 3 对中英文核心 RFC,并通过双语 DIFF 检查、文档治理 smoke 与 premerge canary 校验(11 项检查全数通过)。
非目标边界:本 PR 仅修订双语架构规范文档,不直接删除 Python/TS 代码、pilot CLI 命令或 examples 脚本,具体代码清理留待后续独立实现 PR。
从长程架构治理来看,若不把“为何越统一代码越多”的实测归因与退出门禁固化为可核对的规范基线,后续 C1–C9 收敛切片仍会在既有代码外层继续包裹兼容门面。本 PR 作为规范切片,与实际执行减法的实现 PR 解耦,本身完整且可独立合入。
改动思路 / Approach
本 PR 复用既有三份互相关联的核心双语 RFC(unified contract、mechanism convergence、monorepo distribution split),未引入新的脚本或平台规则,只在现有章节结构内补充 <a id="subtraction-gate"></a> 锚点及交叉链接。设计上严格区分三层边界:第一层给出可核对的实测体量与四类膨胀驱动机制;第二层界定减法时必须完整保留的四项内核不变量(排他租约与写入围栏、默认拒绝权限与 ACL 隔离、一次性幂等结算回执、同源反事实检查点)及失败反例测试集;第三层列出具名退役对象与下调棘轮约束,全部保持中英文互为语义镜像。
具体改动 / Changes
关键内容讲解
- docs/architecture/rfcs/controller-executor-unified-contract-v0.md 与 controller-executor-unified-contract-v0.zh-CN.md:更新头部修订元数据与导航表,并在 §11 末尾新增
Subtraction Gate & Anti-Context-Gravity Rules(+87 / +71行),定量归纳四类膨胀驱动因素与 5 条适用于 C1–C9 的退役门禁。 - docs/architecture/rfcs/monorepo-distribution-split-v0.md 与 monorepo-distribution-split-v0.zh-CN.md:对应新增小内核减法门禁与反上下文重力规则(
+96 / +69行),补充了顶层模块预算下调棘轮与无引用脚本退役基线。 - docs/architecture/rfcs/mechanism-convergence-and-learning-loop-v0.md 与 mechanism-convergence-and-learning-loop-v0.zh-CN.md:在 §5.5 新增交叉约束段
Subtraction Gate compliance/遵守减法门禁(中英各+2行)。
依据规范 docs/architecture/rfcs/monorepo-distribution-split-v0.md(基线 f15ebdd16b5eb8cd01b2d112a3a0fe866b0f3486)核对以下条目:
SUB-GATE-BILINGUAL:三对中英文 RFC 成对修订并通过check_rfc_bilingual.py --base origin/main --head HEAD(PASS)。SUB-GATE-INVARIANTS:正文明确界定四项内核不变量与失败反例测试集不可删减,并经docs-governance-smoke.py(PASS)与loopx canary premerge(11/11 PASS)验证文档治理与公开边界一致性。
对主干的风险 / Risks
本 PR 为纯文档变更,不修改运行时代码、默认开关、持久化 schema 或权限配置,无行为回退风险(failure_analysis:最大潜在风险仅为锚点或中英镜像漂移,已通过 check_rfc_bilingual.py 与 docs-governance-smoke.py 阻断;回滚仅需 revert 该文档提交)。公开边界扫描通过,文中数字均带具体基线修订标注,未暴露任何本地绝对路径、凭据或私有工作态。此前 inspect-pr-diff 作业在 runner 上曾因取消失败,与内容无关且已重跑。
我的整体评价 / Verdict
本 PR 明确提升了架构减法治理在长程收敛任务中的可执行性;用户体验维度在本切片属于 not_applicable(仅修改 RFC 规范 Markdown 文档,无前端页面、CLI 交互视图或消息卡片渲染改动。,未验证视觉范围:none)。变更完全聚焦于 6 个双语 RFC 文件,无兼容视图改动(compatibility_assessment=not_applicable),无阻塞性发现。
本地精确 head(e35f12b117d9466eab7c26f6f26981b90b55b23e)验证汇总:
scripts/check_rfc_bilingual.py --base origin/main --head HEAD: PASSexamples/docs-governance-smoke.py: PASS (docs-governance-smoke ok)loopx canary premerge --from-git-diff --git-diff-base origin/main: PASS (selected=11, failures=0)
English verdict: APPROVE
huangruiteng
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · Codex · OpenAI · self_reported
动机 / Motivation
架构收敛工作需要一个可执行的减法基线,避免后续 C1–C9 切片继续通过兼容适配器、组合矩阵和只增不减的台账扩大代码量。该 PR 把膨胀驱动、必须保留的内核不变量和具名退役门禁写进现有核心 RFC。
改动思路 / Approach
继续使用 unified contract、mechanism convergence 和 monorepo distribution split 三对既有中英文 RFC,不新增脚本、运行时规则或第二套治理 owner。每个门禁都对应可检查的模块预算、兼容视图退役条件和反例边界。
具体改动 / Changes
当前 head e35f12b117d9466eab7c26f6f26981b90b55b23e 在 controller/executor RFC 中增加 Subtraction Gate 与 anti-context-gravity 规则的完整中英镜像,在 monorepo RFC 中增加模块预算下调棘轮和无引用脚本退役基线,并在 mechanism-convergence RFC 中补上交叉约束。六份文档保持相同锚点和语义边界,没有修改代码、默认开关、持久化 schema 或发布配置。
对主干的风险 / Risks
无阻断发现。最大风险是中英文规则漂移或新标题破坏导航锚点,而双语 diff 检查与 docs governance smoke 已分别覆盖这两类失败。该 PR 只定义后续实现必须遵守的退役标准,不声称代码已经按 gate 完成清理;公开边界扫描和 whitespace 检查通过,回滚只涉及六份 RFC。
我的整体评价 / Verdict
APPROVE。该规范让后续重构可以按具名门禁删除重复界面和兼容层,同时明确哪些安全与结算不变量不能为了减少行数被删除。
English verdict: APPROVE at e35f12b. The bilingual subtraction gate, retained invariants and named retirement criteria are consistent across all six RFC files, and the bilingual plus documentation governance checks pass.
Goal And Delivered Outcome
main@f15ebdd16b,#5072,#8787,#8749, and C1 PR#8266.#8266:+26,672 / -4,561across289files; echoed in#8484+1,979 / -174and#7568+6,230 / -349) by layering compatibility adapters, combinatorial mode matrices, and multi-thousand-line append-only logs instead of retiring replaced producers and unreferenced code.#subtraction-gate) to bothdocs/architecture/rfcs/controller-executor-unified-contract-v0.{md,zh-CN.md}anddocs/architecture/rfcs/monorepo-distribution-split-v0.{md,zh-CN.md}, and cross-linked it cleanly inside Section 5.5 ofdocs/architecture/rfcs/mechanism-convergence-and-learning-loop-v0.{md,zh-CN.md}without touching open PR#8793's edited lines (git merge-tree --write-tree HEAD <pr-8793>clean).#5072,#8787,#8266,#8484,#7568,#8749. Base:main.Author Declaration
Implemented against
docs/architecture/rfcs/README.md,docs/development/good-smokes.md,scripts/check_rfc_bilingual.py,scripts/generate_rfc_status_index.py) onmain@f15ebdd16b.check_rfc_bilingual.py)docs/architecture/rfcs/{controller-executor-unified-contract-v0,monorepo-distribution-split-v0,mechanism-convergence-and-learning-loop-v0}.{md,zh-CN.md}uv run --extra test python scripts/check_rfc_bilingual.py --base origin/main --head HEADdocs/architecture/rfcs/STATUS.{md,zh-CN.md}unchangeduv run --extra test python scripts/generate_rfc_status_index.py --check#subtraction-gateanchors and relative repo linksuv run --extra test python examples/docs-governance-smoke.pydocs/architecture/rfcsHOMEuv run --extra test loopx --format json check --scan-path docs/architecture/rfcs(errors: 0,public_boundary_scan.ok: true)docs_project_content,public_boundary)HOMEuv run --extra test loopx canary premerge --from-git-diff --git-diff-base origin/main(11/11passed,merge_gate_passed: true)#8793mechanism-convergence-and-learning-loop-v0.{md,zh-CN.md}Section 5.5 onlygit merge-tree --write-tree HEAD <pr-8793-head>exited 0main@f15ebdd16b(1,785,239code/script LOC across the 7 code trees;loopx/1,864code files /~658kLOC;tests/1,956code files /~727kLOC;examples/688code files /~204kLOC;docs/architecture/rfcs/ledger/152files /~11.5kLOC;20loopx/chat_*.py/20,562LOC;9loopx/*_goal_mode//59files /17,655lines;4loopx/codex_cli_*.py/3,767LOC;200unreferencedexamples/*.py/45,504LOC;14examples/cli-*-command-modularization-smoke.py;max_top_level_modules: 127) and PR stats viagh(#8266:+26,672 / -4,561across289files —docs/+9,564net,tests/+9,976net,loopx/+2,236net).Scope And Continuation
6files,+319 / -8). Code/test/example execution of the retirement backlog proceeds in parallel implementation PRs.Validation
e35f12b117d9466eab7c26f6f26981b90b55b23epublic_fixturestaticpasseduv run --extra test python scripts/check_rfc_bilingual.py --base origin/main --head HEADpassed;uv run --extra test python scripts/generate_rfc_status_index.py --checkexited 0;git diff --check origin/main HEADexited 0staticpassedHOMEuv run --extra test loopx --format json check --scan-path docs/architecture/rfcsreturnedok: true,summary.errors: 0,public_boundary_scan.ok: true(scanned_files: 260)unitpasseduv run --extra test python -m pytest -q --no-cov tests/architecture/test_rfc_status_index.py(13 passed)integrationpasseduv run --extra test python examples/docs-governance-smoke.py(docs-governance-smoke ok);uv run --extra test loopx canary premerge --from-git-diff --git-diff-base origin/mainpassed (11/11checks,merge_gate_passed: true)manualpassedgit merge-tree --write-tree HEAD <pr-8793-head>exited 0 with zero conflicts onmechanism-convergence-and-learning-loop-v0.{md,zh-CN.md}Frontend / Visual Evidence
Type of Change
LoopX Area
Technical Direction
docs/architecture/rfcs/controller-executor-unified-contract-v0.md#subtraction-gate,docs/architecture/rfcs/monorepo-distribution-split-v0.md#subtraction-gateShared-authority RFC fixture impact
Boundary Checklist
.loopx/,.codex/goals/, and liveACTIVE_GOAL_STATE.md).python3 scripts/check_rfc_bilingual.py --base origin/main --head HEADpasses, or no paired RFC changed.none.Signed-off-bytrailer (git commit -s).