Skip to content

Commit c32f0bc

Browse files
celinvaljaisnandanielsnadpaco-aws
authored
An RFC for creating an RFC process. :) (#1543)
* Move build docs script to be under scripts/ * Add RFC book and an RFC template * Build rfc book as part of build docs . Co-authored-by: Jaisurya Nanduri <[email protected]> Co-authored-by: Daniel Schwartz-Narbonne <[email protected]> Co-authored-by: Adrian Palacios <[email protected]>
1 parent 281d0bb commit c32f0bc

File tree

8 files changed

+168
-2
lines changed

8 files changed

+168
-2
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ Describe Kani's current behavior and how your code changes that behavior. If the
77

88
Resolves #ISSUE-NUMBER
99

10+
### Related RFC:
11+
12+
<!--
13+
Link to the Tracking RFC issue if this work implements part of an RFC.
14+
-->
15+
Optional #ISSUE-NUMBER.
1016

1117
### Call-outs:
1218

.github/workflows/kani.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ jobs:
8282

8383
# On one OS only, build the documentation, too.
8484
- name: Build Documentation
85-
run: ./docs/build-docs.sh
85+
run: ./scripts/build-docs.sh
8686

8787
# When we're pushed to main branch, only then actually publish the docs.
8888
- name: Publish Documentation

docs/src/getting-started.md

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Proof harnesses are similar to test harnesses, especially property-based test ha
1212

1313
Kani is currently under active development.
1414
Releases are published [here](https://github.com/model-checking/kani/releases).
15+
Major changes to Kani are documented in the [RFC Book](https://model-checking.github.io/kani/rfc).
16+
1517
There is support for a fair amount of Rust language features, but not all (e.g., concurrency).
1618
Please see [Limitations - Rust feature support](./rust-feature-support.md) for a detailed list of supported features.
1719

rfc/book.toml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright Kani Contributors
2+
# SPDX-License-Identifier: Apache-2.0 OR MIT
3+
[book]
4+
title = "Kani RFC Book"
5+
description = "Design documents for Kani Rust Verifier"
6+
authors = ["Kani Developers"]
7+
language = "en"
8+
multilingual = false
9+
src = "src"
10+
11+
[output.html]
12+
site-url = "/kani/rfc/"
13+
git-repository-url = "https://github.com/model-checking/kani"
14+
edit-url-template = "https://github.com/model-checking/kani/edit/main/rfc/{path}"
15+
16+
[output.html.playground]
17+
runnable = false

rfc/src/SUMMARY.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Kani Rust Verifier - RFCs
2+
3+
[Introduction](./intro.md)
4+
5+
[RFC Template](./template.md)
6+
7+
# Kani RFCs
8+
9+

rfc/src/intro.md

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Introduction
2+
3+
Kani is an open-source verification tool that uses automated reasoning to analyze Rust programs. In order to
4+
integrate feedback from developers and users on future changes to Kani, we decided to follow a light-weight
5+
"RFC" (request for comments) process.
6+
7+
## When to create an RFC
8+
9+
You should create an RFC in one of two cases:
10+
11+
1. The change you are proposing would be a "one way door": e.g. a change to the public API, a new feature that would be difficult to modify once released, deprecating a feature, etc.
12+
2. The change you are making has a significant design component, and would benefit from a design review.
13+
14+
Bugs and smaller improvements to existing features do not require an RFC.
15+
If you are in doubt, feel free to create a [feature request](https://github.com/model-checking/kani/issues/new?assignees=&labels=&template=feature_request.md) and discuss the next steps in the new issue.
16+
Your PR reviewer may also request an RFC if your change appears to fall into category 1 or 2.
17+
18+
You do not necessarily need to create an RFC immediately. It is our experience that it is often best to write some "proof of concept" code to test out possible ideas before writing the formal RFC.
19+
20+
## The RFC process
21+
22+
This is the overall workflow for the RFC process:
23+
24+
```toml
25+
Create RFC ──> Receive Feedback ──> Accepted?
26+
│ ∧ │ Y
27+
∨ │ ├───> Implement ───> Test + Feedback ───> Stabilize?
28+
Revise │ N │ Y
29+
└───> Close PR ├───> RFC Stable
30+
│ N
31+
└───> Remove feature
32+
```
33+
34+
1. Create an RFC
35+
1. Create a tracking issue for your RFC (e.g.: [Issue-1588](https://github.com/model-checking/kani/issues/1588)).
36+
2. Start from a fork of the Kani repository.
37+
3. Copy the template file ([`rfc/src/template.md`](./template.md)) to `rfc/src/<ID_NUMBER><my-feature>.md`.
38+
4. Fill in the details according to the template instructions.
39+
5. Submit a pull request.
40+
2. Build consensus and integrate feedback.
41+
1. RFCs should get approved by at least 2 Kani developers.
42+
2. Once the RFC has been approved, update the RFC status and merge the PR.
43+
3. If the RFC is not approved, close the PR without merging.
44+
3. Feature implementation.
45+
1. Start implementing the new feature in your fork.
46+
2. It is OK to implement it incrementally over multiple PRs. Just ensure that every pull request has a testable
47+
end-to-end flow and that it is properly tested.
48+
3. In the implementation stage, the feature should only be accessible if the user explicitly passes
49+
`--enable-unstable` as an argument to Kani.
50+
4. Document how to use the feature.
51+
5. Keep the RFC up-to-date with the decisions you make during implementation.
52+
4. Test and Gather Feedback.
53+
1. Fix major issues related to the new feature.
54+
2. Gather user feedback and make necessary adjustments.
55+
3. Add lots of tests.
56+
5. Stabilization.
57+
1. Propose to stabilize the feature when feature is well tested and UX has received positive feedback.
58+
2. Create a new PR that removes the `--enable-unstable` guard and that marks the RFC status as "STABLE".
59+
1. Make sure the RFC reflects the final implementation and user experience.
60+
3. In some cases, we might decide not to incorporate a feature
61+
(E.g.: performance degradation, bad user experience, better alternative).
62+
In those cases, please update the RFC status to "CANCELLED as per <PR_LINK | ISSUE_LINK>" and remove the code
63+
that is no longer relevant.
64+
4. Close the tracking issue.

rfc/src/template.md

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
- **Feature Name:** *Fill me with pretty name and a unique ident. E.g: New Feature (`new_feature`)*
2+
- **Feature Request Issue:** *Link to issue*
3+
- **RFC PR:** *Link to original PR*
4+
- **Status:** *One of the following: [Under Review | Unstable | Stable | Cancelled]*
5+
- **Version:** [0-9]\* *Increment this version whenever you open a new PR to update the RFC (not at every revision).
6+
Start with 0.*
7+
- **Proof-of-concept:** *Optional field. If you have implemented a proof of concept, add a link here*
8+
9+
## Summary
10+
11+
Short description of the feature, i.e.: the elevator pitch. What is this feature about?
12+
13+
## User Impact
14+
15+
Why are we doing this? How will this benefit the final user?
16+
17+
- If this is an API change, how will that impact current users?
18+
- For deprecation or breaking changes, how will the transition look like?
19+
- If this RFC is related to change in the architecture without major user impact, think about the long term
20+
impact for user. I.e.: what future work will this enable.
21+
22+
## User Experience
23+
24+
What is the scope of this RFC? Which use cases do you have in mind? Explain how users will interact with it. Also
25+
please include:
26+
27+
- How would you teach this feature to users? What changes will be required to the user documentation?
28+
- If the RFC is related to architectural changes and there are no visible changes to UX, please state so.
29+
30+
## Detailed Design
31+
32+
This is the technical portion of the RFC. Please provide high level details of the implementation you have in mind:
33+
34+
- What are the main components that will be modified? (E.g.: changes to `kani-compiler`, `kani-driver`, metadata,
35+
installation...)
36+
- How will they be modified? Any changes to how these components communicate?
37+
- Will this require any new dependency?
38+
- What corner cases do you anticipate?
39+
40+
## Rationale and alternatives
41+
42+
- What are the pros and cons of this design?
43+
- What is the impact of not doing this?
44+
- What other designs have you considered? Why didn't you choose them?
45+
46+
## Open questions
47+
48+
- Is there any part of the design that you expect to resolve through the RFC process?
49+
- What kind of user feedback do you expect to gather before stabilization? How will this impact your design?
50+
51+
## Future possibilities
52+
53+
What are natural extensions and possible improvements that you predict for this feature that is out of the
54+
scope of this RFC? Feel free to brainstorm here.

docs/build-docs.sh scripts/build-docs.sh

+15-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
# Copyright Kani Contributors
33
# SPDX-License-Identifier: Apache-2.0 OR MIT
44

5+
# Build all our documentation and place them under book/ directory.
6+
# The user facing doc is built into book/
7+
# RFCs are placed under book/rfc/
8+
59
set -eu
610

711
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
@@ -20,8 +24,12 @@ fi
2024

2125
# Publish bookrunner report into our documentation
2226
KANI_DIR=$SCRIPT_DIR/..
27+
DOCS_DIR=$KANI_DIR/docs
28+
RFC_DIR=$KANI_DIR/rfc
2329
HTML_DIR=$KANI_DIR/build/output/latest/html/
2430

31+
cd $DOCS_DIR
32+
2533
if [ -d $HTML_DIR ]; then
2634
# Litani run is copied into `src` to avoid deletion by `mdbook`
2735
cp -r $HTML_DIR src/bookrunner/
@@ -38,11 +46,17 @@ else
3846
echo "WARNING: Could not find the latest bookrunner run."
3947
fi
4048

49+
echo "Building user documentation..."
4150
# Build the book into ./book/
4251
mkdir -p book
43-
./mdbook build
52+
mkdir -p book/rfc
53+
$SCRIPT_DIR/mdbook build
4454
touch book/.nojekyll
4555

56+
echo "Building RFC book..."
57+
cd $RFC_DIR
58+
$SCRIPT_DIR/mdbook build -d $KANI_DIR/docs/book/rfc
59+
4660
# Testing of the code in the documentation is done via the usual
4761
# ./scripts/kani-regression.sh script. A note on running just the
4862
# doc tests is in README.md. We don't run them here because

0 commit comments

Comments
 (0)