Repository navigation
v0.30.0
0.30 cleaned up the command line. Renamed verbs (list → show, metakernels/mk → ls, resolve/aliases → which, duplicates → stats, verify → check, prune → clean; the old names still run with a note until 1.0), update walks every tracked metakernel and downloads only with --execute, a kernel_dirs list in the config (one root is the normal case) with no configured download target, exit codes a script can read (check bits 1/2/4, untracked 1, ambiguous 2, broken config 78), a quiet library with spice_kernel_db.__all__ as its public API, and docs generated from the code. The README on GitHub carries the same note.
The version jumps from 0.22.3 to 0.30.0 to mark the CLI redesign: there are
no 0.23 to 0.29 releases. Everything below landed between 2026-11-19 and
2026-11-23 from the CLI review (#41, #43, #45 to #49, #53, #55).
Changed
- The documentation is built with great-docs (#53). The API reference is
generated from the docstrings of the public names (great-docs.yml
reference:, kept equal tospice_kernel_db.__all__by a test); the
hand-writtenapi.qmdis gone and what it said now lives in those
docstrings. The guides (motivation, design, usage, CLI, coverage, tutorial,
troubleshooting) are unchanged in content, andmake docs/make serve
build and preview the site.
Added
-
A quiet library and a declared public API (#49, closes #6). Nothing
underspice_kernel_dbprints unless it is handed arich.console.Console:
KernelDB(console=...)is where tables, notes, progress bars and the
download question go, and without one (the default)get_metakernel
answers its own question with no and reportsaborted. The CLI passes its
console. Warnings go through thespice_kernel_dblogger, which the CLI
routes to stderr (INFO under--verbose).spice_kernel_db.__all__is
the public API, listed indocs/index.qmd§ Public API and held stable
within a major version, with module-levelget,check,scan,
register_metakernel,resolve_metakernelandmetakernels_covering
that open the configured database per call.config.pyneither prints
nor prompts: a corrupt file raisesConfigError(the CLI prints the message
and exits 78, the configuration-error code, instead of falling back to
setup, which would have overwritten the file),ensure_config()with no file
and noseed_rootraises it too, and the first-run questions live in the
CLI.fetch_metakernel,list_remote_metakernelsand
resolve_kernel_urlsare no longer exported from the package (they stay
inspice_kernel_db.remote). For a program that mounts the command tree
under its own CLI,spice_kernel_db.cli.app,
spice_kernel_db.cli.exit_code(exc)and
spice_kernel_db.cli.logging_to_stderr()are the host contract
(planetarypy'splp spice). -
checkanswers three questions, each with its own exit bit (#46).
present (every listed kernel on disk, bit 1), resolves (every entry
resolves throughPATH_VALUESto the file the database knows, bit 2) and
matches remote (sizes, with--hashalso SHA-256, against the server,
bit 4, only with--remote). The exit code is the sum, so a script can
tell a missing kernel from a corrupt one, and the output never collapses
into one tick.--jsonemits the verdicts and their evidence. -
doctorreports database health with no metakernel argument: poisoned
supersession rows, kernel locations whose file is gone, tracked metakernels
whose file is gone, and the table counts. It exits 1 only on poisoned rows
(#46). -
One resolver for every metakernel argument (#45).
KernelDB.resolve_metakernel()
turns a path, a registry filename, a versionless base name (with or without
.tm) or the source URL into the tracked file, case-insensitively, and every
command (check,list,verify,coverage,update,rewrite,
metakernels,resolve --metakernel) goes through it. A name that matches
nothing exits 1 with thegethint; a name that matches several tracked
metakernels raises the newAmbiguousMetakernel, and the CLI lists them and
exits 2. The first match is never picked silently.rewritenow accepts the
same forms and offers the picker when the argument is omitted. -
Pickers know whether they have a terminal (#45). With no argument at a
terminal every picker behaves as before. In a script, a notebook or a pipe
(stdin not a terminal) the candidates are printed on stderr and the command
exits 2 instead of blocking on input; stdout stays clean for the caller. -
Poisoned supersession rows are reported (#31). #29 made the state
repairable but nothing said it existed: a user saw the same kernels
re-download on everyupdatewith no hint why.KernelDB.poisoned_superseded()
lists kernels present on disk yet flagged as superseded by content that
exists in no location.checknames them and exits 1 when any are found;
statsshows the count, highlighted when non-zero. Both point at
scan <kernel_dir>as the repair. -
import <mk-file>tracks a metakernel that is already on disk (#47).
It indexes the entries, registers the kernels the file resolves to that
exist on disk, and adds the registry row with no source URL. It makes no
network request.--missionoverrides the mission guessed from the path.
The Python entry point isKernelDB.import_metakernel(). -
updatewalks every tracked metakernel (#47). It re-fetches each one
from its source and shows what is missing. It is a dry run by default;
--executedownloads and is the confirmation, so there is no
per-metakernel prompt. Alias rows (symlinks) are skipped. A source that
answers 403, 404 or 410, or one that cannot be reached, is noted in the
summary table and the walk goes on. The Python entry point is
KernelDB.update_all();get_metakernel()andupdate_metakernel()gained
adry_runparameter for it. -
cleanremoves what points at nothing, in three named classes (#47):
--locations(kernel locations whose file is gone, then kernel rows left
with no location),--symlinks(dangling symlinks under each mission's
download tree) and--registry(tracked metakernels whose source URL
answers 403, 404 or 410, the only class that contacts the server;
--delete-filesalso unlinks the.tm). Dry run by default,--execute
removes. With no class flag the two local classes run, so a plainclean
now also sweeps dangling symlinks. -
get <name>re-fetches a tracked metakernel (#47). When the argument
names a tracked metakernel,getfetches it from its stored source URL,
downloads what is missing and re-indexes, which is whatupdate <name>did.
A filename that is not tracked is still looked up on the configured mission's
server. -
Several kernel roots (#48).
[storage]inconfig.tomlnow holds
kernel_dirs, a list in which no root is special. Every root is scanned,
resolved against (which,check) and deduplicated across, sodedup
links a kernel in one root to its identical twin in another. A file with onlykernel_dirloads as
a one-root list and is rewritten askernel_dirson the next save. -
config add-root <dir>andconfig remove-root <dir>edit the list
(#48).add-rootcreates the directory and does not add a root twice;
remove-rootrefuses the last root and leaves files and database rows alone.
skd configlists the roots. -
scantakes an optional directory (#48). With none it scans every
configured kernel root. -
Where a download lands is derived, never configured.
getre-fetches
a tracked metakernel into the root that holds it, puts a new metakernel
into the one root that already holds its mission, and with one root uses
that root. Only when several roots could take a new mission does it list
them and ask at a terminal (exit 2 in a script);--download-dirnames
the root explicitly.scan --archivemoves each file into its own root or
its mission's root, settling every file before anything moves.update
(the all-metakernels walk) andupdate_all()lose--download-dir, which
would have forced metakernels from every root into one directory.
KernelDB.root_for(mission, mk_path)is the one resolver and
AmbiguousKernelRootthe exception. Before this, the first configured
root was a "download target", which would have written a re-fetched
second-root metakernel into the first root. -
import --unofficialand theofficialcolumn (#48). A metakernel
assembled locally, such as a subsetter's output or planetarypy's
archived_kernels.py, can be marked as not published by an archive.
metakernel_registrygainsofficial BOOLEAN DEFAULT TRUE, added when an
older database is first opened for writing; opened read-only before that
(ls,show,doctor,check), every row reads as official.lsappendsunofficialto the name andshow
printsOfficial: no.RegistryRow,list_metakernels()and
info_metakernel()carryofficial, and
import_metakernel(path, mission=None, official=True)sets it. -
Python functions for the roots (#48):
kernel_roots(),
add_root(dir)andremove_root(dir), exported from the
package, andensure_config(seed_root=...), which writes a first
configuration with that root instead of prompting. An existing configuration
is never changed by the seed.Config(db_path, kernel_dirs)holds the
list; the single-rootkernel_dirparameter and property are gone.
KernelDB(kernel_roots=...)anddb.kernel_rootscarry the roots used to
guess a mission, anddb.scan_roots()scans every one.
Changed
-
verifyfolded intocheck(#46).verifystays as a hidden alias
(--deepis--hash,--strictis ignored with a note) and its--json
document now has the three-verdict shape.check --fullis gone; the
server comparison ischeck --remote, and--hashno longer needs it. The
poisoned-row report moved fromchecktodoctor, socheckexits 1 for
a missing kernel and nothing else.KernelDB.check_metakernel()prints
nothing and no longer contacts the server; the newer-version notice is part
of--remote, andKernelDB.check_report()returns the three verdicts as
data. -
KernelDB.info_metakernel()andupdate_metakernel()raiseMetakernelNotTracked
for an unknown name instead of printing "not found" or raising a bare
LookupError; the CLI maps that to exit 1 in one place (#45). -
mk --removeno longer matches a bare prefix; it takes the same forms as
every other command, so a prefix matching several rows is reported instead of
removing the first one (#45). -
skd --versionand--helpstart faster (#26).requests,duckdb,
importlib.metadataand Typer's rich error formatter are now imported
where they are used instead of at module level, so invocations that open
no database and touch no network no longer pay for them. On the
reference machine--versionwent from 184 ms to 123 ms and--help
from 187 ms to 141 ms.spice_kernel_db.__version__is resolved on
first access; everything else in the public API is unchanged. -
The verbs were renamed and regrouped (#47).
--helpnow shows four
panels in order: acquire (browse,get,update), inspect (ls,show,
which,coverage,stats,check,doctor), maintain (scan,
import,rewrite,rm,clean,dedup,reset) and configure
(mission,config).browse,coverage,rewrite,dedup,mission
andconfigkeep their names.metakernelsandmkbecamels [mission], the listing of tracked
metakernels. The--missionoption is now the optional argument.listandmetakernels <name>becameshow <mk>: the registry row
(mission, source, acquired, local path) plus the kernels with type, size
and status.--typefilters the table. On a.tmthat is not tracked it
lists the kernels and saysskd importtracks it.resolveandaliasesbecamewhich <kernel>. The first line is the
local path. When the content is known under several filenames, the alias
table and the on-disk locations follow. It accepts a filename or a SHA-256
prefix.--metakernel <mk>resolves every kernel of a metakernel. With no
argument at a terminal it offers a picker over the deduplicated kernels.duplicateswas folded intostats: the database statistics come
first, then the duplicate kernels section.metakernels --removebecamerm <mk>. It removes the registry row
and its entries; the file stays. With no argument at a terminal it offers
a picker.prunebecamecleanwith the classes named--locations,
--symlinks(was--orphan-symlinks) and--registry(was
--metakernels). The three classes can now be combined in one run.update <name>becameget <name>, andupdatewith no argument
became the walk over all tracked metakernels, a dry run unless
--executeis given.updatewith an argument prints
note: 'update <name>' is now 'get <name>'and runsget.resetmoved from the configure panel to the maintain panel. The
command is unchanged.scannever prompts (#47). A mission that is not configured and has
no.spice-servermarker no longer starts a setup dialog.scanprints
theskd mission add <NAME> --server-url <URL>command instead, so it is
safe in a script.KernelDB.info_metakernel()takeskernel_type=Noneto limit the
printed kernel table to one type (#47).
Deprecated
- The old verb names remain as hidden aliases and are removed in 1.0
(#47). Each printsnote: 'old' is now 'new'on stderr, then runs the new
command with the new command's options:listisshow;metakernels
andmkarels, and with a nameshow, and with--removerm;
resolveandaliasesarewhich;duplicatesisstats;pruneis
clean(--metakernelsand--mkare--registry,--orphan-symlinks
is--symlinks, and a plainprunekeeps its old meaning of locations
only);verifyischeck(--deepis--hash);update <name>is
get <name>.
Fixed
-
A re-scan of a directory holding a metakernel that
gethad fetched
replaced its registry row, dropping the source URL and the acquisition
time, so a laterupdatereported it as added by scan with no source. A
scan now writes a registry row only for a metakernel it sees for the first
time;getandimportstill replace the row (found while removing the
download target, 2026-11-21). -
A tracked metakernel's mission comes from the registry, and
guess_mission
knows the kernel roots (#43, #48). A metakernel in the default store
(~/.local/share/spice-kernel-db/kernels/JUICE/mk/x.tm) got the mission
SPICE-KERNEL-DB, the directory that holds the store, andcheckthen
reportedCross-mission: 102 kernels.check,rewrite,coverageand the
server comparison now read a tracked metakernel's mission from its registry
row.guess_mission(filepath, roots=None)takes the first directory below a
configured root as the mission, classifies a file under a root but in no
mission directory from its filename alone, and applies the old heuristic only
outside every root.scanandimportpass the configured roots. Ascan
that meets an already tracked metakernel keeps the mission andofficial
flag of its row;getandimportstate them. -
doctorlists a path registered under more than one hash, andscan
repairs it (#48). One file could carry twolocationsrows, such as a
0-byte row from an interrupted download beside the real one, andcheck
then reportedSIZE_MISMATCHagainst the wrong row (!= expected 0).
KernelDB.doctor()returns the paths asconflicting_locationsand the CLI
prints them; the exit code is unchanged.register_fileused to supersede
one stale row at a path. It now supersedes all of them, so ascanof the
directory keeps the row that matches the file on disk. -
checkno longer reportsAMBIGUOUSfor a registered path whose filename
exists elsewhere with other content (#48). When an entry resolves to a path
(or to the file its symlink leads to) that is a registered location, that
row's size and hash are the expectation. Only an unregistered path falls back
to the filename, where several activekernelsrows are stillAMBIGUOUS.
Three differentnaif0012.tlsacross two stores no longer fail the check. -
verifyandlistcrashed on a registry filename thatcheckaccepted
(#41). Both handed the bare name to the parser and died with
FileNotFoundError; they now resolve it likecheckdoes. -
get -vno longer crashes (#39). The verbose "Resolved URLs" listing
inget_metakernel()read a name that did not exist, so every verbose
getended in aNameErrorafter the kernel table. Found by ruff's
undefined-name check; a test now exercises the branch. -
Broad
except Exceptionhandlers no longer hide defects (#33). 21
handlers caught everything and reported something plausible; one had
already turned aTypeErrorinverify_against_server()into "could not
fetch". Each now names what the call site raises:duckdb.IOExceptionfor
the connect retry,duckdb.CatalogExceptionfor the startup
case-duplicate check,OSError/http.client.HTTPExceptionon network
paths,requests.RequestExceptionfor the size HEAD,SpiceyErroraround
spiceypy. Two deadexcept Exception: raiselines are gone. The four that
stay broad (two atomic-write cleanups, two transaction rollbacks) all
re-raise and say so in a comment.Narrowing exposed what the issue predicted: 25 unit tests had been
reaching the real network through the size lookup andcheck's
staleness probe, and the offline guard's exception was being swallowed.
Those tests now mock both, theremote_sizesfixture patches the binding
db.pyactually uses, and the guard exception is aBaseExceptionso no
handler can hide it again. -
The test suite can no longer overwrite the user's
config.toml(#28).
test_config_setkept the realsave_configaway only by patching it by
name; when the Typer port moved the import site the patch missed and
~/.config/spice-kernel-db/config.tomlwas replaced with a test's tmp
paths, breaking every laterskdcall. An autouse fixture now points
HOME,CONFIG_DIRandCONFIG_FILEat an empty directory for every
test, and a session guard fails the run if the real config changed anyway.