feat(missions): slice 1 — end-to-end spine with stub worker#249
Closed
DaveHudson wants to merge 2 commits intomainfrom
Closed
feat(missions): slice 1 — end-to-end spine with stub worker#249DaveHudson wants to merge 2 commits intomainfrom
DaveHudson wants to merge 2 commits intomainfrom
Conversation
Replaces the label-gated `.sandcastle/main.ts` issue runner with a Droid-style Missions orchestrator backed by a local Convex deployment. This is the first of three vertical slices. The worker role in `run-agent.ts` is a stub that appends a marker to README.md and pushes a commit; reviewer/fixer/validator/replanner are explicitly not implemented yet (slices 2 and 3). The point of this slice is to land the spine — schema, scheduler, CLI, planner, status table, orchestrator state transitions, PR creation — without the additional uncertainty of real agent behaviour. What's in: - `apps/missions/`: new turborepo package hosting the Convex schema (missions, milestones, features, runs, events) plus typed mutations and queries. Runs `convex --local` for v1; commit `_generated/` so fresh clones typecheck without booting the dev server. `convex-test` covers the create/pause/resume/replan paths. - `.sandcastle/missions/`: 6 modules. `orchestrator.ts` (state machine + Convex client) and `scheduler.ts` (dep + path-conflict resolution) carry the behaviour; the rest is glue. `bun:test` coverage on schema, scheduler, status-view. - `.claude/skills/mission-plan/`: portable planner skill, invokable interactively (`/mission-plan`) or headlessly via the CLI shim. - `.sandcastle/main.ts`: replaced with a CLI dispatcher (`plan`/`run`/`status`/`pause`/`resume`). - `package.json`: `mission` script (was `sandcastle`); `convex:dev` script; root `convex` + `picomatch` deps; root `typescript` devDependency for the new sandcastle typecheck step. - Root CI now also typechecks `.sandcastle/` — previously only workspace packages were typechecked, so orchestrator regressions could ship. What's out (deleted): `eligibility.ts`, `issue.ts`, `github.ts`, `implement-prompt.md`, `implement-docs-prompt.md`, `review-prompt.md`. The Ready-column flow is gone. Verification: `bun run ci` clean (typecheck across 7 packages + tests + sandcastle typecheck + biome + no-suppressions). Smoke-tested plan/status/pause/resume against local Convex; `mission run` deferred to the manual smoke since it creates a real PR.
…plan files `bun run mission` runs from the repo root, so Bun's built-in dotenv loader never reads `.sandcastle/.env`. Result: `CONVEX_URL` (and any other env the orchestrator needs) is missing and the CLI fails with "Missing required environment variable" even though the var is configured. Fix: load `.sandcastle/.env` explicitly inside `main.ts` based on the script's own location, so the CLI works regardless of CWD. Existing process env still wins over file values, matching standard dotenv behaviour. Also: - gitignore + biome-exclude `smoke-*-plan.json` and `mission-plan-*.json` so local smoke-test plan files don't pollute formatter output or get committed. - Include the Convex `ai-files` artefacts that `convex dev --local` installed into `apps/missions/` (AGENTS.md, CLAUDE.md, convex.json, _generated/ai/, skills-lock.json). They're stable Convex-shipped guidelines that improve agent quality when editing this package.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #248 (slice 1 of three vertical slices).
Summary
.sandcastle/main.ts's label-gated issue runner with a Droid-style Missions orchestrator backed byapps/missions/(Convex--local)..sandcastle/missions/(behaviour inorchestrator.ts+scheduler.ts; rest is glue) plus a portablemission-planClaude Code skill..sandcastle/so future orchestrator regressions don't slip through.Verification
bun run ciclean (turbo typecheck + tests across 7 packages,.sandcastle/typecheck, biome, no-suppressions).convex-testcovers create/pause/resume/replanMilestone (7 tests inapps/missions/).bun:testcovers schema (6), scheduler (8), status-view (7).mission plan --apply,mission status,mission pause,mission resumeall work end-to-end.bun run convex:devin one terminal,bun run mission plan --apply <plan.json>thenbun run mission runin another. Confirms the stub worker creates a real branch, commit, and PR; status table reflects each transition. Skipped here because it creates a real PR.Test plan
bun run convex:dev; checkapps/missions/.env.localforCONVEX_URL.CONVEX_URLin.sandcastle/.env./tmp/smoke-plan.json(or write your own).bun run mission run; expect a branch + commit + PR opened, status table goes todo → running → review → done.Notes
apps/missions/convex/_generated/is committed so fresh clones typecheck without first bootingconvex dev. Standard Convex pattern..sandcastle/CLAUDE.mdis unchanged; AFK-rules still apply when an agent runs slice-1's CLI.runAgent({ role, ... })shape is designed so the swap doesn't restructure the orchestrator.