mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-12-05 01:29:32 +01:00
Multi-user mode only accepted Codeman passwords over HTTP Basic, so a team with an
identity provider (Entra ID, Google, Keycloak, ...) had to sign in twice, with no link
between the two identities.
With a shared secret configured (CODEMAN_TRUSTED_PROXY_SECRET_FILE, or
CODEMAN_TRUSTED_PROXY_SECRET; at least 32 printable ASCII characters), an authenticating
reverse proxy on the same host (oauth2-proxy behind Caddy or nginx, mod_auth_openidc,
Authelia) forwards X-Codeman-Proxy-Secret and X-Codeman-User, and the request signs in
as that existing, enabled account. CODEMAN_TRUSTED_PROXY_USER_HEADER renames the
username header. The feature is experimental (docs/versioning-policy.md): its settings,
headers and the viaTrustedProxy field may change until promoted.
- Accepted only from a loopback socket (isLoopbackIp, now shared with the hook-secret
bypass) with a timing-safe secret match.
- The secret is read once at the start of WebServer.start(), before sessions are spawned
or restored, and both variables are then removed from process.env, since every
session inherits Codeman's environment. The secret file's resolved path stays in the
module for the sensitive-path blocklist.
- A configured setup that cannot be used stops the start, like the first boot without
users, with a message that says why and never contains the secret: both variables
set; a secret file that is unreadable, empty, or readable by group or others (not
checked on Windows); a short or non-ASCII secret; a secret with multi-user mode off;
a rejected username header name. getTrustedProxyConfig() returns null for the same
cases as a second layer.
- Both headers are read and deleted from every request by the first auth hook, in every
auth mode, so no exemption or route (e.g. the web-tab relay) can forward the secret.
The relay's drop list names them too, including a configured username header.
- Fails closed once the secret header is present, even empty: a wrong secret or a
non-loopback source is 401; a missing username, or one with no enabled account, is a
plain 403 with no challenge. None of these falls through to cookie or Basic. A
username header without the secret is ignored.
- The username is matched exactly: normalizeUsername(), then the user store's username
rule, no other transformation. A header sent twice arrives joined ("alice, bob") and
is refused.
- The secret is compared before the failure bucket, so a correct secret always passes;
only failures are throttled, in their own per-IP bucket.
- Checked before the session cookie; a cookie on the same request is neither used nor
refreshed, and no cookie is minted: the proxy authorizes every new request and
WebSocket upgrade.
- mustChangePassword does not gate a proxy sign-in, and GET /api/me reports
mustChangePassword: false and viaTrustedProxy: true. Proxy sign-ins update the
last-login time at most every 15 minutes.
- The username header is removed from every request, so its name is validated by shape
(an X-... extension header or Remote-User; standard and reserved headers refused).
- With the feature configured, a /webview/ or /html-view/ request the capability
exemptions don't let through is refused with the route's own 403/404 before the
credential checks, by prefix on a path normalised the way a proxy's matcher sees it
(case-insensitive, percent-decoded, dot segments resolved), whatever the token looks
like: the proxy has to let these paths through without its sign-in, so they must not
reach the Basic check, prompt or failure bucket. Without a proxy they keep the normal
401.
- The configured secret file is on the isSensitivePath blocklist.
- The startup log says "Trusted-proxy sign-in enabled (experimental)".
- Single-user mode, the Host/Origin guard and the hook-secret bypass are otherwise
unchanged.
Docs: security-architecture §10a, architecture-invariants, versioning-policy (new
experimental subsection), Settings-Reference, web-tabs and its wiki page, multi-user-plan,
the CLAUDE.md summary line, and a Caddy + oauth2-proxy walkthrough in the Multi-User Mode
wiki page (web tabs and HTML view bypass the sign-in and never get the secret; the proxy
removes its own session cookie; hook endpoints and their /api/v1 aliases are blocked;
optional username from an IdP claim; what the secret does not protect against).
Changeset included.
153 lines
8.8 KiB
Markdown
153 lines
8.8 KiB
Markdown
# Versioning & Stability Policy
|
|
|
|
Codeman follows [Semantic Versioning](https://semver.org/) (`MAJOR.MINOR.PATCH`),
|
|
managed via `@changesets/cli` (see the COM workflow in `CLAUDE.md`).
|
|
|
|
This document defines **what the version number actually promises** — i.e. which
|
|
surfaces are covered by SemVer and which are explicitly not. It exists because
|
|
"1.0" is a commitment to stability, and an undocumented public surface invites
|
|
incompatible client assumptions we would then be pressured to keep.
|
|
|
|
> **Status:** finalized for the 1.0 cut. The HTTP/SSE API **is** part of the stable
|
|
> surface — served under `/api/v1` with a uniform response envelope and
|
|
> conventional HTTP status codes. See [`api-reference.md`](api-reference.md).
|
|
|
|
## What SemVer covers (the public, stable surface)
|
|
|
|
A **MAJOR** bump is required to break any of these after 1.0:
|
|
|
|
1. **The CLI.** Command names, documented flags, and their behavior for
|
|
`codeman <command>` (published to npm as `aicodeman`; invoked as `codeman`).
|
|
This is the package's actual public entry point (`bin`).
|
|
- The package is published to npm as `aicodeman` and installs **both** the
|
|
`aicodeman` and `codeman` commands (`bin` aliases); `codeman` is the
|
|
canonical command used throughout the docs. Renaming either after 1.0 is a
|
|
breaking change.
|
|
2. **The published `xterm-zerolag-input` library**, but on **its own version
|
|
line** — it is versioned and released independently of the Codeman app. Its
|
|
1.0 status is a separate decision; the Codeman app reaching 1.0 does *not*
|
|
imply `xterm-zerolag-input` is 1.0.
|
|
3. **Documented environment variables** that configure deployment:
|
|
`CODEMAN_PASSWORD`, `CODEMAN_USERNAME`, `CODEMAN_HOST`, `CODEMAN_PORT`,
|
|
`CODEMAN_INSTANCE`, `CODEMAN_ALLOWED_HOSTS`, `CODEMAN_DATA_DIR`,
|
|
`CODEMAN_TMUX_SOCKET`, `CODEMAN_ALLOW_UNAUTHENTICATED_NETWORK`,
|
|
`CODEMAN_ALLOW_UNAUTHENTICATED_TUNNEL`, and the `--host` / `--port` /
|
|
`--https` / `--allow-unauthenticated-network` /
|
|
`--allow-unauthenticated-tunnel` CLI flags. Removing or changing the meaning
|
|
of one of these is breaking. The two acknowledgements are listed from 1.46.0,
|
|
the release that split them: the network one covers the non-loopback bind
|
|
only, and an unauthenticated tunnel needs the tunnel one.
|
|
4. **The HTTP API and SSE event channel**, served under **`/api/v1`** with the
|
|
uniform `{success:true,data}` / `{success:false,error,errorCode}` envelope and
|
|
conventional HTTP status codes. Endpoint paths, the response envelope, error
|
|
`errorCode` values, and SSE event names are stable — see
|
|
[`api-reference.md`](api-reference.md). *Additive* changes (new endpoints, new
|
|
optional fields, new error codes, new SSE events) are non-breaking; breaking
|
|
changes ship under a new prefix (`/api/v2`). The unversioned `/api/...` alias
|
|
is kept working for the bundled UI.
|
|
5. **The dashboard's `#session=<id>` link.** Opening the dashboard URL with a
|
|
`#session=<id>` fragment selects that session if this client can see it. The
|
|
fragment name and that meaning are stable; see
|
|
[Opening a session from your own page](extending-codeman.md#opening-a-session-from-your-own-page).
|
|
|
|
## What SemVer does NOT cover (internal surfaces — may change in any release)
|
|
|
|
These may change in a **MINOR** (or even PATCH) release without a MAJOR bump:
|
|
|
|
1. **The `~/.codeman/` state file formats** (`state.json`, `settings.json`,
|
|
`mux-sessions.json`, etc.). We make a **best-effort** to migrate existing data
|
|
forward (and have done so across renames), but the on-disk schema is not a
|
|
stable contract — do not write tooling that depends on its exact shape.
|
|
2. **Internal TypeScript modules.** The npm package is CLI-only; `import`ing it
|
|
programmatically is not supported (there is no stable library entry point).
|
|
3. **Experimental / opt-in features**, regardless of the app's version:
|
|
Gesture Control (beta), Agent Teams
|
|
(`CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1`), the native-wrapper window bridge
|
|
(`window.CodemanHost.openWindow` / `closeWindow` / `focusWindow`), and
|
|
anything labeled experimental in the UI or docs. These may change or be
|
|
removed at any time.
|
|
|
|
### Experimental agent coordination
|
|
|
|
`codeman agent inspect`, `codeman agent stage` and `codeman agent submit`, and
|
|
the matching `GET /api/v1/sessions/:id/inspect`, `POST /api/v1/sessions/:id/stage`
|
|
and `POST /api/v1/sessions/:id/submit` routes (with their `/api` aliases, since
|
|
every `/api` route is also served under `/api/v1`), are labeled experimental, so
|
|
item 3 above applies to them: their commands, flags, endpoint paths, payloads and
|
|
behavior may change or be removed in a MINOR or PATCH release. They are also
|
|
opt-in: the routes answer `403 FORBIDDEN` with a message naming the synced
|
|
`agentCoordinationEnabled` setting (default OFF) until it is turned on, so
|
|
automation cannot come to depend on them without choosing to. Pin a compatible
|
|
Codeman version when automating them. Existing authentication, ownership and
|
|
shared response-envelope rules still apply. The session behavior underneath them
|
|
(input revision tracking in the session's write paths, the SubmitVerifier
|
|
re-press going through the shared write boundary) runs for every session and is
|
|
covered like any other stable behavior. Other agent commands and API routes keep
|
|
their existing guarantees. Promotion to stable requires an explicit documented
|
|
decision.
|
|
|
|
### Experimental local model routes
|
|
|
|
`GET /api/v1/local-model`, `POST /api/v1/local-model/install`, `/use`, `/cancel`,
|
|
`/resume`, `/runtime` and `/agent`, `DELETE /api/v1/local-model` and
|
|
`DELETE /api/v1/local-model/models` (and their `/api` aliases) are
|
|
labeled experimental, so item 3 above applies to them: their paths, their payloads
|
|
(the hardware facts, the verdicts and reasons, the candidate fields, the `install`
|
|
object with its states, steps, error codes and actions, its `library`, `store` and
|
|
`harnesses` lists, the 409 conflict shape and
|
|
every English sentence) and their behavior may change or be removed in a MINOR or
|
|
PATCH release. They look at the Mac the server runs on, say which local model fits,
|
|
install, start, stop and remove one, keep a library of installed models to switch
|
|
between or delete, and install one more coding agent beside an installed model
|
|
([local-models.md](local-models.md)).
|
|
|
|
They are not behind a setting. Reading changes nothing; an install starts only on an
|
|
explicit request that carries the size the person confirmed. All of them are admin
|
|
only in multi-user mode. What an install leaves behind is ordinary, stable state: one
|
|
saved model endpoint with the id `local-ollama` and the `customModelEndpointsEnabled`
|
|
setting switched on, both of which the stable custom model endpoint routes read like
|
|
any other endpoint. On-disk state (`local-model.json`, the `local-model/` folder) is
|
|
internal, as for every other file in the data directory. Promotion to stable requires
|
|
an explicit documented decision.
|
|
|
|
### Experimental trusted-proxy sign-in
|
|
|
|
Sign-in through an authenticating reverse proxy in multi-user mode
|
|
([security-architecture.md](security-architecture.md) §10a) is labeled experimental, so
|
|
item 3 above applies to all of its surface: the environment variables
|
|
`CODEMAN_TRUSTED_PROXY_SECRET_FILE`, `CODEMAN_TRUSTED_PROXY_SECRET` and
|
|
`CODEMAN_TRUSTED_PROXY_USER_HEADER`, the request headers `X-Codeman-Proxy-Secret` and
|
|
`X-Codeman-User`, the `viaTrustedProxy` field of `GET /api/v1/me` (and its `/api` alias),
|
|
the status codes and messages of its refusals, and the conditions under which a
|
|
configured setup stops the start. They may change or be removed in a MINOR or PATCH
|
|
release.
|
|
|
|
It is off unless a secret is configured. With it off, sign-in works as before. Three
|
|
things still apply: the identity headers (the two above and a configured username
|
|
header) are dropped on arrival, downloads and attachments refuse the secret file, and a
|
|
trusted-proxy setting that cannot be used stops the start. The other fields
|
|
of `GET /api/v1/me` keep their existing guarantees. Promotion to stable requires an
|
|
explicit documented decision.
|
|
|
|
## Deprecation policy
|
|
|
|
When we need to change a covered surface:
|
|
|
|
- Prefer **additive** changes (new flag/env var/command) over breaking ones.
|
|
- A covered surface slated for removal is **deprecated first** — it keeps working
|
|
for at least one MINOR release with a runtime warning and a `CHANGELOG.md` note
|
|
pointing to the replacement — then removed in the next MAJOR.
|
|
- Back-compat migration shims (e.g. the historical Claudeman→Codeman data/socket
|
|
migration) are kept until a MAJOR boundary, then may be dropped.
|
|
|
|
## Pre-1.0 (`0.x`) caveat
|
|
|
|
Until 1.0 ships, **any release may contain breaking changes** per SemVer's `0.x`
|
|
allowance. The commitments above take effect at `1.0.0`.
|
|
|
|
## See also
|
|
|
|
- `CLAUDE.md` — the COM release workflow (changesets, version bump, deploy)
|
|
- `.github/SECURITY.md` — security reporting and the supported-version policy
|
|
- `docs/security-architecture.md` — the full trust model
|