How ski043/marshal-factory works
marshal-factory turns Linear issues into pull requests through a human-visible software-agent workflow. Issues arrive from Linear, the panel, or Slack; the runner claims work, launches a T3 Code thread on a branch, and the agent investigates, implements, verifies, and opens a PR. Reporter events flow through the ingest function into Postgres and appear in the live panel. Owners answer questions and review merges; eligible confident PRs may be merged automatically. The README establishes these product relationships; unsampled implementation details are represented at their existing directory paths.
Main entry points: index.ts Runner daemon · ops.ts Job operations · linear.ts Source adapters · page.tsx Factory panel
Components 23
Owner panel
- Factory panel
app/(panel)/page.tsx - Live panel data
lib/live-queries.ts - Panel actions
app/actions/new-job.ts - Slack routes
app/api/slack/commands/route.ts
Intake and telemetry
- Source adapters
lib/sources/linear.ts - Reporter hooks
hooks/report.ts - Ingest function
functions/ingest/index.ts - Event ingestion
lib/ingest.ts - Event contracts
lib/events.ts
Runner workflow
- Runner daemon
runner/index.ts - Job operations
runner/ops.ts - T3 client
lib/t3-client.ts - Agent harness
lib/harness.ts - Modal sandbox
lib/sandbox.ts
External integrations
- GitHub App
lib/github/app.ts - Pull request services
lib/github/pulls.ts
Review and persistence
- Merge workflow
runner/merge-service.ts - Inbox decisions
lib/inbox.ts - Postgres state
db/schema.ts - Owner authorization
lib/auth/server.ts
Other components
- Owner
- Linear issues
- Slack
Connections 27
- Linear issues → Source adapters: provides issues
README.md - Source adapters → Runner daemon: supplies work
README.md - Owner → Factory panel: files jobs
README.md - Factory panel → Panel actions: submits jobs
- Panel actions → Source adapters: files jobs
- Slack → Slack routes: submits commands
README.md - Slack routes → Source adapters: files jobs
- Reporter hooks → Ingest function: sends events
README.md - Ingest function → Event ingestion: processes events
functions/ingest/index.ts - Event ingestion → Postgres state: writes events
README.md - Runner daemon → Job operations: coordinates work
runner/index.ts - Job operations → T3 client: starts threads
- Job operations → Agent harness: runs harness
README.md - Agent harness → Modal sandbox: runs optionally
README.md - Runner daemon → Ingest function: posts events
- Runner daemon → Postgres state: reads job state
runner/index.ts - Job operations → Source adapters: updates issues
- Job operations → Pull request services: opens pull requests
README.md - Pull request services → GitHub App: uses credentials
lib/github/pulls.ts - GitHub App → Pull request services: authenticates requests
lib/github/pulls.ts - Runner daemon → Merge workflow: dispatches merges
README.md - Merge workflow → Pull request services: checks and merges
runner/merge-service.ts - Owner → Inbox decisions: answers questions
README.md - Factory panel → Live panel data: loads live data
- Live panel data → Postgres state: queries state
lib/live-queries.ts - Factory panel → Owner authorization: requires owner
lib/auth/server.ts - Event ingestion → Event contracts: validates events
lib/events.ts