feat(purelock): process 3 functions/run via parallel test-writer sub-agents - #51164
Merged
Conversation
…t, process up to 3 functions per run Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
feat(purelock): parallelize test generation with test-writer sub-agent, process up to 3 functions per run
feat(purelock): process 3 functions/run via parallel test-writer sub-agents
Aug 7, 2026
Copilot created this pull request from a session on behalf of
pelikhan
August 7, 2026 19:07
View session
pelikhan
marked this pull request as ready for review
August 7, 2026 19:08
Contributor
There was a problem hiding this comment.
Pull request overview
Restructures PureLock into a parallel orchestrator/sub-agent pipeline for processing up to three Go functions per run.
Changes:
- Adds parallel
test-writersub-agents and result aggregation. - Expands the safe-output file limit.
- Regenerates the compiled workflow.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/purelock.md |
Defines candidate fan-out, test generation, validation, and aggregation. |
.github/workflows/purelock.lock.yml |
Updates generated metadata and safe-output configuration. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Suppressed comments (5)
.github/workflows/purelock.md:217
- The PR body requires the sub-agent's Serena verification, but the declared result schema has no field carrying it. Because aggregation reads
result.json, a successful run cannot reliably provide the requested evidence. Add an explicit field; the final instruction to populate all fields will then require the writer to return it.
"residual_uncovered": "",
"reason": ""
.github/workflows/purelock.md:223
- A sub-agent can terminate or fail before creating valid JSON, but this step assumes every result file exists and is readable. One failed invocation can therefore abort aggregation and discard successful agents instead of following the intended partial-success path. Treat missing, malformed, and key-mismatched results as noop failures with a reason.
After all agents finish, read every `result.json`. Separate results into `succeeded` (outcome=pr) and `failed` (outcome=noop).
.github/workflows/purelock.md:266
- The Serena CLI requires named tool parameters; the repository's Copilot smoke workflows use
serena activate_project --path .... Passing the workspace positionally can make activation fail before purity analysis begins.
serena activate_project /home/runner/work/gh-aw/gh-aw
.github/workflows/purelock.md:273
- This early-stop branch writes a relative
result.json, but setup only assignsWORK_DIRand never changes the current directory. The orchestrator looks under$WORK_DIR, so an impure candidate can leave no collectable result. Write to the same absolute work-dir path used by the final reporting step.
If the function turns out to be impure, write `result.json` with `"outcome":"noop"` and a descriptive `reason`, then stop.
.github/workflows/purelock.md:188
nameis not a unique candidate identifier: functions in different packages and methods on different receiver types may have the same name. Those candidates would overwrite the sameinput.jsonandresult.json, causing duplicate work and lost results. Include a selection index (or an encoded full key) in every per-agent directory path.
For each selected candidate, write its JSON entry to `/tmp/gh-aw/agent/purelock-<name>/input.json` (creating the directory first).
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Balanced
| 1. Read `/tmp/gh-aw/cache-memory/purelock/state.json` when it exists. Shape: | ||
| `{"processed":[{"key":"pkg/x/y.go:120:FuncName","date":"YYYY-MM-DD","outcome":"pr|noop"}]}`. | ||
| 2. Walk `candidates.json` in order (already sorted by score) and pick the first candidate whose `key` (`file:line:name`) is absent from `processed`, or was processed more than 60 days ago. | ||
| 2. Walk `candidates.json` in order (already sorted by score) and pick the first **up to 3** candidates whose `key` (`file:line:name`) is absent from `processed`, or was processed more than 60 days ago. |
Contributor
|
🎉 This pull request is included in a new release. Release: |
This was referenced Aug 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PureLock previously processed one function per run sequentially. This restructures it as an orchestrator + parallel sub-agent pipeline to process up to 3 functions per run.
Architecture changes
candidates.json, writes each to/tmp/gh-aw/agent/purelock-<name>/input.json, then fans out to alltest-writersub-agents simultaneouslytest-writersub-agent (model: large) owns the full single-function pipeline: Serena purity confirmation → baseline coverage → table-driven testify suite → fuzz escalation →gofmt/go vet/-racevalidation → structuredresult.jsonFrontmatter
max-patch-files: 4 → 8 (3 functions × up to 2 files each)Expected gains vs baseline run (31190616566: 57 AIC, 15.6 min, 1 function)