dw.sh hardening: concurrency, locking and reattach edge cases (15 findings from #61 QA round 1) #353
Labels
No labels
component:adapters
component:lifecycle
component:qa
component:setup
component:shared
component:worktrees
phase/accepted
phase/backlog
phase/deployed
phase/developing
phase/integrating
phase/planning
phase/qa
phase/requirements
phase/uat
priority:critical
priority:critical
priority:high
priority:high
priority:low
priority:low
priority:medium
priority:medium
type:bug
type:chore
type:docs
type:feature
type:infra
type:tech-debt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jbr870/devwork-skills#353
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Spawned from finding
F-PO-61-4-3(in-scope-deferrable) on issue #61 during decisionD-PO-61-4-2,QA round 1. Fifteen findings, all raised by the round-1
codedomain validate (issue #61, comment 1924,finding ids
CR-19..CR-32andCR-34), batched here because they share one theme: concurrency,locking and reattach edge cases in
.devcontainer/dw.sh.Two of the fifteen are NOT hardening and should be triaged first.
CR-23—require_issueaccepts leading zeros.dw.sh up 07anddw.sh up 7build rivalcontainers (
dw-07anddw-7) against the same logical issue, and eventually two branches for it.This is a correctness bug, not an edge case, and it justifies its own fix rather than a slot in a
hardening sweep.
CR-24/CR-30— peer-churn false failures. AC-4 and AC-11 assert the host credential file isunchanged across multi-minute scenarios; AC-3 reads the integration tip before
up. On this box,parallel sessions are the working model, so a legitimate host-side OAuth refresh or a peer merging to
mainmid-scenario reports as a violation. These cost debugging time rather than correctness, andCLAUDE.md already records one full sweep invalidated by peer churn.
The rest, grouped:
Locking and concurrency —
CR-21cmd_rmtakes no per-issue lock, sormcan interleave with aconcurrent
up(TOCTOU between inspection andrm -f);CR-22acquire_lock's stale-lock clearinglets two waiters both observe the dead pid, so the slower one deletes the lock the faster just
acquired;
CR-28resolve_branch's host-sidegit ls-remotehas no timeout and runs while theper-issue lock is held, so a blackholed forge blocks that
upindefinitely and any concurrentupforthe full 600s.
Reattach and state —
CR-19a partial clone (SIGKILL or host reboot mid-clone) leaves/workspace/.gitpresent,
setup_workspaceearly-returns on-d .git, and the container is marked ready on a corruptworkspace;
CR-25--ssh-agentis silently ignored whenever the container already exists, with nowarning that
recreateis the fix;CR-31theis_readyearly return skipsverify_forge_ssh, so arotated forge host key surfaces mid-session at push time instead of at start.
Failure modes that degrade quietly —
CR-29a malformed hostsettings.jsondegrades to{}with nowarning, so the container silently loses the operator's permission mode (which an unattended run needs);
CR-26the attach pathexecs, so the EXIT trap never runs and$TMPROOTleaks on every interactiveup;CR-20the forge token is passed as a plaintext argv tocurlandtea login add, visible in theprocess table.
Test-shape —
CR-27setup_forge_login's delete-then-add ordering (see also RV-4 on #61, which isbeing fixed there);
CR-32AC-16 verifies "setup did not re-run" by grepping for hardcoded message text,so a reworded message false-FAILs and an always-printed one false-PASSes;
CR-34the round's rebaseauto-resolution, recorded per
rebase-onto-base.md.Full text and per-finding failure scenarios are in the
qa-report:v1at issue #61 comment 1924(
domain=code phase=validate).This issue was deferred out of the parent feature's scope; it carries no PREQ yet. Run
/dev:requirements --issue={this}to flesh it out before planning.