feat: gate mod/deploy/decentralize/deploy-all behind a revealed builder identity#413
Merged
Merged
Conversation
…er identity The value-creating commands (mod, init, deploy, decentralize, deploy-all) now require the signed-in session's product account to have revealed itself on-chain via the playground-app. Anonymous accounts earn no competition points, so the CLI refuses to act for them. The gate derives the product H160 signer-free from the persisted session and reads playground-registry.getRootAccount via the keyless read-only origin (no phone tap, no mapping/funding needed). A non-zero bytes32 means revealed; the 32-zero-byte sentinel means anonymous — the same predicate the playground-app uses. It is signer-mode-agnostic: dev mode and --suri are gated too, but once revealed they work as before. Blocked outcomes (not logged in, anonymous, or an unverifiable read) render a friendly yellow callout and exit 0 (soft). Revealed users proceed silently.
Contributor
E2E Test Pass · ❌ FAILTag:
Sentry traces: view spans for this run |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Reserves the value-creating commands —
mod,init,deploy,decentralize,deploy-all— for users who have revealed themselves (bound a verified identity on-chain via the playground-app's "Become a builder" flow). Anonymous accounts earn no competition points, so the CLI now refuses to act for them.How it works
playground-registry.getRootAccount(productH160)returns a non-zerobytes32. Anonymous accounts read back as the 32-zero-byte sentinel (the contractunwrap_ors a missing binding to zero and never reverts) — the exact predicate the playground-app uses (hasRevealedIdentityvsZERO_ROOT).findSession→deriveSessionAddresses) and the read uses the keyless read-only revive origin (getReadOnlyRegistryContract), so evaluating the gate needs no phone tap, no account mapping, and no funding.--suriare gated too — the gate checks the session's reveal status, not the signing key. Once revealed, dev mode works exactly as before.revealedproceeds silently (no UI flash on the happy path);not-logged-in,anonymous, andunverifiable(read failure → fail-closed) each render a yellow callout and exit 0 (soft, actionable — mirrorsdrip/status).initis gated because it delegates torunModCommand.Structure
src/utils/identity/identityGate.ts— pure logic (no React/Ink):checkIdentityGate+isAnonymousRoot.src/commands/shared/—IdentityGateNotice.tsx(yellowCallout),identityGateCopy.ts(testable copy),gateOrNotice.ts(enforceIdentityGate).Tests
21 new unit tests (
identityGate,identityGateCopy,gateOrNotice). Full suite 994 pass;typecheck,format:check,lint:licenseall clean. Changeset included (minor).The e2e tests drive
mod/deploy/decentralizewith--suriand no logged-in session, so the gate (correctly) blocks them. This is an intended behavior change, not a logic bug — but the e2e harness needs a revealed-session fixture (and its deployer account revealed on-chain) before the e2e matrix is green again. I deliberately did not weaken the gate or add an env bypass. Tracking the e2e session story as a follow-up.