Repository navigation
Add module headers describing each command's flow and failure modes - #41
Merged
Merged
Conversation
- Add a header to `index.ts` that maps argv parsing, command dispatch, and which startup failures exit without a message. - Add headers to `src/cli/commit.ts`, `split.ts`, `setup.ts`, `branch.ts` and `doctor.ts` showing each command's steps, cancel behavior, and error logging. - Add a header to `src/infra/git/repo.ts` that walks through the isolated commit behind split commits, including the pre-commit hook handling. - Add headers to `src/domain/llm/router.ts`, `retry.ts` and `auth-resolver.ts` covering the shared LLM pipeline, the stacked retry layers, and OAuth token refresh. - Add headers to `src/domain/split/plan.ts` and `src/domain/commit/prompts.ts` covering split-plan validation and which diff each prompt receives. - Add headers to the Google, OpenAI and xAI sign-in flows in `src/infra/auth`. - Add headers to `src/infra/shell.ts`, `version-check.ts` and `github/pr.ts`, noting that `getOpenPullRequest` does not filter by state.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's New
Command Flow Headers
index.tsdocuments argv parsing, command dispatch, and exit codes. It also records that a rejection inside a command'screate()(a failed token refresh, or a missing config formodel/effort) exits 1 without printing anything.src/cli/commit.ts,split.ts,setup.ts,branch.tsanddoctor.tsget numbered ASCII flows showing each command's steps, where a cancelled prompt lands, and who logs errors.Git and Isolated Commits
src/infra/git/repo.tsdocuments the isolated commit behind split commits: the temp index, the worktree snapshot taken around the pre-commit hook, thecore.hooksPathcopy that stops the hook from running twice, and the update of the real index afterwards.src/infra/shell.ts,version-check.tsandgithub/pr.tsget short headers. Thepr.tsheader notes thatgetOpenPullRequesthas no state filter, so closed or merged PRs come back asfound.LLM Pipeline and Auth
src/domain/llm/router.tsshows the shared pipeline (effort floor, prompt, provider dispatch, parse, retry) and how three retry layers stack: the SDK's own retries, the effort-fallback retry, andwithTransientRetry.retry.ts,auth-resolver.ts,src/domain/split/plan.tsandsrc/domain/commit/prompts.tsdocument the transient-error policy, how tokens are refreshed and saved, split-plan validation, and which diff each prompt receives.src/infra/auth/google.ts,openai.tsandxai.tslay out the browser PKCE and device-code sign-in steps, their timeouts, and refresh behavior.Changed Files
index.tscreate()failuressrc/cli/commit.tssrc/cli/split.tssrc/cli/setup.tssrc/cli/branch.tsgit switch -csrc/cli/doctor.tssrc/infra/git/repo.tssrc/infra/github/pr.tsPrLookupoutcomes; no state filtersrc/infra/shell.tsexecBinvsexecBinInteractivefailure channelssrc/infra/version-check.tssrc/domain/llm/router.tssrc/domain/llm/retry.tssrc/domain/llm/auth-resolver.tssrc/domain/split/plan.tssrc/domain/commit/prompts.tssrc/infra/auth/google.tssrc/infra/auth/openai.tssrc/infra/auth/xai.tsTesting & Feedback
Only comments changed; no runtime code was touched.
pnpm typecheck,pnpm lintandprettier --checkpass on the changed files. Please check that the headers match your understanding, especially the isolated-commit steps inrepo.tsand the retry counts inrouter.tsandretry.ts, and flag any header that feels too long for its file.If you find any bugs or have recommendations for improvements, please open an issue and assign it to me.