From 511a4c912c59b3262279d4de039904515a7c380e Mon Sep 17 00:00:00 2001 From: ruinivist Date: Sat, 21 Mar 2026 12:49:57 +0000 Subject: [PATCH] rename: rebrand to mire --- .gitignore | 2 +- Makefile | 4 +- cmd/init.go | 6 +- cmd/{miro => mire}/main.go | 2 +- cmd/record.go | 8 +- cmd/root.go | 4 +- cmd/root_test.go | 20 ++-- cmd/test.go | 4 +- go.mod | 2 +- internal/config/config.go | 26 ++--- internal/config/config_test.go | 42 +++---- internal/{miro => mire}/errors.go | 2 +- internal/{miro => mire}/init.go | 12 +- internal/{miro => mire}/path_resolution.go | 2 +- .../{miro => mire}/path_resolution_test.go | 4 +- internal/{miro => mire}/post_process.go | 2 +- internal/{miro => mire}/post_process_test.go | 4 +- internal/{miro => mire}/record.go | 2 +- internal/{miro => mire}/record_session.go | 8 +- internal/{miro => mire}/record_shell.go | 20 ++-- internal/{miro => mire}/record_shell.sh | 24 ++-- internal/{miro => mire}/record_test.go | 106 +++++++++--------- internal/{miro => mire}/setup_scripts.go | 4 +- internal/{miro => mire}/setup_scripts_test.go | 4 +- internal/{miro => mire}/test.go | 6 +- internal/{miro => mire}/test_test.go | 8 +- internal/{miro => mire}/testdir.go | 12 +- internal/{miro => mire}/testdir_test.go | 44 ++++---- internal/{miro => mire}/testhelpers_test.go | 4 +- internal/output/output.go | 6 +- internal/output/output_test.go | 8 +- internal/testutil/testutil.go | 16 +-- 32 files changed, 209 insertions(+), 209 deletions(-) rename cmd/{miro => mire}/main.go (86%) rename internal/{miro => mire}/errors.go (93%) rename internal/{miro => mire}/init.go (71%) rename internal/{miro => mire}/path_resolution.go (99%) rename internal/{miro => mire}/path_resolution_test.go (98%) rename internal/{miro => mire}/post_process.go (99%) rename internal/{miro => mire}/post_process_test.go (97%) rename internal/{miro => mire}/record.go (98%) rename internal/{miro => mire}/record_session.go (96%) rename internal/{miro => mire}/record_shell.go (87%) rename internal/{miro => mire}/record_shell.sh (69%) rename internal/{miro => mire}/record_test.go (80%) rename internal/{miro => mire}/setup_scripts.go (96%) rename internal/{miro => mire}/setup_scripts_test.go (96%) rename internal/{miro => mire}/test.go (98%) rename internal/{miro => mire}/test_test.go (98%) rename internal/{miro => mire}/testdir.go (83%) rename internal/{miro => mire}/testdir_test.go (81%) rename internal/{miro => mire}/testhelpers_test.go (97%) diff --git a/.gitignore b/.gitignore index bffa30e..a22c551 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,4 @@ /AGENTS.md /build/ /e2e/ -/miro.toml \ No newline at end of file +/mire.toml \ No newline at end of file diff --git a/Makefile b/Makefile index 22fba82..37e539d 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ .PHONY: build test -BIN := build/miro +BIN := build/mire build: mkdir -p build - go build -o $(BIN) ./cmd/miro + go build -o $(BIN) ./cmd/mire test: go test ./... diff --git a/cmd/init.go b/cmd/init.go index 97ae33b..33a4bad 100644 --- a/cmd/init.go +++ b/cmd/init.go @@ -1,8 +1,8 @@ package cmd import ( - "miro/internal/miro" - "miro/internal/output" + "mire/internal/mire" + "mire/internal/output" "github.com/spf13/cobra" ) @@ -12,7 +12,7 @@ func newInitCommand() *cobra.Command { Use: "init", Args: cobra.NoArgs, RunE: func(_ *cobra.Command, _ []string) error { - if err := miro.Init(); err != nil { + if err := mire.Init(); err != nil { return err } diff --git a/cmd/miro/main.go b/cmd/mire/main.go similarity index 86% rename from cmd/miro/main.go rename to cmd/mire/main.go index 60e8e42..e60b323 100644 --- a/cmd/miro/main.go +++ b/cmd/mire/main.go @@ -3,7 +3,7 @@ package main import ( "os" - "miro/cmd" + "mire/cmd" ) func main() { diff --git a/cmd/record.go b/cmd/record.go index 2ef4faa..eb60d6f 100644 --- a/cmd/record.go +++ b/cmd/record.go @@ -4,8 +4,8 @@ import ( "errors" "path/filepath" - "miro/internal/miro" - "miro/internal/output" + "mire/internal/mire" + "mire/internal/output" "github.com/spf13/cobra" ) @@ -16,9 +16,9 @@ func newRecordCommand() *cobra.Command { Args: cobra.ExactArgs(1), RunE: func(_ *cobra.Command, args []string) error { path := filepath.Clean(args[0]) - createdPath, err := miro.Record(path) + createdPath, err := mire.Record(path) if err != nil { - if errors.Is(err, miro.ErrRecordingDiscarded) { + if errors.Is(err, mire.ErrRecordingDiscarded) { return nil } return err diff --git a/cmd/root.go b/cmd/root.go index bef702d..d090f91 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -8,7 +8,7 @@ import ( "github.com/spf13/cobra" ) -// Run executes the miro CLI and returns a process exit code. +// Run executes the mire CLI and returns a process exit code. func Run(args []string) int { if err := ensureDependencies(); err != nil { fmt.Fprintln(os.Stderr, err) @@ -27,7 +27,7 @@ func Run(args []string) int { func newRootCommand() *cobra.Command { rootCmd := &cobra.Command{ - Use: "miro", + Use: "mire", Short: "A lean CLI E2E testing framework.", RunE: func(cmd *cobra.Command, _ []string) error { return cmd.Help() diff --git a/cmd/root_test.go b/cmd/root_test.go index b3159d4..dbd5a9d 100644 --- a/cmd/root_test.go +++ b/cmd/root_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "miro/internal/testutil" + "mire/internal/testutil" ) func TestRunShowsHelpWhenNoArgs(t *testing.T) { @@ -49,7 +49,7 @@ func TestRunInit(t *testing.T) { return struct{}{} }) - if got := testutil.ReadFile(t, filepath.Join(root, "miro.toml")); got != testutil.DefaultWrittenConfig("e2e") { + if got := testutil.ReadFile(t, filepath.Join(root, "mire.toml")); got != testutil.DefaultWrittenConfig("e2e") { t.Fatalf("config = %q, want %q", got, testutil.DefaultWrittenConfig("e2e")) } info, err := os.Stat(filepath.Join(root, "e2e", "shell.sh")) @@ -121,8 +121,8 @@ func TestRunInitFailsWhenDependenciesMissing(t *testing.T) { if !strings.Contains(stderr, `required command "script" not found in PATH`) { t.Fatalf("stderr = %q, want missing dependency error", stderr) } - if _, err := os.Stat(filepath.Join(root, "miro.toml")); !os.IsNotExist(err) { - t.Fatalf("Stat(%q) error = %v, want not exists", filepath.Join(root, "miro.toml"), err) + if _, err := os.Stat(filepath.Join(root, "mire.toml")); !os.IsNotExist(err) { + t.Fatalf("Stat(%q) error = %v, want not exists", filepath.Join(root, "mire.toml"), err) } if _, err := os.Stat(filepath.Join(root, "e2e", "shell.sh")); !os.IsNotExist(err) { t.Fatalf("Stat(%q) error = %v, want not exists", filepath.Join(root, "e2e", "shell.sh"), err) @@ -146,7 +146,7 @@ func TestRunRecordMissingPath(t *testing.T) { if !strings.Contains(stderr, "accepts 1 arg(s), received 0") { t.Fatalf("stderr = %q, want argument error", stderr) } - if !strings.Contains(stderr, "Usage:") || !strings.Contains(stderr, "miro record ") { + if !strings.Contains(stderr, "Usage:") || !strings.Contains(stderr, "mire record ") { t.Fatalf("stderr = %q, want record usage", stderr) } } @@ -212,7 +212,7 @@ func TestRunTestExtraArgs(t *testing.T) { if !strings.Contains(stderr, "accepts at most 1 arg(s), received 2") { t.Fatalf("stderr = %q, want extra-arg error", stderr) } - if !strings.Contains(stderr, "Usage:") || !strings.Contains(stderr, "miro test [path]") { + if !strings.Contains(stderr, "Usage:") || !strings.Contains(stderr, "mire test [path]") { t.Fatalf("stderr = %q, want test usage", stderr) } } @@ -229,10 +229,10 @@ func TestRunInitExtraArgs(t *testing.T) { if stdout != "" { t.Fatalf("stdout = %q, want empty", stdout) } - if !strings.Contains(stderr, "unknown command \"extra\" for \"miro init\"") { + if !strings.Contains(stderr, "unknown command \"extra\" for \"mire init\"") { t.Fatalf("stderr = %q, want extra-arg error", stderr) } - if !strings.Contains(stderr, "Usage:") || !strings.Contains(stderr, "miro init") { + if !strings.Contains(stderr, "Usage:") || !strings.Contains(stderr, "mire init") { t.Fatalf("stderr = %q, want init usage", stderr) } } @@ -249,11 +249,11 @@ func TestRunUnknownCommand(t *testing.T) { if stdout != "" { t.Fatalf("stdout = %q, want empty", stdout) } - if !strings.Contains(stderr, "unknown command \"wat\" for \"miro\"") { + if !strings.Contains(stderr, "unknown command \"wat\" for \"mire\"") { t.Fatalf("stderr = %q, want unknown command error", stderr) } } func prefixed(msg string) string { - return "miro › " + msg + return "mire › " + msg } diff --git a/cmd/test.go b/cmd/test.go index ee53905..023731b 100644 --- a/cmd/test.go +++ b/cmd/test.go @@ -1,7 +1,7 @@ package cmd import ( - "miro/internal/miro" + "mire/internal/mire" "github.com/spf13/cobra" ) @@ -16,7 +16,7 @@ func newTestCommand() *cobra.Command { path = args[0] } - return miro.RunTests(path) + return mire.RunTests(path) }, } } diff --git a/go.mod b/go.mod index db1ce88..87608fa 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module miro +module mire go 1.25.5 diff --git a/internal/config/config.go b/internal/config/config.go index a5e7931..019db5c 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -27,11 +27,11 @@ type Config struct { } type tomlConfig struct { - Miro tomlMiroConfig `toml:"miro"` + Mire tomlMireConfig `toml:"mire"` Sandbox map[string]string `toml:"sandbox"` } -type tomlMiroConfig struct { +type tomlMireConfig struct { TestDir string `toml:"test_dir"` } @@ -39,7 +39,7 @@ func DefaultSandboxConfig() map[string]string { return cloneSandbox(requiredSandboxDefaults) } -// ReadConfig reads miro.toml. +// ReadConfig reads mire.toml. func ReadConfig(path string) (Config, error) { var raw tomlConfig @@ -50,14 +50,14 @@ func ReadConfig(path string) (Config, error) { } return Config{}, fmt.Errorf("failed to read %s: %v", path, err) } - if !meta.IsDefined("miro") { - return Config{}, fmt.Errorf("failed to read %s: missing [miro] config", path) + if !meta.IsDefined("mire") { + return Config{}, fmt.Errorf("failed to read %s: missing [mire] config", path) } - if !meta.IsDefined("miro", "test_dir") { - return Config{}, fmt.Errorf("failed to read %s: missing required miro.test_dir", path) + if !meta.IsDefined("mire", "test_dir") { + return Config{}, fmt.Errorf("failed to read %s: missing required mire.test_dir", path) } - if raw.Miro.TestDir == "" { - return Config{}, fmt.Errorf("failed to read %s: empty miro.test_dir", path) + if raw.Mire.TestDir == "" { + return Config{}, fmt.Errorf("failed to read %s: empty mire.test_dir", path) } if !meta.IsDefined("sandbox") { return Config{}, fmt.Errorf("failed to read %s: missing [sandbox] config", path) @@ -69,15 +69,15 @@ func ReadConfig(path string) (Config, error) { } return Config{ - TestDir: raw.Miro.TestDir, + TestDir: raw.Mire.TestDir, Sandbox: sandbox, }, nil } -// WriteConfig writes miro.toml. +// WriteConfig writes mire.toml. func WriteConfig(path string, cfg Config) error { if cfg.TestDir == "" { - return errors.New("empty miro.test_dir") + return errors.New("empty mire.test_dir") } sandbox, err := validateSandbox(path, cfg.Sandbox) if err != nil { @@ -85,7 +85,7 @@ func WriteConfig(path string, cfg Config) error { } var buf bytes.Buffer - fmt.Fprintf(&buf, "[miro]\n test_dir = %q\n\n[sandbox]\n", cfg.TestDir) + fmt.Fprintf(&buf, "[mire]\n test_dir = %q\n\n[sandbox]\n", cfg.TestDir) keys := make([]string, 0, len(sandbox)) for key := range sandbox { diff --git a/internal/config/config_test.go b/internal/config/config_test.go index 1eb1db4..94743cf 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -19,7 +19,7 @@ func TestReadConfig(t *testing.T) { }{ { name: "with test dir and sandbox", - content: "[miro]\ntest_dir = \"custom/suite\"\n\n[sandbox]\nvisible_home = \"/home/test\"\nkey_word = \"value\"\n", + content: "[mire]\ntest_dir = \"custom/suite\"\n\n[sandbox]\nvisible_home = \"/home/test\"\nkey_word = \"value\"\n", wantDir: "custom/suite", wantSandbox: map[string]string{ "visible_home": "/home/test", @@ -29,51 +29,51 @@ func TestReadConfig(t *testing.T) { { name: "legacy top level key", content: "test_dir = \"custom/suite\"\n", - wantErr: "missing [miro] config", + wantErr: "missing [mire] config", }, { - name: "without miro table", + name: "without mire table", content: "", - wantErr: "missing [miro] config", + wantErr: "missing [mire] config", }, { name: "without test dir", - content: "[miro]\n", - wantErr: "missing required miro.test_dir", + content: "[mire]\n", + wantErr: "missing required mire.test_dir", }, { name: "empty test dir", - content: "[miro]\ntest_dir = \"\"\n", - wantErr: "empty miro.test_dir", + content: "[mire]\ntest_dir = \"\"\n", + wantErr: "empty mire.test_dir", }, { name: "without sandbox table", - content: "[miro]\ntest_dir = \"custom/suite\"\n", + content: "[mire]\ntest_dir = \"custom/suite\"\n", wantErr: "missing [sandbox] config", }, { name: "without required visible home", - content: "[miro]\ntest_dir = \"custom/suite\"\n\n[sandbox]\n", + content: "[mire]\ntest_dir = \"custom/suite\"\n\n[sandbox]\n", wantErr: "missing required sandbox.visible_home", }, { name: "empty required visible home", - content: "[miro]\ntest_dir = \"custom/suite\"\n\n[sandbox]\nvisible_home = \"\"\n", + content: "[mire]\ntest_dir = \"custom/suite\"\n\n[sandbox]\nvisible_home = \"\"\n", wantErr: "empty sandbox.visible_home", }, { name: "relative visible home", - content: "[miro]\ntest_dir = \"custom/suite\"\n\n[sandbox]\nvisible_home = \"home/test\"\n", + content: "[mire]\ntest_dir = \"custom/suite\"\n\n[sandbox]\nvisible_home = \"home/test\"\n", wantErr: "sandbox.visible_home must be an absolute path", }, { name: "invalid sandbox key", - content: "[miro]\ntest_dir = \"custom/suite\"\n\n[sandbox]\nvisible_home = \"/home/test\"\nKeyWord = \"value\"\n", + content: "[mire]\ntest_dir = \"custom/suite\"\n\n[sandbox]\nvisible_home = \"/home/test\"\nKeyWord = \"value\"\n", wantErr: "invalid sandbox key", }, { name: "invalid toml", - content: "[miro]\ntest_dir = [\n", + content: "[mire]\ntest_dir = [\n", wantErr: "failed to read", }, { @@ -84,7 +84,7 @@ func TestReadConfig(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - path := filepath.Join(t.TempDir(), "miro.toml") + path := filepath.Join(t.TempDir(), "mire.toml") if !tt.wantMissing { if err := os.WriteFile(path, []byte(tt.content), 0o644); err != nil { t.Fatalf("WriteFile() error = %v", err) @@ -126,7 +126,7 @@ func TestReadConfig(t *testing.T) { } func TestWriteConfig(t *testing.T) { - path := filepath.Join(t.TempDir(), "miro.toml") + path := filepath.Join(t.TempDir(), "mire.toml") if err := WriteConfig(path, Config{ TestDir: "e2e", @@ -143,26 +143,26 @@ func TestWriteConfig(t *testing.T) { if err != nil { t.Fatalf("ReadFile() error = %v", err) } - want := "[miro]\n test_dir = \"e2e\"\n\n[sandbox]\n alpha_key = \"a\"\n visible_home = \"/home/test\"\n zulu_key = \"z\"\n" + want := "[mire]\n test_dir = \"e2e\"\n\n[sandbox]\n alpha_key = \"a\"\n visible_home = \"/home/test\"\n zulu_key = \"z\"\n" if string(got) != want { t.Fatalf("config = %q, want %q", string(got), want) } } func TestWriteConfigEmptyTestDirFails(t *testing.T) { - path := filepath.Join(t.TempDir(), "miro.toml") + path := filepath.Join(t.TempDir(), "mire.toml") err := WriteConfig(path, Config{}) if err == nil { t.Fatal("WriteConfig() error = nil, want error") } - if err.Error() != "empty miro.test_dir" { - t.Fatalf("WriteConfig() error = %q, want %q", err.Error(), "empty miro.test_dir") + if err.Error() != "empty mire.test_dir" { + t.Fatalf("WriteConfig() error = %q, want %q", err.Error(), "empty mire.test_dir") } } func TestWriteConfigMissingRequiredSandboxFails(t *testing.T) { - path := filepath.Join(t.TempDir(), "miro.toml") + path := filepath.Join(t.TempDir(), "mire.toml") err := WriteConfig(path, Config{ TestDir: "e2e", diff --git a/internal/miro/errors.go b/internal/mire/errors.go similarity index 93% rename from internal/miro/errors.go rename to internal/mire/errors.go index 763faec..c0b8cbe 100644 --- a/internal/miro/errors.go +++ b/internal/mire/errors.go @@ -1,4 +1,4 @@ -package miro +package mire var ( ErrRecordingDiscarded = RecordingDiscardedError{} diff --git a/internal/miro/init.go b/internal/mire/init.go similarity index 71% rename from internal/miro/init.go rename to internal/mire/init.go index 9836ea7..023223a 100644 --- a/internal/miro/init.go +++ b/internal/mire/init.go @@ -1,4 +1,4 @@ -package miro +package mire import ( "errors" @@ -6,7 +6,7 @@ import ( "os" "path/filepath" - miroconfig "miro/internal/config" + mireconfig "mire/internal/config" ) const defaultTestDir = "e2e" @@ -18,17 +18,17 @@ func Init() error { return err } - configPath := filepath.Join(root, "miro.toml") + configPath := filepath.Join(root, "mire.toml") if _, err := os.Stat(configPath); err == nil { - if _, err := miroconfig.ReadConfig(configPath); err != nil { + if _, err := mireconfig.ReadConfig(configPath); err != nil { return err } } else if !errors.Is(err, os.ErrNotExist) { return fmt.Errorf("failed to check %s: %v", configPath, err) } else { - if err := miroconfig.WriteConfig(configPath, miroconfig.Config{ + if err := mireconfig.WriteConfig(configPath, mireconfig.Config{ TestDir: defaultTestDir, - Sandbox: miroconfig.DefaultSandboxConfig(), + Sandbox: mireconfig.DefaultSandboxConfig(), }); err != nil { return fmt.Errorf("failed to write %s: %v", configPath, err) } diff --git a/internal/miro/path_resolution.go b/internal/mire/path_resolution.go similarity index 99% rename from internal/miro/path_resolution.go rename to internal/mire/path_resolution.go index 54ec28d..da1bc94 100644 --- a/internal/miro/path_resolution.go +++ b/internal/mire/path_resolution.go @@ -1,4 +1,4 @@ -package miro +package mire import ( "fmt" diff --git a/internal/miro/path_resolution_test.go b/internal/mire/path_resolution_test.go similarity index 98% rename from internal/miro/path_resolution_test.go rename to internal/mire/path_resolution_test.go index 23ab9b7..087c6ca 100644 --- a/internal/miro/path_resolution_test.go +++ b/internal/mire/path_resolution_test.go @@ -1,4 +1,4 @@ -package miro +package mire import ( "os" @@ -6,7 +6,7 @@ import ( "strings" "testing" - "miro/internal/testutil" + "mire/internal/testutil" ) func TestResolvePathWithinTestDirAcceptsRelativePath(t *testing.T) { diff --git a/internal/miro/post_process.go b/internal/mire/post_process.go similarity index 99% rename from internal/miro/post_process.go rename to internal/mire/post_process.go index 0fc666d..4d0c90e 100644 --- a/internal/miro/post_process.go +++ b/internal/mire/post_process.go @@ -1,4 +1,4 @@ -package miro +package mire import ( "bytes" diff --git a/internal/miro/post_process_test.go b/internal/mire/post_process_test.go similarity index 97% rename from internal/miro/post_process_test.go rename to internal/mire/post_process_test.go index fd08a56..0d9601d 100644 --- a/internal/miro/post_process_test.go +++ b/internal/mire/post_process_test.go @@ -1,10 +1,10 @@ -package miro +package mire import ( "path/filepath" "testing" - "miro/internal/testutil" + "mire/internal/testutil" ) func TestLoadRecordedInputTrimsTrailingNewlineAfterEOF(t *testing.T) { diff --git a/internal/miro/record.go b/internal/mire/record.go similarity index 98% rename from internal/miro/record.go rename to internal/mire/record.go index 60df42a..169fe5c 100644 --- a/internal/miro/record.go +++ b/internal/mire/record.go @@ -1,4 +1,4 @@ -package miro +package mire import ( "fmt" diff --git a/internal/miro/record_session.go b/internal/mire/record_session.go similarity index 96% rename from internal/miro/record_session.go rename to internal/mire/record_session.go index dab90f6..166d166 100644 --- a/internal/miro/record_session.go +++ b/internal/mire/record_session.go @@ -1,4 +1,4 @@ -package miro +package mire import ( "bufio" @@ -8,7 +8,7 @@ import ( "path/filepath" "strings" - "miro/internal/output" + "mire/internal/output" ) type recordIO struct { @@ -68,7 +68,7 @@ func recordScenario(target, shellPath string, rio recordIO, sandboxConfig map[st } func newRecordFiles() (string, string, func(), error) { - dir, err := os.MkdirTemp("", "miro-record-") + dir, err := os.MkdirTemp("", "mire-record-") if err != nil { return "", "", nil, err } @@ -91,7 +91,7 @@ func newRecordSandbox() (recordSandbox, func(), error) { } func newRecordSandboxForPathEnv(pathEnv string) (recordSandbox, func(), error) { - dir, err := os.MkdirTemp("", "miro-record-sandbox-") + dir, err := os.MkdirTemp("", "mire-record-sandbox-") if err != nil { return recordSandbox{}, nil, err } diff --git a/internal/miro/record_shell.go b/internal/mire/record_shell.go similarity index 87% rename from internal/miro/record_shell.go rename to internal/mire/record_shell.go index b0fdf19..e322421 100644 --- a/internal/miro/record_shell.go +++ b/internal/mire/record_shell.go @@ -1,4 +1,4 @@ -package miro +package mire import ( "embed" @@ -13,9 +13,9 @@ import ( const recordShellName = "shell.sh" const ( - compareMarkerEnvName = "MIRO_COMPARE_MARKER" + compareMarkerEnvName = "MIRE_COMPARE_MARKER" compareMarkerEnabledValue = "1" - compareOutputMarker = "__MIRO_E2E_BEGIN__" + compareOutputMarker = "__MIRE_E2E_BEGIN__" ) //go:embed record_shell.sh @@ -29,7 +29,7 @@ func ensureRecordShell(testDir string) error { path := recordShellPath(testDir) if info, err := os.Stat(path); err == nil { if info.IsDir() { - return fmt.Errorf("recorder shell %q is a directory; remove it and rerun `miro init`", path) + return fmt.Errorf("recorder shell %q is a directory; remove it and rerun `mire init`", path) } } else if !errors.Is(err, os.ErrNotExist) { return fmt.Errorf("failed to check recorder shell %q: %v", path, err) @@ -59,12 +59,12 @@ func resolveRecordShell(testDir string) (string, error) { info, err := os.Stat(path) if err != nil { if errors.Is(err, os.ErrNotExist) { - return "", fmt.Errorf("missing recorder shell %q; rerun `miro init` or restore the file", path) + return "", fmt.Errorf("missing recorder shell %q; rerun `mire init` or restore the file", path) } return "", fmt.Errorf("failed to check recorder shell %q: %v", path, err) } if info.IsDir() { - return "", fmt.Errorf("recorder shell %q is a directory; rerun `miro init` or restore the file", path) + return "", fmt.Errorf("recorder shell %q is a directory; rerun `mire init` or restore the file", path) } return path, nil @@ -86,9 +86,9 @@ func recordSessionEnv(sandbox recordSandbox, sandboxConfig map[string]string, se func recordSessionEnvWithExtra(sandbox recordSandbox, sandboxConfig map[string]string, setupScripts []string, extraEnv map[string]string) []string { env := append([]string{}, os.Environ()...) env = append(env, - "MIRO_HOST_HOME="+sandbox.hostHome, - "MIRO_HOST_TMP="+sandbox.hostTmp, - "MIRO_PATH_ENV="+sandbox.pathEnv, + "MIRE_HOST_HOME="+sandbox.hostHome, + "MIRE_HOST_TMP="+sandbox.hostTmp, + "MIRE_PATH_ENV="+sandbox.pathEnv, setupScriptsEnvName+"="+strings.Join(setupScripts, "\n"), ) for _, key := range sortedKeys(sandboxConfig) { @@ -102,7 +102,7 @@ func recordSessionEnvWithExtra(sandbox recordSandbox, sandboxConfig map[string]s } func sandboxEnvName(key string) string { - return "MIRO_" + strings.ToUpper(key) + return "MIRE_" + strings.ToUpper(key) } func sortedKeys(values map[string]string) []string { diff --git a/internal/miro/record_shell.sh b/internal/mire/record_shell.sh similarity index 69% rename from internal/miro/record_shell.sh rename to internal/mire/record_shell.sh index 8a0c3b8..dda19db 100644 --- a/internal/miro/record_shell.sh +++ b/internal/mire/record_shell.sh @@ -2,18 +2,18 @@ set -eu # hoisted vars to fail fast if any missing -host_home=${MIRO_HOST_HOME:?} -host_tmp=${MIRO_HOST_TMP:?} -path_env=${MIRO_PATH_ENV:?} -visible_home=${MIRO_VISIBLE_HOME:?} -bootstrap_rc="$host_home/.miro-shell-rc" -visible_bootstrap_rc="$visible_home/.miro-shell-rc" -setup_scripts_dir='/tmp/miro-setup-scripts' +host_home=${MIRE_HOST_HOME:?} +host_tmp=${MIRE_HOST_TMP:?} +path_env=${MIRE_PATH_ENV:?} +visible_home=${MIRE_VISIBLE_HOME:?} +bootstrap_rc="$host_home/.mire-shell-rc" +visible_bootstrap_rc="$visible_home/.mire-shell-rc" +setup_scripts_dir='/tmp/mire-setup-scripts' cat >"$bootstrap_rc" <<'EOF' cd "${HOME:?}" -for path in /tmp/miro-setup-scripts/*.sh; do +for path in /tmp/mire-setup-scripts/*.sh; do [ -e "$path" ] || continue cd "${HOME:?}" source "$path" @@ -21,8 +21,8 @@ for path in /tmp/miro-setup-scripts/*.sh; do done EOF -if [ "${MIRO_COMPARE_MARKER:-0}" = "1" ]; then - printf '__MIRO_E2E_BEGIN__\n' +if [ "${MIRE_COMPARE_MARKER:-0}" = "1" ]; then + printf '__MIRE_E2E_BEGIN__\n' fi set -- \ @@ -46,7 +46,7 @@ set -- \ --setenv TZ 'UTC' \ --chdir "$visible_home" -if [ -n "${MIRO_SETUP_SCRIPTS:-}" ]; then +if [ -n "${MIRE_SETUP_SCRIPTS:-}" ]; then i=1 while IFS= read -r host_path || [ -n "$host_path" ]; do [ -n "$host_path" ] || continue @@ -54,7 +54,7 @@ if [ -n "${MIRO_SETUP_SCRIPTS:-}" ]; then set -- "$@" --ro-bind "$host_path" "$visible_path" i=$((i + 1)) done </dev/null; then +if [ -n "$cmd" ] && /bin/grep -q '__MIRE_E2E_BEGIN__' "$cmd" 2>/dev/null; then command_has_compare_marker=1 fi stdin_file='' if [ "${FAKE_SCRIPT_ECHO_STDIN:-}" = "1" ] || [ -n "${FAKE_SCRIPT_CAPTURE_STDIN_FILE:-}" ]; then - stdin_file="${TMPDIR:-/tmp}/miro-fake-script-stdin-$$" + stdin_file="${TMPDIR:-/tmp}/mire-fake-script-stdin-$$" /bin/cat > "$stdin_file" fi if [ -n "${FAKE_SCRIPT_CAPTURE_STDIN_FILE:-}" ] && [ -n "$stdin_file" ]; then @@ -198,8 +198,8 @@ if [ -n "${FAKE_SCRIPT_STREAM_OUT+x}" ]; then printf '%s' "$FAKE_SCRIPT_STREAM_OUT" elif [ "${FAKE_SCRIPT_ECHO_STDIN:-}" = "1" ] && [ -n "$stdin_file" ]; then /bin/cat "$stdin_file" - if [ "${MIRO_COMPARE_MARKER:-0}" = "1" ] && [ "$command_has_compare_marker" = "1" ]; then - printf '%s\n' '__MIRO_E2E_BEGIN__' + if [ "${MIRE_COMPARE_MARKER:-0}" = "1" ] && [ "$command_has_compare_marker" = "1" ]; then + printf '%s\n' '__MIRE_E2E_BEGIN__' /bin/cat "$stdin_file" fi fi @@ -213,8 +213,8 @@ elif [ -n "$out" ] && [ "${FAKE_SCRIPT_ECHO_STDIN:-}" = "1" ] && [ -n "$stdin_fi printf '%s' 'Script started on 2026-03-18 11:13:38+00:00 [TERM="xterm-256color"] ' /bin/cat "$stdin_file" - if [ "${MIRO_COMPARE_MARKER:-0}" = "1" ] && [ "$command_has_compare_marker" = "1" ]; then - printf '%s\n' '__MIRO_E2E_BEGIN__' + if [ "${MIRE_COMPARE_MARKER:-0}" = "1" ] && [ "$command_has_compare_marker" = "1" ]; then + printf '%s\n' '__MIRE_E2E_BEGIN__' /bin/cat "$stdin_file" fi printf '%s' 'Script done on 2026-03-18 11:13:44+00:00 [COMMAND_EXIT_CODE="0"] @@ -265,9 +265,9 @@ func MustGitInit(t *testing.T, dir string) { } func DefaultWrittenConfig(testDir string) string { - return "[miro]\n test_dir = \"" + testDir + "\"\n\n[sandbox]\n visible_home = \"/home/test\"\n" + return "[mire]\n test_dir = \"" + testDir + "\"\n\n[sandbox]\n visible_home = \"/home/test\"\n" } func ValidConfigContent(testDir string) string { - return "[miro]\ntest_dir = \"" + testDir + "\"\n\n[sandbox]\nvisible_home = \"/home/test\"\n" + return "[mire]\ntest_dir = \"" + testDir + "\"\n\n[sandbox]\nvisible_home = \"/home/test\"\n" }