Repository navigation
branch: a token inside a literal is not a decision; Java's ternary counts once - #4178
Merged
Merged
Conversation
…unts once The code stream keeps string literals, so every C-family `branch` rule counted them: a JDBC "values (?, ?, ?, ?, ?)" read as five ternaries, "if" in a message as an if. IBM's WCA4Z Lgacdb01.insertCustomer (one if/else) scored complexity 21, 19 of it the `?` placeholders in its two INSERT strings. - the 18 brace-family languages opt `branch` into `outside_literals`; for them the filter shields with the brace slicer's literal syntax (char literals, raw and verbatim strings, text blocks; a rust lifetime is not a literal) - java: a `:` is never a decision (the ternary's own, case/default labels, statement labels, enhanced-for, assert); generic wildcards are types - `??` is one hit in typescript/javascript/dart/swift/apex (`\?\?` now before `\?`) - branch_rule_contract.md gains the "Literals" corollary; stream contract updated Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ
- struct_branch rho: 49 pairs 0.826 -> 0.855 (floor 0.70 -> 0.75), committed 12-pair fixture 0.745 -> 0.784 (floor 0.60 -> 0.65); provisional marking removed (port_invariance.py, port_invariance_contract.md). Other readings unchanged. - det_parity branch model refit, same 49 programs and Theil-Sen method: batch 15.0 + 1.62x -> 12.6 + 1.30x, CICS 70.8 + 2.77x -> 51.8 + 2.33x; proven ports 0.73 .. 1.58 of the prediction, none of 49 warns (bands unchanged) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ
Contributor
…ount Audited before blessing: scanning the pinned crucible (v1.6.0) with main and with this branch, the only raw per-file count that changes is struct_branch, in 216 files, every one a brace-family language or an HTML file's embedded JavaScript (a `?` inside a template-literal URL). The 21,314 audit-JSON differences in each mode are that change and its ripple through repo-normalised exposures, masses, rankings and archetype distributions; no other raw count moved. Regenerated with tests/tools/update_golden_master.py in each mode (full-precision; zero-dependency in a PyYAML-only environment matching CI's leg), and test_golden_crucible.py passes locally in both. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ
squid-protocol
added a commit
that referenced
this pull request
Oct 2, 2026
…4178 fix (#4182) Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ Co-authored-by: Claude Opus 5.5 <[email protected]>
This was referenced Oct 2, 2026
Merged
squid-protocol
added a commit
that referenced
this pull request
Oct 3, 2026
…1 (model-written, unedited, proven) (#4187) Ports only, split from #4168; the loop fixes are #4186. Each is the porting loop's answer on attempt 1 (claude-sonnet-5-5, no tools, ticket prompt only), unedited, with provenance.json. Re-proven on main after #4178/#4180: cbsa-updacc 10 scenarios, 7/7 paragraphs, 5/6 branches genapp-lgicdb01 12 scenarios, 3/4 paragraphs, 4/12 branches genapp-lgapvs01 8 scenarios, 2/3 paragraphs, 5/9 branches Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4170
The bug
The code stream keeps string literals, so every C-family
branchrule counted tokens inside them."INSERT ... values (?, ?, ?, ?, ?)"read as five ternaries, and"if"in a message read as an if.:, so a ternary read as 2 decisions, acase 1:as 2, and labels, enhanced-for andassertcolons as decisions. Generic wildcards (List<?>,<? extends T>) read as ternaries.Lgacdb01.java(one if/else) read 22 branch points; it now reads 3.Root cause and fix
branchmatched raw string, char and text-block contents. The 18 brace-family languages (apex, c, cpp, csharp, dart, go, groovy, java, javascript, kotlin, objective-c, php, rust, scala, solidity, swift, typescript, zig) now optbranchinto the existingoutside_literalsscope filter (vectorized_math fires on '@' inside Python string literals #4136)._build_brace_safe_stream, the brace slicer's own literal syntax: char literals, raw and verbatim strings, text blocks and template literals. A Rust lifetime is not a literal.vectorized_mathkeeps the indentation-slicer shield it used before.:and?. The bare:arm is removed: a ternary counts once at its?, andcase/defaultalready count the arm (contract corollary 2). The?arm excludes generic wildcards.??counted twice. typescript, javascript, dart, swift and apex listed\?before\?\?, soa ?? bread 2.\?\?now comes first.docs/branch_rule_contract.mdgains a "Literals" section (corollary 4). The stream contract insignal_contracts.pyis updated anddocs/signal_contracts.mdregenerated.Impact
Lgacdb01.javabranch pointsdet_port_design.md. The methods model didn't move.Tests
tests/extraction/languages/test_branch_literals.py: end-to-end cases through the real extractor (the bare regex never sees the filter):test_branch_contract_2822.py: Java negatives and positives, one-hit pins for a Java ternary andcaselabels and for??in five languages, and two new ReDoS payloads.test_go_strict.py: the go_scope_filterspin now includesbranch.ruff_audit.py --ciandsignal_contract_audit.py --ciare clean;port_invariance.py checkholds with the new floors.Golden masters (re-blessed, both modes)
test_golden_cruciblefailed on the first push with 21,314 differences per mode, which is expected for a counting change. I audited the drift before blessing:file_data.struct_branch, in 216 files: apex 1, c 33, cpp 15, csharp 5, dart 7, go 23, groovy 33, java 13, javascript 12, typescript 13, zig 11, objective-c 3, php 19, rust 15, scala 6 and swift 5.?inside a template-literal URL (`...redirect?url=${...}`).Regenerated with
tests/tools/update_golden_master.py:test_golden_crucible.pypasses locally in both modes.Known and accepted
?/:inside a JS/TS template literal's${...}is shielded along with the literal, so it doesn't count.x?: T) and optional chaining (?.) still count. That's a separate question for the contract, not changed here.🤖 Generated with Claude Code
https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