Skip to content

fix(shotness): restore Kotlin and cross-language declaration tracking - #30

Merged
dmytrogajewski merged 1 commit into
mainfrom
fix/shotness-language-names
Nov 8, 2026
Merged

dmytrogajewski merged 1 commit into
mainfrom
fix/shotness-language-names

Conversation

@dmytrogajewski

@dmytrogajewski dmytrogajewski commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Scope

codefang run -a history/shotness --limit 200 --format text <repo> could return zero nodes for Kotlin repositories because declaration names were missing. The cross-language audit found naming, selection or body-span gaps in 15 additional mappings: Clojure, CMake, Common Lisp, Elixir, Elm, Fortran, GraphQL, Groovy, LaTeX, Make, PowerShell, Protocol Buffers, R, Rego and SQL.

Capture declaration/container names and associate changes with full declaration spans. Root mapping queries at the current CST node and preserve explicit mapping names over raw grammar fields. Remove unreachable Common Lisp rules and document coverage and parser limits.

On the pinned public Spring Petclinic Kotlin history, Shotness changes from 0 to 14 nodes. On the same mixed-language fixture repository, the installed binary changes from 37 nodes/72 touches to the expected 71 nodes/141 touches. Every resulting name and per-entity count is checked.

Test matrix

  • 64 real-history CLI regression tests cover representative declarations in 42 filename-selected mappings, text/JSON output, --limit 200, body changes, qualification, macros, guards and anonymous values.
  • Parser-validity and registry-coverage checks prevent malformed fixtures and missing coverage for newly selectable function-declaring mappings.
  • Kotlin source/script static analysis, companion names and direct capture/name-precedence regressions are included.
  • Full workspace: 3,230 passed, 1 ignored, including integration tests, CLI tests, Markdown examples and doctests.
  • make -o submodules lint, make -o submodules deadcode, formatting, build and install passed. Lint/deadcode repeated before committing.
  • Full suite command: TMPDIR="$PWD/.tmp/shotness-doc-tests" make -o submodules test. The first run had six doctest linker SIGBUS failures under /tmp; those doctests and the entire workspace passed with disk-backed temporary files. The linker cause is unconfirmed; no checks were disabled. -o submodules reuses the existing submodule checkout.

Evidence: verification, mixed-language results, public Kotlin reproduction.

Link to FRD/BUG

Breaking changes

None to CLI flags or report schemas. Entity names and history counts are corrected for affected mappings.

Known limits remain documented in language coverage: old-style LaTeX \def body-only changes on later lines, Helm/RSTML filename routing, conventional Make/CMake filenames and Rust impl qualification. Representative fixtures do not establish every dialect or multi-clause definition. Shared capture semantics are covered by the full workspace suite. Rollback: revert this commit and rebuild deployed binaries/images.


Before opening this PR

  • All tests pass locally (make test, with the temporary-file setting above)
  • Linting is clean (make lint)
  • Dead code analysis passes (make deadcode)
  • Commit messages follow conventional commits
  • Documentation is updated

…uages

Fix BUG-kotlin-shotness-empty and BUG-shotness-language-names with declaration captures, full body spans, rooted query matching and explicit-name precedence. Add real-history CLI coverage, parser-valid fixtures and reproduction evidence.
@dmytrogajewski
dmytrogajewski merged commit 6f61604 into main Nov 8, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants