jp ganis · Project · AI-assisted delivery

jp-harness

A local web app that takes a ticket from Azure DevOps and turns it into a reviewed pull request. Claude Code writes the plan, a person approves it, and Claude builds it test-first. The harness runs the tests and opens the PR. You can watch every step live, written in plain English.

A delivered ticket. The approved plan (version 2, after one round of feedback), the activity feed from pick-up to pull request, the full test run and the diff summary.
The problem

AI coding agents are fast. Trusting them is the hard part.

Running an agent in a terminal works for one developer. It doesn't work for a team that needs plans signed off, tests passing before anything is pushed, and an audit trail a manager can follow. It also had to be safe to point at a real codebase.

jp-harness is the layer around the agent. It decides when Claude runs and what Claude is allowed to do. It checks the work before anything leaves the machine, and it reports progress in language a non-technical viewer can follow.

3workflows: deliver, bug check, PR review
1human approval before any code is written
0pushes or merges by the AI
~3 sfull test suite, no network, no AI
How a ticket moves

Tag a work item. Get a pull request.

Tagging a work item jp-harness-task in Azure DevOps is the only setup. The harness picks it up on its next poll and moves it through six stages, adding its own stage tags and comments to the work item as it goes.

  1. Picked upFound by tag. A private git worktree is made on its own feature/ branch.
  2. DesigningClaude reads the ticket and code in read-only mode and writes a plan.
  3. ApprovalA person approves, rejects, or requests changes. A revised plan comes back as a new version.
  4. BuildingClaude writes failing tests from the acceptance criteria first, then the code.
  5. TestingThe harness runs the full suite itself. Claude gets one attempt to fix a failure.
  6. PR createdThe harness pushes, opens the PR, links the work item and assigns a reviewer.
Claude worksA person decidesThe harness verifies and acts
Human in the loop

Plans are approved before code is written

The design run uses tools that can only read: Read, Glob and Grep. The plan lists the steps, one test per acceptance criterion, what is out of scope, and any questions for the approver. It is also posted as a comment on the work item.

Request changes resumes the same Claude session with the feedback, so the revised plan builds on what Claude already read. Every version is kept.

Awaiting approval. The plan includes a question about time zones, raised before any code exists.
Live, in plain English

A feed a manager can read

Claude Code streams its work as JSON events. A narrator turns each event into a sentence such as "Reading the device list page" or "Tests finished: 1 passed, 3 failed", and pushes it to every open browser over server-sent events.

File paths, commands and raw output stay behind Show technical details. Turn it on when something goes wrong mid-demo.

Building, live. The tests were written first and fail as expected. Next, Claude edits the page to make them pass.
Two more workflows on the same engine

Bug triage and pull request review

The engine (polling, a worker pool, state, the live feed) knows nothing about delivery. Each workflow is a class with poll(), run(), act() and failed(). That made it straightforward to add these two.

Bug check · read-only

"Is this actually a software bug?"

Tag a bug jp-harness-bug, then enter the branch or commit that is deployed. Claude makes a one- to two-minute read-only pass over the code at that commit. It gives a verdict and a confidence level, file-and-line evidence, the most likely cause, and what to check next.

It writes nothing back to Azure DevOps. If the answer is yes, re-tag the bug as a task and it enters the delivery pipeline.

A bug check. An off-by-one end-of-month date, traced to two lines.
PR review · comments only

Findings posted on the line they concern

Label a pull request jp-harness-review. Claude reads the diff and the code around it, then returns structured JSON: an overall risk, a summary, and findings graded Must fix, Should change or Suggestion.

Each finding becomes an active comment thread on its file and line in Azure DevOps. The review never votes, completes or relabels a PR. If some comments fail to post, they stay on the page and Post the rest retries only those.

A PR review. It catches a retry loop that could send the same command twice.
Integrations

How the pieces connect

Azure DevOps

The source of work and the place results go. It is plain REST over httpx, signed in with an az login token, so there are no secrets in config.

  • WIQL queries find work items by tag. The PR list finds PRs by label.
  • Stage tags (jp-harness-planning, -building, -done…) show progress on the board.
  • The plan, a build summary and any blocking reasons are posted as work item comments.
  • Pull requests are linked to the work item, with a reviewer assigned. Review findings become line-anchored comment threads.

Claude Code, headless

Each stage starts claude -p --output-format stream-json as a subprocess in the ticket's worktree. Every run has a time limit and is killed with its whole process tree.

  • Two permission profiles. Read-only is for design, bug checks and reviews. Build allows edits and dotnet test but denies push, remotes, merges, rebases, branch switching and dotnet run.
  • Sessions are resumed for plan revisions and after a restart, so Claude keeps what it already read.
  • The event stream is parsed live into the activity feed, with test totals and cost.

git

Each ticket gets its own worktree outside the harness folder, on a feature/<id>-<title> branch. Several tickets can run at once without stepping on each other.

  • The harness, not Claude, commits and pushes, and only after its own run of the full test suite passes.
  • A guarded push refuses anything except the ticket's own feature/* branch.
  • Rejecting or abandoning a ticket removes the worktree and the local branch.

State & live UI

SQLite holds tickets, every plan version and the full event log. Each change goes through one Engine.update call, so the database and every open browser stay in sync.

  • A ticket's next_action stays set while its work runs. If the process restarts, it simply resumes. Nothing else tracks "in progress".
  • Worker threads publish to asyncio queues, one per open browser tab, which are streamed as server-sent events.
  • The UI has no build step. It is about 370 lines of vanilla JS.
Guardrails

What the AI can never do

These rules are enforced in code, and the project's agent instructions list them under "Must never change".

Things that bit

Lessons from the integration work

Tag patches append

A JSON-patch add on System.Tags appends instead of replacing. Finished tickets kept jp-harness-task and were picked up again as new. The fix was to use replace.

Refusals are a different event

A tool call refused by the permission profile doesn't arrive as a failed tool result. It arrives as a system / permission_denied event with a plain-string message, so the narrator needed a separate path for it.

Plans that go missing

In plan mode, Claude sometimes saves the plan to a file and only points to it. The runner captures that file's text, and the design step falls back to it.

8.3 paths

Claude Code refuses to edit under Windows short paths like C:\Users\LONGNA~1. Worktree paths are always kept in long form.

Token audience

In some Azure DevOps organisations, az account get-access-token only works with the vssps resource. The usual Azure DevOps resource GUID is refused.

Testing without the world

About 3 seconds of tests cover every workflow, using fakes for Azure DevOps, git and Claude. Git itself is tested against a temporary repository. No test touches the network.

Python 3.13FastAPIUvicornhttpxSQLite (WAL)pytestClaude Code CLIAzure DevOps RESTAzure CLI authgit worktreesServer-sent eventsmarked + DOMPurify.NET test runner