Skip to content

feat: add tuskd daemon for continuous rule evaluation#7

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

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
Copy link
Copy Markdown
Owner

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

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>
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