Add rollout sharding, firewall management, and encrypted config#2
Merged
Add rollout sharding, firewall management, and encrypted config#2
Conversation
Three new DSL capabilities: - r.InShard(percent): percentage-based rollout sharding by hardware serial - r.Firewall(name, opts): cross-platform firewall rules (nftables, pf, Windows registry) - r.Secret(key): AES-256-GCM encrypted config with fail-closed decryption Includes full test suites, input validation, platform examples, and updated docs. Rename docs/guide.md to docs/examples.md with per-platform examples for every resource.
- Move injection-prevention comment above the validName regex where it belongs - Rename logging_linux.go to logging_unix.go so macOS also gets syslog - Fix design.md to say compiled-in key, not environment variable
TsekNet
added a commit
that referenced
this pull request
Mar 16, 2026
CRITICAL (#1): - Fix kqueue fd leak in darwin file/plist watchers: explicit fd management instead of defer capturing stale fd HIGH (#2-3): Shared watcher multiplexer - New internal/watch/inotify_linux.go: single inotify+epoll fd for all file and sysctl watchers. Prevents hitting inotify_max_user_instances (128) at 2000+ resources. 5 tests. - File and sysctl watchers refactored to use shared multiplexer HIGH (#4-6): Graph scaling - AddEdge is now O(1) with lazy cycle detection via TopologicalLayers - Duplicate edges silently deduplicated via edge set - Auto-edge serviceToConfigFile uses exact config extension matching - WouldCycle() BFS for auto-edge cycle avoidance HIGH (#7-8): Daemon correctness - Default Timeout to 5m when unset (prevents instant context expiry) - Nil checks in retryManager for unknown resource IDs HIGH (#9): DSL simplification - Extract r.require() helper, cutting ~50 lines of boilerplate HIGH (#10): Watcher dedup (via shared multiplexer above) HIGH (#11): Unsafe pointer bounds - Use unsafe.Offsetof for Windows FILE_NOTIFY_INFORMATION headerSize HIGH (#12): DAG-aware drift remediation - After successful Apply, schedule Check for dependent resources via Children() MEDIUM (#13-20): Simplification + security - Remove dead Nodes() allocation - Systemd: NoNewPrivileges=yes, remove ProtectSystem=full - eventMeta stores EventKind not full Event - Remove retryManager.mu (states map is write-once) - ResourceMeta struct embedded in all Opts (DependsOn+Critical consolidated) - Error accumulation: []error with errors.Join, not single error - Move isRoot() to internal/platform/root.go - Registry watcher: re-register before sending event LOW (#21-25): Tests, docs, minor - Cycle detection test via TopologicalLayers - Log dropped coalescer events - Document Event struct and EventKind in extending.md - Document default blueprint in Service Installation - Rename coal -> coalescer Ref #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
r.InShard(percent): percentage-based rollout sharding by hardware serial (stable, deterministic)r.Firewall(name, opts): cross-platform firewall rules via native APIs (Windows COM, Linux nftables netlink, macOS pf)r.Secret(key): AES-256-GCM encrypted config with compiled-in key, zero external depsdocs/guide.mdtodocs/examples.mdwith per-platform examples for every resourceRef #1
Test plan
go test ./...passes on Linux