Skip to content

C keyword families: bitwise counts & and |, debug_prints console only, panics call form, io oracle reads stream/fs calls (Part of #8863) - #9367

Merged
squid-shepherd[bot] merged 3 commits into
mainfrom
churn/9334-c-families
Nov 26, 2026
Merged

squid-shepherd[bot] merged 3 commits into
mainfrom
churn/9334-c-families

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #8863. Checklist item [c:e86a22fb] of #9334.

What this does

Four of the five red C cells on the pinned crucible (language-crucible v1.9.0, 2599 C functions) now clear 0.8 on both recall and precision. Measured with family_oracle_sweep.py --write:

cell before (recall / precision) after
bitwise_ops 0.49 / - 0.986 / 0.965
debug_prints - / 0.60 0.953 / 1.0
panics_and_aborts - / 0.76 0.966 / 1.0
io - / 0.77 1.0 / 0.929

Causes, per cell:

  • bitwise_ops (rule misses a form): the rule counted <<, >>, ^, ~ and compound assignment but not binary & / |. Added operator-position arms (operand before, not && / ||, not address-of after return / ( / , / =).
  • debug_prints (rule counts another construct): fprintf / fputs to any FILE * counted. The contract is console output, so those now need stdout / stderr.
  • panics_and_aborts (rule counts another construct): bare exit / abort matched member names, identifiers and string text. Now call form only, not after ., > or a word character.
  • io (oracle too narrow): the rule was right; the tree-sitter oracle's C list lacked fputs, fputc, getline, getdelim, pread, pwrite, recvfrom, sendto, recvmsg, sendmsg, stat, rename. Fixed in family_oracle_ts.py; no rule change.

Contract question (not fixed here)

time_date_logic stays red, but it is a hatched cell (redis, not pinned). Recall is 1.00, precision 0.78: the rule counts the bare time_t type in declarations, which is not an invocation, while the contract also names duration arithmetic. Changing it needs a ruling on #8863: should a time_t declaration count? Not changed without one.

Class / Sibling gaps

Class: C keyword-family rules whose regex counts a neighbouring construct or misses an operator form. Sibling gaps found and not touched (one language per PR): cpp.py bitwise_ops (line ~804) has no & / | arm and its debug_prints (~758) likely counts any-stream fprintf the same way, so C++ probably shares the bitwise and debug_prints gaps; cpp.py time rule counts std::time_t (~849), the same question as C's time_t. Each needs its own measure against the pinned crucible before a fix.

Evidence and gates

  • New tests/test_c_family_validity_8863.py (54 tests): positive and false-positive lines per rule, a linear-time check on adversarial input, and the oracle io forms.
  • Goldens re-blessed through golden-lock.sh crucible_check.py --update --yes; scope_check.py attributes the drift to C-scanned files and repo rollups.
  • CPU A/B on crucible data/c, 3 alternating runs, user seconds: base 10.25 / 10.13 / 10.17, branch 10.18 / 10.18 / 10.20 (no regression).
  • audit_check.py: all clear. pr_gates --ratchets: 9 pass. pr_gates --fast: one failure, the stale family-validity SVGs, regenerated in this PR; the affected-test run covered 294 of 1101 files within its budget, the rest is left to CI.
  • keyword-rosetta verify_language.py c: 2 mismatches (a.c safety 2 vs 1, calls_out_to assert), the same with and without this change, neither in a family touched here. rebless.py c --dry-run refuses because the rosetta data/c/expected_signals.json does not round-trip its own formatting; no rosetta file was changed.

Not in this PR

Checklist: partial [c:e86a22fb] -- time_date_logic is a hatched cell, question for #8863

Lessons for agents

  • The crucible sweep scans all of data/ with --file-speed, so .c / .h files in other language directories count as C functions; trace misses through the sweep DB, not only data/c.
  • pr_gates --fast fails on stale docs/self_scan/family_validity_*.svg after any baseline rewrite: run family_validity_chart.py --write.

🤖 Generated with Claude Code

squid-protocol and others added 3 commits November 25, 2026 23:51
…ams only, panics call form, io oracle reads stream/fs calls (Part of #8863)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Nov 26, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot marked this pull request as ready for review November 26, 2026 05:11
@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) November 26, 2026 05:11
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant