Skip to content

feat: add tuskd daemon for continuous rule evaluation#7

Closed
Fraser-Isbester wants to merge 3 commits into
mainfrom
worktree-feat-tuskd-daemon
Closed

feat: add tuskd daemon for continuous rule evaluation#7
Fraser-Isbester wants to merge 3 commits into
mainfrom
worktree-feat-tuskd-daemon

Conversation

@Fraser-Isbester

@Fraser-Isbester Fraser-Isbester commented Apr 30, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds cmd/tuskd/main.go — a separate binary that runs the rule engine as a polling daemon without any TUI dependencies (no tview/tcell linked)
  • Reuses existing internal/rules, internal/db, and internal/config packages with zero changes
  • Adds build:daemon and daemon tasks to Taskfile

Why a separate binary?

Go compiles each main package independently. Since cmd/tuskd never imports internal/tui, the linker drops tview/tcell entirely:

$ go list -deps ./cmd/tuskd | grep -E 'tview|tcell'
(empty — no TUI deps)

$ ls -lh tusk tuskd
-rwxr-xr-x  28M tusk
-rwxr-xr-x  26M tuskd

Usage

# Run with a profile
tuskd -P prod

# Custom polling interval
tuskd -P prod --interval 5s

Test plan

  • go build ./cmd/tusk && go build ./cmd/tuskd — both compile
  • go list -deps ./cmd/tuskd | grep -E 'tview|tcell' — returns nothing
  • task test — all 70 tests pass unchanged
  • task daemon against a live dev DB with rules configured

Fraser-Isbester and others added 3 commits April 30, 2026 00:26
Adds a separate lightweight binary (tuskd) that runs the rule engine
as a daemon, polling PostgreSQL and evaluating rules without any TUI
dependencies. Uses the same config profiles and rule definitions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Fraser-Isbester

Copy link
Copy Markdown
Owner Author

Superseded by #9, which lands the same cmd/tuskd binary with added failure handling (per-resource fetch errors logged and skipped rather than crashing the loop), a testable poll-loop seam, unit tests, and a systemd example. Closing in favor of that. The build:daemon/daemon Taskfile targets from this branch are worth porting separately.

@Fraser-Isbester Fraser-Isbester deleted the worktree-feat-tuskd-daemon branch July 7, 2026 01:11
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