Skip to content

Deterministic git operations wrapper bounded to a repo path #9

Description

@Ryan-Atkinson87

Spec: §5 (branch and PR model), §18.1–18.2 (git is the durable source of truth), §1 Principle 1 (deterministic logic stays deterministic).

A low-level, fully deterministic Python module (GitRepo or equivalent) wrapping the git operations the engine needs, scoped to a single repo working directory (the mount boundary, §7.1). All higher-level branch lifecycle (#10, #11) builds on this. No AI involvement — this is plain Python per Principle 1.

Acceptance criteria

  • A GitRepo abstraction is constructed from a repo path and refuses operations outside that path.
  • Supports: fetch the integration branch from origin; create / checkout / delete a local branch; merge one branch into another (merge, not rebase); stage + commit; detect an uncommitted/dirty working tree; list commits unique to a branch; check whether a branch has been merged into another.
  • Every git invocation has explicit success and failure handling — a non-zero git exit raises a typed error; no silent except: pass (production-readiness bar).
  • A merge conflict surfaces as a distinct, catchable error (not a generic failure) so callers can park the affected issue.
  • Unit tests run against a real temporary git repo (created in a tmp dir), covering create / checkout / merge / delete / dirty-detection and the conflict path.
  • Lint (uv run ruff check .), format (uv run ruff format --check), and typecheck (uv run pyright) pass.

Depends on: #1

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions