Skip to content

The Runs pages are Harbor's (0.19.0) - #24

Merged
adamfortuna merged 3 commits into
mainfrom
runs-pages
Nov 14, 2026
Merged

adamfortuna merged 3 commits into
mainfrom
runs-pages

Conversation

@adamfortuna

Copy link
Copy Markdown
Contributor

What

The Runs list and a run's own page move into Harbor, with the raw stream download and Stop:

  • GET /factory/runs, GET /factory/runs/:id, GET /factory/runs/:id/raw, POST /factory/runs/:id/stop in Harbor::RunsController; the menu's Runs entry is the engine's own route.
  • A site with no code of its own gets both pages whole: a run's name and status, its agent, model, cost and tokens, where it ran (runtime, runner), its command, what started it, the runs it delegated with what each cost, its parsed events, its live log, its error, input and output.
  • While a run is under way its page refreshes every five seconds (a morph, with Turbo), and the log is a window that stays on its newest line (harbor--log-follow). A finished run's log is all on the page.
  • Both pages wrap instead of scrolling sideways on a phone. The list keeps the two-line row.

Where a host plugs in

Partials in the host's app/views/harbor/runs/, rendered when they exist:

Partial Where Locals
_show_actions the heading, beside Stop run
_show_meta the end of the header's first line run
_show_extras below the details, above delegated runs, events and log run

Partials of Harbor's that a host replaces with one of the same name (an application's views are found before an engine's; a test checks the order):

Partial Harbor's Locals
_agent the agent's name, plain run, detail
_details the card: what, agent, where, model, command, started by, timing run

Code, not markup:

  • config.run_stop = ->(run, user) { … } returns a notice or raises. Without it, Stop is offered for agent sessions and queued runs only.
  • Harbor::Run.for_page(filters), #delegated_runs, #raw_log_file: overridable on the host's run class.

Also

  • harbor--details: a <details> stays as the reader left it across a morph.
  • harbor_run_link is always a link; starting a database operation redirects to the run's page.
  • Version 0.18.0, CHANGELOG with "Upgrading from 0.17", README "Runs pages".

Tests

test/runs_pages_test.rb (33 tests): the list, the run's page, the live log, events, raw download, delegated runs, Stop (session, queued, neither), the run_stop hook, each host partial present and absent, both overrides, the page switch, login, the nav. 527 runs, 0 failures; rubocop clean.

Not checked in a browser.

… and Stop

Harbor::RunsController serves /factory/runs, /factory/runs/:id, …/raw and
POST …/stop, and the menu's Runs entry is the engine's own route. A site with
no code of its own gets both pages whole: a run's name and status, its agent,
model, cost and tokens, where it ran, its command, the runs it delegated with
what each cost, its events, its live log, its error, input and output. While
a run is under way its page refreshes every five seconds and the log is a
window that stays on its newest line. Both pages wrap instead of scrolling
sideways on a phone.

A host adds to a run's page with partials in its own app/views/harbor/runs/,
rendered when they exist: _show_actions (buttons beside Stop), _show_meta (the
end of the header's first line) and _show_extras (sections of its own). It
replaces how an agent is shown (_agent) and the details card (_details) with
a partial of the same name, which Rails finds before the engine's.

What is code is a method on the run class or one hook: Run.for_page(filters)
is what the list holds, #delegated_runs the cost breakdown, #raw_log_file the
download, and config.run_stop stops a run that isn't an agent session.
Without the hook, Stop is offered for sessions and queued runs only.

harbor_run_link is always a link now, and starting a database operation goes
to the run's page.
@adamfortuna adamfortuna changed the title The Runs pages are Harbor's (0.18.0) The Runs pages are Harbor's (0.19.0) Nov 14, 2026
@adamfortuna
adamfortuna merged commit bc6f7fa into main Nov 14, 2026
2 checks passed
@adamfortuna
adamfortuna deleted the runs-pages branch November 14, 2026 21:36
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