Skip to content

Scala keyword families: closures and bitwise_ops count only their own construct (Part of #8863, #9332) - #9361

Merged
squid-shepherd[bot] merged 3 commits into
mainfrom
churn/9332-20261126T0148Z
Nov 26, 2026
Merged

squid-shepherd[bot] merged 3 commits into
mainfrom
churn/9332-20261126T0148Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #8863. Refs #9332 (does not close it: five cells are not measurable on the pin).

Checklist: partial [c:4fe6001e] -- the five unpinned cells (regex_execution, thread_sleeps, io, time_date_logic, debug_prints) are measurable only on kafka and are left as sibling gaps

What changed

Scala has 7 red cells. Two are on the pinned language-crucible v1.9.0 (575 Scala functions); five are pinned: false (scored on kafka only, so no number can be quoted from the pin). The two pinned cells now pass:

Cell Before (pin) After (pin) Cause
closures recall 1.00, precision 0.797 (349 vs 278 functions) recall ~0.975, precision ~0.989 (274 vs 278) counted every =>: case arms, def/type header arrows, name: A => B parameter types, and _ in patterns
bitwise_ops precision 0.20 (20 fire vs 4) recall 1.00, precision 1.00 (4 vs 4) counted | in case A | B and [a|b] text, a stripMargin bar, and &/^/~ without operands

closures now counts one match per line holding an anonymous-function arrow (not case, not a header or parameter type), plus _ only in argument or operator position. bitwise_ops needs operands on both sides of & ^ << >>, spaces around | (outside case lines unless after an if guard), and ~ only as a unary operator. Other Scala cells did not move (args 0.97, struct_branch 0.94). The whole Scala row was re-read.

Class / Sibling gaps

The class is "a Scala family rule counts a token that also has a non-family use". Siblings, with status:

  • Unpinned, left unchanged, kafka-only: regex_execution, thread_sleeps, io, time_date_logic, debug_prints. io and debug_prints are over-counts and the three recall misses may need a contract question on Epic: keyword-family validity -- do the per-function signals measure what their names say? #8863. A headless worker files no issue; the reviewer should.
  • Known residuals in the rules just changed: val Some(_) = opt still counts _ as a placeholder; a function-typed val f: A => B = ... line still counts; a|b without spaces is not counted; a mid-line { case A | B => alternative is not excluded. Counting is per line now, so counts differ from per-match counting.

Family-validity checklist

  • Oracle checked first (tree-sitter spec, pinned crucible); whole row re-read
  • Baseline diffed per language: only Scala's cells differ from main (main merged in; the unrelated Python io drift was kept out)
  • Tests: tests/extraction/languages/test_scala_family_validity_9332.py (positive and negative forms); test_scala_strict.py and test_scala.py pass
  • Golden masters re-blessed with golden-lock.sh crucible_check.py --update --yes; drift is Scala closure/bitwise counts and the archetype aggregates they feed
  • keyword-rosetta verify_language.py scala: PASS (88 assertions) on base and branch, so no rosetta:rebless-owed
  • CPU, data/scala, user seconds, base 4.25 / 4.52 / 4.55 vs branch 4.16 / 4.41 / 4.44 (no regression)
  • pr_gates --fast 9/9, --ratchets 9 pass

Remaining slices

The five unpinned cells above, once they have a pinned corpus or a contract ruling.

Lessons for agents

  • A baseline regenerated on top of a moving main shows other languages' drift: load HEAD's file and replace only cells['<lang>'].
  • Main moving mid-PR re-conflicts every golden file; merge main, take main's goldens, and re-bless rather than hand-resolving.
  • A bare (?m) in a joined alternation breaks the scan; use (?m:...).

Cross-repo

No companion PR. keyword-rosetta verify_language.py scala passes on this branch, so nothing re-runs there. Merge order: none.

🤖 Generated with Claude Code

squid-protocol and others added 3 commits November 25, 2026 21:13
… construct (Part of #8863, #9332)

closures no longer counts case arms or function-type arrows; bitwise_ops needs
operands on both sides and skips pattern alternatives. Pinned crucible:
closures precision 0.797 -> 0.989, bitwise_ops precision 0.20 -> 1.00.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
# Conflicts:
#	docs/self_scan/family_validity_chart.svg
#	tests/golden_master_audit/12_scan_output_snapshots/gpu_json.json
#	tests/golden_master_audit/2_global_ecosystem_summary/file_composition_distribution.json
#	tests/golden_master_audit/2_global_ecosystem_summary/function_archetype_distribution.json
#	tests/golden_master_audit/2_global_ecosystem_summary/summary.json
#	tests/golden_master_zero_dep_audit/12_scan_output_snapshots/gpu_json.json
#	tests/golden_master_zero_dep_audit/2_global_ecosystem_summary/file_composition_distribution.json
#	tests/golden_master_zero_dep_audit/2_global_ecosystem_summary/function_archetype_distribution.json
#	tests/golden_master_zero_dep_audit/2_global_ecosystem_summary/summary.json
@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 02:26
@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) November 26, 2026 02:28
@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