Skip to content

Commit c19a200

Browse files
committed
Documentation now reflects split manifest.json
Signed-off-by: Andrew Helwer <ahelwer@pm.me>
1 parent 4021e86 commit c19a200

12 files changed

Lines changed: 53 additions & 54 deletions

.github/scripts/check_manifest_features.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
22
This script performs whatever validations are possible on the metadata in
3-
the manifest.json file. Prominent checks include:
3+
the manifest.json files. Prominent checks include:
44
* .tla files containing pluscal or proofs are marked as such
55
* .tla files importing community modules have those modules listed
66
* .cfg files with certain features are marked as such
@@ -234,7 +234,7 @@ def check_features(parser, queries, manifest, examples_root):
234234
return success
235235

236236
if __name__ == '__main__':
237-
parser = ArgumentParser(description='Checks metadata in tlaplus/examples manifest.json against module and model files in repository.')
237+
parser = ArgumentParser(description='Checks metadata in manifest.json files against module and model files in repository.')
238238
parser.add_argument('--examples_root', help='Root directory of the tlaplus/examples repository', required=True)
239239
args = parser.parse_args()
240240

.github/scripts/check_manifest_files.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"""
22
Checks to ensure all files in manifest.json exist, that all .tla and .cfg
33
files in repo are recorded in manifest.json (except for those in .ciignore),
4-
and that no files are present twice in the manifest. Also checks to ensure
5-
no files in .ciignore are in the manifest.json.
4+
and that no files are present twice in the manifests. Also checks to ensure
5+
no files in .ciignore are in the manifest.json files.
66
"""
77

88
from argparse import ArgumentParser

.github/scripts/check_markdown_table.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Validates the spec table in README.md, ensuring it matches manifest.json.
2+
Validates the spec table in README.md, ensuring it matches manifest.json files.
33
"""
44

55
from argparse import ArgumentParser

.github/scripts/check_small_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Check all models marked as size "small" in the manifest with TLC. Small
2+
Check all models marked as size "small" in each manifest with TLC. Small
33
models should finish executing in less than ten seconds on the GitHub CI
44
machines.
55
"""

.github/scripts/generate_manifest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Generates a best-effort manifest.json file. This is done by scanning all
2+
Generates best-effort manifest.json files. This is done by scanning all
33
.tla and .cfg files in the specifications dir then attempting to sort them
44
into a spec/module/model hierarchy. Files are parsed to check for features
55
and imports. Human-written fields (title/description/source/authors for

.github/scripts/parse_modules.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Parse all modules in the manifest with SANY.
2+
Parse all modules in the manifests with SANY.
33
"""
44

55
from argparse import ArgumentParser

.github/scripts/record_model_state_space.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
22
Records the number of unique & total states encountered by TLC for each small
3-
model where that info is not present, then writes it to the manifest.json.
3+
model where that info is not present, then writes it to a manifest.json file.
44
"""
55

66
from argparse import ArgumentParser

.github/scripts/smoke_test_large_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Smoke-test all models not marked as size "small" in the manifest. This
2+
Smoke-test all models not marked as size "small" in each manifest. This
33
entails running them for five seconds to ensure they can actually start
44
and work with the spec they're supposed to be modeling.
55
"""

.github/scripts/unicode_number_set_shim.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
While Unicode support in the Java tools goes through a trial period, the core
33
Naturals/Integers/Reals modules will remain Unicode-free. So, the Unicode
44
number sets ℕ, ℤ, and ℝ must be defined in any module that wishes to use
5-
them. This script iterates through all modules in the manifest and replaces
5+
them. This script iterates through all modules in the manifests and replaces
66
their imports of the Naturals/Integers/Reals modules with shims containing
77
a definition of the Unicode number sets.
88
"""

CONTRIBUTING.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,25 @@ Licensing your contributed specs under MIT is most appreciated, for consistency;
2222
This makes it clear which model files are associated with which spec.
2323
1. Include a `README.md` in the spec directory explaining the significance of the spec with links to any relevant websites or publications, or integrate this info as comments in the spec itself.
2424

25-
At this point, you have the option of adding your spec directory to the [`.ciignore`](.ciignore) file to simply contribute the spec files & exclude it from automated validation.
25+
At this point, you have the option of adding your spec directory to the [`.ciignore`](.ciignore) file to simply contribute the spec files & exclude it from automated validation, although this precludes your spec from the table of CI-validated specs in [`README.md`](README.md).
2626
Contribution volume is low enough that maintainers will be able to onboard your spec to the validation process eventually.
2727
However, if you are willing to put in the addition work of onboarding your spec to continuous integration yourself, follow the steps below.
2828

2929
## Adding Spec to Continuous Integration
3030

3131
All specs & models in this repository are subject to many validation checks; for a full listing, see [`DEVELOPING.md`](DEVELOPING.md).
32-
While many of these checks concern basic properties like whether the spec parses properly and its models do not crash, they also check whether the spec correctly reflects metadata stored about it in [`manifest.json`](manifest.json) and a table in [`README.md`](README.md).
32+
While many of these checks concern basic properties like whether the spec parses properly and its models do not crash, they also check whether the spec correctly reflects metadata stored about it in the spec's `manifest.json` file and a table in [`README.md`](README.md).
3333

34-
The central file containing metadata about all specs is [`manifest.json`](manifest.json).
35-
You will need to add an entry to it for your spec & model files.
34+
CI validation requires creating a `manifest.json` metadata file in your specification's root directory.
3635
This can either be done manually (by looking at existing examples) or largely automated using the instructions below; note that if done manually you are very likely to miss tagging your spec with some feature flags detected & enforced by the CI.
37-
Before submitted your changes to run in the CI, you can quickly check your [`manifest.json`](manifest.json) against the schema [`manifest-schema.json`](manifest-schema.json) at https://www.jsonschemavalidator.net/.
36+
Before submitted your changes to run in the CI, you can quickly check your `manifest.json` against the schema [`manifest-schema.json`](manifest-schema.json) at https://www.jsonschemavalidator.net/.
3837
Steps:
3938

4039
1. Ensure you have Python 3.11+ installed; open a terminal in the root of this repository
4140
1. It is considered best practice to create & initialize a Python virtual environment so the required packages are not installed globally; run `python -m venv .` then `source ./bin/activate` on Linux & macOS or `.\Scripts\activate.bat` on Windows (run `deactivate` to exit)
4241
1. Run `pip install -r .github/scripts/requirements.txt`
43-
1. Run `python .github/scripts/generate_manifest.py` to auto-generate your spec entry in [`manifest.json`](manifest.json) with as many details as possible
44-
1. Locate your spec's entry in the [`manifest.json`](manifest.json) file and ensure the following fields are filled out:
42+
1. Run `python .github/scripts/generate_manifest.py` to auto-generate your spec's `manifest.json` file with as many details as possible
43+
1. Locate your spec directory's `manifest.json` file and ensure the following fields are filled out:
4544
- Spec title: an appropriate title for your specification
4645
- Spec description: a short description of your specification
4746
- Spec sources: links relevant to the source of the spec (papers, blog posts, repositories)
@@ -69,18 +68,18 @@ Steps:
6968
- Recording these turns your model into a powerful regression test for TLC
7069
- Other fields are auto-generated by the script; if you are adding an entry manually, ensure their values are present and correct (see other entries or the [`manifest-schema.json`](manifest-schema.json) file)
7170
1. Add your spec somewhere in the **topmost** table (not the bottom one, don't get them mixed up!) in [`README.md`](README.md); this must have:
72-
- The spec name as a link to the spec's directory, matching the name in the [`manifest.json`](manifest.json)
73-
- A comma-separated list of authors, which must also match the list of authors in [`manifest.json`](manifest.json)
71+
- The spec name as a link to the spec's directory, matching the name in the `manifest.json`
72+
- A comma-separated list of authors, which must also match the list of authors in the `manifest.json`
7473
- A checkmark indicating whether the spec is appropriate for beginners
75-
- Checked IFF (if and only if) `beginner` is present in the `tags` field of your spec in [`manifest.json`](manifest.json)
74+
- Checked IFF (if and only if) `beginner` is present in the `tags` field of your spec in `manifest.json`
7675
- A checkmark indicating whether the spec contains a formal proof
77-
- Checked IFF a `proof` tag is present in the `features` field of least one module under your spec in [`manifest.json`](manifest.json)
76+
- Checked IFF a `proof` tag is present in the `features` field of least one module under your spec in `manifest.json`
7877
- A checkmark indicating whether the spec contains PlusCal
79-
- Checked IFF a `pluscal` tag is present in the `features` field of least one module under your spec in [`manifest.json`](manifest.json)
78+
- Checked IFF a `pluscal` tag is present in the `features` field of least one module under your spec in `manifest.json`
8079
- A checkmark indicating whether the spec contains a TLC-checkable model
81-
- Checked IFF `exhaustive search`, `generate`, or `simulate` tags are present in the `mode` field of at least one model under your spec in [`manifest.json`](manifest.json)
80+
- Checked IFF `exhaustive search`, `generate`, or `simulate` tags are present in the `mode` field of at least one model under your spec in `manifest.json`
8281
- A checkmark indicating whether the spec contains an Apalache-checkable model
83-
- Checked IFF `symbolic` tag is present in the `mode` field of at least one model under your spec in [`manifest.json`](manifest.json)
82+
- Checked IFF `symbolic` tag is present in the `mode` field of at least one model under your spec in `manifest.json`
8483

8584
At this point you can open a pull request and the CI will run against your spec, alerting you to any details that you missed.
8685
These scripts can be run locally for a faster development loop; see [`DEVELOPING.md`](DEVELOPING.md) for details.

0 commit comments

Comments
 (0)