← 开源

Let's compose rich plans together

TypeScript
增长势头
+224 小时新增 Star+0.3%
721
Star
44
Fork
+18
本周
5
贡献者
创建于 2026-07-27 · 更新于 2026-12-06 · 今日第 4356 名
主要开发者
README

Chopin

Chopin is a GitHub Next research prototype where teams and an AI Planner write technical documents together. Use it for technical specifications, implementation plans, Requests for Comments (RFCs), and decision records linked to a GitHub repository.

People own the document and every decision. The Planner reads your repository, proposes document edits, and opens Decision cards when the codebase can't settle a choice. For background on the project, see the GitHub Next project post.

Important

Chopin is experimental research software, not a supported GitHub product or production service. Expect incomplete workflows, operational limits, and breaking changes.

There is no public Chopin server. Run Chopin locally with Run locally, or deploy your own server with Self-hosting.

chopin-tour.mp4

What Chopin does

Each document links to one GitHub repository and combines three views:

  • Document: People and the Planner edit one shared rich-text document saved as Markdown. Live cursors show who is editing, and recent Planner edits highlight briefly.
  • Chat: The team talks beside the document, and messages inform the Planner. Alone in a document, every message goes straight to @chopin. In a group, Chat waits for a natural pause unless someone mentions @chopin.
  • Decisions: Answers to open questions and accepted comments save as attributed records separate from the prose. Later edits can't overwrite what the team decided.
chopin-comments.mp4

Research and investigations: Type /research in a document to start background web research from a brief. Chopin publishes finished reports as child documents with their own Document and Decisions views. Type /investigate to run a codebase investigation on a fixed Git commit using the hosted runner pool; results publish with interactive tables and charts.

chopin-research.mp4

Builds from a plan: Select Build plan to have the Planner draft a task graph and start a coding agent on the hosted runner pool. The agent clones the repository in an isolated session, implements the tasks, and opens pull requests crediting you. External coding agents can also connect over Model Context Protocol (MCP) (/mcp) to read, edit, decide, and build plans.

Planner backends: By default (HARNESS=copilot-sdk), the Planner runs on GitHub Copilot inside the server with read-only repository tools. It edits only the Chopin document and can't run shell commands or push to GitHub. Two other backends are available:

  • HARNESS=remote: Runs the Planner on the hosted runner pool (or an external client over /api/v1/agent). See Hosted runner pool and Agent connection.
  • HARNESS=atomic: Runs an unsandboxed Atomic session under the server user. Shell and file-writing tools stay blocked, while local reads, extensions, and MCP servers use the server user's access. Read Choose and trust a harness before enabling it.

Hosted runner pool

On servers configured with a pool, Chopin runs remote Planners, codebase investigations, and builds on server-managed Linux and Windows virtual machines (VMs). You don't install a command-line interface (CLI) or connect your own computer. The pool provides these capabilities:

  • One VM per document: The first launch for a document claims a ready VM from the pool. Every Planner turn, investigation, and build runs there in its own sandbox (Microsoft eXecution Container (MXC) on Linux, Windows isolation sessions on Windows). When done, the VM is retired and replaced.
  • One operating system (OS) per document: Choose Linux or Windows in the Chat composer until the document's Planner starts (its first message to the Planner or its first turn, whichever comes first). From then on, the document's work runs on that OS. To work on the other OS, choose New document on Windows (or Linux) from the same menu.
  • Operator-managed sizing: Operators choose each OS's runner size on the Runners page (/runners), defaulting to 8 vCPU and 32 GB RAM. The page shows Running, Idle, and Queued counts for Linux and Windows.
  • Your AI accounts: Connect your AI accounts once on /ai-accounts. Chopin proxies model calls so raw API keys never leave the server.

To set up and operate a runner pool, see Hosted runner pool and chopin CLI and Isolated agent sessions.

Collaborate with the Planner

Write in Chat normally, or mention @chopin for an immediate reply. The following table shows how Chopin responds to common messages:

Message What happens
should we cover the export format? Saves in Chat for the Planner's context. Replies right away when you are alone, or waits for a pause in a group.
@chopin Calls the Planner right away to respond to recent messages.
@chopin draft the export section Calls the Planner right away with that request.
@chopin compare #Release plan Reads the linked document at its latest revision, then replies here.

Type # in Chat to link same-repository documents, research children, headings, Decisions, or repository files. Links stay valid after renames. Chat messages also name untitled documents without overwriting titles a person set.

Each Planner turn and background worker runs on the AI account (or GitHub Copilot seat under copilot-sdk) of the person who triggered it. See Chat, the Planner, and research and Hosted agent (Planner).

Run locally

Follow these steps to run Chopin on your development machine.

Before you begin

Install these prerequisites first:

  • Bun 1.4.5 (mise.toml selects it automatically with mise).
  • Docker Engine with Docker Compose (for local PostgreSQL).
  • A GitHub App registered for your local instance.
  • A GitHub account with push or admin access to a test repository, plus a GitHub Copilot seat for the default Planner.
  • An OPENAI_API_KEY or JEV_API_KEY for the Chat turn-taking and decisions helper model (required when AGENT=on).

1. Register a GitHub App

Create a GitHub App with these URLs:

Homepage:  http://127.0.0.1:8787
Callback:  http://127.0.0.1:8787/auth/github/callback
Setup URL: http://127.0.0.1:8787/auth/github/setup

Configure these settings on the App:

  1. Enable expiring user authorization tokens.
  2. Disable OAuth during installation.
  3. Disable webhooks.
  4. Grant these repository permissions (explained in Repository permissions):
Contents:        Read and write
Pull requests:   Read and write
Workflows:       Read and write
Actions:         Read-only
Checks:          Read-only
Commit statuses: Read-only
Issues:          Read-only
Metadata:        Read-only (automatic)

To restrict sign-in with GITHUB_ALLOWED_ORGANIZATIONS or GITHUB_ALLOWED_TEAMS, add this permission and install the App on each organization (see Organization admission):

Members:         Read-only

2. Install dependencies and configure .env

Install workspace dependencies, copy the sample environment file, and generate a session encryption key:

bun install
cp .env.example .env
openssl rand -hex 32

Fill in these values in .env:

  • GITHUB_APP_SLUG, GITHUB_APP_CLIENT_ID, and GITHUB_APP_CLIENT_SECRET
  • SESSION_ENCRYPTION_KEY (the 64-character hex string from openssl)
  • OPENAI_API_KEY or JEV_API_KEY

To run without the Planner, background jobs, or a helper-model key, set AGENT=off. External coding agents can still use /mcp.

3. Start PostgreSQL and Chopin

Start PostgreSQL, run migrations, and launch the development server:

bun run db:up
bun run migrate
bun run dev

compose.local.yaml exposes PostgreSQL on port 5432, so use it only on a trusted development machine. For network-facing servers, follow Self-hosting.

If port 5432 is in use, start PostgreSQL on another loopback port and update DATABASE_URL in .env:

docker run -d --name chopin-db \
  -e POSTGRES_USER=chopin -e POSTGRES_PASSWORD=chopin -e POSTGRES_DB=chopin \
  -p 127.0.0.1:5439:5432 postgres:17

Two limits apply to a custom container: bun run test:postgres hard-codes 127.0.0.1:5432 in package.json, and bun run db:down won't remove it.

Press Ctrl-C to stop Chopin. Run bun run db:down to stop and remove the Compose containers.

4. Sign in and create a document

Verify the local server and create your first document:

  1. Open http://127.0.0.1:8787 and sign in with GitHub.
  2. Install the GitHub App on a test repository when prompted.
  3. Pick that repository, create a document, and start writing.

Open the document in a second browser profile to test live collaboration. You can also enable local collaborators to test with demo accounts (Lily and Felix) in one browser.

Public web search for /research calls GitHub's Copilot MCP endpoint using your GitHub App token. Self-registered Apps might not be accepted by that endpoint; if search fails, see Self-hosting troubleshooting.

Boundaries and limits

Keep these boundaries in mind when running Chopin:

  • GitHub.com only: GitHub Enterprise Server isn't supported.
  • Repository reads: Under copilot-sdk, the Planner reads the default branch as it stood when the session started, inside that single repository.
  • Access and authentication: Browser users sign in with GitHub, pass any server allowlist, and need repository access through the App installation. Public repositories don't make Chopin documents public. Read access views documents; push or admin access edits and runs the Planner. MCP callers sign in to Chopin with OAuth and pass the server allowlist; Chopin reads their repository role with their own sign-in (older clients may still send a GitHub bearer token unless MCP_GITHUB_BEARER=deny). See Authentication and authorization.
  • Data sent to model providers: Document text, Chat messages, and repository excerpts go to the active provider (copilot-sdk, atomic, or your connected accounts under remote). Background workers receive only the inputs for their task. Public web research sends only your submitted brief.
  • Credentials and storage: Documents, Chat, Decisions, research, jobs, and encrypted credentials live in PostgreSQL. SESSION_ENCRYPTION_KEY stays outside the database. See Storage and persistence.
  • Helper model and optional features: When AGENT=on, Chopin requires a helper model (OPENAI_API_KEY, JEV_API_KEY, or DECISIONS_MODEL) for Chat pacing and reply checks. Chat-derived Decision cards and research offers are off by default (CONVERSATION_PLAN=on enables them).
  • Single active writer: One Chopin server process writes to a database at a time. For zero-downtime restarts, overlap two processes with HANDOVER=wait (see Deploys nobody can see).

Documentation

Browse the guides by role.

Using Chopin

The following table lists guides for people collaborating in Chopin or connecting a coding agent:

Topic Document
Chat, Planner pacing, /research, and offers Chat, the Planner, and research
Raise, compare, and settle Decisions Decisions
Run codebase investigations on the pool Codebase investigations
Turn approved plans into tracked builds Building from a plan
Connect a coding agent (Claude Code, Codex, Copilot CLI, or Atomic) over MCP Connect a coding agent over MCP
Look up what each MCP tool takes, returns, and refuses Chopin MCP tool reference

Operating Chopin

The following table lists guides for deploying, securing, and operating a Chopin server and runner pool:

Topic Document
Deploy and operate a Chopin server Self-hosting
Configure GitHub sign-in and allowlists Authentication and authorization
Let pool runners push as Chopin's GitHub App GitHub App identity
Operate the hosted runner pool (chopin CLI) Hosted runner pool and chopin CLI
Sign or verify pool signed objects Pool signed objects
Pool VM isolation (Linux MXC versus Windows sessions) Isolated agent sessions
Linux pool sandboxes (MXC and AppArmor) Linux pool sandboxes (MXC)
Windows pool sessions (MXC and session helper) Windows pool sessions (MXC)
Overlap restarts with zero downtime Deploys nobody can see
Serve pool launches' git through Chopin The git proxy

Contributing and architecture

The following table lists guides for contributors working on Chopin's codebase, design system, and releases:

Topic Document
Repository map, commands, and engineering rules Working on Chopin
System architecture, packages, and trust boundaries Architecture
Channel identity, HTTP routes, and Decisions inbox Repository channels
PostgreSQL schema, browser cache, and writer lease Storage and persistence
Planner harnesses, AI accounts, and credential proxy Hosted agent (Planner)
Remote Planner WebSocket wire protocol Agent connection
Durable background jobs and isolated workers Background jobs and workers
Design tokens, contrast checks, and exceptions Design contract
Copying and patching assistant-ui components Add an assistant-ui element
Develop on a remote exe.dev VM Develop Chopin remotely on exe.dev
Verify authenticated PR previews with Playwright Test GitHub Next PR previews with Playwright
Release the chopin CLI Release the chopin CLI

Development

Follow Run locally to install prerequisites, configure .env, and start PostgreSQL. Verify changes with these commands:

bun test                 # unit and in-memory adapter tests
bun run test:postgres    # PostgreSQL storage contract, lifecycle and OAuth server tests
bun run e2e              # browser and system integration suite
bun run design:behavior  # Playwright design behavior and contrast suite
bun run types            # TypeScript checks across the workspace
bun run build            # build web client and chopin connector
bun run ci               # formatting, lint, token, and design-contract checks

Run bun run e2e:browsers once to install Chromium. On Linux, Chromium also needs system libraries that a fresh machine lacks; without them the first bun run e2e fails, and its long output includes libatk-1.0.so.0: cannot open shared object file (search it for libatk). To install them once, run the following command as your normal user, not with sudo; Playwright asks for your sudo password when it runs the package manager:

bun run e2e:deps

To see what it would install without changing anything, run bun run e2e:deps -- --dry-run. It lists the missing packages and exits 1 while any are missing; once they're installed, it says All system dependencies are installed. and exits 0.

The end-to-end (E2E) suite builds the web app and starts temporary PostgreSQL databases and Chopin servers automatically. For the full contributor guide, see Working on Chopin.

Report security issues through SECURITY.md. Participation follows the Code of Conduct, and the source is under the MIT License.

排名相邻

AI Rank iPhone 版

随时追踪 AI 模型榜单

在 App Store 下载