Replace libalpm with a native V engine while preserving the public API #1

Open
opened 2026-11-11 03:31:05 +00:00 by diviocity · 0 comments
Owner

Implement a faithful V package engine using the pacman checkout as the behavioral reference. Preserve the existing public V API unless a justified change is also applied to vpac. Completion requires replacing the entire backend; partial ports do not complete this issue.

Reference: /home/diviocity/git/pacman, v7.1.0-18-ga6f7467d. Consumer: /home/diviocity/Projects/vpac. Current published checkpoint: alpm.v 20209bb and vpac 3129534. The default public backend runs in V with no production libalpm headers or linkage. The complete behavior and diagnostic audit remains open. All repository verification tools and network fixtures must be V; no Python files or runtime dependency.

Stages:

  • Native version ordering, dependency parsing/formatting, streaming checksums. Version comparator matched 172,225 comparisons against checked-out version.c.
  • All 29 core list methods in V, retaining C-compatible allocation/layout during transition. Direct-source parity, ASan/UBSan and injected allocation-failure tests pass. Fixed placeholder output lists in search, key extraction and transactions.
  • Native package model, .PKGINFO and DB metadata parsing, exact file lookup, lazy existing-local-database reader. Parity covers metadata, backups, extended data, integer overflow and provider semantics. Public Package.satisfies now follows deps.c for multiple provisions and versioned provisions.
  • Native sync database archive reader using libarchive only for codecs/records. Plain and gzip parity, invalid/truncated archives, upstream metadata line limit, and missing-versus-empty checksum fields are tested. Libarchive declarations preserve the existing V mtree opaque types.
  • Package archives, .MTREE, changelog and full file metadata. Partial/full loads, scan-versus-mtree preference, malformed-mtree fallback, plain/compressed mtree, ownership/mode/digest metadata and changelog reads match libalpm. Added compatible Package.mtree_step and migrated vpac verification off its direct C iterator call. A standalone native core executable builds with only the repository and vlib module paths and links libarchive without libalpm.
  • Native handle/options core, DB registration/cache ownership, local DB creation, POSIX searches, groups and ignore matching. Published in 6938eb1, with parity tests and a standalone no-libalpm core smoke.
  • Native read-only public facade integration, published in 372eead.
  • Native dependency graph/checks, satisfier/provider selection, recursive dependency resolution with rollback, package conflicts, removal closure and reverse/group queries. Published in 45d45ca.
  • Native transaction state, database lock ownership, async unlock/interruption and removal preparation. Published in d1d80ec; 320 flag/target combinations match C victim order, errors and events.
  • Native install/upgrade/replacement preparation core, target/architecture validation, conflict/skip/replacement questions, reason and victim policy, old-package snapshots and cached download sizes. Published in a66ceae; public transaction methods still use libalpm.
  • Native signature verification/trust core, package/database validation, checksum precedence, isolated keyrings, import questions and public decoding/issuer extraction. Published in a318fac.
  • Native parallel download transport, mirror/cache-server error policy, resumption/conditional requests, companion signatures, limits and lifecycle callbacks. Published in 1c6b9f6.
  • Native package-cache fetching orchestration, sync database refresh, retrieval events and external fetch callbacks. Published in 0a294a2.
  • Native download sandboxing and privilege separation.
  • Transport integration coverage for WKD/keyserver import. Published in 8f92976.
  • Native local database entry preparation, desc/files serialization and writing, reason updates and flat entry removal. Published in 6d50e82.
  • Native removal execution core, rooted filesystem operations, pacsave policy, callbacks/progress and interruption. Published in b4c7459; extensions integrated in ae1059e.
  • Native filesystem file-conflict preflight, ownership-transfer removal skips and owned conflict/event/progress data. Published in 63f003a.
  • Native transaction archive/cache/download finalization, keyring/integrity checks, download-space preflight and DOWNLOADONLY commits. Published in 84e3b1a.
  • Native payload and special database archive extraction primitives, sparse data and metadata restoration. Published in 03deaf3; install/upgrade execution integration remains pending.
  • Install/upgrade commit, safe extraction, pacnew/upgrade backups and special database archive files. Integrated with native mount-space preflight and published in 3d0a6ea.
  • Native process runner, hooks and scriptlet execution primitives, chroot/privilege behavior and removal integration with output/events/interruption. Published in ae1059e.
  • Install/upgrade hook/scriptlet/progress integration. Published in 3d0a6ea.
  • Native public event/question/progress/download/fetch adapters and typed log delivery, published in 372eead.
  • Hook parser, validation, dependency and discovery diagnostics through both the core and public facade, published in be6da3b.
  • Complete remaining source diagnostic/event parity, including cache warnings, metadata diagnostics, signature/trust errors and process setup/I/O failures.
  • Switch the complete public facade to native and remove production libalpm calls/header/link requirements, verified on actual vpac binaries.
  • Complete behavioral auditing of every public entry point and edge case; declaration compatibility alone is insufficient.
  • Restore retained legacy MD5 package queries from bdedf621^ and preserve historical local validation markers, published in 61ae4c8.
  • Replace all five Python verification tools/network fixtures with V, including TLS/SNI, sanitizer and allocation-failure coverage, published in 61ae4c8.
  • Final API compatibility and hermetic integration coverage across vpac and vmakepkg; push the completed work and close this issue only when the entire replacement is finished.

Validation at the metadata stage: all 27 vpac src binaries, both vmakepkg binaries, all 10 then-current alpm binaries, and v -check . passed. At the integrated sync archive stage all 12 alpm binaries, all 27 frontend binaries and both vmakepkg binaries pass. v -check . is clean after resolving a cross-module C declaration conflict. Next is package archive and .MTREE loading, followed by the native handle/read-only facade. The full rewrite remains active and incomplete.

Package archive stage validation: v -check . clean; all 14 alpm binaries, all 27 vpac src binaries, and both vmakepkg binaries pass. Standalone core smoke runs successfully and ldd confirms no libalpm dependency for that core executable. The default public backend still uses libalpm, so the full rewrite remains incomplete. Next: native handle/options and read-only facade.

Handle core stage validation: alpm.v 6938eb1 and vpac 18806e3 are pushed. All 16 alpm test binaries, all 27 vpac src binaries and both vmakepkg binaries pass; v -check . is clean. Native handle/options/query smoke builds with only the repository and vlib on its module path, runs successfully, and links libarchive without libalpm. Required database signatures fail closed until the native verifier is installed. Corrected nine option-removal wrappers, nonzero boolean options, and sandbox accessors with unchanged V signatures; vpac issue #4 closed after the consumer fixture passed. Next: dependency graph/checks, provider selection, conflict detection and preparation. Full backend replacement remains active and incomplete.

Dependency core stage: published alpm.v 45d45ca. All 20 alpm test binaries, all 27 vpac src binaries, both vmakepkg binaries, and v -check . pass. The standalone core smoke now also exercises dependency checks/order and links no libalpm. C parity covers 80 dependency-check combinations, 384 provider-policy combinations including question order/answers, prepared ordering through installed intermediaries, cycles, pulled dependencies, recursive removals, conflict reasons, group/NEEDED selection, reverse-dependency scope and first-repository version policy. Public List.find_satisfier and dependency/file-conflict payload cleanup now run in V with unchanged signatures; no additional vpac code change was needed for this stage. Native cache lookups use the name index without cloning the entire cache. The public facade, transaction prepare/commit, downloads/signatures and hooks still require replacement. Next: native transaction state/locking/preparation. Full rewrite remains active and incomplete.

Removal transaction stage: published alpm.v d1d80ec. All 22 alpm binaries, all 27 vpac src binaries, both vmakepkg binaries and v -check . pass. Native removal preparation matches C across 320 flag/target combinations, covering recurse/recurse-all, cascade, unneeded, NODEPS/NODEPVERSION, cycles, shared and optional dependencies, failure state and preparation events. Lock tests cover mutual exclusion against libalpm itself, descriptor 0, CLOEXEC, mode 0000, foreign locks and missing-lock cleanup. Generated C confirms native async unlock/interruption contain only descriptor operations, comparisons and scalar stores. The standalone core smoke now prepares a native removal and still links no libalpm. No system package transaction was committed. Next: native add/upgrade preparation and migrate vpac’s remaining direct C unlock call through a compatible async V method. Full replacement remains active and incomplete.

Async facade migration: published alpm.v 5e54e78 and vpac 6c7f5d1. The new compatible Handle.unlock_async() int method keeps the signal path free of V error construction. vpac has no remaining C.alpm calls. Killed-child tests verify owned-lock release, the acquisition window and foreign-lock preservation; generated C confirms both the wrapper and signal handler contain no allocations. All 22 alpm, 27 vpac src and two vmakepkg test binaries pass, and v -check . is clean. vpac issue #5 is closed. Native install/upgrade/replacement preparation is next; the normal public backend still links libalpm and the full rewrite remains active.

Install/upgrade preparation stage: published alpm.v a66ceae and vpac 4657132. All 24 alpm binaries, all 27 vpac src binaries, both vmakepkg binaries and v -check . pass. The C parity matrix covers 224 flag/target/answer combinations including dependency providers, skipped targets, inner and outer conflicts, reverse dependency failures, duplicate filenames, missing/empty architecture, malformed filename metadata, mixed install/removal and upgrade/downgrade/replacement policy. Questions, events, final target/victim order, reasons and download estimates match C. Additional native tests cover NEEDED, duplicate/invalid admission, signature requests failing closed, archive ownership, partial-cache sizes and avoiding upstream null-filename comparisons. Standalone core smoke now loads a real archive and prepares both install and removal without libalpm. Fixed a binding error discovered by the matrix: copying conflict names reset C errno; returned preparation errors now carry the captured numeric kind, and vpac uses it for formatting. vpac issue #6 is closed. Both worktrees are clean and pushed at this checkpoint. Next: downloads/database refresh/signatures, then commit/local DB writes/extraction, hooks and the native public facade. The normal backend still links libalpm; the full rewrite remains active and incomplete.

Signature/trust stage: published alpm.v a318fac. All 27 alpm binaries, all 27 vpac src binaries, both vmakepkg binaries and v -check . pass. The standalone core verifies a genuinely signed archive, prepares its install, and ldd confirms no libalpm dependency. Native package loading and sync DB validation now enforce signature levels through GPGME with policy and owned results in V. C parity covers 90 package/database trust-level combinations plus multiple signers, embedded/armored signatures, tampering, disabled/expired keys and expired signatures. Native tests cover missing versus malformed optional signatures, checksum precedence/validation flags, bounded packet reads, isolated homes and key-cache invalidation, declined imports and local-key import callbacks. Public decoding and issuer extraction retain their signatures and libc allocation ownership. Deliberate fixes avoid newline-only base64 exposing uninitialized memory, reject truncated packet areas, support modern keyboxes, return useful import/read failures and bound retries. WKD/keyserver code has fingerprint checks; transport integration tests are still part of the network stage. No vpac code change was needed, and both worktrees are clean. Next: native downloads/cache policy/database refresh, then commit/extraction/local DB writes, hooks/callbacks and the native public facade. The normal public backend still links libalpm; the full rewrite remains active and incomplete.

Download transport stage: published alpm.v 1c6b9f6. All 30 alpm binaries, all 27 vpac src binaries, both vmakepkg binaries and v -check . pass. The native transport uses curl multi for concurrent transfers while V owns stable largest-first scheduling, mirror/cache-server selection and error counts, partial files, conditional requests, companion signatures, limits and callbacks. File and isolated loopback HTTP fixtures cover redirects, byte ranges, truncation recovery, timestamps, optional failures, server blacklisting/cache override, actual parallelism, interruption and reuse. Six differential scenarios compare files and lifecycle callbacks against libalpm. Deliberate corrections reject unsafe/overlapping partial paths before truncation, enforce limits without Content-Length, isolate optional oversized failures and retry unusable ranges once from scratch. A small C header only handles typed curl ABI access, file stat layout and a volatile sig_atomic_t control field. Generated C confirms the native async interruption method performs no calls or allocations. The strict-module-path standalone smoke now downloads an archive and its detached signature, verifies it and prepares installation; ldd confirms no libalpm link. Both worktrees are clean and the stage is pushed. Next: package-cache fetching and sync database refresh, external fetch callbacks and sandbox integration, then keyserver/WKD transport coverage and the remaining commit/extraction/hooks/public-facade stages. A configured native sandbox user currently fails closed. The normal public API still uses libalpm; the full rewrite remains active and incomplete.

Cache/refresh stage: published alpm.v 0a294a2. All 33 alpm binaries, all 27 vpac src binaries, both vmakepkg binaries and v -check . pass. Native fetching now selects/creates caches, honors remote signature levels, returns cached results first, manages temporary destinations and dispatches external fetch callbacks. Native sync refresh preserves usage/force policy, locks, invalidation after successful retrieval, retained loaded caches on failed retrieval, signature validation and up-to-date return values. Parity covers 48 cache/signature combinations, 13 callback-driven refresh scenarios and actual HTTP download/current/forced/failure refreshes, comparing callbacks, events, paths, contents and cached metadata. Native tests cover signed DB repair, writable cache fallback, modes/umask restoration, duplicate fetches, invalid callback results, temporary cleanup, preserved transaction/foreign locks and error codes surviving event callbacks or missing-lock housekeeping. The strict-path standalone executable now fetches and verifies a signed archive through cache policy, prepares its install, and refreshes a signed repository twice; ldd confirms no libalpm link. Deliberate corrections honor valid TMPDIR, avoid duplicate-output races, preserve borrowed transaction locks and reject false external-fetch success. The native FetchRequest includes its prepared output filename; existing public callback signatures are unchanged, and the final facade still needs its adapter. Both worktrees are clean and this stage is pushed. Next: download sandboxing and keyserver/WKD transport coverage, then commit/extraction/local DB writes, hooks and the public facade replacement. The normal public backend still uses libalpm; the full rewrite remains active and incomplete.

Download sandbox stage: published alpm.v 9134606. All 38 alpm test binaries, all 27 vpac frontend binaries, both vmakepkg binaries and v -check . pass. Targeted follow-up tests cover the final worker and callback changes. The strict-path standalone executable fetches/verifies a signed package, prepares installation and refreshes a signed repository, and ldd confirms no libalpm link. Native automatic sandbox activation follows the original root UID snapshot, configured user and restriction flags. Explicit setup matches C across 32 isolated user-namespace probes for UID/GID, cleared supplementary groups, no-new-privileges, Landlock writes/execute restrictions and the 83-entry seccomp deny list. Actual HTTP comparisons across all four restriction combinations cover files, callback order/process identity, signatures including optional failures, resume, timestamps/current responses and failures. Native integration also covers cancellation/reuse, terminal-signal forwarding after cleanup, trusted parent fetch callbacks and their current-file responses. Fresh staging/cache inodes prevent retained worker descriptors from altering promoted cache files; unsafe outputs are rejected before privileged metadata changes, inherited descriptors are closed, standard streams redirected and bounded worker messages validated. Signature companions now correctly refetch when the main database is current, matching dload.c. The public V API is unchanged, vpac needed no code change and both worktrees are clean. Next: WKD/keyserver transport coverage, then commit/extraction/local DB writes, hooks/callbacks and the native public facade. The default public backend still links libalpm; the full rewrite remains active and incomplete.

Key transport stage: published alpm.v 8f92976. The native importer now accepts matching ID-only HKP search entries when GPGME provides no fingerprint, and still verifies the requested fingerprint in the local keyring after import. Real GnuPG/dirmngr fixtures cover 23 operations: full fingerprints, ID-only indexes, eight-character fallback, missing keys, declined questions without requests, HTTPS WKD success, missing/wrong-key WKD fallback, untrusted TLS rejection, unrelated indexes and wrong returned key material. Six native/libalpm signed-package pairs compare outcomes, key presence, question contents and request order using independent empty keyrings. Native missing-key failures consistently report PKG_INVALID_SIG; be_package.c returns from that C prepass without assigning pm_errno. The Linux test uses private user/network/mount namespaces, loopback servers and temporary CA/hosts bindings, verifies the host files remain unchanged and kills each fixture home’s daemons. Final full verification: all 39 alpm binaries, all 27 vpac frontend binaries, both vmakepkg binaries and v -check . pass. The strict-module-path signed-package/cache/prepare/signed-repository smoke passes and ldd confirms no libalpm link. Every touched V file is formatted, public V signatures are unchanged and vpac requires no code update for this stage. Next: native local DB writing and transaction execution, safe extraction/backups/removal, hooks/scriptlets/callbacks and the final native public facade. Both worktrees are clean and this stage is pushed. The default public backend still uses libalpm; the full rewrite remains active and incomplete.

Local database writer stage: published alpm.v 6d50e82. Native backend primitives now prepare package directories, serialize/write desc and files, persist install reasons and remove flat entries. Missing-versus-empty base/description/URL/packager fields retain explicit presence alongside architecture, and serialization matches section ordering, explicit-reason omission, validation tokens, dependencies/xdata, file lists and absent backup hashes. The differential suite checks 96 reason changes across 32 scalar-presence combinations against libalpm. Eight real C database-only installs in temporary roots provide desc/files records compared byte-for-byte to independently loaded native archives; hooks/scriptlets are disabled and no payload reaches those temporary roots. Native writes reserve exclusive temporary files, check original-record write permissions, preserve ownership/ordinary modes, fsync and atomically rename through pinned directory descriptors. Failed writes leave the old record and cached reason intact. Tests cover read-only files/directories, symlinked records/entries/local DBs (including the trailing-slash O_NOFOLLOW trap), hard links, invalid identities, nested-directory refusal, umask restoration/modes and actual partial-write failure in an RLIMIT_FSIZE-limited child. The standalone strict-path smoke now persists reason changes as well as signed fetching/verification, prepare and signed repository refresh; ldd confirms no libalpm link. All 41 alpm binaries, all 27 vpac frontend binaries, both vmakepkg binaries and v -check . pass; final focused storage/parity checks also pass. Changed V files are formatted, public root V signatures are unchanged and vpac requires no code change. Both worktrees are clean and the stage is pushed. Next: transaction execution with extraction/backups/removal, special database archive files, hooks/scriptlets/callbacks and the native public facade. The default public backend still links libalpm; the full rewrite remains active and incomplete.

Removal execution stage: published alpm.v b4c7459. Native removal commits now unlink payloads, preserve/rotate modified backups, retain shared directories and mountpoints, remove local records, invalidate package/group caches, deliver ordered transaction/package/pacsave/progress callbacks and finish the current package before honoring interruption. Twenty-one libalpm comparisons check complete root/database snapshots and callback/progress traces, including NoUpgrade and negation, ignored NoExtract, database-only removal, missing files, merged directory links, rotation gaps/aliases, modified/dangling/cyclic backup links and interruption. Root-relative descriptor traversal follows absolute links inside the pinned root, rejects escaping package paths and pins each parent across unlink/rename; tests cover swapped parents, link cycles and descriptor zero. Real private user/mount namespace probes verify read-only filesystem errors and retained empty mountpoints without host package changes. Deliberate corrections retain database entries on file-removal failures, reject unreadable/special backup files without blocking or data loss, preserve files with absent backup hashes, reject reentrant transaction release during callbacks and bound pacsave rotation rather than walking arbitrary numeric gaps. Active hooks, scriptlets and ldconfig are refused before mutation until their runner is implemented; installs/upgrades remain pending. Final validation: all 45 alpm binaries, all 27 vpac frontend binaries, both vmakepkg binaries, clean compiler checks, formatted changed V files and strict-module-path native signed-fetch/prepare/refresh/reason/removal smoke; ldd confirms no libalpm link for that standalone engine executable. Public root V signatures are unchanged, vpac needs no code change and both worktrees are clean. Next: native process execution for hooks/scriptlets/ldconfig, install/upgrade extraction/backups/special database files and the final native public facade. The default public backend still links libalpm; the full rewrite remains active and incomplete.

Hooks/scriptlets/process stage: published alpm.v ae1059e. Native removal commits now discover and run pre/post transaction hooks, pre/post removal scriptlets and ldconfig in source order. Hook policy covers directory priority, empty-file and /dev/null masks, suffix-free name ordering, strict section/directive parsing, wordsplit quoting, Package/Path operations with shared-path upgrade classification, negation, NoExtract on installing paths only, Depends, AbortOnFail and sorted/deduplicated NeedsTargets input. Post hooks reload after mutation. Twenty-five real native/libalpm transaction pairs in private user namespaces and disposable chroots compare outcomes, event/output order, payload/database retention and cleanup, including overrides, mixed target types, malformed hooks, missing commands/dependencies, ignored failures, flag combinations, removed hooks and interruption. In particular ldconfig runs when the interrupted current package is the final package, but not when later packages remain; post hooks are skipped after interruption. Native unit tests cover install/upgrade path classification, archive scriptlet phases and literal version arguments. Scriptlets stage through pinned directories with exclusive files, checks on regular files and cleanup after failure; a /tmp link resolves inside the package root. The V runner pumps combined output and input concurrently, uses callback output, preserves parent cwd/environment/umask/signals/descriptors, resets child signals, closes inherited descriptors and reaps children. Tests exercise full buffers in both directions, closed stdin without SIGPIPE, signal/nonzero/exec failures, a root opened as descriptor zero and deleted parent cwd. Deliberate corrections report EOF fragments once, pass scriptlet versions as literal arguments and reject invalid commands/special hook or scriptlet files rather than blocking. Native shell/ldconfig defaults follow the pacman source defaults; fixture roots also provide the installed C oracle distribution paths. Validation: all 49 alpm binaries, all 27 vpac frontend binaries, both vmakepkg binaries, clean compiler diagnostics and verified formatting pass. The strict-module-path core smoke passes; ldd confirms no libalpm link for both the core and native process test executables. Public root V signatures are unchanged, vpac requires no code change and both worktrees are clean. Next: native install/upgrade execution, extraction and file-conflict checks, pacnew/upgrade backup policy, special database archive records, execution integration and final public facade/event/logging migration. The normal public backend still uses libalpm; the full rewrite remains active and incomplete.

File-conflict preflight stage: published alpm.v 63f003a. Prepared native transactions with fully loaded archive targets now check target intersections, filesystem ownership, file/directory replacements, scheduled removals, ownership transfers, unowned backup files and relative/rooted overwrite patterns. The checker preserves target/file/conflicting-owner ordering, shared-directory policy, NoExtract/NoUpgrade behavior, NOCONFLICTS versus DBONLY distinctions and the removal skip list that prevents a later upgrade from deleting a transferred file. Typed conflict strings are owned in V and retained on the transaction for error reporting. Native commit preflight consumes these results for full archive targets before its still-pending extraction guard; actual installs/upgrades remain unsupported. There are 336 real libalpm comparisons across 28 filesystem/ownership scenarios, three flag policies and four overwrite policies, matching ordered conflict payloads, events and every file-conflict progress call. The C oracle is interrupted at transaction start, so these comparisons modify no payload or local package record. Native guards reject partial archive metadata, invalid states and escaping package paths, prevent callback release/recursive re-entry, retain failure data and build transfer plans without filesystem mutation. File metadata is loaded only when needed. Directory traversal stays rooted and checks ancestor inode/device identities rather than imposing an arbitrary recursion depth. A separately added real cyclic-bind-mount test in a private Linux user/mount namespace verifies prompt conflict rejection and retained directory/database entries; ldd confirms that probe links no libalpm. Validation passed: the complete then-current 51-binary alpm suite plus the subsequently added mount binary (52 alpm binaries altogether), all 27 vpac frontend binaries, both vmakepkg binaries, clean consumer compiler diagnostics and verified formatting of every touched V file. The strict-module-path core smoke and native file-preflight executable both build, run and link without libalpm. Public root V signatures are unchanged, vpac requires no code change and both worktrees are clean. Next: transaction archive/cache/download finalization, native payload extraction and metadata, pacnew/upgrade backup rules, special database archive records, complete install/upgrade execution and final facade/event/logging integration. The normal public backend still uses libalpm; the full rewrite remains active and incomplete.

Transaction archive stage: published alpm.v 84e3b1a. Native transactions now download repository targets, preflight download space, deduplicate missing signing keys, validate checksums/signatures and load full archives in source event/progress order. Archive identity, installed size and dependency/conflict/provision/replacement/group multisets must match repository metadata. Fully loaded targets preserve reasons, validation and old-package snapshots without detaching sync cache entries. DOWNLOADONLY commits finish after integrity checks, retaining source transaction state without changing payloads or local package records. Corrupted-package questions retain typed error information through callbacks. The new compatibility suite checks 128 native/C cases covering cached/fetched/partial/local/mixed targets, malformed archives, metadata mismatches and order, signatures, tampering and unknown-key refusal. A known source bug returns unset errno on missing-key prepass failure; native code returns PKG_INVALID_SIG. Private user/mount namespace tmpfs probes test real sufficient/insufficient download space. Validation: all 55 alpm test binaries, all 27 vpac binaries, both vmakepkg binaries, clean consumer compiler diagnostics and formatting pass; three final focused binaries pass after the additional unusable-keyring regression case. Strict-module-path core and transaction-loader binaries execute successfully and ldd confirms no libalpm linkage. Public root V signatures are unchanged; vpac requires no code change. Next: native payload extraction and special database records, pacnew/upgrade policy, install/upgrade execution/disk-space checks, and final public facade/event/logging integration. The normal public backend still uses libalpm; the full rewrite remains active and incomplete.

Extraction primitive stage: published alpm.v 03deaf3. V now streams regular/sparse payload data through pinned directory descriptors, creates directories, symlinks/hardlinks, FIFOs and device nodes, preserves existing directory metadata and restores numeric ownership, appropriate SUID/SGID bits, fractional access/modification times and extended attributes while omitting ACL encodings. Parent directories follow add.c UNLINK/SECURE_SYMLINKS policy: extraction replaces intervening links instead of following them. Ordinary lookup/removal resolution retains its previous rooted link behavior. Data-bearing CPIO hardlinks are pinned, checked as regular files and truncated before writing; zero-data hardlinks retain source inode metadata. Binary .INSTALL/.CHANGELOG/.MTREE records use mode 0644, reserved dot members are skipped, and database record links/nodes are rejected. The caller cwd and umask are unchanged. Small C helpers expose typed syscall ABI only; extraction policy and streaming remain in V. Linux metadata on links/nodes and pinned hardlink reopening use /proc/self/fd anchors.

Extraction comparisons exercise source flags, all normal file/directory transitions, ownership failures and privilege bits, real GNU sparse archives/xattrs, read-only files, PAX fractional times and ACL omission, hardlinks including data-bearing CPIO entries, parent symlinks, shared-inode replacement and complete root/metadata snapshots. Additional cases check pinned destinations after parent-link swaps, descriptor zero, malformed/escaping paths, special database members, truncated data and RLIMIT_FSIZE failures. The suite also runs as mapped root on a private tmpfs and checks device-node outcomes. This host permits the fixture character node but denies its block node; native code reports the denial instead of silently accepting a libarchive warning. Deliberate corrections reject failed creation/writes and truncated data, forbid escaping hardlink targets and reject intermediate source links without deleting them. Pacman add.c currently accepts archive_read_extract2 header/write failures downgraded to WARN unless errno is ENOSPC, which can silently omit package files.

Validation: the broad 57-binary alpm run passed 56 binaries and exposed only a new reference-harness trailing-slash bug. Correcting the harness to match util-common.c llstat made the extraction binary pass; the additional data-bearing CPIO case also passes. All 57 alpm binaries are therefore verified across the broad run and focused rerun, including the final native extraction binary rebuilt/executed inside a private namespace. All 27 vpac frontend binaries and both vmakepkg binaries pass. Consumer compiler diagnostics are clean; every changed V file is formatted and staged diff checks passed. The strict module-path extraction executable links no libalpm. No public root V API changed, vpac requires no code change, both worktrees are clean and the stage is pushed. Native installation/upgrade commits remain guarded until extraction is integrated with pacnew/upgrade backups, install-space accounting, reasons/cache/database updates and execution callbacks/hooks/scriptlets. The final facade/event/logging switch remains pending. The full rewrite remains active and incomplete.

Installation/upgrade execution stage: published alpm.v 3d0a6ea. Native commit now completes file targets, runs file and optional installation-space preflight, invokes pre-transaction hooks, removes scheduled victims, and executes installs/upgrades/downgrades/reinstalls. It preserves old snapshots and reasons, applies ALLDEPS before ALLEXPLICIT overrides in source order, extracts metadata/payloads, writes local records, inserts owned cache copies and invalidates groups. Backup policy matches add.c across original/local/incoming MD5 choices, retroactive and dropped backup declarations, absent hashes/files, preexisting pacnew files, NoUpgrade/NoExtract negation and NOSAVE; pacnew/pacsave and operation-specific byte progress are emitted in source order. DBONLY skips payload removal/extraction while retaining extension policy. SOURCE_DATE_EPOCH parsing includes signed conversion and invalid/overflow fallback. Pre-install/upgrade scripts read the archive; post scripts read the new database record; old removal scriptlets are suppressed for upgrades. Interruption finishes the current package, skips later targets, and retains source ldconfig/post-hook behavior.

Native installation space accounting parses ordered/escaped mount paths, lazily loads statvfs capacity/read-only flags, subtracts removed logical file sizes, adds declared installed files and tracks maximum requirements after each target with the source cushion. It preserves source NoExtract accounting and rejects arithmetic overflow. Eight actual tmpfs/root/submount comparisons check sufficient/insufficient space, read-only mounts, NoExtract, peak-versus-final requirements and reordered targets, including exact event/progress traces and unchanged state on rejection. The read-only probe uses a direct remount syscall to avoid mount utility replay of host UID/GID options inside the mapped namespace.

43 real native/C package transactions compare complete payload/database trees and every relevant phase/operation/backup/progress callback across fresh installs, upgrades/reinstalls/downgrades, backup hashes, flags, mtree exclusion, removals and interruption. Sixteen further pairs execute hooks, scriptlets and ldconfig in private chroots, including hook/script failures, DBONLY, flags, interruption, installed/no-extract hooks and victim removal. Native-only tests verify signed repository installation, reason/validation/cache ownership and reopening, partial file-target completion, timestamp/mount parsing boundaries, reentrant release/commit guards and real limited writes. Failed extraction/writes now abort without success events or an installed cache entry and discard the incomplete new database entry, rather than accepting libarchive header/write warnings as successful extraction. Partially loaded file targets are completed before execution.

Validation: all 61 alpm test binaries, all 27 vpac frontend binaries and both vmakepkg binaries pass in their complete suite runs. Consumer v -check diagnostics are clean; all touched V files are formatted and staged diff checks pass. The strict module-path native installation executable builds and executes successfully, including signed package transactions and failure cleanup; ldd confirms no libalpm dependency. Public root V signatures are unchanged, vpac requires no code change and both worktrees are clean. Next: freeze the transitional C facade as an independent test oracle, port the public handle/package/database/transaction surface and event/logging adapters, remove production libalpm/header/link requirements, and audit all public entry points with vpac integration. The normal public backend still uses libalpm; the full rewrite remains active and incomplete.

Public migration preparation: published alpm.v 1bcfb3e and vpac b6d2234. Differential suites now use a separate C reference module under tests/coracle with distinct foreign symbol names; reference primitives call C and neither implementation file imports the current backend. All seven reference probes use this module. Root allocator interoperability and signature-decoding tests still exercise the actual current public implementation. Added a compiler-AST declaration baseline guarding 266 public functions, 41 records, 19 enums, callback aliases, returns, mutability, fields and flag values, with verifier self-tests. This is declaration evidence, not behavioral proof. Added portable formatted-line callbacks with complete long-message formatting, getter/context preservation and safe replacement/clearing; vpac uses this API and no longer owns a libalpm C helper. Legacy raw callbacks remain available. Companion vpac issue #7 is closed.

Validation: broad alpm run passed 59/65 and found one missing libarchive declaration in the isolated reference; all six affected binaries pass after the correction, verifying all 65 across the run and reruns. The final API verifier binary also passes. All 27 vpac frontend binaries and both vmakepkg binaries pass; consumer compiler diagnostics, touched-file formatting and staged diff checks are clean. Both repositories are pushed. Next: convert the complete public handle/database/package/transaction facade and all event/question/logging adapters to the native backend, audit every entry point and prove the actual vpac binary has no libalpm/header dependency. The default public backend remains C-backed; full rewrite active and incomplete.

Public native backend switch: published alpm.v 372eead and vpac 0197846. The default root alpm module now wraps engine handles, databases, packages, dependency queries, transactions, downloads and signatures directly in V. Production sources contain no libalpm calls, headers or link flags. All 266 existing public function declarations remain compatible. Native opaque wrappers retain identity, borrowed metadata/list views are owned until release, and a collector root preserves the manual handle lifetime when only unmanaged list nodes remain. Formatted log callback contexts are explicitly retained outside their libc adapter boxes. Signature results, file lists, dependency/conflict payloads, changelog/mtree streams and signature byte outputs are adapted to the existing API. All event/question/progress/download/fetch callback payloads have native adapters; the complete behavioral audit of uncommon paths is still pending. Typed sandbox log messages execute callbacks in the parent. Reinstall/downgrade, mirror failures and mtree-open diagnostics retain frontend behavior.

The public action-log method now follows source prefix handling, timestamp format, descriptor lifetime, rotation, file modes, syslog option and error mapping. Its V message argument treats percent signs as data. Transaction action-record emission throughout the core remains a separate unfinished requirement. Legacy MD5 package methods are retained with documented empty/unsupported behavior because the corresponding C functions no longer exist in the referenced source; file-level MD5 hashing is unaffected. The public get_sig output-pointer/length bug is corrected.

Public validation adds the same 43 C/native installation scenarios through the actual public API, comparing full payload/database trees and phase/operation/backup/progress traces. Further comparisons exercise local/sync/archive metadata, signatures/trust/result cleanup and action-log prefixes/rotation/errors. Native tests cover borrowed identity and views, GC retention, mtree/changelog streams and owned binary signature data. A real failure exposed collector thread entries inherited after fork: GCC workers aborted with pthread_kill failed at suspend and one comparison retained its output pipe after timeout. Native forks now call libgc atfork prepare/parent/child hooks, which are no-ops when automatic handling is active. A forced collection in a child of a threaded parent passes with both default and GCC builds, and all four real GCC sandbox configurations pass. No compiler or module-cache patches were made.

Final validation after the fork fix: the complete 68-binary alpm suite passes. The complete 27-binary vpac frontend suite and both vmakepkg binaries pass. Consumer v -check diagnostics are clean, all touched V files are formatted and staged diff checks pass. tests/native_api_smoke.py builds and executes the public API suite through a strict module path while deliberately forbidding alpm.h/alpm_list.h, then verifies no libalpm linkage or undefined C symbols. The actual rebuilt vpac executable also has no libalpm library or symbols. Both repositories are pushed; companion vpac documentation issue #8 is resolved.

Next required work: complete core transaction action-log records (including package/hook/scriptlet and failure/interruption paths), audit the remaining source diagnostic/event paths and every public entry point/edge case, and extend public differential coverage where indirect core tests are insufficient. Native default backend and absence of production libalpm are now implemented and verified; full faithful replacement remains active and incomplete. Keep this issue open.

Transaction action-log stage: published alpm.v 92ee27b. Native execution now records source-ordered transaction start/completion/interruption/failure, installation/upgrade/downgrade/reinstall and removal, hook execution, scriptlet/ldconfig output, pacnew/pacsave and directory permission warnings. Package operation records precede post-scriptlets; hook records precede hook-run callbacks; transaction completion follows its done callback and precedes post-hooks. Preflight, pre-hook abort and DOWNLOADONLY do not fabricate started/failed transaction records. Error action records cover database preparation/update, extraction, backup renames and unlink failures. Failed-transaction logging preserves the original kind, detail and detail-valid state even if the logfile is unavailable. Native hardening still aborts failed extraction/removal without false success records or false database/cache updates. Exec-failure output now matches the source parentheses wording, removing the old test exclusion.

86 real C/native pairs now compare complete action logs and their visibility at event/progress callbacks: 45 public installation cases (43 existing scenarios plus directory permissions and DOWNLOADONLY), 16 private-chroot installation extension cases and 25 private-chroot removal extension cases. These include hook/scriptlet failures, pre-hook aborts, interruption, ldconfig, database-only and skip flags. Six native adversarial scenarios check missing archives with an unwritable log, a payload changed to a directory after preflight, failed database creation, unsafe metadata replacement with an unchanged outside sentinel, file-conflict preflight with no action file, and a real unprivileged unlink denial retaining the installed database entry. Failed actions claim neither installed/removed packages nor transaction completion.

Validation: the complete 69-binary alpm run, all 27 vpac frontend binaries and both vmakepkg binaries pass. The final action-log fault binary also passes with the additional unlink scenario. Consumer compiler diagnostics are clean; all changed V files pass formatting and staged diff checks. The 266-function public API declaration guard passes unchanged. The strict-module-path public API smoke builds and runs with libalpm headers deliberately forbidden and no libalpm symbols/library. The actual rebuilt vpac executable also has no libalpm symbols/library. No vpac source or API change was needed in this stage; its repository remains clean at 0197846.

Next required work remains the public API and source diagnostic/event audit. Concrete outstanding cases include command exit/signal and hook-error diagnostics that are currently collected but not fully streamed through the public log callback, and the transitional empty/unsupported get_md5_sum/checkmd5sum methods. Pacman history bdedf621^ retains the prior MD5 package API implementation for compatibility reference; do not treat signature preservation alone as behavioral completion. Continue hermetic comparisons and consumer validation. The full faithful rewrite remains active and incomplete; keep this issue open.

Legacy compatibility and V tooling stage: published alpm.v 61ae4c8 with companion vpac 9033a2b. get_md5_sum/checkmd5sum now implement their retained pre-bdedf621 package.c/util.c behavior: raw MD5 metadata, first regular cached package, case-sensitive comparison, PKG_INVALID on mismatch and legacy no-errno failures for unavailable digests. Forty-eight independent frozen-C/native combinations cover digest presence/case/malformed values, cache priority, files, directories and links; local/archive origin rejection and unreadable/missing filename boundaries are also covered. Historical local VALIDATION md5 markers now survive reason/description rewrites and reopening, including a real hermetic vpac mark regression. Current SHA256/signature transaction policy remains unchanged.

Command exit/signal/waitpid failures now stream util.c's error messages and severity through the native log callback. Extension coverage grows to 27 removal pairs and 88 total C/native transaction action-log comparisons. Six extension cases compare complete warning/error logs interleaved with actions/events, including failed exec, failed scripts, aborting/ignored hook failures, signal termination and a callback deliberately reaping the command child to trigger a real waitpid failure. Remaining hook parsing/discovery/dependency diagnostics are not yet fully streamed.

At the user's direction, every Python file and invocation was removed from the repository. V tools now implement the compiler-AST declaration guard/self-tests, strict-module-path public API smoke with forbidden alpm headers and ELF dependency checks, checked-out version.c comparisons, checked-out alpm_list.c and allocation-fault comparisons, and the private-namespace HKP/WKD fixture. The V server preserves real GnuPG requests, trusted/untrusted TLS, SNI observations, wrong-key/body/index rejection, six C/native signed-package loading pairs and unchanged host trust/hosts files. Parent cleanup also reaps fixture GnuPG agents after failed/timed-out children. The list source tool now strips installed alpm headers/link flags and explicitly executes/checks its standalone test ELF.

Validation: the complete 71-binary alpm run, all 27 vpac frontend binaries and both vmakepkg binaries pass. After the tooling replacement, the API verifier and all 23 real key-transport operations pass their focused reruns. All five V tools pass: the API guard preserves 266 functions/41 records/19 enums, version.c matches 172225 comparisons, normal and GCC ASan/UBSan list/allocation-fault tests pass, and the strict public API smoke has no libalpm headers, symbols or linkage. The actual rebuilt vpac ELF also has no libalpm symbols/library. Consumer compiler diagnostics, changed-V formatting and staged diff checks are clean; no Python source files or command references remain. Companion vpac issue #9 is resolved after validation and publication.

Next required work: complete hook parser/discovery/dependency log parity, then cache, metadata and signature/trust diagnostics and remaining source event paths. Expand direct public comparisons for currently indirect surfaces, including server/cache-server mutations, callback accessors, dependency helpers and transaction flags. Preserve the full API/behavior audit requirement and verify final integration before closure. The full faithful rewrite remains active and incomplete; keep this issue open.

Hook diagnostic stage: published alpm.v be6da3b. Native hook parsing now streams hook.c messages, severity, full paths and buffer-counted line numbers. Duplicate definitions warn in source order; validation reports every missing trigger field, Exec and When. Missing hook dependencies now emit the source error. Discovery uses checked directory iteration instead of os.ls, preserving open/stat/readdir and directory/file PATH_MAX failures. fgets(PATH_MAX) line fragments are reproduced, and empty Exec= versus a quoted empty executable retain source parse/run behavior. Native NUL and nonregular-stream guards remain; missing operands are diagnosed rather than reaching the source's NULL string operations.

Sixty-eight real private-namespace scenarios now compare the C transaction against both the engine and the actual public V facade: 136 removal/extension comparisons, making 197 total transaction action-log comparisons with the existing 45 public install and 16 installation-extension pairs. Every removal scenario compares all warning/error messages interleaved with actions and events, success, final victim records, payload presence, temporary scriptlet files and lock cleanup. Cases cover missing/invalid fields and sections, duplicate/empty/unterminated Exec, long-line fragments, wrong-section options, CRLF/final-line handling, dependencies, overrides, disappearing hooks, broken links, non-directory/missing/oversized hook directories, joined-path overflow and a callback closing only its fixture's directory descriptor to provoke a real readdir failure. Source errno/error flow and event/action timing match through the public callback adapters as well as the core.

Validation: the complete 71-binary alpm suite, all 27 vpac frontend binaries and both vmakepkg binaries pass. The final default-compiler extension rerun passes after the oversized-path fixture cleanup correction. A GCC build also passes all 68 core and 68 public comparisons and explicitly verifies the complete fixture directory was removed. The first GCC run exposed cleanup failure for the deliberately over-PATH_MAX filename; a shared V fixture helper now unlinks it relative to its directory in both probe and parent cleanup, and the four identified owned leftovers were removed. Changed V files, staged diff checks, the 266-function API declaration guard and consumer compiler diagnostics pass. The strict public API smoke still forbids libalpm headers and verifies no library/symbol dependency; the actual rebuilt vpac ELF also has no libalpm linkage or symbols. No public API or vpac source change was needed. The vpac worktree remains clean at 9033a2b, and no Python tooling was introduced.

Database API stage: published alpm.v 74a4679, integrating prepared 16f9313 on top of be6da3b. Metadata accessors and empty server-list replacement now preserve handle error state like db.c; real operations still clear errors. Server mutations normalize embedded NULs before trailing-slash policy. Live/registered guards remain. The 344 new independent C/public cases cover 104 metadata/error cases and 240 URL/list mutations. The complete 72-binary alpm suite, all 27 vpac frontend binaries and both vmakepkg binaries passed. The consumer compiler check, formatter, 266-function API declaration guard, strict public smoke and actual vpac ELF checks passed, with no libalpm header, library or symbol dependency. Both main worktrees are clean; the obsolete database staging worktree has been removed.

Cache diagnostic stage: published alpm.v 404bfc3 and vpac fd65340; vpac issue #10 is closed after both pushes succeeded. Source-ordered cache lookup, selection, retrieval and download-size messages pass 72 strict C/core-or-public comparisons. Two additional checks retain native cache-directory revalidation: upstream accepts a regular file after mkdir EEXIST and then fails retrieval; native preserves the file and uses the next valid directory. Valid TMPDIR handling and created-directory revalidation remain. Download-size accounting repeats stat after lookup like sync.c, including callback-driven removal/resize and memoized repeat reads. The companion frontend regression verifies creation/lookup warning IPC messages precede downloads, the sentinel file survives, the next cache holds the archive, the fixture payload is installed and its lock is released. No public V API or IPC shape change.

Integrated validation is complete: all 73 alpm binaries passed (647773 ms), all 27 vpac binaries passed (649158 ms), and both vmakepkg binaries passed. Consumer MCP diagnostics, formatter/staged diff, the 266-function declaration guard, strict no-libalpm public smoke and actual vpac ELF dependency/symbol checks passed. Full logs: /tmp/alpm-cache-stage-full.log and /tmp/vpac-cache-stage-src.log. Both main worktrees are clean at published 404bfc3/fd65340.

Signature extraction stage: published alpm.v 3a5fed8. The independent V-only reproduction /tmp/alpm-signature-cache-probe-1794421094528.v showed that a sync package with embedded PGPSIG=YWJj and no cached package succeeds in C (3 bytes), while the previous native getter returned PKG_NOT_FOUND (33). The native getter now decodes before cache lookup as package.c does, preserves prior errno on success, sets SIG_INVALID on decode failure, and follows detached access/open/read errors, output lengths and diagnostics. Direct archive-path support and null/released-object guards remain. Sixty strict C/core/public comparisons cover embedded/binary/empty/invalid data, missing packages/signatures, directories and ordinary/unreadable/dangling/looping symlinks, with clean and preseeded errno. Caller-owned output survives GC and handle release.

