Skip to content

feat(cloud-bootstrap): add canonical synced repo cloud bootstrap - #397

Merged
kyle-sexton merged 2 commits into
mainfrom
feat/cloud-bootstrap-component
Aug 16, 2026
Merged

feat(cloud-bootstrap): add canonical synced repo cloud bootstrap#397
kyle-sexton merged 2 commits into
mainfrom
feat/cloud-bootstrap-component

Conversation

@kyle-sexton

Copy link
Copy Markdown
Contributor

Summary

Collapses the fleet's twelve hand-copied, drifted .claude/cloud-bootstrap.sh generations into one standards-owned component, distributed by exact materialization with the standard tri-mode lever: take (managed), enrich (a repo's own never-synced .claude/cloud-bootstrap.local.sh, run by the canonical script), or customize (locally-owned).

Fix

  • New component components/cloud-bootstrap/ — the canonical script is generic by construction: no repo names, marketplace identifiers, or pinned versions. Node from .node-version, npm ci from the root lockfile, .NET exactly as global.json pins, marketplaces and plugins from .claude/settings.json (every declared marketplace; every enabledPlugins: true entry, whichever marketplace it names — which also removes the previous hardcoded-marketplace second code path). Adds an environment-snapshot stamp log line (per-account build visibility) and shallow-clone repair (origin/main resolvable for base-ref diffs).
  • distribution/sync-manifest.ymlmanaged for .github, ci-runner, ci-workflows, github-iac, provisioning; locally-owned with recorded reasons for claude-code-plugins (directory-source dogfooding) and medley (repo-specific toolchain; converge later); dotfiles excluded pending its cloud adoption.
  • Contract testscloud-bootstrap.test.sh (parse, generic-by-construction, calling-contract landmarks, stamp-path lockstep with cloud-environment, byte-equality with this repo's own materialized copy); setup.test.sh now lockstep-tests the cloud-environment Node warm-cache pin against .node-version.
  • distribution/check-plugin-baseline.sh — report-only fleet drift check of each target's plugin catalog against this repository's own settings file (the dogfooded fleet baseline), with an offline --compare mode under test.
  • CI: the cloud-environment job now runs both cloud contract tests.

Verification

  • harness/shell/run-tests.sh over the three touched test files: 3 passed.
  • distribution/sync-manifest.sh validate: Manifest valid: 38 components, 8 targets; plan --targets melodic-software/ci-runner renders 100755 components/cloud-bootstrap/cloud-bootstrap.sh -> .claude/cloud-bootstrap.sh.
  • shellcheck + shfmt clean on all new/changed shell; markdownlint clean on changed docs; lefthook pre-commit green.
  • sync-manifest.test.sh: engine fixture cases pass except the two symlink-rejection cases, which fail only on Windows (symlink creation degrades to a regular file there); they are fixture-local and unaffected by this change — CI's Ubuntu run is authoritative.
  • Post-merge follow-ups (deliberate, not in this PR): the provisioning fan-out PR needs its repo-specific toolchain re-added as .claude/cloud-bootstrap.local.sh (extraction prepared); a live cloud verification per the cloud-environment README's stamp checklist.

No linked issue

Related

🤖 Generated with Claude Code

https://claude.ai/code/session_012tKxg98B3QySqEPf8UqwX3

Promote the per-repo .claude/cloud-bootstrap.sh to a standards-owned
component (components/cloud-bootstrap/) and distribute it by exact
materialization: managed for .github, ci-runner, ci-workflows, github-iac,
and provisioning; locally-owned for claude-code-plugins (directory-source
dogfooding) and medley (repo-specific toolchain, converge later). The fleet's
twelve hand-copied bootstrap generations collapse to one reviewed file.

The canonical script is generic by construction — no repo names, marketplace
identifiers, or pinned versions. Everything is data-driven from the consuming
repo's own manifests: Node from .node-version, npm ci from the root lockfile,
the .NET SDK exactly as global.json pins, marketplaces and plugins from
.claude/settings.json (every declared marketplace, every enabledPlugins entry
set to true, whichever marketplace it names). It also logs the environment
snapshot stamp for per-account build visibility, repairs the shallow
single-branch cloud clone so base-ref diffs work, and runs a repo's committed
.claude/cloud-bootstrap.local.sh as the never-synced enrich seam — this
repository's own extension installs each component project's lockfile.

Guards added alongside:
- cloud-bootstrap.test.sh: parse, generic-by-construction (no marketplace or
  repo identifiers), calling-contract landmarks, stamp-path lockstep with the
  cloud-environment component, and byte-equality between the component and
  this repository's own materialized copy (standards is the manifest source,
  not a sync target).
