Files
cc-web/.trellis/spec/backend/quality-guidelines.md
2026-08-07 10:54:08 +08:00

57 lines
1.4 KiB
Markdown

# Quality Guidelines
> Code quality standards for backend development.
---
## Overview
<!--
Document your project's quality standards here.
Questions to answer:
- What patterns are forbidden?
- What linting rules do you enforce?
- What are your testing requirements?
- What code review standards apply?
-->
(To be filled by the team)
---
## Forbidden Patterns
<!-- Patterns that should never be used and why -->
(To be filled by the team)
---
## Required Patterns
<!-- Patterns that must always be used -->
### 部分 JSON 预览
- 从大会话文件的头部/尾部预览提取元数据时,必须识别 JSON 顶层结构;禁止用“第一个同名键”的正则结果代表顶层字段。
- 头部和尾部片段必须独立解析,禁止直接拼接后匹配,避免截断边界组合出文件中不存在的键值。
- 预览读取必须保持明确的字节上限;解析失败时按字段缺失安全降级,不能让单个损坏会话中断整个列表。
---
## Testing Requirements
<!-- What level of testing is expected -->
- 部分 JSON 解析改动必须使用超过完整解析阈值的真实文件夹具,证明测试确实进入预览分支。
- 回归至少覆盖:嵌套同名键早于顶层键、顶层键位于尾部、字符串伪键与转义、`null`、字段跨截断边界、头尾拼接伪命中。
---
## Code Review Checklist
<!-- What reviewers should check -->
(To be filled by the team)