Skip to content

refactor: Extract diagram library to sini/den-diagram#564

Open
sini wants to merge 15 commits into
denful:mainfrom
sini:feat/den-diagram-extraction
Open

refactor: Extract diagram library to sini/den-diagram#564
sini wants to merge 15 commits into
denful:mainfrom
sini:feat/den-diagram-extraction

Conversation

@sini
Copy link
Copy Markdown
Collaborator

@sini sini commented May 21, 2026

Summary

  • Extract den's diagram library (nix/lib/diag/) into standalone repo denful/den-diagram
  • Den keeps only capture.nix (fx pipeline tracing); all graph IR, renderers, filters, fleet views, and export helpers move to den-diagram
  • den-diagram depends only on nixpkgs.lib — no circular dependency
  • Templates (diagram-demo, fleet-demo) use two-step pattern: capture in den, render in den-diagram
  • Den CI has zero den-diagram dependency — capture tests stay, context/graph tests moved to den-diagram's own test suite (13 tests)

Changes

Area What changed
nix/lib/diag/ Reduced to capture.nix only (30 files removed)
nix/lib/default.nix diagcapture
templates/diagram-demo Uses inputs.den-diagram.lib for rendering
templates/fleet-demo Uses inputs.den-diagram.lib for rendering
templates/ci Capture tests updated, context tests moved to den-diagram
ci.bash No den-diagram override needed
CLAUDE.md Documents new two-step capture+render pattern

Test plan

  • 828/828 den CI tests passing
  • 13/13 den-diagram tests passing (context, graph, fleet, namespace)
  • diagram-demo packages evaluate
  • fleet-demo packages evaluate
  • No den.lib.diag references remain in den
  • Den CI has zero den-diagram dependency

@sini sini requested a review from vic as a code owner May 21, 2026 17:21
@github-actions github-actions Bot added the allow-ci allow all CI integration tests label May 21, 2026
@sini sini changed the title Extract diagram library to sini/den-diagram refactor: Extract diagram library to sini/den-diagram May 21, 2026
@sini sini force-pushed the feat/den-diagram-extraction branch from 275e5dc to f877c38 Compare May 21, 2026 18:54
Copy link
Copy Markdown
Collaborator

@drupol drupol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sense!

sini added 3 commits May 21, 2026 19:30
Replace standalone captureWithPathsWith + resolveEntity captures with
diagram.projectScope which projects the fleet capture onto scope
subtrees. One fleet pipeline run, N projections — more accurate (sees
full policy resolution) and more performant.

Both fleet-demo and diagram-demo updated. Pin den-diagram to
feat/fleet-subtree-context.
@sini sini force-pushed the feat/den-diagram-extraction branch from 486d8f4 to 9cd92f1 Compare May 25, 2026 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

allow-ci allow all CI integration tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants