Repository navigation
feat(licensing): add a Concerto model of Really Simple Licensing (RSL) 1.0 - #203
Open
niallroche wants to merge 6 commits into
Open
niallroche wants to merge 6 commits into
niallroche wants to merge 6 commits into
Conversation
Signed-off-by: Niall Roche <niall.roche@gmail.com>
Signed-off-by: Niall Roche <niall.roche@gmail.com>
🧩 Concerto Playground PreviewThe
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>
mttrbrts
approved these changes
Nov 13, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes N/A
Adds
org.accordproject.licensing.rsl@1.0.0, a Concerto model of theReally Simple Licensing 1.0 specification
(RSL-SPEC-1.0, Recommendation, 2025-12-10), covering the full element set:
rsl,content,license,permits/prohibits,paymentwithstandard/custom/amount/accepts,legal,schema,copyright,terms,alternateandreporting.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 eighttokens 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-readableterms 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 statesthat for x402 it MUST be
application/x402+json. RSL names x402 in its ownspecification.
The only dependency is
org.accordproject.money@1.0.0, and only forCurrencyCode.Changes
feat(licensing): add RSL 1.0 model— addssrc/licensing/rsl@1.0.0.cto.No existing model is touched.
test(licensing): validate RSL model and vocabularies— addstest/licensing/rsl@1.0.0.test.jswithtest/licensing/data/rsl-example.jsonand its canonical XML form, plus a one-line
testscript inpackage.json(
node --test "test/**/*.test.js"). No new dependencies: the tests use node'sbuilt-in runner (Node >= 18 is already required) and
@accordproject/concerto-core,which is already a dependency.
package-lock.jsonis 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/termsare single-valued while
licenses/alternatesare arrays;permits/prohibitsare typed fields;
AmountreusesCurrencyCodeandPaymentcarries no moneytype; and the constrained values hold (
endpointHTTPS-only,profileanabsolute URI,
schema typeexactlyapplication/ld+json). Two of them guard theexample 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 serverobliges a client to obtain a licence from it before access, even for a free
licence).
money@1.0.0resolves from this repository's ownsrc/, so the suiteruns offline.
Flags
src/licensing/with a matching namespace segment mirrors thesrc/protocol/x402@0.2.0.ctoshape proposed there. RSL is a licensingvocabulary rather than a wire protocol, hence
licensingrather thanprotocol, and it leaveslicensing.odrlfree for the same treatment. This isa 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
namespaceline and one constant in the test.build-and-publish.ymlrunsnpm installandnpm run build;pr-playground-comment.ymlrunsnpm ci. Neither runsnpm test, so the suite added here will not execute in CI as things stand. Ihave 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_PUBLISHproduces an incomplete artifact set for this model. Themodel declares
concerto version "^4.0.0", sobuild.jsprocesses it withConcerto v4.0.2. A normal build is clean — zero warnings and all 17 artifacts,
the same set
money@1.0.0produces. Built withFORCE_PUBLISH=1, which skipsthe external download, the v4 code generators emit "No registered namespace"
for the
CurrencyCodeimport and silently drop seven formats (gql,json,md,mmd,proto,puml); models on Concerto v3 with external importstolerate the same situation. Not a defect, but worth knowing before publishing
with that flag.
defines
usageToken = rslUsageToken | qnameTokenand the same for user andpayment, 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
QNameTokenfield carrying theextension 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.
CurrencyCode, deliberately.<amount>is an ISO 4217code 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 thatauthoritative 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
foreignElementrule admits anywhere. APreciseAmountinthe 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.
JSONscalar suggested on feat(x402): Agent/x402 model #194.Accepts.metadata,Reporting.configurationand inlineSchema.valuearecarried 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
JSONscalarbe 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.
requires
content+,license+and non-empty token lists; Concerto arrays haveno minimum length, so an empty
contentsorlicensesvalidates here and isstill not a valid RSL document. And
Payment.type/Payment.typeExtensionarealternatives —
paymentTokenis a choice, not a pair — which Concerto cannotexpress as an exclusive-or, so both can be set. An adapter must reject both
cases. Separately, a
QNameTokencarries a prefix but not its namespacebinding, which lives in an
xmlns:declaration, so an adapter needs aprefix → namespace URI map to serialise or resolve extension tokens.
emits RSL XML.
test/licensing/data/rsl-example.xmlis the canonical XML formof 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.
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 buildgenerates the usual artifact set for the newnamespace —
licensing/rsl@1.0.0.{cto,ast.json,html,puml}plus thets,java,go,cs,csdl,gql,json,md,mmd,proto,avdlandxsdarchives — with no registration needed, since
build.jsdiscoverssrc/recursively.
Related Issues
feat(x402): Agent/x402 model. Establishes the groupingconvention this PR follows, and is the model RSL's
<accepts type>points at.Author Checklist
--signoffoption of git commit.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.