Skip to content

feat: settings stratification + parametric-aspect injection (Spike 5 demo)#1

Merged
sini merged 13 commits into
mainfrom
feat/settings-stratification-injection
May 31, 2026
Merged

feat: settings stratification + parametric-aspect injection (Spike 5 demo)#1
sini merged 13 commits into
mainfrom
feat/settings-stratification-injection

Conversation

@sini

@sini sini commented May 31, 2026

Copy link
Copy Markdown
Owner

Summary

Makes the examples/demo faithfully prove Spike 5 — a default < env < host < policy settings cascade with full provenance, settings composing onto parametric aspects, and resolved settings injected back into parametric class content.

  • Cascade: composition.nix folds the policy patch as the final layer via record.foldLayersTraced; per-host gen-derive dispatch (act.configure), layer labels from a parallel raw-settings-ids neron attribute, full provenance surfaced.
  • Canonical aspect shape: firewall becomes parametric (static settings schema + settings-consuming nixos), hardening demoted to plain.
  • Injection construct: injection.nix injectAspectSettings injects resolved composedSettings.<host>.<leaf> into each aspect's class content via gen-bind (demo-local prototype; graduation to gen-aspects.lib deferred). nginx refactored to a second parametric aspect, proving the construct generalizes.
  • Proofs (outputs.nix): firewall + nginx full loops, policy-overrides-host (discriminating), negative control, append accumulation, recursive per-subkey provenance.

Design spec: ~/Documents/papers/den-architecture/specs/2026-05-31-settings-stratification-injection-design.md.

Dependency / required follow-up

Test Plan

  • nix eval .#fwInjectionMatchesCascadetrue (firewall: resolved+appended cascade ports == injected allowedTCPPorts)
  • nix eval .#nginxInjectionResolvedtrue (nginx: resolved settings render worker_processes 32)
  • .#loggingLevelProdWeb1"error" (policy overrides env "warn" — proves policy folds last)
  • .#workersProdWeb1Winner"host" (negative control — policy doesn't blanket-override)
  • .#dbBackupSubkeyProvenance{schedule=policy; retention=policy; method=host; destination=host} (recursive per-subkey)
  • Re-run the above without --override-input after the gen-algebra lock bump
  • Note: a pre-existing nix flake check failure in queries.nix (observability attr) predates this branch and is out of scope.

@sini

sini commented May 31, 2026

Copy link
Copy Markdown
Owner Author

gen-algebra#1 merged. Bumped the demo flake.lock gen-algebra → 49f6721 (d733fe1). The cascade proofs now eval without --override-input gen-algebra — verified loggingLevelProdWeb1="error", fwInjectionMatchesCascade=true, nginxInjectionResolved=true, recursive per-subkey provenance. Only --override-input gen-aspects remains until this PR merges.

@sini sini merged commit 146389e into main May 31, 2026
1 check passed
@sini sini deleted the feat/settings-stratification-injection branch May 31, 2026 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant