1.3 KiB
1.3 KiB
Raw output pointers (diff-ref mode)
The generated patch is committed; per the diff-ref decision rule the verbatim content is the diff itself:
git diff 3a5cfde0~1..3a5cfde0 -- docs/_ext/d2diagrams.py
Generation notes (non-code, verbatim)
RenderResultenum added;render_svg()return type changedbool -> RenderResult. Mapping inrun():FAILED->state_machine.reporter.error(...),NO_OUTPUT-> raw.d2source as aliteral_block,OK/FELL_BACK->image.- Atomicity via
tempfile.mkstemp(dir=out.parent, ...)+os.replace(tmp, out); temp unlinked on any failure path. - Collision guard: module-level
_seen_outputs: dict[str,str]keyed by output basename, cleared by abuilder-initedhandler connected insetup(). parallel_read_safe/parallel_write_safekeptTruebut now justified by the atomic swap (documented inline).- Empirical verification performed before commit:
- broken
.d2+sphinx-build -W-> exit 1, ERROR node rendered, committedactor_tree.svgmd5 unchanged, - duplicate-stem orphan page -> “d2 output collision” error,
nix run nixpkgs#d2forced re-render -> deterministic (no git drift), no.tmpresidue,ruff checkclean.
- broken