Skip to content

star self install takes its payload from the caller's working directory, not from the product #990

Open

Description

@David-Noble-at-work

star self install takes its payload from the repository it happens to be run inside. Ruled a major
design breach, 2026-09-30.

installStarExtensions (cmd/star/star/root.go:312) resolves a source directory from ambient state and
copies whatever is there into the user's data directory:

srcExtDir := findExtensionsDir()                                               // <cwd repo>/star/extensions
targetExtDir := prefixRoot.NewPath("share", "devlore", "star", "extensions")
if err := cli.CopyDir(prefixRoot, srcExtDir, targetExtDir); err != nil {

There is no fixed manifest of what star installs. The payload is a directory listing.

The breach

An installer's payload must be a property of the product, not of the caller's location. This one is
whatever star/extensions/ exists near where the command ran:

  • Run inside devlore-cli, it installs devlore-cli's tree -- including the seven codegen templates inside
    com.noblefactor.devlore.Actions, which are build-time inputs that generate every provider.gen.go,
    action_names.gen.go and *.gen_test.go in that repository.
  • Run inside any other checkout carrying a star/extensions/ directory, it installs that instead. The
    contents are never validated, enumerated or compared against anything star knows about itself.
  • Run outside a checkout, it installs nothing, and says nothing about having installed nothing.

The same binary therefore installs different things depending on the working directory, and make install
reports success in every case.

Demonstrated

star self install <throwaway prefix> from a devlore-cli checkout:

share/devlore/star/extensions/com.noblefactor.devlore.Actions
share/devlore/star/extensions/com.noblefactor.devlore.Knowledge
share/devlore/star/extensions/com.noblefactor.devlore.Model
share/devlore/star/extensions/com.noblefactor.devlore.Package
share/devlore/star/extensions/com.noblefactor.devlore.Test
com.noblefactor.devlore.Actions/templates/action.gen_test.go.template
com.noblefactor.devlore.Actions/templates/action_names.gen.go.template
com.noblefactor.devlore.Actions/templates/dependent_type.gen.go.template
com.noblefactor.devlore.Actions/templates/module.gen_test.go.template
com.noblefactor.devlore.Actions/templates/provider.gen.go.template
com.noblefactor.devlore.Actions/templates/receiver_type.gen_test.go.template
com.noblefactor.devlore.Actions/templates/resource.gen.go.template

Meanwhile the 17 com.noblefactor.star.* extensions -- LintGo, LintStarlark, Setup, Hooks, Config, the ones
embedded in the binary via //go:embed com.* -- are not installed at all.

The second-order failure

The deployed copy sits at SourceUser, one precedence step below SourceProjectLocal. A codegen run that
does not resolve project-local reads the deployed templates instead of the repository's, and emits
generated code from a stale definition with no error and no warning.

Observed 2026-09-30: the copy on the owner's machine was dated three days earlier than the repository's, so
it would have produced pre-#964 output. A wrong-answer path, not a slow one.

The rule

Stated 2026-09-30, and it is the design, not a proposal:

star comes with builtin extensions. Builtin extensions are embedded. They are maintained in the star
source tree. All other extensions must be placed by the end user in the file system. They do not come
with star.

The payload is therefore fixed at build time. A compile-time //go:embed com.* satisfies this -- it cannot
vary by who runs the binary or from where. A run-time directory read cannot satisfy it, which is the breach
above.

The approach

Builtin means com.noblefactor.star.*, and only those. No com.noblefactor.devlore.* extension ships with
star.
They are not embedded and they are not installed: they are project-level extensions of devlore-cli,
and they live in devlore-cli/star/extensions.

Set Where it lives Ships with star
17 x com.noblefactor.star.* cmd/star/extensions/, embedded by //go:embed com.* yes -- these are the builtins
5 x com.noblefactor.devlore.* devlore-cli/star/extensions/ no -- project-level extensions of devlore-cli

So the change is a deletion, not a migration:

  1. Delete installStarExtensions and findExtensionsDir. star self install harvests nothing.
  2. Nothing moves into cmd/star/extensions/. The embedded set is what it already is.
  3. devlore-cli/star/extensions/ keeps all five as devlore-cli's project-level extensions, never installed
    -- Actions and its seven codegen templates among them.

devlore-registry CI is unaffected, and shows why project-local exists. Its validate.yaml checks
devlore-cli out, builds star from it, and runs star devlore package validate with the working directory
inside that checkout -- so com.noblefactor.devlore.Package resolves project-local, from the repository
that carries it. It never needed an installed copy.

Evidence of completion

Ruled 2026-09-30: star self install harvests exactly nothing.

  • installStarExtensions is gone. Nothing is copied from the filesystem into the install prefix.
  • The embedded set needs no installing: it travels in the binary and the loader already reaches it at
    SourceEmbedded.
  • Project-local extensions stay in the project. star self install does not read star/extensions/,
    so findExtensionsDir goes with it.
  • Which extensions are builtin is settled: com.noblefactor.star.*, and only those.
  • Nothing moves. No com.noblefactor.devlore.* extension is embedded or installed.
  • Codegen templates are product of nothing. They are build-time inputs to a checkout and are neither
    embedded nor installed.
  • A test runs self install from inside a checkout carrying star/extensions/ and asserts the prefix
    receives no extension directory at all.
  • The stale copies already on developers' machines are addressed, or this says why they are left.

Plan and design documents

Kind Document
Plan Not yet opened

Found 2026-09-30 while tracing why a template edit produced no regenerated output.

Distinct from #989, which fixed where star
SEARCHES. This is what it WRITES, and the two compound: #989 added an exe-relative probe, so an installed
payload is now reachable from more places than before.

related: #989,
#918,
#920

Activity

  1. changed the title [-]star self install deploys the project's extensions, not star's own: project-local must stay in the project[/-] [+]star self install takes its payload from the caller's working directory, not from the product[/+] on Sep 30, 2026
  2. David-Noble-at-work commented on Oct 20, 2026

    @David-Noble-at-work
    ContributorAuthor

    Evidence carried here from #947's plan (docs/plans/fix/947-self-upgrade-fetches-nothing-it.md, Out of Scope: "Its self-copy truncation, reproduced here ... goes with the code #990 deletes; a comment on #990 carries the evidence"), owed since #1001 and posted 2026-10-20.

    Self-copy truncation. Run from an installed star, self install into its own prefix resolves its extensions source to the directory it is about to write: findExtensionsDir (cmd/star/star/root.go:387, at 65c8b40f) falls back to the executable-relative share/devlore/star/extensions, which is also installStarExtensions's target (:317-345). Each file is then copied onto itself, and the copy's truncating create empties it before it is read. Reproduced during #947's work.

    It goes with the code this issue deletes: star self install harvests nothing (ruled 2026-09-30), so neither installStarExtensions nor findExtensionsDir survives #990.

  3. David-Noble-at-work commented on Nov 9, 2026

    @David-Noble-at-work
    ContributorAuthor

    star github triage sweep added this issue to Triage: devlore, for the rule it breaks:

    • severity: a Bug whose Severity is blank; a bug is Critical, High, Medium or Low
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions