diff --git a/.ai/product/feature-spec/README.md b/.ai/product/feature-spec/README.md index 5904fb3..dddd3dc 100644 --- a/.ai/product/feature-spec/README.md +++ b/.ai/product/feature-spec/README.md @@ -37,6 +37,7 @@ | [ops-feed-slot.md](ops-feed-slot.md) | OpsCMS FeedSlot | §7 | `admin-h5` `/cms` · `GET /admin/cms/feed-slots*` | Ops-D · **ECR-025 Closed** | | [ops-scheduled-publication.md](ops-scheduled-publication.md) | OpsCMS ScheduledPublication | §7 | `GET /admin/cms/publications*` | Ops-D · **ECR-026 Closed** | | [ops-knowledge-chunk.md](ops-knowledge-chunk.md) | AICoreConfig KnowledgeChunk | §7 | `GET /admin/ai/knowledge-chunks*` | Ops-D · **ECR-027 Closed** | +| [ops-tool-definition.md](ops-tool-definition.md) | AICoreConfig ToolDefinition | §7 | `GET /admin/ai/tools*` | Ops-D · **ECR-028 Closed** | 新功能:复制 `_TEMPLATE.md` → 填满 → 在本表登记 → 再编码。 diff --git a/.ai/product/feature-spec/ops-tool-definition.md b/.ai/product/feature-spec/ops-tool-definition.md new file mode 100644 index 0000000..bdabaea --- /dev/null +++ b/.ai/product/feature-spec/ops-tool-definition.md @@ -0,0 +1,41 @@ +# Feature Spec: AICoreConfig · ToolDefinition(Ops · ECR-028) + +> Status: `Active`(Loop continuous · **ECR-028 Closed**) +> Parent: WAVE0-FROZEN · Predecessor: ECR-027 Closed +> Capability: `AICoreConfig` · BC: `Ask_Ops` +> 授权:`docs/WAVE0/LOOP_AUTHORIZATION.md` + +## Non-goals + +工具在线编辑 · 运行时绑定 · UGC · 真支付 + +## L2 Domain + +| 概念 | 语义 | +|------|------| +| `ToolDefinition` | 本切片只读目录;code 唯一(若适用) | + +## L3 API + +| Method | Path | 权限 | 语义 | +|--------|------|------|------| +| GET | `/admin/ai/tools` | `admin.ai_config.read` | 只读 | +| GET | `/admin/ai/tools/{id}` | `admin.ai_config.read` | 只读 | + +## Migration + +`000029`:表 + 种子(若有)(权限复用) + +## L4 AC + +| ID | Then | +|----|------| +| AC-F-01 | list 含种子或空列表合法 | +| AC-F-02 | 已知 id get 200 | +| AC-F-03 | 未知 id → 404 | +| AC-S-01 | 无 Admin → 401 | +| AC-S-02 | 无权限 → 403 | +| AC-P-01 | list < 500ms | +| AC-O-01 | N/A 只读 | + +contract_diff: `docs/CONTRACT_DIFF/ECR-028.yaml` diff --git a/apps/admin-h5/src/api/client.ts b/apps/admin-h5/src/api/client.ts index d99139c..3d99863 100644 --- a/apps/admin-h5/src/api/client.ts +++ b/apps/admin-h5/src/api/client.ts @@ -445,6 +445,10 @@ export const adminApi = { request<{ items: Array> }>('GET', '/ai/knowledge-chunks'), knowledgeChunk: (id: string) => request>('GET', `/ai/knowledge-chunks/${id}`), + tools: () => + request<{ items: Array> }>('GET', '/ai/tools'), + tool: (id: string) => + request>('GET', `/ai/tools/${id}`), orders: () => request<{ items: Array<{ diff --git a/apps/api/internal/handler/admin.go b/apps/api/internal/handler/admin.go index 8a84691..82739ad 100644 --- a/apps/api/internal/handler/admin.go +++ b/apps/api/internal/handler/admin.go @@ -56,6 +56,7 @@ func (h *AdminHandler) Register(api *gin.RouterGroup) { h.registerCMS(authed) h.registerCMSPublications(authed) h.registerKnowledgeChunks(authed) + h.registerToolDefinitions(authed) } func (h *AdminHandler) Login(c *gin.Context) { diff --git a/apps/api/internal/handler/admin_tool_definition.go b/apps/api/internal/handler/admin_tool_definition.go new file mode 100644 index 0000000..8fa8fba --- /dev/null +++ b/apps/api/internal/handler/admin_tool_definition.go @@ -0,0 +1,46 @@ +package handler + +import ( + "errors" + "net/http" + + "github.com/gin-gonic/gin" + "github.com/google/uuid" + + "github.com/yuxingu/digital-psychology/apps/api/internal/middleware" + "github.com/yuxingu/digital-psychology/apps/api/internal/service/admin" + "github.com/yuxingu/digital-psychology/apps/api/pkg/response" +) + +func (h *AdminHandler) registerToolDefinitions(authed *gin.RouterGroup) { + g := authed.Group("/ai") + g.GET("/tools", middleware.RequireAdminPermission(h.Svc, admin.PermAIConfigRead), h.ListToolDefinitions) + g.GET("/tools/:id", middleware.RequireAdminPermission(h.Svc, admin.PermAIConfigRead), h.GetToolDefinition) +} + +func (h *AdminHandler) ListToolDefinitions(c *gin.Context) { + items, err := h.Svc.ListToolDefinitions(c.Request.Context()) + if err != nil { + response.Fail(c, http.StatusInternalServerError, 50050, "list tool-definition failed") + return + } + response.OK(c, gin.H{"items": items}) +} + +func (h *AdminHandler) GetToolDefinition(c *gin.Context) { + id, err := uuid.Parse(c.Param("id")) + if err != nil { + response.Fail(c, http.StatusBadRequest, 40002, "invalid id") + return + } + row, err := h.Svc.GetToolDefinition(c.Request.Context(), id) + if errors.Is(err, admin.ErrToolDefinitionNotFound) { + response.Fail(c, http.StatusNotFound, 40420, "tool-definition not found") + return + } + if err != nil { + response.Fail(c, http.StatusInternalServerError, 50051, "get tool-definition failed") + return + } + response.OK(c, row) +} diff --git a/apps/api/internal/integration/tool_definition_test.go b/apps/api/internal/integration/tool_definition_test.go new file mode 100644 index 0000000..99e28b7 --- /dev/null +++ b/apps/api/internal/integration/tool_definition_test.go @@ -0,0 +1,88 @@ +package integration_test + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + "testing" + "time" + + "github.com/google/uuid" + "golang.org/x/crypto/bcrypt" +) + +func TestAICoreToolDefinitions(t *testing.T) { + r, pool := setupAPIPool(t) + ctx := context.Background() + tok := adminLogin(t, r, "admin", "change-me") + + _, code := doAdminJSON(t, r, http.MethodGet, "/api/v1/admin/ai/tools", nil, "") + if code != http.StatusUnauthorized { + t.Fatalf("expected 401, got %d", code) + } + + limitedRoleID := uuid.New() + _, err := pool.Exec(ctx, `INSERT INTO admin_roles(id, name, system) VALUES ($1,$2,false)`, + limitedRoleID, "lim_"+limitedRoleID.String()[:8]) + if err != nil { + t.Fatal(err) + } + _, err = pool.Exec(ctx, `INSERT INTO admin_role_permissions(role_id, code) VALUES ($1,'admin.users.read')`, limitedRoleID) + if err != nil { + t.Fatal(err) + } + hash, err := bcrypt.GenerateFromPassword([]byte("limited-pass"), bcrypt.DefaultCost) + if err != nil { + t.Fatal(err) + } + limUser := fmt.Sprintf("lim_%d", time.Now().UnixNano()) + _, err = pool.Exec(ctx, `INSERT INTO admin_accounts(username, password_hash, role_id) VALUES ($1,$2,$3)`, + limUser, string(hash), limitedRoleID) + if err != nil { + t.Fatal(err) + } + t.Cleanup(func() { + _, _ = pool.Exec(ctx, `DELETE FROM admin_accounts WHERE username=$1`, limUser) + _, _ = pool.Exec(ctx, `DELETE FROM admin_roles WHERE id=$1`, limitedRoleID) + }) + limTok := adminLogin(t, r, limUser, "limited-pass") + _, code = doAdminJSON(t, r, http.MethodGet, "/api/v1/admin/ai/tools", nil, limTok) + if code != http.StatusForbidden { + t.Fatalf("expected 403, got %d", code) + } + + start := time.Now() + env, code := doAdminJSON(t, r, http.MethodGet, "/api/v1/admin/ai/tools", nil, tok) + if code != 200 || env.Code != 0 { + t.Fatalf("list http=%d msg=%s", code, env.Message) + } + if time.Since(start) > 500*time.Millisecond { + t.Fatalf("list too slow %v", time.Since(start)) + } + var list struct { + Items []struct { + ID string `json:"id"` + Code string `json:"code"` + } `json:"items"` + } + _ = json.Unmarshal(env.Data, &list) + var id string + for _, it := range list.Items { + if it.Code == "fetch_profile_summary" { + id = it.ID + break + } + } + if id == "" { + t.Fatalf("missing fetch_profile_summary: %#v", list.Items) + } + env, code = doAdminJSON(t, r, http.MethodGet, "/api/v1/admin/ai/tools/"+id, nil, tok) + if code != 200 { + t.Fatalf("get %d", code) + } + _, code = doAdminJSON(t, r, http.MethodGet, "/api/v1/admin/ai/tools/"+fakeUUID(), nil, tok) + if code != http.StatusNotFound { + t.Fatalf("expected 404, got %d", code) + } +} diff --git a/apps/api/internal/repository/tool_definition_repo.go b/apps/api/internal/repository/tool_definition_repo.go new file mode 100644 index 0000000..901247a --- /dev/null +++ b/apps/api/internal/repository/tool_definition_repo.go @@ -0,0 +1,58 @@ +package repository + +import ( + "context" + "errors" + "time" + + "github.com/google/uuid" + "github.com/jackc/pgx/v5" +) + +// ToolDefinitionRow is ToolDefinition catalog row. +type ToolDefinitionRow struct { + ID uuid.UUID `json:"id"` + Code string `json:"code"` + Title string `json:"title"` + Description *string `json:"description,omitempty"` + Active bool `json:"active"` + System bool `json:"system"` + UpdatedAt time.Time `json:"updated_at"` +} + +// ListToolDefinitions returns ToolDefinition catalog. +func (r *AdminRepo) ListToolDefinitions(ctx context.Context) ([]ToolDefinitionRow, error) { + rows, err := r.Pool.Query(ctx, ` + SELECT id, code, title, description, active, system, updated_at + FROM tool_definitions + ORDER BY active DESC, code ASC`) + if err != nil { + return nil, err + } + defer rows.Close() + var out []ToolDefinitionRow + for rows.Next() { + var row ToolDefinitionRow + if err := rows.Scan(&row.ID, &row.Code, &row.Title, &row.Description, &row.Active, &row.System, &row.UpdatedAt); err != nil { + return nil, err + } + out = append(out, row) + } + return out, rows.Err() +} + +// GetToolDefinition loads one by id. +func (r *AdminRepo) GetToolDefinition(ctx context.Context, id uuid.UUID) (*ToolDefinitionRow, error) { + var row ToolDefinitionRow + err := r.Pool.QueryRow(ctx, ` + SELECT id, code, title, description, active, system, updated_at + FROM tool_definitions WHERE id=$1`, id, + ).Scan(&row.ID, &row.Code, &row.Title, &row.Description, &row.Active, &row.System, &row.UpdatedAt) + if errors.Is(err, pgx.ErrNoRows) { + return nil, err + } + if err != nil { + return nil, err + } + return &row, nil +} diff --git a/apps/api/internal/service/admin/tool_definition.go b/apps/api/internal/service/admin/tool_definition.go new file mode 100644 index 0000000..b513465 --- /dev/null +++ b/apps/api/internal/service/admin/tool_definition.go @@ -0,0 +1,34 @@ +package admin + +import ( + "context" + "errors" + + "github.com/google/uuid" + "github.com/jackc/pgx/v5" + + "github.com/yuxingu/digital-psychology/apps/api/internal/repository" +) + +var ErrToolDefinitionNotFound = errString("tool definition not found") + +// ListToolDefinitions returns catalog. +func (s *Service) ListToolDefinitions(ctx context.Context) ([]repository.ToolDefinitionRow, error) { + items, err := s.Repo.ListToolDefinitions(ctx) + if err != nil { + return nil, err + } + if items == nil { + items = []repository.ToolDefinitionRow{} + } + return items, nil +} + +// GetToolDefinition loads one. +func (s *Service) GetToolDefinition(ctx context.Context, id uuid.UUID) (*repository.ToolDefinitionRow, error) { + row, err := s.Repo.GetToolDefinition(ctx, id) + if errors.Is(err, pgx.ErrNoRows) { + return nil, ErrToolDefinitionNotFound + } + return row, err +} diff --git a/apps/api/migrations/000029_tool_definitions.down.sql b/apps/api/migrations/000029_tool_definitions.down.sql new file mode 100644 index 0000000..16c5a71 --- /dev/null +++ b/apps/api/migrations/000029_tool_definitions.down.sql @@ -0,0 +1 @@ +DROP TABLE IF EXISTS tool_definitions; diff --git a/apps/api/migrations/000029_tool_definitions.up.sql b/apps/api/migrations/000029_tool_definitions.up.sql new file mode 100644 index 0000000..acf3a37 --- /dev/null +++ b/apps/api/migrations/000029_tool_definitions.up.sql @@ -0,0 +1,18 @@ +-- ECR-028 ToolDefinition (read catalog) + +CREATE TABLE IF NOT EXISTS tool_definitions ( + id uuid PRIMARY KEY DEFAULT gen_random_uuid(), + code varchar(64) NOT NULL UNIQUE, + title varchar(128) NOT NULL, + description text NULL, + active boolean NOT NULL DEFAULT true, + system boolean NOT NULL DEFAULT false, + created_at timestamptz NOT NULL DEFAULT now(), + updated_at timestamptz NOT NULL DEFAULT now() +); + +CREATE INDEX IF NOT EXISTS idx_tool_definitions_active ON tool_definitions(active); + +INSERT INTO tool_definitions(code, title, description, active, system) +VALUES ('fetch_profile_summary', '拉取档案摘要', '只读工具定义占位', true, true) +ON CONFLICT (code) DO NOTHING; diff --git a/docs/BACKEND_DESIGN/BD-2026-028-tool-definition.md b/docs/BACKEND_DESIGN/BD-2026-028-tool-definition.md new file mode 100644 index 0000000..0fcca4f --- /dev/null +++ b/docs/BACKEND_DESIGN/BD-2026-028-tool-definition.md @@ -0,0 +1,23 @@ +# Backend Design: ECR-028 ToolDefinition + +| ID | BD-2026-028 | +| Status | Approved | +| Coding | Loop authorized | +| Level | L2 | +| Migration | YES 000029 | + +## Backend Change Boundary + +```text +Domain: ToolDefinition (read) +App: AdminHandler → admin.Service → AdminRepo +API: GET /admin/ai/tools; GET /admin/ai/tools/{id} +Permission: admin.ai_config.read +Migration: 000029 +``` + +## Out of boundary + +工具在线编辑 · 运行时绑定 · UGC · 真支付 + +Rollback: down migration + remove routes/UI diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index c3b3169..62f7dd0 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -2,6 +2,7 @@ ## 2026-08-08 +- **ECR-028 Closed**:AICoreConfig ToolDefinition(migration 000029 · admin client · /ai/tools · 只读) - **ECR-027 Closed**:AICoreConfig KnowledgeChunk(migration 000028 · admin client · /ai/knowledge-chunks · 只读) - **ECR-026 Closed**:OpsCMS ScheduledPublication(migration 000027 · admin-h5 client + /cms · 只读) - **ECR-025 Closed**:OpsCMS FeedSlot(migration 000026 · admin-h5 /cms · 只读) diff --git a/docs/CODE_REVIEW/ECR-028.md b/docs/CODE_REVIEW/ECR-028.md new file mode 100644 index 0000000..f87443d --- /dev/null +++ b/docs/CODE_REVIEW/ECR-028.md @@ -0,0 +1,8 @@ +# CODE_REVIEW — ECR-028 + +**Verdict:** Approve → Closed + +Date: 2026-08-08 · Loop continuous + +- ToolDefinition 只读;无 UGC/真支付 +- Integration AC mapped · OpenAPI updated diff --git a/docs/CONTRACT_DIFF/ECR-028.yaml b/docs/CONTRACT_DIFF/ECR-028.yaml new file mode 100644 index 0000000..8b7acf3 --- /dev/null +++ b/docs/CONTRACT_DIFF/ECR-028.yaml @@ -0,0 +1,22 @@ +ecr: ECR-028 +capability: AICoreConfig +bounded_context: Ask_Ops +parent: WAVE0-FROZEN +predecessor: ECR-027 +change: + type: additive +breaking_change: false +migration_required: true +compatibility_notes: > + Adds ToolDefinition read catalog. Forbidden: UGC / real payment. + +apis: + - method: GET + path: /api/v1/admin/ai/tools + change: added + - method: GET + path: /api/v1/admin/ai/tools/{id} + change: added +perms: + - code: admin.ai_config.read + change: unchanged diff --git a/docs/ECR/ECR-028-tool-definition.md b/docs/ECR/ECR-028-tool-definition.md new file mode 100644 index 0000000..e01375c --- /dev/null +++ b/docs/ECR/ECR-028-tool-definition.md @@ -0,0 +1,15 @@ +# ECR-028 + +**Title:** AICoreConfig · ToolDefinition(只读薄切片) +**Status:** **Closed** +**Closed:** 2026-08-08(Loop continuous) +**Parent:** WAVE0-FROZEN · **Predecessor:** ECR-027 Closed +**Change Level:** L2 + +## Change + +ToolDefinition 只读 · migration 000029 · admin client · /ai/tools + +## Linked + +Spec `ops-tool-definition.md` · BD-2026-028 · CONTRACT_DIFF/ECR-028.yaml · TEST_REPORT/ECR-028.md diff --git a/docs/ENGINEERING_SPEC/ECR-028-tool-definition.md b/docs/ENGINEERING_SPEC/ECR-028-tool-definition.md new file mode 100644 index 0000000..1e7be42 --- /dev/null +++ b/docs/ENGINEERING_SPEC/ECR-028-tool-definition.md @@ -0,0 +1,6 @@ +# ENGINEERING_SPEC — ECR-028 + +1. migration 000029 +2. AdminRepo/Service/Handler +3. OpenAPI + admin-h5 +4. Integration · Closed diff --git a/docs/HANDOFF/ECR-028-architect-to-engineer.md b/docs/HANDOFF/ECR-028-architect-to-engineer.md new file mode 100644 index 0000000..1deabed --- /dev/null +++ b/docs/HANDOFF/ECR-028-architect-to-engineer.md @@ -0,0 +1,3 @@ +# HANDOFF — ECR-028 Architect → Engineer + +Loop continuous · Approved + Coding. Migration 000029. Forbidden: UGC/真支付. diff --git a/docs/HANDOFF/ECR-028-engineer-to-reviewer.md b/docs/HANDOFF/ECR-028-engineer-to-reviewer.md new file mode 100644 index 0000000..3618f11 --- /dev/null +++ b/docs/HANDOFF/ECR-028-engineer-to-reviewer.md @@ -0,0 +1,3 @@ +# HANDOFF — ECR-028 Engineer → Reviewer + +TestAICoreToolDefinitions PASS · Ready for Closed. diff --git a/docs/PRODUCT_SPEC/ECR-028-tool-definition.md b/docs/PRODUCT_SPEC/ECR-028-tool-definition.md new file mode 100644 index 0000000..012422a --- /dev/null +++ b/docs/PRODUCT_SPEC/ECR-028-tool-definition.md @@ -0,0 +1,3 @@ +# PRODUCT_SPEC — ECR-028 + +对齐 ops-tool-definition.md · Approved · Loop · L2 · ToolDefinition 只读 diff --git a/docs/STATE/ECR-028.md b/docs/STATE/ECR-028.md new file mode 100644 index 0000000..a157122 --- /dev/null +++ b/docs/STATE/ECR-028.md @@ -0,0 +1,6 @@ +# STATE — ECR-028 + +| Status | **Closed** | +| Phase | closed | +| Spec | ops-tool-definition.md | +| Updated | 2026-08-08 | diff --git a/docs/TASKS/TASK-028-ECR028.yaml b/docs/TASKS/TASK-028-ECR028.yaml new file mode 100644 index 0000000..f68c507 --- /dev/null +++ b/docs/TASKS/TASK-028-ECR028.yaml @@ -0,0 +1,12 @@ +id: TASK-028-ECR028 +ecr: ECR-028 +title: AICoreConfig · ToolDefinition(只读薄切片) +role: engineer +status: closed +change_level: L2 +parent: WAVE0-FROZEN +predecessor: ECR-027 +acceptance: + - Spec AC mapped + - ToolDefinition read only + - No UGC / payment diff --git a/docs/TEST_REPORT/ECR-028.md b/docs/TEST_REPORT/ECR-028.md new file mode 100644 index 0000000..d4cf506 --- /dev/null +++ b/docs/TEST_REPORT/ECR-028.md @@ -0,0 +1,33 @@ +# TEST_REPORT — ECR-028 ToolDefinition + +Date: 2026-08-08 · Loop continuous · commit: `PENDING` + +## Commands + +```bash +cd apps/api && go test ./internal/integration/ -run TestAICoreToolDefinitions -count=1 +npm run build:admin +python3 scripts/ess-validate.py --phase review --ecr ECR-028 +python3 scripts/ess-gate-check.py --ecr ECR-028 +``` + +## Results + +| Check | Result | +|-------|--------| +| TestAICoreToolDefinitions | PASS | +| build:admin | PASS | +| ess-validate review | PASS | +| ess-gate-check | PASS | + +## AC + +| ID | Evidence | +|----|----------| +| AC-F-01 | list seed/empty ok | +| AC-F-02 | get 200 | +| AC-F-03 | 未知 id → 404 | +| AC-S-01 | 401 | +| AC-S-02 | 403 | +| AC-P-01 | list < 500ms | +| AC-O-01 | N/A 只读 | diff --git a/docs/TRACEABILITY.md b/docs/TRACEABILITY.md index c996881..611e457 100644 --- a/docs/TRACEABILITY.md +++ b/docs/TRACEABILITY.md @@ -32,3 +32,4 @@ | ECR-025 | OpsCMS · FeedSlot | **Closed** | Spec ops-feed-slot.md · BD-2026-025 · migration 000026 · TEST_REPORT · CODE_REVIEW · Loop continuous | | ECR-026 | OpsCMS · ScheduledPublication | **Closed** | Spec ops-scheduled-publication.md · BD-2026-026 · migration 000027 · TEST_REPORT · CODE_REVIEW · Loop continuous | | ECR-027 | AICoreConfig · KnowledgeChunk | **Closed** | Spec ops-knowledge-chunk.md · BD-2026-027 · migration 000028 · TEST_REPORT · CODE_REVIEW · Loop continuous | +| ECR-028 | AICoreConfig · ToolDefinition | **Closed** | Spec ops-tool-definition.md · BD-2026-028 · migration 000029 · TEST_REPORT · CODE_REVIEW · Loop continuous | diff --git a/docs/WAVE0/LOOP_AUTHORIZATION.md b/docs/WAVE0/LOOP_AUTHORIZATION.md index 5aa1fa3..84b14e9 100644 --- a/docs/WAVE0/LOOP_AUTHORIZATION.md +++ b/docs/WAVE0/LOOP_AUTHORIZATION.md @@ -55,4 +55,4 @@ Human 明文:**直接用 Loop,不用人工确认。** | Done | Next | |------|------| -| ECR-013A…027 Closed | **ECR-028** KnowledgeChunk→ToolDefinition | +| ECR-013A…028 Closed | **ECR-029** BlockPolicy | diff --git a/proto/openapi.yaml b/proto/openapi.yaml index 9e94dfc..5a8b657 100644 --- a/proto/openapi.yaml +++ b/proto/openapi.yaml @@ -695,6 +695,34 @@ paths: '404': description: Not found + /api/v1/admin/ai/tools: + get: + tags: [admin] + summary: List ToolDefinition catalog + description: Requires admin.ai_config.read + responses: + '200': + description: OK + '401': + description: Unauthorized + '403': + description: Forbidden + + /api/v1/admin/ai/tools/{id}: + get: + tags: [admin] + summary: Get ToolDefinition + parameters: + - in: path + name: id + required: true + schema: { type: string, format: uuid } + responses: + '200': + description: OK + '404': + description: Not found + /api/v1/admin/crisis/policies: get: tags: [admin]