Skip to main content
Glama

Lattice

一个 backlog 只是伪装成计划的扁平列表。

Lattice 会从你的 GitHub issues 中推断出隐藏的依赖图,并通过 MCP 把生成的调度计划提供给 coding agent——这样一来,一次昂贵的推理调用,就成了其后每一次廉价 agent 运行共用的调度器。

它自行运行。触发它的是 issue 事件和一份调度计划;没有人点击任何按钮。

它从不向 GitHub 写回数据。 Issues 只是数据源,不是数据存储。

Microsoft Hackathon 2026 · 挑战赛:在 Agent 时代使用 GitHub 规划与追踪工具进行协作


问题

Issues 之间相互依赖。API 必须先于 UI 消费它而存在;schema 迁移必须先于查询;类型契约必须先于那四个 import 它的模块。人类把这些先后顺序记在脑中,却从来没人写下来。

当选择下一个任务的是人类时,这件事还可以忍受;当你的队友是一个 agent 时,它就不再可以忍受了:

  • Agent 拿到的是一个扁平 backlog,所以它会按错的顺序做错的事——它为一个还不存在的 endpoint 写前端,无论模型多好,输出都是垃圾。

  • 每一次 agent 运行,都要从头把同样的顺序重新推导一遍。这种分诊(triage)恰恰是请求中最贵的部分,却被重复 N 次,而且每次都被丢弃。

  • 没有任何信息说明哪些工作可以并行——而这恰恰是有必要跑多个 agent 的全部理由。

GitHub 已经有这个数据模型,但它完全是空的。 Issue 依赖(blocked_by / blocking)在 2025 年转为 GA,并得到完整的 REST、GraphQL 和 gh 支持。几乎没有人填写它们,因为填写是手动且两两进行的——要付出的 O(n²) 人力,却换不来任何一个单独个体能感知到的好处。而就算有人填了,GitHub 也只是用一个扁平的文本列表来渲染;依然没有图形视图。

所以说:schema 是已经存在的,数据是不存在的,视图也是不存在的。

Related MCP server: agentic-sdlc-mcp

Lattice 做了什么

  GitHub (read only)
  issues · blocked_by · sub-issues
             │
             ▼
  ┌──────────────────────────────────────┐
  │  BACKEND                             │
  │   inference ──► the full graph       │
  │                      │               │
  │        REST API ◄────┴────► MCP      │
  └──────────┬─────────────────┬─────────┘
             │ REST            │ MCP
             ▼                 ▼
     interactive graph    coding agents
     (human: what's next)  (agent: what's next,
                            what's parallel, claim)

它唯一的架构承诺是:GitHub 是数据源,不是数据存储。 Lattice 每次运行都会读取 issues、原生的 blocked_by 和 sub-issue 层级,并且不写回任何东西——不写 dependencies、不写 comments、不写 labels。

这使得系统在构造上就是非破坏性的,于是才有资格无人值守运行。它没有任何一个能弄坏共享仓库的自动写入器,也没有任何会删除某人手工记录的依赖的裁剪逻辑。最坏的一次错误推断无非是把自己的建议顺序排错,下一次运行就会纠正回来。

写入路径是反方向的:人来写,Lattice 来读。 谁想去推翻那张图,直接在 GitHub 上改 blocked_by 即可;下一次运行会把它的修改当成 ground truth,模型也不得违背。

为什么它回答了这次挑战

这个黑客松要回答的是:“当你团队的一部分不是你更高时,好的协作长什么样?”

人类与非人类队友之间的协作,其实是调度——而一个每个决定都等待人来批准的调度器根本不算调度器,它只是额外步骤更多、且需要人再点一步的队列。正如刚才说的:人类不"批准"调度,而是用修正来保持控制——直接改 blocked_by即可。

所以 Lattice 自己负责维护排序,持续地,而且两种队友读的是同一张图。Agent 不是单纯的消费方:一个 Agent 遇到未被记录的阻塞,它就把这条信息喂回去,下一位提问者拿到的图会更准确。

共享的工作空间会随着任何一个人使用它而变得更好。 人类可以修它——固定一条边、抑制一条边,或者在 GitHub 上编辑 blocked_by,下一轮会被当作事实依据——而不是挡在它前面当审批锁。

状态

端到端已跑通。在拉它自己的 54 个 issue 的 backlog 上做了测试:一次模型请求生成 63 条候选依赖边,其中 40 条通过了验证,16 条成为阻塞依赖,分布在 3 个批次。

已构建:pipeline、store、REST API、MCP server、交互式图,以及 agent loop。 尚未完成:定时 GitHub Action、DEMO_MODE fixtures、部署。

快速开始

查看不需要数据库也不需要 GitHub token:store 基于 PGlite(真实 Postgres 的内嵌版本),而且如果 GITHUB_TOKEN 未设置,会自动使用 gh auth token

npm install
npm run build          # types + backend (tsc) + web (next build)
npm test               # 11 graph unit tests, then writes artifacts/graph.json

运行它

两个终端。后端以编译后的形式运行——这个路径不包含任何本机二进制,也不会挂掉:

# terminal 1
npm run build && npm start -w @lattice/backend      # :3001

# terminal 2
npm run dev -w @lattice/web                          # :3000

打开 http://localhost:3000,粘贴任意一个公开 GitHub 仓库 URL,它就会运行分析。你已经分析过的仓库会列在同一页面上。

npm run dev(两个服务热重载)使用的是 tsx。如果报错 The package "@esbuild/darwin-arm64" could not be found,表示 npm 丢了一个可选的二进制包——rm -rf node_modules package-lock.json && npm install --include=optional 能修复它。上面编译后的路径可以完全绕开这个问题。

分析一个仓库

需要 OpenRouter 的 API key。复制 .env.example.env,然后设置 OPENROUTER_API_KEYLATTICE_OWNERLATTICE_REPO

npm run analyze        # ~1 model request for a 50-issue backlog

该过程期望会持续几分钟:Ox Alpha 是推理模型,整个 backlog 在一次调用里放进,所以重复运行是即时的——响应按 prompt hash 缓存,这也保护了每天 50 次免费请求的额度。

命令

作用

npm run build

构建全部三个包

npm test

图单元测试,然后输出 artifacts/graph.json + schedule.json

npm run analyze

LATTICE_OWNER/LATTICE_REPO 跑一次 pipeline 运行

npm run agent -- --agents 3

3 个 agent 通过 MCP 认领工作;断言租约是原子的

npm start -w @lattice/backend

编译后的后端,监听 :3001

npm run dev -w @lattice/web

Web 应用,监听 :3000

如果要使用托管的 Postgres(Neon)而不是内嵌版,设置 DATABASE_URL

Stop the backend with Ctrl-C, not kill -9

PGlite 写的是真实的 Postgres 数据目录。写入中途强杀会损坏它,store 就没了。服务器在 SIGINT/SIGTERM 上会正常关闭数据库,所以用 Ctrl-C 安全。如果真的损坏了,运行 npm run import -w @lattice/backend 会从 artifacts/graph.json 恢复上一次的 graph——既不需要模型请求,也不需要 GitHub token。

不用浏览器检查它

curl localhost:3001/api/health
curl "localhost:3001/api/graph" | jq '.stats'
curl -X POST localhost:3001/mcp \
  -H 'content-type: application/json' \
  -H 'accept: application/json, text/event-stream' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

使用 MCP server

后端通过 Streamable HTTP 在 /mcp 提供 MCP,以及一套 REST API。后端启动即有现成 API,无需再单独建一个进程。

npm run build && npm start -w @lattice/backend    # :3001, MCP at /mcp

Claude Code

claude mcp add --scope local --transport http lattice http://localhost:3001/mcp
claude mcp list          # lattice: ... - ✔ Connected

仓库里提交了 .mcp.json,这对任何克隆仓库的人都同样好用,于是 claude 会自动接上这个 server。

Copilot coding agent

Copilot 云端 agent 需要一个公网 URL,所以要先部署后端(issue #52)。完整教程,包括如何让一个不同的仓库指向某个 Lattice 实例:docs/13-using-lattice-mcp.md

COPILOT_MCP_LATTICE_TOKEN 未设置时,认证会被完整跳过;这也正是本地使用零配置的原因。把它设置好后再把后端暴露出去。

任何其它客户端

npx @modelcontextprotocol/inspector    # then connect to http://localhost:3001/mcp

两个方向

自上而下——"我该做什么?"

list_ready_work        issues nothing is blocking, ranked by how much they unblock
claim_next_issue       take one atomically, with a briefing; two agents never collide
report_progress        returns what your work just unblocked

自下而上——"我想发布 #6,什么必须先存在?"

plan_for_issue         the whole prerequisite chain, in build order
get_issue_context      blockers, dependents, and what they need from you
explain_dependency     why an edge exists, with the quote it was inferred from
report_dependency      a blocker you discovered; enters the graph for everyone

把 Agent 指向一个目标,Agent 会直接拿到按顺序排列的计划:

plan_for_issue(6)
  2 issue(s) must land before #6, in 2 step(s).
  step 1: #3  Put Adyen behind a PaymentProvider interface
  step 2: #4  Checkout session endpoint returns a provider-agnostic session
  then    #6  Native checkout in the app

每个 step 内部是相互独立的,所以它可以用任意顺序做,也可以同时交给多个 agent。Web 应用的面板也展示同样的计划,还有一个 Copy 按钮,点击即可把它作为 prompt 发给 agent。

机器可读的图

npm test 会写入 artifacts/graph.jsonartifacts/schedule.json。这让调度表能进入 diff:改一个破除环的权重,critical path 的变化都会成为一个可评审的 diff,而不是一句"图形似乎变了"的模糊感觉——同时它还是仓库里最便宜的集成测试:如果这个文件是良构且无环,说明整个纯核心已经接好线。

架构一览

一个 npm-workspaces monorepo 里的两个服务:

  • apps/backend — 读取 GitHub、跑推理、拥有 store、提供 REST API 和 MCP server。

  • apps/web — 交互式关系图。只持有后端 URL 和一个 API token(无其他任何东西):没有 database URL,没有 GitHub token,没有模型 key。

docs/01-architecture.md

文档

文档

内容

docs/00-context.md

黑客松背景、评判标准、提交要求

docs/01-architecture.md

组件、数据流、状态存在哪、技术栈决策

docs/02-inference-pipeline.md

五个推理层、LLM prompt、反幻觉检验

docs/03-graph-scheduling.md

Tarjan、破环方法、批次、关键路径、影响范围

docs/04-mcp-surface.md

agents 会调的七个 MCP tools

docs/06-workstreams.md

团队五条并行 split

docs/07-demo-script.md

两分钟 demo,分步脚本

docs/08-risks.md

坦诚的短板、回退方案、止损规则

docs/09-github-api-notes.md

已验证的 endpoints、headers,以及会咬人的坑

docs/10-model-provider.md

OpenRouter + Ox Alpha:设置、schema 注意事项、速率限制、隐私

docs/11-graph-store.md

图存那,三层缓存分别是什么

docs/12-rest-api.md

Web 应用的 REST 契约

docs/13-using-lattice-mcp.md

把 Lattice 接入另一个 GitHub Copilot App 仓库

AGENTS.md

agents 应该如何在仓库中工作

快速开始

还没门——脚手架就是 issue #1。这一节对应评审标准“别人能按这个 README 运行你吗?”,所以会放在提交前写好。目标:从 clone 到 graph ≤5 步,再加一个不需要 token 的 DEMO_MODE=1 演示路径。

License

MIT

A
license - permissive license
Not graded
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • -
    license
    B
    quality
    Not graded
    maintenance
    Enables AI-driven orchestration of GitHub development workflows including automated issue analysis, code generation, code review, and PR creation through multiple specialized agents. Integrates with GitHub Actions to automate the complete development process from issue to pull request.
    7
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables AI agents to automate GitHub repository management, issue tracking, and commits using natural language.
    24
    Apache 2.0
  • A
    license
    B
    quality
    B
    maintenance
    Enables AI agents to interact with GitHub (search repos, read files, issues, PRs), analyze code for quality and issues, and manage tasks with priority sorting.
    7
    MIT

View all related MCP servers

Related MCP Connectors

  • One shared brain for your AI coding agents: team memory, agent Q&A, tasks, and file claims.

  • Coding agents from Claude Code, Cursor and Codex claim jobs and lock files on one shared board.

  • Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/J-o-n-a-t-h-a-n-M-u-e-l-l-e-r/lattice'

If you have feedback or need assistance with the MCP directory API, please join our Discord server