Skip to content

fix(goals): preserve registered project across CLI commands - #5732

Merged
huangruiteng merged 1 commit into
loopx-project:mainfrom
mikamikasuki:codex/loopx-project-routing
Oct 6, 2026
Merged

huangruiteng merged 1 commit into
loopx-project:mainfrom
mikamikasuki:codex/loopx-project-routing

Conversation

@mikamikasuki

@mikamikasuki mikamikasuki commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Goal and Delivered Outcome

  • Outcome basis / optional anchor: Reproduced project-routing defect; issue [Bug]: amendment proposal falls back to the caller's current project #5731.
  • Goal/source and gap: At canonical main commit 9f6a87f, both the goal-amendment-proposal and shared-goal-alignment CLIs caught registry-selected state resolution errors and fell back to the caller's current directory.
  • Observable before → after: With a missing registered project and a same-named state in the caller's working directory, the baseline amendment CLI exited successfully and appended an admitted proposal journal row using that other project's state; baseline alignment CLI also incorrectly returned success. Both commands now keep the registry-selected project and fail before proposal admission or alignment readback.
  • Issue/task and intended base: Closes [Bug]: amendment proposal falls back to the caller's current project #5731; main at 9f6a87f.

Author Declaration

  • Written by: model_agent — OpenAI Codex (GPT-6 family).

Implemented against

Criterion Disposition Symbol / path Test or command
Do not replace an unresolved registry-selected project with the caller's current directory when submitting an amendment proposal. implemented loopx/cli_commands/goal_amendment_proposal.py::_resolve_project test_cli_does_not_use_current_directory_when_registered_state_is_missing
Do not replace an unresolved registry-selected project with the caller's current directory for shared goal alignment. implemented loopx/cli_commands/shared_goal_alignment.py::handle_shared_goal_alignment_command test_cli_does_not_use_current_directory_when_registered_state_is_missing
Reject missing registered state before proposal admission. implemented proposal admission path amendment regression; no journal row is written
  • Self-check: Both CLI suites exercise missing registered state with a same-ID caller-directory decoy; the changed paths retain explicit --project as the intentional override.

Scope and Continuation

  • Completed scope and remaining work: Remove the duplicated fail-open CWD fallback from both affected registered-goal CLI paths. Explicit --project remains the intentional override.
  • Slice boundary / successor: Complete within this scope.

Validation

  • Tested revision: a44cd29
  • Run state: Local validation complete; GitHub checks are in progress or queued on this head.
  • Input classes: synthetic
Check kind Result Public-safe evidence / limitation
regression_parity passed Regression cases cover both registered-project CLI paths with missing state and a same-ID caller-directory decoy.
unit passed The two CLI suites: 32 passed.
static passed Ruff, Python compilation, generated semantic-location inventory review, and git diff checks passed.
integration passed Standard premerge canary: 5 selected, 5 executed, 0 failures, 0 warnings.
  • Coverage and gaps: Synthetic registry, project-state, and runtime fixtures cover the affected submit and read paths, including the proposal journal side effect. No live provider is involved.

Frontend / Visual Evidence

  • UI impact: none
  • Before: N/A
  • After: N/A
  • States and viewports shown: N/A
  • Source data: none
  • Attention review: N/A

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring (no functional changes)
  • Documentation update
  • Test update

LoopX Area

  • Control plane (goals, todos, quota, scheduler, registry, runtime)
  • Benchmark boundary (adapters, runners, verifiers, scoring, evidence)
  • Capability or extension (providers, adapters, skills)
  • Public docs or presentation surface (README, protocols, dashboard)
  • Build, packaging, installer, or CI
  • Host or runtime integration

Technical Direction

Shared-authority RFC fixture impact

  • Production-scale fixture schema: N/A
  • Semantic dimensions changed, or reviewed no-impact rationale: N/A
  • Provider conformance arms run: N/A
  • Read-only legacy/file/PostgreSQL three-arm rehearsal: N/A

Boundary Checklist

  • The diff and this PR body contain no private state, credentials, raw traces, internal links, local paths, or runtime data.
  • The change is scoped to the linked issue and common root cause.
  • UI impact is marked none because no user-visible interface changes.
  • Every commit includes a DCO Signed-off-by trailer.

@mikamikasuki
mikamikasuki force-pushed the codex/loopx-project-routing branch from 04831aa to e850124 Compare October 6, 2026 02:51
@mikamikasuki mikamikasuki changed the title fix(goals): keep amendment proposal on registered project fix(goals): preserve registered project across CLI commands Oct 6, 2026

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewer: model_agent — gpt-6.1-sol (OpenAI); runtime_reported; reasoning_effort=xhigh

Exact reviewed head: e850124; immutable baseline: 9e78309

动机

使用已注册 Goal 提交修改建议或查看共享进展的 CLI 操作者。

注册项目的状态文件缺失时,旧版会采用当前目录里同名 Goal 的状态并报告成功;此提交保留注册路由,明确失败且不写建议记录,修复注册路径后可用原命令继续。

四个原生命令及别名、七类场景共 28 项通过;有效注册路径和显式项目选择仍可用,原 Goal、当前目录状态和同仓其它 Goal 均未被修改。

本次交付仅修复这两个 CLI 入口的注册路由,不开放修改 Goal 的新权限,不证明完整自动修订、多领域长程运行或已安装 App/Lark 行为。

改动思路

复用注册表的现有项目解析器,把“选哪个项目”和“该项目状态能否使用”分开。解析阶段可以返回状态暂缺的注册项目,随后由原 admission/alignment owner 明确拒绝;不能因文件缺失而换成另一项目。显式 --project 是调用者有意选择,仍保留优先级。建议提交只写独立建议 journal,不能把 admitted 当作 Goal 已变更;共享 alignment 仍然只读。

具体改动

依据 https://github.com/loopx-project/loopx/issues/5731,固定 issue body 版本 sha256:33f0b90d84c57790201ea4ca3422f9c32d0120d21677a86e24838d6c7b9d1c8b;Expected behavior:注册状态缺失时按注册路由失败,不能退到当前目录——本 head 两个入口均已实现并经同输入对照验证。Stage 1/2 read-only/proposal 边界也与基线 docs/architecture/rfcs/shared-goal-alignment-and-governed-amendment-v0.md 一致;没有用后续 amendment commit 设想扩大本次验收。

关键代码讲解

_resolve_project(goal_amendment_proposal.py:191)移除宽泛异常吞掉及 CWD fallback,调用 require_existing=False 的既有解析器;显式项目仍先返回。handle_shared_goal_alignment_command(shared_goal_alignment.py:126)对两个别名采用同一修复,异常通过原 JSON/exit owner 返回。resolve_todo_state_path(path_resolution.py:11)未修改,继续负责注册 Goal、project/state 的定位;实际状态可用性由原业务 owner 验证。5 文件 +104/-17:两生产 CLI、85 行针对性回归、1 行生成 manifest 位置信息,没有新配置、状态字段或并行决策器。

对主干的风险

未发现阻塞问题。独立真实 CLI/文件 journal 对照覆盖四入口×七场景:合法注册、相对/绝对状态缺失、无 repo、未知 Goal、显式 override、拒绝后修复恢复。基线 16/28,head 28/28;12 个基线失败来自缺失相对路径、无 repo 或恢复前被误认为成功。绝对路径缺失和未知 Goal 的合法拒绝仍保留。所有原状态及同项目其它 Goal bytes 未变,失败没有 journal;修复注册状态后原命令成功。95 项现有 owner/CLI 测试、Ruff 和风险 canary 通过,canary 5 direct +5 selected/executed,0 failure/warning;包含全树 semantic、IO census、CLI 输出预算和模块边界。未查询 CI;预有未跟踪 uv.lock 被 canary 纳入输入但未提交。无新 frontend/Lark 配置入口需要配套,未认证这些已安装界面。

语义与 CI 对齐

复用既有注册选择与 proposal-only/read-only 语义;advisory 未发现新词汇,不能据此自证等价,全树检查另已通过。这个修复是默认错误路径行为变化,PR body、新回归名及本评审均明确旧/新结果。require_existing=False 不是放松 admission:后续状态校验仍强制执行。拒绝是机器规则,未称为可忽略建议;不存在 opt-in/default-off 声明或新增 actor 权限。

我的整体评价

APPROVE,当前窄路由缺陷已修复。long_horizon=improved:避免重复轮次基于另一项目继续,保留明确修复后恢复路径;user_experience=improved:错误可信且合法显式选择可用,不增加用户输入。效率收益是减少错误工作的返工,并无吞吐百分比或长程模型采用测量。future-facing pass 已检查:直接复用 shared resolver 比新增独立路由 helper 更合适,这两处短调用属于不同 CLI/error owner,无需新增通用框架。不会覆盖既有 Goal,建议 admission 也不等于 canonical commit;不宣称整个多 Goal 业务或完整修订系统已验收。运行时变更仍由维护者合并。

English verdict: APPROVE — e850124: fail closed on the registered project instead of silently using a same-ID CWD state. Independent real CLI/journal comparison improves 16/28 on base to 28/28 at head; explicit overrides, legal routes and repair/resume remain usable. 95 owner/CLI tests, Ruff and the selected canary checks pass. CI was not queried; this is bounded routing qualification, not installed-App or long-running model certification.

@mikamikasuki
mikamikasuki force-pushed the codex/loopx-project-routing branch 3 times, most recently from 23e77f6 to 7db5195 Compare October 6, 2026 05:26
@mikamikasuki
mikamikasuki force-pushed the codex/loopx-project-routing branch from 7db5195 to a44cd29 Compare October 6, 2026 05:28
@huangruiteng
huangruiteng merged commit c8589b3 into loopx-project:main Oct 6, 2026
21 of 26 checks passed
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.

[Bug]: amendment proposal falls back to the caller's current project

3 participants