Skip to content

WIP: Harness#201

Draft
petergam wants to merge 11 commits into
mainfrom
add-harness-action
Draft

WIP: Harness#201
petergam wants to merge 11 commits into
mainfrom
add-harness-action

Conversation

@petergam

@petergam petergam commented Jun 2, 2026

Copy link
Copy Markdown

Github Action used for Banzai Harness

Vendors the banzai Codex-agent harness (previously .github/actions/harness in framna-dk/Harness-playground) into this shared actions monorepo as harness/, so consumers reference it as framna-dk/actions/harness@<ref> instead of a local ./ path. That removes the actions/checkout step the playground needed just to resolve the local action. Self-contained (dist/ committed); compiled output unchanged from the source.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@petergam petergam changed the title Add harness composite action WIP: Add harness composite action Jun 2, 2026
@petergam petergam changed the title WIP: Add harness composite action WIP: Harness Jun 2, 2026
@petergam petergam marked this pull request as draft June 2, 2026 08:07
petergam and others added 10 commits June 2, 2026 10:27
…ems, required prompt

- Fall back to built-in defaults when .banzai/config.json is absent instead of
  throwing; only a genuine read error is fatal. Guard for a missing project id.
- Key per-issue workspaces by repo + issue so a shared runner never reuses (and
  pushes to) the wrong repository when two repos share an issue identifier.
- Paginate Projects v2 items so issues beyond the first 100 board items are found.
- Require a prompt_path action input and remove the built-in fallback prompt;
  a missing/unreadable prompt is now a hard error.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Remove inputs that were redundant or never load-bearing:
- base_branch: renamed from repo_ref (it must be a branch, since the workspace
  reset does a --ff-only pull onto it).
- dispatch_nonce: only ever logged; run↔claim correlation happens via the run
  name, not by the action consuming it. Removed along with the dead config_sha
  field that was logged but never declared as an input.
- tracker_endpoint: always the GitHub GraphQL URL; keep the config-file default
  as the single source, overridable via .banzai/config.json if ever needed.
- issue_identifier: derived from the fetched issue instead. The workspace is now
  keyed by the stable issue_id and the agent branch is cut after the fetch using
  the real identifier.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace the hand-rolled Projects v2 GraphQL with the gh CLI:
- reads via `gh project field-list` + `item-list` (match the board item by
  issue number + repo), writes via `gh project item-edit`.
- new gh.ts exec helper; delete the redundant github_graphql agent tool (the
  agent has gh in its shell) and the now-unused tracker.endpoint/project_id
  config + github_graphql tool flag.

New input contract keyed by the project's URL-path identity:
- issue_number, project_owner, project_number, project_node_id (replacing
  issue_id / tracker_project_id). Workspace is keyed by issue_number; repo_url
  carries the issue's owner/repo for board-item matching.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
gh project item-list doesn't expose labels, but prompts reference
{{ issue.labels }} and strictVariables would throw. Fetch them best-effort
with `gh issue view --json labels` and default to [] on failure.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Refactor toward supporting multiple trackers and agent runtimes by hiding each
behind an interface + factory, with the harness as runtime/tracker-agnostic
orchestration. Behavior is unchanged.

- tracker/: Tracker interface (fetchSnapshot + setStatus by state name),
  GitHubProjectsTracker impl (was issue.ts; caches item/field ids), and
  createTracker(kind, opts). Callers no longer touch project/field/option ids.
- agent/: AgentRuntime interface (run(opts) with injected per-turn prompt and
  continue/stop decision), CodexRuntime impl + app_server client (was codex/),
  and createAgentRuntime(kind). The runtime no longer knows about trackers.
- harness.ts: builds tracker + runtime from kinds, owns the stop decision
  (issue left active_states) and outcome mapping. set_issue_status tool now
  depends on the Tracker interface, not gh. config gains agent.runtime.

Adding a tracker or runtime is now one impl file + one factory case.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Generalize the agent's structured-tool surface beyond set_issue_status, behind
the same interface+factory pattern:

- forge/: Forge interface (openOrUpdatePullRequest + commentOnIssue), GitHubForge
  impl (git push + gh pr create-or-edit, idempotent across retries; gh issue
  comment), and createForge(kind, opts).
- tools/open_pull_request.ts + tools/comment.ts: agent supplies content, harness
  injects branch/base/issue context.
- exec.ts: shared run() for spawning git/gh; gh.ts now wraps it.
- config: agent.tools gains open_pull_request + comment (default true).
- harness: builds a Forge and registers all enabled tools with the runtime.

Tools are dormant until the prompt references them.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The implementation moved to its own repo (framna-dk/banzai-codes-actions-harness)
as the `banzai-harness` CLI. This action is now just action.yml + README.md:
the composite steps run `banzai-harness preflight` / `banzai-harness run` instead
of bundled `node dist/*.js`, so the action carries no source or committed bundle.

The CLI is a runner prerequisite (on PATH, alongside codex/gh/node/git/jq).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The CLI (framna-dk/banzai-codes-harness) now takes explicit --flags rather than a
HARNESS_INPUTS_JSON env blob; secrets (GH_TOKEN, OPENAI_API_KEY) stay in the env.
Pass each input as a flag for preflight and run (run adds repo-url, workspace-root,
base-branch, runner-temp).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The harness now embeds the canonical workflow and treats --prompt-path
as an optional override. Make the action's prompt_path input optional and
only forward --prompt-path when non-empty, so the harness falls back to
its embedded template when the orchestrator omits it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Remove the prerequisite/flag comment block from the composite steps and
refer to the "coding agent" instead of Codex specifically.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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