build: one long-lived helper session per community — IDSS_STATE_DIR = that community's folder (ADR 0298 d.1, d.9) — #2094 #2097

Closed
opened 2026-10-30 02:52:57 +00:00 by ben · 7 comments
Owner

Parent

  • Spec: #2094
  • ADR 0298 · DDR 0299 · wireframe docs/ux/wireframes/shell/shell-hb-health-board.html · flow docs/ux/flows/shell.mermaid node HB · build plan docs/superpowers/plans/2026-10-29-many-communities-one-app.md (exact names, signatures, file homes and tests per task). All land with design PR #2093.

What to build

The renderer stops spawning one found and one breakglass helper bridge over the app root. Instead it runs a community session per registered community, spawned with IDSS_STATE_DIR=<app root>/communities/<id> and kept alive until the app quits, so a private guest lives as long as the app. Boot-info carries appRoot, the communities list and moveOutcome. New IPC handles list/add/remove on the registry. The IDIP keychain IPC resolves a community's own idip-keychain.json. The app-update channel keeps the app root, so updates/ stays app-wide. createLegacySession(root) is the only spawn with the app root, and only for a failed or refused move. Plan Task 4.

Anti-goal (Ben): never disturb Whakatōhea Demo's existing seat (~/.config/IDSS on Ben's laptop). Nothing in this ticket may sync, push, deploy or open SSH to a gateway except where the ticket says so.

Acceptance criteria

  • Each community gets found + breakglass bridges with its own stateDir; no session ever spawns with the app root except createLegacySession (tested separately).
  • A registry entry whose folder is missing spawns nothing and is reported via missing().
  • remove disposes that session only; disposeAll kills every bridge on quit.
  • The existing boot test passes with a one-community fixture; full npm test + vue-tsc green.

Blocked by

Task manifest

task: community-sessions
implements_flow: shell
implements_edge: launch→HB (sessions behind each card)
wireframe: docs/ux/wireframes/shell/shell-hb-health-board.html
interface: |
  createCommunitySessions(deps): Promise<CommunitySessions>
  CommunitySessions { list(); get(id); add(); remove(id); missing(); disposeAll() }
  createLegacySession(root, deps): CommunitySession
binds:
  - symbol: createCommunitySessions
    defined_in: app/src/lib/communitySessions.ts
seam: app/tests/unit/communitySessions.test.ts (fake spawn records stateDir)
unproven_by_seam: real helper processes per community — the board e2e and the copy-proof exercise them
acceptance:
  - given: two registered communities
    when: the app boots
    then: four bridges spawn, each pair with its own community folder as IDSS_STATE_DIR
depends_on: [communities-registry-and-move]
out_of_scope: [health-board-ui, probe]
needs_human_decision: []
## Parent - Spec: #2094 - ADR 0298 · DDR 0299 · wireframe `docs/ux/wireframes/shell/shell-hb-health-board.html` · flow `docs/ux/flows/shell.mermaid` node HB · build plan `docs/superpowers/plans/2026-10-29-many-communities-one-app.md` (exact names, signatures, file homes and tests per task). All land with design PR #2093. ## What to build The renderer stops spawning one `found` and one `breakglass` helper bridge over the app root. Instead it runs a **community session** per registered community, spawned with `IDSS_STATE_DIR=<app root>/communities/<id>` and kept alive until the app quits, so a private guest lives as long as the app. Boot-info carries `appRoot`, the communities list and `moveOutcome`. New IPC handles list/add/remove on the registry. The IDIP keychain IPC resolves a community's own `idip-keychain.json`. The app-update channel keeps the app root, so `updates/` stays app-wide. `createLegacySession(root)` is the only spawn with the app root, and only for a failed or refused move. Plan Task 4. **Anti-goal (Ben):** never disturb Whakatōhea Demo's existing seat (`~/.config/IDSS` on Ben's laptop). Nothing in this ticket may sync, push, deploy or open SSH to a gateway except where the ticket says so. ## Acceptance criteria - [ ] Each community gets found + breakglass bridges with its own stateDir; no session ever spawns with the app root except `createLegacySession` (tested separately). - [ ] A registry entry whose folder is missing spawns nothing and is reported via `missing()`. - [ ] remove disposes that session only; disposeAll kills every bridge on quit. - [ ] The existing boot test passes with a one-community fixture; full `npm test` + `vue-tsc` green. ## Blocked by - #2093 - #2095 (communities registry + move) ## Task manifest ```yaml task: community-sessions implements_flow: shell implements_edge: launch→HB (sessions behind each card) wireframe: docs/ux/wireframes/shell/shell-hb-health-board.html interface: | createCommunitySessions(deps): Promise<CommunitySessions> CommunitySessions { list(); get(id); add(); remove(id); missing(); disposeAll() } createLegacySession(root, deps): CommunitySession binds: - symbol: createCommunitySessions defined_in: app/src/lib/communitySessions.ts seam: app/tests/unit/communitySessions.test.ts (fake spawn records stateDir) unproven_by_seam: real helper processes per community — the board e2e and the copy-proof exercise them acceptance: - given: two registered communities when: the app boots then: four bridges spawn, each pair with its own community folder as IDSS_STATE_DIR depends_on: [communities-registry-and-move] out_of_scope: [health-board-ui, probe] needs_human_decision: [] ```

swarm-claim host=matou-dev-server-01 run=57291
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=57291 (automated multi-host claim — lowest live claim id works this ticket)

⏩ independent reviewer for #2097 — verdict unauthenticated

review JSON
{
  "verdict": "unauthenticated",
  "findings": []
}
:fast_forward: **independent reviewer** for #2097 — verdict `unauthenticated` <details><summary>review JSON</summary> ```json { "verdict": "unauthenticated", "findings": [] } ``` </details>

close-report for #2097 — status success

✅ close-report gates passed — every claim verified against the pushed worker branch sandcastle/worker/20261030-084631-e33270 (pre-land — the host promotes it to main only after its post-run verify, #193/#283); issue closed.

envelope
{
  "issue": 2097,
  "status": "success",
  "commits": [
    "29520013be01b48d5ece9060718af1b13b093f65"
  ],
  "changed_files": [
    "STATUS.md",
    "app/src-electron/electron-main.ts",
    "app/src-electron/electron-preload.ts",
    "app/src/bootstrap.ts",
    "app/src/entry/boot.ts",
    "app/src/lib/communitySessions.ts",
    "app/src/renderer/boot-info.ts",
    "app/src/renderer/dev.ts",
    "app/src/renderer/production.ts",
    "app/tests/unit/boot.test.ts",
    "app/tests/unit/communitySessions.test.ts",
    "app/tests/unit/packagedBoot.test.ts",
    "app/tests/unit/packagedConfig.test.ts"
  ],
  "tests": [
    {
      "command": "cd app && npx vitest run tests/unit/communitySessions.test.ts",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c bash -c 'cd app && npx vitest run tests/unit/boot.test.ts'",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c bash -c 'cd app && npm test'",
      "exit_code": 0
    },
    {
      "command": "cd app && npx vue-tsc -p tsconfig.json",
      "exit_code": 0
    },
    {
      "command": "npx eslint app/src/lib/communitySessions.ts app/src/bootstrap.ts app/src/entry/boot.ts app/src/renderer/boot-info.ts app/src/renderer/production.ts app/src/renderer/dev.ts app/src-electron/electron-main.ts app/src-electron/electron-preload.ts app/tests/unit/communitySessions.test.ts app/tests/unit/boot.test.ts app/tests/unit/packagedBoot.test.ts app/tests/unit/packagedConfig.test.ts",
      "exit_code": 0
    },
    {
      "command": "cd app && npx vite build -c vite.main.config.ts",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Each community gets found + breakglass bridges with its own stateDir; no session ever spawns with the app root except createLegacySession (tested separately)": "communitySessions.test.ts 'spawns found+breakglass per community, each with its own folder as stateDir' (four bridges for two communities) + 'never spawns with the app root as stateDir'; the app-root spawn lives only in createLegacySession, asserted separately in 'createLegacySession — the ONE spawn allowed over the app root'. app/src/lib/communitySessions.ts spawnSession sets stateDir=<folder>; createLegacySession passes the app root.",
    "A registry entry whose folder is missing spawns nothing and is reported via missing()": "communitySessions.test.ts 'a registry entry whose folder is missing spawns nothing and is reported via missing()' — only the present community's two bridges spawn; the missing entry is in missing() and get() returns undefined. communitySessions.ts skips spawn when folderExists is false and pushes to missingEntries.",
    "remove disposes that session only; disposeAll kills every bridge on quit": "communitySessions.test.ts 'add() spawns a new session and remove() disposes that session only' (only the removed pair closes, keep's stay live) and 'disposeAll kills every bridge on quit' (all four closed, list() empty). communitySessions.ts remove()/disposeAll().",
    "The existing boot test passes with a one-community fixture; full npm test + vue-tsc green": "boot.test.ts rewired to a one-community fixture (oneCommunity() mints communities/<id>/ + an ipc that lists it; the #202 real-seat test seeds the header into that folder) and passes 6/6 over the real helper under nix. Full npm test = 2286 + 3 isolated build-scale tests, exit 0 under nix develop .#go-ci; npx vue-tsc -p tsconfig.json exit 0; eslint clean."
  },
  "binds": [
    {
      "symbol": "createCommunitySessions",
      "defined_in": "app/src/lib/communitySessions.ts"
    }
  ],
  "summary": "The renderer runs one long-lived found+breakglass helper session per registered community (IDSS_STATE_DIR=<app root>/communities/<id>), with the app root driven only via the explicit createLegacySession fallback.",
  "blockers": []
}
**close-report** for #2097 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against the pushed worker branch `sandcastle/worker/20261030-084631-e33270` (pre-land — the host promotes it to `main` only after its post-run verify, #193/#283); issue closed. <details><summary>envelope</summary> ```json { "issue": 2097, "status": "success", "commits": [ "29520013be01b48d5ece9060718af1b13b093f65" ], "changed_files": [ "STATUS.md", "app/src-electron/electron-main.ts", "app/src-electron/electron-preload.ts", "app/src/bootstrap.ts", "app/src/entry/boot.ts", "app/src/lib/communitySessions.ts", "app/src/renderer/boot-info.ts", "app/src/renderer/dev.ts", "app/src/renderer/production.ts", "app/tests/unit/boot.test.ts", "app/tests/unit/communitySessions.test.ts", "app/tests/unit/packagedBoot.test.ts", "app/tests/unit/packagedConfig.test.ts" ], "tests": [ { "command": "cd app && npx vitest run tests/unit/communitySessions.test.ts", "exit_code": 0 }, { "command": "nix develop .#go-ci -c bash -c 'cd app && npx vitest run tests/unit/boot.test.ts'", "exit_code": 0 }, { "command": "nix develop .#go-ci -c bash -c 'cd app && npm test'", "exit_code": 0 }, { "command": "cd app && npx vue-tsc -p tsconfig.json", "exit_code": 0 }, { "command": "npx eslint app/src/lib/communitySessions.ts app/src/bootstrap.ts app/src/entry/boot.ts app/src/renderer/boot-info.ts app/src/renderer/production.ts app/src/renderer/dev.ts app/src-electron/electron-main.ts app/src-electron/electron-preload.ts app/tests/unit/communitySessions.test.ts app/tests/unit/boot.test.ts app/tests/unit/packagedBoot.test.ts app/tests/unit/packagedConfig.test.ts", "exit_code": 0 }, { "command": "cd app && npx vite build -c vite.main.config.ts", "exit_code": 0 } ], "criteria": { "Each community gets found + breakglass bridges with its own stateDir; no session ever spawns with the app root except createLegacySession (tested separately)": "communitySessions.test.ts 'spawns found+breakglass per community, each with its own folder as stateDir' (four bridges for two communities) + 'never spawns with the app root as stateDir'; the app-root spawn lives only in createLegacySession, asserted separately in 'createLegacySession — the ONE spawn allowed over the app root'. app/src/lib/communitySessions.ts spawnSession sets stateDir=<folder>; createLegacySession passes the app root.", "A registry entry whose folder is missing spawns nothing and is reported via missing()": "communitySessions.test.ts 'a registry entry whose folder is missing spawns nothing and is reported via missing()' — only the present community's two bridges spawn; the missing entry is in missing() and get() returns undefined. communitySessions.ts skips spawn when folderExists is false and pushes to missingEntries.", "remove disposes that session only; disposeAll kills every bridge on quit": "communitySessions.test.ts 'add() spawns a new session and remove() disposes that session only' (only the removed pair closes, keep's stay live) and 'disposeAll kills every bridge on quit' (all four closed, list() empty). communitySessions.ts remove()/disposeAll().", "The existing boot test passes with a one-community fixture; full npm test + vue-tsc green": "boot.test.ts rewired to a one-community fixture (oneCommunity() mints communities/<id>/ + an ipc that lists it; the #202 real-seat test seeds the header into that folder) and passes 6/6 over the real helper under nix. Full npm test = 2286 + 3 isolated build-scale tests, exit 0 under nix develop .#go-ci; npx vue-tsc -p tsconfig.json exit 0; eslint clean." }, "binds": [ { "symbol": "createCommunitySessions", "defined_in": "app/src/lib/communitySessions.ts" } ], "summary": "The renderer runs one long-lived found+breakglass helper session per registered community (IDSS_STATE_DIR=<app root>/communities/<id>), with the app root driven only via the explicit createLegacySession fallback.", "blockers": [] } ``` </details>
Author
Owner

Reopened — stranded close

This ticket closed but its commit(s) (29520013) never reached main (the #2104 shared-workdir reset fault; the harness fix has since landed via #2104/#2106/#2112). Verified 2026-10-30 against origin/main ffdb7171: the deliverable files are absent. Reopened on Ben's word for a fresh build against current main — note app/src/lib/healthBoard.ts has changed since (#2098 landed), so rebuild rather than replay the old worker branch.

## Reopened — stranded close This ticket closed but its commit(s) (`29520013`) never reached `main` (the #2104 shared-workdir reset fault; the harness fix has since landed via #2104/#2106/#2112). Verified 2026-10-30 against `origin/main` `ffdb7171`: the deliverable files are absent. Reopened on Ben's word for a fresh build against current `main` — note `app/src/lib/healthBoard.ts` has changed since (#2098 landed), so rebuild rather than replay the old worker branch.
ben 2026-10-31 00:51:05 +00:00

swarm-claim host=bens-mac-04 run=57659
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=bens-mac-04 run=57659 (automated multi-host claim — lowest live claim id works this ticket)

⏩ independent reviewer for #2097 — verdict unauthenticated

review JSON
{
  "verdict": "unauthenticated",
  "findings": []
}
:fast_forward: **independent reviewer** for #2097 — verdict `unauthenticated` <details><summary>review JSON</summary> ```json { "verdict": "unauthenticated", "findings": [] } ``` </details>

close-report for #2097 — status success

✅ close-report gates passed — every claim verified against the pushed worker branch sandcastle/worker/20261030-195527-63877c (pre-land — the host promotes it to main only after its post-run verify, #193/#283); issue closed.

envelope
{
  "issue": 2097,
  "status": "success",
  "commits": [
    "5d7d1c126210d084ff68e93532fe5af333ec8ab7"
  ],
  "changed_files": [
    "STATUS.md",
    "app/src-electron/electron-main.ts",
    "app/src-electron/electron-preload.ts",
    "app/src/bootstrap.ts",
    "app/src/entry/boot.ts",
    "app/src/lib/communitySessions.ts",
    "app/src/renderer/boot-info.ts",
    "app/src/renderer/dev.ts",
    "app/src/renderer/production.ts",
    "app/tests/unit/boot.test.ts",
    "app/tests/unit/communitySessions.test.ts",
    "app/tests/unit/packagedBoot.test.ts",
    "app/tests/unit/packagedConfig.test.ts"
  ],
  "tests": [
    {
      "command": "cd app && npx vitest run tests/unit/communitySessions.test.ts",
      "exit_code": 0
    },
    {
      "command": "cd app && GOWORK=off GOFLAGS=-mod=mod npx vitest run tests/unit/boot.test.ts",
      "exit_code": 0
    },
    {
      "command": "cd app && GOWORK=off GOFLAGS=-mod=mod npm test",
      "exit_code": 0
    },
    {
      "command": "cd app && npx vue-tsc -p tsconfig.json",
      "exit_code": 0
    },
    {
      "command": "npx eslint app/src/lib/communitySessions.ts app/src/bootstrap.ts app/src/entry/boot.ts app/src/renderer/boot-info.ts app/src/renderer/production.ts app/src/renderer/dev.ts app/src-electron/electron-main.ts app/src-electron/electron-preload.ts app/tests/unit/communitySessions.test.ts app/tests/unit/boot.test.ts app/tests/unit/packagedBoot.test.ts app/tests/unit/packagedConfig.test.ts",
      "exit_code": 0
    },
    {
      "command": "cd app && npx vite build -c vite.main.config.ts",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Each community gets found + breakglass bridges with its own stateDir; no session ever spawns with the app root except createLegacySession (tested separately)": "communitySessions.test.ts 'spawns found+breakglass per community, each with its own folder as stateDir' (four bridges for two communities) + 'never spawns with the app root as stateDir'; the app-root spawn is asserted separately in 'createLegacySession — the ONE spawn allowed over the app root'. app/src/lib/communitySessions.ts spawnSession sets stateDir=<folder>; createLegacySession passes the app root.",
    "A registry entry whose folder is missing spawns nothing and is reported via missing()": "communitySessions.test.ts 'a registry entry whose folder is missing spawns nothing and is reported via missing()' — only the present community's two bridges spawn; the missing entry is in missing() and get() returns undefined. communitySessions.ts skips spawn when folderExists is false and pushes to missingEntries.",
    "remove disposes that session only; disposeAll kills every bridge on quit": "communitySessions.test.ts 'add() spawns a new session and remove() disposes that session only' and 'disposeAll kills every bridge on quit'. communitySessions.ts remove()/disposeAll().",
    "The existing boot test passes with a one-community fixture; full npm test + vue-tsc green": "boot.test.ts rewired to a one-community fixture passes 6/6 over the real helper build (go 1.25.11). Full npm test = 2304 unit + 3 isolated build-scale tests, exit 0; npx vue-tsc -p tsconfig.json exit 0; eslint clean; vite main/preload build clean."
  },
  "binds": [
    {
      "symbol": "createCommunitySessions",
      "defined_in": "app/src/lib/communitySessions.ts"
    }
  ],
  "summary": "The renderer runs one long-lived found+breakglass helper session per registered community (IDSS_STATE_DIR=<app root>/communities/<id>), with the app root driven only via the explicit createLegacySession fallback.",
  "blockers": []
}
**close-report** for #2097 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against the pushed worker branch `sandcastle/worker/20261030-195527-63877c` (pre-land — the host promotes it to `main` only after its post-run verify, #193/#283); issue closed. <details><summary>envelope</summary> ```json { "issue": 2097, "status": "success", "commits": [ "5d7d1c126210d084ff68e93532fe5af333ec8ab7" ], "changed_files": [ "STATUS.md", "app/src-electron/electron-main.ts", "app/src-electron/electron-preload.ts", "app/src/bootstrap.ts", "app/src/entry/boot.ts", "app/src/lib/communitySessions.ts", "app/src/renderer/boot-info.ts", "app/src/renderer/dev.ts", "app/src/renderer/production.ts", "app/tests/unit/boot.test.ts", "app/tests/unit/communitySessions.test.ts", "app/tests/unit/packagedBoot.test.ts", "app/tests/unit/packagedConfig.test.ts" ], "tests": [ { "command": "cd app && npx vitest run tests/unit/communitySessions.test.ts", "exit_code": 0 }, { "command": "cd app && GOWORK=off GOFLAGS=-mod=mod npx vitest run tests/unit/boot.test.ts", "exit_code": 0 }, { "command": "cd app && GOWORK=off GOFLAGS=-mod=mod npm test", "exit_code": 0 }, { "command": "cd app && npx vue-tsc -p tsconfig.json", "exit_code": 0 }, { "command": "npx eslint app/src/lib/communitySessions.ts app/src/bootstrap.ts app/src/entry/boot.ts app/src/renderer/boot-info.ts app/src/renderer/production.ts app/src/renderer/dev.ts app/src-electron/electron-main.ts app/src-electron/electron-preload.ts app/tests/unit/communitySessions.test.ts app/tests/unit/boot.test.ts app/tests/unit/packagedBoot.test.ts app/tests/unit/packagedConfig.test.ts", "exit_code": 0 }, { "command": "cd app && npx vite build -c vite.main.config.ts", "exit_code": 0 } ], "criteria": { "Each community gets found + breakglass bridges with its own stateDir; no session ever spawns with the app root except createLegacySession (tested separately)": "communitySessions.test.ts 'spawns found+breakglass per community, each with its own folder as stateDir' (four bridges for two communities) + 'never spawns with the app root as stateDir'; the app-root spawn is asserted separately in 'createLegacySession — the ONE spawn allowed over the app root'. app/src/lib/communitySessions.ts spawnSession sets stateDir=<folder>; createLegacySession passes the app root.", "A registry entry whose folder is missing spawns nothing and is reported via missing()": "communitySessions.test.ts 'a registry entry whose folder is missing spawns nothing and is reported via missing()' — only the present community's two bridges spawn; the missing entry is in missing() and get() returns undefined. communitySessions.ts skips spawn when folderExists is false and pushes to missingEntries.", "remove disposes that session only; disposeAll kills every bridge on quit": "communitySessions.test.ts 'add() spawns a new session and remove() disposes that session only' and 'disposeAll kills every bridge on quit'. communitySessions.ts remove()/disposeAll().", "The existing boot test passes with a one-community fixture; full npm test + vue-tsc green": "boot.test.ts rewired to a one-community fixture passes 6/6 over the real helper build (go 1.25.11). Full npm test = 2304 unit + 3 isolated build-scale tests, exit 0; npx vue-tsc -p tsconfig.json exit 0; eslint clean; vite main/preload build clean." }, "binds": [ { "symbol": "createCommunitySessions", "defined_in": "app/src/lib/communitySessions.ts" } ], "summary": "The renderer runs one long-lived found+breakglass helper session per registered community (IDSS_STATE_DIR=<app root>/communities/<id>), with the app root driven only via the explicit createLegacySession fallback.", "blockers": [] } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/idss#2097
No description provided.