RELEASING.md still described two independently versioned components, GATEWAY
and RUNTIME release inputs, and a `task release:prepare` invocation that no
longer exists. It is the file someone reads to cut a release, so a stale one is
worse than none.
The PRD's version computation carried a real flaw: a commit whose scope is the
repository's own machinery could still bump the product's version, so the first
improvement anyone made to the release process would inflate it -- which is
exactly what `feat(release)` would have done to this cut. Non-product scopes
(`release`, `ci`, `docs`, `build`, `test`) now contribute no bump.
release.sh decided which commits a release carries from two package closures,
cmd/archied and cmd/archie-agent, plus a short explicit list. The Messaging
Service, the State Store, the playbook runner and the UI ship in the host
bundle but were not named, so a change to a package only one of them links
closed over no component and the release omitted it silently: the telegram
fence fix in 1.37.1's range was dropped this way, and releases since the
Messaging Service was severed from archied in 1.35.0 have been incomplete.
The gap is pre-existing, not introduced by the one-stream change: the old
two-file closures named the same two component directories. What changed is
that the omission is now visible, because a release is one tag with one set of
notes rather than two independent ones.
Each shipped binary's closure is now part of the release, so a change only the
messaging service, state store, playbook runner or UI links lands in the
changelog instead of nowhere.
A tool call rendered as a label line plus a ```text fence. Telegram draws a
fenced block as a full code widget (language header bar, copy button, panel),
and the block parser inserts a spacer paragraph before every block, so one
call cost four rendered elements. Three calls filled the screen to show three
word counts.
Every toolPreview path already summarises to a single line, so the fence was
never wrapping more than one. Drop it and put the preview on the header line.
Tool lines now join with a hard break rather than a bare newline: a soft
break would space-join them into one run-on paragraph, and a blank line would
put the spacer back. Three calls are now three consecutive blocks.
Two hardcoded values go with it. The status word is printed only when the
outcome is not success, since every line otherwise read "done" and
distinguished nothing. The icon is no longer a literal in the renderer: each
builtin declares its own on tools.Tool (not on Schema, which is the model's
contract), the provider carries it into ToolEntry, and the turn snapshots the
registry's icons alongside its tool set. A tool that declares none renders
without one rather than borrowing a generic wrench.
Carries a dependency upgrade (go.mod, go.sum, tools/go.mod, tools/go.sum).
CommonMark fences are three OR MORE backticks or tildes, and the closing
fence must be at least as long as the opening one. The parser hardcoded a
three-backtick prefix for both ends, so every longer fence was mangled:
````go language became "`go", matching no grammar
```` wrapping ``` the outer fence closed at the inner one and the code
leaked out as paragraph blocks
~~~go never recognised, and the "~~" emphasis pass then ate
two of the three tildes
The middle case is the damaging one: wrapping a reply in a longer fence is
how a model safely emits content that itself contains a fence, so getting it
wrong could wreck an entire reply rather than just its formatting.
Track the opening fence's character and run length, and close only on a run
of the same character that is at least as long and carries no info string.
CHANGELOG.archied.md and CHANGELOG.archie.md were two version streams that
drifted: a release that moved both components had two numbers, two pages and
two tags, and a reader had to visit two files to learn what shipped.
The merged history holds 65 versions from 64 archied and 34 archie sections --
33 that both components released, 31 only archied, one only archie -- so 98
published pages become 65. A version's date is the newest of its sections'
dates, and a component whose own date differs carries it on its label, because
the history has two dates and the merge must not invent one. `## [Unreleased]`
is not a release: it gets no page, and it stays at the top of the file.
A level-two heading is where the merge could silently drop a section, so the
merge is verified by content rather than by the generator: section counts per
source, the merged version set against the exact union, and every source `###`
title present both as a substring and, after stripping the component prefix, as
an identical heading. Counting `##` headings rather than releases overcounts by
one here, which is how the empty `[Unreleased]` block was caught.
- newsgen reads one file and writes `docs/news/<version>.md`, the index, the
canonical `releases.json`, and `docs/news/redirects.json`. The redirect table
is what keeps the retired `/news/<component>/<version>/` URLs alive; it is
generated beside the pages so it cannot drift from them.
- release.sh takes one `--version`, keeps commit and tag (the Woodpecker
pipeline that will own them does not exist yet), and exits 3 when the commit
set justifies no release, so a pipeline can finish green without tagging.
- The consumers of the two files follow: the deploy workflow's tag gate and
release-notes extraction, the zip contents, the update check's changelog
links, the packaged-path note, the docs skill, and newsgen's tests.
The per-component detail survives as labelled sections inside each release, so
a reader still learns whether archied or the agent changed; what goes away is
the separate numbers and the separate pages.
A version both components released carries one heading and one date: the newest among
its sections, because a version's date is when its last part shipped. Where a
component's own date differs, that component's section label carries its own, so the
per-component fact survives the merge instead of being collapsed into the heading.
The ambiguity is historical only -- one version stream with one tag gives a version
exactly one date -- so the rule represents the merged past rather than a design that
must hold.
The same section records how the merge is verified: by content, not by the generator
exiting zero. The section count per source, the merged version set equal to the union
of both, and every title still present; a generator agreeing with the file it just
wrote is evidence of nothing.
Adding a release workflow to this repository and enabling the repository in
Woodpecker are two steps, and only the first is a file in this tree. A pipeline that
is correct and never runs is invisible until someone asks why no release happened, so
the second step is stated as a prerequisite of the design rather than left as an
assumption behind it.
The unification in this PRD is what makes a release pipeline possible, so the
pipeline design belongs in the same document rather than a second one that would
have to agree with it.
The spine: a Woodpecker workflow gates, generates the release page, runs the reviewer
over it, commits the changelog and generated pages, tags, pushes, publishes images
and triggers the site's artifact sync -- with no operator step. It triggers on a push
to main rather than a manual run, which is both what "none of it done manually" asks
for and the only trigger this estate's Woodpecker configurations are proven on.
The version is computed from conventional commits since the last release, which is
what the commit rules in this document exist for, and "no release" is a legitimate
outcome rather than an invented version. One tag also removes two of the three builds
a release starts, because concurrency keyed on a commit identifier treats an
annotated tag as a distinct ref -- a consequence of one version stream, not a
separate fix.
The part that cannot be retrofitted cheaply is tools/release.sh, so its shape is
decided here: no prompts, a version that is an argument and a reported result, a
distinct exit code for "nothing to release", and no commit, tag or push of its own
because the pipeline owns those and the script runs on every push to main.
The three CI surfaces are assigned authorities here, so the pipeline is not built in
three places with one authority. The pipeline itself is implemented next; this commit
is the design it will be built from.
Verified: prdlint caught a temporal hedge in the first draft of this text and the
gate refused the commit -- the chain works, and the finding is fixed rather than
suppressed.
A decisive one-page PRD for the release-pipeline change, per AGENTS.md's rule that a
change to settled process starts with a decision rather than a refactor.
The load-bearing decision is one version stream: GATEWAY and RUNTIME stop being
release inputs, so an operator names one version and per-component detail survives as
sections inside the release rather than as separate numbers and pages. A three-way
release forces skip values for components that did not change and lets two
components' tags drift a release apart.
It supersedes the two-component sections of docs/prds/news-and-releases.md and says
so by name, rather than leaving two documents disagreeing about how many components
there are.
The reviewer step is written from a verified invocation, not from the help text: tl
rules --lint reports "corpus ok", and tl review on a generated page reports "0
findings (0 high, 0 medium) · 1/1 files reviewed · clean". --fail-on defaults to
never, so the PRD requires the level to be passed explicitly -- without it the step
cannot refuse anything.
Documented-but-unimplemented is the deliberate state: the PRD is the artifact this
change is required to start with, and the implementation follows separately.
The rule as first written said release notes state what a reader gets and that
withheld capabilities and failure modes belong in docs/architecture/. That is true
but blunt enough to invite the wrong edit: applied mechanically it deletes a caveat
a reader needs.
Three cases, distinguished by whose experience the sentence describes. A capability
that never existed leaves no expectation to correct, so a note about it reads as a
feature. The implementation's journey is not the reader's experience either. A
capability that shipped but is not yet wired is the reader's experience, and belongs
as a caveat paired with the behaviour that compensates for it -- the release note is
then the only place a reader learns they should not expect it to work yet.
The last line says so outright, because the failure mode of this rule is someone
applying it to a caveat.
The gate ran and passed in the same conditional chain as this commit.
The v1.36.0 release note carried four things a reader cannot use. The dashboard's
seven in-browser tools and the installtype fix stay; the withheld judgement verbs,
the consequentialHint limitation and the two silent-failure notes are removed from
the release feed and moved to where an implementer looks.
- The four verbs are withheld because an agent that can approve can approve its
own work. That is settled design, so it now sits in docs/architecture/identity.md,
beside the approval-path conflict it belongs with, stated as the constraint it is:
attribution, not capability, is what releasing them depends on.
- The browser-tool surface had no home in docs/architecture, so it has one now:
docs/architecture/dashboard-agent-tools.md holds what a tool call can be
attributed to, why confirmation is a signal rather than a control, and the two
ways the surface fails silently.
Audited 1.35.0, 1.36.0 and 1.37.0 for the same class. 1.37.0 is clean. 1.35.0 carried
two build notes: a bullet recounting that a guard had never been written because it
failed, and a clause about a manager "finally" having a production writer. Both are
gone; the capabilities they were attached to remain.
RELEASING.md now carries the rule so the next release reads it: release notes state
what a reader gets, and design constraints, withheld capabilities and failure modes
belong in docs/architecture/, because a note about an absence reads as a feature to
someone who never had the thing.
docs/news/** is regenerated by task news, never hand-edited. task check passed before
this commit: the chain runs it, so a failing gate commits nothing.
Two rules added to the quality-gate step, both learned by getting them wrong
tonight.
The gate must gate the commit: one conditional chain, so its exit status is what
decides whether the commit runs. Written as separate statements on one command
line it is decorative, because nothing reads its status but the operator -- the
failure is discovered after it has already been pushed.
And never assert a gate result that was not just produced on that exact tree. A
commit message outlives the tree it describes and is read by people who were not
there; if the tree has moved, describe the change and let the run speak.
AGENTS.md is a symlink to this file, so the edit belongs here.
The live path recorded actor_id, actor_kind and principal_id as empty while the
actor was named inside the event's detail text. The daemon records the event and the
State Store holds it, and the contract between them did not carry the three fields,
so the columns were empty by the time anything could query them. An audit query
reading actor_id found nothing and "who approved this" meant parsing a
human-readable string -- the transient, unqueryable attribution this work exists to
replace.
The in-process test passed throughout because it used the local store and never
crossed that hop. The new test runs the same insert through the local adapter AND a
bufconn-backed gRPC client and asserts the columns on both, so the two paths cannot
disagree again.
Verified: task check exit 0 on this tree; the new test passes in both modes. The
grpc mode is reasoned to have failed before this change -- the field did not exist on
the contract, so it could not be set or read -- but that is inference from the
mechanism, not a run I performed against the old code.
Phase 1 of dynamic curator definitions (archie-core-trnd.1):
- ToolBuilder implementation resolves declared tool names from the
daemon's process-wide tool registry, returning exactly the declared
set and failing closed on an unknown name.
- curatorLLMRunner now carries ChatRequest.Tools and MaxSteps into
core.GenerateOptions and widens ChatResult with the executed tool
calls so a pass can attribute its actions.
- One generic DefinitionEngine interprets a Definition (Manifest +
name/enabled/instructions): its pass composes instructions with the
built declared tool set, runs the model loop, and records an action
per tool invocation.
- [[curators]] config definitions carry the Manifest shape verbatim plus
name/enabled/instructions; a definition missing interval is refused,
never defaulted.
- Idle curators are observable: the runtime logs a debug line when Check
reports not-due.
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.
Two defects, both from consuming a ref's object id as if it were a commit.
1. IMMUTABLE IDENTITY. Both images published only `:latest`, so a deployed
artifact could not be traced to a commit or restored. Each build now also
publishes `sha-<commit>`. The commit is NOT `github.sha`: on a tag push that
is the ref's object id, and every release tag in this repo is annotated —
measured, 80 of 80 archied/v* and archie/v* tags are tag objects (archied/
v1.36.0 points at 6720bc42 and dereferences to 576718c3). So the new step
resolves `git rev-parse "${GITHUB_REF}^{commit}"` and the tags use that.
Annotated tags are the right thing for the producer to create; the consumer
stops guessing rather than the tag type being downgraded.
2. NO BARE dev STAMP. `[ -n "$GATEWAY_VERSION" ] || GATEWAY_VERSION=dev` made a
main build indistinguishable from any other, and is why a release's stamping
looked transient: the next commit to main republished :latest as plain `dev`.
The fallback is now `dev+<short sha>`, so an unreleased build is identifiable
and visibly not a release. The warning at the gate now states the consequence
it previously only implied.
Scope: this file only. Nothing else in the checkout was touched.
The updater is component-driven: it compares the daemon and agent versions and
acts only when they differ, so a host whose individual binaries disagree looks
healthy. Carina ran a hand-installed archie-messaging 1.35.0 against a 1.30.0
state store and crash-looped on an RPC the older store does not serve, while
the updater reported "no approved component changes; nothing to install".
The reason a comparison was impossible: three of the six host binaries carried
no version at all. archie-ui, archie-messaging and archie-playbooks did not link
internal/app/archied, so the release ldflags never reached them; the gateway and
state store linked the variable but exposed no flag. Only archied could say what
it was.
- internal/buildinfo carries Version, stamped by all three build sites: the
zip, install.sh, and the updater itself.
- Every host binary answers -version ("<name> <version>"). archied's existing
two-line output is unchanged, because something parses it.
- archie-update-install reads each installed binary before it can report
"nothing to install" and refuses, naming every binary that disagrees with the
daemon's version; after an install it verifies the same set against the
release it just installed, so a binary the release did not rebuild is skew
rather than success.
- TestDistZipShipsEveryHostCommand pins stamping across the three build sites
and requires each cmd/ to report, so a seventh command cannot arrive unstamped.
The transport could carry an actor and nothing filled it. It does now, so a
dashboard approval is recorded as the person whose credential verified, and an
agent's token is recorded as the agent's action -- for an agent, agent_approved;
for a person, human_approved; and for a caller whose identity archie could not
verify, task_approved, which claims nothing about who did it.
The actor travels the path the action takes: webui reads it from the request
context the middleware resolved, carries it in the gateway request, the daemon
passes it through the in-process adapter, and the NATS request body carries it to
the service that records it. Scope stays separate from actor at every hop, because
scope is which task a caller may touch and the actor is who touched it.
A chat channel's bound identity is an actor too: a bot acting on its own channel's
task is recorded as an agent's action rather than a person's, via ActorFromScope,
whose empty kind is what keeps it out of human_approved. The agent-facing
task_action tool passes that identity and never input["identity"].
The UI process's credential check is now filled by endpoint references rather than
by configuration: -oidc-issuer and -oidc-audience on archie-ui, two URLs the
process already understands the shape of, with the verifier built in Run because
cmd/ parses flags and nothing else. The UI package still never reads config, and a
configured provider that cannot be reached fails boot rather than falling back to
the gate that names nobody.
Evidence for this change, stated as measured: go build ./... and go vet ./... are
clean, and every package this touches passes -- webui, domain/taskactions,
infrastructure/taskactions, infrastructure/gatewayrpc, gateway, app/archieui,
app/archied, domain/messaging, channels/telegram, cmd/archie-ui. task check could
not be run to completion: it fails in cmd/archie-messaging on an untracked
internal/buildinfo package another lane has in flight, which is not this change and
was left untouched. The end-to-end flip is covered in
internal/webui/api_tasks_actor_test.go: a person's credential produces a record
naming that person with human_approved, an agent's produces agent_approved, an
unverified request produces task_approved with no actor, and a request carrying
forged actor fields cannot name one.
The noctx linter refuses httptest.NewRequest, which carries no context. The
requests these tests build are the ones an authenticated caller sends, so they
belong on a real context rather than a background one.
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.
install.sh built and installed five host binaries but wrote only
archied.service, so a fresh install ran one of five services and the updater
refused its own first update for units the installer never created
(archie-core-enow). The runbook stood in as the mechanism, which is the
hand-written step that let a messaging binary and unit drift apart
(archie-core-1c01).
- install.sh writes archie-state-store.service, archie-gateway.service,
archie-ui.service and archie-messaging.service alongside archied.service,
with the contents the runbook used to tell an operator to paste, and starts
all five with the store first.
- deployments/systemd-user-service.md no longer carries the unit contents; it
names the units, explains why each exists, and points at
systemctl --user cat and drop-ins for inspection and overrides.
- The updater's unmanaged-unit refusal now reads as a safety net for a host
that drifted rather than the normal path.
install.sh built five of the six host commands, omitting archie-messaging, and
scripts/archie-update-install's guard only checked that every listed service had
a unit -- never that every host unit was listed. A v1.30.0 updater with the old
list therefore neither backed up nor restarted the messaging service, leaving a
hand-installed binary running under an otherwise updated host (archie-core-1c01,
archie-core-1faq).
- install.sh builds archie-messaging, and its summary names it.
- The updater refuses when a host unit this release ships is not in
GATEWAY_SERVICES, naming it, alongside the existing refusal for a listed
service with no unit.
- TestDistZipShipsEveryHostCommand -- the name deploy.yml:255 already promised --
now pins all four lists to cmd/: the zip's build loop, the zip's copy list,
install.sh's build loop, and the updater's GATEWAY_BINARIES/GATEWAY_SERVICES.
A fresh install still seeds only archied.service; that gap is tracked separately
as archie-core-enow.
Infra decoded real tokens from both clients, and two of the three facts changed
this code.
A machine token carries NO sub at all: it names its caller by client_id, and the
identity is that client. A person's token carries sub, the provider's stable
identifier for the person. The subject is now derived explicitly -- sub when
present, else client_id -- and a verified token asserting neither is refused
rather than accepted as an anonymous caller, because accepting it would let any
token the provider ever signed act as whoever the binding happened to hold. A
machine identity is therefore per client registration, one identity per client,
which is what makes per-agent identity a configuration decision rather than a code
change.
Scopes are read from either claim shape. The standard is a space-delimited scope
string and this provider also emits an scp array; reading only one shape yields no
scopes at all, which is worse than reading none deliberately.
The audience-at-authorisation-endpoint trap is pinned by a test: a token minted
without the requested audience arrives with aud empty, and the audience check
refuses it. That refusal is correct and the fix is the request the human flow
builds, not a weaker check here -- a test now fails if anyone weakens it.
The PRD records both as constraints: a person's client and an agent's client are
registered separately because a shared registration collapses the distinction the
attribution rests on, and a person's token requests the audience at the
authorisation endpoint as well as the token endpoint.
Verified: task check exit 0; internal/infrastructure/oidc passes, including
subject derivation for both token shapes and every refusal.
Two halves of one boundary: a credential resolves to an identity, and an action
records which identity acted and whose authority it used.
resource server. internal/infrastructure/oidc verifies a provider-issued bearer
token against the provider's published keys, using an OSS OIDC library: archie
compares no signature, validates no claim and rotates no key itself, holds no
client secret and issues no session, so a compromised archie cannot mint an
identity. Audience is required rather than optional -- a token minted for another
service must not authenticate here -- and discovery happens at construction, so an
unreachable provider is a startup failure rather than a request-time surprise.
identity.Authenticate is the single place a credential becomes an identity, and it
refuses in four distinguishable ways: no credential presented, a credential that
did not verify (wrong key, expired, wrong issuer, wrong audience, malformed), a
verified subject with no identity bound to it, and an identity that may not act.
The order is deliberate: verification happens before any field of the token is
used, so nothing an unverified token carries can select an identity. A suspended
identity is refused even though its credential verified, because suspension is
archie's decision and must not depend on the provider withdrawing a token.
The binding is the second bridge beside the legacy-name alias: identity_subjects
keys (issuer, subject) so the same subject string from another issuer is a
different caller, and rebinding moves a subject so two identities can never claim
one provider subject. The contract Authenticate needs is SubjectResolver, narrower
than Repository, so a consumer that only authenticates does not take the whole
identity CRUD surface -- and staterpc.Client, which asserts Repository, does not
need a new RPC to satisfy it.
attribution. taskactions now records two identities per action: the acting
identity and the authorising principal, both on the event row as new columns added
through the existing migration table. The rule that the bug turned on is enforced
by the event kind describing the actor: a person's approval is human_approved, an
agent's is agent_approved, and an action with no verified actor is task_approved,
a task-level event that credits nobody. An agent acting under a person's standing
approval records itself as the actor and that person as the principal, so
"approved by came from me" is answerable from the record rather than asserted.
Scope and actor are separated: scope decides which task a caller may touch and is
never promoted into an actor, because the dashboard's credential is a shared token
and possession of it is not evidence that a person was at the keyboard.
That last point is a deliberate fidelity trade, and the reason the transport is
not wired: the dashboard action path passes no actor yet, so dashboard approvals
are now recorded as task_approved rather than claimed as a human's. Recording
nothing false is the requirement; naming the human verifiably needs the dashboard
to authenticate a token and resolve it, which needs two new state-store RPCs
(ResolveIdentitySubject, BindIdentitySubject) -- the next piece, not a rewrite:
the verifier is a one-method interface, so introspection would be a second
implementation of it.
Verified: task check exit 0; focused runs recorded in the handoff. Opaque
authelia_at_ tokens were inspected rather than assumed and cannot be verified
against public keys; infra is configuring access_token_signed_response_alg RS256
on the archie client, with audience https://archie.catlow.cloud and issuer
https://auth.catlow.cloud.
An mkcert-generated private key was created in the repository root while
setting up a secure context for local WebMCP work. It was untracked and
unignored, so any 'git add -A' would have committed it; the key now lives in
~/.config/archie/tls and these patterns keep the next one out.
One identity record covers users, agents, external agents, service accounts and the
system. Authentication is delegated to the estate's OIDC provider and attribution
stays archie's. Nothing that verifies a credential, issues a session, stores a
password or checks a permission is built here, per Sam's hard requirement that
authentication and authorisation are OSS archie integrates.
Authelia is the only provider, because the estate already runs it in front of the
dashboard and it issues credentials for both kinds of caller: authorization code
for humans and client_credentials for machines, whose subject is the client's own
identifier. Each agent is its own client, so two agents are distinguishable in the
audit trail and revocable separately. SPIFFE/SPIRE is rejected on operational fit
rather than quality: it is adopted and its attestation is strictly stronger, but it
adds a control plane archie does not have and answers a threat archie does not face
while its agents run in containers the operator launches.
internal/domain/identity survives and is not replaced by the provider's directory,
because it carries what the directory does not: lifecycle, bindings and
attribution. archie owns the subject binding that ties an identity to the provider
subject asserting it -- the same bridge identity_aliases already provides from a
legacy name -- plus the lifecycle, the attribution and the identity audit trail. It
owns no credential, password, session, token, signing key or permission rule.
How an agent proves who it is: it presents a token the provider issued to its own
client, archie validates it against the provider's published keys and takes the
subject as the acting identity, so an agent holds the secret and archie holds only
public keys. A WebMCP tool call cannot be a proof of agent identity and cannot be
made one -- a page can invoke its own tools, so an agent's call and a page script's
call arrive identically and the difference does not exist on the wire. It is
attributed to the identity the request presented with its source as a hint, and it
never records that an agent acted or that a human approved. Agent-initiated action
therefore arrives on a surface that carries a credential.
Task actions gain both attributions: the acting identity, derived from the
credential and never from a supplied string, and the authorising principal whose
authority the action used. The event kind describes the actor, so
KindHumanApproved is recorded only when a human acted; an agent acting under a
standing approval records itself as actor and the human as authorising principal.
An action with no authorising principal is unattributed rather than attributed to
the actor's own authority, and the review gate's approver is the approval's
authorising principal, not the surface they used.
External agents are first-class: the same record, kind service_account, bound to
its own provider client, at the cost of a client registration and a secret to
rotate per peer. Authorisation is deferred: no engine, no policy language, no
decision point, with the credential's scopes as the only input; the decision point
goes behind a single archie interface when per-skill limits are needed.
The PRD is a development-audience page, so it regenerates dev-docs.json to 69
pages. Verified: task check exit 0, including docs:prds.
The header's secure-context note no longer reads as a dead end: 127.0.0.1 is
already a secure context, and mkcert gives a LAN address or hostname a
locally-trusted certificate, so a plain-HTTP origin is a configuration gap with
a known local fix. Production terminates TLS in front of the dashboard.
A WebMCP tool call cannot be attributed to an agent: the page can invoke its own
tools with executeTool, so an agent's call and a page script's call reach the
server identically. A durable record can honestly say only that the actor was
the signed-in identity and the source was webmcp -- a hint, not proof -- and
must never claim a human approved. Real agent attribution needs the agent to
authenticate with its own credential, which is the A2A work where an agent is
an Identity.
The module header now records the two ways the tools go silently missing: a
secure context is required, so a plain-HTTP dashboard exposes nothing even with
the origin-trial flag, and archie-ui embeds ui/dist, so rebuilding the bundle is
not deploying it and a stale process reports the tools as absent. It also
records that executeTool flattens a thrown execute error into a generic
UnknownError, which is why the confirm guard is pinned by a unit test rather
than by a browser run.
The three recovery tools now carry a required `confirm: true`, rejected before
the API is touched when absent. It is a deliberate-action signal, not a
security control -- an agent can pass it trivially, and the module header says
so. Its value is making the model state intent rather than reaching for a
mutation mid-sentence.
The module headers also record two things this work learned the hard way: the
API's three string/object shape traps (inputSchema and executeTool's input and
result are JSON strings, not objects), and the advisory status of the
annotations -- Chrome 152's getTools() reports only readOnlyHint and
untrustedContentHint and drops consequentialHint, and a page-invoked
executeTool gates nothing. Nothing here is enforced by the browser. The tools
run in the signed-in operator's session and cannot exceed that operator's
rights; that is the security model.
Register the dashboard's own tools with document.modelContext so an in-page
agent can read tasks, events, and daemon health, and recover a stuck task:
list_tasks, get_task, recent_events and daemon_health (read-only), plus
retry_task, stop_task and cancel_task (consequential). The human review gate
(approve/reject) and the destructive verbs (abandon/archive) are deliberately
not exposed.
Every tool calls the same ui/src/lib/api.ts client the interface calls, so the
agent and the UI exercise one set of endpoints, one CSRF header and one error
shape. Registration is framework-agnostic (lib/webmcp.ts machinery,
lib/webmcp-tools.ts list, lib/archie-webmcp.ts the api binding) and no-ops when
document.modelContext is absent, which it is outside the WebMCP origin trial.
Tools returning agent, operator or inbound content carry untrustedContentHint;
only the recovery actions carry consequentialHint.
Verified in system Chrome 152 with --enable-features=WebMCP: seven tools listed
with schemas and annotations, all four read-only tools executed against the live
dashboard, and the flagless run mounts the dashboard with no exception.
Sam's decision, recorded as requirements rather than options. A2A carries
agent-to-agent work: discovery of what a remote agent offers, delegation of a unit
of work, progress on it, and the artifacts it produces. MCP stays the tool layer --
the two are complementary, and internal/tools/provider already registers MCP
providers as optional capabilities. A2A rides archie's existing transports, which
the protocol permits: its canonical data model is Protocol Buffer messages and it
defines a gRPC binding, so archie speaks it over the gRPC and NATS it already runs.
The boundaries are requirements. internal/domain/messaging stays the human and
channel layer, because a Conversation is a ChannelID and a ThreadID and its
participants are people. internal/agentexec stays the daemon-to-worker execution
protocol, whose Request, Result, gate and budget policy A2A never carries. A2A is
an edge protocol that composes with both.
The load-bearing decision, and the one that constrains everything downstream:
archie's work lifecycle is MAPPED to A2A's, not expressed in it. An A2A task is a
view over archie's own task, and archie's status stays the record of truth. Three
gaps make the mapping partial, and each is a fact A2A's states cannot hold: A2A's
terminal states describe what the agent did, while archie's merged and rejected
describe what a forge did afterwards; pr_open hands work to a human reviewer, while
A2A's input-required means the CLIENT must send more input; and declined, parked
and dead are outcomes of archie's own policy. Adopting A2A's state names as the
persisted task status is rejected outright -- it would migrate the task store and
drop the forge outcomes that tell a caller whether the work was accepted.
An A2A agent is an Identity: the actor archie persists, versions and scopes
credentials to. A persona is prompt text with no endpoint; an agent container is
task-scoped and ephemeral; the daemon is the process that serves the identity. The
Gateway serves the card for the identity it is configured as, over the gRPC
binding's Get Agent Card operation, and the card is derived -- skills from the
catalog, identity from configuration, capabilities from what the process already
advertises -- never hand-written, and carries no secret.
archie is a server first, because the work a peer would delegate exists only inside
archie. An inbound call is authenticated at the transport by the bearer-token
interceptor the Gateway already applies: A2A carries no identity in its payload, so
the transport credential is the identity. Authorization is per skill, which is
A2A's own model. Task-scoped grants are not A2A credentials -- reusing one would let
a peer act with a worker's authority -- and the dashboard's authentication gates an
operator interface, not an agent endpoint.
The new PRD is a development-audience page, so it regenerates the development
artifact rather than the public one: dev-docs.json goes to 68 pages and
docs.json is unchanged.
Verified: task check exit 0, including docs:prds, and both docsite checks.
The site's sidebar held the landing page and one guide next to seventeen
architecture records, the migration register, the review procedure and five
PRDs. Nothing there is secret -- every development page may be read by anyone --
but a reader who wants to know what Archie is and how to point an event at it
was meeting contributor material with no signal that it was not for them.
One source tree now yields two sets: public (index, guides/) under /docs/, and
development (architecture/, prds/) under /dev/, each with its own artifact and
its own derived sidebar. archive/, inspiration/, news/ and the credential notes
stay out of both, unchanged.
Selective PRD publication is gone rather than carried over. It existed only
because settled architecture cites PRDs and a link to a held-back target fails
the generator, so five PRDs published to keep those citations alive; with both
halves of every such citation in the development set, the exception has no work
left to do. Both sets are generated in one pass over one url map, so a citation
that crosses between them resolves to the base its target is served under, and
the refusal now fires only for a target genuinely in neither set.
Widening the set exposed a scanner bug worth its own note: the link regex
matched `Resolve[T](i, src, exportPath)` inside a code span and refused the page
for a link to `i,`. Code spans and fenced blocks are now skipped, because what a
renderer draws as a link is the only thing this tool may rewrite or refuse a
page for.
docs/prds/public-and-dev-docs.md records the decision. Draft: the three choices
in it are the maintainer's, the write-up is not yet reviewed.
The landing page still opened with "archied is a resident daemon that polls a
forge", which is wrong twice over. A deployment is a set of contracted services,
not one process, and a forge is one event source among several: signed webhooks
from any sender and chat-channel messages reach the same playbook routing that a
GitHub or Gitea issue does. GitHub/Gitea was the first case, not the shape of the
product.
The intro now leads with the event path (event -> playbook -> workflow in an
isolated worktree) and says outright that sources, their fields, and the workflows
they reach are configuration rather than code. "What runs where" names the actual
services and which contract each owns. The stray "Work arrives as events." line
went with it, since the intro now states that.
Claims are held to what ships: module actions load and type-check but are not
dispatched yet, so the page promises one outcome per event, not a fan-out.
task build already stamped archied, archie-gateway and archie-agent with
installtype.buildType=binary, but archie-state-store, archie-ui and
archie-messaging were built unstamped. A binary built by task build is
then permanently un-updatable: releaseupdate.Service.Install refuses on
installtype.Unknown.
Add the same stamp to the three missing go build commands and pin the
contract with a root-level deployment test that fails when any go build
line under the build task's cmds targets ./cmd/<name> without the stamp,
naming the offending command.
The intro stated per-task sandbox and credential isolation and daemon-owned
git to a reader who has no reason to act on it. Keep the event framing; the
enforcement detail stays in What runs where and ARCHITECTURE.md.
Regenerate docs/data/generated/docs.json with task docs:artifact.
MkDocs retires and the Astro app becomes the only public site, so the artifact is
the product and the Markdown stays the source -- the split tools/newsgen already
states for releases. tools/docsite walks the published set and writes
docs/data/generated/docs.json: every page's directory-style url, title, section and
raw Markdown body, plus the sidebar tree derived from the layout.
Three things the artifact has to get right, each of which was wrong in a draft:
- LINKS. The published pages carry relative .md links that MkDocs rewrote at build
time and nothing else will. Each is rewritten to the target page's url using the
same function that builds urls, so a link and its target cannot disagree; anchors
and scheme-qualified links pass through; assets resolve by the same rule and none
are referenced.
- FRAGMENTS. A link can resolve to a page and still be broken, because a fragment
matching no heading lands the reader at the top of a long document. Each is
checked against the target's headings, by the slug rule a table of contents uses.
- REFUSAL. A link whose target the set holds back, or whose fragment matches no
heading, fails the generator naming the file, the line and the target. This found
three citations from settled architecture pointing at two PRDs the blanket prds/*
exclusion withheld -- links that were already 404s on the published site, so the
exclusion broke citations rather than withholding drafts. Both targets are now
published, for a reason distinct from the three ratified PRDs already published.
The published set moves out of mkdocs.yml into the generator with its reasons: a
renderer reading the artifact cannot see why a page is absent. docs/data/generated
is accounted for by docsgen's generatedArtifacts, which now names this file beside
contracts.json -- one ownership registry for the directory rather than one per
writer, so neither tool reports the other's artifact as unaccounted.
docs:artifact regenerates; docs:artifact:check reproduces into memory and fails on
drift without touching the tree, wired into task check beside news:check. The
existing docs:site target is MkDocs and was left alone -- a first attempt at that
name silently ran MkDocs and produced nothing.
Verified: task check exit 0, docs:artifact:check reporting 23 pages. The artifact
carries 23 pages, no archive/ inspiration/ or news/ entry, and the five PRDs the
set declares. Coverage: the published set and its count, url derivation, the nav
tree, both refusal paths, and check's no-write guarantee.
The apex is becoming the application; the documentation stays on the same
hostname under a path rather than moving to a subdomain that does not
exist. site_url has to agree with where the site actually serves, or every
canonical link and the sitemap point at the application instead.