Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .strray/state/state.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"votingHistory": [],
"metrics": {
"totalVotes": 0,
"successfulVotes": 0,
"failedVotes": 0,
"averageConfidence": 0,
"strategyUsage": {
"majority_vote": 0,
"consensus": 0,
"expert_priority": 0
},
"agentParticipation": {},
"averageVoterTurnout": 0
},
"exportedAt": "2026-05-19T19:43:23.601Z"
}
10 changes: 10 additions & 0 deletions docs/guards/Codify-Test-Coverage-Expansion-pattern.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Guard: Codify Test Coverage Expansion pattern

Test Coverage Expansion detected across 110 sessions (avg confidence: 95%). 7 new test files added. Test-first or test-alongside development — covering new code as it ships.

## Evidence
+ src/__tests__/e2e/inference-e2e.test.ts
+ src/__tests__/integration/inference-pipeline.test.ts
+ src/__tests__/unit/inference/deploy-verifier.test.ts
+ src/__tests__/unit/inference/inference-accumulator.test.ts
+ src/__tests__/unit/inference/inference-cycle.test.ts
34 changes: 30 additions & 4 deletions src/inference/inference-cycle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,8 @@
}

if (!filesChanged) {
execSync(`git checkout master`, { cwd: this.projectRoot, stdio: "pipe" });
const defaultBranch = this.getDefaultBranch();
execSync(`git checkout ${defaultBranch}`, { cwd: this.projectRoot, stdio: "pipe" });
execSync(`git branch -D ${branchName}`, { cwd: this.projectRoot, stdio: "pipe" });
return false;
}
Expand All @@ -441,20 +442,20 @@
const review = await this.researcherReview(p, prUrl);
if (review === "no-go") {
frameworkLogger.log("inference-cycle", "researcher-no-go", "warning", { prUrl });
execSync(`git checkout master`, { cwd: this.projectRoot, stdio: "pipe" });
execSync(`git checkout ${this.getDefaultBranch()}`, { cwd: this.projectRoot, stdio: "pipe" });
execSync(`git branch -D ${branchName}`, { cwd: this.projectRoot, stdio: "pipe" });
return false;
} else if (review === "modify") {
frameworkLogger.log("inference-cycle", "researcher-modify", "info", { prUrl });
}
}

execSync(`git checkout master`, { cwd: this.projectRoot, stdio: "pipe" });
execSync(`git checkout ${this.getDefaultBranch()}`, { cwd: this.projectRoot, stdio: "pipe" });

return true;
} catch (err) {
try {
execSync(`git checkout master`, { cwd: this.projectRoot, stdio: "pipe" });
execSync(`git checkout ${this.getDefaultBranch()}`, { cwd: this.projectRoot, stdio: "pipe" });
execSync(`git branch -D ${branchName}`, { cwd: this.projectRoot, stdio: "pipe" });
} catch {
// ignore cleanup errors
Expand Down Expand Up @@ -597,6 +598,31 @@
return [...files];
}

private getDefaultBranch(): string {
try {
const symRef = execSync('git symbolic-ref refs/remotes/origin/HEAD', {
cwd: this.projectRoot,
encoding: 'utf-8',
stdio: 'pipe'
}).trim();
if (symRef) {
const branch = symRef.replace('refs/remotes/origin/', '');
if (branch) return branch;
}
} catch {}

Check failure on line 612 in src/inference/inference-cycle.ts

View workflow job for this annotation

GitHub Actions / lint

Empty block statement

Check failure on line 612 in src/inference/inference-cycle.ts

View workflow job for this annotation

GitHub Actions / Quality Checks

Empty block statement

try {
const current = execSync('git branch --show-current', {
cwd: this.projectRoot,
encoding: 'utf-8',
stdio: 'pipe'
}).trim();
if (['main', 'master', 'develop'].includes(current)) return current;
} catch {}

Check failure on line 621 in src/inference/inference-cycle.ts

View workflow job for this annotation

GitHub Actions / lint

Empty block statement

Check failure on line 621 in src/inference/inference-cycle.ts

View workflow job for this annotation

GitHub Actions / Quality Checks

Empty block statement

return 'main';
}

private createPR(p: InferenceProposal, branchName: string): string {
try {
execSync(`git push -u origin ${branchName}`, { cwd: this.projectRoot, stdio: "pipe" });
Expand Down
Loading