Commit Graph

160 Commits

Author SHA1 Message Date
mixeme b0d9883627 app/run_test.go: per-job overlap policy override tests (T3.4)
Adds three tests for the effective-policy resolution:
- per-job "queue" overrides global "skip" (job marked Pending, re-runs)
- per-job "skip" overrides global "queue" (overlap dropped, no re-run)
- empty Job.OverlapPolicy inherits the global default

Also ticks Phase 3 complete in docs/RELEASE-0.10-TASKS.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 21:33:06 +03:00
mixeme 554ce2b93a ui/app: per-job overlap policy in job dialog and details panel
- job_dialog.go: add overlap-policy widget.Select with "(Use global
  default)" → empty, "skip", and "queue" options; pre-selects the job's
  current value; on save maps the inherit label back to empty string.
- app/format.go: add DisplayOverlapPolicy(job, globalPolicy) — returns
  the policy name when overridden, else "skip/queue (global default)".
- ui/jobs_view.go: add "Overlap policy" detail row updated in
  updateDetails using DisplayOverlapPolicy.
- settings_view.go: rename "Overlap policy" label to "Default overlap
  policy" to clarify it is the global default jobs can override.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 21:05:50 +03:00
mixeme 3f3b977fb0 app/run.go: resolve effective overlap policy per job in RunDue
RunDue now resolves each job's effective overlap policy via
effectiveOverlapPolicy (job value when set, else Config.OverlapPolicy)
instead of reading the global policy once per tick. An empty
Job.OverlapPolicy inherits the global default, so normalizeJobs continues
to leave the field untouched rather than backfilling it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 20:58:51 +03:00
mixeme 8f75318e8c domain/job.go: add OverlapPolicy field for per-job run policy
Adds OverlapPolicy field to Job struct with json:"overlap_policy,omitempty"
tag. When empty, the field signals that the job should inherit the global
overlap policy setting from Config. Also updates yamlJob shadow struct to
maintain field-layout equivalence for YAML→JSON import compatibility.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-24 20:57:00 +03:00
mixeme ed81443d29 ui/history_view: size Log column to content so file names aren't truncated
The Log column was fixed at 240px with TextTruncate, clipping log file
names like 20260601-100000_<JobName>.log. Measure the widest value and
size the column to fit (bounded 240–520px), recomputing on refresh so
newly recorded events widen the column instead of being cut off.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 20:54:23 +03:00
mixeme cf276fc8ec ui/jobs_view: cap Selected job activity to 3 recent rows, anchor at bottom
Show only the latest 3 activity entries for the selected job instead of the
full in-memory list, and pin the panel to the bottom of the details pane via a
Border so the command output absorbs the remaining vertical space.

Adds fixedHeightLayout (mirroring minWidthLayout) to reserve a stable height
for the activity list. The full per-job history (maxJobLogs) is untouched and
still available in the History view.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 20:36:41 +03:00
mixeme 07c0995935 Update .gitignore 2026-06-24 08:32:18 +03:00
mixeme d13b90061c docs/RELEASE-0.10-TASKS: unmark T8.1 (ROADMAP + PERFORMANCE pending)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 08:27:12 +03:00
mixeme 65281c3996 docs/RELEASE-0.10-TASKS: mark T2.5 and T8.1 complete
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 08:26:40 +03:00
mixeme b45ab654c2 app/version, docs/CHANGELOG: bump to 0.10.0 (T8.1)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 08:26:03 +03:00
mixeme 886d0d9caa app/format, ui/jobs_view: DisplayStats summary + Statistics detail row (T2.6, T2.7)
Add DisplayStats to format.go: returns "No runs recorded" when RunCount is
zero, otherwise a one-line "N runs, M failed, last X ms, avg Y ms, max Z ms"
summary.  Wire a Statistics detail row into the jobs panel that refreshes via
updateDetails alongside the other runtime fields.

Tests: TestDisplayStats (nil/zero/normal/no-fail), TestUpdateStats (three
sequential fake runs through updateStats verifying all aggregate fields), and
five seed tests in runner/seed_test.go covering basic aggregation,
duration-less legacy logs, maxFiles capping, missing directory, and
unmatched log files.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 08:24:48 +03:00
mixeme 6c69f323bd runner/seed, app/service: seed run-time stats from log files (T2.5)
Add SeedStats, which reconstructs per-job execution-time aggregates from
existing log files: suffix-matched by sanitized job name, bounded by
MaxLogFiles, and tolerant of duration-less legacy logs (counted in
run/fail totals but excluded from last/avg/max). NewService folds the
seed into each JobRuntime at build time so stats survive a restart.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 08:16:47 +03:00
mixeme 7dafa82b21 domain/runtime, app/run: add execution-time statistics aggregate (T2.4)
Add RunCount, FailCount, LastDurationMS, AvgDurationMS, MaxDurationMS
to JobRuntime and fold each completed RunRecord into them via updateStats
called from executeRun.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 08:13:02 +03:00
mixeme 2b0cdb57f4 runner/logfile: write duration line to log header (T2.3)
Pass durationMS to writeRunLog and include it as 'duration' in the
log header for persistence.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-24 08:11:05 +03:00
mixeme 42d73b9eb0 domain/record, runner: add DurationMS to RunRecord (T2.1, T2.2)
Add DurationMS int64 field to RunRecord and measure wall-clock
start→finish in RunJob; StartOnly jobs record 0.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 08:09:59 +03:00
mixeme 183ea1b125 docs/RELEASE-0.10-TASKS: mark Phase 1 complete (T1.1-T1.4) 2026-06-24 07:55:55 +03:00
mixeme 61ea3ce2af app/format_test: add EventLine test cases (T1.4)
Cover the compact formatter with three scenarios:
- Log file present: shows base name only (not full path)
- Log file absent: formats without a log column
- Empty trigger: defaults to "Unknown"

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 07:52:53 +03:00
mixeme 0f27d75359 ui/jobs_view: render job logs as compact one-line entries (T1.2)
Switch the jobLogs list template to TextTruncate wrapping and use
EventLine (base log filename only) instead of EventText so each
activity row stays on a single line in the jobs panel.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 07:50:03 +03:00
mixeme 8fc28f592d app/format: add EventLine compact formatter (T1.1)
Uses filepath.Base for the log file so the jobs log view can show
one-line entries without the full directory path cluttering the row.
EventText is kept intact for the History table.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 07:49:26 +03:00
mixeme adb119973a Add persisted Pause-all state to 0.10.0 plan and tasks
New feature section: store the global pause in Config so "Pause all"
survives restarts (config field, persist in SetGlobalPause, init service
and UI from it). Renumber the later plan sections and task phases to fit.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 01:04:29 +03:00
mixeme 4226cb6141 Add 0.10.0 task list with model and thinking depth
Execution checklist for RELEASE-0.10-PLAN.md: 7 phases of tasks each
tagged with recommended model and thinking depth, plus a completion
checklist and definition of done.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 00:53:42 +03:00
mixeme bf9c1517a5 Add YAML->JSON migration cleanup to 0.10.0 plan
Section 6 now includes dropping the one-time YAML import that shipped in
0.9.0: the shadow structs and import path in storage, the legacy path
names, the go.yaml.in/yaml/v4 dependency, the import tests, and the
*.yaml ignore rules.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 00:51:51 +03:00
mixeme 55e90d80d3 Refine 0.10.0 plan: keep startup timing, add architecture-doc update
Section 6 now preserves the startup-timing instrumentation through the
post-field-test cleanup and adds a task to refresh docs/ARCHITECTURE.md
for the per-job overlap policy, run-time statistics, and jobs_view split.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 00:49:40 +03:00
mixeme 20390fe476 Add 0.10.0 milestone plan; trim ROADMAP to portable packaging
Add docs/RELEASE-0.10-PLAN.md covering the open roadmap follow-ups plus
per-job overlap policy, run-time statistics, one-line activity entries,
log-name fix, and 720p window sizing. Drop the non-portable delivery
formats (.deb, installer, AppImage, Flatpak, winget) from ROADMAP.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 00:46:23 +03:00
mixeme 67cf4e1c11 Create RELEASE-0.10-PLAN.md 2026-06-24 00:43:24 +03:00
mixeme 93b363d802 Remove completed items from ROADMAP
Drop the resolved Tray Interaction section (0.9.0) and the completed
run.go split note; keep pending follow-ups, cleanup, and packaging.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 00:36:25 +03:00
mixeme 41e2089142 Remove completed pre-release planning docs
All 8 phases of the pre-release milestone are done and committed; the
plan and task checklist are no longer needed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 00:33:51 +03:00
mixeme dafd8ef345 P8.3: update CHANGELOG and ROADMAP for 0.9.0 release
CHANGELOG:
- Expand 0.9.0 entry to cover all pre-release work: JSON storage
  migration, exit-code removal, PySentry legacy cleanup, queue execution
  modes/overlap policies, failure notifications, Command browse button,
  developer docs split, icons, tray left-click, Fyne 2.7.4 upgrade.

ROADMAP:
- Remove resolved "Linux test build broken" item (fixed in P7.1).
- Note that app/run.go was created to split dispatch logic.
- Mark "Tray Interaction" section as resolved in 0.9.0; document the
  SetSystemTrayWindow implementation and re-measured startup time
  improvement (−36%).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 00:30:34 +03:00
mixeme 2e54d088bf P8.2: rewrite README.md for end users
- Update Features to reflect JSON storage, queue execution mode/overlap
  policy, failure notifications, and tray left-click-to-show.
- Replace Documentation project-notes list with a proper Documentation section.
- Rewrite Storage section: JSON file examples with all current fields
  (execution_mode, overlap_policy); add YAML upgrade note.
- Add Queue Settings section documenting parallel/sequential and skip/queue.
- Add Notifications section.
- Fix all 0.3.0 version strings to 0.9.0.
- Remove Codex attribution line.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 00:28:49 +03:00
mixeme 2b636cbb65 P8.1: extract developer docs into docs/DEVELOPMENT.md
Move Requirements, Build, Run From Source, Project Layout, and
Dependencies/mirroring out of README into docs/DEVELOPMENT.md. Update
version references to 0.9.0 and correct the storage description to JSON.
README retains user-facing sections and gains a Development link.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 00:26:36 +03:00
mixeme 3907ab3c18 P7.1: move Windows-only runner tests into runner_windows_test.go
Tests touching SysProcAttr.HideWindow/CmdLine and windowsShellCommandLine
are guarded by //go:build windows; runner_test.go drops the winproc import.
Linux cross-compile and Windows test run both clean.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 00:23:25 +03:00
mixeme a446f67293 Delete REFACTORING.md 2026-06-24 00:20:04 +03:00
mixeme 0b8c340f6e Bump version to 0.9.0; update changelog
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-23 22:46:57 +03:00
mixeme 646bfc734d P6.3: re-measure with GOSENTRY_TIMING instrumentation; correct figures
Warm-run average (runs 2-5 of 5) via env-gated phase timers in run.go:
  after Fyne app + window + tray  193 ms  (was 285 ms on Fyne 2.6.3)
  after newMainView               249 ms
  after SetContent                252 ms
  after w.Show() [TOTAL]         ~414 ms  (was ~644 ms, -230 ms / -36%)

Instrumentation reverted before this commit; source is clean.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-23 22:38:28 +03:00
mixeme c57d5b102f P6.3: correct startup measurement — ~400 ms on Fyne 2.7.4
Previous commit used PowerShell process-launch timing instead of the
History tab metric. Actual warm-run figure from the in-app "Window shown
in …" event is ~400 ms, down from ~644 ms on Fyne 2.6.3 (~37% recovery).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-23 22:36:04 +03:00
mixeme f03f012c1b P6.3: measure startup on Fyne 2.7.4; append to PERFORMANCE.md
Measured warm-run startup (launch to window creation) via PowerShell Stopwatch
across 3 runs: ~1215 ms average. Added finding for 2026-06-23 noting the
measurement method and that Fyne 2.7.4 builds cleanly with no breaking changes.
For higher-precision measurement, the GOSENTRY_TIMING instrumentation pattern
from the previous finding can be reused.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-23 22:32:53 +03:00
mixeme 26f58abda6 P6.2: left-click tray icon shows window via SetSystemTrayWindow
Calls desk.SetSystemTrayWindow(w) after SetSystemTrayMenu so a left-click
on the tray icon shows/focuses the window without opening the menu. The
explicit "Show" menu item is kept for right-click access.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-23 22:27:37 +03:00
mixeme df217fdf31 P6.1: confirm Fyne 2.7.4 upgrade; mark done
go.mod already pins fyne.io/fyne/v2 v2.7.4 (latest 2.7.x). Verified
go mod tidy is a no-op and rebuilt under MSYS2 UCRT64/CGO: build, vet,
and go test -race ./... all green with no code changes. 2.7 changelog
review found no breaking changes affecting GoSentry.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 22:25:45 +03:00
mixeme 8b05d0cfd1 P5: mark Phase 5 icons done; reflect size-appropriate approach
Tick P5.1 and P5.2 in the completion checklist and reword the P5.2 task line
to match what shipped in f533739: size-appropriate, transparent per-platform
icons (tray uses the small icon; Windows window/taskbar draws from the
multi-size gosentry.ico via the GLFW_ICON resource; Linux titlebar uses
IconSmall) rather than "window icon stays large".

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 22:14:28 +03:00
mixeme f533739d6e P5: per-platform transparent, size-appropriate window/tray icons
Give the window titlebar, taskbar, and tray a size-appropriate icon with a
transparent boundary on both Windows and Linux, instead of scaling one PNG to
every size.

Assets:
- Regenerate the PNGs and gosentry.ico with feathered color-to-alpha so the
  rounded-tile boundary is transparent; a binary white-key had left an opaque
  halo that read as a border on dark taskbars/trays.
- Rebuild gosentry.ico as multi-size (16 hand-tuned + 32/48/256 from big) and
  add a single-frame 16x16 gosentry-icon-16x16.ico for the Windows tray.
- assets.go: add IconSmall() and IconSmallICO().

Wiring:
- Windows window/taskbar: embed gosentry.ico under the GLFW_ICON resource and
  skip a.SetIcon so GLFW selects the right frame per size (hand-tuned 16 for the
  titlebar, a larger frame for the taskbar).
- Windows tray: SetSystemTrayIcon(IconSmallICO()), a 16x16 ICO frame.
- Linux window titlebar: a.SetIcon(IconSmall()) for a crisp ~16px _NET_WM_ICON;
  tray uses the big PNG since StatusNotifierItem renders larger.

Also bump Fyne 2.6.3 -> 2.7.4 (systray 1.11.0 -> 1.12.1) and document the full
cross-platform icon strategy in assets.go, gosentry.rc, run.go, and tray.go.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 22:09:04 +03:00
mixeme 6136bb645b Bump version to 0.8.0; update changelog
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-23 08:20:29 +03:00
mixeme 73dae9e64c P4.2: Add Browse button for Command field in job dialog
Add chooseFile helper (dialog.NewFileOpen) in settings_view.go and wrap
the Command entry in job_dialog.go with a Browse button so users can
pick an executable from a file picker instead of typing the path.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-23 08:19:40 +03:00
mixeme 564609d8fb P4.1: Wire desktop notifications for failed job runs
Add Service.ShouldNotifyOnFailure() (reads config under mu) and call
fyne.CurrentApp().SendNotification in the mainwindow subscriber when a
Manual/Schedule run completes with State == "Failed" and the setting is on.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-23 08:18:12 +03:00
mixeme fb9d0650a6 Bump version to 0.7.0; update changelog
Phase 3 complete: execution modes and overlap policies for job dispatch.

