Repository navigation
Kotlin family validity: closures count trailing and implicit-it lambdas, doc stays on the declaration directly below (Part of #8863) - #9358
Conversation
…as, doc stays on the declaration directly below (Part of #8863) Closures recall 0.42 -> 1.00 (precision 0.97); doc precision 0.75 -> 1.00 on the pinned crucible. Goldens, baseline and charts regenerated. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
No description provided. |
|
No description provided. |
|
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. |
Golden conflicts (gpu_json, function_archetype_distribution, both fixtures) taken from main and re-blessed; family-validity chart regenerated. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
CI shepherd: the head of this PR (5735c71) is not the one a maintainer labelled |
Golden and chart conflicts taken from main and regenerated. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
No description provided. |
|
No description provided. |
Part of #8863. Phase 2 of #9330 (Kotlin keyword-family red cells).
Checklist: partial [c:3d9860c9] -- the two cells that are red on the pinned crucible (closures, doc) are fixed; the five okhttp-only cells (time_date_logic, io, panics_and_aborts, bitwise_ops, regex_execution) are unpinned and not measurable there, left as sibling gaps below
What changed
Pinned language-crucible v1.9.0, Kotlin (246 oracle functions), measured before and after:
closures{ x -> }). It now also counts trailing lambdas (runBlocking {,.also {,lazy {,synchronized(this) {) and implicit-itlambdas, line-anchored, and skips declaration and control-flow blocks (funheaders,class/object/supertype headers,if/else/try/finally/when/for/while,init,companion,whenbranches).doc//comments,)or import/package lines between).Files:
languages/kotlin.py(closures rule),core/detector.py(_DOC_ADJACENT_LANGS,_only_header_trivia_between), new testtest_kotlin_family_validity_9330.py(25 tests: 10 positive lambda forms, 13 declaration/control negatives, doc adjacency). Regenerated, not hand-edited: both golden masters,tests/family_validity_baseline.json(Kotlin cells only), the two family-validity SVGs.Family-validity checklist
closuresover-counts (serialize, line 50 of the two...ContextualTest.kt/...ContextualListTest.ktfiles; slice bleed-through).Golden diff
Both fixtures re-blessed with
golden-lock.sh crucible_check.py --update --yes; a second bless after mergingorigin/mainreports no drift. The diff is confined to Kotlin: closure counts (closures_lambdas),documentation_exposure, and the archetype aggregates that follow from them. No other language moved.Measurements
data/kotlin, 3 alternating runs, user seconds: base 1.85 / 1.58 / 1.60, branch 1.59 / 1.61 / 1.61 (no change).verify_language.py kotlinwith this engine: the same 2 mismatches as with main (calls_out_toforprobeBranchandprobeBypass, unrelated). A first draft of the doc change brokeunits_documented(the plant puts the KDoc above a//comment and animport); fixed by treating import/package lines as trivia, and pinned by a test. Norosetta:rebless-owedneeded.audit_check.pyall clear,ruff format --checkclean.Cross-repo
None: no crucible pin change, no rosetta change.
Class sweep
Same mechanism (language-agnostic 5-line doc window crediting a class or property doc to the next function) exists for every other language; I gated the fix to Kotlin so goldens elsewhere do not move.
Sibling gaps
_DOC_ADJACENT_LANGSis the opt-in list).panics_and_abortsfires 38 vs 5 (precision 0.13),io29 vs 0,regex_execution2 vs 0,time_date_logic0 vs 6,bitwise_ops3 vs 0. They need a corpus with enough functions (an okhttp pin) before they can be fixed or quoted;panics_and_abortsmay need a contract question.iomoved on a fresh sweep (precision 0.84 -> 0.797, 75 -> 79 family functions) with no Python change in the golden diff, so it is not from this PR. I kept its committed baseline cell; someone should re-measure it.Remaining slices
The five Kotlin cells above, and the doc-window leak in other languages.
Lessons for agents
tests/family_validity_baseline.jsonregeneration (family_oracle_sweep.py --write) rewrites every language's cells; diff it per language and keep only the language you changed (another language's drift is not yours).//comment and animport: any tightening of the doc window must runverify_language.py <lang>against it.crucible_check.pyrun in the background: the log stays empty while queued behind another agent's bless ongolden.lock.Facts checked: pinned crucible v1.9.0 Kotlin 246 functions; before/after cells from
family_oracle_sweep.pyand a per-function diff against the tree-sitter oracle; baseline diff Kotlin-only; post-merge bless shows no drift.🤖 Generated with Claude Code