Kleidos API Search

In development. It changes without notice.

AGENTS.md — Kleidos bench meter

Rules for anyone, person or agent, changing this repository. The repository's README says what the instrument is, how it is built, flashed and wired; the SCPI command set is its protocol.

What this repository is

  • The instrument, not the measurements. The firmware of the INA228 bench meter, its schematic and wiring, its bill of materials, its calibration procedure, records and registry, its SCPI command set and a host client. The measurements are taken by the Kleidos firmware repository's QA harness (qa/tools/power_campaign.py, MeterLink) and filed in that repository's power store (qa/measurements/power/); results are copied wherever they are needed from there. Never file a measurement here, and never move the power store here.
  • Public with the rest of the organization, on the owner's word, as one commit; its private history is not carried over.
  • Licenses (owner, 2026-11-19): the firmware, the host software and the documents are GPL-3.0-or-later; the hardware design files (hardware/: the KiCad schematic, its generator, its renders, the BOM) are CERN-OHL-S-2.0. Both are OSI-approved. Every file names its copyright holder and its license: two SPDX lines in its own header, the copyright (year and holder's name, no e-mail) directly above the license identifier, or, for a file that cannot hold a comment (a license text, the generated schematic and its renders, a calibration record), an explicit entry in REUSE.toml, which has no catch-all. reuse lint, the quality kit's header check and python3 scripts/check_spdx.py (pre-commit and CI; --fix adds a missing copyright line) must pass. Never add a Creative Commons license to anything of ours.

The calibration registry is the calibration

  • calibration/ holds the calibration of every instrument, versioned (calibration/README.md): configurations, instruments and their append-only events, records, and the generated index.json. What the instrument keeps in its flash (a record of the calibration record log, from FW-16; an NVS blob before) is a working copy; the Kleidos QA harness reads the registry at a pinned commit, never the instrument. A correction is a new event and a new record, never an edit: the check holds each filed record to its hash.
  • python3 scripts/check_calibration_registry.py (pre-commit, scripts/run_tests.sh, CI) must pass, and --write regenerates index.json after any change to a configuration or an instrument.
  • No real instrument serial is tracked (owner, 2026-11-27): a serial (firmware/src/identity.h) is a digest of the MAC, so the bench instrument is KM-0000000000 everywhere (tests/ci/test_instrument_serials.py); nor are the MAC, the port or the USB serial.

The protocol is a contract

  • The SCPI command set is normative. A change to a command, a response, a report key, an error number or a stream record changes that page, the host client (host/kleidos_meter/), its simulator and its tests in the same commit, and is announced to the Kleidos QA harness, which speaks the protocol on its own (MeterLink and its fakes in qa/tests/tools/meter_sim.py).
  • The command table is the command set (FW-30): kCommands in firmware/src/console.cpp is its one definition, each entry with its refusals (D, R, C) and the most parameters it takes (takes( n ); an entry that names no count takes none), and nothing lists the headers by hand. scripts/scpi_table.py reads it; tests/firmware/test_scpi_doc_matches_table.py holds docs/scpi.md's command reference to it header for header, and the host tests' sweep (firmware/test/native/test_sweep.cpp) runs every entry, so a new command needs its row on the page and its fixture in the sweep (the testing guide). The native bridge (make -C firmware/test/native bridge) answers it on standard input and output. The simulator answers as the firmware does (FW-31): host/kleidos_meter/sim_table.py copies the table, held to it row for row through scripts/scpi_table.py, and the conformance suite (host/tests/conformance.py, run by scripts/run_tests.sh on the simulator and on the bridge) requires the same keys, forms and error codes of both (of the pin map and the averaging, every byte), so a change to a report or a refusal changes the simulator in the same commit.
  • Report keys keep the device's integer units in their names (_na, _pv, _uohm, _mc, _us). A key is never renamed or given another unit: a new meaning is a new key.
  • The TEXT stream record (METER t=<us> ch=<ch> v=<value>) is the one recorded meter.log files hold; it does not change.
  • Every refused unit queues exactly one error and changes nothing; later units of the message still run.
  • Versions (the changelog, "The version rule"): a new command, key, error, record or observable behavior is a minor version, a fix nobody sees on the wire a patch, a removal a major; a changed meaning is not allowed. The change bumps firmware/version.txt and its copies (host package, simulator, host-test harness) and adds its changelog entry in the same commit, and the version is tagged v<version> (annotated, signed) once that commit is on main. tests/firmware/test_versioning.py holds the version, its copies and the changelog together.

The pin map

The GPIOs of the five roles (the INA228's SDA, SCL and ALERT, Relay 1, Relay 2) are data the instrument stores and the panel changes (0.18.0; “The pin map” in the SCPI command set, the firmware's architecture §2.7):

  • The table is the board. firmware/board/pins.toml describes the carrier pin by pin; scripts/gen_pin_table.py writes both copies, firmware/src/pin_table.h and host/kleidos_meter/board_pins.json, with one digest, and --check (pre-commit, scripts/run_tests.sh) holds them: never edit a copy.
  • A role or a rule changes everywhere in one commit: pins.toml, pinmap::validate() (firmware/src/pinmap.h), the vectors it prints (firmware/test/native/golden/pinmap.vectors), its Python port (host/kleidos_meter/pins.py), its JavaScript one (host/kleidos_meter/panel/static/js/pins-math.js) and the SCPI command set. A new digest makes every stored record read as none.
  • An apply proves before it saves, and puts the last good map back with exactly one 117 when the proof fails. A relay's pad proves nothing: a map that moves one reads verified=0 until a null path passes its check; what the DUT's current shows at rest (a lead opened or a bypass closed by a wrong active level, from 2 mA) puts the map back like a failed proof (reason=rest).
  • Recovery needs no I2C: no role takes the console's UART, and SYSTem:PINS:DEFault needs no INA228.

Firmware

  • ESP-IDF only (framework = espidf), no Arduino, no third-party device library. The toolchain is pinned in firmware/platformio.ini and the pins and the strict warning set are guarded by tests/firmware/test_project_pins.py. Compiler and linker warnings are errors, as the compiler is actually told: ESP-IDF gives every component -Wno-error= and -Wno-<warning> flags that a later -Werror does not undo, so build_src_flags answers each by name, and -Wl,--fatal-warnings is on the link (firmware/CMakeLists.txt). tests/firmware/test_effective_compile_flags.py reads the compile database (pio run --project-dir firmware -e meter -t compiledb, never a verbose build) and CMake's link command; CI's firmware job runs it after the build with METER_BUILD_REQUIRED=1, which turns a build guard's skip into a failure.
  • Build: pio run --project-dir firmware -e meter. On the Kleidos bench every pio command goes through that repository's scripts/pio-job (scripts/pio-job run --project-dir <this repo>/firmware -e meter), which serializes builds and uploads across checkouts. CI builds the image on every push and pull request (the firmware job of .github/workflows/check.yml), with the platform and the ESP-IDF package firmware/platformio.ini pins installed from the PlatformIO registry (pio pkg install --project-dir firmware -e meter, which fetches only what the meter's environment takes).
  • Flash only through the CH343 port, naming it (KLEIDOS_METER_PORT); the upload guard refuses anything else. The meter is the bench's to flash; a Kleidos board never is, from here.
  • Integer arithmetic for every value on the wire: no float in the measurement path, no locale.
  • Fixed-width integers, unsigned bit work (FW-23, MISRA C++:2023 6.9.2 and 7.0.5): firmware/src names std::int32_t, std::uint32_t, std::uint64_t or std::size_t, never int, unsigned, long or short (the few a printf format's arguments needed went with the formatter, FW-26); masks and bit positions are std::uint32_t, flag tests and field reads go through firmware/src/bits.h, and a literal that meets an unsigned operand carries its U. scripts/misra_register.py and scripts/misra_rules.py fail anything else (the MISRA record, "Held", D12).
  • No formatted output and no varargs (FW-24 to FW-26, MISRA C++:2023 21.10.1 and 30.0.1): every response, error, stream record and dump row is composed with the bounded writer of firmware/src/text.h (typed appends on std::to_chars, no format string, nothing allocated) through the console's typed members (openUnit(), respondText(), respondNumber(), respondScaled(), openRecord()/endRecord(), openError()/failText()), never snprintf, <cstdio>, <cstdarg> or a C ellipsis; and no array decays to a pointer (7.11.2: a buffer travels as a std::span, a character array as chars::untilNul()). scripts/misra_rules.py and clang-tidy's cppcoreguidelines-pro-type-vararg, cert-dcl50-cpp and cppcoreguidelines-pro-bounds-array-to-pointer-decay fail anything else, and the golden transcript (firmware/test/native/golden/console.transcript) holds every byte on the wire (the MISRA record, "Held", D3).
  • No dynamic memory in our code (0.7.0): FreeRTOS objects and task stacks are created over static storage (xQueueCreateStatic, xSemaphoreCreateBinaryStatic, xTaskCreateStaticPinnedToCore), the console runs on ESP-IDF's main task, which app_main() never leaves (FW-17: so nothing frees it) and whose stack and control block are static too (the review of 2026-11-24: ESP-IDF's startup tasks are linked wrapped onto static slots), buffers are static, and there is no new, delete, C or heap_caps allocator, smart pointer or standard container in firmware/src. The claim is allocs_since_main=0 frees_since_main=0 for every operation the SCPI table offers (FW-19). The source gate (tests/firmware/test_no_dynamic_memory.py), the object gate (scripts/check_heap_objects.py, CI), the reachability gate (scripts/check_heap_reachability.py, CI's firmware job, FW-19: the linked image's call graph, read with pyelftools from the relocations the device link keeps, -Wl,--emit-relocs, from every own function to any allocator, each ROM function reached and each edge cut listed with its reason, tests/firmware/test_heap_reachability_gate.py), the host tests' every-command session (firmware/test/native/test_heap.cpp kEveryCommand, both counts 0 after each message, held to every header of the command table by tests/firmware/test_heap_session_covers_the_table.py) and the device's own counts (DIAGnostic:HEAP?, heap_monitor.h: from FW-07 every allocation from ESP-IDF's startup on, split at app_main()'s first line, where from FW-17 the 0.7.0 steady state starts too, and from which the required count is zero, the boot included) hold it; what ESP-IDF still allocates, all of it before app_main() (1 allocation, the C library's 4-byte environ, and no free, from the review of 2026-11-24, which linked ESP-IDF's IPC and main tasks, its flash locks (five queues from ESP-IDF 6.1.1) and its system interrupts wrapped onto static slots and the firmware's own interrupt router; 16 and 4 from FW-18, which took PSRAM out of the heap, linked PSA's initialization and the idle tasks' memory wrapped onto static answers in firmware/src/startup_memory.h, and arms the brownout detector itself in firmware/src/brownout.h), is listed row by row in the MISRA record (D1, which tests/bench/test_bench_support.py holds to heap_expectations.toml; the maintenance operations' deviation went with the last of them in FW-16, and the register names none), held by one deny list of allocating ESP-IDF entry points, one allow-list of the calls we still make (empty since FW-16, and from FW-17 absent from the host harness, which fails any listed call not made safe) and one made-safe list of the calls the image's configuration takes the allocation out of (FW-16: the calibration log's esp_flash_write() and esp_flash_erase_region(), whose region check is linked wrapped onto a static table; and its esp_flash_read(), whose port refuses a destination outside internal RAM, which ESP-IDF would read through a heap bounce buffer), in three copies kept equal by tests/firmware/test_idf_allocation_lists.py (the source gate's, the object gate's and the host harness's ledger, firmware/test/native/harness/idf_ledger.h, which fails a host test whose code calls one on neither list; the allow-list only shrinks, the deny list only grows, and each made-safe call's mechanism is held in the tree); the object gate's --elf leg fails an image holding operator new or delete, the C++ exception runtime or NVS (FW-16), or a PSA or mbedTLS function (FW-18: PSA's startup initialization is linked wrapped onto an answer that initializes nothing). The build holds only the firmware's component and what it requires (set(COMPONENTS src __pio_env) in firmware/CMakeLists.txt, FW-16): a component ESP-IDF builds can be linked by another's optional dependency, as NVS was through mbedTLS's PSA storage after the firmware stopped calling it, so a new requirement goes in firmware/src/CMakeLists.txt with its reason, and tests/firmware/test_meter_sdkconfig_reaches_the_build.py fails a build that holds NVS, a radio or a retired driver. Sites are named one by one by a census build (-DMETER_HEAP_CENSUS through PLATFORMIO_BUILD_SRC_FLAGS, read by scripts/heap_census.py). The bench suite (tests/bench, --run-bench, under the bench lock; docs/testing.md) holds the boot's counts and each command family's to tests/bench/heap_expectations.toml: a change that removes an allocation lowers that file in the same commit, and nothing raises it.
  • **The design is the firmware's architecture**, kept current: a change that makes a statement there false corrects it in the same commit. The first design is the design record of 0.1.0, frozen on 2026-11-22; nothing but it and the changelog cites its sections, and tests/firmware/test_no_stale_references.py fails on a citation anywhere else.
  • One core owns the I2C bus (0.16.5): every transaction is made on the core that opened the bus (Core 1, the sampler's). Until FW-14 that was where ESP-IDF's I2C master had its interrupt, and a NACKed transaction from the other core left a completion latched that the next one took for its own, ESP_OK and zeros (the firmware's architecture §2.2); from FW-14 the bus is the own I2C master, which refuses every call from the other core before it touches a register. Code reaches the bus only through Ina228Driver's transaction entries, which make the call in place there and route it through esp_ipc_call_blocking() from the other core, one transaction per call. The source gate (tests/firmware/test_i2c_on_bus_core.py) fails on a call into I2C master anywhere the routing does not own and on any call of ESP-IDF's I2C master, and the host harness fails every Bench case that reached I2C0's registers off the bus's core.
  • Interrupts are routed by our own code (FW-09): the ALERT pin's interrupt goes to a free level-1 line of Core 1, and UART0's (FW-12) to one of Core 0, through firmware/src/interrupt.cpp (the CPU's descriptor and handler tables, the interrupt matrix, nothing allocated), and the pin's interrupt type, enable and status are set at the register (ESP-IDF's hal/gpio_ll.h) in sampler.cpp alone (the firmware's architecture §5.1). No source calls ESP-IDF's interrupt allocator or its GPIO interrupt driver; tests/firmware/test_interrupt_routing.py holds both, and the host harness fails a case whose level interrupt its handler leaves pending.
  • ESP-IDF drivers are replaced, not wrapped (FW-10): where the zero-allocation work retires an allocating ESP-IDF driver, the firmware drives the peripheral through ESP-IDF's low-level layer (hal/*_ll.h, inline register access) with static state, polled where it can be, and the harness fakes the registers rather than the driver. The LED's RMT frame is the first (the firmware's architecture §8), and ESP-IDF's task watchdog the second: CONFIG_ESP_TASK_WDT_EN is off and firmware/src/watchdog.cpp runs Timer Group 0's MWDT itself, fed once the console, the sampler and Core 0's idle task have all checked in (FW-11, §5.1). The third is the console's UART: ESP-IDF's UART driver is gone, and firmware/src/uart0.cpp sets UART0 on its registers (hal/uart_ll.h), fills a static receive ring from an interrupt it routes itself, and writes by polling the FIFO (FW-12, §4.2). The fourth is the I2C master: firmware/src/i2c_bus.cpp drives I2C0 on its registers (ESP-IDF's hal/i2c_ll.h), each transaction polled to its end, the clock changed by rewriting the timing registers, nothing allocated (FW-13, §2.4), and the INA228's driver makes every transaction through it, a clock change included (FW-14). The fifth is NVS: the calibration is a record of the firmware's own append-only log over two 4 KiB sectors of the calib partition at 0x9000 (firmware/partitions.csv, firmware/src/flash_log.cpp and flash_port.cpp, §3.7), written through esp_flash_* from a static buffer with ESP-IDF's region check linked onto a static table that allows only those sectors and, from FW-03 (0.18.0), the pin map's second log of the same kind over two sectors of the pins partition at 0xB000 (firmware/src/pinmap_store.h) (-Wl,--wrap=esp_partition_is_flash_region_writable, CONFIG_SPI_FLASH_DANGEROUS_WRITE_ALLOWED), and a stored shunt outside 0.05..0.2 Ω is refused like a bad CRC, never clamped (FW-16); no migration from NVS, so the first boot of that image is q=uncal until kleidos-meter calibration restore. scripts/check_drivers_absent.py (CI's firmware job) fails an image whose link map holds any member of a retired component's archive (its RETIRED list, nvs_flash and nvs_sec_provider from FW-16); tests/firmware/test_drivers_absent_gate.py keeps every retired component out of the firmware's requirements and its sources' includes.
  • Serial-only, and the unused hardware parked (0.16.6, the owner's ruling of 2026-11-21): the NW-00 radio A/B failed (calibration/records/radio-ab-2026-11-21.md), so the meter never links Wi-Fi, Bluetooth, the PHY or coexistence, and its USB-Serial-JTAG is off in sdkconfig.defaults; the panel runs on the host over the cable (kleidos-meter serve, "The panel" below). scripts/check_radio_absent.py (CI's firmware job) fails an image that defines any of their symbols. Every broken-out GPIO the firmware does not use is parked at boot, an input with the internal pull-down, as the pin map the boot runs leaves it (pinmap::parkedSet(), from FW-04; the default map's set is firmware/src/relay.h kParkedPins, held equal by a static_assert), and the rules refuse a strapping, memory, UART0, USB or LED pin to every role (the firmware's architecture §9). No GPIO is named outside the pin map: main.cpp, relay.cpp and pin_boot.cpp take every pin from it, and nothing but the map's read precedes the relays' release (tests/firmware/test_meter_relays_fail_safe.py).
  • The measurement's hot path runs from IRAM (0.16.1): both cores share the flash cache, and code the sampler fetches from flash on Core 1 waits on Core 0's evictions, which with a radio lost up to 17 % of STATE's conversions (the firmware's architecture §5.2). A function or constant the loop or the ALERT handler reaches, the own I2C master's transactions included, is IRAM_ATTR / DRAM_ATTR (ours), or moved by sdkconfig.defaults (ESP-IDF's: FreeRTOS). scripts/check_iram_hot_path.py (CI's firmware job) walks the call graph from the objects' relocations and fails on anything it reaches in flash; a function deliberately left there goes in its COLD list with the reason no conversion runs it.
  • Formatted and analyzed: .clang-format is the Kleidos firmware repository's style (clang-format 23.1.5, pre-commit and CI), and scripts/run_static_analysis.sh runs clang-tidy (the quality kit's root .clang-tidy and the meter's own checks on top of it in firmware/.clang-tidy) over every source of firmware/src/CMakeLists.txt twice, as the device and as the host tests compile it, and cppcheck (.cppcheck-suppress) over the same sources, every finding an error. The analyzers' versions have one definition site, scripts/analysis_toolchain.sh; what the gate refuses to judge (exit 2) and its self-test are in “What runs” in the testing guide. A finding is fixed, or suppressed at its line with the reason beside it and an entry in the MISRA record, the register of what the firmware holds of MISRA C++:2023 and where it departs. A commit that only reformats is listed in .git-blame-ignore-revs.
  • Documented: every symbol of firmware/src carries a Doxygen comment, private class members, file-static functions and constants, anonymous-namespace symbols and function-local classes included, and every function a @brief, one @param[in|out] per parameter and @return or @retval; mkdir -p build && doxygen Doxyfile (Doxygen 1.18.0, pre-commit and CI) exits 0 only with zero warnings, undocumented symbols included, and scripts/check_doc_links.py then fails what Doxygen does not warn on (“What runs” in the testing guide). The public contract goes on the .h declaration and is never repeated on the .cpp definition, and so does a private member's, on its declaration in the class; a file-static or anonymous-namespace symbol is documented where it is defined, in its .cpp; each file joins its topic of docs/groups.dox with an @addtogroup wrap inside its namespace and names it with @ingroup in its @file block; docs/firmware.dox is the reference's front page and docs/README.md that of the site every Markdown page joins, linked in GitHub's form (“The documentation site” in the testing guide). The house style is the Kleidos firmware's, with no coverage baseline.
  • The firmware is tested on the host as it is built (docs/testing.md): its sources compile unchanged against the fake ESP-IDF of firmware/test/native/harness/, on a simulated board. A change to the firmware comes with the tests that show its decisions: the report's gate refuses an MC/DC condition left uncovered without a written reason in firmware/test/native/mcdc_exclusions.toml.
  • One image (0.8.0 and later): meter, which drives the shunt bypass on the MikroE Relay 2 Click (active high on GPIO15) and the lead on the HW-316's K1, the rig as wired (rev D). The meter_relay2 image of 0.3.0 to 0.7.0 drove the same rig and the registry accepts both names for it (calibration/README.md); an image older than 0.8.0 named meter drove the HW-316 bypass and must not run on this rig (docs/relay2-click-wiring.md).
  • New source files start with the same two SPDX lines the others carry (GPL-3.0-or-later; CERN-OHL-S-2.0 under hardware/); the version lives in firmware/version.txt and is bumped by the version rule above.

Before you commit

scripts/run_tests.sh (every test and the report) and pre-commit run --all-files (every hook) are the two every change runs; the testing guide lists every gate with its command.

One CI run per ready head: iterate as a draft (its Check job fails on purpose), run the local gates, mark it ready when they pass, push again only if something must change. A ruleset requires Check on main: fast-forward a head only once its ready run made Check green (the testing guide).

The panel

kleidos-meter serve (host/kleidos_meter/panel/) is the panel on the PC; the panel's guide says how it is used and the HTTP API's reference what it answers. These hold whatever is changed in it:

  • The sole opener of the port. It opens the port exclusively, every message goes through its one executor, and whoever else needs the line meanwhile comes in through the passthrough, one client at a time, byte for byte. The panel never reaches the meter any other way, and the firmware has no command, session or lock for it.
  • It never changes FORMat, and never sends *RST. The host parses the stream in the format it finds (TEXT, the default); format is declared writable=False, and only a person at the console or a passthrough client changes it.
  • It hands the instrument back as it found it. What it found is a snapshot of the settings that shape a capture, taken at the start; what it changed that differs is written back and read back on the way out and before the line is lent. A window it did not open is never closed, a sequence's cleanup always runs and leaves path=shunt, and no order carries FORCe or LIVE that a person did not give: a sequence that needs FORCe asks first. A new setting the panel writes is declared in SETTINGS, which is also what it restores.
  • The pin map is never restored on the way out: it is the board's wiring, in no snapshot and not in SETTINGS; only an Apply, a Defaults or a passthrough client changes it.
  • Its data stays outside every repository. Runs go to the data directory, refused inside a git work tree, and a shunt override beside it; nothing a run holds is committed here or filed anywhere but by the Kleidos harness.
  • Its SCPI is held to the firmware's table. host/kleidos_meter/panel/schema.py is the one declaration of the settings, the relay orders, the sequences and the routes: the API dispatches on it, the page draws its controls from it, and a test holds every header and flag it names to kCommands. A route, a sequence or an argument that changes changes it, its contract (host/tests/test_panel_contract.py), the panel's guide and, by python3 scripts/gen_http_api_doc.py, docs/http-api.md (never edited by hand) in the same commit: host/tests/test_panel_doc.py fails otherwise, and runs the page's simulator examples.
  • Unauthenticated, so on the loopback. It binds 127.0.0.1 unless --allow-remote says otherwise, a GET never changes the instrument, and a change carries X-Kleidos-Meter: 1. No route may weaken a guard of host/kleidos_meter/panel/guards.py.
  • No third-party script, no build step. The page is plain ES modules of this package, and nothing it loads is another origin's.

The schematic

  • hardware/rig.kicad_sch and its project files are generated by hardware/gen_rig.py, and rig.pdf, rig.svg and rig-calibration.svg (sheet 2, the shunt's calibration) by hardware/export_rig.py in KiCad 10.0.8's container; CI holds both to their bytes. The drawing follows the Kleidos KiCad style, owned by the brand repository and copied as hardware/kicad/ (held to KIT.json): never edit the copy; change brand, run its tools/sync_kicad.py --copy, generate and export again. ERC allows no message; the netlist must stay EXPECTED in export_rig.py unless the wiring on the bench changes, and then both change in the same commit with a new revision in gen_rig.py.

Organization rules

The rules every kleidos-dev repository shares are the organization rules: read them before changing anything here.

Conventions

  • **The documentation's front page indexes the documents, and the usage guide is the one a user follows.** A new page in docs/ is listed in the index in the commit that adds it (tests/firmware/test_docs_index.py). Every command of the usage guide was run and its output is real: the --sim ones are compared by host/tests/test_usage_doc.py, so a change to what they print changes the page in the same commit, and the panel's page likewise (host/tests/test_panel_doc.py). The command line's reference and the Python API's reference are generated (scripts/gen_cli_doc.py from the parsers, scripts/gen_python_api_doc.py from the docstrings) and never edited by hand: a change to a subcommand, an option, an exit status (the module's EXIT_STATUS), a public signature or a docstring writes them again in the same commit, and host/tests/test_cli_doc.py and host/tests/test_python_api_doc.py fail otherwise. A new subcommand goes in cli.SUBCOMMANDS with its example in the generator, and every public name of the host package has a docstring (the host package's README, "Docstrings"). The README's quick start is held the same way; its layout draws every file of firmware/src, every page of docs/ and every top-level entry (tests/firmware/test_readme.py), and a settled question is struck with its date and the link to its record.
  • English in code, comments, docs and commit messages; Markdown prose is never hard-wrapped (one line per paragraph and per list item).
  • Commit messages: signed, imperative subject of at most 72 characters with no final period, a blank line, body wrapped at 72, no attribution lines: the quality kit's kleidos-commit-msg hook checks each commit, and its quick workflow every commit of a pull request. Never --no-verify, never force-push.
  • A skip in CI names where the test runs instead (FW-31, SKIPS in scripts/test_report.py, tests/ci/test_skips.py): any other skip fails the report's gate, and what the run itself built never skips (METER_BRIDGE_REQUIRED, METER_BUILD_REQUIRED, METER_BROWSER_REQUIRED). Every module of the host package has a branch floor in host/branch_floors.toml that only rises (tests/ci/test_host_floors.py); a new module gets its floor in the commit that adds it. The page's pure modules have theirs in host/js_floors.toml (CI's panel job). Every mutant is killed: the host's (host/mutants/) in every run, the firmware's (scripts/mutants/) by hand and before a release; new code brings its own (“Mutants” in the testing guide).
  • CI follows the organization's CI convention (job names "<emoji> <description>", stages cheapest first through needs:, path filters in the What changed job, under which a change to any script, test or Doxygen input a filtered job reads runs that job (tests/ci/test_changes_filter.py), a superseded run cancelled, every action pinned to a commit); tests/ci/test_workflow_convention.py holds check.yml and the advisory codeql.yml and security.yml to it.
  • The Kleidos quality kit runs here by name (kleidos-dev/.github, @v3; owner, 2026-11-24): check.yml calls its quick.yml (the policy checks, every pre-commit hook on every file, reuse and the header lines, gitleaks over the history, the commit messages) and its check.yml (mypy strict in the three groups of pyproject.toml, OSV-Scanner), and ends with the Check job, the required check, which the kit holds to its model; nothing of the kit is held but its base configurations (.github/quality/SOURCE.json) and the waivers (.github/quality/waivers.toml, each weakening with its reason). Its hooks and the canonical third-party hooks are the first of .pre-commit-config.yaml, at the kit's release; the quick job skips the ones this repository runs in jobs of its own, and tests/ci/test_lint_gates.py names the job that runs each. The spelling locale is en-us; a word goes into .typos.toml only with the reason it is not a typo.
  • Private bench data (port names, USB serials, MACs, host names) never enters a tracked file; gitleaks (.gitleaks.toml, pre-commit and CI) fails a port name with a USB serial in it, a USB serial number as macOS prints it, and a MAC address.

Back to the top