vpac / AGENTS.md
159 lines · 142 sloc · 9.11 KB · 841315c100c81d9e6b14c4b55a25d4e3d12db762
Raw

AGENTS.md

for agents landing in this repository cold.

vpac is a package manager written in V on top of the native nspkg engine, which follows pacman/libalpm behavior. 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. Vile assignments such as network-connections = 3 use the forms (path pkg network rank pkgbuild
             options search clean tree color progress spinner
             mirrorlist repo) are read by stutter through Vile, /etc/vpac.d/config.vile 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 nspkg;
             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/    builds PKGBUILD.vile, PKGBUILD.scm and PKGBUILD.vsh directly
             as the invoking user. native phases pass literal argv and native
             .NSPKG-HOOK executables run inside the nspkg transaction root.
pkgs/        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 uses the native V module nspkg (a file that begins module nspkg), evaluates its config through stutter and package recipes through vile.scheme, and reuses this repo's own vmakepkg. Vile and stutter are local development checkouts, not released modules. Vile needs a V development toolchain with its arena APIs. 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. the native backend uses libarchive, GPGME/GnuPG, seccomp on Linux and libc. its downloader uses V by default and libcurl with -d nspkg_libcurl; production builds have no libalpm header or link dependency. nspkg keeps its C reference under tests/coracle; never substitute it for the production backend.

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.