|
11 | 11 | [📖 HTML Documentation][] |
12 | 12 | [🖥️ IDE Integration][] |
13 | 13 | [🧑🔧 Working on the Agda source code][] |
| 14 | +[📋 Tracking Properties of the Ledger][] |
14 | 15 | [🔁 CI/CD Workflow][] |
15 | 16 | [🎛️️ Setup Without Nix][] |
16 | 17 | [🕵️♀️ Conformance Testing][] |
@@ -433,6 +434,93 @@ browser. |
433 | 434 |
|
434 | 435 | --- |
435 | 436 |
|
| 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 | + |
436 | 524 | <a id="cicd-workflow"></a> |
437 | 525 | ## 🔁 CI/CD Workflow |
438 | 526 |
|
@@ -781,6 +869,7 @@ This repository is maintained by [@carlostome][], [@WhatisRT][], and [@williamde |
781 | 869 | [Building and viewing the formal specification]: #building-and-viewing-the-formal-specification |
782 | 870 | [Browsing the source code]: #browsing-the-source-code |
783 | 871 | [🧑🔧 Working on the Agda source code]: #working-on-the-agda-source-code |
| 872 | +[📋 Tracking Properties of the Ledger]: #tracking-properties-of-the-ledger |
784 | 873 | [🕵️♀️ Conformance Testing]: #conformance-testing |
785 | 874 | [🖥️ IDE Integration]: #ide-integration |
786 | 875 | [🔁 CI/CD Workflow]: #cicd-workflow |
|
0 commit comments