Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
180 commits
Select commit Hold shift + click to select a range
6715b24
Lab: set up lab/main, the base for lab builds (#92)
dayfine Oct 31, 2026
52fb02b
Merge origin/main into lab/main
dayfine Nov 1, 2026
0e737fb
Settings: default audio display and collapsed console settings (#99)
dayfine Nov 1, 2026
877cee4
Merge origin/main into lab/main (#83)
dayfine Nov 1, 2026
cd2a04a
Merge origin/main into lab/main (#104)
dayfine Nov 1, 2026
7d6712e
Lab control folder: start/stop the selected program from scripts (#76)
dayfine Oct 30, 2026
b30fb26
Lab control folder: a README for the files and their protocol
dayfine Nov 1, 2026
bc834a8
Command File Runner: a developer program driven by text command files
dayfine Nov 1, 2026
557e5ec
Skills: the console-iteration dev loop, with the Command File Runner …
dayfine Nov 1, 2026
e280a48
Lab scripts: the console lock, Lab Control and Command File Runner fr…
dayfine Nov 1, 2026
8f2441d
Skills: make the console-iteration loop program-agnostic
dayfine Nov 1, 2026
21e2ce3
Command File Runner: expose its command table for the lab channel
dayfine Nov 1, 2026
bec4aee
Lab channel: one request folder per app, replacing the lab control fo…
dayfine Nov 1, 2026
00b35e8
Lab channel: select a program and set its options from a request
dayfine Nov 1, 2026
7483b96
Lab channel: the owner lock and keepawake
dayfine Nov 1, 2026
ac5ea4b
Lab channel: one README for the files, the commands and a worked run
dayfine Nov 1, 2026
7f99715
Merge remote-tracking branch 'origin/lab/tooling' into lab/tooling-ch…
dayfine Nov 1, 2026
7ea0326
Lab scripts: speak the lab channel
dayfine Nov 1, 2026
c004be6
Lab scripts README: the claim's journal line is line 2, after the own…
dayfine Nov 1, 2026
4151709
Command File Runner: std::format for log and error lines
dayfine Nov 1, 2026
842ef8b
Lab channel: drop LabControl.md
dayfine Nov 1, 2026
322e754
Merge lab/tooling (#107) into lab/main
dayfine Nov 1, 2026
8459564
Lab channel: a refused start or stop is a journal error
dayfine Nov 1, 2026
9c150c1
Lab channel: "set" takes the JSON as written; '#' inside a string is …
dayfine Nov 1, 2026
9c4b56f
Lab channel: start from MainWindow only when Lab/ exists, as a pool task
dayfine Nov 1, 2026
e35c859
Lab commands: screen-only commands don't wait for the controller
dayfine Nov 1, 2026
566ede8
lablock.sh: a lock being written is not stale
dayfine Nov 1, 2026
c23466d
Skill: how to use it, and one step of any program
dayfine Nov 1, 2026
e275c27
Skills: make CFR verification explicit in the console iteration loop
dayfine Nov 1, 2026
94be4fd
Skills: scope console iteration examples to their game and task
dayfine Nov 1, 2026
8d13713
Merge lab/tooling review fixes into lab/main
dayfine Nov 1, 2026
5c26218
Lab channel: start the console's inference threads for each command
dayfine Nov 1, 2026
a45c82b
Merge origin/main into lab/main
dayfine Nov 1, 2026
7f993e3
Merge origin/base/upstream-main into lab/tooling
dayfine Nov 1, 2026
315f4f8
Design: an MCP server for agents to run and develop programs over the…
dayfine Nov 1, 2026
bd2e96e
Design: agent integration as one lab CLI; MCP an optional thin wrappe…
dayfine Nov 1, 2026
ba405cf
Lab channel: popups lists the app's message boxes, popups close press…
dayfine Nov 1, 2026
6c5451a
Lab channel: popups compiles (QPushButton include)
dayfine Nov 1, 2026
fed71d6
Merge origin/main into lab/main
dayfine Nov 2, 2026
e177edc
Merge origin/base/upstream-main into lab/tooling
dayfine Nov 2, 2026
035acb2
Merge origin/lab/tooling into design/agent-integration
dayfine Nov 2, 2026
2b3eac8
Lab: start waits for the controller; state shows controller=
dayfine Nov 2, 2026
0eba3a1
Merge lab/tooling into design/agent-integration
dayfine Nov 2, 2026
04f6521
Replace the USE_QT_UI global with use_qt_ui()
dayfine Nov 3, 2026
e06d70e
Add SerialProgramsTests, a unit test runner without the GUI
dayfine Nov 3, 2026
c1f27b6
Merge origin/main into lab/main
dayfine Nov 3, 2026
ee20fdc
Merge origin/main into build/use-qt-ui-accessor
dayfine Nov 3, 2026
43edf27
Merge origin/build/use-qt-ui-accessor into build/headless-tests
dayfine Nov 3, 2026
ad6aa40
SerialProgramsTests: address review (span filters, namespaces, docs)
dayfine Nov 3, 2026
c213cac
Unit test runner: blank lines around unit_test_names()
dayfine Nov 3, 2026
6cf3cdb
Add SerialProgramsTests for running unit tests without the GUI
dayfine Nov 4, 2026
d5d34b8
Use structured bindings for filtered unit test entries
dayfine Nov 4, 2026
0f9d232
Handle empty test selections before listing or running
dayfine Nov 4, 2026
006d547
Drop the --list option from SerialProgramsTests
dayfine Nov 4, 2026
b9548df
Merge origin/main into lab/main
dayfine Nov 4, 2026
0910e0f
Merge origin/main into build/use-qt-ui-accessor
dayfine Nov 4, 2026
e8d97ba
Merge origin/build/use-qt-ui-accessor into build/headless-tests
dayfine Nov 4, 2026
c75bfb1
Merge origin/base/upstream-main into lab/tooling
dayfine Nov 4, 2026
037924c
Merge origin/lab/tooling into design/agent-integration
dayfine Nov 4, 2026
32f9003
Lab: reject unsafe startup and isolate native test launches (#233)
dayfine Nov 6, 2026
f369bf0
Merge origin/main into lab/main
dayfine Nov 6, 2026
3a00943
Merge origin/main into build/use-qt-ui-accessor
dayfine Nov 6, 2026
f66d3c3
Merge origin/build/use-qt-ui-accessor into build/headless-tests
dayfine Nov 6, 2026
58af96a
Lab: seed isolated profiles and validate staged app identity (#236)
dayfine Nov 6, 2026
83dec64
Lab: enforce device ownership before hardware opens (#237)
dayfine Nov 6, 2026
61f361a
Remove unused Qt UI accessor from standalone test runner
dayfine Nov 7, 2026
1f0edf0
Merge upstream main and retain test runner alongside Python bindings
dayfine Nov 7, 2026
f5ed406
Merge origin/upstream/headless-tests (SerialProgramsTests) into lab/main
dayfine Nov 8, 2026
68ecbf8
Lab: merge lab/tooling into lab/main (lab commands start inference th…
dayfine Nov 8, 2026
036a05e
Lab devices: a refusal names the device it refused (#257)
dayfine Nov 8, 2026
1d428e6
Command File Runner: hold buttons with stick, walk and dpad
dayfine Nov 10, 2026
a2608d7
Merge pull request #317 from dayfine/lab/cfr-held-buttons
dayfine Nov 10, 2026
16baf42
Merge origin/base/upstream-main into lab/tooling
dayfine Nov 10, 2026
a023591
Merge origin/lab/tooling into design/agent-integration
dayfine Nov 10, 2026
356aa15
Merge build/headless-tests (#207) into lab/main
dayfine Nov 11, 2026
aa5a927
FRLG: remove tests for navigation behavior (#1896)
theastrogoth Nov 12, 2026
4024a63
FRLG Egg RNG: accept lower advances for the held frame (#1897)
theastrogoth Nov 12, 2026
8958cda
Command-line test runner: filter tests by name substring (#1895)
pa-devbot Nov 12, 2026
213e996
Home simplify exit menu (#1873)
Dalton-V Nov 12, 2026
5220644
Home - StorageView (#1900)
Dalton-V Nov 12, 2026
d914382
Home - Box number reader (#1901)
Dalton-V Nov 12, 2026
14cf718
Recover the boss from the summary when header read is not a boss (#1894)
dayfine Nov 13, 2026
e5b3172
Support different game languages (#1904)
Dalton-V Nov 13, 2026
8d67694
Home - Detect Selection Hand (#1903)
Dalton-V Nov 13, 2026
72de561
Sockets: add a per-connection id to server socket sends (#1910)
pa-devbot Nov 13, 2026
73fecab
FRLG Box Sorter - BallReader (#1908)
Dalton-V Nov 13, 2026
39f94a9
FRLG SpriteReader fixes and tests (#1913)
theastrogoth Nov 13, 2026
02118eb
More FRLG Ball Reader Tests (#1914)
Dalton-V Nov 14, 2026
cf011f6
HttpServer: add a minimal Qt-free HTTP/1.1 server (#1879)
pa-devbot Nov 14, 2026
e961bf4
Start of PageView Detector (#1911)
Dalton-V Nov 14, 2026
db53d19
Design: MCP lab server shaped by the week's incidents
dayfine Nov 14, 2026
8cf5938
Expand agent integration design and rollout plan
dayfine Nov 14, 2026
7a2da8f
Design: fit the lab server to the existing locks, hooks and repo rules
dayfine Nov 14, 2026
9f5fdc7
Design: record the 2026-11-14 decisions (fork-only, declared precheck…
dayfine Nov 14, 2026
90509c9
Lab channel: write Lab/state.json for the lab server (#131 Slice 1)
dayfine Nov 14, 2026
629bfde
Lab channel: snapshot command for a frame newer than the call (#131 S…
dayfine Nov 14, 2026
5c32c74
Design: settle the open questions and the implementation review
dayfine Nov 14, 2026
c97618b
Merge pull request #131 from dayfine/design/agent-integration
dayfine Nov 14, 2026
ba5e19f
MgbaLink: connection and video source for mGBA (lab slice 1)
dayfine Nov 14, 2026
753eff4
MgbaLink: code health (case tables, namespace comments, header docs)
dayfine Nov 14, 2026
06d50dd
MgbaLink tests: split registration by table
dayfine Nov 14, 2026
3ee6891
Lab state: forget the last transition when the panel changes
dayfine Nov 14, 2026
bd6f9f7
MgbaLink: review fixes (clock, dead bridge, abort, single-use open)
dayfine Nov 14, 2026
d9bbbed
Merge pull request #481 from dayfine/lab/observation-seam
dayfine Nov 15, 2026
5087514
Agent-Integration: Slice 7b retires CFR
dayfine Nov 15, 2026
3fa53bf
Merge pull request #499 from dayfine/design/retire-cfr
dayfine Nov 15, 2026
a468cd0
Lab channel: document the inbox/outbox transport and its alternatives
dayfine Nov 15, 2026
1d3d6a9
MgbaLink: opt out of the no-video watchdog again; log a bad frame siz…
dayfine Nov 15, 2026
3409f94
Merge lab/tooling into lab/mgba-slice1
dayfine Nov 15, 2026
5101913
Merge pull request #493 from dayfine/lab/mgba-slice1
dayfine Nov 15, 2026
42ca61e
Merge pull request #501 from dayfine/lab-transport-alternatives
dayfine Nov 15, 2026
2af92d6
MgbaLink: key schedule, input log and Pro Controller key map (slice 2)
dayfine Nov 15, 2026
bc1c2aa
Lab: describe_program and game_open commands
dayfine Nov 15, 2026
72e4867
Lab contract: free keyed_options(), game_open verdict in its own file…
dayfine Nov 15, 2026
dc8c240
CommandFileRunner.h: drop a stray blank line
dayfine Nov 15, 2026
0d30871
MgbaLink: GRANT pacer and mGBA Pro Controller (slice 2b)
dayfine Nov 15, 2026
b5e83cc
Lab: close the Slice 1 gaps (shot worker, transition source, state.js…
dayfine Nov 15, 2026
90e18b8
Lab: code health (helper for the start record, transition filter besi…
dayfine Nov 15, 2026
c00b1af
Merge pull request #503 from dayfine/lab/mgba-slice2
dayfine Nov 15, 2026
392abf6
Merge remote-tracking branch 'origin/lab/tooling' into lab/slice4b
dayfine Nov 15, 2026
276a942
ProgramSession: one helper ends the run, so run_program() keeps its l…
dayfine Nov 15, 2026
624a14a
Merge remote-tracking branch 'origin/lab/tooling' into lab/mgba-slice2b
dayfine Nov 15, 2026
d87a8ac
MgbaLink: re-anchor the controller clock across LOAD and RESET
dayfine Nov 15, 2026
f1d8983
Merge pull request #504 from dayfine/lab/slice4b
dayfine Nov 15, 2026
d0a42b8
MgbaLink: build the descriptor and selector widget in SerialProgramsL…
dayfine Nov 15, 2026
140ca70
Merge branch 'lab/mgba-slice2b' into lab/mgba-reanchor
dayfine Nov 15, 2026
f6d01a5
MgbaLink tests: a later state ends at +14, not +15
dayfine Nov 15, 2026
7f6de24
Merge branch 'lab/mgba-slice2b' into lab/mgba-reanchor
dayfine Nov 15, 2026
0e5dbd2
Merge pull request #506 from dayfine/lab/mgba-slice2b
dayfine Nov 15, 2026
42e9c2d
Merge pull request #508 from dayfine/lab/mgba-reanchor
dayfine Nov 15, 2026
a5b451f
Merge pull request #507 from dayfine/lab/slice1-gaps
dayfine Nov 15, 2026
9ef885e
Lab channel: Slice 7b is option B, test the console command gate
dayfine Nov 15, 2026
19922bd
Merge pull request #509 from dayfine/lab/cfr-retire-b
dayfine Nov 15, 2026
b72cd77
Lab: describe_program lists the program's prechecks
dayfine Nov 15, 2026
a5f921c
Merge pull request #511 from dayfine/lab/slice-4
dayfine Nov 15, 2026
deff563
Lab: preflight runs a program's start checks without starting it
dayfine Nov 16, 2026
e707e71
Home Replace non calibrated tests (#1917)
Dalton-V Nov 16, 2026
d7bdd1c
Lab: ProgramSession::Prechecks holds the precheck list and the checks…
dayfine Nov 16, 2026
fe662b6
Lab: user hold - the lab channel refuses presses and starts while the…
dayfine Nov 16, 2026
266a1a0
Merge upstream #1913 into lab/tooling: FRLG WildEncounterReader test …
dayfine Nov 16, 2026
8ad0026
Merge lab/tooling into lab/app-preflight (upstream #1913: FRLG test f…
dayfine Nov 16, 2026
07aa01c
Merge lab/app-preflight into lab/user-hold (upstream #1913: FRLG test…
dayfine Nov 16, 2026
d3b3a1e
Merge upstream main into lab/tooling
dayfine Nov 16, 2026
6687fb4
Merge lab/tooling (upstream main) into lab/app-preflight
dayfine Nov 16, 2026
18777ad
Merge lab/app-preflight into lab/user-hold
dayfine Nov 16, 2026
9bc8e6a
Lab preflight: stage and restore options on the UI thread; keep a use…
dayfine Nov 16, 2026
77377b0
Merge remote-tracking branch 'origin/lab/app-preflight' into lab/user…
dayfine Nov 16, 2026
d5f26ae
Merge pull request #601 from dayfine/lab/app-preflight
dayfine Nov 16, 2026
958025a
Merge remote-tracking branch 'origin/lab/tooling' into lab/user-hold
dayfine Nov 16, 2026
f6146ba
Lab preflight: put the options back after a panel change, and reply
dayfine Nov 16, 2026
ee101da
Merge pull request #616 from dayfine/lab/mcp-followups
dayfine Nov 16, 2026
79519ac
Merge pull request #608 from dayfine/lab/user-hold
dayfine Nov 16, 2026
8804814
MgbaLink: PA_MGBA_LINK=1 offers the mGBA Link controller and video so…
dayfine Nov 17, 2026
0d7a2bc
ControllerSession: add the status listener outside m_state_lock
dayfine Nov 18, 2026
8da7692
docs: rework headless CC design against lab/main and address review
dayfine Nov 19, 2026
8fffda0
docs: address re-review (macOS scope, readiness, ownership, leases)
dayfine Nov 19, 2026
cd86fe3
Merge pull request #657 from dayfine/lab/headless-cc-design
dayfine Nov 19, 2026
d65712c
PanelCatalog: extract widget-free catalog and load_panel_session() (P…
dayfine Nov 19, 2026
a76e8ff
PanelCatalog: free functions instead of a catalog class (review)
dayfine Nov 19, 2026
ce1636d
docs: Headless-CC names the PanelCatalog free functions
dayfine Nov 19, 2026
87d8957
Merge pull request #660 from dayfine/lab/panel-catalog
dayfine Nov 19, 2026
3a76d5f
HeadlessHost: add --headless --run one-shot runner (PR 2)
dayfine Nov 19, 2026
fbed013
HeadlessHost: fix CoreLib placement, test types, and code-health checks
dayfine Nov 19, 2026
7b55ff0
code-health: split helpers and remove char*[] parameter
dayfine Nov 19, 2026
f52f606
code-health: pass QApplication& to run_headless_application
dayfine Nov 19, 2026
3312187
HeadlessHost: address PR #669 review (RAII SignalPipe, StartupDialogs…
dayfine Nov 19, 2026
9626443
code-health: move signal globals into function-local static and extra…
dayfine Nov 19, 2026
782e70e
Merge pull request #650 from dayfine/lab/mgba-link-optin
dayfine Nov 19, 2026
647bf18
HeadlessHost: implement download_added and all_downloads_done in Head…
dayfine Nov 19, 2026
a160a29
HeadlessHost: trim boilerplate in implementation and tests
dayfine Nov 19, 2026
084ad8c
Merge pull request #669 from dayfine/lab/headless-run
dayfine Nov 19, 2026
2806e45
Merge remote-tracking branch 'origin/lab/main' into lab/sync-main-to-…
dayfine Nov 19, 2026
5cc8572
HeadlessHost: pass ActionSource::CLI to start_program/stop_program
dayfine Nov 19, 2026
b539824
HeadlessHost: guard STOP_TIMEOUT under !defined(_WIN32)
dayfine Nov 19, 2026
5bff44a
LabHold_Tests: default-initialize Observation fields to std::nullopt
dayfine Nov 19, 2026
cecc522
LabProgramContract_Tests: default-initialize ProgramInput::prechecks …
dayfine Nov 19, 2026
e2ac0ee
Merge pull request #673 from dayfine/lab/fix-labhold-tests-init
dayfine Nov 19, 2026
76148ba
Merge remote-tracking branch 'origin/lab/tooling' into lab/sync-update
dayfine Nov 19, 2026
af0610f
CommandLineTests.h: match lab/main 1-arg run_command_line_tests decla…
dayfine Nov 19, 2026
e6c63e6
Merge pull request #671 from dayfine/lab/sync-main-to-tooling
dayfine Nov 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/code-health.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: C++ Code Health
# Stub: the linter (devtools/code_health) and its self-tests live on the fork's agents branch.
# This checks that branch out next to the code and runs it against the code checkout.
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
inputs:
base-ref:
description: Revision to compare with (e.g. origin/main); empty = whole tree
required: false

permissions:
contents: read

jobs:
code-health:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: actions/checkout@v7
with:
repository: dayfine/Arduino-Source
ref: agents
path: .agents-tools
- uses: actions/setup-python@v6
with:
python-version: '3.11'
cache: pip
cache-dependency-path: .agents-tools/devtools/code_health/requirements.txt
- run: python -m pip install -r .agents-tools/devtools/code_health/requirements.txt
- name: Linter self-tests
working-directory: .agents-tools
env:
CODE_HEALTH_REPO: ${{ github.workspace }}
run: python -m unittest discover -s devtools/code_health/tests -v
- name: Check changed C++ files
working-directory: .agents-tools
env:
PR_BASE: ${{ github.event.pull_request.base.sha }}
INPUT_BASE: ${{ inputs.base-ref }}
PUSH_BASE: ${{ github.event.before }}
CODE: ${{ github.workspace }}
shell: bash
run: |
base="${PR_BASE:-${INPUT_BASE:-$PUSH_BASE}}"
if [[ -z "$base" || "$base" == 0000000000000000000000000000000000000000 ]]; then
base=$(git -C "$CODE" hash-object -w -t tree --stdin </dev/null)
fi
python -m devtools.code_health --root "$CODE" --base-ref "$base" --github
27 changes: 24 additions & 3 deletions .github/workflows/cpp-ci-serial-programs-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -251,14 +251,14 @@ jobs:
# The unit tests assume the downloadable resources they need are already downloaded
# (see Packages/Resources/ResourceDownloadList.json). Unzip them from the Packages
# checkout into where the program looks for them, DOWNLOADED_RESOURCE_PATH():
# the working directory on Windows/Linux, and ~/Library/Application Support/SerialPrograms
# on macOS.
# the working directory on Windows/Linux, and ~/Library/Application Support/SerialPrograms/Profiles/unit-tests
# on macOS (the isolated test profile).
- name: Install downloadable resources for tests
if: inputs.run-tests
shell: bash
run: |
if [[ "${{inputs.os}}" == mac* ]]; then
DOWNLOADED_RESOURCES="$HOME/Library/Application Support/SerialPrograms/DownloadedResources"
DOWNLOADED_RESOURCES="$HOME/Library/Application Support/SerialPrograms/Profiles/unit-tests/DownloadedResources"
else
DOWNLOADED_RESOURCES="Arduino-Source/SerialPrograms/bin/DownloadedResources"
fi
Expand Down Expand Up @@ -289,6 +289,27 @@ jobs:
cd Arduino-Source/SerialPrograms/bin
./SerialPrograms --command-line-test-mode

- name: Reject unsafe lab launches (Mac)
if: startsWith(inputs.os, 'mac') && inputs.run-tests
shell: bash
run: |
cd Arduino-Source/SerialPrograms/bin
binary=./SerialPrograms.app/Contents/MacOS/SerialPrograms
expect_rejection() {
local status=0
"$binary" "$@" || status=$?
if [[ "$status" != 2 ]]; then
echo "Expected startup rejection (2), read $status"
exit 1
fi
}
expect_rejection --test bdsp
expect_rejection --profile
expect_rejection --profile ../lab-A
expect_rejection --command-line-test-mode --profile lab-A
# CI's default build has no PA_LAB_PROFILE: unprofiled relaunch must fail.
expect_rejection

- name: Run tests (Mac)
if: startsWith(inputs.os, 'mac') && inputs.run-tests
run: |
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/lab-device-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Lab device ownership
on:
pull_request:
workflow_dispatch:
jobs:
native-leases:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
- uses: jurplel/install-qt-action@v4
with:
version: '6.10.2'
cache: true
- run: cmake -S SerialPrograms/Source/CommonFramework/Devices -B build-lab-devices -DCMAKE_BUILD_TYPE=Debug
- run: cmake --build build-lab-devices --config Debug -j4
- run: ctest --test-dir build-lab-devices -C Debug --output-on-failure
21 changes: 21 additions & 0 deletions .github/workflows/lab-instance-tools.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Lab instance tools
on:
pull_request:
paths:
- 'devtools/lab/**'
- 'SerialPrograms/cmake/LabBuildReceipt.cmake'
- 'SerialPrograms/CMakeLists.txt'
- '.github/workflows/lab-instance-tools.yml'
workflow_dispatch:
jobs:
offline-preparation:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v6
with:
python-version: '3.12'
- run: python3 -m unittest discover -s devtools/lab -p 'test_lab_instance.py' -v
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,7 @@ build_*/
.cache/*
Packages/*


# Local agent/linter environments.
.venv-code-health/
__pycache__/
5 changes: 5 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ migrate a file to the wrappers when you're already touching it and it's straight
Windows/Linux; `~/Library/Application Support/SerialPrograms/DownloadedResources` on macOS).
- Headless Linux: `QT_QPA_PLATFORM=offscreen` and
`TESSDATA_PREFIX=<bin>/Resources/Tesseract`.
- `SerialProgramsTests` (built by default next to `SerialPrograms`; `-DTEST_RUNNER_EXE=OFF`
turns it off) runs the same tests without the GUI, settings or device scans, so it can run
while SerialPrograms is open: `ninja SerialProgramsTests`, then
`SerialProgramsTests --filter <text>` (repeatable) or `--list`. Its exit code is the number
of failed tests. Same requirements as above.
- Test framework: test classes derive `UnitTest` (`Common/Cpp/TestRunners/UnitTest.h`) and are
collected via per-module `add_tests(UnitTestDatabase&)` — see
`SerialPrograms/Source/Tests/CommandLineTests.h`.
Expand Down
9 changes: 5 additions & 4 deletions Common/Cpp/Filesystem/Filesystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#ifndef PokemonAutomation_Filesystem_Filesystem_H
#define PokemonAutomation_Filesystem_Filesystem_H

#include <string_view>
#include <cstdint>
#include <vector>
#include "FilePath.h"
Expand Down Expand Up @@ -115,11 +116,11 @@ Path application_install_path();
Path application_scratch_path();


// Set a profile for program settings (/UserSettings/PROFILE_NAME/) on MacOS.
// Have to run the program with command-line argument "open -n PATH_TO_APP --args --profile PROFILE_NAME" to set the profile and launch a new window.
// This allows multiple instances of the program to run since settings are no longer shared.
#if defined(__APPLE__)
void set_startup_profile(int& argc, char* argv[]);
// Set a validated macOS settings profile before any settings paths are cached.
// GUI launch uses --profile NAME or the build-bound PA_LAB_PROFILE identity.
void set_startup_profile(std::string_view profile);
// Return the identity used for the window title and scratch directory.
const std::string& STARTUP_PROFILE();
#endif

Expand Down
19 changes: 3 additions & 16 deletions Common/Cpp/Filesystem/Filesystem_Mac.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,9 @@ namespace Filesystem{

static std::string g_startup_profile;

void set_startup_profile(int& argc, char* argv[]){
for (int i = 1; i + 1 < argc; i++){
if (strcmp(argv[i], "--profile") == 0){
std::string profile = argv[i + 1];
for (char c : profile){
if (!(std::isalpha(c) || std::isdigit(c)) && c != u'_' && c != u'-') c = u'_';
}
g_startup_profile = std::move(profile);
// Shift everything after --profile <name> down by 2.
for (int j = i; j + 2 < argc; j++){
argv[j] = argv[j + 2];
}
argc -= 2;
return;
}
}
// Store the already-validated identity before any scratch/settings path is cached.
void set_startup_profile(std::string_view profile){
g_startup_profile = profile;
}

const std::string& STARTUP_PROFILE(){
Expand Down
Loading