atproto git client
atgc plan module-layout.md
15 kB
Markdown
at main


id: module-layout title: Where code goes is a compile error, not a convention status: shipped repos: [atgc] dependsOn: [] exitCriterion: > Nothing outside cmd/ imports cmd/, no module reaches sideways for a neighbour's helper, and the two rules visibility cannot express have tests. #

module-layout #

Six folders under src/: cmd/ for the command families, clients/ for everything that talks to a counterpart (git included), lexicon/ for the pure record and identifier conventions, and config/, logging/ and term/ for the rest. docs/module-layout.md is the contract, and it landed first so the moves could be read against it.

The rules are enforced where they can be. Everything in cmd/ is pub(super), pub(in crate::cmd) or — for the entry points main.rs dispatches through — pub(crate); no bare pub is left. The two rules visibility cannot express, because clients has to be pub(crate) for cmd/ to call it, are pinned by tests/module_layout.rs instead. Both had been violated in the tree at some point, and both were found by grep, which is the argument for the test.

The three-copies-of-a-body-reader entry this file used to carry is gone rather than restated: term/body.rs is that function, and what is left at the three call sites are named wrappers whose doc comments say what each one's nested Option means.

What it needs #

Done #