feat: 接入真实登录与成员权限
- auth/members/messages: 新增超级管理员登录、成员权限和密码消息流程 - agent-config/agent: 支持服务端保存 Agent 配置并取消未配置 mock 成功结果 - projects/deploy-runs/settings: 按当前用户权限保护真实接口 - prisma: 新增用户、项目权限和平台消息表结构
This commit is contained in:
@@ -1,38 +1,38 @@
|
||||
@RTK.md
|
||||
|
||||
# Agent Instructions
|
||||
# Agent 指令
|
||||
|
||||
This backend owns the DevOps platform API only. Do not edit sibling projects from this directory.
|
||||
当前后端只负责运维平台 API。除非用户明确扩大范围,否则不要编辑同级项目。
|
||||
|
||||
## Hard Boundaries
|
||||
## 硬性边界
|
||||
|
||||
- Write only inside `devops-platform-api` unless the user explicitly expands the scope.
|
||||
- Do not write `devops-platform-web`.
|
||||
- Do not write `devops-platform-docs/devops-platform-implementation-tracker.md`; the coordinating thread owns tracker updates.
|
||||
- Do not revert unrelated user or worker changes.
|
||||
- 只允许在 `devops-platform-api` 内写入。
|
||||
- 不要写入 `devops-platform-web`。
|
||||
- 不要写入 `devops-platform-docs/devops-platform-implementation-tracker.md`,协调线程负责跟踪文档更新。
|
||||
- 不要回滚无关的用户或其他工作线程改动。
|
||||
|
||||
## Backend Standards
|
||||
## 后端标准
|
||||
|
||||
- Use NestJS modules and dependency injection for all business boundaries.
|
||||
- Keep controllers thin. Validation, orchestration, and audit decisions belong in services.
|
||||
- Use Prisma as the default data access layer. Business code must not create mysql2 pools or scatter handwritten SQL.
|
||||
- If native SQL is unavoidable, place it in a Repository, parameterize it, document why Prisma is insufficient, and keep the method narrow.
|
||||
- Keep external clients behind integration modules: Jenkins, Gitea, notification providers, and LLM.
|
||||
- 所有业务边界使用 NestJS module 和依赖注入。
|
||||
- Controller 保持轻量;校验、编排和审计决策放在 service。
|
||||
- 默认使用 Prisma 作为数据访问层,业务代码不得创建 mysql2 连接池或散落手写 SQL。
|
||||
- 如无法避免原生 SQL,必须放在 Repository,使用参数化查询,说明 Prisma 不足之处,并保持方法范围收敛。
|
||||
- 外部客户端必须放在集成模块后面,包括 Jenkins、Gitea、通知提供方和 LLM。
|
||||
|
||||
## Security Standards
|
||||
## 安全标准
|
||||
|
||||
- Never commit real credentials.
|
||||
- Redact tokens, webhook URLs, cookies, authorization headers, private keys, and long opaque secret-like strings before logging, auditing, returning errors, or passing content to LLMs.
|
||||
- Store future persisted secrets encrypted server-side only.
|
||||
- Frontend must never receive Jenkins/Gitea/notification/LLM secret values.
|
||||
- 永远不要提交真实凭据。
|
||||
- 记录日志、写审计、返回错误或传给 LLM 前,必须脱敏 token、webhook URL、cookie、authorization header、私钥和长的不透明密钥字符串。
|
||||
- 未来持久化密钥只能在服务端加密保存。
|
||||
- 前端永远不能收到 Jenkins、Gitea、通知或 LLM 的完整密钥值。
|
||||
|
||||
## Audit Standards
|
||||
## 审计标准
|
||||
|
||||
- Record actor, resource, action, before/after state summaries, request source, and parameter digests for deploy, cancel, retry, secret change, and agent invocation operations.
|
||||
- Deploy run status transitions must be idempotent and concurrency-safe when database writes are enabled.
|
||||
- 发布、取消、重试、密钥变更和 Agent 调用需要记录操作者、资源、动作、变更前后摘要、请求来源和参数摘要。
|
||||
- 启用数据库写入后,发布状态流转必须具备幂等和并发安全能力。
|
||||
|
||||
## Agent Standards
|
||||
## Agent 标准
|
||||
|
||||
- Agent features must be tied to DevOps workflows, not general chat.
|
||||
- Agent calls are read-only unless a future product decision explicitly changes this.
|
||||
- Save prompt version, purpose, operator, input digest, output digest, token estimate, and sanitized failure summary for every real invocation.
|
||||
- Agent 能力必须绑定运维工作流,不能做通用聊天。
|
||||
- 除非未来产品决策明确改变,否则 Agent 调用只读。
|
||||
- 每次真实调用都要保存 prompt 版本、目的、操作者、输入摘要、输出摘要、token 估算和脱敏后的失败摘要。
|
||||
|
||||
Reference in New Issue
Block a user