feat(web): manage independent schedules and restore recorded stage navigation
This commit is contained in:
@@ -9,7 +9,7 @@ import (
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
var skillFiles = []string{"SKILL.md", "references/orchestration.md", "references/work.md", "references/queue.md", "references/debugging.md", "references/delivery.md", "references/format.md", "references/notifications.md", "references/operations.md", "references/transfer.md", "references/verification.md", "references/control.md", "references/harnesses.md", "references/access.md"}
|
||||
var skillFiles = []string{"SKILL.md", "references/orchestration.md", "references/work.md", "references/queue.md", "references/debugging.md", "references/delivery.md", "references/format.md", "references/notifications.md", "references/operations.md", "references/transfer.md", "references/verification.md", "references/control.md", "references/harnesses.md", "references/access.md", "references/schedules.md"}
|
||||
|
||||
func SkillDirectory() (string, error) {
|
||||
dir := os.Getenv("XDG_CONFIG_HOME")
|
||||
|
||||
@@ -35,7 +35,7 @@ explain the gap; ask before authoring. Do not add a task-specific pipeline as a
|
||||
## Authoring
|
||||
|
||||
A definition is Markdown: `# stage <Name>` sections with `prompt`, `configs`,
|
||||
`tools`, `edges`, and optional `limits`/`checks`/`settings`. Start from
|
||||
`tools`, `edges`, and optional `limits`/`checks`. Start from
|
||||
`examples/`. Use stage names that describe the work:
|
||||
|
||||
`Plan` · `Code` · `Review` · `UIReview` · `Land` (`Prepare` and `Survey` are
|
||||
@@ -49,6 +49,12 @@ free markdown. Use `links` and `memory` only when they clarify a handoff.
|
||||
`pipelines validate DRAFT` checks a draft; `pipelines submit DRAFT` publishes a
|
||||
new immutable version. `pipelines help <command>` has flags.
|
||||
|
||||
Schedules are separate saved run configurations: pipeline/version, prompt,
|
||||
workspace and other run options, plus timing. Never add `# settings` or schedule
|
||||
blocks to a workflow to arrange recurring work. One generic pipeline can have
|
||||
many independent topics and timers. Read `references/schedules.md` when the user
|
||||
explicitly asks to manage a schedule; scheduling alone is not workflow authoring.
|
||||
|
||||
## Turns and artifacts
|
||||
|
||||
Each visit has `input.md` (the run prompt or previous body), `memory.md`
|
||||
@@ -73,6 +79,7 @@ Read only what the task needs:
|
||||
| Delivery and installation | `references/delivery.md` |
|
||||
| Harnesses and models | `references/harnesses.md` |
|
||||
| Notifications | `references/notifications.md` |
|
||||
| Independent saved run schedules | `references/schedules.md` |
|
||||
| Transfer and versions | `references/transfer.md` |
|
||||
| Hosting, auth and deployment | `references/access.md` |
|
||||
| Queue and work items | `references/work.md`, `references/queue.md` |
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
# Definition format
|
||||
|
||||
Definitions are Markdown made only of `# stage KEY` headings and fenced blocks.
|
||||
An optional `# settings` section precedes all stages. No unrelated prose outside
|
||||
blocks. The first stage receives the run prompt in its `input.md`; later stages receive
|
||||
Scheduling belongs to separate saved run configurations, not `# settings` or
|
||||
schedule blocks in the definition. No unrelated prose outside blocks. The first
|
||||
stage receives the run prompt in its `input.md`; later stages receive
|
||||
the previous turn's output. Every visit also gets a `memory.md` of completed
|
||||
turns. There are no stage `input`, `output`, or `memory` blocks: the model reads
|
||||
the turn files and writes free-form markdown, and only the `# outcome` section is
|
||||
@@ -247,13 +248,20 @@ fix a response's formatting.
|
||||
|
||||
## Scheduling
|
||||
|
||||
Manual-only is the default. To schedule, put `# settings` before all stages with
|
||||
a nonempty fenced `prompt` and one or more fenced `schedule` blocks. Each schedule
|
||||
uses exactly one of `times=09:00,17:30` or `every=15m`, optionally
|
||||
`days=mon,tue,wed,thu,fri` and `timezone=Europe/London`. Intervals are at least
|
||||
one minute. Submission activates the latest version's schedules immediately.
|
||||
Removing settings disables schedules on the new version. Scheduled shell/edit
|
||||
are not approved. Warn explicitly before adding/changing schedules.
|
||||
Publishing a workflow does not schedule it. Create a separate saved schedule
|
||||
with an explicit pipeline/version and complete run information (prompt, server
|
||||
workspace, model overrides, notifications, output format and write restrictions
|
||||
when used). Multiple saved schedules can reuse one workflow with different
|
||||
research items or timers; updates and deletion do not rewrite the definition.
|
||||
Use exactly one timing rule: `times` (24-hour clock values) or `every` (a duration
|
||||
of at least one minute), with optional weekdays and timezone.
|
||||
|
||||
New definitions with embedded schedules are rejected. Historical immutable
|
||||
versions remain readable; their latest legacy slots migrate into separate saved
|
||||
schedules without changing source/history or replaying old occurrences. Never
|
||||
reintroduce legacy scheduling blocks or make a new workflow just to set another
|
||||
topic/timer. Warn explicitly before enabling unattended runs. See
|
||||
`references/schedules.md` for the API and retry/concurrency guards.
|
||||
|
||||
## Notifications
|
||||
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
# Independent saved run schedules
|
||||
|
||||
A schedule is not part of a workflow. It pairs an explicit pipeline ID/version
|
||||
with run information (`input.prompt`, server `workspace`, optional model/stage
|
||||
overrides, title, notifications, output format, and `write_paths`) and a timer.
|
||||
One generic research workflow can have many topics/prompts on different timers.
|
||||
Scheduling an existing workflow never authorizes creating/editing/publishing a
|
||||
workflow or altering its permissions. Ask before enabling unattended runs unless
|
||||
the user already requested that schedule.
|
||||
|
||||
The web app exposes **Pipeline → Schedules → Add schedule** and **Schedule this
|
||||
run**. The latter copies original input/options, not output, and preserves
|
||||
run-level write restrictions. Publishing a workflow creates no timer.
|
||||
|
||||
All scheduling commands use the existing JSON envelope through `pipelines rpc -`:
|
||||
|
||||
- `list_schedules` with optional `pipeline_id` → `schedules`.
|
||||
- `save_schedule` with a full `schedule` object → `schedule`. Omitted/zero ID and
|
||||
revision create; edits require the returned positive `id` and current
|
||||
`revision`. The record contains `name`, `pipeline_id`, `version`, `enabled`,
|
||||
`input`, `workspace`, and `rule`.
|
||||
- `delete_schedule` with `schedule_id` and `expected_revision` removes future
|
||||
occurrences only. History and already admitted/running work are retained.
|
||||
|
||||
For creates, use a new top-level `request_key` for each intentional schedule and
|
||||
reuse it only to retry that same creation after a lost response. A conflicting
|
||||
payload fails; retrying a deleted creation cannot resurrect it. On revision
|
||||
conflict, reload and reconcile—never force-overwrite somebody else's changes.
|
||||
|
||||
`rule` uses exactly one of `{"every":"24h"}` or
|
||||
`{"times":["09:00","17:30"]}`, optionally `days` (`sun` through `sat`, omit for
|
||||
everyday) and `timezone` (IANA, `UTC`, or server-local `Local`/omitted). Intervals
|
||||
are at least one minute. Workspace is an existing absolute directory on the
|
||||
execution server, not the browser/client's filesystem. Validate run/model options
|
||||
against the pinned workflow; unavailable providers still need runtime checks.
|
||||
|
||||
**Pipelines → Has schedules** includes configured paused schedules.
|
||||
**Runs → Scheduled runs** means a real timer-triggered execution, not a manual
|
||||
run of a pipeline that happens to have schedules. Provenance stays after pause or
|
||||
deletion. Missed occurrences are skipped, not replayed; overlapping workspace
|
||||
execution is refused and recorded. Do not add recovery workflows or rerun work
|
||||
merely because a timer's dispatch was skipped.
|
||||
Reference in New Issue
Block a user