Skip to content

fix(devenv): build the operator CLI so the box never serves a stale binary (RIG-3342) - #925

Open
rigel-mintaka wants to merge 2 commits into
mainfrom
compass/rig-3342-build-operator-cli
Open

fix(devenv): build the operator CLI so the box never serves a stale binary (RIG-3342)#925
rigel-mintaka wants to merge 2 commits into
mainfrom
compass/rig-3342-build-operator-cli

Conversation

@rigel-mintaka

Copy link
Copy Markdown
Contributor

devenv.nix builds four binaries — compass-server, compass-runner,
compass-gen-cert, compass-mint-runner-token — but never ./cmd/compass.
Each of those four is built by the task that immediately execs it, so their
freshness is a side effect of being invoked at boot. The operator CLI is
invoked later, by a human over ssh, so nothing rebuilt it: the mattfw dogfood
box served an Aug 23 binary missing the agent and message verbs while
main.go had registered all five for weeks.

The drift was invisible from the CLI itself, because --version prints the
same static "0.1.0" for a months-old build and a current one (that blind spot
is RIG-3346).

Add dogfood:build-cli, deliberately the only build-only task here — it has
no exec, since there is nothing to run at boot; the point is to leave a
current binary in the state dir. Ordered before the server purely to pin it
into the up graph, with no runtime dependency on it.

Verified on the box: the state-dir path held a 22,064,753-byte Aug 23 binary;
running the task's build replaced it with an 18,782,067-byte current one
exposing all five verbs (agent, agent-config, message, secret,
token).

Refs RIG-3342, RIG-3068 (the dogfood validation that surfaced it).

Co-authored-by: Matt Wilkinson matt@rigel.build

@linear-code

linear-code Bot commented Sep 6, 2026

Copy link
Copy Markdown

RIG-3342

RIG-3068

@trunk-io

trunk-io Bot commented Sep 6, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown

Compass engineering docs preview: https://compass-rig-3342-build-opera.compass-eng-docs.pages.dev

Deployed from compass/rig-3342-build-operator-cli at 7e12e76.

rigel-mintaka and others added 2 commits September 6, 2026 01:07
…inary (RIG-3342)

`devenv.nix` builds four binaries — `compass-server`, `compass-runner`,
`compass-gen-cert`, `compass-mint-runner-token` — but never `./cmd/compass`.
Each of those four is built by the task that immediately execs it, so their
freshness is a side effect of being invoked at boot. The operator CLI is
invoked later, by a human over ssh, so nothing rebuilt it: the mattfw dogfood
box served an Aug 23 binary missing the `agent` and `message` verbs while
`main.go` had registered all five for weeks.

The drift was invisible from the CLI itself, because `--version` prints the
same static "0.1.0" for a months-old build and a current one (that blind spot
is RIG-3346).

Add `dogfood:build-cli`, deliberately the only build-only task here — it has
no `exec`, since there is nothing to run at boot; the point is to leave a
current binary in the state dir. Ordered `before` the server purely to pin it
into the `up` graph, with no runtime dependency on it.

Verified on the box: the state-dir path held a 22,064,753-byte Aug 23 binary;
running the task's build replaced it with an 18,782,067-byte current one
exposing all five verbs (`agent`, `agent-config`, `message`, `secret`,
`token`).

Refs RIG-3342, RIG-3068 (the dogfood validation that surfaced it).

Co-authored-by: Matt Wilkinson <matt@rigel.build>
…nt (RIG-3342)

Review findings on the build-cli task.

The `before` edge inverted a failure mode: `go build ./cmd/compass` pulls
cobra, viper and the connect client, so any compile error in the operator
CLI's import graph blocked compass-server from starting — and with it
compass-ui and compass-runner, which chain off the server. A broken CLI took
down the whole dogfood backend, which is backwards: you want the server up in
order to diagnose. Switch to `after`, mirroring dogfood:mint-runner-token.
That still pins the task into the `up` graph, but the edge is inert.

The comment also claimed this was "the only task here with no `exec`", which
is false twice over: the task does have an `exec` attribute two lines below
the claim, and under the intended reading dogfood:agent-image and
dogfood:clean also never exec-replace. Restate it as the narrower true claim
— it is the only *binary-building* task that does not exec what it produces —
and stop conflating tasks with processes (gen-cert and mint-runner-token are
tasks; compass-server and compass-runner are processes).

Also document the two things a reader needs and could not get from the file:
that the unconditional rebuild is deliberate (a present-but-stale binary is
the bug, so skip-if-present would skip exactly when the build is required),
and the invocation path, since the state dir is not on PATH. Add build-cli to
the two indexes that enumerate the `up` graph — the chain comment and the
tasks-block platform header — which otherwise under-describe it, reproducing
the same documentation drift this change exists to fix.

Refs RIG-3342.

Co-authored-by: Matt Wilkinson <matt@rigel.build>
@rigel-mintaka
rigel-mintaka force-pushed the compass/rig-3342-build-operator-cli branch from 3ef72be to 7e12e76 Compare September 6, 2026 05:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant