assemble-payload.sh DELETES the keri-web bundle it just built — every operator-app payload ships without /idip/keri-web.js, so nobody can sign in to an IDIP community founded from it #1710

Closed
opened 2026-09-21 20:41:47 +00:00 by ben · 3 comments
Owner

What happened

Whakatōhea Demo (rented + IDIP, founded by hand 2026-09-21 from a payload assembled by scripts/assemble-payload.sh at 5b910ef3). The operator typed a correct recovery phrase at id.<apex>/login and was refused. Front-door log:

20:34:46Z POST id.whakatohea-demo.idss.nz  /login/verify      401
20:34:47Z GET  whakatohea-demo.idss.nz     /idip/keri-web.js  404

/srv/idss/dashboard/idip/ does not exist on the gateway; nor in the installed app's payload; nor in the assembled payload dir. The sign-in page loads /idip/keri-web.js from the apex to derive the passcode and sign the challenge in the browser — without it the form posts nothing the bridge can verify.

Cause — two lines in the wrong order (still so on main)

scripts/assemble-payload.sh, the keri-web block (~lines 163-167):

(cd app && CI=true pnpm build:keriweb)
install -D -m644 app/dist-keriweb/keri-web.js "$dest/dashboard/idip/keri-web.js"
rm -rf "$dest/dashboard"; cp -r dashboard/dist "$dest/dashboard"    # <- wipes the file installed one line above

The build log shows the bundle built (892 kB) and "installed"; the next line deletes it. publish.sh (the release rail) folds the bundle correctly, and the rehearsal executor refreshes payload slots its own way — which is why every IDIP drive is green while the operator-app path, the one a real founder uses, has never been able to produce a working IDIP sign-in.

Fix

  1. Swap the order: copy dashboard/dist first, THEN install idip/keri-web.js into it.
  2. PAYLOAD.txt reports the bundle as its own line, and app/scripts/verify-payload.mjs REFUSES a payload that carries idss-idp without dashboard/idip/keri-web.js (the same fail-loud rule as the config-server slot, #1623).
  3. Offline test in scripts/tests/: assemble with stub sources ⇒ dashboard/idip/keri-web.js exists in DEST.
  4. Founding's IDIP preflight refuses a payload without the bundle (never found a community nobody can sign in to).
  5. The sign-in page itself: when /idip/keri-web.js fails to load, say so in plain words ("this page could not load its sign-in code — tell your operator") instead of posting an unverifiable form and answering 401 as if the phrase were wrong.
  6. One shared payload-refresh path for the drives and the operator app, so a drive proves the payload a founder actually gets (same lesson as #1674/#1675).

Repair on the demo

Copy the built bundle (same commit) to /srv/idss/dashboard/idip/keri-web.js on the gateway — Ben's go-ahead. The first testing release the community takes would also restore it (the control-panel tarball carries it).

Build idss_0.1.0_amd64.deb sha256 ecff1f99…6e87febc.

## What happened Whakatōhea Demo (rented + IDIP, founded by hand 2026-09-21 from a payload assembled by `scripts/assemble-payload.sh` at `5b910ef3`). The operator typed a correct recovery phrase at `id.<apex>/login` and was refused. Front-door log: ``` 20:34:46Z POST id.whakatohea-demo.idss.nz /login/verify 401 20:34:47Z GET whakatohea-demo.idss.nz /idip/keri-web.js 404 ``` `/srv/idss/dashboard/idip/` does not exist on the gateway; nor in the installed app's payload; nor in the assembled payload dir. The sign-in page loads `/idip/keri-web.js` from the apex to derive the passcode and sign the challenge **in the browser** — without it the form posts nothing the bridge can verify. ## Cause — two lines in the wrong order (still so on main) `scripts/assemble-payload.sh`, the keri-web block (~lines 163-167): ```sh (cd app && CI=true pnpm build:keriweb) install -D -m644 app/dist-keriweb/keri-web.js "$dest/dashboard/idip/keri-web.js" rm -rf "$dest/dashboard"; cp -r dashboard/dist "$dest/dashboard" # <- wipes the file installed one line above ``` The build log shows the bundle built (892 kB) and "installed"; the next line deletes it. `publish.sh` (the release rail) folds the bundle correctly, and the rehearsal executor refreshes payload slots its own way — which is why every IDIP drive is green while the operator-app path, the one a real founder uses, has never been able to produce a working IDIP sign-in. ## Fix 1. Swap the order: copy `dashboard/dist` first, THEN install `idip/keri-web.js` into it. 2. `PAYLOAD.txt` reports the bundle as its own line, and `app/scripts/verify-payload.mjs` REFUSES a payload that carries `idss-idp` without `dashboard/idip/keri-web.js` (the same fail-loud rule as the config-server slot, #1623). 3. Offline test in `scripts/tests/`: assemble with stub sources ⇒ `dashboard/idip/keri-web.js` exists in DEST. 4. Founding's IDIP preflight refuses a payload without the bundle (never found a community nobody can sign in to). 5. The sign-in page itself: when `/idip/keri-web.js` fails to load, say so in plain words ("this page could not load its sign-in code — tell your operator") instead of posting an unverifiable form and answering 401 as if the phrase were wrong. 6. One shared payload-refresh path for the drives and the operator app, so a drive proves the payload a founder actually gets (same lesson as #1674/#1675). ## Repair on the demo Copy the built bundle (same commit) to `/srv/idss/dashboard/idip/keri-web.js` on the gateway — Ben's go-ahead. The first `testing` release the community takes would also restore it (the control-panel tarball carries it). Build `idss_0.1.0_amd64.deb` sha256 `ecff1f99…6e87febc`.

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

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

Demo repaired 2026-09-21 (Ben's go-ahead): the bundle built at 5b910ef3 (sha256 551391b3…, 892,773 bytes) copied to /srv/idss/dashboard/idip/keri-web.js; the apex now answers 200 text/javascript for it.

**Demo repaired 2026-09-21 (Ben's go-ahead):** the bundle built at `5b910ef3` (sha256 `551391b3…`, 892,773 bytes) copied to `/srv/idss/dashboard/idip/keri-web.js`; the apex now answers 200 `text/javascript` for it.

close-report for #1710 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 1710,
  "status": "success",
  "commits": [
    "d3dd7481dfb214ce821cc09bbbdfbd4b91cfe45a"
  ],
  "changed_files": [
    "STATUS.md",
    "app/scripts/verify-payload.mjs",
    "docs/GOTCHAS.md",
    "internal/fleetwire/supply.go",
    "internal/founding/configserver_preflight_internal_test.go",
    "internal/founding/manualpath.go",
    "internal/founding/privatepath.go",
    "internal/founding/readiness_test.go",
    "internal/founding/testing/fakes.go",
    "internal/idp/brand.go",
    "internal/idp/seam_test.go",
    "internal/vm/assemble_test.go",
    "scripts/assemble-payload.sh",
    "scripts/lib/keriweb-stage-lib.sh",
    "scripts/rehearsal-cycle.sh",
    "scripts/tests/keriweb-payload-test.sh"
  ],
  "tests": [
    {
      "command": "bash scripts/tests/keriweb-payload-test.sh",
      "exit_code": 0
    },
    {
      "command": "go test ./internal/idp/... ./internal/fleetwire/... ./internal/founding/... ./internal/vm/...",
      "exit_code": 0
    },
    {
      "command": "go build ./...",
      "exit_code": 0
    },
    {
      "command": "go vet ./internal/idp/... ./internal/fleetwire/... ./internal/founding/... ./internal/vm/...",
      "exit_code": 0
    },
    {
      "command": "node app/scripts/verify-payload.mjs (idss-idp without keri-web => exit 1; with => exit 0)",
      "exit_code": 0
    }
  ],
  "criteria": {
    "1. Swap the order: copy dashboard/dist first, THEN install idip/keri-web.js on top": "scripts/assemble-payload.sh — the dashboard->$dest copy moved into the build branch (staged FIRST); the keri-web bundle is installed on top via stage_keriweb, never followed by a wiping copy. TestAssemblePayload_KeriWebSurvivesDashboardStaging + scripts/tests/keriweb-payload-test.sh prove the bundle and dashboard both survive.",
    "2. PAYLOAD.txt reports the bundle as its own line, and verify-payload.mjs REFUSES idss-idp without dashboard/idip/keri-web.js": "assemble-payload.sh adds a 'keri-web bundle:' line to PAYLOAD.txt (asserted in the shell test); app/scripts/verify-payload.mjs dies when idss-idp is present without a non-empty dashboard/idip/keri-web.js — verified refusing/passing both ways.",
    "3. Offline test in scripts/tests/: assemble with stub sources => dashboard/idip/keri-web.js exists in DEST": "scripts/tests/keriweb-payload-test.sh (auto-run by seam-smoke's scripts/tests/*.sh loop) drives assemble-payload.sh with stub sources via PAYLOAD_KERIWEB_SRC and asserts DEST carries the bundle; also TestAssemblePayload_KeriWebSurvivesDashboardStaging at the internal/vm seam.",
    "4. Founding's IDIP preflight refuses a payload without the bundle": "requireKeriWebForIDIP / ErrKeriWebNotCarried + CarriesKeriWeb() on GuestSupply (privatepath.go), fleetwire.Supply, and the fakes; wired at all four IDIP preflight sites (own-VPS, rented, self-hosted, private). TestRequireKeriWebForIDIP proves refuse/pass/kanidm-not-gated.",
    "5. The sign-in page says so in plain words when /idip/keri-web.js fails to load, instead of posting an unverifiable form answered 401": "internal/idp/brand.go — s.onerror sets idssKeriWebFailed; the submit handler prevents the post when the module is absent and words the refusal ('this page could not load its sign-in code — tell your operator. Your recovery phrase was not sent.'). TestSeam_SignInPage_RefusesInPlainWordsWhenBundleAbsent.",
    "6. One shared payload-refresh path for the drives and the operator app": "scripts/lib/keriweb-stage-lib.sh stage_keriweb is the single staging path called by BOTH scripts/assemble-payload.sh and scripts/rehearsal-cycle.sh, so a drive proves the exact keri-web bundle a founder's operator-app payload gets (same lesson as #1674/#1675)."
  },
  "summary": "assemble-payload.sh now stages the keri-web sign-in bundle on top of an already-staged dashboard (no longer wiped) through one shared path, with fail-loud guards at assembly, package, and founding preflight, and a plain-words sign-in error when the bundle is absent.",
  "blockers": []
}
**close-report** for #1710 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1710, "status": "success", "commits": [ "d3dd7481dfb214ce821cc09bbbdfbd4b91cfe45a" ], "changed_files": [ "STATUS.md", "app/scripts/verify-payload.mjs", "docs/GOTCHAS.md", "internal/fleetwire/supply.go", "internal/founding/configserver_preflight_internal_test.go", "internal/founding/manualpath.go", "internal/founding/privatepath.go", "internal/founding/readiness_test.go", "internal/founding/testing/fakes.go", "internal/idp/brand.go", "internal/idp/seam_test.go", "internal/vm/assemble_test.go", "scripts/assemble-payload.sh", "scripts/lib/keriweb-stage-lib.sh", "scripts/rehearsal-cycle.sh", "scripts/tests/keriweb-payload-test.sh" ], "tests": [ { "command": "bash scripts/tests/keriweb-payload-test.sh", "exit_code": 0 }, { "command": "go test ./internal/idp/... ./internal/fleetwire/... ./internal/founding/... ./internal/vm/...", "exit_code": 0 }, { "command": "go build ./...", "exit_code": 0 }, { "command": "go vet ./internal/idp/... ./internal/fleetwire/... ./internal/founding/... ./internal/vm/...", "exit_code": 0 }, { "command": "node app/scripts/verify-payload.mjs (idss-idp without keri-web => exit 1; with => exit 0)", "exit_code": 0 } ], "criteria": { "1. Swap the order: copy dashboard/dist first, THEN install idip/keri-web.js on top": "scripts/assemble-payload.sh — the dashboard->$dest copy moved into the build branch (staged FIRST); the keri-web bundle is installed on top via stage_keriweb, never followed by a wiping copy. TestAssemblePayload_KeriWebSurvivesDashboardStaging + scripts/tests/keriweb-payload-test.sh prove the bundle and dashboard both survive.", "2. PAYLOAD.txt reports the bundle as its own line, and verify-payload.mjs REFUSES idss-idp without dashboard/idip/keri-web.js": "assemble-payload.sh adds a 'keri-web bundle:' line to PAYLOAD.txt (asserted in the shell test); app/scripts/verify-payload.mjs dies when idss-idp is present without a non-empty dashboard/idip/keri-web.js — verified refusing/passing both ways.", "3. Offline test in scripts/tests/: assemble with stub sources => dashboard/idip/keri-web.js exists in DEST": "scripts/tests/keriweb-payload-test.sh (auto-run by seam-smoke's scripts/tests/*.sh loop) drives assemble-payload.sh with stub sources via PAYLOAD_KERIWEB_SRC and asserts DEST carries the bundle; also TestAssemblePayload_KeriWebSurvivesDashboardStaging at the internal/vm seam.", "4. Founding's IDIP preflight refuses a payload without the bundle": "requireKeriWebForIDIP / ErrKeriWebNotCarried + CarriesKeriWeb() on GuestSupply (privatepath.go), fleetwire.Supply, and the fakes; wired at all four IDIP preflight sites (own-VPS, rented, self-hosted, private). TestRequireKeriWebForIDIP proves refuse/pass/kanidm-not-gated.", "5. The sign-in page says so in plain words when /idip/keri-web.js fails to load, instead of posting an unverifiable form answered 401": "internal/idp/brand.go — s.onerror sets idssKeriWebFailed; the submit handler prevents the post when the module is absent and words the refusal ('this page could not load its sign-in code — tell your operator. Your recovery phrase was not sent.'). TestSeam_SignInPage_RefusesInPlainWordsWhenBundleAbsent.", "6. One shared payload-refresh path for the drives and the operator app": "scripts/lib/keriweb-stage-lib.sh stage_keriweb is the single staging path called by BOTH scripts/assemble-payload.sh and scripts/rehearsal-cycle.sh, so a drive proves the exact keri-web bundle a founder's operator-app payload gets (same lesson as #1674/#1675)." }, "summary": "assemble-payload.sh now stages the keri-web sign-in bundle on top of an already-staged dashboard (no longer wiped) through one shared path, with fail-loud guards at assembly, package, and founding preflight, and a plain-words sign-in error when the bundle is absent.", "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.

Dependencies

No dependencies set.

Reference
Matou/idss#1710
No description provided.