Repository navigation
Ada: a nested subprogram ends at its own end Name; the parent keeps its tail (#8913) - #9061
squid-protocol wants to merge 4 commits into
Conversation
…ps its tail (#8913) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…8913) 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]>
|
No description provided. |
|
PR #9061 @ feb7a6c: 1 failed check(s) == rosetta-audit (failure) -- real |
|
Waiting on an owner decision (asked privately, 2026-11-22). Nothing is needed from contributors; work resumes once it is answered. |
#9056 #9057 #9058 #9059 #9061 #9067) (#9111) * apply #9053 (non-snapshot changes) * apply #9054 (non-snapshot changes) * apply #9057 (non-snapshot changes) * apply #9059 (non-snapshot changes) * apply #9061 (non-snapshot changes) * apply #9067 (non-snapshot changes) * apply #9055 (non-snapshot changes) * golden: re-bless once for the seven stacked engine fixes (#9053 #9054 #9055 #9057 #9059 #9061 #9067) Each of the seven PRs conflicted with the others in the golden-master snapshots, so merging them one at a time would have re-conflicted the rest each time. One combined branch, one bless (crucible_check.py --update --yes through golden-lock.sh, both legs) plus the dartdoom DOOM golden. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> * apply #9056 #9058 (non-snapshot changes) * golden: re-bless with #9056 and #9058 folded in (powershell, perl) plus odamex and prboom-plus DOOM goldens Co-Authored-By: Claude Sonnet 5.5 <[email protected]> --------- Co-authored-by: Claude Sonnet 5.5 <[email protected]>
Closes #8913 (the Ada nested-subprogram case; the two unreproduced shapes are listed as sibling gaps). Part of #8863.
What changed
Ada is sliced by Mode A (
_slice_by_labels): every unit ran greedily to the nextfunc_startmatch. ForC4holdingInner,C4ended atInner's header (losing itsbegin ... end C4;tail and itsif), andInnerran to EOF and took that tail.gitgalaxy/core/detector.py: new_ada_unit_endfinds theend Name;that closes a subprogram (searched in the whole file, since a parent's end lies past its nested headers; case-insensitive,end Pkg.Name;accepted). In_slice_by_labels, an Ada unit with a labelled end now ends there; every nested subprogram inside it is blanked out of its block (newlines kept, so lines and LOC hold) and its span is excluded from the parent's hit vector via a new optionalexclude_spanson_calculate_block_metrics. A unit with no labelled end keeps the old greedy body.tests/extraction/languages/test_ada_nested_subprogram_8913.py: the issue'sC4/Innercase (C4 branch 1, Inner 0, end lines), two sibling nested subprograms, two levels of nesting, end-label spellings, unlabelledend;fallback, flat subprograms unchanged.Class / Sibling gaps
Class: Mode A greedy slicing gives a nested unit with an explicit closing label the wrong body (parent truncated at the nested header, nested unit extended to the parent's tail). Member fixed here: Ada.
PROC): its child already ends atEND name;(_structural_unit_end), but the parent is still truncated at the nested header. Not changed here to keep the golden drift attributable to Ada; sameexclude_spanshook would serve it. No burned-estate program needs it (core/sweep).return R : T do ... end return;) truncating the enclosing function: not reproduced on a minimal file, not verified here.whencounted as a branch (branch contract corollary 1): different mechanism (thebranchrule inlanguages/ada.pymatches everywhen, case arms included); not changed here.end Name;label keeps the greedy body (stated fallback).Golden drift
Re-blessed with
golden-lock.sh crucible_check.py --update --yes(both legs), then re-checked: both PASS. The Ada drift is the intended change (function boundaries, per-function families, Ada directory rollups). Other languages move only through repo-wide graph rollups (PageRank at the 1e-5 level, topological coordinates, composition z-scores, archetype distribution counts) because Ada's function set and import/call edges changed.scope_check.py --expect adaalso listed shell/powershell/cpp function-levelCalls Out To/Fan Outentries that do not appear in the blessed golden diff; I did not chase them further. Merged main once for a sibling's golden conflict (took main's generated files, re-blessed).Facts checked: ada tests 133 passed (new file 7);
pr_gates --fast9/9;pr_gates --ratchets9 pass, 0 skipped; crucible_check PASS both legs.Lessons for agents
_calculate_block_metricscounts branch/etc. by bisecting the spatial map onstart_idx/end_idx, not fromblocktext: blanking text inside a block does not remove its hits; passexclude_spans.🤖 Generated with Claude Code