Reset per-service runtime state in svc.sh env_config #457

Merged
weichen merged 9 commits from feature/svc-pidcheck-leak into main 2026-10-12 09:39:31 +00:00
Owner

Summary

  • env_config 按实例清空 SVC_PIDCHECK/SVC_EXEC/SVC_VERSION/SVC_SOURCE,避免批量 update --all 用上一服务的 mark 误判本服务进程为已死/非本服务。
  • 复现现场:dev 更新成功后 genui/rdm1/rdmcand 误清 svc.pid、旧进程占口导致「端口被占用」。
  • 合入后在主检出恢复三服务,并将 rdmcand 改为独立 runtime/rdmcand/data。

任务卡:.task/feature-svc-pidcheck-leak.md(含 precheck / task-sync / make test-governance 证据收据)。

Test plan

  • make test-governance(SELF,含批量 update 回归与 SVC_PIDCHECK 棘轮)
  • 合入后主检出恢复 genui/rdm1/rdmcand 并改 rdmcand 独立 data
## Summary - `env_config` 按实例清空 `SVC_PIDCHECK`/`SVC_EXEC`/`SVC_VERSION`/`SVC_SOURCE`,避免批量 `update --all` 用上一服务的 mark 误判本服务进程为已死/非本服务。 - 复现现场:dev 更新成功后 genui/rdm1/rdmcand 误清 `svc.pid`、旧进程占口导致「端口被占用」。 - 合入后在主检出恢复三服务,并将 rdmcand 改为独立 `runtime/rdmcand/data`。 任务卡:`.task/feature-svc-pidcheck-leak.md`(含 precheck / task-sync / `make test-governance` 证据收据)。 ## Test plan - [x] `make test-governance`(SELF,含批量 update 回归与 SVC_PIDCHECK 棘轮) - [ ] 合入后主检出恢复 genui/rdm1/rdmcand 并改 rdmcand 独立 data
weichen added 5 commits 2026-10-12 09:29:04 +00:00
Why: establish the authorized task workspace and its initial baseline.

Evidence: preserved precheck receipt in .task/feature-svc-pidcheck-leak.md; R0=2723e452440fc11022c0f6d916cd34cc4cd17335.

Impact: task metadata only; the feature workspace starts at 2723e45244.

Refs: .task/feature-svc-pidcheck-leak.md
Why: Batch update --all left SVC_PIDCHECK from the prior service in
memory, so pid_alive/reclaim_own_port misclassified the next service's
process as dead/foreign, deleted svc.pid, and failed start on a still-
occupied port (genui/rdm1/rdmcand after successful dev).

Evidence: make test-governance (SELF; receipt /tmp/svc-pidcheck-gov.json);
new test_batch_update_stops_second_service_despite_prior_pidcheck +
SVC_PIDCHECK ratchet in test_svc_precheck.

Impact: env_config clears SVC_PIDCHECK/EXEC/VERSION/SOURCE per service;
batch update correctly stops and restarts each agent. After merge:
restore genui/rdm1/rdmcand and move rdmcand to its own data dir.

Refs: .task/feature-svc-pidcheck-leak.md; complements #456 reclaim_own_port
Co-authored-by: Cursor <cursoragent@cursor.com>
Why: bind the task validation checkpoint to the latest integration baseline.

Evidence: SELF recursive component checks; sync_base=2723e452440fc11022c0f6d916cd34cc4cd17335; candidate=442251c35ea169633cc03d88d3426083d5e80fef.

Impact: task metadata only.

Refs: .task/feature-svc-pidcheck-leak.md
Co-authored-by: Cursor <cursoragent@cursor.com>
Record the sync checkpoint
ci / test-pg (pull_request) Successful in 1m37s
ci / test (pull_request) Failing after 1m44s
dc9ff87844
Why: bind the task validation checkpoint to the latest integration baseline.

Evidence: SELF recursive component checks; sync_base=2723e452440fc11022c0f6d916cd34cc4cd17335; candidate=83c4ee2430b841e537178f2cbdfe0b0ec9462730.

Impact: task metadata only.

Refs: .task/feature-svc-pidcheck-leak.md
weichen added 1 commit 2026-10-12 09:29:34 +00:00
Record PR #457 link on task card
ci / test-pg (pull_request) Successful in 1m39s
ci / test (pull_request) Failing after 1m43s
7f120d8c32
Co-authored-by: Cursor <cursoragent@cursor.com>
weichen added 1 commit 2026-10-12 09:32:51 +00:00
Skip reclaim attribution tests when ss cannot report PIDs
ci / test-pg (pull_request) Successful in 1m38s
ci / test (pull_request) Failing after 1m45s
c7364ed971
Why: CI runners without ss -ltnp pid= attribution fail #456 reclaim
tests with "未能识别占用者", blocking unrelated merges.

Evidence: local unittest of reclaim + foreign-port + batch update cases.

Impact: reclaim tests skip without ss; foreign-port accepts either
attribution or unattributable refusal. Batch pidcheck fix unchanged.

Refs: .task/feature-svc-pidcheck-leak.md; PR #457
Co-authored-by: Cursor <cursoragent@cursor.com>
weichen added 2 commits 2026-10-12 09:35:29 +00:00
Why: bind the task validation checkpoint to the latest integration baseline.

Evidence: SELF recursive component checks; sync_base=2723e452440fc11022c0f6d916cd34cc4cd17335; candidate=c7364ed97152d3107f585215468c1a70aa340918.

Impact: task metadata only.

Refs: .task/feature-svc-pidcheck-leak.md
Treat zombie PIDs as dead in batch update regression
ci / test-pg (pull_request) Successful in 1m43s
ci / test (pull_request) Successful in 3m29s
20a4733152
Why: CI containers leave unreaped zombies; os.kill(0) still succeeds
and falsely failed the old-process-stopped assertion.

Evidence: local unittest of the batch update case.

Impact: assertion matches svc.sh/recover zombie semantics.

Refs: .task/feature-svc-pidcheck-leak.md; PR #457
Co-authored-by: Cursor <cursoragent@cursor.com>
weichen merged commit 226a4af157 into main 2026-10-12 09:39:31 +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#457