Skip to content

fix/issues-73-77-78: Artifact discovery skips what the analysis skips, its own outputs, and links out of the project - #84

Merged
rahlk merged 2 commits into
mainfrom
fix/issues-73-77-78-artifact-discovery
Nov 30, 2026
Merged

rahlk merged 2 commits into
mainfrom
fix/issues-73-77-78-artifact-discovery

Conversation

@rahlk

@rahlk rahlk commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Fixes #73. Fixes #77. Fixes #78.

Artifact discovery now uses the same skip rule as the Go analysis, skips this tool's own output files, and follows a symlinked file only when the target is inside the project.

Motivation and Context

--artifact-text is on by default (#83). So a file that discovery captures by mistake also puts its whole text into the JSON and the graph.

  • Artifact discovery skips different directories than the Go analysis #78: discovery had its own skip list (.git, vendor), and it checked the list only on directories. It now uses utils.IsVendored, the rule of the Go analysis, on every entry: vendor/, testdata/ and .git are skipped. This includes a .git file (a git worktree or a submodule), whose gitdir: line has an absolute host path.
  • graph.cypher in the working directory is captured as an artifact #77: the -o and -c directories are skipped whole when they are inside the project, as in the Python analyzer. If one of them holds the project root (for example -o .), discovery does not skip it whole, because that would empty the inventory. It skips only analysis.json and graph.cypher in it, and writes a warning. With --emit neo4j and no -o, discovery skips the graph.cypher in the current directory. Two runs from the project root now write the same snapshot.
  • A symlinked go.mod is never emitted as an artifact #73: discovery follows a symlinked file when its target is a regular file inside the project, and not in a skipped path. It records the file under the link's path, so a symlinked go.mod is the artifact that its dependencies name. A link to a directory, or to outside the project, is still skipped.

How Has This Been Tested?

  • Unit tests on a temporary project:
    • a symlinked go.mod;
    • a link to outside the project;
    • testdata/ and .git files;
    • the whole -o directory and the working-directory graph.cypher;
    • an -o or cache directory that holds the project.
  • A CLI test runs --emit neo4j two times from the project root. The two snapshots are the same.
  • Each behavior test fails on the old code. go test ./... and golangci-lint pass.

Breaking Changes

  • Files under testdata/ are no longer artifacts. Python and TypeScript keep their test folders; Go follows the Go toolchain, which ignores testdata/.
  • Other files in an -o directory inside the project are no longer artifacts.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the Codellm-Devkit Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

  • Spec: docs/design/specs/v2-artifacts.md, "Excluded paths". It also names the Go types now (schema.GoArtifact, schema.GoDependency, emitted as v2.Artifact, v2.Dependency).
  • With -o ., each run writes a warning that the output directory holds the project. Python writes the same warning.

Rahul Krishna and others added 2 commits November 29, 2026 18:06
…puts, and links out of the project (#73, #77, #78)

- #78: discovery had its own skip list (.git, vendor) and checked it only on
  directories. It now uses utils.IsVendored, the Go analysis's rule, on every
  entry: vendor/, testdata/ and .git are skipped, also a .git file (a git
  worktree or submodule), whose gitdir: line holds an absolute host path.
- #77: the -o and -c directories are skipped whole when they are inside the
  project, as in the Python analyzer. One that holds the project root (-o .)
  is not, because that would empty the inventory; only analysis.json and
  graph.cypher in it are skipped. With --emit neo4j and no -o, the
  graph.cypher in the current directory is skipped, so two runs from the
  project root write the same snapshot.
- #73: a symlinked file is followed when its target is a regular file inside
  the project and not in a skipped path. It is recorded under the link's path,
  so a symlinked go.mod is the artifact its dependencies name. A link to a
  directory or to outside the project is still skipped.

Tests: a symlinked go.mod, a link to outside the project, testdata and .git
files, the whole -o directory and the working-directory graph.cypher, an -o /
cache directory that holds the project, and two --emit neo4j runs from the
project root. The new behavior tests fail on the old code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The spec named only the Python types (PyArtifact, PyDependency, PyConfigKey).
It now names the Go analyzer model (schema.GoArtifact, schema.GoDependency),
the emitted types (v2.Artifact, v2.Dependency), and says there is no
config-key type yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rahlk
rahlk merged commit 638081b into main Nov 30, 2026
3 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

1 participant