Repository navigation
Description
Problem
CODESTYLE.md "Interrupts" and "Interrupts in Shell" bind every Bash script on its next edit. Every script sets an INT trap and a TERM trap, and a long-running external command runs in the background under wait, or in the foreground where it is sh -c. The rule has no case for a script whose last step is exec into the process it launches. Container entrypoints and process-supervisor service scripts (s6 run, runit run) take that shape on purpose. The exec replaces the shell, so the supervisor's SIGTERM goes straight to the daemon and the daemon shuts down cleanly.
A literal reading turns that script into a wrapper that holds the daemon as a child. Take this constructed s6 service script:
#!/usr/bin/with-contenv bash
exec s6-setuidgid app /bin/bash -c '/opt/app/bin/daemon -e'The rule asks for traps, which an exec makes impossible, so the exec has to go. The bash -c then has to run in the foreground per the background bullet. s6-supervise's SIGTERM reaches only the wrapper's bash. Bash defers the trap until the foreground command returns, and the daemon never receives the signal. The supervisor kills it at its grace timeout, so a clean shutdown becomes an unclean one. For an entrypoint script, docker stop gets the trap's forced exit 143 in place of the daemon's own status.
Expected
An exec into the long-running process is a sanctioned shape. The script no longer exists when the signal arrives, so it owes no trap and no signal test. Anything it held before the exec is released before the exec. A script that keeps running after it starts a child still takes the full rule.
Found by
A local strict review during a resync of ptr727/NxWitness, from audit run 2026-11-12T16:56:31Z | hub 2d0f8901. NxWitness has an entrypoint and s6 service scripts of this exact shape. Those scripts are untouched today, and the rule would apply on their next edit.
Done when
CODESTYLE.md"Interrupts" (or "Interrupts in Shell") exempts a script that ends byexec-ing the process it launches, and states that anything held before theexecis released before it.shell-codestyleis regenerated throughscripts/build_dist.py.
🤖 Generated with Claude Code
Activity
ptr727 commentedon Nov 12, 2026
Correction and one more shape, both from a later local review pass of the same resync.
Correction to the s6 example above. A
bash -cgiven a single simple command execs that command in place. So$!still names the daemon, and the rule's own reasoning puts it in the background rather than the foreground. The grace-timeout kill described above is therefore not what follows from the rule for that form. The cost of dropping anexecthat stands is the extra bash between the supervisor and the daemon, plus the trap's fixed 143 replacing the daemon's own exit status. Neither has been confirmed in a running container. A probe would build an image with theexecremoved, then runps -o pid,argsand ans6-svc -ragainst the service inside it.A second handover the rule cannot express. A constructed entrypoint:
The helper is a long-running background child that is meant to outlive the script across the
exec. "Interrupts in Shell" requireswait "$pid"on such a child, which blocks before theexec, so the daemon never starts. "Interrupts" also owes a mid-run signal test for a script holding a child. Here the only window for that test is the moment before theexec. So the exemption needs to cover a background child handed across theexec, not only theexecline.🤖 Generated with Claude Code
Resync the Instruction Set and Carried Skills With the Hub (#685)
Promote Develop: Hub Resync to 2.0.1421 and the .NET 10 SDK Line (#689)
ptr727 commentedon Nov 13, 2026
Backlog burndown claim, round 1 (2026-11-13), away run, scope
develop. Branchburndown/interrupts-reraise, group: #4084, #4097. Tier:frontier(carriedCODESTYLE.mdand codestyle skills).Predicted files:
CODESTYLE.md("Interrupts", "Interrupts in Python", "Interrupts in Shell").agents/skills/python-codestyle/SKILL.md.agents/skills/shell-codestyle/SKILL.md.github/skills/python-codestyle/SKILL.md.github/skills/shell-codestyle/SKILL.md.claude-plugin/fleet-skills/skills/python-codestyle/SKILL.md.claude-plugin/fleet-skills/skills/shell-codestyle/SKILL.md.claude-plugin/fleet-skills/.source-digests/python-codestyle.claude-plugin/fleet-skills/.source-digests/shell-codestyleRe-Raise the Interrupt Signal and Exempt a Script That Execs Its Proc…