Managing kōjō

After the first deployment, everything a team tunes over time is changed live, without a restart: skills, repositories, schedules, models, budgets, policies and access. These pages are for the operators and admins who make those changes.

Five ways to make a change

Every change ends up as the same thing, a new revision of a runtime config object in Postgres. Pick the tool that fits who is making it.

Tool Use it to Page
Dashboard Watch sessions and replay them, edit and test skills, change settings with a form, see an object’s history and roll it back Dashboard
CLI Start and follow sessions from a terminal, export the whole config, apply it from CI CLI
Git Keep a repository’s skills, schedules and merge policy in its own .factory/ directory, reviewed like code Git
MCP Do all of the above from an editor or another coding agent MCP
HTTP API Script anything the dashboard does HTTP API

What each object holds, key by key, is in Runtime config objects.

Boot config and runtime config

kōjō has two kinds of configuration.

Boot config Runtime config
Where kojo.yaml, read at start Postgres, as versioned revisions
Holds Database URL, public URL, sign-in, forge and Slack secrets, model provider keys, the sandbox driver and proxy wiring, telemetry Model tiers and budgets, merge policy, egress limits, the activation policy, the skills source, repositories, RBAC, schedules, memory, self-improvement, skills
Changed by Editing the file and restarting kojo serve The dashboard, the API, kojo config apply, and a repository’s .factory/ files
Takes effect At the next start At once, on every replica, for sessions that start from then on
Reference kojo.yaml reference This page

Some keys of kojo.yaml only seed the runtime config: models.tiers, models.budgets, defaults, seed and the admin emails in server.auth.admins. At every start kōjō writes the objects that do not exist yet from them. Once an object exists, the runtime config owns it, and editing those keys changes nothing.

Secrets are never part of the runtime config. It names credentials (github, gitlab, forgejo); the values stay in kojo.yaml and its environment. Rotating a secret is a deployment-side change and needs a restart.

Check a kojo.yaml before you restart with it:

kojo config validate -f kojo.yaml

Roles

Roles form a ladder. Each one includes everything below it.

Role May
viewer Read sessions and their replay, skills, drafts, config objects, revisions, schedules, the audit log, evals and team memory. Validate skill files. Add, read and delete their own personal memories.
skill:edit Create, edit and delete skill drafts. Test a draft. Start evals.
operator Start and cancel sessions. Make links to a session’s shareable report, and save it as a file. Activate drafts and delete dashboard-managed skills. Ask for, reject and approve skill proposals; approving one needs a person signed in, not an API token. Change settings/models, repos and schedules. Roll back those objects and skills. Add and delete team memory. Export the audit log. Run doctor.
admin Change settings/merge_policy, settings/egress, settings/limits, settings/activation, settings/skills_source, settings/memory, settings/improvement, settings/reports and rbac. Revoke the links to a session’s report. List and delete another person’s memories, which is audited. Turn on allow_auto_merge. Export and apply the whole config. List users.

The roles are the same in every tool. They also decide what a person may do from Slack: the operator role is needed to trigger write actions and to decide approvals. See Merge policy.

How a change applies

flowchart TD
    D["Dashboard"] --> V
    C["kojo config apply"] --> V
    A["HTTP API"] --> V
    G["Push to .factory/"] --> V
    V{"Decodes and validates?"} -- no --> X["Refused, nothing written"]
    V -- yes --> R["New revision in config_revisions"]
    R --> P["Active pointer moves"]
    P --> N["Postgres NOTIFY"]
    N --> E["Every replica reloads the object"]
    E --> S["Sessions that start from now on use it"]
  1. The new content is decoded strictly and validated. An invalid object is refused and nothing is written.
  2. If the content equals the active revision, nothing is written.
  3. Otherwise a new row is added to config_revisions with the scope, the object, the content, the author, the parent revision and an optional message.
  4. The object’s pointer in config_active moves to the new revision, and the change is announced with Postgres NOTIFY on the kojo_config channel.
  5. Every replica holds a LISTEN connection and reloads the object. If that connection is lost, the replica reloads all active revisions when it reconnects.
  6. The change is recorded in the audit log as config.activate.

A repository’s settings/merge_policy or schedules that its default branch keeps in .factory/ takes another path: a change made in kōjō becomes a pull request on the repository, and the steps above run when the merge’s push is read. See Editing a setting that lives in git.

A session records the revision IDs it started with and keeps them until it ends, also across a restart. New sessions use the new revision.

Revisions are never changed or deleted.

Revisions and rollback

Every object has a history, and a rollback activates an earlier revision.

  • A rollback moves the active pointer. It writes no new revision and deletes nothing, so a rollback can itself be rolled back.
  • It needs the role of the object. For a skill it needs operator.
  • The old revision is checked against today’s rules before it comes back: it must still decode and validate, a skill must still fit the scope’s egress limits, and the repos and rbac guards apply.
  • It is announced to every replica like any other change and recorded as config.rollback.

Where to do it: the history panel next to every settings form in the dashboard, or two calls of the HTTP API. The CLI has no rollback command; kojo config apply with an older export has the same effect and writes a new revision.

Scroll to move. + - zoom, 0 fit, Esc close.100%