- setup.test.sh: the cloud-environment Node warm-cache pin is now
  lockstep-tested against this repository's .node-version instead of relying
  on the README's manual obligation.
- distribution/check-plugin-baseline.sh: report-only fleet drift check of
  each target's enabledPlugins/marketplace declarations against this
  repository's own settings file (the dogfooded fleet baseline), with an
  offline --compare mode exercised by its test.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012tKxg98B3QySqEPf8UqwX3
@cursor

cursor Bot commented Aug 16, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@claude

claude Bot commented Aug 16, 2026

Copy link
Copy Markdown

Claude finished @kyle-sexton's task in 4m 38s —— View job


Code review — cloud-bootstrap component

  • Gather context (diff, changed files, CLAUDE.md)
  • Understand the request (/review:code-review — correctness/maintainability, no security lane duplication)
  • Review changed files
  • Post inline findings
  • Post summary

Scope reviewed: all 12 changed files (origin/main...HEAD), plus a manual check that the committed .claude/cloud-bootstrap.sh is byte-identical to components/cloud-bootstrap/cloud-bootstrap.sh (it is — the contract test's core claim holds), and that the new setup.test.sh Node-pin lockstep and cloud-bootstrap.test.sh stamp-path lockstep both point at real, matching values in components/cloud-environment/setup.sh / .node-version. CI (ci workflow, run 31975672844) is green.

Findings (posted inline on distribution/check-plugin-baseline.sh):

  1. Fragile hand-rolled YAML target parsing, with a real coverage gap (line 111) — fleet mode discovers targets via a sed regex ([a-z.-]*/[a-z.-]*) instead of reusing sync-manifest.sh's existing, validated target list (TARGET_NAMES, populated via yq eval -r '.targets | keys[]', or the matrix subcommand's JSON output). Today's target names all happen to satisfy the regex, but any future target repo name containing a digit or underscore would silently drop out of the no-argument fleet sweep with no error — the opposite of what a drift-visibility tool should do.
  2. base64 -d is GNU-only (line 119) — macOS's built-in base64 uses -D, not -d. On a Mac this fails, the && chain short-circuits, and the script prints the misleading "no readable .claude/settings.json (repo declares nothing)" message for a repo whose settings are actually fine.

Both findings are scoped to the new, optional check-plugin-baseline.sh fleet-audit tool — they don't touch the core cloud-bootstrap.sh sync path, which read cleanly: cloud-only guard, enrich seam, and plugin/marketplace install logic are all correctly data-driven off the consuming repo's own manifests, with no hardcoded repo/marketplace identifiers left behind.

No other correctness or maintainability issues found in components/cloud-bootstrap/, distribution/sync-manifest.yml, the test files, .github/workflows/ci.yml, or the README updates.
· Branch

@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: 9783bfa755

ℹ️ 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".

Comment thread components/cloud-bootstrap/cloud-bootstrap.sh Outdated
Comment thread distribution/check-plugin-baseline.sh Outdated
Comment thread .github/workflows/ci.yml
Comment thread distribution/check-plugin-baseline.sh Outdated
Comment thread distribution/check-plugin-baseline.sh Outdated
@github-actions

Copy link
Copy Markdown

Claude has reviewed this PR 1 time. The lane skips further automatic reviews after 5; deleting this comment resets the count.

…leet report portability

- Run the cloud-bootstrap.local.sh enrich seam inside the toolchain subshell
  so it inherits the nvm-selected Node on PATH (and the warn-never-fatal
  posture) instead of the caller's pre-pin environment.
- check-plugin-baseline: require jq in both modes and refuse an unparsable
  baseline/candidate loudly (exit 2) instead of letting a swallowed jq
  failure read as "matches baseline"; enumerate fleet targets through
  `sync-manifest.sh matrix` instead of a second hand-rolled YAML parse;
  fetch settings via the GitHub raw media type, dropping the GNU-only
  `base64 -d`; strip CRs from jq -r captures so a Windows jq cannot corrupt
  repo slugs or reported names.
- CI: run the plugin-baseline contract test in the distribution job.

