Skip to content

Lab: preflight command and options hash (app side of Slice 5b) - #601

Draft
dayfine wants to merge 1 commit into
lab/toolingfrom
lab/app-preflight
Draft

dayfine wants to merge 1 commit into
lab/toolingfrom
lab/app-preflight

Conversation

@dayfine

@dayfine dayfine commented Nov 16, 2026

Copy link
Copy Markdown
Owner

The lab server's preflight_program (#600) had no app command to call. This adds the channel command `preflight JSON`: the program session stages the given options (unknown keys, clamped or disabled values and `check_validity()` are refused), runs the program's start checks without starting it while Start is blocked, loads the prior options back and prints one line, `preflight {JSON}`, in the reply format of the fake app in #600 plus an `options_hash` field. A program supplies its checks by overriding `run_switch_prechecks()` next to `precheck_summaries()`; none does on this branch yet, so every preflight answers `unsupported` until FRLG RNG's list (#485) arrives. `Lab/state.json` gains `program.options_hash`, the SHA-256 of the program's option JSON (the same canonical form the server's Python produces). New unit tests in ProgramPrecheckRun, LabProgramContract and LabStateJson; touched files compiled locally, nothing run on a console.

The channel's "preflight JSON" stages the given options on the program
session (ProgramSession::run_prechecks_only()), runs the program's
prechecks (ConsoleProgramInstance::run_prechecks(); Switch programs
override run_switch_prechecks()) under a scope that makes Start refuse
meanwhile, loads the prior options back and prints one line,
"preflight {JSON}": the verdict, each check, the refused option and
whether the options were restored. Lab/state.json gains
program.options_hash, the SHA-256 of the program's option JSON, also in
the reply. No program declares runnable checks on this branch yet, so
every preflight says "unsupported" until FRLG RNG's list (#485) arrives.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant