The template catalog is now Example 1-4: one stage, two stages (handoff),
feedback loop (runner-owned limits, retries, timeout) and human decision
(type=human approve/revise/abort with notify hooks). All read-only or leave
changes uncommitted; none commits, pushes or deploys.
A brand-new database (schema created by this Open) gets the examples once at
server start, bound to the configured default model and harness. A
server_settings marker records the decision, so removed examples never come
back and existing installs are marked without any pipeline being added or
rewritten.
Rewrite the README around the server, web/Android app and CLI, and
replace docs/install.md with the current native install (all-or-nothing
Docker web build, flags from setup-native.py, lifecycle commands, data
locations, password, upgrading). Add docs/harnesses.md and
docs/notifications.md; point ntfy.md at the new overview and fix its
topic name.
Record every notification published to ntfy (run outbox, stage notify
hooks, chat question/approval/reply) in a persisted app_notifications
outbox and stream it to subscribe_notifications clients with an after
cursor; clear_notifications and ack_attention clear across devices, as do
runs leaving waiting, deleted runs and answered chat questions. Add the
notify.ntfy_enabled setting (default on) to stop only the ntfy publish.
Auto runs no longer alert on failure or success; only notify_mode on does,
unless the run_finished setting (now 'Notify when any run ends', default off)
opts into every run end. Waiting still notifies auto and on runs. The setting
is stored under a new key so a value saved under the old meaning is ignored.
Persist three global ntfy switches in server_settings: run_finished
(default on: auto-mode runs notify on success, read inside the
transition transaction; on/off modes unchanged), chat_needs_you
(default on: gates chat question/approval alerts) and
chat_reply_finished (default off: one alert per finished assistant
turn). Expose notification_settings / set_notification_settings over
the websocket protocol, add a Phone notifications section with
Material and Cupertino checkboxes in Settings, document the settings,
and keep the cli, tui, stage and pipeline test packages from
inheriting a real ntfy configuration.
Run notifications now always click through to pipelines://run/<id>; a valid
PIPELINES_WEB_PUBLIC_URL adds an "Open in browser" ntfy view action instead
of replacing the click. Queued rows derive links from the run id at delivery,
so legacy rows holding a web URL still open the app.
Unresolved chat questions/forms and permission requests publish one async,
bounded notification to the system destination (pipelines://chat/<id> plus the
browser action), deduplicated per form/request id across reconnects and
replays. stage.PublishNtfy gains optional, strictly validated view actions.
Server tests now clear the operator's real ntfy environment.
Nothing told the operator that a run was waiting for a person or had failed; they
found out by going looking. A run that needs attention now reaches the ntfy they
already run, and the app answers "what needs me now" in one live, ordered surface.
Server (smallest change, reusing the existing publisher):
- internal/server/notify.go adds notifyRun, called from finishRunState (failed)
and when a run parks on a human (runner.go runLoop). It publishes to the same
already-configured `system` destination through the unchanged stage.PublishNtfy,
so there is no second publisher, topic or service and the token handling is the
stage's own. runAttentionEvent maps only waiting and failed; queued, running,
succeeded, canceled and interrupted publish nothing.
- No storms: runner.attentionSent records sequence:event per run before publishing,
so a run that stays waiting is never republished on a re-request or restart, and
a stage notify policy that already covers the same event marks it first so the
run-level default is suppressed. The set is dropped when the run is terminal. A
delivery failure is logged, never fails the run, and is not retried.
- The payload names the run and pipeline and carries a click action
pipelines://run/<id> (validated: absolute URL, no userinfo, no fragment, no
credentials). PublishNtfy gained the optional click parameter; existing callers
pass "".
App:
- AndroidManifest/MainActivity declare the pipelines://run/<id> deep link
(singleTop); runIdFromDeepLink parses it and PipelinesApp opens that run once,
clearing the link. It opens a run; it starts nothing.
- ui/Attention.kt is the pure model (status -> Decision/Failed/Finished or
nothing, ordered by kind then newest-first) and ui/components/AttentionSurface.kt
is the floating indicator plus bottom sheet. It is derived from the same run
events the server already pushes, so an entry appears with no refresh and clears
when resolved; a finished run clears once looked at, and any entry can be
dismissed, persisted in SettingsRepository. The existing destinations, pill and
bottom strip are untouched and no competing navigation surface is added.
Checked before committing:
- Packaged authoring skill references: internal/author/skill/references/
notifications.md documents the automatic run-attention notifications and the
app surface. The only packaged "template" carrying notify is that reference; no
pipeline definition template exists to update and install.go's managed file list
is unchanged (notifications.md already existed).
- Repository guidelines: docs/ntfy.md gains an "Automatic run-attention
notifications" section and no longer claims "No block means no notifications";
the top-level README phone-notifications note now says a waiting/failed run
notifies automatically; android/README.md gains the dated feature section and
supersedes the previous section's note that the attention surface was absent.
- docker.md, install docs and the CLI/TUI docs describe mechanisms this change
does not alter; left as they are.
Tests: go test ./internal/server/... ./internal/stage/... ./internal/author/...
all ok; notify_test.go covers the event mapping and the real HTTP delivery
(destination, topic, click, no duplicate). Android :app:testDebugUnitTest ->
BUILD SUCCESSFUL, 58 suites / 531 tests / 0 failures (new AttentionTest, 13 cases,
covering ordering, appearing from a push, clearing on resolution, dismissal, the
empty case, persistence and the deep link). Device screenshots and the phone's own
notification are visual review's per the brief's device policy.
Scope: android/ plus the smallest server change; no new dependency, no run started
from the app, no installer or Docker change.
Make OpenCode authoring responsive and expand the managed skill references. Add conflict-aware import/export, real-provider reference workflows, and tracked V2 generation for reliable budget accounting.