Expand description
Page dependency graph for incremental rebuilds.
DepGraph tracks four things:
- Edges —
consumer → set<dependency>. A page declares a dependency on every template, partial, and data file the compiler will read while rendering it. Edges are reflexive (a page depends on itself). - Outputs —
source → set<output>. The compiler may emit several artefacts per source (foo.md → public/foo/index.html, plus a sitemap entry, an RSS entry, an SBOM entry). The output set drives the AC5 delete sweep. - Hashes —
path → sha256. The freshness key. A source is “changed” iff its current SHA-256 differs from the cached value (or no cached value exists, i.e. it’s new). - Schema version — bumped when the on-disk JSON layout changes. Loading a graph with a stale version triggers a poisoning-resistant fallback to a full rebuild (AC6).
Transitive edges are resolved on demand by DepGraph::invalidated
via BFS over the reverse edge map. Persistence is atomic — the
graph is written to .tmp then renamed (POSIX guarantee).
Structs§
- DepGraph
- Dependency graph mapping consumers to their dependencies.
- Diff
- Result of
DepGraph::diff.
Constants§
- CACHE_
DIRNAME - Subdirectory of the cache root where the graph lives.
- DEP_
GRAPH_ FILE - Filename used for the persisted graph under
target/ssg-cache/. Issue #524 spec.
Functions§
- current_
hashes - Walks every tracked source on disk and returns
path → sha256(content). Used byDepGraph::diffon the incremental hot path. Sources that disappear silently drop out. - populate
- Reads every
.mdfile undercontent_dirand every.htmlfile undertemplate_dir, recording: