31 Commits

Author SHA1 Message Date
Paul O'Reilly
c67d9736fd R3b [fw]: delete legacy workflow-script/v1 composite and cp-service-token/v1 context (dbc5efc6)
Control plane 0.0.5.1890 no longer falls back to either. Invariant tests now
assert both stay gone.

Claude-Session: https://claude.ai/code/session_01N218bERyNeLhbLmDRDvbWF
2026-10-19 01:41:44 +13:00
Paul O'Reilly
d0424879c2 R2: remove AU-51 bearer layer from planning/spec-writing model composites; delete retired @1 templates (dbc5efc6)
The @2 templates use CP-side verdict/WIA decompose and never read the bearer.
Triggers already pin version 2.

Claude-Session: https://claude.ai/code/session_01N218bERyNeLhbLmDRDvbWF
2026-10-19 00:24:55 +13:00
Paul O'Reilly
d7decc1dec minimax: move to MiniMax-M3.1-Flash-Preview; drop bare minimax/minimax-m2 slugs
- new context minimax-m31-flash/v1 (model pin; no thinking-budget init, Flash
  ignores it); four composites switch from minimax-m3-max/v1 (kept for rollback)
- models + registry for minimax-m31-flash-{max,medium}; removes the dangling
  model-registry/minimax.yaml (endpoint "minimax" never existed)
- tiers, harness-roles, minimax-* task templates and the *-review-loop@1
  workflows use the Flash slugs (MiniMax silently maps unknown names to M3, so
  the provider-id translation lands in agent-runtimes)
2026-10-13 10:55:03 +13:00
Paul O'Reilly
57374c8bfb feat(harness): workflow-script-nocp-norepo/v1 secret-free script composite (e993c9fa)
Claude-Session: https://claude.ai/code/session_01N218bERyNeLhbLmDRDvbWF
2026-10-11 22:49:52 +13:00
Paul O'Reilly
a1c708ac96 fix(harness): add -hatchmate composites for sonnet, haiku, deepseekv4flash (bug 678d4e8e)
Hatchmate templates resolving to claude-sonnet-5, claude-haiku-4-5 or
airouter-deepseekv4flash mounted only gitea-ssh/v1 and could not clone
hatchmate/hatchmate-agents. Mirror the existing -hatchmate composites:
non-hatchmate base layers plus gitea-ssh-hatchmate/v1 after gitea-ssh/v1 (HC-26).

Claude-Session: https://claude.ai/code/session_01N218bERyNeLhbLmDRDvbWF
2026-10-04 21:13:32 +13:00
Paul O'Reilly
08ca057687 feat(harness): workflow-script-nocp/v1 + workflow-script-write/v1 composites (Option C, WF-COMP-31b/31c, item 26754227)
nocp: shared-variables/v1 + repo-readonly/v1 (no CP credential).
write: shared-variables/v1 + cp-write-token/v1 + repo-readonly/v1.
repo-readonly/v1 is last in both (WF-COMP-34); neither layers
cp-service-token/v1 or gitea-ssh/v1.

HOLD: do not merge until the CP release (AU-55/55a/56/57, WF-COMP-31b engine/
dispatch/compiler composite-set changes) and the dispatcher image
(cp-write-token delivery, AU-55b) are deployed. The dispatcher advertises every
composite found in the CRS-synced harnesses/ tree (dispatcher/poller.py
_collect_supported_harnesses), so merging this to origin/main IS the
advertisement event.

Claude-Session: https://claude.ai/code/session_01N218bERyNeLhbLmDRDvbWF
2026-10-04 09:35:34 +13:00
Paul O'Reilly
ea7c11265b fix(repo-readonly): own read-only deploy key; workflow-script drops write-capable gitea-ssh/v1
repo-readonly/v1 now declares write_targets: [], an ssh_hosts alias and its
own secrets_required (account platform-readonly.space:platform, a read-only
Gitea deploy key), and stages the key before cloning. workflow-script/v1 no
longer layers gitea-ssh/v1, so script nodes cannot push. Invariants updated:
credential layers in the composite must declare write_targets: [].

Bug 45a48685-23e9-4605-af1f-d93306108cef

Claude-Session: https://claude.ai/code/session_01N218bERyNeLhbLmDRDvbWF
2026-10-02 20:09:30 +13:00
Paul O'Reilly
4b41236e26 feat(harness): repo-readonly/v1 + gitea-ssh layer in workflow-script/v1; agent_repo on test-validate/frozen-fixture-emit (WF-COMP-34, bug 3bee78fa/a3ba44bc) 2026-10-02 16:18:21 +13:00
Paul O'Reilly
b549a28187 feat(harnesses): shared-variables/v1 context + workflow-script/v1 composite (WF-COMP-31, WV-19) (03878b12-86b5-4b88-86d5-7182ae1c471f) 2026-10-01 15:31:48 +13:00
Paul O'Reilly
59f7b9e5f8 feat(forge-credential): add gitea-ssh-hatchmate/v1 layer + 4 hatchmate composite forks
M2-CRS W4 unblock: dispatched agents could not clone hatchmate/hatchmate-agents
because the shared gitea-ssh/v1 context mounts the ai_enablement deploy key,
which is scoped to skynet/* only. Same bug would hit every project whose
working repo lives outside the skynet org.

This implements the per-org pattern the framework already uses for accelerators
(gitea-ssh-accelerators/v1) and homelab (gitea-ssh-homelab/v1):

- harnesses/contexts/gitea-ssh-hatchmate/v1/{init.sh,harness.yaml} — NEW
  forge-credential context mirroring accelerators, with account_ref
  'hatchmate.space:platform' and write_targets covering hatchmate/*. The
  init.sh stages the ESO-mounted private key to ~/.ssh/gitea-oreillyit-nz-hatchmate
  (matching the ssh alias declared in harness.yaml). URL host pattern
  'gitea.oreillyit.nz-hatchmate' (per-org alias) drives SSH config block
  selection — already auto-written by harness_init.py from each layer's
  ssh_hosts: declarations.

- harnesses/composites/code-*-tdd-repo-hatchmate/v1/ — NEW composites for
  fable/minimax/airouter/opus that compose BOTH gitea-ssh/v1 (for reference
  clones, skynet org) AND gitea-ssh-hatchmate/v1 (for working-repo clone +
  push, hatchmate org). Composites are unchanged for non-hatchmate projects.

- tests/invariants/test_forge_credentials_declare_write_targets.py — the
  existing xfail(strict=True) marker was wrong: the 4 existing layers all
  declare write_targets today, so the test was XPASSing. Removed the
  xfail marker so HC-11 is now a real positive gate (5 layers instead
  of 4). This was a pre-existing test bug surfaced by the 5th layer.

W4 next step: dispatcher's account_ref resolution needs the hatchmate CP
account + grant to be created (via the new scripts/provision-hatchmate-fork-key.sh
in the hatchmate app repo).
2026-09-18 12:28:06 +12:00
Paul O'Reilly
33501ca54e fix(bug-verify-sonnet@1): agent self-transitions flow_state, remove dead verdict-tx node
verdict-tx (kind: script) never worked: script nodes are harness-exempt
(WF-COMP-6/MN-38) and run in their own empty container, so it could
never credentially read /workspace/verdict from the agent's node.

Option 3: give the agent node's own composite (planning-sonnet-repo) a
cp-service-token/v1 layer, and have the agent PATCH its own item's
flow_state (verified|rejected) to the CP directly as its last step,
before task_complete. Removes verdict-tx entirely.

See agent-runtimes work item 88ecd23e and spec/typed-workflows.md
WF-COMP-25 (agent-runtimes commit 8972d266) for the finalize.py
precedence fix this depends on (ambiguous pipe-separated output.state
must never be auto-PATCHed over the agent's own value).

Claude-Session: https://claude.ai/code/session_01U3biMxRhFGkwtf4jVTNjcj
2026-09-09 13:56:34 +12:00
Paul O'Reilly
5a8cd32aec feat(harnesses): add customer-script/v1 composite
Minimal harness for kind: customer_script nodes (agent-runtimes
spec/tenant-namespaces.md SCR-1..SCR-6). No LLM turn - runs via the
"shell" runner, agent-repo/v1 clone access only. Per-script credential
needs are deliberately not baked into this base (SCR-6: narrow,
per-script review) - compose a customer-script-<need>/v1 variant
layering whichever specific credential context a given script actually
needs, rather than widening this shared base.

Without this commit, kind: customer_script was not dispatchable from
any machine other than the one it was authored on - the harness lookup
against a fresh CRS sync would fail.

Claude-Session: https://claude.ai/code/session_012arAwUuBQrpnMzJ36mEVBk
2026-09-08 07:42:48 +12:00
Paul O'Reilly
a685bf16a6 feat: bug-verify-sonnet@1 template + planning-sonnet-repo runtime
Adds the CRS-side deliverables for agent-runtimes work item f59f0132
(ai-resolve bug-verification stage, M42 concept 7666d278). Mirrors
planning-opus-repo's layer stack with the sonnet model applied at the
node level (model: sonnet), per the established convention that the
composite name is descriptive only — the workflow node's own model:/
tier: field is what actually selects the model.

The template's terminal node runs the (separately-tracked, sibling
task ad975ac6) state-tx-verdict script — this template will not be
runnable end-to-end until that script lands, but the declarative
config itself is independently valid: schema-validates cleanly and
both eligibility scenarios from the task spec pass (verify-pending +
ai-resolve -> ok=True; missing flow_state -> state_mismatch).
2026-09-05 11:34:37 +12:00
Paul O'Reilly
38cd0b040b feat(harness): cp-service-token/v1 context — AU-51/AU-51b credential for decompose
New context mounts the cp-decompose-service-token account (system
provider type, account_id 1d963673-6ac9-4f85-875a-2ce5323e76ad, owner
(cp, cp)) via ESO and exports CP_SERVICE_TOKEN_FILE pointing at the
mounted secret file. Wired into spec-writing-sonnet-repo (backs
scope-decompose-sonnet@1, which calls back POST
/v1/work-items/{id}/decompose — bug b3a96acc / fa41caac / M42 stall).

The mounted value must match the CP's CP_INTERNAL_BEARER_TOKEN
(agent-runtimes deploy repo, overlays/{production,staging}/app-secret.sops.yaml).

No init.sh needed — the mount path is static at harness-authoring time
and entrypoint/actions/decompose_work_items.py (AU-51b, agent-runtimes
commit 0fa8b760) reads CP_SERVICE_TOKEN_FILE directly, so no
transformation/staging step is required.
2026-09-04 05:31:34 +12:00
Paul O'Reilly
2fa4dc92c2 pipeline model routing: mechanical stages to MiniMax M3, spec stages to Fable low effort
- scaffolding-repo + test-writing-repo: anthropic-cloud-paul-oauth -> minimax + minimax-m3-max
- merge@1: new best-practices-minimax-repo composite (impl-review stays Sonnet)
- spec-draft-opus@1: Opus -> Fable 5 low effort via new fable-low-effort/v1
  env context (ANTHROPIC_MODEL=claude-fable-5, MAX_THINKING_TOKENS=1024) +
  spec-writing-fable-low-repo composite
- review-spec-arch-opus@1: Qwen3.6/airouter -> Fable 5 low effort via
  best-practices-fable-low-repo (arch review was on the cheapest model)

Template names kept (trigger rules reference them). Node model: fields
removed where env pins the model — a --model flag overrides ANTHROPIC_MODEL.

Claude-Session: https://claude.ai/code/session_019tJk7P8tZzJ24PvtgoGhLN
2026-09-02 21:43:23 +12:00
Paul O'Reilly
4201b1ac3a integration-direct: route to MiniMax M3 max-effort instead of Anthropic OAuth
Integration runs were burning the personal Anthropic 5-hour window
(429 storm + window drain, 2026-09-02). New env-only context
minimax-m3-max/v1 pins ANTHROPIC_MODEL=MiniMax-M3[1m], maxes the
thinking budget, and sets the 1M auto-compact window; layered on
minimax/v1 for base URL + apiKeyHelper auth.

Claude-Session: https://claude.ai/code/session_019tJk7P8tZzJ24PvtgoGhLN
2026-09-02 21:33:50 +12:00
Paul O'Reilly
18a702d7a0 fix(integration-direct/v1): add missing agent-repo/v1 layer
All tasks dispatched to integration-direct/v1 were failing with
harness_missing_agent_repo_layer because dispatcher DSP-1 guard
requires agent-repo in the composite when AGENT_REPO_URL is set.

direct-push/v1 sets env vars (AGENT_SKIP_BRANCH_PUSH,
AGENT_EMPTY_DELIVERABLE_CHECK) that configure agent-repo's finalize.sh,
so agent-repo/v1 must precede it in the layer list.
2026-08-01 00:17:37 +12:00
Paul O'Reilly
350c0eeed4 feat(templates): 6-tier escalation ladder — add MiniMax + Fable tiers
New tiers in the coding queue:
  airouter(0-2) → minimax(3-5) → sonnet(6-7) → opus(8-9) → fable(10) → blocked(11+)

- models/claude-fable-5.yaml: Fable 5 model definition (Anthropic cloud, claude runner)
- harnesses/composites/code-fable-tdd-repo/v1: Fable TDD composite (mirrors opus, anthropic-cloud-paul-oauth auth)
- model-registry/harness-roles.yaml: claude-fable-5 → code-fable-tdd-repo under code-tdd role
- model-registry/tiers.yaml: claude-fable-5 added to coding.qualifies_today
- task-templates/workflow/minimax-impl-ready@1.yaml: MiniMax TDD workflow (scope: 3 files / 200 lines / 30m)
- task-templates/workflow/fable-impl-ready@1.yaml: Fable TDD workflow (scope: 5 files / 400 lines / 60m)

Claude-Session: https://claude.ai/code/session_015sCpoFee3LsLKbHQ4FRRWY
2026-07-29 01:59:54 +12:00
Paul O'Reilly
71f9cc0338 feat(airouter): DeepSeek V4 Flash TDD composite + max-effort template
New code-airouter-deepseekv4flash-tdd-repo/v1 composite (deepseek
methodology + the same tdd-protect/tdd-gate/python-dev/tdd-file-lock
layers as the Qwen TDD composite), plus a task-template that sets
reasoning_effort=max via the new extra_body passthrough (agent-runtimes
TT-38). Model/endpoint/model-registry entries already existed; only
the TDD-capable harness and the template were missing.
2026-07-03 12:36:43 +12:00
Paul O'Reilly
dd0d9e5c0a feat: hugo-content-workspace + hugo-content-airouter harnesses
New context: hugo-content-workspace/v1
- init.sh: clones hugo-{customer}-content at HUGO_CONTENT_BRANCH and
  hugo-{customer}-integration at main via gitea-ssh-accelerators
- finalize.sh: detects changes, commits content repo first then
  integration repo; skips silently if no changes
- CLAUDE.md: instructs the agent to work in /workspace/content/

New composite: hugo-content-airouter/v1
- Combines airouter/v1 + gitea-ssh-accelerators/v1 + hugo-content-workspace/v1
- Label-gated to airouter dispatchers (ESO secret required)

Used by cms-proxy /ai/{customer}/draft endpoint.
2026-06-24 07:10:05 +12:00
Paul O'Reilly
8167035b6b Add DeepSeek V4 Flash model and coder composite via airouter
- models/airouter-deepseekv4flash.yaml: DeepSeek-V4-Flash on airouter.ch endpoint,
  temp 1.0 / top_p 1.0 per recommended reasoning defaults, 262k context / 65k output
- model-registry/airouter-deepseekv4flash.yaml: deepseek provider, complexity 9,
  creativity 9, cost_efficiency 10 (covered by airouter sub)
- harnesses/contexts/deepseek-code-methodology/v1: DeepSeek-specific methodology
  CLAUDE.md; same rules as qwen-code-methodology but with correct model header
- harnesses/composites/code-airouter-deepseekv4flash-repo/v1: coder composite
  using airouter/v1 context (shared endpoint + secret — no new ESO resources needed)
2026-06-23 22:07:33 +12:00
Paul O'Reilly
f5968cfab5 feat: migrate missing harnesses, templates, and workflows from agent-runtimes
Brings the framework CRS repo up to date with all content that was
living in agent-runtimes (local-dev fallback) but hadn't been promoted.

New composites: feature-delivery-loop, integration-direct, scaffolding-repo,
sonnet-impl-narrow, sonnet-manager, test-writing-repo

New contexts: integration/v1, scaffolding/v1, sonnet-manager/v1, z-ai/v1,
airouter/v1/bin (anthropic-compat-wrapper.sh), cp-harness/v1/init.sh

New task-templates: sonnet-integrator.yaml, workflow/* (17 typed workflow
task templates for the Epic 1 pipeline)

Updated: agent-repo/v1/finalize.sh — adds AR-38/F97 empty-deliverable audit
(SKIP_BRANCH_PUSH support, boilerplate-path filtering, ci_metadata.json flag)

Also adds MEMORY.md index and memory/ topic files for the framework repo.
2026-06-23 08:59:01 +12:00
Paul O'Reilly
770ba97170 feat(epic1): add spec-writing-airouter-repo and best-practices-airouter-repo composites
Required by the Epic 1 trigger pipeline in agent-runtimes:
- spec-draft-opus@1 uses spec-writing-airouter-repo (concept→spec-draft workflow)
- review-spec-arch-opus@1 uses best-practices-airouter-repo (spec-draft→spec-reviewed-arch)
- scope-decompose-sonnet@1 uses spec-writing-airouter-repo (spec-reviewed-arch→scoped-tagged)

Both composites require the airouter label so only the airouter dispatcher claims them.
2026-06-19 17:34:58 +12:00
Paul O'Reilly
38dc28fef9 fix(harness): remove agent-repo/v1 from code-sonnet-direct composite
agent-repo/v1 init.sh creates /workspace/project/results/ and .gitignore,
making the directory non-empty before the integrator clone action runs.
git clone into a non-empty directory fails with 'already exists'.
Integrators don't need the agent-repo lifecycle — they clone origin/main
directly and push back. Remove agent-repo/v1 from the composite.
2026-06-15 01:27:55 +12:00
Paul O'Reilly
50c07b850c feat(harness): add code-sonnet-direct composite + direct-push context
Copies code-sonnet-direct/v1 (composite) and direct-push/v1 (context)
from agent-runtimes local harnesses to the CRS-served framework repo.
These are required by the sonnet-integrator task template used in the
ralph coding loop. Without them, all integrator dispatches fail with
"harness not found in any concepts repo: code-sonnet-direct/v1".
2026-06-15 00:18:43 +12:00
Paul O'Reilly
07309567d5 feat(agent-repo,airouter): seed from upstream + label-gate + diff verify
Three load-bearing fixes for the airouter dogfood pipeline, derived from
the 2026-05-08 batch-3 dogfood postmortem (gotchas-airouter.md items 27-30):

1. agent-repo/v1/init.sh — seed fresh task branches from
   /workspace/reference/main/ (the upstream clone) rather than the agent
   repo's stale main. This was THE killer for batch 3: the
   agent-runtimes-agents fork has been frozen at 2026-05-04 since the
   "Fork cleanup" PR, so every agent started from old state, missing
   recent test files and the M16/M22 scripts to delete. The fork remains
   the push remote (so finalize.sh works); only the working-tree seed
   moves to the upstream reference. Falls back to fork main when the
   reference clone isn't available (preserves legacy behavior). Tagged
   AR-14a.

2. requires_labels on contexts/composites — airouter context + both
   airouter composites declare requires_labels: [airouter] so the
   dispatcher's _collect_supported_harnesses (with the matching agent-
   runtimes change) advertises them only on dispatchers carrying the
   airouter label. Stops the main dispatcher from claiming airouter-
   labeled tasks and dying at init time. Composites that wrap label-
   restricted contexts MUST redeclare their own requires_labels — no
   auto-traversal of layers (kept simple).

3. agent-repo/v1/finalize.sh — AR-21 diff-against-upstream verification.
   New env-var protocol:
     - AGENT_EXPECTED_CHANGED_FILES (comma-separated paths that MUST
       appear in `git diff <ref/main>..HEAD`)
     - AGENT_FORBIDDEN_CHANGED_FILES (paths that MUST NOT appear)
   finalize.sh fails the task (exit 1) if either invariant is violated;
   the branch is still pushed for forensics so the operator can inspect.
   Catches BOTH the false-success mode (item 30 — agent reports succeeded
   but never changed the target file) AND the destructive-Write mode
   (item 21 — task 4a2f2988 stripped 9 unrelated functions). Also writes
   diff_verified, diff_mismatch, diff_changed_files into ci_metadata.json.

CRS pulls all three on next CP poll — no agent-runtimes image rebuild
needed for the framework parts. The matching dispatcher poller filter
ships in agent-runtimes (separate commit).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-08 15:45:41 +12:00
Paul O'Reilly
7a75c5ec3b fix(b22b): retarget composites + delete stale anthropic-cloud/v1
Phase 8 cutover (M22) renamed the anthropic harness from anthropic-cloud
→ anthropic-cloud-paul-oauth in agent-runtimes, but the equivalent
rename in this framework's composites and the deletion of the stale
SOPS-era anthropic-cloud/v1 dir were never done. Every cloud-Anthropic
composite (haiku/sonnet/opus code, planning, security-review, spec-
writing, test-writing, best-practices) layered the dead context and
silently never resolved a credential.

- Update 14 composites to layer anthropic-cloud-paul-oauth/v1
- Delete the orphaned harnesses/contexts/anthropic-cloud/v1/ directory
  (used pre-Phase-9 SOPS file delivery; now obsolete)

Closes BUG-22b. Pairs with the live PATCH /v1/accounts/{id} rename
shipped under BUG-22a.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-08 07:16:09 +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
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
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