From 9c242a5b8d27c78c4b1e528bb57066a19d93f554 Mon Sep 17 00:00:00 2001 From: g1nation Date: Sun, 3 May 2026 20:25:37 +0900 Subject: [PATCH] Version 2.53.0 Release: Thinking Partner Protocol and Context-Aware Chronicle --- package.json | 2 +- src/features/projectChronicle/guardPrompt.ts | 4 ++ src/sidebarProvider.ts | 52 ++++++++++++++++++-- src/utils.ts | 5 ++ 4 files changed, 58 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 9ce83b7..14cc72e 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "g1nation", "displayName": "G1nation", "description": "High-performance autonomous local AI coding agent for VS Code. Features vectorized inference, asynchronous task management, and 100% offline processing.", - "version": "2.52.0", + "version": "2.53.0", "publisher": "connectailab", "license": "MIT", "icon": "assets/icon.png", diff --git a/src/features/projectChronicle/guardPrompt.ts b/src/features/projectChronicle/guardPrompt.ts index 4c6847c..0b80940 100644 --- a/src/features/projectChronicle/guardPrompt.ts +++ b/src/features/projectChronicle/guardPrompt.ts @@ -52,6 +52,10 @@ export function buildProjectChronicleGuardContext(project: ProjectProfile | null '', 'Tone and scope:', '- Be practical and plain-spoken.', + '- For architecture, design, and direction questions, be a thinking partner rather than a generic advisor.', + '- Start with a clear verdict. Then separate confirmed facts, inferences, concerns, decision forks, and next action.', + '- Do not only say the direction is good. Say what is strong, what is weak, what is missing, and what decision would make the project clearer.', + '- If the user is using the tool to organize their thinking, reflect the shape of their uncertainty and turn it into 1-2 concrete choices.', '- Keep the top conclusion calm and short so the user can understand the answer before reading the long version.', '- Prefer short paragraphs with blank lines between numbered sections. Avoid starting most lines with `*` or `-` bullets.', '- Use visible markdown headings such as `## 간단 요약`, `## 요청 요약`, `## 상세 답변`, and `## 추가 조언` for major sections.', diff --git a/src/sidebarProvider.ts b/src/sidebarProvider.ts index b617b47..d985775 100644 --- a/src/sidebarProvider.ts +++ b/src/sidebarProvider.ts @@ -1483,12 +1483,12 @@ export class SidebarChatProvider implements vscode.WebviewViewProvider, BridgeIn } private async _autoWriteChronicleAfterPrompt() { - const profile = this._getActiveChronicleProject(); - if (!profile) return; - const history = this._agent.getHistory(); const latestUser = [...history].reverse().find(message => message.role === 'user')?.content || ''; const latestAssistant = [...history].reverse().find(message => message.role === 'assistant')?.content || ''; + const profile = this._getChronicleProjectForConversation(latestUser) || this._getActiveChronicleProject(); + if (!profile) return; + const recordType = this._inferAutoChronicleRecordType(latestUser, latestAssistant); if (!recordType) return; @@ -1573,12 +1573,56 @@ export class SidebarChatProvider implements vscode.WebviewViewProvider, BridgeIn this._chronicle.appendTimeline(profile, [`Auto ${recordType} record created: ${result.relativePath}`], createdAt); await this._context.globalState.update(SidebarChatProvider.lastAutoChronicleSignatureStateKey, signature); await this._sendChronicleRecords(); - this.injectSystemMessage(`**[Chronicle Auto Saved]** ${recordType} · \`${result.filePath}\``); + vscode.window.setStatusBarMessage(`G1nation: Chronicle auto-saved ${recordType}`, 3500); } catch (err: any) { logError('Automatic Chronicle record write failed.', { error: err?.message || String(err), recordType }); } } + private _getChronicleProjectForConversation(text: string): ProjectProfile | null { + const projectPath = this._extractLocalProjectPath(text); + if (!projectPath) return null; + + const projects = this._getChronicleProjects(); + const resolvedPath = path.resolve(projectPath); + const existing = projects.find(project => { + const root = project.projectRoot ? path.resolve(project.projectRoot) : ''; + const recordRoot = path.resolve(project.recordRoot); + return root === resolvedPath || recordRoot.startsWith(`${resolvedPath}${path.sep}`); + }); + if (existing) return existing; + + const projectName = path.basename(resolvedPath) || 'Current Project'; + const now = new Date().toISOString(); + return { + projectId: this._slugify(projectName), + projectName, + projectRoot: resolvedPath, + recordRoot: path.join(resolvedPath, 'docs', 'records', projectName), + description: 'Auto-detected from the local project path in the conversation.', + corePurpose: 'Capture project direction, architecture discussion, decisions, and development notes as Markdown.', + targetUsers: ['Project developer'], + avoidDirections: ['Do not mix records across projects.'], + detailLevel: 'standard', + createdAt: now, + updatedAt: now + }; + } + + private _extractLocalProjectPath(text: string): string | null { + const match = text.match(/\/Volumes\/Data\/project\/Antigravity\/[^\s`"'<>]+/i); + if (!match) return null; + const candidate = match[0].replace(/[.,;:)\]]+$/, ''); + try { + if (fs.existsSync(candidate) && fs.statSync(candidate).isDirectory()) { + return candidate; + } + } catch { + return null; + } + return null; + } + private _inferAutoChronicleRecordType(userText: string, assistantText: string): 'planning' | 'discussion' | 'decision' | 'development' | 'bug' | null { const combined = `${userText}\n${assistantText}`; if (!combined.trim()) return null; diff --git a/src/utils.ts b/src/utils.ts index 2216b09..89681d0 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -161,6 +161,11 @@ Core behavior: - Do not force this structure for tiny factual replies, quick confirmations, or one-line operational updates. - For product ideas, feature proposals, and architecture discussions, narrow the direction before expanding it. Prefer a practical MVP first, then separate later expansion ideas. - Avoid inflated consulting language. Use concrete engineering tradeoffs, dependency risk, and next decisions instead. +- For design, architecture, product direction, or "what do you think?" questions, act as a thinking partner, not a cheerleader. +- Give an opinionated verdict first. Then explain: what is confirmed, what is only an inference, what worries you, what choice the user is really facing, and what you would do next. +- Do not give merely pleasant guidance such as "좋은 방향입니다" without a concrete reason, risk, or decision fork. +- Help the user organize their thinking. Name the user's likely intent, the hidden tradeoff, and the next small decision that would reduce confusion. +- If the user sounds unsure or discouraged, reassure them briefly, then return to concrete diagnosis. Do not imply the issue is the user's intelligence. - Do not use grand labels like "final execution mandate", "engineering standard", "knowledge distiller", or "Antigravity's yardstick" unless the user explicitly asks for that style. - No Evidence, No Project Claim: do not state that the current project has a technical structure unless it is supported by user-provided facts, source code, design docs, project docs, or project records. - Even if Second Brain provides a general concept note, do not describe that concept as actually implemented in the current project. General concept notes are not project evidence.