Skip to content

cli(feat): add workspace-aware profile routing#32

Merged
Ducksss merged 9 commits into
mainfrom
PinZheng/workspace-bindings
Jul 13, 2026
Merged

cli(feat): add workspace-aware profile routing#32
Ducksss merged 9 commits into
mainfrom
PinZheng/workspace-bindings

Conversation

@Ducksss

@Ducksss Ducksss commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add private canonical workspace-to-profile bindings with nearest-ancestor resolution.
  • Add run and run --app for automatic Codex CLI and signed ChatGPT Desktop routing.
  • Add warn/strict/off mismatch guards for explicit cli, env/use, and app selections.
  • Clean bindings during profile removal and expose binding health through doctor.
  • Synchronize help, Bash/Zsh/Fish completions, README, AI-readable docs, changelog, design, and tests.

Safety and compatibility

  • Bindings contain only canonical project paths and profile names and are stored with private permissions through same-directory atomic replacement.
  • Project directories, auth tokens, ChatGPT cookies, and other credentials are never read, copied, moved, or deleted.
  • Desktop routing continues to launch the original signed app bundle.
  • Deprecated --instance, --rebuild, and app-instance spellings remain supported.
  • The merged init --share-with linked-profile behavior and completions remain intact.

Review revisions

  • Rebased onto current main, including the merged guide and linked-profile PRs.
  • Addressed CodeRabbit's two findings: workspace routing remains under Unreleased, and the premature 0.8.0 release/version/date changes were removed.
  • Regenerated the AUR CLI integrity hash without changing the published 0.7.0 metadata.
  • Audited registry parsing/writes, canonical matching, guards, cleanup, diagnostics, argument boundaries, and signed-app routing with no remaining blocking findings.

Validation

  • make test
  • make lint
  • bin/codex-profile completions zsh | zsh -n
  • git diff --check

Ducksss added 9 commits July 14, 2026 05:19
Summary:
- define workspace binding, resolution, guard, and run commands
- document private persistence, safety, diagnostics, and test coverage

Rationale:
- prevent accidental profile use without inspecting credentials
- keep routing local, deterministic, and dependency-free

Tests:
- git diff --cached --check
Summary:
- break workspace bindings into test-first implementation slices
- define interfaces, verification, documentation, and publication steps

Rationale:
- make the approved design executable without unresolved decisions

Tests:
- git diff --cached --check
Summary:
- add atomic private workspace binding persistence
- resolve nearest canonical workspace ancestors
- expose bind, unbind, list, status, and guard commands

Rationale:
- make profile routing explicit without modifying repositories
- keep binding metadata credential-free and inspectable

Tests:
- bash test/codex-profile-test.sh
Summary:
- route bound workspaces to Codex CLI or the signed ChatGPT app
- guard explicit profile mismatches in warn, strict, and off modes
- preserve upstream CLI argument forwarding and eval-safe stdout

Rationale:
- prevent accidental cross-profile work while preserving explicit control

Tests:
- bash test/codex-profile-test.sh
Summary:
- remove profile bindings without touching project directories
- report workspace health in human and JSON doctor output
- fail profile removal before destructive work when registry state is corrupt

Rationale:
- prevent stale routing and keep local binding state repairable

Tests:
- bash test/codex-profile-test.sh
Summary:
- expose workspace and run commands in help and shell completions
- document routing, guards, persistence, cleanup, and safety
- record the feature under the unreleased changelog

Rationale:
- keep human, shell, and AI-readable command references synchronized

Tests:
- bash test/codex-profile-test.sh
- node test/geo-site-test.mjs
Summary:
- distinguish invalid workspace paths from valid unbound directories
- keep explicit Desktop launch compatibility when no binding applies
- create workspace config directories under a private umask
- add regression coverage and refresh AUR integrity metadata

Rationale:
- conditional Bash calls suppressed a nested exit and could emit successful
  status JSON after reporting a missing directory
- explicit profile launches must remain compatible with optional paths while
  workspace-aware commands fail cleanly on invalid paths

Tests:
- bash test/package-metadata-test.sh
- bash test/codex-profile-test.sh
- make lint
- git diff --check
Summary:
- reject malformed workspace config roots and report them through doctor
- require the separator before upstream run options that start with a dash
- complete Zsh JSON option suggestions for workspace inspection
- add regression tests, usage guidance, and refreshed package integrity data

Rationale:
- invalid local state must not appear healthy or silently act empty
- a fixed wrapper option boundary keeps run --app unambiguous while preserving
  arbitrary upstream arguments after the documented separator
- all supported shells should expose the same workspace command surface

Tests:
- bash test/package-metadata-test.sh
- node test/geo-site-test.mjs
- bash test/codex-profile-test.sh
- make lint
- bin/codex-profile completions zsh | zsh -n
- git diff --check
Summary:
- retain workspace routing under the Unreleased changelog section
- keep release metadata at the currently published 0.7.0 version
- refresh the AUR CLI integrity hash for the final script
- restore ShellCheck annotations for child-shell test literals

Rationale:
- feature review must not claim an unpublished 0.8.0 release
- preserve synchronized packaging and lint contracts after the rebase

Tests:
- make test
- make lint
- bin/codex-profile completions zsh | zsh -n
- git diff --check
@Ducksss Ducksss force-pushed the PinZheng/workspace-bindings branch from cfb0fcc to c5607c0 Compare July 13, 2026 22:27
@Ducksss Ducksss marked this pull request as ready for review July 13, 2026 22:28
Copilot AI review requested due to automatic review settings July 13, 2026 22:28

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Ducksss Ducksss merged commit 316dcb9 into main Jul 13, 2026
3 checks passed
@Ducksss Ducksss deleted the PinZheng/workspace-bindings branch July 13, 2026 22:28
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.

2 participants