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:
2026-04-05 17:14:13 +08:00
parent 134dd063c3
commit 446f865cdf
62 changed files with 9503 additions and 2664 deletions
+34
View File
@@ -1,5 +1,39 @@
# Progress Log
## Session: 2026-04-04
### Phase 13: Prompt Centralization
- **Status:** complete
- Actions taken:
- Read the current planning files and reopened repository context for the new prompt-centralization request.
- Searched runtime and seed paths for all currently used hard-coded prompts instead of only matching the obvious template seed strings.
- Confirmed the prompt surface spans template seeds, template generation fallback prompts, template assist fallback prompts, prompt-rule generation supplements, and knowledge prompt injection.
- Added a dedicated `server/internal/tenant/prompts` package to centralize platform template seed prompts and runtime prompt fragments.
- Refactored `cmd/dev-seed`, `template_prompt.go`, `template_assist.go`, `prompt_generate_service.go`, and `knowledge_service.go` to read prompt text from the new package.
- Corrected invalid JSON quoting in the seed `custom_placeholder` fields while moving the template card-config blobs.
- Files created/modified:
- `task_plan.md` (updated)
- `findings.md` (updated)
- `progress.md` (updated)
- `server/internal/tenant/prompts/runtime.go` (created)
- `server/internal/tenant/prompts/template_seeds.go` (created)
- `server/cmd/dev-seed/main.go` (updated)
- `server/internal/tenant/app/template_prompt.go` (updated)
- `server/internal/tenant/app/template_assist.go` (updated)
- `server/internal/tenant/app/prompt_generate_service.go` (updated)
- `server/internal/tenant/app/knowledge_service.go` (updated)
### Phase 14: Prompt Verification & Delivery
- **Status:** complete
- Actions taken:
- Ran `gofmt` across all changed Go files after the prompt extraction.
- Re-scanned the runtime and seed callers to confirm the long prompt literals were removed from business functions and now only live under `server/internal/tenant/prompts`.
- Ran `go test ./internal/tenant/... ./cmd/dev-seed` from `server/` and confirmed the affected packages compile and tests pass.
- Files created/modified:
- `task_plan.md` (updated)
- `findings.md` (updated)
- `progress.md` (updated)
## Session: 2026-03-31
### Phase 10: Interface Coverage Audit & Visual Mapping