Radish alpha
r
rad:z3trNYnLWS11cJWC6BbxDs5niGo82
Radicle Improvement Proposals (RIPs)
Radicle
Git
RIP X: URI scheme
Open levitte opened 8 months ago

Building on the work that Lorenz Leutgeb did in patch rad:z3trNYnLWS11cJWC6BbxDs5niGo82/patch/19ba16634fbde97156255ed97069d0aa3ab2bf12, the URI scheme is brought to a final RIP document, with full ABNF and Nearley grammars as well as examples, and a couple of scripts to extract and test those grammars against those examples.

Compared to the URL scheme in RIP 3, this RIP brings a subtly different URL form, while also supporting the RIP 3 scheme (now considered legacy). In short, these two forms are supported by this RIP:

  • rad://{rid}/{nid} (considered legacy)
  • rad://{rad-auth}/{rid}{object-and-query}

(rad-auth is the authority part, which can take the form of {nid}@{host-and-port} or parts thereof)

This works, because the {rid} and the {nid} are distinguishable, as a {nid} always starts with z6Mk, while a {rid} does start with a z, but never with z6Mk, and they have different lengths (a {rid} is always 28 or 29 characters long, which a {nid} is always 48 characters long).

The test scripts are found in tests/0004-uri-scheme

levitte opened with revision 2e206185 on base 329dee9a +370 -0 8 months ago

Building on the work that Lorenz Leutgeb did in patch rad:z3trNYnLWS11cJWC6BbxDs5niGo82/patch/19ba16634fbde97156255ed97069d0aa3ab2bf12, the URI scheme is brought to a final RIP document, with full ABNF and Nearley grammars as well as examples, and a couple of scripts to extract and test those grammars against those examples.

Compared to the URL scheme in RIP 3, this RIP brings a subtly different URL form, while also supporting the RIP 3 scheme (now considered legacy). In short, these two forms are supported by this RIP:

  • rad://{rid}/{nid} (considered legacy)
  • rad://{rad-auth}/{rid}{object-and-query}

(rad-auth is the authority part, which can take the form of {nid}@{host-and-port} or parts thereof)

This works, because the {rid} and the {nid} are distinguishable, as a {nid} always starts with z6Mk, while a {rid} does start with a z, but never with z6Mk, and they have different lengths (a {rid} is always 28 or 29 characters long, which a {nid} is always 48 characters long).

The test scripts are found in tests/0004-uri-scheme

levitte pushed revision 2 a3b29cf2 on base 329dee9a +430 -0 8 months ago
levitte pushed revision 3 4bd0c732 on base 329dee9a +512 -0 8 months ago
levitte pushed revision 4 008a1a58 on base 329dee9a +519 -0 8 months ago
levitte pushed revision 5 05c48c06 on base 329dee9a +544 -0 8 months ago

Get rid of the ellipsis and incorrect RID length in the grammar

The test script resorts to a hack to convert the ellipsis to a suitable number of characters for each part that has it

levitte pushed revision 6 d6eafa7a on base 329dee9a +547 -0 8 months ago
levitte pushed revision 7 8d9f38ff on base 329dee9a +549 -0 8 months ago
levitte pushed revision 8 a93b1f16 on base 329dee9a +700 -0 8 months ago

Add docs/rad-uri.abnf

When rewriting the nearley grammar, I started by writing this file, and then translating. I think this is what should end up in the RIP, unless someone has a strong opinion otherwise

levitte pushed revision 9 b81b0f0c on base 329dee9a +665 -0 8 months ago

Simplify for stricter URI compatible ‘authority’

levitte pushed revision 10 5abe3e2e on base 329dee9a +1563 -0 8 months ago
  • Rethink the path= and file= queries

    This changes path= to allow multiple queries, and reserves the file= query to be singular and for “blob” only.

  • Put it all together into 0004-uri-scheme.md

    [note: I still need to verify that everything holds, i.e. perform all tests from this document, check that the ABNF and Nearly grammars correspond to each other, and give fragments a thought]

I’m nearly there

levitte pushed revision 11 7d0e42fa on base 329dee9a +1571 -0 8 months ago
levitte pushed revision 12 828d43e1 on base 329dee9a +1578 -0 8 months ago
levitte pushed revision 13 0eb4d52b on base 329dee9a +1678 -0 8 months ago
levitte pushed revision 14 aa1cdd8c on base 329dee9a +1530 -0 8 months ago
levitte pushed revision 15 37ec5a31 on base 329dee9a +1530 -0 8 months ago
levitte pushed revision 16 560f76e5 on base 329dee9a +1597 -0 8 months ago
levitte pushed revision 17 e99b8057 on base 329dee9a +1594 -0 8 months ago
levitte pushed revision 18 ef46ff8d on base 329dee9a +1189 -0 8 months ago

Rebase, squash, etc. Basically, clean up this branch

