Problem
When the CEO pipeline executes step 2c (Create GitHub Issue), it always creates a new issue, even when the hypothesis explicitly references an existing one (e.g., "issue #352"). This produces duplicate issues with near-identical content.
Example: Issue #352 already had a full spec for factory handoff. The CEO created #369 with the same content during the experiment pipeline, then #369 had to be closed as a duplicate.
Expected Behavior
Before creating a new issue, the CEO should:
- Check if the hypothesis text or backlog item references an existing issue number (e.g.,
#352, issue #352, Addresses: #352)
- If an existing issue is found, verify it's open:
gh issue view <number> --json state
- If open, use that issue number as
$ISSUE_NUM and skip creation
- Only create a new issue if no existing reference is found
Where to Fix
This is a prompt change in factory/agents/prompts/ceo.md, step 2c (Create GitHub Issue). Add a pre-check before the gh issue create block.
Acceptance Criteria
Problem
When the CEO pipeline executes step 2c (Create GitHub Issue), it always creates a new issue, even when the hypothesis explicitly references an existing one (e.g., "issue #352"). This produces duplicate issues with near-identical content.
Example: Issue #352 already had a full spec for
factory handoff. The CEO created #369 with the same content during the experiment pipeline, then #369 had to be closed as a duplicate.Expected Behavior
Before creating a new issue, the CEO should:
#352,issue #352,Addresses: #352)gh issue view <number> --json state$ISSUE_NUMand skip creationWhere to Fix
This is a prompt change in
factory/agents/prompts/ceo.md, step 2c (Create GitHub Issue). Add a pre-check before thegh issue createblock.Acceptance Criteria