Uh oh!
There was an error while loading. Please reload this page.
refactor(system): group the capability probes into a src/system/ module - #950
Merged
Conversation
First group under #949. src/ held eleven modules and fifteen loose files; individually each was small and well named, but as a listing they read as leftovers and the root stopped conveying structure. src/check_os.sh -> src/system/check_os.sh src/dependencies.sh -> src/system/dependencies.sh src/io.sh -> src/system/io.sh The bottom layer: what this machine is and what it has. Nothing in it touches config, test state, console or the runner. The issue proposed putting clock.sh here too. That would have created a cross-module cycle -- system/clock.sh -> util/math.sh -> system/dependencies.sh. Harmless at load time, since both crossings are inside function bodies and clock.sh's only file-scope statements are two variable initialisers, but not worth shipping. clock.sh goes to src/util/ with math.sh instead: both compute something and both probe via dependencies, so the edge runs util -> system in one direction only. Two callers reach these files by path rather than through the entrypoint: build.sh sources check_os.sh and calls check_os::init at line 4, before it sets BASHUNIT_ROOT_DIR, so it points at the file rather than the module index; and tests/unit/check_os_test.sh sources it relative to the test file. A relocation: git records all three as renames with a zero-line diff, and the built artifact's code content is identical. Related #949
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 freeto 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.
🤔 Background
Related #949 — first group.
src/held 11 modules and 15 loose files. Individually each is small and well named; as a listing they read as leftovers and the root stopped conveying structure.💡 Changes
The bottom layer — what this machine is and what it has. Nothing in it touches config, test state, console or the runner. All three recorded as renames with a zero-line diff.
#949 put
clock.shhere too. That creates a cross-module cycle:Harmless at load time — both crossings are inside function bodies, and
clock.sh's only file-scope statements are two variable initialisers — but a module cycle isn't worth shipping when one different cut removes it.clock.shgoes tosrc/util/withmath.shinstead: both compute something, both probe viadependencies, so the edge runsutil → systemin one direction only. Mapping updated on the issue.📌 Two callers reach these by path, not through the entrypoint
build.sh:4sourcescheck_os.shand callscheck_os::initbefore it setsBASHUNIT_ROOT_DIR— so it points at the file, not the module index.tests/unit/check_os_test.sh:88sources it relative to the test file.Both would have failed silently or loudly on merge; grepped for before committing, per the checklist #938 and #946 earned.
✅ Verification
Artifact code content identical,
bash build.sh bin -v→✅ Build verified ✅.Green: sequential (1604 passed, 0 failed) ·
--parallel --simple --strict·make sa·make lint· CI-mode ShellCheck ·git check-ignoreclean.