commit e9c01dc4af6599222caa2b8c8e84c403be4863c1
parent 6c7f6d9779ebeae5067ffa3b12395b140014b262
Author: Bharatvaj Hemanth <bharatvaj@yahoo.com>
Date: Mon, 14 Sep 2026 20:32:25 +0530
parent 6c7f6d9779ebeae5067ffa3b12395b140014b262
Author: Bharatvaj Hemanth <bharatvaj@yahoo.com>
Date: Mon, 14 Sep 2026 20:32:25 +0530
Add AI project context
2 files changed, 129 insertions(+), 0 deletions(-)
diff --git a/AGENTS.md b/AGENTS.md @@ -0,0 +1,80 @@ +# AGENTS.md - Minci + +## What this project is + +Minci is a small C/POSIX shell CI system derived from Kristaps Dzonsons' BSD.lv code. Keep changes conservative, explicit, and easy to audit. Prefer simple C, POSIX shell, semantic HTML, and small CSS changes over abstractions or dependencies. + +## Architecture + +- `minci.sh` is the runner. It reads `~/.minci` or `/etc/minci`, fetches configured repositories, sources a Jobfile when present, runs jobs, and submits signed results. +- `main.c` is the CGI/FastCGI server. It accepts signed result submissions, handles small control requests, and renders the web UI. +- `db.ort` is the openradtool schema. Generated files such as `db.c`, `extern.h`, `db.sql`, and `minci.db` must not be committed. +- `minci.css` is the entire UI stylesheet. +- `README.md` is user/admin documentation. +- `design-plans/` and `evals/` on the `ai` branch hold AI-oriented plans and operational evaluations. + +## Active model + +- Projects are configured in the minci database and in runner config as `repo = ...` lines. +- Runner branch selection is global per config via `branch = ...`. +- A repository may provide `.config/Jobfile`. +- A runner operator may instead provide `jobfile = ...` or `/etc/minci.d/<repo>/Jobfile` to keep deployment logic outside the tested branch. +- Jobfile `triggers` name the branch/ref being tested, not necessarily the branch that stores an operator-held Jobfile. +- Result submissions go to `minci.cgi`/`minci.fcgi`; execution happens in `minci.sh`. + +## Current deployment notes from cdg-1 / ci.nply.org + +- Public service: `https://ci.nply.org/cgi-bin/minci.cgi` and FastCGI at `/cgi-bin/minci.fcgi`. +- Installed binaries: `/usr/lib/cgi-bin/minci.cgi`, `/usr/lib/cgi-bin/minci.fcgi`. +- Installed runner: `/usr/local/bin/minci.sh`. +- Runner state and DB: `/var/lib/minci`. +- CSS: `/usr/share/minci/minci.css`. +- The deployed FastCGI binary was built with `DATADIR=/var/lib/minci`. +- For the web start experiment it was built with `RUNNER=/usr/local/sbin/minci-submit`. +- `www-data` is in the `gitolite3` and `git` groups on cdg-1; the runner normally executes as user `git`. + +## Gitolite hook model + +- Gitolite uses `LOCAL_CODE => $rc{GL_ADMIN_BASE}/local`. +- Repository `post-receive` hooks are symlinks to `/home/git/.gitolite/local/hooks/common/post-receive`. +- Repo-specific hooks are not enabled in `.gitolite.rc`, so the common local hook is the active adapter path. +- The common hook should stay repository-agnostic: + - mirror only when `gitolite.mirror.simple` is set; + - minci only when `gitolite.minci = true` is set. +- Do not hardcode project names in the hook. + +## Build/test commands + +On a host with openradtool/kcgi/sqlbox available: + +```sh +make +``` + +For cdg-1 style deployment builds: + +```sh +make DATADIR=/var/lib/minci \ + CFLAGS='-g -W -Wall -Wextra -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings -Wno-unused-parameter -DDATADIR="/var/lib/minci" -DRUNNER="/usr/local/sbin/minci-submit"' +``` + +On systems without openradtool tools, `make` will fail because `ort-c-source`, `ort-c-header`, and related tools are missing. Do not treat that as a code failure. + +Always run: + +```sh +sh -n minci.sh +``` + +## Code rules + +- Preserve the ISC license header and existing style. +- Keep shell POSIX-compatible; avoid Bashisms. +- Keep C changes small and in the style already present: explicit helper functions, simple ownership, `kasprintf`/`free`, and existing kcgi patterns. +- Avoid new tables unless the feature truly needs durable state. +- Be careful with result submission signing. The server verifies MD5 signatures built from sorted/formatted fields and the user's API secret. +- Do not commit generated files: `db.c`, `extern.h`, `db.sql`, `minci.db`, object files, CGI binaries. + +## Known caveat + +A direct web start request currently creates the start marker. The wrapper `/usr/local/sbin/minci-submit` works when invoked as `www-data`, and gitolite push-triggered offload is the reliable trigger path. If relying on web-triggered execution, re-test FastCGI process-manager behaviour before assuming the runner actually starts from the web request.
diff --git a/CONTEXT.md b/CONTEXT.md @@ -0,0 +1,49 @@ +# Minci + +Minci is a minimal continuous integration system. Its domain is intentionally small: runners produce authenticated results, and the server records and displays them. + +## Language + +**Project**: +A named repository known to the minci server. Results are grouped by project name. +_Avoid_: Repo, package, application + +**Runner**: +The shell process that clones or freshens projects, executes checks, and submits results to the server. +_Avoid_: Agent, worker, build server + +**Server**: +The CGI/FastCGI program that records authenticated submissions and renders the web interface. +_Avoid_: Runner, dashboard + +**Jobfile**: +A POSIX shell file that defines project-specific jobs and trigger mappings. It is sourced by the runner. +_Avoid_: Pipeline file, workflow file, CI config + +**Trigger**: +A Jobfile mapping from a Git ref to one or more job names. It determines which jobs apply to a fetched branch/ref. +_Avoid_: Webhook, event, hook + +**Run**: +A grouped integration attempt for one project revision and target. A run may contain one or more jobs. +_Avoid_: Build, report + +**Job**: +A named step within a run with its own status, time range, log, and optional artifacts. +_Avoid_: Task, step, report + +**Report**: +The legacy single-record result model predating Jobfile runs and jobs. +_Avoid_: Run, job + +**Artifact**: +A published output attached to a job by name and URL, optionally with a SHA-256 hash. +_Avoid_: Release, package + +**Start request**: +A server-side request for the runner to run a project or job. It is not itself a result. +_Avoid_: Submission, report + +**Cancellation request**: +A server-side request for the runner to stop a running job. It is not itself a result. +_Avoid_: Failure, cancelled job
: nply/minci