Skip to content

switchboard v0.4.0

Choose a tag to compare

@github-actions github-actions released this 04 Sep 22:09
· 91 commits to main since this release
v0.4.0
485da88
go install github.com/go-steer/switchboard/cmd/switchboard@v0.4.0
docker pull ghcr.io/go-steer/switchboard:0.4.0

The module version keeps its v and the image tag does not.

The image is multi-arch (amd64 + arm64), distroless
(gcr.io/distroless/static-debian12:nonroot, no shell, no package manager)
and signed with Sigstore keyless:

cosign verify ghcr.io/go-steer/switchboard:0.4.0 \
  --certificate-identity-regexp '^https://github.com/go-steer/switchboard' \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com

A release about what switchboard says while it works. No new surface, no new
verb, nothing a room can do that it could not do before — three things that
were reporting badly now report honestly, which is the difference between a
gateway you can run and one you can only watch.

A thread that does not wait its turn keeps its clock (#42). One progress
placeholder is kept per conversation, and every way a turn could end used to
delete it — so asking a second question before the first had answered cost the
second turn its clock, its elapsed time, and, if the timing was unkind, its
usage footer to the wrong answer. An answer with something queued behind it now
re-anchors the placeholder below itself instead of retiring it, a turn that
narrated or died freezes it rather than deleting it, and a backlog that went
stale across a stream outage resynchronises on the next idle daemon. This needs
a daemon that advertises inbox events; without one the previous behaviour
applies unchanged and switchboard says so once at stream open.

Every log line carries a severity (#49). Records were ingested at
DEFAULT, so nothing in a deployment could alert on an error and nothing
reached Error Reporting. All ~100 call sites are now classified against one
rubric, JSON renders Cloud Logging's severity in Cloud Logging's vocabulary,
and the two optional listeners' own runtime errors — a recovered handler panic,
a failed TLS handshake — stop bypassing the logger entirely. There is no
DEBUG and no --log-level. Structured attributes are still to come.

Pushing a tag is the whole release (#76). The GitHub Release is built from
the tag's own changelog section rather than by hand, which is why v0.2.0 and
v0.3.0 shipped images and signatures but no release. This is the first tag
where that step is not a thing anyone has to remember.

Upgrading costs one thing: eight startup warnings dropped the warning: they
carried in their own text, because the level says it now. A run that greps its
own logs for warning: should grep for WARN.

Added

  • Pushing a tag now publishes the GitHub Release, not just the image.
    release-images.yml grows a github-release job that builds the notes from
    the tag's own CHANGELOG.md section under the go install / docker pull /
    cosign verify preamble, and CONTRIBUTING.md records the three steps of
    cutting a release. The step had only ever been done by hand, which is why
    v0.2.0 and v0.3.0 shipped images and signatures but no release — the two tags
    where the tag was the last thing anyone did. It runs after the image is pushed
    so the docker pull in the notes works the moment the notes are readable, a
    tag with no matching changelog section fails rather than publishing an empty
    body, and an existing release — a draft included — is left alone, so
    hand-written notes still win by being drafted before the tag.
  • Log lines carry a severity (#49). Text renders it in its own fixed-width
    column between the timestamp and the program name; JSON renders it as
    Cloud Logging's severity, in Cloud Logging's vocabulary (INFO,
    WARNING, ERROR), so an alert policy and Error Reporting see the failures
    without a parser in between. Records used to carry no level at all and were
    ingested at DEFAULT. All ~100 call sites were classified: ERROR for work
    switchboard could not do that costs a user or a turn, WARN for degraded but
    still going, INFO for lifecycle. There is no DEBUG and no --log-level.
  • Runtime errors from the --metrics-addr and --ingress-addr listeners go
    through switchboard's logger at ERROR, prefixed with the listener's name
    (#49). http.Server.ErrorLog was unset, so net/http wrote a recovered
    handler panic or a failed TLS handshake to stderr through the log package's
    default logger — unstamped, and under --log-format json unparseable lines
    in the middle of the stream. A multi-line record — the stack dump that comes
    with a recovered panic, a Chat payload under --googlechat-log-events —
    stays one record: json escapes the newlines, and text now writes the
    continuation lines under a | gutter so none of them reads as a record
    of its own.
  • Switchboard reads the daemon's inbox events, and warns at stream open if a
    daemon does not advertise them. They are the only description of a message's
    life before it becomes a turn, and the only way to know a session has work
    waiting behind the turn it is running.

Changed

  • Eight startup warnings dropped the warning: they carried in their own
    message text; the level says it now, once, in a place a filter can see (#49).
    A run that greps its own logs for warning: should grep for WARN instead.
  • The Logf field on both adapters' Config takes chat.Logf (#49), aliased
    to the same type the binary builds, so an adapter outside this module can
    still supply one. Naming the level type is what supplying it requires, and
    the renderers live under internal/.

Fixed

  • A second question asked before the first has answered no longer costs the
    second turn its progress placeholder and clock (#42). One placeholder is kept
    per conversation, so the first answer used to delete the message the second
    turn was counting on; an answer with something still queued behind it now
    re-anchors the placeholder below itself instead of retiring it, and the turn
    that picks the queued message up restarts its clock. The other two ways out
    of a turn are covered as well: a turn that narrated before finishing, and one
    that died on a turn-error, both freeze the placeholder for the queued turn
    rather than deleting it — the failure notice goes in below it and the
    placeholder moves back to the bottom. Needs a daemon advertising inbox;
    without one the previous behaviour applies unchanged.

  • A stale backlog resynchronises on any idle daemon, not only one this
    connection watched start a turn. An inbox dequeued lost to a stream
    outage is never replayed — those events carry no seq — and the resync it
    needs used to be gated on a flag that the ordinary turn-complete path
    clears and a fresh connection never sets, so the lost id could strand a
    frozen placeholder under every answer for the life of the session.

  • A follow-up message no longer discards the accounting of the turn already
    running, so the first answer keeps its usage footer instead of posting bare
    and having its spend folded into the follow-up's footer (#42). That covers
    the window after turn-complete too, where the turn is over but the answer
    carrying its figures has not arrived; conversely a turn that dies on the
    daemon's idle boundary now drops its figures the way a turn-error already
    did, so they are not billed to whatever answers next.

    Not fixed, and now the whole of what is left on #42: which turn an answer
    belongs to. turn-complete names a prompt id minted at turn start rather
    than the one inject returned (go-steer/core-agent#943), so switchboard can
    tell that another turn is owed but not which turn a given answer settles. In
    a thread running two overlapping turns a usage footer can still land on the
    wrong answer.

  • internal/version.Version is v0.4.0-dev, so a build off main no longer
    claims to be the release that just shipped (#43). Same window
    verify-version-fallback keeps short after every tag.

  • Documented image tags carry no v. release-images.yml builds them with
    metadata-action's {{version}}, which strips it — the registry holds 0.3.0,
    0.3, 0, latest — but the v0.3.0 notes, deploy/README.md, the README's
    cosign example and the workflow's own header comment all wrote vX.Y.Z, which
    is a pull that 404s. The Go module path keeps the v and is unchanged; only
    the image tag drops it, which is what made the two easy to conflate.

Full diff: v0.3.0...v0.4.0