levitte pushed revision 19 43cd7b5d on base 329dee9a +1174 -0 8 months ago
levitte pushed revision 20 5c6cf6be on base 329dee9a +1230 -0 8 months ago
  • Proof-reading fixes and typographical adjustments
  • Added a word on fragments with the “blob” object
  • Added credits and closing thoughts
levitte pushed revision 21 2f292546 on base 329dee9a +1238 -0 8 months ago

A few “last” fixes

levitte pushed revision 22 d61ac608 on base 329dee9a +1228 -0 8 months ago

Updates following recent commentary on https://radicle.zulipchat.com/#narrow/channel/369876-rips/topic/.60rad.3A.60-URI/with/535054321

levitte pushed revision 23 375d6cf3 on base 329dee9a +1228 -0 8 months ago

Fixing a typo

levitte pushed revision 24 4bb1cb87 on base 329dee9a +1162 -0 8 months ago

This revision is a rewrite of the desciption of all object types. The git objects are now more strictly git objects and nothing else, and their descriptions are hopefully easier to understand.

levitte pushed revision 25 c2d9727e on base 329dee9a +1163 -0 8 months ago

Bah, typos…

levitte pushed revision 26 0ba7a35a on base 329dee9a +1166 -0 8 months ago

Correcting the job COB type name, xyz.radicle.job → xyz.radworks.job

fintohaps pushed revision 27 7957f7bf on base 329dee9a +1166 -0 8 months ago

See REVIEW Commits

levitte pushed revision 28 e11313cc on base 329dee9a +1166 -0 8 months ago

Integrated Fintan’s review commits

levitte commented on revision 27 8 months ago

Thank you, they all got integrated

levitte pushed revision 29 148de45a on base 329dee9a +1301 -0 8 months ago

A number of updates

This now includes namespaces as a resource, more examples, and the examples are now sprinkled among the diverse topics.

levitte pushed revision 30 92082da2 on base 329dee9a +1299 -0 8 months ago

Change the authority to require a NID with a host+port

This is a requirement of Radicle’s node connection protocol

levitte pushed revision 31 b9e7c389 on base 329dee9a +1290 -0 8 months ago

Drop all ideas of references to lists

There is no real agreement whether they should be part of this URI scheme, at least for now, so the easiest path forward it to simply drop that idea.

levitte pushed revision 32 9746c154 on base 329dee9a +1375 -0 5 months ago

Major rework

This revision is a major rework of what was before, partially based on conversations in Zulip, and a good deal of conceptual rethinking.

Something to remember is that these URIs are conceptually references to all sorts of resources. Another thing to remember is that humans read URIs, and will interpret them as best they can, not necessarily just pass them to a software.

This rework isn’t quite done yet… the ABNF details are in disarray and need editing. The next revision will have all that updated.

levitte pushed revision 33 7061174b on base 329dee9a +1407 -0 5 months ago

ABNF and nearley mess fixed up!

levitte pushed revision 34 222676a4 on base 329dee9a +1468 -0 4 months ago

Following a discussion on zulip, the Generic rad: URI scheme RIP is rewritten in Asciidoc.

levitte pushed revision 35 5c6c00f7 on base 329dee9a +1472 -0 4 months ago

I added an example to refer to the git notes for a specific commit

levitte pushed revision 36 273f2c64 on base 329dee9a +1463 -0 3 months ago

This is an update where I change ‘object’ types to become ‘resource’ types. This is more consistent with URI descriptions, and allows us to mentally separate generic resource references from objects, where the latter has specific semantics in git and Radicle.

levitte pushed revision 37 cf5c04ff on base 329dee9a +1346 -0 3 months ago

Abbreviations for known COB types removed, courtesy @fintohaps

ade rejected · 12 comments 2 months ago
levitte reviewed · 2 comments 2 months ago

Reminder to myself: in zulip, @fintohaps remarked that asciidoc’s include functionality could be useful. That’s an excellent idea.

2color reviewed · 6 comments 2 months ago

The authority component in URIs typically represents a hierarchical naming authority, i.e. DNS-based authority.

Many URI schemes include a hierarchical element for a naming authority so that governance of the name space defined by the remainder of the URI is delegated to that authority (which may, in turn, delegate it further).

  • source: https://datatracker.ietf.org/doc/html/rfc3986#section-3.2

The “authority” in Radicle is cryptographic (the identity document and its delegates), not locational. It is downstream of the identity document which maps to a set of delegates. Git and by extension Radicle have many benefits stemming from their use of hashes as immutable pointers that decouple resources from a specific network location.

This may seem like a subtle distinction, but I think it’s worth delibrating. The utility of encoding a host and port into the URI is clear for bootstrapping, but it also risks linkrot, and some coupling between never-changing resources and transient network locations (on a long enough timeline). In other words, it conflates “where I first heard about this” with “who controls this”.

Some ideas for how this could be addressed while keeping the authority as is:

  • Specify that the canonical form omits authority: i.e., rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5 is the canonical identifier
  • Allow authority as a non-normative hint for bootstrapping, but specify that implementations should not treat two URIs as different resources just because they have different authorities
  • Document that RID is the true authority, i.e. the cryptographic identity, not the network

Alternatively, if we decide to use the RID as the authority —which intuitively feels like a better approach— the seed node for bootstrapping could be encoded in a query parameter: rad://z3gqcJUoA1n9HaHKufZs5FCSGazv5/path?seed=z6Mkux1...@seed.radicle.xyz:8776

levitte pushed revision 38 7378454a on base 329dee9a +1358 -0 2 months ago

Small fixes

  • Clarified that the path= could appear multiple times, and that the values should be accumulated, thereby refering to multiple paths.
  • Subtle change of the git-obj ABNF rule and git_obj nearley rule to make it clear that it currently supports git’s sha1 IDs, using the git-sha1 / git_sha1 sub-rule. This implies that git-obj / git_obj can be extended to support newer hashes by adding new sub-rules for them.
levitte pushed revision 39 83aa0cf1 on base 329dee9a +1274 -0 2 months ago

Move the ABNF and Nearley documents to their own file, and include them in the adoc

The files (rad-uri.abnf and rad-uri.ne) were generated by tests/general-uri-scheme/uri-scheme-extractor.sh, and moved to data/general-uri-scheme.

Then, 000X-general-uri-scheme.adoc was modified by removing almost all ABNF and Nearley code and replace them with file inclusions. For the ABNF, [tagged inclusions](see https://docs.asciidoctor.org/asciidoc/latest/directives/include-tagged-regions/) are used, and the corresponding tags were added to rad-uri.abnf.

The test script in tests/general-uri-scheme were adapted so they use data/general-uri-scheme/rad-uri.{abnf,ne} instead of trying to extract them from 000X-general-uri-scheme.adoc.

I finished up by fixing some inconsistencies between duplicates of the ABNF code, as well as in the Nearley spec compared to the ABNF spec.

levitte pushed revision 40 7386ab1c on base 329dee9a +1272 -0 2 months ago

Move to a new directory structure, where the top directory is the RIP name

Ref: https://radicle.zulipchat.com/#narrow/channel/369876-RIPs/topic/.60rad.3A.60-URI/near/573958689

fintohaps pushed revision 41 dc842d19 on base 329dee9a +5017 -4 29 days ago

REVIEW

There are a few easy REVIEW commits:

  • Typo fixes
  • Links fixes

Some REVIEW commits might be a bit more bikeshedding:

  • Preferring “RFC 3986” rather than “URI”
  • Code fencing usage

There is a fix to the grammar of NID and RID, noting that they use base58btc, which omits 0,O,I,l from its alphabet. I also came across an issue with rid in the nearley file.

IMPORTANT: I removed the option revision in cob. Not every COB is expected to have a revision, xyz.radicle.issue is already a good example of this.

Then there is the introduction of flake.nix so that I could have an easy way of dropping myself into a development shell with nearley* tools. I also brought in linkspector to make sure links look correct. I then took this a step further and introduced nix flake check’s so that the grammars and links can easily be checked. Since these test examples now live in files, they are now referenced in the tables, and their expected output is is referenced as well.

levitte pushed revision 42 6954dd42 on base 329dee9a +5015 -4 13 days ago

Incorporated all of @fintohaps’ latest revision, plus some text adjustments

levitte pushed revision 43 75199d2a on base 329dee9a +5025 -4 13 days ago

Rewrote the talking point about COB metadata, and made it a proper aside/sidebar

lorenz pushed revision 44 575f13af on base 329dee9a +5104 -4 5 days ago

Review

levitte pushed revision 45 bec8da0d on base 329dee9a +4943 -4 3 days ago

Update

All of @lorenz’ review commits were incorporated.

Following that, I made lots of editorial fixups, but hopefully kept the spirit of the changes that were recently discussed.

  • The grammars are updated to reflect current consensus

    The nearly grammar (data/rad-uri.ne) was far behind, still having old rules that were dropped from the ABNF grammar a long time ago. I also copied all the latest commentary additions from the ABNF grammar.

    In both grammars, git related rules are also updated to correspond to the conclusion of the latest discussions (the .adoc changes will follow)

  • Converted the section about addressing git resources into a sidebar

    A “sidebar” is the best that asciidoctor offers in terms of remark box.

  • Turned some of the TODOs into more sidebars

    Those TODOs were quite nice, actually. They gave food for thought.

  • Defined some query parameters that we want support for

  • Rewrote the whole section on COBs

  • Fixed a bunch of the tests to conform to all the updates

  • Fixed a few typos

fintohaps pushed revision 46 533470dc on base 7e993a9b +1833 -2 2 days ago

Changes:

  • Update test script to use git rev-parse --show-toplevel to get base directory, and build directory paths from this.
  • Remove the non-accepted linkspector changes from flake.nix.
  • Introduce wrapper for nearley for dev shell and flake check.
fintohaps pushed revision 47 134368c5 on base 7e993a9b +1847 -2 2 days ago

REVIEW