Skip to content

moss: update logic related to system-model resolution - #924

Draft
ermo wants to merge 7 commits into
mainfrom
task/unify-sync-resolver-logic
Draft

ermo wants to merge 7 commits into
mainfrom
task/unify-sync-resolver-logic

Conversation

@ermo

@ermo ermo commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

The idea is to streamline the resolver logic in moss around a set of nicely composable primitives, along with fixing up the terminology (with attendant necessary CLI changes), and ensuring that any "unintended features" in the current resolver code are corrected.

A moss pkg update primitive is being added to make it easier for people using a declarative /etc/moss/system-model.kdl to update non-sync'd packages they are testing out or don't want to add to their declared models, and to make it simpler for developers and packagers working on stacks to update their system state to reflect the latest local/development repository stack update versions (based on experience with the papercuts that currently exist when attempting to do this).

That this work also made it possible to re-define the sync operation as a compound operation consisting of the pkg update operation plus a few other things, was an unintended but nice side-effect.

The CLI changes will look something like this:

  • A new moss pkg update primitive is introduced, which requires an argument:
    moss pkg update <one-or-more-packages> [Aliases: pup]
  • Repositories will now be "refreshed" rather than "updated" (this has been the case in the code and the output for a while now; people paying attention will notice that repos already used the "Refreshed" verbiage before this PR):
    moss repo refresh [Aliases: rrf]
    • (replaces moss repo update and its aliases)
  • In turn, the sync operation is updated to also take a -r|--refresh argument instead:
    moss sync -r|--refresh
    • (replaces moss sync -u|--update and its aliases)

@ermo
ermo force-pushed the task/unify-sync-resolver-logic branch 5 times, most recently from 5f30c37 to 6264417 Compare November 25, 2026 08:16
The request module holds the HTTP/file download helpers.

The idea with the rename is to free up the "request" module for other
uses.

Signed-off-by: Rune Morling <ermo@aerynos.com>
@ermo
ermo force-pushed the task/unify-sync-resolver-logic branch from 6264417 to e51cd06 Compare November 25, 2026 08:24
ermo added 2 commits November 27, 2026 13:07
Rename download functions for what they produce (to_path, json ...), so
they don't read download::download(...)

Example:

`download::download_with_progress` -> `download::to_path_with_progress`

Signed-off-by: Rune Morling <ermo@aerynos.com>
Replace the overloaded term "explicit" and use "supplied" instead, in the
context of moss repositories.

After this refactor, "explicit" only refers to explicitly user selected
packages.

Signed-off-by: Rune Morling <ermo@aerynos.com>
@ermo
ermo force-pushed the task/unify-sync-resolver-logic branch 2 times, most recently from 61235df to d539497 Compare November 27, 2026 16:29
ermo added 2 commits November 27, 2026 17:31
Repositories are now "enabled"/"disabled", not "active"/"inactive".

Only states can be "active".

Note that we allow "active" to be serialised in repository configurations
as a backwards compatibility feature, though we really ought to at least
warn the user about it for a period of time, before deprecating it fully.

Signed-off-by: Rune Morling <ermo@aerynos.com>
This is a breaking CLI change, in the sense that the cached view of
enabled reposistory indices will now be "refreshed" instead of "updated".

Examples:

    moss repo refresh       [aliases: rrf]         (was moss repo update)
    moss sync -r|--refresh                    (was moss sync -u|--update)

Not only does this now deliberately match the underlying terms in the
code, it also leaves room for a `pkg update` primitive, which can now not
be confused with a `repo refresh` in the code or on the CLI.

Signed-off-by: Rune Morling <ermo@aerynos.com>
@ermo
ermo force-pushed the task/unify-sync-resolver-logic branch from d539497 to df22794 Compare November 27, 2026 16:31
The idea is that "resolve" only means dependency resolution.

Signed-off-by: Rune Morling <ermo@aerynos.com>
@ermo
ermo force-pushed the task/unify-sync-resolver-logic branch 2 times, most recently from 0fb36c7 to a1bcfa6 Compare November 28, 2026 19:02
SystemModel is now pure data, and consists of the set of known
repositories (enabled or disabled) and the set  of explicit providers
 / packages.

Document holds a system-model with its KDL encoding and associated
edits. Specifically, it keeps formatting for declared models that the
user has carefully edited themselves.

Declared is the system-model the user declares at
`/etc/moss/system-model.kdl` or imports with
`moss sync --import <some valid system-model.kdl>`.
Declared system-models will only ever be read by moss, never written.

Recorded is the system-model a fstree was built from. The recoded
system-model is stored within the fstree at `/usr/.system-model.kdl`.
It will be read from the old location (/usr/lib/system-model.kdl) when
needed.

Base is the system-model a change starts from: Recorded or Declared.

Drift is the difference between two system-models.

This commit also contains a bunch of refactors to match up with the new
system-model data structures and API.

Signed-off-by: Rune Morling <ermo@aerynos.com>
@ermo
ermo force-pushed the task/unify-sync-resolver-logic branch from a1bcfa6 to 38328c2 Compare November 29, 2026 06:32
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