Skip to content
5 changes: 4 additions & 1 deletion docs/family_oracle_readings.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Per-language readings that differ from the shared sentence:
| Ruby | `\|\|=` and `&&=` count under `short_circuit`; `rescue` / `ensure` are handlers, not branches (corollary 1) | aligned |
| Kotlin, Swift | conjunction and disjunction nodes count under `short_circuit` | aligned |
| Scala | a `case` clause under a `catch` is a handler, not a decision (corollary 1) | aligned |
| C++ | `std::cout <<` / `std::cerr <<` / `clog <<` chains count as one `debug_prints` (and no `bitwise_ops`); `cin >>` as one `io`; `catch` is a handler, not a branch (corollary 1); no `closures` oracle | aligned |
| C++ | `std::cout <<` / `std::cerr <<` / `clog <<` chains count as one `debug_prints` (and no `bitwise_ops`); `cin >>` as one `io`; a `<<` chain holding a string literal is a stream insertion, never `bitwise_ops`; `(Type)&x` (tree-sitter reads it as a binary `&`) is a cast, not `bitwise_ops`; member `.` / `->` calls, qualified socket verbs and `std::bind` are not `io` (#9335); `catch` is a handler, not a branch (corollary 1); no `closures` oracle | aligned |
| shell | `&&` / `\|\|` list chaining counts under `short_circuit` | aligned |

The non-Python `branch` cells in `tests/family_validity_baseline.json` were measured before this realignment and there is no
Expand All @@ -82,6 +82,9 @@ Ruled 2026-11-24 (#8862, closed): `assert` is not an abort; `doc` is the structu

1. Does `comprehensions` include generator expressions? The oracle counts them until ruled (the contract's "inline iteration form" may cover them; `lazy_evaluation` excludes them, which is a different family).
2. Is `??` (and `??=`) a `short_circuit` operator in C# and PHP? Until ruled it counts under `branch`.
Also pending, C++ `decorators` (#9335): is `[[maybe_unused]]` on a local variable declaration inside a function an attribute "on the function"? The
contract says an attribute attaches to the declaration it precedes, so the rule counts it; the oracle reads only attributes on the
function itself. Two functions on the pinned crucible; the cell stays red on the oracle side until ruled.

Answered, no longer open: the `llm_api` absence entries (a rule only for python, javascript and typescript; every other
language is a stated absence, #9275, `### llm_api stated absences` in `docs/unplanted_family_contracts.md`).
496 changes: 247 additions & 249 deletions docs/self_scan/family_validity_chart.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 8 additions & 7 deletions docs/self_scan/family_validity_matrix.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 35 additions & 5 deletions gitgalaxy/standards/language_standards/languages/cpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,8 @@
r"\b(std::fstream|std::ifstream|std::ofstream|std::filesystem|fopen|fread|fwrite|socket|recv|send|asio::|curl_easy_perform|std::cin)\b"
# #8868 libc/POSIX transfer calls, call form only; member calls and longer names stay out.
r"|(?<![.>\w])(?:fgets|fputs|fgetc|fputc|mmap|pread|pwrite|recvfrom|sendto|recvmsg|sendmsg)[ \t]{0,4}\("
# #9335 a capitalised class's static open (`FileAccess::open(`, `DirAccess::open(`): a file or directory handle.
r"|\b[A-Z]\w{2,40}::open[ \t]{0,4}\("
),
# 10. api (Public Surface Area)
# Code exposed to the world. Explicit visibility and module exports.
Expand Down Expand Up @@ -656,7 +658,9 @@
re.M,
),
# 19. decorators (Decorators / Annotations)
"decorators": re.compile(r"\[\[\s*[" + ID_START + r":][^\]]*\]\]"),
# #9335: `[[fallthrough]];` / `[[likely]];` stand alone as a statement and attach to no declaration; an
# attribute that precedes a declaration or statement is not followed by `;`.
"decorators": re.compile(r"\[\[\s*[" + ID_START + r":][^\]]*\]\](?![ \t]*;)"),
# 20. generics (Generics / Type Parameters)
"generics": re.compile(r"\btemplate\s*<[^>]*>|\b(?:concept|requires)\b"),
# 21. comprehensions (Iterators / Comprehensions)
Expand Down Expand Up @@ -795,13 +799,39 @@
+ r"]"
),
# 41. panics_and_aborts (Error Exits: raise/throw/abort)
"panics_and_aborts": re.compile(r"\b(throw|abort|exit|_Exit|quick_exit|std::terminate|longjmp)\b"),
# #9335: process-exit names count in call form (`exit(1)`, `std::abort()`), never as a bare identifier or a
# member call (godot's `bool exit = false;`, `while (!exit)`, `span.exit()`); `exit` takes no space before `(` so prose in a
# string (`"leaked at exit (run with"`) is not a call; `throw` and `std::terminate` stay keywords.
"panics_and_aborts": re.compile(
r"\bthrow\b|\bstd::terminate\b|(?<![.>\w])(?:(?:abort|_Exit|quick_exit|longjmp)[ \t]*\(|exit\()"
),
# 42. thread_sleeps (Sleeps & Timed Waits: a call that blocks the thread or forces a delay)
# Admission of race conditions or lazy polling.
"thread_sleeps": re.compile(r"\b(sleep|delay|usleep|nanosleep|std::this_thread::sleep_for)\b"),
# #9335: call form, so `"--frame-delay"` and a `delay` variable are not sleeps; `Sleep` / `SleepEx` (Win32) and
# `thrd_sleep` are the same call under another spelling.
"thread_sleeps": re.compile(
r"(?<![.>\w])(?:sleep|usleep|nanosleep|Sleep|SleepEx|thrd_sleep|delay)[ \t]*\("
r"|\bsleep_(?:for|until)[ \t]*\("
),
# 43. bitwise_ops (Bitwise Operations)
# Low-level byte manipulation. CRITICAL: Removed bare `<<` and `>>` to prevent catastrophic false positives on `std::cout` and `std::cin` streams. Explicit bitwise assignments (`<<=`, `&=`) are retained as they are unambiguous.
"bitwise_ops": re.compile(r"\^|(?<![=!])~|<<=|>>=|&=|\|=|\^="),
# Low-level byte manipulation. A bare `<<` / `>>` is a stream insertion or a template close far more often than a
# shift, so (#9335) a shift counts only beside a numeric or ALL_CAPS operand with no string literal against the
# operator; `&` / `|` count only against a numeric mask or an ALL_CAPS flag (a bare `T &x` is a reference, `a | b`
# between lowercase names is not told from a lambda or a stream). `~` is a complement only after an operator, never a
# destructor name. `^` and the compound assignments are unambiguous.
"bitwise_ops": re.compile(
r"\^"
r"|(?:(?<![-:])[=(,&|^+*/%<>?!]|\breturn\b)[ \t]*~"
r"|<<=|>>=|&=|\|="
r"|\b\d[\w']{0,20}[ \t]*<<(?![=<])"
r"|<<(?![=<])[ \t]*(?:\d|[A-Z][A-Z0-9_]{2,}\b)"
r"|>>(?![=>])[ \t]*(?:\d|[A-Z][A-Z0-9_]{2,}\b)"
r"|[\w)\]][ \t]*&(?![&=])[ \t]*(?:\d|[A-Z][A-Z0-9_]{2,}\b)"
r"|\b[A-Z][A-Z0-9_]{2,}[ \t]*&(?![&=])[ \t]*[\w(]"
r"|\b(?:0[xX][0-9A-Fa-f]+|\d+)[ \t]*&(?![&=])"
r"|\b[A-Z][A-Z0-9_]{2,}[ \t]*(?<!\|)\|(?![|=])"
r"|(?<![|])\|(?![|=])[ \t]*(?:\w{1,40}::){0,3}[A-Z][A-Z0-9_]{2,}\b"
),
# 44. sync_locks (Resource Management & Stability)
"sync_locks": re.compile(
r"\b(mutex|lock|synchronized|Semaphore|std::lock_guard|std::scoped_lock|std::unique_lock|mtx_lock)\b",
Expand Down
Loading
Loading