rehearsal-5 task 8/13: Standing-community lib + launch stateDir override #849

Closed
opened 2026-08-25 20:14:41 +00:00 by ben · 3 comments
Owner

Part of the #183 phase-5 rehearsal arc (device-add + Nextcloud-on-device on a standing rented community).

  • Spec: docs/superpowers/specs/2026-08-25-183-phase-5-device-nextcloud-rehearsal-design.md
  • Plan: docs/superpowers/plans/2026-08-25-183-phase-5-device-nextcloud-rehearsal.md — this ticket is Task 8, carried verbatim below. The plan's Global Constraints apply to every step.

Task 8: Standing-community lib + launch stateDir override

Files:

  • Create: scripts/lib/rehearsal-standing-lib.sh
  • Create: scripts/tests/rehearsal-standing-test.sh (offline: fake git + curl + facts round-trip)
  • Modify: app/tests/e2e/fixtures/launch.ts (LaunchOptions.stateDir?: string — overrides the run-dir default)
  • Modify: STATUS.md

Interfaces:

  • Consumes: oc_bootstrap_staleness's shape (scripts/lib/bootstrap-staleness-lib.sh — copy the three-guard + rev-list pattern, same path list); broker routes POST /v1/gateways/renew + /release, POST /v1/subdomains/offboard (bearer = claim secret); oc_slug_secret_remember (rehearsal-droplet.sh:698).

  • Produces:

    OC_STANDING_DIR="${REHEARSAL_STANDING_DIR:-$root/test-results/standing-rented}"
    oc_standing_facts_write <slug> <host> <ip> <founding_sha>   # writes $OC_STANDING_DIR/facts.json (secret stays in state/founding-state.json, mined on demand)
    oc_standing_facts_read <key>                                # jq -r over facts.json
    oc_standing_secret                                          # mines the claim secret from $OC_STANDING_DIR/state (the oc_rented_teardown grep, verbatim)
    oc_standing_staleness                                       # 0 fresh · 1 stale · 2 absent/unusable — founding_sha vs origin/main over agent/ go.mod go.sum internal/
    oc_standing_renew                                           # POST /v1/gateways/renew {host} bearer $(oc_standing_secret); rc!=0 logs, never dies
    oc_standing_teardown                                        # release + offboard + secret remembered first + rm -rf $OC_STANDING_DIR
    

    TS side: launchApp({stateDir}) launches on the given dir; the journey passes join(process.env.REHEARSAL_STANDING_DIR, 'state').

  • Step 1: Write the failing offline test — facts round-trip; staleness fresh/stale/absent with a scripted git; renew posts the right body/bearer against a fake curl; teardown remembers the secret BEFORE spending it.

  • Step 2: Run bash scripts/tests/rehearsal-standing-test.sh → FAIL; implement; → PASS.

  • Step 3: launch.ts — add the option (default unchanged); pnpm -r typecheck → PASS (no behavior change for existing specs — assert by running the fixtures' unit suite).

  • Step 4: Commit — git commit -m "rehearsal-5: standing-community lib — facts, staleness verdict, renew, teardown; launch stateDir override (ADR 0207) (task 8 of #<ticket>)".


Global Constraints (from the plan)

  • Nothing fabricated (ADR 0100): every landed fact is read from the box; a
    failure is a named error, never a masked success. No sandbox-green claim (#377).
  • The wipe consent is given at the machine (ADR 0024) and shown-not-re-asked
    at P4-S3x; the takeover runs at provisioning's first deploy, never at join.
  • One placement deploy = device closure + gateway route in one config-repo
    commit, then two single-node clan.Deploy calls, device first (ruling: a
    route to a dead service is the honest failure, a service with no route is
    invisible).
  • Standing community: home test-results/standing-rented/; staleness gate =
    oc_bootstrap_staleness pattern over agent/ go.mod go.sum internal/; the
    reaper stays honest — renewal, not exemption (idss-rental-hold is for
    humans, the executor never sets it).
  • Do not destabilize live drives: #720 (rented confirm loop, elitebook) and
    #721/#722 (workstation) keep running; the prefix extraction (Task 10) is
    behavior-preserving and #720 must stay green across it. Never touch the
    executors' env files from a ticket.
  • Tracker gotcha: labels via POST/DELETE /issues/<n>/labels, never in an
    issue PATCH. "closes #NNN" in commit messages auto-closes — say "task N of
    #NNN" instead.
  • ADR numbers: 0207/0208/0209 assumed — re-check git ls-tree origin/main docs/adr/
    at mint (IDIP + observability swarm lanes are minting concurrently).
  • STATUS.md updated in the same commit as any project-state change;
    git pull --rebase immediately before a STATUS commit (shared checkout).
  • Go: gofmt, go vet ./..., go test ./... green; TS: pnpm -r typecheck +
    unit suites green, pre-land.
Part of the **#183 phase-5 rehearsal arc** (device-add + Nextcloud-on-device on a standing rented community). - Spec: `docs/superpowers/specs/2026-08-25-183-phase-5-device-nextcloud-rehearsal-design.md` - Plan: `docs/superpowers/plans/2026-08-25-183-phase-5-device-nextcloud-rehearsal.md` — this ticket is **Task 8**, carried verbatim below. The plan's Global Constraints apply to every step. --- ### Task 8: Standing-community lib + launch stateDir override **Files:** - Create: `scripts/lib/rehearsal-standing-lib.sh` - Create: `scripts/tests/rehearsal-standing-test.sh` (offline: fake git + curl + facts round-trip) - Modify: `app/tests/e2e/fixtures/launch.ts` (`LaunchOptions.stateDir?: string` — overrides the run-dir default) - Modify: `STATUS.md` **Interfaces:** - Consumes: `oc_bootstrap_staleness`'s shape (`scripts/lib/bootstrap-staleness-lib.sh` — copy the three-guard + `rev-list` pattern, same path list); broker routes `POST /v1/gateways/renew` + `/release`, `POST /v1/subdomains/offboard` (bearer = claim secret); `oc_slug_secret_remember` (`rehearsal-droplet.sh:698`). - Produces: ```bash OC_STANDING_DIR="${REHEARSAL_STANDING_DIR:-$root/test-results/standing-rented}" oc_standing_facts_write <slug> <host> <ip> <founding_sha> # writes $OC_STANDING_DIR/facts.json (secret stays in state/founding-state.json, mined on demand) oc_standing_facts_read <key> # jq -r over facts.json oc_standing_secret # mines the claim secret from $OC_STANDING_DIR/state (the oc_rented_teardown grep, verbatim) oc_standing_staleness # 0 fresh · 1 stale · 2 absent/unusable — founding_sha vs origin/main over agent/ go.mod go.sum internal/ oc_standing_renew # POST /v1/gateways/renew {host} bearer $(oc_standing_secret); rc!=0 logs, never dies oc_standing_teardown # release + offboard + secret remembered first + rm -rf $OC_STANDING_DIR ``` TS side: `launchApp({stateDir})` launches on the given dir; the journey passes `join(process.env.REHEARSAL_STANDING_DIR, 'state')`. - [ ] **Step 1: Write the failing offline test** — facts round-trip; staleness fresh/stale/absent with a scripted git; renew posts the right body/bearer against a fake curl; teardown remembers the secret BEFORE spending it. - [ ] **Step 2: Run** `bash scripts/tests/rehearsal-standing-test.sh` → FAIL; **implement**; → PASS. - [ ] **Step 3: launch.ts** — add the option (default unchanged); `pnpm -r typecheck` → PASS (no behavior change for existing specs — assert by running the fixtures' unit suite). - [ ] **Step 4: Commit** — `git commit -m "rehearsal-5: standing-community lib — facts, staleness verdict, renew, teardown; launch stateDir override (ADR 0207) (task 8 of #<ticket>)"`. --- ## Global Constraints (from the plan) - **Nothing fabricated (ADR 0100):** every landed fact is read from the box; a failure is a named error, never a masked success. No sandbox-green claim (#377). - **The wipe consent is given at the machine (ADR 0024)** and shown-not-re-asked at P4-S3x; the takeover runs at provisioning's first deploy, never at join. - **One placement deploy = device closure + gateway route** in one config-repo commit, then two single-node `clan.Deploy` calls, device first (ruling: a route to a dead service is the honest failure, a service with no route is invisible). - **Standing community:** home `test-results/standing-rented/`; staleness gate = `oc_bootstrap_staleness` pattern over `agent/ go.mod go.sum internal/`; the reaper stays honest — renewal, not exemption (`idss-rental-hold` is for humans, the executor never sets it). - **Do not destabilize live drives:** #720 (rented confirm loop, elitebook) and #721/#722 (workstation) keep running; the prefix extraction (Task 10) is behavior-preserving and #720 must stay green across it. Never touch the executors' env files from a ticket. - **Tracker gotcha:** labels via `POST/DELETE /issues/<n>/labels`, never in an issue PATCH. "closes #NNN" in commit messages auto-closes — say "task N of #NNN" instead. - **ADR numbers:** 0207/0208/0209 assumed — re-check `git ls-tree origin/main docs/adr/` at mint (IDIP + observability swarm lanes are minting concurrently). - **STATUS.md** updated in the same commit as any project-state change; `git pull --rebase` immediately before a STATUS commit (shared checkout). - Go: `gofmt`, `go vet ./...`, `go test ./...` green; TS: `pnpm -r typecheck` + unit suites green, pre-land.

ADR numbers ruled at mint — read 0207 → 0208, 0208 → 0209, 0209 → 0210

Task 1 (#842) has landed the phase-5 design tier. This ticket's body carries the
plan's assumed ADR numbers; they shifted by one at mint, exactly as the
Global Constraints line in your body told you to re-check.

assumed ruled ADR
0207 0208 the standing rehearsal community — staleness-gated re-found
0208 0209 device-add's landing goes live — mesh fact, fleet admission, /get
0209 0210 files on a member device — composition, OIDC split, mesh route

Why: docs/adr/0207-design-keri-stack-version-pins.md (#771, the concurrent
IDIP lane) had taken 0207 on origin/main before this arc minted.

Use the ruled numbers in your commit messages and code comments. The plan
(docs/superpowers/plans/2026-08-25-183-phase-5-device-nextcloud-rehearsal.md)
is updated and records the mapping; commit 70a3bce6.

Ruled by agent under ADR 0174 — veto anytime.

## ADR numbers ruled at mint — read 0207 → 0208, 0208 → 0209, 0209 → 0210 Task 1 (#842) has landed the phase-5 design tier. This ticket's body carries the plan's **assumed** ADR numbers; they shifted by one at mint, exactly as the Global Constraints line in your body told you to re-check. | assumed | **ruled** | ADR | |---|---|---| | 0207 | **0208** | the standing rehearsal community — staleness-gated re-found | | 0208 | **0209** | device-add's landing goes live — mesh fact, fleet admission, `/get` | | 0209 | **0210** | files on a member device — composition, OIDC split, mesh route | Why: `docs/adr/0207-design-keri-stack-version-pins.md` (#771, the concurrent IDIP lane) had taken 0207 on `origin/main` before this arc minted. Use the **ruled** numbers in your commit messages and code comments. The plan (`docs/superpowers/plans/2026-08-25-183-phase-5-device-nextcloud-rehearsal.md`) is updated and records the mapping; commit `70a3bce6`. Ruled by agent under ADR 0174 — veto anytime.

swarm-claim host=elitebook-distributed-server-03 run=10098
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=10098 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #849 — status success

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

envelope
{
  "issue": 849,
  "status": "success",
  "commits": [
    "f2f123d0706be3eb6c363b4045b600b514bd3d86"
  ],
  "changed_files": [
    "STATUS.md",
    "app/tests/e2e/fixtures/launch.ts",
    "scripts/lib/rehearsal-standing-lib.sh",
    "scripts/tests/rehearsal-standing-test.sh"
  ],
  "tests": [
    {
      "command": "bash scripts/tests/rehearsal-standing-test.sh",
      "exit_code": 0
    },
    {
      "command": "node_modules/.bin/vitest run tests/e2e/fixtures (app)",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Step 1: failing offline test (facts round-trip; staleness fresh/stale/absent with a scripted git; renew posts the right body/bearer against a fake curl; teardown remembers the secret BEFORE spending it)": "scripts/tests/rehearsal-standing-test.sh — 12 checks: A facts round-trip, B secret mining, C staleness (fresh tip, fresh docs-only-behind, stale-before-agent/, stale-before-internal/, absent, unknown-sha, off-history), D renew posts /v1/gateways/renew + Bearer + {host} and never dies on a 500, E teardown asserts REMEMBER line precedes the release curl line",
    "Step 2: run test -> FAIL then implement -> PASS": "test ran red (lib absent) then green after scripts/lib/rehearsal-standing-lib.sh landed — `bash scripts/tests/rehearsal-standing-test.sh` exit 0, 12 checks passed",
    "Interface: OC_STANDING_DIR + oc_standing_facts_write/read/secret/staleness/renew/teardown produced": "scripts/lib/rehearsal-standing-lib.sh defines all seven per the manifest signature; staleness copies #600's oc_bootstrap_staleness three-guard+rev-list over agent/ go.mod go.sum internal/ (0/1/2); secret mines state via the oc_rented_teardown grep verbatim; teardown consumes oc_slug_secret_remember (guarded) before release+offboard+rm",
    "Step 3: launch.ts adds LaunchOptions.stateDir? (default unchanged); no behavior change for existing specs (fixtures unit suite)": "app/tests/e2e/fixtures/launch.ts — stateDir?: string added, `opts.stateDir ?? join(runDir,'state')`; 113 fixture unit tests green (vitest run tests/e2e/fixtures); pre-existing vue-tsc errors are in unrelated files (tests/unit/mermaidDocs.test.ts, slicesYaml.test.ts) not touched by this slice",
    "Step 4: commit + STATUS.md in same commit": "f2f123d — commit message names #849/ADR 0208/files/decisions; STATUS.md marks #849 LANDED in the phase-5 arc, header + affected node updated"
  },
  "summary": "Standing-community lib (facts, staleness verdict, renew, teardown) + launch stateDir override, ADR 0208, task 8 of #849.",
  "blockers": []
}
**close-report** for #849 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 849, "status": "success", "commits": [ "f2f123d0706be3eb6c363b4045b600b514bd3d86" ], "changed_files": [ "STATUS.md", "app/tests/e2e/fixtures/launch.ts", "scripts/lib/rehearsal-standing-lib.sh", "scripts/tests/rehearsal-standing-test.sh" ], "tests": [ { "command": "bash scripts/tests/rehearsal-standing-test.sh", "exit_code": 0 }, { "command": "node_modules/.bin/vitest run tests/e2e/fixtures (app)", "exit_code": 0 } ], "criteria": { "Step 1: failing offline test (facts round-trip; staleness fresh/stale/absent with a scripted git; renew posts the right body/bearer against a fake curl; teardown remembers the secret BEFORE spending it)": "scripts/tests/rehearsal-standing-test.sh — 12 checks: A facts round-trip, B secret mining, C staleness (fresh tip, fresh docs-only-behind, stale-before-agent/, stale-before-internal/, absent, unknown-sha, off-history), D renew posts /v1/gateways/renew + Bearer + {host} and never dies on a 500, E teardown asserts REMEMBER line precedes the release curl line", "Step 2: run test -> FAIL then implement -> PASS": "test ran red (lib absent) then green after scripts/lib/rehearsal-standing-lib.sh landed — `bash scripts/tests/rehearsal-standing-test.sh` exit 0, 12 checks passed", "Interface: OC_STANDING_DIR + oc_standing_facts_write/read/secret/staleness/renew/teardown produced": "scripts/lib/rehearsal-standing-lib.sh defines all seven per the manifest signature; staleness copies #600's oc_bootstrap_staleness three-guard+rev-list over agent/ go.mod go.sum internal/ (0/1/2); secret mines state via the oc_rented_teardown grep verbatim; teardown consumes oc_slug_secret_remember (guarded) before release+offboard+rm", "Step 3: launch.ts adds LaunchOptions.stateDir? (default unchanged); no behavior change for existing specs (fixtures unit suite)": "app/tests/e2e/fixtures/launch.ts — stateDir?: string added, `opts.stateDir ?? join(runDir,'state')`; 113 fixture unit tests green (vitest run tests/e2e/fixtures); pre-existing vue-tsc errors are in unrelated files (tests/unit/mermaidDocs.test.ts, slicesYaml.test.ts) not touched by this slice", "Step 4: commit + STATUS.md in same commit": "f2f123d — commit message names #849/ADR 0208/files/decisions; STATUS.md marks #849 LANDED in the phase-5 arc, header + affected node updated" }, "summary": "Standing-community lib (facts, staleness verdict, renew, teardown) + launch stateDir override, ADR 0208, task 8 of #849.", "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#849
No description provided.