Repository navigation
fix: close the gaps a review found in limited access tokens - #209
Merged
Merged
Conversation
A review of #207 found these: - A token whose agents may only comment could steer a session that started able to push, once that session's project was held lower: its sandbox keeps a token that pushes until it expires. Whom a token may steer now goes by what the session started with. - A token that does everything could change its projects' settings, and so what their agents do, whatever it held its own agents to. Only a token that runs sessions may now hold its agents lower (fctl token --github makes one). - GET /auth/me showed a limited token its person's other addresses. - A limited token could fetch any workspace's avatar. - Values a newer version may store read as the most an agent may do: they now read as the least, and limits with a field this version doesn't know reach nothing. - fctl resolve's refusals named other repositories of the installation.
kalaspuff
approved these changes
Oct 22, 2026
kalaspuff
pushed a commit
to hyperstructure/fctl-site
that referenced
this pull request
Oct 22, 2026
Adds fctl's new **Automation** guide to fctl.sh/docs, and updates the privacy policy for limited access tokens (hyperstructure/fctl#207). hyperstructure/fctl#207 is merged and fctl's CI pinned it (`fctl-docs.ref` at 9ced8ea), which this branch now has from `main`, so the build finds the page: ready to merge. hyperstructure/fctl#209, which follows #207, changes these docs' wording only; the next pin brings it. ## What changed - `scripts/docs.mjs`: `docs/automation.md` renders at `/docs/automation/`, after the CLI in the navigation. It covers access tokens limited to what they are for, what agents may do on GitHub (push, comment, read), and review agents from GitHub Actions. Links from other pages to it now stay on the site. The 404 page's suggestions test lists it too. - `legal/privacy.md` (`updated` is already today): - **Sign-in sessions and tokens**: for an access token you limit, app.fctl.sh keeps what it may do, the workspaces and projects it reaches, and what its sessions' agents may do on GitHub. - **Projects and sessions**: each session keeps what its agent may do on GitHub, and which access token started it, if one did. - **Browser storage**: the draft task keeps the GitHub access chosen for it, beside the project, model and effort level. ## Verification - `FCTL_DOCS_DIR=<fctl at fctl/133-…> npm run build` renders 9 docs pages. `/docs/automation/` links to `/docs/architecture/#access-tokens` and `/docs/cli/`, and the nav lists it on every page. - `npm run check`: no new findings (the two `!important` warnings in 404.html and 500.html are on main too). - `node --test scripts/*.test.mjs`: 13 pass. Session: https://app.fctl.sh/s/ses_01M5HPGZ4R0NQCXSMFR659JEHJ Co-authored-by: fctl-sh[bot] <fctl-sh[bot]@users.noreply.github.com>
fctl-sh Bot
added a commit
that referenced
this pull request
Oct 23, 2026
A schedule asked for no GitHub access stored none, which means the project's as each run starts, whatever the token that set it up allowed; and a change that left the access out kept the one stored. A token held to comment or read on GitHub could so set up, or rewrite the task of, a schedule whose timed runs push. Since #209 a token that does everything (which setting up or changing a schedule takes) can't be made with a cap, so only tokens made before it could; the rule holds anyway, as it does for running one. Setting one up, changing it, resuming it and taking it over with a capped token now keep its access within the cap (fctl_domain::schedules::github_within); pausing it changes nothing.
kalaspuff
pushed a commit
that referenced
this pull request
Oct 23, 2026
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>
This was referenced Oct 23, 2026
kalaspuff
pushed a commit
that referenced
this pull request
Oct 23, 2026
New projects now start with all four follow-ups on: comments that mention the agent, failed checks, merge conflicts, and merged or closed. Before, every switch started off, so in session #209 an agent wasn't told when its pull request (#246) began to conflict with `main`. ## What changed - `settings::for_new_project` (`crates/fctl-domain`) turns on each follow-up that the create request leaves out, next to where it turns connectors off. A request that sends `follow_ups`, or some of its fields, keeps what it sends. The project then stores every switch. - **Existing projects are left as they are stored. There is no migration**, as the issue's decision asks. `FollowUps::default()` is still all off, so a project stored without `follow_ups`, or without one of its fields, still reads them as off. Serde and the SQL in `pull_requests::moved_onto` (`json_extract(…) = 1`) therefore still agree. To turn them on in an existing project, use its Settings or `fctl projects set --follow-ups all`. - `fctl projects create --connectors` sends whole settings, which turned follow-ups off. It now sends `FollowUps::ALL`, a new constant in `fctl-proto` that `--follow-ups all` uses too. A CLI one version behind still sends them off. - Docs: architecture, self-hosting and cli are updated, and the new ADR 0051 supersedes the "all off" part of ADRs 0043 and 0045 for new projects. The ADR also says what limits the cost: at most three failed checks and three conflicts in a row while nobody messages the agent, and one follow-up for a merge or close. - The protocol doesn't change: only a doc comment does, which shows up in `web/src/gen`. Hosts and agents need nothing. - fctl-site's privacy policy needs no change: it says what happens "where the project's follow-ups are on", which still reads right. ## Verification - New unit tests in `fctl-domain` (`new_projects_start_with_follow_ups_on_unless_asked`) cover a request with no settings, one with other settings, one with some follow-ups, and an older CLI's whole default settings. - `cargo xtask check --quick` passes. - In `cargo xtask dev`: - `fctl projects create` and `fctl projects create --connectors` both stored all four switches as `true` in D1. - A POST with `{"follow_ups":{"checks":false}}` stored checks off and the other three on. Fixes #247 Session: https://app.fctl.sh/s/ses_01M5NFNH5ZCX4BA0S6QERHAB57 Co-authored-by: fctl-sh[bot] <fctl-sh[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-ups to #207. A review of #207, by an agent reading the code without my notes, found one way past the limits, a design gap, and four smaller issues. I checked each against the code, and this fixes all of them.
Refs #207
What changed
SessionRow::started_github), for both HTTP and socket rechecks. Tokens and pages keep the effective value.fctl_domain::limits::check).fctl token --github commentwithout--accessmakes a token that runs sessions.GET /auth/mefor a limited token listed the person's other email addresses, and whether they have a password, two-factor or passkeys. It now shows only their name and primary address, as the docs said.GET /workspaces/{id}/avatarignored a token's places, since its handler checks membership itself. Limited tokens no longer reach it; nothing that uses them needs it.readfor tokens and aspushfor steering decisions;github_accessno longer makes a project's whole settings unreadable, which had fallen back to defaults that push;fctl resolverefusals named the repository of a thread outside the session's repositories, and told a missing thread from a foreign one. Both now get the same answer, which names no repository.The docs (architecture, CLI, Automation, security) and ADR 0037 say all of this.
Verification
readand keeps the other settings;cargo xtask check --quickpasses: fmt, generated types, Clippy for host and wasm, all Rust tests, 566 web tests.cargo xtask dev:fctl projects set -p hello --github comment,fctl showsays the session "reviews and comments", and the token is still refused.fctl token x --access full --github commentis refused with the reason, and the avatar route answers 403.fctl token x -p hello --github commentmakes a token that runs sessions.whoami --jsonwith a limited token shows no other addresses or sign-in details.Screenshots
The new token dialog with Everything chosen (light), at 8486659: no GitHub question, and a sentence that says why.
Session: https://app.fctl.sh/s/ses_01M5HPGZ4R0NQCXSMFR659JEHJ