carlos / platform Public

spec rev 2: first-run next steps (Astra round 1)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 80402dd66c1eee4b2e44e1ffea469a9e2dbcc3a3 parent fafa693
3 files changed, +138 −44
  • docs/superpowers/specs/2026-11-08-first-run-next-steps-design.md +53 −44
  • docs/superpowers/specs/CODEX-FINDINGS-first-run-next-steps.md +43 −0
  • docs/superpowers/specs/CODEX-REVIEW-BRIEF-first-run-next-steps-R2.md +42 −0

CI cancelled — superseded by a newer push — run details

Intent

Human

<task-notification> <task-id>bp8mrxnmj</task-id> <tool-use-id>toolu_01RERCSxnmtXvQe3fpdt8kTA</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/a1de5273-c148-49b8-8267-3dee9d49c9c1/tasks/bp8mrxnmj.output</output-file> <status>completed</status> <summary>Background command "Run Astra spec review for first-run next steps" completed (exit code 0)</summary> </task-notification>

Attributed to this commit: 35.8 g CO₂e (4,625,246 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on design-first-run-next-steps, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.

diff --git a/docs/superpowers/specs/2026-11-08-first-run-next-steps-design.md b/docs/superpowers/specs/2026-11-08-first-run-next-steps-design.md
index f97020b0e..33c41d618 100644
--- a/docs/superpowers/specs/2026-11-08-first-run-next-steps-design.md
+++ b/docs/superpowers/specs/2026-11-08-first-run-next-steps-design.md
@@ -1,6 +1,8 @@
# First-run next steps (account "Getting started" checklist)
-Status: draft for Paul, 2026-11-08. Slice 1 of "agent-first onboarding and
+Status: rev 2 for Paul, 2026-11-08. Astra round 1:
+`CODEX-FINDINGS-first-run-next-steps.md` (NOT READY: P1 domain detection,
+six P2s); accepted findings marked **(codex N)**, none declined. Slice 1 of "agent-first onboarding and
console parity" (order Paul approved 2026-11-08: first-run page, console
secrets, parity guard, MCP connector). Slice 0, agent login by link, is live
in v0.34.27 (`2026-11-07-agent-login-link-design.md`).
@@ -32,18 +34,18 @@ up the first step that isn't, and mutes the rest:
Open state: a copyable prompt for the agent ("Deploy this app to
{console}. Use the carlos CLI; my account is ready."), and "Create an app
here instead" linking the existing create-app page.
-3. **Add your app's secrets.** Carloku does not know which secrets an app
- needs (nothing declares them today), so this step is done when any app in
- the account has at least one saved environment setting or secret, or when
- the person presses Skip for this step (my call, Paul agreed in principle
- 2026-11-08). Open state: say secrets can be given to the agent or set
- here; until slice 2 ships the console page, "set here" points at the
- existing settings page and the CLI command; slice 2 replaces that link.
-4. **Use your own domain.** Done when any app in the account has a custom
- domain attached. Open state: link the existing domain page/command; Skip
- allowed.
-
-The card hides itself when all four are done or skipped. "Hide" on the
+3. **Add your app's secrets.** Not detected (see rev 2 below). Open
+ state: secrets can be given to the agent (copyable prompt: "Set the
+ secrets my app needs on {console}") or set with the CLI
+ (`carlos secrets set`); there is no console editor until slice 2, so the
+ step offers instructions, not a "set here" link (codex 7). Buttons:
+ "Mark done" and "Skip".
+4. **Use your own domain.** Not detected (see rev 2 below). Open state:
+ link the existing domain page for owners (browser attach is owner-only)
+ and the CLI command for everyone. Buttons: "Mark done" and "Skip".
+
+The card hides itself, for good, once all four are done, marked done or
+skipped (completion is remembered, call 5). "Hide" on the
card hides it for that person on that account, permanently, with a small
"Show getting started" link left in the page footer area to bring it back.
@@ -51,8 +53,9 @@ card hides it for that person on that account, permanently, with a small
- A new person always sees exactly one clear next thing to do, worded for
someone driving an agent, with the agent prompt one tap from the clipboard.
-- The ticks are facts, computed when the page renders; nobody has to tick
- anything except Skip.
+- Steps 1 and 2 tick themselves from facts computed when the page renders.
+ Steps 3 and 4 are ticked by the person (Mark done or Skip): Carloku can't
+ tell cheaply or reliably when they are done (rev 2).
- Uses only existing console components (confirm-card, chips, code block,
buttons); no new visual language. Works with JavaScript off (Copy is an
enhancement; the prompt is selectable text).
@@ -85,36 +88,42 @@ card hides it for that person on that account, permanently, with a small
approval on #280 (console code normally is not).
- Release like v0.34.27: console only, through the agent manager (8a3d302).
-## Calls made after the builder check (mine, 2026-11-08)
-
-1. **Step 3 without S3 reads.** The console records a per-account "has
- saved settings" fact in its own database whenever a settings write
- succeeds through the console: the CLI's `PUT /api/cli/apps/{account}/{app}/config`
- (handleAPIConfigPut), `POST .../config/sync`, and the console's own
- settings pages. Writes that bypass the console (an operator writing the
- bucket directly) don't tick it; Skip covers that. "Settings" means
- environment variables and secrets (appconfig), not the store record.
- No backfill pass: existing accounts with settings already have apps and
- rarely need the card; the bit is set on their next write, and Skip works.
-2. **Step 4 is routed custom domains only,** from the views the page
- already loads (`AppView.Domains`), excluding the platform's own hosts
- (compare against the apps domain, not a Type string). A domain still
- attaching shows as not done until it routes, which is true.
-3. **Step 2 is done when any app's verdict is "ok"** (`summarize`), the same
- "deployed and healthy" the list shows. A failing first deploy or an
- unreported remote instance is not done: the card should keep helping.
-4. **Step 1 counts person tokens only** (`Kind == ""`, not revoked, not
+## Calls made after the builder check and Astra round 1 (mine)
+
+1. **Steps 3 and 4 are person-ticked, not detected.** Astra round 1 showed
+ that detecting them needs either new S3 reads or a derived fact kept in
+ step with a dozen writers (config PUT, sync, env fork, relay and scan and
+ mail credentials, storage and mail walks, removals, trash and purge), and
+ that domain attach creates aliases the page's views don't carry
+ **(codex 1, 2, 3)**. A wrong tick is worse than asking, so the person
+ presses "Mark done" or "Skip". Both are stored per person per account.
+2. **Step 2 is done when an app shows a deployed version** in the data the
+ apps list already loads: the "Observed versions" cell is non-empty
+ (`Deployment.UniformVersion` set or `Deployment.Mixed`) and its verdict is
+ not "attention". The step claims "live", not "healthy": the list has no
+ process-liveness evidence **(codex 4)**. A static app whose route lacks
+ its channel does not count.
+3. **Step 1 counts person tokens only** (`Kind == ""`, not revoked, not
expired); app and service tokens never tick it. A slice 0 agent login is
- a person token. Tokens are per person, so step 1 ticks in every account
- that person belongs to; Hide and Skip are per person per account.
-5. **Everyone who can see the account's apps page sees the card**; each
- action link appears only if the viewer's role allows it (create app,
- settings, domains), otherwise the step shows its text without the
- button. It renders in the zero-apps branch too (above the welcome text),
- which is the main new-user case.
-6. **Skip exists on steps 3 and 4 only.** A real "done" always wins over a
- skip. "Show getting started" brings the card back and clears that
- person's skips on that account.
+ a person token. Step 1 ticks in every account the person belongs to.
+4. **Who sees it:** everyone who can see the account's apps page. Each
+ action appears only if that viewer's role allows it (members can create
+ apps and read settings; browser domain attach is owner-only), otherwise
+ the step shows its text and the CLI or agent route.
+5. **Completion is remembered** **(codex 5):** the first time a person's
+ view shows all four steps done, skipped or marked done, a "completed"
+ mark is stored for that person and account, and the card stays hidden
+ even if a fact later changes (a token expires, an app is deleted).
+ "Show getting started" clears that person's completed mark, skips and
+ marks-done on that account, so the card shows the live state again.
+6. **Preference handlers** **(codex 6):** Hide, Show, Skip and Mark done are
+ POSTs under `/a/{sqid}/getting-started/...`, following `handleAppStar`
+ (applist.go): session required, account membership checked, the person
+ taken from the session (never the form), CSRF double-submit of the
+ session token, Skip and Mark done accepted for steps 3 and 4 only.
+ All state is in the console database, cleaned up with the account's
+ existing soft-delete cleanup (ownership.go) and per-person on member
+ removal.
## Left to the builder
diff --git a/docs/superpowers/specs/CODEX-FINDINGS-first-run-next-steps.md b/docs/superpowers/specs/CODEX-FINDINGS-first-run-next-steps.md
new file mode 100644
index 000000000..58cef6a42
--- /dev/null
+++ b/docs/superpowers/specs/CODEX-FINDINGS-first-run-next-steps.md
@@ -0,0 +1,43 @@
+Reviewed `fafa6933c4721b858b5082856d752716cd9ae527`, round 1 of 3. **One P1 and six P2 findings.** Console code is unchanged from the checkout’s `origin/main`.
+
+1. **P1 — Step 4 cannot recognise the normal custom-domain attach.**
+ Fault family: domain completion must reflect actual routing.
+ Spec lines 99–102 rely on `AppView.Domains`, but attaching a domain to an already deployed app creates an **alias**, never another route ([domainattach.go:176](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-first-run-next-steps/internal/console/domainattach.go:176)). That alias never enters this slice, so the step remains incomplete even after the domain works. Conversely, `remoteRoute` adds a `DomainView` for an instance record before any box reports its route ([remoteinstances.go:442](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-first-run-next-steps/internal/console/remoteinstances.go:442)).
+
+ Specify an account/app-scoped check covering local aliases and accepted remote alias reports, excluding pending rows, sidecars and platform hosts. Reusing `settingsDomains` would add reads: its claims lookup, `status.LoadBoxes`, and certificate-warm LIST/GETs ([appsettings.go:714](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-first-run-next-steps/internal/console/appsettings.go:714)). Name the data source that avoids those new S3 reads.
+
+2. **P2 — A successful settings request does not establish that settings exist.**
+ Fault family: step 3 must represent current, nonempty configuration.
+ Spec lines 90–98 include `config/sync`, which succeeds with no config and only touches the generation object ([apiconfig.go:800](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-first-run-next-steps/internal/console/apiconfig.go:800)). PUT also accepts `exec_delivery` alone, or an unset removing the last variable. A permanent account bit additionally survives deletion of the only configured app.
+
+ Define how the stored fact follows successful nonempty bundle contents, across default and named environments, removals, trash/restore and purge. Specify ordering for concurrent writes and delayed database updates so an older result cannot overwrite a newer one or affect a recreated app. Account deletion is a soft delete with explicit cleanup, so table cascades alone would not handle it ([ownership.go:819](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-first-run-next-steps/internal/console/ownership.go:819)).
+
+3. **P2 — The settings-writer inventory is incomplete.**
+ Fault family: every qualifying config write must update the derived fact.
+ Beyond config PUT, console-controlled writes include environment fork (`apienv.go:341`), relay credentials in default and named environments (`relayops.go:657`, `relayenv.go:74`), scan callback secrets (`scankeysync.go:49`), and mail-event verification keys (`apimail.go:920`). Storage grant/rotation and mail enable/rotation also write actual appconfig variables and secrets through [objstore/walk.go:882](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-first-run-next-steps/internal/objstore/walk.go:882) and [mail/walk.go:956](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-first-run-next-steps/internal/mail/walk.go:956), including named environments.
+
+ These are not merely store-record changes. Cover their successful config writes and corresponding removals, including background repair paths. Update at the config commit boundary: some handlers can fail after their config write has already succeeded.
+
+4. **P2 — Verdict `"ok"` does not prove a running, healthy version.**
+ Fault family: deployment completion must not overstate observed state.
+ Spec lines 103–105 equate these facts, but `summarize` returns `"ok"` for static/service-only routes without checking a version or channel pointer ([server.go:7005](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-first-run-next-steps/internal/console/server.go:7005)). Its source comment explicitly excludes process liveness ([server.go:2938](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-first-run-next-steps/internal/console/server.go:2938)).
+
+ Define the completion predicate by serving kind. For channel-backed static routes, check the relevant channel from the already-loaded view; an unrelated environment’s valid channel must not validate a route whose channel is missing. Either narrow the health claim to available evidence or identify an existing observation that supports it without new reads.
+
+5. **P2 — Automatic completion needs persistent dismissal state.**
+ Fault family: completion must not cause repeated onboarding.
+ Lines 46 and 72 require permanent hiding after completion, but only Hide and Skip have specified persistence. Recomputing visibility from live facts makes the card return when a token expires, an app is removed or a domain disappears. Persist completion per person/account, and define how Show clears it. Otherwise Show also immediately hides an already-complete card again.
+
+6. **P2 — Specify the preference-handler security contract.**
+ Fault family: only the authenticated person may change their account preferences.
+ Lines 82–83 specify storage scope but omit POST-only mutations, session validation, account membership and CSRF checks for Hide, Skip **and Show**. Require these explicitly, derive the person from the session, and accept skips only for steps 3 and 4. The existing [star handler](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-first-run-next-steps/internal/console/applist.go:175) provides the appropriate pattern.
+
+7. **P2 — “Set here” promises an editor that does not exist.**
+ Fault family: the offered action must complete the stated task.
+ Spec lines 39–41 send users to settings to add secrets before slice 2. The existing Environments section lists names and CLI instructions; it has no env/secret editor ([app_settings.html:267](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-first-run-next-steps/internal/console/templates/app_settings.html:267)). Until slice 2, describe this as instructions and provide the agent/CLI action directly.
+
+Step 1 is feasible without S3 reads: `CLITokens` uses SQL, excludes revoked tokens, and leaves kind/expiry filtering to the caller as specified. Role handling is also feasible: members can create apps and read settings; browser domain attachment is owner-only. Preserve those actual distinctions rather than applying one owner-only check to every action.
+
+No files changed. No tests or subagents run.
+
+NOT READY
\ No newline at end of file
diff --git a/docs/superpowers/specs/CODEX-REVIEW-BRIEF-first-run-next-steps-R2.md b/docs/superpowers/specs/CODEX-REVIEW-BRIEF-first-run-next-steps-R2.md
new file mode 100644
index 000000000..fbdb7fb36
--- /dev/null
+++ b/docs/superpowers/specs/CODEX-REVIEW-BRIEF-first-run-next-steps-R2.md
@@ -0,0 +1,42 @@
+# Review brief: spec "First-run next steps", round 2 of 3
+
+Repo carlos/platform, branch `design-first-run-next-steps`, commit: the
+commit that adds this file. Under review:
+`docs/superpowers/specs/2026-11-08-first-run-next-steps-design.md`.
+Authorities: main's code (internal/console: apps.html, server.go apps render
+and summarize, authstore.go CLITokens, appsettings.go, apiconfig handlers,
+view.go AppView.Domains, the role checks on create-app/settings/domains).
+
+You are an independent reviewer. Read the spec, then the code it names, and
+check every claim against that code.
+
+Fixed, do not re-argue: Paul chose the checklist layout and the four steps
+(2026-11-08); the "Calls made after the builder check" are the author's and
+open to challenge on correctness, not taste.
+
+Check:
+1. Can each step's done-fact really be computed without new S3 reads per
+ page view, as specified? Name any read the spec misses.
+2. Wrong-tick risks (anti-goal): any case where a step shows done but isn't,
+ including expired tokens, retired versions, platform hosts counted as
+ custom domains, multi-environment apps.
+3. The "has saved settings" bit: every console write path that can save
+ env vars or secrets for an app, so none is missed; races; what happens on
+ account or app deletion.
+4. Role handling: viewers without permission must not get links that 403;
+ Hide/Skip handlers need CSRF and must be per person per account.
+5. Anything else that would make it not work or slow the apps page.
+
+Severity: P1 unsafe/would not work (blocks approval); P2 wrong or missing
+(fixed without another round); P3 polish (follow-up). End with exactly one
+verdict: READY, READY AFTER FIXES, or NOT READY. Do not edit files. No
+subagents. No full test suites.
+
+## Round 2
+
+Round 1: `CODEX-FINDINGS-first-run-next-steps.md` (P1 domain detection;
+P2 settings fact, writer inventory, verdict ok, completion persistence,
+handler contract, "set here"). The author cut detection of steps 3 and 4
+(person-ticked now) instead of building derived facts. First give one line
+per round-1 finding: resolved, partly, or not; then new findings. Item 3 of
+"Check" (the settings bit) no longer applies.