Commit Graph
1323 Commits
Author SHA1 Message Date
sam 2e172c679c fix(webui): bind the capture pane to the list it sits beside
The pane was capped against the viewport, which let it grow taller than the
box it lives in on a short list -- and a sticky element taller than its
container is a sticky element that cannot stick. It is now capped by the
list's own measured height and by the room the window has, whichever is
smaller: both are sizes the pane does not influence, so filling the cap
cannot feed back into it. Stacked, where there is no sibling to be bound by,
the panel caps itself at 62vh the way the task log does, so one large
payload is a scrolling payload rather than a ten-thousand-pixel page.
2026-09-21 01:22:22 +10:00
sam 03a2d86f9b fix(webui): read a capture beside the list, not over it
The capture detail was the app's only sheet: it covered the list it was
opened from, had to be dismissed between rows, and held no address. It is
now a pane that sits with the list -- sticky and internally scrolling on the
wide layout, stacked under the list below 1100px, where selecting scrolls it
into view. The selection rides in the URL (?capture=N) with replace, so a
capture survives a reload and can be linked, and a page opened without a
selection shows the newest event rather than an empty box.
2026-09-21 01:17:04 +10:00
sam 2c3a47de68 feat(tools): a capture-intake sender for exercising the Events surfaces
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.
2026-09-21 01:10:30 +10:00
sam 943d02cbfc fix(webui): stuck log reads surface as errors, not eternal loading
A keyed read whose request never settles pinned the panel's loading line
forever; after a quiet minute the read is declared broken so the retry
button appears, and the started-dedupe is released so it can run again.
Also drops the download button from the log's empty state -- a log with
nothing recorded has nothing to download -- and the leftover imports from
the empty-state cuts.
2026-09-21 01:05:37 +10:00
sam a4e1df2399 fix(webui): let the empty state say no capture once 2026-09-21 01:01:17 +10:00
sam 84b2ff0a26 chore(webui): rebuild dist 2026-09-21 00:56:30 +10:00
sam 050f833a23 fix(webui): stop empty states re-deriving their own titles
A title that states the fact does not need a description that derives it:
the log, panels, lifecycle lists, dashboard cards, stages, skills and
captures empty states now say the fact once, and keep only the
descriptions that carry an action, a cause, or a distinct reading.
2026-09-21 00:56:24 +10:00
sam 578c0f5a2d fix(webui): drop the log filter labels and the empty-stage explainer
The selects' first options already say All levels / All stages, so the
uppercase captions restated them; the screen-reader names stay. The
no-stage-names notice restated the filter's obvious emptiness and is gone.
2026-09-21 00:51:29 +10:00
sam 4732ed166e fix(webui): use appearance page width 2026-09-21 00:46:50 +10:00
sam 793864c682 fix(webui): four-column appearance grid on wide screens 2026-09-21 00:46:28 +10:00
sam 0a6eedc928 feat(webui): refine system navigation and appearance 2026-09-21 00:45:02 +10:00
sam 042fdef671 fix(webui): settle the run page head around the attempt pager
The head strip breaks into a full-width control row -- Back, Refresh, and
Start a new run on the left, the forge coordinates pushed to the far edge
-- and the meta row pairs the lifecycle badge with the attempt pager, which
rides in from TaskMetaBar's slot. TaskMetaBar narrows to the served status
badge; the forge links move out of it into the control row where the other
navigation lives.
2026-09-21 00:43:41 +10:00
sam 7102c7e6a2 fix(webui): hide the attempt pager for zero or one attempt
A one-page pager is the old text fact wearing extra chrome. The URL still
names the attempt and the panels show it.
2026-09-21 00:27:19 +10:00
sam 6dff1245a3 feat(webui): make attempts a pager above the tabs
The attempt selector becomes an icon-ended pager from the registry
pagination primitive: chevrons walk run history, numbers land on an
attempt, and the active page is the attempt on screen. It sits top-right
above the tab card, and the meta line loses the attempt text fact since
the control now carries it.
2026-09-21 00:25:54 +10:00
sam d188074ad4 fix(webui): strip the task detail page to one head strip and honest states
The page stacked five chrome strips before its content and every state
wrote an essay. The head is now one strip -- title, workflow, actions, a
single meta line -- the retry explainer is gone (the confirm dialog already
carries the commit-discard consequence), and empty states say the fact in
the title without a paragraph re-deriving it.
2026-09-21 00:10:19 +10:00
sam 799a7a8249 fix(webui): deepen the primary violet and give links their own tint
The bright violet passed the contrast ratio on paper and failed in the
hand: black-on-purple vibrated at button and FAB sizes. The primary surface
is now deep enough for white labels, and link text on the canvas uses a
dedicated lighter tint, since one violet cannot be both a dark-enough
surface and a light-enough text colour. Also drops an empty-state
description that restated its title.
2026-09-21 00:10:10 +10:00
sam a855573b12 feat(webui): add a command palette, live tasks, and a11y fixes
Ctrl/Cmd+K opens a palette over the capability-gated nav entries; the tasks
board refreshes from the shared event stream; config tooltips are
keyboard-reachable; live activity announces politely; and missing event
timestamps render an em-dash instead of a fabricated now.
2026-09-20 23:38:57 +10:00
sam b9c005fb93 fix(webui): make task actions and dangerous approvals deliberate
Task rows render one primary control with the rest in an overflow menu
instead of every catalog action at once; dangerous-action approvals and the
daemon-restarting install confirm by name; the Needs-you tile reads the
served attention statuses instead of a hardcoded pair; and dangerous.go
stops calling the 24-hour approval permanent.
2026-09-20 23:38:57 +10:00
sam 74f0aadc70 fix(webui): cut redundant tails and restating descriptions from copy
Empty states and card descriptions no longer explain the consequence the
main clause already implies, page descriptions match between the router and
the chat page-index tool, and the Appearance cards lose descriptions that
restated their controls.
2026-09-20 23:38:57 +10:00
sam 103392c555 Merge pull request #956 from samcharles93/feat/vue-shadcn-migration
Feat/vue shadcn migration
2026-09-20 23:11:43 +10:00
sam 7013ef9ce4 fix(webui): stop menus locking the page, and make tooltips optional
Two things reported from use.

