Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
1a21846
feat: add requirement IDs, schemas and a requirement lint
brendanjryan Nov 9, 2026
7794d36
fix: address review on requirement lint and schema
brendanjryan Nov 9, 2026
a8608cf
fix: flag keywords in table cells and pin the header value in the schema
brendanjryan Nov 9, 2026
be8749b
fix(schemas): type Credential source as a string, as the drafts do
brendanjryan Nov 9, 2026
55bd68c
fix(schemas): constrain method to the core payment-method-id grammar
brendanjryan Nov 9, 2026
8a3a00b
fix(schemas): require Receipt method and constrain intent to the core…
brendanjryan Nov 9, 2026
6325fcc
chore(tempo): keep tempo-charge at -00 instead of bumping to -01
brendanjryan Nov 9, 2026
5cc64e9
fix(lint): flag conditional REQUIRED table cells; list schema differe…
brendanjryan Nov 9, 2026
21fccd6
fix(lint): reject list-item IDs not indented to the item text
brendanjryan Nov 9, 2026
5c41399
fix(lint): keep loose-list continuation paragraphs in their item
brendanjryan Nov 9, 2026
dfce681
fix(lint): skip code blocks, quoted and ALD ids; pin proof typed data
brendanjryan Nov 9, 2026
d9b47c6
fix(lint): match fence delimiters, split definitions, flag stray ids
brendanjryan Nov 9, 2026
d08d1ea
fix(lint): open fences only outside indented code blocks
brendanjryan Nov 9, 2026
800753b
fix(lint): follow kramdown-rfc fences, tabs, quotes and lazy items
brendanjryan Nov 9, 2026
3b251c0
fix(lint): emphasis, block ends, nested quotes, linear joins, boilerp…
brendanjryan Nov 9, 2026
0a02265
fix(lint): skip block HTML comments and deep-indented IALs; order tem…
brendanjryan Nov 9, 2026
db18366
fix(lint): read a ~~~ inside an HTML comment as comment text
brendanjryan Nov 9, 2026
24b5a03
fix(lint): an unclosed HTML comment hides nothing
brendanjryan Nov 9, 2026
8a9b8e6
fix(lint): scope quoted comments to their quote; reject req IDs on he…
brendanjryan Nov 9, 2026
bdccd21
fix(lint): honor quoted id= attributes, kramdown comment extensions a…
brendanjryan Nov 9, 2026
68b43d5
fix(lint): scope kramdown comment and fence closers to their containe…
brendanjryan Nov 9, 2026
a00c792
fix(schemas): require string values for custom Challenge parameters
brendanjryan Nov 9, 2026
8a3e129
fix(lint): leave oversized decimal character references as text
brendanjryan Nov 9, 2026
5e04ba5
fix(lint): fences on list markers, backtracking fence runs, split key…
brendanjryan Nov 9, 2026
c4a838b
fix(lint): close code spans only at matching backtick runs, keep IALs…
brendanjryan Nov 9, 2026
982485e
fix(lint): apply consecutive IALs to one block, ignore indented ALDs …
brendanjryan Nov 9, 2026
5a773c4
fix(lint): check indent and quote depth for adjacent IALs; schema: co…
brendanjryan Nov 9, 2026
c2ec1c2
fix(schema): require a non-empty, decodable base64url opaque value
brendanjryan Nov 9, 2026
19ba8ce
fix(schemas): require canonical base64url pad bits in Opaque
brendanjryan Nov 9, 2026
1b05603
fix(lint): read ALD-looking prose and comments in table cells as kram…
brendanjryan Nov 9, 2026
4f7a29a
fix(lint): flag escaped comment openers in tables, memoize ALDs, requ…
brendanjryan Nov 9, 2026
b6a7559
fix(lint): hide keywords in unescaped comments; dedupe ALD IDs in lin…
brendanjryan Nov 9, 2026
3d55b24
fix(lint): read inline math literally and report ALD cycles
brendanjryan Nov 9, 2026
d57c8a6
fix(lint): read unclosed comment openers as prose and pair code and m…
brendanjryan Nov 9, 2026
48c77e5
fix(lint): strip code, math and comment spans in kramdown's earliest-…
brendanjryan Nov 9, 2026
df0345c
perf(lint): scan each span pattern once in strip_literal_spans
brendanjryan Nov 9, 2026
6fbb58b
fix(lint): read link destinations literally when pairing math and cod…
brendanjryan Nov 9, 2026
23bba91
fix(lint): skip raw nomarkdown bodies, parse full link destinations; …
brendanjryan Nov 9, 2026
37c979a
fix(schemas): forbid control characters in Challenge expires
brendanjryan Nov 9, 2026
d45b98d
fix(schemas): reject a trailing newline under Python regex validators
brendanjryan Nov 9, 2026
c71d2b7
docs(schemas): say HttpServerOffer is the adapter command's offer
brendanjryan Nov 9, 2026
78d59b4
fix(schemas): keep protocol patterns RE2-compatible
brendanjryan Nov 9, 2026
a1260ca
fix(schemas): enforce RFC 3339 on expires and timestamp with a pattern
brendanjryan Nov 9, 2026
0b0b030
fix(schemas): reject trailing CR, NEL, LS and PS that java.util.regex…
brendanjryan Nov 9, 2026
d1448be
fix(lint): accept only ASCII digits and names in requirement IDs
brendanjryan Nov 9, 2026
72d6afa
fix(schemas): reject impossible calendar dates in DateTime
brendanjryan Nov 9, 2026
ac5127a
fix(schemas): enforce absolute http(s) URLs in HttpPaymentRequest
brendanjryan Nov 9, 2026
cada165
fix(schemas): reject embedded line terminators; check digest and subs…
brendanjryan Nov 9, 2026
1251e47
fix(schemas): accept only decodable base64 in Content-Digest values
brendanjryan Nov 9, 2026
c6fd7bd
feat(scripts): read requirements from kramdown-rfc XML and annotate P…
brendanjryan Nov 9, 2026
1a3af1d
fix(schemas): accept second 60 only as 23:59:60 UTC
brendanjryan Nov 9, 2026
ae52321
fix(scripts): report a requirement ID an ALD loses to a literal ID
brendanjryan Nov 9, 2026
6e00660
fix(scripts): annotate drafts being tagged first; parse URL structure…
brendanjryan Nov 9, 2026
47e2a72
fix(scripts): report a reused requirement ID that another ID replaces
brendanjryan Nov 9, 2026
4e61ceb
fix(scripts): check requirement IDs shown as code where an IAL misuse…
brendanjryan Nov 9, 2026
7a1a5c6
fix(schemas): place leap seconds on month ends, with any offset
brendanjryan Nov 9, 2026
9c09607
fix(schemas): allow a February 28 leap second only outside leap years
brendanjryan Nov 9, 2026
63f86d6
fix(lint): place requirement IDs by their IALs alone, and report each…
brendanjryan Nov 9, 2026
0cbfd7e
fix(lint): strip code spans in linear time
brendanjryan Nov 9, 2026
b5fefa0
fix(lint): scan comments and braces in linear time
brendanjryan Nov 9, 2026
d17006b
fix(lint): tighten IP literals, conditions, replaced IDs and comment …
brendanjryan Nov 9, 2026
a445afa
perf(lint): dedupe requirement problems with a set
brendanjryan Nov 9, 2026
707ff9c
fix(schema): reject leap seconds with a nonzero UTC offset
brendanjryan Nov 9, 2026
8c0457f
perf(lint): build each line's brace table once
brendanjryan Nov 9, 2026
773c20d
perf(lint): keep only brace positions for the requirement lint's brac…
brendanjryan Nov 9, 2026
99bd80b
fix(lint): scan indentation linearly, check ALD references' placement…
brendanjryan Nov 9, 2026
6f82d27
fix(lint): scope IAL scans to their block, read quoted IAL values and…
brendanjryan Nov 9, 2026
0433f83
perf(lint): keep the brace caches unbounded so shared IDs don't thras…
brendanjryan Nov 9, 2026
9f1a418
fix(lint): treat on and upon as conditions after a presence marker
brendanjryan Nov 9, 2026
3c595c1
chore: move tempo-charge requirement tags to their own pull request
brendanjryan Nov 13, 2026
f036918
Merge remote-tracking branch 'origin/main' into b397
brendanjryan Nov 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ jobs:
run: |
docker run --rm -v "$(pwd)":/data ietf-spec-tools:latest python3 /data/scripts/lint_examples.py

# Warns without failing the check while drafts are being tagged. GITHUB_ACTIONS turns
# each warning into an annotation on the PR diff.
- name: Lint requirements (non-blocking)
continue-on-error: true
run: |
docker run --rm -e GITHUB_ACTIONS -v "$(pwd)":/data ietf-spec-tools:latest python3 /data/scripts/lint_requirements.py

- name: Test scripts
run: docker run --rm -v "$(pwd)":/data -w /data/scripts ietf-spec-tools:latest pytest -v

Expand Down
4 changes: 3 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The IETF Internet-Drafts that define the Machine Payments Protocol: the `Payment

```bash
make docker-build # build the ietf-spec-tools image (kramdown-rfc, xml2rfc, rfclint, pytest); once, and after Dockerfile changes
make lint # frontmatter, JSON examples, external section refs, encoded examples, problem types
make lint # frontmatter, JSON examples, external section refs, encoded examples, problem types, requirement IDs (warn only)
make test # pytest over scripts/ (scripts/test_*.py)
make check # build every draft to XML/HTML/TXT/PDF in artifacts/, then rfclint the XML
make build # build only (scripts/gen.sh in Docker)
Expand All @@ -22,6 +22,7 @@ CI (`pr-check.yml`) runs the same steps inside the Docker image. Run one script
- `specs/intents/`: standardized payment intents (`draft-payment-intent-{name}-NN.md`).
- `specs/methods/<network>/`: payment methods, one draft per intent (`draft-{network}-{intent}-NN.md`, such as `tempo/draft-tempo-charge-00.md`).
- `specs/extensions/`: optional extensions (`draft-payment-discovery-NN.md`) and `transports/` (MCP).
- `schemas/`: JSON Schemas for protocol values, copied from tempoxyz/mpp-tools (`schemas/README.md`).
- `examples/`: templates for new intents, methods and extensions, with the required sections per track (`examples/README.md`).
- `scripts/`: `gen.sh` (Markdown → XML → HTML/TXT/PDF), `check.sh`, the `lint_*.py` linters and their `test_*.py`, `bump_and_rename.sh`, `gen_index.py` and `gen_problems.py` for the site, `serve.py`.
- `pages/templates/`: HTML templates for the paymentauth.org index and `/problems/` pages.
Expand All @@ -36,6 +37,7 @@ CI (`pr-check.yml`) runs the same steps inside the Docker image. Run one script
- Frontmatter needs `title`, `abbrev`, `docname`, `version`, `category`, `ipr` (`noModificationTrust200902`), `submissiontype`, `consensus` and `author` (`name`, `ins`, `email`, `org` in that order); `lint_frontmatter.py` enforces it.
- Avoid new hardcoded external section references such as `Section X.Y of {{I-D...}}`; allowed ones are listed in `scripts/allowed_external_section_refs.txt`.
- Write in RFC 7322 style with RFC 2119/8174 keywords, terms defined before use, and Security and IANA Considerations in every draft (STYLE.md). Keep Markdown source lines under 72 characters.
- Every normative statement carries a requirement ID, `{: #req-<draft>-<nnn>}` on the line after it, never renumbered or reused (STYLE.md). `python3 scripts/lint_requirements.py --strict <draft>` checks a tagged draft. It reads the draft as kramdown-rfc renders it, so it needs kramdown-rfc (run it in the Docker image).
- JSON and encoded examples must be valid and decode to what they claim; problem types used in drafts must have pages (`lint_problem_types.py`).
- Cross-references flow downward: core → intents → methods.
- Versioning: the core carries no wire version, intents carry none, and methods may add `methodDetails.version` (absent means 1) for breaking changes. Implementations ignore unknown fields.
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ lint:
docker run --rm -v "$$(pwd)":/data ietf-spec-tools python3 /data/scripts/lint_external_section_refs.py
docker run --rm -v "$$(pwd)":/data ietf-spec-tools python3 /data/scripts/lint_examples.py
docker run --rm -v "$$(pwd)":/data ietf-spec-tools python3 /data/scripts/lint_problem_types.py
docker run --rm -v "$$(pwd)":/data ietf-spec-tools python3 /data/scripts/lint_requirements.py

