workflow

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Overview

@index Full graph build pipeline: spool, batch persistence, and edge resolution.

@index Filesystem walking, per-file parsing, and unreadable-file accounting.

@index Existing-graph file-state loading and change/force detection.

@index Graph building service that orchestrates parsing, persistence, and search indexing.

@index Language package discovery and package-level semantic edge maintenance.

@index Parse-result cache identity and serialization for repeatable full builds.

@index Disk-backed spool records used to bound memory during build and update.

@index Unresolved-edge index compatibility identity for safe semi-naive updates.

@index Incremental update pipeline: spool replay, deletions, and affected-node tracking.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckParseFileSize

func CheckParseFileSize(relPath string, size int64, maxFileBytes int64) error

@intent reject individual files that exceed the configured per-file parse budget before loading them into memory.

func CheckTotalParsedBytes

func CheckTotalParsedBytes(relPath string, current int64, next int64, maxTotalBytes int64) error

@intent stop one build or update pass once cumulative parsed bytes would exceed the configured safety limit.

func ExistingGraphFiles

func ExistingGraphFiles(ctx context.Context, graphStore ingest.GraphStore) ([]string, error)

ExistingGraphFiles returns namespace-scoped graph file paths currently stored. @intent share deletion-scope discovery across CLI and MCP incremental updates

Types

type BuildOptions

type BuildOptions struct {
	Dir                 string
	NoRecursive         bool
	ExcludePatterns     []string
	IncludePaths        []string
	MaxFileBytes        int64
	MaxTotalParsedBytes int64
	SkipSearchRebuild   bool
	FallbackCalls       bool
}

BuildOptions configures one graph build run. @intent 빌드 대상 경로와 탐색 범위를 호출자에서 제어하게 한다.

type BuildResolveOperationTiming

type BuildResolveOperationTiming struct {
	Calls int
	MS    int64
}

BuildResolveOperationTiming reports one resolver operation's call count and elapsed time. @intent show which edge-resolution store operation dominates a full build without changing resolution behavior.

type BuildResolveTiming

type BuildResolveTiming struct {
	Resolver              BuildResolveOperationTiming
	NodesByIDs            BuildResolveOperationTiming
	NodesByFiles          BuildResolveOperationTiming
	NodesByQualifiedNames BuildResolveOperationTiming
	ImportFileNodes       BuildResolveOperationTiming
	EdgesToNodes          BuildResolveOperationTiming
	UpsertEdges           BuildResolveOperationTiming
}

BuildResolveTiming breaks edge resolution into resolver, store-read, and edge-write operations. @intent expose actionable evidence for optimizing the remaining full-build bottleneck.

type BuildStats

type BuildStats struct {
	TotalFiles int
	TotalNodes int
	TotalEdges int
	Unresolved resolve.FilterResolvedDiagnostics
	Timing     BuildTiming
}

BuildStats reports how much content a build processed. @intent CLI와 호출자가 빌드 결과 규모를 사용자에게 보여줄 수 있게 한다.

type BuildTiming

type BuildTiming struct {
	ParseMS          int64
	ParseCacheHits   int
	ParseCacheMisses int
	PersistNodesMS   int64
	ResolveEdgesMS   int64
	SearchRebuildMS  int64
	TotalMS          int64
	Resolve          BuildResolveTiming
}

BuildTiming reports elapsed milliseconds for the major full-build stages. @intent expose actionable stage-level evidence so large-build regressions can be diagnosed without guessing.

type CrossRefSyncer

type CrossRefSyncer interface {
	SyncNamespace(ctx context.Context) error
}

CrossRefSyncer rebuilds cross-namespace reference state after an ingest commit. @intent let build/update trigger cross-ref materialization without depending on its implementation.

type IncrementalSyncer

type IncrementalSyncer = ingestapp.IncrementalSyncer

IncrementalSyncer defines the sync operation Service.Update delegates to. @intent keep filesystem/build policy in service while preserving the existing incremental engine

type Parser

type Parser = ingestapp.Parser

Parser defines the minimum parser behavior required by graph builds. @intent let CLI, MCP, and tests share the same build policy with their parser implementations

type Service

type Service struct {
	Store      ingestapp.GraphStore
	UnitOfWork ingestapp.UnitOfWork
	Search     ingestapp.SearchWriter
	ParseCache ingestapp.ParseCache
	Walkers    map[string]Parser
	Parsers    map[string]Parser
	CrossRefs  CrossRefSyncer
	Logger     *slog.Logger
	// contains filtered or unexported fields
}

Service orchestrates graph building and search document refresh. @intent 파싱 결과 저장과 검색 인덱스 재구성을 하나의 서비스로 묶는다.

func (*Service) Build

func (s *Service) Build(ctx context.Context, opts BuildOptions) (BuildStats, error)

Build walks source files, stores parsed graph data, and rebuilds search docs. @intent perform a full graph build from the specified directory. @sideEffect 파일 시스템을 읽고 그래프 저장소·DB·검색 인덱스를 갱신한다.

func (*Service) Update

func (s *Service) Update(ctx context.Context, opts UpdateOptions) (*ingest.SyncStats, error)

Update incrementally syncs changed files into the graph and optionally rebuilds search. @intent centralize file collection, include path, parse limit, and search policy for update callers

type UnreadableFilesError

type UnreadableFilesError struct {
	Files []string
}

UnreadableFilesError signals that the update path encountered files it could not stat or read while FailOnUnreadable was enabled. @intent give webhook/server callers a structured failure they can surface instead of silent partial sync

func (*UnreadableFilesError) Error

func (e *UnreadableFilesError) Error() string

Error formats the unreadable file failure with a count and a representative sample path. @intent give operators a stable, single-line summary they can grep instead of dumping every path.

type UpdateOptions

type UpdateOptions struct {
	BuildOptions
	Syncer           IncrementalSyncer
	Replace          bool
	FailOnUnreadable bool
}

UpdateOptions configures one incremental graph sync run. @intent reuse Service traversal and parse limit policy for CLI and MCP updates

Jump to

Keyboard shortcuts

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