Skip to content

feat(ui): run Nondominium as a Moss tool in weave dev mode - #180

Merged
Soushi888 merged 1 commit into
devfrom
feat/moss-tool-scaffold
Nov 4, 2026
Merged

Soushi888 merged 1 commit into
devfrom
feat/moss-tool-scaffold

Conversation

@Soushi888

@Soushi888 Soushi888 commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

SoushAI analysis. Drafted by Soushi's AI assistant, reviewed and posted by @Soushi888.

Summary

Nondominium now starts as a Moss tool in weave dev mode. bun run tool-dev runs the UI on :8888 and two Moss windows, Alice and Bob, in one group, with the tool served from localhost. The UI detects Moss, connects through the applet client Moss hands it, and shows its own pages inside Moss. The standalone connection modes are untouched. Group context (#164) and NDOs as assets (#165) come next in the stack.

Closes #163

Stacked on #178 (docs: publish the Holochain 0.7.1 DNA hashes), itself stacked on #130 (chore/holochain-0.7). Review only this layer's diff; everything below belongs to the parent PR.

GitHub already held #130 and #178 as a native stack (#179) and a stack can only be extended, so this layer sits on #178: rebased onto docs/161-dna-hashes (no conflicts) and retargeted from chore/holochain-0.7. It touches CHANGELOG.md and IMPLEMENTATION_STATUS.md like #178 does, in different sections.

Intent

The UI had no @theweave/* dependency and no applet entry point, so Moss could not load Nondominium as a tool. This is the base the rest of the Moss pilot builds on. Decisions already taken (2026-11-03): the pilot runs the weave CLI in dev mode, Moss only for v0.1.0, standalone keeps compiling and running unchanged.

Changes
  • weave/: a separate package (not in the root workspaces, so CI and the standalone build never install Electron) with weave.dev.config.ts (two agents, one group Nondominium Pilot, tool from localhost:8888, .happ from workdir/), @theweave/cli pinned to 0.16.0-rc.5, and the tsconfig and tslib the CLI needs to load a TypeScript config.
  • Root scripts: moss:install, tool-dev (Vite plus both agents), tool-dev-1.
  • ui/: @theweave/api 0.7.0-rc.3, and src/lib/moss/ with host.ts (pure host detection), connect.ts (initializeHotReload when needed, then WeaveClient.connect, injectable for tests) and applet-services.ts (an empty AppletServices; feat(moss): NDOs as Moss assets #165 fills it).
  • utils/hc-connect.ts: a moss connection mode, checked first. holochain.service takes an AppClient instead of an AppWebsocket and exposes the moss connection.
  • ui/static/icon.png (128 px, Moss limits group icons to about 200 KB; the logo is 308 KB), ui/static/weave.config.json, and workdir/moss.yaml pointed at the icon that exists.
  • Docs: new documentation/specifications/moss-integration.md; ui_architecture.md (§3 and §15.4), lobby-architecture.md §9 (marked partly superseded), IMPLEMENTATION_STATUS.md, DOCUMENTATION_INDEX.md, SUMMARY.md, CHANGELOG.md.
Decisions
Option Rejected because
weave.dev.config.ts at the repo root with @theweave/cli in the root devDependencies It would pull Electron and about 55 MB of Holochain binaries into every bun install, CI included. A separate weave/ package installs on demand with bun run moss:install.
Detect Moss with isWeaveContext() from @theweave/api In dev mode it is false until the iframe script is loaded, and the iframe script is what initializeHotReload fetches. Detection has to rely on the page: the applet:// protocol, an injected __WEAVE_API__, or a dev-build iframe carrying the iframe-kind hash Moss appends.
Change workdir/happ.yaml Not needed: the #162 spike showed Moss installs the manifest unchanged, deferred roles included.
How to test
git checkout feat/moss-tool-scaffold
nix develop -c bun run build:happ        # needs the hREA submodule: git submodule update --init --recursive
nix develop -c bun run moss:install
nix develop -c bun run tool-dev          # two Moss windows; click the group, then the tool
nix develop -c bun run --filter ui check
nix develop -c bash -c 'cd ui && bunx vitest run --project server'
nix develop -c bun run e2e

Recorded run (2026-11-03, two agents, nested X server): the repo's own config created the group, installed the tool in both agents, and the tool iframe logged Connected to Holochain (moss) at moss://applet. The tool rendered inside Moss with the standalone Lobby profile form, which #164 replaces with the Moss profile.

Documentation

Updated in this PR: documentation/specifications/moss-integration.md (new), ui_architecture.md, lobby-architecture.md §9, IMPLEMENTATION_STATUS.md, DOCUMENTATION_INDEX.md, SUMMARY.md, CHANGELOG.md.

Related

Pre-open review

  • Description: disclosure line first, visible Summary, details folded, Closes #163, stack position stated. Pass.
  • Merge state: in sync with docs/161-dna-hashes (2354947), no conflicts. Pass.
  • Code: reviewed the diff (hc-connect mode order, AppClient widening, cachedAppInfo guard, host detection, weave/ config typechecked with tsc). Standalone path is reached only when the host is not Moss; the e2e suite exercises it. No blockers.
  • Documentation: new specification plus the five existing documents that describe connection modes, status and the Moss contract. Pass.
  • Tests: 19 new unit tests (host 7, connect 6, applet services 4, hc-connect 2); server project 100 passed. The client project has one failure, /+page.svelte > should render lobby heading (effect_orphan in melt), which fails identically on chore/holochain-0.7 (81 passed, 1 failed there). bun run --filter ui check: 0 errors, 0 warnings. bun run e2e: 23 passed.
  • Test exhaustivity: the Moss connection is covered by a recorded two-agent dev-mode run (above) plus the unit seam tests; the standalone path by the unchanged e2e suite. The asset and group-context behaviours are out of scope here.
  • Open for the reader: weave pops one Electron window per agent; the recorded run used a nested X server.

@Soushi888
Soushi888 force-pushed the feat/moss-tool-scaffold branch from 287e834 to 376f8d1 Compare November 4, 2026 01:39
@Soushi888
Soushi888 changed the base branch from chore/holochain-0.7 to docs/161-dna-hashes November 4, 2026 01:39
@Soushi888
Soushi888 added this pull request to stack #179 November 4, 2026 01:39
@Soushi888
Soushi888 marked this pull request as ready for review November 4, 2026 02:26
@Soushi888
Soushi888 force-pushed the feat/moss-tool-scaffold branch from 376f8d1 to 449c399 Compare November 4, 2026 02:45
Base automatically changed from docs/161-dna-hashes to dev November 4, 2026 03:51
@Soushi888
Soushi888 marked this pull request as draft November 4, 2026 03:51
Adds weave/ (dev config with two agents and one group, kept outside the root
workspaces so CI never installs Electron), bun run tool-dev, @theweave/api in
ui/, and ui/src/lib/moss/: host detection, the Moss connection mode and an
empty AppletServices. The standalone connection modes are unchanged.

Documents the Moss integration in documentation/specifications/moss-integration.md.
@Soushi888
Soushi888 force-pushed the feat/moss-tool-scaffold branch from 449c399 to d499831 Compare November 4, 2026 03:52
@Soushi888
Soushi888 marked this pull request as ready for review November 4, 2026 04:15
@Soushi888

Copy link
Copy Markdown
Collaborator Author

SoushAI analysis. Drafted by Soushi's AI assistant, reviewed and posted by @Soushi888.

Review APPROVE at head d499831, merging under Soushi's explicit -mwr authorisation (2026-11-03 21:42).

  • This head is a rebase of the reviewed commit (449c399) onto dev after docs(adr): record that work contexts live in the group DHT #172 and docs: publish the Holochain 0.7.1 DNA hashes #178 merged. The only change is in documentation/specifications/lobby-architecture.md: docs(adr): record that work contexts live in the group DHT #172 and this PR each added a note under "9. Moss Integration Contract", and both notes are kept. git range-diff against the reviewed commit shows no other difference. I pushed it with --force-with-lease, and the PR went back to draft for the push and is marked ready again now.
  • Scope as reviewed: a weave/ package outside the root workspaces, the moss connection mode checked first in hc-connect, pure host detection, AppClient widening in holochain.service, 19 new unit tests, and the new moss-integration.md. The standalone path is reached only when the host is not Moss.
  • CI at this head: build, rustfmt, nine Sweettest shards and e2e are SUCCESS. Branch is clean against dev.
  • Known and not caused by this PR: the UI client test project has one failure (/+page.svelte lobby heading, effect_orphan in melt) that fails identically on chore/holochain-0.7; CI does not run it.
  • Follow-up: feat(ui): Moss group context for groups and NDOs #181 retargets to dev next.

@Soushi888
Soushi888 merged commit 7f3dab6 into dev Nov 4, 2026
12 checks passed
@Soushi888
Soushi888 deleted the feat/moss-tool-scaffold branch November 4, 2026 04:15
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.

feat(moss): Moss tool scaffold

1 participant