chore: version up to v2.80.31, clean up agent logic, and fix tests

This commit is contained in:
g1nation
2026-05-11 13:02:06 +09:00
parent 3c2b62c018
commit 5d3df0816f
9 changed files with 58 additions and 282 deletions
+9 -94
View File
@@ -109,12 +109,12 @@ describe('local project path preflight', () => {
const agent = new AgentExecutor(context) as any;
const guidance = agent.buildLocalProjectIntentGuidance('review-evaluation');
expect(guidance).toContain('purpose fit');
expect(guidance).toContain('architecture shape');
expect(guidance).toContain('data/control flow');
expect(guidance).toContain('failure recovery');
expect(guidance).toContain('operability/observability');
expect(guidance).toContain('extensibility');
expect(guidance).toContain('Intent operating contract — Code Review');
expect(guidance).toContain('## 한 줄 판단');
expect(guidance).toContain('## 잘된 점');
expect(guidance).toContain('## 부족한 점');
expect(guidance).toContain('## 사용자 관점 개선');
expect(guidance).toContain('## 다음 한 수');
});
it('adds an Astra stance layer for opinionated project collaboration', () => {
@@ -140,46 +140,7 @@ describe('local project path preflight', () => {
expect(stance).toContain('Local project intent for tone: review-evaluation');
});
it('quality-gates template-like review answers into an Astra verdict', () => {
const context: any = {
globalStorageUri: { fsPath: path.join(root, '.storage') },
workspaceState: stateStore(),
globalState: stateStore()
};
const agent = new AgentExecutor(context) as any;
const prompt = '/Volumes/Data/project/Antigravity/Datacollector_MAC 이 지식 수집 앱을 평가해줘. 장점 단점 확장성도 보고 싶어.';
const localPathContext = [
'Path: /Volumes/Data/project/Antigravity/Datacollector_MAC',
'Access: succeeded'
].join('\n');
const templateAnswer = [
'## 간단 요약',
'좋은 프로젝트입니다.',
'## 요청 요약',
'프로젝트 평가 요청입니다.',
'## 추론된 사용자 의도',
'방향성을 알고 싶어합니다.'
].join('\n');
const gated = agent.applyAstraQualityGate(templateAnswer, prompt, localPathContext);
expect(gated).toContain('## Astra 판단');
expect(gated).toContain('## 내가 보는 위험');
expect(gated).toContain('## 다음 한 수');
expect(gated).toContain('실제로 의존해도 되는 도구');
});
it('does not quality-gate tiny non-project replies', () => {
const context: any = {
globalStorageUri: { fsPath: path.join(root, '.storage') },
workspaceState: stateStore(),
globalState: stateStore()
};
const agent = new AgentExecutor(context) as any;
const answer = '좋아요. 바로 진행할게요.';
expect(agent.applyAstraQualityGate(answer, '좋아', '')).toBe(answer);
});
// applyAstraQualityGate was removed in v2.80.31 to prefer model-generated answers over hardcoded templates.
it('treats architecture opinion requests with local paths as inspectable work', () => {
const context: any = {
@@ -275,55 +236,9 @@ describe('local project path preflight', () => {
expect(fallback).not.toContain('어떤 기능 영역을 가장 먼저');
});
it('replaces misrouted project-knowledge answers for code review requests', () => {
const context: any = {
globalStorageUri: { fsPath: path.join(root, '.storage') },
workspaceState: stateStore(),
globalState: stateStore()
};
const agent = new AgentExecutor(context) as any;
const localPathContext = [
'Path: /Volumes/Data/project/Antigravity/Datacollector_MAC',
'Access: succeeded',
'Type: directory',
'Scanned tree:',
'src/App.tsx',
'src/lib/engine.ts',
'src/lib/api.ts',
'Priority file previews:',
'File: src/lib/engine.ts',
'export async function runMission() {}',
'File: src/lib/api.ts',
'export async function fetchSources() {}'
].join('\n');
const wrongAnswer = '## 기본 지식 생성 방향\n## 바로 만들 지식 초안\n# Datacollector_MAC Project Knowledge Overview';
// misrouted project-knowledge answer replacement for reviews was removed to favor flexible model responses.
expect(agent.isMisroutedProjectKnowledgeAnswer(wrongAnswer)).toBe(true);
const fixed = agent.buildProjectReviewFallbackAnswer(localPathContext);
expect(fixed).toContain('코드리뷰와 제품 평가 요청');
expect(fixed).toContain('## 코드리뷰 관점 평가');
expect(fixed).toContain('목적 적합성');
expect(fixed).toContain('데이터/제어 흐름');
expect(fixed).toContain('실패 복구');
expect(fixed).toContain('운영성/관측성');
expect(fixed).toContain('## 확장성 방향');
expect(fixed).not.toContain('바로 만들 지식 초안');
});
it('detects shallow project review answers', () => {
const context: any = {
globalStorageUri: { fsPath: path.join(root, '.storage') },
workspaceState: stateStore(),
globalState: stateStore()
};
const agent = new AgentExecutor(context) as any;
expect(agent.isShallowProjectReviewAnswer('좋은 프로젝트입니다. 장점은 구조가 좋고 단점은 테스트가 필요합니다.')).toBe(true);
expect(agent.isShallowProjectReviewAnswer([
'## 코드리뷰 관점 평가',
'목적 적합성, 아키텍처 구조, 데이터 흐름, 실패 복구, 운영 로그, 확장성을 기준으로 봅니다.'
].join('\n'))).toBe(false);
});
// isShallowProjectReviewAnswer was removed in favor of system-prompt-driven quality.
it('treats no-record-created answers as incomplete project knowledge creation', () => {
const context: any = {