Skip to content

feat(asc): automate CloudKit schema deploy via xcrun cktool (Dev→Production, gated) (#337) - #350

Merged
wei18 merged 1 commit into
mainfrom
feat/cktool-schema-deploy-337
Jun 5, 2026
Merged

wei18 merged 1 commit into
mainfrom
feat/cktool-schema-deploy-337

Conversation

@wei18

@wei18 wei18 commented Jun 5, 2026

Copy link
Copy Markdown
Owner

Closes #337.

mise run ck:schema <export|validate|deploy> --app sudoku|minesweeper [--env development|production] [--i-am-sure] wrapping xcrun cktool. Management token from secrets/.env (never argv/echoed); Production deploy gated behind --i-am-sure (else exit 2); development is the safe default.

Prereqs verified by Leader against live cktool: subcommands (export-schema/import-schema/validate-schema/save-token) + flags (--team-id/--container-id/--environment/--file/--output-file/--validate) match; verb→subcommand mapping correct; container IDs correct; bash -n clean.

CR (security-focused): APPROVE-WITH-NITS — token never in argv/echoed, no set -x, Production guard bypass-resistant, secrets/** gitignored (only .env.example committed), no .ckdb committed. Leader inline-fixed the Med+2Low (one coherent edit): added trap … remove-token … EXIT so the Production-capable token is purged on exit; replaced bogus --quiet + here-string fallback with single stdin save-token --force (fixes the re-run overwrite hang). Does NOT run live Production deploy (user-owned).

🤖 Generated with Claude Code

Wrap `xcrun cktool` as a `ck:schema` mise-task so the CloudKit
Development→Production schema deploy becomes a commit-trackable,
Leader-orderable step — mirroring ASCRegister for ASC metadata / GC.

- mise-tasks/ck/schema: export / validate / deploy subcommands.
  Auth via CK_MANAGEMENT_TOKEN from secrets/.env (never printed/committed,
  fed to cktool save-token via stdin). Container IDs (public) hardcoded
  per --app sudoku|minesweeper.
- Production deploy is USER-OWNED: gated behind a printed confirm gate +
  mandatory --i-am-sure flag (refuses otherwise). No live Production
  deploy performed — automation + docs only.
- cloudkit/README.md: schema-source-of-truth location + seed/deploy flow.
  Actual .ckdb files seeded by user (needs live token + populated Dev
  container); intentionally absent from this PR.
- secrets/.env.example + secrets/README.md: CK_MANAGEMENT_TOKEN / CK_TEAM_ID
  placeholders.
- docs/foundations.md §7.7.2: command surface, Production guard, auth posture.
- review docs: point the Production-schema gate at the new task (still
  user-owned).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@wei18
wei18 merged commit 78e4e1d into main Jun 5, 2026
@wei18
wei18 deleted the feat/cktool-schema-deploy-337 branch June 5, 2026 03:19
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.

feat(asc): automate CloudKit schema deploy via cktool (Dev→Production)

1 participant