systemspec

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package systemspec provides system-spec extraction for knowledge graphs. It extracts infrastructure topology from system-spec JSON files, enabling queries that span both code and infrastructure.

Index

Constants

View Source
const (
	// Language is the canonical name for system-spec.
	Language = "system-spec"

	// NodePrefix is the prefix for system-spec node IDs.
	// Note: system-spec uses its own prefixes (svc:, rds:, etc.) so this is not used.
	NodePrefix = ""
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Extractor

type Extractor struct {
	// contains filtered or unexported fields
}

Extractor implements provider.LanguageExtractor for system-spec JSON files. It wraps the system-spec graphize.Provider to integrate with graphize's extraction pipeline.

func New

func New() *Extractor

New creates a new system-spec extractor.

func (*Extractor) CanExtract

func (e *Extractor) CanExtract(path string) bool

CanExtract returns true if the file is a system-spec JSON document. It checks for the presence of "name" and "services" fields at the root.

func (*Extractor) DetectFramework

func (e *Extractor) DetectFramework(path string) *provider.FrameworkInfo

DetectFramework returns nil as system-spec is not a code framework.

func (*Extractor) Extensions

func (e *Extractor) Extensions() []string

Extensions returns JSON file extension. Note: Not all JSON files are system-spec files; CanExtract does content detection.

func (*Extractor) ExtractFile

func (e *Extractor) ExtractFile(path, baseDir string) ([]*graph.Node, []*graph.Edge, error)

ExtractFile extracts nodes and edges from a system-spec JSON file. It produces:

  • System node (system:<name>)
  • Service nodes (svc:<name>) with links_to edges to repos
  • Cloud resource nodes (rds:, sqs:, s3:, etc.)
  • Connection edges between services
  • Deployment nodes (helm:, terraform:)

func (*Extractor) Language

func (e *Extractor) Language() string

Language returns "system-spec".

Jump to

Keyboard shortcuts

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