Skip to content

feat(nickel): emit packages block with repo-bucketed lists#61

Merged
UnbreakableMJ merged 1 commit into
mainfrom
feat/nickel-emit-packages
Apr 29, 2026
Merged

feat(nickel): emit packages block with repo-bucketed lists#61
UnbreakableMJ merged 1 commit into
mainfrom
feat/nickel-emit-packages

Conversation

@UnbreakableMJ

Copy link
Copy Markdown
Contributor

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):

  • foreign packages (-Qm) → packages.aur, regardless of what the /etc/pacman.conf-resolved repo says
  • explicit (-Qe) with repo cachyospackages.cachyos
  • explicit with repo cachyos-v3 / cachyos-v4 → matching bucket
  • everything else (core, extra, multilib, custom/unknown) → packages.core
  • cargo install --listpackages.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 driving 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.

Test plan

  • cargo test --workspace --all-features — 324 passing (+3 new)
  • cargo clippy --workspace --all-targets --all-features -- -D warnings — clean
  • cargo fmt --all -- --check — clean
  • scripts/ci/check-spdx.sh — clean
  • pearlite-audit check . — 1 check, 0 violations
  • CI green on T1 / T2 / T3

🤖 Generated with Claude Code

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>
@UnbreakableMJ
UnbreakableMJ merged commit f82e0c8 into main Apr 29, 2026
3 checks passed
@UnbreakableMJ
UnbreakableMJ deleted the feat/nickel-emit-packages branch April 29, 2026 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant