docs(architecture): v0.3 — document implemented backend (API surface, points rules, DB schema, roadmap) - #76
Merged
Merged
Conversation
- §4.1 网关层标注已实现:OpenAI/Anthropic 双协议 + SSE 流式 + 余额预检(可用余额口径)+ 完整 API 一览 - §4.2 补上游 key AES-256-GCM 加密(v1:<nonce>:<cipher>,ATP_MASTER_KEY → config.master_key → dev 随机兜底) - §4.3/4.4 计量与账本标注已实现:点数公式、事务性 settle、双余额账户、每日赠送/惰性过期清理、先赠后永扣减、SHARE_RATIO=0.9、管理员充值 topup - §4.6 管理台补管理员 API(role 判定/403、种子账号) - §5 数据库设计改为实表(gift_grants/schema_version/quotas 双列),§6 补配置说明 - §7 路线勾掉 P0/P1(v0.1.0→v0.3.0,PR #71–#75)
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.
Summary
Docs-only update: bump
docs/architecture.mdfrom v0.2 → v0.3 to reflect the implemented backend reality (P0-A/B/C + P1, now at v0.3.0). The doc previously only described the planned architecture (v0.2, 2026-08-15) — before the backend existed. This brings it in sync with the code:v1:<nonce>:<cipher>;ATP_MASTER_KEY→config.server.master_key→ dev-random fallback; startup plaintext migration)settle(90/10 share, all-or-nothing rollback), dual-balance account (balancepermanent +gift_balance), daily gift (1pt/day × 10 days, same-day expiry, lazy expiry cleanup), gift-first deduction (earliest expiry), admin top-up →topupledgerAuthUser.role, 403, seed accounts)gift_grants,schema_version,quotasdual columns)Verification
src/routes/mod.rs(routes),src/db.rs(schema v3),src/billing.rs/src/gift.rs(points rules),src/crypto.rs(AES-256-GCM), Cargo.toml (aes-gcm 0.10)