Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
145 changes: 144 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,23 @@ permissions:
contents: read

jobs:
spec-kit-conformance:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Validate spec-kit artifact set
run: |
test -f testkit/.specify/memory/constitution.md
test -f testkit/.specify/specs/001-polyglot-harness/spec.md
test -f testkit/.specify/specs/001-polyglot-harness/plan.md
test -f testkit/.specify/specs/001-polyglot-harness/tasks.md
test -f testkit/.specify/specs/001-polyglot-harness/contracts/cli-protocol.json
test -f testkit/.specify/specs/001-polyglot-harness/checklists/quality.md

- name: Validate spec-kit scaffold and status
run: ./testkit/.specify/scripts/validate_specify.sh

test:
runs-on: ubuntu-latest
steps:
Expand All @@ -21,7 +38,7 @@ jobs:
cache: true

- name: Check gofmt
run: test -z "$(gofmt -l git safety)"
run: test -z "$(gofmt -l git safety cmd)"

- name: Build
run: go build ./...
Expand All @@ -31,3 +48,129 @@ jobs:

- name: Test
run: go test -race -count=1 ./...

testkit:
runs-on: ubuntu-latest
needs: [spec-kit-conformance, test]
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true

- name: Build git-harness CLI binary once
run: |
mkdir -p bin
go build -o ./bin/git-harness-cli ./cmd/git-harness-cli

- uses: actions/setup-python@v5
with:
python-version: "3.12"

- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "21"
cache: maven

- name: Run Python wrapper tests
env:
GIT_HARNESS_CLI: ./bin/git-harness-cli
run: |
cd testkit/python
python -m pip install -e ".[dev]"
python -m pytest tests/ -v

- name: Run Python sample smoke implementations
env:
GIT_HARNESS_CLI: ./bin/git-harness-cli
run: |
cd testkit/python
python -m samples.smoke_repo_flow
python -m samples.smoke_safety_flow

- name: Run Java wrapper tests
env:
GIT_HARNESS_CLI: ./bin/git-harness-cli
run: |
cd testkit/java
mvn test

- name: Run Java sample smoke implementations
env:
GIT_HARNESS_CLI: ./bin/git-harness-cli
run: |
cd testkit/java
mvn -Dtest=SampleRepoFlowSmoke,SampleSafetyFlowSmoke test

wrapper-cross-platform:
runs-on: ${{ matrix.os }}
needs: [spec-kit-conformance, test]
strategy:
fail-fast: false
matrix:
# Linux wrapper path is covered by the `testkit` job; matrix only cross-checks macOS + Windows.
os: [macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true

- name: Build git-harness CLI binary once
shell: bash
run: |
mkdir -p bin
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
go build -o ./bin/git-harness-cli.exe ./cmd/git-harness-cli
else
go build -o ./bin/git-harness-cli ./cmd/git-harness-cli
fi

- uses: actions/setup-python@v5
with:
python-version: "3.12"

- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "21"
cache: maven

- name: Run Python wrapper smoke tests
shell: bash
env:
GIT_HARNESS_CLI: ${{ matrix.os == 'windows-latest' && './bin/git-harness-cli.exe' || './bin/git-harness-cli' }}
run: |
cd testkit/python
python -m pip install -e ".[dev]"
python -m pytest tests/ -v

- name: Run Python sample smoke implementations
shell: bash
env:
GIT_HARNESS_CLI: ${{ matrix.os == 'windows-latest' && './bin/git-harness-cli.exe' || './bin/git-harness-cli' }}
run: |
cd testkit/python
python -m samples.smoke_repo_flow
python -m samples.smoke_safety_flow

- name: Run Java wrapper smoke tests
shell: bash
env:
GIT_HARNESS_CLI: ${{ matrix.os == 'windows-latest' && './bin/git-harness-cli.exe' || './bin/git-harness-cli' }}
run: |
cd testkit/java
mvn test

- name: Run Java sample smoke implementations
shell: bash
env:
GIT_HARNESS_CLI: ${{ matrix.os == 'windows-latest' && './bin/git-harness-cli.exe' || './bin/git-harness-cli' }}
run: |
cd testkit/java
mvn -Dtest=SampleRepoFlowSmoke,SampleSafetyFlowSmoke test
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
# Local reference clones (not part of this module)
/mnt/

# testkit (polyglot) build artifacts
testkit/python/**/__pycache__/
testkit/python/**/*.egg-info/
testkit/python/.pytest_cache/
testkit/java/target/
17 changes: 8 additions & 9 deletions CURSOR_ULTRA_PLAN.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,10 @@ git-harness/
.github/
workflows/
ci.yml # Go build + test + vet
wrappers/ # placeholder dirs for Phase 5 & 6
testkit/ # polyglot layout (mirror git-testkit)
python/
.gitkeep
java/
.gitkeep
.specify/
```

> **Local wiring (temporary):** Add `replace github.com/git-fire/git-harness => ../git-harness`
Expand Down Expand Up @@ -170,11 +169,11 @@ Commit: `refactor(git-harness): remove extracted internals from companion CLI`
> Follow git-testkit's Python wrapper structure exactly. Read it before writing anything here.

### 5.1 Scaffold
Mirror whatever structure git-testkit uses under `wrappers/python/`. This likely means:
- A Python package under `wrappers/python/git_harness/`
Mirror whatever structure git-testkit uses under `testkit/python/`. This likely means:
- A Python package under `testkit/python/git_harness/`
- Build tooling (cffi, ctypes, subprocess bridge, or whatever git-testkit uses)
- `pyproject.toml` / `setup.py`
- `wrappers/python/README.md`
- `testkit/python/README.md`

### 5.2 Implement
Expose the same surface area as the Go module — subprocess runner, safety/sanitize, repo introspection.
Expand All @@ -198,10 +197,10 @@ Commit: `feat(git-harness): Python wrapper`
> Follow git-testkit's Java wrapper structure exactly. Read it before writing anything here.

### 6.1 Scaffold
Mirror whatever structure git-testkit uses under `wrappers/java/`. Likely:
- Maven or Gradle project under `wrappers/java/`
Mirror whatever structure git-testkit uses under `testkit/java/`. Likely:
- Maven or Gradle project under `testkit/java/`
- `src/main/java/io/gitfire/harness/`
- `wrappers/java/README.md`
- `testkit/java/README.md`

### 6.2 Implement
Expose the same surface area as the Go module.
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ Go library extracted from [git-fire](https://github.com/git-fire/git-fire): subp
- **`git`** — repository scanning, status, commits, pushes, worktrees, and related helpers.
- **`safety`** — redaction and secret-pattern scanning helpers used by git error paths.

## Polyglot wrappers

Python and Java clients use the same layout as [git-testkit](https://github.com/git-fire/git-testkit) under **`testkit/`**: build `cmd/git-harness-cli`, set **`GIT_HARNESS_CLI`** to that binary (or rely on `go run ./cmd/git-harness-cli` from the repo root). Code lives in `testkit/python` and `testkit/java`; runnable samples are `testkit/python/samples/` and the Java `Sample*Smoke` tests.

## Requirements

- Go **1.24**+ (see `go.mod`).
Expand Down
Loading
Loading