Skip to content

Add deterministic local Git workflow effects #294

Description

@taras

Story

As a workflow author, I want deterministic local Git components to switch branches, stage selected changes, and commit staged content inside a retained Repository or Worktree.

Current delivery state

Git.Switch and Git.Add are shipped. PR #474 delivered branch switching, PR #477 delivered explicit staging, and PR #481 bound the branch transition to the request that admitted it. Git.Commit is the remaining delivery slice; this issue closes when that component and its interruption/reconciliation contract ship.

Contract

The provider-neutral component set is:

  • Git.Switch for changing or creating the current branch;
  • Git.Add for staging explicit paths; and
  • Git.Commit for committing exactly the current index.

Git.Checkout may be supplied as a compatible Git-shaped operation where its semantics are explicit, but Git.Switch is the primary branch operation. Git.Commit accepts message as a prop and children as an expandable message; retaining both supports convenient bindings and pre-commit expansion.

Each component is one expansion, one effect, and one Workspace transaction. A commit does not bundle arbitrary child mutations into its transaction: children finish first, then the commit expansion commits the staged index.

Agents remain read-only. They do not supply a privileged authorized-path set; changes reach Git through ordinary durable File and Git.Add effects.

Acceptance

  • Every operation uses the contextual Repository or Worktree and has no path prop.
  • Git.Switch changes the named branch deterministically and rejects incompatible retained state.
  • Git.Add stages only its explicit path inputs and reports the resulting index/tree identity.
  • Git.Commit commits only staged content and fails clearly when nothing is staged.
  • Child content and a message prop both produce the intended commit message with documented precedence or conflict behavior.
  • Replay cannot create a duplicate branch transition, staging result, or commit.
  • Interruption after commit creation reconciles the existing commit under the same effect identity.
  • Results identify branch, commit, parent, and tree.
  • Local Git metadata and the filtered result commit through Commit Workspace mutations and journal results atomically #365's transaction boundary.

Dependencies

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions