45 lines
2.3 KiB
Markdown
45 lines
2.3 KiB
Markdown
# F00 — Scaffold: workspace, reproducible build, licences
|
|
|
|
## 1. Why and what
|
|
Every later claim in `docs/VERIFY.md` rests on a build anyone can reproduce. So the repository
|
|
starts with the guard rails and **no protocol or relay code**: that waits for the protocol review
|
|
(issue #1). At the end, a stranger can clone the repository, build it with Nix twice and get the same
|
|
hash, and read exactly which licence covers which crate.
|
|
|
|
## 2. Architecture
|
|
```mermaid
|
|
flowchart LR
|
|
client[crates/client — Apache-2.0 OR MIT] --> protocol[crates/protocol — Apache-2.0 OR MIT]
|
|
relay[crates/relay — AGPL-3.0-only] --> protocol
|
|
flake[flake.nix] -. builds .-> relay & client & protocol
|
|
```
|
|
- Three empty crates. `protocol` depends on nothing in this repository; `relay` never depends on
|
|
`client` — enforced by `scripts/check-deps.sh` in CI.
|
|
- `tabellarius-relay` is a placeholder binary that prints its version and exits. It opens no socket.
|
|
It exists so the reproducible build has an artefact to hash.
|
|
- `flake.nix` pins nixpkgs through `flake.lock`; `nix build` produces the relay binary;
|
|
`nix build --rebuild` rebuilds it and fails if the output differs.
|
|
- Pre-commit hook (POSIX sh, no Node): rejects files over 5 MB and build output.
|
|
|
|
## 3. Risks
|
|
- **Public hygiene:** no hostnames, tokens, personal names or paths in any file or commit.
|
|
- **Licence ambiguity:** the docs say "AGPL-3.0"; the SPDX id chosen here is `AGPL-3.0-only`
|
|
*(proposal — confirm in review)*.
|
|
- **Reproducibility is only as good as the pin:** a floating nixpkgs would make two builds differ.
|
|
`flake.lock` is committed.
|
|
|
|
## 4. Gaps
|
|
| Gap | Solution |
|
|
|:--|:--|
|
|
| CI runners are Windows-only; Nix needs Linux | Reproducibility checked manually (WSL Nix) and recorded in the review until a Linux runner exists |
|
|
| No public GitHub mirror yet | Needs the maintainer's GitHub account; Gitea push mirror |
|
|
|
|
## 5. Verification
|
|
| Case | Kind | Expectation |
|
|
|:--|:--|:--|
|
|
| `cargo test --workspace`, `cargo clippy -D warnings` | CI | pass |
|
|
| `relay` depends on `client`, or `protocol` on any workspace crate | CI (`check-deps.sh`) | fails |
|
|
| 6 MB file / file under `target/` staged | hook test | rejected |
|
|
| `nix build` then `nix build --rebuild` | manual (Linux) | same output hash |
|
|
| Grep for hostnames, tokens, personal paths | manual | none |
|