Skip to content

Conversation

@jsantell
Copy link
Collaborator

@jsantell jsantell commented Nov 4, 2025

First draft of defining how delegations work for namespaces, spaces, and charms

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

3 issues found across 3 files

Prompt for AI agents (all 3 issues)

Understand the root cause of the following 3 issues and fix them.


<file name="docs/specs/delegation.md">

<violation number="1" location="docs/specs/delegation.md:29">
Replace “responsible from” with “responsible for” so the sentence reads correctly and the responsibility is unambiguous.</violation>

<violation number="2" location="docs/specs/delegation.md:35">
Use the plural verb “are” so the subject-verb agreement is correct and the sentence reads naturally.</violation>
</file>

<file name="packages/identity/src/url.ts">

<violation number="1" location="packages/identity/src/url.ts:28">
The parser drops any path segments beyond the first three address components, so a malformed URL such as &quot;/@ns/space/charm/extra&quot; is treated as valid instead of throwing. Please reject paths that contain additional segments after the charm component.</violation>
</file>

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

> [!NOTE]
> There may be a way to view a namespace, like itemizing all contained spaces, but is out of scope here.

Additionally, delegations for access to the namespace is stored in the admin space as well. See **CAPABILITIES** below for delegation.
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Nov 4, 2025

Choose a reason for hiding this comment

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

Use the plural verb “are” so the subject-verb agreement is correct and the sentence reads naturally.

Prompt for AI agents
Address the following comment on docs/specs/delegation.md at line 35:

<comment>Use the plural verb “are” so the subject-verb agreement is correct and the sentence reads naturally.</comment>

<file context>
@@ -0,0 +1,110 @@
+&gt; [!NOTE]
+&gt; There may be a way to view a namespace, like itemizing all contained spaces, but is out of scope here.
+
+Additionally, delegations for access to the namespace is stored in the admin space as well. See **CAPABILITIES** below for delegation.
+
+### Namespace Admin Space
</file context>
Suggested change
Additionally, delegations for access to the namespace is stored in the admin space as well. See **CAPABILITIES** below for delegation.
Additionally, delegations for access to the namespace are stored in the admin space as well. See **CAPABILITIES** below for delegation.
Fix with Cubic


Namespaces can be referenced via DNS record, resolving to a DID key, or via directly as a DID key. Similarly, a provider-namespace is implied when no namespace given, which also resolves to an identity DID.

Namespaces manage many spaces, and are responsible from mapping space petnames to their identity.
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Nov 4, 2025

Choose a reason for hiding this comment

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

Replace “responsible from” with “responsible for” so the sentence reads correctly and the responsibility is unambiguous.

Prompt for AI agents
Address the following comment on docs/specs/delegation.md at line 29:

<comment>Replace “responsible from” with “responsible for” so the sentence reads correctly and the responsibility is unambiguous.</comment>

<file context>
@@ -0,0 +1,110 @@
+
+Namespaces can be referenced via DNS record, resolving to a DID key, or via directly as a DID key. Similarly, a provider-namespace is implied when no namespace given, which also resolves to an identity DID. 
+
+Namespaces manage many spaces, and are responsible from mapping space petnames to their identity.
+Each namespace has an &quot;admin&quot; space (possibly with the same identity as the namespace itself?), where records are stored.
+
</file context>
Suggested change
Namespaces manage many spaces, and are responsible from mapping space petnames to their identity.
Namespaces manage many spaces, and are responsible for mapping space petnames to their identity.
Fix with Cubic

}

export function parseCharmAddress(url: URL): CharmAddress {
const [prefix, ns, space, charm] = url.pathname.split("/");
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Nov 4, 2025

Choose a reason for hiding this comment

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

The parser drops any path segments beyond the first three address components, so a malformed URL such as "/@ns/space/charm/extra" is treated as valid instead of throwing. Please reject paths that contain additional segments after the charm component.

Prompt for AI agents
Address the following comment on packages/identity/src/url.ts at line 28:

<comment>The parser drops any path segments beyond the first three address components, so a malformed URL such as &quot;/@ns/space/charm/extra&quot; is treated as valid instead of throwing. Please reject paths that contain additional segments after the charm component.</comment>

<file context>
@@ -0,0 +1,65 @@
+}
+
+export function parseCharmAddress(url: URL): CharmAddress {
+  const [prefix, ns, space, charm] = url.pathname.split(&quot;/&quot;);
+  if (prefix || !ns) throw new CharmAddressError();
+  if (!space &amp;&amp; charm) throw new CharmAddressError();
</file context>
Fix with Cubic

@jsantell jsantell changed the title chore: Draft up identity specs for delegation WIP: Draft up identity specs for delegation Nov 5, 2025
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