Repository navigation
Conversation
Recent zero-Any refactors left their baseline ceilings at the pre-refactor counts, so the ratchet would silently accept Any being reintroduced. Lower the any_count ceilings to the measured AST counts on main: - goal_frontier/__init__.py 115 -> 0 - lark/presentation/kanban.py 62 -> 0 - state_refresh.py 30 -> 0 - slash_command_install.py 11 -> 0 - capabilities/issue_fix/cli.py 5 -> 0 - worker_bridge.py 28 -> 15 Line ceilings are left alone: the policy does not freeze exact line counts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: duang777 <duangjl007@gmail.com>
terminal.py was the last goal_frontier module carrying Any (15 AST occurrences). Use the package's existing Payload / PayloadView aliases: read-only inputs take Mapping[str, object], derived payloads return dict[str, object]. Runtime checks still require dict, so behavior is unchanged (the module's AST is identical once annotations are removed). Ratchet its baseline any_count ceiling from 15 to 0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: duang777 <duangjl007@gmail.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · xhigh
动机 / Motivation
维护 Goal 终态推导与 Canary 模块度量的工程人员。 六个既有模块的静态计数已经降低,terminal.py 仍有 15 处 Any,旧基线允许重新引入已清走的债务。 独立重测 7 个上限,6 个为 0,worker_bridge 为 15。去掉注解、新类型别名及其导入后,terminal.py 的 AST 相同。真 CLI File/SQLite 的终态及原轮重放用例两头通过。 两文件 +27/-23,其他度量和主链协议保持原路径。 使用隔离 File/SQLite 和局部合成 AST 对照,未跑完整全仓或远端 CI。 首次两头各有 258 项通过后触发本机临时空间下限。空间恢复后使用原默认阈值完整重跑,两头均通过。
改动思路 / Approach
把 terminal.py 的字典注解收紧为 object,保留原类型检查与取值。降低七个文件的 Any 上限以匹配实测。 Goal frontier 继续根据 Todo 和 projection 决策,Canary 只检测代码度量。 两文件 +27/-23,其他度量和主链协议保持原路径。
具体改动 / Changes
精确提交 81637fc7fc4c52e4c8ef9f0f6e0b1d8a709f71ef,基线 811c1a1f66652d3fc3b9830d467e14b45b7423c1。两文件 +27/-23,其他度量和主链协议保持原路径。
- TERMINAL-PARITY。独立重测 7 个上限,6 个为 0,worker_bridge 为 15。去掉注解、新类型别名及其导入后,terminal.py 的 AST 相同。真 CLI File/SQLite 的终态及原轮重放用例两头通过。 验收契约
- RATCHET-LOWER-ONLY。对同一个合成 kanban 模块加 1 个 Any,旧上限放行,新上限报告 any_count=1。无效计数和不全来源两头都无法制造终态。 验收契约
关键代码讲解
- 保留严格整数零条件,false、字符串及其他值不视作零。 _strict_zero
- 保留原 Todo 来源闭环及无后继状态的推导。 derive_goal_terminal_state
- 继续从原投影判断终态,无需重写持久化记录。 goal_frontier_is_terminal_no_followup
- 根据实际 Any 计数和既有基线比较。 collect_module_metric_findings
对主干的风险 / Risks
基线及候选各 273 项通过。Ruff、严格 mypy、Git diff 和候选标准预合并 18 项通过。 首次两头各有 258 项通过后触发本机临时空间下限。空间恢复后使用原默认阈值完整重跑,两头均通过。 使用隔离 File/SQLite 和局部合成 AST 对照,未跑完整全仓或远端 CI。
对同一个合成 kanban 模块加 1 个 Any,旧上限放行,新上限报告 any_count=1。无效计数和不全来源两头都无法制造终态。
我的整体评价 / Verdict
APPROVE。 通过。终态语义保持,七项上限都能阻止已清理的 Any 债务回流。 允许当前窄改动进入维护者终审。 使用隔离 File/SQLite 和局部合成 AST 对照,未跑完整全仓或远端 CI。
English verdict: APPROVE at 81637fc. The terminal runtime AST is unchanged after removing annotations and their type declarations. All seven lowered ceilings match measured Any counts. The same one-Any mutation is caught on head only, and all 273 focused tests passed on each revision.
Goal And Delivered Outcome
loopx/canary/maintainability_ratchet.py); no issue.module_metric_baseline.jsonceilings at the pre-refactorany_count, so the ratchet would acceptAnybeing reintroduced into modules that are already clean.goal_frontier/terminal.pywas also the lastgoal_frontiermodule still carryingAny.Anytoloopx/extensions/lark/presentation/kanban.pyproduced nomodule_metric_budgetfinding before; it now producesregressions={'any_count': 1}.terminal.pygoes from 15 ASTAnyto 0.mainat811c1a1f6.Author Declaration
Implemented against
811c1a1f6are the basis.any_countlowered to measured AST countsloopx/canary/module_metric_baseline.jsonmodule_metrics()on each entrytests/canary/test_maintainability_ratchet.pyterminal.pybehavior unchangedloopx/control_plane/goals/goal_frontier/terminal.pymodule_metrics()on main; checked that no open PR touching these modules addsAny(refactor(hosts): consolidate claude, kunluncode, and zcode packages under loopx/hosts #9505, fix(turn): preserve original lease authority across recovery #9153, feat(stride): persist Todo meta-goals across Turns #9214, refactor(goal-frontier): slim __init__.py below 1,000 lines and consolidate rule/projection owners #8937 add none).loopx/history.pyalso has line slack (1122 → 1013) but perf(history,runtime): cache timestamp parses, skip redundant copies and merges, and trim diagnostic deepcopies #9554 grows it, and lines are intentionally coarse, so it is left alone.Scope And Continuation
any_countlowered forgoal_frontier/__init__.py115→0,lark/presentation/kanban.py62→0,state_refresh.py30→0,goal_frontier/terminal.py15→0,slash_command_install.py11→0,capabilities/issue_fix/cli.py5→0,worker_bridge.py28→15.Anydebt (pr_review.py,lark/presentation/explore_results.py,chat_runtime.py,bootstrap_command_pack.py,chat_server.py,worker_bridge.py,agent_scope.py,capabilities/catalog.py) is untouched.Validation
81637fc7fstaticpassedmypy --strict --follow-imports=silentonterminal.py(also clean before).unitpassedtests/canary/test_maintainability_ratchet.py(14 passed).unitpassedregression_paritypassedAnyinkanban.pyis reported bycollect_module_metric_findings;terminal.pyAST identical to base once annotations are stripped.staticpassedloopx canary premerge --from-git-diff --git-diff-base origin/main: 18 selected, 0 failures.Python Testsis currently red on main for unrelated shard deadlines ([Bug]: Python test-shards on main exceed the session deadline every run — suite never completes #9567).Frontend / Visual Evidence
Type of Change
LoopX Area
Shared-authority RFC fixture impact
N/A
Boundary Checklist
none.Signed-off-bytrailer (git commit -s).🤖 Generated with Claude Code