feat(nickel): emit packages block with repo-bucketed lists#61
Merged
Conversation
Continues M4 W1 reconcile (Plan §7.5). Where the previous chunk
emitted only meta + kernel placeholders, this one buckets the
probed pacman + cargo inventory into the host file's `packages = {
... }` block with the same per-repo layout the apply path consumes
on the way back in.
Bucketing rules (mirroring pearlite_pacman::inventory's classifier):
- foreign packages (-Qm) → packages.aur, regardless of what the
/etc/pacman.conf-resolved repo says
- explicit (-Qe) with repo "cachyos" → packages.cachyos
- explicit with repo "cachyos-v3" / "cachyos-v4" → matching bucket
- everything else (core, extra, multilib, custom/unknown) → packages.core
- cargo install --list → packages.cargo
Bucket keys containing `-` (cachyos-v3, cachyos-v4) emit as Nickel
quoted field names. Names within each bucket are sorted+deduped so
emission is deterministic regardless of input order; the BTreeMap
that drives iteration also gives stable bucket ordering.
Three new unit tests:
- buckets-by-repo with the foreign-overrides-repo case (claude-code
in repos="cachyos" but foreign → aur), the unknown-repo collapse
to core, and the quoted-key cachyos-v4 path.
- empty pacman + cargo case still emits a `packages = {}` block.
- unknown repo (`chaotic-aur`) correctly collapses to core.
Tests: 324 passing (+3). Clippy clean. fmt clean. audit clean.
Subsequent chunks add services, users, and config-file blocks.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Continues M4 W1 reconcile (Plan §7.5). Where the previous chunk (PR #60) emitted only meta + kernel placeholders, this one buckets the probed pacman + cargo inventory into the host file's
packages = { ... }block with the same per-repo layout the apply path consumes on the way back in.Bucketing rules (mirroring
pearlite_pacman::inventory's classifier):-Qm) →packages.aur, regardless of what the/etc/pacman.conf-resolved repo says-Qe) with repocachyos→packages.cachyoscachyos-v3/cachyos-v4→ matching bucketpackages.corecargo install --list→packages.cargoBucket keys containing
-(cachyos-v3,cachyos-v4) emit as Nickel quoted field names. Names within each bucket are sorted+deduped so emission is deterministic regardless of input order; theBTreeMapdriving iteration also gives stable bucket ordering.Three new unit tests:
claude-codeinrepos="cachyos"but foreign →aur), the unknown-repo collapse tocore, and the quoted-keycachyos-v4path.packages = {}block.chaotic-aur) correctly collapses tocore.Test plan
cargo test --workspace --all-features— 324 passing (+3 new)cargo clippy --workspace --all-targets --all-features -- -D warnings— cleancargo fmt --all -- --check— cleanscripts/ci/check-spdx.sh— cleanpearlite-audit check .— 1 check, 0 violations🤖 Generated with Claude Code