lightjob
# lightjob
lightjob is a minimal MCP server that turns a written spec into a job. A coding agent does the job in a clone of a git repository. A gate and a judge check the delivery before it is paid and merged.
## The loop
1. `job_post` pins a spec file at a commit with a bounty.
2. `job_brief` shows the worker the requirements, scope, gate and rules.
3. `job_gate` runs the gate in the worker's clone.
4. `job_deliver` hands in patches, notes and logs as a round.
5. `job_judge` applies the latest delivery, checks scope, gate, shortcuts and comments, and reads the deviations.
6. `job_verdict` records a pass or fail.
7. `job_pay` writes the payment to the ledger once the delivery has passed.
8. `job_merge` applies the passed patches to the repository after the merge commands pass.
## Installing and connecting
lightjob needs Python 3.11 or newer and uses only the standard library.
```
pip install -e .
python -m lightjob
```
The server speaks MCP on stdin and stdout. It keeps its state in one directory, chosen in this order: the `--dir` argument, then the `LIGHTJOB_DIR` environment variable when it is not empty, then `~/.lightjob`. It prints the choice on stderr at start.
Claude Code:
```json
{
"mcpServers": {
"lightjob": {
"command": "python",
"args": ["-m", "lightjob", "--dir", "/path/to/state"]
}
}
}
```
Gemini CLI:
```json
{
"mcpServers": {
"lightjob": {
"command": "lightjob",
"args": ["--dir", "/path/to/state"]
}
}
}
```
Antigravity:
```json
{
"mcpServers": {
"lightjob": {
"command": "python",
"args": ["-m", "lightjob"],
"env": {"LIGHTJOB_DIR": "/path/to/state"}
}
}
}
```
## Tools
| Tool | What it does |
| --- | --- |
| `job_post` | Post a job: pin a spec file in a git repository at a commit, with a bounty. |
| `job_lint` | Warn about a spec before posting it; changes nothing. |
| `job_brief` | Show the exact work and rules of a job. |
| `job_gate` | Run the job's gate in your clone: the fast gate if the spec has fast lines, else the full gate. |
| `job_inspect` | Read one open item of the latest report whole, or the latest delivery's diff with lines added and removed per file. |
| `job_deliver` | Deliver a round: a directory with patches, notes and logs. |
| `job_judge` | Judge the latest delivery. |
| `job_verdict` | Record a pass or fail for the latest delivery. |
| `job_pay` | Write a payment to the ledger for a job whose latest delivery passed. |
| `job_merge` | Apply a passed delivery's patches to the repository if the merge commands pass in a clone. |
| `job_question` | Ask the poster a question about a job. |
| `job_answer` | Answer a question; with spec and commit, pin a new spec version. |
| `job_close` | Close a job that is not paid, with a reason. |
| `job_status` | List all jobs, or give the full history of one. |
## Spec format
A spec is a markdown file. Its first line is a `# ` title. A line `Why: ...` gives the reason. A `## Requirements` section holds items written `R1: ...`, `R2: ...`. An optional `## Edge cases` section holds items written `E1: ...`. Fenced blocks named `lightjob-...` carry the machine-read parts:
| Block | Content |
| --- | --- |
| `lightjob-scope` | Required. One path glob per line; the delivery may change only these. |
| `lightjob-gate` | Required. One command per line, and the gate options below. |
| `lightjob-context` | References such as `path:10-20` or `path#symbol`, shown in the brief. |
| `lightjob-examples` | One example per line, written `<call> => <expect>`. |
| `lightjob-evidence` | One item per line, written `<path>: <what it must show>`; paths stay inside `evidence/`. |
| `lightjob-merge` | Commands `job_merge` runs; without the block it runs the gate's commands. |
| `lightjob-env` | One `NAME=value` per line, set when the gate runs. |
## Gate options
A line of the `lightjob-gate` block that does not start with one of these options is a command.
| Option | Meaning |
| --- | --- |
| `timeout` | Seconds allowed per command, a positive number. |
| `warm` | `true` or `false`: reuse one clone between judgings. |
| `keep` | A path glob that a warm clone keeps when it is reset; may repeat. |
| `sibling` | `name=path@commit`: a second repository checked out at a commit next to the clone; may repeat. |
| `comments` | `allowed`: lets the delivery add comments and docstrings. |
| `mutants` | Number of mutants from 1 to 100, or `off`. |
| `mutants-budget` | Seconds for mutation, from 1 to 600. |
| `fast` | A command `job_gate` runs instead of the full gate; may repeat. |
| `repeat` | Run the last command this many times, from 2 to 50. |
| `load` | Busy processes, from 0 to 256 or `auto`, kept running while the repeats run. |
## Running the tests
```
python -m unittest discover -s tests -q
```
`tests/test_readme.py` checks that the tables and config examples above match the code.
lightjob is released under the MIT license; see `LICENSE`.
TDQS
Scored across 14 tools
Most tools have clearly distinct lifecycle roles, but job_judge, job_verdict, and job_gate overlap: judge encompasses gate and analysis, verdict records the decision, and gate runs only the gate. The descriptions clarify the distinctions, but an agent could still hesitate about which to call after a delivery.
All 14 tools use a consistent job_ prefix in snake_case, such as job_post, job_deliver, and job_verdict. A few names use nouns rather than verbs, but the overall pattern is highly predictable and readable.
14 tools is well within the ideal range and each maps to a distinct lifecycle step: post, lint, brief, deliver, judge, verdict, gate, inspect, question, answer, merge, pay, close, and status. No tool feels redundant or missing from a count perspective.
The surface covers the full job lifecycle from posting and linting through delivery, judging, Q&A, merge, payment, and closure, plus status and history. No obvious workflow or CRUD gap remains for the stated domain.