Webhook intake answers 503 and counts no refusal while the chain loads.
The readiness probe reads the chain on every check. The UI never exits on
a first-load failure. An invalid instance policy closes the instance but
lets an instance admin repair policies. Outage pages are 503, and the
health detail names the unloaded chain.
IsLoopback(":8484") returned true: the empty host fell through the
switch as loopback, so a wildcard bind skipped the non-loopback token
requirement and served every interface unauthenticated. An empty host is
the wildcard, not loopback.
Two loose ends from the sign-in work, both mine.
A browser that cannot authenticate now goes to the provider when this instance has
a sign-in flow, instead of being shown the shared-token paste page -- a page that
cannot help it, because the token it would paste is not what this instance accepts.
A refusal that signing in again cannot fix, a suspended identity, is still answered
rather than redirected: sending someone back to a provider that already authenticated
them would hide the reason they were refused.
ProviderSession.Expired is removed. Nothing called it, and it must not: expiry is
the verifier's check, and a second opinion about whether a token is still good is
exactly the sort of near-duplicate that drifts from the authority it copies. The
browser path re-runs the flow when verification refuses, which is one rule rather
than two.
Verified: task check exit 0 on this tree.
The last gap in the identity boundary: enabling a provider used to lock browsers
out, because nothing could turn a sign-in into the credential the dashboard already
verifies. Now a browser completes the authorization code flow with PKCE and the
identity reaching the request context is the person who signed in.
The audience is requested AT THE AUTHORIZATION ENDPOINT, not only at the token
endpoint. Infra measured that a provider asked otherwise returns the audience empty,
and this dashboard then refuses a perfectly valid token -- a failure that reads as a
signing fault and is actually a missing query parameter. A test asserts the
parameter is present, so it cannot quietly go missing.
The flow is the libraries': discovery, the code exchange, PKCE generation and the
challenge transformation are go-oidc and x/oauth2, so archie writes no protocol. The
token returned by the exchange is verified through the SAME Verifier a presented
token goes through, and the identity is then resolved through the same rule -- one
Resolve now shared by Authenticate and the callback, so a browser sign-in cannot be
accepted on terms a presented token would be refused on.
Archie still issues no session. The callback stores the PROVIDER's token in an
HttpOnly cookie and every later request re-verifies it, so what archie holds cannot
outlive the provider's own decision. The callback checks the state it issued, and
expires the state and PKCE verifier cookies on use.
The sign-in routes mount on the bypass mux because they are how a caller becomes
authenticated; gating them behind the credential they obtain would make signing in
impossible. The client secret is never a flag: -oidc-client-secret-env names the
environment variable holding it, so it cannot reach a process listing or a log line.
No client id means no sign-in route and token verification is unaffected, which is
what an agent-only deployment wants.
Evidence, produced by driv·ng the flow rather than the seam:
internal/webui/api_tasks_actor_test.go's TestBrowserSignInRecordsTheSignedInPerson
walks sign-in -> callback -> cookie -> action and asserts the recorded actor is the
signed-in person with human_approved. TestCallbackRefusesAMismatchedState asserts a
replayed state is refused before any credential is verified.
internal/infrastructure/oidc/flow_test.go runs the real flow against a test
provider's own authorize and token endpoints, asserting the audience parameter, the
PKCE challenge, a successful exchange, and a refused wrong verifier.
Verified: task check exit 0 on this tree.
The verifier was a library nothing called. A request now carries a credential or
is refused: webui.Server.Authenticate resolves a presented bearer token to the
identity that may act, and requireIdentity attaches it to the request context.
With a provider configured that check replaces the shared token, so every request
resolves to a named identity or is refused; with none, the shared-token gate stays
for a loopback instance.
Nothing about the caller is read from the request. The subject comes from the
credential the provider signed and the identity is the record that subject is bound
to, which is what makes attribution possible at all: a caller cannot assert who it
is, it can only present what the provider gave it. A test sends an
X-Archie-Identity header and an actor field in the body alongside a valid token and
asserts the resolved identity is still the credential's.
Refusals follow HTTP's own distinction: absent or unverifiable credentials are 401
and name the scheme, while a credential that verified for an identity that may not
act is 403. Each is covered, because a refusal path with no test is a path nobody
has watched refuse.
The two state-store RPCs the dashboard needs to resolve a subject exist:
ResolveIdentitySubject and BindIdentitySubject, with the client implementing
identity.SubjectBinding (a narrower contract than Repository, so the administrative
facade keeps its shape) and the server answering Unavailable rather than pretending
when a process has no binding store.
chat.proto carries the actor for the next step: actor_id, actor_kind and
principal_id on ApplyOperatorTaskActionRequest, regenerated here. The transport can
now carry an attribution and nothing fills it yet, which is why the dashboard still
records task_approved rather than a human attribution.
Not wired in production yet, and worth stating plainly: dep.Authenticate is a seam
nothing sets, because the dashboard is served only by the UI process and that
process is documented to take endpoint references only -- there is deliberately no
config.Config in it. OIDC settings must therefore arrive as flags there, which is an
existing design boundary I did not want to cross unilaterally. config.Oidc exists
so the daemon-side wiring has somewhere to read from.
Verified: task check exit 0 after this commit; focused webui run records the
resolution and all four refusals.
An unauthenticated document request answered with a plain-text 401 -- and
index.html, the bundle and every asset sit behind requireToken -- so a
bookmarked or bare URL was a dead end: the dashboard's own authentication
banner could never load to explain it. Document requests now get a
self-contained 401 page whose one-field form reuses the ?t= exchange, so a
pasted token sets the cookie and the redirect lands on the dashboard. A
rejected token re-renders the page with the reason instead of answering a
document with text.
API and event-stream callers keep the plain-text 401: classifyActionError maps
it to "session-expired", and an EventSource error body is never seen.
The auth banner gains a Retry that re-runs the reads which report their own
401s, so a recovered session clears it without a document reload. The retry is
extracted to lib/session-retry.ts with an in-flight guard and unit tests.
The update watchdog verifies archied's restart, so archied has to be what
answers. It was probing the dashboard's /healthz, which belongs to the
dashboard: switch [web] off and nothing answers, and in the extracted UI
topology that endpoint reports a different process entirely, which would
confirm a release while the daemon it was meant to verify is down.
[health].listen (127.0.0.1:8485, defaulted, always on) serves /healthz,
/health and /health/detailed for the life of the process. Liveness answers
503 until the daemon reaches its run loop: the listener binds before the
subsystems do, so an unconditional 200 would tell the watchdog a half-booted
release came up. Failing to bind is fatal, because a daemon nothing can probe
gets every update rolled back. The State Store's readiness surface now shares
the listener plumbing, keeping its log and error text verbatim.
Closes archie-core-exbz, which asked which of two bad options to take when
the dashboard is off. Neither: the daemon owns its own liveness.
Also deletes TestInstallUpdateDetachesInstallerFromCallbackContext. It has
failed intermittently under load more than once, racing its fake bot server's
multipart parse against the cancellation it induces.
The watchdog polled http://127.0.0.1:8420/healthz. Nothing binds 8420: the
daemon serves /healthz on [web].listen (127.0.0.1:8484 by default), so every
dashboard- or Telegram-initiated update waited out the 60s health timeout and
rolled back a release that had come up fine.
The daemon is the only process that knows which address it binds, so it now
derives the probe URL from its own config and hands it to the installer;
CommandInstaller exports ARCHIE_HEALTH_URL and the install script forwards it
into the watchdog unit, whose remaining default matches the dashboard's.
The suite never dialled the URL: every watchdog test faked curl as an
immediate failure, so only the unhealthy branch existed. One test now runs
the real curl against a real listener, and another pins the script default.
clean.RequestURI() echoed the incoming request's raw path/query straight
into http.Redirect's Location header. A path starting with "//" is treated
by browsers as protocol-relative, so a crafted token-exchange link could
redirect off-host after a legitimate token exchange. sameOriginPath()
collapses any leading "//" before the value is ever used.
Fixes#440
The old UI was a single 200-line Go file serving one hand-written HTML
page of task rows. It showed that archied was running and almost nothing
about what it was doing -- skills, workflows, memory, channels, logs and
configuration were all invisible unless you read the source or the
config file.
The dashboard now covers each of those as its own section, built as a
Vite app under ui/ at the repo root: it is a separate artefact from the
Go daemon, not an internal package of it. dist/ is committed so building
archied never needs a Node toolchain, and the !no_ui build tag keeps an
embed-free build available.
Both sides are split by concern rather than by layer -- one Go file per
API area, one folder per UI section with its own CSS -- so a change to
logs cannot disturb tasks.
Pages report consequences, not just state: an empty memory page says
Archie starts every conversation with no recollection of earlier ones,
and the setup checklist names what is missing in plain language instead
of showing a grid of zeroes. Nothing greets by a hardcoded name; the
operator comes from [chat], which is deployment data.
Auth is exposure control, not capability control -- the agent already
holds this user's authority through its own tools. So a loopback bind
needs no token, and only a reachable bind mints one and logs a URL,
which means an instance cannot be exposed merely by omitting config.
Container startup now degrades instead of aborting, for the reason
resolveForge already does: a missing agent image should not deny the
operator chat and the dashboard, and under Restart=on-failure it turns a
recoverable problem into a crash loop with the real error scrolling past.
`task dev` runs the daemon under air and the Vite server together in one
terminal.