Skip to content
elbay-malikPublic

About

AI copilot for a sprint board: a tool-loop agent whose every write waits for human approval, plus a public MCP server. Vue 3, Hono on Cloudflare Workers, AI SDK, trajectory evals.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

DevSprint Copilot

CI

An AI copilot for a sprint board, built to show how an agent can be useful without being trusted:

  • every answer is grounded in real tool calls
  • every write the copilot proposes waits for a human to approve it
  • the same issue tools are served to outside AI assistants over MCP, writing to the same live board behind their own host's permission prompt

Live demo: https://devsprint.elbaymalik.com Public MCP server: https://mcp.devsprint.elbaymalik.com/mcp (Streamable HTTP) Demo video: coming with the v1.0.0 release

Try it

The live demo runs a real model: Groq's openai/gpt-oss-120b. It has no fallback, so a busy minute can end in a rate-limit message. Ask it anything about the board. These six prompts are the demo scenarios, and each one exercises a different part of the system. A real model words its answers its own way, and may take a slightly different route than described here:

Prompt What you'll see
Summarize Sprint 12 and draft release notes for v1.5.0., then Looks good, save it. Three chained tool calls, a release-notes diff against v1.4.2, then an approval card before anything is saved
We're closing Sprint 12 today — mark every remaining open issue in the sprint as done. Five separate approval cards, one per issue. Deny one with a reason, approve the rest in one press, and watch the agent say so
Deploy v1.5.0-rc.1 to staging. A gated deployment that streams build → test → migrate → release live, with a working Cancel
Is Sprint 12 on track? Show me the burndown. A burndown chart drawn from the tool's own series, and a narration that names the blocker
Mark DS-42 as done — the billing export shipped this morning., then Yes, that one. A typed ISSUE_NOT_FOUND error, a search for what you meant, and a fresh approval for the fix
In Claude Desktop or Cursor: add the MCP server above, then ask it to create an issue The write lands on the same board. Switch back to the demo and it appears in the backlog

The board is shared by every visitor and resets itself at midnight UTC. Reset board in the header restores it at any time, once you confirm it for everyone.

Messages go to a third-party AI provider (Groq) and may be logged. Don't enter personal information.

How it works

flowchart LR
  Browser["Vue 3 SPA<br/>(Workers Static Assets)"] -->|"UI message stream"| Api["api Worker<br/>Hono + AI SDK v6 ToolLoopAgent"]
  Api -->|"service binding, MCP client"| Mcp["mcp-issues Worker<br/>5 issue tools"]
  Host["External MCP host<br/>Claude Desktop, Cursor"] -->|"Streamable HTTP"| Mcp
  Api --> DO[("WorkspaceDO<br/>board, approval ledger,<br/>token budget, reset alarm")]
  Mcp --> DO
  Api -.->|"OTLP/HTTP JSON, optional"| Langfuse["Langfuse"]
  Api -.->|"Groq or mock"| Model["Model"]
Loading

A turn starts when the SPA streams a question to the api Worker. There, an AI SDK v6 ToolLoopAgent chains up to six tool calls before answering.

  • Reads run immediately and come back as cards in the transcript: an issue table, a burndown chart, a release-notes diff.
  • Writes don't run until approved. Each write becomes a signed approval card, and only an explicit, single-use approval lets it execute. "Approve all" answers a group's board writes in one press, still one approval per card, and an applied status change, reassignment or new issue can be undone from its card, from the server's own record of what it changed.
  • The five issue tools live in a separate MCP Worker, which the agent reaches over a service binding as an ordinary MCP client. Any outside AI assistant can use the same server.
  • There's one board. Both Workers read and write it through one Durable Object, so a write from Claude Desktop shows up in the SPA.

Decisions worth reading

Each of these is an ADR. Several record a plan that didn't survive contact with the real thing, and say why.

Decision Why it's interesting
Approvals are signed, and single-use through our own ledger The SDK's signature has no nonce, so a captured approval could be replayed. The ledger closes that, with its exceptions named rather than hidden
The workspace lives in a Durable Object It's what lets two Workers, and any outside MCP host, share one board. It replaced the planned D1 database
Deployment cancel is an api route A browser that stops reading a stream does not reliably abort the Worker, so the run would finish while the card said "cancelled"
Undo reads the server's record, not the card's The undo route takes only a change id. The workspace records each write's before and after as it lands, and refuses once the board has moved on
Tracing without the OpenTelemetry SDK About 200 hand-written lines. The "risky on workerd" assumption was measured, not believed
Two spend controls, deliberately different Cloudflare's rate limiter disclaims being an accounting system, so the token cap lives elsewhere. Prompt injection is answered by the approval gate, not a prompt
Scenario specs assert three layers Green tests turned out to prove little. A mutation pass found ten product bugs every suite let through
A deploy that bootstraps itself The two Workers bind each other, so a first deploy has to break the cycle. Also why PR previews stop at the SPA
Switching to a live model The "one-line" switch would have sent every turn to two retired models. Running the scenarios live first found that and five quieter gaps the scripted model had hidden

How it's tested, and what "green" was found not to prove

The recurring lesson of this repo is that a passing suite is a claim, not proof. So the tests are checked as well as run:

  • Trajectory evals. These check which tools the agent calls, in what order and with what arguments, against each demo scenario's own written assertions. They run in CI against the scripted model, and against a live model on demand (EVAL_MODEL_PROVIDER=groq pnpm eval).
  • One browser test per scenario. Each checks three layers: the page, the stream the browser actually received (tool order, and approval strictly before execution), and the Durable Object. The last is there because a card and the database can disagree.
  • An audit of all 173 scenario requirements. It found two evals passing for the wrong reason.
  • A mutation pass. Ten one-line breaks were made deliberately, such as a frozen stats header, an upside-down chart, an empty progress bar, and successful writes shown in red. All ten passed every suite. Each now fails a test written for it.
  • Accessibility. axe checks WCAG 2.2 AA across five UI states in both themes. Lighthouse's 100 only ever sees the empty first page, and missed three real violations.
  • Deploy smoke checks. Each one names the misconfiguration it catches.

By the numbers: 365 unit and eval tests, 29 browser tests, and Lighthouse 100 / 100 / 100 / 100 on the live site, on mobile and desktop.

What it deliberately doesn't do

  • Per-visitor workspaces. Multi-tenancy is a non-goal, so everyone shares one board, reset daily (ADR-0014).
  • An approval card for outside assistants. The public MCP server takes writes from any MCP client without the copilot's approval card. The host's own permission prompt is the gate there, and the server bounds writes by rate, request size and 40 new issues until the board resets. At most 20 of those 40 may come from MCP clients, so they can't use up the copilot's, and their cards say "via MCP" (ADR-0020, ADR-0024).
  • Unlimited use of the live model. It runs on free tiers. A per-IP rate limit, a daily token share per client and a daily token cap stop one visitor spending it for everyone, and once one of those is reached the copilot says so instead of failing. They cover model spend only: if the hosting platform's own request quota runs out, the demo shows as offline until it refills.
  • Full markdown in chat. Answers render bold, lists, tables and code, but never links, and never through v-html. A model repeating planted board text can't produce markup or a clickable URL (ADR-0022).
  • A few planned UI pieces were never built: the Sprint and Deploys tabs, a release-notes badge, and a distinct "interrupted" stage state. The demo scenarios doc names each one, rather than describing them as if they existed.
  • API previews. PR previews cover the SPA only, against the production api. A preview of the api would write to the live board.

Running it locally

Prerequisites

  • fnm, which switches to Node 24.18 via .node-version
  • corepack (corepack enable), which provides pnpm 11.10 as pinned in packageManager

Getting started

git clone git@github.com:elbay-malik/DevSprint.git
cd DevSprint
corepack enable
pnpm install
pnpm dev        # web on :5173, api on :8787, mcp-issues on :8788

That runs end to end on the scripted model, with no keys and no account. To use a real model locally, copy apps/api/.dev.vars.example to apps/api/.dev.vars and set GROQ_API_KEY.

Model providers

Groq openai/gpt-oss-120b is the only live model (ADR-0021). The Gemini fallback was removed, because Google's terms allow only its paid services for an app open to users in the EEA, Switzerland or the UK (ADR-0026). MODEL_PROVIDER takes auto, groq or mock. wrangler.jsonc sets auto, which falls back to the mock when no key is set, so a fresh clone still runs without any. Each response reports the resolved route in the X-DevSprint-Model header. Three spend controls limit a live model: 60 chat requests a minute per IP, a 25,000-token daily share per client, and a 100,000-token daily cap. The share is per client address, so a few addresses can still use up the cap between them (ADR-0016). The mock never counts against the share or the cap.

Scripts

Script What it does
pnpm dev all package dev servers in parallel
pnpm lint ESLint (single root flat config)
pnpm format:check Prettier check
pnpm typecheck recursive per-package typecheck
pnpm test recursive Vitest, then node --test for scripts/
pnpm eval trajectory evals for the 6 demo scenarios
pnpm build recursive builds (web: vite; api: wrangler dry-run)
pnpm ci:local CI's checks and e2e jobs, on this machine
pnpm deploy:all deploy all three Workers, then smoke-check them (--plan to preview)
pnpm smoke read-only checks against the live deployment

Browser tests live in apps/web:

pnpm --filter @devsprint/web test:e2e

Playwright starts all four servers itself and pins the scripted mock model, so the end-to-end run needs no API key and never spends provider quota. It includes one test per demo scenario (e2e/scenarios.spec.ts).

Running CI locally

pnpm ci:local runs the workflow's checks and e2e jobs on this machine, in about three minutes. Use it whenever GitHub Actions cannot run. --checks or --e2e runs one job.

  • The steps come from .github/workflows/ci.yml itself, so the two cannot drift.
  • It starts the e2e servers itself (apps/web/e2e/servers.ts, shared with Playwright's config), waits until the api really reaches the MCP Worker, and stops them with SIGTERM so wrangler can leave its dev registry cleanly.
  • It never kills a process it did not start. If a port the stack needs is taken, it names the process holding it and stops.
  • It drops credentials from the environment each step gets (scripts/ci-env.ts): CLOUDFLARE_*, CF_*, WRANGLER_*_TOKEN, GROQ_*, GOOGLE_*, LANGFUSE_*, GH_TOKEN and GITHUB_TOKEN. It is not a sandbox. It runs the workflow's steps as you, and a step can still read ~/.wrangler or an .env file from disk.
  • Logs go to .ci-local/.
  • Edits under apps/api during a run fail the test on screen. wrangler dev restarts the Worker and has no flag to stop it, which ends any stream in flight. The web server runs without HMR, so edits to the SPA's files can't reload a page mid-test.

Prefer it to a bare CI=1 … test:e2e on a workstation. Playwright's own readiness probe reuses its first connection, so another process on a port it polls can stall it until it times out.

Package contract: every workspace package exposes typecheck (web: vue-tsc --noEmit; others: tsc --noEmit) and, where meaningful, test (vitest run) and build. pnpm -r skips packages missing a script.

Deploying

pnpm deploy:all deploys all three Workers in the one order that works and ends with smoke checks. Pushes to main run it in CI once both test jobs pass. From a laptop it refuses unless the checkout is a clean main level with origin/main. Details are in apps/api/README.md and ADR-0019.

Repository layout

Path Package What it is
apps/web @devsprint/web Vue 3 SPA: Vite 8, Pinia, shadcn-vue (Reka UI, Tailwind v4)
apps/api @devsprint/api Hono Worker: chat route, agent loop, workspace Durable Object
apps/mcp-issues @devsprint/mcp-issues Public issues MCP server, Streamable HTTP and stateless
packages/shared @devsprint/shared Domain types, tool schemas, seed fixtures
scripts/ (root) deploy.ts, deploy-gates.ts, smoke.ts, ci-local.ts, and their tests
docs/ (none) Product brief, domain model, scenarios, wireframes, demo-video storyboard, roadmap, ADRs
PRODUCT.md, DESIGN.md (root) The product record and the design system (tokens mirrored in .impeccable/design.json)

The roadmap records all 16 phases, from design docs to this write-up, with what each one actually found.

Conventions

  • Per-phase Conventional Commits; readable history is part of the portfolio.
  • Dependency versions are pinned exactly in the pnpm-workspace.yaml default catalog (catalog: protocol); the AI SDK stays on the v6 line (ai-v6 dist-tag) — npm latest is v7.
  • shadcn-vue components are vendored, and the package is not a dependency. Add one with pnpm dlx shadcn-vue@2.7.4 add <component> from apps/web, then check the diff (ADR-0006).
  • TypeScript strict everywhere; one shared tsconfig.base.json; no project references.
  • Single root ESLint flat config + Prettier; per-package configs are forbidden.

Acknowledgements

Claude, Anthropic's AI model, was also used for building DevSprint. Claude worked some commits in this repository.

License

MIT

About

AI copilot for a sprint board: a tool-loop agent whose every write waits for human approval, plus a public MCP server. Vue 3, Hono on Cloudflare Workers, AI SDK, trajectory evals.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages