feat: add knowledge management functionality with CRUD operations and database schema
- Implemented KnowledgeHandler for managing knowledge groups and items, including listing, creating, updating, and deleting operations. - Added database migration scripts to create necessary tables for knowledge management, including knowledge_groups, knowledge_items, knowledge_parse_tasks, and knowledge_chunks_meta. - Introduced prompt_rule_knowledge_groups table to associate prompt rules with knowledge groups.
This commit is contained in:
@@ -54,6 +54,14 @@
|
||||
- The user explicitly asked for i18n and styling discipline during implementation: text should move behind translation keys, and component styles should live in `<style>` blocks rather than inline attributes.
|
||||
- `pnpm dev:admin` regressed temporarily after the route graph referenced a missing `BrandsView.vue`; adding the missing view, installing the new frontend dependency set, and rerunning checks restored the Vite startup path.
|
||||
- `pnpm typecheck:admin` now passes after introducing the i18n scaffold, restoring `AppShell.vue` to the user's preferred version, and removing inline styles from the Vue SFC templates.
|
||||
- The currently used hard-coded prompts are concentrated in four runtime areas: `cmd/dev-seed` platform template seeds, `template_prompt.go` generation fallback sections, `template_assist.go` analyze/title/outline fallback prompts, and `prompt_generate_service.go` plus `knowledge_service.go` prompt supplements.
|
||||
- The seed path stores four full article prompt templates plus twelve wizard prompt templates inside large inline JSON blobs, which makes prompt iteration awkward and easy to miss during later tuning.
|
||||
- Runtime prompt assembly still embeds section titles, writing rules, output requirements, output examples, and knowledge-reference instructions directly inside application functions.
|
||||
- A dedicated prompt hub now exists under `server/internal/tenant/prompts/`: `template_seeds.go` owns the four platform template seeds and their wizard prompt templates, while `runtime.go` owns generation fallback prompts, assist fallback prompts, prompt-rule supplements, and knowledge prompt instructions.
|
||||
- `cmd/dev-seed` now reads platform templates from `prompts.PlatformTemplateSeeds()` instead of carrying 400+ lines of inline prompt/card-config text in the command itself.
|
||||
- `template_prompt.go`, `template_assist.go`, `prompt_generate_service.go`, and `knowledge_service.go` now assemble prompts from the centralized prompt package, so runtime business logic no longer embeds the long prompt text directly.
|
||||
- The prompt centralization also corrected invalid JSON quoting in the seed card config `custom_placeholder` fields, which previously contained unescaped inner quotes.
|
||||
- Targeted verification passed with `go test ./internal/tenant/... ./cmd/dev-seed` from `server/`, confirming the refactor compiles cleanly across the affected runtime and seed paths.
|
||||
|
||||
## Technical Decisions
|
||||
| Decision | Rationale |
|
||||
@@ -69,6 +77,7 @@
|
||||
| Use screenshot-derived spatial structure as an implementation constraint | Needed to satisfy the user's requirement to follow layout and placement, not just labels |
|
||||
| Introduce a minimal `vue-i18n` foundation now instead of leaving hard-coded strings in new pages | The user explicitly called out the current i18n approach as non-standard |
|
||||
| Keep `AppShell.vue` on the user-preferred version and avoid structural/style rewrites there | The user said that file is managed elsewhere and only allowed inline-style cleanup |
|
||||
| Create a dedicated `internal/tenant/prompts` package for prompt text and seed definitions | This keeps prompt tuning in one place while minimizing refactor risk in the current dirty worktree |
|
||||
|
||||
## Issues Encountered
|
||||
| Issue | Resolution |
|
||||
|
||||
Reference in New Issue
Block a user