|
| 1 | +# Gittensory miner deployment |
| 2 | + |
| 3 | +Two form factors for running `@jsonbored/gittensory-miner`: **laptop mode** (single machine, zero Docker) and **fleet mode** (containerized workers with a shared data volume). Both are 100% client-side for core operation — the miner never uploads source and never requires a hosted Gittensory callback to boot. Credentials (GitHub tokens, etc.) stay on the operator's machine or in their own secret store; nothing is baked into images. |
| 4 | + |
| 5 | +| | Laptop mode | Fleet mode | |
| 6 | +|---|---|---| |
| 7 | +| **Best for** | One contributor machine, local experimentation | Many parallel miner attempts on a host or small cluster | |
| 8 | +| **Dependencies** | Node.js `>=22.13.0` only | Docker (or compatible runtime) + Node image or custom image | |
| 9 | +| **State** | SQLite files under `~/.config/gittensory-miner/` (override with `GITTENSORY_MINER_CONFIG_DIR`) | Same SQLite layout on a mounted `/data` (or `GITTENSORY_MINER_CONFIG_DIR`) volume | |
| 10 | +| **Setup** | `npm install -g @jsonbored/gittensory-miner` or workspace build | `docker run` with env + volume (see below) | |
| 11 | +| **Footprint** | One Node process, local disk for ledgers/queues | One container per worker; scale horizontally by adding containers | |
| 12 | + |
| 13 | +## Laptop mode walkthrough |
| 14 | + |
| 15 | +1. Install Node.js 22.13+ and the package: |
| 16 | + |
| 17 | + ```sh |
| 18 | + npm install -g @jsonbored/gittensory-miner@latest |
| 19 | + # or from a checkout: |
| 20 | + npm install && npm --workspace @jsonbored/gittensory-miner run build |
| 21 | + ``` |
| 22 | + |
| 23 | +2. Inspect what is installed and where local state will live (no network calls): |
| 24 | + |
| 25 | + ```sh |
| 26 | + gittensory-miner status |
| 27 | + gittensory-miner doctor |
| 28 | + ``` |
| 29 | + |
| 30 | +3. Expected layout after first use (default paths): |
| 31 | + |
| 32 | + ```text |
| 33 | + ~/.config/gittensory-miner/ |
| 34 | + claim-ledger.sqlite3 # soft issue claims (#2314) |
| 35 | + plan-store.sqlite3 # persisted MCP plan DAGs (#2318) |
| 36 | + portfolio-queue.sqlite3 # local portfolio queue |
| 37 | + event-ledger.sqlite3 # manage-loop audit trail |
| 38 | + governor-ledger.sqlite3 # governor decisions |
| 39 | + ``` |
| 40 | + |
| 41 | + Override the directory with `GITTENSORY_MINER_CONFIG_DIR` or `XDG_CONFIG_HOME` (same resolution chain as `@jsonbored/gittensory-mcp`). |
| 42 | + |
| 43 | +4. Optional per-repo miner goals: copy [`.gittensory-miner.yml.example`](../../.gittensory-miner.yml.example) to a target repo as `.gittensory-miner.yml`. See [`docs/miner-goal-spec.md`](docs/miner-goal-spec.md). |
| 44 | + |
| 45 | +## Fleet mode walkthrough |
| 46 | + |
| 47 | +There is no separate published miner fleet image yet. Run the same CLI inside a standard Node container, mount persistent state, and inject secrets at runtime (never bake them into the image): |
| 48 | + |
| 49 | +```sh |
| 50 | +docker run --rm -it \ |
| 51 | + -e GITTENSORY_MINER_CONFIG_DIR=/data/miner \ |
| 52 | + -e GITHUB_TOKEN \ |
| 53 | + -v miner-data:/data/miner \ |
| 54 | + node:24-slim \ |
| 55 | + bash -lc 'npm install -g @jsonbored/gittensory-miner@latest && gittensory-miner doctor && gittensory-miner status' |
| 56 | +``` |
| 57 | + |
| 58 | +- **`/data` volume** — holds all SQLite state so containers are disposable. |
| 59 | +- **`GITHUB_TOKEN`** — supplied by the operator at run time; the image contains no credentials. |
| 60 | +- **Scale** — launch additional containers with the same volume (or partitioned config dirs) for parallel attempts. |
| 61 | + |
| 62 | +The repo-root [`docker-compose.yml`](../../docker-compose.yml) documents the **self-hosted review stack** (the `gittensory` API/orb), not the miner CLI. Miners are clients of that stack (or of github.com directly) and do not require it to run locally. |
| 63 | + |
| 64 | +## Invariants |
| 65 | + |
| 66 | +- Core miner bookkeeping (claims, plans, queues, ledgers) works offline after install. |
| 67 | +- `gittensory-miner status` and `gittensory-miner doctor` make **no network calls**. |
| 68 | +- Discovery/ranking primitives that touch GitHub only run when explicitly invoked and only perform documented GETs unless a future command says otherwise. |
| 69 | +- Operators own secret injection; images and packages ship without embedded tokens. |
0 commit comments