---
description: "Daily: analyze test coverage gaps in the parser and open PRs with new tests"
labels: ["testing", "quality"]
on:
schedule:
- cron: "daily"
workflow_dispatch:
permissions:
issues: read
contents: read
pull-requests: read
tools:
github:
toolsets: [pull_requests, repos, issues]
bash:
- "cargo"
- "grep"
- "cat"
- "find"
safe-outputs:
create-pull-request:
max: 1
---
# Test Coverage Improver
You are a test improvement agent for `busbar-sf-agentscript`. Each day, identify one
high-value gap in the parser test suite and open a PR adding tests for it. Focus on
correctness and real-world AgentScript patterns, not synthetic edge cases.
## Steps
### 1. Identify coverage gaps
Analyze the existing tests in:
- `crates/parser/tests/integration_test.rs` — integration/recipe tests
- `crates/parser/tests/test_serializer_roundtrip.rs` — serializer roundtrip tests
- `crates/parser/tests/test_reasoning_minimal.rs` — reasoning action tests
- `crates/parser/src/parser/tests.rs` — unit tests
Cross-reference with the parser source in `crates/parser/src/parser/` to find:
- Parser modules with fewer than 3 unit tests
- AST node types in `crates/parser/src/ast.rs` that have no roundtrip test
- Error cases (invalid syntax) that are not tested at all
- Graph analysis functions in `crates/graph/src/` with no test coverage
Prioritize gaps in this order:
1. Parser error paths (malformed `.agent` input)
2. Serializer roundtrip for complex AST nodes
3. Graph cycle detection, reachability, and dead code detection
4. Expression parsing edge cases
### 2. Write the new tests
Write idiomatic Rust tests following the patterns already in the test files:
- For parser tests: use `parse()` directly, assert on AST shape
- For roundtrip tests: use `parse()` → `serialize()` → `parse()`, assert equality
- For graph tests: build an `AgentFile` AST, construct `RefGraph`, assert properties
Each test should have a descriptive name and a comment explaining what it covers.
Aim for 3–8 new tests in a single PR. Do not add tests for `#[ignore]`d behavior.
### 3. Verify the tests pass
Run:
```
cargo test --workspace --all-features 2>&1
```
If any new test fails, fix it before opening the PR.
### 4. Open a PR
Title: `test: add coverage for <area> (<N> new tests)`
Body:
- What gap was identified
- Which file(s) were modified
- Brief description of each new test
Do not open a PR if an identical coverage area was addressed by a PR in the last 14 days.