test:
docker run --rm -v "$$(pwd)":/data -w /data/scripts ietf-spec-tools pytest -v
Expand Down
35 changes: 35 additions & 0 deletions STYLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,41 @@ Use RFC 2119 keywords precisely:
| SHOULD NOT | Discouraged, but valid reasons to do it may exist |
| MAY | Truly optional |

#### Requirement IDs

Every normative statement carries a stable ID that tests, schemas
and gap reports cite.

- A requirement is a paragraph or list item containing an RFC
2119/8174 keyword in capitals.
- Tag it with a kramdown block IAL on the line right after it:
`{: #req-<draft>-<nnn>}`. In a list, indent it to the item's text.
- `<draft>` is the file name without `draft-`, a leading
`payment-` and the revision: `core` (`draft-httpauth-payment`),
`tempo-charge`, `intent-charge`, `discovery`.
- `<nnn>` is three digits, in document order when a draft is first
tagged.
- Never renumber or reuse an ID. A new rule takes the next free
number wherever it goes; a removed rule's number stays retired.
- A keyword in a table cell can't carry an ID: state the rule in
prose next to the table. A cell may still mark a field present or
absent with a bare REQUIRED, OPTIONAL or RECOMMENDED (alone, or
ending its clause: "OPTIONAL. Defaults to 0"); a marker that opens
a condition ("REQUIRED if ...", "REQUIRED: if ...") is a rule.
- An ID only goes on text with a keyword. Reworded a rule so it has
none? Drop the ID and retire its number.
- IDs become `anchor` attributes in the XML and don't show in the
TXT or HTML output.
- `scripts/lint_requirements.py` (in `make lint`) warns by default.
`--strict <draft>` fails on:
- untagged requirements;
- duplicate or malformed IDs, or more than one ID on a block;
- IDs on text with no keyword;
- IDs not directly after their block, or not indented to their
list item's text;
- keywords in table cells beyond a presence marker.
IDs that go backwards are notes only.

