Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.DS_Store
node_modules/
notes/
.impeccable/mocks/
.impeccable/questions/
50 changes: 50 additions & 0 deletions .impeccable/briefs/manager.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Surface brief: manager list + job details

Mode: Operate. Visual authority: Tern itself (user's theme, Tern view nodes); no new world. Code-led.
Approved by Brendan 2026-10-13 after shape (sketch: .impeccable/mocks/decision/hybrid.png).

## Job and audience
Tern users checking agent work. First question answered: what happened since I last looked; then what needs me; then what runs next. Typical 3–10 jobs, rarely >20.

## Structure
- **Default list layout: Timeline.** Results since the user last looked above a "now" rule; every active recurring job exactly once below it, at its next run (time-ordered). The now rule appears only when there are results above it or runs in progress at it; sections with no rows are never shown. When nothing is new, a single muted quiet line follows the header ("Nothing new since 08:00." / "Nothing has run yet. <job> runs first, 18:00 (in 9h 52m)."). Running / needs-you runs sit on the now rule (running job shows "next HH:MM" inline instead of a second row). One-shot jobs below until they run. Bottom group: paused, needs fixing, manual-only.
- **Classic layout (setting):** today's grouped job list (Needs you, Needs fixing, Running, Upcoming, Paused & finished), with the shared row/toolbar fixes.
- **Job details:** layout-3 detail: header (name, state, next run), latest result line called out (failure tone when failed), settings as key/value, run list with one-line summary, duration, cost. No chart.
- **Width:** at ≥ ~150 cols (cx.cols; tune with screenshots) details sit beside the list and follow selection, in both layouts. Narrower: Enter opens details full-width.

## New / seen
- New results highlighted until visible in the open manager briefly, then fade (default). Setting "New results": fade once seen | stay until cleared.
- A failure keeps its ✗ on the job until its next success.
- Last-looked marker advances when leaving the manager.
- Backlog: ≤ ~8 new results → one row each. More → one row per job ("PR triage · 84 runs since Mon · 70 ✓ · 12 ↷ · 2 ✗ · latest …"); failures and needs-you always get their own rows above. Rows do NOT expand; opening the job shows all its runs. "Mark all seen" key and button appear only when something is unseen. Counts tracked independently of the 50-run retention; run lists say "latest 50 of N" when truncated.

## Toolbar
Job actions and global actions are two groups of the same buttons, apart by space, with the selected job named above the job group; keys shown inside buttons; Delete and Pause all last in their groups, in muted text; separate hint row removed. Forms and dialogs use the same buttons.

## Settings
Manager Settings sheet gains a "Manager" page: Layout (Timeline default | Classic job list), New results (fade once seen | stay until cleared). Palette command "Agent Scheduler: Settings".

## Styling (approved 2026-10-13: "B with A's markers"; mocks .impeccable/mocks/style/)
- UI font (--sans) for names/summaries; mono with tabular digits for times/durations/costs.
- New results: thin left-edge marker (accent; --bad for failures), not full-row wash; fades once seen.
- Selection: accent outline + light tint; glides between rows (spring-follow).
- Now rule: accent rule (no glow) with a filled "now · HH:MM" pill; countdown digits roll (-stencil-text-effect: numeric).
- Running row on the now rule: --live gradient wash + slow pulsing dot.
- Details: raised card (--card, --r-card, soft shadow); failure called out in a bordered --bad tint block + "Last run failed" badge; settings in a recessed --l1 block.
- Dock: one outlined button style everywhere (no tray); the Enter/default action is accent-tinted.
- All motion off under prefers-reduced-motion. Light theme: times use --t2 not --t3; status glyphs slightly larger. Verify against 2+ real omp themes in Tern.

## Time format
Setting "Time format": Automatic (default; follow system, 24-hour fallback) | 12-hour | 24-hour. Centralize all time formatting in one helper (lib currently has ~29 os.date calls); applies to manager, notifications, status line, Carly text. Parsing already accepts both.

## Keep
All current keys, section vocabulary, Tern theme/components, plain-English copy.

## Anti-goals
No charts/stat tiles (remove the run-duration bar chart). No inline expanding rows.

## Also fix
Missed ≠ failed in counts; `0 */2 * * *` reads "every 2 hours"; "Invalid job id.." double period; "d d" spacing.

## Open
Exact width cutoff (tune on screenshots).
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,37 @@

User-facing changes per release. Update with `tern plugin install github.com/bmanturner/tern-agent-scheduler --force`.

## 0.4.0 (2026-10-16)

Built and tested on Tern 0.9.0. **Update Tern to 0.9.0:** on an older Tern, the manager asks you to check setup and Settings › Status flags the Tern version.

### Added

- **Timeline**, the manager's new default view: results since you last looked, a **Now** rule, then each active job at its next run, with paused, manual-only and broken jobs at the bottom. A run in progress sits on the Now rule. When nothing is new, one line says so ("Nothing new since 08:00."), and on a first visit it names the first run. More than eight new results fold into one summary per job, with failures still listed one by one. **Settings › Display › Layout** brings back the **Classic job list**.
- In panes 150 columns or wider, a job's details sit beside the list and follow the selection. They call out the latest result and list each run on one line with its outcome, duration and cost.
- New results fade after three seconds, or stay highlighted until you mark them seen (**Settings › Display › New results**). `s` or **Mark all seen** clears them, and a failure marker stays on the job until its next success.
- **Time format**: Automatic (follows your system, with a 24-hour fallback), 12-hour or 24-hour, used for schedules, previews, notifications, the status line and Carly. Until now times were always 24-hour.
- **Agent Scheduler: Settings** in the palette.

### Changed

- Settings is one page, **Agent Scheduler Settings**, with Status, Display, Where runs start, Limits and Setup sections. **Status** says whether Agent Scheduler is ready to run jobs, lists each problem with what to do about it, and **Check again** checks in place. The Check setup dialog is gone; what it said about when jobs run is now in Help.
- In Settings, Time format and Layout are buttons (←/→ also switch them), number rows take a typed value after Enter, a rejected value stays in its field with the reason above it, and a changed setting shows a dot and **Reset**. Tab and Shift+Tab move between rows; a key legend sits at the bottom.
- Help (`?`) groups the keys into The selected job, Move and open, and All jobs, written the way you type them (`P` is shift+p).
- One look for every button in the manager, the job form and its dialogs, each with its key inside. The default action, the one Enter does, is highlighted.
- On the job form's **Only when** page, a condition that's off shows only its switch, and its settings appear when you turn it on (nothing you set is lost). **Check now** appears once a condition is on.
- With no jobs, the manager offers its examples under a "Start from an example" heading; Enter opens the selected one as a draft that's saved only when you save it.
- A job's history is one line per run instead of a chart.

### Fixed

- On Tern 0.9.0, a scheduled run no longer ends as "Closed by you." a few seconds after it starts while omp keeps running in its tab. Agent Scheduler didn't recognise its own run tabs in the shape Tern 0.9.0 lists them.
- Runs missed while your computer was asleep no longer count as failures.
- Schedules with a cron step read naturally ("Every 2 hours").
- Every run is listed at its start time, and countdowns round up to the minute.
- With window glass on, Settings no longer lets the job list show through.
- "Invalid job id." no longer ends in two periods.

## 0.3.2 (2026-10-13)

Built and tested on Tern 0.8.3.
Expand Down
67 changes: 67 additions & 0 deletions PRODUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Product

<!-- impeccable:product-schema 1 -->

## Platform

web

"web" here means Tern's own view engine, not a browser: the plugin draws its screens with Tern view nodes (`tern.ui`), an HTML-like element subset and a CSS subset that Tern renders natively. There is no JavaScript, no browser layout engine and no custom fonts. The plugin runs on Tern desktop for macOS and Linux. The manager also opens in Tern's web client and on iPhone/iPad, but palette commands, the status line, needs-you notices and Carly tools need a desktop window.

## Users

Primary users are Tern closed-beta users: power users who live in the terminal and already run omp agents in Tern panes. They want agent work to happen on a schedule while they keep working, and to check in on it without leaving Tern. The plugin's author is one of these users, but design decisions favor the wider Tern user base over personal preference.

They open the manager for two reasons equally often: to see what ran, what failed and what needs them, and to create or adjust jobs.

## Product Purpose

Agent Scheduler gives Tern the scheduled agent tasks that the Claude and ChatGPT desktop apps already have, built natively into Tern. On top of that it adds things terminal-heavy users expect: cron and plain-English schedules, conditions that hold a run back (new commits, hours, run and spend limits, a user script, an AI check), and runs that land in real Tern tabs.

Success means Stencil adopts it into Tern. To get there it has to be trusted with unattended work and used by a large share of Tern users.

## Positioning

It's meant to match what other tools already offer, not to stand apart from them: what the Claude and ChatGPT desktop apps do for scheduled tasks, delivered inside Tern and fitting Tern's way of working. Where it goes further, it's because terminal power users need it: each run is a real omp session in a Tern tab that can be opened and continued, conditions decide whether a due run is worth starting, and all jobs, prompts and history stay on the user's machine.

## Operating Context

- A job is a saved prompt plus a schedule, a folder, an omp role, an approval mode and a time limit. A run is one execution of it.
- Runs start in a background **Scheduled runs** session without taking focus. The user hears about them through the status line, toasts and desktop notifications when something needs them or fails.
- Jobs run only while Tern's session service is running. Nothing runs while the computer is asleep. Missed runs follow the job's catch-up setting.
- The manager is a Tern block. The palette has Open manager, New job, Run a job now and Go to run that needs you. Carly, Tern's assistant, can create, list, run and pause jobs.
- Remote hosts each keep their own jobs and manager.

## Capabilities and Constraints

- **Terminology** (use exactly these words): job, run, needs you, needs fixing, Hands-off, Only when, skipped, missed, quiet.
- **Agent support:** omp only for now. UI wording should stay agent-neutral so other agents can be added later without rewriting copy. Undecided: which agents, and when.
- **Security model:** only the host half creates or changes jobs and settings. Windows send allowlisted intents only. Hands-off is the default approval mode and always shows its warning.
- **Platform limits:** window-half calls have a 50 ms budget. Views use Tern's built-in node kinds and its CSS subset. Plugin CSS must be scoped to the plugin's surfaces.
- **Data:** stored in Tern's plugin data folder. The plugin makes no network requests of its own.

## Brand Commitments

- **Looks like part of Tern.** Follow the user's Tern theme through Tern's theme variables and semantic tones. No separate brand, palette or logo.
- **Keyboard-first, never keyboard-only.** Everything doable by key must also be clickable.
- **Plain-English voice.** Sentence case, short, no jargon, no exclamation marks, no emoji in copy. Errors say what happened, then what to do. Times are concrete and local (`Mon 12 Oct 09:00`), in 24-hour or 12-hour form per the user's Time format setting (Automatic follows the system).

## Evidence on Hand

- README (`README.md`) and the changelog (`CHANGELOG.md`).
- Design history in `docs/DESIGN.md` and `docs/design/` (ux.md, decisions.md, engine.md, launch.md, architecture.md). These are historical; the code and README win where they disagree.
- Screenshots in `docs/screenshots/`.
- A UI audit with screenshots of every manager screen in dark, light and narrow layouts (seeded test data, not real usage): `~/Dev/personal/tern-agent-scheduler-audit/`.
- The public GitHub repo has 13 stars. There are no usage numbers, testimonials or adoption data yet; don't invent any.

## Product Principles

1. **Trust before features.** Users have to be willing to leave unattended runs going, so every run's outcome, cost and reason is visible, and nothing fails or gets skipped silently.
2. **Outcomes and authoring are equal.** The manager has to make "what happened / what needs me" and "create or change a job" both fast. Neither should be buried behind the other.
3. **Never steal focus.** Runs start in the background. The user goes to a run only when they choose to.
4. **Native to Tern.** It should feel like a part of Tern that Stencil could ship as-is: Tern's theme, Tern's components, Tern's keyboard conventions.
5. **Parity first, power second.** Cover what other desktop agent apps offer for scheduled tasks plainly, then add terminal-power-user depth without making the simple path harder.

## Accessibility & Inclusion

Status is never shown by color alone: every state has a glyph and words. Tern's simulated preferences (reduced motion, increased contrast, differentiate without color) should be respected where the plugin's views are affected. No other product-specific requirement has been established.
Loading
Loading