Stop task-finish from uninitializing shared submodule config #75

Merged
weichen merged 6 commits from fix/task-finish-close-followups into main 2026-09-30 16:03:49 +00:00
Owner

fix/task-finish-close-followups 任务卡

任务主记录:<PR 链接,task-finish 时填写>;状态:进行中;owner:weichen

基线与授权

  • 权威仓:ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/Agent-System-Dev.git;目标分支:main;R0(initial_base_sha)= bb1bf06aec
  • 工作区:/home/weichen/projects/Agent-System-Dev-wt-fix-task-finish-close-followups(worktree);分支:fix/task-finish-close-followups
  • 授权与交付终点:修复 task-finish 对共享子模块配置的污染并完成配套文档/忽略项收敛;终点为 PR 合入 main 后回收 worktree。

目标与非目标

  • 目标:①cmd_finish 去掉 submodule deinit --all——submodule url 配置在共享 .git/config,deinit 会把其他检出/worktree 的子模块一并标成未初始化(工作区清理本就走 rm -rf + prune,deinit 无实际作用);②AGENTS.md 任务卡闭合描述与实测对齐(ff-only pull 同样触发 post-merge 钩子;钩子内 close 扫不到远端新合卡,需手动兜底);③.gitignore 增加 .zcodeignore(ZCode CLI 会话产物,不入库)。
  • 非目标:close 默认 web_base 改 git-home——由并行 PR #73 完成,本卡撤回该项;不改 start 落点(PR #69 已修);不改 precheck 判脏口径。

同步记录

节点 sync_base_sha tested_head_sha checked_at
启动 bb1bf06aec bb1bf06aec 2026-09-30T15:46:04Z

结果与验证

  • 结果:cmd_finish 删除 deinit 行并留注释说明共享 config 污染机理;AGENTS.md 闭合路径句改写;.gitignore 追加 .zcodeignore。bug 期间被并行会话现场复现:其 task-finish 后主检出 submodule.*.url 配置归零(uninit=12),本卡验证前已用 make sync 恢复。
  • 验证:bash -n 通过;abandon 冒烟——修复版脚本 start→FORCE_ABANDON=1 finish 一条假任务,断言共享 submodule.*.url 计数 12→12(修复前会归 0)、主检出 submodule status --recursive uninit=0、smoke worktree/分支全部回收;顺带证实 inline close 能兜底闭合并行会话漏闭合的卡(feature-gitea-access-facts,经 feature/card-close-20260930-155017Z 分支)。
  • 影响与剩余项:无剩余项;HTTPS API 与 SSH 在收尾阶段出现家服隧道整体瞬断,推送与 PR 推进待通道恢复后完成。
# fix/task-finish-close-followups 任务卡 任务主记录:<PR 链接,task-finish 时填写>;状态:进行中;owner:weichen ## 基线与授权 - 权威仓:ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/Agent-System-Dev.git;目标分支:main;R0(initial_base_sha)= bb1bf06aec6d3f848ce6a1ca291c6ef6dc4da4ab - 工作区:/home/weichen/projects/Agent-System-Dev-wt-fix-task-finish-close-followups(worktree);分支:fix/task-finish-close-followups - 授权与交付终点:修复 task-finish 对共享子模块配置的污染并完成配套文档/忽略项收敛;终点为 PR 合入 main 后回收 worktree。 ## 目标与非目标 - 目标:①`cmd_finish` 去掉 `submodule deinit --all`——submodule url 配置在共享 `.git/config`,deinit 会把其他检出/worktree 的子模块一并标成未初始化(工作区清理本就走 rm -rf + prune,deinit 无实际作用);②AGENTS.md 任务卡闭合描述与实测对齐(ff-only pull 同样触发 post-merge 钩子;钩子内 close 扫不到远端新合卡,需手动兜底);③`.gitignore` 增加 `.zcodeignore`(ZCode CLI 会话产物,不入库)。 - 非目标:close 默认 web_base 改 git-home——由并行 PR #73 完成,本卡撤回该项;不改 start 落点(PR #69 已修);不改 precheck 判脏口径。 ## 同步记录 | 节点 | sync_base_sha | tested_head_sha | checked_at | |---|---|---|---| | 启动 | bb1bf06aec6d3f848ce6a1ca291c6ef6dc4da4ab | bb1bf06aec6d3f848ce6a1ca291c6ef6dc4da4ab | 2026-09-30T15:46:04Z | ## 结果与验证 - 结果:`cmd_finish` 删除 deinit 行并留注释说明共享 config 污染机理;AGENTS.md 闭合路径句改写;`.gitignore` 追加 `.zcodeignore`。bug 期间被并行会话现场复现:其 task-finish 后主检出 `submodule.*.url` 配置归零(uninit=12),本卡验证前已用 make sync 恢复。 - 验证:`bash -n` 通过;abandon 冒烟——修复版脚本 start→FORCE_ABANDON=1 finish 一条假任务,断言共享 `submodule.*.url` 计数 12→12(修复前会归 0)、主检出 `submodule status --recursive` uninit=0、smoke worktree/分支全部回收;顺带证实 inline close 能兜底闭合并行会话漏闭合的卡(feature-gitea-access-facts,经 feature/card-close-20260930-155017Z 分支)。 - 影响与剩余项:无剩余项;HTTPS API 与 SSH 在收尾阶段出现家服隧道整体瞬断,推送与 PR 推进待通道恢复后完成。
weichen added 4 commits 2026-09-30 16:02:02 +00:00
Why: cmd_finish ran git submodule deinit --all, but submodule.<name>.url entries live in the shared .git/config — finishing any task silently marked every other checkout and worktree uninitialized (observed twice on 2026-09-30: main checkout uninit=12 after each finish; a parallel session hit it minutes before this fix landed). The deinit serves no purpose: worktree removal with gitlinks is refused regardless, so cleanup already goes through rm -rf + prune. Also aligns AGENTS.md with observed hook behavior (post-merge fires on ff-only pulls too, and its inline close cannot see cards merged remotely until they are pulled), and ignores the ZCode-generated .zcodeignore that tripped the BUSY gate in every session.
Evidence: bash -n clean; abandon-path smoke of the patched script — start + FORCE_ABANDON=1 finish of a throwaway branch left shared submodule url config at 12 entries (pre-fix: 0), main checkout submodule status uninit=0, smoke worktree and branch fully recycled; the smoke close also backfilled a parallel session card left open (gitea-access-facts) via a card-close branch, proving the fallback path.
Impact: scripts/task.sh cmd_finish only (removes one line, updates comment), AGENTS.md card-close paragraph, .gitignore one entry. No product or gitlink change; make test not applicable (repo-level tooling/docs only). web_base default fix intentionally withdrawn from this PR — landed via parallel PR #73.
Refs: .task/fix-task-finish-close-followups.md
Record the sync checkpoint
ci / test (pull_request) Failing after 11m5s
e6cee503a2
weichen added 2 commits 2026-09-30 16:03:46 +00:00
weichen merged commit b696939eaa into main 2026-09-30 16:03:49 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: weichen/Agent-System-Dev#75