### 3. Structure

Following IETF guidelines, every spec should follow the structure below:
Expand Down
56 changes: 56 additions & 0 deletions schemas/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Schemas

JSON Schemas for MPP protocol values.

- `protocol.schema.json`: Challenge, Credential and Receipt values
as parsed objects (`request` decoded from base64url), plus the
operation, error and fixture types the MPP conformance suite uses.
Copied from [tempoxyz/mpp-tools](https://github.com/tempoxyz/mpp-tools/blob/6cc6b497763e9c50e738834c7447c9771e85e592/conformance/schemas/protocol.schema.json)
(`conformance/schemas/`) with its `$id` moved to
`https://paymentauth.org/schemas/`. Change it there first, then
copy it here.
- The `$id` URL is not served yet: the Pages deploy (`.github/workflows/deploy.yml`)
does not copy `schemas/` into `_site`. Until it does, read the schema from
this repository.
- Intentional differences from mpp-tools, which should follow:
- Receipt `status` is `const: "success"`, as the core draft's
Receipt Status Semantics require.
- Receipt requires `method`, as the core draft's Receipt fields do.
- Challenge and ChallengeIdInput `header` are
`const: "Payment-Authorization"`.
- ChallengeIdInput `expires` and `digest` use the Challenge formats
(`DateTime`, `ContentDigest`), so neither can hold the `|` that
separates HMAC input slots. mpp-tools' challenge-id vectors use
digests without the RFC 9530 colons and should add them.
- Credential `source` is a string.
- http.payment_request `payment.source` is a string or null, matching Credential `source`.
- `TempoProofTypedData` pins domain `name` "MPP", `version` "3", `primaryType`
"Proof" and the `Proof` type, per the tempo-charge draft.
- `PaymentMethodId` has pattern `^[a-z]+$` and `IntentId` has
`^[A-Za-z0-9-]+$`, per the core draft's method and intent grammar.
Challenge, ChallengeIdInput, ServerVerifyRequest and Receipt use
them for `method` and, where present, `intent`.
- HttpServerOffer `method` is a `PaymentMethodId`, narrowed from
`^[a-z][a-z0-9-]*$`.
- Challenge allows extra members whose names are lowercase RFC 9110
tokens (`propertyNames`) and whose values are `ParamValue` strings
(no control characters but HTA`): custom parameters are auth-params

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Low (trigger unconfirmed) · unverified: Schema README says 'HTA`' instead of 'HTAB'

The added schemas/README.md line 37 describes ParamValue as '(no control characters but HTA)'. The schema's own ParamValue description says 'no control characters but HTAB'. The README line has a typo plus a stray unmatched backtick, so readers see a meaningless 'HTA' where the allowed character (horizontal tab) should be named.

Full finding

The added schemas/README.md line 37 describes ParamValue as '(no control characters but HTA)'. The schema's own ParamValue description says 'no control characters but HTAB'. The README line has a typo plus a stray unmatched backtick, so readers see a meaningless 'HTA' where the allowed character (horizontal tab) should be named. Impact is documentation clarity only. Fix: change 'HTA`' to 'HTAB'.

Valid? React with 👍 / 👎.

(token or quoted-string), and receivers ignore unknown ones.
- Challenge `digest` is an RFC 9530 Content-Digest value
(`ContentDigest`), and Receipt `subscriptionId` is unpadded base64url,
as the core draft and the subscription intent require.
- Every pattern has a `not` guard that rejects a line terminator
anywhere in the value, so validators whose `$` also matches before a
final newline, or at every line (Ruby), accept no multi-line value.
- Challenge `expires`, Receipt `timestamp` and HttpServerOffer
`expires` use `DateTime`: `format: date-time` plus an RFC 3339
pattern, since 2020-12 validators treat `format` as an annotation
by default.
- HttpPaymentRequest `url` adds a pattern to `format: uri`: an
absolute http or https URL in RFC 3986 characters, for the same reason.
- Credential allows extra members of any type
(`additionalProperties: true`), since receivers ignore unknown fields.
- The drafts are normative. Where a schema and a draft disagree, the
draft wins and the schema is the bug.
- JSON Schema draft 2020-12. Nothing in CI validates the drafts'
examples against these schemas yet.
Loading
Loading