The topbar dropdowns shifted the whole page on click. reka's DropdownMenu is
modal by default, which locks body scroll; losing the scrollbar widens the
layout by its width (measured: 15px at 1440), so everything moved sideways. It
also blocked clicking the page while a menu was open. Non-modal is now the
default for every dropdown, not just the nav's: a menu is not a dialog.

Hover descriptions became a preference on /system/appearance, applied in the
Tooltip primitive so a tooltip added later honours it without each call site
remembering. On by default; nothing depends on a tooltip to be usable.

Appearance also lost its duplicated copy: the page, its first card, and that
card's field each said "Appearance" or "Theme" in turn.
2026-09-20 20:18:48 +10:00
sam e9a1eb8ac2 feat(webui): scroll the chat transcript with MessageScroller
The transcript scrolled itself with a watcher that set
`scrollTop = scrollHeight` on every new message and streamed token, reaching
into ScrollArea's internals through `[data-slot="scroll-area-viewport"]` to find
the element that actually scrolls.

That follows the tail and nothing else. It has no notion of the reader having
scrolled away, so every streamed token yanked them back, and no way down for
someone who had deliberately scrolled up.

shadcn-vue's MessageScroller is the component for exactly this, so the surface
is composed from it instead: the provider owns autoscroll, the viewport reports
its edges, the content is a `role="log"` region, and the item carries the scroll
anchor. It buys the part the watcher could not express: once the reader
scrolls, autoscroll stops rather than fighting them, and a "Scroll to end"
button appears.

Verified in the browser: at the tail the root reports `data-scrollable="start"`
and the button is inert; after a wheel scroll it reports `data-scrollable="end"`,
autoscroll disengages, and the button is visible at opacity 1 and reachable. A
programmatic scrollTop does not count as intent, which is right: autoscroll
reclaims the tail unless a person asked for something else.
2026-09-20 20:08:00 +10:00
sam 8e91ccb76d feat(webui): port the dashboard (Phases 3-5)
Every page from the deleted Preact dashboard, rebuilt in Vue 3 + shadcn-vue.
The navigation restructure landed earlier on this branch; this is the surfaces
behind it, and the two are now one app.

Dashboard, Tasks (list and detail), Configuration split six ways, Logs,
Inspector, Mappings, Bindings, Workflows, Skills, Curators, Channels, chat.

Components, not files: docs/prds/dashboard-port-brief.md requires one
component, one job, one file, with shared state in a module beside it. So a
page file composes and holds nothing, and a shape repeated across panes becomes
its own component (LogRow, PageHeader, PanelLoading, WorkflowBar).

Behaviour that had to survive, because each was a fix:

- Live activity's detail is clamped to one line with the payload on the title.
  Unclamped, one row made the dashboard 7,481px tall.
- Each health card takes its own height. Equalising left a mostly-empty box
  taking a quarter of the first screen once setup was done.
- Tasks: `tab`/`attempt` live in the query string and are written with
  router.replace, so a tab click adds no history entry and does not remount.
  The list's deep-link reveal honours prefers-reduced-motion.
- LOG_LEVELS is a wire contract (the server matches that CSV server-side), used
  unchanged by both log panes.
- The chat panel's Phase 5 list: a FAB that is the only toggle, a morph whose
  scale, radius and position interpolate together, no scrim, no close button,
  Escape returning focus to the launcher, Stop only while streaming.
- Unconfigured is not broken. A 501 on /api/version or the log stream renders
  what is true ("Not configured on this deployment") rather than blank, and a
  read-only Configuration says so instead of offering controls that cannot work.

Three things the port decided rather than carried:

- Button gains an `attention` variant and Badge the five status tones, in the
  project's own cva. The pill's dot did not come across: the Badge's shape is
  the affordance, and the same tone now covers a trend indicator.
- The icon module is not ported. Its name-to-glyph lookup is the pattern
  shadcn-vue's rules call out as wrong, so icons come from @lucide/vue at the
  call site. The five bespoke glyphs have no consumer yet and become components
  if a page draws them.
- The theme control left the topbar for /system/appearance, per the approved
  navigation design. ThemeToggle.vue and Placeholder.vue are deleted rather
  than orphaned: every route now resolves to a real page.

Also fixes the bundle freshness check failing on the first build after every
change. ui/dist is committed, so nothing ignores it and Tailwind's content
detection scanned it, making each build an input to the next.
2026-09-20 20:04:55 +10:00
sam b6fe2f3e0f feat(webui): port the dashboard (Phase 3, first page)
The control room, on the primitives from the previous commit. Being the first
page it also settles the shape of the rest: shadcn components for chrome, one
feature folder per page, Lucide imported at the call site.

Carried across deliberately, because each was a fix rather than a layout:

- Live activity's detail is cut to one line and clamped again in the cell, so a
  long unbroken token (a path, a URL, a hash) cannot widen the column past the
  table. Unclamped, one agent_finish row made the dashboard 7,481px tall.
- Each HEALTH card takes its own content height. Matching them was right while
  both held a checklist; once setup is done that card is a title and a line
  while Gate pulse carries a gauge and four rows, so equalising them left a
  mostly-empty box taking a quarter of the first screen.

The task links are router paths now, not the `#/tasks` hashes the Preact build
used. History routing means a hash is not a route any more, so one that
survived here would navigate nowhere.

Also in this change:

- Button gains an `attention` variant, in the project's own cva. An action that
  exists because something needs a human has to look unlike one that is always
  present, and `destructive` would overstate it: nothing is broken, it is
  waiting.
- The setup panel branches on the state machine rather than on "is setup
  present at all". Guarding on presence showed a 100% checklist with every step
  struck through where the complete state belongs.
2026-09-20 19:42:08 +10:00
sam 25650a4b7d feat(webui): port the shared primitives (Phase 2)
The Preact tree's ui/src/base/ was deleted with the dashboard. This rebuilds
what depended on it, on the shadcn layer rather than as new bespoke markup.

Badge and Card come from the shadcn-vue CLI, so they match the already-vendored
components, and the composed pieces sit on top of them:

- Badge gains the five status variants the pills used, over the palette's status
  tokens. The pill's dot did not come across: the Badge's own shape is the
  affordance, and the same variant now covers a trend indicator, where a dot
  reads as noise.
- base/StatTile.vue uses full Card composition instead of dumping everything
  into one content slot, with base/Sparkline.vue and the goodDirection logic
  that says whether "up" is good news.
- base/Gauge.vue and base/SegmentBar.vue, both of them: the original exported
  two components from one file and budget composition uses the second.
- base/LogRow.vue over lib/log.ts, which holds the LOG_LEVELS wire contract
  (the server matches that CSV server-side, so it is not a display choice).
- lib/status.ts, so status colour has one home: a task state, a gate result, a
  log level and a trend all draw from the same five kinds.

Two deliberate departures:

The icon module is not ported. Its name-to-glyph string lookup is the pattern
shadcn-vue's rules call out as wrong, and nothing consumes the five bespoke
glyphs anyway: the navigation is text with tooltips. Icons come from @lucide/vue
at the call site, and the five become components if a page draws them.

The gauge's aria-label announces the rounded percentage. It announced the raw
one, so a screen reader read 71.38461538461539% where the screen showed 71%
(bead 86au).

Also lands the four modules the checklist marks copy-verbatim, which encode
bugs fixed just before the delete: dashboard/activity-detail, chat/
command-scroll, workflows/workflow-rows and logs/logs-empty.
2026-09-20 19:38:17 +10:00
sam ff8369c5ac feat(webui): land the Phase 1 foundation on the navigation restructure
Two Vue branches were in flight and looked like competing versions of the same
change. They were not: this branch had the navigation restructure (Phase 4)
and the route table, and the other worktree had the Phase 1 foundation, still
uncommitted. Neither had ported a page. This reconciles them.

What came across from the foundation:

- lib/api.ts, the one client every request goes through, so the CSRF and
  Content-Type headers live in a single place, plus the four framework-free
  modules it needs: uuid, stream-state, format, task-meta.
- loadTaskMeta() at boot, so /api/task-meta replaces the freeze-dried
  lifecycle defaults instead of the catalogue being frozen into the bundle.
