The JSON ConfigTarget interface already exists end to end (the workbench posts {Props, Opts} to /api/config/apply), but the two halves speak different vocabularies: Props has name-based custom marshaling in the readback vocabulary, while Opts uses default struct marshaling with raw integer flag values, which the webui hand-mirrors in msg-flags.ts ("keep in sync" by hand). Any bit renumbering in configtarget.go silently corrupts webui requests.
Separately, satpulsetool gps predates gpshwtest and does not expose all of configtarget.go: SetStatic is hidden, NMEAMsgOther/RTCMMsgOther and unaligned time pulses are inexpressible, and --survey always sets SurveyAgain, so several model semantics cannot be exercised from the command line at all.
Plan in plan/config-target-json.md, two parts:
- Give the
ConfigOptions flag and enum types a name-based JSON vocabulary (arrays of names modeled on PropIDs, names derived from the model constants: timePulse, leapSecond, navData, ...; SaveType/ResetType as text enums), and flip the webui to send names in the same change.
- Add a hidden
--target-json argument to satpulsetool gps that accepts a whole ConfigTarget as JSON (inline or - for stdin), mutually exclusive with the config-shaping flags, policy-free, with ClearReadOnlyProps applied so a --show-config result feeds back verbatim.
Part 2 makes every configtarget.go semantic expressible without per-flag CLI work; see the closing section of gpshwtest-fixes.md for the semantics this unlocks for testing.
The JSON ConfigTarget interface already exists end to end (the workbench posts
{Props, Opts}to/api/config/apply), but the two halves speak different vocabularies:Propshas name-based custom marshaling in the readback vocabulary, whileOptsuses default struct marshaling with raw integer flag values, which the webui hand-mirrors inmsg-flags.ts("keep in sync" by hand). Any bit renumbering in configtarget.go silently corrupts webui requests.Separately,
satpulsetool gpspredates gpshwtest and does not expose all of configtarget.go:SetStaticis hidden,NMEAMsgOther/RTCMMsgOtherand unaligned time pulses are inexpressible, and--surveyalways setsSurveyAgain, so several model semantics cannot be exercised from the command line at all.Plan in
plan/config-target-json.md, two parts:ConfigOptionsflag and enum types a name-based JSON vocabulary (arrays of names modeled onPropIDs, names derived from the model constants:timePulse,leapSecond,navData, ...;SaveType/ResetTypeas text enums), and flip the webui to send names in the same change.--target-jsonargument tosatpulsetool gpsthat accepts a wholeConfigTargetas JSON (inline or-for stdin), mutually exclusive with the config-shaping flags, policy-free, withClearReadOnlyPropsapplied so a--show-configresult feeds back verbatim.Part 2 makes every configtarget.go semantic expressible without per-flag CLI work; see the closing section of gpshwtest-fixes.md for the semantics this unlocks for testing.