rehearsal-3: drive fixtures — self-hosted wizard branch, install-command paste, terminal consent over SSH #520

Closed
opened 2026-08-14 06:20:44 +00:00 by ben · 2 comments
Owner

Part of rehearsal phase 3 — gateway from home (spec docs/superpowers/specs/2026-08-14-183-phase-3-home-gateway-rehearsal-design.md, plan docs/superpowers/plans/2026-08-14-183-phase-3-home-gateway-rehearsal.md).
The plan section below is the work, verbatim; its Interfaces block names what neighbouring tasks consume — keep those names exact.

Global constraints (apply to every step)

  • Use the domain glossary's vocabulary (CONTEXT.md) in ALL copy, comments,
    commit messages: founding, gateway, agent, install command,
    enrollment code — never installer/daemon/token/join-key.
  • Fail loud, never fabricate (ADR 0100): a missing artifact/secret/seam is an
    error with the real reason, never a silent skip or a made-up value.
  • x86_64 only at v1; full install is the consented mode (ADR 0024); the
    install command is a doorway, not a kept tool (ADR 0028).
  • Never write closes #NNN (or any close keyword) in commits or issue bodies
    for the standing drive issue family — say "advances #NNN". Even DESCRIBING a
    close can auto-close (2026-08-10 lesson, twice).
  • Commits that change project state update STATUS.md in the same commit
    (CLAUDE.md rule); the drive-issue minting commit (Task 9) carries the
    STATUS + runbook update for the whole arc.
  • TDD: each step's test is written and seen red before its implementation.
  • Secrets never enter .sandcastle/.env (it forwards into worker containers);
    host-only secrets live in the executor's rehearsal-env.sh (2026-07-11
    lesson).

Files:

  • Modify: app/tests/e2e/fixtures/wizard.ts
  • Modify: app/tests/e2e/fixtures/droplet.ts (+ droplet.test.ts)

