Radish alpha
r
rad:z3trNYnLWS11cJWC6BbxDs5niGo82
Radicle Improvement Proposals (RIPs)
Radicle
Git
Namespaces
Draft lorenz opened 7 months ago
1 file changed +88 -0 329dee9a 116e19cc
added namespaces.md
@@ -0,0 +1,88 @@
+
---
+
RIP: X
+
Title: Namespaces
+
Author: 'Lorenz Leutgeb <lorenz.leutgeb@radicle.xyz>'
+
Status: Draft
+
Created: 2025-09-23
+
License: CC0-1.0
+
---
+

+
Amendment to RIPs #2, #3, #4.
+

+
Motivation:
+
 1. Clearer separation of references with different concerns (user-defined crefs vs. internal `refs/rad/id` for the identity vs. internal refs for nodes).
+
 2. Freeing up the anonymous root namespace for compatibility with Git worktrees.
+

+
## Namespacing Naming Scheme
+

+
Decide on a naming scheme for the namespaces:
+
 1. `xyz.radicle.*`
+
 2. `xyz/radicle/*` using hierarchical namespaces, i.e. let Git expand `GIT_NAMESPACE=xyz/radicle/crefs` to `refs/namespaces/xyz/refs/namespaces/radicle/refs/namespaces/crefs`. See <https://git-scm.com/docs/gitnamespaces>.
+

+
For now: `ns("<arg>")` is a function that returns the "Radicle namespace `<arg>`".
+

+
Depending on the naming scheme, `ns("<arg>")` might be defined to be, e.g.:
+
 1. `refs/namespaces/xyz.radicle.<arg>`
+
 2. `xyz/radicle/<arg>` which expands to `refs/namespaces/xyz/refs/namespaces/radicle/refs/namespaces/<arg>`
+

+
## Amendments to RIP #2
+

+
The repository identity is not found at `refs/rad/id`, but at `ns("id")/refs/rad/id`.
+

+
## Amendments to RIP #3
+

+
The namespaces of peers are not found at `refs/namespaces/<nid>` but at `ns("node")/refs/namespaces/<nid>`.
+

+
## Amendments to RIP #4
+

+
Canonical refs are not found at the anonymous root namespace, but at `ns("crefs")`.
+

+
This namespace is computed by taking the identity document from `ns("id")/refs/rad/id`, interpreting it to obtain the canonical reference rules, and canonicity computation over the "allow" user namespaces from `ns("node")/refs/namespaces/<nid>` where `<nid>` is computed from the `did:key` in `allowed`.
+

+
## Rough Comparison
+

+
### Before
+

+
    <storage>/<rid>      # The "physical" Git repository
+
    ├─ HEAD              # Symbolic reference targeting the default branch.
+
    └─ refs
+
       ├─ rad            # References related to repository identity.
+
       │  └─ id          # Identity document.
+
       ├─ heads
+
       │  └─ main        # Example qualified ref born from rules.
+
       ├─ tags
+
       │  └─ v0.9.100    # Example qualified ref born from rules.
+
       └─ namespaces
+
          ├─ <nid>       # One peer's fork is stored here
+
          │  └─ refs
+
          ├─ <nid>       # Another peer's fork is stored here
+
          │  └─ refs
+
          └─ <nid>       # Etc.
+
             └─ refs
+

+
### After
+

+
Note: This uses `ns(<arg>) = xyz.radicle.<arg>`.
+

+
    <storage>/<rid>             # The "physical" Git repository
+
    └─ refs
+
       ├─ heads
+
       │  └─ my-feature         # The local user(s) are free to use this for their work.
+
       └─ namespaces
+
          ├─ xyz.radicle.id     # References related to repository identity …
+
          │  └─ rad
+
          │     └─ id           # Identity document.
+
          ├─ xyz.radicle.crefs  # All canonical refs are stored under this namespace
+
          │  ├─ HEAD            # Symbolic reference targeting the default branch.
+
          │  └─ refs
+
          │     ├─ heads
+
          │     │  └─ main      # Example qualified ref born from rules.
+
          │     └─ tags
+
          │        └─ v0.9.100  # Example qualified ref born from rules.
+
          └─ xyz.radicle.node   # All forks are stored under this namespace
+
             ├─ refs/namespaces/<nid>   # One peer's fork is stored here
+
             │  └─ refs
+
             ├─ refs/namespaces/<nid>   # Another peer's fork is stored here
+
             │  └─ refs
+
             └─ refs/namespaces/<nid>   # Etc.
+
                └─ refs