Skip to content

feat: add the requirement-ID convention, lint and schemas - #397

Open
brendanjryan wants to merge 71 commits into
mainfrom
pyramid/f44edc25-47d6-4e3b-985a-b448c8251bea
Open

brendanjryan wants to merge 71 commits into
mainfrom
pyramid/f44edc25-47d6-4e3b-985a-b448c8251bea

Conversation

@brendanjryan

@brendanjryan brendanjryan commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

Context

Adds the requirement-ID convention, its lint and protocol schemas, so automated tooling can check invariants on the specs. Tagging the drafts themselves happens in separate PRs, starting with tempo-charge in #407.

Summary

  • STYLE.md: requirement ID convention, {: #req-<draft>-<nnn>} block IAL after each normative paragraph or list item; AGENTS.md points to it
  • scripts/lint_requirements.py + tests: reports untagged requirements, duplicate, malformed, detached and out-of-order IDs; warn-only by default, --strict exits 1; added to make lint
  • schemas/protocol.schema.json: copied from tempoxyz/mpp-tools conformance/schemas/ with $id under https://paymentauth.org/schemas/, plus schemas/README.md
  • No draft changes here: tagging tempo-charge, and the --strict test that keeps it tagged, moved to feat(tempo-charge): tag every requirement with an ID #407, which stacks on this PR
  • Not done here:
    • scripts/check.sh doesn't call the lint because that file is executable and would need an unsigned commit
    • Out-of-order IDs are notes, not --strict failures, because new rules take the next free number
    • Examples aren't validated against the schema yet: the image has no jsonschema, and the schema models decoded values (request as an object), not the base64url wire form
  • Checks: make lint, make test (95 passed), make check (rfclint passes; the "Duplicate word" messages also appear on main

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T04:00:00.051247Z 1a21846 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1a21846aaf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread schemas/protocol.schema.json Outdated
"required": ["status", "timestamp", "reference"],
"additionalProperties": true,
"properties": {
"status": { "type": "string", "minLength": 1 },

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Restrict receipt status to success

When validating a Receipt, this definition accepts any nonempty status, including "failed" or "pending". That contradicts specs/core/draft-httpauth-payment-01.md's Receipt Status Semantics section, which requires status to be "success" and communicates failures through HTTP errors instead. Consequently, consumers of this schema, including the ServerVerifyResult receipt reference, can accept failure receipts as valid protocol values. Use const: "success" here so schema validation enforces that invariant.

AGENTS.md reference: AGENTS.md:L69-L69

Useful? React with 👍 / 👎.

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown

Spec Preview

Spec Changed Artifacts
draft-card-charge-00 Yes HTML · TXT · XML · PDF
draft-evm-charge-00 Yes HTML · TXT · XML · PDF
draft-evm-session-00 Yes HTML · TXT · XML · PDF
draft-hedera-charge-00 Yes HTML · TXT · XML · PDF
draft-hedera-session-00 Yes HTML · TXT · XML · PDF
draft-httpauth-payment-01 Yes HTML · TXT · XML · PDF
draft-lightning-charge-00 Yes HTML · TXT · XML · PDF
draft-lightning-session-00 Yes HTML · TXT · XML · PDF
draft-nearintents-charge-01 Yes HTML · TXT · XML · PDF
draft-payment-discovery-01 Yes HTML · TXT · XML · PDF
draft-payment-intent-charge-00 Yes HTML · TXT · XML · PDF
draft-payment-intent-subscription-00 Yes HTML · TXT · XML · PDF
draft-payment-transport-mcp-00 Yes HTML · TXT · XML · PDF
draft-solana-charge-00 Yes HTML · TXT · XML · PDF
draft-solana-session-00 Yes HTML · TXT · XML · PDF
draft-solana-subscription-00 Yes HTML · TXT · XML · PDF
draft-stellar-charge-00 Yes HTML · TXT · XML · PDF
draft-stripe-charge-00 Yes HTML · TXT · XML · PDF
draft-stripe-subscription-00 Yes HTML · TXT · XML · PDF
draft-tempo-charge-01 New HTML · TXT · XML · PDF
draft-tempo-session-00 Yes HTML · TXT · XML · PDF
draft-tempo-subscription-00 Yes HTML · TXT · XML · PDF
draft-usdc-charge-00 Yes HTML · TXT · XML · PDF
draft-xrpl-charge-00 Yes HTML · TXT · XML · PDF
draft-xrpl-session-00 Yes HTML · TXT · XML · PDF

Browse preview release assets

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nothing blocking. The comments below are optional suggestions. There is no need to push a fix for them before merging.

Comment thread scripts/lint_requirements.py Resolved
Comment thread schemas/protocol.schema.json Resolved

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I re-reviewed after the latest commit and didn't find any new bugs. A human should still sign off, because this sets a requirement-ID convention for every draft and publishes a schema that now differs from upstream mpp-tools on purpose.

What was reviewed:

  • Both points from my earlier review are fixed. segments() now resets current after an IAL, and the new test_line_after_ial_is_a_new_block covers that case. Challenge and Credential now have additionalProperties: true, and schemas/README.md records why.
  • I checked the tempo-charge -01 IALs, including the indented ones on list items. Each one sits on the line right after its paragraph or item, and the numbers run 001 onward in order.
Extended reasoning...

The change adds a requirement-ID rule to STYLE.md and AGENTS.md, a new warn-only lint with pytest coverage, a Makefile lint step, and a 534-line JSON Schema under a paymentauth.org $id. It also renames and tags the Tempo charge draft as -01. It touches no auth, crypto or runtime code, only specs, docs and tooling. The follow-up commit fixes both of my earlier findings, and the Receipt status const change probably answers the other bot's inline comment on that line. I'm deferring rather than approving because the change is large and sets a repo-wide convention. The published schema also now intentionally differs from its upstream source, and maintainers should decide that.

@tempoxyz-bot

tempoxyz-bot commented Nov 9, 2026 •

Copy link
Copy Markdown

👁️ Cyclops Security Review

✅ Reviewed 6fbb58b · Coverage: partial · ⚠️ 93 open, 2 unverified findings · report
❌ Review of 9f1a418 did not finish · workflow
⚠️ Not checked: The kramdown 2.4.0 gem source (lib/kramdown/parser/kramdown/link.rb) is not installed in the sandbox, and no Python interpreter is available to run the lint on the trigger inputs.
⏳ 444 findings from an earlier commit waiting for a recheck at the latest commit

# Severity Finding Introduced Status
1 🟢 Low Protocol schema accepts header values the core draft forbids 7794d36 ✅ Fixed in 5cc64e9
2 🟢 Low Requirement lint skips table cells and misses an untagged memo MUST 7794d36 ✅ Fixed in 5cc64e9
3 🟢 Low Protocol schema accepts non-string Credential source values a8608cf ✅ Fixed in 5cc64e9
4 🟢 Low Protocol schema accepts method identifiers the core grammar forbids be8749b ✅ Fixed in 5cc64e9
5 🟢 Low Receipt schema accepts Receipts missing the required method field be8749b ✅ Fixed in 5cc64e9
6 🟢 Low Challenge schema accepts method and intent values the core draft forbids be8749b ✅ Fixed in 5cc64e9
7 🟢 Low Requirement lint skips normative table cells that start with REQUIRED 6325fcc ✅ Fixed in 5cc64e9
8 🟢 Low schemas/README omits five local divergences from the mpp-tools schema copy 6325fcc ✅ Fixed in 5cc64e9
9 🟢 Low HttpPaymentRequest payment.source still accepts objects and null 8a3a00b ✅ Fixed in dfce681
10 🟢 Low Requirement lint accepts list-item IDs not indented to the item text 6325fcc ✅ Fixed in 5c41399
11 🟢 Low Requirement lint accepts mis-indented list-item IDs that kramdown attaches to the list a8608cf ✅ Fixed in 5c41399
12 🟢 Low Requirement lint counts #req IDs that kramdown never renders as anchors 8a3a00b ✅ Fixed in 0a02265
13 🟢 Low Requirement lint accepts unindented IDs after loose-list continuation paragraphs 21fccd6 ✅ Fixed in dfce681
14 🟢 Low Requirement lint accepts column-0 IDs after nested-list outer continuations 5c41399 ✅ Fixed in dfce681
15 🟢 Low Requirement lint counts indented code blocks as tagged normative prose 5c41399 ✅ Fixed in 0a02265
16 🟢 Low Canonical schema URL is not deployed 5c41399 🟠 Open
17 🟢 Low Proof typed-data schema accepts EIP-712 domains the tempo draft forbids 8a3a00b ✅ Fixed in dfce681
18 🟢 Low Requirement lint skips prose after a fence containing the other delimiter 6325fcc ✅ Fixed in d9b47c6
19 🟢 Low STYLE.md requirement-ID rules disagree with lint_requirements.py strict checks 5cc64e9 ✅ Fixed in d9b47c6
20 🟢 Low Requirement lint lets one ID cover several definition-list definitions a8608cf ✅ Fixed in d9b47c6
21 🟢 Low Tempo proof typed-data schema accepts retired versions and Proof types without account 55bd68c ✅ Fixed in dfce681
22 🟢 Low Requirement lint accepts req IDs on non-normative prose in strict mode 5cc64e9 ✅ Fixed in d9b47c6
23 🟢 Low Requirement lint fence toggle skips requirements after a mixed-fence code block 55bd68c ✅ Fixed in d9b47c6
24 🟢 Low Requirement lint misses conditional table markers followed by '.' or ':' 5cc64e9 ✅ Fixed in 800753b
25 🟢 Low Requirement lint attaches IALs indented four or more columns, which kramdown renders as text dfce681 ✅ Fixed in 0a02265
26 🟢 Low Requirement IDs inside HTML comments pass strict lint dfce681 ✅ Fixed in 0a02265
27 🟢 Low An IAL outside a blockquote tags the wrong block dfce681 ✅ Fixed in c4a838b
28 🟢 Low Schema README omits in-PR divergences, so the documented mpp-tools re-sync reverts them be8749b ✅ Fixed in d08d1ea
29 🟢 Low Requirement lint treats over-indented ''' lines as fence openers d9b47c6 ✅ Fixed in 800753b
30 🟢 Low Initial Tempo requirement IDs are out of document order 55bd68c ✅ Fixed in 0a02265
31 🟢 Low Requirement lint ignores keywords in blockquoted table rows 55bd68c ✅ Fixed in 800753b
32 🟢 Low Requirement lint misses keywords after mixed fences or multi-backtick spans 5c41399 ✅ Fixed in c4a838b
33 🟡 Medium Requirement lint opens a phantom fence after a list ends d08d1ea ✅ Fixed in 800753b
34 🟢 Low Fence closes on a delimiter indented 4+ columns, then the real closer opens a phantom fence d08d1ea ✅ Fixed in 800753b
35 🟢 Low Tab-indented delimiters still hide visible requirements d08d1ea ✅ Fixed in 800753b
36 🟢 Low Blockquoted fenced code is parsed as tagged prose d08d1ea ✅ Fixed in 800753b
37 🟢 Low Requirement lint accepts column-0 ID that kramdown puts on the list 5c41399 ✅ Fixed in 800753b
38 🟢 Low Requirement lint stops treating ''' fences as code, so it hides or falsely tags requirements 800753b 🟠 Open
39 🟢 Low Boilerplate substring hides appended requirements 800753b ✅ Fixed in 0a02265
40 🟢 Low List-nested fence closers suppress later table checks 800753b ✅ Fixed in 0a02265
41 ⚪ Informational Large wrapped paragraphs make PR checks quadratic 7794d36 ✅ Fixed in 0a02265
42 🟢 Low Underscore emphasis bypasses strict requirement linting 7794d36 ✅ Fixed in 0a02265
43 🟢 Low Requirement lint misses misindented IDs after nested blockquotes 5c41399 ✅ Fixed in 0a02265
44 🟢 Low Boilerplate substring suppresses unrelated requirements d9b47c6 ✅ Fixed in 0a02265
45 🟢 Low Requirement lint credits IDs across kramdown paragraph-ending lines 21fccd6 🟠 Open
46 🟢 Low A ~~~ line inside a block HTML comment opens a fence that hides the rest of the draft 0a02265 ✅ Fixed in db18366
47 🟢 Low Requirement lint misses normative cells in tables without leading pipes 8a3a00b 🟠 Open
48 🟢 Low Leading table requirements bypass strict lint a8608cf ✅ Fixed in bdccd21
49 🟢 Low Pipe-less table rows bypass table requirement checks a8608cf 🟠 Open
50 ⚪ Needs review Requirement lint treats rest of draft as code after ~~~ inside HTML comment 0a02265 ✅ Fixed in db18366
51 🟢 Low Requirement lint misses keywords in tables without leading pipes 6325fcc 🟠 Open
52 🟢 Low Requirement lint treats unclosed or space-indented ~~~ as code, hiding requirements kramdown renders 800753b ✅ Fixed in 8a3e129
53 🟢 Low Unclosed quoted fence suppresses later requirement checks 800753b ✅ Fixed in 8a3e129
54 🟢 Low Challenge schema accepts extension members with uppercase names or non-string values 6325fcc ✅ Fixed in 4f7a29a
55 🟢 Low Unclosed <!-- hides the rest of the draft from requirement lint db18366 ✅ Fixed in 8a9b8e6
56 🟢 Low Text after --> on a comment's closing line is dropped from lint db18366 🟠 Open
57 🟢 Low A later shorthand ID overrides the validated requirement anchor db18366 ✅ Fixed in 982485e
58 🟢 Low HTML comment closing lines can hide visible requirements db18366 🟠 Open
59 🟢 Low Challenge schema accepts extra members the core draft forbids 8a3a00b ✅ Fixed in 4f7a29a
60 🟢 Low A quoted unclosed <!-- borrows a closer from outside its blockquote and hides the rules in between 24b5a03 🟠 Open
61 🟢 Low Requirement lint accepts non-ID hash attributes 6325fcc ✅ Fixed in 8a3e129
62 🟢 Low Quoted tables bypass requirement lint 6325fcc 🟠 Open
63 🟢 Low Inline heading anchors can duplicate requirement IDs 6325fcc 🟠 Open
64 🟢 Low An unclosed or blockquoted <!-- hides the rest of the draft from the requirement lint db18366 🟠 Open
65 🟢 Low Expanded IAL IDs can override checked requirement anchors db18366 ✅ Fixed in bdccd21
66 🟢 Low Requirement lint misreads tab-indented list continuations and list-item IDs 5c41399 ❔ Unverified
67 🟢 Low schemas/README omits local schema differences in ChallengeIdInput and HttpServerOffer 5cc64e9 ✅ Fixed in bdccd21
68 🟢 Low Requirement lint treats multi-line comment bodies as normative prose 5c41399 ✅ Fixed in bdccd21
69 🟢 Low Requirement lint skips hash-prefixed paragraph lines, so untagged rules pass strict 21fccd6 🟠 Open
70 🟢 Low A quoted or deep-indented {:/comment} ends an unquoted {::comment} in the lint but not in kramdown, hiding rendered requirements bdccd21 ✅ Fixed in 8a3e129
71 🟡 Medium List-scoped extension comments hide outer requirements bdccd21 ✅ Fixed in 8a3e129
72 🟢 Low Mixed fence delimiters disable strict scanning 21fccd6 ✅ Fixed in 8a3e129
73 🟡 Medium A fence starting on a list marker line can suppress a visible requirement 8a3e129 ✅ Fixed in c4a838b
74 🟢 Low Inline markup can conceal rendered requirement keywords 68b43d5 🟠 Open
75 🟢 Low A ~~~ opener whose closers are all shorter is read as prose and can hide a later rendered rule 68b43d5 ✅ Fixed in c4a838b
76 🟢 Low Fix keeps list_indent across a list-ending code fence, adding false errors 5c41399 ✅ Fixed in c4a838b
77 🟢 Low Indented table/comment in a list item resets list_indent, hiding misindented IDs 5c41399 ✅ Fixed in c2ec1c2
78 🟢 Low Non-comment extension line lets a ~~~ inside a paragraph hide a requirement a00c792 ✅ Fixed in c4a838b
79 ⚪ Needs review Named attribute lists bypass effective anchor validation a00c792 ✅ Fixed in c4a838b
80 🟢 Low Requirement lint accepts a blockquoted IAL as an unquoted paragraph's ID 5e04ba5 ✅ Fixed in c4a838b
81 🟢 Low Requirement lint hides keywords after unmatched longer backtick runs 5e04ba5 ✅ Fixed in c4a838b
82 🟢 Low An indented ALD line inside a paragraph is registered, crediting a requirement ID kramdown never renders c4a838b ✅ Fixed in c2ec1c2
83 🟢 Low An escaped backslash before a backtick run makes strip_code_spans hide a rendered keyword c4a838b ✅ Fixed in 982485e
84 🟢 Low Modified draft retains its existing revision c4a838b 🟠 Open
85 🟡 Medium Adjacent IALs can replace a validated requirement anchor c4a838b ✅ Fixed in 982485e
86 🟢 Low A requirement ID after a class-only IAL skips the misindent and quote-depth checks 982485e ✅ Fixed in c2ec1c2
87 🟢 Low Adjacent IAL handling crosses list-item boundaries 982485e ✅ Fixed in c2ec1c2
88 🟢 Low Protocol schema accepts opaque values the core draft forbids 5e04ba5 🟠 Open
89 🟢 Low Opaque schema pattern accepts empty and undecodable base64url values 5a773c4 ✅ Fixed in c2ec1c2
90 🟢 Low Opaque pattern accepts non-canonical base64url aliases c2ec1c2 ✅ Fixed in 1b05603
91 🟢 Low Requirement lint drops ALD-looking prose lines, hiding untagged normative text 5e04ba5 ✅ Fixed in 1b05603
92 🟢 Low Inline comments hide conditional table requirements 5a773c4 ✅ Fixed in 1b05603
93 🟢 Low Table lint now hides visible keywords inside escaped comment openers 1b05603 ✅ Fixed in b6a7559
94 ⚪ Informational Recursive ALD expansion can exhaust lint resources 1b05603 ✅ Fixed in b6a7559
95 🟢 Low Challenge schema accepts parameter names outside the auth-param token grammar 5e04ba5 ✅ Fixed in 4f7a29a
96 🟢 Low Comment stripping hides visible keywords when <!-- sits inside a literal span such as $$math$$ b6a7559 ✅ Fixed in 48c77e5
97 🟢 Low Shared ALD memo hides IDs after cyclic references b6a7559 ✅ Fixed in 3d55b24
98 🟢 Low Requirement lint drops unclosed HTML-comment opener line, hiding its keyword 5e04ba5 ✅ Fixed in 6fbb58b
99 🟢 Low Requirement lint hides keywords when a code span crosses inline math 3d55b24 ✅ Fixed in 48c77e5
100 🟢 Low Math stripping pairs escaped or commented $$, hiding visible requirement keywords 3d55b24 ✅ Fixed in 48c77e5
101 🟡 Medium strip_literal_spans rescans the rest of the text per code span, making lint quadratic 48c77e5 ✅ Fixed in 6fbb58b
102 🟢 Low Requirement lint pairs $$ in link destinations and hides visible keywords 48c77e5 🟠 Open
103 🟢 Low Schema cannot require RFC3339 timestamps 3d55b24 🟠 Open
104 🟢 Low Requirement lint treats indented <!-- as a block comment, hiding requirements 5e04ba5 ❔ Unverified
105 ⚪ Needs review Link destinations with ')' end early, so a later $$ or backtick hides visible keywords 6fbb58b 🟠 Open
106 🟢 Low Requirement lint parses {::nomarkdown} raw block bodies as Markdown 5e04ba5 🟠 Open
107 🟢 Low Challenge schema accepts CR/LF in realm, description and custom auth-params 5e04ba5 🟠 Open
108 🟢 Low Literal pipes let normative table cells bypass requirement lint 48c77e5 🟠 Open
109 🟢 Low Inline markup bypasses table-rule detection 5e04ba5 🟠 Open
110 🟢 Low IAL key="value" credited without kramdown's trailing lookahead 5e04ba5 🟠 Open
111 🟢 Low # and <!-- lines inside a paragraph are treated as block constructs 5e04ba5 🟠 Open
112 ⚪ Informational Deep ALD chains can terminate the requirement linter 5e04ba5 🟠 Open
113 🟢 Low Unicode \d and \w accept IDs kramdown never anchors 5e04ba5 🟠 Open
114 🟢 Low Table-condition allowlist misses normative rules 5e04ba5 🟠 Open
115 🟢 Low Setext headings pass as tagged requirement paragraphs 5e04ba5 🟠 Open
116 🟢 Low Setext headings are accepted as tagged requirements 5e04ba5 🟠 Open
117 🟢 Low Challenge schema accepts malformed request digests 5e04ba5 🟠 Open
118 🟢 Low Pseudo-list continuation receives a nonexistent requirement anchor 5e04ba5 🟠 Open
119 🟡 Medium Unicode whitespace and line breaks diverge from kramdown 5e04ba5 🟠 Open
120 🟢 Low Lazy line after indented code is credited as a tagged paragraph 5e04ba5 🟠 Open
121 ⚪ Informational INLINE_MARKUP makes the requirement check quadratic on unclosed markup 5e04ba5 🟠 Open
122 🟢 Low Protocol schema accepts CR/LF in Challenge expires parameter 23bba91 🟠 Open
123 🟢 Low Requirement lint splits lines on Unicode separators, unlike kramdown 37c979a 🟠 Open
124 ⚪ Informational Requirement lint rescans to end of draft for each unclosed fence 37c979a 🟠 Open
125 🟢 Low Requirement lint accepts Unicode-space and fullwidth-digit ID lines kramdown ignores 37c979a 🟠 Open
126 🟢 Low Requirement lint accepts misplaced IDs on same-line nested list items 37c979a 🟠 Open
127 🟢 Low Requirement lint skips paragraph text after HTML comments and on #/' lines 37c979a 🟠 Open
128 🟢 Low HttpServerOffer schema rejects valid Tempo and Stripe charge requests 37c979a 🟠 Open
129 🟢 Low Requirement lint accepts glued id="req-..." IAL that kramdown drops 37c979a 🟠 Open
130 ⚪ Informational Requirement lint goes quadratic on unclosed quoted HTML comment openers 37c979a 🟠 Open
131 🟢 Low Requirement lint ignores BCP 14 keywords inside nomarkdown blocks 37c979a 🟠 Open
132 ⚪ Informational Requirement lint regexes take quadratic time on unclosed inline openers 78d59b4 🟠 Open
133 🟢 Low Requirement lint misses keywords split by links with balanced URLs 78d59b4 🟠 Open
134 🟢 Low Requirement lint ignores IDs set by inline span IALs 78d59b4 🟠 Open
135 🟡 Medium Requirement lint lets an in-item , hiding requirements 78d59b4 🟠 Open
136 🟢 Low Requirement lint skips BCP 14 rules in nomarkdown bodies 78d59b4 🟠 Open
137 🟢 Low Requirement lint drops '#'-leading paragraph lines, hiding untagged keywords 78d59b4 🟠 Open
138 🟢 Low Requirement lint splits lines on Unicode separators kramdown keeps inline 78d59b4 🟠 Open
139 🟢 Low Requirement lint merges requirements across block IALs with escaped braces 78d59b4 🟠 Open
140 🟢 Low Requirement lint misreads spaced nested blockquotes and accepts misplaced IDs 78d59b4 🟠 Open
141 🟢 Low Protocol schema accepts non-RFC 3339 expires and timestamp values 78d59b4 🟠 Open
142 🟢 Low Protocol schema DateTime pattern accepts impossible calendar dates d1448be 🟠 Open
143 🟢 Low Requirement lint drops hash-prefixed paragraph lines, so --strict misses rules 72d6afa 🟠 Open
144 🟢 Low ContentDigest schema pattern accepts undecodable base64 byte sequences in Challenge digest cada165 🟠 Open
145 🟢 Low DateTime schema accepts second 60 outside the leap-second minute c6fd7bd 🟠 Open
146 🟢 Low Requirement lint annotations from untouched drafts fill GitHub's 10-warning cap c6fd7bd 🟠 Open
147 🟢 Low Requirement lint misses second ID when one comes from an ALD 1a3af1d 🟠 Open
148 🟢 Low Requirement lint annotations spent on unchanged drafts before drafts being tagged ae52321 🟠 Open
149 🟢 Low Requirement lint skips reused IDs that another block anchors 6e00660 🟠 Open
150 🟢 Low Requirement lint skips replaced IDs that also appear in code examples 47e2a72 🟠 Open
151 🟢 Low Schema DateTime pattern rejects offset leap seconds and accepts mid-month ones 4e61ceb 🟠 Open
152 🟢 Low DateTime schema accepts leap second on February 28 of leap years 7a1a5c6 🟠 Open
153 ⚪ Informational Requirement lint code-span regex takes cubic time on backtick runs 9c09607 🟠 Open
154 ⚪ Informational Requirement lint takes quadratic time on unclosed comment openers and brace runs 0cbfd7e 🟠 Open
155 ⚪ Informational Requirement lint dedupes problems by list scan, quadratic in problem count d17006b 🟠 Open
156 🟢 Low DateTime pattern accepts second 60 at any minute with nonzero offset a445afa 🟠 Open
157 🟡 Medium Requirement lint rebuilds brace table per ID mention, quadratic on one line 707ff9c 🟠 Open
158 ⚪ Informational Requirement lint keeps a per-character brace table for every req- line 8c0457f 🟠 Open
159 🟡 Medium MIXED_INDENT regex backtracks quadratically on long whitespace lines 773c20d 🟠 Open
160 ⚪ Informational Requirement lint rescans a whole line for every repeated ID mention 773c20d 🟠 Open
161 🟡 Medium Requirement lint rescans a whole line per distinct ID, so cost is quadratic 99bd80b 🟠 Open
162 🟡 Medium Requirement lint's 64-entry line cache thrashes, making the lint quadratic 6f82d27 🟠 Open
163 🟢 Low Requirement lint misses requirement IDs on inline spans in headings 9f1a418 🟠 Open
164 ⚪ Informational Requirement lint takes quadratic time when many blocks share one ID 9f1a418 🟠 Open
165 🟢 Low Requirement lint misses table conditions that start with unlisted words 9f1a418 🟠 Open
166 🟢 Low Requirement lint maps rules onto HTML comment text, hiding leading IALs 9f1a418 🟠 Open
167 ⚪ Informational Requirement lint rebuilds an ALD's referencing blocks for every ID on it 9f1a418 🟠 Open
168 ⚪ Informational Requirement lint's quiet_at rescans the whole line per ID, quadratic time 9f1a418 🟠 Open
169 🟢 Low lint_requirements --strict fails on tab indentation that STYLE.md doesn't list 9f1a418 🟠 Open
170 🟢 Low HttpServerInfo url pattern accepts port 0 and ports above 65535 9f1a418 🟠 Open
171 🟢 Low HeaderOutput schema accepts header values with CR, LF and control characters 9f1a418 🟠 Open
172 🟢 Low Schema README says 'HTA'' instead of 'HTAB' 9f1a418 🟠 Open
173 🟢 Low Table-cell lint reports a presence marker followed by a description starting with 'On-' (or 'For', 'Only', ...) as a conditional rule 9f1a418 🟠 Open
174 🟢 Low DateTime rejects valid offset leap seconds 9f1a418 🟠 Open
175 🟡 Medium Requirement lint misreads a {{req-...}} cross-reference as a second or detached requirement ID 9f1a418 🟠 Open
176 🟢 Low Challenge schema accepts strings that cannot be UTF-8 9f1a418 🟠 Open
177 ⚪ Informational Blocking test times kramdown-rfc subprocess render against a 2 s wall-clock bound 9f1a418 🟠 Open
178 🟢 Low Chained ALDs bypass detached-ID checks 9f1a418 🟠 Open
179 🟢 Low Table-cell keyword check flags quoted keyword names that the paragraph check ignores 9f1a418 🟠 Open

Comment thread schemas/protocol.schema.json Resolved
Comment thread scripts/lint_requirements.py Resolved

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

My two earlier points are fixed in the latest commits and I didn't find any new bugs. This PR publishes a new schema and bumps the Tempo charge draft to -01, so a human should still look at it.

  • segments() now sets current = None after an IAL, so text right after a tagged block becomes its own segment.
  • Challenge and Credential now allow extra members, and schemas/README.md lists both differences from mpp-tools.
  • In the draft, the tags and the table-cell memo rule moving to prose as req-tempo-charge-044 only add IAL lines; the normative wording is unchanged.
  • I didn't run the lint or the tests; this was a read-only review.
Extended reasoning...

The change adds a requirement-ID convention (STYLE.md, AGENTS.md) and a Python lint with tests wired into make lint. It also adds a 534-line JSON Schema published under a paymentauth.org $id and renames the Tempo charge draft to version -01 with requirement tags. None of it touches auth, crypto or other security-sensitive runtime code; it is spec tooling and documentation. I deferred because of the size, the new public schema, and the draft version bump, which spec maintainers should decide on. Other bots' inline comments on the schema and the lint were posted before the last commit, and I couldn't confirm independently that they were addressed.

Comment thread schemas/protocol.schema.json Resolved

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code review completed

Nothing new to post: everything this review found is already covered by existing comments on this pull request or didn't merit a separate one.

Comment thread schemas/protocol.schema.json Resolved
Comment thread schemas/protocol.schema.json Resolved
Comment thread schemas/protocol.schema.json Resolved

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code review found no issues

No high-confidence issues detected in this change.

This review covers commit 55bd68c, which is no longer the latest commit on this pull request; later commits are not covered by it.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No new blocking issues. 1 optional suggestion (a nit or a note on pre-existing code) was found and not posted. Nothing in this review needs a push before merging.

Comment thread scripts/lint_requirements.py Resolved
Comment thread schemas/README.md Resolved

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code review found no issues

No high-confidence issues detected in this change.

Comment thread schemas/protocol.schema.json Resolved
Comment thread scripts/lint_requirements.py Resolved

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code review found no issues

No high-confidence issues detected in this change.

Comment thread scripts/lint_requirements.py Outdated
# A line holding only an IAL, which applies to the block above it.
IAL_LINE = re.compile(r"^\s*\{:[^}]*\}\s*$")
# A tab after a space in a line's indentation (see lint_file).
MIXED_INDENT = re.compile(r"^[ \t]*(?:> ?)*[ \t]* \t")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Medium: MIXED_INDENT regex backtracks quadratically on long whitespace lines

MIXED_INDENT in scripts/lint_requirements.py puts two [ \t]* quantifiers around a group that matches nothing on whitespace.

Full finding

MIXED_INDENT in scripts/lint_requirements.py puts two [ \t]* quantifiers around a group that matches nothing on whitespace. On a run of spaces or tabs with no space followed by a tab, Python's re tries every split of the run before it fails. lint_file applies the regex to every body line with no length limit, so one long whitespace line makes each lint run quadratic.

Valid? React with 👍 / 👎.

id_lines: dict[str, list[int]] = defaultdict(list)
for number in range(start, len(lines) + 1):
for found_id in SOURCE_ID.findall(lines[number - 1]):
id_lines[found_id].append(number)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Informational: Requirement lint rescans a whole line for every repeated ID mention

lint_file calls in_braces once for every mention of a requirement ID on a line, and each call rescans all of that line's mentions from the start. A line with N mentions of one ID, none inside braces, therefore costs N squared substring searches. This defeats the near-linear design the in_braces docstring claims.

Valid? React with 👍 / 👎.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code review found no issues

No high-confidence issues detected in this change.

Comment on lines +591 to +607
def in_braces(line: str, text: str) -> bool:
"""Whether text occurs after a { with no } in between, as an IAL or ALD writes it.

Each mention looks up the last { and } before it by binary search, so a run of
unclosed braces or many ID mentions on one line stays near linear.
"""
if "{" not in line:
return False
opens, closes = brace_positions(line)
pos = 0
while (found := line.find(text, pos)) >= 0:
opened = bisect.bisect_left(opens, found)
closed = bisect.bisect_left(closes, found)
if opened and (not closed or opens[opened - 1] > closes[closed - 1]):
return True
pos = found + 1
return False

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Medium (trigger unconfirmed): Requirement lint rescans a whole line per distinct ID, so cost is…

lint_file calls in_braces once for each distinct req- ID on a source line, and in_braces scans the whole line with str.find each time. A line of length L with K distinct IDs therefore costs O(K*L), quadratic in the line length, although the in_braces docstring promises near-linear behaviour.

Full finding

Requirement lint rescans a whole line per distinct ID, so cost is quadratic

lint_file calls in_braces once for each distinct req- ID on a source line, and in_braces scans the whole line with str.find each time. A line of length L with K distinct IDs therefore costs O(K*L), quadratic in the line length, although the in_braces docstring promises near-linear behaviour.

Valid? React with 👍 / 👎.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No new blocking issues. 3 optional suggestions (nits or notes on pre-existing code) were found and not posted. Nothing in this review needs a push before merging.

Comment thread scripts/lint_requirements.py Outdated
Comment on lines +638 to +665
@functools.lru_cache(maxsize=64)
def brace_positions(line: str) -> tuple[tuple[int, ...], tuple[int, ...]]:
"""The positions of every { and every } in a line, in order.

Cached, so a line with many ID mentions is scanned once rather than once per mention.
Only brace positions are kept, so memory grows with the braces, not the line length.
"""
opens = tuple(i for i, char in enumerate(line) if char == "{")
closes = tuple(i for i, char in enumerate(line) if char == "}")
return opens, closes


@functools.lru_cache(maxsize=64)
def braced_ids(line: str) -> frozenset[str]:
"""The requirement IDs written somewhere in a line after a { with no } in between.

One pass over the line's IDs, cached, so checking every distinct ID on a long line
costs one scan of it rather than one per ID.
"""
opens, closes = brace_positions(line)
found: set[str] = set()
for match in SOURCE_ID.finditer(line):
at = match.start()
opened = bisect.bisect_left(opens, at)
closed = bisect.bisect_left(closes, at)
if opened and (not closed or opens[opened - 1] > closes[closed - 1]):
found.add(match.group(1))
return frozenset(found)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Medium: Requirement lint's 64-entry line cache thrashes, making the lint quadratic

lint_requirements.py caches braced_ids and brace_positions in 64-entry LRU caches keyed by the line text, but lint_file visits lines ID by ID. When more than 64 distinct lines share the same braced IDs, every lookup misses and rescans the whole line. The lint then costs O(L·K²) instead of the linear time the docstring promises.

Valid? React with 👍 / 👎.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code review found no issues

No high-confidence issues detected in this change.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No new blocking issues. 1 optional suggestion (a nit or a note on pre-existing code) was found and not posted. Nothing in this review needs a push before merging.

Comment on lines +315 to +320
if tag == "section":
for child in el:
if child.tag == "name":
items.append(Item("heading", words("".join(child.itertext())), anchor=anchor))
else:
walk(child, items)

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: Requirement lint misses requirement IDs on inline spans in headings

lint_requirements.py never inspects anchors nested inside a section's name element. A span IAL in a heading, such as *control*{: #req-tempo-charge-999}, therefore produces no item and is skipped as an already-anchored ID. If every real requirement is tagged, --strict reports nothing, unlike the same span IAL in a paragraph or table cell.

Valid? React with 👍 / 👎.

Comment on lines +803 to +818
found = [
n
for n in id_lines.get(req_id, [])
if n not in code_lines and in_braces(loud[n - 1], req_id)
]
if not found or any(n >= item.start for n in found):
return None
before = [n for n in found if not ALD_LINE.match(lines[n - 1])]
if before:
return before[-1]
# Only in ALDs: the IALs that reference them place the ID, so check those instead.
names = {ALD_NAME.match(lines[n - 1]).group(1) for n in found}
refs = sorted(n for name in names for n in ald_refs.get(name, []))
if not refs or any(n >= item.start for n in refs):
return None
return refs[-1]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Informational: Requirement lint takes quadratic time when many blocks share one ID

lint_file's written_before helper rebuilds a filtered list over every source line naming a block's requirement ID, calling in_braces on each, once per anchored block. N blocks anchored by the same ID cost N^2 in_braces calls, and replaced_ids repeats the pattern. At N=8000 this measured 74x the cost of a same-size draft with distinct IDs.

Valid? React with 👍 / 👎.

Comment on lines +68 to +70
CONDITION = re.compile(
r"^\W*(?:if|when|whenever|unless|for|only|except|where|while|after|before|once|until|during|provided|otherwise|on|upon)\b",
re.IGNORECASE,

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: Requirement lint misses table conditions that start with unlisted words

In lint_file, a table cell whose presence marker ends in a colon or period is flagged only when the next word is on the CONDITION list. Cells such as REQUIRED: in pull mode or OPTIONAL. Under version 2 the field holds a hash state a condition but pass the lint, even with --strict.

Valid? React with 👍 / 👎.

Comment on lines +373 to +378
for number, line in enumerate(lines, start=1):
self.first.append(len(self.words))
for word in WORD.findall(line):
self.positions[word].append(len(self.words))
self.words.append(word)
self.line_of.append(number)

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: Requirement lint maps rules onto HTML comment text, hiding leading IALs

SourceMap indexes every word in the Markdown source, including HTML comments that kramdown-rfc never renders. When a block comment before a rule repeats the rule's opening words, the rule maps to the comment's line. A requirement ID written before the rule then looks like it follows it, and strict mode reports nothing.

Valid? React with 👍 / 👎.

Comment on lines +899 to +914
ald = ALD_NAME.match(line)
if ald:
# An ALD only defines attributes; it tags a block when an IAL names it. If
# some IAL names it and its ID still isn't an anchor, the block also set an
# ID of its own, and kramdown kept only that one. Unused ALDs stay quiet, and
# so does one whose ID anchors every block whose IAL names it: where the ALD
# is defined says nothing about which block uses it.
users = [bisect.bisect_left(starts, n) - 1 for n in ald_refs.get(ald.group(1), [])]
if users and all(u >= 0 and texts[u].anchor == req_id for u in users):
continue
if ald.group(1) in ald_uses:
report.error(
number,
f"{req_id} in ALD {ald.group(1)} is replaced by another ID on the block that uses it",
)
continue

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Informational: Requirement lint rebuilds an ALD's referencing blocks for every ID on it

In lint_file's ALD branch, the requirement lint rebuilds the list of blocks that reference an ALD once for each requirement ID on that ALD line, although the list depends only on the ALD name. An ALD with K IDs referenced by R IALs costs K×R bisects. That is 7x to 18x slower than computing the list once per name.

Valid? React with 👍 / 👎.

Comment on lines +789 to +791
def quiet_at(req_id: str, number: int) -> bool:
"""Whether this occurrence of a quiet ID is in code or a comment, not an IAL."""
return number in code_lines or req_id not in loud[number - 1]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Informational: Requirement lint's quiet_at rescans the whole line per ID, quadratic time

lint_file calls quiet_at once for every distinct quiet requirement ID on a source line, and quiet_at substring-scans the whole blanked line each time. One line holding K IDs inside an HTML comment therefore costs O(K*L) work. The PR removed this pattern from in_braces through braced_ids but left it in quiet_at.

Valid? React with 👍 / 👎.

Comment on lines +937 to +942
for number, raw in enumerate(lines, start=1):
if number >= start and mixed_indent(raw):
# kramdown-rfc expands tabs before kramdown reads the draft and warns that
# "undefined behavior will ensue": a tab after spaces lands on a column the
# author rarely meant, even in a code block.
report.error(number, "tab after a space in the indentation; indent with spaces")

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: lint_requirements --strict fails on tab indentation that STYLE.md doesn't list

With --strict, lint_requirements.py exits 1 when a body line, including one in a code block, has a tab after a space in its indentation. STYLE.md's list of strict failures and the module docstring both leave this check out. The failure summary calls it a requirement ID problem and points to a STYLE.md section that doesn't describe it.

Valid? React with 👍 / 👎.

"required": ["url"],
"additionalProperties": false,
"properties": {
"url": { "type": "string", "pattern": "^http://127\\.0\\.0\\.1:[0-9]+$", "not": { "pattern": "[\r\n\u0085\u2028\u2029]" } }

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 (exposure unconfirmed): HttpServerInfo url pattern accepts port 0 and ports above 65535

The HttpServerInfo schema checks the url's port only with [0-9]+. It accepts http://127.0.0.1:0, http://127.0.0.1:65536 and longer digit strings, none of which a client can connect to.

Valid? React with 👍 / 👎.

Comment on lines +136 to +142
"HeaderOutput": {
"type": "object",
"required": ["header"],
"additionalProperties": false,
"properties": {
"header": { "type": "string" }
}

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 (exposure unconfirmed): HeaderOutput schema accepts header values with CR, LF and control characters

$defs.HeaderOutput in the new protocol schema types the formatter's header result as any string. The schema therefore accepts Challenge, Credential and Receipt header values that the core draft's ABNF forbids, including values with CRLF or control characters. The FieldValue definition the same file adds to block CR and LF is not applied to it.

Valid? React with 👍 / 👎.

@tempoxyz-bot tempoxyz-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👁️ Cyclops Review — 8 findings.

  • **Low (trigger unconfirmed) · unverified:** Schema README says 'HTA\`' instead of 'HTAB'
  • **Low (trigger unconfirmed) · unverified:** Table-cell lint reports a presence marker followed by a description starting with…
  • **Low (trigger unconfirmed) · unverified:** DateTime rejects valid offset leap seconds
  • **Medium (trigger unconfirmed) · unverified:** Requirement lint misreads a {{req-...}} cross-reference as a second or detached requirement…
  • **Low (trigger unconfirmed) · unverified:** Challenge schema accepts strings that cannot be UTF-8
  • **Informational · unverified:** Blocking test times kramdown-rfc subprocess render against a 2 s wall-clock bound
  • **Low (trigger unconfirmed) · unverified:** Chained ALDs bypass detached-ID checks
  • **Low (trigger unconfirmed) · unverified:** Table-cell keyword check flags quoted keyword names that the paragraph check ignores

Comment thread schemas/README.md
`^[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 👍 / 👎.

Comment on lines +68 to +71
CONDITION = re.compile(
r"^\W*(?:if|when|whenever|unless|for|only|except|where|while|after|before|once|until|during|provided|otherwise|on|upon)\b",
re.IGNORECASE,
)

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: Table-cell lint reports a presence marker followed by a description starting with…

What the code owes: STYLE.md lets a table cell use a bare REQUIRED/OPTIONAL/RECOMMENDED that ends its clause, followed by a description ('OPTIONAL. Defaults to 0', 'OPTIONAL: Units consumed', which the lint's own test treats as fine, E5). Only a marker that opens a condition ('REQUIRED: if ...') should be reported.

Full finding

Table-cell lint reports a presence marker followed by a description starting with 'On-' (or 'For', 'Only', ...) as a conditional rule

What the code owes: STYLE.md lets a table cell use a bare REQUIRED/OPTIONAL/RECOMMENDED that ends its clause, followed by a description ('OPTIONAL. Defaults to 0', 'OPTIONAL: Units consumed', which the lint's own test treats as fine, E5). Only a marker that opens a condition ('REQUIRED: if ...') should be reported. How it breaks: lint_requirements.py removes the marker with PRESENCE_MARKER and tests what is left against CONDITION. CONDITION is ^\W*(?:if|when|whenever|unless|for|only|except|where|while|after|before|once|until|during|provided|otherwise|on|upon)\b compiled with re.IGNORECASE. The final \b also matches before a hyphen, and IGNORECASE matches capitalized words that start a new description. The HEAD commit added on/upon. Concrete trigger in the repo: specs/methods/tempo/draft-tempo-session-00.md:1566 has the cell 'OPTIONAL: On-chain transaction hash (present on settlement/close)'. After the marker is removed, ' On-chain ...' matches on\b, so the check at E2 reports 'keyword in a table cell; state the rule in a tagged paragraph'. The cell right above it, 'OPTIONAL: Units consumed ...', has the same structure and passes. The same false positive hits any description starting with For/Only/Once/Where/After/Before/During/Until/While/Otherwise. Impact: make lint and the new CI step print, and annotate, a spurious problem for tempo-session today. Once that draft is tagged and checked with --strict, the lint fails on text the convention allows, forcing authors to reword legitimate cells and making the lint look unreliable. Tests only use lowercase condition words followed by a space, so nothing catches this. Not shown: the rendered output was not run here (no kramdown-rfc in the sandbox). The conclusion assumes kramdown-rfc keeps the cell text 'OPTIONAL: On-chain ...' as written, which holds for plain text with a single hyphen. Fix: only accept a condition word followed by whitespace (replace the final \b with (?=\s)). Better, also match condition words case-sensitively in lowercase, since a condition continues the marker's clause ('REQUIRED: if ...') while a capitalized word starts a description. Add regression tests for 'OPTIONAL: On-chain transaction hash' and 'OPTIONAL. For display only'.

Valid? React with 👍 / 👎.

"description": "RFC 3339 date-time, as the core draft requires for Challenge expires and Receipt timestamp. format: date-time is an annotation by default in JSON Schema 2020-12, so the pattern enforces it in every validator (RE2-compatible; T and Z are case-insensitive per RFC 3339 section 5.6). The date branch checks each month's length and allows February 29 only in Gregorian leap years (RFC 3339 section 5.7). Second 60 (a leap second) falls at 23:59:60 UTC on the last day of a month (February 28 only outside leap years) (RFC 3339 section 5.7): with offset Z or +00:00/-00:00 the pattern accepts exactly that. With any other offset the pattern rejects second 60: a pattern cannot tie the local time to its offset, and MPP implementations write timestamps in UTC.",
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:[0-9]{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12][0-9]|3[01])|(?:0[469]|11)-(?:0[1-9]|[12][0-9]|30)|02-(?:0[1-9]|1[0-9]|2[0-8]))|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:[02468][048]|[13579][26])00)-02-29)[Tt](?:[01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](?:\\.[0-9]+)?(?:[Zz]|[+-](?:[01][0-9]|2[0-3]):[0-5][0-9])|(?:(?:[0-9]{4}-(?:(?:0[13578]|1[02])-31|(?:0[469]|11)-30)|(?:[0-9]{2}(?:[02468][1235679]|[13579][01345789])|(?:[02468][1235679]|[13579][01345789])00)-02-28)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:[02468][048]|[13579][26])00)-02-29)[Tt]23:59:60(?:\\.[0-9]+)?(?:[Zz]|[+-]00:00))$", "not": { "pattern": "[\r\n\u0085\u2028\u2029]" }

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: DateTime rejects valid offset leap seconds

The DateTime regex only accepts second 60 at local 23:59:60 with a zero offset, although the drafts permit generic RFC3339 expires and timestamps. A valid representation such as 2016-12-31T18:59:60-05:00 is rejected, breaking valid Challenge or Receipt interoperability. Broaden leap-second handling for offset-adjusted local times or make UTC a normative protocol requirement.

Valid? React with 👍 / 👎.

Comment on lines +652 to +689
@functools.lru_cache(maxsize=None)
def braced_ids(line: str) -> frozenset[str]:
"""The requirement IDs written somewhere in a line after a { with no } in between.

One pass over the line's IDs, cached, so checking every distinct ID on a long line
costs one scan of it rather than one per ID.
"""
opens, closes = brace_positions(line)
found: set[str] = set()
for match in SOURCE_ID.finditer(line):
at = match.start()
opened = bisect.bisect_left(opens, at)
closed = bisect.bisect_left(closes, at)
if opened and (not closed or opens[opened - 1] > closes[closed - 1]):
found.add(match.group(1))
return frozenset(found)


def in_braces(line: str, text: str) -> bool:
"""Whether text occurs after a { with no } in between, as an IAL or ALD writes it.

A requirement ID is looked up in braced_ids, so the whole ID must match, not a prefix
of a longer one. Other text is found mention by mention, each looking up the last {
and } before it by binary search, so a run of unclosed braces stays near linear.
"""
if "{" not in line:
return False
if SOURCE_ID.fullmatch(text):
return text in braced_ids(line)
opens, closes = brace_positions(line)
pos = 0
while (found := line.find(text, pos)) >= 0:
opened = bisect.bisect_left(opens, found)
closed = bisect.bisect_left(closes, found)
if opened and (not closed or opens[opened - 1] > closes[closed - 1]):
return True
pos = found + 1
return False

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Medium (trigger unconfirmed) · unverified: Requirement lint misreads a {{req-...}} cross-reference as a second or detached requirement…

What goes wrong: in_braces/braced_ids (scripts/lint_requirements.py:652-689) count a requirement ID as written in an IAL or ALD whenever any '{' precedes it with no '}' in between. kramdown-rfc's cross-reference syntax '{{req-tempo-charge-010}}' meets that test, although it renders as <xref target=...> and sets no anchor. flatten (216-237) adds nothing for the xref, so only the source-line scan sees it.

Full finding

Requirement lint misreads a {{req-...}} cross-reference as a second or detached requirement ID

What goes wrong: in_braces/braced_ids (scripts/lint_requirements.py:652-689) count a requirement ID as written in an IAL or ALD whenever any '{' precedes it with no '}' in between. kramdown-rfc's cross-reference syntax '{{req-tempo-charge-010}}' meets that test, although it renders as <xref target=...> and sets no anchor. flatten (216-237) adds nothing for the xref, so only the source-line scan sees it.

In the occurrence loop (883-935), an anchored ID's occurrence is skipped only when the block starting before that line has the same anchor. An xref on a non-first line of another tagged paragraph therefore falls through. It passes in_braces and KRAMDOWN_ID, and is not reported as rendered text because it is an anchor. It is then appended to lost[owner] for the enclosing paragraph. The final loop (978-1016) merges it with that paragraph's own ID and reports two errors: 'more than one requirement ID (req-...-010, req-...-042)' and 'duplicate ID req-...-010 (first on line N)'. An xref on the first line of a paragraph whose predecessor has a different anchor gets the else branch instead: '... is not directly after a paragraph or list item'.

Concrete trigger: change 'See {{split-payments}} for rationale.' in the tagged req-tempo-charge-042 paragraph (draft-tempo-charge-00.md:797-799) to 'See {{req-tempo-charge-010}} for rationale.'. This is valid kramdown-rfc that xml2rfc resolves, and the draft already uses '{{anchor}}' xrefs throughout. The lint then emits both spurious errors above.

Impact: test_lint_requirements.py:362-365 runs --strict on tempo-charge, and the 'Test scripts' step (pr-check.yml:85-86) has no continue-on-error. A correct edit that cites a requirement by its new anchor therefore fails the PR check, and the warn-mode lint gives misleading annotations on every other draft. This is a CI gate false positive (integrity and availability of the merge gate). There is no confidentiality or privilege impact.

Preconditions: an author xrefs a requirement anchor, which STYLE.md (55-58) presents as a citable ID and does not forbid. The repository does not do this today.

Missing evidence: this was not executed, because kramdown-rfc and python3 are not installed in this environment. The trace assumes kramdown-rfc renders '{{id}}' as an empty <xref target="id"/> and the paragraph IAL as anchor="id".

Fix: drop '{{...}}' xref occurrences before the ID scans. For example, blank '{{...}}' spans in the 'loud' text and test in_braces against loud. Or require the brace that opens an ID occurrence to be an IAL or ALD opener ('{:' not followed by ':', or a header '{#'). Add a test with '{{req-x-001}}' in a later tagged paragraph, on both its first and a later line.

Valid? React with 👍 / 👎.

Comment on lines +79 to +80
"pattern": "^[^\u0000-\u0008\u000A-\u001F\u007F]*$", "not": { "pattern": "[\r\n]" }
},

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: Challenge schema accepts strings that cannot be UTF-8

ParamValue omits the UTF-16 surrogate range from its exclusions. A decoded credential can therefore contain an escaped lone surrogate such as \uD800 in challenge.realm and still validate, despite the protocol's RFC 3629 requirement. Realm participates in Challenge binding, so conforming implementations may reject, replace, or differently encode the same accepted value, producing interoperability failures or input-triggered exceptions.

Full finding

ParamValue omits the UTF-16 surrogate range from its exclusions. A decoded credential can therefore contain an escaped lone surrogate such as \uD800 in challenge.realm and still validate, despite the protocol's RFC 3629 requirement. Realm participates in Challenge binding, so conforming implementations may reject, replace, or differently encode the same accepted value, producing interoperability failures or input-triggered exceptions. Reject U+D800 through U+DFFF and apply a shared Unicode-scalar constraint to protocol strings.

Valid? React with 👍 / 👎.

Comment on lines +340 to +345
def test_long_paragraph_is_linear(self, tmp_path):
import time
spec = write_spec(tmp_path, "Clients MUST x\n" + "word " * 20 + "\n" * 0 + ("more text\n" * 40000))
start = time.perf_counter()
lint_file(spec)
assert time.perf_counter() - start < 2

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Informational · unverified: Blocking test times kramdown-rfc subprocess render against a 2 s wall-clock bound

Mechanism: test_long_paragraph_is_linear (scripts/test_lint_requirements.py:340-345) is meant to show that the Python scanning is linear. It wraps the whole lint_file(spec) call in perf_counter and asserts it finishes in under 2 s. lint_file calls render() first (scripts/lint_requirements.py:721-737), and render() runs kramdown-rfc with subprocess.run (lines 158-195).

Full finding

Mechanism: test_long_paragraph_is_linear (scripts/test_lint_requirements.py:340-345) is meant to show that the Python scanning is linear. It wraps the whole lint_file(spec) call in perf_counter and asserts it finishes in under 2 s. lint_file calls render() first (scripts/lint_requirements.py:721-737), and render() runs kramdown-rfc with subprocess.run (lines 158-195). So the timed region includes Ruby interpreter startup, loading the kramdown-rfc gems, parsing and converting a 40,001-line (~400 KB) paragraph to XML, ElementTree parsing, and then the Python work. Trigger: any CI run where the GitHub-hosted runner is slow or loaded, or a slower Ruby/kramdown-rfc build in the Docker image. Impact: the test runs in the 'Test scripts' pytest step, which has no continue-on-error (.github/workflows/pr-check.yml:85-86). A timing overrun fails build-and-check and the CI gate on PRs that don't touch the lint, and the test still doesn't isolate the linearity it claims to check. Other render-including timing tests use 10-20 s bounds (lines 800-807, 843-853), which makes the 2 s bound the outlier. Missing evidence: actual timings of this test on GitHub-hosted runners. This sandbox has no Ruby, kramdown-rfc or Python, so neither the flake rate nor the current margin could be measured. Remediation options: (a) render once outside the timer and time only the post-render Python steps (for example monkeypatch lint_requirements.render to return pre-rendered XML, or time extract() plus the SourceMap and lint passes); (b) assert a growth ratio between two input sizes instead of an absolute bound; or (c) give the render-including bound the same generous margin as the other render tests.

Valid? React with 👍 / 👎.

Comment on lines +815 to +817
refs = sorted(n for name in names for n in ald_refs.get(name, []))
if not refs or any(n >= item.start for n in refs):
return None

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: Chained ALDs bypass detached-ID checks

ALD chaining is supported, but ald_refs records only direct non-ALD IAL references (E5/E6/E8). A draft can define ALD a with #req-..., define ALD b referencing a, then place {: b} before a normative paragraph. Kramdown anchors the paragraph, but written_before finds no direct reference to a, returns None, and strict mode counts it as correctly tagged (E7/E9/E10).

Full finding

ALD chaining is supported, but ald_refs records only direct non-ALD IAL references (E5/E6/E8). A draft can define ALD a with #req-..., define ALD b referencing a, then place {: b} before a normative paragraph. Kramdown anchors the paragraph, but written_before finds no direct reference to a, returns None, and strict mode counts it as correctly tagged (E7/E9/E10). This defeats the direct-after invariant and makes source associations consumed by tests and gap reports fragile. Compute transitive ALD-to-IAL reachability and test an indirect pre-block reference.

Valid? React with 👍 / 👎.

Comment on lines +969 to +976
for item in items:
if item.kind != "row":
continue
for cell in item.cells:
text = PRESENCE_MARKER.sub("", cell)
if KEYWORD.search(text) or (text != cell and CONDITION.match(text)):
report.error(item.start, "keyword in a table cell; state the rule in a tagged paragraph")
break

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: Table-cell keyword check flags quoted keyword names that the paragraph check ignores

Mechanism: the lint's own rule (scripts/lint_requirements.py:54-61) is that a keyword in double quotes is named, not used. Item.is_requirement applies that rule by running QUOTED_KEYWORDS.sub before KEYWORD.search (lines 136-138). The table-cell loop (lines 969-976) never applies QUOTED_KEYWORDS.

Full finding

Mechanism: the lint's own rule (scripts/lint_requirements.py:54-61) is that a keyword in double quotes is named, not used. Item.is_requirement applies that rule by running QUOTED_KEYWORDS.sub before KEYWORD.search (lines 136-138). The table-cell loop (lines 969-976) never applies QUOTED_KEYWORDS. It strips a leading presence marker with PRESENCE_MARKER, then runs KEYWORD.search on the raw cell text. table_rows/flatten (lines 278-298) keep the quote characters, so a cell that only names a keyword is reported as 'keyword in a table cell; state the rule in a tagged paragraph'. That counts as a problem, and --strict exits 1 (lines 1096-1104).

Trigger: a Markdown table cell such as | level | "MUST" | Absolute requirement |, or a description cell like Set to "OPTIONAL" when .... A quoted marker in the Required column, "OPTIONAL", also misses PRESENCE_MARKER because that pattern is anchored at ^, so it is flagged too.

Impact: strict mode fails, and CI shows a spurious annotation, for a table that names a keyword without using it. The advice also contradicts itself. If the author follows it and moves the text into a paragraph, that paragraph is not a requirement, because is_requirement strips the quoted name. Adding an ID then triggers '<id> is on text with no BCP 14 keyword; drop the ID or restore the keyword' (lines 995-999, STYLE.md:76-77). Rewording to drop the quotes is the only way to pass.

Preconditions and missing evidence: no draft at this revision has a table cell that quotes a keyword (tempo-charge's cells are bare markers, lines 155-172), so nothing in CI is affected today. The failure applies to drafts tagged later and checked with --strict. kramdown-rfc was not available here, so the rendered cell text was not confirmed at runtime. Whether kramdown renders straight quotes or curly quotes, the quote characters are non-alphanumeric, so KEYWORD still matches.

Remediation: in the table loop, compute unquoted = QUOTED_KEYWORDS.sub("", cell), then text = PRESENCE_MARKER.sub("", unquoted). Use text != unquoted in the CONDITION guard. Add a test that a quoted keyword in a cell is not reported.

Valid? React with 👍 / 👎.

@brendanjryan brendanjryan changed the title feat: add requirement IDs, schemas and a requirement lint feat: add the requirement-ID convention, lint and schemas Nov 13, 2026

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code review found no issues

No high-confidence issues detected in this change.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code review completed

Nothing new to post: everything this review found is already covered by existing comments on this pull request or didn't merit a separate one.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants