Skip to content

feat(decentralize): interactive TUI + deploy-flow integration#211

Merged
UtkarshBhardwaj007 merged 6 commits into
mainfrom
feat/decentralize-interactive
May 26, 2026
Merged

feat(decentralize): interactive TUI + deploy-flow integration#211
UtkarshBhardwaj007 merged 6 commits into
mainfrom
feat/decentralize-interactive

Conversation

@UtkarshBhardwaj007
Copy link
Copy Markdown
Member

Summary

Builds on #181 (feat/decentralize, rebased onto current main) and makes dot decentralize a first-class interactive command that reuses the existing dot deploy publish machinery.

  • Interactive modedot decentralize with no --site opens an Ink TUI: a yellow advisory callout, site URL prompt, dev/phone signer picker, .dot name prompt with live availability check, a publish-to-playground prompt, a confirm card, and a deploy-style step-row progress view (mirror / upload+dotns / publish) with a throttled latest-log line.
  • Headless unchangeddot decentralize --site=... keeps its existing contract (the demo service that passes --suri=//Bob is unaffected). Added an opt-in --playground flag for registry-publish parity.
  • Deploy-flow integration — the runner threads (mode, userSigner) through deploy's resolveSignerSetup and calls publishToPlayground, so dev-mode-with-session records the user's H160 as the registry owner. Mirrored sites publish with repositoryUrl: null and isModdable: false (no GitHub source).
  • Phone-signing prompts — phone mode now surfaces the "check your phone" callout (and a headless text equivalent) via deploy's signing-event proxy, so users know to approve on their device.

Bug fixes folded in

  • Unrenderable siteswget --no-host-directories keeps URL path segments as subdirectories, so https://host/foo/ wrote index.html one level below the upload root and Bulletin's viewer returned "Archive missing index.html". findIndexHtmlRoot now resolves the real document root before upload. Verified against https://utkarshbhardwaj007.github.io/visualise-agents/.
  • Auto-exit the done/error screens instead of waiting for a keypress.
  • Renamed createAliceSignerForDevPublishcreateDevPublishSigner (it is not Substrate's //Alice) and exported it for reuse.

Notes

  • Points/XP are awarded by the registry contract on publish(); dev-signer publishes carry is_dev_signer=true and earn 0 (anti-abuse). Phone-mode publishes earn launch_points — same rule as dot deploy.
  • The "owned by a development account" callout intentionally fires for all dev-mode runs: it refers to DotNS domain ownership (dev-signed in dev mode regardless of the registry-level claimedOwnerH160).

Test plan

  • pnpm format:check, pnpm lint:license, pnpm build, pnpm test — 593 passed / 1 skipped
  • Mirror render fix verified on the reported URL (index.html resolves at the upload root)
  • Manual: dot decentralize interactive end-to-end on paseo-next-v2 (dev + phone signers)
  • Manual: confirm phone-mode signing prompts appear

shawntabrizi and others added 6 commits May 26, 2026 16:24
Before, `dot decentralize --site=example.com` picked a random
`decent-ffe0ab72.dot`. The label was unrecognisable in the resulting
`.dot.li` URL and gave the user no clue which site they were
mirroring.

After, the auto-name starts with a dumb transliteration of the URL's
hostname (lowercase, dots → hyphens, sanitised to `[a-z0-9-]`, capped
at 30 chars), followed by a 4-letter random tail + 2 digits. No TLD
or `www.` stripping — that requires the Public Suffix List, which we
don't want as a dep; users who want a clean name pass `--dot`
explicitly. Falls back to the legacy `decent-` shape for unparseable
inputs.

  example.com            → example-com-uslj17.dot
  shawntabrizi.com       → shawntabrizi-com-byhq57.dot
  shawntabrizi.github.io → shawntabrizi-github-io-<rand>NN.dot

Also fixes a latent classifier bug. The previous hex-based suffix
produced labels with >2 trailing digits ~62% of the time (whenever
the random hex happened to end in a digit), classified as RESERVED
and silently masked by the 20-attempt retry loop. The new generator
uses lowercase letters only in the variable middle so the trailing-
digit invariant holds for every call.

New test file covers the invariants across 200 iterations: exactly
2 trailing digits, base length ≥9 (NoStatus), normalizeDomain regex
compatibility, plus the hostname-incorporation cases.
Add an interactive flow to `dot decentralize` and wire it through deploy's
existing publish machinery.

- `dot decentralize` with no `--site` opens an Ink TUI: yellow advisory
  callout, site URL prompt, dev/phone signer picker, `.dot` name prompt with
  live availability check, publish-to-playground prompt, confirm, and a
  deploy-style step-row progress view (mirror / upload+dotns / publish) with a
  throttled latest-log line.
- The headless `dot decentralize --site=...` contract is unchanged; add an
  opt-in `--playground` flag for registry publish parity.
- Runner threads `(mode, userSigner)` through deploy's `resolveSignerSetup`
  and calls `publishToPlayground` so dev-mode-with-session records the user's
  H160 as owner; mirrored sites publish with `repositoryUrl: null` and
  `isModdable: false`.
- Phone-mode signing surfaces the "check your phone" callout (and a headless
  equivalent) via deploy's signing-event proxy.
- Fix unrenderable sites: `wget --no-host-directories` keeps URL path segments
  as subdirs, so `index.html` landed below the upload root and Bulletin's
  viewer reported "Archive missing index.html". `findIndexHtmlRoot` resolves
  the real document root before upload.
- Auto-exit the done/error screens instead of waiting for a keypress.
- Rename `createAliceSignerForDevPublish` to `createDevPublishSigner` and
  export it for reuse (the name is not Substrate's //Alice).

Tests: stage machine, URL/domain validators, mirror helpers
(findIndexHtmlRoot, WgetMissingError, empty-mirror), and the deploy-event
formatter.
@github-actions
Copy link
Copy Markdown
Contributor

Dev build ready — try this branch:

curl -fsSL https://raw.githubusercontent.com/paritytech/playground-cli/main/install.sh | VERSION=dev/feat/decentralize-interactive bash

@UtkarshBhardwaj007 UtkarshBhardwaj007 merged commit 42a2e6a into main May 26, 2026
19 checks passed
@UtkarshBhardwaj007 UtkarshBhardwaj007 deleted the feat/decentralize-interactive branch May 26, 2026 20:24
@github-actions
Copy link
Copy Markdown
Contributor

E2E Test Pass · ✅ PASS

Tag: e2e-ci-pr · Branch: feat/decentralize-interactive · Commit: 293099f · Run logs

Cell Result Time
pr-preflight ✅ PASS 1m13s
pr-mod ✅ PASS 1m23s
pr-deploy-frontend ✅ PASS 3m14s
pr-deploy-cdm ✅ PASS 2m07s
pr-deploy-foundry ✅ PASS 0m42s
pr-init-session ✅ PASS 3m04s
pr-install ✅ PASS 0m42s
${{ matrix.cell }} ⏭️ SKIP 0m00s
${{ matrix.cell }} ⏭️ SKIP 0m-1s

Sentry traces: view spans for this run

ottovlotto added a commit that referenced this pull request May 27, 2026
Update product context to v0.18 scoring overhaul, tutorial rename
(Rock Paper Scissors, not "The Stadium"), stars one-way (CR2),
display name precedence (registry username → wallet name → H160),
sample apps status (Feedback Board built, others candidates), and
prize logistics (4-way $500 split). Drop adjective-noun display
name model; drop per-feature build statuses; trim items now
resolved ("modded-from capture not yet built", "parallelised dep
install not yet built") that have since landed.

Also adds the v0.18 backlog items now in scope (mobile signing hang
detection, up-front phone approval count, dot mod post-clone UX) and
the dot decentralize command that shipped under PR #211 (spec calls
this V2.5 dot import).
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