From e7225960ec171542bbdb4defe146dbfbff827c2f Mon Sep 17 00:00:00 2001 From: Paul O'Reilly Date: Thu, 30 Apr 2026 15:21:30 +1200 Subject: [PATCH] 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 --- workflows/write-tests.yaml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/workflows/write-tests.yaml b/workflows/write-tests.yaml index 05e3411..e6d9223 100644 --- a/workflows/write-tests.yaml +++ b/workflows/write-tests.yaml @@ -48,12 +48,16 @@ params: nodes: write_tests: name: "Write tests from spec" + reference_branches: + - repo_url: "{{ repo_url }}" + branch: main + name: main prompt: | You are writing a test suite from a spec file. Tests are the contract — they will be run against an agent's implementation. Write them now, before the implementation exists. ## Spec file - Read the spec at `{{ spec_file }}` in the cloned repo at `/workspace/project/`. + Read the spec at `/workspace/reference/main/{{ spec_file }}`. {% if task_description %} ## Additional context @@ -65,7 +69,7 @@ nodes: 2. For each requirement, write at least one test function named `test__`. 3. Cover edge cases explicitly — empty inputs, boundary values, error paths. 4. Add property-based tests (Hypothesis) where the requirement involves ranges or invariants. - 5. Write tests to `{{ test_output_dir }}` — one file per logical group (mirrors spec sections). + 5. Write tests to `/workspace/project/{{ test_output_dir }}` — one file per logical group (mirrors spec sections). 6. Use `{{ test_framework }}` conventions. Tests should fail immediately (no implementation exists). 7. Do NOT write any implementation code. Only test files. @@ -82,11 +86,15 @@ nodes: review_coverage: name: "Review test coverage" depends_on: [write_tests] + reference_branches: + - repo_url: "{{ repo_url }}" + branch: main + name: main prompt: | You are reviewing the coverage of a freshly written test suite against its spec. ## Spec file - Read the spec at `{{ spec_file }}` in the cloned repo at `/workspace/project/`. + Read the spec at `/workspace/reference/main/{{ spec_file }}`. ## Test summary written by the previous agent <>