Skip to content

Describe deterministic stack replay - #278

Closed
nishu-builder wants to merge 1 commit into
mainfrom
codex/replay-design-20260924-70793d
Closed

nishu-builder wants to merge 1 commit into
mainfrom
codex/replay-design-20260924-70793d

Conversation

@nishu-builder

@nishu-builder nishu-builder commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Represent a feature as numbered source gitlinks and .base files recording where each layer started. A replay plan selects changes, messages, and output branch boundaries.

Each run starts from the beginning with fixed commit metadata. A conflict leaves a draft to edit; the next plan references that resolution. The same tool prepares new layers and restacks existing ones. Update the chat and GitHub guides to describe this workflow.

@nishu-builder
nishu-builder added this pull request to stack #283 September 24, 2026 02:11
@nishu-builder
nishu-builder force-pushed the codex/replay-design-20260924-70793d branch from 22ef03a to e704a18 Compare September 24, 2026 17:45

@nishu-builder nishu-builder left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Review for simplicity and parsimony, covering the design and how #279–#282 implement it.

The main point (inline at L139-152): since every replay step is a pure function of object ids, the replay can re-run the whole plan on each call instead of pausing and resuming. With a fixed committer, output commits are the same on every run, and the merges are cached jobs. That removes action=continue, the done/here records in the plan, the rules for what stays fixed while paused, the stored original-snapshot tree id, and the history walk in #282's rebase.rs::checkpoint. That is most of the 1390-line rebase_plan.rs and most of rebase_tests.rs. A conflict is resolved by editing the plan to reference the fixed draft.

Other reductions, each inline:

  1. Plan commands: drop is a no-op, squash is a range pick plus a message, and amend is message. Four commands cover it: onto, pick, message, branch.
  2. branch= takes bare names and the tool assigns numbers.
  3. git-add-layer is a one-layer replay. Consider one writer, and dropping the special -work name.
  4. Writers get the stack subtree as in, not the whole conversation. This removes the out-of-scope diff check and allows cache hits.
  5. #279 adds a second merge-tree implementation (a server route) beside std/merge, and a git-commit-tree subcommand that duplicates caos put-commit.
  6. design/chat.md and design/agent-github.md describe a different stack model (numbering from 01, restack by merge, no special names) and need updating in this PR.

Generated by Claude Code

Comment thread design/agent-rebase.md Outdated
Comment thread design/agent-rebase.md Outdated
Comment thread design/agent-rebase.md Outdated
Comment thread design/agent-rebase.md Outdated
Comment thread design/agent-rebase.md Outdated
Comment thread design/agent-rebase.md Outdated
Comment thread design/agent-rebase.md Outdated
Comment thread design/agent-rebase.md Outdated
Comment thread design/agent-rebase.md Outdated
@nishu-builder nishu-builder changed the title Describe source stacks and replay Describe deterministic stack replay Sep 25, 2026
@nishu-builder
nishu-builder force-pushed the codex/replay-design-20260924-70793d branch from e704a18 to f14abce Compare September 25, 2026 06:02

Copy link
Copy Markdown
Contributor Author

Closing as superseded: #293 put the stack design in design/stacks.md with a different model (sibling gitlinks ordered by name, kept current with merge, not .base files plus a replay plan), and #300 is rewriting design/agent-github.md.


Generated by Claude Code

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