Commit f3df4a4
authored
Resolve bare DID aliases for trust and cert lookups (#9)
* Resolve bare DID aliases for trust and cert lookups
Public profile and CLI surfaces accept bare z6Mk keys, but trust and certificate data are stored against full did:key identities. Normalize agent profile lookups and make cert commands resolve owner-less repos against the caller DID so valid pushes are not hidden behind node-owned paths.
Constraint: Public URLs and CLI examples commonly use short z6Mk identifiers
Constraint: Ref certificates are issued after push and stored under the owner repo id
Rejected: Register duplicate bare-key identities | would split trust and certificate history across aliases
Rejected: Require full certificate UUIDs in show output | list already displays short IDs as the human-facing handle
Confidence: high
Scope-risk: narrow
Directive: Keep bare key inputs as aliases for did:key, not separate identities
Tested: cargo check -p gl
Tested: cargo run -q -p gl -- cert list agentbot-opensource
Tested: cargo run -q -p gl -- cert show agentbot-opensource 3686b1fe
Tested: cargo check -p gitlawb-node
Tested: cargo test -p gitlawb-node normalize_agent_did
* Preserve agent rank on short profile URLs
The public profile route can use compact handles like z6MkpUq1, while trust history is stored under the full did:key identity. Resolve exact aliases first, then fall back to matching registered agent key prefixes so older high-level identities are not displayed as fresh newcomers.
Constraint: Public GitLawb profile URLs expose short z6Mk handles.
Constraint: Trust and push history remain keyed by canonical did:key identities.
Rejected: Mint duplicate short-handle agent rows | would split rank and push history across aliases.
Confidence: high
Scope-risk: narrow
Directive: Keep short profile handles as aliases for canonical did:key identities, never as separate trust principals.
Tested: cargo fmt --check -p gitlawb-node
Tested: cargo test -p gitlawb-node agent
Tested: cargo check -p gitlawb-node
Tested: cargo check -p gl1 parent 034cb3c commit f3df4a4
2 files changed
Lines changed: 111 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
11 | 42 | | |
12 | 43 | | |
13 | 44 | | |
| |||
66 | 97 | | |
67 | 98 | | |
68 | 99 | | |
| 100 | + | |
69 | 101 | | |
70 | 102 | | |
71 | | - | |
| 103 | + | |
72 | 104 | | |
73 | | - | |
| 105 | + | |
74 | 106 | | |
75 | 107 | | |
76 | 108 | | |
| |||
88 | 120 | | |
89 | 121 | | |
90 | 122 | | |
91 | | - | |
92 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
93 | 126 | | |
94 | 127 | | |
95 | 128 | | |
96 | | - | |
| 129 | + | |
97 | 130 | | |
98 | 131 | | |
99 | 132 | | |
100 | 133 | | |
101 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
44 | | - | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
58 | 64 | | |
59 | 65 | | |
60 | 66 | | |
| |||
94 | 100 | | |
95 | 101 | | |
96 | 102 | | |
| 103 | + | |
97 | 104 | | |
98 | 105 | | |
99 | 106 | | |
100 | | - | |
| 107 | + | |
101 | 108 | | |
102 | 109 | | |
103 | | - | |
104 | | - | |
| 110 | + | |
105 | 111 | | |
| 112 | + | |
106 | 113 | | |
107 | 114 | | |
108 | 115 | | |
| |||
155 | 162 | | |
156 | 163 | | |
157 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
0 commit comments