Metadata-Version: 2.4
Name: fridica
Version: 0.12.2
Classifier: Operating System :: MacOS
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Rust
License-File: LICENSE
Summary: Your Slack presence: a parent agent per person, a session per thread, and Claude Code / Codex workers on your machines
License-Expression: MIT
Requires-Python: >=3.11
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM

# Fridica

Fridica answers Slack threads as you and delegates work to Claude Code or Codex on your machines. One daemon represents one Slack account. Its local parent agent decides when to reply and what to delegate. Each thread keeps its own conversation, decisions and workers, so a follow-up can continue a job on the same machine.

## Set up tokens on macOS or Linux

Install Fridica in a Python 3.11+ virtual environment with `python -m pip install fridica`. As the OS user who will run the daemon, store the Slack tokens and any worker tokens you already have. The same commands use **Keychain on macOS** and **Secret Service on Linux**. On Linux, run them in a user D-Bus session with an unlocked keyring. Each command prompts for the token with input hidden.

| Credential | Store in the OS keyring | Environment variable |
| --- | --- | --- |
| Slack app | `fridica secret set slack/app-token` | `SLACK_APP_TOKEN` |
| Slack user | `fridica secret set slack/user-token` | `SLACK_USER_TOKEN` |
| GitHub daemon reader (optional) | `fridica secret set github/read-prs` | Uses existing `gh` credentials when no reader keyring entry is configured |
| GitHub worker MCP | `fridica secret set github/mcp-token` | `GH_TOKEN` or `GITHUB_TOKEN` |
| alphaXiv MCP | `fridica secret set alphaxiv/token` | `ALPHAXIV_TOKEN` |
| NASA ADS (SciX) MCP | `fridica secret set ads/token` | `ADS_TOKEN` |
| Overleaf Git mode | `fridica secret set overleaf/git-token` | `OVERLEAF_GIT_TOKEN` |

Native Overleaf comments and pending Track Changes use one account login:

```sh
fridica overleaf-auth login --expected-email alice@example.com
```

Enter passwords/MFA yourself in the isolated Chrome/Chromium window. Later,
`fridica overleaf-auth login` reuses the saved account and valid session from the
same OS credential store. A browser is needed only for first sign-in or confirmed
expiry during this owner command; `--browser` optionally selects its executable.
Login needs no project, channel, worker UUID or model client and does not reload
or start a listener.

Native tools are bundled Rust through fridica-agent and Interleaf. Install a
matching Fridica build on registered workers; no Node, npm, Python adapter,
worker browser or Git token is needed for native comments and Track Changes.
Fridica attaches native tools only to admitted eligible jobs, retaining workspace,
channel, task-project and tool-approval guards. Supply the editor URL in the
requesting Slack thread to bind a project for writes. Unbound tasks can discover
and read projects within their grant. Existing logins retain seven operations.
Owners can enable the full native tool set with `fridica overleaf-auth grant --all`.
`native_compile` uses Overleaf's cloud compiler. Only `native_compile_local`
requires TeX Live and `latexmk` on the worker. Separate
Git mode keeps its existing token-based workflow.

Existing account/project/channel/recipient restrictions remain effective. See
[installation](docs/overleaf-native-source-install.md) and
[native operations](src/overleaf/README.md). These instructions describe
this source version; they do not imply a published release or runtime switch.

Slack automatically checks the standard environment variables first and then their keyring entries. You can delete the four standard Slack token assignments from an existing `[slack]` table. Keep any overrides that point to custom names.

To use an environment variable in Bash or Zsh, export it before running `fridica init` and supply it to the daemon at startup. For example, this prompts for an ADS token without putting its value in shell history:

```sh
export ADS_TOKEN="$(python3 -c 'import getpass; print(getpass.getpass("ADS token: "))')"
```

## Initialize Fridica

```sh
fridica init
```

On first setup, `init` enables each MCP with a nonblank environment token or a matching keyring entry. An existing local `gh` login also enables GitHub MCP. Discovery runs on the daemon machine and leaves workspace permissions intact. For credentials available only on an SSH worker, enable the corresponding MCP in `config.toml`. After configuring your workspaces, run `fridica doctor` to validate credentials on eligible workers. For Overleaf Git access, `OVERLEAF_PROJECT_ID` lets doctor check the Git token against one project. It is not a default target for native tools; native comments use the separate account login. With a native account scope, doctor checks installed tools without a Git token or session forwarding; live account validation waits for an admitted task.

For an isolated command-line installation, use `pipx install fridica` in place of the pip command. The wheel includes the native CLI and its credential helper. To install the version in this checkout, run `python -m pip install .` from the repository root with Rust 1.91 or newer.

`fridica init` creates four files under `~/.config/fridica/`:

| File | What to do with it |
| --- | --- |
| `config.toml` | Set the Slack identity, channels, backends and workspaces. |
| `manifest.yaml` | Import it when creating your Slack app. |
| `contract.md` | Customize how Fridica participates, replies and delegates. |
| `secrets.yml` | Use this optional mapping if your deployment uses Summon. |

For an existing installation with legacy state, stop the daemon, back up its configuration and database, and preview the migration with `fridica migrate --dry-run` before running `fridica migrate`.

### Prepare the machines

- **Daemon:** Install and sign in to the parent backend on this machine. The default is Claude Code. To use Codex, set `backend = "codex"` under `[parent]`.
- **Workers:** Install and sign in to every backend listed for that machine. Fridica's helpers use `/usr/bin/python3`. On SSH machines, the account must be reachable without a prompt, and the backend commands must be on its noninteractive `PATH`. Install Fridica there too when using the bundled GitHub, alphaXiv, ADS or Overleaf tools.

Backend installation guides: [Claude Code](https://code.claude.com/docs/en/setup) and [Codex CLI](https://developers.openai.com/codex/cli).

### Linux worker sandbox

Install `bubblewrap` on every Linux worker host, including Codex-only hosts. Install `socat` as well if the host runs Claude. Use `sudo apt install bubblewrap socat` on Debian or Ubuntu, or `sudo dnf install bubblewrap socat` on Fedora.

Run Fridica’s sandbox check on the worker host as the worker user. Success produces no output and exits with status 0.

```sh
bwrap --unshare-user --unshare-net --ro-bind / / --dev /dev --proc /proc --die-with-parent -- /bin/true
```

<details>
<summary>Ubuntu 24.04 and later: AppArmor blocks user namespaces</summary>

If the check fails with a UID map or loopback permission error, run these on the affected host:

```sh
command -v bwrap
sysctl kernel.apparmor_restrict_unprivileged_userns
```

If the path is `/usr/bin/bwrap` and the setting is `1`, check the AppArmor profile for that executable. If the profile is missing, create `/etc/apparmor.d/bwrap` with the following contents. Preserve any existing site-specific rules.

```text
abi <abi/4.0>,
include <tunables/global>

profile bwrap /usr/bin/bwrap flags=(unconfined) {
  userns,
  include if exists <local/bwrap>
}
```

Run `sudo systemctl reload apparmor` and repeat the sandbox check as the worker user. [AppArmor setup for bubblewrap](https://code.claude.com/docs/en/sandboxing#add-an-apparmor-profile-for-bubblewrap)

</details>

## Configure Slack

1. In [Slack app management](https://api.slack.com/apps), choose **Create New App → From an app manifest**, select your workspace and import the generated `manifest.yaml`. Use one app per owner. The current manifest enables Socket Mode and subscribes to messages in public channels and direct messages.
2. Under **Basic Information → App-Level Tokens**, generate an `xapp-` token with `connections:write`. For private channels, also add the `groups:read` and `groups:history` **user token scopes** and the `message.groups` **user event** before installing the app.
3. For thread roles, check each participant’s Slack app, including existing installations. Under **OAuth & Permissions → User Token Scopes**, add `im:write` and `im:history`. Under **Event Subscriptions → Subscribe to events on behalf of users**, add `message.im`. Fridica opens a direct conversation to send role invitations and listens there for confirmations.
4. Under **OAuth & Permissions**, install the app to your workspace as the person Fridica will represent. Reinstall an existing app after changing its scopes to grant the new permissions. Copy the `xoxp-` **User OAuth Token**. If Slack issued a replacement token, update the daemon’s stored token or environment variable and restart Fridica. That Slack account must belong to each channel you configure.
5. As the OS user who will run the daemon, run `fridica doctor` to see which tokens are available and whether Slack accepts them. You can run it before `fridica init`. The starter configuration automatically uses existing environment or keyring tokens. Store any missing or newly issued tokens, then select your channels:

   ```sh
   fridica secret set slack/app-token
   fridica secret set slack/user-token
   fridica configure --detect
   ```

Detection reads your Slack identity and joined channels. For unattended setup, repeat `--channel-name NAME` with `--detect`. By default, **any member of a configured channel can request work on your machines**. Set `[slack].delegate_channels` to the channel IDs where you want to allow delegation. Fridica supports public and private channels. [Shipped Slack manifest](assets/slack-manifest.yaml)

If your installed CLI lacks the `secret` command, set `SLACK_APP_TOKEN` and `SLACK_USER_TOKEN` in your environment before running `fridica configure --detect`.

The generated configuration uses macOS Keychain or Linux Secret Service. On Linux, the daemon needs a user D-Bus session with an unlocked keyring. When using environment variables, supply them to the daemon process as well. They take precedence over stored entries. To rotate a stored token, repeat its `secret set` command and restart the daemon.

`fridica secret set slack/app-token` stores the token as a generic password in macOS Keychain or as a secret in the default Linux Secret Service collection (such as GNOME Keyring). Both use the current OS username as the account, `fridica:fridica/slack/app-token` as the service, and the token as the password. The entry has no website. Running `secret set` on an older Fridica entry moves it to this format.

`fridica secret get slack/app-token` writes the token to stdout. Both this command and the `fridica-secret` provider check the corresponding environment variable first for Slack credentials (`SLACK_APP_TOKEN` or `SLACK_USER_TOKEN`). For a custom token, use `fridica secret get example/api-token --env EXAMPLE_API_TOKEN`. If the variable is unset, Fridica reads the stored password.

### Copy stored credentials to another machine

macOS and Linux can each send or receive credentials. Install a version of Fridica with `secret copy` on both machines. The destination must accept SSH connections. The sender checks the remote PATH, then common user, Python environment and system install locations, including `~/pyenv/bin/fridica`. For a custom location, pass an absolute path from the source machine, for example `fridica secret copy --remote-bin /opt/fridica/bin/fridica user@linux-host`. Each Linux account involved needs a user D-Bus session with an unlocked Secret Service keyring. When sending to a Mac, enable Remote Login and make sure the SSH account can write to its unlocked Keychain.

#### Set up the Linux keyring

If the Linux machine needs a Secret Service provider, run the command for its distribution on that machine.

| Distribution | Install command |
| --- | --- |
| Red Hat Enterprise Linux 9 or 10 | `sudo dnf install gnome-keyring` |
| Ubuntu | `sudo apt update && sudo apt install gnome-keyring dbus-user-session` |

If Fridica is on the remote PATH, you can run this optional check from the source machine using the same SSH account you will use for the transfer.

```sh
ssh user@linux-host 'fridica secret copy --help && fridica secret list'
```

The first command verifies that SSH can find a compatible Fridica build. The second lists stored names and can succeed with an empty list on a new machine. If it reports a D-Bus error, check that the SSH account has an active user D-Bus session. If it reports a locked keyring, unlock that account's default keyring. An SSH key login can leave it locked on a headless server.

#### Transfer credentials

To copy from Linux to a Mac, run this command on Linux.

```sh
fridica secret copy user@mac-host
```

To send to Linux, run the same command from either macOS or Linux with the Linux destination.

```sh
fridica secret copy user@linux-host
```

With just a destination, Fridica copies all credentials it discovers from standard token environment variables and the source keyring. For each name, a nonempty exported token takes precedence over its keyring value. For GitHub MCP, the order is `GH_TOKEN`, then `GITHUB_TOKEN`, then the keyring. Custom keyring entries are included. If the source keyring is unavailable and exported tokens are present, Fridica reports the keyring issue and continues with the available tokens.

To select a subset, pass exact names or quoted patterns, for example `fridica secret copy user@linux-host 'slack/*' ads/token`. A star matches any sequence of characters in the name, including slashes. Every pattern must match at least one available name. Use `--from-env` to restrict the copy to exported tokens.

The command sends the selected values over SSH standard input. It replaces matching entries in the destination account's keyring and lists each copied credential name after the transfer succeeds. If a keyring write fails partway through, earlier writes may have succeeded. You can rerun the same command. When moving the daemon, run `fridica doctor` on the destination to check its credentials. If the destination only runs SSH workers, select just the worker credentials you need.

## Configure machines

Edit the existing tables in `config.toml`. Choose only the backends installed on each machine and point each workspace at an **existing directory**. The starter lists both Claude and Codex and uses `~/project` as a placeholder. For example, a local Codex installation with one checkout can use:

```toml
[parent]
backend = "codex"

[machines.local]
transport = "local"
backends = ["codex"]

[machines.local.workspaces]
project = { path = "~/repos/my-project", subfolders = false }
```

To add an SSH machine, give it a host alias and at least one workspace. Tags let the parent place a request such as “run this on a CUDA machine.”

```toml
[machines.gpu]
transport = "ssh"
host = "gpu-box"
backends = ["codex"]
tags = ["cuda"]
resources = { gpus = [0] }
max_jobs = 1

[machines.gpu.workspaces]
experiments = "/data/experiments"
```

The generated template documents machine limits, load-aware placement, GPU confinement and policy overrides. Use local or SSH transport for jobs. Slurm entries can be configured, but job execution is unimplemented. [Configuration template](src/config/template.toml)

### Workspaces and permissions

- Writable workspaces normally give each slot its own `worker1/`, `worker2/`, and so on. Set `subfolders = false` for a shared checkout. Jobs there can touch the same files. In managed slot directories, Fridica cleans old scratch files before reuse. Place `.fridica-keep` in a directory to preserve its subtree.
- The default worker mode is `write`. Set `[policy].mode` to `read-only`, `write` or `full` and override it per machine or workspace as needed. For Codex's ordinary sandbox, a nonempty `network` list enables general network access. GPU confinement uses the host network and bounds filesystem writes. Declared GPUs are assigned by job slot.
- `approvals = "auto"` uses the backend reviewer. Choose `on-request` for owner decisions on escalation, `untrusted` for more frequent prompts, or `never` to deny escalation. Pending requests appear in the dashboard and in `fridica approvals`.
- For scoped access to a public GitHub ref, configure `fetch_repos`, `network = []` and `approvals = "on-request"` on a writable workspace without GPU confinement. The worker receives a bare repository and the fetched commit SHA.
- To use an existing Python virtual environment for worker commands and MCP servers, set `python_env = "~/pyenv"` in the machine table. Fridica activates it on the execution machine.

## Run

```sh
fridica doctor
fridica start
```

`doctor` checks configuration, credentials, backend sign-in, workspaces and sandbox prerequisites. `start` runs in the foreground, verifies Slack access and begins answering threads. Use Ctrl-C to stop it.

| To do this | Run |
| --- | --- |
| Check startup prerequisites without connecting to Slack | `fridica start --check-ready` |
| Record Slack intake without calling models, starting workers or posting replies | `fridica start --observe-only` |
| Print a Linux systemd user unit for the configured daemon | `fridica service-print` |

## In Slack

From your configured Slack owner account, send `!f <instruction>` in a configured channel to start a thread, or reply with it to instruct an existing thread. For example, send `!f Use the project workspace to inspect <Overleaf project URL> and identify the main TeX file.`

Other channel members can mention the owner and ask for work in a named workspace. For the example workspace above, ask “Run the tests in the project workspace and summarize the failures.” Reply in the same thread to refine the request. The parent can reuse a worker, delegate to several machines, or ask for clarification. Set `[slack].general_messages = false` to turn off unsolicited participation in general conversation.

The parent reads thread history, selected text attachments and worker summaries. It can pass Slack files to a worker as read-only inputs. Workers report results, progress and requested artifacts back through the daemon. The Slack app needs `files:read` to download attachments and `files:write` to upload reports and figures.

Customize the owner's voice and delegation rules in `contract.md` beside the configuration. Keep the required `## Participation` and `## Replies` headings. Use `## Delegation` for parent instructions and `## Worker reports` for instructions given to workers. [Default contract](assets/contract.md)

### Project follow-through

When you delegate an outcome that needs follow-through, the parent can start a project in the thread. It records the original instruction, completion criteria, assignments, dependencies, and evidence. Ask in the thread for status or to pause, resume, or cancel a project. The Slack account that started the thread holds the project manager role across participating daemons. Fridica posts each committed manager action and scheduled review to that thread. The manager keeps follow-up assignments open until each has a verified outcome and its dependencies are resolved. Closure also requires evidence for the overall outcome and all linked jobs to have stopped.

Assignments form a directed acyclic graph. Each dependency is the ID of a prerequisite assignment in the same project. The manager reports each assignment as `ready`, `working`, `waiting`, `blocked`, or `complete`. An open prerequisite makes its dependent effectively `blocked`. Once all prerequisites are verified, the reported status applies again. An explicit blocker stays in effect until the manager updates it. When an assignment becomes ready, Fridica mentions its Slack assignee in the project thread with the requested next action. Reassigning ready work addresses the new owner. Routine reviews preserve the recorded handoff. Completion requires evidence. Reopening one invalidates downstream completions until they are verified again. Older free-text blockers remain visible for the manager to reconcile.

The manager uses its configured review interval (15 minutes by default) to verify work. An ETA or rewritten status note leaves the checkpoint clock running. For an unchanged active assignment owned by a Slack member, a scheduled review asks for verifiable progress or confirmation of availability. A second interval without a state change raises the issue in the project thread. A confirmed `unavailable` report activates the first designated backup for that assignment. A `changes_requested` report requires an open fix assignment as its first prerequisite, so the reviewer’s assignment becomes ready again after the repair is verified.

The daemon reviews a project when a linked job finishes, a reported assignment changes status or dependencies, or the next review is due. Routine updates keep the existing deadline. Set `project_review_interval_seconds` in `[state]` to change the default interval of 900 seconds. Review deadlines survive a daemon restart.

## GitHub links

When a thread links a GitHub issue or pull request, the daemon reads up to three links per call through `gh api`. The parent receives the title, state and selected status lines. Pull requests also include the head commit, checks and reviews. Replies may repeat private repository information, so give the reader access only to repositories those channels may see.

The daemon can use its existing GitHub CLI credentials. A new configuration automatically selects an existing `github/read-prs` keyring entry. To add a dedicated read-only credential after initialization, run `fridica secret set github/read-prs` and enable the token line in the existing table:

```toml
[github]
enabled = true
token = "keyring://github/read-prs"
cache_seconds = 60
```

Fridica supplies the resolved secret to its `gh` process as `GH_TOKEN`. No interactive login is required. When upgrading an existing configuration, remove `token_env` from the top-level `[github]` table. Move any dedicated reader token to the keyring. Set `enabled = false` to disable these lookups.

## Worker integrations

**GitHub.** The bundled GitHub MCP server runs on eligible local and SSH workspaces with GitHub network access when enabled. Read-only workspaces expose read tools. Writable workspaces can also publish reviews, comments and task-branch changes. Enabling these tools authorizes their use without a second Fridica approval. GitHub enforces the worker credential's repository permissions and branch protections. Scoped-fetch placements receive no GitHub MCP server.

Authenticate as the worker's execution user with `gh auth login --hostname github.com`, or provide a worker `GH_TOKEN`. The daemon's dedicated GitHub reader secret stays with the daemon. Set `[github.mcp].enabled = false` to disable worker GitHub tools.

**alphaXiv.** Set `[alphaxiv].enabled = true`, allow `api.alphaxiv.org` in the workspace network policy, and provide `ALPHAXIV_TOKEN` to the daemon. On an authenticated worker, `fridica alphaxiv-mcp --probe` checks tool discovery without running a search.

**NASA ADS (SciX).** Set `[scix].enabled = true`, allow `api.adsabs.harvard.edu` in the workspace network policy, and provide `ADS_TOKEN`. Workers can search papers, export citations and manage ADS libraries. Because the bundled server includes library edits, Fridica attaches it to writable placements. Run `fridica scix-mcp --probe` on the worker to verify ADS accepts the token.

**Overleaf Git mode.** Set `[overleaf].enabled = true` and provide `OVERLEAF_GIT_TOKEN`. Use `network = ["*"]` because the server accepts general Git remotes. The default `write` mode confines Overleaf, Git and TeX writes to the assigned worker directory. The execution machine needs bubblewrap with user namespaces on Linux or the system sandbox on macOS. Install Git on the worker, plus TeX Live for compilation and PDF review. For Slack manuscript work, supply the project link or 24-character ID in the requesting thread. Fridica carries that selection into later jobs in the same thread and checks the Git destination before pushing. Standalone tools can use `OVERLEAF_PROJECT_ID` as their default. Citation checks use `ADS_TOKEN`. With the token in the worker environment, `fridica overleaf-mcp --probe` checks tool discovery and reads the default project’s Git references when a project ID is set.

Running `fridica doctor` checks each enabled research server on its eligible local and SSH workspaces. Its ADS check verifies authentication with a zero-result query. Its Overleaf check warns when a project ID is missing and verifies remote read access when one is supplied.

**Worker credentials.** Local workers inherit a filtered daemon environment. SSH workers receive integration credentials over encrypted SSH stdin, including variables such as `GH_TOKEN`, `ALPHAXIV_TOKEN` and `AWS_SECRET_ACCESS_KEY`, plus explicitly named MCP credentials. Forwarded values take precedence over target-local values. Fridica filters configured daemon secrets and Slack credentials before launching agents. [Credential forwarding rules](src/exec/credentials.rs)

## Dashboard and CLI

With the daemon running, open a second terminal and run `fridica dashboard`. Open the printed loopback URL on the same machine. The dashboard shows thread conversations, worker relationships and job history. You can send instructions, decide approvals and retry failed posts there.

![Dashboard showing a parent and three workers on two servers](docs/images/dashboard-demo.jpg)

| Task | Command |
| --- | --- |
| Check current activity | `fridica status`, `fridica threads`, `fridica workers`, `fridica machines` |
| Follow the event feed | `fridica events --follow` |
| List outstanding mentions | `fridica obligations` |
| Send a thread an instruction | `fridica instruct THREAD_ID "Run the tests again"` |
| Decide a pending approval | `fridica approvals ID once` (also `session` or `deny`) |
| Retry a failed parent decision | `fridica threads THREAD_ID retry` |
| Inspect failed or ambiguous posts | `fridica outbox` |
| Search archived threads | `fridica archive search "test failures"` |

The CLI and dashboard reach the daemon over its owner-only Unix socket. Use `fridica --help` for all commands. Local integrations can follow the event feed or drive a thread through the control API. [Events](docs/events.md) · [External drivers](docs/external-driver.md)

## State and recovery

Fridica stores messages, thread state, jobs and outgoing posts in SQLite. It records incoming Slack events before acknowledging them and commits each thread turn's effects together. After a restart, catch-up recovers missed messages and interrupted jobs are reported to their threads. Set `[limits].auto_resume = true` to rerun interrupted jobs once.

If delivery to Slack is uncertain, the post becomes `ambiguous`. Check the Slack thread before using `fridica outbox ID` to retry. Finished, quiet threads move to weekly archives beside the database after `state.archive_after_days` (default 7). A new message in an archived thread restores its history.

A parent rate limit pauses model calls across the daemon’s threads until the provider’s reset time, or for ten minutes when the backend supplies none. Slack intake continues and pending work survives restart. A single call probes the quota when the deadline passes. Daemons with separate databases that share a backend login can set `state.parent_quota_dir` to the same private directory on a filesystem that supports file locking. Each backend has its own cooldown there. By default the cooldown is stored beside the state database.

## Development

The daemon is written in Rust. Its Python distribution packages the executables with Maturin. From a source checkout, run:

```sh
cargo test --locked --all-targets
cargo test --locked --doc
python -m pip install -r requirements-dev.txt
python -m pytest -q
node --test tests/dashboard*.cjs
```

Build a wheel with `maturin build --release --locked --out dist`. The wheel smoke test exercises the installed command-line tools. [Wheel smoke test](scripts/smoke_wheel.sh) · [CI workflow](.github/workflows/ci.yml)

## License

[MIT](LICENSE)

The [native Overleaf backend](src/overleaf/README.md) is bundled Rust
through fridica-agent and MIT-licensed Interleaf. It preserves pending suggestions,
strict versions, scoped authorization and durable no-replay receipts.

### Thread coordination across accounts

A coordinated Slack thread has one manager. Each participating Slack account holds one role in that thread and can hold a different role elsewhere. The starter's daemon records appointments, assignments, submissions and review decisions. It remains the authority when the manager changes.

When a Slack app posts a plain, unedited message on behalf of the thread starter in a channel enabled for delegation, Fridica appoints the starter as manager if that role is empty. This works on the root message or a later post by the starter. A review request sent through Slack’s API can appoint the starter and invite the reviewers it @mentions in one message. The starter can also become manager before inviting anyone.

To invite someone, the thread starter selects their Slack @mention in the root message or a reply. For example, “@Alex check the release and @Sam review it” invites Alex and Sam. The explicit command `!f group start @Alex @Sam -- Verify the release candidate` also works. A group can invite up to 12 peers.

Each mentioned person's daemon checks the starter and the invitation against the original thread, then confirms by DM. The manager can appoint the first confirmed peer immediately. After one review interval (15 minutes by default), an unanswered invitation is marked **role unavailable** for that person in that thread. The check is private. A late confirmation enrolls the person, and a fresh mention can retry the invitation. Existing managed projects retain their previous workflow and timers until their unfinished assignments can migrate and outstanding jobs finish.

Enable the project channel for delegation on each account. Install the Slack app with the `im:history` and `im:write` user scopes and the `message.im` user event. For a private channel, each account also needs access to that channel, the `groups:read` and `groups:history` user scopes, and the `message.groups` user event. Multiple threads can share a channel and the same DM conversation. Each control message identifies its originating thread and group.

The manager moves branches, resolves rebase conflicts, marks PRs ready for review or draft, updates status, and assigns work. During a rebase, the manager edits conflicted files as needed and verifies the result. Workers carry out derivations, research the literature, debate technical choices, implement changes, edit source and tests, and write documentation and manuscripts. In a technical disagreement, the manager serves only as arbitrator. The manager weighs the workers' evidence and records the decision within the project's delegated authority.

A worker submits an artifact revision with evidence. When an assignment names a reviewer, the reviewer accepts that revision or requests a fix. Appointing a successor as manager transfers the outgoing manager into the successor's previous role (worker for a first appointment). The thread starter can issue an owner instruction to recover a stalled appointment.

Private Slack messages carry transitions, receipts and group snapshots to the invited accounts. A committed assignment or review wakes the next participant immediately. The internal clock uses `state.project_review_interval_seconds` (900 by default) to retry missing deliveries and reconsider outstanding work. The starter can be offline during a submission. Its peers retain their requests for delivery when it returns.

On each interval the manager checks progress even while a worker or reviewer is busy. With GitHub context enabled, the manager checks PR links from the goal and the root message for changes to the head, base, CI and reviews. It can run an authorized rebase under its manager appointment and request re-review on the published head. A verified stale branch calls for action or a named person with a concrete next step.

When a tracked assignment stays ready for a full interval without an update, the manager can ask its assignee for a revision, review link or blocker. Automatic reminders for the same assignment are spaced at least two intervals apart. A recent reply from the assignee or a recent mention from the manager suppresses the automatic reminder. Once the goal is verified, the manager closes the group with evidence. For work completed entirely on GitHub, closure requires the linked merged PR and its full head SHA.

Send `!f bring the PR up to date and ask for re-review` from the owner's Slack account in the project thread to direct the manager. The command gets a thread reply when the action is queued or when Fridica cannot carry it out.

