From f8588dcd87a499da564039a5d85b8937b2a81fde Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 19 Oct 2026 19:17:35 -0700 Subject: [PATCH] refactor(app): own optional first-run setup admission --- docs/architecture/repository-layout.md | 5 +++++ {pkg/custom => internal/app}/audio_first_run_review_test.go | 2 +- {pkg/custom => internal/app}/audio_skip_setup_test.go | 4 ++-- .../app}/image_first_run_admission_test.go | 2 +- {pkg/custom => internal/app}/image_picker_first_run.go | 2 +- internal/app/run.go | 2 +- 6 files changed, 11 insertions(+), 6 deletions(-) rename {pkg/custom => internal/app}/audio_first_run_review_test.go (99%) rename {pkg/custom => internal/app}/audio_skip_setup_test.go (99%) rename {pkg/custom => internal/app}/image_first_run_admission_test.go (99%) rename {pkg/custom => internal/app}/image_picker_first_run.go (99%) diff --git a/docs/architecture/repository-layout.md b/docs/architecture/repository-layout.md index 62acf7ec..5737f28a 100644 --- a/docs/architecture/repository-layout.md +++ b/docs/architecture/repository-layout.md @@ -355,3 +355,8 @@ Keep release, signing, CODEOWNER, merge-queue, and trusted-main controls intact. Help assembly and its contracts live in `internal/app/`: root flag descriptions, feature help content, flag groups, and admin setup guidance are configured there in the existing order. Rendering remains in `internal/clihelp/`. + +Optional first-run shell setup admission lives in `internal/app/`, alongside +invocation. Its existing terminal checks, synchronous audio command traversal, +argument copy, single-worker limit, and 250 ms foreground wait are unchanged. +Image shell installation mechanics remain in `internal/commands/images/`. diff --git a/pkg/custom/audio_first_run_review_test.go b/internal/app/audio_first_run_review_test.go similarity index 99% rename from pkg/custom/audio_first_run_review_test.go rename to internal/app/audio_first_run_review_test.go index 16ce0cbd..1b1a8671 100644 --- a/pkg/custom/audio_first_run_review_test.go +++ b/internal/app/audio_first_run_review_test.go @@ -1,4 +1,4 @@ -package custom +package app import ( "context" diff --git a/pkg/custom/audio_skip_setup_test.go b/internal/app/audio_skip_setup_test.go similarity index 99% rename from pkg/custom/audio_skip_setup_test.go rename to internal/app/audio_skip_setup_test.go index 117310f5..ac45974d 100644 --- a/pkg/custom/audio_skip_setup_test.go +++ b/internal/app/audio_skip_setup_test.go @@ -1,4 +1,4 @@ -package custom +package app import ( "context" @@ -31,7 +31,7 @@ func audioFirstRunTestRoot() *cli.Command { Flags: []cli.Flag{&cli.BoolFlag{Name: "all", Hidden: true}}}, }} requestconfig.ConfigureRootFlags(root) - registerAudioCommands(root) + audiocommands.RegisterLocal(root, audiocommands.LocalOptions{}) root.Command("audio").Command("history").Aliases = []string{"past"} return root } diff --git a/pkg/custom/image_first_run_admission_test.go b/internal/app/image_first_run_admission_test.go similarity index 99% rename from pkg/custom/image_first_run_admission_test.go rename to internal/app/image_first_run_admission_test.go index c539702b..f09cc33d 100644 --- a/pkg/custom/image_first_run_admission_test.go +++ b/internal/app/image_first_run_admission_test.go @@ -1,4 +1,4 @@ -package custom +package app import ( "context" diff --git a/pkg/custom/image_picker_first_run.go b/internal/app/image_picker_first_run.go similarity index 99% rename from pkg/custom/image_picker_first_run.go rename to internal/app/image_picker_first_run.go index 65796711..ffe28028 100644 --- a/pkg/custom/image_picker_first_run.go +++ b/internal/app/image_picker_first_run.go @@ -1,4 +1,4 @@ -package custom +package app import ( "context" diff --git a/internal/app/run.go b/internal/app/run.go index cbfb1972..7223c71a 100644 --- a/internal/app/run.go +++ b/internal/app/run.go @@ -51,7 +51,7 @@ func Run(ctx context.Context, argv []string) int { custom.ConfigureCommandErrors(app) if err == nil { - custom.SetupImagePickerShellOnFirstRun(ctx, argv, app) + SetupImagePickerShellOnFirstRun(ctx, argv, app) err = custom.RunWithOutputPolicy(ctx, app, func(ctx context.Context) error { return runWithRequestConfiguration(ctx, app, args, completing) })