Uh oh!
There was an error while loading. Please reload this page.
refactor(runner): split src/runner.sh into a src/runner/ module - #927
Merged
Conversation
src/runner.sh was 2145 lines and 57 functions covering five unrelated responsibilities: the per-file loop, per-test execution, retry/timeout, result parsing and failure context. Move them into ten files under src/runner/, layered leaves-first: context · payload · diagnostics -> parallel · hooks · result -> provider · exec -> discovery · bench 53 of the 57 functions are leaves, so the layering is acyclic. src/runner.sh becomes an aggregator of `source` lines and comments only - the build emits a file's body before recursing into its sources, so anything else there would run before its dependencies in the built binary but after them in dev mode. A new test pins that rule for every aggregator. This is a pure relocation: no function renamed, no call site changed, no behavior changed. Verified by comparing the line multiset before and after (all 1896 non-blank lines preserved exactly once, 57/57 functions), and the built artifact embeds all ten module files once each with no duplicate definition. The file-scoped `# shellcheck disable=SC2155` on the old file was dead - the Makefile's sa target already passes `-e SC2155` - so it is not carried over. runner/exec.sh needs one scoped SC2154 disable instead: `exit_code` is assigned inside an EXIT trap body and read by cleanup_on_exit, now in runner/hooks.sh. tests/unit/runner_test.sh is split the same way into flat per-area files, since `make test` globs exactly one level deep and would silently skip a tests/unit/runner/ subdirectory. Closes#924
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Jul 30, 2026
Chemaclass added a commit
that referenced
this pull request
Jul 31, 2026
Four blocks a session can reconstruct on its own, two of which had already drifted out of date: - the architecture tree, which is `ls` output and still showed a flat `src/*.sh` after #927 and #928 added src/runner/, src/coverage/ and src/dev/ - the skills table, which duplicates the skill listing already injected into every session and had gone stale at 9 of 11 entries (missing /review and /gh-issues, the most-used skill in the repo) - Common Commands, whose contents are in the Makefile and whose one non-obvious note -- that `make lint` is the formatting authority -- is already stated under Quality Standards - the Path-Scoped Guidelines bullet lists, which restate bash-style.md and testing.md; the line explaining how the rules auto-load stays Everything not derivable is kept: the Bash 3.0 prohibited-features list, the shfmt/.editorconfig gotcha, the test-pattern pointers, Guardrails, Definition of Done, Commit Message Format and Prohibited Actions. 6638 -> 4290 chars, roughly 590 fewer resident tokens in every session.
10 tasks
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 #924
src/runner.shwas 2145 lines and 57 functions covering five unrelated responsibilities: the per-file loop, per-test execution, retry/timeout, result parsing and failure context. Now that the build dedupes embedded files by path (#923),src/can hold module directories.💡 Changes
src/runner/, sourced leaves-first in an acyclic layering;src/runner.shbecomes asource-only aggregatormake testglobs exactly one level deep