fix(loop): selftest no longer fails on day-0 install - #11
Open
jodunk wants to merge 1 commit into
Open
Conversation
Two defects in `--selftest`, surfaced by booting a fresh `npx create-auto-co` scaffold and running the env check: 1. State-directory check FAILED when `state/` was absent on a brand-new install, telling the user "Fix the failures before running the loop" for a directory that is auto-created on first cycle. Relabeled PASS -- the detail string itself conceded "will be created on first run", so ok=0 was a mislabel. Every fresh install hit this. 2. Signal-handling trap test leaked the literal word `caught` into selftest stdout. Replaced `trap "echo caught"` with a no-op `trap ":"` -- same proof (trapped subshell survives SIGTERM and reaches exit 0), silent output. Verified: fresh-scaffold `--selftest` now 14/14 pass (was 13/14 + stray `caught`); `--dry-run` exits 0; `tests/run-all.sh` 3/3 ALL GREEN. Co-Authored-By: Claude <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe self-test now clarifies that a missing state directory will be created on first run and uses a no-op SIGTERM trap while verifying signal handling. ChangesSelf-test updates
Estimated code review effort: 1 (Trivial) | ~2 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two small defects in
auto-loop.sh --selftest, both surfaced by dogfooding — booting a freshnpx create-auto-coscaffold and running the environment check (the first real boot pastbash -n+--help).1.
--selftestfails on a brand-new installThe
State directorycheck returnsFAILwhenstate/is absent — which it always is on a fresh scaffold, because it's auto-created on the first real cycle. A new user running--selftestto validate their install is told:…for something that needs no fixing. The detail string itself already says "will be created on first run" — so
ok=0was a mislabel. Fixed: relabeledPASS.2. Stray
caughtin selftest outputThe signal-handling test does
trap "echo caught" SIGTERMinside a subshell, and thatecholeaks the literal wordcaughtinto the selftest output. Replaced with a no-optrap ":"— identical proof (a trapped subshell survivesSIGTERMand reachesexit 0), silent output.Diff
2 lines,
--selftestblock only. No overlap with #10 (consensus/reason/JSONL region).Verification
npx create-auto-coscaffold + fixed script:--selftest→ 14/14 pass (was 13/14 + a straycaughtline).bash -n auto-loop.shclean.--dry-runstill exits 0 (prompt builds clean).tests/run-all.sh→ 3/3 ALL GREEN (no regression in the existing test gate).Related: #10 (broader reliability hardening — complementary, different code regions).
Summary by CodeRabbit