Injectable host interface: every file-system and git access of the DNA
engine goes through this seam, so the engine core stays free of
dart:io/Process and can be compiled to WebAssembly (the JS bridge
injects node callbacks instead).
Outcome of one instantiation run (see the golden-update semantics in
the README): hand-modified instances fail without writing, pending
updates are written and reported once, an up-to-date project passes.
DnaHost backed by dart:io and the local git binary. This file is
the only place binding the engine to the real platform — the engine
core itself must not import dart:io.
Runs one instantiation over targetRoot: expands the inheritance
tree, merges all dna/ replicas (last override wins), renders markdown
markers, substitutes variables, converts file naming and reconciles the
generated state with the project — honoring instance ownership from the
manifest and the per-file guard (no existing file with uncommitted work
is ever overwritten).
The paths below <root>/dna/ that escape a leading dot with dot_
instead of dot-, project-relative. Only dot- is decoded, so these
would instantiate as literal dot_… folders.
Parses git status --porcelainoutput into paths relative to the
folder identified by prefix (the repo-root-relative path of that
folder, as printed by git rev-parse --show-prefix). Rename entries
contribute both their old and their new path.
Reads the DNA config of targetRoot from dna/_dna.json. A missing
file yields the default config — but only when there is no dna/
folder at all. A dna/ folder without _dna.json is an error: the
config is the only thing that says whether that folder is
hand-authored (role: dna) or engine-generated, and defaulting to
project would let the engine wipe a hand-written DNA. Run
gg_dna init to place the config.
Entry point for the placed DNA test (test/dna/dna_test.dart imports
gg_dna as dev-dependency and calls this). Runs one instantiation over
the current project and throws when the project is not in a clean,
up-to-date DNA state: