Skip to content

[M1-4] Add docs/STYLE.md#287

Merged
williamdemeo merged 3 commits into
masterfrom
253-m1-4-project-style-guide
Apr 21, 2026
Merged

[M1-4] Add docs/STYLE.md#287
williamdemeo merged 3 commits into
masterfrom
253-m1-4-project-style-guide

Conversation

@williamdemeo
Copy link
Copy Markdown
Member

@williamdemeo williamdemeo commented Apr 20, 2026

Summary

Expands docs/STYLE_GUIDE.md from the initial stub to a full-length style guide that takes concrete positions on the axes previously flagged as open, and populates the canonical symbol table.

Closes #253 (issue M1-4).

Approach

The style guide is opinionated: where the library had parallel conventions, the document picks one and justifies it. In particular:

  • IsX vs is-X predicate naming is settled in favor of IsX. This matches the Agda stdlib idiom and is already the canonical form in Setoid/Homomorphisms/Basic.agda and Demos/HSP.lagda. The is-x hyphen-case form is preserved in Legacy/Base/ (unchanged) and deprecated elsewhere during M4-1.
  • Record vs Σ. The core Algebra type remains a record (named projections, inhabited many times). Classical algebraic structures are Σ-typed with record-typed "bundle views" for stdlib interop — this is the Signatures / Theories / Structures / Bundles / Small quintuple that M3-1 will formalize in ADR-002.
  • Projections ∣_∣ / ∥_∥ are announced as deprecated in favor of proj₁ / proj₂. The mechanical migration is scoped to M4-1 and the rationale will land as an ADR under M1-6. Existing call sites remain valid until the sweep.
  • Canonical notation table is populated, covering projections, levels, algebras, equivalence/equality/isomorphism, orders, set-theoretic, products, interpretation, and term algebra. New notation is added to the table in the same PR that introduces it.

The document opens with 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 closes with three checklists — opening a PR, reviewing a PR, and auditing a module during the M4-1 sweep.

Notes for reviewers

  • Several paths referenced in the document (src/Classical/, src/Cubical/, src/Legacy/Base/) do not yet exist in the tree. A note at the top of the file calls this out; the rules apply when those trees land in M2/M3/M5.
  • CONTRIBUTING.md (from [M1-3] Add CONTRIBUTING.md, CHANGELOG.md, CODE_OF_CONDUCT.md #252) and README.md already link to docs/STYLE.md; those links now resolve to the substantive document.
  • The ∣_∣ / ∥_∥ deprecation is the single largest syntactic change announced for the 3.0 cycle. Library-wide rewrite is M4-1's scope; this PR only states the intent.
  • Pragma-order consistency between the code, CONTRIBUTING.md, and this document is a separate follow-up (the code uses --cubical-compatible --exact-split --safe; the docs currently document a different order).
  • The final paragraph ("This document will evolve...") is deliberate — it sets expectations that the document tracks the code, not the other way around.

@williamdemeo williamdemeo self-assigned this Apr 20, 2026
@williamdemeo williamdemeo linked an issue Apr 20, 2026 that may be closed by this pull request
4 tasks
Adds a first draft of docs/STYLE.md documenting the conventions
agda-algebras currently follows, with explicit flags for the axes where
style decisions remain open (naming conventions, notation table,
universe-level variable scope).

The style guide is deliberately short at this stage.  Applying and
refining it across Setoid/ and Classical/ is tracked in M4-1, and the
document will grow as specific decisions are settled.  A premature
full-length style guide would codify decisions that are properly made
during the M4 sweep.

Addresses #253 (M1-4).
@williamdemeo williamdemeo force-pushed the 253-m1-4-project-style-guide branch 2 times, most recently from 8a97afb to f606dd5 Compare April 21, 2026 01:33
@williamdemeo williamdemeo marked this pull request as ready for review April 21, 2026 01:33
@williamdemeo williamdemeo force-pushed the 253-m1-4-project-style-guide branch from f606dd5 to a0d092b Compare April 21, 2026 01:34
@williamdemeo williamdemeo requested a review from Copilot April 21, 2026 01:35
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).
@williamdemeo williamdemeo force-pushed the 253-m1-4-project-style-guide branch from a0d092b to 656abb9 Compare April 21, 2026 01:38
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR turns the style guide draft into a full docs/STYLE_GUIDE.md document and updates existing docs to reference it consistently as the project’s canonical style guide.

Changes:

  • Add a comprehensive docs/STYLE_GUIDE.md covering formatting, naming, notation, levels, proof style, and deprecation policy.
  • Update the roadmap (docs/GITHUB_PROJECT.md) and contributor-facing docs (README.md, CONTRIBUTING.md) to point to docs/STYLE_GUIDE.md.
  • Adjust README wording around the HSP reference and add a link reference for Setoid.Varieties.HSP.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
docs/STYLE_GUIDE.md Adds the full project style guide (new file).
docs/GITHUB_PROJECT.md Updates roadmap references from STYLE.md to STYLE_GUIDE.md.
README.md Updates style-guide link + adjusts HSP pointer and adds a link definition.
CONTRIBUTING.md Updates the style-guide reference to docs/STYLE_GUIDE.md.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread docs/STYLE_GUIDE.md Outdated
Comment thread docs/STYLE_GUIDE.md
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@williamdemeo williamdemeo merged commit 2c7f05f into master Apr 21, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[M1-4] Adopt docs/STYLE_GUIDE.md as the project style guide

2 participants