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.
Pass 2 of archie-core-nx30. Pass 1 typed each prior action's result in
the CEL env; this pass wires that typing through the loader, module
schemas, and daemon, and removes the now-redundant id classifier.
Loader shape (D2): one playbook is exactly one workflow action
(unchanged) OR one or more module actions; the shapes never mix. Mixed,
unsupported, or zero actions fail the load naming the playbook.
playbook.Load now takes a KindSchemas source (a small interface this
package defines, satisfied by *module.ModuleRegistry) so playbook grows
no module import. Callers: bootstrap.loadEDAPlaybooks passes b.modules;
daemon and playbook tests pass module.New().
Per-playbook env (D3): each action's when and args values compile against
an env built from the PRIOR actions' ids typed by their kinds' Result
structs (expr.NewEnv(DeclaredResult{ID,Type})). event stays dyn. An
undeclared id, a forward reference, or a field the kind's Result lacks is
a compile-time undefined-field error.
Args schema (D4): an args key the kind's Args struct does not define
fails the load. An args VALUE whose compiled type mismatches the field
type is left as a named gap (not cheap without leaking cel-go type kinds
into playbook and handling dyn reads); a wrong-typed value still surfaces
at module invoke, not load.
D1: Store.Dispatch routes workflow playbooks only, so an action playbook
cannot hijack the definition pin. bootstrap.loadEDAPlaybooks logs a
visible Warn (not debug) for each loaded action playbook naming it and
stating it does not execute yet.
D5: ModuleRegistry.Invoke is deliberately schema-agnostic (the stored
invoker is type-erased and returns map[string]any). The map-to-Result
marshalling belongs in the coordinator named by the doc, which is the
t2db.31 run path and out of scope here.
Classifier enumeration (E) and verdict, all proven for a typed action
playbook via CEL (expr.NewEnv with a declared log.Result id):
unknown id CEL compile (undefined field) -> delete unknownActionReference
literal map index actions["x"] CEL compile (no _[_] overload) -> covered
computed index actions[key] CEL compile (undeclared 'key') -> covered
dynamic index actions[event.name] CEL compile (no _[_] overload) -> covered
"x" in actions CEL compile (no @in overload) -> covered
size(actions) CEL compile (no size overload) -> covered
actions.all(...) CEL compile (not a range) -> covered
actions == {} CEL compile (no _==_ overload) -> covered
bare actions compiles; KEPT classifier -> retained resolvable check
unknownActionReference is deleted; actionReferences/ActionReferences are
kept solely for the bare-actions spelling CEL does not reject.
Declare `actions` as a per-playbook object type with one field per
declared prior action id, each typed by that kind's Go Result struct
(multi-action-playbooks.md D3). A data-driven types.Provider exposes
lower-cased Result fields to the checker, so a result-field typo, an
undeclared id, or a dynamic actions read is a compile-time rejection.
Evaluation still reads an ordinary map value; no custom ref.Val adapter
is needed.
NewEnv now takes the declared results (an empty set is valid); `event`
stays dyn. The playbook loader keeps its current single-action boundary,
so its zero-declared-results env is unchanged and playbook.go needed no
call-site edit. Two playbook tests are updated to assert the new
compile-time rejection semantics.
archie-core-np7l's service half -- the reload action and its truthful refusal. The
request surface that carries the instruction from the dashboard is its own change,
because it is its own object with its own lifetime (the reasoning is recorded in
docs/architecture/migration-decisions.md).
Service.ReloadChannel routes to the channel's own seam rather than reimplementing
it: the telegram front-end re-reads its token and allowlist, which is what its own
/restart path calls. A channel that cannot reload is refused with a reason instead
of accepted and ignored, because the dashboard offers the action on the strength of
the capability the descriptor declares, and an accepted-then-nothing reload is a
lie the operator cannot see through.
The capability and the action now come from one source. Before this a descriptor
declared ReloadSupported by NAME, so a channel could announce reload support and
have nothing behind it; reloadable() decides both, and the descriptor test builds
a real gateway with a seam rather than a fake named "telegram".
Verified: task check exit 0. Coverage: the refusal names the reason for a channel
that declares no support and for an unknown channel; the service reaches telegram's
own reload seam and the re-read config lands; and the declaration and the action
cannot drift, which is asserted by reloading every composed channel and requiring
the refusal specifically to be "does not support reload" -- a declared reload may
still fail on the configuration it re-reads, and that is a different fact.
The UI boundary test forbade wiring Server.Channels, and it was right about what
the field used to hold: a live *status.Manager is a runtime handle this process has
no business owning. It now holds a reader over the State Store's channel-status
contract, which is the same shape as the Mappings, Bindings and ApplyStatus fields
the guard already expects to be wired. The distinction it draws is the handle, not
the name, so the assertion moves with the field and says why.
Also adopts task fmt's rewrite of the reader's status construction: go fix drops
the explicit embedded Descriptor, and formatter output is law here.
archie-core-8cda.6.8's carrier. The service now records channel lifecycle and has
nowhere to put it: /api/channels answered with nothing because
webui.Server.Channels had no production source, and reload answered 501 for the
same reason. This adds the surface the register decided on, following the split
archie-core-ymut established for config snapshots -- a pair of administrative RPCs
whose writer is one process and whose reader is the UI -- and wires both ends.
Wire and store: PutChannelStatus / ListChannelStatus, with ChannelStatus carrying
id, name, state, detail, configured, reload_supported and observed_at. The store
holds one row per channel and replaces the reported set, so a channel the reporter
no longer mentions is deleted rather than left standing as a stale "running"; an
empty report clears the table, because hosting no channels is a fact worth
reporting. A row without an id is refused: it could never be replaced or removed
by a later report.
Writer: the service publishes on every lifecycle transition through a coalescing
signal -- a burst of transitions is one write, since a reader only wants the latest
state of every channel -- plus a start-up report and a final report after shutdown,
so a stopped service leaves the store honest. A failed write is logged and retried
on the next signal; the dashboard losing channel state is worth a warning and never
worth failing a channel start over.
Reader: webui.Server.Channels becomes a source rather than a concrete manager, and
webui.RemoteChannelStatus reads the store the way RemoteConfigView reads the config
snapshot. A store it cannot reach reports nothing rather than a stale "running",
and a state the reader does not recognise is carried through rather than dropped.
The contract's own index gains the group in the same change that adds the RPCs --
a surface the grouped table does not list is one nobody finds -- and the count moves
to 51. The register records why the surface is the State Store rather than a
resource kind, and why reload gets its own surface rather than a field here: reading
status must not be able to retrigger an action, a transient request is not
distinguishable from state once anything polls it, and it would invert the
writer/reader relationship the precedent establishes.
Verified: task check exit 0. New coverage: the store's replace-the-set semantics
and its refusal of an id-less row, the reader's mapping including an unknown state,
and the publisher's start-up, transition and final reports.
archie-core-8cda.6.8's producer half. The service handed every channel an empty
channels.Lifecycle{}, so starting, running, failed and stopped were recorded
nowhere and internal/channels/status.Manager -- which has had MarkStarting,
MarkRunning, MarkDegraded, MarkFailed, MarkStopped and Snapshot all along -- had no
production writer at all. The channels have always reported: all three call
ReportStarting and ReportRunning on whichever lifecycle they are given.
Each composed channel now gets its own report into a manager keyed by channel, so
one channel's failure marks only itself; a channel that cannot start is marked
failed with its reason rather than only logged, and a channel that returns is
marked stopped. Service.ChannelStatus is the producer a dashboard surface reads.
Left open deliberately: the cross-process carrier, and reload's direction.
docs/architecture/migration-decisions.md records the shape by the precedent the
contract already establishes -- archie-core-ymut's config snapshot is "the one
surface whose writer is the daemon and whose reader is the UI process", a pair of
administrative RPCs deny-by-default under authorizesTaskScopedCall -- and names
what that settles: channel state is runtime state rather than a settings document,
so it does not belong among the ControlPlaneService's validated resource kinds; the
UI already dials the State Store and pumps its cursor, so no new transport is
needed; and the contract PRD's grouped table gains a group in the same change that
adds the RPCs. Reload runs the other way and is left as a named open question
rather than decided by analogy with a status report, because a request queue and a
status report do not have the same lifetime. It also records that 8cda.6.9's
component self-report is the same shape, so the two do not become two homes for
"what a component reports about itself".
Red-proofed: restoring the empty lifecycle fails TestServiceRecordsChannelLifecycle
with "channel webhook never reached running; last report State:configured", so the
test pins the fix rather than the manager's existence.
Verified: task check exit 0.
archie-core-8cda.6.5's remaining half. The gate landed in a7d6cc8c; what was
missing is the verification that the extracted service actually carries a message.
It drives the deployed path -- compose, the real webhook adapter, a real listener,
a real signed HTTP request -- and asserts on what crossed the chat contract as well
as on the reply the caller receives back, which DeliverTo=origin routes through
that contract. The envelope assertions are the three transport facts this channel
must carry, each of which has a reason recorded elsewhere: platform "webhook" is
how the Gateway learns which channel it serves (archie-core-c1qx); SenderID stays
empty because a route path is a source and never a person (archie-core-oyna); and
the route survives as the budget key, so the inbound limit still applies.
Webhook is the only channel a test can own. Telegram needs a bot token and the
Telegram API, email needs SMTP, so neither can be exercised here. The PRD's fourth
criterion asks for a live Telegram round trip "or equivalent channel smoke test",
and this is that equivalent: every step between the POST and the contract is the
deployed code path. The gRPC hop beyond the contract is covered by
internal/infrastructure/gatewayrpc's conformance tests, which run the same client
and server in both local and remote mode.
Red-proofed rather than assumed: signing the request with the wrong secret fails it
with "status = 401, want 200", so the signed path is genuinely exercised rather
than bypassed.
Also carries f39fdd73, the migration register's correction, which was committed
unpushed on purpose so it would ride a code change rather than re-stamp :latest on
its own.
Verified: task check exit 0.
The register described a design written before any measurement existed, and two of
its open questions were answered while landing archie-core-1ng1 -- both by
measuring rather than by preference. The client did not become two packages: the
workflow and persona watches stayed on internal/app/controlplane's Client, which
now embeds the new one, so the daemon's validated watch is still defined once and
the read path still has one implementation. And the vocabulary stayed in
internal/infrastructure/controlplanerpc rather than moving to a domain package,
because it has exactly one consumer and the store-backed side reads the same
definitions through type aliases rather than a copy.
It records what made that safe rather than asserting it: internal/app/controlplane
was the ONLY direct import of the Messaging Service that dragged a banned runtime
-- gatewayrpc, staterpc, applystatus, messaging, configuration, readiness and health
were all clean -- so severing that one dependency sufficed and no third package was
needed. The workflow/task exception the gate carries is recorded too, with the
verification that justifies it rather than the precedent alone.
Two questions stay open and named: whether the store-backed server also leaves
internal/app/ (archie-core-8f4n), and whether internal/domain/workflow's
contract/engine split happens (archie-core-inh6). Promoting the vocabulary to a
domain package is recorded for the day a second consumer appears.
Committed without pushing on purpose: a docs-only push to main republishes :latest
with a dev stamp for no benefit (archie-core-i5nb), so this rides with the next code
change.
The PRD's deletion gate for the Messaging Service could not pass: go list -deps
./cmd/archie-messaging linked modernc.org/sqlite, internal/store,
internal/domain/workflow and internal/agentexec -- all through one import,
archiemessaging/run.go -> internal/app/controlplane, from which the service used
three symbols. The decision was to sever rather than amend the gate, because a
boundary you whitelist around is no longer a boundary (archie-core-1ng1, recorded
in docs/architecture/migration-decisions.md).
Measured before touching anything: internal/app/controlplane was the ONLY direct
import of the service that dragged those runtimes -- every other one was clean --
so severing this one dependency is sufficient for the gate.
Moved into the new internal/infrastructure/controlplanerpc: the generic resource
client (NewRPCClient, Query), the RuntimeChatConfig projection, the reader
interface (now the exported ResourceReader), the wire sentinels, the status
mapping (now ClientError), and the channel-settings document with its decode --
ChannelSettings, TelegramSettings, WebhookChannelSettings, EmailSettings,
RateLimitSettings, ChannelDuration, DecodeRenamingLegacyKeys.
internal/app/controlplane keeps the store-backed server, the Definition registry,
every kind's seed/validator/Normalize, the schema derivation, and its
resource-specific reads and watches. Its Client embeds the new one, so the read
path has one implementation while the workflow, persona and cronstore reads stay
with the processes that already link those engines. The documents are type-aliased
back into this package so the store-backed side reads them by the names it has
always used: one definition, not a copy on each side of the boundary.
The gate is now enforced by cmd/archie-messaging/architecture_test.go, measuring
the linked binary against the PRD's banned list, with one exception checked in
both directions: internal/domain/workflow/task, the Task status and view
vocabulary whose own dependency set holds none of the banned runtimes. The UI gate
carries the same entry for the same reason, and the fleet skill names it as the
precedent.
Verified: task check exit 0. The gate was red-proofed twice -- banning
internal/channels fails it, and removing the workflow/task exception fails it --
so neither the loop nor the exception is decorative.
archie-core-8cda.6's fourth criterion cannot pass: the PRD's deletion gate for the
Messaging Service does not exist, and the check it names reports four banned
packages linked -- modernc.org/sqlite, internal/store, internal/domain/workflow and
internal/agentexec -- all through one import, archiemessaging/run.go ->
internal/app/controlplane, from which the service uses three symbols. The decision
is to sever rather than amend the gate, because a boundary you whitelist around is
no longer a boundary.
This records the plan before any implementation: what moves (every kind constant,
the channel-settings vocabulary and its decode, the generic client, the persona
watch, the workflow-settings document), what stays and why (the store-backed server
and Definition registry, WorkflowDefinitionsClient and stepRegistry,
WatchWorkflowExecutionSettings because decodeSettings returns and validates
workflow.ExecutionSettings, the schedules document because a domain vocabulary may
not import infrastructure, the schema derivation), and where the pieces go
(internal/domain/controlplane for the vocabulary,
internal/infrastructure/controlplanerpc for the client, mirroring gatewayrpc and
staterpc).
Four decisions are named rather than taken, so archie-core-8cda.6.5 does not
inherit them: whether the server also leaves internal/app/; where
WatchWorkflowExecutionSettings lives, given it cannot share a package with the
client the Messaging Service imports; whether internal/domain/workflow's
contract/engine split happens and when; and whether archied's watches move with the
client. Both existing consumers keep compiling, and the Messaging Service's
dependency set loses all four banned packages.
Verified: task check exit 0, docs-only change, docs:check and docs:prds green.
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 bead behind this is already satisfied on main -- install.sh renders no TOML,
splices nothing, calls the archied binary it just built for a fresh install,
leaves an existing config alone, and fails loudly rather than writing a partial
one. What was missing is that nothing checked any of it, which is how the
generating branch grew back the first time it drifted: it hardcoded the GitHub
token key and the Gitea host, so choosing Gitea produced a config naming a token
the installer never wrote (archie-core-1786637491134-51-17a55e60).
TestInstallerDelegatesConfigGenerationToArchiedSetup now pins all four, with the
splice and redirection checks scoped per line so a legitimate sed or awk elsewhere
in the installer stays allowed. Red-proofed in both directions: re-adding a forge
table fails with "install.sh carries a TOML template", and re-adding a sed splice
on config.toml fails with "install.sh splices config.toml".
The non-interactive arm of the criterion was verified by running it rather than
reading it: the exact invocation install.sh builds, with stdin closed, exits 0 and
writes a config the real loader accepts. That run also surfaced a separate defect,
filed as archie-core-6omt rather than folded in here: the cloud path pairs the
ollama baseline model with provider openai, so an unattended install names
openai/llama3 -- loadable, but not a model OpenAI serves, and it fails at the first
chat turn long after the install reported success. Fixing that needs a decision
about where an attended-free install gets its model, so it is not a patch.
Verified: task check exit 0 including test:tools and test:ui.
The menu and /help were generated from a hand-maintained spec list that had
drifted from the executable surface: /approve and /deny are real handlers but
were published nowhere, while /rollback and /stop are Telegram-only.
Registration now reads a single handler table, and a regression test derives
the executable set from messaging.LocalCommands() plus that table, failing when
the published specs and the executable surface disagree in either direction.
/approve and /deny are published with their Telegram meaning, the
dangerous-command approval list, not the shared task-approval copy; that split
is archie-core-ho86. The two tests that pinned them as hidden commands are
updated to the published decision. /help now also asserts it carries every
published command's description, not only its usage.
The v1.30.0 extraction moved Telegram, email and webhook out of archied and into
cmd/archie-messaging, and nothing packaged it. dist-zip built and copied only the
five older binaries, and scripts/archie-update-install omitted it from both its
service and binary lists. A host upgraded across v1.30.0 therefore ran on with no
messaging process at all: archied logged that it stopped serving the telegram
gateway at the extraction, nothing replaced it, and the bot was dead for two days
with no error anywhere -- the daemon looked healthy throughout (archie-core-1c01).
Fixed in all four places the host component set was enumerated: the zip's build
loop, the zip's copy list, the installer's GATEWAY_SERVICES (messaging is a
service, so it is installed AND restarted) and its GATEWAY_BINARIES. The comment
claiming every process in the documented deployment ships in the zip is now true,
and says what makes it true.
The duplication was the actual defect, so the sets are pinned to cmd/ instead:
TestHostCommandListsCannotDrift derives the host-run commands from cmd/ and
asserts all four lists, plus the reference runbook's units, agree with it. Adding
a command or extracting one fails the test until it is packaged -- the check that
would have caught this on the day. The installer's own test grew the same
coverage, and the reason it passed while the bug was live is worth recording: its
fixture created only the stale cmd/ set, so the script's `[ -d ./cmd/$cmd ]` guard
silently skipped messaging.
Documentation, because the installer now refuses an update when a service unit is
missing and sends the operator to the runbook -- so a service the runbook omits is
a dead end: a messaging unit in deployments/systemd-user-service.md, the component
list and start sequence in deployments/INSTRUCTIONS.md (which ships inside the
zip), and the packaged-binary list in RELEASING.md.
Verified: task check exit 0, including test:tools and test:ui. Both new guards
were made to fail on purpose: reintroducing each omission produces "missing
archie-messaging" and "no call with fragments [./cmd/archie-messaging]".
The landing page opened by defining archied against a category the reader
never raised, then listed security features. State what the daemon does
and who owns git operations; drop the contrast.
Derive a public news page and one release-notes page per component version
from CHANGELOG.archied.md and CHANGELOG.archie.md, the notes the release
process already freezes.
- tools/newsgen writes docs/news/releases.json, the canonical artifact a host
renders from, plus the MkDocs pages. Check mode fails when the committed
files lag a changelog edit, and runs in task check; tools/release.sh --tag
regenerates and stages them in the release commit, skipping files already
current.
- mkdocs.yml keeps the version pages out of the derived navigation without
excluding them from the site.
Add the playbook_dispatches at-most-once ledger (docs/prds/eda-playbook-engine.md
gap 2) and the record-then-invoke coordinator helper, with the cross-process
plumbing the State Store boundary requires.
- proto: RecordPlaybookDispatch and DeletePlaybookDispatches RPCs (string keys)
- storecontract: PlaybookDispatcher interface (no *sql.Tx, reuses ErrAlreadyDispatched)
- store: playbook_dispatches table + INSERT OR IGNORE dedup + delete-by-playbook
- staterpc: client/server methods and Deps field; error sentinel survives the hop
- eda/playbook: InvokeOnce record-before-invoke helper, keyed on
(playbook, version, event, action) with a "1" action-position fallback
The ledger is administrative-only: task-scoped grants never reach it, matching
TaskGrants' Update/Transition/InsertEvent allowlist. Not wired into the daemon
workflow pin; the production call site arrives with the first side-effecting
position.