Repository navigation
feat(selector): one selector API for writ and lore; directory names follow os-release's lineage - #992
Merged
David-Noble-at-work merged 3 commits intoSep 30, 2026
Conversation
One package detects the host (os-release, the chain Unix -> Linux -> ID_LIKE reversed -> ID) and selects and orders directory names by one ordered grammar, [<project>][.<os>][.<arch>][.<extra>...], against a closed vocabulary. Grammar errors refuse the run. Extras are declared in configuration with their values. writ, lore and pkg/platform all go through it. Resolves #944, #369 and #970 when done; lane 19 of #949. The owner's rulings of 2026-09-30 are recorded in the plan. Claude-Session: https://claude.ai/code/session_01DuNfZFyfxBoD9pdaiDEMrY
…ollow os-release's lineage pkg/selector detects the host and selects and orders directory names for both programs. The grammar is [<project>][.<os>][.<arch>][.<extra>...]: order is significant, a name carries one OS word, and the vocabulary is closed. The chain runs Unix, Linux, ID_LIKE reversed, then ID, from os-release, so on Ubuntu a directory suffixed Linux, Debian or Ubuntu applies. common.Debian is the form; common.Linux.Debian is refused. A name that breaks the grammar (out of order, two words for one part, a word no part holds) refuses the run before anything changes, and the refusal lists every one. Another machine's well-formed name is excluded silently. Directories apply in one total order, and the last applied wins: projects as the command line reads (implicit, then recorded and not named, then named, left to right); within a project, the OS word's depth in the chain, then the architecture, then the extras in their configured order; layers base, team, personal. Naming an implicit project, writ deploy common included, or naming a project twice is a command-line error. The bare form is writ deploy. writ: extra segments are declared in writ.segments with every value they may take, validated, and set by --segment NAME=value or WRIT_SEGMENT_<NAME> on deploy, upgrade, reconcile and adopt. The tree builder applies the selector's order, and a collision carries both directories' ranks and says what put the winner after the loser: a later layer, a later project, a more specific OS word, the architecture, or a named segment. lore: a package's platform directories are selected the same way, with Common first, and every applicable directory's phase script runs, general to specific. lore deploy plans every package before any deploys, so a grammar error in any package refuses the run. A native package resolves through the platform's default purl type, pacman included, and lore search labels its hits by the same mapping: rpm and alpm hits were labeled apt. pkg/platform detects through the selector, and a distribution devlore doesn't list takes the package managers of its closest listed ID_LIKE ancestor: Pop!_OS takes Ubuntu's apt. Its token is gone. docs/guides/selectors.md states the rules once; writ's and lore's guides link it. #959's plan takes its last box and is complete. Resolves #944 Resolves #369 Resolves #970 Claude-Session: https://claude.ai/code/session_01DuNfZFyfxBoD9pdaiDEMrY
…ture/944-one-selector-api-writ-and-lore
David-Noble-at-work
deleted the
feature/944-one-selector-api-writ-and-lore
branch
September 30, 2026 18:35
This was referenced Sep 30, 2026
Open
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
Lane 19 of #949, alone, straight after #959 (ruled 2026-09-30: "we'll do lane 18 followed by lane 22. two prs and at the end we'll be done with selectors. we'll have common selectors for writ and lore.").
pkg/selector: it detects the host and answers which of a list of directory names apply to it, and in what order. writ and lore both use it. The rules are stated once, indocs/guides/selectors.md.[<project>][.<os>][.<arch>][.<extra>...]. Order is significant, a name carries one OS word, and the vocabulary is closed.common.Debianis the form, andcommon.Linux.Debianis refused.Unix,Linux,ID_LIKEreversed, thenID. On Ubuntu,Linux,DebianandUbuntuapply. macOS isUnix,Darwin; the BSDs areUnix, then the OS; Windows isWindows.writ deploy commonincluded) or naming a project twice is a command-line error; the bare form iswrit deploy(ruled 2026-09-30).writ.segmentswith their values and validated. They're set by--segment NAME=valueorWRIT_SEGMENT_<NAME>ondeploy,upgrade,reconcileandadopt. This resolves writ upgrade and reconcile do not see the segments deploy was given: -s is deploy-only, and reconcile's Config.Segments is never read #970, the segmentsupgradeandreconciledidn't see.Commonfirst; every applicable phase script runs, general to specific.lore deployplans every package before any deploys, so a grammar error in any package refuses the run. Native packages resolve by the platform's default purl type,pacmanincluded, andlore searchlabels hits by the same mapping (rpmandalpmhits were labeledapt).pkg/platform: it detects through the selector, and falls back alongID_LIKEfor package managers (Pop!_OS takes Ubuntu's apt). Its token andlore'sdetectPlatformare gone.abandoned, because this one supersedes it.Also: #959's plan takes its last box and is
complete; plans that described the token or the retiredLinux.Debianform carry dated notes; the 2.5 architecture status records two places where the document and the code disagree.docs/plans/feature/944-one-selector-api-writ-and-lore.md. It staysactive: its last boxes are DANOBLE-UD24-1's convergence and the follow-up issues.Resolves #944
Resolves #369
Resolves #970
Test plan
pkg/selector: the chains per distribution, the spelling table, the vocabulary, every grammar error, the ranking, and the segment declarations' refusals--platformCommonfirst; a leftoverLinux.Debianrefuses the package, and a grammar error in any package refuseslore deploybefore anything deploys; phase scripts run general to specific; purl types map to sourcesmake test;make test-scenario, whose lineage step asserts that eachID_LIKEancestor's consumer deploys on this hostgofmt;make vet-allandmake lint-allon linux, darwin and windows, 0 issues;star lint go;star lint shell; the guides' frontmatterHome/common.Debian's four files deploy on this Ubuntu host, and no other link changesTime
Computed by the algorithm of noblefactor-ops#188 at merge.