Interfaces:

  • Consumes: screen selectors — S4 options render [data-option="self-hosted"]
    / [data-action="option:self-hosted"] (FoundingAccess.vue); S7b renders
    [data-action="choose-method-command-line"] and
    [data-field="install-command"] (FoundingInstallMachine.vue);
    sshDroplet(ip, command, timeoutMs) (droplet.ts).

  • Produces (Task 7 calls exactly these):

    • s4AccessSelfHosted(live: LaunchedApp): Promise<void> — select the
      self-hosted option, run the pre-check, answer sameConnection=false
      (the caution path), land on S5.
    • s7bInstallCommand(live: LaunchedApp): Promise<string> — choose the
      command-line method, read and return [data-field="install-command"]'s
      text.
    • sshDropletInteractive(ip: string, command: string, answers: Array<{expect: RegExp, send: string}>, timeoutMs: number): Promise<{code: number; transcript: string}> — ssh -tt with piped
      stdin; on each expect match in the accumulated output, writes send;
      resolves with the full transcript (Task 7 saves it as evidence); rejects
      on timeout with the transcript so far in the error.
  • Step 1: Failing unit test — droplet.test.ts: with a PATH-shimmed
    ssh (the file's existing shim pattern) that prints Install mode? then
    echoes stdin, sshDropletInteractive sends the scripted answer and the
    transcript contains both prompt and answer; a never-matching expect rejects
    at the timeout with the transcript in the message.

  • Step 2: Red → implement → green — pnpm vitest run app/tests/e2e/fixtures/droplet.test.ts (match the repo's runner
    invocation).

  • Step 3: Wizard fixtures — implement s4AccessSelfHosted /
    s7bInstallCommand against the selectors above (mirror
    s4AccessOwnVPS's style, wizard.ts:99); pure-logic seams (e.g. the
    expect/send sequencer) get cases beside the existing wizard tests. The
    consent answer sequence itself lives in Task 7 (it is journey knowledge);
    this task ships the mechanism.

  • Step 4: tsc + full unit suites green; commit — rehearsal: the wizard drives the self-hosted branch and a terminal consent can be answered over SSH (spec 2026-08-14).

Part of rehearsal **phase 3 — gateway from home** (spec `docs/superpowers/specs/2026-08-14-183-phase-3-home-gateway-rehearsal-design.md`, plan `docs/superpowers/plans/2026-08-14-183-phase-3-home-gateway-rehearsal.md`). The plan section below is the work, verbatim; its **Interfaces** block names what neighbouring tasks consume — keep those names exact. ## Global constraints (apply to every step) - Use the domain glossary's vocabulary (`CONTEXT.md`) in ALL copy, comments, commit messages: *founding*, *gateway*, *agent*, *install command*, *enrollment code* — never installer/daemon/token/join-key. - Fail loud, never fabricate (ADR 0100): a missing artifact/secret/seam is an error with the real reason, never a silent skip or a made-up value. - x86_64 only at v1; full install is the consented mode (ADR 0024); the install command is a doorway, not a kept tool (ADR 0028). - Never write `closes #NNN` (or any close keyword) in commits or issue bodies for the standing drive issue family — say "advances #NNN". Even DESCRIBING a close can auto-close (2026-08-10 lesson, twice). - Commits that change project state update `STATUS.md` in the same commit (CLAUDE.md rule); the drive-issue minting commit (Task 9) carries the STATUS + runbook update for the whole arc. - TDD: each step's test is written and seen red before its implementation. - Secrets never enter `.sandcastle/.env` (it forwards into worker containers); host-only secrets live in the executor's `rehearsal-env.sh` (2026-07-11 lesson). --- ### Task 6: Drive fixtures — wizard branch, install-command paste, terminal consent **Files:** - Modify: `app/tests/e2e/fixtures/wizard.ts` - Modify: `app/tests/e2e/fixtures/droplet.ts` (+ `droplet.test.ts`) **Interfaces:** - Consumes: screen selectors — S4 options render `[data-option="self-hosted"]` / `[data-action="option:self-hosted"]` (`FoundingAccess.vue`); S7b renders `[data-action="choose-method-command-line"]` and `[data-field="install-command"]` (`FoundingInstallMachine.vue`); `sshDroplet(ip, command, timeoutMs)` (droplet.ts). - Produces (Task 7 calls exactly these): - `s4AccessSelfHosted(live: LaunchedApp): Promise<void>` — select the self-hosted option, run the pre-check, answer `sameConnection=false` (the caution path), land on S5. - `s7bInstallCommand(live: LaunchedApp): Promise<string>` — choose the command-line method, read and return `[data-field="install-command"]`'s text. - `sshDropletInteractive(ip: string, command: string, answers: Array<{expect: RegExp, send: string}>, timeoutMs: number): Promise<{code: number; transcript: string}>` — `ssh -tt` with piped stdin; on each `expect` match in the accumulated output, writes `send`; resolves with the full transcript (Task 7 saves it as evidence); rejects on timeout with the transcript so far in the error. - [ ] **Step 1: Failing unit test** — `droplet.test.ts`: with a PATH-shimmed `ssh` (the file's existing shim pattern) that prints `Install mode?` then echoes stdin, `sshDropletInteractive` sends the scripted answer and the transcript contains both prompt and answer; a never-matching expect rejects at the timeout with the transcript in the message. - [ ] **Step 2: Red → implement → green** — `pnpm vitest run app/tests/e2e/fixtures/droplet.test.ts` (match the repo's runner invocation). - [ ] **Step 3: Wizard fixtures** — implement `s4AccessSelfHosted` / `s7bInstallCommand` against the selectors above (mirror `s4AccessOwnVPS`'s style, wizard.ts:99); pure-logic seams (e.g. the expect/send sequencer) get cases beside the existing wizard tests. The consent answer sequence itself lives in Task 7 (it is journey knowledge); this task ships the mechanism. - [ ] **Step 4: `tsc` + full unit suites green; commit** — `rehearsal: the wizard drives the self-hosted branch and a terminal consent can be answered over SSH (spec 2026-08-14)`.
Author
Owner

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

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

close-report for #520 — status success

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

envelope
{
  "issue": 520,
  "status": "success",
  "commits": [
    "b6e24aba7202f843ae2132038ac9e1219976cb7a"
  ],
  "changed_files": [
    "app/tests/e2e/fixtures/droplet.ts",
    "app/tests/e2e/fixtures/droplet.test.ts",
    "app/tests/e2e/fixtures/wizard.ts"
  ],
  "tests": [
    {
      "command": "CI=true pnpm vitest run tests/e2e/fixtures/droplet.test.ts",
      "exit_code": 0
    },
    {
      "command": "CI=true pnpm vitest run tests/e2e/fixtures/ (all fixture suites)",
      "exit_code": 0
    },
    {
      "command": "CI=true pnpm build (vue-tsc -p tsconfig.json)",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Step 1: failing unit test in droplet.test.ts — shimmed ssh prints prompt then echoes stdin; sshDropletInteractive sends the scripted answer, transcript contains prompt+answer; never-matching expect rejects at timeout with transcript in message": "droplet.test.ts: withPromptEchoSsh() shim + the two sshDropletInteractive tests (happy path asserts transcript contains 'Install mode?' and 'you-said: full'; timeout test rejects with /Install mode\\?/). Seen red first (sshDropletInteractive is not a function), then green.",
    "Step 2: red -> implement -> green via vitest run on droplet.test.ts": "5 passed (CI=true pnpm vitest run tests/e2e/fixtures/droplet.test.ts).",
    "Step 3: wizard fixtures s4AccessSelfHosted / s7bInstallCommand against the real selectors, mirroring s4AccessOwnVPS; pure-logic expect/send sequencer gets its own cases; consent answer sequence deferred to Task 7": "wizard.ts: s4AccessSelfHosted drives [data-action=option:self-hosted] -> continue -> [data-action=same-connection-no] -> verdict-unknown -> continue -> address (caution path, sameConnection=false); s7bInstallCommand chooses [data-action=choose-method-command-line] and returns [data-field=install-command] text. Sequencer extracted as pure nextConsentSend with its own 'nextConsentSend' describe block in droplet.test.ts. No consent answer sequence shipped (mechanism only).",
    "Step 4: tsc + full unit suites green; commit with the exact message": "vue-tsc clean; e2e fixture suites 53 passed; commit b6e24ab titled 'rehearsal: the wizard drives the self-hosted branch and a terminal consent can be answered over SSH (spec 2026-08-14)'. (Full app suite: 867 passed / 6 skipped; the one failure is tests/unit/boot.test.ts spawnSync go ENOENT — Go absent from this sandbox PATH, an environmental gap unrelated to this TypeScript-only change; the push gate itself reports 'TypeScript-only change — Go stages skipped'.)"
  },
  "summary": "Ship the self-hosted wizard fixtures (s4AccessSelfHosted, s7bInstallCommand) and the over-SSH interactive consent driver (sshDropletInteractive) with its pure order-strict sequencer seam.",
  "blockers": []
}
**close-report** for #520 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; closing. <details><summary>envelope</summary> ```json { "issue": 520, "status": "success", "commits": [ "b6e24aba7202f843ae2132038ac9e1219976cb7a" ], "changed_files": [ "app/tests/e2e/fixtures/droplet.ts", "app/tests/e2e/fixtures/droplet.test.ts", "app/tests/e2e/fixtures/wizard.ts" ], "tests": [ { "command": "CI=true pnpm vitest run tests/e2e/fixtures/droplet.test.ts", "exit_code": 0 }, { "command": "CI=true pnpm vitest run tests/e2e/fixtures/ (all fixture suites)", "exit_code": 0 }, { "command": "CI=true pnpm build (vue-tsc -p tsconfig.json)", "exit_code": 0 } ], "criteria": { "Step 1: failing unit test in droplet.test.ts — shimmed ssh prints prompt then echoes stdin; sshDropletInteractive sends the scripted answer, transcript contains prompt+answer; never-matching expect rejects at timeout with transcript in message": "droplet.test.ts: withPromptEchoSsh() shim + the two sshDropletInteractive tests (happy path asserts transcript contains 'Install mode?' and 'you-said: full'; timeout test rejects with /Install mode\\?/). Seen red first (sshDropletInteractive is not a function), then green.", "Step 2: red -> implement -> green via vitest run on droplet.test.ts": "5 passed (CI=true pnpm vitest run tests/e2e/fixtures/droplet.test.ts).", "Step 3: wizard fixtures s4AccessSelfHosted / s7bInstallCommand against the real selectors, mirroring s4AccessOwnVPS; pure-logic expect/send sequencer gets its own cases; consent answer sequence deferred to Task 7": "wizard.ts: s4AccessSelfHosted drives [data-action=option:self-hosted] -> continue -> [data-action=same-connection-no] -> verdict-unknown -> continue -> address (caution path, sameConnection=false); s7bInstallCommand chooses [data-action=choose-method-command-line] and returns [data-field=install-command] text. Sequencer extracted as pure nextConsentSend with its own 'nextConsentSend' describe block in droplet.test.ts. No consent answer sequence shipped (mechanism only).", "Step 4: tsc + full unit suites green; commit with the exact message": "vue-tsc clean; e2e fixture suites 53 passed; commit b6e24ab titled 'rehearsal: the wizard drives the self-hosted branch and a terminal consent can be answered over SSH (spec 2026-08-14)'. (Full app suite: 867 passed / 6 skipped; the one failure is tests/unit/boot.test.ts spawnSync go ENOENT — Go absent from this sandbox PATH, an environmental gap unrelated to this TypeScript-only change; the push gate itself reports 'TypeScript-only change — Go stages skipped'.)" }, "summary": "Ship the self-hosted wizard fixtures (s4AccessSelfHosted, s7bInstallCommand) and the over-SSH interactive consent driver (sshDropletInteractive) with its pure order-strict sequencer seam.", "blockers": [] } ``` </details>
ben closed this issue 2026-08-14 06:30:57 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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#520
No description provided.