Commit Graph

69 Commits

Author SHA1 Message Date
Paul O'Reilly
455d8d135b fix(z-ai): wire auth_token via apiKeyHelper, never via env
Mirrors the minimax fix to z-ai. Replaces bin/anthropic-compat-wrapper.sh
(which did `exec env ANTHROPIC_AUTH_TOKEN="$(cat ...)" claude "$@"`,
exposing the secret in the claude subprocess' /proc/<pid>/environ) with
init.sh that writes ~/.claude/settings.json with:

  apiKeyHelper: "cat /run/agent/secrets/z-ai/auth_token"

Claude Code routes apiKeyHelper output to `Authorization: Bearer <value>`
when ANTHROPIC_BASE_URL is non-anthropic.com — exactly what the Z.ai
proxy at api.z.ai/api/anthropic requires.

The legacy K8s Secret may still ship a `base_url` file; it is
intentionally ignored by init.sh (the base URL is not a credential and
lives in harness.yaml).

Mirrors agent-runtimes commit (z-ai apiKeyHelper). CRS serves these
harness files to dispatchers, so this repo must match.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 13:47:52 +12:00
Paul O'Reilly
cb1b411276 fix(minimax): wire api_key via apiKeyHelper, never via env
Mirrors agent-runtimes commit 1b83c81. CRS serves these harness files
to dispatchers, so this repo must match for the fix to take effect.

The minimax harness now writes ~/.claude/settings.json with an
apiKeyHelper that `cat`s the ESO-mounted /run/agent/secrets/minimax/
api_key file. Claude Code routes apiKeyHelper output to
`Authorization: Bearer <value>` for non-anthropic.com base URLs, which
is what MiniMax's /anthropic proxy requires. The secret is never read
into env, never written into a config file, and ESO rotation is
auto-recovered via Claude Code's per-session helper invocation
(also re-runs after a 401).

- harness.yaml: drop ANTHROPIC_AUTH_TOKEN_FILE env var
- init.sh: write (or jq-merge) settings.json with apiKeyHelper, chmod 0600
- bin/anthropic-compat-wrapper.sh: deleted

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 13:14:21 +12:00
Paul O'Reilly
dcdc6b5e0a fix(minimax): wire ANTHROPIC_AUTH_TOKEN_FILE for runner apiKeyHelper
Mirrors agent-runtimes — adds ANTHROPIC_AUTH_TOKEN_FILE pointer so the
Claude runner sets apiKeyHelper. Without it Claude Code CLI exits with
'Not logged in'.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 08:51:31 +12:00
Paul O'Reilly
3d8627f17c fix(harnesses): scoped account_ref for ambiguous gitea-* providers
gitea-ssh has 3 accounts (ai_enablement, accelerators, homelab) and
gitea-https has 2 (primary, admin) — bare provider_type refs hit
MultipleAccountsError per SR-DISP-8. Switch to scoped name.space:platform
form. Mirrors the agent-runtimes commit; the dispatcher-side parser
also gains underscore support for account names like 'ai_enablement'.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 08:27:23 +12:00
Paul O'Reilly
5f85d895c1 fix(harnesses): migrate to ESO secrets_required form, mirror agent-runtimes
The CRS-served harnesses still carried `secrets_files: [{encrypted: true}]`
which now hard-fails on H-SECRET-1 ("SOPS-encrypted secrets_files entries
are no longer permitted") in the dispatcher's harness validator. Sync the
8 provider harnesses with the agent-runtimes copies: same `secrets_required`
shape, same `init.sh` (ESO-mounted file paths), same `bin/` wrappers.

Use bare `account_ref: "<provider>"` (not `<provider>.cp:cp` — that
scope-kind isn't valid per SR-DISP-1-FIELD).

Provider key names follow the per-provider schema as emitted by the CP
provisioner: minimax/airouter/z-ai → api_key; gitea-https/gitea-admin →
{token,base_url,username}; gitea-ssh* → {host,private_key}.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 07:26:19 +12:00
Paul O'Reilly
8bbf6cbb2f BUG-5/BUG-20 fixes: pre_test.sh, output validation, push retry, workflow output tags
- pre_test.sh: harness-level test folder revert script, replaces inline
  _revert_test_folders() in entrypoint. Writes {"reverted": N} atomically.
- finalize.sh: set -x debug tracing; push retry (AGENT_PUSH_RETRIES, default 1
  retry after 5s); output validation (AGENT_EXPECTED_OUTPUT env var); wrong-path
  detection moves .agent-output/ files to working dir and writes
  .correction-prompt.txt for entrypoint re-invoke
- harness.yaml: add scripts.pre_test
- spec-planning.yaml: all 17 nodes tagged with output:{path,min_bytes}

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-04 18:29:47 +12:00
Paul O'Reilly
14151767e9 fix(write-tests): reviewer_harness default → planning-minimax-repo/v1
planning/v1 is a bare context with no provider credentials; any review node
using it fails with "Not logged in". The correct composite is
planning-minimax-repo/v1 which includes minimax/v1 auth.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 08:49:39 +12:00
Paul O'Reilly
e7225960ec fix(write-tests): use reference_branches for source repo; fix spec path
AR-27b filters clone pre_actions when agent-repo is active, so the source
repo was never cloned and the spec was unreachable. Use reference_branches
instead: the source repo is cloned read-only to /workspace/reference/main/
by agent-repo/v1/init.sh.

Both write_tests and review_coverage nodes now declare:
  reference_branches:
    - repo_url: "{{ repo_url }}"
      branch: main
      name: main

Prompts updated to read from /workspace/reference/main/{{ spec_file }}
and write output to /workspace/project/{{ test_output_dir }}.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-30 15:21:30 +12:00
Paul O'Reilly
21bdeb0c0e Add MiniMax test-writing composite and template
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 09:32:46 +12:00
Paul O'Reilly
a89829e31d Add write-code-simple workflow: narrow airouter single-test impl
Single-node airouter workflow for one-requirement/one-test tasks.
Optional test_target param focuses the agent on a specific pytest
node ID. Cost-optimised: labels=[airouter], cost_efficiency≥9.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-28 17:15:10 +12:00
Paul O'Reilly
906de0954d Add minimax model registry entry; rename tdd-impl workflow
- minimax.yaml: scores copied from Opus (placeholder until real benchmark),
  cost 0.0/0.0 (subscription), provider=minimax. Now auto-selectable by
  min_scores routing (smart-agent at complexity≥9 will reach it).
- tdd-impl → write-code-following-tdd (name field updated)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-28 17:12:06 +12:00
Paul O'Reilly
f4a5c5e680 Rework single-agent workflows; add write-tests; remove comparative-plan
- claude-agent → standard-agent (complexity≥8, spec_adherence≥9 → Sonnet-class)
- smart-agent: complexity≥9 → Opus; documents MiniMax not in registry
- functional-agent: labels=[airouter], cost_efficiency≥9 → Qwen3.6
- write-tests: two-node DAG (write_tests → review_coverage), spec-driven
  test authoring with coverage gap report in JSON
- Remove comparative-plan (superseded by tdd-impl audit pattern)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-28 15:50:01 +12:00
Paul O'Reilly
21f1cb6f17 Add tdd-impl workflow: parallel TDD implementations with one-shot audit
Two agents (impl_a: airouter, impl_b: best-complexity model) implement
in parallel against pre-written tests using TDD composites. An audit
node compares both outputs and emits a JSON verdict (pass/more_work_needed,
winner: a/b/neither, gaps). Harnesses are param-overridable for
provider flexibility. F-WE-PDIV note in description for future
unique_providers enforcement.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-28 15:37:22 +12:00
Paul O'Reilly
f392f72ca2 Add tdd-gate context, *-code-tdd-repo composites, and TDD task templates
Adds the tdd-gate harness context (TEST_PASS_REQUIRED=true + CLAUDE.md
methodology) and five provider-specific TDD composites that layer
tdd-protect + tdd-gate + python-dev + tdd-file-lock on top of the
existing code-* layer stacks. Matching task templates for sonnet, opus,
haiku, minimax, and airouter. allowed_failing_tests support noted in
warnings pending M19 pre-test hook implementation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-28 13:48:35 +12:00
Paul O'Reilly
2b3e4a3e80 feat(model-registry): add provider field to all entries
Add optional provider field (anthropic, openai, alibaba, github,
openrouter, opencode) as groundwork for F-WE-PDIV provider diversity
enforcement in auto-model selection.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-28 13:40:56 +12:00
Paul O'Reilly
c0758cbd71 fix(harness): align workspace paths and best-practices mount target
- Mount best-practices context at /workspace/best-practices/ (was
  /opt/harness/context/best-practices/) for consistent agent access
- Fix /workspace/working/ → /workspace/project/ in all CLAUDE.md files
  (planning, spec-writing, security-review, code-methodology,
  qwen-code-methodology, test-writing)
- Update best-practices path references in all CLAUDE.md files to
  /workspace/best-practices/

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-28 13:24:10 +12:00
Paul O'Reilly
b04f718530 docs: add CLAUDE.md with repo purpose, structure, and conventions
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-28 12:06:38 +12:00
Paul O'Reilly
0272e3df1e chore: sync framework content from agent-runtimes main (2026-04-28)
- Hardens qwen-code-methodology rules (no code deletion, pre-commit diff)
- Fixes test-writing CLAUDE.md workspace path
- Adds best-practices-opus-repo/v1 composite harness
- Adds opus-best-practices-review task template
- Adds max_turns support to airouter task template defaults
- Updates agent-repo finalize.sh

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-28 10:58:01 +12:00
Paul O'Reilly
37a5165dfb init: seed framework reference content from agent-runtimes main repo 2026-04-26 12:17:42 +12:00