Validation: all 74 alpm binaries passed (481489 ms), all 27 vpac binaries passed (480376 ms), and both vmakepkg binaries passed. Consumer MCP diagnostics, formatter/staged diff, the 266-function API declaration guard, strict native API smoke and actual vpac ELF checks passed with no libalpm header, linkage or symbol dependency. Logs: /tmp/alpm-signature-stage-full.log, /tmp/vpac-signature-stage-src.log, /tmp/alpm-signature-bytes-final.log. The publication push succeeded; no public V API or consumer source change was needed.

Download-size getter stage: published alpm.v 3024b28. Initial and memoized successful reads preserve prior errno, and the public getter returns stored size after computation failure as sync.c does. Transaction preparation remains strict. The merge retained partial-file re-stat and cache diagnostics. Eighty-eight strict C/core/public comparisons cover sync/empty/missing filenames, local/archive origins, none/whole/partial caches, initial/memoized/repeated calls and clean/preseeded error state. Null/released-object guards and strict transaction tests pass. The merged focused three-binary suite passes. Full validation passed all 75 alpm binaries (478644 ms), all 27 vpac binaries (471830 ms), both vmakepkg binaries, clean consumer MCP diagnostics, formatting/staged diff, API guard, strict public smoke and actual vpac ELF checks with no libalpm headers, linkage or symbols. Push succeeded; public V signatures and consumer source are compatible. The obsolete signature/download-size staging worktree was removed after publication.

Local metadata stage: published alpm.v 8984511 and vpac 65c7431; companion issue #11 is closed after both pushes succeeded. The reader follows be_local.c persistent fgets fragments, safe_fgets EINTR behavior, newline/EOF/NUL semantics and streaming read failures. Public lazy getters preserve stored partial fields with package.c errno semantics, while core load errors stay sticky for transactions. Source severity/order now covers name/version inconsistencies, unknown reasons/validation/keys, open failures and function-level loading messages. Legacy MD5 validation history remains supported. The implementation/tooling remain V; libc supplies only I/O primitives.

Validation passed 276 strict C/public comparisons across 46 scenarios, three lazy-read orders and clean/preseeded errno, including six callback-driven real descriptor faults and partial-list versus temporary-list behavior. Four failed-load transactions reject commit and preserve their private payload/database records. The native FILES I/O-error guard remains stricter than upstream's unchecked loop. The consumer regressions preserve parsed description/reason, deliver unknown-key warnings and missing-desc errors through existing IPC shapes, leave DB content unchanged and create no lock. The full 76-binary alpm suite passed (478390 ms), all 27 frontend binaries passed (469175 ms), both vmakepkg binaries passed, and consumer MCP diagnostics, formatting, declaration guard, strict public smoke and actual vpac ELF no-libalpm checks passed. Logs: /tmp/alpm-local-metadata-stage-full.log and /tmp/vpac-local-metadata-stage-src.log. Obsolete metadata staging worktrees were removed after publication.

Local DB population stage: published alpm.v 85d9f7a and vpac 578ceae; companion issue #12 is closed after both pushes succeeded. Invalid-name, duplicate-entry and metadata messages follow db.c/be_local.c, along with BASE/cache insertion function logs and cache lifecycle/count messages. The source's C implementation-location RET_ERR debug messages are excluded from comparisons; warning/error, function and cache messages are compared. Native validity remains separate from package.c's unusual fnmatch diagnostic argument order.

Focused validation passed 84 strict C/core-or-public comparisons and eight explicit guard cases, across normal/unusual/malformed entries, duplicates/order/reuse, inaccessible/replaced/disappeared directories and retries with clean/preseeded errno. Native retains unconditional symlink-entry exclusion even where C's stat fallback follows them. Checked readdir rejects partial caches: a callback closes only the fixture's directory descriptor in a 2001-entry DB; C repeats a truncated cache while native returns DB_OPEN without committing it and recovers all 2001 entries on retry. The consumer reports invalid/duplicate entries through IPC and cache read failure through the existing target ErrorEvent, then recovers without DB writes or lock changes. Full validation passed 77 alpm binaries (476538 ms), 27 vpac binaries (463609 ms), both vmakepkg binaries, compiler/format/staged-diff checks, API guard, strict public smoke and actual vpac ELF checks without libalpm headers/linkage/symbols. Logs: /tmp/alpm-local-population-stage-full.log and /tmp/vpac-local-population-stage-src.log. Obsolete population staging worktrees were removed after publication.

Local DB validation stage: published alpm.v bd166a7 and vpac b6ca929. Companion issue #13 is closed after complete validation and both pushes. The native constant-memory scanner reproduces be_local.c fscanf("%zu") sign/whitespace/overflow/prefix behavior. Directory-open errors remain DB_OPEN; missing-directory creation uses DB_CREATE. Newly written version files need not be readable immediately under the caller's umask. Write/close failures are checked rather than reporting an initialized DB after failure.

Focused validation passes 102 strict C/core/public comparisons and ten explicit safeguards across 54 fixture combinations, including six checks retaining meaningful creation errors where C leaves errno OK and four RLIMIT_FSIZE=0 checks rejecting ignored flush failures. All filesystem data/modes and temporary process settings are checked/restored. Vpac init_handle now preserves the underlying cause/code; its frontend regressions cover regular-file local paths, restrictive creation umasks and signed version input. No public V signature or IPC shape change.

Integrated validation passed all 78 alpm binaries (970573 ms), all 27 vpac frontend binaries (952177 ms), both vmakepkg binaries, clean consumer MCP diagnostics, formatting/diff, the 266-function/41-record/19-enum API guard, strict native public smoke and actual vpac ELF checks without libalpm headers/linkage/symbols. Logs: /tmp/alpm-local-validation-stage-full.log and /tmp/vpac-local-validation-stage-src.log. Both main worktrees are clean at the published revisions.

Cached repository error/recovery stage: published alpm.v 84163df and vpac df19d4d. Companion issue #14 is closed after full validation and both pushes. Independent source comparisons distinguish archive-open DB_OPEN errors, malformed metadata DB_INVALID and later header LIBARCHIVE failures. Header failures retain validity for retry after repair; failed opens/parses poison the existing database until re-registration. Sync readability and signature checks use source-compatible faccessat with AT_SYMLINK_NOFOLLOW. Existing native safeguards do not cache failed group lookups.

Focused validation passes 148 strict C/core-or-public comparisons and twenty explicit source-group-cache safeguard comparisons across fourteen scenarios, three signature levels, clean/preseeded errno, repair and re-registration. All other actions remain exact in safeguard cases. Repeated successful and failed archive loads preserve their descriptor counts. Five related archive/signature binaries and the frontend regressions passed. The full integrated 79-binary alpm suite passed (775766 ms), all 27 vpac frontend binaries passed (702084 ms), both vmakepkg binaries passed, and consumer MCP diagnostics, formatter/diff, API guard, strict public smoke and actual rebuilt vpac ELF checks passed with no production libalpm headers/linkage/symbols. No public API or IPC shape changes; no Python files. Logs: /tmp/alpm-cached-db-stage-full.log, /tmp/vpac-cached-db-stage-src.log, /tmp/alpm-cached-db-parity.log.

Sync metadata diagnostic stage: published alpm.v 0fb5507 and vpac fdcc29a. Companion issue #15 is closed after full validation and both pushes. Native archive metadata parsing uses V streaming reads with util.c block, newline-before-NUL and final partial/empty line semantics, retaining bounded lines and legacy MD5 handling. Diagnostics follow source severity/order, parsing continues through malformed archive entries, no partial cache escapes, and parse failure takes precedence over subsequent header failure. Unknown root files and unknown subfiles have distinct warning/debug severity.

Validation passes 236 strict C/core-or-public comparisons over 31 scenarios with plain/gzip archives where applicable and clean/preseeded errno. All log levels are compared except RET_ERR/GOTO_ERR C implementation-location strings. Six real descriptor-fault executions close only a private fixture archive from an early warning callback. Header truncation and parse-plus-header failures cover error precedence. The standalone malformed-list fixture now correctly lacks its final newline, while an accepted newline-terminated dependency regression follows C. Frontend regressions preserve ordered messages/severity, successfully read final groups and reject partial caches without changing archive bytes, locks or IPC shapes.

The full integrated 80-binary alpm suite passed (520013 ms), all 27 frontend binaries passed (469169 ms), both vmakepkg binaries passed, and consumer MCP diagnostics, formatting/diff, the 266-function/41-record/19-enum API guard, strict public smoke and actual vpac ELF checks passed without production libalpm headers/linkage/symbols. Logs: /tmp/alpm-sync-metadata-stage-full.log and /tmp/vpac-sync-metadata-stage-src.log. Obsolete sync metadata staging worktrees were removed after publication.

Package archive diagnostic/error stage: published alpm.v 1ead313 and vpac fb205e9. Companion issue #16 is closed after all gates and both pushes succeeded. Package metadata now streams source syntax/unknown-key/missing-field messages, preserves archive open/read/skip error types and mtree fallback state, and uses a shared owned opener with EINTR handling, fstat on the actual descriptor and cleanup on every path. Package signature-path probes and non-following readability checks follow source ordering.

Validation passes 680 strict C/core-or-public comparisons across 45 scenarios, partial/full reads, plain/gzip where applicable and clean/preseeded errno. Tests normalize private fixture roots and process-local descriptor numbers and exclude C implementation-location debug strings. Thirty real descriptor-fault executions, callback-driven file removal/replacement before open (including opened-file sizes), metadata/header/data/mtree/path boundaries and repeated descriptor-lifetime checks pass. All six related binaries and three frontend regressions pass. Full integration passed all 81 alpm binaries (632630 ms), all 27 vpac frontend binaries (598540 ms), both vmakepkg binaries, clean consumer MCP diagnostics, formatting/diff, API guard, strict public smoke and actual vpac ELF checks without production libalpm headers/linkage/symbols. Logs: /tmp/alpm-package-load-stage-full.log and /tmp/vpac-package-load-stage-src.log. Obsolete package staging worktrees were removed after publication.

Raw signature diagnostic/ownership stage: published alpm.v 66afd56 and vpac 67b4efa. Companion issue #17 is closed after full validation and both pushes. Raw checks emit source counts, fingerprints, summary bits, statuses/times/future notices, validity/reasons and key/trust/disabled data. Missing/unreadable signatures and GPGME errors preserve messages/severity, with error delivery after cleanup. Sync packages check their recorded filenames directly; missing filenames report NOT_A_FILE.

PGPKey.data now retains an actual GPGME key instead of a V stand-in. Known strings borrow from it, unknown fields retain NULLs, and SigList.cleanup unrefs the key or frees the unknown fingerprint. Removing the obsolete private native_keys array restores the compact original layout without changing public fields. Failed allocations report MEMORY, release every transferred key and return no list. Core value results retain automatic cleanup.

Validation passes 310 strict C/core-or-public comparisons after warm initialization, including raw runtime logs, key/string identity and NULLs, trust/time/status variants, embedded/detached checks and path failures. A real GPGME reference survives handle release, GC and list cleanup. Three V-only linker allocator faults fail the result array and first/second unknown fingerprints; each reports MEMORY and releases the owned reference exactly once. Four related binaries and two frontend regressions pass. Full integration passed all 83 alpm binaries (826778 ms), all 27 frontend binaries (765451 ms), both vmakepkg binaries, consumer MCP, formatting/diff, the API guard, strict public smoke and actual vpac ELF checks without production libalpm headers/linkage/symbols. Logs: /tmp/alpm-signature-log-stage-full.log and /tmp/vpac-signature-log-stage-src.log. Obsolete raw-signature staging worktrees were removed after publication.

Signature policy/block-boundary stage is published: alpm.v 20209bb and vpac 3129534, both pushed successfully. Vpac #18 is resolved after all required integration checks passed.

Policy, trust and local-key/import preflight diagnostics/questions now follow the checked-out source order. Explicit meaningful error codes, modern keyboxes and bounded retry safeguards remain. Package archive reads use source BUFSIZ/filesystem block sizes, fixing a reproduced package-name difference across a NUL boundary.

Focused validation passes 984 strict C/core-or-public comparisons plus 96 explicitly bounded meaningful-error safeguards across 15 scenarios, nine signature levels, package/database operations and clean/preseeded error state. C fails signature reads or declined imports while leaving errno OK; native retains PKG_INVALID_SIG. Only the final error code is normalized in those guard rows; all other logs/questions/outcomes match exactly. Six related binaries and four frontend regressions pass, covering optional/required signatures, marginal trust, an IPC-declined unknown-key import without importing the key, and source metadata identity at the archive block boundary. Fixtures use private roots/keyrings, no network or host trust changes.

Full integration completed successfully: alpm 84/84 binaries (/tmp/alpm-signature-policy-stage-full.log), frontend 27/27 (/tmp/vpac-signature-policy-stage-src.log), vmakepkg 2/2, consumer MCP with zero diagnostics, formatting/diff, public API guard (266 functions/41 records/19 enums), strict public smoke with forbidden libalpm headers, and rebuilt vpac ELF without libalpm linkage or symbols. The previously recorded sessions 57116/64481 are finished. Both main worktrees are clean. No public V declarations or IPC shapes changed; neither repository contains Python files.

The next cold GPGME initialization stage is prepared and integrated uncommitted: alpm d348e60 and vpac 943e28d on main checkpoints 20209bb/3129534, tracked in vpac #19. Fresh-process tests pass 34 strict C/core/public comparisons and two explicitly asserted modern-keybox corrections, across nine keyring conditions, explicit/default homes and repeated checks. Six native tests cover callback re-entry from version/engine-info logs and keyring changes away/back. Failed-child cleanup with unreadable keyrings is proven. Four related signature binaries and the complete frontend binary pass. Production setup now emits source health/version/engine diagnostics, retains modern keyboxes and per-handle isolation, and invokes callbacks outside the setup mutex. Frontend checks cover missing-keyring warning count/order and healthy keyboxes. Consumer MCP passes with no diagnostics. Full integration RUNNING: alpm 7226 (85 binaries), frontend 41720 (27), vmakepkg 74575, API guard 29819, strict smoke 94911, rebuilt consumer ELF 26548. Logs: /tmp/alpm-signature-init-stage-full.log, /tmp/vpac-signature-init-stage-src.log, /tmp/vpac-signature-init-stage-vmakepkg.log, /tmp/alpm-signature-init-api-guard.log, /tmp/alpm-signature-init-native-api.log, /tmp/vpac-signature-init-binary.log. Poll the same handles to terminal completion before publishing or closing #19. Focused logs: /tmp/alpm-signature-init-final-focused.log, /tmp/alpm-signature-init-related.log, /tmp/vpac-signature-init-focused.log. Public declarations and IPC shapes unchanged; no Python.

The following public extract_keyid audit has a fresh worktree at /tmp/alpm-signature-keyid-stage-1794435051000/alpm based on prepared d348e60. No code edits yet; use source signing.c to prove logs/errno/output semantics, with explicit bounds/packet-type safeguards.

Following required audits include remaining accepted import/WKD/keyserver diagnostics and retry failures, process setup/I/O failures, archive auxiliary operations and the full public entry-point behavior audit. A concrete pending public entry is extract_keyid: its wrapper currently sets SIG_INVALID and emits no parser log on failure, whereas signing.c emits format/unsupported errors and leaves handle errno unchanged; compare defined cases while retaining pointer/packet-type bounds guards.

The full objective remains active and incomplete. Continue cache/metadata/signature/trust and process setup/I/O diagnostics, remaining event paths and the rest of the public entry-point audit. Keep this issue open until the entire faithful replacement and final consumer compatibility audit are proven.

