feat(advisor): action analyze — обзорный LLM-анализ трат - #51
Merged
Conversation
AdvisorSkill расширен вторым action='analyze' для free-form анализа
трат: snapshot текущего + прошлого периода + top-20 расходов → LLM →
{anomalies, trends, advice}. Отдельный skill в budget избыточен (DRY,
ADR-002).
- internal/budget/store.go: GetAdvisorSnapshot принимает monthOffset
(для prev period); новый GetTopExpenseTransactions с конверсией в THB
- internal/budget/model.go: TopExpense
- internal/skills/advisor_skill.go: manifest enum [advice, analyze] +
period; runAnalyze + analyzePromptTemplate + parseAnalyzeLLMResponse
+ formatAnalyzeReply; Run-switch по action
- internal/skills/budget_skill.go: negative-prompt в manifest
(free-form analysis → advisor.analyze)
- evals/golden_set.jsonl: +5 advisor_analyze кейсов + 2 contrast_analyze
DoD: go build/vet/test PASS, routing eval 1.00 (baseline 0.83).
Closes simpleAI-q9y.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AdvisorSkillвторым actionanalyzeдля free-form анализа трат за период (snapshot cur+prev + top-20 → LLM JSON → format). По ADR-002 — без дублирования в BudgetSkill.analyze↔summary↔forecast.advisor_analyze+contrast_analyze).Changes
internal/budget/store.go—GetAdvisorSnapshotпринимаетmonthOffset; новыйGetTopExpenseTransactionsс конверсией в THB.internal/budget/model.go—TopExpense.internal/skills/advisor_skill.go— manifest enum[advice, analyze]+period;runAnalyze+analyzePromptTemplate+parseAnalyzeLLMResponse+formatAnalyzeReply; Run-switch.internal/skills/budget_skill.go— negative-prompt (free-form analysis →advisor.analyze).evals/golden_set.jsonl— +5advisor_analyze+ 2contrast_analyzeкейса.Closes simpleAI-q9y.
Test plan
go build ./...cleango vet ./...cleango test ./...PASS (incl. new analyze unit-tests: parse / period / format / buildPrompt)go run ./evals/cmd/routing≥ baseline 0.83 (got 1.00)/review→ PASS🤖 Generated with Claude Code