Skip to content

feat(cc-201): detect_executor_profile() shim — dedupe codex profile detection#123

Merged
screenleon merged 3 commits into
mainfrom
feat/cc-201-detect-executor-profile
May 22, 2026
Merged

feat(cc-201): detect_executor_profile() shim — dedupe codex profile detection#123
screenleon merged 3 commits into
mainfrom
feat/cc-201-detect-executor-profile

Conversation

@screenleon
Copy link
Copy Markdown
Owner

Summary

v0.3.0 milestone M0 — first ticket of the architecture restructure (epic CC-211). Extracts the duplicated command -v codex executor-profile detection into shared functions; behavior-preserving reuse extraction (CC-201).

  • scripts/lib/portable.sh — new codex_available() + detect_executor_profile()
  • scripts/install-hooks.shPROFILE="$(detect_executor_profile)"
  • scripts/doctor.shcheck_codex() + hook-profile case branch use codex_available(); copy-mode else-branch gains a matching fallback
  • scripts/pr-gate.sh — sources portable.sh behind a graceful guard (pr-gate.sh is copied standalone by its test harness / copy-mode install), with an inline codex_available() fallback
  • scripts/test-portable.sh — +4 cases; scripts/test-doctor.sh — +1 copy-mode/no-codex regression case

Audit (proactive sweep)

All production command -v codex profile-detection sites consolidated: pr-gate.sh, install-hooks.sh, doctor.sh ×2. Deliberately left: run-all-tests.sh:127 (test-runner skip check, not an install/dispatch path), comment lines, and test-install.sh:657 (fixture).

Gate

Codex implemented; main-thread spot-check caught a regression (hard source broke pr-gate.sh's standalone-copy test path — fixed with the doctor.sh-style graceful guard). PR-gate standard tier round 1 NO-GO (critic+qa block — doctor.sh copy-mode lacked a codex_available fallback); fixed; targeted re-gate round 2 Final: GO (critic, qa-tester, architecture-reviewer all approve).

test-portable 32/0, test-pr-gate 41/0, test-install 57/0, test-doctor 33/0, lint-scripts OK.

Closes CC-201.

🤖 Generated with Claude Code

screenleon and others added 3 commits May 23, 2026 00:33
…etection

Extract the duplicated `command -v codex` executor-profile detection into
shared functions in scripts/lib/portable.sh and update all production
consumers. v0.3.0 milestone M0 (reuse debt CC-201). Behavior-preserving.

- portable.sh: add codex_available() + detect_executor_profile()
- install-hooks.sh: PROFILE="$(detect_executor_profile)"
- doctor.sh: check_codex() + hook-profile case branch use codex_available()
- pr-gate.sh: source portable.sh behind a graceful guard — pr-gate.sh is
  copied standalone by its test harness (and copy-mode install), so the
  source falls back to an inline codex_available() when the sibling lib/
  is absent (mirrors doctor.sh's pattern); auto-detect uses codex_available()
- test-portable.sh: +4 regression cases

test-portable 32/0, test-pr-gate 41/0, test-install 57/0, lint-scripts OK.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Gate NO-GO (gate-20260523-003335): doctor.sh's copy-mode else-branch
defined a fallback detect_platform() but not codex_available(), so
check_codex() and the hook-profile case branch would hit an undefined
function when lib/portable.sh is absent (copy-mode install).

- doctor.sh: define a matching codex_available() fallback in the
  no-portable.sh else-branch (copy-mode parity)
- test-doctor.sh: +case_doctor_copy_mode_no_lib_no_codex — copy-mode +
  codex absent from PATH, asserts graceful behavior (no crash)

test-doctor 33/0, lint-scripts OK.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@screenleon screenleon merged commit 823546e into main May 22, 2026
16 checks passed
@screenleon screenleon deleted the feat/cc-201-detect-executor-profile branch May 22, 2026 15:45
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