Skip to content

Instantly share code, notes, and snippets.

View sini's full-sized avatar

Jason Bowman sini

  • San Francisco, CA, USA
View GitHub Profile
@sini
sini / 2026-04-29-forward-elimination-trait-unification.md
Created April 29, 2026 16:45
Den: Forward Sub-Pipeline Elimination and Trait Delivery Unification

Forward Sub-Pipeline Elimination and Trait Delivery Unification

Problem

Trait data emitted via den.traits never reaches class modules through the entity instantiation path. A class module like { greeting, config, ... }: receives greeting = [] instead of the collected trait data.

Root cause: Two independently correct subsystems — forward sub-pipelines and traitModule injection — were never composed. The entity path goes through applyForwardSpecs → runSubPipeline, which produces class modules but no traitModule. The traitModule is only synthesized in fxResolve, after forward processing completes. The trait thunk fallback (or []) makes the failure silent — no error, no crash, no trace warning.

Why now: Multi-class collection is already in place (classCollectorHandler collects per-class buckets). The forward sub-pipeline redundantly re-collects data the parent pipeline already has from transition sub-pipelines. Eliminating it fixes trait delivery structurally rather than patching ov

@sini
sini / 2026-04-29-flake-scope-pipeline-args-design.md
Last active April 29, 2026 19:20
Den: Flake-Scope Args in Aspect Pipeline Functions — design spec

Flake-Scope Args in Aspect Pipeline Functions

Date: 2026-04-29 Branch: feat/fx-pipeline Status: Design approved

Problem

Aspect functions at the pipeline level can only destructure entity context args (host, user, home) and enrichment args. Flake-scope values like lib, inputs, and den are available as module-level closure args but cannot be destructured in the aspect function signature:

@sini
sini / 2026-04-29-scope-partitioned-pipeline-state.md
Last active April 29, 2026 21:05
Den: Scope-Partitioned Pipeline State — replace sub-pipeline isolation with scope-partitioned state

Scope-Partitioned Pipeline State

Status: Draft (rev 2 — post review)

Problem

The fx pipeline uses isolated sub-pipelines (separate fx.run executions with fresh state) for entity resolution during transitions. This creates three problems:

  1. Forward sub-pipelines are redundant. applyForwardSpecs re-walks source aspects via runSubPipeline to collect class modules that the parent pipeline already collected during transition sub-pipelines. Eliminating this requires entity-scoped class module access, which the flat classImports structure doesn't provide.
@sini
sini / 2026-04-29-entity-class-evaluation.md
Last active April 30, 2026 04:44
Entity-Level Class Evaluation — Eliminating Forwards (den fx pipeline)

Entity-Level Class Evaluation — Eliminating Forwards

Status: Draft

Problem

The forward mechanism exists to wire entity class content into flake outputs. But entity schemas already contain all the information needed: class, instantiate, intoAttr, mainModule. The forward sub-pipeline redundantly re-resolves content that mainModule already produces.

Three output forward modules (osConfigurations.nix, hmConfigurations.nix, flakeSystemOutputs.nix) exist solely to:

  1. Re-resolve an entity's aspect tree (redundant — mainModule does this)
@sini
sini / 2026-04-30-forward-route-unification.md
Last active May 1, 2026 07:52
Den: Forward → Route Unification — eliminate sub-pipelines by converting all forwards to routes

Forward → Route Unification

Date: 2026-04-30 Status: Partial — Tasks 0/1/6 shipped, compat shim blocked (see Blockers) Scope: Eliminate sub-pipelines by converting all forwards to policy.route effects

Problem

The forward mechanism uses post-pipeline sub-pipelines (resolveForwardSource in pipeline.nix) to re-resolve source aspects and extract class modules. This is the single most complex piece of the pipeline:

@sini
sini / 2026-05-01-transition-elimination.md
Created May 1, 2026 15:45
Den: Transition Elimination — replace transitions with policy-driven context expansion

Transition Elimination — Policies as Context Expansion

Date: 2026-05-01 Status: Draft Scope: Replace transition boundaries with policy-driven context expansion

Problem

The into-transition handler in transition.nix (~400 lines) is the most complex piece of the pipeline. It manages:

  • Scope push/pop with explicit stack tracking
@sini
sini / 2026-05-02-fx-pipeline-consolidated.md
Last active May 3, 2026 01:08
Den FX Pipeline Refactor — Consolidated Spec (feat/fx-pipeline, PR #475)

FX Pipeline Refactor — Consolidated Spec

Date: 2026-05-02 Branch: feat/fx-pipeline PR: #475 CI: 629/629 Scope: Refactor narrative, current architecture, remaining work, forward plan

1. Introduction

@sini
sini / policy-registry-activation.md
Created May 5, 2026 19:06
Den policy registry/activation split — design spec

Policy Registry/Activation Split — Design Spec

Date: 2026-05-05 Branch: feat/fx-pipeline (not yet on main) Status: Design draft Prerequisite: None — this is a hard API break, not a migration


1. Problem

@sini
sini / pipes-and-quirks.md
Last active May 6, 2026 19:30
Den Pipes and Quirks: Unified Data Flow Design Spec

Pipes and Quirks: Unified Data Flow

Date: 2026-05-05 Status: Design Branch: feat/fx-pipeline (713/713 tests) Supersedes: design/traits.md, design/fleet-and-exports.md, tbd/emission-pipeline.md


1. Problem

@sini
sini / 2026-05-07-stream-architecture-migration.md
Last active May 7, 2026 15:08
Den stream architecture migration spec — replacing shared pipeline with Ned-style FRP streams

Stream Architecture Migration

Den's fx-pipeline currently runs all entities through a single shared trampoline, forcing ~2,500 lines of coordination machinery (scope trees, deferred includes, late dispatch, 4-phase post-pipeline assembly). Ned demonstrates that the same semantics — topology fan-out, cross-host data sharing, scoped DI, class forwarding — can be achieved with stream composition and a Cycle.js fixed-point, using ~50x less infrastructure code.

This spec defines the migration from Den's shared-pipeline model to a stream-based architecture (Approach A), preserving all user-facing APIs while eliminating the internal coordination overhead.

Architecture Overview

Current Model (Shared Pipeline)