Skip to content

feat(licensing): add a Concerto model of Really Simple Licensing (RSL) 1.0 - #203

Open
niallroche wants to merge 6 commits into
accordproject:mainfrom
niallroche:codex/rsl-model-1.0.0
Open

niallroche wants to merge 6 commits into
accordproject:mainfrom
niallroche:codex/rsl-model-1.0.0

Conversation

@niallroche

Copy link
Copy Markdown
Contributor

Closes N/A

Adds org.accordproject.licensing.rsl@1.0.0, a Concerto model of the
Really Simple Licensing 1.0 specification
(RSL-SPEC-1.0, Recommendation, 2025-12-10), covering the full element set: rsl,
content, license, permits/prohibits, payment with
standard/custom/amount/accepts, legal, schema, copyright, terms,
alternate and reporting.

Every structural rule is taken from the normative Relax NG compact grammar in
Appendix A rather than from the prose sections. Where the two disagree the
grammar wins — notably <payment type>, which §3.7 says MUST be one of eight
tokens while Appendix A defines paymentToken = rslPaymentToken | qnameToken.

Why this belongs here. RSL is where a publisher declares what may be done
with content and on what payment terms, and it is being adopted as the
machine-readable layer for AI access to published material. Accord Project sits
directly underneath it: RSL's <terms> element is a bare URL to human-readable
terms with no format, hash or version, and its companion API
(the Open License Protocol) places licence
registration, management and payment out of scope. A Concerto model of RSL is
what lets an agreement and the licence declaration published beside it be
generated from one source rather than maintained in parallel.

It also composes with the x402 model proposed in #194 more directly than one
might expect: <accepts type> identifies a payment protocol, and §3.11 states
that for x402 it MUST be application/x402+json. RSL names x402 in its own
specification.

The only dependency is org.accordproject.money@1.0.0, and only for
CurrencyCode.

Changes

  • feat(licensing): add RSL 1.0 model — adds src/licensing/rsl@1.0.0.cto.
    No existing model is touched.
  • test(licensing): validate RSL model and vocabularies — adds
    test/licensing/rsl@1.0.0.test.js with test/licensing/data/rsl-example.json
    and its canonical XML form, plus a one-line test script in package.json
    (node --test "test/**/*.test.js"). No new dependencies: the tests use node's
    built-in runner (Node >= 18 is already required) and @accordproject/concerto-core,
    which is already a dependency. package-lock.json is unchanged.
    Twelve tests: the model compiles; each vocabulary matches the specification,
    asserted both as enum members and as the RSL tokens they serialise to;
    the example validates; extension-namespace tokens are carried rather than
    rejected, and a bare word is rejected as a QName; schema/copyright/terms
    are single-valued while licenses/alternates are arrays; permits/prohibits
    are typed fields; Amount reuses CurrencyCode and Payment carries no money
    type; and the constrained values hold (endpoint HTTPS-only, profile an
    absolute URI, schema type exactly application/ld+json). Two of them guard the
    example rather than the model: that it never prohibits a usage it also permits
    (§3.1.1 — a prohibition in any applicable licence defeats a permit in every
    other), and that it advertises no server (§3.3 — an advertised OLP server
    obliges a client to obtain a licence from it before access, even for a free
    licence). money@1.0.0 resolves from this repository's own src/, so the suite
    runs offline.

