notes

jig, the package manager

Name: ratified 2026-10-18 (calef, convention-rulings Rule 3).

The appendix to notes/packages.md for milestone 809 (the package client becomes a program), built 2026-10-10 (UTC). jig installs, removes and rolls back packages and lists what the image vouches for. The progenitor stays the installer; jig asks it. Since milestone 911 (scripted installs grant only what the owner's approval file allows), jig also holds the owner's approvals. jig approve <file> stores an approval file's compiled records, and jig revoke <name> drops one. jig install --approved <file> replaces the owner's prompt with the check that the package's asks lie within the file's entry, failing closed and naming every extra grant.

Scripted installs, and the approvals

The flags an install, removal or rollback takes, after the operand:

jig approve <file> prints every grant the file contains (the root zone flagged apart, the way the confirmation flags it), asks once, and sends the compiled records to the progenitor as an Approve request. On a name stored already it shows only the grants changed since the stored digest, which is the re-approval the block's Done-when 5 asks for; the approve verb reads the store's file through the activation directory it holds read-only. jig revoke <name> drops it. An approval lives beside the installed-programs table's generations, never as rows in them, so jig rollback changes no approval.

What it holds

caps jig install greeting@0.1.0 prints it. A std program, so the slots are the std layout's:

slot what from
2, 3 the network stack, and its own region for each socket's page Manifest::network
8 its words ProgramArgumentDeclaration::Words
15 the installer endpoint, WRITE Manifest::installer, §270 (a package manager holds an installer endpoint, not the spawn endpoint)
16 the endpoint its answers come back on, READ the same
17, and a page a copy of the image's catalog Manifest::catalog
4 the file a word names, read-only the line, for install <path>
4 the index store, activation/indexes: read and write for update, read for list and install <name> Manifest::indexes, on a line that names no directory
4 activation/, read only, for list -u: the live generation and the index copy beneath it Manifest::activation_directory, in the index store's place
18, and a page the image's index sources: where its index is, and the root its TLS must chain to Manifest::indexes
5, 6 the clock and entropy, for TLS update and install

Only the owner's console grants the index store, as it grants the installer, and no note may ask for it. The image's index sources are a measured archive entry (package_index::SOURCES_ENTRY), so basalt can name another index without rebuilding jig.

Each line holds what its verb needs and no more (option V2, milestone 281 (watch holds exactly what ps holds)'s test): list the catalog alone, remove and rollback the installer alone, install all three. grant_contract::narrow_by_verb decides it from program_table::Program::verbs. The shell narrows for caps and the progenitor for the endowment, each reading the line's second word. The progenitor reads it off the argv page and refuses the spawn if the child's copy says otherwise.

update and the index copy

The image names its index's addresses and the root their TLS must chain to (package_index::Sources, at std_runtime_contract::INDEX_SOURCES_PAGE). This is item 6 of milestone 809. update fetches the index from the first address that answers, pinned to that root, and keeps this architecture's lines. It writes them to package_index::IMAGE_INDEX_COPY in the index store, the directory the owner's console grants at std_runtime_contract::FS_DIR_SLOT.

After that, a name is looked up in the copy first. The package is fetched from the entry's locations, or from the repository's own targets/, over HTTPS, and judged by the entry's digest. The progenitor installs it on the same copy's word (ruling I2). Before any update, a name is looked up in the image's catalog and fetched from the local area network package source, as since milestone 198 (a package manager)'s rung 3a. A command word with a / in it is a file, by the prompt's rule for a command word (§219 (how the shell names an installed program to the spawner)).

How an install travels

jig reads the package into one run of its own pages: from the file, or from the package source over plain HTTP (http_response). A fetched package must then be the one asked for, and the catalog must vouch for its digest (package_archive::installable_as), or nothing is sent.

Then spawn_protocol's activation request goes out on the installer endpoint, unchanged from the builtin's: three words, one READ frame per page, one answer. The frames are slices of the run (moho_abi::page_frame::SLICE), so the buffer and the frames are the same memory. The progenitor copies each page before it hashes, checks its copy against its own catalog, places the program and writes a generation. The row records jig in its manager column.

The run needs room for a package beside the heap, so a program declaring the installer is built in a region one package larger, from the progenitor's image pool (program_table::named_std_region_pages).

What moved

A rehearsal with basalt's sources

No check boots the production sources, so the bench evening's step 5 (notes/xenon-bench-2026-10-18.md) is rehearsed by hand under QEMU's x86_64 UEFI machine, from an installed disk, against the live basalt.nifeos.org. Under slirp the lease's name server forwards to the host's, so here the index host is resolved by name.

cargo xtask std-exerciser
NIFE_INDEX_SOURCES=basalt cargo xtask install-boot     # install-boot: PASS
# then boot target/nife-install.img with the stick detached, and type at `$`:
#   jig update; jig install ioping; cd packages; ioping -v

On 2026-10-24 (UTC), against rolling-2026-10-24-87a3b29:

$ jig update
    index updated: 6 packages for x86_64, from basalt.nifeos.org over TLS
$ jig install ioping
    fetched ioping-1.3-x86_64 from release-assets.githubusercontent.com via github.com over TLS
  fetched and installed; generation 1 is live
$ cd packages
$ ioping -v
  ioping 1.3

The Release hop works only while GitHub's 302 head fits http_response::REDIRECT_HEAD_MAXIMUM, 32 KiB. It measured 10,806 bytes on 2026-10-24, most of it one content-security-policy line. When it does not fit, jig prints passed over https://github.com:443/...: Http(HeadTooLong) and installs from the Pages copy. The ignored test a_release_download_is_e46_then_one_redirect_to_x1 (pinned_tls_client/tests/peer.rs) checks the same hop from the host.

A port waits on the package client

A port to nife is complete when jig install puts it on the system from basalt's package index, as §297 (software reaches a nife system as a package jig installs from basalt's index) rules. That install waits on milestone 809 (the package client becomes a program) and milestone 801 (packages over the internet). No work toward a port's install starts until both land.

BUGS