feat(cli)!: reorganize add/remove commands - #574
Merged
andrius-puksta-sensmetry merged 1 commit intoSep 29, 2026
Merged
andrius-puksta-sensmetry merged 1 commit into
andrius-puksta-sensmetry merged 1 commit into
Conversation
andrius-puksta-sensmetry
force-pushed
the
pr/reorganize-add-remove
branch
from
September 29, 2026 04:32
95dabc1 to
7be2f8d
Compare
vytautas-astrauskas-sensmetry
added a commit
that referenced
this pull request
Sep 29, 2026
- Python `add` takes `lock`, `sync` and `prune` (all `True` by default) instead of `no_lock`, `no_sync` and `no_prune`, avoiding double negation. - Removing by publisher and name, in Python and in `sysand remove <publisher>/<name>`, removes the project's usages of every kind: index, directory and KPAR usages, and a `pkg:sysand` resource usage. Each field matches spelled as the usage spells it, or normalized, as #574 does for the CLI. Python can now remove directory and KPAR usages, so the Python special cases for "cannot remove them yet" are gone. - Every typed usage kind (directory, KPAR, index) now rejects keys it does not define, not only index usages, so a future field such as a constraint on a directory usage is never silently dropped. Resource usages, the shape KerML specifies, keep ignoring unknown keys, since existing manifests carry extra keys in them. Index protocol §14 and RELEASE.md say so. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
andrius-puksta-sensmetry
force-pushed
the
pr/reorganize-add-remove
branch
from
September 29, 2026 14:17
7be2f8d to
08f2fae
Compare
Change arguments and fold `experimental` commands into the non-experimental ones. Also made file parsers use stricter types where possible. Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
andrius-puksta-sensmetry
force-pushed
the
pr/reorganize-add-remove
branch
from
September 29, 2026 14:19
08f2fae to
4d2588c
Compare
andrius-puksta-sensmetry
added a commit
that referenced
this pull request
Oct 1, 2026
An index usage names a project by publisher and name, and has to spell them exactly as the project does. `add` now accepts two spellings: the project's own, which is checked, and the fully normalized one (lowercase, hyphens for spaces), which takes the project's spelling. - When locking, a normalized usage is first resolved by identifier as a placeholder, then written with the spelling of the project locked. Any other spelling is checked by the lock, as before. - With `--no-lock`, the spelling is checked against, or taken from, the versions installed in the local environment that match the version constraint, without any network request. It fails when none is installed, or when those installed disagree on the spelling. - A clash with a usage of another kind is reported before anything is looked up. The lock's spelling error now says outright that the usage resolved but was rejected for its spelling, and which spelling to use. An index usage has to spell a project's publisher and name exactly as the project does, so every version of a project in an index has to spell them the same way. `sysand index add` now refuses a version spelled differently from the versions already in the index (yanked ones included, removed ones left out), and any version of a project whose existing versions already disagree. The index protocol records one spelling per project as a server obligation. `add` now runs `sysand add` itself: after declaring the usage it locks and syncs, unless `no_lock` or `no_sync`, and restores `.project.json` if either fails. It takes `no_lock`, `no_sync`, `no_prune`, `resolution` and `auth`, and checks and recovers the spelling of index usages the way the CLI does. With `no_lock=True`, it only edits `.project.json`, and an index usage needs a matching version installed in the environment. `version_constraint` stays required. - Python `add` takes `lock`, `sync` and `prune` (all `True` by default) instead of `no_lock`, `no_sync` and `no_prune`, avoiding double negation. - Removing by publisher and name, in Python and in `sysand remove <publisher>/<name>`, removes the project's usages of every kind: index, directory and KPAR usages, and a `pkg:sysand` resource usage. Each field matches spelled as the usage spells it, or normalized, as #574 does for the CLI. Python can now remove directory and KPAR usages, so the Python special cases for "cannot remove them yet" are gone. - Every typed usage kind (directory, KPAR, index) now rejects keys it does not define, not only index usages, so a future field such as a constraint on a directory usage is never silently dropped. Resource usages, the shape KerML specifies, keep ignoring unknown keys, since existing manifests carry extra keys in them. Index protocol §14 and RELEASE.md say so. Co-authored-by: Andrius Pukšta <andrius.puksta@sensmetry.com> Signed-off-by: vytautas-astrauskas-sensmetry <vytautas.astrauskas@sensmetry.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
andrius-puksta-sensmetry
added a commit
that referenced
this pull request
Oct 1, 2026
An index usage names a project by publisher and name, and has to spell them exactly as the project does. `add` now accepts two spellings: the project's own, which is checked, and the fully normalized one (lowercase, hyphens for spaces), which takes the project's spelling. - When locking, a normalized usage is first resolved by identifier as a placeholder, then written with the spelling of the project locked. Any other spelling is checked by the lock, as before. - With `--no-lock`, the spelling is checked against, or taken from, the versions installed in the local environment that match the version constraint, without any network request. It fails when none is installed, or when those installed disagree on the spelling. - A clash with a usage of another kind is reported before anything is looked up. The lock's spelling error now says outright that the usage resolved but was rejected for its spelling, and which spelling to use. An index usage has to spell a project's publisher and name exactly as the project does, so every version of a project in an index has to spell them the same way. `sysand index add` now refuses a version spelled differently from the versions already in the index (yanked ones included, removed ones left out), and any version of a project whose existing versions already disagree. The index protocol records one spelling per project as a server obligation. `add` now runs `sysand add` itself: after declaring the usage it locks and syncs, unless `no_lock` or `no_sync`, and restores `.project.json` if either fails. It takes `no_lock`, `no_sync`, `no_prune`, `resolution` and `auth`, and checks and recovers the spelling of index usages the way the CLI does. With `no_lock=True`, it only edits `.project.json`, and an index usage needs a matching version installed in the environment. `version_constraint` stays required. - Python `add` takes `lock`, `sync` and `prune` (all `True` by default) instead of `no_lock`, `no_sync` and `no_prune`, avoiding double negation. - Removing by publisher and name, in Python and in `sysand remove <publisher>/<name>`, removes the project's usages of every kind: index, directory and KPAR usages, and a `pkg:sysand` resource usage. Each field matches spelled as the usage spells it, or normalized, as #574 does for the CLI. Python can now remove directory and KPAR usages, so the Python special cases for "cannot remove them yet" are gone. - Every typed usage kind (directory, KPAR, index) now rejects keys it does not define, not only index usages, so a future field such as a constraint on a directory usage is never silently dropped. Resource usages, the shape KerML specifies, keep ignoring unknown keys, since existing manifests carry extra keys in them. Index protocol §14 and RELEASE.md say so. Co-authored-by: Andrius Pukšta <andrius.puksta@sensmetry.com> Signed-off-by: Vytautas Astrauskas <vytautas.astrauskas@sensmetry.com> Co-Authored-By: Claude Opus 5.5 <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.
Change arguments and fold
experimentalcommands into the non-experimental ones.Also made file parsers use stricter types where possible.