# Fails if any download-logic token appears under gui/src. Run as a ctest (see # tests/CMakeLists.txt). CLAUDE.md §3: "A grep for curl|pwrite|sqlite in gui/ must come # back empty." # # Invoked with -DGUI_SRC=. if(NOT DEFINED GUI_SRC) message(FATAL_ERROR "GUI_SRC not set") endif() file(GLOB_RECURSE sources "${GUI_SRC}/*.cpp" "${GUI_SRC}/*.hpp") # Word-ish boundaries so this file's own prose and e.g. "curly" do not trip it, and so a # comment mentioning the rule is fine but a real call is not. set(forbidden "curl_[a-z_]+" # libcurl "\\bpwrite\\b" # raw positioned writes — the transfer path, not the GUI "sqlite3?_[a-z_]+" # sqlite C API "QSqlDatabase" # or via Qt "QNetworkAccessManager" # the GUI talks to the daemon over QLocalSocket, nothing else ) set(hits "") foreach(file ${sources}) file(STRINGS "${file}" matched REGEX "(curl_[a-z_]+|\\bpwrite\\b|sqlite3?_[a-z_]+|QSqlDatabase|QNetworkAccessManager)") foreach(line ${matched}) string(STRIP "${line}" line) list(APPEND hits "${file}: ${line}") endforeach() endforeach() list(LENGTH hits n) if(n GREATER 0) string(REPLACE ";" "\n " pretty "${hits}") message(FATAL_ERROR "download-logic token(s) found under gui/src — CLAUDE.md §3:\n ${pretty}") endif() message(STATUS "gui/src is clean of download-logic tokens (${forbidden})")