Skip to content

feat: commit reviewed workspace changes with explicit Git identity - #10

Open
harshitethic wants to merge 3 commits into
mainfrom
feat/commit-workspace-changes
Open

harshitethic wants to merge 3 commits into
mainfrom
feat/commit-workspace-changes

Conversation

@harshitethic

Copy link
Copy Markdown
Owner

Summary

Add the missing local-commit stage to PatchPilot's repository workflow.

Until now, an agent run created an isolated branch, applied edits, ran tests, and exposed a diff, but the reviewed workspace could not be turned into a Git commit through the API. This PR adds an explicit human-triggered commit boundary without pushing anything remotely.

API

POST /api/commit

{
  "workspace_id": "<workspace>",
  "message": "fix: handle expired sessions",
  "author_name": "PatchPilot",
  "author_email": "patchpilot@localhost"
}

The response includes the resulting commit SHA, current branch, normalized message, and author identity.

Behavior

  • resolves the workspace using the existing containment-safe workspace lookup;
  • refuses blank commit messages and clean repositories;
  • stages the complete reviewed workspace with git add --all;
  • verifies that staging actually produced a diff;
  • creates the commit using per-command git -c user.name=... -c user.email=... values;
  • never invokes a shell and does not mutate global or repository Git identity;
  • returns the final SHA and branch;
  • still does not push or create remote PRs.

Validation

Adds real Git integration tests that initialize a temporary repository and verify:

  • a real commit is created;
  • author name/email and subject are exactly what the request supplied;
  • the repository is clean afterwards;
  • clean workspaces are rejected;
  • malformed author email is rejected by request validation.

README/API/roadmap documentation is updated to reflect the new commit stage.

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