Skip to content

fix(scanner): same-dir C/C++/PHP includes resolve, Elixir symbol-level, 20-language conformance test - #202

Merged
JordanCoin merged 3 commits into
mainfrom
fix/language-conformance
Oct 11, 2026
Merged

JordanCoin merged 3 commits into
mainfrom
fix/language-conformance

Conversation

@JordanCoin

Copy link
Copy Markdown
Owner

What a probe of all 20 detected languages found

Built the smallest two-file repo per language (a imports b the idiomatic way) and ran BuildFileGraph. Before this PR:

language a→b edge coverage verdict
c, cpp none complete wrong answer: #include "b.h" normalized to b/h
php none complete wrong answer: require_once 'b.php' normalized to b/php
elixir none complete mislabelled: alias App.B names a module, not a file
java, kotlin, scala, csharp none partial honest, declared
swift yes partial honest, type-name edges
rust yes partial honest, macro note
go, python, js, ts, ruby, dart, bash, lua, solidity, cue yes complete correct

Subdirectory includes (#include "inc/b.h") already worked because the slash short-circuits the dot rule, which is why real C repos got some edges and nobody filed it.

Changes

  • normalizeImport: the Python dots-to-slashes rule skips imports whose last dot introduces a known source extension. Regression cases for b.h and b.php.
  • symbolLevelImportLanguages gains Elixir; an Elixir-only graph now reports partial with the module-import note instead of complete.
  • scanner/conformance_test.go: one inline fixture per language in extToLang, asserting edge and coverage status. TestConformanceCoversEveryDetectedLanguage fails if an extension is added without a case.

go build ./... && go test ./... && gofmt -l . clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NRaBgKRAZMX9hjbkkefA7T

…red symbol-level; one conformance case per language

normalizeImport turned every dotted, slash-free import into a path, so
`#include "b.h"` and `require_once 'b.php'` became b/h and b/php and
resolved to nothing. Only dots that do not introduce a known source
extension are module separators now.

Elixir aliases name modules, not files, so an empty Elixir graph was
labelled complete. It joins the symbol-level set and reports partial
with the same note as Java, Kotlin, Scala and C#.

conformance_test.go builds the smallest two-file repository for each of
the 20 detected languages and asserts the a->b edge and coverage status.
A language added to extToLang without a case fails the suite.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NRaBgKRAZMX9hjbkkefA7T
Copilot AI balanced review requested due to automatic review settings October 11, 2026 11:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

JordanCoin and others added 2 commits October 11, 2026 21:28
staticcheck@latest cannot read export data from the newest toolchain, so
every PR's Lint job failed on an environment mismatch unrelated to the
change under review (#202, #203, #204 on 2026-10-11).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NRaBgKRAZMX9hjbkkefA7T
@JordanCoin
JordanCoin merged commit a7b7415 into main Oct 11, 2026
12 checks passed
@JordanCoin
JordanCoin deleted the fix/language-conformance branch October 11, 2026 19:34
JordanCoin added a commit that referenced this pull request Oct 11, 2026
… not the first WRITE (#207)

TestEventDetection and TestLineDelta failed on ubuntu-latest (PR #202,
2026-10-11) with "Expected 5 lines, got 0" and "Expected positive line
delta, got -3" while passing on macOS. os.WriteFile opens with O_TRUNC;
on Linux inotify reports the truncation as its own WRITE before the
content lands. The daemon processes that first event immediately (0
lines, delta -3 on a 3-line file) and defers the real one through the
debouncer, so a test that stopped at "any WRITE arrived" asserted on the
truncated state. kqueue coalesces the two events, which is why macOS
never saw it.

waitForWriteEvent now takes the terminal condition and polls until the
most recent WRITE for the path satisfies it, the same shape TestDebounce
already uses. The daemon is unchanged: a transient 0-line WRITE followed
by a debounced trailing event is accurate history.

Not reproduced locally: 40 iterations with -race -cpu 1 on macOS and 15
iterations on Linux (golang:1.24 in Docker) all passed before the
change; the split needs a loaded runner. After the change, 200
iterations with -race pass.

Fixes #135


Claude-Session: https://claude.ai/code/session_01NRaBgKRAZMX9hjbkkefA7T

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
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