fix(ci): apps/ contract JSON edits run the Python lane

_PY_SKIP includes apps/, so a change to apps/shared/src/gateway-events.json
(or apps/desktop/src/lib/desktop-slash-registry.json) alone classified as
python:false and tests/tui_gateway/test_gateway_event_contract.py — the
only side that checks emitters against the JSON — never ran. "Either side
drifting turns both red" was true locally and false in CI for that
direction. A table of cross-language contract files now forces python:true
alongside frontend; two classifier rows pin it (they fail without the
allowlist).
This commit is contained in:
teknium1
2026-09-12 23:57:42 -07:00
committed by Teknium
parent c1e0fd83f9
commit 956967fbdc
2 changed files with 21 additions and 1 deletions
+11 -1
View File
@@ -91,6 +91,16 @@ _PY_RELEVANT_SITE = (
"website/docs/",
"website/scripts/",
)
# Cross-language contract files: data committed under a frontend tree that a
# pytest pins against the Python side (emitter inventory, command registry).
# Editing only the JSON in an apps/-only PR would otherwise skip the one test
# that can catch the drift, so these force the Python lane too.
_PY_RELEVANT_CONTRACT_FILES = {
# tests/tui_gateway/test_gateway_event_contract.py
"apps/shared/src/gateway-events.json",
# tests/hermes_cli/test_desktop_slash_registry.py
"apps/desktop/src/lib/desktop-slash-registry.json",
}
# CI-sensitive files: eslint config, workflow files, composite actions.
# Changes here can influence what code the autofix job executes and pushes to
@@ -147,7 +157,7 @@ def _is_nix(p: str) -> bool:
def _py_irrelevant(p: str) -> bool:
if p.startswith(_PY_RELEVANT_SITE):
if p.startswith(_PY_RELEVANT_SITE) or p in _PY_RELEVANT_CONTRACT_FILES:
return False
return (
_is_docs(p)
+10
View File
@@ -99,6 +99,16 @@ CASES = {
_lanes(python=True, site=True),
),
"frontend → no uv_lock": (["apps/desktop/src/store/profile.ts"], _lanes(frontend=True)),
# Cross-language contract JSON under apps/: the pytest that pins it against
# the Python side must run even when nothing else in the PR is Python.
"gateway-events contract JSON → python + frontend": (
["apps/shared/src/gateway-events.json"],
_lanes(python=True, frontend=True),
),
"desktop slash-registry JSON → python + frontend": (
["apps/desktop/src/lib/desktop-slash-registry.json"],
_lanes(python=True, frontend=True),
),
# The published CIMD document is asserted about by the Python suite, so a
# lone edit there must not skip the lane that would catch a bad edit.
"cimd document → python + site": (