Documentation
¶
Overview ¶
@index GORM persistence adapter for git-diff change-risk analysis.
@index Namespace-agnostic graph reader that merges cross_refs into traversal edges for cross-repository analysis.
@index GORM adapter for materialized cross-namespace reference rows and ccg ref resolution.
@index GORM read adapter for documentation generation and lint facts.
@index GORM persistence adapter for atomic stored-flow rebuilds.
@index GORM persistence adapter for predefined analysis graph queries.
@index GORM read models for MCP graph, context, namespace, and change surfaces.
@index GORM graph statistics adapter for operator and protocol read surfaces.
@index GORM-based graph repository that manages CRUD operations and transactions for nodes, edges, and annotations.
@index GORM unit-of-work adapter for atomic graph and derived search updates.
@index GORM persistence for unresolved-edge reverse lookup and readiness state.
@index GORM read adapter for eager and lazy built-in Wiki tree construction.
Index ¶
- type CrossNamespaceReader
- func (r *CrossNamespaceReader) GetEdgesFrom(ctx context.Context, nodeID uint) ([]graph.Edge, error)
- func (r *CrossNamespaceReader) GetEdgesFromNodes(ctx context.Context, nodeIDs []uint) ([]graph.Edge, error)
- func (r *CrossNamespaceReader) GetEdgesTo(ctx context.Context, nodeID uint) ([]graph.Edge, error)
- func (r *CrossNamespaceReader) GetEdgesToNodes(ctx context.Context, nodeIDs []uint) ([]graph.Edge, error)
- func (r *CrossNamespaceReader) GetNodeByID(ctx context.Context, id uint) (*graph.Node, error)
- func (r *CrossNamespaceReader) GetNodesByIDs(ctx context.Context, ids []uint) ([]graph.Node, error)
- type SearchWriterFactory
- type Store
- func (s *Store) AffectedFlowsPage(ctx context.Context, changedNodeIDs []uint, limit, offset int) ([]analyze.AffectedFlow, bool, error)
- func (s *Store) Annotations(ctx context.Context, ids []uint) (map[uint]*graph.Annotation, error)
- func (s *Store) AutoMigrate() error
- func (s *Store) CCGRefExists(ctx context.Context, ref reference.Ref) (bool, error)
- func (s *Store) CallEdges(ctx context.Context, anchorID uint, peerIDs []uint, ...) (map[uint]graph.Edge, error)
- func (s *Store) CreateFlow(ctx context.Context, flow *graph.Flow) error
- func (s *Store) CrossNamespaceReader() *CrossNamespaceReader
- func (s *Store) DeleteEdgesByFile(ctx context.Context, filePath string) error
- func (s *Store) DeleteFlows(ctx context.Context) error
- func (s *Store) DeleteGraph(ctx context.Context) error
- func (s *Store) DeleteNodesByFile(ctx context.Context, filePath string) error
- func (s *Store) DeleteNodesByFiles(ctx context.Context, filePaths []string) error
- func (s *Store) DeletePackageSemanticEdges(ctx context.Context, anchors []string) error
- func (s *Store) DeleteUnresolvedEdgesByFingerprints(ctx context.Context, fingerprints []string) error
- func (s *Store) FileSymbols(ctx context.Context, filePath string, kinds []graph.NodeKind) ([]graph.Node, error)
- func (s *Store) FindFlowEntrypoints(ctx context.Context) ([]graph.Node, error)
- func (s *Store) FindUnresolvedEdgesByFiles(ctx context.Context, filePaths []string) ([]graph.Edge, error)
- func (s *Store) FindUnresolvedEdgesByLookupKeys(ctx context.Context, keys []string) ([]graph.Edge, error)
- func (s *Store) FlowsPage(ctx context.Context, sortBy string, limit, offset int) ([]analyze.FlowSummary, bool, error)
- func (s *Store) GetAnnotation(ctx context.Context, nodeID uint) (*graph.Annotation, error)
- func (s *Store) GetEdgesFrom(ctx context.Context, nodeID uint) ([]graph.Edge, error)
- func (s *Store) GetEdgesFromNodes(ctx context.Context, nodeIDs []uint) ([]graph.Edge, error)
- func (s *Store) GetEdgesTo(ctx context.Context, nodeID uint) ([]graph.Edge, error)
- func (s *Store) GetEdgesToNodes(ctx context.Context, nodeIDs []uint) ([]graph.Edge, error)
- func (s *Store) GetFileNodesByPathSuffix(ctx context.Context, suffix string) ([]graph.Node, error)
- func (s *Store) GetNode(ctx context.Context, qualifiedName string) (*graph.Node, error)
- func (s *Store) GetNodeByID(ctx context.Context, id uint) (*graph.Node, error)
- func (s *Store) GetNodesByFile(ctx context.Context, filePath string) ([]graph.Node, error)
- func (s *Store) GetNodesByFiles(ctx context.Context, filePaths []string) (map[string][]graph.Node, error)
- func (s *Store) GetNodesByIDs(ctx context.Context, ids []uint) ([]graph.Node, error)
- func (s *Store) GetNodesByQualifiedNames(ctx context.Context, names []string) (map[string][]graph.Node, error)
- func (s *Store) GraphStatistics(ctx context.Context) (analyze.GraphStatistics, error)
- func (s *Store) GraphView(ctx context.Context, limit int, edgeKinds []graph.EdgeKind) (wiki.GraphView, error)
- func (s *Store) HasSymbol(ctx context.Context, filePath string, kinds []graph.NodeKind) (bool, error)
- func (s *Store) ListAnnotationCCGRefs(ctx context.Context, namespace string) ([]crossrefapp.AnnotationRef, error)
- func (s *Store) ListFileNodes(ctx context.Context) ([]graph.Node, error)
- func (s *Store) ListImportFileNodes(ctx context.Context) ([]graph.Node, error)
- func (s *Store) ListInboundCrossRefs(ctx context.Context, toNamespace string) ([]graph.CrossRef, error)
- func (s *Store) ListOutboundCrossRefs(ctx context.Context, fromNamespace string) ([]graph.CrossRef, error)
- func (s *Store) LoadParseResult(ctx context.Context, key ingest.ParseCacheKey) ([]byte, bool, error)
- func (s *Store) MarkUnresolvedIndexReady(ctx context.Context, version string) error
- func (s *Store) Namespaces(ctx context.Context) ([]string, error)
- func (s *Store) NamespacesPage(ctx context.Context, limit, offset int) ([]analyze.NamespaceSummary, bool, error)
- func (s *Store) NavigationNodes(ctx context.Context, kinds []graph.NodeKind) ([]graph.Node, error)
- func (s *Store) NodesByExactName(ctx context.Context, name string, limit int) ([]graph.Node, error)
- func (s *Store) NodesByFile(ctx context.Context, filePath string) ([]graph.Node, error)
- func (s *Store) NodesByFiles(ctx context.Context, filePaths []string) ([]graph.Node, error)
- func (s *Store) OutgoingDocEdges(ctx context.Context, namespace string, ids []uint) (map[uint][]graph.Edge, error)
- func (s *Store) OutgoingEdgeCounts(ctx context.Context, nodeIDs []uint) (map[uint]int64, error)
- func (s *Store) PathNodes(ctx context.Context, folderPath string, kinds []graph.NodeKind) ([]graph.Node, error)
- func (s *Store) QualifiedNameExists(ctx context.Context, namespace, name string) (bool, error)
- func (s *Store) RelatedNodes(ctx context.Context, request analyzeapp.RelatedNodesRequest) (analyzeapp.RelatedNodesPage, error)
- func (s *Store) ReplaceCrossRefsFrom(ctx context.Context, fromNamespace string, refs []graph.CrossRef) error
- func (s *Store) ResolveCCGRef(ctx context.Context, ref reference.Ref) (uint, bool, error)
- func (s *Store) ResolveReference(ctx context.Context, ref *reference.Ref) (*graph.Node, error)
- func (s *Store) Snapshot(ctx context.Context, namespace string, kinds []graph.NodeKind) (docsapp.Snapshot, error)
- func (s *Store) StoreParseResult(ctx context.Context, key ingest.ParseCacheKey, payload []byte) error
- func (s *Store) StoredNode(ctx context.Context, kind graph.NodeKind, filePath string) (*graph.Node, error)
- func (s *Store) SymbolNode(ctx context.Context, qualifiedName string, kinds []graph.NodeKind) (*graph.Node, error)
- func (s *Store) TopCommunities(ctx context.Context, limit int) ([]analyze.NamedCount, error)
- func (s *Store) TopFlows(ctx context.Context, limit int) ([]analyze.NamedCount, error)
- func (s *Store) UnresolvedIndexReady(ctx context.Context, version string) (bool, error)
- func (s *Store) UntestedCount(ctx context.Context, nodeIDs []uint) (int, error)
- func (s *Store) UpdateCrossRefResolution(ctx context.Context, id uint, resolvedNodeID *uint, ...) error
- func (s *Store) UpsertAnnotation(ctx context.Context, ann *graph.Annotation) error
- func (s *Store) UpsertAnnotations(ctx context.Context, annotations []*graph.Annotation) error
- func (s *Store) UpsertEdges(ctx context.Context, edges []graph.Edge) error
- func (s *Store) UpsertNodes(ctx context.Context, nodes []graph.Node) error
- func (s *Store) UpsertUnresolvedEdges(ctx context.Context, candidates []graph.UnresolvedEdgeCandidate) error
- func (s *Store) WithTx(ctx context.Context, fn func(store ingest.GraphStore) error) error
- func (s *Store) WithTxDB(ctx context.Context, fn func(ingest.GraphStore, *gorm.DB) error) error
- func (s *Store) WithinFlowRebuild(ctx context.Context, fn func(analyzeapp.FlowRebuildStore) error) error
- type UnitOfWork
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CrossNamespaceReader ¶
type CrossNamespaceReader struct {
// contains filtered or unexported fields
}
CrossNamespaceReader reads nodes and edges across every namespace and augments traversal with synthetic cross_ref edges derived from resolved cross-namespace references. @intent let impact and flow analysis walk across repository boundaries declared by annotations. @domainRule node ids are globally unique, so id-based reads are safe without a namespace filter.
func (*CrossNamespaceReader) GetEdgesFrom ¶
GetEdgesFrom returns outgoing edges of one node across namespaces, including cross refs. @intent satisfy the impact analyzer contract for cross-namespace traversal.
func (*CrossNamespaceReader) GetEdgesFromNodes ¶
func (r *CrossNamespaceReader) GetEdgesFromNodes(ctx context.Context, nodeIDs []uint) ([]graph.Edge, error)
GetEdgesFromNodes returns outgoing edges of the node set across namespaces, including cross refs. @intent expand traversal frontiers across repository boundaries in one query pair.
func (*CrossNamespaceReader) GetEdgesTo ¶
GetEdgesTo returns incoming edges of one node across namespaces, including cross refs. @intent satisfy the impact analyzer contract for reverse cross-namespace traversal.
func (*CrossNamespaceReader) GetEdgesToNodes ¶
func (r *CrossNamespaceReader) GetEdgesToNodes(ctx context.Context, nodeIDs []uint) ([]graph.Edge, error)
GetEdgesToNodes returns incoming edges of the node set across namespaces, including cross refs. @intent let impact analysis find foreign namespaces that depend on the target nodes.
func (*CrossNamespaceReader) GetNodeByID ¶
GetNodeByID retrieves one node by primary key regardless of namespace. @intent resolve traversal frontiers that crossed into another namespace.
func (*CrossNamespaceReader) GetNodesByIDs ¶
GetNodesByIDs retrieves nodes by primary key regardless of namespace. @intent load result nodes for cross-namespace traversals in one query.
type SearchWriterFactory ¶
type SearchWriterFactory func(tx *gorm.DB) ingest.SearchWriter
SearchWriterFactory binds a search writer to the active GORM transaction. @intent construct derived-state persistence with the same transaction handle as graph persistence.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is the GORM-backed GraphStore implementation. @intent implement the graph repository contract through a GORM DB handle.
func New ¶
New creates a repository wrapping a GORM DB. @intent initialize the GraphStore implementation with the injected DB handle.
func (*Store) AffectedFlowsPage ¶
func (s *Store) AffectedFlowsPage(ctx context.Context, changedNodeIDs []uint, limit, offset int) ([]analyze.AffectedFlow, bool, error)
@intent map changed nodes to one deterministic page of namespace-scoped stored flows.
func (*Store) Annotations ¶
@intent batch-load Wiki annotations with deterministic tag ordering.
func (*Store) AutoMigrate ¶
AutoMigrate creates or updates the graph repository schema. @intent prepare the GORM model tables required for graph persistence. @sideEffect may modify the database schema.
func (*Store) CCGRefExists ¶
@intent validate parsed cross-namespace ccg references against graph path and symbol semantics.
func (*Store) CallEdges ¶
func (s *Store) CallEdges(ctx context.Context, anchorID uint, peerIDs []uint, direction analyze.EdgeDirection) (map[uint]graph.Edge, error)
@intent select the strongest call evidence edge for each requested peer node.
func (*Store) CreateFlow ¶
CreateFlow persists one flow and its ordered memberships through the active transaction. @intent store traced flow aggregates while keeping generated IDs visible to application results. @sideEffect inserts a flow row and zero or more flow-membership rows. @mutates flow.ID and each flow.Members item FlowID.
func (*Store) CrossNamespaceReader ¶
func (s *Store) CrossNamespaceReader() *CrossNamespaceReader
CrossNamespaceReader returns a namespace-agnostic reader over the same database. @intent derive the cross-repository read surface from an existing store without new wiring inputs.
func (*Store) DeleteEdgesByFile ¶
DeleteEdgesByFile removes edges generated from a file. @intent selectively clean existing relationships during file-scoped updates. @sideEffect deletes matching file_path records from the edges table.
func (*Store) DeleteFlows ¶
DeleteFlows removes all stored flows and memberships in the active namespace. @intent clear stale flow state before a transaction-scoped rebuild. @sideEffect deletes namespace-owned flow and flow-membership rows.
func (*Store) DeleteGraph ¶
DeleteGraph removes the entire graph state for the current namespace. @intent replace namespace-scoped state before a full rebuild or include_paths rebuild. @sideEffect deletes all nodes, edges, annotations, and doc_tags in the namespace. @domainRule namespace-owned search documents are deleted directly before node-scoped dependent cleanup.
func (*Store) DeleteNodesByFile ¶
DeleteNodesByFile removes nodes in a file and their related data. @intent keep the single-file API compatible while delegating cleanup to the bounded batch path. @sideEffect deletes related records from the nodes, edges, annotations, and doc_tags tables. @domainRule connected edges and annotations must also be removed when deleting a file.
func (*Store) DeleteNodesByFiles ¶
DeleteNodesByFiles removes nodes and dependent graph rows for bounded file-path batches. @intent replace per-file deletion round trips with one transaction and a fixed deletion sequence per path chunk. @sideEffect deletes unresolved candidates, edges, annotations/tags, memberships, search documents, and nodes. @domainRule only rows owned by the request namespace and rows connected to its deleted nodes may be removed.
func (*Store) DeletePackageSemanticEdges ¶
DeletePackageSemanticEdges removes synthesized package-level implementation edges for anchor files. @intent replace stale package semantic relationships without exposing persistence queries to the application layer. @sideEffect deletes namespace-scoped edge rows matching the supplied anchors. @domainRule only synthesized implements edges, identified by line zero, are eligible for deletion.
func (*Store) DeleteUnresolvedEdgesByFingerprints ¶
func (s *Store) DeleteUnresolvedEdgesByFingerprints(ctx context.Context, fingerprints []string) error
DeleteUnresolvedEdgesByFingerprints removes every lookup-key row for resolved syntax edges. @intent keep the reverse index limited to relationships that still lack endpoints.
func (*Store) FileSymbols ¶
func (s *Store) FileSymbols(ctx context.Context, filePath string, kinds []graph.NodeKind) ([]graph.Node, error)
@intent load stable symbol children for one lazy Wiki file node.
func (*Store) FindFlowEntrypoints ¶
FindFlowEntrypoints returns function/test nodes with no inbound call-kind edge. @intent provide deterministic namespace-scoped entrypoints for stored-flow rebuild policy. @domainRule inbound detection includes every kind returned by graph.CallEdgeKinds.
func (*Store) FindUnresolvedEdgesByFiles ¶
func (s *Store) FindUnresolvedEdgesByFiles(ctx context.Context, filePaths []string) ([]graph.Edge, error)
FindUnresolvedEdgesByFiles loads every candidate edge owned by the selected affected files. @intent replay import warmup and related edges together after reverse-index selection narrows source files.
func (*Store) FindUnresolvedEdgesByLookupKeys ¶
func (s *Store) FindUnresolvedEdgesByLookupKeys(ctx context.Context, keys []string) ([]graph.Edge, error)
FindUnresolvedEdgesByLookupKeys finds deduplicated syntax edges matching newly added symbol keys. @intent use the reverse index to identify affected unchanged source files.
func (*Store) FlowsPage ¶
func (s *Store) FlowsPage(ctx context.Context, sortBy string, limit, offset int) ([]analyze.FlowSummary, bool, error)
@intent load one stable namespace-scoped stored-flow page with member counts.
func (*Store) GetAnnotation ¶
GetAnnotation retrieves the annotation attached to a node ID. @intent load a node's structured comment and tags together for search and display. @return returns nil when no annotation exists.
func (*Store) GetEdgesFrom ¶
GetEdgesFrom retrieves outgoing edges from a node. @intent load outbound relationships for a specific declaration.
func (*Store) GetEdgesFromNodes ¶
GetEdgesFromNodes retrieves outgoing edges from multiple nodes. @intent load outbound relationships for multiple declarations in one call. @return returns a nil slice when nodeIDs is empty.
func (*Store) GetEdgesTo ¶
GetEdgesTo retrieves incoming edges to a node. @intent load inbound relationships for a specific declaration.
func (*Store) GetEdgesToNodes ¶
GetEdgesToNodes retrieves incoming edges to multiple nodes. @intent load inbound relationships for multiple declarations in one call. @return returns a nil slice when nodeIDs is empty.
func (*Store) GetFileNodesByPathSuffix ¶
GetFileNodesByPathSuffix finds file nodes whose directory matches an import-path suffix. @intent let import edge resolution bind repo-local import paths back to stored file nodes.
func (*Store) GetNode ¶
GetNode retrieves a single node by qualified name. @intent find one node by the declaration's qualified name. @return returns nil when no node exists.
func (*Store) GetNodeByID ¶
GetNodeByID retrieves a single node by primary key. @intent find one node by its internal identifier. @return returns nil when no node exists.
func (*Store) GetNodesByFile ¶
GetNodesByFile retrieves nodes belonging to a file path. @intent load declarations parsed from a specific source file.
func (*Store) GetNodesByFiles ¶
func (s *Store) GetNodesByFiles(ctx context.Context, filePaths []string) (map[string][]graph.Node, error)
GetNodesByFiles retrieves nodes from multiple files grouped by file path. @intent return declarations for a file set grouped by path. @return returns a map whose keys are file paths and values are the nodes in each file.
func (*Store) GetNodesByIDs ¶
GetNodesByIDs retrieves nodes matching the provided ID list. @intent load multiple nodes at once by internal identifier. @return returns a nil slice when ids is empty.
func (*Store) GetNodesByQualifiedNames ¶
func (s *Store) GetNodesByQualifiedNames(ctx context.Context, names []string) (map[string][]graph.Node, error)
GetNodesByQualifiedNames loads a set of names into a node map. @intent build a fast lookup map for qualified-name-based reference resolution. @return returns a map keyed by QualifiedName, with slices containing all nodes for each name.
func (*Store) GraphStatistics ¶
GraphStatistics loads totals and grouped distributions for the active namespace. @intent implement the application statistics port while preserving namespace filtering and aggregate semantics.
func (*Store) GraphView ¶
func (s *Store) GraphView(ctx context.Context, limit int, edgeKinds []graph.EdgeKind) (wiki.GraphView, error)
GraphView loads a bounded stable node set and only edges contained within it. @intent implement the Wiki force-graph read port with deterministic ordering and limits.
func (*Store) HasSymbol ¶
func (s *Store) HasSymbol(ctx context.Context, filePath string, kinds []graph.NodeKind) (bool, error)
@intent answer whether a lazy file node has expandable symbol children.
func (*Store) ListAnnotationCCGRefs ¶
func (s *Store) ListAnnotationCCGRefs(ctx context.Context, namespace string) ([]crossrefapp.AnnotationRef, error)
ListAnnotationCCGRefs returns every @see ccg:// tag value declared by nodes of one namespace. @intent collect the source facts for rebuilding a namespace's outbound cross refs.
func (*Store) ListFileNodes ¶
ListFileNodes returns the minimal persisted state used to compare source files during an update. @intent expose namespace-scoped file identity and hash state without leaking the database handle.
func (*Store) ListImportFileNodes ¶
ListImportFileNodes returns actual file nodes for build-scoped import-path resolution. @intent let full builds create an in-memory import suffix index without reloading all file nodes per import.
func (*Store) ListInboundCrossRefs ¶
func (s *Store) ListInboundCrossRefs(ctx context.Context, toNamespace string) ([]graph.CrossRef, error)
ListInboundCrossRefs returns refs from other namespaces that target the given namespace. @intent select the rows whose resolution may change after this namespace rebuilds. @domainRule self-namespace refs are excluded because the outbound rebuild already re-resolved them.
func (*Store) ListOutboundCrossRefs ¶
func (s *Store) ListOutboundCrossRefs(ctx context.Context, fromNamespace string) ([]graph.CrossRef, error)
ListOutboundCrossRefs returns every cross ref originating from one namespace. @intent expose a namespace's declared external dependencies for listing and analysis.
func (*Store) LoadParseResult ¶
func (s *Store) LoadParseResult(ctx context.Context, key ingest.ParseCacheKey) ([]byte, bool, error)
LoadParseResult returns a cached parser payload only when every identity field matches. @intent prevent stale parser output from being reused across content, path, parser, context, or namespace changes.
func (*Store) MarkUnresolvedIndexReady ¶
MarkUnresolvedIndexReady marks the current namespace and producer version after a successful full candidate pass. @intent distinguish a compatible legitimately empty reverse index from stale or uninitialized state. @sideEffect inserts or updates unresolved_index_states.
func (*Store) Namespaces ¶
Namespaces returns distinct stored namespaces in stable order. @intent implement Wiki namespace discovery without exposing persistence to HTTP.
func (*Store) NamespacesPage ¶
func (s *Store) NamespacesPage(ctx context.Context, limit, offset int) ([]analyze.NamespaceSummary, bool, error)
@intent load one stable global namespace page with node counts.
func (*Store) NavigationNodes ¶
@intent load the stable graph snapshot from which the eager Wiki hierarchy is derived.
func (*Store) NodesByExactName ¶
NodesByExactName loads deterministic namespace-scoped short-name matches. @intent support exact-name fallback suggestions through the analysis repository.
func (*Store) NodesByFile ¶
NodesByFile loads all namespace-scoped nodes belonging to one file. @intent supply file-summary inputs without exposing database filtering to app policy.
func (*Store) NodesByFiles ¶
NodesByFiles loads deterministic namespace-scoped graph nodes for changed files. @intent supply diff-overlap inputs without exposing database filters to change policy.
func (*Store) OutgoingDocEdges ¶
func (s *Store) OutgoingDocEdges(ctx context.Context, namespace string, ids []uint) (map[uint][]graph.Edge, error)
@intent load call/import relationships rendered beneath symbol documentation.
func (*Store) OutgoingEdgeCounts ¶
OutgoingEdgeCounts returns namespace-scoped outgoing edge counts keyed by source node ID. @intent provide risk-weight inputs through one grouped persistence query.
func (*Store) PathNodes ¶
func (s *Store) PathNodes(ctx context.Context, folderPath string, kinds []graph.NodeKind) ([]graph.Node, error)
@intent load stable path-bearing candidates below one lazy Wiki folder or package.
func (*Store) QualifiedNameExists ¶
@intent validate local @see targets within the active docs namespace.
func (*Store) RelatedNodes ¶
func (s *Store) RelatedNodes(ctx context.Context, request analyzeapp.RelatedNodesRequest) (analyzeapp.RelatedNodesPage, error)
RelatedNodes loads one deterministic distinct relationship page and its total count. @intent implement namespace-scoped relationship joins behind the analysis query repository.
func (*Store) ReplaceCrossRefsFrom ¶
func (s *Store) ReplaceCrossRefsFrom(ctx context.Context, fromNamespace string, refs []graph.CrossRef) error
ReplaceCrossRefsFrom atomically replaces every cross ref originating from one namespace. @intent make outbound cross-ref state a pure function of the namespace's current annotations. @sideEffect deletes and inserts cross_refs rows in one transaction.
func (*Store) ResolveCCGRef ¶
ResolveCCGRef resolves a parsed ccg:// reference to a target node id. @intent give cross-ref materialization the concrete node identity behind a symbolic reference. @domainRule namespace-scope refs resolve with a zero node id when the namespace has any nodes. @domainRule path-scope refs prefer the file node of the path; remaining ties resolve to the lowest node id.
func (*Store) ResolveReference ¶
ResolveReference finds the first deterministic graph node matching a parsed CCG reference. @intent resolve Wiki reference navigation while keeping GORM filtering and preload behavior in the outbound adapter.
func (*Store) Snapshot ¶
func (s *Store) Snapshot(ctx context.Context, namespace string, kinds []graph.NodeKind) (docsapp.Snapshot, error)
@intent load documentable nodes and their annotations from one namespace.
func (*Store) StoreParseResult ¶
func (s *Store) StoreParseResult(ctx context.Context, key ingest.ParseCacheKey, payload []byte) error
StoreParseResult replaces the latest cached parser payload for one namespace/file path. @intent retain one bounded current cache entry per source path instead of accumulating every historical hash. @sideEffect inserts or updates a parse_cache_entries row.
func (*Store) StoredNode ¶
func (s *Store) StoredNode(ctx context.Context, kind graph.NodeKind, filePath string) (*graph.Node, error)
@intent resolve one stored package or file used as a lazy Wiki root.
func (*Store) SymbolNode ¶
func (s *Store) SymbolNode(ctx context.Context, qualifiedName string, kinds []graph.NodeKind) (*graph.Node, error)
@intent resolve the first deterministic symbol match used by direct lazy navigation.
func (*Store) TopCommunities ¶
@intent rank namespace communities by stored membership count.
func (*Store) UnresolvedIndexReady ¶
UnresolvedIndexReady reports whether a compatible full build populated the namespace's reverse index. @intent gate semi-naive update on complete historical unresolved-edge coverage produced by the expected algorithm and parsers.
func (*Store) UntestedCount ¶
@intent count requested nodes without a namespace-scoped tested_by edge.
func (*Store) UpdateCrossRefResolution ¶
func (s *Store) UpdateCrossRefResolution(ctx context.Context, id uint, resolvedNodeID *uint, status graph.CrossRefStatus) error
UpdateCrossRefResolution updates one row's derived resolution state. @intent remap or invalidate a reference after its target namespace rebuilt. @sideEffect updates resolved_node_id and status of one cross_refs row.
func (*Store) UpsertAnnotation ¶
UpsertAnnotation stores a node's annotation and tags. @intent keep the single-annotation API compatible while delegating persistence to the batch path. @sideEffect performs inserts, updates, and deletes on the annotations and doc_tags tables. @mutates may overwrite ann.ID with the existing record ID. @domainRule only one annotation must be kept per node_id.
func (*Store) UpsertAnnotations ¶
UpsertAnnotations replaces annotations and tags for a batch of namespace-owned nodes. @intent collapse per-annotation lookup and write round trips into bounded batch operations. @sideEffect inserts or updates annotations, deletes prior tags, and inserts replacement tags in one transaction. @mutates assigns persisted annotation and annotation-tag foreign IDs to input values. @domainRule every node must belong to the request namespace before any annotation in the batch is mutated.
func (*Store) UpsertEdges ¶
UpsertEdges stores a batch of edges keyed by fingerprint. @intent apply graph relationships in bulk without duplicates. @sideEffect performs batch inserts on the edges table. @domainRule edges with the same fingerprint must be stored only once.
func (*Store) UpsertNodes ¶
UpsertNodes stores a batch of nodes keyed by qualified_name. @intent apply parsed result nodes in bulk without creating duplicates. @sideEffect performs batch inserts and updates on the nodes table. @requires nodes must have a non-empty QualifiedName. @ensures existing nodes with the same qualified_name are updated with the latest metadata.
func (*Store) UpsertUnresolvedEdges ¶
func (s *Store) UpsertUnresolvedEdges(ctx context.Context, candidates []graph.UnresolvedEdgeCandidate) error
UpsertUnresolvedEdges stores reverse-index rows without exposing them as traversable graph edges. @intent retain unresolved syntax candidates until a future symbol addition can resolve them. @sideEffect inserts unresolved_edge_candidates rows.
func (*Store) WithTx ¶
WithTx executes the given function inside the same transaction. @intent allow multiple repository operations to run atomically as one unit. @sideEffect starts a database transaction and commits or rolls it back. @ensures commits the transaction when fn returns a nil error.
func (*Store) WithTxDB ¶
WithTxDB passes the transaction DB handle together with the repository. @intent let graph persistence and DB-backed derived-state updates share a single transaction. @sideEffect starts a database transaction and commits or rolls it back.
func (*Store) WithinFlowRebuild ¶
func (s *Store) WithinFlowRebuild(ctx context.Context, fn func(analyzeapp.FlowRebuildStore) error) error
WithinFlowRebuild executes stored-flow replacement against one transaction-scoped store. @intent implement the analysis flow unit of work without exposing GORM to application policy. @sideEffect starts a transaction and commits or rolls back namespace-scoped flow changes.
type UnitOfWork ¶
type UnitOfWork struct {
// contains filtered or unexported fields
}
UnitOfWork implements the ingest atomicity boundary with GORM transactions. @intent coordinate graph and search writes without exposing GORM to application policy.
func NewUnitOfWork ¶
func NewUnitOfWork(db *gorm.DB, newSearchWriter SearchWriterFactory) *UnitOfWork
NewUnitOfWork constructs a GORM-backed ingest unit of work. @intent inject the database transaction owner and transaction-scoped search writer factory.
func (*UnitOfWork) WithinTransaction ¶
func (u *UnitOfWork) WithinTransaction(ctx context.Context, fn func(ingest.Transaction) error) error
WithinTransaction executes graph and search work against one GORM transaction. @intent commit graph and derived search state together or roll both back on any callback error. @sideEffect starts a database transaction and commits or rolls it back. @ensures the callback is not invoked unless both transaction capabilities are available.