mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-21 15:55:50 +00:00
chore: 移除 goalAudit stub 及其测试引用
- 删除 src/services/goal/goalAudit.ts(导出 COMPLETION_AUDIT_RULES/BLOCKED_AUDIT_RULES/isGoalTerminal 等未引用的 stub) - 同步移除 tests/integration/goal-lifecycle.test.ts 中对 goalAudit 的 import 和一个测试用例(budget_limited is terminal) Co-Authored-By: glm-5.2 <zai-org@claude-code-best.win>
This commit is contained in:
@@ -38,12 +38,6 @@ import {
|
||||
buildGoalContextBlock,
|
||||
} from '../../src/services/goal/prompts'
|
||||
|
||||
import {
|
||||
COMPLETION_AUDIT_RULES,
|
||||
BLOCKED_AUDIT_RULES,
|
||||
isGoalTerminal,
|
||||
} from '../../src/services/goal/goalAudit'
|
||||
|
||||
const TEST_SESSION = 'test-integration-session'
|
||||
|
||||
beforeEach(() => {
|
||||
@@ -123,10 +117,6 @@ describe('Goal lifecycle: budget limiting', () => {
|
||||
expect(getGoal(TEST_SESSION)!.status).toBe('budget_limited')
|
||||
expect(getGoal(TEST_SESSION)!.tokensUsed).toBe(55_000)
|
||||
})
|
||||
|
||||
test('budget_limited is terminal', () => {
|
||||
expect(isGoalTerminal('budget_limited')).toBe(true)
|
||||
})
|
||||
})
|
||||
|
||||
describe('Goal lifecycle: usage limiting', () => {
|
||||
@@ -135,10 +125,6 @@ describe('Goal lifecycle: usage limiting', () => {
|
||||
markUsageLimited(TEST_SESSION)
|
||||
expect(getGoal(TEST_SESSION)!.status).toBe('usage_limited')
|
||||
})
|
||||
|
||||
test('usage_limited is terminal', () => {
|
||||
expect(isGoalTerminal('usage_limited')).toBe(true)
|
||||
})
|
||||
})
|
||||
|
||||
describe('Goal lifecycle: blocked attempts', () => {
|
||||
@@ -197,20 +183,6 @@ describe('Goal lifecycle: turn limits', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('isGoalTerminal', () => {
|
||||
test('active and paused are NOT terminal', () => {
|
||||
expect(isGoalTerminal('active')).toBe(false)
|
||||
expect(isGoalTerminal('paused')).toBe(false)
|
||||
})
|
||||
|
||||
test('complete, blocked, budget_limited, usage_limited are terminal', () => {
|
||||
expect(isGoalTerminal('complete')).toBe(true)
|
||||
expect(isGoalTerminal('blocked')).toBe(true)
|
||||
expect(isGoalTerminal('budget_limited')).toBe(true)
|
||||
expect(isGoalTerminal('usage_limited')).toBe(true)
|
||||
})
|
||||
})
|
||||
|
||||
describe('Goal prompt templates', () => {
|
||||
test('continuation prompt contains objective and audit rules', () => {
|
||||
const goal = setGoal('Build dashboard', {
|
||||
@@ -256,24 +228,6 @@ describe('Goal prompt templates', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('Audit rules consistency', () => {
|
||||
test('completion audit has 6 rules', () => {
|
||||
expect(COMPLETION_AUDIT_RULES.length).toBe(6)
|
||||
})
|
||||
|
||||
test('blocked audit has 3 rules', () => {
|
||||
expect(BLOCKED_AUDIT_RULES.length).toBe(3)
|
||||
})
|
||||
|
||||
test('continuation prompt embeds all completion audit rules', () => {
|
||||
const goal = setGoal('Audit check', { sessionId: TEST_SESSION })
|
||||
const prompt = buildContinuationPrompt(goal)
|
||||
for (const rule of COMPLETION_AUDIT_RULES) {
|
||||
expect(prompt).toContain(rule)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
describe('Format helpers', () => {
|
||||
test('formatGoalStatusLabel returns human-readable labels', () => {
|
||||
expect(formatGoalStatusLabel('active')).toBe('Active')
|
||||
|
||||
Reference in New Issue
Block a user