feat: add TraitsTab component for managing agent traits
Some checks failed
CI / build-and-test (push) Failing after -32m5s

- Implemented TraitsTab.svelte to handle CRUD operations for agent traits.
- Integrated grid for displaying traits with context menu actions for add, edit, and delete.
- Added trait instruction editing functionality with a dedicated editor.
- Updated AdminShell to include PersonasPage for navigation.
- Enhanced AppSidebar with a new entry for Personas.
- Extended ShellPage type to include 'personas'.
- Defined new types for AgentPersona, AgentPart, and AgentTrait in types.ts.
This commit is contained in:
2026-05-05 14:51:58 +02:00
parent e285a03639
commit 9230f39cb6
48 changed files with 6979 additions and 2240 deletions

View File

@@ -0,0 +1,20 @@
Completed personas UI reachability and fixed the missing backend ResolveSpec registrations that blocked it.
- Added Personas navigation/page wiring in the Svelte admin shell.
- Added a personas overview page with tabs for personas, parts, and traits.
- Expanded the persona inspector to load linked parts, traits, skills, guardrails, and arc state.
- Found that `/api/rs/public/agent_parts` and related persona routes were missing because `internal/app/resolvespec_admin.go` manually whitelists ResolveSpec models.
- Registered persona-related ResolveSpec models: `agent_personas`, `agent_parts`, `agent_traits`, persona join tables, arc tables, and `persona_arc`.
- Allowed ResolveSpec mutations for `agent_personas`, `agent_parts`, and `agent_traits`.
- Verified the `internal/app` package still compiles with `env GOCACHE=/tmp/amcs-go-cache go test -run '^$' ./internal/app`.
Follow-up:
- Automated ResolveSpec model registration generation with `relspec templ`.
- Added `scripts/templates/resolvespec_models.tmpl`.
- Updated `scripts/generate-models.sh` to generate `internal/app/resolvespec_models_generated.go`.
- Removed the handwritten `resolveSpecModels()` from `internal/app/resolvespec_admin.go`.
- Extended `scripts/patch-generated-models.sh` to fix current relspec output quirks:
- incorrect `persona_arc` primary-key cast
- unused `resolvespec_common` imports in join-table models
- Added focused tests covering persona entity presence and persona mutation allowlisting.

View File

@@ -0,0 +1,15 @@
Fixed the Gitea build break caused by `go:embed` requiring `internal/app/ui/dist` to exist in a clean checkout.
Changes made:
- Added `internal/app/ui/dist/placeholder.txt` so the embedded UI directory is always present in source control.
- Updated `internal/mcpserver/server_test.go` to derive expected tool names from `BuildToolCatalog()` instead of a stale hard-coded list.
- Removed stale maintenance tool entries from `internal/mcpserver/server.go` because those tools are not currently registered.
Verification:
- `env GOCACHE=/tmp/go-build go test ./internal/mcpserver -run TestNewListsAllRegisteredTools -v` passes.
- A broader `go test ./internal/app ./cmd/amcs-server` compile check was started, but it did not finish before this log entry was written.
Migration follow-up:
- Fixed `migrations/020_generated_schema.sql` after PostgreSQL failed with `operator does not exist: name[] = text[]`.
- Root cause: `pg_attribute.attname` is type `name`, so `ARRAY(SELECT a.attname ...)` produced `name[]`, which was compared against `text[]` literals.
- Updated each repeated primary-key introspection block to use `SELECT a.attname::text`, keeping the existing `ARRAY[]::text[]` and `ARRAY['id']` / `ARRAY['persona_id']` comparisons valid.