Repository navigation
Description
Corrected 2026-09-30, after reading the design this should have started from.
docs/architecture/9-star-extensions.md defines four scopes — project, user, system, embedded — and says which
tool writes each. Defect 1 below proposed a fifth path, derived from the running binary, to find what
star self install writes to $PREFIX/share/devlore/star/extensions.
That path serves no scope. self install should write no extensions at all: builtin extensions are embedded
and travel in the binary, and every other extension is placed deliberately — by writ at user scope, or by the
repository at project scope. The prefix payload it was searching for is itself the defect, now
#990.
The probe was implemented, committed, and then reverted. It accommodated a breach instead of reading the design
that forbids it. Defect 1 is withdrawn. Defects 2, 3 and 4 stand and are fixed; all three are sanctioned by
the design.
star installs its extensions to $PREFIX/share/devlore/star/extensions and searches a list that was
written independently of that. The two agree for exactly two prefixes, by coincidence, and for any other
prefix make install reports success while star never sees the extensions.
The search list today
cmd/star/extension/loader.go:233, defaultSearchPaths():
| # | Path | Source label it gets |
|---|---|---|
| 0 | config.GitWorkspaceRoot() + /star/extensions |
SourceProjectLocal |
| 1 | devlore.DataPath("star", "extensions") = ${XDG_DATA_HOME}/devlore/star/extensions |
SourceUser |
| 2 | xdg.DataPath("star", "extensions") = ${XDG_DATA_HOME}/star/extensions — deprecated, #920 |
SourceSystem |
| 3 | /usr/local/share/devlore/star/extensions — string literal |
SourceSystem |
| 4 | /usr/local/share/star/extensions — deprecated, #920 |
SourceSystem |
| 5 | the embedded FS | SourceEmbedded |
The installer writes to $PREFIX/share/devlore/star/extensions — cmd/star/star/root.go:329,
prefixRoot.NewPath("share", "devlore", "star", "extensions"), where the prefix is self install's
argument and make install passes PREFIX, default ~/.local.
Four defects
1. Any prefix other than ~/.local or /usr/local installs somewhere nothing searches
PREFIX |
Installed to | Searched |
|---|---|---|
~/.local |
~/.local/share/devlore/star/extensions |
yes, by row 1 — only because XDG_DATA_HOME is unset |
/usr/local |
/usr/local/share/devlore/star/extensions |
yes, by the literal in row 3 |
/opt/devlore, ~/apps, a container prefix |
$PREFIX/share/devlore/star/extensions |
no |
Silent: the install succeeds and the extensions are simply absent.
There is no exe-relative search path, which is what would make the search follow the prefix. The logic
already exists in this repository, on the installer side: root.go:382 computes
filepath.Join(filepath.Dir(filepath.Dir(exe)), "share") to find extensions in an unpacked release
archive. The loader does not have it.
2. The installer resolves its source relative to the working directory, not the repository root
root.go:374, findExtensionsDir():
if info, err := os.Stat(filepath.Join("star", "extensions")); err == nil && info.IsDir() {
return filepath.Join("star", "extensions")
}That is ./star/extensions — found only when self install runs from the repository root. The loader does
the same job correctly one file away, with config.GitWorkspaceRoot() (loader.go:236). Same concept, two
implementations, one wrong.
3. /usr/local/share is a string literal, and xdg.DataDirs() is unused
pkg/xdg/xdg.go:142 already implements the specification's answer:
func DataDirs() []string { return dirs(envDataDirs, "/usr/local/share", "/usr/share") }Nothing in the codebase calls it. The loader hardcodes one of its two defaults, so /usr/share is never
searched and XDG_DATA_DIRS is ignored. The user half of the spec is honored (XDG_DATA_HOME, via
DataHome) and the system half is not.
4. Source labels are assigned by index, and the array is shorter than the list
loader.go:79:
sources := []Source{SourceProjectLocal, SourceUser, SourceSystem}
for i, dir := range l.searchPaths {
source := SourceSystem
if i < len(sources) {
source = sources[i]
}Row 2 is ${XDG_DATA_HOME}/star/extensions, a user path, reported as system. It does not change
resolution order, only what narration and diagnostics say about where an extension came from — which is
what someone reads when an extension resolved from somewhere they did not expect.
What it should be
Prior art converges: derive from the binary, then let the environment override.
- Git finds
git-corerelative to the runtime binary;git --exec-pathexposes it. - Python computes
sys.prefixfrom the executable, which is what makes an install relocatable. - Go derives
GOROOTfrom the executable path when unset. - Clang finds its resource directory relative to the driver.
- The XDG specification is
XDG_DATA_HOME, thenXDG_DATA_DIRS— the directly applicable standard,
already half-implemented here, withxdg.DataDirs()sitting unused.
So: repository root, then exe-relative (<dir of star>/../share/devlore/star/extensions), then
XDG_DATA_HOME, then XDG_DATA_DIRS, then embedded — with both /usr/local literals gone, since
DataDirs() already defaults to them.
Done when
-
The loader searches exe-relativewithdrawn -- it served no scope, and star self install takes its payload from the caller's working directory, not from the product #990 removes the payload it
looked for. -
findExtensionsDir()resolves its source fromconfig.GitWorkspaceRoot(), like the loader does. -
xdg.DataDirs()supplies the system paths; no/usr/local/shareliteral remains in the loader. - A
Sourcelabel is derived from the path that produced it, not from its index. -
A test installs to a prefix that is neitherwithdrawn with defect 1.~/.localnor/usr/local
The equivalent test now belongs to star self install takes its payload from the caller's working directory, not from the product #990:self installfrom inside a checkout delivers no extensions.
Plan and design documents
| Kind | Document |
|---|---|
| Plan | docs/plans/fix/964-ci-lints-neither-markdown.md |
Found 2026-09-30 while tracing why a template edit produced no regenerated output: the deployed copy of
com.noblefactor.devlore.Actions was three days stale, which raised the question of when the deployed copy
is consulted at all.
related: #918 (where the
devlore/ move was made), #920 (which drops rows 2
and 4)
Activity
fix(star): extensions are searched where they are installed, for any …
fix(star): revert the binary-derived search path, and make the docume…
fix(star): a Source travels with its path, so no Loader can hold one …
style(goast): the go-style debt measured and 1,530 cleared, and star …