Skip to content

Commit 656abb9

Browse files
committed
docs: expand STYLE_GUIDE.md into the opinionated 3.0 style guide
Replaces the initial stub with a full-length style guide that takes concrete positions on the axes previously flagged as open: + IsX vs is-X predicate naming is settled in favor of IsX (stdlib-compatible, already canonical in Setoid/Homomorphisms/ Basic and Demos/HSP). + Record-vs-Σ guidance: Algebra stays a record; classical structures are Σ-typed with record-typed bundle views for stdlib interop. + The canonical symbol table is populated (projections, levels, algebras, equivalence, orders, set-theoretic, products, interpretation, term algebra). + ∣_∣ / ∥_∥ are announced as deprecated in favor of proj₁ / proj₂; the mechanical migration is scoped to M4-1, with the rationale to land as an ADR under M1-6. Adds five guiding principles (one canonical form per concept, stdlib-compat when possible, proof terms as training data, Cubical portability by construction, document the mathematics) and concrete checklists for opening, reviewing, and auditing PRs. Paths referenced for Classical/, Cubical/, and Legacy/Base/ are forward-looking; a note at the top calls this out. Addresses #253 (M1-4).
1 parent 7d2121b commit 656abb9

5 files changed

Lines changed: 615 additions & 151 deletions

File tree

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ If no issue exists for the change you want to make, **please open one first**, e
6666
Every `.agda` source file begins with:
6767

6868
```agda
69-
{-# OPTIONS --cubical-compatible --safe --exact-split #-}
69+
{-# OPTIONS --cubical-compatible --exact-split --safe #-}
7070
```
7171

7272
plus `module X.Y.Z where` on the next non-comment line.
@@ -81,7 +81,7 @@ As of the 3.0 reconstruction, all of `src/` uses `--cubical-compatible`. When t
8181
+ **Predicates** are typically named `IsX` for "X-ness of a single thing" (e.g. `IsHomomorphism`) and `X` for "the type of things with property X" (e.g. `Homomorphism`).
8282
+ Avoid synonyms. If the concept is already called `Hom` elsewhere, call it `Hom` here too.
8383

84-
A proper style guide, `docs/STYLE.md`, is tracked in M1-4 and will land shortly. Until then, the convention is "follow the style of the surrounding code, and when in doubt ask in the PR."
84+
A proper style guide, `docs/STYLE_GUIDE.md`, is tracked in M1-4 and will land shortly. Until then, the convention is "follow the style of the surrounding code, and when in doubt ask in the PR."
8585

8686
### Comments
8787

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Older versions of either component are **not** supported on the `master` branch.
6060

6161
## Contributing
6262

63-
Contributions are welcome. See [`CONTRIBUTING.md`](CONTRIBUTING.md) for the development workflow and conventions, and [`CODE_OF_CONDUCT.md`](CODE_OF_CONDUCT.md) for community standards. The style guide ([`docs/STYLE.md`](docs/STYLE.md)) is being drafted as part of Milestone 1; see [`docs/GITHUB_PROJECT.md`](docs/GITHUB_PROJECT.md) for the full roadmap.
63+
Contributions are welcome. See [`CONTRIBUTING.md`](CONTRIBUTING.md) for the development workflow and conventions, and [`CODE_OF_CONDUCT.md`](CODE_OF_CONDUCT.md) for community standards. The style guide ([`docs/STYLE_GUIDE.md`](docs/STYLE_GUIDE.md)) is being drafted as part of Milestone 1; see [`docs/GITHUB_PROJECT.md`](docs/GITHUB_PROJECT.md) for the full roadmap.
6464

6565
For questions about mathematical content or large design changes, open a GitHub issue
6666
labeled `design-discussion` before writing code.
@@ -143,7 +143,7 @@ To cite the [formalization of Birkhoff's HSP Theorem](https://ualib.org/Setoid.V
143143
}
144144
```
145145

146-
If you're looking for the latest (setoid-based) formalization of Brkhoff's Theorem, see the [Proof of the HSP Theorem](https://ualib.org/Setoid.Varieties.HSP.html#proof-of-the-hsp-theorem) in the html documentation, or the source code of the [Setoid.Varieties.HSP][] module in the file [Setoid/Varieties/HSP.lagda][] in the [agda-algebras][] GitHub repository.
146+
If you're looking for the latest (setoid-based) formalization of Brkhoff's Theorem, see the [Proof of the HSP Theorem](https://ualib.org/Setoid.Varieties.HSP.html#proof-of-the-hsp-theorem) in the html documentation, or the source code of the [Setoid.Varieties.HSP][] module.
147147

148148
---
149149

@@ -175,5 +175,5 @@ If you're looking for the latest (setoid-based) formalization of Brkhoff's Theor
175175
[Formalization of Universal Algebra in Agda]: https://www.sciencedirect.com/science/article/pii/S1571066118300768
176176
[Introduction to Univalent Foundations of Mathematics with Agda]: https://www.cs.bham.ac.uk/~mhe/HoTT-UF-in-Agda-Lecture-Notes/
177177
[Programming Languages Foundations in Agda]: https://plfa.github.io/
178-
178+
[Setoid.Varieties.HSP]: https://github.com/ualib/agda-algebras/src/Setoid/Varieties/HSP.agda
179179

docs/GITHUB_PROJECT.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ agda-algebras was released as v2.0.1 in December 2021 ([Zenodo DOI 10.5281/zenod
5454

5555
**Description**. Modernize the library's tooling, establish baseline project hygiene, and unblock every subsequent milestone. The library is currently pinned to Agda 2.6.2 / stdlib 1.7; it must move to Agda 2.8.0 / stdlib v2.3 with `--cubical-compatible` replacing `--without-K`. Standard community-health files (CONTRIBUTING, CHANGELOG, CODE_OF_CONDUCT, STYLE) must land. GitHub Actions CI must stand up. README and installation docs must be rewritten for the 3.0 line.
5656

57-
**Exit criterion**. `make check` passes under GitHub Actions CI against Agda 2.8.0 / stdlib v2.3; CONTRIBUTING.md, docs/STYLE.md, ROADMAP.md, CHANGELOG.md are merged; README documents the new install path.
57+
**Exit criterion**. `make check` passes under GitHub Actions CI against Agda 2.8.0 / stdlib v2.3; CONTRIBUTING.md, docs/STYLE_GUIDE.md, ROADMAP.md, CHANGELOG.md are merged; README documents the new install path.
5858

5959
---
6060

@@ -80,9 +80,9 @@ Phase 2: Ring, CommutativeRing, Field, Module, DistributiveLattice, BooleanAlgeb
8080

8181
### Milestone 4 — Style and naming uniformity sweep
8282

83-
**Description**. Apply `docs/STYLE.md` consistently across `Setoid/` and `Classical/`. Audit naming (one preferred name per concept; synonyms deprecated); audit notation (one canonical symbol table); audit module structure (one concept per module where feasible); ensure every user-facing definition has a prose comment block.
83+
**Description**. Apply `docs/STYLE_GUIDE.md` consistently across `Setoid/` and `Classical/`. Audit naming (one preferred name per concept; synonyms deprecated); audit notation (one canonical symbol table); audit module structure (one concept per module where feasible); ensure every user-facing definition has a prose comment block.
8484

85-
**Exit criterion**. No undocumented public definitions remain in `Setoid/` or `Classical/`; no synonym pairs (e.g. `is-homomorphism` + `IsHom`) exist in the public API; the canonical symbol table in `docs/STYLE.md` matches the notation actually used in the library.
85+
**Exit criterion**. No undocumented public definitions remain in `Setoid/` or `Classical/`; no synonym pairs (e.g. `is-homomorphism` + `IsHom`) exist in the public API; the canonical symbol table in `docs/STYLE_GUIDE.md` matches the notation actually used in the library.
8686

8787
---
8888

@@ -249,24 +249,24 @@ Standard community-health files are missing. Drafts of CONTRIBUTING and STYLE e
249249

250250
---
251251

252-
### Issue M1-4: Adopt docs/STYLE.md as the project style guide
252+
### Issue M1-4: Adopt docs/STYLE_GUIDE.md as the project style guide
253253

254254
**Labels**: `milestone-1-infra`, `documentation`
255255

256256
**Milestone**: 1 — Infrastructure health
257257

258258
## Description
259259

260-
Create `docs/STYLE.md` documenting file format, module structure, naming conventions, notation, universe-polymorphism practices, record vs Σ guidance, proof style, and library-as-training-corpus considerations. A draft from the planning cycle is ready for review. Applying the style guide across `Setoid/` and `Classical/` is tracked in M4-1.
260+
Create `docs/STYLE_GUIDE.md` documenting file format, module structure, naming conventions, notation, universe-polymorphism practices, record vs Σ guidance, proof style, and library-as-training-corpus considerations. A draft from the planning cycle is ready for review. Applying the style guide across `Setoid/` and `Classical/` is tracked in M4-1.
261261

262262
## Tasks
263263

264-
- [ ] Merge `docs/STYLE.md` (draft from planning cycle).
265-
- [ ] Link `STYLE.md` from `README.md` and `CONTRIBUTING.md`.
264+
- [ ] Merge `docs/STYLE_GUIDE.md` (draft from planning cycle).
265+
- [ ] Link `STYLE_GUIDE.md` from `README.md` and `CONTRIBUTING.md`.
266266

267267
## Acceptance criteria
268268

269-
- [ ] `docs/STYLE.md` is merged.
269+
- [ ] `docs/STYLE_GUIDE.md` is merged.
270270
- [ ] Links from README and CONTRIBUTING work.
271271

272272
---
@@ -285,7 +285,7 @@ The current `README.md` and `docs/lagda/Preface.lagda` are 1.x-era: wrong Agda v
285285

286286
- [ ] Pin Agda 2.8.0 / stdlib 2.3 in install instructions.
287287
- [ ] Describe the Setoid-as-canonical structure and point to `Classical/`.
288-
- [ ] Link `CONTRIBUTING.md`, `ROADMAP.md`, `docs/STYLE.md`.
288+
- [ ] Link `CONTRIBUTING.md`, `ROADMAP.md`, `docs/STYLE_GUIDE.md`.
289289
- [ ] Concrete quickstart for new users (5-command install → `make check`).
290290
- [ ] Add CI badge (from M1-2) and documentation site link.
291291

@@ -333,7 +333,7 @@ graph TD
333333
M1_1["M1-1: Agda 2.8 / stdlib 2.3"]
334334
M1_2["M1-2: GitHub Actions CI"]
335335
M1_3["M1-3: Community files"]
336-
M1_4["M1-4: STYLE.md"]
336+
M1_4["M1-4: STYLE_GUIDE.md"]
337337
M1_5["M1-5: README / Preface"]
338338
M1_6["M1-6: docs/adr/"]
339339
M1_1 --> M1_2
@@ -743,20 +743,20 @@ graph TD
743743

744744
## Description
745745

746-
Apply `docs/STYLE.md` across the `Setoid/` tree. This is a long-tail task that can be decomposed into per-submodule issues for parallel work.
746+
Apply `docs/STYLE_GUIDE.md` across the `Setoid/` tree. This is a long-tail task that can be decomposed into per-submodule issues for parallel work.
747747

748748
## Tasks
749749

750750
- [ ] Audit naming: `IsHom` vs `is-homomorphism` vs `Hom` — pick one, deprecate others.
751-
- [ ] Audit notation against the canonical symbol table in STYLE.md.
751+
- [ ] Audit notation against the canonical symbol table in STYLE_GUIDE.md.
752752
- [ ] Audit imports (tighten `using` clauses; remove unused).
753753
- [ ] Ensure every public definition has a prose comment block.
754754
- [ ] Rich comment headers on every module.
755755

756756
## Acceptance criteria
757757

758758
- [ ] No synonym pairs remain in the `Setoid/` public API.
759-
- [ ] All notation in `Setoid/` matches the canonical table in STYLE.md.
759+
- [ ] All notation in `Setoid/` matches the canonical table in STYLE_GUIDE.md.
760760
- [ ] Every public definition in `Setoid/` has a docstring.
761761

762762
---
@@ -800,12 +800,12 @@ Every record, type family, and top-level function in the public API should have
800800
2. Make them `private` in `Overture.Signatures`; downstream modules re-declare.
801801
3. Move to a dedicated `Overture.UniverseLevels` module imported explicitly.
802802
- [ ] Collect input; pick one.
803-
- [ ] Document the decision in STYLE.md.
803+
- [ ] Document the decision in STYLE_GUIDE.md.
804804
- [ ] Apply consistently.
805805

806806
## Acceptance criteria
807807

808-
- [ ] Decision is recorded (ADR or STYLE.md section).
808+
- [ ] Decision is recorded (ADR or STYLE_GUIDE.md section).
809809
- [ ] `𝓞` and `𝓥` are handled uniformly across the library.
810810

811811
---
@@ -1199,7 +1199,7 @@ graph TD
11991199
| M1-1 | Upgrade to Agda 2.8.0 / stdlib 2.3 | milestone-1-infra, breaking-change |
12001200
| M1-2 | Add GitHub Actions CI | milestone-1-infra, good first issue |
12011201
| M1-3 | Add CONTRIBUTING, CHANGELOG, CoC | milestone-1-infra, documentation |
1202-
| M1-4 | Adopt docs/STYLE.md | milestone-1-infra, documentation |
1202+
| M1-4 | Adopt docs/STYLE_GUIDE.md | milestone-1-infra, documentation |
12031203
| M1-5 | Rewrite README and Preface | milestone-1-infra, documentation |
12041204
| M1-6 | Establish docs/adr/ | milestone-1-infra, documentation |
12051205

@@ -1279,7 +1279,7 @@ graph TD
12791279
M1_1["M1-1: Agda 2.8 / stdlib 2.3"]
12801280
M1_2["M1-2: GitHub Actions CI"]
12811281
M1_3["M1-3: Community files"]
1282-
M1_4["M1-4: STYLE.md"]
1282+
M1_4["M1-4: STYLE_GUIDE.md"]
12831283
M1_5["M1-5: README / Preface"]
12841284
M1_6["M1-6: docs/adr/"]
12851285
end

docs/STYLE.md

Lines changed: 0 additions & 129 deletions
This file was deleted.

0 commit comments

Comments
 (0)