Repository navigation
docs(legal): say what app.fctl.sh keeps of schedules and their runs - #47
Conversation
fctl's projects get schedules (hyperstructure/fctl#9): tasks that start sessions on their own, once, again and again, or when a person or another tool asks. The policy now says what app.fctl.sh keeps of each schedule and its runs, that what a tool sends with a run goes into the session's transcript, how long they are kept, and what becomes of them when their owner deletes their account.
|
Partly addressed as of fctl reviewed On lines the diff doesn't show:
Reviewed by fctl · Review agent settings |
fctl's review found that the policy named no recipient for a schedule's task or for what a person or tool sends with a run, and didn't say that a project's members see its schedules. Anthropic now gets both, on the Claude account each run starts on (the owner's at its time, otherwise whoever runs it or whose token a tool runs it with), and the members see each schedule, whose account it runs on and what started its runs. The retention entry no longer reads as if sessions outlived a deleted project: deleting a schedule leaves its sessions, and its runs go with it. Account deletion covers the schedules someone took over too.
|
On Recipients section doesn't cover scheduled sessions: fixed in 6ebcd0e, with one correction to the finding. Not every run starts on the Claude account stored on the schedule: only runs at the schedule's time do. A person's Run now starts on that person's own account, and so does a tool's run with someone's access token ( People you work with now says that a project's members see its schedules, with who set up and changed each, whose Claude account it runs on and who or what started each run. These are the same people who see its sessions: The same commit also makes account deletion cover the schedules someone took over, not only those they set up, since both stop running on the deleted account. |
…ent-https-github-com-hyperst # Conflicts: # legal/privacy.md
Fixes #9 Projects get **schedules**: a task fctl starts a session for on its own. A schedule runs once at a set time, again and again, or only when asked. Repeating ones run every hour, day, weekday, week or month in a time zone, or on any cron expression. Other tools start agents by running a schedule with what they know of why. So issue trackers like Linear, Jira and ClickUp can start agents today with one request, and a built-in integration gets a place to plug in later. ## What changes **Schedules** (`schedules` and `schedule_runs` in D1; [ADR 0044](docs/adr/0044-schedules-start-sessions-on-their-owners-subscription.md), [architecture](docs/architecture.md#schedules)) - **What a schedule holds.** A name, the task its runs' agents get, and when it runs. Also what its sessions start with: model, effort level, base branch and GitHub access. Unset ones follow the project's, and GitHub access never exceeds what the project allows now. - **Whose subscription.** A schedule runs on the Claude subscription of whoever set it up. The project's maintainers and owners may also change it. Their change moves it to their own subscription, and so do a resume or "Run it on my subscription". Nobody puts work on someone else's subscription. - **Runs don't pile up.** A run is skipped while the last one is still working on its task. - It is also skipped while the owner's plan is at its limit, as the issue asks, until the limit resets. A one-off waits for the reset instead. - When the owner can no longer run it, fctl pauses it and says why: they left, lost the role or have no Claude connection, or the project is archived. - **Each run is a session** named after the schedule. - Its first message is the task, then a note from fctl: which schedule started it, when and for whom, its previous run, and that nobody watches it start. - The transcript shows the note apart from the task. **Starting agents from other tools** - **Running a schedule now.** `POST /api/v1/schedules/{id}/runs` runs a schedule on the caller's subscription. - It takes `context`: what the tool knows of why it runs, such as an issue's text. - From an access token, the agent gets that text after the task, inside `<context>`, marked as information and not instructions. - A token that runs sessions may run schedules. Setting one up or changing it takes a token that does everything, since its sessions start after the token is gone. - People and tools can run a schedule 20 times an hour. Pausing it stops them all. - **When asked.** A schedule without a time is a task saved for its case. Each schedule's details show the request another tool sends, ready to copy. **The alarm** - **A Durable Object of its own.** `ScheduleObject` (wrangler migration `v4`) keeps one alarm for the earliest next run, which D1 keeps per schedule. The hourly cron trigger would run up to an hour late, and `wrangler dev` runs no crons. Alarms ring on Cloudflare, in the standalone server and in development. - **Each run is claimed before it starts.** A compare-and-swap on `next_run_at` in D1 means a retried alarm starts nothing twice. A failure after the claim is recorded as a failed run, so a one-off never looks done without having run. The hourly job re-arms the alarm in case a wake went missing. - **Cron and time zones.** `fctl_domain::cron` reads Vixie cron: five fields, names, steps, `@daily` and the like, and Vixie's day-of-month/day-of-week rule. It finds next runs as wall-clock times in a zone. - The control plane reads zones with `Intl`, as browsers do, so the wasm carries no time zone database. - The web app finds the same runs by the same rules (`web/src/lib/schedules.ts`). - A time the clock skips in spring runs as far past the change. A time the clock repeats in autumn runs once. **Web app** - **A Schedules tab.** - With no schedules yet, it explains what they are and offers ideas to start from: dependency updates, triaging new issues, tidying the project's memory, and learning from the week's reviews. - Then it lists the project's schedules, with when each runs next and what its last run did. - Each schedule opens to its task, settings, next runs and runs, and the request for other tools. - **The form reads as a sentence**, such as "Every [weekday ▾] at [09:00]". - Weeks get day toggles, months a day of the month. - Once is a day and a time, with quick picks: in an hour, this evening, tomorrow morning, Monday morning. - Cron is a field whose expression is explained in words as you type. - When asked needs no time. - It uses your time zone or any other, and shows the next runs as you choose, also in your own time when the zones differ. - The task box carries the composer's model, effort and GitHub pickers. - **Schedule button.** The Sessions tab's task box gets a **Schedule** button that turns what you wrote into a schedule. - The Agent Floor's task box has it too, as its symbol alone, from `xl` (1280 px) up. Narrower, it would push Start or the pickers onto another line, so there the project's own task box has it. The Agent Floor's draft is forgotten once a schedule is set up with it, and stays when the form is cancelled. - On a phone the Agent Floor's row now keeps one line. Before, with the GitHub picker and a model named by its ID, it put Start on a line of its own from 402 px down, and at 360 px the pickers too. Now the project's and the model's names give way when the row runs out of room. - **Sessions link back.** A session that a schedule started links to it from its page and shows its mark in lists. - **Phones.** One column, the decorative preview hidden, long names wrapping, and icon-only buttons. **CLI** - `fctl schedules`: `add`, `show`, `edit`, `pause`, `resume`, `run --context`, `runs` and `rm`. It finds a schedule by id or name. - `add` takes `--cron`, `--at 2h` (or an RFC 3339 time) or `--when-asked`, and `--tz`, which defaults to the machine's zone. **Docs** - Architecture: Schedules, ScheduleDO, data and deletion. - Automation: [Schedules](docs/automation.md#schedules) and [Start agents from other tools](docs/automation.md#start-agents-from-other-tools). - Also the CLI reference, development (testing schedules locally), security, ADR 0044 and the roadmap. - The data export now includes the schedules someone set up. - hyperstructure/fctl-site#47 updates the privacy policy to match. ## Screenshots At 2a76dbd, from `cargo xtask dev` with its data, in a 1440 px window unless noted. **What a project without schedules shows**, with ideas to start from:  **A project's schedules**, one of them open, in the light and the dark theme: when each runs next, what its last run did, a paused one, a one-off and one that runs when asked. | Light | Dark | |---|---| |  |  | **Setting one up from an idea**: the sentence form, the day toggles and the next runs:  **On a phone** (390 px): | No schedules yet | The list | The form | |---|---|---| |  |  |  | **A schedule that runs when asked**, with the request another tool sends:  **Its run's session**, started with curl and a tool's context. The header and the rail link to the schedule, and the transcript shows fctl's note apart from the task. The context sits inside `<context>`, marked as information, here with an instruction that tries to steer the agent:  **The Sessions tab's task box**, with **Schedule** beside Start, in the light theme:  **The same task box on an iPhone 16 Pro** (402 px), in the worst case: the GitHub picker shows (the project has a repository) and the model is named by its ID. Everything stays on one line, as it does down to 360 px:  **The Agent Floor's task box at 1440 px**, with **Schedule** as its symbol between ⌘+Enter and Start, in both themes:   **The Agent Floor's task box on an iPhone 16 Pro** (402 px), in the same worst case. Before, on `main`, the pickers and Start take a second line:  After: one line, with the model's ID cut short. Schedule isn't on the phone row; the project's own task box has it:  ## How I verified it - **Unit tests.** - `fctl-domain` cron: parsing and its errors, descriptions, next runs in UTC and in Stockholm across both summer-time changes, the Vixie day rule, gaps. - `fctl-domain` schedules: when a schedule runs, its state, names, zones, context, who may do what, plan limits and the run note. Also the routes limited tokens reach. - The web's `lib/schedules.test.ts`: the same descriptions as Rust's, next runs with `Intl` across summer time, the form's round trips, the run-note split and names. - The CLI's time parsing. - **End to end in `cargo xtask dev`**, with the CLI, curl and the browser: - A one-off due in a minute started its session on time, and Run now worked. - A run was skipped while the last session still worked. - With the dev plan at its 5-hour limit, a repeating schedule skipped to after the reset, and a one-off waited for it. - A schedule whose owner was gone paused with its reason, and resuming it made it the resumer's. - A When-asked schedule ran from curl with context, and its session shows the note and the context as information. - **The standalone server** (`cargo xtask serve`): its migrations applied, `cargo xtask dev --smoke --server` passed, and a schedule fired there on time. - **Layout, measured in Playwright.** - A schedule row's name line, avatar, Run now and menu center within 0.2 px of each other, and every row's avatar sits at the same x. - The Sessions tab's task box keeps all its controls on one line at 402, 393, 375 and 360 px, in the worst case above. - The Agent Floor's task box keeps one line at 360, 375, 393, 402 and 430 px in that case, and for a project without GitHub. - Its Schedule button adds no line at any of 29 widths from 360 to 1920 px. That holds with a model ID, the GitHub picker, two workspaces' labels, and a project with neither, measured against the same row without the button. - **The Agent Floor's Schedule, end to end:** it opened the project's Schedules form with the task. Cancelling kept the Agent Floor's draft, and setting the schedule up emptied it. `schedules.test.tsx` covers the same, and the button's states. - **An independent review** of the backend found no authorization hole. It did find: - Cron expressions with a stepped star in a day field (`0 9 */2 * *`) read as every day, and the form would have rewritten them on save. - A one-off was skipped for good while a session of its own still worked. - A sandbox-reported reset time could overflow the arithmetic. - The alarm and a person's edit could race, and so could two wakes. - A model's own weekly limit held back runs on other models. - A tool's text could close the `<context>` block. All of these are fixed, with tests. - **fctl's review agent** found that a token's cap on GitHub didn't stay with a schedule it set up or changed, so the schedule's timed runs could push. Since #209 only tokens made before it can have both full access and a cap, but the cap now holds anyway (`schedules::github_within`). It has a test, and I checked it in `cargo xtask dev` with such a token. - **The project's checks**: `cargo xtask check` and `cargo xtask dev --smoke` pass. ## Compatibility - Hosts and agents need no update: a schedule's run is a session like any other. - Protocol changes are additive (`Session.schedule`, new types), and older CLIs and web apps ignore them. - Deploys render the new Durable Object class and its migration `v4`, and apply D1 migration `0028` before the Worker. ## Left for later - **Retrospectives in the sandbox.** Agents can't read their project's retrospectives from a sandbox yet, only their own session's. So the "learn from the week" idea reads review comments for now; the roadmap's "Learning from retrospectives" covers the rest. - **Built-in integrations.** Linear, Jira and ClickUp integrations would be triggers that run a schedule with what they received, through the same path. They are on the roadmap now. Session: https://app.fctl.sh/s/ses_01M5M5BZQ6FV77CZ7Z23YMWJAQ --------- Co-authored-by: fctl-sh[bot] <343971779+fctl-sh[bot]@users.noreply.github.com>
fctl's projects get schedules (hyperstructure/fctl#229, for hyperstructure/fctl#9): tasks that start sessions on their own, once, again and again, or when a person or another tool asks. This brings the privacy policy in line with what app.fctl.sh then keeps:
The
updateddate is already today's.npm run checkpasses; its two warnings are onmaintoo.Session: https://app.fctl.sh/s/ses_01M5M5BZQ6FV77CZ7Z23YMWJAQ