Skip to content

refactor(git): migrate guarded workflows to Python - #193

Merged
BjRo merged 10 commits into
mainfrom
refactor/181-python-git-mechanics
Sep 18, 2026
Merged

BjRo merged 10 commits into
mainfrom
refactor/181-python-git-mechanics

Conversation

@BjRo

@BjRo BjRo commented Sep 17, 2026 •

Copy link
Copy Markdown
Owner

Why

Closes #181. Darrow Git’s substantial Bash mechanics need native Linux, macOS, and Windows support without weakening mutation safeguards or exact publication evidence. This PR also fixes #171 and #174 in separate commits before the migration.

What changed

  • c2c4258 bounds observation of delayed PR-head propagation without repeating publication; 326f6bb keeps successful user-facing reports concise while preserving the complete machine record.
  • Move all five workflows to one contained Python + UV package with frozen resolution, argument-vector Git/GitHub calls, and native filesystem handling. Remove all six legacy Bash entrypoints; callers use the frozen UV commands directly on every platform.
  • Preserve worktree, index, hook recovery, duplicate prevention, exact-head verification, and evidence reconciliation contracts; add real-Git integration/property tests and fresh-copy platform jobs.
  • Register the package, update invariants and usage, bump both Git manifests to 0.8.1, and teach eval fixtures to mount the backend, manifest-local resources, and writable UV scratch. Retarget the seven shell regression suites and dependent composition fixtures to the Python commands; the ticket-to-PR fixture patch bumps its manifests to 0.4.1.
  • Simplify internal argument consumption, move commit dispatch into the CLI to remove the circular remediation dependency, and share identical provider-error and local-default-branch helpers. Preserve the outward interface and publication state model.
  • Route Claude Git requests through their matching skills before preflight using a static native SessionStart reminder. This fixes skipped activation for clean trees, missing inputs, conflicts, and hook failures, including a reproduced history rewrite when the commit skill was skipped. The hook performs no Git/GitHub operations, prompt classification, or orchestration.

Verification

  • bun run check:python: passed; Git package has 158 passing tests, 98.54% statement coverage and 95.86% branch coverage.
  • Parser simplification matched all 31,866 pre-refactor outcomes, including exact refusal text/status and unchanged input lists; durable CLI tests check stdout/stderr routing and diagnostic precedence.
  • bun run lint, lint:ts, lint:shell, typecheck, check:decisions, and check:docs: passed.
  • bun test evals/runner/environment.test.ts evals/runner/fixture.test.ts: 14 passed.
  • All seven retained shell regression suites passed locally against direct UV commands with Bash 3.2, including after internal simplification. Final platform CI passed on 8882332: Linux/macOS/Windows fresh installation, Python 3.10–3.13 quality, and Bash 5/3.2 regression runners (73 Python/platform jobs plus documentation).
  • The two affected composition-fixture suites have 16 passing tests, including rejection of stale publication evidence and execution of guarded hook remediation through the copied Python package.
  • Full migration/routing evaluation covered all 48 cases on each host; Claude had 49 successful trials, including one extra ambiguous-hook case selected by the substring filter. After wrapper removal, the conventional-commit case passed again on both hosts; after internal simplification, the hook-retry-authorization case passed on both hosts. Trials use Codex gpt-5.6-terra/medium and Claude claude-sonnet-5/medium, one trial per case per invocation, threshold 80%. These samples are not a reliability estimate.
  • Matched pre-migration controls reproduced Claude's skipped activation for clean trees and its raw-Git amendment of history. With the context hook, both cases select the commit skill and satisfy the observable repository-state checks. Missing-token, conflict, ambiguous-hook, and all five nonactivation cases also pass.
  • Fresh-context migration, Claude routing, wrapper-removal, and internal-simplification reviews completed; material migration findings were repaired, and the latter three reviews found no material findings.

Review notes

The runtime interface intentionally breaks compatibility with legacy shell paths; use the documented frozen UV entrypoints. Review the propagation and reporting fixes separately from the migration, Claude routing, and wrapper removal. Provider subprocesses use argument vectors; the existing explicitly authorized hook-diagnostic command remains the documented exception, executed by POSIX sh or native Windows cmd with the saved HEAD/index guard. Focus review on snapshot restoration and evidence identity/reconciliation. The Claude hook uses an executable plus argument array and is absent from Codex's manifest; fresh-copy CI exercises that command on each platform.

Checklist

  • I have read and followed CONTRIBUTING.md, including the contribution
    licensing terms.
  • I added or updated the applicable invariant before implementation, or
    this change does not affect a capability invariant.
  • I added or updated colocated evals, or this change does not affect skill
    behavior.
  • I confirmed that each changed plugin remains self-contained, or this
    change does not affect plugin content.
  • I ran bun run check:python, or this change does not affect registered
    Python packages or their repository quality infrastructure.

BjRo added 10 commits September 17, 2026 19:43
Refs #171. Retry only read-only observations while the remote remains\nat the intended commit; retain exact PR identity and bounded failure.
Refs #174. Preserve complete machine publication evidence while reporting the PR link, base, draft state, and verified commit once.
Keep the five workflows in one contained, frozen UV package with native
filesystem handling and literal Git/GitHub process arguments. Preserve
public records, staging safeguards, and exact publication binding.

Add fresh-artifact platform checks and adapt eval mounts for the backend.
Refs #181
BREAKING CHANGE: Call the frozen UV entrypoints directly; legacy shell
paths are removed. Retain regression coverage against the Python commands
and update composition fixtures to observe those commands.
@BjRo
BjRo merged commit ccce70d into main Sep 18, 2026
75 checks passed
@BjRo
BjRo deleted the refactor/181-python-git-mechanics branch September 18, 2026 07:16
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.

Migrate darrow-git mechanics to Python + uv darrow-git/create-pr: Investigate and fix propagation bug

1 participant