From c41c72775611e62f373337d3c14a8eb62861b23a Mon Sep 17 00:00:00 2001 From: Mikkeli Date: Tue, 13 Oct 2026 22:50:03 +0900 Subject: [PATCH] topic check: gnss signals; a literal topic (yukart/gnss/fix) is not a signal Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01DDwfd6Ki8UfG4hK6W5YpJz --- README.md | 2 +- crosscheck.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8595bab..01dd35c 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ no network: plain Python over the tracked files. | Check | Source of truth | Catches | |---|---|---| | `decision` | project-yukart `docs/ARCHITECTURE.md`, decisions table | a decision number that does not exist; a line calling an Accepted decision proposed | -| `topic` | contracts `schema/topics.json`, `schema/signals.json` | a `yukart/...` topic matching no pattern; a vehicle or host signal that is not registered, or has the wrong source | +| `topic` | contracts `schema/topics.json`, `schema/signals.json` | a `yukart/...` topic matching no pattern; a vehicle, host or gnss signal that is not registered, or has the wrong source | | `docref` | the repos' own trees | `` `FILE.md` `` naming a file that does not exist; relative markdown links that do not resolve | | `binaries` | each repo's `Cargo.toml` and `deploy/*.service` | project-yukart `REPOS.md` missing a deployed binary; `ORIN-RUNTIME.md` missing a deployed service | | `frontmatter` | the docs convention | a `docs/**/*.md` without front matter, or with an unknown `type` | diff --git a/crosscheck.py b/crosscheck.py index daef056..80f7c1d 100644 --- a/crosscheck.py +++ b/crosscheck.py @@ -13,7 +13,7 @@ Exit status 1 when anything is found. Checks, and the source each one trusts: decision "decision N" names a row of project-yukart's decisions table, and a line calling it proposed does not contradict an Accepted row topic every yukart/<...> topic matches contracts' topics.json; concrete - vehicle and host signals exist in signals.json with that source + vehicle, host and gnss signals exist in signals.json with that source docref " `path.md`" names a file that exists in that repo; relative markdown links resolve binaries REPOS.md's row for a repo names every deployed [[bin]] in its Cargo.toml; @@ -138,7 +138,7 @@ def check_topics(ws: Workspace) -> None: topics = json.loads(ws.text("contracts", "schema/topics.json"))["topics"] signals = json.loads(ws.text("contracts", "schema/signals.json"))["signals"] patterns = [t.split("/") for t in topics] - sources = {"vehicle": {"obd2", "z27ag"}, "host": {"host"}} + sources = {"vehicle": {"obd2", "z27ag"}, "host": {"host"}, "gnss": {"gnss"}} for repo, rel, text in ws.each(): if (repo, rel) == ("contracts", "schema/topics.json"): continue @@ -156,6 +156,8 @@ def check_topics(ws: Workspace) -> None: if not any(topic_matches(segs, p) for p in patterns): find(f"{repo}/{rel}", n, "topic", f"'{m.group(0)}' matches no topic in contracts topics.json") continue + if "/".join(segs) in topics: + continue # a topic of its own (yukart/gnss/fix), not a signal if root in sources and len(segs) == 3 and "*" in segs[2]: glob = re.compile(re.escape(segs[2]).replace(r"\*", ".*")) if not any(glob.fullmatch(k) and v.get("source") in sources[root] for k, v in signals.items()):