rehearsal-9 Task 3: The Nextcloud tail leaves journey.droplet into fixtures/nextcloudTail.ts — droplet legs byte-identical by leg list #1487

Closed
opened 2026-09-15 13:14:29 +00:00 by ben · 2 comments
Owner

Phase 9 (provision on founding) task 3 of 6. Spec: docs/superpowers/specs/2026-09-15-183-phase-9-provision-on-founding-rehearsal-design.md. Plan (read the header, Global Constraints and plan-time inventory first — the Interfaces block below is how tasks learn each other's names): docs/superpowers/plans/2026-09-15-183-phase-9-provision-on-founding-rehearsal.md.

Acceptance = every checkbox step below done, its verification commands green, one commit in the repo's voice. A blocked_by edge on this ticket names the task whose Interfaces it consumes.


Task 3: The Nextcloud tail leaves journey.droplet into a shared fixture (byte-identical legs)

Files:

  • Create: app/tests/e2e/fixtures/nextcloudTail.ts
  • Test: app/tests/e2e/fixtures/nextcloudTail.test.ts
  • Modify: app/tests/e2e/journey.droplet.spec.ts:474-540, 657-735 (call the shared bodies; leg keys, ceilings, assertions unchanged)

Interfaces:

  • Produces (all in nextcloudTail.ts):

    • export const NEXTCLOUD_BRAND = { name: 'E2E Drive', accent: '#619793' } as const;
    • export function nextcloudChromeBrand(): ChromeBrandExpectation → { ...NEXTCLOUD_BRAND, background: '#f5f5f0', logo: LOGO_FIXTURE_PNG }.
    • export async function signInOperator(live: LaunchedApp, panel: string): Promise<Page> — the droplet sign-in body verbatim (open ceremony window on open-your-dashboard, enrol-pending, registerPassword, credential-enrolled, loginWithPassword(... 'E2E Drive', LOGO_FIXTURE_PNG, E2E_GREETING), expect(landed).toContain('/ui/apps'), establishAdminDoorSession(page, panel, runDir)); returns the ceremony page.
    • export async function assertFilesBrandedLogin(door: string, runDir: string): Promise<void> — fresh Chromium, assertBrandedLogin(fresh, doorPath(door,'/login'), NEXTCLOUD_BRAND, ${runDir}/artifacts/nextcloud/login.png), finally fresh.close().
    • export async function assertFilesOidcAdmin(ceremony: Page, door: string, runDir: string): Promise<void> — goto(doorPath(door,'/login')), oidcSignInAsOperator(ceremony, door, runDir, OPERATOR_PASSWORD), assertOperatorIsAdmin(ceremony, door).
    • export async function assertFilesBrandedChrome(dash: Page, door: string, runDir: string, ssh: (remote: string) => Promise<{ code: number; stdout: string; stderr: string }>): Promise<void> — wraps ssh into the occ thunk (throws on code !== 0 with the droplet's message shape), calls assertBrandedChrome(dash, occ, door, nextcloudChromeBrand(), ${runDir}/artifacts/nextcloud/branded-chrome.png).
    • export function assertPublicFilesDoor(door: string, apex: string): void — the droplet door leg's host/port check (throws the DDR 0165 message).
  • Consumes: everything from fixtures/ceremony.ts, fixtures/provision.ts, fixtures/wizard.ts named above.

  • Step 1: Failing fixture test (nextcloudTail.test.ts) — the pure parts:

import { describe, expect, it } from 'vitest';
import { assertPublicFilesDoor, NEXTCLOUD_BRAND, nextcloudChromeBrand } from './nextcloudTail';

describe('nextcloudTail — the shared Nextcloud proof the droplet and rented-services drives run', () => {
  it('the public door must be files.<apex>, portless (DDR 0165)', () => {
    expect(() => assertPublicFilesDoor('https://files.x.idss.nz/', 'x.idss.nz')).not.toThrow();
    expect(() => assertPublicFilesDoor('https://files.x.idss.nz:8443/', 'x.idss.nz')).toThrow(/NO port/);
    expect(() => assertPublicFilesDoor('https://x.idss.nz/files', 'x.idss.nz')).toThrow(/files\.x\.idss\.nz/);
  });
  it('the chrome expectation is the login expectation plus background and logo', () => {
    const c = nextcloudChromeBrand();
    expect(c.name).toBe(NEXTCLOUD_BRAND.name);
    expect(c.accent).toBe('#619793');
    expect(c.background).toBe('#f5f5f0');
    expect(c.logo.length).toBeGreaterThan(0);
  });
});
  • Step 2: Run, expect FAIL (module missing).

  • Step 3: Write nextcloudTail.ts — move the droplet bodies VERBATIM (comments included) into the functions named in Interfaces. assertPublicFilesDoor:

export function assertPublicFilesDoor(door: string, apex: string): void {
  const u = new URL(door);
  if (u.hostname !== `files.${apex}` || u.port !== '') {
    throw new Error(
      `the S5 [Open] target ${door} is not the real public door ` +
        `https://files.${apex} — on the public path the door carries the ` +
        `real host and NO port (DDR 0165)`,
    );
  }
}
  • Step 4: Run, expect PASS.

  • Step 5: Re-point journey.droplet.spec.ts. sign-in body → ceremonyPage = await signInOperator(live, panel);. door body → door = await readFilesDoor(dash, apex); assertPublicFilesDoor(door, apex);. branded-login → () => assertFilesBrandedLogin(door, live.runDir). oidc-admin → () => assertFilesOidcAdmin(ceremonyPage!, door, live.runDir). branded-chrome → () => assertFilesBrandedChrome(dash, door, live.runDir, (remote) => sshDroplet(ip, remote, 30_000)). Leg names, runRecordedLeg wrapping, comments above each leg: unchanged. Drop now-unused imports.

  • Step 6: Verify byte-identical legs — grep -n "journey: " app/tests/e2e/journey.droplet.spec.ts before/after: the same 15 leg names in the same order; pnpm --filter app build; pnpm exec vitest run tests/e2e/fixtures/; root pnpm lint.

  • Step 7: Commit — e2e: phase 9 — the droplet journey's Nextcloud tail (sign-in, branded-login, oidc-admin, branded-chrome, the DDR 0165 door check) moves into fixtures/nextcloudTail.ts; the droplet legs stay byte-identical by leg list (#851 discipline).


Phase 9 (provision on founding) task 3 of 6. Spec: `docs/superpowers/specs/2026-09-15-183-phase-9-provision-on-founding-rehearsal-design.md`. Plan (read the header, Global Constraints and plan-time inventory first — the Interfaces block below is how tasks learn each other's names): `docs/superpowers/plans/2026-09-15-183-phase-9-provision-on-founding-rehearsal.md`. Acceptance = every checkbox step below done, its verification commands green, one commit in the repo's voice. A blocked_by edge on this ticket names the task whose Interfaces it consumes. --- ### Task 3: The Nextcloud tail leaves `journey.droplet` into a shared fixture (byte-identical legs) **Files:** - Create: `app/tests/e2e/fixtures/nextcloudTail.ts` - Test: `app/tests/e2e/fixtures/nextcloudTail.test.ts` - Modify: `app/tests/e2e/journey.droplet.spec.ts:474-540, 657-735` (call the shared bodies; leg keys, ceilings, assertions unchanged) **Interfaces:** - Produces (all in `nextcloudTail.ts`): - `export const NEXTCLOUD_BRAND = { name: 'E2E Drive', accent: '#619793' } as const;` - `export function nextcloudChromeBrand(): ChromeBrandExpectation` → `{ ...NEXTCLOUD_BRAND, background: '#f5f5f0', logo: LOGO_FIXTURE_PNG }`. - `export async function signInOperator(live: LaunchedApp, panel: string): Promise<Page>` — the droplet `sign-in` body verbatim (open ceremony window on `open-your-dashboard`, `enrol-pending`, `registerPassword`, `credential-enrolled`, `loginWithPassword(... 'E2E Drive', LOGO_FIXTURE_PNG, E2E_GREETING)`, `expect(landed).toContain('/ui/apps')`, `establishAdminDoorSession(page, panel, runDir)`); returns the ceremony page. - `export async function assertFilesBrandedLogin(door: string, runDir: string): Promise<void>` — fresh Chromium, `assertBrandedLogin(fresh, doorPath(door,'/login'), NEXTCLOUD_BRAND, `${runDir}/artifacts/nextcloud/login.png`)`, `finally fresh.close()`. - `export async function assertFilesOidcAdmin(ceremony: Page, door: string, runDir: string): Promise<void>` — `goto(doorPath(door,'/login'))`, `oidcSignInAsOperator(ceremony, door, runDir, OPERATOR_PASSWORD)`, `assertOperatorIsAdmin(ceremony, door)`. - `export async function assertFilesBrandedChrome(dash: Page, door: string, runDir: string, ssh: (remote: string) => Promise<{ code: number; stdout: string; stderr: string }>): Promise<void>` — wraps `ssh` into the `occ` thunk (throws on `code !== 0` with the droplet's message shape), calls `assertBrandedChrome(dash, occ, door, nextcloudChromeBrand(), `${runDir}/artifacts/nextcloud/branded-chrome.png`)`. - `export function assertPublicFilesDoor(door: string, apex: string): void` — the droplet `door` leg's host/port check (throws the DDR 0165 message). - Consumes: everything from `fixtures/ceremony.ts`, `fixtures/provision.ts`, `fixtures/wizard.ts` named above. - [ ] **Step 1: Failing fixture test** (`nextcloudTail.test.ts`) — the pure parts: ```ts import { describe, expect, it } from 'vitest'; import { assertPublicFilesDoor, NEXTCLOUD_BRAND, nextcloudChromeBrand } from './nextcloudTail'; describe('nextcloudTail — the shared Nextcloud proof the droplet and rented-services drives run', () => { it('the public door must be files.<apex>, portless (DDR 0165)', () => { expect(() => assertPublicFilesDoor('https://files.x.idss.nz/', 'x.idss.nz')).not.toThrow(); expect(() => assertPublicFilesDoor('https://files.x.idss.nz:8443/', 'x.idss.nz')).toThrow(/NO port/); expect(() => assertPublicFilesDoor('https://x.idss.nz/files', 'x.idss.nz')).toThrow(/files\.x\.idss\.nz/); }); it('the chrome expectation is the login expectation plus background and logo', () => { const c = nextcloudChromeBrand(); expect(c.name).toBe(NEXTCLOUD_BRAND.name); expect(c.accent).toBe('#619793'); expect(c.background).toBe('#f5f5f0'); expect(c.logo.length).toBeGreaterThan(0); }); }); ``` - [ ] **Step 2: Run, expect FAIL** (module missing). - [ ] **Step 3: Write `nextcloudTail.ts`** — move the droplet bodies VERBATIM (comments included) into the functions named in Interfaces. `assertPublicFilesDoor`: ```ts export function assertPublicFilesDoor(door: string, apex: string): void { const u = new URL(door); if (u.hostname !== `files.${apex}` || u.port !== '') { throw new Error( `the S5 [Open] target ${door} is not the real public door ` + `https://files.${apex} — on the public path the door carries the ` + `real host and NO port (DDR 0165)`, ); } } ``` - [ ] **Step 4: Run, expect PASS.** - [ ] **Step 5: Re-point `journey.droplet.spec.ts`.** `sign-in` body → `ceremonyPage = await signInOperator(live, panel);`. `door` body → `door = await readFilesDoor(dash, apex); assertPublicFilesDoor(door, apex);`. `branded-login` → `() => assertFilesBrandedLogin(door, live.runDir)`. `oidc-admin` → `() => assertFilesOidcAdmin(ceremonyPage!, door, live.runDir)`. `branded-chrome` → `() => assertFilesBrandedChrome(dash, door, live.runDir, (remote) => sshDroplet(ip, remote, 30_000))`. Leg names, `runRecordedLeg` wrapping, comments above each leg: unchanged. Drop now-unused imports. - [ ] **Step 6: Verify byte-identical legs** — `grep -n "journey: " app/tests/e2e/journey.droplet.spec.ts` before/after: the same 15 leg names in the same order; `pnpm --filter app build`; `pnpm exec vitest run tests/e2e/fixtures/`; root `pnpm lint`. - [ ] **Step 7: Commit** — `e2e: phase 9 — the droplet journey's Nextcloud tail (sign-in, branded-login, oidc-admin, branded-chrome, the DDR 0165 door check) moves into fixtures/nextcloudTail.ts; the droplet legs stay byte-identical by leg list (#851 discipline)`. ---

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

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

close-report for #1487 — status success

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

envelope
{
  "issue": 1487,
  "status": "success",
  "commits": [
    "4a7ed9b0f8a7d04ed0da960b4e92da2c251882bc"
  ],
  "changed_files": [
    "app/tests/e2e/fixtures/nextcloudTail.ts",
    "app/tests/e2e/fixtures/nextcloudTail.test.ts",
    "app/tests/e2e/journey.droplet.spec.ts"
  ],
  "tests": [
    {
      "command": "pnpm --filter app build",
      "exit_code": 0
    },
    {
      "command": "pnpm exec vitest run tests/e2e/fixtures/",
      "exit_code": 0
    },
    {
      "command": "pnpm lint",
      "exit_code": 0
    }
  ],
  "criteria": {
    "nextcloudTail.ts produces NEXTCLOUD_BRAND, nextcloudChromeBrand, signInOperator, assertFilesBrandedLogin, assertFilesOidcAdmin, assertFilesBrandedChrome, assertPublicFilesDoor": "app/tests/e2e/fixtures/nextcloudTail.ts exports all seven Interfaces symbols",
    "Failing fixture test then passing (steps 1-4)": "nextcloudTail.test.ts covers the pure parts (assertPublicFilesDoor DDR 0165 check + nextcloudChromeBrand); FAILed on missing module, PASSes after nextcloudTail.ts written",
    "droplet bodies moved verbatim into the fixture (step 3)": "sign-in/door/branded-login/oidc-admin/branded-chrome bodies + comments moved into the named functions in nextcloudTail.ts",
    "journey.droplet.spec.ts re-pointed, dead imports dropped (step 5)": "spec calls signInOperator/assertPublicFilesDoor/assertFilesBrandedLogin/assertFilesOidcAdmin/assertFilesBrandedChrome; ceremony import block removed, unused provision/wizard symbols dropped",
    "droplet legs byte-identical by leg list (step 6)": "grep 'journey: ' before/after — same 13 test.step markers (incl. the two dynamic ${row} loops = 15 legs) in the same order; leg keys, ceilings, runRecordedLeg wrapping and assertions unchanged",
    "verification green (step 6)": "pnpm --filter app build exit 0; vitest run tests/e2e/fixtures/ 440 passed exit 0; root pnpm lint exit 0"
  },
  "summary": "Moved the droplet journey's Nextcloud tail (sign-in, door check, branded-login, oidc-admin, branded-chrome) into the shared fixtures/nextcloudTail.ts, leaving the droplet legs byte-identical by leg list.",
  "blockers": []
}
**close-report** for #1487 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1487, "status": "success", "commits": [ "4a7ed9b0f8a7d04ed0da960b4e92da2c251882bc" ], "changed_files": [ "app/tests/e2e/fixtures/nextcloudTail.ts", "app/tests/e2e/fixtures/nextcloudTail.test.ts", "app/tests/e2e/journey.droplet.spec.ts" ], "tests": [ { "command": "pnpm --filter app build", "exit_code": 0 }, { "command": "pnpm exec vitest run tests/e2e/fixtures/", "exit_code": 0 }, { "command": "pnpm lint", "exit_code": 0 } ], "criteria": { "nextcloudTail.ts produces NEXTCLOUD_BRAND, nextcloudChromeBrand, signInOperator, assertFilesBrandedLogin, assertFilesOidcAdmin, assertFilesBrandedChrome, assertPublicFilesDoor": "app/tests/e2e/fixtures/nextcloudTail.ts exports all seven Interfaces symbols", "Failing fixture test then passing (steps 1-4)": "nextcloudTail.test.ts covers the pure parts (assertPublicFilesDoor DDR 0165 check + nextcloudChromeBrand); FAILed on missing module, PASSes after nextcloudTail.ts written", "droplet bodies moved verbatim into the fixture (step 3)": "sign-in/door/branded-login/oidc-admin/branded-chrome bodies + comments moved into the named functions in nextcloudTail.ts", "journey.droplet.spec.ts re-pointed, dead imports dropped (step 5)": "spec calls signInOperator/assertPublicFilesDoor/assertFilesBrandedLogin/assertFilesOidcAdmin/assertFilesBrandedChrome; ceremony import block removed, unused provision/wizard symbols dropped", "droplet legs byte-identical by leg list (step 6)": "grep 'journey: ' before/after — same 13 test.step markers (incl. the two dynamic ${row} loops = 15 legs) in the same order; leg keys, ceilings, runRecordedLeg wrapping and assertions unchanged", "verification green (step 6)": "pnpm --filter app build exit 0; vitest run tests/e2e/fixtures/ 440 passed exit 0; root pnpm lint exit 0" }, "summary": "Moved the droplet journey's Nextcloud tail (sign-in, door check, branded-login, oidc-admin, branded-chrome) into the shared fixtures/nextcloudTail.ts, leaving the droplet legs byte-identical by leg list.", "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#1487
No description provided.