feat: 实现 Ora Cloud 阶段一权威核心架构并补齐各模块 README 架构文档 - #4
Merged
wanglongan587 merged 4 commits intoSep 9, 2026
Merged
Conversation
Implement Ora Cloud phase-one authoritative architecture and add module-level documentation across all backend packages following the Ora repository standards.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1. 提交功能概述 (Features Delivered)
本 PR 提交了 Ora Cloud 阶段一的权威核心服务端架构实现,并建立了对齐 Ora 桌面端规范的全模块架构文档体系。主要包含以下关键能力:
0001_core.sql至0004_effect_intent_and_ticket_scope.sql)。Idempotency-Key与请求体哈希值,实现针对租户和用户维度的安全幂等控制(相同请求安全重放历史响应,相异请求返回冲突拒绝)。version) 乐观并发控制,控制器工作流引入租约与递增纪元号 (epoch) 隔离。cloudctl:限制性运维管理 CLI,负责数据库迁移 (migrate)、原子初始化租户与管理员 (bootstrap)、安全注册基础设施凭证引用 (credential-ref)。simulator:端到端本地模拟环境,在内存与磁盘中提供 Substrate 存储、Git 仓库夹具以及 Controller 执行调度替身。openapi与checkformat:代码即契约(自动生成并校验api/openapi.json)与严格的格式检查门禁。integration:基于真实 PostgreSQL 隔离 Schema 的全链路集成测试与并发竞争检查。D:\project\desktop(Ora 桌面端)规范,为cmd/*、internal/*、pkg、integration等 18 个模块建立了专业技术英文文档,明确各模块的职责范围、并发规则与所有权边界,并在根目录README.md中同步建立了完整的架构导航。2. 解决的问题与动机 (Problem Statement & Motivation)
3. 方案设计理由与考量 (Design Rationale & Considerations)
pg_advisory_xact_lock) 来串行化核心聚合根的写入,彻底规避了高并发下复杂状态转移竞态(Race Condition)的问题。Fault错误结构,彻底杜绝数据表名、SQL 语句或凭据泄露风险。4. 权衡与取舍 (Trade-offs & Sacrifices)
cloudctl migrate预先执行,服务启动仅做只读校验和核验。5. 专业术语通俗解释 (Terminology Explained)
为了让不同背景的工程师与审阅者都能顺畅理解本次提交的核心设计,特将文中所涉关键术语解释如下:
Idempotency-Key识别出这是同一请求,直接返回之前创建好的对象,而不会重复创建出两个相同的项目。version)。写入时检查当前数据库里的版本号是否还是之前的版本,如果是则加一保存;如果版本已被别人改过,则拒绝写入(返回 409 冲突),让调用者重试。CREATE TABLE)。AutoMigrate 是部分 ORM 框架提供的自动改表功能。本方案在生产中禁用自动改表,改用显式、可复现、带校验和的向前迁移脚本。6. 关联 Issue 说明 (Related Issues)
ora-space/cloud上的 Issue 列表,当前上游主仓库无对应待关闭的开放 Issue(No matching open issues found)。Closes #<issue_id>进行自动关联合并。7. 代码与文档同步保证 (Code & Documentation Sync)
task format:check)、静态检查 (task lint) 以及所有单元与契约测试 (task test:unit、internal/contract契约比对测试全部通过)。README.md与全部 18 个模块的README.md已全面同步并包含双向跳转索引。Co-authored-by等额外无关信息。