Repository navigation
feat(families): split boolean operators out of branch into short_circuit (leaf families, computed composites) - #8939
Conversation
…t_circuit family (Part of #8862, #8905) Eagle Eye (#8863) showed the broad families scoring worst because one name covered several things that languages spell and count differently. Decision (owner, 2026-11-21): narrow leaf families with one-sentence contracts, composites computed from leaves, one parser oracle per leaf (docs/family_levels.md). First split: `branch` -> `branch` (constructs and arms) + `short_circuit` (boolean operators); composite `decision_points = branch + short_circuit` (computed, not scanned). - New family `short_circuit` (column struct_short_circuit): signal contract, display name, schema comment, docs/short_circuit_rule_contract.md, branch contract corollary 0. - 45 language rules: boolean operators moved from `branch` to `short_circuit` with the same literal-shielding scope filter. Verified per function on 71,000+ functions of 15 repositories (express, curl, flask, Alamofire, AFNetworking, brew, impacket, exiftool, retrofit, okhttp, tokio, redis, vue, vapor, wordpress): old branch == new branch + short_circuit for every function. - Deliberate differences: negation (`not`, `-not`) leaves `branch` in lua, livecode, csharp, powershell (neither family); csharp gains `&&`/`||` (it counted only its `and`/`or` patterns; jellyfin moves up); zig counts `and`/`or` (its rule listed `&&`/`||`, which Zig lacks; supersedes #8937); nim drops try/except/finally from branch (#8926) and counts `and`/`or`; solidity, groovy and haskell gain a rule. - Tests that pinned the old definition now pin the new one. Keyword-rosetta verifier output is identical to main for all 34 languages that have a fixture. Goldens and the archetype models are NOT updated in this commit. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018srRvejJbzNR67xR3D2VxV
…ct doc Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018srRvejJbzNR67xR3D2VxV
…h + short_circuit (Part of #8862) Where the engine computes per-function and per-file decision density (magnitude, control-flow ratio, the function `branch`/`complexity` it exports, the file control-flow ratio, the signal processor's file cognitive inputs), read the composite instead of the narrowed leaf, so those metrics keep the meaning they had before boolean operators moved to `short_circuit`. The stored struct_branch / struct_short_circuit columns remain the two leaves. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018srRvejJbzNR67xR3D2VxV
…art of #8862) Regenerated with tests/tools/crucible_check.py --update --yes, after decision density was wired to decision_points = branch + short_circuit. What moved: the `struct_branch` column falls in the 36 languages whose rule counted boolean operators (those hits are the new `struct_short_circuit`, a new fixture part in each golden); csharp gains && / || (counted before only through its and/or patterns); zig counts and/or; nim drops handlers; metrics that read the stored leaf follow. Per-function complexity is unchanged outside C# (0 of 71,763 functions on 15 repositories); archetype assignments change for 0.27% of 78,325 functions. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018srRvejJbzNR67xR3D2VxV
|
No description provided. |
|
This PR conflicts with main, so no checks ran. Merge origin/main into it and regenerate generated files with their tools (never hand-merge them), then push. |
…and validity charts Resolved the generated golden-snapshot conflicts by taking main's files and re-running tests/tools/crucible_check.py --update --yes; the validity charts (docs/self_scan/family_validity_*.svg) regenerate with the new short_circuit family via family_validity_chart.py --write. Against main the PR is again only the family split, its goldens and the charts. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018srRvejJbzNR67xR3D2VxV
|
CI shepherd: the head of this PR (f94326d) is not the one a maintainer labelled |
|
No description provided. |
|
PR #8939 @ f94326d: 1 failed check(s) == rosetta-audit (failure) -- real |
… split (Part of #8862) Regenerated with tests/tools/doom_rosetta_check.py --update --yes. Four ports moved, all through the deliberate differences of the split: odamex (powershell: -not leaves branch), edge-classic (lua: not leaves branch), managed-doom and helion (csharp: && and || now counted, `not` pattern removed). The other ports are unchanged. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018srRvejJbzNR67xR3D2VxV
|
CI shepherd: the head of this PR (b3dab12) is not the one a maintainer labelled |
|
No description provided. |
|
PR #8939 @ 5e35b9b: 11 failed check(s) == crucible (cancelled) -- infra == equivalence-e2e (cancelled) -- infra == full-suite (cancelled) -- infra == full-suite part ${{ matrix.group }}/${{ needs.shard-plan.outputs.splits }} (cancelled) -- infra == graph-accuracy-audit (failure) -- real == measure (shard ${{ matrix.shard }}/${{ matrix.total }}) (cancelled) -- infra == publish-history (cancelled) -- infra == shard ${{ matrix.group }}/${{ needs.plan.outputs.splits }} (cancelled) -- infra == shard ${{ matrix.shard }} (${{ matrix.loc }} LOC) (cancelled) -- infra == store the suite's durations (cancelled) -- infra == suite time budget (#5166) (cancelled) -- infra |
|
No description provided. |
|
CI shepherd: the head of this PR (f0bcc4a) is not the one a maintainer labelled |
…t_circuit family split Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…an and Julia, golden masters re-blessed Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ast push mixed two store layouts) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Part of #8862 and #8905 (closes neither; the oracle/chart half and the other splits are follow-ups).
Decision and why
Eagle Eye (#8863) showed the broad families scoring worst because one name covered several things that languages spell and count differently. Owner decision (2026-11-21): narrow leaf families with one-sentence contracts, composites computed from leaves, one parser oracle per leaf. Plan and split order:
docs/family_levels.md. This PR is the first split.What changes
short_circuit(columnstruct_short_circuit): signal contract, display name, schema comment,docs/short_circuit_rule_contract.md,branchcontract corollary 0.branchkeeps constructs and arms; boolean operators (&&||andorand thenor else.and.-andandalso) move toshort_circuitin 45 language rules, with the same literal-shielding scope filter.decision_points = branch + short_circuit, computed not scanned. The engine's decision-density metrics (per-function magnitude/complexity, file control-flow ratio, signal-processor inputs) read it, so they keep their old meaning.not,-not) leavesbranchin lua, livecode, csharp, powershell (neither family); C# gains&&/||(it counted onlyand/orpatterns); Zig countsand/or(its rule listed&&/||, which Zig lacks; supersedes fix(zig): branch counts the keywords and/or, not the nonexistent && and || #8937); Nim drops try/except/finally from branch (Nim: branch counts try, except and finally (a handler is not a decision) #8926) and countsand/or; Solidity, Groovy, Haskell gain a rule.Evidence
branch== newbranch+short_circuitfor every function except C# (jellyfin, +1,294 from&&/||).complexityunchanged in all repos but jellyfin; archetype assignment changes for 210 of 78,325 functions (0.27%).mainfor all 34 languages with a fixture (c, go, shell, haskell fail the same way onmain).core_enginesuite,pr_gates --ratchets; CI will.crucible_check.py --update --yes(separate commit).Not in this PR
short_circuitand removing boolean operators from the oracle'sbranch(follow-up on tests/tools: family_oracle scores each keyword family against an ast oracle (Part of #8863) #8864's tooling; tests/tools: family_oracle scores each keyword family against an ast oracle (Part of #8863) #8864 is still open).log_density_struct_branchnow reads the narrower leaf; 0.27% of functions change archetype. A retrain needs a decision from the owner.docs/family_levels.md.short_circuit.🤖 Generated with Claude Code
https://claude.ai/code/session_018srRvejJbzNR67xR3D2VxV