spec(daemon-registry): the stop requirement does not say what `daemon stop` prints when a stop fails

未关闭
#181 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
半天
新手友好度
55/100
Issue 类型
文档
描述清晰度
基本清楚
活跃度
活跃
技术栈
go
领域
cli

调研方向

Start with the stop requirement and its existing scenarios in openspec/specs/daemon-registry/spec.md, then read the failure-path tests in internal/cli/daemon_test.go and internal/cli/tui/daemonpicker_test.go to see the printed output and exit codes they pin. Draft scenarios for a listing failure, a total stop failure and a partial stop failure, proposed through an OpenSpec change. Coordinate with #180, which also touches stopTargets. Done means the scenarios match what the tests already assert.

由索引模型根据 Issue 内容生成。

描述

chore priority:low spec-needed

Problem

The daemon-registry spec does not say what codegraph daemon stop and the codegraph daemon picker print when a stop fails.

The stop scenarios in openspec/specs/daemon-registry/spec.md cover only a stop that returns no error. An example is "Stop all with a malformed record under a live pid": stdout is no running daemons and the command exits 0. No scenario covers:

  • a registry listing that fails;
  • a stop where every per-target signal fails;
  • a stop that stops some daemons and then fails on another.

#179 (fixing #172) set this behavior as a fix, because the spec does not cover it:

  • The "no running daemons", "no running daemon for " and "nothing stopped" notices print only when the error is nil.
  • A failed stop prints the error, and any skipped registry files, on stderr, and exits non-zero.
  • A stop that fails part-way still prints a stopped pid N (<repo>) line for each daemon it stopped.

Tests in internal/cli/daemon_test.go and internal/cli/tui/daemonpicker_test.go pin this behavior. Because no spec states it, a later change can alter it without a spec delta.

Possible direction

  • Add scenarios for a listing failure, a total stop failure and a partial stop failure to the stop requirement, through an OpenSpec change.
  • #180 changes how stopTargets treats os.ErrProcessDone. One change could cover both.

Found by the impact lane of the suite review of #179, which noted that spec.md covers only the nil-error stop case.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XFrTgTHsJM948TTYmCDjP5

主要语言
Go
星标
0
派生
0
平均合并
7 小时 42 分钟
30 天内合并 PR
111

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

seanb4t/codegraph-go 的其他 Issue

查看 seanb4t/codegraph-go 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。