Skip to content

Commit 9d4554a

Browse files
committed
Remove fast rejudge acceptance
1 parent 9e314be commit 9d4554a

4 files changed

Lines changed: 51 additions & 130 deletions

File tree

src/__tests__/report.test.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ describe('saveLoopDocGateArtifacts', () => {
5353
priority: 80,
5454
text: 'Document env setup for config-sensitive tests',
5555
accepted: true,
56-
fastAccepted: false,
5756
status: 'accepted',
5857
reason: 'Reusable and verified',
5958
baseScore: 6,
@@ -62,7 +61,6 @@ describe('saveLoopDocGateArtifacts', () => {
6261
gateDelta: 0.9,
6362
docsDiff: '--- a/docs/testing.md\n+++ b/docs/testing.md\n+Set APP_MODE=test\n',
6463
},
65-
docsPatchText: 'diff --git a/docs/testing.md b/docs/testing.md\n--- a/docs/testing.md\n+++ b/docs/testing.md\n@@ -1 +1,2 @@\n # Testing\n+Set APP_MODE=test\n',
6664
rejudgeJudging: {
6765
analysis: 'More discerning with updated docs.',
6866
strengths: [],
@@ -106,7 +104,7 @@ describe('saveLoopDocGateArtifacts', () => {
106104
const candidateDir = path.join(logDir, 'doc-candidates-loop-1', 'feature-a', 'candidate-01')
107105
expect(fs.existsSync(candidateDir)).toBe(true)
108106
expect(fs.readFileSync(path.join(candidateDir, 'suggestion.txt'), 'utf-8')).toContain('Document env setup')
109-
expect(fs.readFileSync(path.join(candidateDir, 'docs.patch'), 'utf-8')).toContain('diff --git')
107+
expect(fs.existsSync(path.join(candidateDir, 'docs.patch'))).toBe(false)
110108
expect(fs.readFileSync(path.join(candidateDir, 'docs-diff.txt'), 'utf-8')).toContain('APP_MODE=test')
111109

112110
const metadata = JSON.parse(fs.readFileSync(path.join(candidateDir, 'metadata.json'), 'utf-8'))

src/__tests__/run-evalbuff.test.ts

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,6 @@ describe('evaluateDocChangeGate', () => {
5151
events.clearBuffer()
5252
})
5353

54-
it('fast-accepts when the rejudge score drops by at least twice the normal threshold', () => {
55-
const result = evaluateDocChangeGate({
56-
baseScore: 6,
57-
rejudgeScore: 5,
58-
})
59-
60-
expect(result.accepted).toBe(true)
61-
expect(result.fastAccepted).toBe(true)
62-
expect(result.status).toBe('accepted_fast_rejudge')
63-
expect(result.gateDelta).toBeCloseTo(1, 6)
64-
expect(result.reason).toBe('Accepted without rerun because rejudge dropped by 1.0.')
65-
})
66-
6754
it('accepts when rerun minus rejudge clears the threshold', () => {
6855
const result = evaluateDocChangeGate({
6956
baseScore: 6,
@@ -72,7 +59,6 @@ describe('evaluateDocChangeGate', () => {
7259
})
7360

7461
expect(result.accepted).toBe(true)
75-
expect(result.fastAccepted).toBe(false)
7662
expect(result.status).toBe('accepted')
7763
expect(result.gateDelta).toBeCloseTo(0.6, 6)
7864
expect(result.reason).toBe('Accepted because rerun minus rejudge was 0.6.')
@@ -86,7 +72,6 @@ describe('evaluateDocChangeGate', () => {
8672
})
8773

8874
expect(result.accepted).toBe(false)
89-
expect(result.fastAccepted).toBe(false)
9075
expect(result.status).toBe('rejected')
9176
expect(result.gateDelta).toBeCloseTo(0.3, 6)
9277
expect(result.reason).toBe('Rejected because rerun minus rejudge was 0.3.')
@@ -158,12 +143,14 @@ describe('evaluateDocChangeGate', () => {
158143
text: 'Document the rerun gate',
159144
reason: 'Useful guidance',
160145
overfit: false,
161-
patchText: 'patch',
146+
fileChanges: [
147+
{ path: 'docs/guide.md', content: '# Guide\nRerun gate.\n' },
148+
],
162149
diffText: '--- a/docs/guide.md\n+++ b/docs/guide.md\n',
163150
},
164151
],
165152
}),
166-
materializeDocsChangeFromPatch: () => ({
153+
materializeDocsChange: () => ({
167154
tempDir: '/tmp/draft-docs',
168155
repoDir: '/tmp/draft-docs',
169156
before: {},

src/report.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@ export interface DocChangeGateCandidateResult {
1919
priority: number
2020
text: string
2121
accepted: boolean
22-
fastAccepted: boolean
2322
status:
2423
| 'accepted'
25-
| 'accepted_fast_rejudge'
2624
| 'rejected'
2725
| 'rejected_overfit'
2826
| 'rejected_no_change'
@@ -46,7 +44,6 @@ export interface FeatureDocGateResult {
4644

4745
export interface DocChangeGateCandidateArtifacts {
4846
summary: DocChangeGateCandidateResult
49-
docsPatchText?: string
5047
rejudgeJudging?: JudgingResult
5148
rerunTask?: TaskResult
5249
}
@@ -59,7 +56,6 @@ export interface FeatureDocGateArtifacts {
5956
export interface LoopDocGateResult {
6057
loop: number
6158
threshold: number
62-
fastAcceptThreshold: number
6359
features: FeatureDocGateResult[]
6460
}
6561

@@ -151,10 +147,6 @@ export function saveLoopDocGateArtifacts(
151147
fs.writeFileSync(path.join(candidateDir, 'metadata.json'), JSON.stringify(candidate.summary, null, 2))
152148
fs.writeFileSync(path.join(candidateDir, 'suggestion.txt'), candidate.summary.text + '\n')
153149

154-
if (candidate.docsPatchText && candidate.docsPatchText.trim()) {
155-
fs.writeFileSync(path.join(candidateDir, 'docs.patch'), candidate.docsPatchText)
156-
}
157-
158150
if (candidate.summary.docsDiff.trim()) {
159151
fs.writeFileSync(path.join(candidateDir, 'docs-diff.txt'), candidate.summary.docsDiff)
160152
}

0 commit comments

Comments
 (0)