@bongos/core 1.19.881 → 1.19.883

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/.bongos-core.json +63 -58
  2. package/clients/bongos-client/index.d.ts +2 -2
  3. package/docs/adr/0304-routine-reads-run-without-a-prompt-and-anything-a-flag-can-turn-into-a-write-is-exact-form.md +79 -4
  4. package/docs/adr/0309-durable-module-enablement-db-override.md +116 -0
  5. package/docs/adr/README.md +1 -0
  6. package/docs/api/openapi.json +6 -0
  7. package/docs/copy-inventory.md +24 -23
  8. package/docs/copy-registry.json +34 -25
  9. package/docs/file-map.md +2 -2
  10. package/docs/module-api-changelog.md +4 -0
  11. package/docs/recipes/bongos-cli-release.md +1 -1
  12. package/docs/recipes/managed-settings-remote-control.md +1 -1
  13. package/migrations/core_248_module_enablement_overrides.sql +50 -0
  14. package/modules/dev-box/app/README.md +4 -3
  15. package/modules/hall-ui/public/collab-lib.js +33 -1
  16. package/modules/hall-ui/public/collab.css +33 -4
  17. package/modules/hall-ui/public/collab.html +9 -2
  18. package/modules/hall-ui/public/collab.js +68 -15
  19. package/modules/hall-ui/public/dom-utils.js +23 -1
  20. package/package-lock.json +2 -2
  21. package/package.json +1 -1
  22. package/scripts/gds/claude-materialize.js +39 -34
  23. package/scripts/hall-preview/server.js +38 -1
  24. package/src/bongos/module-overrides.js +117 -0
  25. package/src/bongos/routes/modules.js +56 -23
  26. package/src/module-api.js +1 -1
  27. package/src/modules.js +120 -14
  28. package/src/platform-server.js +47 -5
  29. package/tests/allow_rule_guard.mjs +192 -0
  30. package/tests/box_ship_permissions.mjs +143 -62
  31. package/tests/box_sweep_docs.mjs +7 -3
  32. package/tests/claude_materialize.mjs +8 -4
  33. package/tests/collab_page.mjs +136 -1
  34. package/tests/host_topology_skips.mjs +1 -0
  35. package/tests/modules.mjs +110 -0
  36. package/tests/modules_route_wiring.mjs +103 -0
  37. package/docs/recipes/builder-box-lifecycle.md +0 -181
  38. package/docs/recipes/devbox-app-release.md +0 -103
  39. package/docs/recipes/devbox-app-windows-test.md +0 -128
  40. package/docs/recipes/work-on-a-task-from-your-dev-box.md +0 -122
@@ -1,128 +0,0 @@
1
- # Hardware-verifying the Dev Box app on Windows (Parallels runbook)
2
-
3
- The app's logic is covered by the stub self-test (`OTB_DEVBOX_AUTOFLOW`, see
4
- `devbox-app/README.md`), but four things only a real Windows session can
5
- prove: the UAC elevation write of the Claude Desktop connection file, the
6
- `icacls` SSH-key lock, native notifications + tray behavior, and the full
7
- switch-on → <redacted> → switch-off loop. This runbook walks a
8
- tester through all of them in ~20 minutes. Written for **Windows 11 in
9
- Parallels on an Apple-silicon Mac** (that's ARM64 Windows — use the ARM
10
- build); everything applies unchanged to a physical PC.
11
-
12
- ## 0. Setup
13
-
14
- - Windows 11 VM up to date; **Claude Desktop for Windows** installed inside
15
- the VM and signed in.
16
- - A GitHub account that's an approved builder (the test account
17
- @largekristensen-svg is ideal — it has lived the broken flow).
18
- - Sign into the builders' hall once in the VM's browser (Edge/Chrome
19
- *inside* Windows, not the Mac side): `https://builders.example.com`.
20
- - Parallels quirks that bite this test:
21
- - Do the whole test **inside the VM** — if the pairing browser tab opens on
22
- the macOS side you're testing the wrong machine's cookies.
23
- - Windows "Do not disturb" / Focus suppresses toast notifications — turn it
24
- off (Settings → System → Notifications) or step 5 can't be judged.
25
- - The VM clock must be right (Parallels usually syncs it) — TLS and the
26
- 10-minute pairing TTL both care.
27
-
28
- ## 1. Download + install (tests: branded redirect, SmartScreen path)
29
-
30
- 1. In the VM browser: `https://example.com/downloads/devbox/win-arm64`
31
- (Parallels = ARM64 Windows; on an Intel PC use `win-x64`).
32
- 2. Expect the browser to warn about an uncommon download — keep it.
33
- 3. Run the installer. **SmartScreen will interpose** (unsigned until blocker
34
- [#18](https://example.com/builders#/task/18)'s Windows half): "Windows protected your PC" → **More info** → **Run
35
- anyway**. ✅ Record that this matches the onboarding copy's wording.
36
- 4. One-click install; the app launches itself and the panel window opens.
37
- ✅ The tray (bottom-right, may be behind the ^ chevron) shows the
38
- container icon.
39
- - ARM64 check: Task Manager → Details → `OTB Dev Box.exe` → the
40
- Architecture column should say **ARM64**, not x64-emulated (column may
41
- need enabling via right-click on the headers).
42
-
43
- ## 2. Pairing sign-in (tests: app-pair flow on Windows)
44
-
45
- 1. Click **Sign in through the hall**. ✅ The default browser opens
46
- `/builders/pair?code=XXXX-XXXX`; the code on the page matches the code in
47
- the panel.
48
- 2. Click **Approve — sign the app in as me**. ✅ Within ~5s the panel flips
49
- to signed-in (the @login shows in the header) with no further input.
50
- 3. ✅ A "Signed in" toast notification appears.
51
- 4. ✅ `%USERPROFILE%\.config\otb\gds-session.json` now exists.
52
-
53
- ## 3. SSH key + Claude Desktop connection file (tests: icacls, UAC write)
54
-
55
- Right after sign-in the app generates/registers the key and asks to install
56
- the Claude Desktop connection file:
57
-
58
- 1. In PowerShell:
59
- ```powershell
60
- icacls $env:USERPROFILE\.ssh\otb_builder
61
- ```
62
- ✅ Exactly one ACE — your user with full control. **No** `BUILTIN\Users`
63
- or `Everyone` lines (the 644-key bug the old flow shipped).
64
- 2. ```powershell
65
- Get-Content $env:USERPROFILE\.claude\settings.json
66
- ```
67
- ✅ Contains an `sshConfigs` entry `name` = "Example Dev Box",
68
- `sshHost` = `root@box-<your-login>.dev.example.com`. Since v1.0.3
69
- (#910) THIS per-user file is what makes the environment appear in the
70
- picker — written with **no elevation**; "✓ Claude Desktop is linked"
71
- refers to it.
72
- 3. ✅ A **UAC prompt** may also appear once — that's the OPTIONAL hardening
73
- layer (the system `managed-settings.json` host allowlist, written to both
74
- `C:\Program Files\ClaudeCode\` and `C:\ProgramData\ClaudeCode\`).
75
- Declining it does NOT break the link — the panel must still show
76
- "✓ Claude Desktop is linked".
77
-
78
- ## 4. The switch (tests: box lifecycle end-to-end)
79
-
80
- 1. Flip the switch ON. ✅ Status walks `Raising thy box…` (a first-ever box
81
- shows the one-time Archon-approval wait instead — the panel says so).
82
- 2. ✅ Within ~3 min: status **ON**, host/size rows fill in, a "Your dev box
83
- is ready" toast fires, the tray icon switches to the filled variant.
84
- 3. ✅ **Open the browser terminal** works (ttyd page, user `otb`, password
85
- from the panel's copy row).
86
- 4. ✅ `Get-Content $env:USERPROFILE\.ssh\known_hosts` contains fresh
87
- `box-<login>.dev.example.com` lines (the app replaces them each
88
- activation — the Desktop ssh2 fix). Since v1.0.2 (#909) the panel shows
89
- this live: "✓ Box identity pinned" (it retries by itself while the box's
90
- SSH service boots; a stuck "not pinned yet" row has a **Retry now**
91
- button). If it never pins, read the app log:
92
- `Get-Content $env:APPDATA\otb-devbox-app\devbox.log -Tail 30`.
93
-
94
- ## 5. Claude Desktop connect (the step the old flow could never reach)
95
-
96
- 1. **Restart Claude Desktop** inside the VM (it reads managed-settings at
97
- launch).
98
- 2. Code tab → Environment picker. ✅ **"Example Dev Box"** is listed.
99
- 3. Select it. ✅ It connects with **no host-verification error** (this is the
100
- known_hosts fix paying off) and lands in `/workspace`.
101
- 4. Ask Claude something trivial (`ls`) to prove the session is live.
102
-
103
- ## 6. Switch off + idle behavior
104
-
105
- 1. Flip the switch OFF. ✅ `Resting thy box…` → OFF within ~2 min; tray icon
106
- back to outline; "Your dev box closed" toast.
107
- 2. (Optional, 15 min) Flip ON, never connect, walk away. ✅ The box
108
- self-reclaims (~10–15 min idle sweep) and the panel flips itself off with
109
- the "closed after sitting idle" notification — the app deliberately sends
110
- no keep-alive.
111
- 3. Quit via tray right-click → Quit. Relaunch. ✅ Still signed in (no
112
- re-pairing), state re-syncs.
113
-
114
- ## Recording results
115
-
116
- File outcomes against the verification task in Bongos. For any failure
117
- grab: the panel state, `%TEMP%`/console output if launched from a terminal
118
- (`& "$env:LOCALAPPDATA\Programs\OTB Dev Box\OTB Dev Box.exe"` shows logs),
119
- the relevant PowerShell output from steps 3–4, and a screenshot. The fastest
120
- diagnosis channel is the box-side state: `GET /api/gds/box/me` via
121
- `node scripts/gds/api.js` from any authed checkout.
122
-
123
- ## Known-unsigned caveats (until blocker #18 lands)
124
-
125
- SmartScreen "Run anyway" (step 1) and the unsigned-publisher UAC dialog
126
- (step 3) are EXPECTED today. When the Windows signing decision lands (Azure
127
- Trusted Signing vs EV cert), re-run steps 1 and 3 — both prompts should then
128
- name the verified publisher, and the SmartScreen interstitial disappears.
@@ -1,122 +0,0 @@
1
- # Work on a task from your dev box
2
-
3
- > Your dev box serves your **rank scope**: Metic+ boxes carry the **whole repo**;
4
- > newcomer (starter) boxes carry the safe starter surface. Task-scoped slices are
5
- > **paused** per [ADR 0193](../adr/0193-pause-task-scoped-box-slices.md) (the
6
- > machinery from [ADR 0148](../adr/0148-task-scoped-box-source-access.md) remains;
7
- > `BOX_TASK_SCOPE=on` re-enables it). Your GitHub token never leaves the server —
8
- > see "How git works on a box" below, and
9
- > [ADR 0150](../adr/0150-box-first-boot-bringup-vendored-instances.md) for how the
10
- > box comes up.
11
-
12
- ## TL;DR
13
-
14
- In your dev box's terminal:
15
-
16
- ```bash
17
- /builder-start # see what you can claim
18
- /builder-claim <N> # claim task N (locks it to your session)
19
- /builder-sync # pull the latest main onto the box right now
20
- # …work in /workspace…
21
- /builder-ship # smoke + review, then land + deploy — awards credits
22
- ```
23
-
24
- That's the whole loop. `/builder-sync` pulls fresh code within seconds instead of
25
- waiting for the box's ~10-minute refresh.
26
-
27
- ## How git works on a box — read this BEFORE diagnosing "stuck"
28
-
29
- The box holds **no stored git credential, ever** — and that is the design, not a
30
- fault ([ADR 0055](../adr/0055-server-mediated-branch-publish.md)):
31
-
32
- - **Reads are server-mediated, per request.** Every remote git operation goes
33
- through `/usr/local/bin/otb-git-credential`, which asks the control plane
34
- (`GET /box/source-access`) for a **short-lived, read-only** credential. The
35
- server checks your **live** rank + status on every single request — demotion or
36
- deactivation cuts off the next fetch instantly.
37
- - **`git push` always fails with 403 here — by design.** The read credential
38
- cannot write. Landing code is the server's job: `/builder-ship` uploads your
39
- work, opens the PR, and lands it. Never try to fix the 403 by embedding a
40
- token or editing git config.
41
- - **Source refreshes from `main` every ~10 minutes** (the `box-source-fetch`
42
- cron; log at `/tmp/box-source-fetch.log`). `/builder-sync` runs the same fetch
43
- on demand.
44
- - **If a remote git op says `could not read Username`, or the sync log shows
45
- 401:** the box's Bongos session expired. Run `/builder-reauth`, then
46
- `/builder-sync`. That is the whole fix.
47
-
48
- The box writes these same facts to `/workspace/CLAUDE.local.md` on every sync, so
49
- a Claude session on the box loads them automatically (the file is gitignored and
50
- box-written — don't edit it).
51
-
52
- ## The model — what's on your box
53
-
54
- - **Metic and above:** the full repo in `/workspace` — same tree as a laptop
55
- clone, refreshed from `main` by the sync cron.
56
- - **Below Metic (starter):** the starter surface — methodology (`CLAUDE.md`,
57
- `.claude/`), build tooling (`scripts/`, `src/bongos/`), `docs/`, `infra/`,
58
- `tests/`, and the sandbox-runnable product code. Rank, checked live by the
59
- server, is what bounds a box — not the task you claimed
60
- ([ADR 0193](../adr/0193-pause-task-scoped-box-slices.md)).
61
-
62
- ## Step by step
63
-
64
- ### 1. Connect to your box
65
-
66
- If you haven't yet, run **`/builder-connect`** (or follow the
67
- [dev-box lifecycle recipe](builder-box-lifecycle.md)) to raise and connect to your
68
- box, then **`/builder-setup`** once on the box to sign the Bongos CLI in. The browser
69
- terminal drops you into `/workspace` — the one working folder.
70
-
71
- > **`bongos shell` / `bongos code` sync on connect (BV1.R101).** Connecting with
72
- > either verb runs the source fetch for you first, so you land in `/workspace`
73
- > already fresh. (The browser terminal drops you straight into `/workspace`; run
74
- > `/builder-sync` there if you want the latest immediately.)
75
-
76
- ### 2. See what you can claim — `/builder-start`
77
-
78
- Lists the tasks that are `ready` and parallel-safe against everyone else's active
79
- claims. Pick one.
80
-
81
- ### 3. Claim it — `/builder-claim <N>`
82
-
83
- Locks task N to your session so no parallel session collides with your work.
84
-
85
- ### 4. Freshen the code — `/builder-sync`
86
-
87
- Re-runs the box's source fetch immediately so `/workspace` is on the current
88
- `main` before you branch. (The ~10-minute cron does this on its own as a
89
- backstop.) Off a box there's nothing to sync — your source is your local
90
- checkout — and the command tells you so.
91
-
92
- ### 5. Work — in `/workspace`
93
-
94
- One folder, always. When you switch tasks, keep working in place.
95
-
96
- ### 6. Ship — `/builder-ship`
97
-
98
- Runs the smoke tests and the review gate, then lands + deploys and awards credits.
99
-
100
- ## Switching tasks
101
-
102
- One box, one working folder, one active claim at a time (the server enforces
103
- one-claim-per-session). To move to a different task:
104
-
105
- 1. `/builder-ship` (or `/builder-release`) the current claim.
106
- 2. `/builder-claim <M>` the new one — and keep working in `/workspace`.
107
-
108
- ## Notes + gotchas
109
-
110
- - **`tests/` is on every box** — a starter box can run the suite for the code it
111
- holds (tests live in the top-level `tests/`, not inside `modules/<key>/`).
112
- - **Idle boxes park, they don't die.** After ~2 hours of no activity the box is
113
- **parked**: a snapshot is kept and the droplet is destroyed, so compute billing
114
- stops and a wake restores your filesystem. Only weeks of staying parked lead to
115
- reclaim (with a warning first). Still: **ship or commit before you step away** —
116
- a snapshot is a safety net, not a workflow.
117
- - **`/builder-sync` is idempotent** — safe to re-run; it just does, on demand, what
118
- the cron does on its schedule.
119
- - **A fresh box comes up with the code already cloned.** If a box ever comes up
120
- *bare* (no code, no terminal), that's the packaging bug
121
- [ADR 0150](../adr/0150-box-first-boot-bringup-vendored-instances.md) fixed on the
122
- control plane — flag it rather than working around it.