nex_docus/docs/sdd/specs/DV-0002-project-filesystem/design.md

28 lines
883 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# DV-0002项目与文件系统 设计Design
## 上下文
`projects.py`、`storage.py`、`project_file_service.py`、`file_vector_sync_service.py`。
## 数据模型
- `projects`storage_key/owner_id/status/access_pass…
- `project_members`role: admin/editor/viewer
- `document_meta`、`document_vector`
- 细节见 DATABASE.md。
## 存储结构
`STORAGE_ROOT/projects/<storage_key>/` + `_assets/images|files` + 默认 README.md。
## 接口设计
- /api/v1/projects/*CRUD、my、shared、transfer、members
- /api/v1/files/{project_id}/tree
## 路径安全
`get_secure_path(storage_key, rel)`:以 project_root 为根,`relative_to` 校验,失败 403。
## 状态与降级
- 权限不足→403索引同步失败不阻塞文件写最终一致
## 变更影响
- ADR-0006文件变更触发向量/全文索引进后台同步。