Skip to content

docs: gardening Apr 2026 - #40

Merged
cardotrejos merged 2 commits into
mainfrom
docs/gardening-apr-2026
Apr 6, 2026
Merged

docs: gardening Apr 2026#40
cardotrejos merged 2 commits into
mainfrom
docs/gardening-apr-2026

Conversation

@cardotrejos

@cardotrejos cardotrejos commented Apr 1, 2026

Copy link
Copy Markdown
Owner

Weekly doc gardening pass.

Changes

  • docs/architecture.md — timestamped to Apr 1, added v0.3.2→v0.3.3 changes: X402.Utils new module, TLS enforcement, 8KB header caps, HTTPS-only facilitator URL, SIWX ETS fixes
  • docs/quality.md — Tests upgraded A- → A (coverage confirmed ≥90%), Security upgraded B+ → A-
  • docs/golden-principles.md — added principles 11 (TLS must be verified) and 12 (HTTPS on facilitator URL), reflecting new enforcement added in v0.3.2/v0.3.3

Note

Low Risk
Docs-only changes updating architecture/quality notes and documenting HTTPS/TLS requirements; no runtime code or behavior is modified.

Overview
Updates documentation to reflect recent v0.3.3 work: docs/architecture.md adds X402.Utils/X402.Header to the module map and includes a new “Recent Changes” section covering TLS peer verification, HTTPS-only facilitator URLs, header/ETS size caps, and related SIWX fixes.

Refreshes docs/golden-principles.md to require HTTPS facilitator URLs and verified TLS (new principles 11–12), and updates docs/quality.md timestamps/grades to note ≥90% coverage and the improved security posture.

Written by Cursor Bugbot for commit 1b1acb5. This will update automatically on new commits. Configure here.

@greptile-apps

greptile-apps Bot commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Documentation gardening pass updating docs/architecture.md, docs/golden-principles.md, and docs/quality.md to reflect v0.3.3 changes (TLS enforcement, HTTPS-only facilitator URLs, 8KB header caps, new X402.Utils/X402.Header modules). The prior Principle 1 / Principle 12 conflict has been resolved by updating Principle 1 to read "Any HTTPS facilitator URL is accepted", and Principle 12 carries the expected (added v0.3.2) annotation.

Confidence Score: 5/5

Safe to merge — docs-only PR, no runtime code changed, only P2 findings remain

All remaining findings are P2 style suggestions (CLAUDE.md stale module map). No P0/P1 issues exist. Both prior review thread concerns (Principle 1/12 conflict, missing Principle 12 version annotation) have been addressed in this PR.

docs/architecture.md — CLAUDE.md should also be updated to list X402.Utils and X402.Header

Important Files Changed

Filename Overview
docs/architecture.md Updated last-modified date, added Utils/Header to module tree, added Recent Changes section for v0.3.2→v0.3.3; CLAUDE.md Module Map not updated to match
docs/golden-principles.md Principle 1 updated to require HTTPS, Principles 11–12 added with v0.3.2 annotations; prior Principle 1/12 conflict fully resolved
docs/quality.md Test grade A-→A (≥90% coverage confirmed), Security grade B+→A- (TLS+HTTPS enforcement, 8KB size caps, atomic ETS claim)

Sequence Diagram

sequenceDiagram
    participant Client
    participant PaymentGate as X402.Plug.PaymentGate
    participant Facilitator as X402.Facilitator
    participant HTTP as Facilitator.HTTP (HTTPS+TLS)
    participant App
    Client->>PaymentGate: HTTP request (no PAYMENT-SIGNATURE)
    PaymentGate-->>Client: 402 + PAYMENT-REQUIRED header
    Client->>PaymentGate: HTTP request + PAYMENT-SIGNATURE
    PaymentGate->>PaymentGate: Decode + validate header (≤8KB)
    PaymentGate->>Facilitator: verify/2
    Facilitator->>HTTP: POST /verify (HTTPS-only, TLS verified)
    HTTP-->>Facilitator: {:ok, result}
    Facilitator-->>PaymentGate: :ok
    PaymentGate->>Facilitator: settle/2
    Facilitator->>HTTP: POST /settle (HTTPS-only, TLS verified)
    HTTP-->>Facilitator: {:ok, result}
    Facilitator-->>PaymentGate: :ok
    PaymentGate->>App: pass conn
    App-->>Client: 200 + PAYMENT-RESPONSE header
Loading

Reviews (6): Last reviewed commit: "docs: fix module tree and golden-princip..." | Re-trigger Greptile

Comment thread docs/golden-principles.md Outdated
Comment on lines +60 to +63
## 12. Enforce HTTPS on Facilitator URL
The facilitator `base_url` must start with `https://`. This is validated at `Facilitator.start_link/1` time, not at call time.

**Violation:** Accepting an `http://` facilitator URL at startup without raising.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Principle 12 conflicts with Principle 1 ("Any facilitator URL is accepted")

Principle 1 explicitly states: "Any facilitator URL is accepted" as part of its Zero Lock-In guarantee. Principle 12 now contradicts this by restricting accepted URLs to https:// only. A contributor reading Principle 1 would be misled.

Consider either:

  1. Updating Principle 1's wording to note the HTTPS constraint (e.g., "Any HTTPS facilitator URL is accepted"), or
  2. Adding a clarifying note to Principle 12 that it is a deliberate, security-motivated refinement of Principle 1.

Comment thread docs/golden-principles.md Outdated

**Violation:** Passing `[transport_opts: [verify: :verify_none]]` to `Finch.start_link`.

## 12. Enforce HTTPS on Facilitator URL

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Missing version annotation on Principle 12

Principle 11 carries a (added v0.3.2) annotation in its heading for traceability, but Principle 12 — added in the same release — does not. For consistency:

Suggested change
## 12. Enforce HTTPS on Facilitator URL
## 12. Enforce HTTPS on Facilitator URL (added v0.3.2)

- Add X402.Utils and X402.Header to module structure tree
- Add (added v0.3.2) annotation to Principle 12
- Fix Principle 1 wording: 'Any facilitator URL' → 'Any HTTPS facilitator URL'
  to remove conflict with Principle 12
@cardotrejos

Copy link
Copy Markdown
Owner Author

@greptile review

4 similar comments
@cardotrejos

Copy link
Copy Markdown
Owner Author

@greptile review

@cardotrejos

Copy link
Copy Markdown
Owner Author

@greptile review

@cardotrejos

Copy link
Copy Markdown
Owner Author

@greptile review

@cardotrejos

Copy link
Copy Markdown
Owner Author

@greptile review

@cardotrejos
cardotrejos merged commit 9bc9295 into main Apr 6, 2026
3 checks passed
@cardotrejos
cardotrejos deleted the docs/gardening-apr-2026 branch April 6, 2026 13:43
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.

1 participant