feat: publish Dever core with project scaffolding and versioned AI skills
This commit is contained in:
1 parent
70fa73cdc2
commit
ac458ffa7f
960 files changed
+221319
-1163
No files matched your search
@@ -0,0 +1,3 @@
|
||||
{"file":".trellis/spec/backend/quality-guidelines.md","reason":"CLI、filesystem、offline fixture 和确定性测试"}
|
||||
{"file":".trellis/spec/backend/error-handling.md","reason":"resolver/cache/protocol failure 分类"}
|
||||
{"file":".trellis/tasks/09-29-external-lib-ecosystems/prd.md","reason":"生态子任务验收标准"}
|
||||
@@ -0,0 +1,23 @@
|
||||
# Design
|
||||
|
||||
## Resolver Boundary
|
||||
|
||||
CLI 使用一个 closed ecosystem dispatch:parse requested spec、resolve fixture/registry metadata、fetch verified artifact、produce normalized locked graph。生态实现只处理自己的 metadata;缓存发布、摘要、路径安全、lock 排序和诊断由共享 owner 负责。
|
||||
|
||||
## Lock
|
||||
|
||||
`dever.lock` 是 compiler-owned canonical document,包含 format version、Dever toolchain identity、Adapter identity、Port schema hash、ecosystem、requested spec、runtime pack、target artifacts、dependency graph 和 SHA-256。未知字段、重复键或手工修改在 doctor/project command 中拒绝并提示重新解析。
|
||||
|
||||
每个 Adapter 拥有隔离 dependency graph,因此两个 Adapter 可以锁定同一生态包的不同版本。共享 cache 只按已验证内容去重,不合并运行环境。
|
||||
|
||||
## Runtime Packs And SDK
|
||||
|
||||
- pip:固定 CPython pack,优先验证 wheel;source distribution 只能进入隔离构建 sandbox。
|
||||
- npm:固定 Node pack,lifecycle scripts 默认禁用,需要的 build hook 进入隔离 sandbox。
|
||||
- go:固定 Go pack,按 target 编译 worker;需要 cgo 时必须存在受管 target toolchain,否则明确拒绝。
|
||||
|
||||
三个 SDK 共用生成的 operation/type/error schema fixture;语言层只负责数据映射和协议循环。日志写 stderr,不能读取应用 setting 文件或环境变量配置。
|
||||
|
||||
## Network Boundary
|
||||
|
||||
网络只由显式 add/update resolver 使用。registry URL 和信任根属于签名工具链发行合同,不由项目或环境变量覆盖。测试使用本地 fixture registry 和 test-owned cache,不连接真实 registry。
|
||||
@@ -0,0 +1,4 @@
|
||||
{"file":".trellis/spec/backend/toolchain-and-library.md","reason":"CLI、cache、offline、runtime pack 和 config boundary"}
|
||||
{"file":".trellis/spec/backend/compiler-contracts.md","reason":"Adapter schema identity 与业务边界"}
|
||||
{"file":".trellis/tasks/09-28-shared-toolchain/design.md","reason":"机器级共享 cache、版本和权限 owner"}
|
||||
{"file":".trellis/tasks/09-29-external-lib-protocol/design.md","reason":"SDK 必须实现的唯一协议"}
|
||||
@@ -0,0 +1,42 @@
|
||||
# Implementation Plan
|
||||
|
||||
- [x] 定义 requested/locked/artifact/runtime-pack 内部模型和 canonical lock codec。
|
||||
- [x] 实现共享 resolver orchestration、SHA-256、归档安全、atomic lock/cache publish 和 doctor。
|
||||
- [x] 增加 `dever lib add/list/update/remove/doctor` 并复用统一项目根/诊断处理。
|
||||
- [x] 提供 `ArtifactStore` 适配边界和 test-owned 内容寻址 fixture;正式 `deverd` IPC 仍由共享工具链任务提供。
|
||||
- [x] 实现 PyPI wheel/PEP 508/440、npm packument/semver/SRI 和 Go proxy/MVS resolver,接入已验证安装版本及签名 runtime 描述。
|
||||
- [ ] 发行正式 CPython/Node/Go runtime/build pack 并运行无宿主验收。
|
||||
- [x] 完成锁定 host-target build pack 的受管 Go compile/link、build tags、module ZIP、go:embed 与同名操作绑定;源码移除和清空环境独立 Worker 执行通过。
|
||||
- [x] 完成 Python extras/wheel/sdist/PEP517、npm 高级依赖图/安装钩子/native addon 与 Go sumdb;2026-10-02 已运行官方第三方依赖隔离构建和离线 Worker 验收,证据见父生产化任务。
|
||||
- [x] Python、JavaScript、Go SDK 协议库、checked manifest typed 校验及显式宿主验收;Python/JS 自动同名 entry 绑定已接入打包器。
|
||||
- [x] 使用本地 fixture registry 覆盖 deterministic lock、摘要、归档路径、冲突、offline 和双 target cache 隔离。
|
||||
- [x] ArtifactStore 提供 verified `get`,并拒绝摘要不匹配;npm scoped name 和 remove 依赖关系有明确诊断。
|
||||
- [x] 增加 `LibResolver`/`ProviderManifest` 边界和真实 provider 接线;仅显式 Lib 命令解析/下载,不读取 PATH 或环境变量。
|
||||
- [x] `doctor` 按各生态校验精确依赖图、可达闭包和构建收据;npm 允许合法依赖环。ArtifactStore 在 Worker 启动前验证目标和摘要。
|
||||
- [x] 编译器/CLI 接通 external Adapter 的精确 Lib 请求:支持 `lib "pip:name@version"`、`lib "npm:name@version"`、`lib "go:name@version"`,请求进入 schema identity 并参与 lock 校验。
|
||||
- [x] 更新 LANGUAGE、README、IMPLEMENTATION 与 compiler/toolchain specs,保留尚未实现和缺发行资产的边界。
|
||||
- [x] 运行 CLI/lib resolver/SDK 定向测试;只使用注入 transport、自有 loopback 镜像和显式宿主 fixture,不访问公网 registry、不运行全量。
|
||||
|
||||
## Current implementation boundary
|
||||
|
||||
2026-10-02:当前锁格式为 v5,Python extras/原生 wheel/sdist 构建、npm 嵌套/peer/optional/bundled 图、安装钩子与 native 分类裁剪、Go sumdb 已实现。最终默认解析 **71/71**,Worker **7/7**,严格 CLI Clippy 通过;simplejson3.20.1、bufferutil4.0.9 和 google/uuid1.6.0 的显式真实构建与离线 Worker 均通过。命令、作者资产与运行日志统一记录于 `../09-29-language-production-closure/implement.md`,不复制历史进度为当前缺口。正式公开及其他平台资产尚未交付,任务暂不归档。以下为历史基线。
|
||||
|
||||
本阶段已完成 compiler-owned lock/resolver boundary、真实 registry resolver、机器共享资产缓存及三 SDK typed manifest。显式宿主协议验收不是正式受管 pack/无宿主发行验收;未安装签名 runtime 描述的开发入口仍明确失败,不使用系统包管理器或宿主语言环境。
|
||||
|
||||
2026-09-30:Lib 声明统一到 `config/setting.json.lib`,拒绝旧独立文件;canonical v2 lock 绑定 checked Worker contract 与 runtime(零 Lib managed Worker 也锁 runtime)。每个 Worker 独立 resolve/doctor,跨 Worker 版本可以不同。嵌入精确比对完整 provider 元数据。CLI `external_libs` 最终 27/27 通过,真实 provider 测试注入协议 transport,Go ZIP 的受限跳转使用自有 loopback HTTP 镜像;不使用 FixtureRegistry 冒充产品解析,也不声称已访问公网/发行 pack。Linux 不同 UID 的 artifact put/get、token 隔离和 owner-only clean 通过。CLI Clippy `-D warnings` 与所属文件私有 rustfmt check 通过。
|
||||
|
||||
## Review Gates
|
||||
|
||||
- 不让各 resolver 重复 lock/cache/path/HTTP 验证。
|
||||
- Go ZIP 重定向仅允许固定 GCS bucket、最多两跳、总 30 秒;URL 规范化、userinfo/fragment/端口/路径检查与循环/Location 检查都在后续请求前,诊断不回显签名 URL。
|
||||
- 不在 run/build 中解析版本或联网。
|
||||
- 不允许项目 registry URL、runtime path 或 token 来自环境变量。
|
||||
- 不把生态依赖模型暴露成 Dever 业务类型。
|
||||
|
||||
## Verification
|
||||
|
||||
- `cargo check --offline -p dever-cli`:通过。
|
||||
- `cargo test --offline -p dever-cli --lib libs::tests`:4/4 通过。
|
||||
- `cargo test --offline -p dever-cli --test external_libs`:3/3 通过。
|
||||
- 手工 `deverc lib add/list/doctor`:通过。
|
||||
- 未运行公网 registry 下载、正式签名 runtime 或全量测试;真实 resolver 的定向证据来自注入 transport 的协议元数据,不能等同于发行验收。
|
||||
@@ -0,0 +1,37 @@
|
||||
# Dever Lib 生态解析
|
||||
|
||||
## Goal
|
||||
|
||||
在统一 external Adapter/Worker 协议之上,实现确定性的 `dever lib`、`dever.lock`、机器级内容缓存以及首批 pip/npm/go resolver 和官方 SDK。
|
||||
|
||||
## Dependencies
|
||||
|
||||
- `external-lib-protocol` 已完成并冻结协议版本和 external Adapter HIR。
|
||||
- `shared-toolchain` 提供机器级版本目录、权限和共享 cache API;本任务不复制该实现。
|
||||
|
||||
## Requirements
|
||||
|
||||
- 命令固定为 `lib add/list/update/remove/doctor <project-root> ...`,保持 CLI 的显式项目根合同。
|
||||
- spec 使用 `pip:name@version`、`npm:name@version`、`go:module@version`;禁止无版本请求进入 lock。
|
||||
- `add/update` 解析完整传递依赖、平台 artifact、runtime pack 与摘要,写 canonical `dever.lock`;写入采用 prepared + atomic replace。
|
||||
- `list/doctor/remove` 默认不联网;`doctor` 校验声明、lock、缓存和 Adapter schema identity 一致。
|
||||
- 共享 cache 按 verified bytes 和 target identity 去重;项目之间不共享可写 dependency state。
|
||||
- pip/npm/go 各自使用固定 resolver adapter,不执行项目提供的 shell;需要构建的生态 hook 必须在声明 capability 的隔离构建 sandbox 内运行。
|
||||
- Python、JavaScript、Go SDK 实现同一个协议和生成的类型合同;SDK 不定义第二套业务 schema。
|
||||
- 所有项目命令离线消费 lock;缺失 artifact 给出需要执行的精确 `dever lib` 命令,不隐式下载。
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
- [ ] 三个生态的本地 fixture registry 解析出确定性 lock;重复解析字节一致。
|
||||
- [ ] 版本冲突、摘要错误、篡改 cache、非法归档路径、缺平台 artifact 和 schema 漂移均明确失败。
|
||||
- [ ] 两个项目共享相同 artifact bytes,但 lock、Adapter setting 和项目文件保持隔离。
|
||||
- [ ] Python/Node/Go SDK fixture 完成 handshake、success、declared error、cancel 和 shutdown。
|
||||
- [ ] PATH 中放置伪造 python/node/go 不影响选择;不读取语言相关环境变量。
|
||||
- [ ] 断网且 cache 完整时项目命令前置验证成功;cache 缺失时不联网。
|
||||
- [ ] 新 resolver 可通过固定内部接口加入,不修改 CLI 命令、lock 核心 schema 或 Worker 协议。
|
||||
|
||||
## Out Of Scope
|
||||
|
||||
- Maven、NuGet、Composer、Gem 的正式 resolver。
|
||||
- 公共 registry 服务建设和真实互联网端到端测试。
|
||||
- 最终应用资源嵌入与目标机器运行。
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"id": "external-lib-ecosystems",
|
||||
"name": "external-lib-ecosystems",
|
||||
"title": "Dever Lib 生态解析",
|
||||
"description": "实现 dever lib、dever.lock、机器缓存及 pip/npm/go 依赖解析和 SDK",
|
||||
"status": "in_progress",
|
||||
"dev_type": null,
|
||||
"scope": null,
|
||||
"package": null,
|
||||
"priority": "P1",
|
||||
"creator": "Antigravity",
|
||||
"assignee": "Antigravity",
|
||||
"createdAt": "2026-09-29",
|
||||
"completedAt": null,
|
||||
"branch": "main",
|
||||
"base_branch": "main",
|
||||
"worktree_path": null,
|
||||
"commit": null,
|
||||
"pr_url": null,
|
||||
"subtasks": [],
|
||||
"children": [],
|
||||
"parent": "09-29-external-libs",
|
||||
"relatedFiles": [],
|
||||
"notes": "2026-10-02:高级生态产品实现和Linux实际第三方构建/Worker验收已补齐,最终external_libs71/71、workers7/7,CLI严格Clippy通过。包括extras/原生wheel/sdist/PEP517、npm复杂安装图/hooks/native分类与物理裁剪、Go sumdb及官方UUID。正式公开/其他平台资产仍未交付;保留in_progress,不将私有签名fixture冒充正式发行。准确命令和运行证据统一见09-29-language-production-closure/implement.md。",
|
||||
"meta": {}
|
||||
}
|
||||
Reference in new issue
Block a user