Implement a faithful V package engine using the pacman checkout as the behavioral reference. Preserve the existing public V API unless a justified change is also applied to vpac. Completion requires replacing the entire backend; partial ports do not complete this issue. Reference: /home/diviocity/git/pacman, v7.1.0-18-ga6f7467d. Consumer: /home/diviocity/Projects/vpac. Current published checkpoint: alpm.v 20209bb and vpac 3129534. The default public backend runs in V with no production libalpm headers or linkage. The complete behavior and diagnostic audit remains open. All repository verification tools and network fixtures must be V; no Python files or runtime dependency. Stages: - [x] Native version ordering, dependency parsing/formatting, streaming checksums. Version comparator matched 172,225 comparisons against checked-out version.c. - [x] All 29 core list methods in V, retaining C-compatible allocation/layout during transition. Direct-source parity, ASan/UBSan and injected allocation-failure tests pass. Fixed placeholder output lists in search, key extraction and transactions. - [x] Native package model, .PKGINFO and DB metadata parsing, exact file lookup, lazy existing-local-database reader. Parity covers metadata, backups, extended data, integer overflow and provider semantics. Public Package.satisfies now follows deps.c for multiple provisions and versioned provisions. - [x] Native sync database archive reader using libarchive only for codecs/records. Plain and gzip parity, invalid/truncated archives, upstream metadata line limit, and missing-versus-empty checksum fields are tested. Libarchive declarations preserve the existing V mtree opaque types. - [x] Package archives, .MTREE, changelog and full file metadata. Partial/full loads, scan-versus-mtree preference, malformed-mtree fallback, plain/compressed mtree, ownership/mode/digest metadata and changelog reads match libalpm. Added compatible Package.mtree_step and migrated vpac verification off its direct C iterator call. A standalone native core executable builds with only the repository and vlib module paths and links libarchive without libalpm. - [x] Native handle/options core, DB registration/cache ownership, local DB creation, POSIX searches, groups and ignore matching. Published in 6938eb1, with parity tests and a standalone no-libalpm core smoke. - [x] Native read-only public facade integration, published in 372eead. - [x] Native dependency graph/checks, satisfier/provider selection, recursive dependency resolution with rollback, package conflicts, removal closure and reverse/group queries. Published in 45d45ca. - [x] Native transaction state, database lock ownership, async unlock/interruption and removal preparation. Published in d1d80ec; 320 flag/target combinations match C victim order, errors and events. - [x] Native install/upgrade/replacement preparation core, target/architecture validation, conflict/skip/replacement questions, reason and victim policy, old-package snapshots and cached download sizes. Published in a66ceae; public transaction methods still use libalpm. - [x] Native signature verification/trust core, package/database validation, checksum precedence, isolated keyrings, import questions and public decoding/issuer extraction. Published in a318fac. - [x] Native parallel download transport, mirror/cache-server error policy, resumption/conditional requests, companion signatures, limits and lifecycle callbacks. Published in 1c6b9f6. - [x] Native package-cache fetching orchestration, sync database refresh, retrieval events and external fetch callbacks. Published in 0a294a2. - [x] Native download sandboxing and privilege separation. - [x] Transport integration coverage for WKD/keyserver import. Published in 8f92976. - [x] Native local database entry preparation, desc/files serialization and writing, reason updates and flat entry removal. Published in 6d50e82. - [x] Native removal execution core, rooted filesystem operations, pacsave policy, callbacks/progress and interruption. Published in b4c7459; extensions integrated in ae1059e. - [x] Native filesystem file-conflict preflight, ownership-transfer removal skips and owned conflict/event/progress data. Published in 63f003a. - [x] Native transaction archive/cache/download finalization, keyring/integrity checks, download-space preflight and DOWNLOADONLY commits. Published in 84e3b1a. - [x] Native payload and special database archive extraction primitives, sparse data and metadata restoration. Published in 03deaf3; install/upgrade execution integration remains pending. - [x] Install/upgrade commit, safe extraction, pacnew/upgrade backups and special database archive files. Integrated with native mount-space preflight and published in 3d0a6ea. - [x] Native process runner, hooks and scriptlet execution primitives, chroot/privilege behavior and removal integration with output/events/interruption. Published in ae1059e. - [x] Install/upgrade hook/scriptlet/progress integration. Published in 3d0a6ea. - [x] Native public event/question/progress/download/fetch adapters and typed log delivery, published in 372eead. - [x] Hook parser, validation, dependency and discovery diagnostics through both the core and public facade, published in be6da3b. - [ ] Complete remaining source diagnostic/event parity, including cache warnings, metadata diagnostics, signature/trust errors and process setup/I/O failures. - [x] Switch the complete public facade to native and remove production libalpm calls/header/link requirements, verified on actual vpac binaries. - [ ] Complete behavioral auditing of every public entry point and edge case; declaration compatibility alone is insufficient. - [x] Restore retained legacy MD5 package queries from bdedf621^ and preserve historical local validation markers, published in 61ae4c8. - [x] Replace all five Python verification tools/network fixtures with V, including TLS/SNI, sanitizer and allocation-failure coverage, published in 61ae4c8. - [ ] Final API compatibility and hermetic integration coverage across vpac and vmakepkg; push the completed work and close this issue only when the entire replacement is finished. Validation at the metadata stage: all 27 vpac src binaries, both vmakepkg binaries, all 10 then-current alpm binaries, and v -check . passed. At the integrated sync archive stage all 12 alpm binaries, all 27 frontend binaries and both vmakepkg binaries pass. v -check . is clean after resolving a cross-module C declaration conflict. Next is package archive and .MTREE loading, followed by the native handle/read-only facade. The full rewrite remains active and incomplete. Package archive stage validation: v -check . clean; all 14 alpm binaries, all 27 vpac src binaries, and both vmakepkg binaries pass. Standalone core smoke runs successfully and ldd confirms no libalpm dependency for that core executable. The default public backend still uses libalpm, so the full rewrite remains incomplete. Next: native handle/options and read-only facade. Handle core stage validation: alpm.v 6938eb1 and vpac 18806e3 are pushed. All 16 alpm test binaries, all 27 vpac src binaries and both vmakepkg binaries pass; v -check . is clean. Native handle/options/query smoke builds with only the repository and vlib on its module path, runs successfully, and links libarchive without libalpm. Required database signatures fail closed until the native verifier is installed. Corrected nine option-removal wrappers, nonzero boolean options, and sandbox accessors with unchanged V signatures; vpac issue #4 closed after the consumer fixture passed. Next: dependency graph/checks, provider selection, conflict detection and preparation. Full backend replacement remains active and incomplete. Dependency core stage: published alpm.v 45d45ca. All 20 alpm test binaries, all 27 vpac src binaries, both vmakepkg binaries, and v -check . pass. The standalone core smoke now also exercises dependency checks/order and links no libalpm. C parity covers 80 dependency-check combinations, 384 provider-policy combinations including question order/answers, prepared ordering through installed intermediaries, cycles, pulled dependencies, recursive removals, conflict reasons, group/NEEDED selection, reverse-dependency scope and first-repository version policy. Public List.find_satisfier and dependency/file-conflict payload cleanup now run in V with unchanged signatures; no additional vpac code change was needed for this stage. Native cache lookups use the name index without cloning the entire cache. The public facade, transaction prepare/commit, downloads/signatures and hooks still require replacement. Next: native transaction state/locking/preparation. Full rewrite remains active and incomplete. Removal transaction stage: published alpm.v d1d80ec. All 22 alpm binaries, all 27 vpac src binaries, both vmakepkg binaries and v -check . pass. Native removal preparation matches C across 320 flag/target combinations, covering recurse/recurse-all, cascade, unneeded, NODEPS/NODEPVERSION, cycles, shared and optional dependencies, failure state and preparation events. Lock tests cover mutual exclusion against libalpm itself, descriptor 0, CLOEXEC, mode 0000, foreign locks and missing-lock cleanup. Generated C confirms native async unlock/interruption contain only descriptor operations, comparisons and scalar stores. The standalone core smoke now prepares a native removal and still links no libalpm. No system package transaction was committed. Next: native add/upgrade preparation and migrate vpac’s remaining direct C unlock call through a compatible async V method. Full replacement remains active and incomplete. Async facade migration: published alpm.v 5e54e78 and vpac 6c7f5d1. The new compatible Handle.unlock_async() int method keeps the signal path free of V error construction. vpac has no remaining C.alpm calls. Killed-child tests verify owned-lock release, the acquisition window and foreign-lock preservation; generated C confirms both the wrapper and signal handler contain no allocations. All 22 alpm, 27 vpac src and two vmakepkg test binaries pass, and v -check . is clean. vpac issue #5 is closed. Native install/upgrade/replacement preparation is next; the normal public backend still links libalpm and the full rewrite remains active. Install/upgrade preparation stage: published alpm.v a66ceae and vpac 4657132. All 24 alpm binaries, all 27 vpac src binaries, both vmakepkg binaries and v -check . pass. The C parity matrix covers 224 flag/target/answer combinations including dependency providers, skipped targets, inner and outer conflicts, reverse dependency failures, duplicate filenames, missing/empty architecture, malformed filename metadata, mixed install/removal and upgrade/downgrade/replacement policy. Questions, events, final target/victim order, reasons and download estimates match C. Additional native tests cover NEEDED, duplicate/invalid admission, signature requests failing closed, archive ownership, partial-cache sizes and avoiding upstream null-filename comparisons. Standalone core smoke now loads a real archive and prepares both install and removal without libalpm. Fixed a binding error discovered by the matrix: copying conflict names reset C errno; returned preparation errors now carry the captured numeric kind, and vpac uses it for formatting. vpac issue #6 is closed. Both worktrees are clean and pushed at this checkpoint. Next: downloads/database refresh/signatures, then commit/local DB writes/extraction, hooks and the native public facade. The normal backend still links libalpm; the full rewrite remains active and incomplete. Signature/trust stage: published alpm.v a318fac. All 27 alpm binaries, all 27 vpac src binaries, both vmakepkg binaries and v -check . pass. The standalone core verifies a genuinely signed archive, prepares its install, and ldd confirms no libalpm dependency. Native package loading and sync DB validation now enforce signature levels through GPGME with policy and owned results in V. C parity covers 90 package/database trust-level combinations plus multiple signers, embedded/armored signatures, tampering, disabled/expired keys and expired signatures. Native tests cover missing versus malformed optional signatures, checksum precedence/validation flags, bounded packet reads, isolated homes and key-cache invalidation, declined imports and local-key import callbacks. Public decoding and issuer extraction retain their signatures and libc allocation ownership. Deliberate fixes avoid newline-only base64 exposing uninitialized memory, reject truncated packet areas, support modern keyboxes, return useful import/read failures and bound retries. WKD/keyserver code has fingerprint checks; transport integration tests are still part of the network stage. No vpac code change was needed, and both worktrees are clean. Next: native downloads/cache policy/database refresh, then commit/extraction/local DB writes, hooks/callbacks and the native public facade. The normal public backend still links libalpm; the full rewrite remains active and incomplete. Download transport stage: published alpm.v 1c6b9f6. All 30 alpm binaries, all 27 vpac src binaries, both vmakepkg binaries and v -check . pass. The native transport uses curl multi for concurrent transfers while V owns stable largest-first scheduling, mirror/cache-server selection and error counts, partial files, conditional requests, companion signatures, limits and callbacks. File and isolated loopback HTTP fixtures cover redirects, byte ranges, truncation recovery, timestamps, optional failures, server blacklisting/cache override, actual parallelism, interruption and reuse. Six differential scenarios compare files and lifecycle callbacks against libalpm. Deliberate corrections reject unsafe/overlapping partial paths before truncation, enforce limits without Content-Length, isolate optional oversized failures and retry unusable ranges once from scratch. A small C header only handles typed curl ABI access, file stat layout and a volatile sig_atomic_t control field. Generated C confirms the native async interruption method performs no calls or allocations. The strict-module-path standalone smoke now downloads an archive and its detached signature, verifies it and prepares installation; ldd confirms no libalpm link. Both worktrees are clean and the stage is pushed. Next: package-cache fetching and sync database refresh, external fetch callbacks and sandbox integration, then keyserver/WKD transport coverage and the remaining commit/extraction/hooks/public-facade stages. A configured native sandbox user currently fails closed. The normal public API still uses libalpm; the full rewrite remains active and incomplete. Cache/refresh stage: published alpm.v 0a294a2. All 33 alpm binaries, all 27 vpac src binaries, both vmakepkg binaries and v -check . pass. Native fetching now selects/creates caches, honors remote signature levels, returns cached results first, manages temporary destinations and dispatches external fetch callbacks. Native sync refresh preserves usage/force policy, locks, invalidation after successful retrieval, retained loaded caches on failed retrieval, signature validation and up-to-date return values. Parity covers 48 cache/signature combinations, 13 callback-driven refresh scenarios and actual HTTP download/current/forced/failure refreshes, comparing callbacks, events, paths, contents and cached metadata. Native tests cover signed DB repair, writable cache fallback, modes/umask restoration, duplicate fetches, invalid callback results, temporary cleanup, preserved transaction/foreign locks and error codes surviving event callbacks or missing-lock housekeeping. The strict-path standalone executable now fetches and verifies a signed archive through cache policy, prepares its install, and refreshes a signed repository twice; ldd confirms no libalpm link. Deliberate corrections honor valid TMPDIR, avoid duplicate-output races, preserve borrowed transaction locks and reject false external-fetch success. The native FetchRequest includes its prepared output filename; existing public callback signatures are unchanged, and the final facade still needs its adapter. Both worktrees are clean and this stage is pushed. Next: download sandboxing and keyserver/WKD transport coverage, then commit/extraction/local DB writes, hooks and the public facade replacement. The normal public backend still uses libalpm; the full rewrite remains active and incomplete. Download sandbox stage: published alpm.v 9134606. All 38 alpm test binaries, all 27 vpac frontend binaries, both vmakepkg binaries and v -check . pass. Targeted follow-up tests cover the final worker and callback changes. The strict-path standalone executable fetches/verifies a signed package, prepares installation and refreshes a signed repository, and ldd confirms no libalpm link. Native automatic sandbox activation follows the original root UID snapshot, configured user and restriction flags. Explicit setup matches C across 32 isolated user-namespace probes for UID/GID, cleared supplementary groups, no-new-privileges, Landlock writes/execute restrictions and the 83-entry seccomp deny list. Actual HTTP comparisons across all four restriction combinations cover files, callback order/process identity, signatures including optional failures, resume, timestamps/current responses and failures. Native integration also covers cancellation/reuse, terminal-signal forwarding after cleanup, trusted parent fetch callbacks and their current-file responses. Fresh staging/cache inodes prevent retained worker descriptors from altering promoted cache files; unsafe outputs are rejected before privileged metadata changes, inherited descriptors are closed, standard streams redirected and bounded worker messages validated. Signature companions now correctly refetch when the main database is current, matching dload.c. The public V API is unchanged, vpac needed no code change and both worktrees are clean. Next: WKD/keyserver transport coverage, then commit/extraction/local DB writes, hooks/callbacks and the native public facade. The default public backend still links libalpm; the full rewrite remains active and incomplete. Key transport stage: published alpm.v 8f92976. The native importer now accepts matching ID-only HKP search entries when GPGME provides no fingerprint, and still verifies the requested fingerprint in the local keyring after import. Real GnuPG/dirmngr fixtures cover 23 operations: full fingerprints, ID-only indexes, eight-character fallback, missing keys, declined questions without requests, HTTPS WKD success, missing/wrong-key WKD fallback, untrusted TLS rejection, unrelated indexes and wrong returned key material. Six native/libalpm signed-package pairs compare outcomes, key presence, question contents and request order using independent empty keyrings. Native missing-key failures consistently report PKG_INVALID_SIG; be_package.c returns from that C prepass without assigning pm_errno. The Linux test uses private user/network/mount namespaces, loopback servers and temporary CA/hosts bindings, verifies the host files remain unchanged and kills each fixture home’s daemons. Final full verification: all 39 alpm binaries, all 27 vpac frontend binaries, both vmakepkg binaries and v -check . pass. The strict-module-path signed-package/cache/prepare/signed-repository smoke passes and ldd confirms no libalpm link. Every touched V file is formatted, public V signatures are unchanged and vpac requires no code update for this stage. Next: native local DB writing and transaction execution, safe extraction/backups/removal, hooks/scriptlets/callbacks and the final native public facade. Both worktrees are clean and this stage is pushed. The default public backend still uses libalpm; the full rewrite remains active and incomplete. Local database writer stage: published alpm.v 6d50e82. Native backend primitives now prepare package directories, serialize/write desc and files, persist install reasons and remove flat entries. Missing-versus-empty base/description/URL/packager fields retain explicit presence alongside architecture, and serialization matches section ordering, explicit-reason omission, validation tokens, dependencies/xdata, file lists and absent backup hashes. The differential suite checks 96 reason changes across 32 scalar-presence combinations against libalpm. Eight real C database-only installs in temporary roots provide desc/files records compared byte-for-byte to independently loaded native archives; hooks/scriptlets are disabled and no payload reaches those temporary roots. Native writes reserve exclusive temporary files, check original-record write permissions, preserve ownership/ordinary modes, fsync and atomically rename through pinned directory descriptors. Failed writes leave the old record and cached reason intact. Tests cover read-only files/directories, symlinked records/entries/local DBs (including the trailing-slash O_NOFOLLOW trap), hard links, invalid identities, nested-directory refusal, umask restoration/modes and actual partial-write failure in an RLIMIT_FSIZE-limited child. The standalone strict-path smoke now persists reason changes as well as signed fetching/verification, prepare and signed repository refresh; ldd confirms no libalpm link. All 41 alpm binaries, all 27 vpac frontend binaries, both vmakepkg binaries and v -check . pass; final focused storage/parity checks also pass. Changed V files are formatted, public root V signatures are unchanged and vpac requires no code change. Both worktrees are clean and the stage is pushed. Next: transaction execution with extraction/backups/removal, special database archive files, hooks/scriptlets/callbacks and the native public facade. The default public backend still links libalpm; the full rewrite remains active and incomplete. Removal execution stage: published alpm.v b4c7459. Native removal commits now unlink payloads, preserve/rotate modified backups, retain shared directories and mountpoints, remove local records, invalidate package/group caches, deliver ordered transaction/package/pacsave/progress callbacks and finish the current package before honoring interruption. Twenty-one libalpm comparisons check complete root/database snapshots and callback/progress traces, including NoUpgrade and negation, ignored NoExtract, database-only removal, missing files, merged directory links, rotation gaps/aliases, modified/dangling/cyclic backup links and interruption. Root-relative descriptor traversal follows absolute links inside the pinned root, rejects escaping package paths and pins each parent across unlink/rename; tests cover swapped parents, link cycles and descriptor zero. Real private user/mount namespace probes verify read-only filesystem errors and retained empty mountpoints without host package changes. Deliberate corrections retain database entries on file-removal failures, reject unreadable/special backup files without blocking or data loss, preserve files with absent backup hashes, reject reentrant transaction release during callbacks and bound pacsave rotation rather than walking arbitrary numeric gaps. Active hooks, scriptlets and ldconfig are refused before mutation until their runner is implemented; installs/upgrades remain pending. Final validation: all 45 alpm binaries, all 27 vpac frontend binaries, both vmakepkg binaries, clean compiler checks, formatted changed V files and strict-module-path native signed-fetch/prepare/refresh/reason/removal smoke; ldd confirms no libalpm link for that standalone engine executable. Public root V signatures are unchanged, vpac needs no code change and both worktrees are clean. Next: native process execution for hooks/scriptlets/ldconfig, install/upgrade extraction/backups/special database files and the final native public facade. The default public backend still links libalpm; the full rewrite remains active and incomplete. Hooks/scriptlets/process stage: published alpm.v ae1059e. Native removal commits now discover and run pre/post transaction hooks, pre/post removal scriptlets and ldconfig in source order. Hook policy covers directory priority, empty-file and /dev/null masks, suffix-free name ordering, strict section/directive parsing, wordsplit quoting, Package/Path operations with shared-path upgrade classification, negation, NoExtract on installing paths only, Depends, AbortOnFail and sorted/deduplicated NeedsTargets input. Post hooks reload after mutation. Twenty-five real native/libalpm transaction pairs in private user namespaces and disposable chroots compare outcomes, event/output order, payload/database retention and cleanup, including overrides, mixed target types, malformed hooks, missing commands/dependencies, ignored failures, flag combinations, removed hooks and interruption. In particular ldconfig runs when the interrupted current package is the final package, but not when later packages remain; post hooks are skipped after interruption. Native unit tests cover install/upgrade path classification, archive scriptlet phases and literal version arguments. Scriptlets stage through pinned directories with exclusive files, checks on regular files and cleanup after failure; a /tmp link resolves inside the package root. The V runner pumps combined output and input concurrently, uses callback output, preserves parent cwd/environment/umask/signals/descriptors, resets child signals, closes inherited descriptors and reaps children. Tests exercise full buffers in both directions, closed stdin without SIGPIPE, signal/nonzero/exec failures, a root opened as descriptor zero and deleted parent cwd. Deliberate corrections report EOF fragments once, pass scriptlet versions as literal arguments and reject invalid commands/special hook or scriptlet files rather than blocking. Native shell/ldconfig defaults follow the pacman source defaults; fixture roots also provide the installed C oracle distribution paths. Validation: all 49 alpm binaries, all 27 vpac frontend binaries, both vmakepkg binaries, clean compiler diagnostics and verified formatting pass. The strict-module-path core smoke passes; ldd confirms no libalpm link for both the core and native process test executables. Public root V signatures are unchanged, vpac requires no code change and both worktrees are clean. Next: native install/upgrade execution, extraction and file-conflict checks, pacnew/upgrade backup policy, special database archive records, execution integration and final public facade/event/logging migration. The normal public backend still uses libalpm; the full rewrite remains active and incomplete. File-conflict preflight stage: published alpm.v 63f003a. Prepared native transactions with fully loaded archive targets now check target intersections, filesystem ownership, file/directory replacements, scheduled removals, ownership transfers, unowned backup files and relative/rooted overwrite patterns. The checker preserves target/file/conflicting-owner ordering, shared-directory policy, NoExtract/NoUpgrade behavior, NOCONFLICTS versus DBONLY distinctions and the removal skip list that prevents a later upgrade from deleting a transferred file. Typed conflict strings are owned in V and retained on the transaction for error reporting. Native commit preflight consumes these results for full archive targets before its still-pending extraction guard; actual installs/upgrades remain unsupported. There are 336 real libalpm comparisons across 28 filesystem/ownership scenarios, three flag policies and four overwrite policies, matching ordered conflict payloads, events and every file-conflict progress call. The C oracle is interrupted at transaction start, so these comparisons modify no payload or local package record. Native guards reject partial archive metadata, invalid states and escaping package paths, prevent callback release/recursive re-entry, retain failure data and build transfer plans without filesystem mutation. File metadata is loaded only when needed. Directory traversal stays rooted and checks ancestor inode/device identities rather than imposing an arbitrary recursion depth. A separately added real cyclic-bind-mount test in a private Linux user/mount namespace verifies prompt conflict rejection and retained directory/database entries; ldd confirms that probe links no libalpm. Validation passed: the complete then-current 51-binary alpm suite plus the subsequently added mount binary (52 alpm binaries altogether), all 27 vpac frontend binaries, both vmakepkg binaries, clean consumer compiler diagnostics and verified formatting of every touched V file. The strict-module-path core smoke and native file-preflight executable both build, run and link without libalpm. Public root V signatures are unchanged, vpac requires no code change and both worktrees are clean. Next: transaction archive/cache/download finalization, native payload extraction and metadata, pacnew/upgrade backup rules, special database archive records, complete install/upgrade execution and final facade/event/logging integration. The normal public backend still uses libalpm; the full rewrite remains active and incomplete. Transaction archive stage: published alpm.v 84e3b1a. Native transactions now download repository targets, preflight download space, deduplicate missing signing keys, validate checksums/signatures and load full archives in source event/progress order. Archive identity, installed size and dependency/conflict/provision/replacement/group multisets must match repository metadata. Fully loaded targets preserve reasons, validation and old-package snapshots without detaching sync cache entries. DOWNLOADONLY commits finish after integrity checks, retaining source transaction state without changing payloads or local package records. Corrupted-package questions retain typed error information through callbacks. The new compatibility suite checks 128 native/C cases covering cached/fetched/partial/local/mixed targets, malformed archives, metadata mismatches and order, signatures, tampering and unknown-key refusal. A known source bug returns unset errno on missing-key prepass failure; native code returns PKG_INVALID_SIG. Private user/mount namespace tmpfs probes test real sufficient/insufficient download space. Validation: all 55 alpm test binaries, all 27 vpac binaries, both vmakepkg binaries, clean consumer compiler diagnostics and formatting pass; three final focused binaries pass after the additional unusable-keyring regression case. Strict-module-path core and transaction-loader binaries execute successfully and ldd confirms no libalpm linkage. Public root V signatures are unchanged; vpac requires no code change. Next: native payload extraction and special database records, pacnew/upgrade policy, install/upgrade execution/disk-space checks, and final public facade/event/logging integration. The normal public backend still uses libalpm; the full rewrite remains active and incomplete. Extraction primitive stage: published alpm.v 03deaf3. V now streams regular/sparse payload data through pinned directory descriptors, creates directories, symlinks/hardlinks, FIFOs and device nodes, preserves existing directory metadata and restores numeric ownership, appropriate SUID/SGID bits, fractional access/modification times and extended attributes while omitting ACL encodings. Parent directories follow add.c UNLINK/SECURE_SYMLINKS policy: extraction replaces intervening links instead of following them. Ordinary lookup/removal resolution retains its previous rooted link behavior. Data-bearing CPIO hardlinks are pinned, checked as regular files and truncated before writing; zero-data hardlinks retain source inode metadata. Binary .INSTALL/.CHANGELOG/.MTREE records use mode 0644, reserved dot members are skipped, and database record links/nodes are rejected. The caller cwd and umask are unchanged. Small C helpers expose typed syscall ABI only; extraction policy and streaming remain in V. Linux metadata on links/nodes and pinned hardlink reopening use /proc/self/fd anchors. Extraction comparisons exercise source flags, all normal file/directory transitions, ownership failures and privilege bits, real GNU sparse archives/xattrs, read-only files, PAX fractional times and ACL omission, hardlinks including data-bearing CPIO entries, parent symlinks, shared-inode replacement and complete root/metadata snapshots. Additional cases check pinned destinations after parent-link swaps, descriptor zero, malformed/escaping paths, special database members, truncated data and RLIMIT_FSIZE failures. The suite also runs as mapped root on a private tmpfs and checks device-node outcomes. This host permits the fixture character node but denies its block node; native code reports the denial instead of silently accepting a libarchive warning. Deliberate corrections reject failed creation/writes and truncated data, forbid escaping hardlink targets and reject intermediate source links without deleting them. Pacman add.c currently accepts archive_read_extract2 header/write failures downgraded to WARN unless errno is ENOSPC, which can silently omit package files. Validation: the broad 57-binary alpm run passed 56 binaries and exposed only a new reference-harness trailing-slash bug. Correcting the harness to match util-common.c llstat made the extraction binary pass; the additional data-bearing CPIO case also passes. All 57 alpm binaries are therefore verified across the broad run and focused rerun, including the final native extraction binary rebuilt/executed inside a private namespace. All 27 vpac frontend binaries and both vmakepkg binaries pass. Consumer compiler diagnostics are clean; every changed V file is formatted and staged diff checks passed. The strict module-path extraction executable links no libalpm. No public root V API changed, vpac requires no code change, both worktrees are clean and the stage is pushed. Native installation/upgrade commits remain guarded until extraction is integrated with pacnew/upgrade backups, install-space accounting, reasons/cache/database updates and execution callbacks/hooks/scriptlets. The final facade/event/logging switch remains pending. The full rewrite remains active and incomplete. Installation/upgrade execution stage: published alpm.v 3d0a6ea. Native commit now completes file targets, runs file and optional installation-space preflight, invokes pre-transaction hooks, removes scheduled victims, and executes installs/upgrades/downgrades/reinstalls. It preserves old snapshots and reasons, applies ALLDEPS before ALLEXPLICIT overrides in source order, extracts metadata/payloads, writes local records, inserts owned cache copies and invalidates groups. Backup policy matches add.c across original/local/incoming MD5 choices, retroactive and dropped backup declarations, absent hashes/files, preexisting pacnew files, NoUpgrade/NoExtract negation and NOSAVE; pacnew/pacsave and operation-specific byte progress are emitted in source order. DBONLY skips payload removal/extraction while retaining extension policy. SOURCE_DATE_EPOCH parsing includes signed conversion and invalid/overflow fallback. Pre-install/upgrade scripts read the archive; post scripts read the new database record; old removal scriptlets are suppressed for upgrades. Interruption finishes the current package, skips later targets, and retains source ldconfig/post-hook behavior. Native installation space accounting parses ordered/escaped mount paths, lazily loads statvfs capacity/read-only flags, subtracts removed logical file sizes, adds declared installed files and tracks maximum requirements after each target with the source cushion. It preserves source NoExtract accounting and rejects arithmetic overflow. Eight actual tmpfs/root/submount comparisons check sufficient/insufficient space, read-only mounts, NoExtract, peak-versus-final requirements and reordered targets, including exact event/progress traces and unchanged state on rejection. The read-only probe uses a direct remount syscall to avoid mount utility replay of host UID/GID options inside the mapped namespace. 43 real native/C package transactions compare complete payload/database trees and every relevant phase/operation/backup/progress callback across fresh installs, upgrades/reinstalls/downgrades, backup hashes, flags, mtree exclusion, removals and interruption. Sixteen further pairs execute hooks, scriptlets and ldconfig in private chroots, including hook/script failures, DBONLY, flags, interruption, installed/no-extract hooks and victim removal. Native-only tests verify signed repository installation, reason/validation/cache ownership and reopening, partial file-target completion, timestamp/mount parsing boundaries, reentrant release/commit guards and real limited writes. Failed extraction/writes now abort without success events or an installed cache entry and discard the incomplete new database entry, rather than accepting libarchive header/write warnings as successful extraction. Partially loaded file targets are completed before execution. Validation: all 61 alpm test binaries, all 27 vpac frontend binaries and both vmakepkg binaries pass in their complete suite runs. Consumer v -check diagnostics are clean; all touched V files are formatted and staged diff checks pass. The strict module-path native installation executable builds and executes successfully, including signed package transactions and failure cleanup; ldd confirms no libalpm dependency. Public root V signatures are unchanged, vpac requires no code change and both worktrees are clean. Next: freeze the transitional C facade as an independent test oracle, port the public handle/package/database/transaction surface and event/logging adapters, remove production libalpm/header/link requirements, and audit all public entry points with vpac integration. The normal public backend still uses libalpm; the full rewrite remains active and incomplete. Public migration preparation: published alpm.v 1bcfb3e and vpac b6d2234. Differential suites now use a separate C reference module under tests/coracle with distinct foreign symbol names; reference primitives call C and neither implementation file imports the current backend. All seven reference probes use this module. Root allocator interoperability and signature-decoding tests still exercise the actual current public implementation. Added a compiler-AST declaration baseline guarding 266 public functions, 41 records, 19 enums, callback aliases, returns, mutability, fields and flag values, with verifier self-tests. This is declaration evidence, not behavioral proof. Added portable formatted-line callbacks with complete long-message formatting, getter/context preservation and safe replacement/clearing; vpac uses this API and no longer owns a libalpm C helper. Legacy raw callbacks remain available. Companion vpac issue #7 is closed. Validation: broad alpm run passed 59/65 and found one missing libarchive declaration in the isolated reference; all six affected binaries pass after the correction, verifying all 65 across the run and reruns. The final API verifier binary also passes. All 27 vpac frontend binaries and both vmakepkg binaries pass; consumer compiler diagnostics, touched-file formatting and staged diff checks are clean. Both repositories are pushed. Next: convert the complete public handle/database/package/transaction facade and all event/question/logging adapters to the native backend, audit every entry point and prove the actual vpac binary has no libalpm/header dependency. The default public backend remains C-backed; full rewrite active and incomplete. Public native backend switch: published alpm.v 372eead and vpac 0197846. The default root alpm module now wraps engine handles, databases, packages, dependency queries, transactions, downloads and signatures directly in V. Production sources contain no libalpm calls, headers or link flags. All 266 existing public function declarations remain compatible. Native opaque wrappers retain identity, borrowed metadata/list views are owned until release, and a collector root preserves the manual handle lifetime when only unmanaged list nodes remain. Formatted log callback contexts are explicitly retained outside their libc adapter boxes. Signature results, file lists, dependency/conflict payloads, changelog/mtree streams and signature byte outputs are adapted to the existing API. All event/question/progress/download/fetch callback payloads have native adapters; the complete behavioral audit of uncommon paths is still pending. Typed sandbox log messages execute callbacks in the parent. Reinstall/downgrade, mirror failures and mtree-open diagnostics retain frontend behavior. The public action-log method now follows source prefix handling, timestamp format, descriptor lifetime, rotation, file modes, syslog option and error mapping. Its V message argument treats percent signs as data. Transaction action-record emission throughout the core remains a separate unfinished requirement. Legacy MD5 package methods are retained with documented empty/unsupported behavior because the corresponding C functions no longer exist in the referenced source; file-level MD5 hashing is unaffected. The public get_sig output-pointer/length bug is corrected. Public validation adds the same 43 C/native installation scenarios through the actual public API, comparing full payload/database trees and phase/operation/backup/progress traces. Further comparisons exercise local/sync/archive metadata, signatures/trust/result cleanup and action-log prefixes/rotation/errors. Native tests cover borrowed identity and views, GC retention, mtree/changelog streams and owned binary signature data. A real failure exposed collector thread entries inherited after fork: GCC workers aborted with pthread_kill failed at suspend and one comparison retained its output pipe after timeout. Native forks now call libgc atfork prepare/parent/child hooks, which are no-ops when automatic handling is active. A forced collection in a child of a threaded parent passes with both default and GCC builds, and all four real GCC sandbox configurations pass. No compiler or module-cache patches were made. Final validation after the fork fix: the complete 68-binary alpm suite passes. The complete 27-binary vpac frontend suite and both vmakepkg binaries pass. Consumer v -check diagnostics are clean, all touched V files are formatted and staged diff checks pass. tests/native_api_smoke.py builds and executes the public API suite through a strict module path while deliberately forbidding alpm.h/alpm_list.h, then verifies no libalpm linkage or undefined C symbols. The actual rebuilt vpac executable also has no libalpm library or symbols. Both repositories are pushed; companion vpac documentation issue #8 is resolved. Next required work: complete core transaction action-log records (including package/hook/scriptlet and failure/interruption paths), audit the remaining source diagnostic/event paths and every public entry point/edge case, and extend public differential coverage where indirect core tests are insufficient. Native default backend and absence of production libalpm are now implemented and verified; full faithful replacement remains active and incomplete. Keep this issue open. Transaction action-log stage: published alpm.v 92ee27b. Native execution now records source-ordered transaction start/completion/interruption/failure, installation/upgrade/downgrade/reinstall and removal, hook execution, scriptlet/ldconfig output, pacnew/pacsave and directory permission warnings. Package operation records precede post-scriptlets; hook records precede hook-run callbacks; transaction completion follows its done callback and precedes post-hooks. Preflight, pre-hook abort and DOWNLOADONLY do not fabricate started/failed transaction records. Error action records cover database preparation/update, extraction, backup renames and unlink failures. Failed-transaction logging preserves the original kind, detail and detail-valid state even if the logfile is unavailable. Native hardening still aborts failed extraction/removal without false success records or false database/cache updates. Exec-failure output now matches the source parentheses wording, removing the old test exclusion. 86 real C/native pairs now compare complete action logs and their visibility at event/progress callbacks: 45 public installation cases (43 existing scenarios plus directory permissions and DOWNLOADONLY), 16 private-chroot installation extension cases and 25 private-chroot removal extension cases. These include hook/scriptlet failures, pre-hook aborts, interruption, ldconfig, database-only and skip flags. Six native adversarial scenarios check missing archives with an unwritable log, a payload changed to a directory after preflight, failed database creation, unsafe metadata replacement with an unchanged outside sentinel, file-conflict preflight with no action file, and a real unprivileged unlink denial retaining the installed database entry. Failed actions claim neither installed/removed packages nor transaction completion. Validation: the complete 69-binary alpm run, all 27 vpac frontend binaries and both vmakepkg binaries pass. The final action-log fault binary also passes with the additional unlink scenario. Consumer compiler diagnostics are clean; all changed V files pass formatting and staged diff checks. The 266-function public API declaration guard passes unchanged. The strict-module-path public API smoke builds and runs with libalpm headers deliberately forbidden and no libalpm symbols/library. The actual rebuilt vpac executable also has no libalpm symbols/library. No vpac source or API change was needed in this stage; its repository remains clean at 0197846. Next required work remains the public API and source diagnostic/event audit. Concrete outstanding cases include command exit/signal and hook-error diagnostics that are currently collected but not fully streamed through the public log callback, and the transitional empty/unsupported get_md5_sum/checkmd5sum methods. Pacman history bdedf621^ retains the prior MD5 package API implementation for compatibility reference; do not treat signature preservation alone as behavioral completion. Continue hermetic comparisons and consumer validation. The full faithful rewrite remains active and incomplete; keep this issue open. Legacy compatibility and V tooling stage: published alpm.v 61ae4c8 with companion vpac 9033a2b. get_md5_sum/checkmd5sum now implement their retained pre-bdedf621 package.c/util.c behavior: raw MD5 metadata, first regular cached package, case-sensitive comparison, PKG_INVALID on mismatch and legacy no-errno failures for unavailable digests. Forty-eight independent frozen-C/native combinations cover digest presence/case/malformed values, cache priority, files, directories and links; local/archive origin rejection and unreadable/missing filename boundaries are also covered. Historical local VALIDATION md5 markers now survive reason/description rewrites and reopening, including a real hermetic vpac mark regression. Current SHA256/signature transaction policy remains unchanged. Command exit/signal/waitpid failures now stream util.c's error messages and severity through the native log callback. Extension coverage grows to 27 removal pairs and 88 total C/native transaction action-log comparisons. Six extension cases compare complete warning/error logs interleaved with actions/events, including failed exec, failed scripts, aborting/ignored hook failures, signal termination and a callback deliberately reaping the command child to trigger a real waitpid failure. Remaining hook parsing/discovery/dependency diagnostics are not yet fully streamed. At the user's direction, every Python file and invocation was removed from the repository. V tools now implement the compiler-AST declaration guard/self-tests, strict-module-path public API smoke with forbidden alpm headers and ELF dependency checks, checked-out version.c comparisons, checked-out alpm_list.c and allocation-fault comparisons, and the private-namespace HKP/WKD fixture. The V server preserves real GnuPG requests, trusted/untrusted TLS, SNI observations, wrong-key/body/index rejection, six C/native signed-package loading pairs and unchanged host trust/hosts files. Parent cleanup also reaps fixture GnuPG agents after failed/timed-out children. The list source tool now strips installed alpm headers/link flags and explicitly executes/checks its standalone test ELF. Validation: the complete 71-binary alpm run, all 27 vpac frontend binaries and both vmakepkg binaries pass. After the tooling replacement, the API verifier and all 23 real key-transport operations pass their focused reruns. All five V tools pass: the API guard preserves 266 functions/41 records/19 enums, version.c matches 172225 comparisons, normal and GCC ASan/UBSan list/allocation-fault tests pass, and the strict public API smoke has no libalpm headers, symbols or linkage. The actual rebuilt vpac ELF also has no libalpm symbols/library. Consumer compiler diagnostics, changed-V formatting and staged diff checks are clean; no Python source files or command references remain. Companion vpac issue #9 is resolved after validation and publication. Next required work: complete hook parser/discovery/dependency log parity, then cache, metadata and signature/trust diagnostics and remaining source event paths. Expand direct public comparisons for currently indirect surfaces, including server/cache-server mutations, callback accessors, dependency helpers and transaction flags. Preserve the full API/behavior audit requirement and verify final integration before closure. The full faithful rewrite remains active and incomplete; keep this issue open. Hook diagnostic stage: published alpm.v be6da3b. Native hook parsing now streams hook.c messages, severity, full paths and buffer-counted line numbers. Duplicate definitions warn in source order; validation reports every missing trigger field, Exec and When. Missing hook dependencies now emit the source error. Discovery uses checked directory iteration instead of os.ls, preserving open/stat/readdir and directory/file PATH_MAX failures. fgets(PATH_MAX) line fragments are reproduced, and empty Exec= versus a quoted empty executable retain source parse/run behavior. Native NUL and nonregular-stream guards remain; missing operands are diagnosed rather than reaching the source's NULL string operations. Sixty-eight real private-namespace scenarios now compare the C transaction against both the engine and the actual public V facade: 136 removal/extension comparisons, making 197 total transaction action-log comparisons with the existing 45 public install and 16 installation-extension pairs. Every removal scenario compares all warning/error messages interleaved with actions and events, success, final victim records, payload presence, temporary scriptlet files and lock cleanup. Cases cover missing/invalid fields and sections, duplicate/empty/unterminated Exec, long-line fragments, wrong-section options, CRLF/final-line handling, dependencies, overrides, disappearing hooks, broken links, non-directory/missing/oversized hook directories, joined-path overflow and a callback closing only its fixture's directory descriptor to provoke a real readdir failure. Source errno/error flow and event/action timing match through the public callback adapters as well as the core. Validation: the complete 71-binary alpm suite, all 27 vpac frontend binaries and both vmakepkg binaries pass. The final default-compiler extension rerun passes after the oversized-path fixture cleanup correction. A GCC build also passes all 68 core and 68 public comparisons and explicitly verifies the complete fixture directory was removed. The first GCC run exposed cleanup failure for the deliberately over-PATH_MAX filename; a shared V fixture helper now unlinks it relative to its directory in both probe and parent cleanup, and the four identified owned leftovers were removed. Changed V files, staged diff checks, the 266-function API declaration guard and consumer compiler diagnostics pass. The strict public API smoke still forbids libalpm headers and verifies no library/symbol dependency; the actual rebuilt vpac ELF also has no libalpm linkage or symbols. No public API or vpac source change was needed. The vpac worktree remains clean at 9033a2b, and no Python tooling was introduced. Database API stage: published alpm.v 74a4679, integrating prepared 16f9313 on top of be6da3b. Metadata accessors and empty server-list replacement now preserve handle error state like db.c; real operations still clear errors. Server mutations normalize embedded NULs before trailing-slash policy. Live/registered guards remain. The 344 new independent C/public cases cover 104 metadata/error cases and 240 URL/list mutations. The complete 72-binary alpm suite, all 27 vpac frontend binaries and both vmakepkg binaries passed. The consumer compiler check, formatter, 266-function API declaration guard, strict public smoke and actual vpac ELF checks passed, with no libalpm header, library or symbol dependency. Both main worktrees are clean; the obsolete database staging worktree has been removed. Cache diagnostic stage: published alpm.v 404bfc3 and vpac fd65340; vpac issue #10 is closed after both pushes succeeded. Source-ordered cache lookup, selection, retrieval and download-size messages pass 72 strict C/core-or-public comparisons. Two additional checks retain native cache-directory revalidation: upstream accepts a regular file after mkdir EEXIST and then fails retrieval; native preserves the file and uses the next valid directory. Valid TMPDIR handling and created-directory revalidation remain. Download-size accounting repeats stat after lookup like sync.c, including callback-driven removal/resize and memoized repeat reads. The companion frontend regression verifies creation/lookup warning IPC messages precede downloads, the sentinel file survives, the next cache holds the archive, the fixture payload is installed and its lock is released. No public V API or IPC shape change. Integrated validation is complete: all 73 alpm binaries passed (647773 ms), all 27 vpac binaries passed (649158 ms), and both vmakepkg binaries passed. Consumer MCP diagnostics, formatter/staged diff, the 266-function declaration guard, strict no-libalpm public smoke and actual vpac ELF dependency/symbol checks passed. Full logs: /tmp/alpm-cache-stage-full.log and /tmp/vpac-cache-stage-src.log. Both main worktrees are clean at published 404bfc3/fd65340. Signature extraction stage: published alpm.v 3a5fed8. The independent V-only reproduction /tmp/alpm-signature-cache-probe-1794421094528.v showed that a sync package with embedded PGPSIG=YWJj and no cached package succeeds in C (3 bytes), while the previous native getter returned PKG_NOT_FOUND (33). The native getter now decodes before cache lookup as package.c does, preserves prior errno on success, sets SIG_INVALID on decode failure, and follows detached access/open/read errors, output lengths and diagnostics. Direct archive-path support and null/released-object guards remain. Sixty strict C/core/public comparisons cover embedded/binary/empty/invalid data, missing packages/signatures, directories and ordinary/unreadable/dangling/looping symlinks, with clean and preseeded errno. Caller-owned output survives GC and handle release. Validation: all 74 alpm binaries passed (481489 ms), all 27 vpac binaries passed (480376 ms), and both vmakepkg binaries passed. Consumer MCP diagnostics, formatter/staged diff, the 266-function API declaration guard, strict native API smoke and actual vpac ELF checks passed with no libalpm header, linkage or symbol dependency. Logs: /tmp/alpm-signature-stage-full.log, /tmp/vpac-signature-stage-src.log, /tmp/alpm-signature-bytes-final.log. The publication push succeeded; no public V API or consumer source change was needed. Download-size getter stage: published alpm.v 3024b28. Initial and memoized successful reads preserve prior errno, and the public getter returns stored size after computation failure as sync.c does. Transaction preparation remains strict. The merge retained partial-file re-stat and cache diagnostics. Eighty-eight strict C/core/public comparisons cover sync/empty/missing filenames, local/archive origins, none/whole/partial caches, initial/memoized/repeated calls and clean/preseeded error state. Null/released-object guards and strict transaction tests pass. The merged focused three-binary suite passes. Full validation passed all 75 alpm binaries (478644 ms), all 27 vpac binaries (471830 ms), both vmakepkg binaries, clean consumer MCP diagnostics, formatting/staged diff, API guard, strict public smoke and actual vpac ELF checks with no libalpm headers, linkage or symbols. Push succeeded; public V signatures and consumer source are compatible. The obsolete signature/download-size staging worktree was removed after publication. Local metadata stage: published alpm.v 8984511 and vpac 65c7431; companion issue #11 is closed after both pushes succeeded. The reader follows be_local.c persistent fgets fragments, safe_fgets EINTR behavior, newline/EOF/NUL semantics and streaming read failures. Public lazy getters preserve stored partial fields with package.c errno semantics, while core load errors stay sticky for transactions. Source severity/order now covers name/version inconsistencies, unknown reasons/validation/keys, open failures and function-level loading messages. Legacy MD5 validation history remains supported. The implementation/tooling remain V; libc supplies only I/O primitives. Validation passed 276 strict C/public comparisons across 46 scenarios, three lazy-read orders and clean/preseeded errno, including six callback-driven real descriptor faults and partial-list versus temporary-list behavior. Four failed-load transactions reject commit and preserve their private payload/database records. The native FILES I/O-error guard remains stricter than upstream's unchecked loop. The consumer regressions preserve parsed description/reason, deliver unknown-key warnings and missing-desc errors through existing IPC shapes, leave DB content unchanged and create no lock. The full 76-binary alpm suite passed (478390 ms), all 27 frontend binaries passed (469175 ms), both vmakepkg binaries passed, and consumer MCP diagnostics, formatting, declaration guard, strict public smoke and actual vpac ELF no-libalpm checks passed. Logs: /tmp/alpm-local-metadata-stage-full.log and /tmp/vpac-local-metadata-stage-src.log. Obsolete metadata staging worktrees were removed after publication. Local DB population stage: published alpm.v 85d9f7a and vpac 578ceae; companion issue #12 is closed after both pushes succeeded. Invalid-name, duplicate-entry and metadata messages follow db.c/be_local.c, along with BASE/cache insertion function logs and cache lifecycle/count messages. The source's C implementation-location RET_ERR debug messages are excluded from comparisons; warning/error, function and cache messages are compared. Native validity remains separate from package.c's unusual fnmatch diagnostic argument order. Focused validation passed 84 strict C/core-or-public comparisons and eight explicit guard cases, across normal/unusual/malformed entries, duplicates/order/reuse, inaccessible/replaced/disappeared directories and retries with clean/preseeded errno. Native retains unconditional symlink-entry exclusion even where C's stat fallback follows them. Checked readdir rejects partial caches: a callback closes only the fixture's directory descriptor in a 2001-entry DB; C repeats a truncated cache while native returns DB_OPEN without committing it and recovers all 2001 entries on retry. The consumer reports invalid/duplicate entries through IPC and cache read failure through the existing target ErrorEvent, then recovers without DB writes or lock changes. Full validation passed 77 alpm binaries (476538 ms), 27 vpac binaries (463609 ms), both vmakepkg binaries, compiler/format/staged-diff checks, API guard, strict public smoke and actual vpac ELF checks without libalpm headers/linkage/symbols. Logs: /tmp/alpm-local-population-stage-full.log and /tmp/vpac-local-population-stage-src.log. Obsolete population staging worktrees were removed after publication. Local DB validation stage: published alpm.v bd166a7 and vpac b6ca929. Companion issue #13 is closed after complete validation and both pushes. The native constant-memory scanner reproduces be_local.c fscanf("%zu") sign/whitespace/overflow/prefix behavior. Directory-open errors remain DB_OPEN; missing-directory creation uses DB_CREATE. Newly written version files need not be readable immediately under the caller's umask. Write/close failures are checked rather than reporting an initialized DB after failure. Focused validation passes 102 strict C/core/public comparisons and ten explicit safeguards across 54 fixture combinations, including six checks retaining meaningful creation errors where C leaves errno OK and four RLIMIT_FSIZE=0 checks rejecting ignored flush failures. All filesystem data/modes and temporary process settings are checked/restored. Vpac init_handle now preserves the underlying cause/code; its frontend regressions cover regular-file local paths, restrictive creation umasks and signed version input. No public V signature or IPC shape change. Integrated validation passed all 78 alpm binaries (970573 ms), all 27 vpac frontend binaries (952177 ms), both vmakepkg binaries, clean consumer MCP diagnostics, formatting/diff, the 266-function/41-record/19-enum API guard, strict native public smoke and actual vpac ELF checks without libalpm headers/linkage/symbols. Logs: /tmp/alpm-local-validation-stage-full.log and /tmp/vpac-local-validation-stage-src.log. Both main worktrees are clean at the published revisions. Cached repository error/recovery stage: published alpm.v 84163df and vpac df19d4d. Companion issue #14 is closed after full validation and both pushes. Independent source comparisons distinguish archive-open DB_OPEN errors, malformed metadata DB_INVALID and later header LIBARCHIVE failures. Header failures retain validity for retry after repair; failed opens/parses poison the existing database until re-registration. Sync readability and signature checks use source-compatible faccessat with AT_SYMLINK_NOFOLLOW. Existing native safeguards do not cache failed group lookups. Focused validation passes 148 strict C/core-or-public comparisons and twenty explicit source-group-cache safeguard comparisons across fourteen scenarios, three signature levels, clean/preseeded errno, repair and re-registration. All other actions remain exact in safeguard cases. Repeated successful and failed archive loads preserve their descriptor counts. Five related archive/signature binaries and the frontend regressions passed. The full integrated 79-binary alpm suite passed (775766 ms), all 27 vpac frontend binaries passed (702084 ms), both vmakepkg binaries passed, and consumer MCP diagnostics, formatter/diff, API guard, strict public smoke and actual rebuilt vpac ELF checks passed with no production libalpm headers/linkage/symbols. No public API or IPC shape changes; no Python files. Logs: /tmp/alpm-cached-db-stage-full.log, /tmp/vpac-cached-db-stage-src.log, /tmp/alpm-cached-db-parity.log. Sync metadata diagnostic stage: published alpm.v 0fb5507 and vpac fdcc29a. Companion issue #15 is closed after full validation and both pushes. Native archive metadata parsing uses V streaming reads with util.c block, newline-before-NUL and final partial/empty line semantics, retaining bounded lines and legacy MD5 handling. Diagnostics follow source severity/order, parsing continues through malformed archive entries, no partial cache escapes, and parse failure takes precedence over subsequent header failure. Unknown root files and unknown subfiles have distinct warning/debug severity. Validation passes 236 strict C/core-or-public comparisons over 31 scenarios with plain/gzip archives where applicable and clean/preseeded errno. All log levels are compared except RET_ERR/GOTO_ERR C implementation-location strings. Six real descriptor-fault executions close only a private fixture archive from an early warning callback. Header truncation and parse-plus-header failures cover error precedence. The standalone malformed-list fixture now correctly lacks its final newline, while an accepted newline-terminated dependency regression follows C. Frontend regressions preserve ordered messages/severity, successfully read final groups and reject partial caches without changing archive bytes, locks or IPC shapes. The full integrated 80-binary alpm suite passed (520013 ms), all 27 frontend binaries passed (469169 ms), both vmakepkg binaries passed, and consumer MCP diagnostics, formatting/diff, the 266-function/41-record/19-enum API guard, strict public smoke and actual vpac ELF checks passed without production libalpm headers/linkage/symbols. Logs: /tmp/alpm-sync-metadata-stage-full.log and /tmp/vpac-sync-metadata-stage-src.log. Obsolete sync metadata staging worktrees were removed after publication. Package archive diagnostic/error stage: published alpm.v 1ead313 and vpac fb205e9. Companion issue #16 is closed after all gates and both pushes succeeded. Package metadata now streams source syntax/unknown-key/missing-field messages, preserves archive open/read/skip error types and mtree fallback state, and uses a shared owned opener with EINTR handling, fstat on the actual descriptor and cleanup on every path. Package signature-path probes and non-following readability checks follow source ordering. Validation passes 680 strict C/core-or-public comparisons across 45 scenarios, partial/full reads, plain/gzip where applicable and clean/preseeded errno. Tests normalize private fixture roots and process-local descriptor numbers and exclude C implementation-location debug strings. Thirty real descriptor-fault executions, callback-driven file removal/replacement before open (including opened-file sizes), metadata/header/data/mtree/path boundaries and repeated descriptor-lifetime checks pass. All six related binaries and three frontend regressions pass. Full integration passed all 81 alpm binaries (632630 ms), all 27 vpac frontend binaries (598540 ms), both vmakepkg binaries, clean consumer MCP diagnostics, formatting/diff, API guard, strict public smoke and actual vpac ELF checks without production libalpm headers/linkage/symbols. Logs: /tmp/alpm-package-load-stage-full.log and /tmp/vpac-package-load-stage-src.log. Obsolete package staging worktrees were removed after publication. Raw signature diagnostic/ownership stage: published alpm.v 66afd56 and vpac 67b4efa. Companion issue #17 is closed after full validation and both pushes. Raw checks emit source counts, fingerprints, summary bits, statuses/times/future notices, validity/reasons and key/trust/disabled data. Missing/unreadable signatures and GPGME errors preserve messages/severity, with error delivery after cleanup. Sync packages check their recorded filenames directly; missing filenames report NOT_A_FILE. PGPKey.data now retains an actual GPGME key instead of a V stand-in. Known strings borrow from it, unknown fields retain NULLs, and SigList.cleanup unrefs the key or frees the unknown fingerprint. Removing the obsolete private native_keys array restores the compact original layout without changing public fields. Failed allocations report MEMORY, release every transferred key and return no list. Core value results retain automatic cleanup. Validation passes 310 strict C/core-or-public comparisons after warm initialization, including raw runtime logs, key/string identity and NULLs, trust/time/status variants, embedded/detached checks and path failures. A real GPGME reference survives handle release, GC and list cleanup. Three V-only linker allocator faults fail the result array and first/second unknown fingerprints; each reports MEMORY and releases the owned reference exactly once. Four related binaries and two frontend regressions pass. Full integration passed all 83 alpm binaries (826778 ms), all 27 frontend binaries (765451 ms), both vmakepkg binaries, consumer MCP, formatting/diff, the API guard, strict public smoke and actual vpac ELF checks without production libalpm headers/linkage/symbols. Logs: /tmp/alpm-signature-log-stage-full.log and /tmp/vpac-signature-log-stage-src.log. Obsolete raw-signature staging worktrees were removed after publication. Signature policy/block-boundary stage is published: alpm.v 20209bb and vpac 3129534, both pushed successfully. Vpac #18 is resolved after all required integration checks passed. Policy, trust and local-key/import preflight diagnostics/questions now follow the checked-out source order. Explicit meaningful error codes, modern keyboxes and bounded retry safeguards remain. Package archive reads use source BUFSIZ/filesystem block sizes, fixing a reproduced package-name difference across a NUL boundary. Focused validation passes 984 strict C/core-or-public comparisons plus 96 explicitly bounded meaningful-error safeguards across 15 scenarios, nine signature levels, package/database operations and clean/preseeded error state. C fails signature reads or declined imports while leaving errno OK; native retains PKG_INVALID_SIG. Only the final error code is normalized in those guard rows; all other logs/questions/outcomes match exactly. Six related binaries and four frontend regressions pass, covering optional/required signatures, marginal trust, an IPC-declined unknown-key import without importing the key, and source metadata identity at the archive block boundary. Fixtures use private roots/keyrings, no network or host trust changes. Full integration completed successfully: alpm 84/84 binaries (/tmp/alpm-signature-policy-stage-full.log), frontend 27/27 (/tmp/vpac-signature-policy-stage-src.log), vmakepkg 2/2, consumer MCP with zero diagnostics, formatting/diff, public API guard (266 functions/41 records/19 enums), strict public smoke with forbidden libalpm headers, and rebuilt vpac ELF without libalpm linkage or symbols. The previously recorded sessions 57116/64481 are finished. Both main worktrees are clean. No public V declarations or IPC shapes changed; neither repository contains Python files. The next cold GPGME initialization stage is prepared and integrated uncommitted: alpm d348e60 and vpac 943e28d on main checkpoints 20209bb/3129534, tracked in vpac #19. Fresh-process tests pass 34 strict C/core/public comparisons and two explicitly asserted modern-keybox corrections, across nine keyring conditions, explicit/default homes and repeated checks. Six native tests cover callback re-entry from version/engine-info logs and keyring changes away/back. Failed-child cleanup with unreadable keyrings is proven. Four related signature binaries and the complete frontend binary pass. Production setup now emits source health/version/engine diagnostics, retains modern keyboxes and per-handle isolation, and invokes callbacks outside the setup mutex. Frontend checks cover missing-keyring warning count/order and healthy keyboxes. Consumer MCP passes with no diagnostics. Full integration RUNNING: alpm 7226 (85 binaries), frontend 41720 (27), vmakepkg 74575, API guard 29819, strict smoke 94911, rebuilt consumer ELF 26548. Logs: /tmp/alpm-signature-init-stage-full.log, /tmp/vpac-signature-init-stage-src.log, /tmp/vpac-signature-init-stage-vmakepkg.log, /tmp/alpm-signature-init-api-guard.log, /tmp/alpm-signature-init-native-api.log, /tmp/vpac-signature-init-binary.log. Poll the same handles to terminal completion before publishing or closing #19. Focused logs: /tmp/alpm-signature-init-final-focused.log, /tmp/alpm-signature-init-related.log, /tmp/vpac-signature-init-focused.log. Public declarations and IPC shapes unchanged; no Python. The following public extract_keyid audit has a fresh worktree at /tmp/alpm-signature-keyid-stage-1794435051000/alpm based on prepared d348e60. No code edits yet; use source signing.c to prove logs/errno/output semantics, with explicit bounds/packet-type safeguards. Following required audits include remaining accepted import/WKD/keyserver diagnostics and retry failures, process setup/I/O failures, archive auxiliary operations and the full public entry-point behavior audit. A concrete pending public entry is extract_keyid: its wrapper currently sets SIG_INVALID and emits no parser log on failure, whereas signing.c emits format/unsupported errors and leaves handle errno unchanged; compare defined cases while retaining pointer/packet-type bounds guards. The full objective remains active and incomplete. Continue cache/metadata/signature/trust and process setup/I/O diagnostics, remaining event paths and the rest of the public entry-point audit. Keep this issue open until the entire faithful replacement and final consumer compatibility audit are proven.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
diviocity/alpm.v#1
No description provided.