codegraph

package
v0.50.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 11, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package codegraph is the CodeGrapher-snapshot ingestion adapter: it reads committed `codegraph/` snapshot recordsets (INGR encoding, inGitDB layout) and emits package entities and `derived` facts for `imports` edges at package granularity.

Feature: cli/studio/index (REQ: adapter-codegraph)

Emitted predicates:

  • imports — one fact per distinct (importing package, imported package) pair found in the snapshot's `imports` edges

Snapshots usually store imports at file granularity (edge source `file:<path>`, target an `import:` node whose name is the import path); the adapter derives the package edge in the same single pass: the subject is the source file's directory as a repo-relative package (`#<dir>`, `#.` for the repo root) and the object is the imported path verbatim (a global package coordinate, matching the manifests adapter's object vocabulary). Where the snapshot already provides package-granularity nodes/edges (`package:` refs) they pass through as repo-relative packages (`#<name>`) with no extra parsing pass. Malformed or unreadable snapshot files become warnings and skip only that file (REQ: partial-tolerance); edges whose endpoints cannot be resolved to packages are counted into one warning per edges file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter struct{}

Adapter is the codegraph-snapshot ingestion adapter. The zero value is ready to use.

func New

func New() Adapter

New returns the adapter.

func (Adapter) ID

func (Adapter) ID() string

ID returns the stable adapter id stamped into every emitted fact.

func (Adapter) Ingest

func (Adapter) Ingest(repoPath string) ([]fact.Fact, []fact.Warning)

Ingest reads the committed codegraph/ snapshot of the repo at repoPath. A repo without a snapshot yields no facts and no warnings. Malformed or unreadable recordset files become warnings and skip only that file (REQ: partial-tolerance).

func (Adapter) Version

func (Adapter) Version() string

Version returns the adapter version stamped into every emitted fact.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL