Autonomous coding-agent server that turns a natural-language task into a traced LangGraph run: plan, coordinate isolated workers, verify with deterministic gates, review, retry or recover, then report evidence.
- Agent orchestration: a LangGraph
StateGraphroutesgate -> plan -> coordinate/execute -> verify -> review -> error_recovery -> report, with worker coordination as the default path and single-agent execution as recovery fallback. - Production AI runtime: Express API, WebSocket live feed, optional Postgres persistence, auth/rate limits, GitHub connector and webhook/invoke/retry surfaces, LangSmith trace resolution, and run-level telemetry.
- Reliability discipline: deterministic verification, file-overlay rollback on retry, scoped tool boundaries, failure catalog, benchmark renderer, load tests, and a done gate that enforces typecheck plus a minimum test baseline.
Watch the 8-second workflow video
Reproducible local demo: docs/demo.md
Expected run shape:
{
"runId": "9b5c...",
"phase": "done",
"steps": [
{ "index": 0, "description": "Inspect target files", "status": "done" },
{ "index": 1, "description": "Apply focused edit", "status": "done" },
{ "index": 2, "description": "Add regression test", "status": "done" }
],
"verificationResult": { "passed": true, "newErrorCount": 0 },
"traceUrl": "https://smith.langchain.com/..."
}Live surfaces:
- Dashboard:
/dashboard - Runs:
/runs - Benchmarks:
/benchmarks - Health:
/api/health - API reference: docs/API-REFERENCE.md
pnpm install
cp .env.example .env
pnpm devServer starts on http://localhost:4200.
curl http://localhost:4200/api/healthRun the deterministic checks:
pnpm type-check
pnpm testProduction-style local start:
pnpm build
pnpm startOptional features:
OPENAI_API_KEYis required for real agent runs with the default provider routing.ANTHROPIC_API_KEYorANTHROPIC_AUTH_TOKENenables Anthropic model selections.SHIPYARD_DB_URLenables Postgres-backed run persistence; without it, Shipyard uses memory.LANGCHAIN_TRACING_V2=trueplusLANGCHAIN_API_KEYenables LangSmith tracing.SHIPYARD_ENABLE_WEB_SEARCH=trueplusBRAVE_SEARCH_API_KEYenables the guarded web-search tool.
flowchart LR
User["User, dashboard, API, GitHub webhook"] --> API["Express API + WebSocket"]
API --> Gate["gate node"]
Gate --> Plan["planner"]
Plan --> Coord["coordinator"]
Coord --> Workers["isolated worker agents"]
Plan --> Execute["single-agent fallback"]
Workers --> Verify["verify: typecheck + tests"]
Execute --> Verify
Verify --> Review["reviewer"]
Review -->|done| Report["report"]
Review -->|continue| Execute
Review -->|retry| Plan
Review -->|escalate| Recovery["error_recovery"]
Recovery -->|retry planning| Plan
Recovery -->|retry execution| Execute
Recovery -->|fatal| Report
Workers --> Tools["tool registry"]
Execute --> Tools
Tools --> Files["target repo files"]
Tools --> Shell["guarded bash"]
Tools --> Search["grep, glob, ls, web_search"]
API --> Store["Postgres or in-memory store"]
API --> Metrics["metrics, audit, dead letter"]
Report --> Trace["LangSmith trace URL"]
Request lifecycle:
- Client submits an instruction through
POST /api/run, WebSocketsubmit, invoke route, or GitHub connector flow. gateclassifies chat vs code work and choosesplan,coordinate,execute, orend.plandecomposes the instruction into vertical steps and target files.coordinatedispatches worker agents for planned steps, isolates worker state, merges edits, and falls back when file ownership conflicts.- Tools can read, search, edit, write, run guarded bash, inject context, ask the user, spawn agents, and open PRs through explicit adapters.
verifyruns deterministic checks and records baseline vs newly introduced errors.reviewdecidescontinue,done,retry, orescalate; retry paths use feedback and file-overlay rollback.reportreturns final state, cost estimate, next actions, and LangSmith trace URL when tracing is enabled.
Core state lives in src/graph/state.ts and tracks the instruction, plan steps, file edits, tool-call history, verification result, review decision, retry count, trace URL, token usage, worker results, and loop diagnostics.
Primary loop:
| Stage | Code | Responsibility |
|---|---|---|
| Gate | src/graph/nodes/gate.ts |
Route chat, code, continuation, and direct execution paths. |
| Plan | src/graph/nodes/plan.ts |
Inspect repo context and create executable steps. |
| Coordinate | src/graph/nodes/coordinate.ts, src/multi-agent/* |
Decompose step work, run workers, merge edits, handle conflicts. |
| Execute | src/graph/nodes/execute.ts |
Single-agent tool loop used as fallback or sequential mode. |
| Verify | src/graph/nodes/verify.ts |
Run typecheck/tests and compute new vs pre-existing errors. |
| Review | src/graph/nodes/review.ts |
Deterministic guards plus model review for continue/done/retry/escalate. |
| Recovery | src/graph/nodes/error-recovery.ts |
Retry planning/execution or stop with a fatal report. |
| Report | src/graph/nodes/report.ts |
Summarize final state, cost, trace, and next actions. |
Tool boundaries:
- File tools:
read_file,edit_file,write_file,revert_changes. - Search tools:
grep,glob,ls, optionalweb_search. - Runtime tools:
bash,inject_context,ask_user,spawn_agent,commit_and_open_pr. - Edit safety:
edit_fileuses a four-tier cascade: exact match, whitespace-normalized match, Levenshtein fuzzy match, then full rewrite as logged last resort. - Bash safety: dangerous commands are blocked and covered by tests.
Failure recovery:
- Retries carry structured review feedback back to planning or execution.
- File overlays allow rollback when review chooses retry.
- Watchdogs detect no-edit stalls, repeated tool loops, ambiguous edits, provider errors, auth errors, and max tool rounds.
- Coordinator conflict handling falls back to safer execution when parallel workers touch shared files.
- Dead-letter and retry APIs preserve failed invoke/webhook events for replay.
Core run APIs:
curl -X POST http://localhost:4200/api/run \
-H "Content-Type: application/json" \
-d '{"instruction":"Add a regression test for the parser edge case"}'
curl http://localhost:4200/api/runs/<run-id>
curl -X POST http://localhost:4200/api/runs/<run-id>/followup \
-H "Content-Type: application/json" \
-d '{"instruction":"Now explain the tradeoff"}'Additional surfaces are documented in docs/API-REFERENCE.md: invoke batch/retry, GitHub webhooks, dead-letter replay, checkpoints, metrics, readiness, benchmark snapshots, model key settings, and GitHub App repo connection.
Error behavior is structured for automation:
{
"error": "Human-readable message",
"code": "MACHINE_CODE",
"details": { "field": "context" }
}- LangSmith integration is in
src/runtime/langsmith.ts; it supportsLANGCHAIN_*andLANGSMITH_*env vars. SHIPYARD_TRACE_PUBLIC=truecreates shareable public trace links for demos and benchmarks.- Tool calls, node decisions, parser decisions, token usage, cost, trace URLs, audit events, and live WebSocket events are tracked.
- Dashboard live feed documents file-edit and tool-activity streaming in docs/DASHBOARD-LIVE-FEED.md.
- Metrics and audit behavior are covered in docs/SECURITY.md and docs/ops-metrics.md.
Run tests:
pnpm testRun the repo done gate:
pnpm done:checkBenchmark a seeded instruction:
./scripts/bench.sh 01-strict-typescript
pnpm exec tsx scripts/render-benchmarks.ts
pnpm exec tsx scripts/render-issues.tsEvidence:
- Benchmark report: docs/benchmarks.md
- Failure catalog: docs/issues.md
- Reliability report: docs/RELIABILITY-REPORT-2026-03-26.md
- Cost notes: docs/AI-COST.md
Current benchmark docs include a verified 7/7 step rebuild sequence, LangSmith trace links, token/edit totals, recent swarm failures, and known open failure classes.
Shipyard is a Node service:
pnpm build
pnpm startCurrent deployment notes in this repo name Hostinger as the live host and expose:
- Dashboard:
https://agent.ship.187.77.7.226.sslip.io/dashboard - Base URL:
https://agent.ship.187.77.7.226.sslip.io
No Dockerfile or Compose file is currently present. Deployment proof is therefore the Node build/start path, env contract in .env.example, health/readiness routes, optional Postgres persistence, and the live Hostinger endpoint.
Read docs/SECURITY.md before exposing beyond localhost.
Implemented surfaces include:
- Global API bearer token through
SHIPYARD_API_KEY. - Invoke/retry bearer or
X-Shipyard-Invoke-Token. - GitHub webhook HMAC via
SHIPYARD_GITHUB_WEBHOOK_SECRET. - Header sanitization for dead-letter persistence.
- Bot-loop prevention and webhook sender allowlists.
- Dashboard XSS hardening on user-controlled preview fields.
- Rate limits on run/followup/write endpoints.
Remote multi-user deployments still need full same-origin CSRF tokens for every state-changing route.
- Demo script: docs/demo.md
- API schema/reference: docs/API-REFERENCE.md
- Architecture presearch: docs/PRESEARCH.md
- Benchmark report: docs/benchmarks.md
- Failure catalog: docs/issues.md
- Reliability report: docs/RELIABILITY-REPORT-2026-03-26.md
- Dashboard live feed: docs/DASHBOARD-LIVE-FEED.md
- Security model: docs/SECURITY.md
- Workflow poster: docs/assets/shipyard-agent-workflow-poster.png
- Workflow video: docs/assets/shipyard-agent-workflow.mp4
- Worker orchestration improves context isolation but can introduce shared-file conflicts; Shipyard detects overlap and falls back to safer sequential execution.
edit_fileoptimizes for surgical changes, but tier-4 full rewrites remain a last-resort escape hatch and are logged as degraded edits.- LangSmith public trace links are excellent demo evidence but should be disabled with
SHIPYARD_TRACE_PUBLIC=falsefor sensitive work. - Docker packaging is not yet represented in-repo; production deploy evidence currently depends on Node build/start plus the external Hostinger host.
src/graph/ LangGraph builder, state, routing, and node implementations
src/multi-agent/ Worker orchestration, isolated worktrees, merge/materialization
src/tools/ Tool registry and adapters
src/runtime/ Loop, persistence, checkpoints, LangSmith, shutdown
src/server/ Express routes, dashboard, WebSocket, GitHub, invoke/retry
scripts/ Benchmarks, load tests, migrations, done gate, renderers
test/ Vitest coverage for graph, runtime, server, tools, scripts
docs/ API, security, benchmarks, reliability, plans, demo assets
No license file is currently present in this repository.
