Repository navigation
fix(network): read imports from the code stream, so comments and docstrings draw no edges (#3600) - #3612
Merged
Conversation
…tring edges (#3600) galaxyscope ran each language's `_dependency_capture` over the RAW file, so an import written in documentation became an edge: Dart `/// import 'package:http/http.dart'`, fp-ts JSDoc `@example` imports, fastapi's usage docstrings, a commented-out PL/I `%INCLUDE`, Rails `# include` lines, and Perl comment words (`no warning` -> the `warning` typosquat alert). Capture now reads PRISM's code stream -- comments and Python docstrings removed, string literals (most import paths) kept -- the same view the mainframe boundary channel already reads. Inert formats keep their raw text (markdown links are their content). Kotlin, Scala and Java, whose import paths are never strings, also blank `"""` blocks (`import_capture_blank`): test fixtures and code generators full of example source (kotlinpoet's `kotlin("X.kt", """ import ... """)`). import_graph_accuracy precision: python 99.1 -> 99.9, typescript 99.6 -> 100, objective-c 99.8 -> 100, dart 99.1 -> 100, kotlin 99.1 -> 100, scala 98.2 -> 99.4. Scala recall 54.5 -> 51.6 is a scoring artifact: a Scaladoc edge into io.circe had been crediting 29 wildcard statements whose truth set is the whole 40-file package. Baseline regenerated. Golden masters: typosquat_hits 27 -> 22, firewall imports_unknown 11162 -> 10501; Extracted Dependencies lose comment/docstring/string-borne tokens across python, perl, php, rust, livecode, groovy, typescript and more. The mainframe ground-truth ledger stays clean. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YAtpBfGGyBGGovitSVaM5Q
Contributor
…s are not includes (#3600) The ground-truth workflow's full-corpus step pins each corpus's completeness counts. DSF keeps retired `/* %INCLUDE Rnnnnnnn; ... */` lines as comments (R0010410, R0011520, R0010620, R0011901, ... -- dozens), which the raw-text capture read as includes. One PL/I main counted as CICS only through such a comment; read from the code stream it is a batch main: transactions 235/310 -> 234/309, batch entry 128 -> 129. The ledger itself is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YAtpBfGGyBGGovitSVaM5Q
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.
Summary
Fixes #3600.
galaxyscoperan each language's_dependency_captureover the raw file, comments included, so an import written in documentation became an edge. Examples, all verified against the source:/// import 'package:http/http.dart';inbase_response.dart* import * as E from 'fp-ts/Either'from fastapi import BackgroundTasks/* %INCLUDE R0019912 ... */lines (dozens of programs)# include ActionView::Layoutscomment lines(no warning will be issued)→ thewarningtyposquat alertbuild.sbtstringimport io.circe._Fix. Capture reads PRISM's code stream: comments and Python docstrings removed, string literals (most import paths) kept. The mainframe boundary channel already reads this view for the same reason. Inert formats keep their raw text, since markdown links are their content.
Kotlin, Scala and Java write import paths as identifiers, never strings, so they also blank
"""blocks via a new top-levelimport_capture_blankkey. This covers test fixtures and code generators full of example source: kotlinpoet'skotlin("Example.kt", """ import … """), circe'sproject/Boilerplate.scala, and Gradle integration tests' embedded build scripts.Measured:
import_graph_accuracy.py(precision)Recall is unchanged everywhere except Scala: 54.5 → 51.6, which is a scoring artifact. A Scaladoc-example edge from
Decoder.scalaintoio/circe/disjunctionCodecs.scalahad been crediting 29 wildcard statements whose truth set is the whole 40-fileio.circepackage. Only 8 Scala edges changed, all comment- or string-borne. Baseline regenerated.Mainframe (second commit)
The ground-truth workflow's full-corpus step pins each corpus's completeness counts, and DSF's moved. DSF keeps retired
%INCLUDEs as comments across dozens of PL/I programs (R0010410,R0011520,R0010620,R0011901, …; every lost include was checked and each is inside/* */). One PL/I main counted as CICS only through such a comment. Read from the code stream, it is the batch main its source says it is:transactions235/310 → 234/309;batch entry128 → 129.test_completeness.py's DSF pin is updated with that explanation. The ground-truth ledger itself, i.e. every answer-key field, is unchanged.Type of change
CI checklist
python -m pytest tests/: 11,147 passed. Newtest_worker_reads_imports_from_the_code_streamfails without the change.pytest tests/cobol_mainframe/against the fetched pinned corpora: 476 passed, 1 skipped.ground_truth_ledger.py check: ledger clean.crucible_check.py: both fixtures pass on the rebased head (reblessed; scope below).import_graph_accuracy.py --regenerate: 20 languages.Golden-master scope
Zero-dependency fixture: 2,670 differences, 392 of them not coordinate ripple. All changes follow from
Extracted Dependencieslosing comment-, docstring- or embedded-string-borne tokens:PHP's losses are fragments of its existing multi-line capture garbage (#3609); LiveCode's are doc prose.
Summary:
typosquat_hits27 → 22. Five false alerts are gone, including Perlwarning,react/build.jsand bugzillaCGI.pm.firewall.imports_unknown11162 → 10501.One junk token appears:
agc_assembly/RCS_FAILURE_MONITOR.agcgainsCOUNT(fromCOUNT* $$/T4RCS). It resolves to nothing.Verification
🤖 Generated with Claude Code
https://claude.ai/code/session_01YAtpBfGGyBGGovitSVaM5Q