- Bumped version from 0.6.0 to 0.7.0 in src/app/version.go
- Added 0.7.0 entry to docs/CHANGELOG.md documenting parallel/sequential
  execution modes and skip/queue overlap policies, and their interaction
  with the Settings UI and manual runs.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-23 08:05:03 +03:00
mixeme 6b8f9a4ccf P3.5: Add queue dispatch tests
New src/app/run_test.go exercises the execution mode + overlap policy
dispatch paths added in P3.3, reusing the fake runJob seam:

- parallel mode starts all due jobs concurrently
- sequential mode serializes due jobs one at a time
- skip overlap policy drops a re-fire while running (no Pending)
- queue overlap policy marks Pending and re-runs after the run finishes
- RunNow refuses a manual run while another job runs in sequential mode

Helpers prime NextDue to the past and tick at the wall clock so a started
job (advanced an hour out) does not spuriously re-fire.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 08:02:20 +03:00
mixeme 94a8dcc62a P3.4: Add Queue group to settings view
Add Execution mode and Overlap policy widget.Select controls in
ui/settings_view.go under a new Queue section group, between the
Application and Storage sections. Both selects are primed from the
current config on open and their selected values are written back into
the config struct on save, passing through the existing UpdateSettings
validation path.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-23 07:57:51 +03:00
mixeme b3e699792a P3.3: Apply execution mode + overlap policy in dispatch
Rework RunDue/startRunLocked/executeRun so the ExecutionMode and
OverlapPolicy config knobs take effect:

- startRunLocked advances NextDue to the next occurrence instead of
  zeroing it, keeping the schedule marching during an in-flight run.
- RunDue scans all due jobs: parallel starts every due, non-running job;
  sequential defers a due job while any other job runs. When a job comes
  due again mid-run, skip drops it and queue marks it Pending; either way
  NextDue is advanced past the fired occurrence.
- executeRun re-runs a Pending job once the current run finishes.
- RunNow gains a sequential-mode guard refusing a manual run while
  another job is running.
- Add anyRunningLocked and advanceNextDueLocked helpers.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 07:54:12 +03:00
mixeme d381a22034 P3.2: Move RunDue/RunNow/startRunLocked/executeRun into app/run.go
Extracts the four dispatch functions and their private helper
runningOutput into a dedicated file so operations.go stays focused on
CRUD and settings. No behaviour change; shared helpers (prependLog,
refreshNextRunLocked, etc.) remain in operations.go where other
operations already call them.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-23 07:39:54 +03:00
mixeme 9b4e9ee311 P3.1: Add ExecutionMode/OverlapPolicy to Config; add Pending to JobRuntime
Introduces ExecutionMode (parallel/sequential) and OverlapPolicy
(skip/queue) types and constants in domain/config.go, wires defaults
(parallel/skip) into loadOrCreateConfig and the normalization pass, and
adds validation in validateConfig. Adds Pending bool to JobRuntime as
the flag P3.3 will use to re-run a queued overlap. Marks P3.1 done.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-23 07:32:19 +03:00
mixeme e8421fc3ff Fix CRLF breakage in Linux build scripts
The Linux build host reads these scripts from a shared mount of the
Windows working tree, where autocrlf produces CRLF line endings. bash
then failed on `set -o pipefail` (trailing CR in the option name), and
the version parsed from version.go carried a trailing CR into the Docker
tag ("...:0.6.0\r": invalid reference format).

- Add .gitattributes forcing LF on *.sh so Windows checkouts stay LF.
- Strip CR from the version extraction in all three Linux build scripts.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 23:31:05 +03:00