vpac / AGENTS.md
156 lines · 139 sloc · 8.64 KB · 3609dfbd82867dc1034a443f8f9ced529ddbbedd
Raw

AGENTS.md

for agents landing in this repository cold.

vpac is a package manager written in V on top of libalpm, the library that backs pacman. it is a frontend of its own — its own listings, prompts, progress drawing, and a json event protocol for other frontends — with a config file of its own, and two package sources beyond the sync dbs: the pkgbuild repos and arbitrary git repos built with vpac itself.

the repository

src/         module main: the frontend. one file per mode, plus the shared
             parts every mode reaches for.
src/cli.v    argument parsing and mode dispatch. modes: s q w n m b i r u
             l o d c t a k v f (search info which deptest mark build
             install remove upgrade files owner orphans clean tree
             autoremove rank verify find).
src/config.v the configuration. the forms (path pkg network rank pkgbuild
             options search clean tree color progress spinner
             mirrorlist repo) are read from a blip file, /etc/vpac.d/config.lip by
             default, and every setting keeps a __global here.
src/trans.v  transaction begin/prepare/commit/cleanup and the interrupt
             handler. src/db.v holds the db paths, repo registration and
             freshness; src/db_check.v is verify's -D modes.
src/ipc.v    --ui ipc: the event protocol (one json object per line) and
             the prompter a frontend answers questions with.
src/ui.v     the shared progress display and callback wiring for libalpm;
             src/prompt.v the terminal's side of every question.
(the rest of src/)
             one file per command. install is remote.v, and remove.v
             autoremove.v upgrade.v modify.v write the db too; find.v
             files.v orphans.v deptest.v are read-only; verify.v and
             verify_full.v check the disk; pkgbuild.v pkgbuild_install.v
             build_repo.v mirrors.v privilege.v are the network- and
             privilege-flavored ones.
vmakepkg/    a library module of its own: PKGBUILD.lip (blip format;
             lip.v) and PKGBUILD.vsh (a V script; vsh.v) both turn into a
             real PKGBUILD (and a .install for hooks) whose phases makepkg
             runs, delegating back into vpac or v.
pkgs/        two tiny packages vpac itself builds as smoke tests of the
             vmakepkg formats.
src/*_test.v, vmakepkg/*_test.v   the tests.
src/testdb/  a module only the tests import: the one writer of libalpm
             local dbs they share. vpac never imports it, so it is in no
             build of the program.

the cross-references, and the rule about them

the binary links libalpm through the V module alpm (a file that begins module alpm), evaluates its config and lip files through the module blip.vlib.blip, and reuses this repo's own vmakepkg. these dependencies live outside the repository: on a machine, V finds them under its module directory (typically ~/.vmodules), often as symlinks to checkouts beside vpac.

building and testing

house style

gotchas learned the hard way (do not rediscover them)

conventions that hold the system together

the issue tracker

there is no TODO file: the checklist of the 2026-11-09 review sweep moved into the issue tracker — 140 issues, one per checklist id, and #2 their index. tracker numbers do not match the ids; look an id up in the index (#2) first. later sweeps filed some findings two or three times: close the duplicates of an issue with it. work changes state in the tracker, not in files: open an issue first (fj issue create -R origin), push the fix, then close the issue with the resolution (fj issue close -R origin N -w "..."). fj talks to the origin host (git.vorelabs.dev) and needs a token such as configured under fj auth list — user read, repository read, issue read/write.