Commit Graph
10 Commits
Author SHA1 Message Date
Daniel SamsonandClaude Opus 4.5 f233547ce8 feat(scheduler): add per-level job limits based on load classification
Implements #34 - Job Limits Per Load Level

Jobs are now classified into HIGH, MEDIUM, or LOW load levels based on
gitignore-style whitelist files (.load files). This allows concurrent
execution of different types of jobs (e.g., downloading while transcoding).

Changes:
- Add LoadLevel enum with default limits (HIGH=2, MEDIUM=8, LOW=32)
- Add LoadLevelConfig record for per-level max jobs configuration
- Add CommandMatcher sealed interface for matching commands by name/path/dir
- Add LoadFileParser for parsing .load whitelist files
- Add LoadLevelClassifier for auto-classifying commands
- Add ConfigInstallCommand (barn config install) for default config files
- Update JobScheduler to use per-level limits with EnumMap
- Add --load-level/-l option to barn run for manual override
- Add load level display to barn status and barn describe output
- Remove --user flag from service install/uninstall (system-wide only)
- Update documentation for load levels and whitelist files

Default whitelists:
- high.load: ffmpeg, ffprobe, handbrake, x264, x265, etc.
- low.load: curl, wget, rclone, rsync, aria2c, etc.
- medium.load: empty (unmatched commands default to MEDIUM)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 14:33:06 +00:00
Daniel SamsonandClaude Opus 4.5 258c86f001 fix(native): add reflection config for IPC serialization
Add Job, JobManifest, and JobState to reflect-config.json for
proper Jackson serialization in native image.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 09:24:07 +00:00
Daniel SamsonandClaude Opus 4.5 6b28dca798 feat: dynamic version from Maven resource filtering
- Add VersionProvider class that reads version from version.properties
- Enable Maven resource filtering for version.properties
- Version is now automatically synced with pom.xml

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 09:14:08 +00:00
Daniel SamsonandClaude Opus 4.5 d95ac32739 Replace SLF4J with BarnLogger and update documentation
- Replace SLF4J/logback with custom BarnLogger across all source files
- BarnLogger is disabled by default for CLI commands, enabled for service
- Fixes #30: debug logs no longer break JSON/XML CLI output
- Add SpotBugs exclusions for BarnLogger false positives
- Update docs: remove .deb and AUR references (no longer applicable)
- Update docs: add Windows setup.exe installation instructions
- Update docs: clarify auto-update only works with Homebrew

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 08:04:35 +00:00
Daniel SamsonandClaude Opus 4.5 f81c0fad8f fix(logging): disable console logging for CLI commands (#30)
- Set root log level to OFF by default in logback.xml
- Service startup explicitly enables logging via LoggingConfig
- Use cross-platform path ${java.io.tmpdir} for log directory
- Remove unused CONSOLE appender

This prevents debug logs from breaking JSON/XML output in CLI commands.

Fixes #30

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 03:03:44 +00:00
Daniel SamsonandClaude Opus 4.5 116f1fbb59 fix(native): add Job and Config classes to reflection config
Jackson deserialization in native binary fails when processing job
status responses. Added missing classes to reflect-config.json:
- Job, JobManifest, JobState, ResourceUsage
- Config, ServiceConfig, StorageConfig, JobsConfig, CleanupConfig
- Collection types for IPC payloads

Tested locally with native binary:
- barn run, status, describe, usage, kill, clean
- barn service status, config show, autocompletion

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 00:04:03 +00:00
Daniel SamsonandClaude Opus 4.5 53f0991f6f fix: add Jackson reflection config for native-image
IPC communication was failing in native binary because Jackson
couldn't deserialize IpcMessage and related classes without
reflection configuration.

Added reflect-config.json with all IPC classes.

Bumped version to 0.1.2.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 23:46:34 +00:00
Daniel SamsonandClaude Opus 4.5 da43488024 fix(logging): use consistent /tmp/barn/logs path for service logs
The previous configuration used ${java.io.tmpdir} which resolves to
/var/folders/... on macOS, while the data directory uses /tmp/barn.
This caused a mismatch where logs and data were in different locations.

Changed to use explicit /tmp/barn/logs as default for both FILE and
JSON appenders to match the ConfigDefaults.getDefaultBaseDir() path.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 22:02:28 +00:00
Daniel SamsonandClaude Opus 4.5 1ce74e0bc8 fix(logging): suppress logback status messages in CLI output
- Add NopStatusListener to suppress logback initialization messages
- Remove console appender from default root logger (file only)
- CLI commands now show clean output without logging noise

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 21:48:45 +00:00
Daniel SamsonandClaude Opus 4.5 92810cabee feat(service): add IPC communication and service management
Implement proper CLI-to-service communication via Unix domain sockets,
fixing issue where CLI commands couldn't see jobs managed by the service.

Key changes:
- Add IPC client/server for CLI-service communication
- Fix directory mismatch (CLI used java.io.tmpdir, service used /tmp/barn)
- Add service management commands (start, stop, restart, reload, logs)
- Add service installation for macOS (launchd), Linux (systemd), Windows
- Add process usage monitoring (barn usage command)
- Add job state breakdown in service status (succeeded, failed, canceled)
- Add output formatters (human, JSON, XML)
- Add crash recovery and heartbeat checking
- Add structured logging with MDC context

The CLI commands now properly communicate with the running service
via IPC, ensuring consistent job state visibility.

Fixes #24

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 21:41:02 +00:00