Commit 180826c
authored
feat!: migrate Role Manager to operator profile runtime (#96)
* feat(role-manager): adopt capability-adapters runtime architecture
Migrate from monolithic ContractAdapter to profile-based EcosystemRuntime:
- Replace AdapterProvider with RuntimeProvider, getAdapter with getRuntime
- Introduce RoleManagerRuntime (OperatorEcosystemRuntime + relayer) and
RoleManagerAdapter compatibility shim for incremental hook migration
- Add legacyOperatorRuntime bridge for adapters still on createAdapter
- Migrate WalletSyncProvider to activeRuntime API with ecosystem-scoped
wallet session support and simplified chain switch logic
- Update all hooks/tests from ContractAdapter to RoleManagerAdapter types
- Remove broken contract-adapter-compat.d.ts
* chore(role-manager): temporary legacy support
* feat(role-manager): remove legacy operator runtime and map adapter-evm-core locally
Require createRuntime for operator profile.
Extend pnpmfile for adapter-evm-core local dev.
* feat(role-manager): add runtime disposal lifecycle to useNetworkAdapter
Apply the same promote-then-dispose handoff pattern from the shared
RuntimeProvider/WalletStateProvider layer to the app-local runtime
path. Superseded runtimes are disposed after their replacement is
promoted to state, cancelled loads are disposed immediately, and the
active runtime is disposed on unmount. Disposal is deferred via
setTimeout to avoid RuntimeDisposedError in React's dev-mode commit
phase. Updates tests to assert correct disposal behavior.
* refactor(role-manager): remove RoleManagerAdapter compatibility layer
Migrate all production code and tests from the flattened
RoleManagerAdapter interface to capability-qualified
RoleManagerRuntime access (runtime.addressing, runtime.explorer,
runtime.accessControl, runtime.query, runtime.contractLoading,
runtime.relayer). Remove toRoleManagerAdapter(), getAdapter(),
getAccessControlService(), and the dual-path fallback in
useAccessControlService / useContractRegistration.
* chore(deps): regenerate lockfile without local dev tarball paths
* chore(deps): update @OpenZeppelin/ui-* to latest published versions
* feat(deps): bump @OpenZeppelin/ui-* deps to ^2.0.0
* fix(role-manager): suppress exhaustive-deps for intentional ID-only tracking
* feat(ci): add RC adapter resolution for staging builds (#97)
Port the RC adapter resolution mechanism from ui-builder so staging
Docker builds can consume pre-release adapter packages.
- Add scripts/resolve-staging-adapters.cjs that queries npm for "rc"
and "latest" dist-tags, picks the newer version, and runs a surgical
pnpm add --save-exact for adapter packages only.
- Update Dockerfile with ADAPTER_DIST_TAG build arg and resolution step
between frozen-lockfile install and build.
- Pass ADAPTER_DIST_TAG=rc in the staging workflow build-args.
* feat(deps): bump adapter packages to ^2.0.0 with pre-release resolution
Bump all @openzeppelin/adapter-* and adapters-vite dependencies to
^2.0.0 for the capability adapters migration.
Extend .pnpmfile.cjs to widen adapter caret ranges to include
pre-release versions during resolution, so pnpm can resolve to RC
packages when the stable version hasn't shipped yet. Once stable
2.0.0 is published, pnpm naturally resolves to it instead.
* fix(role-manager): align test mocks and component with v2 runtime API
- WalletSyncProvider: read activeRuntime/isRuntimeLoading, pass wallet +
networkCatalog as separate props to NetworkSwitchManager, skip chain
switch on initial sync and cross-ecosystem switches
- Nest getExplorerUrl/getExplorerTxUrl under runtime.explorer in mocks
- Update error assertions from "runtime" to "adapter" wording
- Fix fake timer cascading timeouts in useNetworkAdapter tests
* fix(role-manager): address PR review feedback
- Use Object.create instead of spread in attachRelayerCapability to
preserve runtime proxy behavior and object identity
- Use execFileSync in resolve-staging-adapters to prevent shell injection
- Include @openzeppelin/adapters-vite in prerelease version widening
- Update stale adapter terminology in comments, variables, JSDoc, and
user-facing copy to use runtime language
* fix(role-manager): update lockfile pnpmfileChecksum
The previous commit modified .pnpmfile.cjs without updating the
lockfile checksum, causing CI to fail with
ERR_PNPM_LOCKFILE_CONFIG_MISMATCH on --frozen-lockfile.
* fix(role-manager): address second round of PR review feedback
- Use execFileSync for pnpm add in resolve-staging-adapters to eliminate
remaining shell injection vector; remove unused execSync import
- Dispose runtime immediately after extracting addressing capability in
AddressBook.resolveAddressing to prevent resource leaks
- Dispose previous promoted runtime on getRuntime error path in
useNetworkAdapter so stale connections don't persist
- Update Dockerfile comment to reflect that .pnpmfile.cjs now also runs
the prerelease-widening hook (not purely a no-op in Docker)
* fix(role-manager): update stale adapter terminology in JSDoc and comments
- useContractSchema: @param now says "runtime" instead of "adapter"
- useExpirationMetadata: file-level JSDoc updated to reference runtime's
accessControl capability instead of "adapter.getExpirationMetadata()"
- AddContractDialog: inline comment updated to "Runtime for schema loading"
* fix(role-manager): harden parseSemver in resolve-staging-adapters
Strip build metadata (+...) before parsing and validate that
major/minor/patch are finite numbers to avoid silent NaN comparisons.
* fix(role-manager): update stale adapter terminology and harden pickBestVersion
- useExpirationMetadata guard comment now references runtime/accessControl
- App.tsx provider-hierarchy comment updated to "runtime session"
- pickBestVersion only prefers latest over rc when latest is a stable
(non-prerelease) release, preventing incorrect downgrades
* fix(role-manager): correct caret upper bound for 0.x ranges in pnpmfile
allowAdapterPrereleases now computes the caret ceiling correctly for
major-zero ranges (^0.3.0 -> <0.4.0 instead of <1.0.0), matching
npm/pnpm caret semantics and preventing unintended major upgrades.1 parent 6f4261d commit 180826c
File tree
85 files changed
+2272
-1535
lines changed- .github/workflows
- apps/role-manager
- src
- components
- Admin
- Contracts
- Ownership
- Roles
- context
- __tests__
- core
- ecosystems
- hooks
- __tests__
- pages
- types
- utils
- scripts
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
85 files changed
+2272
-1535
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
| 217 | + | |
217 | 218 | | |
218 | 219 | | |
219 | 220 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
| |||
210 | 212 | | |
211 | 213 | | |
212 | 214 | | |
213 | | - | |
214 | | - | |
215 | | - | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
216 | 243 | | |
| 244 | + | |
217 | 245 | | |
218 | | - | |
219 | | - | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
220 | 250 | | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
225 | 255 | | |
226 | | - | |
| 256 | + | |
| 257 | + | |
227 | 258 | | |
228 | 259 | | |
| 260 | + | |
| 261 | + | |
229 | 262 | | |
230 | 263 | | |
231 | 264 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
36 | | - | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
| 40 | + | |
39 | 41 | | |
40 | | - | |
| 42 | + | |
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
44 | 57 | | |
45 | 58 | | |
46 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
| 29 | + | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
77 | 75 | | |
78 | 76 | | |
79 | | - | |
| 77 | + | |
80 | 78 | | |
81 | | - | |
| 79 | + | |
82 | 80 | | |
83 | 81 | | |
84 | | - | |
| 82 | + | |
85 | 83 | | |
86 | 84 | | |
87 | 85 | | |
| |||
124 | 122 | | |
125 | 123 | | |
126 | 124 | | |
127 | | - | |
| 125 | + | |
128 | 126 | | |
129 | 127 | | |
130 | 128 | | |
| |||
183 | 181 | | |
184 | 182 | | |
185 | 183 | | |
186 | | - | |
| 184 | + | |
187 | 185 | | |
188 | 186 | | |
189 | 187 | | |
| |||
Lines changed: 14 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| |||
270 | 270 | | |
271 | 271 | | |
272 | 272 | | |
273 | | - | |
| 273 | + | |
274 | 274 | | |
275 | | - | |
276 | | - | |
| 275 | + | |
| 276 | + | |
277 | 277 | | |
278 | 278 | | |
279 | 279 | | |
| |||
325 | 325 | | |
326 | 326 | | |
327 | 327 | | |
328 | | - | |
329 | | - | |
| 328 | + | |
| 329 | + | |
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
| |||
341 | 341 | | |
342 | 342 | | |
343 | 343 | | |
344 | | - | |
345 | | - | |
| 344 | + | |
| 345 | + | |
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
| |||
395 | 395 | | |
396 | 396 | | |
397 | 397 | | |
398 | | - | |
399 | | - | |
| 398 | + | |
| 399 | + | |
400 | 400 | | |
401 | 401 | | |
402 | 402 | | |
| |||
422 | 422 | | |
423 | 423 | | |
424 | 424 | | |
425 | | - | |
426 | | - | |
| 425 | + | |
| 426 | + | |
427 | 427 | | |
428 | 428 | | |
429 | 429 | | |
430 | 430 | | |
431 | | - | |
| 431 | + | |
432 | 432 | | |
433 | 433 | | |
434 | 434 | | |
| |||
502 | 502 | | |
503 | 503 | | |
504 | 504 | | |
505 | | - | |
| 505 | + | |
506 | 506 | | |
507 | 507 | | |
508 | 508 | | |
| |||
Lines changed: 10 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
| 105 | + | |
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
| 156 | + | |
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
165 | | - | |
| 165 | + | |
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
| |||
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
289 | | - | |
290 | | - | |
| 289 | + | |
| 290 | + | |
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
295 | 295 | | |
296 | | - | |
| 296 | + | |
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
| |||
324 | 324 | | |
325 | 325 | | |
326 | 326 | | |
327 | | - | |
| 327 | + | |
328 | 328 | | |
329 | 329 | | |
330 | 330 | | |
| |||
0 commit comments