name: gormes-dev-runtime description: Use when running, installing, rebuilding, or validating local Gormes binaries, go run ./cmd/gormes, bin/gormes, install.sh, managed source clones, PATH shadowing, gateway stop/status, or sessions.db lock issues.
Gormes Dev Runtime
Repository Branch Rule
For Gormes work, stay on the existing development branch. Do not create or
use feature branches, short-lived branches, or git worktrees. If the checkout
is not on development, stop before editing and switch safely or report the
blocker.
Mission
Keep three execution surfaces distinct: the dirty development checkout, the local compiled binary, and the shell-wide installed command. Never let Hermes or a stale PATH entry become part of the Gormes dev loop.
Start by proving which surface the user is actually running. Use pwd,
git rev-parse --show-toplevel, which -a gormes, and readlink -f before
changing installers, binaries, or config. If the user names a development
workspace, honor that path; do not silently fall back to a sibling checkout or
the installer-managed clone.
Treat source checkout, runtime home, installer-managed checkout, and PATH
binary as separate facts. For this workspace family, workspace-mineru may be
the editing workspace while workspace-gormes or GORMES_HOME is the Gormes
development/runtime home. Discover and pass those paths through environment or
fixtures; do not hard-code /home/xel/... paths into product code or tests.
Choose The Surface
- Current checkout, including uncommitted edits:
go run ./cmd/gormes. - Compiled binary from this checkout:
go build -o bin/gormes ./cmd/gormes, then./bin/gormes. - Shell-wide command:
install.sh, or manual publish after a build.
install.sh is source-backed for final users. Its release defaults may clone
or update $HOME/.gormes/gormes-agent from main; that is not the agent
development surface. For Gormes agent work, use the current development
checkout or set GORMES_BRANCH=development when intentionally testing the
installer-managed path. It builds ./cmd/gormes, publishes to
$HOME/.local/bin/gormes, and refreshes any older active gormes command that
appears earlier on PATH.
Root Linux defaults are /usr/local/lib/gormes-agent and
/usr/local/bin/gormes. Override with GORMES_INSTALL_DIR,
GORMES_BIN_DIR, GORMES_INSTALL_HOME, or GORMES_BRANCH.
Dev Rules
- For active uncommitted work, prefer
go run ./cmd/gormesor./bin/gormes. - Use
go run ./cmd/gormesto prove source changes before install; use./bin/gormesto prove the rebuilt local binary; use plaingormesonly after verifying the installed command path. - Do not ask for a push to
mainto validate development behavior. Agent work stays ondevelopment; local behavior is proven from the checkout or rebuilt binary. - For side-by-side smoke tests, use an isolated home:
GORMES_HOME="$(mktemp -d)" go run ./cmd/gormes --offline. Reuse the real home only when validating persisted sessions, migration, or operator state. - Plain
install.shtests the managed branch, not the dirty checkout. For Gormes work, set that managed branch todevelopmentor use the local checkout; do not use it to prove uncommitted changes unless an explicit local-source mode is implemented. - If using
GORMES_INSTALL_DIRagainst an existing checkout, remember the installer may stash local changes, fetch, checkout, and pull the branch. - After publishing binaries, verify
which -a gormes,readlink -f, andsha256sumforgormes,bin/gormes,$HOME/.gormes/bin/gormes, and$HOME/go/bin/gormeswhen present. gormes gateway statusidentifies the live runtime owner. Usegormes gateway stopwhen a persisted foreground TUI needs to release$HOME/.gormes/sessions.db.- Prefer
gormes gateway reloador gateway/reloadfor config changes that the live manager can swap without reconnecting transports: allowlists, first-run discovery flags, display/tool-progress settings, provider/model client routing, skills root, and agent bindings. Invalid reloads must keep the last-good config active and surfaceconfig_reload=failedingormes gateway status. - Still use a gateway restart for binary changes, channel transport changes that need reconnecting clients, database path changes, or service-manager lifecycle work.
- A foreground TUI may run with in-memory session state while the gateway owns
sessions.db; that is acceptable for smoke testing but not for persisted session validation. - If alternating
go run,./bin/gormes, and installedgormes, either stop the existing owner cleanly or give each surface a differentGORMES_HOME. Do not "fix" a lock by deletingsessions.db. - Gormes startup must not require Hermes
api_serveror suggesthermes gateway start. Any such output is a parity bug; fix the Gormes startup path or installer-published binary, not the user's Hermes process.
Setup And Auth Regression Checks
Runtime/setup incidents often span multiple surfaces. Build a temp-home matrix before touching real operator state:
- Run config/setup checks with isolated
GORMES_HOME,HERMES_HOME,CODEX_HOME,XDG_CONFIG_HOME, andXDG_DATA_HOME. - Use synthetic Telegram/provider tokens in tests; never echo, commit, or report real tokens.
- For Codex provider setup, include a synthetic
CODEX_HOME/auth.jsoncase: fresh Codex CLI auth should import into the Gormes credential pool, expired Codex CLI auth should fall back to device-code, and output must stay redacted. - Cover the operator-facing chain that broke:
config set, config reload,onboard,doctor --offline,gateway status --json, and the exact binary surface (go run,./bin/gormes, or installedgormes) implicated by the report. - If the user provides live settings, install them only after a sanitized dry-run fixture passes, then verify with redacted commands. Document any blockers without printing secret values.
Incident Checklist
When validating an installer/runtime report, write down these facts before changing code:
- command run:
go run ./cmd/gormes,./bin/gormes, or plaingormes; - binary path and realpath from
which -a gormes/readlink -f; - source checkout used by the binary or installer;
GORMES_HOMEand whether it is a temp dir,workspace-gormes, or~/.gormes;- whether any gateway/TUI process owns
sessions.db; - whether output contains Hermes-owned instructions,
~/.hermesstate reads, stale product labels, or API-server assumptions.
Only after this matrix is clear should a parity report move to TUI, Telegram/channel, or provider work. Many visible UX bugs are stale binary or wrong-home bugs until this checklist says otherwise.
Verification
- Installer behavior:
(cd webpages/landing && go test ./internal/site -run 'TestInstallSH' -count=1). - Runtime package smoke:
go test ./cmd/gormes ./internal/persistence/session -count=1. - Gateway reload smoke:
go test ./cmd/gormes ./internal/gateway -run 'TestGatewaySignalLoop|TestGatewayReload|TestManager_ReloadCommand' -count=1. - Source/binary/install matrix: run the same focused command through
GORMES_HOME="$(mktemp -d)" go run ./cmd/gormes ...,GORMES_HOME="$(mktemp -d)" ./bin/gormes ..., and installedgormesafter path verification when the bug involves publishing or PATH shadowing. - Full gate before completion claims:
go test ./... -count=1,go run ./cmd/progress validate, andgit diff --check.
Common Mistakes
- Assuming plain
install.shbuilds the dirty repo. - Using a final-user
maininstall path to validate agent development work. - Testing
gormeswhile$HOME/go/bin/gormesshadows the freshly published command. - Killing random processes instead of using
gormes gateway statusandgormes gateway stop. - Restarting the gateway for every config edit before trying
gormes gateway reload, or treating a failed reload as a partially-applied config. - Deleting lock files or
sessions.dbinstead of stopping the owning Gormes process or using an isolatedGORMES_HOME. - Reintroducing Hermes commands or Hermes state reads into Gormes startup.
- Treating an in-memory
sessions.dbfallback as proof of persisted-session behavior.