Scores a reviewer's findings on the 38 runnable Martian Code-Review-Bench
PRs: the deterministic core turns findings into posted comments, an
independent judge model matches them to the goldens, and the run reports
golden micro-recall and golden-only precision. The reviewer is a findings
fixture directory until the pr-review workflow lands.
Run with: task bench:prreview -- -findings DIR
Task templates every command, so the PostgreSQL health check's
'{{.State.Health.Status}}' rendered as an empty format string: dev:postgres
always reported unhealthy after 60s, the State Store never started, and the
Gateway and daemon exited on boot or retried against a store that was never
coming. Escape the template, and have dev:daemon and dev:gateway wait for
the State Store's port before starting.
Wave 1 of the Postgres migration (archie-core-7r0x.9). This is the shared shape
every port lane builds on; nothing here switches a live path to Postgres yet.
- config: add `database_url` beside `db_path` (config.go), mark it bootstrap-only
in denied_keys, expose it in the webui StorageView/config schema, and add it to
config.example.toml plus all deployments/*.toml.
- docker-compose: add a postgres:18 service; `task dev` (dev:postgres) brings it
up and waits for it before the State Store boots.
- archied: `openStateStore` now opens and migrates the process-scoped Postgres
pool via `openStateStorePool`. The State Store fails closed (D1.2) when
database_url is absent or invalid rather than fall back to SQLite; serving
against Postgres later requires an import-completion record (D1.3), which is a
later lane's gate, not this one.
- composition seam: task-store construction (state_store_task.go) and EDA-store
construction (state_store_eda.go) are extracted from openStateStore, with the
pool open in state_store_pool.go. This is a behaviour-preserving refactor only
— no store, interface, error, ordering or logging change — so L1 and L2 build
against separate files instead of sharing state_store.go.
Tests: fail-closed pool behaviour is pinned (absent/invalid URL); the State Store
boot/restart tests now run against a throwaway Postgres 18 container (pgtest
TestMain). Scoped test command and module-wide build pass; see lane report.
goose migration 0001 lands the twelve State Store tables on Postgres, and sqlc generates the task queries from it. Two behaviours that genuinely differ from SQLite are pinned by tests against a real PG 18: claiming takes the oldest queued row with FOR UPDATE SKIP LOCKED (without the clause a second claimer blocks, which the test shows by timing out), and every column behind a Go int is bigint -- SQLite's INTEGER is 64-bit, and the chat issue-number allocator seeds at 10^15, which does not fit an int4.
task db:generate writes the committed postgresdb package; task db:check regenerates it in the gate, as proto:check and ui:check do.
The remaining store methods (events, resources, identities, the status tables) still run on SQLite: porting them is the rest of archie-core-7r0x.2.
stateadmin served read-only PocketBase views over the SQLite task file on -admin-addr. PocketBase is SQLite-only and the State Store moves to Postgres (archie-core-7r0x), so the view goes; operators use a Postgres tool of their choice.
task test runs -short with the test cache on; task test:full keeps the
uncached run. The 50s keepalive proof skips under -short (the deploy
workflow's full go test still runs it). Sleep-bound archied watch tests
run in parallel, and the read-only gate steps run concurrently after fmt
and proto:check. ui:deps is run: once so the parallel UI steps install once.
Two beads, one root: four sites stamped a version and only two of them were CI.
`Taskfile.yml`'s build and `install.sh` derived GATEWAY_VERSION/RUNTIME_VERSION
from `git describe`, so a from-source build claimed a release it was not
running, and the stamp became a function of the commit graph -- the one input a
content-checksum build cache cannot see. An empty commit moved `git describe`
while `task build` reported "up to date" and shipped the previous stamp
(archie-core-pdq2). Both sites now stamp `dev`: a source build says so, and the
version a release carries is written into the artifact CI publishes. That
removes the non-file input rather than caching it, and traceability for a local
build is the checkout it came from.
`deploy.yml` published `:latest` from any push to main, so a release's own
stamping survived only until the next ordinary commit -- minutes, in an active
repo -- and a host deploying :latest reported dev, leaving the update path
unable to tell current from stale (archie-core-i5nb). `:latest` now moves only
from a commit that IS a release; every other build publishes `:edge` (mutable,
newest main) and `sha-<commit>` (immutable). A host that runs releases follows
`:latest`; a host that tracks main follows `:edge`, which RELEASING.md now says.
Verified: `task build` reports `archied dev`; the new workflow test fails
against the old workflow on all five guards and passes after; deploy.yml
parses; install.sh passes `bash -n`.
Gated with `task check` (exit 0) at 8faa0f6a -- the v1.39.0 base, CI-green --
with these five files applied. It is NOT gated at HEAD: HEAD carries an
unrelated red, `TestTaskProtoCarriesEveryDomainField`, because d6f61c2c added
ParkClass and RemediationRounds without the proto mapping. This change neither
causes nor fixes that.
The index built google/codesearch over the chat workspace on every daemon
start, for the process lifetime, through a child-process helper and a
SQLite metadata DB -- and grep consulted it only for searches confined to
the workspace root, which the analysed sessions showed was a small
fraction of searches. The compute was continuous; the benefit was not.
Removes internal/indexing, the workspace-codesearch helper subcommand,
the [indexing] config section, and the GrepIndex accelerator seam from
the grep tool, which returns to its direct walk. google/codesearch
leaves go.mod with it.
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.
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.
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.
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.
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.
Five files named a specific host's service and the port it holds as the
reason a deployment might move the state store's listen address, including
config.example.toml, which ships to every operator. The guidance keeps its
point -- move the listen/target pair together when a port is already taken
on the host -- without naming a service the reader may not run, or have
heard of.
Also corrects the Taskfile's dev-stack summary, which still described the
state store as binding 127.0.0.1:9090. deployments/dev.toml pairs it with
9091, and has since the pair became configurable, so the comment described
a stack that does not start.
The build task's only sources were **/*.go, go.mod and go.sum, while
ui/embed.go embeds the committed bundle with //go:embed all:dist. Task's
up-to-date check is a content checksum over files, so a change to ui/dist
-- including the one `task ui` writes in place -- left the task "up to
date" and the previously embedded dashboard in every binary.
Measured on this worktree, appending a byte to ui/dist/index.html:
git status M ui/dist/index.html
task build task: Task "build" is up to date
grep <marker> bin/archied 0 <- stale asset shipped
With ui/dist/** listed, the same probe rebuilds all six binaries and the
marker is present; a nested asset (ui/dist/assets/index.css) does too.
Reverting the probe rebuilds again, and a second build with nothing
changed still reports "up to date", so the content cache is intact.
touch-only changes do not retrigger, confirming the check is on content
rather than mtime.
deployment_contract_test.go gains a bounded test over the build task's
sources block, the shape the neighbouring fmt assertion already uses.
The version stamps in the same task stay out of reach of a file checksum:
git describe moves with HEAD while no file content does, and the git
metadata is not addressable from a worktree, where .git is a file. That
needs a status/stamp design decision, so it is split to archie-core-pdq2.
One go fix pass applies each fixer once, to the parse it started with, so a
rewrite made by one fixer is only fixed up by the next pass: stditerators
turns `for i := range t.NumField()` into a field iterator that copies its
loop variable, and forvar deletes that copy on the following pass. A single
pass therefore left the copy behind for copyloopvar to reject, and no
fmt-then-lint sequence healed it. task fmt now applies passes until a dry run
reports nothing left to fix, and fails loudly instead of handing the lint
step a tree it must reject.
deployment_contract_test.go pins the fixpoint proof rather than the old
single-invocation literal.
golangci-lint ran ./... from the repository root, which stops at the root
module, so the tools module was never linted and had drifted unseen. task
check already closes this hole for tests with test:tools; lint now has the
same shape in lint:tools, which runs in the tools directory rather than
passing a path prefix that only rewrites output paths.
Fixes the six issues that had accumulated behind it:
stripJSComments was 21 cyclomatic complexity against a cap of 15, with the
comment-skipping and literal-copying loops inlined into one scanner. It is
four named functions now, and the De Morgan warning went with the rewrite. It
had no test despite deciding whether a commented-out call reads as a live
consumer, so it has one: literals that look like comments, comment markers
inside strings, escapes, and unterminated literals and block comments.
docsgen's missing-artifact error ended in punctuation, and three test type
assertions were unchecked, which panic rather than fail when the generated
artifact does not have the shape the case assumes.
A PRD states a decision, a requirement, a constraint or evidence. Those
survive the code moving underneath them. A line number, a progress report or
a dated status claim does not: it is true on the day it is written and
silently wrong a month later, while still reading as authoritative.
prdlint rejects five shapes: file:line citations (including a document citing
its own line numbers), dated status claims, progress reports on the work
being designed, phase-completion narration, and records of how a finding was
produced. Each finding names the file, line, rule and fix.
The rules target decay, not subject matter. A PRD may describe a phased plan,
name a dependency that exists, and carry its own Status and Date header
fields; what it may not do is assert the state of the tree on the day it was
written. Fenced blocks are skipped, since a listing may specify a line
reference as its literal content.
Wired into task check next to docs:check. A sweep alone would not stop the
class recurring.
Posts to /webhooks/capture/{source} with a realistic GitHub, Sentry, form or
large payload (or an exact body), reads the capture back so a silent drop is
visible immediately, and names the intake's rate and size limits when it
hits them. Wired as task webhook:send.
Sam owns this codebase and reads Vue fluently, not Preact; a UI its maintainer
cannot read is the liability that outweighs the port. shadcn-vue is Vue-only,
so adopting it means the framework moves with it.
Scaffolded per the official Vite guide: `npm create vite --template vue-ts`,
Tailwind v4 via @tailwindcss/vite, `shadcn-vue init` (Reka UI, Lucide, neutral
base, CSS variables). Button and DropdownMenu are added, the latter being what
the pending navigation restructure needs.
Two deviations from the guide, both forced:
- The guide sets `baseUrl` alongside `paths`. TypeScript 6 deprecates
`baseUrl` and errors on it, and this project is heading for TS 7 native, so
`paths` stands alone and resolves relative to the config file. Not a
downgrade: the scaffold's typescript ~6.0.2 is untouched.
- vite.config.ts keeps `base: "./"` and unhashed asset names. ui/embed.go
embeds a committed dist/, served from a path the build does not know;
hashed names would also orphan a file in git on every rebuild.
The Preact app and its 43 test files are deleted rather than ported, on Sam's
instruction: tests return when there is behaviour worth pinning rather than a
port to re-assert. `task test:ui` is now a vue-tsc typecheck, which is what
would actually catch a broken component; an empty `npm test` would pass
vacuously.
ui/src/router/index.ts carries the route table and is the new source of truth
for TestDashboardPagesRegistryCoversEveryRoute, which parsed main.jsx before.
Keeping that contract alive matters: it is what caught the stale /chat entry
earlier today. Every route resolves to a named placeholder view, so an unported
page is visibly unported rather than blank.
golangci-lint now excludes ui/node_modules. The dashboard toolchain pulls in
`flatted`, which ships a Go implementation beside its JavaScript, and the gate
was failing on complexity in a vendored third-party file.
The shadcn MCP server is registered in the root .mcp.json. `shadcn-vue mcp init`
writes it to the directory it runs in, which for a nested ui/ is a path Claude
Code never reads.
* fix: address the Greptile findings on the merged PRs
Four valid review findings from PRs #892, #893, #898 and #899, which were
merged without the comments being read.
- Config.Clone left the new diff-cap pointers aliased (#899, mine). Clone
deep-copies every reference field, including the *bool beside it, so a
clone could write the cap through to the published snapshot. Both the
top-level field and the identity overrides are copied, with the clone test
extended to cover them.
- providerOutcomeRecorder.record could report an older call as the latest
(#892). The completion time is taken before the lock, so two concurrent
calls can reach the lock in the opposite order to their completion and the
unconditional store overwrote the newer outcome. It now keeps the newer,
via a recordAt seam that makes the reordering testable.
- Curator model calls bypassed the recorder (#892). curatorLLMRunner calls
the runtime directly, so a daemon whose only recent model traffic was
curator work reported "no calls attempted yet" while the provider was
demonstrably reachable. It records at its own adapter, and sendChatTurn's
"single choke point" comment is corrected to say there are two.
- A provider error reached /status raw (#892), unlike channel details, so a
multiline or oversized error broke the one-line-per-fact layout. Both now
share one bounded formatter.
Found while fixing the curator path: agentexec.NewRuntime returns nil when no
provider is configured, and a nil *runtime.Runtime panics on its first method
call, so a curator asking for a completion took the daemon down. It now
returns an error, and records nothing -- a local misconfiguration is not a
provider call.
Not fixed, filed instead: the shared lastPollAt masking a stuck identity, the
container max-uptime callback resurrecting teardown bookkeeping, the
dashboard dropping a served-only status filter on cold load, and the route
registry test's line-by-line parser.
* fix(build): drop goimports from the gate's formatter set
`task check` spent 136 of its 167 seconds in `task fmt`, and 134 of those
136 in one formatter: goimports alone over the tree.
golangci-lint's goimports formatter calls imports.Process once per file,
which builds a fresh x/tools ProcessEnv each time, so
internal/imports.getFixesWithSource re-reads modindex.Read($GOMODCACHE) per
file. On this machine that index is 62.7 MiB / 2,081,070 lines (an 11 GiB
module cache), and modindex's in-process memo does not take effect: 3 files
read 187.9 MiB back, 15 files open the payload 15 times. That is ~53 GiB of
I/O and CSV parsing per run, and it is linear at ~155 ms per file (122 files
-> 18.8s, 864 -> 133.8s). Pointing the index cache elsewhere drops the same
command to 3.9s.
The same analyzer runs under `golangci-lint run`, so a cold cache pays it
again: 169s cold with goimports, 31s without -- which is what CI and archied's
own PR gate see, since only `fmt` never caches locally.
Removing it costs no enforcement. gofumpt and gci remain, `task lint` still
reports formatter drift as an issue, and the whole-tree fmt is now 2.2s with
the tree byte-identical. What is given up is goimports' convenience of
adding and removing import lines, which compile errors already cover.
The examples/secret-engines exclusion stays: gofumpt and gci leave those
Yaegi programs alone today, but the exclusion is the stated invariant that a
formatter must not rewrite the imports of files it cannot type-check, and
TestFormattersExcludeInterpretedSecretEngines holds it. Its comment no longer
pins the reason to the formatter that was dropped.
* fix(gateway): stop /status promising and mis-reporting health it cannot see
Two findings from the cloud review of #892.
Title generation no longer records chat-model health. It runs detached after
a first turn under its own 30s bound and its error is swallowed by the
caller, but it shared the process-wide outcome recorder, so a title that
merely timed out overwrote the health line with "failed" -- reporting a
broken provider on the strength of a call no user was waiting for.
The /status command description no longer claims "workers" and "channels".
Neither can render: newStatusHealth reads the container pool and the poll
loop from boot, but the only production router.Health assignment is in
setupGatewayChat, which runs solely in the archie-gateway process, where
neither exists; channels is nil since the Messaging Service took the
front-ends. Only the broker and chat-model lines actually appear, so that is
what the help text now says.
The underlying split -- daemon owns the facts, Gateway owns the Router -- is
filed rather than patched here: it needs either a cross-process health
contract or a ratified two-section /status, not a quick wire-up.
* fix(ui): make the served lifecycle vocabulary actually load
base/task-meta.jsx documents the backend as the source of truth: /api/task-meta
returns the statuses (label, pill severity, "needs you") and the operator
actions, and loadTaskMeta() replaces the freeze-dried defaults with that
catalog. Nothing called it. Every pill, status filter and action control read
the snapshot, so a catalogue change on the server never reached the browser --
the module's first paragraph was simply not true.
main.jsx now asks for the catalog once at boot, alongside the capabilities read
it already does for the same reason: the shell paints immediately and upgrades a
moment later.
The two vocabularies the dashboard mirrors rather than serves -- FILE_STATUS
(ids owned by internal/domain/workflow/task/changes.go) and CONFIG_SCHEMA
(events.ConfigCapturedSchema) -- are now documented as the deliberate second
tier, with their two-sided pins named, so the tree stops telling two stories
about where a vocabulary comes from. Both degrade to a raw id or the verbatim
payload rather than rendering something wrong, which is why mirroring is
tolerable there and not for a presentation catalog.
RED before (loader never called):
x booting the dashboard replaces the freeze-dried vocabulary with the served catalog
actual: 'custom_status', expected: 'Custom status'
Also repairs a drifted LAW asset. A fresh build of pristine main dirties both
ui/dist/assets/index.css and index.js: 4c484887 (#889, memory unification slice
5) changed ui/src without rebuilding ui/dist, and task check runs task ui --
which repairs dist instead of verifying it -- so a stale dist is invisible to
the gate. Rebuilding here restores the invariant; a dist-freshness gate is filed
as follow-up.
* fix(ui,gateway): restore the search focus the port dropped, and the page registry truth
An adversarial review of the port (5787287e) found three things worth acting on.
1. Topbar search -- a regression the port introduced. The el() version focused
the input when the narrow-layout toggle opened it, and blurred it after a
successful jump; the port kept neither. That layout hides the field with
width:0/pointer-events:none until .is-open or :focus-within, so without
focus() the caret was not in the field the operator had just opened, and
without blur() :focus-within left it expanded across the topbar after the
jump. Both calls are back, with the ref they need.
2. dashboard_tools.go advertised a page that does not exist and omitted two that
do. The registry calls itself "the single source of truth for what the
dashboard exposes", but it is a hand-copy of the route table in
ui/src/main.jsx: /memory stayed after the page was deleted (that deletion
also left ui/dist stale -- archie-core-1vhh), and /bindings and /curators
were never added. So the agent could hand the operator a chip to a route that
now falls back to the dashboard, and could not answer "where do I go for
playbook bindings?".
3. TestDashboardPagesRegistryCoversEveryRoute did not test that. It asserted
three hardcoded paths and passed while the registry listed a deleted page. It
now reads the route table back out of ui/src/main.jsx and compares in both
directions, which is what makes the registry's claim holdable. RED before:
route "/bindings" is a dashboard page the registry does not list, so the agent cannot point at it
route "/curators" is a dashboard page the registry does not list, so the agent cannot point at it
registry lists "/memory" (Memory), which is not a dashboard route: the agent would send the operator somewhere that does not exist
Also deletes the dead .chat-page rules the deleted chatPage() bridge left
behind: nothing renders .chat-page any more (chat.jsx renders
.chat-page-content, and the drawer sizes it from layout.css).
Not changed: the unreachable `soon` path, which predates the port and was
reported rather than acted on.
* fix(build): verify ui/dist is fresh instead of never looking at it
ui/dist is committed because the Go build embeds it, so it is a generated
source file. Nothing in the gate read it: task check does not run task ui, and
nothing else compares the bundle with ui/src. So when 4c484887 (#889) changed
ui/src without rebuilding, the committed bundle went on serving the Memory page
whose source had been deleted -- with the gate green throughout.
task ui:check (tools/uidist.sh) rebuilds into a temporary directory and compares,
never rewriting the committed artifact. That is the rule docs:check already
states for the contract reference -- a gate that silently rewrote the artifact
would bless an unintended change with no reviewer ever seeing it -- and it
matters more now that several agents work in their own worktrees, where each
could otherwise pass while producing a different bundle.
Evidence:
fresh tree exit 0, matches
hand-staled bundle exit 1, names the differing file
the #889 drift replayed exit 1, names BOTH index.css and index.js
(pre-#889 bundle, post-#889 sources)
git status after a run unchanged: the check never writes ui/dist
Cost: ui:check declares ui:deps like ui and test:ui do, so the gate runs npm
install once per dependent. Task's sources/generates up-to-date check does not
apply to a node_modules directory (measured: it ran on every invocation), so the
target does not claim otherwise; guarding that is follow-up work.
Gate: task check exit 0, UI suite 230/230, all Go packages ok.
* fix(ui): make the served vocabulary reach an already-painted page
Greptile's finding on the first cut of this fix, and it was right: loadTaskMeta()
resolves after a page has painted and only mutated module state. The route tree
renders into its own root, so App re-rendering cannot reach it, and a painted
page kept the freeze-dried labels it read on the way up.
show() is split so the page render can be repeated on its own: renderRoute()
mounts the current route into the outlet without the teardown/chrome side
effects, and the catalog effect calls it once the catalog lands. The key is
unchanged, so Preact re-renders the mounted page in place and keeps its state.
Deeper instance of the same defect, found while fixing that one:
task-filters.jsx captured the vocabulary in module-level constants at import
(ATTENTION_STATUSES/TASK_STATUSES), so the task filter could never see a served
status, no matter when or how correctly the catalog landed. Both are read at
call time now.
Tests, and what they actually cover:
- the task-filter test has teeth: with the source fix stashed it fails, with
the fix it passes.
- task-meta-late-catalog.test.js guards the boot fetch end to end (it fails
when loadTaskMeta is never called), but it does NOT isolate the re-render:
a page also re-renders for its own reasons, so the assertion holds without
renderRoute too. Said plainly here rather than implied as coverage -- the
fix makes the re-render deterministic instead of incidental, and this
harness cannot tell those apart.
- it lives in its own file because main.jsx boots once per process; a second
test in the same file would assert against a detached tree.
UI suite 232/232, task check exit 0.
* feat(workflow): post line-anchored review comments with suggested fixes
Bead archie-core-q9au (docs/prds/inline-review.md). A review's findings reached
the operator only as a flat list in the PR body, so the author had to map every
finding back to its line by hand and apply mechanical fixes by hand. Now the
line-anchored findings are also posted as inline review comments, carrying a
one-click suggestion when the reviewer could state the fix.
Domain (internal/domain/workflow):
- ReviewFinding gains Suggestion; Validate rejects one on anything but a
confirmed finding, so the agent's record_finding call is refused with
something it can act on. Validate splits into validateAnchor /
validateClassification / validateDisposition, which also brings it back under
the cyclop limit the gate enforces.
- StagePostReviewComments runs after StageOpenPR in the implement workflow. It
posts only line-anchored findings (Line > 0); a whole-file finding has no line
to attach to and stays in the body list, which remains the complete record.
It is best-effort: the PR is open and the body already lists every finding, so
a failed comment is logged, never a park -- the same reasoning as OpenPR's
existing best-effort LinkBranch call.
- The suggestion fence is gated on Verdict == confirmed where the fence is
written, because it is a one-click apply: a wrong suggestion breaks the code
and the author has to notice.
Forge (internal/forge): ReviewCommentWriter + GitHub/Gitea implementations,
type-asserted like PullRequestReader so a forge that cannot is skipped rather
than faked (NoopForge is pinned as not satisfying it). GitHub loops one
CreateComment per comment and joins the failures, so one refused anchor cannot
drop the rest; Gitea carries them on a single COMMENT-state review.
Two deliberate departures from the PRD's sketch, both recorded in it:
- The interface is batch (CreateReviewComments), not one call per comment:
Gitea's only inline shape is one submitted review, and the set then crosses
NATS once instead of once per finding.
- The head SHA is resolved inside each forge implementation rather than by the
caller. The stage runs in archie-agent, which holds no forge credentials and
has no PullRequestReader; the daemon-side forgerpc handler is the only place
that does.
Transport (internal/forgerpc): workflow.Forger gains the method, so the agent
reaches the daemon over the new create_review_comments subject; the server
type-asserts the writer and answers an incapable forge with an error the stage
logs. This is the one proxied method whose absence on an image skew does not
park a task.
The reviewer prompt and record_finding schema ask for a suggestion on a
confirmed, mechanically fixable defect only.
Regenerating the wfextract symbol table -- the documented way a new exported
workflow symbol reaches interpreted stage plugins -- also picked up symbols that
were missing from the committed table (the Status* and Source* constants,
ReviewCheck, Store, Task, and the _Store wrapper). Nil-guards were re-applied to
every wrapper afterwards, as that file's header requires.
Evidence: task check exit 0 (incl. 229 UI tests). Three mutations of the new
stage logic each fail a test that names the behaviour -- dropping the
confirmed-only gate, dropping the Line > 0 filter, and letting a posting failure
escape -- so the tests discriminate rather than passing vacuously.
* fix(build): drop the Dockerfile pin assertion
The guard fetched golangci-lint's go.mod at image build time to fail the build
when GOLANGCI_LINT_VERSION and GOFUMPT_VERSION disagreed. It only ever tripped
on self-inflicted pin drift, but it added a network fetch and a new failure
mode to the release build, which is not where that belongs.
The pins stay correct (golangci-lint 2.13.2, whose vendored gofumpt v0.11.0
equals GOFUMPT_VERSION) and the comment above them still states the invariant,
so the reasoning survives without the build-time machinery. The pin change
itself reaches the agent image through the normal release path: CI rebuilds
and pushes archie-agent on an archie/vX.Y.Z release, and a gateway-only
release deliberately does not.
* feat(workflow): add the remediate workflow for PR review remediation
Implements step 5 of docs/prds/pr-review-remediation.md: a remediate
workflow that resumes the task's existing worktree onto its PR branch
(worktree.Manager.Resume, not Prepare's refresh), runs a builder agent
against the review's actionable comments, commits and pushes to the
same branch, and replies via the forge's ReplyToReview. Task.RetryCount
doubles as the remediation round counter, capped by the repo's
max_retries; the round-cap stage parks the task and posts one comment
when it's hit.
Task gains a ReviewPayload field (JSON-encoded review unit) with full
store/proto/staterpc plumbing. workflow.Forger gains Comment and
ReplyToReview, proxied to archie-agent via a new forgerpc RPC. Resume
and its Dir lookup are added as an unexported optional Trees capability
rather than widening the exported interface, which is already at
golangci-lint's interfacebloat cap and is projected into wfextract's
Yaegi symbol table for repository-authored stage plugins.
The daemon-side reaction consumer that dispatches into this workflow
(subscribing ARCHIE_REACTIONS, grouping comments by review, enforcing
per-task serialization) is tracked separately in archie-core-8li9.4.
* feat(messaging): extract standalone messaging service binary and process composition
* feat(messaging): adapt channel frontends to consume Gateway ChatContract
* feat(messaging): remove in-process channels and Router from daemon bootstrap
Telegram, email and webhook now run only in the Messaging Service, which
reaches this process through the Gateway's ChatContract. The daemon builds
no channel and no gateway.Router, so the wiring that existed only to serve
them goes with it: setupGateways, setupEmailGateway, setupWebhookGateway,
setupTelegramGateway, buildTelegramRouter, makeTelegramReload and the
release-announcement path helper.
The seams those paths owned move to where they can still be honoured:
- Channel ValidateConfig runs in archiemessaging.compose, which now returns
an error, so a configured-but-invalid front-end fails the service rather
than being dropped silently.
- The inbound rate limiter moves to the Gateway process, which owns the only
Router and therefore the only place a per-sender budget applies to every
channel's turns.
- The daemon's gateway readiness probe becomes a ContractProbe against the
Gateway. It cannot observe a channel lifecycle it no longer runs, and a
channel-count probe would have reported every daemon degraded.
- telegramSetup is now chatSetup (in chat_setup.go), trimmed to the fields a
chat turn runner actually reads.
Telegram operator features that were wired only in the daemon (/update,
release announcements, version reporting, SIGHUP reload) are not yet wired
in the Messaging Service: archie-core-8cda.6.6. Channel lifecycle reporting:
archie-core-8cda.6.8. The Gateway process builds no worktree manager, so
review_pr is unadvertised on every channel: archie-core-8cda.6.7.
* feat(messaging): re-wire the Telegram operator surface in the Messaging Service
setupTelegramGateway satisfied eight telegram.Gateway seams from the daemon's
own process. Each is resolved by where the fact it needs is owned, not by
where it used to be built; the decision table is in
docs/architecture/migration-decisions.md.
Wired here: /update (built from this service's own [chat.telegram] check and
install commands), the update-report relay (same sha256(bot_user)[:8] path the
daemon wrote, so a pending report is found rather than written afresh),
show_tool_calls, and /restart's config reload, which re-resolves the token and
allowlist from this service's own file and refuses a reload that resolves to
an empty token.
/version is sourced from the Gateway: ChatSnapshot gains a Version field
carrying the Gateway's rendered build block, read per call and bounded by the
dependency timeout. cmd/archie-messaging deliberately takes no version
ldflags, so it cannot report a partial upgrade as a matched one.
RunningVersions and ReleaseAnnouncements stay nil. Both need a component's
real running version, and the only versions this process can obtain are a
different binary's stamps -- reporting them would manufacture exactly the
false success the update check exists to catch, and the announcer without
parseable versions is a no-op that reads as configured. archie-core-8cda.6.9
carries the contract that unblocks them. Dangerous stays nil: no composition
has ever supplied a command authority.
Enrich is dropped from the update service: componentInstallTypeEnricher read
[nats], which this service must not decode, so the check command's own
reported install type stands.
* fix(workflow): guard inline review comments against head drift
Two findings from the review of q9au.
A comment's line numbers describe exactly one revision of the branch, but the
forge resolved the pull request's head at posting time -- after the review had
already read the worktree. A push in that window (a collaborator, a retry) meant
the findings were anchored to whatever now occupied those lines, mislabelling
instead of failing. The revision the review measured now travels with the
comment set: OpenPR records it from the same worktree read it already performs
(TaskContext.ReviewedHeadSHA), StagePostReviewComments threads it through
Forger to forgerpc, and the forge refuses the whole set once the head it reads
has moved off it -- which the best-effort stage logs, the PR body remaining the
record. An unmeasured revision posts unverified rather than dropping every
finding, so a worktree that cannot report one degrades instead of regressing.
Suggestion was documented single-line only, because GitHub applies a suggestion
fence up to its first line and a multi-line replacement would silently corrupt
the file. Only the verdict was validated, so a multi-line suggestion reached the
renderer and posted as that truncated fence. Validate now rejects an embedded
newline, which makes record_finding refuse it with feedback the model can act on
instead of the reviewer discovering the corruption later.
`task lint` enables gofumpt's `extra-rules`, so it demands `func f(a, b int)`
where `task fmt`'s bare `gofumpt -w .` left `func f(a int, b int)` alone --
and `task fmt` is the documented repair for a failing gate, so a contributor
had no command that could satisfy `task check`. That is the same failure shape
as the version drift fixed alongside it, one layer up: fmt and lint are not
the same formatter, so only the rules they happen to share are safe.
`-extra` matches `extra-rules`, and nothing reformats as a result: the tree is
already clean under it (`gofumpt -extra -l .` is empty).
Still open, filed as archie-core-q288: gci's custom-order places archie-core
imports last where gofumpt sorts them alphabetically, so `task fmt` can still
produce formatting it will never fix. That needs a decision about which
formatter owns formatting rather than another flag, and it is a decision CI
cannot currently surface at all -- the deploy gate never runs golangci-lint.
reachaudit classified whole unreachable packages but explicitly skipped
findings inside packages already in the cmd closure ("reported separately
as live-package findings" -- never implemented). That's the more common
half-built-feature shape: the package ships, one symbol at its call site
doesn't (crondelivery.ChatCourier, eda/playbook.Store.Dispatch,
gatewayrpc.StoreClient). Add a second in-package-* report section using
the same tracked/untracked/dynamic classification. Also wires the --md
flag, which was accepted but never written.
Both gRPC listeners took their bind address from a -listen flag default alone,
with no config key. The port a service binds and the port its clients dial were
therefore two separate facts -- the flag default, and [services.<name>].target --
with nothing keeping them in step.
On a host that already owned the default the effect read as a code fault rather
than a port collision: the store died with "bind: address already in use" while
every client reported "state store: connection error ... error reading server
preface: EOF". Cockpit binds 9090 by default, so this is not hypothetical.
Verifying the dashboard on such a host needed a hand-written overlay plus a
matching -listen, two things to keep in step by hand.
- [services.state].listen and [services.gateway].listen now name the bind
address. Precedence is -listen, then config, then a default applied by the
loader. An empty result is a startup ERROR, never a fallback: net.Listen reads
"" as "any free port", so defaulting there would bind the service somewhere no
client looks and still report success.
- Both flag defaults become "" so configuration can win, mirroring how archie-ui
already prefers [web].listen over its flag.
- Gateway listen defaults to the same constant as the gateway target, so a
default deployment's client and server cannot drift onto different ports.
[services.state].target still has no default: an empty target stays a startup
error in the daemon and gateway, which no longer serve a local store.
- ServiceConnection gains the field. Its doc now says clients read only Target
and TargetToken, and Listen belongs to the process that owns the service --
the previous wording claimed the struct starts no listeners while carrying one.
- deployments/dev.toml states each port once, beside the target it must match, so
`task dev` is retargetable on a host that owns 9090 by editing one overlay.
Tests. Unit: config defaults, explicit values, and precedence. Process: the
existing real-process smoke test now takes its listen from configuration instead
of -listen, so the end-to-end wiring is proven by the test that already starts
the binary, with no extra process. Both were verified load-bearing by mutation --
inverting the precedence fails the unit test, and making the app layer ignore
config fails the process test with "state: no listen address".
Verified: task check exit 0. Also documented in config.example.toml, the
configuration architecture table, and the `task dev` summary.
Adds an mkdocs.yml, a landing page, and `task docs:site` / `task docs:serve`.
Deliberately hosting-agnostic: MkDocs is the same input Backstage TechDocs
consumes, so choosing where this lands later costs nothing.
exclude_docs holds back four subtrees, since everything under docs/ would
otherwise be published. archive/ is superseded design and would compete with
the current architecture for a reader's attention; inspiration/ discusses
other products by name; prds/ are open decisions rather than settled design;
github-token.md is credential setup. One PRD is let back through because
architecture/migration-decisions.md links to it three times, and a page
excluded out from under a live link is just a 404 with extra steps.
No nav block. MkDocs derives it from the directory layout, so a new page
under docs/architecture/ publishes without a second edit, and there is no
hand-maintained tree to drift against the repository.
Builds --strict, so a dead internal link fails rather than ships.
Add `task deadcode` (whole-program RTA from ./cmd/...) and `task reachaudit`
(the existing classifier on top of it). Neither joins `task check`: both
report a standing backlog, so gating on them fails every run until that
backlog is zero, same as `task vuln`.
`task deadcode` shells to `go run ...@latest` rather than a local binary on
purpose. A deadcode built against an older Go than this module exits non-zero
and prints nothing, which reads as "no dead code" instead of "analysis
failed" -- the locally installed copy was built against 1.26 against a 1.27
module and had been silently reporting an empty tree.
reachaudit had two traps that made it answer confidently from nothing:
its --repo default pointed at a path that does not exist on either machine,
and it reused /tmp/reachaudit-deadcode.txt with no staleness check, so it
would serve a previous tree's analysis indefinitely. Key the cache on HEAD
and refuse it outright when the tree is dirty.
Also lands the design for tools/symbolrefs, the type-resolved reference
index that covers what reachability cannot: RTA treats every address-taken
function as live, so every reflect.ValueOf entry in the *extract tables
launders a dead symbol into a reachable-looking one, and deadcode reports
functions only, leaving dead package vars unrepresentable.
Closes#855 (archie-core-5gzx).
The check mode added in the preceding commit had no caller, so it prevented nothing: a
stale contracts.json still passed every gate. This wires it in and makes
drift fail the build.
- `task docs:generate` writes the committed artifact.
- `task docs:check` verifies it, non-destructively.
- `task check` runs `docs:check`, right after `proto:check`, so both
generated-artifact surfaces are judged the same way in the same place.
The check cannot be satisfied by rewriting: it generates into a temporary
directory, so a failing gate leaves the artifact exactly as it found it and
the author applies the regenerated bytes. That keeps the regenerated diff
reviewable in the same commit as the code change that caused it, which is
what Step 9 of the architecture document requires and what a CI auto-update
would quietly bypass.
Documents that called this gap open are updated rather than left to
contradict the code:
- `generated-documentation.md` Step 8 (no `docs:*` task exists -> both exist),
Step 9 (drift is gated locally, not in CI), and the hook/CI policy (rule 3
is now enforced by the gate; rules 1, 2, and 4 still rely on the author,
since nothing observes a commit).
- `contract-conformance-audit.md` gap 1, now closed.
- `config-example-drift.md` item 3, which asked for exactly this wiring.
- `CLAUDE.md`, whose `task check` description listed neither `docs:check`
nor `test:tools`.
- The build, docs, and diagnostics skills, plus a re-baselined diagnostics
snapshot: the `task_docs` delivery surface went 0 -> 6 and the `tools`
module 4 -> 7 now that the tasks exist.
Verified with `task check` (green), including the new `docs:check` step.
Six tests asserted on the wording and formatting of source and config files
rather than on behaviour: four injected text into fixtures and checked that a
regex noticed, and two asserted on api.jsx's contents. They break on an extra
space, a newline, a rename, or a comment that merely mentions the token -- the
single-fetch check had already false-positived on a comment, and I patched it
with a comment-stripper instead of deleting it. A test that cannot tell "the
code is wrong" from "the file is formatted differently" tests the wrong thing,
and the maintenance cost is permanent.
Deleted: tools/contractaudit/negative_test.go in full, and the source-scanning
"api.jsx holds exactly one fetch call" check with its stripComments helper. The
dashboard suite still asserts the browser mutation contract behaviourally, per
method, by inspecting the request each one makes -- which is where the real
defect was found. 142 UI tests pass; the 45 methods remain fully covered by the
two inventories and the completeness check.
The tool's own decoding is now testable without a file: parseDeclarations takes
an io.Reader, so its rules are exercised with in-memory input, and only the
absent-file branch still touches a path (which is never created).
contractaudit is no longer part of task check. Its surfaces are discovered by
scanning source text, so a rename or reformat elsewhere can change its output
with nothing actually wrong -- it reported 16 live routes as unconsumed once,
when the dashboard's request helper was renamed. A check that can fail for
reasons unrelated to what it measures must not be able to break a build. It now
matches tools/reachaudit: advisory, run by hand, --strict available on request.
Also removes five unused indirect requires from tools/go.mod (go mod tidy).
They were residue from the reflection-based first implementation of the RPC
scan, which was replaced by text scanning without tidying. -mod=readonly cannot
catch a superfluous require, so nothing would ever have found them.
Rewrites docs/prds/contract-conformance-audit.md, which claimed RPC coverage was
derived by reflection over the exported client type -- it never was -- listed
surface sizes of 43/12/52 against real counts of 45/21/49, described three
classification classes where the code has four, invented a five-surface Shape
with files that were never written, and blamed raw fetch calls for a 401 defect
that did not exist. Each false claim is now recorded in an errata section rather
than quietly dropped, and the document states plainly that the audit has found
nothing actionable: the 415 refusals and the duplicated client plumbing were
both found by reading the handler and reproducing the request.
Testing rule added to the document, since this is the second time: assert on the
observable effect, never on the content or formatting of generated or
hand-authored text and config files.
dev:daemon, dev:dashboard and dev:state-store all pass
`-config-overlay deployments/dev.toml`, which is what sets
[services.state].target = 127.0.0.1:9090. dev:gateway did not, so under
`task dev` the gateway dialled whatever the developer's installed
~/.config/archie/config.toml named, or failed to start in a fresh checkout,
while the other three processes used the dev store the task summary itself
describes.
No automated test accompanies this: asserting it would mean reading
Taskfile.yml's text, which is the source-coupling class the tracker already
files as test-coupling-6/-7. The change is a config value, verified by
inspection of the four dev processes.
Reachability (tools/reachaudit, epic archie-core-06ag) answers "is this code
in a shipped binary?". It cannot answer the complementary question: "does
every declared contract surface have a consumer, or a declaration that it
has none?". ratelimit was in the binary closure and called by nothing, which
reachability could not see.
tools/contractaudit classifies each subject of each declared surface as
CONSUMED, DECLARED-UNCONSUMED, UNDECLARED-UNCONSUMED, or STALE-DECLARATION,
and only the last two are findings. The declaration allowlist must match
reality exactly: a missing entry fails and so does an entry that outlived
its subject, because a stale allowlist is how a gate quietly stops checking
anything.
Surfaces: the two gRPC services, whose consumption is derived by scanning
adapter bodies for calls through the generated client, and the dashboard
HTTP API, matched between the registerXRoutes call sites and the path
literals the bundled client calls.
Findings on the current tree, all deliberate and now declared:
ListCaptures and ListUndispatchedCaptures are superseded by their streaming
variants -- staterpc's client calls StreamCaptures -- so no production
client reaches the unary RPCs.
Three bugs this tool found in itself, each recorded because each is the
class of error that makes a conformance check worse than none:
- Joining RPCs to adapter methods by name silently reported live RPCs as
unconsumed, because adapters do not map one-to-one: StoreClient.Get calls
GetSession, List calls ListSessions.
- Reflecting over the client value rather than the pointer reported zero
methods, hence the whole surface unconsumed.
- Treating the asset mount and the health probes as dashboard API routes
reported four healthy routes as undeclared; they have different consumers
and are out of scope for this surface.
The consumer extractor fails loudly on a call shape it cannot parse rather
than under-reporting, and every check is negative-tested: a route, an RPC,
and a removed consumer are each injected, confirmed to fail for the right
reason, and reverted. The declaration staleness rule is tested too.
Advisory when run directly; task check runs it -strict. See
docs/prds/contract-conformance-audit.md.
Nothing in the delivery gate entered tools/, so its dependency drift was
only ever discovered by a command that silently repaired it, dirtying the
tree with an unrelated diff. task check now runs test:tools.
-mod=readonly is passed explicitly on every documented tools command: a
developer's global GOFLAGS=-mod=mod in go env overrides the toolchain
default and re-enables the rewrite.
Also corrects the archie-build-and-env coverage table, which claimed task
check omits task lint.
Bead archie-core-8cda.5.5:
- task dev now runs archie-ui (dev:dashboard) on :8484 -- after the
cutover archied binds no dashboard listener, and Vite's /api,/events
proxy needs a live receiver there. dev:mobile starts archie-ui with a
LAN bind and -token-file (reusing the pre-cutover token path) instead
of a mobile archied overlay; dev:ui's summary points at archie-ui.
- deployments/dev.toml documents itself as the archie-ui overlay and
states the [services.gateway] target explicitly.
- systemd-user-service.md: the auth gap is now the documented posture --
archie-ui has no secret registry, resolves GATEWAY_TOKEN/
STATE_STORE_TOKEN from its process environment only, so the starter
(EnvironmentFile) exports them; worked env-file example added, plus
/healthz as the token-free liveness probe.
- INSTRUCTIONS.md ships five binaries with archie-ui in the quickstart
and the token story; README.md carries the auth note; the
docker-nats-stack profile notes archie-ui binds [web] and dials the
same [services.*] targets.
- release tooling: archied's component closure extends with
cmd/archie-ui and internal/app/archieui, so a UI-process-only commit
can no longer fall between the two changelogs; RELEASING.md documents
that the UI Service ships inside the archied release.
Add cmd/archie-ui and internal/app/archieui: a second composition root that
serves the dashboard and the compiled SPA against the two contracts the daemon
already dials, so the UI stops needing the daemon's in-process objects.
The composition root lives outside internal/app/archied deliberately. That
package pulls 88 internal packages (daemon, forge, containers, NATS, secrets,
workflow); reusing its boot the way RunGateway and RunStateStore do would make
the PRD's deletion gate unreachable. archieui links 41, and cmd/archie-ui 42.
Configuration ownership follows docs/prds/ui-service-boundary.md: the process
reads the shared file, but only [services.gateway].{target,target_token},
[services.state].{target,target_token} and [web].{listen,
trust_forwarded_headers}, with flags taking precedence. Options has no field
for anything else in that file to land in, and no config.Holder.
compose() sets only the contract-backed and process-local fields. Every daemon
runtime handle stays nil on purpose and its route degrades through the
existing 501/503/empty paths. Captures, CaptureLimiter and BindingDispatcher
are withheld for the duration of the seam: the daemon's dashboard still serves
POST /webhooks/capture/{source}, and two intakes are not permitted.
Readiness is the UI's own registry over its two dependencies via a new bounded
readiness.ContractProbe. The existing GatewayProbe was unusable here: with no
channel manager to inject it reports "no gateway channels configured", i.e.
permanently degraded.
The State Store's fail-closed non-loopback rule and the two dial paths move to
staterpc.Dial/TargetIsLoopback and gatewayrpc.Dial, so the server side and
every client share one implementation instead of three copies.
The Gateway remains loopback-only with no auth interceptor, so this process is
scoped to being colocated with it; filed as archie-core-juqx.
Refs: archie-core-8cda.5.2
Closes six review findings against .4.6 (PR #775):
- daemon.StateStoreGrantIssuer + staterpc.TaskGrants: containers get a
per-task credential authorized only for their own Update/Transition/
InsertEvent, never the daemon's administrative token. Issued before
Acquire, revoked on Release; fails closed if no issuer is wired.
- StreamCaptures/StreamUndispatchedCaptures: new streaming RPCs so a
batch of large capture bodies can't exceed gRPC's 4MiB unary cap.
The original unary RPCs are kept, unmodified (deprecated) rather than
reshaped, so buf breaking stays green for an in-flight rolling deploy.
- Update rejects a nil Task with InvalidArgument instead of panicking in
the store layer.
- RequireHostGateway only forces on for embedded NATS, so an externally
reachable NATS/State Store no longer requires a local Docker bridge.
- Client-side token resolution now matches the server's (target_token,
then STATE_STORE_TOKEN secret/env).
- task dev now runs archie-state-store (dev:state-store) alongside
archied/archie-gateway/vite; deployments/dev.toml points them at it.
archie-gateway is now the sole owner of ChatContract; the daemon always
dials it over gRPC for webui chat, no in-process fallback left. Telegram
and email keep their own in-process routers unchanged (their streaming
responder is a callback that can't cross the wire-safe contract).
- composeChatContract only accepts mode="remote"; config defaults
Services.Gateway to remote + 127.0.0.1:8585 when unset
- deleted taskActionsActor (dead code once the local branch is gone)
- task dev now launches archie-gateway alongside archied + Vite
Verified end-to-end: archie-gateway + archied booted against a shared
NATS/store, webui's /api/chat/sessions round-tripped through the gRPC hop.
Baseline `task check` failed on a clean main checkout, blocking unrelated
in-flight work. Fixes only those pre-existing failures:
- bootstrap.go: extract wireWebStoreSurfaces from setupObservability
(cyclop 16 > 15) and startEmbeddedNATS from connectNATS (nestif).
- telegram_setup_test.go: os.Setenv -> t.Setenv (usetesting).
- install_script_test.go: exec.Command -> exec.CommandContext with
t.Context() (noctx).
- Taskfile: add a ui:deps install step shared by `ui` and `test:ui`.
ui/node_modules is gitignored and nothing in the gate installed it, so
`task test:ui` died on a missing jsdom rather than a real test failure.
- shutdown_watchdog_test.go: `go fix` output adopted verbatim.
Refs bead archie-core-14cs.
Sam's explicit requirement: the definitive gate should catch lint
regressions, not just fmt/vet/build/test. Immediately surfaced real
debt on the first run -- see follow-up beads issues.
Fourth slice of docs/prds/eda-playbook-engine.md (t2db.12): the design
doc's pre-merge collision layer, as a gopls-shaped standalone binary
(cmd/archie-playbooks) rather than a Taskfile wrapper -- one binary, one
schema source, mode-based entrypoints.
- cmd/archie-playbooks: subcommand dispatch table from day one (lint now;
an lsp/serve mode later slots in without restructuring), flag parsing
only per organisation.md's cmd/ rule.
- internal/app/archieplaybooks: the lint mode's composition -- collects
directories, calls workflow.LoadPlaybookDirs (the daemon's own loader),
reports findings. No second validation path: the linter agrees with
runtime startup validation by construction.
- Reuses LoadKindWorkflowsYAML/LoadLabelWorkflowsYAML/LoadPlaybookDirs
directly; collision/malformed/invalid bindings exit non-zero.
- Known limitation recorded: findings are file-granular, not
line-granular (yaml.Unmarshal into map discards line numbers; a
file:line diagnostic needs a yaml.Node upgrade, out of scope here).
- Taskfile lint:playbooks target; PRD records the shipped shape and the
file-granular caveat.
-X main.gatewayVersion/main.runtimeVersion targeted package main, but
those vars live in internal/app/archied (cmd/archied is a thin
wrapper). An -X target that doesn't exist is silently ignored by the
linker, so every archied binary this shipped -- task build, install.sh,
Dockerfile.archied, and the carina self-update script -- reported
"dev" instead of its real version. Point every one of those ldflags at
the actual package.
Also, while chasing the carina incident this surfaced:
- restart.go: /restart didn't check for an in-flight /update install.
The install runs as archied's own child process, so a restart killed
it mid-build (observed: "signal: terminated") instead of letting it
finish or fail cleanly. Refuse the restart while updateInProgress.
- update.go / update_report.go: the "no version could be confirmed
running" branch still opened with "Update complete", contradicting
its own next clause. Reworded so an unverified outcome isn't
reported as completion.