Skip to content

[recipes] Add install-time wiki/crm surface toggles to bootstrap - #64

Open
alanshurafa wants to merge 1 commit into
mainfrom
contrib/alanshurafa/bootstrap-surface-toggles
Open

[recipes] Add install-time wiki/crm surface toggles to bootstrap#64
alanshurafa wants to merge 1 commit into
mainfrom
contrib/alanshurafa/bootstrap-surface-toggles

Conversation

@alanshurafa

Copy link
Copy Markdown
Owner

Contribution Type

  • Recipe (/recipes)

What does this do?

Makes the fresh-install experience "enabled by default, easy to opt out" for the Wiki and CRM surfaces. The installer already defaulted to the wiki-crm bundle; this adds discoverable install-time toggles so you don't have to know bundle names or edit the script:

  • Default (no flags): both surfaces enabled — zero-setup first run, no dashboard setup card.
  • --disable crm / --disable wiki (comma-list): opt a surface out.
  • --enable wiki,crm: explicit set (replaces the default).
  • --bundle <name>: unchanged, still works as an explicit alias.

Precedence --bundle > --enable > default-minus---disable; the three combinations are mutually exclusive and fail fast with clear messages. The plan now prints a plain-language Surfaces: Wiki (enabled), CRM (disabled) line, an interactive Proceed? [Y/n] confirm (TTY-only, skipped by --yes and never reached under --dry-run), and — for anything left disabled — an actionable hint pointing at either a re-run or the dashboard's existing "Re-check now" flow.

Design note

"Composing surfaces" is a lookup, not a re-merge: each legal {wiki, crm} combination already exists as a hand-ordered BUNDLES entry, so surface selection maps to an existing bundle key and the schema/function dependency order can't drift. No SQL, no schema changes, no new deps (stdlib Node).

Manual verification

  • node --check clean.
  • --dry-run across default / --disable crm / --disable wiki / --disable wiki,crm / --enable crm / --bundle wiki — each resolves to the correct pre-ordered bundle; Surfaces line correct; zero network calls; zero prompts.
  • Non-TTty run (--dry-run </dev/null) confirmed prompt-free (no hang) — the confirm is gated on process.stdout.isTTY && !--yes.
  • Error cases fire (exit 1): --enable+--disable, --bundle+--enable, unknown surface, empty list.
  • markdownlint-cli2 --config .github/.markdownlint.jsonc on the README: 0 errors.
  • No DROP/TRUNCATE/DELETE introduced; credential grep clean.

The live apply/deploy/verify paths are unchanged (only the resolved bundle values feed them), so this carries no new live-project gate beyond the installer's existing first-run acceptance step.

Checklist

  • I've read CONTRIBUTING.md
  • My contribution has a README.md with prerequisites, step-by-step instructions, and expected outcome
  • My metadata.json has all required fields
  • If my contribution depends on a skill or primitive, I declared it in metadata.json and linked it in the README
  • I tested this on my own Open Brain instance (dry-run + static gates; unchanged live paths covered by the installer's existing first-run gate)
  • No credentials, API keys, or secrets are included

🤖 Generated with Claude Code

Surfaces are on by default for a zero-setup first run, but users
who only want part of the stack need a way to opt out (or explicitly
opt in) at install time instead of editing the script. Adds --enable/
--disable alongside the existing --bundle, plus a plan-time "Surfaces:"
summary and a re-check hint for whatever's left disabled.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions github-actions Bot added the recipe label Jul 6, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a6148ac0b3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

// --yes. --dry-run never reaches this (it returns before main's confirm
// call), so it is not part of this check.
function shouldPrompt(flags) {
return Boolean(process.stdout.isTTY) && !flags.yes;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Require stdin TTY before prompting

When stdout is a TTY but stdin is a pipe, this still enters confirm() and waits for input/EOF that a user cannot provide; for example, a terminal run like tail -f /dev/null | node bootstrap.mjs --project-ref ... hangs at Proceed? instead of proceeding prompt-free as the new piped-run behavior describes. Check process.stdin.isTTY as well before showing the interactive prompt.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant