feat: DONE gate in update_job_status — reject if verify_result null or EMPTY without verify_only
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
994f28f103
commit
5cd792a8fe
2 changed files with 73 additions and 0 deletions
39
__tests__/update-job-status-gate.test.ts
Normal file
39
__tests__/update-job-status-gate.test.ts
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
import { describe, it, expect } from 'vitest'
|
||||
import { checkVerifyGate } from '../src/tools/update-job-status.js'
|
||||
|
||||
describe('checkVerifyGate', () => {
|
||||
it('rejects when verify_result is null — agent must verify first', () => {
|
||||
const r = checkVerifyGate(null, false)
|
||||
expect(r.allowed).toBe(false)
|
||||
if (!r.allowed) expect(r.error).toMatch(/verify_task_against_plan/i)
|
||||
})
|
||||
|
||||
it('rejects when verify_result is EMPTY and task is not verify_only', () => {
|
||||
const r = checkVerifyGate('EMPTY', false)
|
||||
expect(r.allowed).toBe(false)
|
||||
if (!r.allowed) {
|
||||
expect(r.error).toMatch(/EMPTY/i)
|
||||
expect(r.error).toMatch(/verify_only/i)
|
||||
}
|
||||
})
|
||||
|
||||
it('allows when verify_result is EMPTY and task IS verify_only', () => {
|
||||
const r = checkVerifyGate('EMPTY', true)
|
||||
expect(r.allowed).toBe(true)
|
||||
})
|
||||
|
||||
it('allows when verify_result is ALIGNED', () => {
|
||||
const r = checkVerifyGate('ALIGNED', false)
|
||||
expect(r.allowed).toBe(true)
|
||||
})
|
||||
|
||||
it('allows when verify_result is PARTIAL', () => {
|
||||
const r = checkVerifyGate('PARTIAL', false)
|
||||
expect(r.allowed).toBe(true)
|
||||
})
|
||||
|
||||
it('allows when verify_result is DIVERGENT', () => {
|
||||
const r = checkVerifyGate('DIVERGENT', false)
|
||||
expect(r.allowed).toBe(true)
|
||||
})
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue