Repository navigation
[WIP] 微内核重构:Rust 核心、Go 扩展、协议模板与独立分发 - #675
LIghtJUNction wants to merge 118 commits into
Conversation
…urrent main Consolidate the five WIP setup and temporary verification commits into one source commit based on main 4399bb6. Preserve the complete migration from b86eb79 and all three upstream updates. Use the conflict-free combined source tree from GitHub's merge preview, with main as the sole parent (no merge commit in branch history). Retire apps/api-rust and its deployment/package paths; retain the current Go/Web production backend. Introduce the fail-closed Rust core, native personal/team funding rules, modular Go extension host, shared contracts, and independently operated Docker services. P0 only. Keep PR #675 draft. No production deployment, data migration, or live model traffic.
165a17e to
a6e4dd6
Compare
…pilot Continue draft #656 with database ownership, session-fenced team creation, ID-bound invitations, member changes, audit transactions and scoped HTTP routes. Reuse the existing optional migration registry and manual billing-safety workflow. Team billing, keys, handles and UI remain unavailable. Full database and HTTP regressions are written but not yet executed; keep this default-off and WIP. Rebased-from: 8190dbf Preserve the newer router entry from PR #675 and replay only the original three-line SetNativeAccountRouter registration. All other patch blobs are unchanged.
…egressions Keep billing safety checks manual-only. Source and test files are unchanged from the isolated verification candidate 7c11493. Rebased-from: b85fedd Rebase-base: a6e4dd6 (PR #675) Complete the four-commit replay of PR #656. Retain the disabled native-account feature and draft status. No merge, production deployment or new CI test run.
团队开发线收束:#656 已关闭,保留设计而非整批合入按维护者要求,独立团队 Draft #656 已关闭、未合并。本条替代正文和 完整的关闭前分析、源码位置与舍取理由见:#656 (comment) 保留为后续实现要求
不重复引入 Go 核心实现#656 的 本 PR 已有 验收顺序P1:真实身份/会话、唯一团队所有者、成员和邀请、撤销与平台权限隔离。 #656 中并发接受/拒绝唯一结果、审计失败回滚、弱化数据库约束被拒绝等测试适合作为 Rust 验收输入,不意味着其旧测试可直接证明 Rust 正确。本轮没有运行新测试,没有声称团队业务已完成;本 PR 保持 Draft、未合并、未部署。 |
…urrent main Consolidate the five WIP setup and temporary verification commits into one source commit based on main 4399bb6. Preserve the complete migration from b86eb79 and all three upstream updates. Use the conflict-free combined source tree from GitHub's merge preview, with main as the sole parent (no merge commit in branch history). Retire apps/api-rust and its deployment/package paths; retain the current Go/Web production backend. Introduce the fail-closed Rust core, native personal/team funding rules, modular Go extension host, shared contracts, and independently operated Docker services. P0 only. Keep PR #675 draft. No production deployment, data migration, or live model traffic.
2017f14 to
e0b5162
Compare
fa9ebf1 to
bdfa790
Compare
|
核对当前 head 5f1f5b3 后,发现协议工作流有一处路径回归:
建议保留独立的 extensions-go 检查与构建步骤,并对应其 go.sum 缓存键及 push 路径;如果也要检查 api-go,可另加步骤。 本条仅基于当前提交的静态源码、目录和调用链核对,没有执行工作流或测试,也不将此前提交的通过结果视为当前 head 的验证结果。 |
|
复核当前 head 扩展入口现位于 apps/api-go/cmd/extensions,重复的 apps/extensions-go 已移除;生成脚本、工作流的工作目录、缓存键与 push 路径均指向 apps/api-go。该精确提交的 运行 38012253953已成功,已逐项核对生成绑定、Rust 检查、Go race/build、Docker 恢复与边界检查步骤。 本条仅关闭此前的路径与检查目标不一致问题;专项通过不代表整站功能或生产上线验收通过,PR 仍为 Draft。 |
e48670e to
b83723c
Compare
任务 06 接口协调:Protobuf 与可靠事件工作分支: 拟定公共接入点:
任务 01/02/03/04 请在本线程提供需要的具体命令和事件字段;账本/计费方法只允许窄操作、引用已验证业务记录,不提供任意 SQL 或设置余额。业务尚未合并时仅验证基础机制,不能将测试计数器当成真实资金业务验收。最终集成需要显式接入事件 schema、订阅配置和 RPC event store。 |
任务 02 → 任务 06:资金接口交接(已通过账本验收)独立 Draft PR:#694,分支 真实 PostgreSQL CI:fmt、严格 clippy 通过;48 个测试全部通过,其中账本 PostgreSQL 集成测试 14/14,通过了并发扣款、重复退款和丢失 COMMIT 响应后重试。未修改共享 Protobuf、身份 schema、Go 或初始化器;未合并、未部署。 完整接口和权限约束:ledger/README.md。请任务 06 按以下约束接入:
账本定义独立保存在 |
|
任务 10( 需要由 Rust 提供并经宿主 Unix socket 窄接口暴露:
Go 模块目前采用可注入 Core 接口 + 默认拒绝的 UnavailableCore;测试使用模拟核心,不会伪造真实 RPC 已接通。渠道仅提供证据,Go 无余额字段、无核心数据库连接。完整要求及事件状态说明将随本任务 Draft PR 提交。 |
Wire native identity/key/profile, console compatibility, shared charging and commerce contracts, durable payment proof recovery, and streaming checkpoints through the Core runtime. Keep optional money paths capability-gated and retain holds when settlement is uncertain. Expose only audited ledger projections. Default to /etc/lmm.conf.d/core.toml, reject mixed/invalid configuration, read private credentials from bounded files, and require explicit shared-group RPC. Regenerate the payment and commerce Go bindings from the canonical protocols. Validated on immutable source08: cargo test --locked --no-fail-fast --all-targets -- --test-threads=1 (429 passed, 3 ignored), all-targets clippy -D warnings, and 89-file rustfmt. The ignored payment test separately passed its real 302-second Go/Core/PostgreSQL recovery run; remaining ignores are a duplicated benchmark. Fixed-binary configuration/process and 8 different-UID RPC checks also passed. This is source integration, not full main parity or activation of the existing local v2 migration database. Real legacy money import, provider/browser parity, and normal-host payment acceptance remain incomplete.
Add strict file-only TOML startup and bounded private credential reads. Keep module database pools and runtime permissions separate, wire scoped Core commerce clients, persist typed store prices and recovery records, and reject unsafe repricing inside the order transaction. Add assistant history/preset compatibility and tool-market Web contracts; keep unsupported paid/delegated actions unavailable. Persist Core-verified payment proof results so delayed and duplicate delivery recovers safely. Validated with mise Go 1.27.2: 849 race test events passed, 7 optional fixtures skipped; gofmt/vet/build passed with 184 source inputs unchanged. Separate PostgreSQL checks passed 5 store tests plus 3 subtests and 4 assistant-history tests. Actual TOML sample and legal processes passed. The Rust-coordinated 302-second payment recovery joint test separately passed with real PG. The store PG tests use controlled Funds, not the real Core commerce bridge. Normal payment host wiring, assistant model delegation, tool-market actions, and legacy Web seller-terms capability compatibility remain incomplete.
Define /etc/lmm.conf.d/{core,extensions}.toml and separate private files,
/var/lib/lmm state, /run/lmm IPC, /usr/share/lmm assets, and journal defaults.
Document XDG client paths as policy without claiming CLI implementation.
Update native packages, explicit static service users, optional RPC group
examples, noreplace configuration and non-destructive lifecycle rules. Remove
obsolete environment samples and use read-only TOML Docker mounts with separate
owner/runtime credentials and project-scoped networks. Keep optional modules
closed unless configured. Update development, protocol, legal and distribution
guards and parser attribution without changing CI trigger policy.
Local validation passed: 19 boundary, 8 workflow, 14 distribution, 5 docs,
33 documentation and 20 package-definition tests; Compose rendering/privacy
fixtures and actual fixed-binary base/legal configuration checks also passed.
Real cold Docker build and native installation were not performed. nFPM tool
build is blocked by a dependency checksum mismatch; the native-encoder attempt
fails because nfpm is unavailable, and no integrity check was bypassed.
Existing local services/data and four unfinished identity/console migration
scripts are preserved. This commit does not migrate existing installations,
initialize databases, start services, publish packages, or deploy production.
Scope AGENTS, all eight skills and setup/check guidance to the actual microservice branch. Reuse component artifacts, avoid repeated aggregate checks and correct the Go extension startup example. Keep core ownership, isolated initialization and independent acceptance requirements intact. Docs only; no runtime, test, workflow or quality-gate implementation changes.
WIP 文档与技能效率优化已直接追加到
主要改动:
保留核心独立运行、核心数据库归属、安装 owner/runtime 分离、空库显式初始化、来源/签名、权限/计费/并发/失败测试及独立验收要求。没有修改应用代码、部署实现、测试断言、质量工具/阈值/债务记录、工作流或上游技能参考。 实际验证: 辅助验证脚本和日志仅在本次工作环境中,没有加入仓库。完整检出不可用,因此没有执行完整仓库 使用预期分支 SHA 和非强制更新写入,未覆盖其他分支历史。 |
开发主线交接(2026-10-12)
开发默认主线现为
wip/rust-core-go-extensions;旧单体main与traditional冻结于3948a0a1ee1cefdd016a7aa45a11851545bb4b85。分支交接不是发布、部署或验收通过。原问题、源码基线、测试与未完成项保留;旧单体路径仅作历史证据,后续先在微服务源码重新确认并按职责移植,不回灌旧数据库/权限/资金实现。主线/S11 跟踪:#895。Extore 商品同步:#894,未验收,禁止部署,尤其禁止合并/推送 Extore
main。本 PR 原为 WIP → main。现在 WIP 已成为默认开发主线,旧 main 已冻结,因此关闭这个旧合并通道;没有执行合并,S11 仍未完成。原正文、局部验证及剩余责任保留,后续验收在 #895 跟踪。
S11 串行集成状态 — 2026-10-12
BLOCKED / Draft:本轮只完成前置项核对和一项构建租约修复,未完成 S11 的最终装配、迁移或整站验收。
继续更新本 PR,不新建替代集成 PR。读取时 WIP HEAD 为
a28f06e88b7adf3701937f2a4018689bdc96ad85,main HEAD 为de2c439f26446792d4a605b2b91fa2b84777e284;这仅固定本次观察,不表示完成了该 main 的全部功能等价审查。任务文档中5999dc656的 HumanGrant 增量仍须纳入 A02/A10/S11 验收。本轮 没有修改共享 WIP 的源码 HEAD。实际代码修复推送到已有 A09 PR #878;下面十份候选没有被批量合并。原 PR 元数据不是 Draft,与正文不符;现已转为 Draft。
前置 PR 与剩余责任
以下是根据各候选 PR 的范围、验证记录与明确缺项建立的接收清单,不是完整 main 功能分母或全部源码审计。PR 已创建不等于代码、接口、冻结回执及测试均已完成。各项继续更新原 PR,不另建重复 PR。
--apply仍拒绝未获得十份完整的冻结合同、源码 manifest 和私有接线请求,不能以 PR 标题或若干隔离测试代替。S11 后续按 A01→A02→A03→A04/05/06/07→A08 的实际依赖统一接线,A09/A10 消费同版接口;遇到缺项继续回到上表原 PR 修正,不猜测权限或金融规则。
本轮实际代码与验证
已有 PR #878 新增提交
478f658cd7d550f7813f12e8a13630d0c8afb89e,仅修改测试用构建租约脚本及新增对应测试,+253/-13。原脚本只等待直接子进程,启动进程退出或关闭继承描述符后,仍活跃的下级进程会失去构建锁。修复用独立、短暂的 Linux 监督进程持锁并等待本地后代退出;不会扫描或停止无关进程。python -W error::DeprecationWarning -B -m unittest discover -s tests/architecture_completion -p 'test_build_lease*.py' -v。这些是 异地沙箱的测试工具验证,不是原工作区的 mise、Core/Go/Web/CLI、PG、分发或整站验收。未改产品运行配置、数据库结构、CI 触发器或子模块指针。
尚未执行的 S11 验收
本环境未找到任务指定工作区
/home/lightjunction/Documents/GITHUB/api.lmm.best-microservices,没有其私有合同/租约/历史源快照和本地服务,也没有所需 mise/Rust/Bun/PostgreSQL/Docker 工具。直接 Git 网络访问失败后使用已连接 GitHub 读取并更新既有 PR;这不等于访问了原工作区。因此仍未执行:最终共享代码装配与完整组合构建;真实 PG 权限/资金/跨进程验证;同一源归档到全新目标的受控导入与对账;完整浏览器/CLI 旅程;最终安装/恢复/资源测试及本地切换。源码候选未被冻结和业务合同未完成也是独立阻断,不是只补装工具就能通过。
不标记 100%,不启用未验证的付费/管理能力,不改旧目标库或生产状态。本轮没有合并、发版、部署或移动真实资金。下面原有验证记录保留为历史证据,不得作为本轮 S11 组合通过的证据。
历史范围:文档、协议与独立分发
以下记录对应
f1f637423379a8b732d2cd1484834cebcb024798,不是当前 WIP HEAD。当轮为全新安装的微服务重构,不升级或导入现有数据库,不把旧 Go 单体恢复为运行时回退;未合入 main、未发布 Release、未部署生产。
wip/rust-core-go-extensions从
72667564c0431754d4856dc2e0db55f360bd2745开始,新增fdfd9022和f1f63742两次提交;65 个文件,新增 1,971 行、删除 4,123 行。LMM_LEGAL_CONFIG_FILE读取并校验协议快照。三个公开只读 API 保留前端响应结构,其他模块仍受认证保护。修改配置后只重启扩展,不重编译、不访问核心或数据库。模板未填完整时不能发布;没有新增管理员写入 API、用户同意记录或退款执行逻辑。site.json、密钥和缓存不进入包内。Docker 同步携带模板和许可证。历史验证记录(未由本轮 S11 重跑)
当轮实际源码为
f1f637423379a8b732d2cd1484834cebcb024798。当轮预览构建与验证
第一次前端真实打包发现
.well-known/webmcp.json被隐藏文件规则误拦。第二次提交只放行该精确公共路径,并增加真实文件回归和相邻私有文件拒绝测试;最终重新构建四个组件通过。早先 Go 校验服务连接失败通过重试恢复,没有关闭依赖校验。当轮现有微服务检查记录为 success;Rust 检查及真实数据库测试、Go 全量 race、商店/客服 PostgreSQL、公开协议真实进程测试、跨进程事件恢复、Docker 通信与故障恢复检查均通过。但整站业务、支付及模型资金联调仍未完成,不能据此将 WIP 视为可发布版本。
当轮预览产物设置保留 7 天,不是正式发行或生产部署;本轮未重新核验其可下载状态。
当轮保留问题
核心模型路由、收费及资金 RPC 的最终连接、账本/预算/事件同事务处理、各业务模块宿主组装、统一空库结构检查和整站前后端联合验收仍需完成。收费依赖不可用时继续拒绝操作,不免费放行。
当轮修复了前端构建的旧 Go 生成物依赖,但没有声称全量前端回归通过。此前记录的工具配置测试旧路径依赖及其他前端失败,应单独验证和修复。协议通过文件配置,旧控制台
legal.*设置尚未接回新宿主。较早变基验证针对
2ed549cd,仅作历史证据,不替代当前验收。原记录的回退参考分支为wip/backup-675-pre-rebase-20261010;本轮未修改它。文档入口
架构收尾任务(含 S11) · 文档目录 · 隔离 Docker 开发栈 · 协议模板与配置 · 打包与分发