Repository navigation
Lab: reject unsafe startup and isolate native test launches - #233
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Base:
lab/main. Mechanical prerequisite: fork PR #234, merged into this branch without rewriting published history. No AutoStory feature parents. The base-relative diff still includes #234 until that change reacheslab/main.A mistyped test command (
--test bdsp) could launch the GUI, and a macOS relaunch without--profilecould restore the live app's default controller settings. Existinglab/mainalso discovers serial ports and cameras before checking test mode.The revised implementation separates:
StartupArguments: parse before Qt/settings/devices, preserve documented Qt options, and dispatch exclusively to GUI or tests. With no lab adapter, no arguments still mean ordinary GUI startup.LabStartupPolicy: require an explicit macOS lab profile or select the identity compiled withPA_LAB_PROFILE; reject conflicts. No-argument relaunches of bound binaries select the correct profile, and unbound lab builds fail closed.Validation: 40 native cases (16 general grammar/Qt compatibility, 24 lab policy/dispatch) pass locally with Apple Clang C++23 and warnings as errors; code health passes against
origin/lab/main. The initial Ubuntu CI caught incorrect source paths; those are fixed in a separate commit. Fresh macOS, Windows Clang and Ubuntu builds/native suites are dispatched for the revised head. macOS CI also checks invalid executable invocations. No console or app deployment was performed.How to review
StartupArguments.h/.cppand its generic tests, thenLabStartupPolicy.h/.cppand its separate tests.Main.cppafter the mechanical prerequisite:For the full diff with moved lines distinguished:
Startup design and upstream sequence documents the examples and exact boundary: reuse PokemonAutomation#1845 for upstream test lifecycle, prepare general validation separately, preserve release defaults/Qt options, and keep profile requirements on lab branches. No pending headless-runner code is imported here.
Profiles do not enforce physical serial-device ownership; a lease before port open remains separate work. After merge, lab integration branches merge
origin/lab/main; upstream-bound feature branches never merge lab tooling.Code-health dependency: #235 fixes baseline matching for namespace moves and namespace comments after metatype macros. This C++ revision passes the updated linter; canonical CI requires that tooling PR to merge into
agentsfirst.