# section9d > A self-hosted software factory. GitHub issues and cron triggers become > reviewed, tested and merged pull requests, run by opencode agents inside > isolated git worktrees. ## What it is section9d is a Bun and TypeScript daemon. It watches a GitHub repository for issues labelled `factory` and for local cron triggers. Each task is claimed from a SQLite queue with one atomic statement, checked out into its own git worktree on a Conventional Commits branch (`feat/17-add-dark-mode`), and walked through a pipeline of agent stages and shell gates. The happy path ends in a squash merge. A human is paged only when the pipeline gets stuck. ## Pipeline 1. plan: read-only, writes PLAN.md with acceptance criteria and comments it on the issue. 2. setup: repo setup commands from SECTION9.json. 3. work: implements the plan and commits with Conventional Commits. Never pushes. 4. qa: repo check commands. 5. quality: repo quality commands. 6. security: TruffleHog diff blocks on any finding; semgrep findings go back to the agent for a bounded fix. 7. review: read-only, different model, requires VERDICT: APPROVE. 8. fix: bounded by maxFixRounds, findings injected into the same session. 9. prove: executes the plan acceptance criteria, requires PROOF: PASS. 10. adversarial: hostile second review with confirmed findings only. 11. wrapup: push, open or reuse the pull request, comment on the issue. 12. sync: merge origin/base into the branch; on conflict the agent resolves with the parent epic as context, gates re-run. 13. ci: gh pr checks --watch on the real GitHub runners. 14. merge: squash merge and delete the branch, only after every gate is green (one more sync lap when the PR conflicts). ## Merge rule Merge runs only when the branch has at least one commit over origin/base, qa, quality and security are green in the final round, review is APPROVE (or disabled), prove returned PROOF: PASS, adversarial is APPROVE (or disabled), the branch is in sync with origin/base, and remote CI is green. ## Commands ```bash git clone https://github.com/Dyallab/factory.git cd factory && bun install bun src/index.ts init-config opencode auth login gh auth login bun run dev ``` Mission control: ```bash bun run dashboard:serve # http://localhost:3100 bun run dashboard # one-shot ./mission-control.html ``` Status KPIs, Trends charts, per-repo costs, a sortable task index and review/adversarial/prove verdicts. Filter with `?status=`/`?repo=`/`?q=` (or `--status`/`--repo`/`--q` for the one-shot report) and page with `?page=`/`?limit=`. Read-only JSON at `/api/tasks` and `/api/tasks/:id/runs`, health at `/health`. Requeue is the only write, failed tasks only. File a task: ```bash gh issue create --repo owner/repo --label factory \ --title "docs: clarify the service contract" \ --body "Add a short table of the local services." ``` ## Configuration Per-repo policy lives in `SECTION9.json` at the target repository root. Empty model strings mean the opencode default. `models.review` should be a different model than `models.work` for an independent second opinion. `merge.enabled: false` gives PR-only mode. ## Security notes Secrets come from the environment only: `GH_TOKEN`, `DISCORD_WEBHOOK_URL`, `GITHUB_WEBHOOK_SECRET`, `CLOUDFLARE_TUNNEL_TOKEN`. Inbound webhooks are HMAC-verified. Review, prove and adversarial are read-only. There are no git hook bypasses, and the work agent is told not to push, open PRs or modify SECTION9.json and CI config. ## Links - Repository: https://github.com/Dyallab/factory - Pipeline: https://github.com/Dyallab/factory/blob/main/docs/pipeline.md - Architecture: https://github.com/Dyallab/factory/blob/main/docs/architecture.md - Agent rules: https://github.com/Dyallab/factory/blob/main/AGENTS.md - Site: https://factory.dyallab.com.ar/