AncrelDocumentationv0.3.0

Search documentation

    Documentation / rfc

    Wave 2 提案 · 后端包接入边界

    Wave 2 拟让 Go、Python、TypeScript 和 Rust 包共用前端已有的检索、版本选择与机器阅读协议。前后端源码、运行时依赖和测试工具各自独立。0.2.0 仅用 unlisted: true 的 be.example-queue 测试目录协议,公开索引中只有前端条目。

    目录原生构建边界对应 CI 测试
    packages/backend/go一个 go.mod 管理多个 packagego test -race ./...
    packages/backend/pythonpyproject.toml 与 uv workspaceuv run pytest
    packages/backend/ts每包独立 package.json,经 ADR 决议后纳入 pnpm workspacepnpm --filter @ancrel/<name> test
    packages/backend/rustCargo.toml 声明 Cargo workspacecargo test --locked

    一次原生发布如何进入目录

    1. 路径变更触发对应语言的 CI。原生脚本在测试通过后生成 ancrel.export.json,上传为构建产物。
    2. 目录适配器只读导出文件与 manifest,以 schemas/backend-export.v1.json 校验。下面是仓库内测试包的清单。
    3. 编译器将入口和契约填入 registry-item.v1 后端分支的 api.entrypoint、api.contractRef。正式条目通过同一版 registry.json、registry/<id>.json、raw 与 llms.txt 发布。站点构建无需启动后端或加载后端代码。
    {
      "id": "be.example-queue",
      "ecosystem": "go",
      "language": "go",
      "unlisted": true,
      "name": "example.org/ancrel/queue",
      "version": "0.0.1",
      "entrypoint": "example.org/ancrel/queue",
      "contractRef": "raw/backend/example-queue.md",
      "testCommand": "go test -race ./..."
    }
    

    首个正式包应先提交设计 RFC,落地后在 frontmatter 关联 itemId 与首次 release。性能声明需附 benchmarks 测量,写明 commit、hardware、runtime、concurrency、warmup 和 rawResultsRef,使另一位维护者能在相同条件下复核。