Skip to content

Commit b2856b0

Browse files
committed
contributing: absorb the property-tracking ADR (review feedback)
Carlos: an ADR should record decisions about the architecture of the formal spec, not meta-level tooling. Accordingly: - the ADR's "How to" and "Conventions" content moves, condensed, to a new CONTRIBUTING.md section, "Tracking Properties of the Ledger", which also documents scan_properties.py and the two gh_project scripts, and notes that the default nix develop shell already provides the required python3 + PyYAML (the flake needs no change); - the problem/decision record moves to the PR description; - docs/adr/0001-ledger-property-tracking.md is deleted, and every reference to it (catalog header, scanner preamble, scripts README, populate issue bodies, workflow comment) now points at the CONTRIBUTING section. AI-assisted development: Claude Fable 5 (Anthropic)
1 parent 38d48c3 commit b2856b0

8 files changed

Lines changed: 101 additions & 208 deletions

File tree

.github/workflows/properties-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: properties-check
22

33
# Reconcile the ledger-properties catalog (build-tools/properties.yaml) against
44
# the Agda source and the generated dashboard. This is the no-network drift gate
5-
# described in docs/adr/0001-ledger-property-tracking.md. (The Agda --safe
5+
# described in CONTRIBUTING.md ("Tracking Properties of the Ledger"). (The Agda --safe
66
# typecheck that guarantees `proved` properties have no holes runs in ci.yml.)
77

88
on:

CONTRIBUTING.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
[📖 HTML Documentation][]
1212
[🖥️ IDE Integration][]
1313
[🧑‍🔧 Working on the Agda source code][]
14+
[📋 Tracking Properties of the Ledger][]
1415
[🔁 CI/CD Workflow][]
1516
[🎛️️ Setup Without Nix][]
1617
[🕵️‍♀️ Conformance Testing][]
@@ -433,6 +434,93 @@ browser.
433434

434435
---
435436

437+
<a id="tracking-properties-of-the-ledger"></a>
438+
## 📋 Tracking Properties of the Ledger
439+
440+
Ledger properties (preservation of value, governance invariants, and so on) are
441+
tracked across eras by the following three artifacts, each the single source of
442+
truth for one concern:
443+
444+
+ **the Agda** under `src/**/Properties/` decides whether a property is *proved*;
445+
+ **the catalog** (`build-tools/properties.yaml`), curated by hand, records each
446+
property's identity: era, STS, Agda module, key definitions, and tracking
447+
issue; it deliberately declares **no** status;
448+
+ **GitHub issues** carry the coordination: discussion, assignment, open/closed.
449+
450+
### The scanner: `scan_properties.py`
451+
452+
A property's status is *derived*, never asserted.
453+
`build-tools/scripts/scan_properties.py` resolves each catalog entry's `module`
454+
against the Agda on disk and classifies the entry as one of the following:
455+
456+
+ `idea`: no module named (nothing in Agda yet);
457+
+ `planned`: module named, but the file is not on this branch;
458+
+ `stated`: the file contains a `coming soon` marker (statement present, proof
459+
pending);
460+
+ `proved`: the file is present with no pending marker.
461+
462+
The scanner regenerates the dashboard
463+
(`build-tools/static/mkdocs/docs/ledger-properties-dashboard.md`, published on
464+
the documentation site as the **Properties Dashboard** page), and
465+
`scan_properties.py --check` fails when the committed dashboard is stale or the
466+
catalog is malformed. The check runs in CI
467+
(`.github/workflows/properties-check.yml`), so a proof that lands without a
468+
regenerated dashboard fails the pull request; the Agda `--safe` typecheck in the
469+
main CI is what makes `proved` mean proved.
470+
471+
Run the scanner from the default development shell (`nix develop` provides
472+
`python3` with PyYAML; without Nix, any Python 3.8+ with the `pyyaml` package
473+
works):
474+
475+
```bash
476+
python3 build-tools/scripts/scan_properties.py # regenerate the dashboard
477+
python3 build-tools/scripts/scan_properties.py --check # what CI runs: fail on drift
478+
```
479+
480+
### Conventions for property modules
481+
482+
+ One focused module per property, in the STS's `Properties/` directory (e.g.
483+
`Chain/Properties/EpochStep.lagda.md`); aggregator modules
484+
(`X/Properties.lagda.md`) just re-export.
485+
+ While unproved, the module states the proposition and ends with
486+
`*Proof*. (coming soon)`. When proved, the proof replaces that line. The
487+
`coming soon` string is the machine-readable pending signal; keep it.
488+
+ Headings carry a stable anchor: `## Claim: … {#clm:Foo}` or
489+
`## Theorem: … {#thm:Foo}`.
490+
+ The catalog records the dotted `module`, the `anchor`, the key `defs`, and
491+
the tracking `issues`; this is where the property↔issue link lives, in-repo
492+
and machine-checkable.
493+
494+
### Typical workflows
495+
496+
+ **Add a property**. Add a catalog entry (no status field; with no module it
497+
derives as `idea`), write the module with the statement and `coming soon`
498+
(it now derives as `stated`), run the scanner, and commit the catalog
499+
together with the regenerated dashboard.
500+
+ **Record a proof**. Replace `coming soon` with the proof (it now derives as
501+
`proved`), run the scanner, commit the regenerated dashboard, and close the
502+
tracking issue.
503+
504+
### Syncing with GitHub issues
505+
506+
Two companion scripts keep the catalog and the GitHub issues aligned. Both are
507+
run locally by maintainers and are documented in `build-tools/scripts/README.md`;
508+
they need the [GitHub CLI](https://cli.github.com/) (`gh`), authenticated (the
509+
Nix shell does not provide `gh`).
510+
511+
+ `gh_project_populate.py` (catalog → GitHub) creates labels, the per-era
512+
umbrella issues, and one tracking issue per catalog entry that has none,
513+
writing the new issue numbers back into the catalog; for already-tracked
514+
issues it reconciles the derived `status:*` label. Run it, with `--dry-run`
515+
first, after adding catalog entries that need issues.
516+
+ `gh_project_render.py` (GitHub → repo) regenerates the issues view
517+
(`build-tools/static/mkdocs/docs/ledger-properties-issues.md`) with live
518+
open/closed/assignee state. Run it to refresh that coordination view;
519+
formal status never comes from issues, since closing an issue by hand does
520+
not make a proof exist.
521+
522+
---
523+
436524
<a id="cicd-workflow"></a>
437525
## 🔁 CI/CD Workflow
438526

@@ -781,6 +869,7 @@ This repository is maintained by [@carlostome][], [@WhatisRT][], and [@williamde
781869
[Building and viewing the formal specification]: #building-and-viewing-the-formal-specification
782870
[Browsing the source code]: #browsing-the-source-code
783871
[🧑‍🔧 Working on the Agda source code]: #working-on-the-agda-source-code
872+
[📋 Tracking Properties of the Ledger]: #tracking-properties-of-the-ledger
784873
[🕵️‍♀️ Conformance Testing]: #conformance-testing
785874
[🖥️ IDE Integration]: #ide-integration
786875
[🔁 CI/CD Workflow]: #cicd-workflow

build-tools/properties.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
# dashboard matches what the Agda currently implies, so the bookkeeping cannot
2020
# silently drift from the code.
2121
#
22-
# Workflow and conventions are documented in
23-
# docs/adr/0001-ledger-property-tracking.md
22+
# Workflow and conventions are documented in CONTRIBUTING.md, in the
23+
# "Tracking Properties of the Ledger" section.
2424
#
2525
# Field reference (per property):
2626
# id : stable slug, unique across the catalog (used by the scripts)

build-tools/scripts/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
Tooling for the ledger-properties catalog (this README covers the three
66
`scan_properties.py` / `gh_project_*.py` scripts; the other scripts in this
7-
directory are unrelated build helpers). Design and rationale:
8-
[`docs/adr/0001-ledger-property-tracking.md`](../../docs/adr/0001-ledger-property-tracking.md).
7+
directory are unrelated build helpers). Workflow and conventions: the
8+
"Tracking Properties of the Ledger" section of [CONTRIBUTING.md](../../CONTRIBUTING.md).
99

1010
The catalog [`build-tools/properties.yaml`](../properties.yaml) declares
1111
every property (identity, era, STS, Agda module, tracking issue). It is what we humans edit.

build-tools/scripts/gh_project_populate.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,8 @@ def issue_body(p: dict, umbrella: int | None) -> str:
222222
lines += [
223223
"",
224224
"---",
225-
"Tracked in `build-tools/properties.yaml`; see ADR "
226-
"`docs/adr/0001-ledger-property-tracking.md` and the dashboard "
225+
"Tracked in `build-tools/properties.yaml`; see the \"Tracking Properties "
226+
"of the Ledger\" section of CONTRIBUTING.md and the dashboard "
227227
"`build-tools/static/mkdocs/docs/ledger-properties-dashboard.md`.",
228228
]
229229
if umbrella:
@@ -274,7 +274,7 @@ def main() -> int:
274274
title = f"Properties of the ledger — {era} era"
275275
body = (f"Umbrella tracking issue for **{era}** ledger properties.\n\n"
276276
f"Sub-issues are generated from `build-tools/properties.yaml`. "
277-
f"See ADR `docs/adr/0001-ledger-property-tracking.md`.")
277+
f"See CONTRIBUTING.md (\"Tracking Properties of the Ledger\").")
278278
num = create_issue(gh, title, body, ["property", f"era:{era}"])
279279
if num:
280280
umbrellas[era] = num

build-tools/scripts/scan_properties.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,8 @@ def render_region(cat: dict, results: dict) -> str:
227227
`build-tools/scripts/scan_properties.py`. Do not edit the generated region below
228228
by hand; edit the catalog and regenerate.
229229
230-
See `docs/adr/0001-ledger-property-tracking.md` for the design, conventions,
231-
and workflow.
230+
See the "Tracking Properties of the Ledger" section of `CONTRIBUTING.md` for
231+
the conventions and workflow.
232232
233233
Status legend: ✅ proved · 🟡 stated (proof pending) · 🟦 planned (drafted on
234234
another branch/PR) · ⚪ idea (not yet in Agda).

build-tools/static/mkdocs/docs/ledger-properties-dashboard.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ property's status **derived from the Agda source** by
66
`build-tools/scripts/scan_properties.py`. Do not edit the generated region below
77
by hand; edit the catalog and regenerate.
88

9-
See `docs/adr/0001-ledger-property-tracking.md` for the design, conventions,
10-
and workflow.
9+
See the "Tracking Properties of the Ledger" section of `CONTRIBUTING.md` for
10+
the conventions and workflow.
1111

1212
Status legend: ✅ proved · 🟡 stated (proof pending) · 🟦 planned (drafted on
1313
another branch/PR) · ⚪ idea (not yet in Agda).

docs/adr/0001-ledger-property-tracking.md

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

0 commit comments

Comments
 (0)