Feat: Implement Project Chronicle Guard Policy and Second Brain Trace enhancements
This commit is contained in:
@@ -121,6 +121,40 @@ describe('Second Brain Trace', () => {
|
||||
expect(apiGateway?.sourceType).toBe('General Knowledge');
|
||||
expect(apiGateway?.canSupportProjectClaim).toBe(false);
|
||||
expect(apiGateway?.warning).toContain('실제 구현 근거가 아닙니다');
|
||||
expect(renderSecondBrainTraceMarkdown(trace, true)).toContain('"canSupportProjectClaim": false');
|
||||
const markdown = renderSecondBrainTraceMarkdown(trace, true);
|
||||
const context = renderSecondBrainTraceContext(trace);
|
||||
expect(trace.projectClaimPolicy).not.toBe('allow');
|
||||
expect(markdown).toContain('"canSupportProjectClaim": false');
|
||||
expect(context).toContain('No Evidence, No Project Claim');
|
||||
expect(context).toContain('현재 정보만으로는 기술 구조를 판단할 수 없습니다');
|
||||
expect(context).toContain('아키텍처는 유연합니다');
|
||||
});
|
||||
|
||||
it('uses general-only policy when selected notes cannot support project claims', () => {
|
||||
const generalOnlyRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'second-brain-general-only-'));
|
||||
try {
|
||||
fs.mkdirSync(path.join(generalOnlyRoot, '02_Architecture_Principles'), { recursive: true });
|
||||
fs.writeFileSync(
|
||||
path.join(generalOnlyRoot, '02_Architecture_Principles', 'API Gateway.md'),
|
||||
[
|
||||
'# API Gateway',
|
||||
'',
|
||||
'General Knowledge: API Gateway can route requests in a microservice architecture.',
|
||||
'This is a concept note, not current project evidence.'
|
||||
].join('\n'),
|
||||
'utf8'
|
||||
);
|
||||
|
||||
const trace = buildSecondBrainTrace(
|
||||
'현재 프로젝트는 API Gateway 라우팅 구조를 갖추고 있어?',
|
||||
generalOnlyRoot,
|
||||
{ force: true }
|
||||
);
|
||||
|
||||
expect(trace.projectClaimPolicy).toBe('general-only');
|
||||
expect(renderSecondBrainTraceContext(trace)).toContain('STRICT RULE');
|
||||
} finally {
|
||||
fs.rmSync(generalOnlyRoot, { recursive: true, force: true });
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user