Repository navigation
Fix tcl proc loss after an unterminated double-quote (#3142) - #3149
Merged
Merged
Conversation
Contributor
testrunner.tcl (sqlite) declares 40 line-start procs but GitGalaxy extracted only 22. An unterminated double-quote in a `puts` on L823 (malformed TCL in sqlite's own source: `puts "...\"$a0\"". Use --help..."` has an unbalanced 5th quote) desynced the brace slicer's quote state, so the string mask ran away across the next 18 proc declarations (L943-L1426) until it happened to resync. Fix (Direction 2 from the issue -- resync at a line-start `proc` anchor): the tcl-specific double-quoted-string pattern in `_build_brace_safe_stream` now refuses to let a string span a newline that begins a `proc` declaration (`"(?:[^"\\\n]|\n(?![ \t]*proc\b)|\\.)*"`). A runaway/unterminated string can no longer swallow a column-0 `proc`; the structural anchor survives the desync. The change is scoped to the `elif lang_id == "tcl":` branch, so no other language's quote handling is affected. The alternation's three branches are first-character-disjoint, so the nested quantifier is linear (no catastrophic backtracking); verified against a 50k+ adversarial unterminated string. On the real testrunner.tcl the engine now extracts 40 procs (all of dirs_nHelper, add_tcl_jobs, must_be_testfixture, add_jobs_from_cmdline recovered). Co-Authored-By: Claude Opus 4.8 <[email protected]>
Rebased onto main after #3110/#3115 merged, then regenerated both golden-master fixtures so they carry those merged changes PLUS the tcl quote-resync fix. Verified via golden_diff.deep_compare against main: the only drift vs main is testrunner.tcl's 18 recovered procs and their corpus rollup (Function Analysis list, archetype mix Many-Arg/Compute/Interface/I-O/Defensive summing to +18, Structural Magnitude, topo re-solve, State-Mutation / Cascading-Flux drop, tcl/sqlite directory-group + global rollups). #3110's REGISTRS.asm->hlasm reclassification is preserved (0 hlasm/assembly diffs vs main). No other file. Co-Authored-By: Claude Opus 4.8 <[email protected]>
squid-protocol
force-pushed
the
fix/tcl-quote-3142
branch
from
September 17, 2026 22:34
4e4e3b9 to
2441314
Compare
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.
Closes #3142.
Problem
language-crucible/data/tcl/sqlite/testrunner.tcldeclares 40 line-startprocs; GitGalaxy's Function Analysis extracted only 22. The 18 missing were a contiguous block (L943–L1426).Root cause is extraction, not detection. An unterminated double-quote on L823 — malformed TCL in sqlite's own source:
(the 4th quote closes the string, the 5th opens one that never closes) desynced the brace slicer's quote state, so the string mask ran away across the next 18
procdeclarations until it happened to resync at L1544.Fix
Direction 2 from the issue — resync at a line-start
procanchor. In_build_brace_safe_stream, the tcl-specific double-quoted-string pattern now refuses to span a newline that begins aproc:A runaway/unterminated string can no longer swallow a column-0
proc. Scoped to theelif lang_id == "tcl":branch — no other language's quote handling changes.Verification
testrunner.tcl(was 22);dirs_nHelper,add_tcl_jobs,must_be_testfixture,add_jobs_from_cmdlineall recovered.test_tcl.py; full tcl suite passes;detector.pyruff identical to baseline; no new mypy errors.