Skip to content

docs: style guides, contributor guide, and a student README - #21

Merged
arademaker merged 5 commits into
mainfrom
aula
Sep 11, 2026
Merged

arademaker merged 5 commits into
mainfrom
aula

Conversation

@arademaker

@arademaker arademaker commented Sep 11, 2026

Copy link
Copy Markdown
Member

Project documentation adapted from sf-in-lean, plus the retirement of
TODO.md in favour of GitHub issues.

What this adds

Three new documents, and the wiring so the existing ones point at them rather
than duplicating them.

STYLE-CODE.md — Lean and Verso conventions. Its core is a ledger of
which Lean feature is first used in which chapter, derived from a sweep of the
code inside ```lean blocks. It makes checkable the constraint
DEVIATIONS.md already states — nothing is used before it is presented
which until now was verified by hand. Because this book is mostly programs
rather than proofs, the ledger covers every Lean feature, not only tactics.

It also documents the directive vocabulary that CSwLMeta/ already
implements (:::exercise, solution!, :::gradeTheorem, :::dev,
:::quiz, the four build variants) and that had no documentation anywhere:
writing a chapter previously meant reading the elaborator.

STYLE-WRITING.md — prose conventions. Absorbs the "Pedagogical
decisions" section out of CLAUDE.md, adds writing advice adapted from
sf-in-lean, and starts a Portuguese term list. That list is deliberately
short: it records decisions actually taken, because prescribing a term the
book has never used against an alternative it has never used is the same
failure the section exists to catch.

CONTRIBUTING.md — workflow, and who decides what. Written for the
situation this repository is actually in: one author, with the course monitor
as alpha tester. Content and structure stay with the author; the objective
tasks open to a contributor are listed explicitly. The coordination machinery
sf-in-lean needs for several contributors across branches — Zulip, CODEOWNERS,
the branch-activity dashboard, the draft-PR protocol — is deliberately absent.

Its AI policy is this project's own rather than sf-in-lean's, which forbids
AI-written prose outright and would contradict CLAUDE.md: here AI never
writes prose on its own initiative, translates as literally as the target
language allows, and produces drafts for human revision.

Findings from the sweep

Writing the ledger meant reading the chapters against the rule, which turned
up things now filed as issues:

Two things I initially reported as violations turned out not to be, and the
ledger records why: IntroCS's use of unpresented Lean is the constraint's
one accepted exception, and simp/decide are presented — in a plain-text
table that a scan of lean blocks does not see. STYLE-CODE.md now carries
that caveat so the next sweep does not repeat the mistake.

One behaviour change

CSwLMeta/Save/Project.lean — the generated project's README.md was in
Portuguese and said only "não edite aqui". It is now in English, like every
other document about the project, and the student variant carries a real
setup guide: how to build, how to work an exercise, where to report a problem.
That variant is what reaches the students at emap-nlp/book.

TODO.md is gone

Its 20 open items were consolidated into GitHub issues #3#20; everything it
recorded as done was discarded rather than filed to be closed. Issue #3 is the
umbrella for the restructuring the rest of them depend on.

Note on scope

This branch also carries 0d16e25 drafts, which is unrelated teaching
material. The documentation work is d9db3e5.

Uncommitted and deliberately left out: prose edits in PL.lean and
FOL.lean, and working notes under doc/.

AI usage

The documents were drafted with Claude Code (Opus 5) from decisions taken in
conversation, with the author directing scope, rejecting several proposals,
and reviewing the result. The feature ledger was derived by script from the
chapter sources and corrected by hand where the scan proved too narrow. This
description was likewise AI-drafted and reviewed.

Adapted from sf-in-lean's project documentation, keeping what fits a
one-author book with a course monitor as alpha tester and dropping the
machinery for coordinating several contributors across branches (Zulip,
CODEOWNERS, the branch-activity dashboard, the draft-PR protocol).

New files:

* STYLE-CODE.md — Lean and Verso conventions. Its core is a ledger of which
  Lean feature is first used in which chapter, derived from a sweep of the
  code inside `lean` blocks: it makes checkable the constraint DEVIATIONS.md
  states, that nothing is used before it is presented. Because the book is
  mostly programs rather than proofs, the ledger covers every Lean feature,
  not only tactics. It also documents the directive vocabulary already
  implemented in CSwLMeta/ (`:::exercise`, `solution!`, `:::gradeTheorem`,
  `:::dev`, `:::quiz`, the build variants), which had no documentation at all.

* STYLE-WRITING.md — prose conventions. Absorbs the "Pedagogical decisions"
  section from CLAUDE.md, adds writing advice adapted from sf-in-lean, and
  starts a Portuguese term list. The list is deliberately short: it records
  decisions actually taken rather than a vocabulary invented in advance.

* CONTRIBUTING.md — workflow, and who decides what. Content and structure
  remain the author's; the objective tasks open to a contributor are listed
  explicitly. Its AI policy is this project's own, not sf-in-lean's: AI never
  writes prose on its own initiative, translates as literally as the target
  language allows, and produces drafts for human revision.

Other changes:

* CLAUDE.md points at the two style guides instead of carrying the
  pedagogical section itself.
* README.md stops restating conventions that are now normative elsewhere.
* DEVIATIONS.md refers to GitHub issues, TODO.md having been retired in
  favour of them.
* CSwLMeta/Save/Project.lean — the generated project's README was in
  Portuguese and said only "do not edit here". It is now in English, like
  every other document about the project, and the `student` variant carries a
  full setup guide: how to build, how to work an exercise, where to report a
  problem. That variant is what reaches the students.

The pending work the retired TODO.md tracked is now in GitHub issues #3#20;
everything it recorded as done was discarded rather than filed to be closed.

These documents were drafted with Claude Code (Opus 5) from decisions taken in
conversation with the author, who directed the scope, rejected several
proposals, and reviewed the result. The feature ledger in STYLE-CODE.md was
derived by script from the chapter sources and then corrected by hand where
the scan proved too narrow.
Copilot AI lite review requested due to automatic review settings September 11, 2026 01:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Documentation inaccuracies and scope inconsistencies should be corrected before approval.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds project style guides, contributor workflow documentation, and English setup guidance for generated student projects while moving pending work from TODO.md to GitHub issues.

Changes:

  • Adds Lean/Verso and Portuguese writing conventions.
  • Updates contributor and project documentation.
  • Updates generated READMEs and includes FOL teaching drafts.
File summaries
File Reviewed changes
STYLE-WRITING.md Prose and Portuguese writing conventions
STYLE-CODE.md Lean, Verso, variants, and feature-ledger conventions
README.md Links to normative documentation
doc/fol-semantics.md FOL semantics teaching notes
doc/entailment.md Entailment teaching notes
DEVIATIONS.md Project deviations and issue tracking
CSwLMeta/Save/Project.lean Generates English student project READMEs
CSwL/Logic/FOL.lean Adjusts code warning line length
CONTRIBUTING.md Contributor workflow and AI policy
CLAUDE.md References the style guides
Review details

Suppressed comments (6)

README.md:72

  • This repeats the inaccurate description that CSwL/Games.lean only gathers included sections; the file also contains chapter-level introductory prose before the includes. Please describe it as gathering sections while allowing introductory prose, so this overview agrees with the actual glue file and the normative style guide.
Mnemonic file names, never numbers. A short chapter is a single file
(`CSwL/Sets.lean`, `namespace Sets`); a chapter whose sections are long enough
to deserve their own file is a "glue" file (`CSwL/Games.lean`) that only
gathers them, via `{include 1 ...}`, from a same-named directory

STYLE-CODE.md:85

  • These lines say the explanation is hidden inside the solution, but CSwL/Morphology/SwedishPlural.lean:63-66 is a comment outside the solution! markers, so it survives the student source rewrite. The actual problem is that it is a Portuguese Lean comment; please correct this description and decide whether to promote the explanation to prose or rewrite the comment in English.
  appears, and a comment at `:63-66` says why, but that comment is inside the
  solution and in Portuguese, so the explanation reaches neither the student
  nor the English code-comment rule.

STYLE-CODE.md:178

  • :::dev is not currently filtered by variant: Block.devcomment.traverse returns none unconditionally, and the extractor emits shown notes without consulting getCurrVariant. Thus the existing no-urgency note in CSwL/Logic/FOL.lean appears in the student and terse HTML/generated Lean, so this guarantee is false until issue #4 is implemented.
- `:::dev` — an internal note to the authors. It renders with the heading
  "Nota editorial" and must never carry anything the student should not read.
  AI-generated commentary belongs here and is marked as such.

STYLE-CODE.md:124

  • CSwL/Games.lean is not only an include aggregator: it also contains the chapter's introductory prose at lines 12–21 before the two includes. Calling this a file that “only gathers” sections gives contributors an incorrect model of where chapter-level prose belongs.
A short chapter is a single file (`CSwL/Sets.lean`). A chapter whose sections
are long enough to deserve their own files is a "glue" file (`CSwL/Games.lean`)
that only gathers them via `{include 1 …}` from a same-named directory. Each

doc/entailment.md:111

  • A complete theory is one that decides every formula—typically, for each φ, either Γ ⊨ φ or Γ ⊨ ¬φ; it is not generally defined by having a single model or valuation. If uniqueness is only the property of this finite example, state it as the reason completeness follows here rather than as the definition.
* **teoria completa:** \(\Gamma\) restringe as interpretações a uma única valuation, nesse exemplo.

doc/entailment.md:111

  • valuation is left in English inside this Portuguese note, while the surrounding logic chapters consistently use valoração. That makes the term look like a second concept; use the established Portuguese term.
* **teoria completa:** \(\Gamma\) restringe as interpretações a uma única valuation, nesse exemplo.
  • Files reviewed: 10/10 changed files
  • Comments generated: 5
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread CONTRIBUTING.md
Comment on lines +59 to +61
For a comment that is local to one passage and only makes sense with that
section in view, use a `:::dev` note in the Lean file itself rather than an
issue. Those render as editorial notes and never reach the student.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

done locally

Comment thread CSwLMeta/Save/Project.lean Outdated
Comment on lines +117 to +118
problem. The other variants are read by the instructor, who has the repository
itself, and get only the note saying where they came from.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

solved locally

Comment thread STYLE-CODE.md Outdated
Comment on lines +88 to +90
- **`Sets.lean` uses `Setoid`, `Fintype` and `Finset` with no presentation.**
A short paragraph plus a citation for each would settle it, under the
loosening `DEVIATIONS.md` describes.
Comment thread doc/entailment.md Outdated
@@ -0,0 +1,124 @@

### Exemplo
Comment thread doc/fol-semantics.md Outdated
@@ -0,0 +1,246 @@

A grande mudança em relação à lógica proposicional é justamente esta:
PL.lean — the chapter opens with the acronym PL, from the English, which is
what the file and section tags already use; the Portuguese LP appeared only
here. The paragraph now states the chapter's aim as making precise that one
proposition follows from another, rather than as escaping the imprecision of
natural language.

FOL.lean — the ∀-introduction example binds `n`, so the introduced name
differs from the bound variable it replaces and the tactic's effect is
visible.

doc/entailment.md and doc/fol-semantics.md were working notes toward this
material; nothing references them.
`Block.devcomment`'s `traverse` returned `none` unconditionally and never
consulted `getCurrVariant`, so an editorial note survived into every variant.
The one note in the book — a design observation about `PredSymbol` in
`Logic/FOL.lean` — was reaching students in both the HTML and the generated
`.lean`.

The student variant now drops every dev note during traversal. Both surfaces
are produced from the per-variant traversed tree, so the one guard covers
them; the extractor needs no change. `terse`, `solutions` and `grading` keep
every note: the first is the instructor's, where a note on screen during a
class is harmless, and the other two are the authors'.

Verified by regenerating all four variants and grepping both surfaces:

    VARIANT    HTML     LEAN
    student    0        0
    terse      1        1
    solutions  1        1
    grading    1        1

The docstrings that recorded the old behaviour as deliberate ("every variant
is a reader of the book") are rewritten, and `STYLE-CODE.md` now documents the
two independent filters — by variant in `traverse`, by urgency in
`devNoteShown`. `CONTRIBUTING.md` needs no edit: the promise it already makes,
that `:::dev` blocks never reach the student, is now true.

Closes #4.
small fixes proposed by the Co-Pilot review of the PR.
@arademaker
arademaker merged commit f617af1 into main Sep 11, 2026
1 check passed
@arademaker
arademaker deleted the aula branch September 11, 2026 04:01
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.

2 participants