Repository navigation
WIP: fix(startup): own-invocation shape + respawn door for the startup funnel (rubash#2129 companion) - #699
Merged
Conversation
…nel (rubash#2129) The niu-side companion to the rubash#2129 P0: the startup funnel read the exported __RUBASH_LOGIN_SHELL carrier back, so a child that merely inherited it (the procsub respawn out of an rc file — fzf's completion.bash shape) adopted the parent's login shape, re-ran the profile chain, and recursed without bound. - Login classification is host state now (Shell::own_login_shell): argv[0] '-' seed, the ShellInvocation parse, or the legacy -c -l mark (new mark_own_login_shell door). login_shell_active reads the field; the carrier is a write-only projection. - Carrier normalization at construction: an inherited __RUBASH_LOGIN_SHELL is scrubbed unless own argv earned login; an inherited __RUBASH_INTERACTIVE is scrubbed unconditionally (every interactive face re-writes it after classification). - Respawn door: construction snapshots the engine's respawn marker pair (__RUBASH_COPROC_CHILD / __RUBASH_SHELL_PID, read once, no new API token); both funnel entries source nothing for a respawned child — the parent session already ran startup. - Pins: tests/issue2129_startup_carrier.rs (8 tests, watchdog- bounded, counter-file counting). Baseline: 6 red incl. the fzf-shape e2e (527-549 generations in 30s); fixed: 8/8 green with the rc body in exactly one generation. The two #422 unit tests that modeled login by planting the carrier now set the host classification field.
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.
WIP: niu companion fix for the rubash#2129 P0 — the field path (implements §6 of the engine-side fix report in
~/workspace/fix-2129-p0/REPORT.md; stands alone against current engine master, no dependency on rubash PR #2138).Defect
niu's entry classification was clean (argv-only
ShellInvocationparse), but the startup funnel trusted the inherited env carrier:login_shell_active()read__RUBASH_LOGIN_SHELLback from the session executor, consumed atrun_startup_files(login → profile chain replaces the rc branch) andsource_non_interactive_env(the-croute). Nothing scrubbed an inherited carrier, niu never consulted the respawn state, and the funnel had no run-once guard — so the #2129 recursion reproduces verbatim on niu: profile chains into rc → fzf procsub line → nextniu -cgeneration inherits the carrier → profile again.Fix (3 parts, per the §6 spec)
Shell::own_login_shell): argv[0]-seed at construction,invocation.loginatapply_invocation_before_startup, or the legacy-c -lroute's newmark_own_login_shelldoor.login_shell_active()reads the field; the carrier is a write-only projection for engine faces. At construction, an inherited__RUBASH_LOGIN_SHELLis scrubbed (unset_env, already ledgered) unless own argv earned login, and an inherited__RUBASH_INTERACTIVEis scrubbed unconditionally — every face that earns the interactive shape writes it after classification.Executor::new(__RUBASH_COPROC_CHILD/__RUBASH_SHELL_PID) — no new rubash API token consumed. Both funnel entries source NOTHING for a respawned child (the parent session already ran startup).tests/issue2129_startup_carrier.rs(8 tests, watchdog-bounded, counter-file counting): carrier adoption on the-croute (single + both markers), respawn sourcing nothing on both funnels (both marker spellings), guards for own-l(engine-lc, legacy-c -l,--login -c) and for a genuine nested interactive child keeping its own rc branch, plus the fzf-shape e2e. Baseline: 6 red — the e2e hit the 30 s watchdog with 527–549 generations and a live linearniuchain inps; fixed: 8/8 green, rc body in exactly one generation.The two niubash#422 unit tests that modeled login by planting the carrier now set the host classification field (the seam they were modeling).
Verification
cargo build --locked --workspace --all-targetsgreen; fmt clean; CR=0.Full report:
~/workspace/fix-2129-niu/REPORT.md.Fixes unixwin/rubash#2129
Refs unixwin/rubash#2133