carlos / platform Public

host: the installer's guard errors and helper notes name the install, not the landing (Task 3)

errLandingChanged and errFilesOccupied are the shared installer's, raised
for a dirty return too; their text and the helpers' comments say
"install". No test matches either text; behaviour is unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev 616325b37e9018b2bea5765da394cb5fd0905fb0 parent 3d6d73d
1 file changed, +15 −13
  • internal/host/moveslandinstall.go +15 −13
diff --git a/internal/host/moveslandinstall.go b/internal/host/moveslandinstall.go
index bf3186cb0..f5bd8b424 100644
--- a/internal/host/moveslandinstall.go
+++ b/internal/host/moveslandinstall.go
@@ -35,13 +35,15 @@ import (
// errLandingChanged is a guarded install's refusal when the claim, the
// record, the installation record or the destination is no longer this
-// landing's: nothing is written, and the pass ends with the error.
-var errLandingChanged = errors.New("the installation is no longer this landing's")
+// install's (a landing's or a dirty return's): nothing is written, and the
+// pass ends with the error.
+var errLandingChanged = errors.New("the installation is no longer this install's")
// errFilesOccupied is the files install's refusal when the files directory
-// holds anything, or <host>.env exists, that this landing did not write:
-// it is not the landing's to clear, so the rollback is marked instead.
-var errFilesOccupied = errors.New("the files paths hold what this landing did not write")
+// holds anything, or <host>.env exists, that this install did not write:
+// it is not the install's to clear, so the install's refusal is written
+// instead (a landing's rollback marker, a return's stuck mark).
+var errFilesOccupied = errors.New("the files paths hold what this install did not write")
// capture reads the installation record and requires it at the holder's
// incarnation and stamp: the identity every guarded install runs under.
@@ -119,9 +121,9 @@ func journalledStaged(j *moves.Journal, step string) (stagedFiles, error) {
// its identities journalled as `staged`; a retry before that clears only
// the staging and extracts again. Then, inside the host guard, the staged
// tree and env are moved to the files directory and <host>.env when those
-// hold nothing this landing did not write (absent, or an empty directory,
-// or this landing's own tree by identity after a crash mid-move). Anything
-// else there is not the landing's to clear: nothing is moved and the
+// hold nothing this install did not write (absent, or an empty directory,
+// or this install's own tree by identity after a crash mid-move). Anything
+// else there is not the install's to clear: nothing is moved and the
// rollback is marked. The install receipt (`files_placed`) is journalled,
// the empty staging removed, and only then `extracted`.
func (ir *installRun) installFiles(ctx context.Context, j *moves.Journal, mark func(step, value string) error, captured hostguard.Captured, seal moves.Seal, want provision.MoveFilesDigest, dir, envPath string) (restoreOutcome, error) {
@@ -192,8 +194,8 @@ func (ir *installRun) installFiles(ctx context.Context, j *moves.Journal, mark f
// placeStaged runs inside the guard. Every destination is decided before
// anything moves, so a refusal changes nothing: the files directory must be
-// this landing's tree already (by identity: a crash after its move) or
-// absent or an empty directory, and <host>.env this landing's env already,
+// this install's tree already (by identity: a crash after its move) or
+// absent or an empty directory, and <host>.env this install's env already,
// or absent. An empty directory gives its mode to the tree and is replaced,
// as Extract has always done.
func (ir *installRun) placeStaged(staged stagedFiles, stFiles, stEnv, dir, envPath string) error {
@@ -318,7 +320,7 @@ func sameIdentity(path, id string) (bool, error) {
return id != "" && got == id, nil
}
-// removeTree removes a tree this landing made under its own journal
+// removeTree removes a tree this install made under its own journal
// directory, whose directories may carry the archive's restrictive modes:
// each is made writable before its contents are removed. Absent is nothing
// to do.
@@ -541,7 +543,7 @@ func (ir *installRun) restore(ctx context.Context, obs hostclaim.Observed) (sha
err = ir.guarded(ctx, captured, ir.src.Phases[4], func() error {
// Every destination is Lstat-checked, never read through: a symlink
// or any other non-regular file at <dbPath>.gen, DBPath or the WAL
- // paths, dangling or not, is not this landing's and is never
+ // paths, dangling or not, is not this install's and is never
// replaced (final re-review residual). ReadGenerationMarker follows
// a symlink and reads a dangling one as absent.
if fi, err := os.Lstat(dbPath + ".gen"); err == nil && !fi.Mode().IsRegular() {
@@ -569,7 +571,7 @@ func (ir *installRun) restore(ctx context.Context, obs hostclaim.Observed) (sha
return err
}
if got != want {
- return fmt.Errorf("%w: %s holds a database that is not this landing's build (%s, want %s)", errLandingChanged, dbPath, got, want)
+ return fmt.Errorf("%w: %s holds a database that is not this install's build (%s, want %s)", errLandingChanged, dbPath, got, want)
}
case present:
return fmt.Errorf("%w: the database observed at %s is gone", errLandingChanged, dbPath)