Skip to content

fix: dev-loop instance guards -- concurrent-start refusal + per-rebuild reap (BACKLOG Standing #8) - #52

Merged
alicoding merged 1 commit into
mainfrom
fix/devloop-guards
Aug 13, 2026
Merged

fix: dev-loop instance guards -- concurrent-start refusal + per-rebuild reap (BACKLOG Standing #8)#52
alicoding merged 1 commit into
mainfrom
fix/devloop-guards

Conversation

@alicoding

Copy link
Copy Markdown
Owner

Summary

  • (a) Per-rebuild reap: build/config.yml's dev_mode.executes gains a type: blocking pkill step right before the primary wails3 task run step. Blocking steps re-run every reload cycle (confirmed against the vendored github.com/atterpac/refresh engine source), backstopping refresh's own kill-then-restart -- a live task dev session was caught mid-investigation with two concurrent mill.dev.app processes, one orphaned into a foreign process group refresh's own tracking never reaped. Root cause not fully pinned to one line in a vendored dependency this repo doesn't own; this is an independent, pattern-based backstop.
  • (b) Concurrent-start guard: internal/devguard (real Go package, unit-tested) runs as the first step of Taskfile.yml's dev: task, detects an already-running wails3 dev process for this exact repo, and exits non-zero naming the conflicting PID -- verified live against a genuinely running session (correctly refused, naming the real PID).
  • Manual-only registry entry added (.claude/skills/run-mill/SKILL.md) for what CI structurally can't prove (real multi-rebuild orphan prevention, a genuine second-terminal refusal).
  • SPEC.md + BACKLOG.md updated in the same change (Standing Attention escalation: idle-aware presence, floating approval prompt, cross-device forward (goal 0023) #8 checked off).

Test plan

  • go vet . ./internal/...
  • golangci-lint run . ./internal/... (0 issues, two justified //nolint:gosec,noctx on one-shot CLI subprocess calls)
  • go test . ./internal/... -race -cover (all green, internal/devguard 74.1% coverage)
  • go build -o /dev/null . and go build -tags server -o /dev/null .
  • scripts/check-loc.sh
  • Live-verified internal/devguard against a real running task dev session (correctly detected + refused, naming the actual PID)
  • Local lefthook pre-commit suite green

🤖 Generated with Claude Code

https://claude.ai/code/session_018pkViCNAuZp2vBv2K9AbUh

…ld reap (BACKLOG Standing #8)

Two mechanical fixes for the owner-hit THREE-concurrent-mill.dev.app
incident (real crash risk on a 16GB machine):

(a) Per-rebuild reap: build/config.yml's dev_mode.executes gains a
`type: blocking` pkill step right before the `primary` `wails3 task
run` step. Blocking steps re-run on every reload cycle (confirmed
directly against the vendored github.com/atterpac/refresh engine
source), backstopping refresh's own kill-then-restart regardless of
whether it actually reaps the previous instance -- a live task dev
session was caught, mid-investigation, with two concurrent
mill.dev.app processes, one orphaned into a foreign process group
refresh's own tracking never caught. Root cause not fully pinned to
one line since it's inside a vendored third-party dependency; this
reap is an independent, pattern-based backstop rather than a patch to
code this repo doesn't own.

(b) Concurrent-start guard: internal/devguard (a real Go package,
unit-tested) runs as the first step of Taskfile.yml's `dev:` task,
checks for an already-running `wails3 dev` process for this exact
repo, and exits non-zero naming the conflicting PID before the
existing destructive sweep steps can run -- which would otherwise
silently kill a genuinely live first session's own vite/app instead of
refusing to start. Verified live against a real running session
(correctly detected and refused, naming the actual PID).

Manual-only registry entry added (.claude/skills/run-mill/SKILL.md)
for what CI structurally can't prove: real per-rebuild-orphan
prevention across several live Go-triggered rebuilds, and a genuine
second-terminal task dev invocation actually refusing to start.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018pkViCNAuZp2vBv2K9AbUh
@alicoding
alicoding enabled auto-merge (squash) August 13, 2026 06:08
@alicoding
alicoding merged commit 25d9d43 into main Aug 13, 2026
16 checks passed
alicoding added a commit that referenced this pull request Aug 15, 2026
…ld reap (BACKLOG Standing #8) (#52)

Two mechanical fixes for the owner-hit THREE-concurrent-mill.dev.app
incident (real crash risk on a 16GB machine):

(a) Per-rebuild reap: build/config.yml's dev_mode.executes gains a
`type: blocking` pkill step right before the `primary` `wails3 task
run` step. Blocking steps re-run on every reload cycle (confirmed
directly against the vendored github.com/atterpac/refresh engine
source), backstopping refresh's own kill-then-restart regardless of
whether it actually reaps the previous instance -- a live task dev
session was caught, mid-investigation, with two concurrent
mill.dev.app processes, one orphaned into a foreign process group
refresh's own tracking never caught. Root cause not fully pinned to
one line since it's inside a vendored third-party dependency; this
reap is an independent, pattern-based backstop rather than a patch to
code this repo doesn't own.

(b) Concurrent-start guard: internal/devguard (a real Go package,
unit-tested) runs as the first step of Taskfile.yml's `dev:` task,
checks for an already-running `wails3 dev` process for this exact
repo, and exits non-zero naming the conflicting PID before the
existing destructive sweep steps can run -- which would otherwise
silently kill a genuinely live first session's own vite/app instead of
refusing to start. Verified live against a real running session
(correctly detected and refused, naming the actual PID).

Manual-only registry entry added (.claude/skills/run-mill/SKILL.md)
for what CI structurally can't prove: real per-rebuild-orphan
prevention across several live Go-triggered rebuilds, and a genuine
second-terminal task dev invocation actually refusing to start.


Claude-Session: https://claude.ai/code/session_018pkViCNAuZp2vBv2K9AbUh

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant