The model
PiFi tracks work as branches: a repository on a branch, with one or more agent sessions. The Sessions page lists individual sessions; the Board and mirrors show branches.
Three questions
Every component answers one of three questions:
| Question | Components |
|---|---|
| What work is it? | Project, branch, session, and the issues a scope’s source attaches. A scope is a named part of this work |
| Where does it run? | Host, workspace (the checkout), and how its Pi runs: held by PiFi in a terminal session, in a pane you started it in yourself, or over RPC |
| Where do you look at it? | Clients: the web app, the phone, the CLI, and herdr and tmux sessions, which mirror nothing, everything or one scope |
A scope never depends on the client a session was started in or is shown in, so a session is in the same scopes everywhere. The Sessions page can group rows by project, host or status, or show no headings. Sorting and the run-location filter are independent of grouping. The filter can narrow the list to a host or a currently reported client and combines with the selected scope; a stopped session’s remembered terminal is last known, not a current client location. One herdr session can mirror everything, a herdr session per scope can each mirror a part, or both: the scopes are the same either way.
The components
| Component | What it is | Who owns the truth |
|---|---|---|
| Host | A machine that runs agents and holds checkouts | The host: filesystem, git and processes |
| Project | A provider-listed repository, possibly without a checkout | Provider authority and immutable repository ID; PiFi owns the Project ID and history |
| Branch | A project on a branch: the card on the Board. Derived, never stored | Workspaces, sessions and tracked issues |
| Workspace | A branch’s checkout on one host: the main checkout or a git worktree, with its git state | The host |
| Session | A Pi agent in a workspace. One per branch is primary; other sessions on the branch are extras; subagents hang off the session that started them | Pi owns the conversation; PiFi owns which session is primary |
| Scope | A named part of your work: a set of projects you choose and pins, or the issues of a GitHub source (those assigned to you in one owner, or every open issue on a Projects board) (scopes.md). A scope can still limit hosts (older ones); new ones leave where sessions run to the run-location filter | PiFi; GitHub for a source’s issues |
| Issue (tracked issue) | One issue a scope’s source follows: its branch, pull request and board column | GitHub; PiFi keeps a snapshot |
| Device | A sign-in credential: a browser, the installed app, a machine’s CLI | PiFi |
| Client | Anything signed in that shows your work. A herdr or tmux session is one PiFi keeps a record of: it holds Pi you start there by hand (own panes) and, if you choose, mirrors nothing, everything or one scope as a tab per active branch. It is reported by the device its plugin signs in with, and on a host when there is one (clients.md) | PiFi records what it mirrors; its plugin reports what it shows |
| Task, Run | Automation: scheduled or dispatched work that makes its own worktree and session | PiFi |
How they work together
- Opening work is one action: open a branch. PiFi finds or creates the worktree, finds or starts its primary session, and shows it. It is the same action for a new branch, an existing branch with no session, and a branch with a running agent (
POST /api/branches/open; New session in the web app; Start session on an issue, or an issue chosen in New session). - A second session on a branch is allowed. You ask for it explicitly (“Start another session in this branch”, or “New session in this branch” in the session menu). It has its own row on Sessions. Choose another primary from the session menu.
- The same branch on two hosts is one branch. Each host keeps its own workspace with its own git state; the Board shows the host where its primary session runs. Sessions lists each session on its own host.
- A source decorates branches. An issue with a branch shows its issue, pull request and board column on that branch. An issue with no branch waits in the Board’s Not started column; starting it makes the branch, its worktree on the project’s default host, and an idle session.
- A GitHub scope is its issues’ work. It holds the sessions on branches linked to its issues, whatever their state, plus any session in its repositories that is live right now. A stopped session with no issue is not in it; it is under Current.
- Needs input is a question you can still answer. When a session’s Pi stops, its open questions expire and its “Needs input” clears, whatever raised them. Other attention (failed, ready to review) keeps its own label and does not keep a stopped session under Active. Clear a flag by hand from the session menu (Clear Needs input) or the Attention page (Clear).
- A pin is membership only. Pinning a session adds it to a scope; it does not keep the session from being archived, and archiving it removes its pins. Starting a session with a scope selected in the web app does not pin it; starting one from a herdr or tmux client that mirrors a scope pins it only when the scope would not show it otherwise, and says so. A pin does not open a mirror tab either: a pinned session’s branch gets one while it is active, like any other.
- A scope decides which branches you see; a client decides where. Every client that mirrors a scope shows the same branches, and the web app and phone select a scope of their own. What a herdr or tmux client mirrors is recorded in PiFi (
pifi clients bind, or Settings > Clients), never taken from its name. - A mirror shows branches, not every session. It opens a tab for each branch’s primary while the branch is active (live, waiting for input, unread, or active in the last 48 hours), so mirroring everything stays usable with hundreds of stopped sessions. Extras open on demand from a new tab. Closing a primary’s tab archives it everywhere; closing an extra’s only hides it.
- Where a session runs is a fact on the session, not a scope. A Pi you start in your own pane can show its reported client on its row and under Details (Runs in), with the same label (“herdr default on Mac”, through the host’s PiFi name), and belongs to the same scopes as any other session in its project. After it stops, Details says where it last ran by hand. Which scope a client mirrors (Mirrored in, in the scope’s Edit dialog) is a separate fact. A client you only work in by hand needs no binding: it mirrors nothing, and focusing such a Pi still counts as reading it.
- Watching counts as reading. The session in the focused pane of a herdr or tmux client you are attached to is viewed, like one open in the browser: it is not marked unread, and it sends no new notification, while you are at the computer.
- Cleanup follows the branch. When the pull request merges and the worktree is clean and idle, its sessions are archived and the worktree removed (with “Remove merged worktrees” on). Removing a worktree any other way archives its ended sessions too.
- Letting a session go archives it. Quitting its Pi, replacing it, or closing its tab or pane archives it, except the primary of a worktree branch that has not landed: the branch keeps that one until it lands or its worktree is removed. A main checkout’s sessions are each their own task. Sessions that ended without being let go (a restart, a crash) stay Current for 3 days, 7 when unread; both are settings (operations.md).
- One owner starts and cleans up work. PiFi can do it (Start session, “Keep a session in every worktree”, “Remove merged worktrees”, board write-back), or your terminal tools can (a Pi plugin that starts issues in worktrees, a multiplexer that removes merged ones) while PiFi only watches: sessions you start yourself are adopted, branches and issues are matched, nothing is created or removed. Pick one per project and turn the other off (scopes.md).
Where work shows
| Work | Where it shows |
|---|---|
| Not started: a tracked issue with no linked branch or worktree | Board (Not started) and New session → From an issue |
| Linked branch or worktree with no session | Board (Working, unless its PR is in review or merged); linked issues also appear under All tracked issues |
| Active: its session is live (starting, idle, running, waiting for input) | Sessions and Board |
| Needs input: its live session has a question you can still answer (a dialog, a plan to approve, an adapter’s question) | Sessions under Active and Needs input, Attention, and Board |
| Stopped: its session is stopped, failed or interrupted, and not archived | Sessions under Current, and Board. In a GitHub scope, only when its branch is linked to one of the scope’s issues or the session is pinned |
| Archived: you let it go, its branch landed or its worktree was removed | Sessions under Archived (searchable) |
Sessions and branches share one vocabulary: Not started (an issue with no branch), Current (started, not finished: a branch that has not landed, a session you have not let go), Active (Current with a live Pi, or needing you) and Archived (finished or let go). Active sits on top of Current; it is not a separate list.
Create is always Start session; Open goes to a session that exists; Resume restarts a stopped one.
Stages
A branch’s stage comes from facts, never from a status PiFi stores:
| Stage | When |
|---|---|
| Not started | A tracked issue with no branch yet |
| Working | The branch exists, with no open or merged pull request |
| In review | Its pull request is open |
| Merged | Its pull request has merged |
The Board shows branches by stage, or, for a GitHub scope with a Projects board, by that board’s columns. Its Issue list and New session’s From an issue picker share the same inventory rules. A repository selected under All work or a manual project scope shows that repository’s open GitHub issues. A repository filter inside a source scope only narrows the tracked inventory. Selecting an issue reads it. Only Start session provisions work; the same GitHub issue in different views reuses its branch and session.
Tasks
Tasks and runs are for automation: an automation or the task board (/tasks) dispatches a task, which gets its own worktree and session, checks and a review step. They are not the list of what you are working on; Sessions lists your individual sessions, and the Board shows their branches.