Verified: shellcheck/shfmt clean; contract tests green; live fleet run
reports 6 targets matching baseline, claude-code-plugins diverging only on
its directory-source marketplace declaration, and medley's known divergence.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012tKxg98B3QySqEPf8UqwX3
@kyle-sexton
kyle-sexton merged commit 8dab051 into main Aug 16, 2026
45 checks passed
@kyle-sexton
kyle-sexton deleted the feat/cloud-bootstrap-component branch August 16, 2026 22:26
kyle-sexton added a commit that referenced this pull request Aug 16, 2026
…ready landed (#398)

## Summary

Corrects a wrong exclusion recorded in #397: dotfiles was left out of
the `cloud-bootstrap` component's targets on the claim it had no
adoption yet, but `melodic-software/dotfiles` main already carries
`.claude/cloud-bootstrap.sh`.

## Fix

Drop the stale exclusion comment and add `cloud-bootstrap` to dotfiles'
`managed` list. Verified live via the GitHub contents API: dotfiles main
has the bootstrap (an older generic generation, 70 lines, no
repo-specific content — safe to converge), the SessionStart hook
registration, and the full baseline plugin declaration. The clone that
informed the original comment was on a stale feature branch. dotfiles is
already a sync target, so the App installation's selected-repo set is
untouched.

## Verification

- `distribution/sync-manifest.sh validate`: `Manifest valid: 38
components, 8 targets`.
- `plan --targets melodic-software/dotfiles` renders `100755
components/cloud-bootstrap/cloud-bootstrap.sh ->
.claude/cloud-bootstrap.sh`.

No linked issue

## Related

- #397 (component introduction; recorded the exclusion this PR reverses)
- melodic-software/claude-code-plugins#2885 (fleet audit that surfaced
the discrepancy)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_012tKxg98B3QySqEPf8UqwX3

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
kyle-sexton added a commit that referenced this pull request Aug 16, 2026
#399)

## Summary

Agents working in consumer repos had no in-repo statement of the two
conventions the cloud rollout rests on. Adds a "Cloud sessions and
plugins" section to the synced orientation (AGENTS.md in every
agent-orientation target).

## Fix

Two bullets: the checked-in `.claude/settings.json` is the repo's plugin
source of truth (cloud sessions install exactly what it declares — a
repo that declares nothing gets nothing); `.claude/cloud-bootstrap.sh`
is owned by the `components/cloud-bootstrap` component with
`.claude/cloud-bootstrap.local.sh` as the repo's never-synced enrich
seam. Mode (`managed` vs `locally-owned`) is deliberately left to the
manifest, so the text stays true for repos that own their copy.

## Verification

- markdownlint clean; `sync-manifest.sh validate` green (content-only
change; no manifest edit).
- Fans out to the 5 agent-orientation targets on merge via the ordinary
sync.

No linked issue

## Related

- #397 / #398 (cloud-bootstrap component + targets)
- melodic-software/claude-code-plugins#2885 (fleet doc reconciliation
this orientation complements)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_012tKxg98B3QySqEPf8UqwX3

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
kyle-sexton added a commit to melodic-software/claude-code-plugins that referenced this pull request Aug 17, 2026
…mport (#2887)

## Summary

A one-line `CLAUDE.md` import bridges the synced `AGENTS.md` orientation
into
Claude Code sessions, per the official docs: Claude Code reads
`CLAUDE.md`, not
`AGENTS.md` (code.claude.com/docs/en/memory.md, fetched 2026-08-16), and
recommends creating a `CLAUDE.md` that imports it. Symlinks need admin
rights on
Windows, so the `@AGENTS.md` import line is the portable bridge.

## Fix

`CLAUDE.md` becomes exactly `@AGENTS.md` (single line, trailing
newline).

This is an unhobble re-add with evidence, not a restoration of prose:
the root
`CLAUDE.md` is deliberately 0 bytes from the bare-baseline resets
(melodic-software/standards#348), whose rule is that an instruction
returns only
with ledger evidence. The evidence cited here is the managed-file
silent-overwrite failure mode that `AGENTS.md` exists to prevent, plus
the
verified doc fact that `AGENTS.md` alone never loads into a Claude
session. One
import line, no restored prose.

## Verification

- `CLAUDE.md` is one line (`@AGENTS.md`) plus a trailing newline, 11
bytes.
- `AGENTS.md` confirmed non-empty at the default-branch HEAD before the
change
  (952 bytes, via `gh api` with the raw media type).
- `CLAUDE.md` is not a sync target in `melodic-software/standards`
`distribution/sync-manifest.yml` (only `AGENTS.md` is), so this edit is
  repo-owned and will not be overwritten by the next standards sync.
- No other files changed.

## Related

- melodic-software/standards#399 (orientation content)
- melodic-software/standards#397 (cloud-bootstrap component)

No linked issue

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_012tKxg98B3QySqEPf8UqwX3

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant