Feat: Implement Project Claim Output Brake and refine agent reasoning

This commit is contained in:
g1nation
2026-05-02 18:06:28 +09:00
parent 3df23b4ca9
commit fcc07e013e
5 changed files with 112 additions and 1 deletions
@@ -0,0 +1,35 @@
# Development Log: Project Claim Output Brake
## Purpose
Stop unsupported project technical claims in the final answer body, not only in Trace diagnostics.
## Problem
Even when Trace reported `projectClaimPolicy=general-only`, the model could still write phrases such as:
- "기술적 기반 면에서는 안정적"
- "아키텍처는 유연하나"
- "모듈화된 구조는 향후 기능 추가 시 유연성을 제공합니다"
Prompt guidance alone was not enough.
## Implementation Summary
- Added `enforceProjectClaimPolicyInAnswer`.
- When `projectClaimPolicy=general-only`, final answer text is scanned before output.
- Unsupported technical structure claim sentences are removed.
- A safe notice is inserted:
- "현재 정보만으로는 기술 구조를 판단할 수 없습니다."
- "기술적 안정성, 아키텍처 유연성, 모듈화 여부는 소스 코드나 설계 문서 확인이 필요합니다."
- Connected the enforcement function in `AgentExecutor` before final response streaming and history persistence.
- Added regression tests for the exact problematic phrases.
## Changed Files
- `src/features/secondBrainTrace.ts`
- `src/agent.ts`
- `tests/secondBrainTrace.test.ts`
## Verification
- `./node_modules/.bin/tsc --noEmit`
- `npm run compile`
- `./node_modules/.bin/jest --runInBand`
## Result
The system now has a deterministic output brake for unsupported project implementation claims when Trace says only general/reference evidence is available.