- capabilities.ts keeps the other branch's pure hiddenRoutes, but reads
  route.meta.section. The other version read route.section, which is always
  undefined for this route table, so its capability gating was silently dead.

The route table stays this branch's: internal/gateway's registry test holds it
in parity with the agent-facing page index in both directions, and the other
branch's table fails it with seven errors.

The frame is Tailwind on the shell, not a ported stylesheet. layout.css
described a shell, a topbar and a nav as authored classes, but the topbar is a
Vue component like every other surface and emits none of them, so two thirds
of that file had no consumer. What the frame needs is now the shell element's
own utilities plus the canvas, focus floor and motion preference in
style.css's base layer, where a global element rule belongs. Verified equal to
the stylesheet it replaces: 20px radius, hairline border, blur(28px)
saturate(1.2), and the narrow-screen collapse.

Also fixes the bundle freshness check failing on the first build after any
change, which had cost both branches of this port a rebuild-and-retry. ui/dist
is committed, so nothing ignores it and Tailwind's content detection scanned
it, making every build an input to the next: class strings left in the bundle
generated utilities for classes nothing references any more, so an unchanged
tree built a different bundle. Excluding it also drops ~12KB of dead CSS.
2026-09-20 19:14:46 +10:00
sam 393e30ed1a feat(webui): adopt the violet palette, and give the outlet the viewport
Takes style.css, lib/theme.ts and index.html's pre-paint script from the
palette work on worktree-groovy-imagining-widget (73e602a7..72034249), leaving
its flat topbar and route table behind. The theme is a data-theme attribute set
before the first paint, so a reload does not flash the wrong palette, and
color-scheme moves with it.

The outlet takes the viewport height below the topbar so an empty state has
somewhere to sit.
2026-09-20 18:52:15 +10:00
sam 2bddb9f36a feat(webui): grouped topbar navigation, built from components
Five top-level items instead of eleven flat ones: Dashboard as a link, then
Work, Agent, Events and System as dropdowns, with each item's one-line
description on a hover tooltip. Configuration dissolves into /system/{status,
appearance,tasks,models,repos,advanced} and /settings redirects to the first of
them, so existing bookmarks still land somewhere. Logs gets a nav entry for the
first time.

The bar is composed from named components rather than one file: Brand (Logo,
BrandName), Nav (NavTrigger, NavGroup, NavItem), SearchBar, SupportLink,
ThemeToggle, ProfileDropdown. The nav model reads the route table, so a route
and its nav entry cannot disagree, and a group whose every child is gated off
is dropped while a group left with one child stays a dropdown.

The Go page registry moves with it, which its parse-the-route-table test
enforces.
2026-09-20 18:46:11 +10:00
sam b3c06de5ee docs(webui): nav item descriptions are hover tooltips 2026-09-20 18:25:56 +10:00
sam b086505871 feat(webui): history routing
createWebHistory with base "/". The Go server already falls back to index.html
for any unmatched path and [web] has no path-prefix option, so the dashboard is
always at the root.

legacy-hash-redirect.ts rewrites `#/path` links minted before this change.
Verified against archie-ui rather than the Vite dev server: /tasks, /tasks/42
and /settings all serve index.html with assets resolving, and #/settings lands
on /settings.
2026-09-20 18:14:37 +10:00
sam cf1a3a7bbe fix(webui): self-host Geist, and fold the cross-check findings into the plan
Four review agents checked the bootstrap and the migration checklist against
the deleted tree and the Go handlers. Three found real problems.

The shadcn-vue CLI's default font resolved to a Google Fonts @import. archied
is deployed on LAN-only and air-gapped hosts, where that silently falls back to
a generic sans and makes an admin tool that otherwise has no third-party calls
start making one. Now @fontsource-variable/geist, self-hosted: five woff2 files
in dist and no external URL left in the bundle.

vite.config.ts used __dirname for the @ alias, which Vite 8 already warns is
unsupported under its native config loader. Now import.meta.url. Dropped the
leftover template vite.svg.

The checklist gained what the review found missing, most of it consequential:

  - main.jsx was never named as a source, so the jump-to search, the `soon:`
    nav treatment, the boot-time task-meta re-render and the route-keying rule
    (keyed on path+params but NOT the query, so a tab switch does not remount)
    had no home. vue-router needs an equivalent key strategy.
  - css/layout.css is 498 lines and holds the shell, the chat dock and morph,
    and every breakpoint Phase 5 described only in prose. Named as the source
    to port from rather than left to reverse-engineering.
  - Six further CSS files carried behaviour with no mapping: focus-visible,
    .sr-only, the global prefers-reduced-motion override, and the pill colours
    a Badge port has to match.
  - Chat's content features -- session switching, persona and model selectors,
    inline tool-call rendering -- were absent; Phase 5 described only chrome.
  - Configuration's editable-vs-read-only dual mode (503 when the process only
    holds a published snapshot) is architecture, not styling.
  - Tasks writes tab/attempt state with history.replaceState specifically to
    avoid a remount per tab click.
  - statTile also exports Sparkline, gauge also exports SegmentBar, and five
    icons have no 1:1 Lucide equivalent, so those swaps are design calls.
  - LOG_LEVELS is a wire contract matched by splitCSV server-side.

Corrections: the API surface is 48 methods plus two SSE subscribers, not ~45.
Mutations require both X-Archie-CSRF: 1 and Content-Type: application/json,
answered 403 and 415 -- the likeliest silent breakage after the port, now
stated exactly. My claim that a test enforced "no second fetch()" was wrong:
that text-scan was deliberately removed upstream for testing the file's wording
rather than its behaviour. The real guard was per-method header classification,
flagged as the one test worth bringing back first.

The 106px clipping figure is a live measurement and not recoverable from git,
so it now carries the viewport and both edge positions.
2026-09-20 17:22:51 +10:00
sam 6932f18e3b docs(webui): migration checklist for the Vue + shadcn-vue port
Records what has to exist again, the contracts that break silently if missed
(embed output shape, the Go route registry, capability gating, the single
fetch path, SSE teardown), and the behaviour shipped today that lives only in
the deleted tree -- the chat launcher, the topbar shrink rules, the clamped
activity detail, the corrected contrast tokens, the readyState-derived stream
state.

Five deleted modules are framework-free and port by rename; each encodes a bug
fixed today, so re-deriving them by hand is how those bugs come back.
2026-09-20 17:17:48 +10:00
sam e18fb8b204 feat(webui): bootstrap Vue 3 + shadcn-vue, replacing the Preact dashboard
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.
2026-09-20 17:14:47 +10:00
sam 7d7e900e47 fix(webui): stop the UI contradicting itself, and clear the AA failures
Four P1 findings from the audit.

Workflows claimed "No workflow runs yet" directly above stage tables listing
those runs (archie-core-rcbf). The rows were built from the definition list
alone, so a workflow with statistics but no definition produced no row at all.
workflow-rows.js now merges both sides: a run is evidence the workflow exists.
The producer is also at fault -- /api/workflows returns definitions: [] from
the archie-ui composition while the daemon logs a registry of seven -- which
also means "Start work" never renders there. Filed as archie-core-3tij.

The logs page said "Durable history unavailable" twice and promised live logs
from a stream that had stopped (archie-core-c5bz). EventSource fires onerror
both for a retry and for a give-up; readyState tells them apart, so a dead
stream now reports "unavailable" in red instead of "reconnecting" in amber
forever. The toolbar says "Live only" and the empty state carries the
explanation, each once. An unconfigured update check (501) now says so on
Configuration rather than rendering nothing at all.

Contrast (archie-core-umdn). --fg-subtle was 3.37:1 dark and 2.72:1 light,
used for every KPI caption and column header; both move to values clearing
4.5:1 on every surface they actually land on, down to surface-hover at 4.51.
White on the dark accent was 3.2:1 on the active nav item and every primary
button: --accent-fg becomes near-black at 5.96:1 and the accent itself is
untouched, since it is also the link colour and reads correctly on the canvas.
Swept four routes in both themes: no remaining failures outside elements
painted on a gradient, which a compositing check cannot judge and which are
white on blue-purple anyway.

The HEALTH cards take their own height again
(archie-core-1786637500926-421-7c63bcd3). Equalising them was right when both
held a checklist; once setup completes, that card is a title and one line
while Gate pulse carries a gauge and four rows, so matching heights left a
~400px empty box in the first screen.
2026-09-20 16:50:28 +10:00
sam 25086a66a2 feat(webui): rehome update and dangerous-action controls to Configuration
Installing a release and approving a gated action are things you do to the
deployment, not things you say to Archie. They lived in the chat surface only
because that is where they were first built, and in a launcher panel a few
hundred pixels wide they crowded out the conversation (archie-core-tf20).

Both are new cards in ui/src/settings/operator-cards.jsx, wired into
Configuration beside the read-only UpdateStatusCard that was already there.
Behaviour is unchanged from the chat panel, including accepting both the
capitalised and lowercase checkpoint field shapes the API has returned.

A 501 from either endpoint renders no card at all rather than an error: a
deployment that does not wire update-checking should show nothing, which is
what the dev stack does.

Reload Telegram deliberately did not move. It was never an API call -- the old
handler sent the "/restart" chat command as a message -- so a Configuration
button would have to post a chat message to reach the adapter. It stays as
/restart in the palette until the cross-process restart RPC exists
(archie-core-ry4k); archie-core-oif3 tracks landing it here afterwards.
2026-09-20 16:33:47 +10:00
sam 1d2e58ebaa fix(webui): make the chat panel behave like a chat window
Remediation from testing the launcher (archie-core-ifay), plus the morph Sam
asked for.

The panel grows out of the launcher rather than fading in beside it: closed, it
is collapsed to a pill the size of the button and translated over it; open, it
is the full panel. Scale, border-radius and position interpolate together, and
the contents fade in once the shape has mostly arrived, so the button reads as
becoming the panel. The launcher stays visible throughout and is the only
control that opens and closes it, so the panel carries no close button.

  - Header shows the open conversation's name; ChatApp owns the header now,
    because the title and the actions that change it belong to the same
    component.
  - New chat became the Lucide message-circle-plus glyph and moved into the
    header. Added to the icon set, which is the same 24-grid stroke system.
  - The commands accordion is gone. The composer's slash palette was already
    the command surface and floats above the input; having both was two
    answers to one question.
  - Arrow keys scroll the palette so the selection stays visible. The decision
    is pure arithmetic in command-scroll.js, including the case of an option
    taller than the list, which aligns to its top so the command name is not
    the part scrolled out of sight.
  - The settings popover closes on any pointerdown or focus outside it.
  - Stop renders only while a reply is streaming.
  - The composer keeps focus and stays writeable during a send, so the next
    message can be typed while one streams. It was `disabled`, which also made
    the focus() in the send's finally block a silent no-op. sendMessage already
    refuses a second concurrent turn via isSendingRef.
  - Composer actions sit at the right of the input row, the resize handle is
    gone, and the Enter/Shift+Enter hint is removed.
  - Message bubbles dropped their "Archie"/"You" labels; side and colour
    already say who spoke.
  - Fixed an empty band under the composer: the panel still declared two grid
    rows from when the launcher owned the header.
2026-09-20 16:30:01 +10:00
sam 30a9be4dc5 fix(webui): make chat a FAB-opened panel and stop the topbar clipping
Four P0 defects from the frontend audit, plus the one-line theme fix that was
making every one of them look worse.

Chat is a floating launcher and the panel it opens, not a route
(archie-core-yuvg, archie-core-hesx). /chat rendered an empty page with a
drawer over it, and that drawer hosted the full-page chat workspace: a page
title, a conversations column, a four-control action row and a command-help
column, all inside 440px. Measured at 1440x900, .chat-workspace was 174px wide
holding 270px of content and the composer ran off the viewport.

  - The Chat nav entry, the /chat route and the topbar chat icon are gone;
    the launcher is the single way in.
  - The panel anchors to the launcher and opens leftward from it, sharing its
    bottom edge, so the button never moves. No scrim and no scroll lock: the
    page stays readable and clickable, which is the point of asking Archie
    about the page you are on.
  - Conversations became a switcher in a compact bar; personality, provider
    and model moved into a disclosure beside it; the empty state and composer
    dropped to panel type scale.
  - The launcher renders outside .shell because .shell's backdrop-filter is a
    containing block for fixed positioning, which otherwise pinned the button
    to the scrolling shell instead of the viewport.
  - Update-check, Dangerous actions and Reload Telegram left the panel; their
    api.* calls are untouched for the rehome to Configuration
    (archie-core-tf20).

The topbar no longer clips its utility cluster (archie-core-mkb3). brand, nav
and topbar-end were all flex:none with no wrap above 1220px, and .app sets
overflow:hidden, so between 1221px and ~1582px the avatar, theme toggle and
documentation button were cut off with no way to reach them. The nav is now
the one region allowed to shrink, the search collapses to its icon below
1500px, and the nav wraps to its own row below 1270px where it stops fitting.

Live activity clamps its detail column (archie-core-qo7f). An agent_finish
payload rendered raw turned one row into six viewports and the dashboard into
7,481px. The cell shows the first meaningful line; the full text stays on the
title.

color-scheme is bound to the active theme (archie-core-nm0y), so scrollbars
and native controls stop rendering light inside the dark UI.
2026-09-20 16:00:29 +10:00
sam 1fc3d67c15 chore(dev): move the dev State Store off the contested 9090
cockpit binds 9090 by default on this host, so task dev could not start the
State Store and every service came up without one. dev.toml's own comment
says to move the listen/target pair when that happens.
2026-09-20 16:00:14 +10:00
sam 1e7f478d2f fix(yaegiutil): refuse incomplete Yaegi interface wrappers at load
The generated symbol tables carried 25 hand-added nil guards across three
packages, re-applied by hand after every regeneration because `yaegi extract`
does not emit them. Regeneration silently dropped them, and three package docs
instructed the next agent to put them back.

The guards also answered the wrong way. A nil WResolve returned ("", nil), so a
malformed secret engine served an empty secret and reported success; a nil
WStop reported a clean shutdown for a module that never ran one.

Reject the wrapper where it enters the daemon instead. Yaegi type-checks
"var X Iface = impl{}" and refuses an incomplete impl on its own, but the
wrapper type is exported into the symbol table, so interpreted code can build
one directly and struct-literal semantics leave the omitted method nil.
Resolve now names the missing method and skips the plugin.

Generated tables are used verbatim again. Also names the wanted type on a
failed assertion, which formatted as "want <nil>" for every interface target.
2026-09-20 12:05:39 +10:00
sam cb63b27be0 feat(skills): make the archaeology main-check squash-aware
`git merge-base --is-ancestor` answers a topology question, so it reports a
landed repair as never-landed for every squash merge and for any rebase merge
that had to replay commits. This repository squash-merged its last fifteen
pull requests (everything merged up to 2026-09-18 used merge commits), so the
check documented in the failure-archaeology skill is a false negative for all
of them.

Add scripts/on-main.sh: `--is-ancestor` stays the offline fast path, and a
non-ancestor falls back to the GitHub API, where merge state is recorded
independently of the commit graph. It separates landed (0) from not-landed (1)
from undetermined (2) instead of folding an unanswered question into a
negative -- `if on-main.sh <ref>; then` is the mistake it exists to prevent.

Verified against live data: ancestor -> 0, squash-merged PR #899 -> 0, closed
unmerged PR #896 -> 1, commit in no pull request -> 1, local-only commit
GitHub has never seen -> 2, bad ref / bad base / no args / bad option -> 2.
2026-09-20 11:53:44 +10:00
sam 1b0133d7b7 refactor(plugin): delete the unused Registry type
Registry carried no plugin identity, discovery, compatibility or
lifecycle, so it was never the seed for the approved internal/domain/plugin
package. Host, Manifest and Module are, and they stay.

Regenerating pluginextract strips the interface-wrapper nil guards, so
those are restored by hand; the only intended change to the generated
table is dropping the Registry symbol.
2026-09-20 11:38:15 +10:00
sam d0d38d2844 chore(release): archied v1.30.0 archie v1.30.0 2026-09-20 02:55:20 +10:00
sam 6de2ec1535 docs(build): record why goimports is absent from the formatter set
Completes 856c6a8f. The measurement belongs next to the omission: without it
the next person to notice goimports missing re-adds it and pays ~135s per
gate run.
2026-09-20 02:54:01 +10:00
sam f6397af7f4 fix: address the Greptile findings on the merged PRs (#902)
* 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.
2026-09-20 02:42:36 +10:00
sam e108e9dadf fix(build): make formatting and CI converge (#901) 2026-09-20 00:38:51 +10:00
sam 93db997ea9 test(daemon): prove a stalled forge cannot block a sibling sweep (#900)
sweepAccess sweeps each forge in its own goroutine, but nothing pinned
that: the table test asserts coverage, not ordering, so the sweep could
be made sequential again without a failure.

The test stalls the root forge in AcceptInvitations and asserts the
sibling identity is swept while it is still blocked, then that Startup
returns once the stall is released. Verified RED against a sequential
sweepAccess (times out waiting for the sibling) and GREEN against the
goroutine-per-forge implementation.
2026-09-20 00:34:41 +10:00
sam 82ed8c9357 Fix/dashboard vocabulary single source (#898)
* 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: 04d4d8f1 (#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 (278b7fc6) 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 04d4d8f1 (#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.
2026-09-20 00:33:28 +10:00
sam c35d9b6fdd feat(messaging): Messaging Service operator surface, chat report rendering, and the diff-cap config fix (#899)
* 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.

* fix(gateway): render chat reports as lines, not one run-on paragraph

/status and /tasks are line-oriented reports, but their newlines were plain
"\n" -- CommonMark's soft wrap. The Telegram rich-block renderer space-joins
soft-wrapped lines, by design: a Telegram paragraph renders an embedded
newline as nothing at all, so a space is the only separator that survives.
The reports therefore arrived as one line each: "Runtime Provider: DeepSeek
Model: deepseek/deepseek-flash", and every task's title, state and park
reason jammed together.

The renderer now implements CommonMark's hard line break (two trailing
spaces, or a trailing backslash): the line closes its own block and the next
one hugs it, so a stanza keeps its lines without the spacer paragraph that
separates unrelated blocks. Ordinary prose is untouched -- a model's wrapped
paragraph still joins with a space. The producers mark their report lines
with it.

Two report fixes alongside:

- A park reason is capped to its first line at 160 runes. It carries whatever
  the failing stage reported, which for a lint gate is the whole tool log;
  unbounded, one parked task pushed every other task out of the reply. The
  full reason is still on the task.
- /status loses its "Runtime" sub-header. A section header over two fields
  made a four-fact report read like a document.

* fix(config): let diff_cap_lines = 0 actually switch the cap off

Config.DiffCapLines was a plain int, so the defaults pass could not tell an
absent key from an explicit 0 and rewrote both to 400. The dashboard schema
said "0 means unlimited" and StageDiffCap treated <= 0 as unlimited, but 0
never reached the step: the documented way to switch the cap off was
unreachable through config.

Same root cause, worse instance: configForIdentity assigned
root.DiffCapLines = identity.DiffCapLines unconditionally, so an identity
that simply omitted the key overwrote the shared cap with the zero value and
silently disabled the safety rail for that identity.

DiffCapLines is now *int on both Config and IdentityConfig -- nil is absent,
0 is no cap -- read through Config.DiffCap(). Defaults fill only nil, and an
identity overrides only when it set the key. TaskConfig keeps a resolved int,
so the daemon/agent wire format is unchanged and a version-skewed agent
cannot misread a null.

The park reason changes too. It told the operator to "approve manually", but
a parked task's actions are retry, abandon and reject (internal/taskstate):
there is no approve path out of diff-cap, so it sent them looking for a
button that does not exist. It now names the two things that work.

* feat(config): make the daemon's readiness dependency timeout configurable

The daemon's gateway probe bounded its call with a hardcoded 5s constant,
while every other NewContractProbe call site (archie-ui, archie-messaging)
passes the service's configured DependencyTimeout. It was the only magic
number among them.

[health].dependency_timeout carries it, defaulting to the same 5s the
extracted services' -dependency-timeout flag defaults to, so every process
bounds a probe into a dependency the same way out of the box.

It is not added to the dashboard config schema or the reloadable set:
[health] appears in neither today, health.listen included, and a probe
assembled at boot would not observe a reload anyway.
2026-09-20 00:32:13 +10:00
sam 800352a692 feat(gateway): give /status a real daemon-health surface (#892)
* feat(gateway): give /status a real daemon-health surface

Phase 2 of archie-core-wp9s. Phase 1 split the commands apart (health vs
work) but left /status with one aggregate queue line and a static runtime
block; it could not answer the questions an operator actually asks when
something feels wrong. /status now reports, between the queue line and the
runtime block:

- Broker: the live state of this process's own NATS connection
  (eventbus/nats.Client.Connected), not a fresh dial -- a probe would
  report the probe's reachability, not the daemon's.
- Containers: the pool's own active counter against the configured cap
  (Pool.Active/Cap), not a Docker listing, which would include containers
  this pool does not own. A zero cap means unlimited, so it is not shown
  as a ratio.
- Channels: the channel manager's real lifecycle state, including a
  failed adapter's reason (the documented decision: read the existing
  manager rather than re-deriving health per adapter).
- Chat model: last-known outcome of every chat-model call this process
  made, recorded once in sendChatTurn (the single choke point) and read
  back by /status. The second documented decision: never a live probe,
  so /status stays instant and reports what happened -- or says plainly
  that nothing has been attempted yet.
- Last poll: when the most recent poll pass began, stamped on both poll
  paths (Run's single-identity loop and runIdentities' per-identity
  goroutines). A pass that hangs leaves the stamp stale, which is the
  signal; stamping completion would leave a wedged poller looking
  healthy.

Truthful or absent: a section this process has no source for is omitted
rather than rendered as a zero. The standalone Gateway owns no poll loop,
pool or channel manager, so its /status reports broker and chat-model
health only; aggregating across processes would need a new daemon RPC and
is deliberately not built. Version stays out (/version owns it).

/status and /tasks descriptions now describe what each command actually
does on both published surfaces (Telegram menu/help and the shared
specs), pinned by a test that also fails if the two surfaces drift.

Sources are read through functions, not captured values: occupancy and
channel state move, and the daemon is built after the gateways, so a
source captured at construction would freeze /status on boot state.

Left in place deliberately: the Runtime (provider/model) block, which
Phase 1 flagged and which duplicates /model and /whoami. Removing it is a
product call on a command Sam uses daily, not a mechanical follow-up.

* docs(prds): record the two open /status health decisions as settled

Both were flagged in PR #892 as needing the maintainer's call; both are now
answered, and the PRD is the place a follow-up would look:

- The Runtime (provider/model) block stays. It is the one line in /status the
  ticket's own rule says should not be there, but /status is read daily to see
  the active model at a glance, so the duplication is deliberate. Recorded as a
  settled product decision so it is not removed later as an oversight.
- Health stays per-process. Pooling the daemon's and the Gateway's chat-model
  outcomes would need a new daemon<->gateway health RPC for one status line, and
  a per-process line is true where an aggregate would be a claim about a process
  the answering one cannot see.

/agents' published description is still left to archie-core-mxls, unchanged.
2026-09-20 00:30:23 +10:00
sam 79fbdc8478 fix(container): stop the reaper from deleting teardown bookkeeping early (#893)
The reaper's deferred forgetTeardown could delete a container's teardown
entry between the reaper's own claim and Release's later claim check.
teardownLocked then recreated a fresh, unclosed entry, letting Release
believe it still owned teardown and re-run ContainerStop/ContainerRemove.
Release is now the sole owner of deleting the entry, since it always
runs for every acquired container.
2026-09-20 00:20:31 +10:00