The harness page lists each credential binding with its captured OAuth
state (expiry, scopes, capture time; never the tokens), and the setup
terminal route upgrades to a WebSocket and bridges it to a harness
session. The session is a narrow webui-owned HarnessTerminal seam: the
container, sandbox network and egress path belong to the daemon, so the
dashboard process cannot implement it and answers 503 until a transport
is wired (archie-core-egkf.7). Opening the terminal authorizes as the
update action on the secret, per the PRD.
The per-process apply rows labelled every older applied version "Restart
pending", including a live-apply kind that needs no restart at all: the lag is
in reporting. The wording now follows the resource's apply mode. A live kind
reads "Applied" at the stored version and "Behind" on an older one, neutrally
rather than as a warning, while a restart-required kind keeps "Restart
pending".
The restart banner's condition is lifted out of the component into a plain
module so it can be tested: only a restart-required resource with a process on
an older version earns the banner, and a live-apply kind never does. The
per-process rows are wired onto the Plugins page, where a live kind's lag is
meant to show.
The sandbox kit spec lets one credential@1 declare apiKey and oauth
together, meaning "whichever the host has bound": the published
docker/claude-code-kit does exactly that for anthropic, and codex for
openai. archie decided the kind from the Kit's declaration instead
(egress.IsOAuthManaged), so a dual-declared service always came out
OAuth-bound however the org had bound it:
- kitrun.resolveCredentials granted an API-key binding's service the
empty string, so the proxy had no key to inject and every request to
a domain the Kit named carried an empty credential. The reference
Claude Code Kit could not authenticate with an API key at all.
- an API-key-only service whose binding named no secret resolved to ""
through the zero SecretRef, presenting an empty credential rather than
staying unbound.
- the proxy fired an apiKey inject rule for an OAuth-bound service,
putting "Bearer " on the wire, and intercepted the token endpoint of
an API-key-bound one, whose only outcomes were a 502 on the missing
token set, a capture the org never bound, or -- for a required
dual-declared credential -- a refused launch when no token store was
configured.
- the container's SBX_CRED_*_MODE said "apikey" for an OAuth-bound
dual-declared service, and kitrun demanded a captured OAuth token for
an API-key-bound one whose Kit renders a credential file.
One root cause, fixed once: the org's binding decides the kind. It is
now a first-class fact (egress.CredentialKind: apikey or oauth, absent
meaning unbound), computed from the binding in resolveCredentials and
carried to every consumer of it -- the resolver grant, the container's
credential state (mode variable and credential file), and the proxy
session, whose rule sets are built from it so a rule can only fire for a
service the run carries as that same kind. A service the run does not
carry at all keeps both rule sets, so resolving it still refuses a
required credential and skips an optional one.
Declared and bound stay two independent facts, as the reported
declared-and-granted intersection requires: neither widens the other.
No secret value crosses into kit (Bound carries kinds only) and none is
logged or written to a task row.
A Telegram voice note was stored as the placeholder "[voice message]" and
nothing turned its audio into text, so the agent could not read it. Add a
channel-neutral Transcriber capability to the messaging media layer
(internal/domain/messaging), an ai-sdk Whisper implementation behind it
(internal/infrastructure/transcription), and wire it for Telegram.
The capability is config-driven like the other model roles:
models.transcription names a provider/model, the matching [providers.*]
entry carries the credential (api_key_env or an api_key secret ref), and
a missing role, provider, class or credential degrades to today's
behaviour with a log -- never an error that fails the turn.
A transcribed note replaces its placeholder with "[voice transcription]"
followed by the transcript, preserving any caption, so stored history
shows the agent it is reading a machine transcript.
An EphemeralReply is a status notice a channel delivers and then removes
once its TTL elapses, so a transient placeholder does not linger in the
chat history after it is superseded. The TTL lives on the reply, the
Delete capability joins AdapterCapabilities alongside Media, and
channels.EphemeralSender does the send-then-retract with an injected
clock. A sender that cannot delete still delivers the reply and logs the
missed retraction instead of failing the turn.
Telegram implements MessageDeleter through deleteMessage and honours the
mechanism for the "Archie reloaded." status notice; the pre-restart
"Reloading…" message remains the durable acknowledgement.
ImagePull was called with empty options, so a private registry answered 401
on every pull regardless of containers.pull_policy. docker login did not help
either: it writes ~/.docker/config.json, which only the CLI reads.
Add containers.registry_auth, a SecretRef reusing the credential shape the
rest of the file uses, whose resolved value is a Docker registry.AuthConfig
JSON document. archied resolves it at boot and the pool base64url-encodes it
into the X-Registry-Auth header ImagePullOptions carries.
A missing or unresolvable credential degrades to the anonymous pull that
existed before the field (with a warning), so a deployment with no private
registry is unaffected; a half-named reference is refused by
configuration.Validate. The field is file-owned and json:"-", so the
container-runtime-policies layering has to preserve it explicitly, the way it
preserves Profiles.
MCP servers could not ask the client for a completion: the transports
routed only responses by id and dropped every server-initiated request,
so a server calling sampling/createMessage hung waiting for a reply.
Route server->client requests through the transport readers to a handler
on the client. The client answers sampling/createMessage from a
configured SamplingHandler and maps a missing handler, malformed params
and handler failure to JSON-RPC errors for that request alone -- never a
silent drop or a failed session. stdio and SSE implement the routing;
the stateless HTTP transport cannot receive the request at all and says
so in its doc.
The daemon wires the handler to its own chat runtime and active model
role, so a sample is answered by the model a chat turn uses, capped by
the request's maxTokens and the model's output ceiling, and recorded on
/status like every other model call. No model configured is a refused
request with a clear error.
modelcatalog.Load ran once at boot, so a provider whose credential became
resolvable later, or a model models.dev published since, needed a restart.
The daemon now re-reads the catalog on an interval and republishes everything
derived from it, without a restart.
- `refreshModelCatalog` re-reads through the same options boot used, layers
the result with the process's own runtimeConfig, and publishes. A failed
read keeps the catalog already running: the model list must not go blank
because the catalog service had a bad minute.
- Boot now publishes the merged config into `config.Holder`. applyModelCatalog
only ever wrote into the boot struct, so the catalog's model limits and
discovered providers never reached the running config -- and therefore never
reached `config.ForTask`, which is what a workflow stage resolves model
limits from. The first live update was the first snapshot to carry them.
- The chat model manager's catalog is a contribution that is replaced, not
merged. A model the catalog no longer publishes stops being offered and
described instead of lingering from an earlier snapshot.
- The catalog snapshot and the refs it contributes live behind one lock: the
refresh goroutine replaces them while the config paths read them.
The daemon owns the published configuration, so the loop is the daemon's; the
standalone Gateway reads the catalog once at boot, as it does for the other
live-applied settings it does not watch.
The interval is deliberately not an operator setting: the catalog is derived
state rather than a stored resource, and a knob with no second consumer would
be a setting that parses and does nothing.
A key exported into the shell after the process started stays invisible to
every refresh, and cannot be otherwise: the process environment is fixed at
exec. A credential a secret engine starts resolving is visible, because the
catalog's credential lookup is the secrets registry.
Refs archie-core-zfb0.6
Descriptor.Validate duplicated only the forge-permission half of
Authority.Validate, so a descriptor could declare a blank credential
service, egress host, trigger or tool and be installed: the acceptance
record refused the same blank, leaving the descriptor the operator is
shown disagreeing with the record the package is bounded by. Delegate to
Authority.Validate, the one validation of a grant list, and cover it with
the blank cases the descriptor now has to refuse.
The built-in workspace write and edit tools replaced file content with
no recoverable pre-state. Each now snapshots its target immediately
before the write and refuses the mutation when the snapshot cannot be
taken, so a checkpoint is never silently skipped.
Checkpoints land in .git/archie-checkpoints inside the workspace, the
same per-task state directory that already holds the task brief and the
prepared sentinel: nothing under .git can be swept onto the task branch
by go-git's Add{All:true}. A checkpoint records either the file's bytes
or its absence, so creating a file restores by removing it;
RestoreLatest returns the most recent pre-state for a path.
Shell, Go-script, MCP and plugin tools are deliberately not covered:
the set of files they can touch is not enumerable from the call.
A declared output is written through a capture tool, but the dispatch-time
harness check read only the workflow's needs.captures. A workflow that
declared outputs without also writing needs: {captures: true} could name a
Kit profile whose adapter serves no capture tools; a required output then
parked with "output %q is required" instead of the profile being refused.
WorkflowInterface.Needs now reports captures for a non-empty Outputs beside
the declared needs, and the profile check and Kit launcher read it. The
needs: block keeps its meaning for a workflow that captures without
declaring outputs.
- internal/domain/workflow/task: Needs() derives captures; DeclaredNeeds
carries only the declared block.
- internal/daemon: pinTaskProfile and runKitTask read Needs().
- tests: parse-time derivation, and pinTaskProfile refusing an
outputs-declaring workflow against a Kit adapter with no capture MCP.
The Settings save flow tracked dirty fields but did not consult validity:
each page validated in a local computed the save bar could not see, so an
invalid draft could be saved and the server refused it a round-trip later.
The rules now live once in ui/src/settings/validation.ts, the store derives
invalidFields from the same draft diff as dirtyKinds, and the save bar lists
the invalid fields and refuses Save. The route-leave guard still reads the
one dirty model, so the two can never disagree.
Every edited field also shows its former value inline ("was 1m0s") from the
same per-kind diff, via a new DraftHint component.
The per-kind diff is now a cached computed, so the hint, the save bar and
the guard share one computation per change instead of one per consumer.
The poller, the forge webhook intake and the review scan built envelopes
without an Org, so every task and reaction keyed on the default org no
matter which org its identity served. Resolve the org through the State
Store's PrincipalSource (the existing org RPC over the staterpc client)
on the single publish paths:
- PublishTask stamps the envelope's identity org before encoding, so the
idempotency key is org/identity/owner/repo/number; a resolve failure
stops the publish instead of keying under a guess.
- PublishReaction is the one reaction write path, stamping the root org
when the webhook producer could not; the poll scan stamps its task's
already-resolved org, so both deliveries of one review key the same.
- The webhook receiver's inline publish closure moves onto the daemon
method, removing the second reaction write path.
Review of the plugin-settings reconcile PRD (F1-F8) returned REVISE: the doc
stated outcomes without making the decisions behind them. This revision makes
each one, so the PRD can carry the plugin live-reload work:
- ApplyMode is set to live and the gateway's version lag moves from the
restart banner to the per-process applied-version rows.
- The skills_dir refusal gets a check site (a pre-layer comparison on the live
path, not the value-agnostic validator), keeping #1143's validates-nothing
intact.
- Records the four-directory coupling and why a whole-document refusal is
acceptable.
- Justifies stop-then-start as a module's only check, and adds the refused
dependent-replace outcome to the apply-status taxonomy.
- States that a reconcile tick re-runs layering and provider resolution, and
what archie-gateway actually boots.
- Adds the Verification section.
Cited package paths re-checked against the tree; the control-plane
definitions now cite internal/app/controlplane/.
The temp-repo fixtures in agentexec, domain/workflow and agentworker seeded
a repository and committed without disabling gpg signing, so a host with
commit.gpgsign=true and an agent-only SSH signing key failed those tests at
the fixture's own git call ("Couldn't get agent socket?").
Each producer now writes commit.gpgsign=false into the temporary repository's
own config, which also covers commits made inside the seeded repo by a
subprocess (the fake harness). A regression test per package pins the
fixture's hermeticity under a hostile global git config.
The server offers re-review for a waiting task, and it refuses one
without instructions, so the control needs a dialog of its own rather
than the plain confirm: it collects the operator's focus and posts
api.taskAction(id, "rereview", {instructions}). taskAction now takes the
review-gate payload (instructions and the finding keys approve posts, an
absent selection meaning all), and the freeze-dried catalog gains
Re-review so the first render matches the served catalog. The rereview
event kinds join the live-update topic list.
ui/dist is regenerated and committed; task test:ui and the typecheck pass.
Decision 1 of docs/prds/pr-review-operator-response.md: the dashboard's
POST /api/tasks/{id}/action is the authoritative surface, chat's /approve
is a shortcut that posts every offered finding, and both reach the same
Service.Apply so one operator intent cannot be recorded as two decisions.
The action body now carries instructions (required by rereview) and the
finding keys an approve posts. taskactions.Service answers an offer
through the guarded RespondReviewGate write: approve records the
selection on the offer, rereview records the instructions, increments the
round and clears the offer, and a rereview with no instructions, with no
offer, or at the cap is refused as a conflict with nothing written. Chat
reaches the same service: chatTaskControllerAdapter.ApproveChatTask
delegates to b.taskActions() instead of its own requeue, which is what
removed the handler's hardcoded implement handoff -- feasibility's deliver
stage now names implement on the task before it waits, the invariant the
handler needs.
The payload crosses every hop it must: the NATS action request, the
gateway.v1 gRPC contract (regenerated), the LocalChatAdapter, and the
webui handler, which answers 400 for a rereview without instructions and
409 for the cap. A rereview event kind names its actor the way the
approval and rejection trios do.
taskactions.Task gains review_gate and rereview_rounds, and the two
surfaces' tests assert they agree.
The gate now writes its offer to the task's review_gate document before it
waits -- the scored findings, the head SHA, the pull request's identity
and the resuming workflow -- because the engine cannot resume a run
partway, so a resumed pipeline recomputes its findings and only the
recorded document is the review the operator saw
(docs/prds/pr-review-operator-response.md, "The review the operator
answers").
The document lives with the task column it encodes (internal/domain/
workflow/task), the way EncodeInputs does, and carries each finding as
opaque JSON beside the key an operator's selection names. That is what
lets the dashboard render and answer a gate without linking the workflow
engine -- cmd/archie-ui/architecture_test.go measures the linked binary,
and an operator-domain service importing the finding's own type linked
prreview into archie-ui. prreview owns the key derivation and the
finding's encoding, and the MaxRereviewRounds constant lives in the task
vocabulary beside the action names it answers with.
Intake restores the document into the run: a re-review's instructions
ride one labelled block in runLens's and runReviewer's missions only, and
an approve's recorded review is posted by phase 9 filtered by the
operator's selection, with the recomputed findings kept out of the output.
The gate does not wait again on an answered approve.
taskstate gains the rereview action the vocabulary needs -- offered for
waiting_human beside approve and reject, routed to queued -- whose
surfaces follow in the response channel.
The operator-approval gate needs its conversation with the operator
persisted before it waits and its answer threaded back
(docs/prds/pr-review-operator-response.md, Decision 2). review_gate is a
text column beside review_payload, encoded by the package that owns the
type; rereview_rounds is a bigint counted only by the new guarded write.
RespondReviewGate is the one write beside RetryTask/BeginRemediation: a
transition-table guard, one from-status check, an optional round
increment, and a requeue in one transaction. The re-review cap is
enforced in the row under the guard's lock, and a refusal leaves the
task waiting and the row untouched, surfaced as ErrRereviewCapReached
(added to the wire error table and the conformance battery). The column
joins the column-listing ListTaskSummaries projection and UpdateTask, so
the dashboard reads the offer and the store round-trips the count.
prReviewDecisionStages loses the withOperatorApproval flag: the shared
list the implement workflow splices (archie-core-afbk.7) never carries
the gate, and the standalone pipeline inserts it itself, immediately
before its merge gate (docs/prds/pr-review-operator-response.md, "The
gate is not reachable from archie's own PRs"). A structural test pins
both directions so a future edit cannot re-share the gate.
A workflow declares named, typed outputs beside its inputs
(task.WorkflowInterface.Outputs). A run writes each one once through a
capture tool named after the output, or from a deterministic Go stage via
TaskContext.WriteOutput; the finish write persists them on tasks.outputs
before the outcome transition. A wait:true caller receives its successful
callee's outputs through WorkflowCallStatus and publishes one as its own
through a call step's outputs assignment.
Build authority: docs/prds/workflow-call-outputs.md.
- save time: WorkflowInterface.Validate checks output names and types;
checkCallOutputs checks a call's assignment against both declarations
and refuses outputs over a wait:false call.
- run time: undeclared, mistyped and required-but-missing values park the
run; published callee values are re-checked against the caller's type.
- storage/wire: tasks.outputs (goose 0024), reset by each claim so the set
is attempt-scoped; an encoded set past the structured-payload bound is
refused, not clipped. Task.outputs_json and
WorkflowCallStatusResponse.outputs_json carry it; task.Caller keeps its
two methods.
- examples: firewall-contain calls firewall-investigate and publishes its
summary as its own output.
Four findings from the ui-redesign verification pass, each with the module that
owns the rule and the test that pins it.
- events: the three-step strip's and the tab chips' counts move out of the SFC
into events/counts.ts -- one read per step, an unreadable count stays blank
rather than reading as zero (events-counts.test.ts).
- workflows: workflows/workflow-yaml.ts reads the editor's YAML with a real
parser (the yaml package, not a line scanner) to drive the read-only Steps
preview and a live validity indicator; the editor gains a line-number gutter
and light syntax colouring behind the textarea. Step types and their settings
are not served to the dashboard, so those remain the server's to check on
save, and a save it refuses still reports its own reason.
- tasks: an ERROR log row is a block rather than only red text (lib/log.ts), the
log pane ends with "End of attempt N - M lines", and the task head offers
Archive when the server's own action list offers it (task-actions.ts, and
TaskRowActions' new `only` narrows the list without inventing a control).
- dashboard: the live activity feed gains the All/Tasks/System filter
(activity-filter.ts) and every quality-gate row gains a pass bar
(pass-bar.ts) that is red when the gate is failing.
ui/dist regenerated; ui/package.json carries yaml ^2.9.1.
Direction for GH #1154 (epic #998): reconcile the plugin, module and
secret-engine directories into the running registries, load new and
changed files, and surface only the removals through apply status.
Draft pending maintainer approval - not settled design, so no diff.
The index page warned that task check adds linter-tool lines to go.sum
(bead 1e37) and told contributors to restore the file before committing.
Measured at HEAD c6623d53 on a copy of go.sum, with the originals restored
after every step, that is not what the gate does: go fix ./..., golangci-lint
fmt, go vet ./..., golangci-lint run ./... (root and tools), go build ./cmd/...,
go test -short ./..., the docsgen and docsite checks and
go -C tools test -mod=readonly ./... left go.mod, go.sum, tools/go.mod and
tools/go.sum byte-identical, with GOFLAGS unset and again with
GOFLAGS=-mod=mod. golangci-lint cannot write its own lines into go.sum either:
it is in no require or tool directive, go mod tidy -diff is empty, and the
committed go.sum carries none of its dependencies.
What the page should say is the rule the measurements show. A stale go.mod or
go.sum fails the gate (missing go.sum entry, updates to go.mod needed) instead
of being repaired, because every Go step runs under the toolchain's readonly
default and the tools steps pass -mod=readonly. Only a global
GOFLAGS=-mod=mod in go env re-enables the repair, which is why the flag is
spelled out on the go -C tools steps; when go.sum does go dirty, go mod tidy
and its own commit are the fix.
The regenerated docs/data/generated/dev-docs.json rides along, as the page
requires: docsite check failed on the edited page first (stale dev-docs.json)
and passes after task docs:artifact.
No process writes configuration through the dashboard: the write
handlers, their UpdateConfig/ResetConfig/UpdateRepoField seams and
ConfigView.Editable were deleted with the runtime config overlay
(2311529d), and database-backed settings are written through the control
plane. That left producer-side residue behind:
- ConfigField.Editable and the descriptor literals setting it, which
emitted editable=true for fields no process can change, and which
ui/src/settings/types.ts's ConfigField deliberately omits from the
reader side of the wire shape
- ErrConfigUpdateUnavailable/ErrConfigUpdateInvalid, with neither a
producer nor a consumer since handleConfigUpdate was deleted
- comments pointing at handleConfigUpdate/UpdateConfig,
ConfigView.Editable, the overlay's overridden markers and a deleted
test name
The two Editable-only descriptor tests go with the field; the deleted
write path is what they pinned.
Closes the decision #1143 asked for. plugin_dir, module_dir, secret_engine_dir
and skills_dir keep their no-op validator, and the comment at that validator
now says so on purpose, with the two rules considered and refused:
- "must exist": all four consumers read a missing directory as an empty one by
design (plugin.LoadDir and secret.Registry.LoadDir return no entries and no
error on os.IsNotExist, loadModules skips an absent kind file, playbook.Load
returns an empty store, and internal/secret's TestLoadDirNonexistent pins the
no-error half), so the rule would turn deliberate emptiness into a failed
startup.
- "must be absolute" / "skills_dir under plugin_dir": no directory setting in
the repository is validated for shape, so a rule for these four alone is
arbitrary, and a boot-path validator over a stored document fails closed on
values the store already holds.
Deliberately no code change to either layer: configuration.validateDatabaseOwned
still has no say over the four, and the resource validator stays the single
no-op function with one obvious home for a rule.
Refs #1143
applyGeneralDefaults home-expanded secret_engine_dir, work_dir, state_dir and
chat.workspace but not plugin_dir, module_dir or skills_dir, while
config.example.toml tells operators to write all four as
~/.local/share/archie/<dir>. A literal "~" is not a directory: plugin.LoadDir
returns an empty set for it, loadModules finds no kind file, and skill
discovery falls back to the built-ins, all without an error naming the
mistake. Expand the three in the same place as the rest, so a value the
example advertises resolves to the directory the operator meant.
Test first: TestLoadExpandsConfiguredHomePaths gains the three fields (and
pins HOME to a temp dir instead of the runner's real one); it failed on the
three new assertions before this change.
No validator is added alongside: see the plugin-settings decision record for
why these four directories stay free-form.
Refs #1143
The sd_notify(3) client lived in internal/app/archied, so archie-messaging --
a process that must not import archied's composition -- could never announce
itself to systemd, and could therefore never be a Type=notify unit
(archie-core-g5g8).
The protocol client and the heartbeat sampler move to internal/sdnotify, a
cross-cutting leaf that imports nothing of ours. What stays in archied is
what is the daemon's own: which marker counts as progress (daemon.LastPollAt)
and how long the run loop may go between poll passes. The three entry points
that already announced keep announcing, unchanged.
The Messaging Service announces READY=1 at the point it declares itself
serving, the way the daemon, the Gateway and the State Store already do. No
unit is switched to Type=notify here: that is a separate decision, and
archie-messaging.service is still Type=simple.
The skill already told a lane that a wire-type change needs `task docs:generate`;
this names the other trigger for the same generated artifact. Adding or editing a
page under docs/ gains or drops a page in docs/data/generated/dev-docs.json, and
skipping the regeneration fails docs:artifact:check on main rather than in the
lane that caused it.
b2244080 added docs/prds/soul.md but did not regenerate
docs/data/generated/dev-docs.json, which is generated from the docs tree and
gained a 95th page (/dev/prds/soul/). main therefore fails the gate's
docs:artifact:check. Regenerated with the command the check itself names.
The fleet skill is normative for archie facts and the fleet can read it, so
three facts earned this session move here from one operator's private memory:
- Peer sessions over intercom: name the reporting channel in the brief, because
a compaction erases an agent's transport convention while keeping its task
state, so a peer can revert to addressing its operator. Peer silence is not
evidence of death; ask for an ack. Also: match task shape to window size, and
checkpoint at ~70% rather than compacting mid-task.
- Gate the merge candidate before main moves, and have the lane brief demand
scoped lint beside scoped tests.
- codegraph: read interface_dispatch and inferred tests alongside test_count,
treat the index as a derived cache, stagger name-based queries, and report
problems as one JSON object per line.
An install that stayed in installed_packages left every contribution
unprojected: nothing made a package's workflow a usable org resource, and
nothing stopped it on removal. This lands projection for the workflow family,
the one kind whose org resource, validation and live read path all exist:
- storepkg.Service gains Projections (family -> projector): install resolves
each projected family's contributed names against the fetched
layer (FilesFromLayer), applies them, and on failure withdraws and removes
the half installation; remove withdraws before the record goes, so a failed
withdrawal keeps the package installed and usable.
- controlplane.WorkflowProjector merges the package's entries into the org's
workflow-definitions document — the same document the daemon's
WorkflowDefinitions client reads per dispatch, so a projected workflow is
usable at the next dispatch and a withdrawn one stops dispatching, without
restarts. A contributed id displacing an operator's own workflow is refused
(storepkg.ErrContributionCollision), never silently replaced.
- installed_package_contributions (migration 0023) records the entries a
package projected, so removal takes exactly its own contributions out.
- stateStoreDeps wires the projector set on the State Store's pool; the
composition is pinned by the live round-trip test over a real gRPC
connection.
Prompts, skills, MCP server definitions and default settings remain
unprojected: their contribution formats are not settled by docs/prds/store.md
and are left for their own slices rather than half-wired here.
{{.Scopes}} now substitutes the captured set as an ARRAY in the target
encoding, so a one-element set stays a one-element array rather than
collapsing to a bare string. An empty set REFUSES by name with an
actionable "re-run the setup terminal" message: the spec declares an
omission case for {{.PrimaryApiKey}} but none for {{.Scopes}}, and an empty
array would silently change the CLI's capability decisions.
{{.PrimaryApiKey}} now implements the spec's omit case: its enclosing key is
dropped from the structure, never emptied. archie resolves a service key
only to fill the egress grant and the container holds egress.Sentinel, so
there is never a key to render.
The renderer's input becomes OAuthFacts{Scopes, ExpiresAt} -- still the only
thing it receives about a stored token set, so a real access or refresh
token cannot reach the file and an unsourceable placeholder still refuses by
name (docs/prds/external-agent-harness.md, Verification).