topic check: gnss signals; a literal topic (yukart/gnss/fix) is not a signal
/ crosscheck (push) Successful in 1s
/ crosscheck (push) Successful in 1s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DDwfd6Ki8UfG4hK6W5YpJz
This commit is contained in:
+4
-2
@@ -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 "<repo> `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()):
|
||||
|
||||
Reference in New Issue
Block a user