1 min read
pyssg.core.dependency
Dependency and Connection.
Two distinct concepts, deliberately separated:
Dependencyis the intent to reference something (immutable, hashable, cacheable) emitted by a parser before resolution.Connectionis the resolved relation living in the graph. It carries the incremental-invalidation semantics (sensitive_to/restart_phase/reverse) and is the single most important integration point for the incremental engine.
class Dependency
An unresolved reference request emitted by a parser.
Frozen and hashable so it can be cached and diffed across reparses.
meta is a tuple of pairs (not a dict) precisely to stay hashable.
class Connection
A resolved edge in the dependency graph.
dst is None while unresolved (a placeholder, e.g. a broken
wikilink). sensitive_to lists which aspects of dst propagate dirt
to src; restart_phase is the phase src re-enters when they do;
reverse indicates whether the edge is indexed for in_edges lookups
(backlinks require True).