Skip to content

feat: implement checkpoint-resume pattern — checkpoint.mjs + /resume command - #12

Merged
koydas merged 10 commits into
mainfrom
claude/checkpoint-resume-pattern-baZ71
May 25, 2026
Merged

feat: implement checkpoint-resume pattern — checkpoint.mjs + /resume command#12
koydas merged 10 commits into
mainfrom
claude/checkpoint-resume-pattern-baZ71

Conversation

@koydas

@koydas koydas commented May 25, 2026

Copy link
Copy Markdown
Owner

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 95c749b973

ℹ️ 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 commands/resume.md Outdated
Comment thread scripts/checkpoint.mjs Outdated
…sume

- /resume now requires explicit --strict to match original run; step
  sequence is derived from the flag, not inferred from checkpoint
  presence — prevents code-challenger being skipped on strict runs
  interrupted after 03-patch
- checkpoint.mjs write reads content from stdin instead of argv tokens
  so multiline Markdown (### Brief, ### Patch, …) is preserved exactly
- issue-code-generation.md updated to use pipe syntax consistently

https://claude.ai/code/session_01Phehb45JRh3HpLp9mAobzu
@koydas

koydas commented May 25, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 28c378723f

ℹ️ 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 scripts/checkpoint.mjs Outdated
Comment thread scripts/checkpoint.mjs Outdated
- Add STEP_RE allowlist (/^\d{2}-[a-z][a-z0-9-]*$/) enforced by
  assertStep() called in both writeCheckpoint and readCheckpoint —
  rejects any step containing path separators or traversal sequences
- Add requireArgs() in the CLI handler to validate issueId/step before
  calling any function, replacing TypeError stack traces with a
  controlled usage error and non-zero exit

https://claude.ai/code/session_01Phehb45JRh3HpLp9mAobzu
@koydas

koydas commented May 25, 2026

Copy link
Copy Markdown
Owner Author

@codex review

1 similar comment
@koydas

koydas commented May 25, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 214878471c

ℹ️ 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 scripts/checkpoint.mjs Outdated
Add ISSUE_ID_RE (/^\d+$/) and assertIssueId() enforced at the top of
writeCheckpoint, readCheckpoint, and listCheckpoints — rejects any
issueId containing path separators or traversal sequences before
path.join is called, keeping all operations inside ~/dev/checkpoints.

https://claude.ai/code/session_01Phehb45JRh3HpLp9mAobzu
@koydas

koydas commented May 25, 2026

Copy link
Copy Markdown
Owner Author

@codex review

1 similar comment
@koydas

koydas commented May 25, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9165680d81

ℹ️ 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 scripts/checkpoint.mjs Outdated
…ti-hyphen steps

The old <step>-<agentSlug>.md format caused listCheckpoints to return
a corrupted slug for any step with more than one hyphen (e.g.
04-code-challenges became 04-code-challenges-code in the listing),
making completed steps appear missing and triggering unintended re-runs.

Replace the redundant suffix with a plain <step>.md filename.
readCheckpoint builds the path directly; listCheckpoints strips .md and
filters by STEP_RE, which also excludes stray non-checkpoint files.
findFile is removed as it is no longer needed.

https://claude.ai/code/session_01Phehb45JRh3HpLp9mAobzu
@koydas

koydas commented May 25, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3a7a3aa7bc

ℹ️ 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 commands/resume.md Outdated
Comment thread scripts/checkpoint.mjs Outdated
…ssions

- resume.md: issue JSON is never checkpointed, so any resume point at
  02-brief or later now explicitly re-fetches via gh-get-issue.mjs
  before running ticket-analyst or code-builder; removes the silent
  dependency on context that no longer exists after interruption
- checkpoint.mjs: writeCheckpoint passes mode 0o700 to mkdirSync and
  mode 0o600 to writeFileSync so checkpoint dirs and files are
  owner-only; prevents other local users from reading sensitive agent
  output on shared runners or workstations

https://claude.ai/code/session_01Phehb45JRh3HpLp9mAobzu
@koydas

koydas commented May 25, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8fda63be86

ℹ️ 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 scripts/checkpoint.mjs Outdated
Previously the CLI printed "null" and exited 0, making a missing
checkpoint indistinguishable from valid content in shell pipelines.
Now it emits an error to stderr and exits 1, so /resume fails fast
on a typoed or deleted checkpoint instead of feeding invalid data to
the next agent.

https://claude.ai/code/session_01Phehb45JRh3HpLp9mAobzu
@koydas

koydas commented May 25, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fd5dbbba71

ℹ️ 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 scripts/checkpoint.mjs Outdated
…ions

Checkpoint paths are now ~/dev/checkpoints/<owner>/<repo>/<issueId>/<step>.md.
All three exported functions (writeCheckpoint, readCheckpoint, listCheckpoints)
take repo as their first argument and validate it against REPO_RE before
building the path; assertRepo rejects anything that is not owner/repo.
The CLI requires --repo <owner/repo> on every subcommand. Both commands
updated to pass --repo <owner/repo> on every checkpoint call.

https://claude.ai/code/session_01Phehb45JRh3HpLp9mAobzu
@koydas

koydas commented May 25, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2cda19d646

ℹ️ 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 commands/resume.md Outdated
All node scripts/gh-get-issue.mjs calls in resume.md now include
--repo <owner/repo> so the fetched issue JSON always comes from the
intended repository, matching the namespace used for checkpoint storage.

https://claude.ai/code/session_01Phehb45JRh3HpLp9mAobzu
@koydas

koydas commented May 25, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 90918a1977

ℹ️ 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 scripts/checkpoint.mjs Outdated
Change ISSUE_ID_RE from /^\d+$/ to /^[1-9]\d*$/ so that 0 is rejected
as an invalid GitHub issue number, matching the error message that
already says "positive integer".

https://claude.ai/code/session_01Phehb45JRh3HpLp9mAobzu
@koydas

koydas commented May 25, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

ℹ️ 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".

@koydas
koydas merged commit d635f47 into main May 25, 2026
2 checks passed
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