@agenticprimitives/agent-naming 1.0.0-alpha.4 → 1.0.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AUDIT.md +15 -4
- package/CLAUDE.md +3 -3
- package/README.md +1 -1
- package/dist/namehash.d.ts +3 -2
- package/dist/namehash.d.ts.map +1 -1
- package/dist/namehash.js +4 -3
- package/dist/namehash.js.map +1 -1
- package/docs/api.md +2 -2
- package/docs/concepts.md +1 -1
- package/docs/migration.md +1 -1
- package/package.json +8 -8
package/AUDIT.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# @agenticprimitives/agent-naming — package audit
|
|
2
2
|
|
|
3
3
|
**Status:** Phase 1 (SDK skeleton + spec + pure helpers).
|
|
4
|
-
**Last refreshed:** 2026-
|
|
4
|
+
**Last refreshed:** 2026-06-01 (R9 substrate coverage references + R11.1 fail-hard audit + R11.3 public-surface cleanup)
|
|
5
|
+
**Prior refresh:** 2026-05-23
|
|
5
6
|
**Owner:** [security-auditor](../../docs/agents/security-auditor.md) +
|
|
6
7
|
[technical-architect-auditor](../../docs/agents/technical-architect-auditor.md).
|
|
7
8
|
**System audit cross-ref:** see
|
|
@@ -14,7 +15,7 @@ on-chain authority paths, and demo integration land in Phase 3+.
|
|
|
14
15
|
## Charter (what's audit-relevant in this package)
|
|
15
16
|
|
|
16
17
|
- Pure helpers (`normalizeAgentName`, `labelhash`, `namehash`): MUST
|
|
17
|
-
be deterministic + match the
|
|
18
|
+
be deterministic + match the standard recursive-namehash algorithm + reject
|
|
18
19
|
malformed input.
|
|
19
20
|
- Record schema (`AgentNameRecords` + `records` subpath): MUST
|
|
20
21
|
refuse unknown keys on encode (fail-loud write) AND drop unknown
|
|
@@ -39,9 +40,9 @@ on-chain authority paths, and demo integration land in Phase 3+.
|
|
|
39
40
|
non-ASCII / oversize labels. Throws `InvalidNameError`. Covered in
|
|
40
41
|
`test/normalize.test.ts`.
|
|
41
42
|
- ✅ `normalize` is idempotent: `normalize(normalize(x)) === normalize(x)`.
|
|
42
|
-
- ✅ `namehash('')` = `ZERO_NODE` (`0x00…00`) per the
|
|
43
|
+
- ✅ `namehash('')` = `ZERO_NODE` (`0x00…00`) per the root-sentinel
|
|
43
44
|
convention.
|
|
44
|
-
- ✅ `namehash` matches the
|
|
45
|
+
- ✅ `namehash` matches the standard recursive-namehash algorithm under an
|
|
45
46
|
in-band independent reimplementation (`test/namehash.test.ts`
|
|
46
47
|
golden-vector table).
|
|
47
48
|
- ✅ `namehash` rejects malformed input by delegating to `normalize`.
|
|
@@ -84,3 +85,13 @@ client doesn't yet take an `auditSink`; Phase 2 will add the optional
|
|
|
84
85
|
| Date | Wave | What changed |
|
|
85
86
|
| --- | --- | --- |
|
|
86
87
|
| 2026-05-23 | NS Phase 1 | Initial audit. AN-1/2/3 open; security invariants verified by unit tests. |
|
|
88
|
+
|
|
89
|
+
## R9 substrate coverage (2026-06-01)
|
|
90
|
+
|
|
91
|
+
- Locked by R6.2 + R6.8 contract-side hardening:
|
|
92
|
+
- `AgentNameRegistry.initializeRoot` cannot be frontrun (immutable initializer + same-tx deploy) — H7-C.4 / CON-NAMING-001.
|
|
93
|
+
- `PermissionlessSubregistry.register` is `nonReentrant` — R6.2 / CON-SUBREGISTRY-003.
|
|
94
|
+
- Pause coverage: 7 mutating functions (register, backfillLabel, setOwner, setResolver, setSubregistry, renew, setPrimaryName) are `whenNotPaused` — R6.8.
|
|
95
|
+
- ADR-0012 / ADR-0013: NO `eth_getLogs` in product read paths; `reverseResolveString` is the canonical single-call.
|
|
96
|
+
- See [`packages/contracts/AUDIT.md` § 3.8](../contracts/AUDIT.md).
|
|
97
|
+
|
package/CLAUDE.md
CHANGED
|
@@ -8,8 +8,8 @@ Names are a **facet registration** pointing AT the canonical Smart Agent ([ADR-0
|
|
|
8
8
|
- The `.agent` TLD constant (`AGENT_TLD`).
|
|
9
9
|
- Name normalization (`normalizeAgentName`) — NFC + lowercase + label
|
|
10
10
|
validation. Rejects empty / hyphen-prefixed / non-ASCII labels in v0.
|
|
11
|
-
- `labelhash` + `namehash` —
|
|
12
|
-
identifier nodes.
|
|
11
|
+
- `labelhash` + `namehash` — recursive keccak256 hashes
|
|
12
|
+
(`keccak256(parentNode || labelhash)`) for identifier nodes.
|
|
13
13
|
- Record schemas (`AgentNameRecords`) and predicate constants
|
|
14
14
|
(subpath `/records`).
|
|
15
15
|
- `AgentNamingClient` — read API (resolve / reverse-resolve / get
|
|
@@ -37,7 +37,7 @@ Names are a **facet registration** pointing AT the canonical Smart Agent ([ADR-0
|
|
|
37
37
|
`AGENT_TLD`.
|
|
38
38
|
**Disambiguation:**
|
|
39
39
|
|
|
40
|
-
- **"resolver"** here = on-chain
|
|
40
|
+
- **"resolver"** here = our on-chain registry + resolver. Distinct from
|
|
41
41
|
any other package.
|
|
42
42
|
- **"registry"** here = `AgentNameRegistry` contract. Distinct from
|
|
43
43
|
the factory deploy-registry in `agent-account`.
|
package/README.md
CHANGED
|
@@ -70,7 +70,7 @@ const records = await naming.getRecords('treasury.acme.agent');
|
|
|
70
70
|
`nativeId`). Owned by `agent-account`, not this package.
|
|
71
71
|
- **AgentName**: a normalized dotted name under `.agent` (a facet label).
|
|
72
72
|
- **Label**: one segment of a name, such as `treasury`.
|
|
73
|
-
- **Node**:
|
|
73
|
+
- **Node**: the recursive `namehash(name)`.
|
|
74
74
|
- **Registry**: owns name records: owner, resolver, parent, subregistry.
|
|
75
75
|
- **Resolver**: stores typed records for a node.
|
|
76
76
|
- **Primary name**: reverse record for a Smart Agent address.
|
package/dist/namehash.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type Hex } from 'viem';
|
|
2
2
|
/**
|
|
3
|
-
* Compute the namehash of an agent name
|
|
3
|
+
* Compute the recursive namehash of an agent name
|
|
4
|
+
* (`keccak256(parentNode || labelhash)` convention).
|
|
4
5
|
*
|
|
5
6
|
* namehash('') = 0x00…00
|
|
6
7
|
* namehash('agent') = keccak256(namehash('') || labelhash('agent'))
|
|
@@ -13,7 +14,7 @@ import { type Hex } from 'viem';
|
|
|
13
14
|
*
|
|
14
15
|
* Throws `InvalidNameError` (via `normalizeAgentName`) on malformed
|
|
15
16
|
* input. Passing `''` returns `0x00…00` — the canonical "empty / root"
|
|
16
|
-
* sentinel matching the
|
|
17
|
+
* sentinel matching the recursive-namehash convention.
|
|
17
18
|
*/
|
|
18
19
|
export declare function namehash(name: string): Hex;
|
|
19
20
|
/**
|
package/dist/namehash.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"namehash.d.ts","sourceRoot":"","sources":["../src/namehash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoC,KAAK,GAAG,EAAE,MAAM,MAAM,CAAC;AAGlE
|
|
1
|
+
{"version":3,"file":"namehash.d.ts","sourceRoot":"","sources":["../src/namehash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoC,KAAK,GAAG,EAAE,MAAM,MAAM,CAAC;AAGlE;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAW1C;AAED;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CAE5C;AAED,sEAAsE;AACtE,eAAO,MAAM,SAAS,EAAE,GAA0E,CAAC"}
|
package/dist/namehash.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { keccak256, encodePacked, toBytes } from 'viem';
|
|
2
2
|
import { normalizeAgentName } from './normalize';
|
|
3
3
|
/**
|
|
4
|
-
* Compute the namehash of an agent name
|
|
4
|
+
* Compute the recursive namehash of an agent name
|
|
5
|
+
* (`keccak256(parentNode || labelhash)` convention).
|
|
5
6
|
*
|
|
6
7
|
* namehash('') = 0x00…00
|
|
7
8
|
* namehash('agent') = keccak256(namehash('') || labelhash('agent'))
|
|
@@ -14,7 +15,7 @@ import { normalizeAgentName } from './normalize';
|
|
|
14
15
|
*
|
|
15
16
|
* Throws `InvalidNameError` (via `normalizeAgentName`) on malformed
|
|
16
17
|
* input. Passing `''` returns `0x00…00` — the canonical "empty / root"
|
|
17
|
-
* sentinel matching the
|
|
18
|
+
* sentinel matching the recursive-namehash convention.
|
|
18
19
|
*/
|
|
19
20
|
export function namehash(name) {
|
|
20
21
|
if (name === '')
|
|
@@ -22,7 +23,7 @@ export function namehash(name) {
|
|
|
22
23
|
const labels = normalizeAgentName(name).split('.');
|
|
23
24
|
let node = ZERO_NODE;
|
|
24
25
|
// Walk from rightmost (TLD-side) label inward so the root anchors
|
|
25
|
-
// the recursion —
|
|
26
|
+
// the recursion — the standard recursive-namehash algorithm.
|
|
26
27
|
for (let i = labels.length - 1; i >= 0; i--) {
|
|
27
28
|
const lh = labelhash(labels[i]);
|
|
28
29
|
node = keccak256(encodePacked(['bytes32', 'bytes32'], [node, lh]));
|
package/dist/namehash.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"namehash.js","sourceRoot":"","sources":["../src/namehash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,OAAO,EAAY,MAAM,MAAM,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD
|
|
1
|
+
{"version":3,"file":"namehash.js","sourceRoot":"","sources":["../src/namehash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,OAAO,EAAY,MAAM,MAAM,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAY;IACnC,IAAI,IAAI,KAAK,EAAE;QAAE,OAAO,SAAS,CAAC;IAClC,MAAM,MAAM,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACnD,IAAI,IAAI,GAAQ,SAAS,CAAC;IAC1B,kEAAkE;IAClE,6DAA6D;IAC7D,KAAK,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC5C,MAAM,EAAE,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAE,CAAC,CAAC;QACjC,IAAI,GAAG,SAAS,CAAC,YAAY,CAAC,CAAC,SAAS,EAAE,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IACrE,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,SAAS,CAAC,KAAa;IACrC,OAAO,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;AACnC,CAAC;AAED,sEAAsE;AACtE,MAAM,CAAC,MAAM,SAAS,GAAQ,oEAAoE,CAAC"}
|
package/docs/api.md
CHANGED
|
@@ -7,7 +7,7 @@ This is the human-readable guide to the public exports in
|
|
|
7
7
|
|
|
8
8
|
- `AGENT_TLD`: the canonical top-level label, currently `"agent"`.
|
|
9
9
|
- `AgentTld`: type of the canonical top-level label.
|
|
10
|
-
- `ZERO_NODE`: the all-zero
|
|
10
|
+
- `ZERO_NODE`: the all-zero root node.
|
|
11
11
|
|
|
12
12
|
## Name Helpers
|
|
13
13
|
|
|
@@ -15,7 +15,7 @@ This is the human-readable guide to the public exports in
|
|
|
15
15
|
throws `InvalidNameError`.
|
|
16
16
|
- `isValidAgentName(name)`: boolean wrapper around `normalizeAgentName`.
|
|
17
17
|
- `labelhash(label)`: keccak256 hash of a single label.
|
|
18
|
-
- `namehash(name)`:
|
|
18
|
+
- `namehash(name)`: recursive namehash (`keccak256(parentNode || labelhash)`) of a normalized name.
|
|
19
19
|
|
|
20
20
|
## Client
|
|
21
21
|
|
package/docs/concepts.md
CHANGED
|
@@ -43,7 +43,7 @@ This avoids Unicode spoofing until a full IDN/punycode policy exists.
|
|
|
43
43
|
|
|
44
44
|
## Node And Namehash
|
|
45
45
|
|
|
46
|
-
A node is the
|
|
46
|
+
A node is the recursive `bytes32` namehash (`keccak256(parentNode || labelhash)`) of a normalized name.
|
|
47
47
|
|
|
48
48
|
```ts
|
|
49
49
|
namehash('agent');
|
package/docs/migration.md
CHANGED
|
@@ -90,4 +90,4 @@ Expected future migration areas:
|
|
|
90
90
|
- Generated API docs or manifest-doc synchronization.
|
|
91
91
|
- Example typecheck enforcement.
|
|
92
92
|
- Stable deployment address package.
|
|
93
|
-
- Optional compatibility layer for external
|
|
93
|
+
- Optional compatibility layer for external on-chain name resolvers.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agenticprimitives/agent-naming",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
4
|
-
"description": "Agent Naming Service SDK:
|
|
3
|
+
"version": "1.0.0-alpha.5",
|
|
4
|
+
"description": "Agent Naming Service SDK: hierarchical naming for Smart Agents (.agent TLD). Owns name normalization, namehash/labelhash, records schemas, and the AgentNamingClient (resolve / reverse / registry). Speaks naming-domain vocabulary only — no delegation / caveat / custody concepts.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -43,19 +43,19 @@
|
|
|
43
43
|
"access": "public"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"viem": "^2.
|
|
47
|
-
"@agenticprimitives/agent-account": "1.0.0-alpha.
|
|
48
|
-
"@agenticprimitives/connect-auth": "1.0.0-alpha.
|
|
49
|
-
"@agenticprimitives/types": "1.0.0-alpha.
|
|
46
|
+
"viem": "^2.52.2",
|
|
47
|
+
"@agenticprimitives/agent-account": "1.0.0-alpha.5",
|
|
48
|
+
"@agenticprimitives/connect-auth": "1.0.0-alpha.5",
|
|
49
|
+
"@agenticprimitives/types": "1.0.0-alpha.5"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@types/node": "^22.7.0",
|
|
53
|
-
"vitest": "^
|
|
53
|
+
"vitest": "^4.1.8"
|
|
54
54
|
},
|
|
55
55
|
"keywords": [
|
|
56
56
|
"agent",
|
|
57
57
|
"naming",
|
|
58
|
-
"
|
|
58
|
+
"namehash",
|
|
59
59
|
"smart-agent",
|
|
60
60
|
"agentic"
|
|
61
61
|
],
|