Skip to content

Lua keyword families: bitwise_ops, thread_sleeps, io, regex_execution count the named construct (Part of #8863, #9339) - #9410

Merged
squid-shepherd[bot] merged 2 commits into
mainfrom
churn/9339-20261126T0519Z
Nov 26, 2026
Merged

squid-shepherd[bot] merged 2 commits into
mainfrom
churn/9339-20261126T0519Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #8863. Closes the #9339 checklist item.

Checklist: done [c:fa04726a]

What changed

All four red Lua cells on the pinned crucible (data/lua, 623 functions, v1.9.0) are now ok. Before and after:

Family Before After
bitwise_ops precision 0.52 (over-counts) precision 1.00, recall 0.95
thread_sleeps recall 0.00 (dead) precision 1.00, recall 1.00
io recall 0.50 (misses) precision 1.00, recall 1.00
regex_execution recall 0.74 (misses) precision 1.00, recall 0.99

Rule changes (lua.py):

  • bitwise_ops: ^ is exponentiation in Lua (xor is binary ~), so it is dropped. <<, >>, & and | now need an operand on both sides, so ">>> " log markers and "|" string separators no longer count.
  • thread_sleeps: adds loader.delay, socket.sleep, ngx.sleep, posix.sleep, posix.usleep and the posix.unistd.* forms.
  • io: adds io.tmpfile and file-handle method calls (f:read, f:write, f:lines, f:seek). io.stdout: and io.stderr: are skipped, since they are the console handles (print's).
  • regex_execution: adds method-form s:match(, s:gmatch( and s:gsub(, and s:find( only with a string-literal first argument.

Oracle changes (family_oracle_specs_b.py):

  • Lua ^ is no longer read as bitwise.
  • The Lua io list drops os.remove, os.rename (cleanup's) and os.tmpname (returns a name only).
  • loadfile is dropped from the io list: it is high_risk_execution's, and the rule does not count it as io either.
  • .read / .write / .lines / .seek count only as method calls (f:read), so pandoc.read and password.read no longer match.

Golden bless

golden-lock.sh crucible_check.py --update --yes. scope_check.py --expect lua attributes 517 differences to Lua; the other 128 are repo-wide rollup fields (file-composition and function-archetype counts shifting by one function). The golden diff is from the Lua rule changes only.

Class / Sibling gaps

Class: a Lua keyword-family rule counts a different construct (^ is exponentiation, not xor) or misses an idiomatic form of its own construct (method-call x:f() syntax, host-library sleep names), plus an oracle that reads io too broadly. All four members (bitwise_ops, thread_sleeps, io, regex_execution) are handled here, each with positive and false-positive cases in tests/test_lua_family_validity_8863.py. Sibling gaps: none. Every red Lua cell is handled.

No contract question filed: loadfile / dofile stay with high_risk_execution (existing rule), not io.

Notes

  • tests/family_validity_baseline.json was regenerated by the full sweep, so it also carries drift from main for other cells (Ruby doc and Lua args oracle count) that earlier PRs had not re-measured. Not caused by this change.
  • Gates: family_oracle_sweep.py --write, pr_gates.py --fast (9/9), pr_gates.py --ratchets (9 pass), audit_check.py (clear), pinned ruff format on touched files, the Lua strict and family-oracle tests.

🤖 Generated with Claude Code

… count the named construct (Part of #8863, #9339)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@squid-protocol

Copy link
Copy Markdown
Owner Author

Waiting on an owner decision (asked privately, 2026-11-26). Nothing is needed from contributors; work resumes once it is answered.

@squid-protocol

Copy link
Copy Markdown
Owner Author

The owner decided (2026-11-26); the bot applies it on its next tick.

…validity baseline and charts

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 21:56
@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) November 26, 2026 21:56
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol squid-protocol added shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md and removed shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md labels Nov 26, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot merged commit 862ba44 into main Nov 26, 2026
131 checks passed
@squid-shepherd
squid-shepherd Bot deleted the churn/9339-20261126T0519Z branch November 26, 2026 22:10
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