feat: LLM narrator/explainer + guide via chattydeer with DB-backed model config (schema v22)#64
feat: LLM narrator/explainer + guide via chattydeer with DB-backed model config (schema v22)#64
Conversation
Agent-Logs-Url: https://github.com/jsilvanus/gitsema/sessions/4539623d-376d-41b2-99f6-72a14cfe3a9e Co-authored-by: jsilvanus <22452468+jsilvanus@users.noreply.github.com>
Agent-Logs-Url: https://github.com/jsilvanus/gitsema/sessions/4539623d-376d-41b2-99f6-72a14cfe3a9e Co-authored-by: jsilvanus <22452468+jsilvanus@users.noreply.github.com>
|
@copilot in narrator mcp, also the agent calling the mcp could be the narrator if given all relevant info. Add an option for command to return evidence instead of narrated info. Same for explain. Make evidence-only the default. Also, I'd want to add gitsema guide, a pratical LLM chat where gitsema agent answers questions and even does the tool calls. Please move gitsema models narrator-xxx into argument --narrator, and add a --guide argument for guide usage. Enable http api (open Ai style) and chattydeer style function call execution for the chat. If chattydeer needs more functionalities, just write a plan for thst, I will develop that. Write. A contract that you want fulfilled, I will fulfill it. |
…uide HTTP route, chattydeer contract Agent-Logs-Url: https://github.com/jsilvanus/gitsema/sessions/c93ecd61-9000-45c1-b32f-2ac61e99b4c2 Co-authored-by: jsilvanus <22452468+jsilvanus@users.noreply.github.com>
Done in bb71f70. Here's what changed: Evidence-only mode (now the default):
|
Adds
gitsema narrate,gitsema explain, andgitsema guidecommands backed by@jsilvanus/chattydeer. Narrator and guide model configs are stored in theembed_configtable (viakind='narrator'/kind='guide') and managed through the unifiedgitsema modelssystem.Dependency changes
@jsilvanus/embedeer→^1.3.2@jsilvanus/chattydeer@^0.2.0addedSchema v22
embed_config.kind TEXT DEFAULT 'embedding'— distinguishesembedding,narrator, andguideconfigsembed_config.params_json TEXT— narrator/guide params (httpUrl,apiKey,maxTokens,temperature)settingstable — key-value store for active selections (active_narrator_model_config_id,active_guide_model_config_id)Narrator module (
src/core/narrator/)ChattydeerNarratorProvider— adapter over chattydeer'sExplainer; builds a customgenerateFnthat hits any OpenAI-compatible/v1/chat/completionsendpointgitsema narrate/gitsema explainand the MCP tools return raw classified commits as structured JSON by default, enabling the calling agent to narrate itself. Pass--narrate(CLI) orevidence_only: false(MCP) to invoke the LLM.redact.ts) — 10 secret patterns applied before every outbound payload[llm_audit]entries; never contains prompt/response textgit log, batches 100 commits → LLM → mergesCLI surface
Resolution order for narrator provider:
--narrator-model-id→--model→ active DB setting → disabled (safe-by-default).HTTP / MCP parity
POST /api/v1/narrate,POST /api/v1/explain— respond with{ prose, commitCount, citations[], redactedFields[], llmEnabled, format, evidence? }POST /api/v1/guide/chat— OpenAI-style single-turn Q&A with repo contextnarrate_repo(defaultevidence_only: true),explain_issue_or_error(defaultevidence_only: true)chattydeer contract
docs/chattydeer_contract.md— formal API contract forChatSession,ChatCompletionProvider,AgentLoop, and an OpenAI pass-through handler needed in@jsilvanus/chattydeer >= 0.3.0to enable full function-call / tool-call execution ingitsema guide. Includes the complete gitsema tool registry to be exposed as function calls.Tests
43 new tests across three files: redaction pattern coverage (
narratorRedact), DB config CRUD + active selection (narratorConfig), CLI handler shape invariants with mock provider (narratorSmoke). All 787 tests pass.Docs
docs/plan_LLM.md— full spec (goals, API surface, pipeline, security model, schema)docs/chattydeer_contract.md— interface contract for@jsilvanus/chattydeerv0.3.0+CLAUDE.mdschema table updated to v22Original prompt
Create a PR in
jsilvanus/gitsemato implement the Review7 LLM narrator/explainer integration using thechattydeernpm package.Key requirements:
Dependency updates
@jsilvanus/embedeerdependency to the latest version (as of 2026-04-09, latest release tag is v1.3.2).@jsilvanus/chattydeer(chattydeer is the split-out chat completions/explainer package). Use the latest version fromjsilvanus/chattydeer(package.json currently shows version 0.2.0; verify during implementation).Implement narrator/explainer feature
gitsema narrate(repo development history narrative)gitsema explain(bug/error history explainer)chattydeerfor LLM narration/explainer functionality (do not keep legacy embedeer explainer path).Planning doc
docs/plan_LLM.md(create/update this file) before or alongside the implementation. The plan should include:Testing
Implementation notes:
jsilvanus/embedeerandjsilvanus/chattydeerrepositories to understand APIs.Deliverable:
maintitled:feat: add LLM narrator/explainer via chattydeer.The following is the prior conversation context from the user's chat exploration (may be truncated):
Assistant: I can’t delegate an agent run from this message (I don’t have access to start automated repo work right now).
If you want to proceed anyway, I can write a PR-ready implementation plan (schema migration steps + exact type changes + status output spec + tests) that you can hand to whoever is doing the changes, and we can kick off the agent as soon as automation is available again.
Two quick confirmations so the plan matches the repo reality:
blob_hashusually the Git blob OID, except for module results where it becomes"module:..."?module_embeddingstable), or do you prefer “modules are just groups of blobs” and only compute module vectors on the fly?Assistant: Understood! Let me know if you want me to reattempt delegating the agent to handle those changes, or if you'd like to adjust the scope or requirements before proceeding.
User: Delegate agent to change the index command as described
Assistant: I can’t delegate an agent or open a PR right now (I don’t have repo-automation access in this turn).
If you confirm the two details below, I’ll write a ready-to-implement change spec (CLI UX, DB migration, and test plan) that you or your automation can apply immediately:
gitsema index start(preferred) orgitsema index run?--allrefs (branches + tags), or only fromHEADby default (with a flag to switch to--all)?Assistant: The coding agent has started working on updating the
indexcommand UX injsilvanus/gitsemato make it status-first and multi-model aware. Key changes include:gitsema indexwill now display the status of indexed content (without running indexing).gitsema index start(orgitsema index run) will explicitly start indexing.blob_hashmisuse for modules.You’ll be notified when the pull request is ready! Let me know if further adjustments are needed.
User: Please read plan.md. Delegate an agent to do new phases (70-). Npm minor in between. In the end, update plan.md. Then fix parity errors in the test. Finally, npm version patch. Please report progress in between the phases.
Assistant: I can’t delegate an agent or read
plan.mdfrom the repo in this turn due to a temporary limitation on running repo actions.If you paste the contents (or at least the “Phases 70+” section) of
plan.md/docs/plan.mdhere, I’ll immediately:npm version minorafter each phase,This pull request was created from Copilot chat.