Version 2.47.0 Release: Recursive Project Knowledge Flow and Follow-up Context Injection

This commit is contained in:
g1nation
2026-05-03 01:22:15 +09:00
parent fadf867978
commit ecec7556da
4 changed files with 233 additions and 1 deletions
@@ -0,0 +1,122 @@
# ConnectAI Project Knowledge Overview
Date: 2026-05-02T16:14:59.756Z
Project: ConnectAI
Repository: `/Volumes/Data/project/Antigravity/ConnectAI`
## Purpose
ConnectAI는 VS Code 안에서 로컬 AI 에이전트, Second Brain, 프로젝트 기록, 에이전트 스킬을 연결하는 개발 보조 프로젝트다.
## Confirmed Structure
- `src/agent.ts`: 에이전트 실행, 로컬 경로 프리플라이트, Second Brain Trace, 액션 실행 흐름의 중심.
- `src/sidebarProvider.ts`: Webview UI, 브레인/모델/프로젝트 선택, 프롬프트 전달, 기록 UI를 담당.
- `src/features/secondBrainTrace.ts`: Second Brain 검색 결과와 근거 정책을 구성.
- `src/features/projectChronicle/`: 프로젝트 기록을 Markdown으로 관리하는 Chronicle 기능.
- `src/core/`: 큐, 이벤트, 트랜잭션, 오류 처리 등 실행 안정성 계층.
- `tests/`: Second Brain, 로컬 경로 프리플라이트, Chronicle, 보안/트랜잭션 회귀 테스트.
## Evidence Files
- `package.json`
- `docs/records/ConnectAI/README.md`
- `README.md`
- `src/agent.ts`
- `src/agents/AgentWorkflowManager.ts`
- `src/agents/factory.ts`
- `src/bridge.ts`
- `src/config.ts`
- `src/extension.ts`
- `src/MrBeast_Premium_10.md`
- `src/security.ts`
- `src/sidebarProvider.ts`
## Scanned Tree Excerpt
```text
assets/
assets/icon.png
assets/icon.svg
core_py/
core_py/events.py
core_py/inference.py
core_py/loader.py
core_py/monitoring.py
core_py/optimizer.py
core_py/queue_worker.py
core_py/requirements.txt
docs/
docs/records/
docs/records/ConnectAI/
docs/records/ConnectAI/decisions/
docs/records/ConnectAI/development/
docs/records/ConnectAI/development/2026-05-02_answer-format-readability-tuning.md
docs/records/ConnectAI/development/2026-05-02_local-path-code-review-preflight.md
docs/records/ConnectAI/development/2026-05-02_no-evidence-no-project-claim.md
docs/records/ConnectAI/development/2026-05-02_progressive-answer-format.md
docs/records/ConnectAI/development/2026-05-02_project-claim-output-brake.md
docs/records/ConnectAI/development/2026-05-02_project-claim-policy-enforcement.md
docs/records/ConnectAI/development/2026-05-02_query-intent-search-tuning.md
docs/records/ConnectAI/development/2026-05-02_remove-local-template-replies.md
docs/records/ConnectAI/development/2026-05-02_second-brain-trace-quality-tuning.md
docs/records/ConnectAI/discussions/
docs/records/ConnectAI/planning/
docs/records/ConnectAI/planning/2026-05-02_project-chronicle-guard.md
docs/records/ConnectAI/planning/2026-05-02_second-brain-trace-mode.md
docs/records/ConnectAI/project-profile.md
docs/records/ConnectAI/README.md
docs/records/ConnectAI/timeline.md
docs/Advanced_Features_Implementation_Guide.md
docs/UX_UI_Consistency_Guidelines.md
src/
src/agents/
src/agents/AgentWorkflowManager.ts
src/agents/factory.ts
src/core/
src/core/conflict.ts
src/core/dataProcessor.ts
src/core/errorHandler.ts
src/core/errors.ts
src/core/events.ts
src/core/health.ts
src/core/lock.ts
src/core/queue.ts
src/core/services.ts
src/core/session.ts
src/core/statusBar.ts
src/core/transaction.ts
src/features/
src/features/projectChronicle/
src/features/projectChronicle/guardPrompt.ts
src/features/projectChronicle/index.ts
src/features/projectChronicle/markdownFileWriter.ts
src/features/projectChronicle/templates.ts
src/features/projectChronicle/types.ts
src/features/secondBrainTrace.ts
src/lib/
src/lib/engine.ts
src/types/
src/types/interfaces.ts
src/agent.ts
src/bridge.ts
src/config.ts
src/extension.ts
src/MrBeast_Premium_10.md
src/security.ts
src/sidebarProvider.ts
src/utils.ts
tests/
tests/mocks/
tests/mocks/vscode.js
tests/dataProcessor.test.ts
tests/localPathPreflight.test.ts
tests/projectChronicle.test.ts
tests/projectChronicleGuardPrompt.test.ts
tests/secondBrainTrace.test.ts
tests/systemPrompt.test.ts
```
## Current Knowledge Gap
- 전체 아키텍처는 파일 구조와 일부 프리뷰 기준으로 파악 가능하지만, 세부 동작 지식은 `src/agent.ts`, `src/sidebarProvider.ts`, `secondBrainTrace.ts`, `projectChronicle` 순서로 심화 분석해 보강해야 한다.
## Next Records
- `agent.ts` 실행 흐름 상세 분석
- Second Brain Trace 검색 및 근거 정책 분석
- Project Chronicle 기록 생성 흐름 분석
+1 -1
View File
@@ -2,7 +2,7 @@
"name": "g1nation", "name": "g1nation",
"displayName": "G1nation", "displayName": "G1nation",
"description": "High-performance autonomous local AI coding agent for VS Code. Features vectorized inference, asynchronous task management, and 100% offline processing.", "description": "High-performance autonomous local AI coding agent for VS Code. Features vectorized inference, asynchronous task management, and 100% offline processing.",
"version": "2.46.0", "version": "2.47.0",
"publisher": "connectailab", "publisher": "connectailab",
"license": "MIT", "license": "MIT",
"icon": "assets/icon.png", "icon": "assets/icon.png",
+80
View File
@@ -281,6 +281,12 @@ export class AgentExecutor {
if (localPathContext) { if (localPathContext) {
contextBlock += `\n\n${localPathContext}`; contextBlock += `\n\n${localPathContext}`;
} }
const recentProjectKnowledgeContext = prompt && loopDepth === 0 && !localPathContext
? this.buildRecentProjectKnowledgeContext(prompt, rootPath)
: '';
if (recentProjectKnowledgeContext) {
contextBlock += `\n\n${recentProjectKnowledgeContext}`;
}
// 2. Setup History // 2. Setup History
if (prompt !== null) { if (prompt !== null) {
@@ -763,6 +769,80 @@ export class AgentExecutor {
&& /\/Volumes\/Data\/project\/Antigravity\/[^\s`"'<>]+/i.test(prompt); && /\/Volumes\/Data\/project\/Antigravity\/[^\s`"'<>]+/i.test(prompt);
} }
private isProjectKnowledgeFollowupRequest(prompt: string): boolean {
return /(아키텍처|구조|조사|분석|설계|흐름|모듈|역할|개선|architecture|structure|design|flow|module|investigate|analy[sz]e)/i.test(prompt);
}
private buildRecentProjectKnowledgeContext(prompt: string, rootPath: string): string {
if (!rootPath || !this.isProjectKnowledgeFollowupRequest(prompt)) {
return '';
}
const recordPath = this.findRecentProjectKnowledgeRecord(rootPath);
if (!recordPath) {
return '';
}
try {
const content = fs.readFileSync(recordPath, 'utf8');
return [
'[RECENT LOCAL PROJECT KNOWLEDGE]',
'The current user request appears to continue a previous local project knowledge discussion.',
`Use this recently generated project knowledge record as project evidence: ${recordPath}`,
'When answering, explicitly say that the analysis is based on the recently generated project knowledge record and local project structure. Do not imply that Second Brain Trace was the only evidence.',
'If deeper architecture detail is needed, recommend reading the concrete source files next instead of asking for the project path again.',
'',
summarizeText(content, 5000)
].join('\n');
} catch (error: any) {
logError('Failed to load recent project knowledge record.', { recordPath, error: error?.message || String(error) });
return '';
}
}
private findRecentProjectKnowledgeRecord(rootPath: string): string | null {
const fromHistory = [...this.chatHistory]
.reverse()
.map((message) => typeof message.content === 'string'
? message.content.match(/\/Volumes\/Data\/project\/Antigravity\/[^\s`"'<>]+_project_knowledge_overview\.md/i)?.[0]
: undefined)
.find(Boolean);
if (fromHistory && fs.existsSync(fromHistory)) {
return fromHistory;
}
const recordsRoot = path.join(rootPath, 'docs', 'records');
if (!fs.existsSync(recordsRoot)) {
return null;
}
const candidates: string[] = [];
const visit = (dir: string, depth: number) => {
if (depth > 5) return;
let entries: fs.Dirent[] = [];
try {
entries = fs.readdirSync(dir, { withFileTypes: true });
} catch {
return;
}
for (const entry of entries) {
const fullPath = path.join(dir, entry.name);
if (entry.isDirectory()) {
if (!entry.name.startsWith('.')) visit(fullPath, depth + 1);
continue;
}
if (/_project_knowledge_overview\.md$/i.test(entry.name)) {
candidates.push(fullPath);
}
}
};
visit(recordsRoot, 0);
return candidates
.filter((file) => fs.existsSync(file))
.sort((a, b) => fs.statSync(b).mtimeMs - fs.statSync(a).mtimeMs)[0] || null;
}
private extractLocalProjectPaths(prompt: string): string[] { private extractLocalProjectPaths(prompt: string): string[] {
const matches = prompt.match(/\/Volumes\/Data\/project\/Antigravity\/[^\s`"'<>]+/gi) || []; const matches = prompt.match(/\/Volumes\/Data\/project\/Antigravity\/[^\s`"'<>]+/gi) || [];
return Array.from(new Set(matches.map((value) => value.replace(/[),.;\]]+$/g, '')))); return Array.from(new Set(matches.map((value) => value.replace(/[),.;\]]+$/g, ''))));
+30
View File
@@ -174,4 +174,34 @@ describe('local project path preflight', () => {
expect(content).toContain('package.json'); expect(content).toContain('package.json');
expect(content).toContain('src/features/game/systems/CombatSystem.ts'); expect(content).toContain('src/features/game/systems/CombatSystem.ts');
}); });
it('uses the latest project knowledge record for architecture follow-up questions without a path', () => {
const context: any = {
globalStorageUri: { fsPath: path.join(root, '.storage') },
workspaceState: stateStore(),
globalState: stateStore()
};
const agent = new AgentExecutor(context) as any;
const recordDir = path.join(root, 'docs', 'records', path.basename(root), 'development');
fs.mkdirSync(recordDir, { recursive: true });
const recordPath = path.join(recordDir, '2026-05-02_project_knowledge_overview.md');
fs.writeFileSync(
recordPath,
[
'# Project Knowledge Overview',
'',
'## Confirmed Structure',
'- `src/agent.ts`: 에이전트 실행 흐름의 중심.',
'- `src/sidebarProvider.ts`: Webview UI를 담당.'
].join('\n'),
'utf8'
);
const followup = agent.buildRecentProjectKnowledgeContext('이젠 아키텍처에 대한 조사도 해주면 좋을 것 같아.', root);
expect(followup).toContain('[RECENT LOCAL PROJECT KNOWLEDGE]');
expect(followup).toContain(recordPath);
expect(followup).toContain('src/agent.ts');
expect(followup).toContain('recently generated project knowledge record');
});
}); });