Flags

  • Directory and namespace follow feat(x402): Agent/x402 model #194, which is still open.
    src/licensing/ with a matching namespace segment mirrors the
    src/protocol/x402@0.2.0.cto shape proposed there. RSL is a licensing
    vocabulary rather than a wire protocol, hence licensing rather than
    protocol, and it leaves licensing.odrl free for the same treatment. This is
    a convention in progress rather than a settled one — happy to move this if feat(x402): Agent/x402 model #194
    lands elsewhere or if you would rather group differently. It is the directory,
    the namespace line and one constant in the test.
  • CI does not run the tests. build-and-publish.yml runs npm install and
    npm run build; pr-playground-comment.yml runs npm ci. Neither runs
    npm test, so the suite added here will not execute in CI as things stand. I
    have deliberately not modified a workflow in this PR. Happy to add the step if
    you want it, or to drop the second commit entirely if you would rather not
    introduce a test runner to this repository.
  • FORCE_PUBLISH produces an incomplete artifact set for this model. The
    model declares concerto version "^4.0.0", so build.js processes it with
    Concerto v4.0.2. A normal build is clean — zero warnings and all 17 artifacts,
    the same set money@1.0.0 produces. Built with FORCE_PUBLISH=1, which skips
    the external download, the v4 code generators emit "No registered namespace"
    for the CurrencyCode import and silently drop seven formats (gql, json,
    md, mmd, proto, puml); models on Concerto v3 with external imports
    tolerate the same situation. Not a defect, but worth knowing before publishing
    with that flag.
  • The usage, user and payment vocabularies are open, by design. Appendix A
    defines usageToken = rslUsageToken | qnameToken and the same for user and
    payment, and §3.4.1 says extension-namespace tokens MAY appear but MUST NOT be
    interpreted unless the processor recognises them. The enums here are therefore
    the RSL core vocabulary, each paired with a QNameToken field carrying the
    extension tokens a processor does not interpret — dropping them would lose data
    that has to survive a round trip. The geo, reporting, warranty and disclaimer
    vocabularies are closed in Appendix A and are enums alone.
  • No money type beyond CurrencyCode, deliberately. <amount> is an ISO 4217
    code and a decimal and that is the whole of what RSL can say about price. Where
    a price cannot be expressed that way — a token rail, or any unit needing an
    explicit scale — RSL's own answer is <accepts>: §3.11 provides that
    authoritative pricing and settlement instructions MAY be supplied dynamically by
    the payment protocol at runtime. An exact amount belongs on the obligation in
    the agreement model that sources the payment, or in a foreign-namespace element,
    which Appendix A's foreignElement rule admits anywhere. A PreciseAmount in
    the RSL namespace would create a second price with no XML form and no defined
    precedence — and USD 0.50 is not an approximation of USDC 0.50 in any case.
  • Opaque JSON strings, and the JSON scalar suggested on feat(x402): Agent/x402 model #194.
    Accepts.metadata, Reporting.configuration and inline Schema.value are
    carried verbatim as strings because their shape is defined by a media type or a
    reporting profile, not by RSL. @mttrbrts suggested on feat(x402): Agent/x402 model #194 that a JSON scalar
    be defined to make that intent explicit and possibly upstreamed to the shared
    scalar library. That applies equally here — if such a scalar lands, I will
    adopt it in this model.
  • Two rules the model cannot enforce, both documented in the file. Appendix A
    requires content+, license+ and non-empty token lists; Concerto arrays have
    no minimum length, so an empty contents or licenses validates here and is
    still not a valid RSL document. And Payment.type/Payment.typeExtension are
    alternatives — paymentToken is a choice, not a pair — which Concerto cannot
    express as an exclusive-or, so both can be set. An adapter must reject both
    cases. Separately, a QNameToken carries a prefix but not its namespace
    binding, which lives in an xmlns: declaration, so an adapter needs a
    prefix → namespace URI map to serialise or resolve extension tokens.
  • Out of scope: there is no XML adapter here, so nothing in this PR parses or
    emits RSL XML. test/licensing/data/rsl-example.xml is the canonical XML form
    of the example, kept beside the JSON as documentation only. A JSON ↔ XML round
    trip validated against Appendix A with a Relax NG validator belongs with an
    adapter, wherever one is written — happy to follow up if that would be welcome
    here.
  • RSL has no allowance element and no duration element, so a bundle size or a
    pass length has nowhere to live in an RSL document. That is a property of the
    specification; an agreement needing those must carry them itself.

Screenshots or Video

Not applicable. npm run build generates the usual artifact set for the new
namespace — licensing/rsl@1.0.0.{cto,ast.json,html,puml} plus the ts, java,
go, cs, csdl, gql, json, md, mmd, proto, avdl and xsd
archives — with no registration needed, since build.js discovers src/
recursively.

Related Issues

  • Pull Request feat(x402): Agent/x402 model #194 — feat(x402): Agent/x402 model. Establishes the grouping
    convention this PR follows, and is the model RSL's <accepts type> points at.

Author Checklist

  • Ensure you provide a DCO sign-off for your commits using the --signoff option of git commit.
  • Vital features and changes captured in unit and/or integration tests
  • Commits messages follow AP format
  • Extend the documentation, if necessary — the model documents its own
    modelling decisions and limitations inline, with section references to the
    specification. No separate documentation change seemed warranted; say the
    word if you would like one.

Signed-off-by: Niall Roche <niall.roche@gmail.com>
Signed-off-by: Niall Roche <niall.roche@gmail.com>
@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

🧩 Concerto Playground Preview

The .cto model changes in this PR are pre-loaded into the Concerto Playground — click a link below for a live preview.

File Preview
src/licensing/rsl@1.0.0.cto Diagram · Code · Open in Playground

Auto-generated from commit 2897ef9. Updates automatically on new commits.

Signed-off-by: Niall Roche <niall.roche@gmail.com>
Signed-off-by: Niall Roche <niall.roche@gmail.com>
Signed-off-by: Niall Roche <niall.roche@gmail.com>
Signed-off-by: Niall Roche <niall.roche@gmail.com>

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