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>
This commit is contained in:
@@ -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_<req_id>_<short_description>`.
|
||||
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
|
||||
<<ARTIFACT:write_tests:output>>
|
||||
|
||||
Reference in New Issue
Block a user