Uh oh!
There was an error while loading. Please reload this page.
docs(adr): document the src layout and the build pipeline - #956
Merged
Conversation
ADR-010 decided that large files become module directories, and was later amended on where the aggregator lives. What no document stated was the whole picture: what the modules are, in what order they load, how the single-file binary is assembled from them, and which tests keep all of that honest. That was spread across ADR-010, build.sh comments, the architecture-map rule file and eight issues. ADR-011 is descriptive, not a new decision. It records: - the rule: src/ holds module directories and nothing else, each with an index.sh entry point that holds only `source` lines - the seventeen modules, in entrypoint source order, with what each owns - the three load-order facts that are load-bearing rather than stylistic: api/globals.sh runs `set -euo pipefail` at file scope, config/env.sh executes at source time and must precede console/, and main/ is sourced last - the six build steps, and why "aggregators hold only source lines" follows from step 2 emitting a file's body before recursing into its sources - the eight contracts that enforce all of it, with the warning that a path-grepping contract passes vacuously the moment its target moves, as happened in #946 - how to add a function, a file, a module or a subcommand, and how to prove a split is a relocation docs/project-overview.md gains the module table and a pointer to the ADR; it previously described src/ in a single line, from before any of this. Every figure was verified against the tree rather than written from memory -- which caught one wrong claim in the draft about the largest file.
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
ADR-010 decided that large files become module directories, and was later amended on where the aggregator lives. What no document stated was the whole picture: what the modules are, in what order they load, how the single-file binary is assembled from them, and which tests keep all of that honest.
That was spread across ADR-010,
build.shcomments,.claude/rules/architecture-map.mdand eight issues. Someone arriving at the project — contributor or agent — had no single place to read it.💡 Changes
ADR-011 is descriptive, not a new decision. It records:
src/holds module directories and nothing else; each has anindex.shentry point holding onlysourcelines.api/globals.shrunsset -euo pipefailat file scope;config/env.shexecutes at source time and must precedeconsole/, whose palette is built at file scope;main/is sourced last.sourcelines" follows from step 2 emitting a file's body before recursing into its sources.docs/project-overview.mdgains the module table and a pointer to the ADR. It previously describedsrc/in a single line, written before any of this work.✅ Verification
Every figure was checked against the tree rather than written from memory — module count, file counts, line counts, the aggregator rule, the embed markers, the
src/dev/exclusion, and that all five named contract tests exist.That caught a wrong claim in my own draft: I'd written that the largest file is
main/test.shat 485 lines; it's actuallyassert/core.shat 970. Corrected, and the passage now explains why all three of the deliberately-large files stayed whole.make sa·make lint· full suite (1604 passed, 0 failed) green.