fix(startup): Pass 2 nit-class refinements (stacked on PR #235)#236
Merged
fix(startup): Pass 2 nit-class refinements (stacked on PR #235)#236
Conversation
Second pass of the 2026-05-07 startup/shutdown scripts audit. Cleans up the six nit-class items remaining after Pass 1 (PR #235). DEGRADED: - #4 juniper-cascor process now receives both JUNIPER_CASCOR_HOST and JUNIPER_CASCOR_PORT. The documented host override was previously a silent no-op for binding (cascor's settings default host=127.0.0.1). NIT (plant_all): - #7+#9 JUNIPER_DATA_HOST now respects caller value via the ${JUNIPER_DATA_HOST:-0.0.0.0} idiom. Documented in the docstring. - #8 uvicorn dropped from the global `command -v` pre-flight loop — it lives inside each conda env, not on the launcher's PATH, so the check failed on a fresh shell before any conda activation. NIT (chop_all): - #10 pid file format swapped from `name: pid` (variable whitespace) to `name=pid` (one per line). Chop's parser accepts both formats during the transition window so an in-flight pid file from a Pass-1 plant_all run still works. - #11 worker-cleanup grep tightened from `juniper.cascor.worker\|juniper_cascor_worker\|cascor.*worker\|<term>` to `juniper-cascor-worker\|juniper_cascor_worker\|<term>`. The dropped alternative was over-greedy (matched unrelated dev shell processes). Tests added: - TestDataHostHonorsOverride, TestUvicornPreflightDeferred, TestCascorHostExported, TestPidFileFormat in test_juniper_plant_all.py - New test_juniper_chop_all.py covering pid parser (both formats), grep tightening, systemd path preservation, and the intentional duplicate echo lines per memory `feedback_chop_all_echo_debug`. #12 (intentional duplicate echoes) preserved as-is. Pre-commit clean. Full repo unittest suite (130 tests) passes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Pass 2 of the 2026-05-07 startup/shutdown scripts audit. Stacked on top of #235 — please merge #235 first; this PR's diff includes #235's commits and will simplify automatically once it lands.
Closes out the six nit-class items remaining from the audit. Item #12 (intentional duplicate echo lines per memory
feedback_chop_all_echo_debug) preserved as-is.What's fixed
🟡 DEGRADED
JUNIPER_CASCOR_HOSTis now exported to the cascor server process alongsideJUNIPER_CASCOR_PORT. Previously a documented but silent no-op for binding.🟢 NIT (plant_all)
JUNIPER_DATA_HOSThonors caller value via the${JUNIPER_DATA_HOST:-0.0.0.0}idiom; documented in the script's docstring.uvicorndropped from the globalcommand -vpre-flight loop — uvicorn lives inside each conda env, not on the launcher's PATH, so the check spuriously failed on fresh shells.🟢 NIT (chop_all)
name=pid(one per line). Chop's parser accepts both=and legacy:delimiters during the transition window so an in-flight pid file from a Pass-1 plant_all run still works.cascor.*workeralternative; kept the explicit dash and underscore variants.New tests
tests/test_juniper_plant_all.py— addedTestDataHostHonorsOverride,TestUvicornPreflightDeferred,TestCascorHostExported,TestPidFileFormat.tests/test_juniper_chop_all.py(new file) — covers pid parser (both formats, edge cases), grep tightening, systemd path preservation, and explicitly asserts the intentional duplicate echo lines perfeedback_chop_all_echo_debugare still present.Test plan
bash -nandshellcheckclean on both scriptspre-commit run --files <changed>cleanpython3 -m unittest discover tests— 130/130 pass (was 112 on main, now +18 new tests across two files)name=pidandname: pidformats parse identicallyJUNIPER_CASCOR_HOST=0.0.0.0 util/juniper_plant_all.bashactually rebinds cascor to 0.0.0.0 (deferred to deployment validation)🤖 Generated with Claude Code