Skip to content

feat: add profile presets and proof artifacts#115

Merged
steipete merged 3 commits into
mainfrom
feat/profiles-presets-proof
May 16, 2026
Merged

feat: add profile presets and proof artifacts#115
steipete merged 3 commits into
mainfrom
feat/profiles-presets-proof

Conversation

@steipete
Copy link
Copy Markdown
Contributor

Summary

  • Add configured profiles and presets for crabbox run, including profile env defaults, doctor requirements, artifact globs, proof templates, and preset variables.
  • Add profile-aware remote doctor checks, artifact harvesting into .crabbox/runs, parser-safe real behavior proof emission, expanded run summary fields, and --stop-after cleanup policy.
  • Update durable command/feature docs for run, doctor, artifacts, and configuration. docs/refactor/profiles-presets.md is intentionally absent.

Verification

  • go test ./...
  • go vet ./...
  • go build -trimpath -o bin/crabbox ./cmd/crabbox
  • go test -race ./...
  • node scripts/check-command-docs.mjs
  • node scripts/check-docs-links.mjs
  • node scripts/build-docs-site.mjs
  • npm ci --prefix worker
  • npm run format:check --prefix worker
  • npm run lint --prefix worker
  • npm run check --prefix worker
  • npm test --prefix worker
  • npm run build --prefix worker
  • $codex-review: clean, no accepted/actionable findings
  • test ! -e docs/refactor/profiles-presets.md

Copy link
Copy Markdown

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

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: f538d604e4

ℹ️ 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 internal/cli/run.go
Comment on lines +915 to +916
} else if useShell {
remote = windowsRemoteShellCommandWithEnvFiles(workdir, runEnv, envFiles, runCommandShellStringWithLiteralArgs(command, false, expansion.LiteralArgs))
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Use PowerShell-safe auto-shell script on native Windows

When useShell is true on a native Windows target (for example commands containing control operators like &&/| or leading env assignments) this path now feeds runCommandShellStringWithLiteralArgs(...) into windowsRemoteShellCommandWithEnvFiles(...). That helper builds POSIX-quoted fragments via shellQuote (e.g. 'cmd' 'arg'), which PowerShell does not execute as a command invocation, so auto-shell commands that previously ran as plain joined text will fail on Windows with parse/execution errors.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

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

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: 7a8a7c70be

ℹ️ 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 internal/cli/doctor.go
if err != nil {
return err
}
cfg.Profile = strings.TrimSpace(*profile)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve configured profile when --profile is omitted

Do not overwrite cfg.Profile unconditionally from the flag value here: --profile is registered with defaultConfig().Profile (typically empty), so when users run crabbox doctor --id ... without passing --profile, this assignment clears the profile loaded from config and silently disables profiles.<name>.doctor.enabled checks. That means repos relying on profile: in config will skip the new remote prerequisite contract unless callers redundantly pass --profile every time.

Useful? React with 👍 / 👎.

func remoteProfileDoctorCommand(profile string, doctor DoctorProfileConfig, workdir string) string {
script := profileDoctorScript(doctor, workdir)
encoded := base64.StdEncoding.EncodeToString([]byte(script))
return "bash -lc " + shellQuote("tmp=$(mktemp); trap 'rm -f \"$tmp\"' EXIT; printf %s "+shellQuote(encoded)+" | base64 -d > \"$tmp\" || exit 1; bash \"$tmp\"")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Make profile doctor script decode portable across POSIX targets

The profile doctor path is only blocked for native Windows, so macOS targets are treated as supported POSIX targets, but this command hard-codes base64 -d for decoding. On BSD/macOS base64, decode uses -D (and -d fails), so profile doctor exits before executing any prerequisite checks on macOS leases. This creates false profile doctor failed results despite valid environments.

Useful? React with 👍 / 👎.

@steipete steipete merged commit 091b7d3 into main May 16, 2026
11 checks passed
@steipete steipete deleted the feat/profiles-presets-proof branch May 16, 2026 23:44
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