Commit Graph
23 Commits
Author SHA1 Message Date
sam 6f34e34adb feat(webui): render configuration from a published snapshot
The configuration page had exactly one source: this process's own
config.Holder. The UI process has no holder and is not permitted one, so the
page was empty there and the shared-holder assumption was the thing blocking
the cutover.

GET /api/config now reads a ConfigViewSource. The daemon builds the
projection from the configuration it owns, as before, and publishes that same
document to the State Store on boot and on every republish -- reload, a
dashboard edit, a repository field change -- since those are exactly the
moments it changes. The UI process renders what it reads there and nothing
else; an unknown schema is refused rather than half-rendered, and nothing
published yet is the documented empty response, not an error.

Editable is a property of the process, not of the configuration, so each
source sets it: the daemon holds the update path, the reader does not. The
settings page honours it, rendering values where it would otherwise offer
controls whose PATCH would answer 503 -- the deliberate feature reduction
archie-core-ymut recorded, made visible instead of discovered by clicking.

A failed publish is logged and degrades to a stale page. It must never fail
the reload or the edit that produced the configuration, both of which have
already taken effect.
2026-09-09 23:43:17 +10:00
sam a64d72ddbe refactor(ui): extract Pill to ui/src/base/, closing archie-core-mlro
Pill was independently duplicated byte-for-byte across 11 files
(tasks, logs, mapping-editor, capture-row, settings, update-status,
skills, dashboard, memory, channels, curators) plus the bindings page
built earlier this session -- a violation of organisation.md's
"extract on the second distinct consumer" rule, predating this
session entirely. Found while building the bindings UI.

Mechanical extraction only, no behavior change: ui/src/base/pill.jsx
is now the single definition; every call site imports from there.
skills.jsx's copy used `class=` instead of `className=` (functionally
identical in Preact) -- normalized to the shared version's className.
captures.jsx's import of Pill (previously re-exported through
capture-row.jsx) now points at the shared module directly.

Verified via task test:ui (120/120 unchanged) and, since this touches
the exact rendering path that had a real app-wide regression earlier
tonight (commit 8f9f2d6), re-verified in a real browser across all 12
pages: zero "[object Object]" occurrences, and every page's .pill
elements render with real content (settings: 9, bindings: 2, etc.),
not just "the build succeeded."
2026-09-03 06:25:21 +10:00
sam 5652d5a6fe Refactor channels, settings, logs, and memory to use Preact components 2026-09-03 00:20:43 +10:00
sam 9e86bd0962 Rename remaining JS files to JSX 2026-09-03 00:12:03 +10:00
sam a4fbd8d6ef feat(webui): inline editing for per-repo allow_concurrent/max_retries/review_enabled
Adds PATCH /api/config/repos/{owner}/{name}, a dedicated seam distinct
from the generic dotted-key PATCH /api/config path: a repository is
one element of []config.Repo, not a flat key. Traced the mechanism
before adding any new plumbing -- overlay.Nest/ApplyOverlayValues
already handle "repos" as a single whole-slice key with no dot, so
the fix is a webui handler plus a bootstrap seam that reads the
daemon's live, untrimmed Repos (never webui.RepoView, which omits
Preflight/TestGlob), mutates the one matched field via the pure
applyRepoFieldUpdate helper, and republishes through the existing
UpdateConfig(ctx, {"repos": repos}) path unchanged.

config-row.js's row() gains an opts.save override so an edit can be
redirected to a different persistence call. The repositories table
renders an autosaving checkbox for the two booleans and a
save-on-blur/Enter input for max_retries, via api.configRepoUpdate.

Closes archie-core-b6ew.6, and with it archie-core-b6ew.
2026-09-02 22:35:03 +10:00
sam 302caedec9 feat(webui): surface allow_concurrent/max_retries/review_enabled on the repositories card
RepoView.ReviewEnabled was previously absent from GET /api/config
entirely, not just unrendered; add it alongside AllowConcurrent and
MaxRetries. The repositories table gains Concurrent/Max retries/
Self-review columns as read-only pills -- this is the concrete
discoverability fix for "why isn't a second agent running": that
config was already reachable from the API, just never shown.

config.example.toml documents review_enabled, which had no example
entry before this.

Full inline editing of per-repo fields is out of scope here: the
dashboard's PATCH /api/config path has no array-index support for
updating one element of the Repos slice, which is separate,
real scope -- filed as archie-core-b6ew.6.

Closes archie-core-b6ew.4
2026-09-02 22:23:58 +10:00
sam 35eb4050de feat(webui): render scalar config sections generically from the schema
settings.js drops identityCard/budgetsCard/storageCard/webCard/
pullPolicyLabel in favour of one schemaCards() that walks cfg.schema
and builds a card per section, a row per non-structured field --
label, type, description, editability and enum options all come from
the backend descriptor instead of a hardcoded row(...) call per key.

config-row.js gains: enum fields edit as a <select> from opts.options;
opts.editable === false renders read-only distinct from a locked row
(no reason to show, just no edit affordance); opts.hint carries a
field's description as the label's tooltip, so "0 means unlimited."
travels with the field instead of being baked into a display-value
string per key.

ConfigSection also gains Description, filled in per section to match
each card's existing sub-text, since the card's own explanation is
schema metadata too.

Structured sections (repositories, models & providers) are untouched
-- still the existing bespoke renderers, reserved for archie-core-b6ew.4.

Closes archie-core-b6ew.3
2026-09-02 22:12:48 +10:00
sam c026ada077 feat(dashboard): render task actions, statuses and filters from the server catalog
Three surfaces stopped keeping hand-synced copies of the lifecycle vocabulary,
so a status or action added on the backend shows up without a frontend change:

- task actions render label/variant/confirm from taskstate.ActionCatalog via
  actionFor(); unknown actions no longer vanish behind a hardcoded switch and
  a new action needs no frontend case
- status labels and pill severities come from taskstate.Statuses via
  statusLabel()/statusKind(); the local copy and the dom.js switch are gone
- the status filter vocabulary and the "needs you" grouping derive from
  statusIds()/attentionStatusIds(); a new status appears in the filter and in
  the settings page's Work lifecycle card, driven by /api/task-meta

Regenerated ui/dist so the embedded binary ships the new dashboard.
2026-08-28 00:55:17 +00:00
sam 1f05dbb33c feat(deployment): default to managed NATS workers
Autonomous workflows now always hand a complete task to a scoped archie-agent container. Embedded NATS is the default and external NATS changes only broker placement; legacy agent and containers.enabled inputs decode for migration but cannot select an execution path. The daemon flushes task-event subscriptions before a worker can publish, and runtime updates snapshot and restore the configured worker image.
2026-08-24 14:56:57 +10:00
sam d3da153768 refactor(agentexec): remove legacy execution paths
Autonomous workflows now have exactly one production boundary: a task-scoped archie-agent receives a full-task core-NATS request and runs the worker-local stage loop. The legacy [agent] section remains decode-only for migration; it no longer selects runtime behavior.
2026-08-24 14:56:57 +10:00
sam cc53e5258d fix(telegram): compact tool output and drop turn caps
Render completed ToolCallEvents as Telegram-safe streaming blocks
with compact name/status and a short cleaned preview. Summarize
file contents and listings instead of dumping source or quoted
JSON. Collapse repeated legacy turn-budget failures.

Remove max_tokens turn gating and the 200000 turn_budget_chars
default so absent or commented config cannot restore an aggregate
cap. Keep per-result max_result_chars and spill.

Confine find/grep discovery to the active workspace/worktree.

Refs #604
2026-08-23 16:40:16 +00:00
sam 08fa79e5af feat(webui): surface per-component update status on /api/version and Configuration
The prior two changes gave every component an InstallType/Reference
and a way to observe what's actually running (installtype.Type(),
daemon.AgentStatus, [nats] config), but nothing consumed any of it --
an operator still had no single place to see whether a component's
actual running state agrees with what the update-check command
claims.

Add GET /api/version: per component, install type, observed running
version, the check command's installed/available claims, and a
computed status -- ok / update_available / drift / unknown. drift
takes priority over update_available (a claim the running system
contradicts is worse than a newer release merely existing), and a
component with no installed claim at all reports unknown rather than
guessing "ok" or "update_available" from a comparison that was never
actually made.

Surface it as an "Update status" card above the Configuration page's
existing config view, sourced independently so its own failure (or a
501 on deployments with no update-check command configured, which
renders nothing rather than an error) never blocks the config view
that's already there.

Closes archie-core-1786751948782-3-837a8fd0.3 and, with it,
archie-core-1786751948782-3-837a8fd0 (all 5 design points landed).
2026-08-23 23:36:44 +10:00
sam 367637d174 fix(webui): cap and centre the Configuration page instead of its lists
The page ran the full width of the shell, so a card was roughly 1300px
of which the content used the left third. Every previous attempt fought
that inside the card by capping or shrinking .kv-list, which only moved
the imbalance around: the lists changed width but the Repositories and
Providers tables stayed stretched just as far, and shrinking the lists
broke the row separators and the alignment of the Edit column.

Constrain the page container instead. One max-width and auto margins on
the view fixes every child at once, so cards, key/value lists and tables
all sit on the same readable measure and the leftover space falls
outside the cards where it reads as margin rather than as a hole.

Scoped to this page as .cfg-page rather than added to .page-head, which
every other view shares; widening that is a separate decision.

This is what `margin: 0 auto` was for. Applying it to .kv-list, which is
what I tried first, really would have misaligned each list against its
own card heading and against the table beneath it, and I used that to
rule the approach out rather than to move it up a level.
2026-08-10 03:18:17 +10:00
sam f2eaba2fe1 fix(webui): keep Configuration rows full width, hug only the label column
Sizing the whole list with width: fit-content fixed the label-to-value
distance by breaking the row: every list ended at a different width, the
separators stopped part-way across the card, and no two Edit buttons
shared a column.

Those are two different knobs and only one of them was ever the bug.
How far the value sits from its label is set by the label track; how
wide the row is is set by the container. Hug the first, leave the second
alone: the label column is max-content so the value starts immediately
after the longest label, the value column takes the slack, and the
actions column is pinned right. The row spans the card again, so the
separators run full width and every Edit lands in one column, while the
label-to-value distance stays as short as it was.

Verified against the built stylesheet in the dark theme at 1440px:
label and value adjacent, locked reasons on their own line, actions
aligned across sibling lists.
2026-08-10 03:11:58 +10:00
sam 7b07033d7c fix(webui): size Configuration key/value lists to their own content
The rewrite capped .kv-list at 72rem and left it anchored to the card's
left edge, so on a wide screen the rows stopped well short of the card
and the action column floated in the middle of the dead space rather
than sitting near the value it belongs to.

Any fixed cap is a guess that is wrong at some viewport: too wide and
the actions drift away from the value, too narrow and paths truncate
for no reason. Size the list to its children instead --
width: fit-content, bounded by max-width: 100% so a pathological value
clamps and lets the ellipsis take over.

Not centred with margin: 0 auto. These lists share cards with
full-width tables (Models & providers has both), so centring would
misalign every list against its own card heading and against the table
directly beneath it.

Sizing to content required moving the columns off the row and onto the
list. Each .kv was previously its own grid, so no row could size a
column against any other row, and a max-content label track would have
ended at a different x on every line. The list now declares the tracks
and each row adopts them with grid-template-columns: subgrid, giving
one shared label column sized to the longest label and no wider. A
@supports fallback keeps the previous bounded-column behaviour where
subgrid is unavailable, and the narrow-viewport rules drop out of
subgrid because a shared label column is the wrong shape once the row
stacks.

Verified by rendering the built stylesheet against representative
markup rather than by inspection: label and value adjacent, notes on
their own line, actions in a reserved column, no dead space.
2026-08-10 03:07:47 +10:00
sam fb7fba4232 fix(webui): rebuild the Configuration page layout so values stop colliding
The page had three compounding layout faults, all visible on a wide
screen and all still present after the earlier spacing pass:

  1. .cfg-row used justify-content: space-between on a full-width card,
     so the label sat at the far left and its value at the far right with
     roughly a thousand pixels between them. Reading one pair meant
     tracking across the viewport. The earlier "tighten KV row spacing"
     change reduced vertical padding only, which is why the complaint it
     was meant to answer survived it.
  2. .cfg-value had no min-width: 0, so a long value could not shrink
     inside its flex parent. It overflowed into the Edit button, which is
     why 400 rendered as "40" and 100000000 was clipped mid-number.
  3. The locked-row reason was a flex sibling of that overflowing value,
     so it ran onto the end of the path with no separation, rendering
     ".../archie/work" and "pins the daemon's working layout" as one
     unbroken string.

Replace the flex row with a three-column grid: label, value, actions.
Label and value are adjacent and left-aligned so the eye travels a fixed
short distance at any viewport width; the value column is minmax(0, 1fr)
so it can actually shrink, truncating with an ellipsis and keeping the
full text in a title attribute; actions occupy a reserved column that
nothing can overlap. Secondary text (locked reason, override marker,
validation error) gets its own grid row instead of sharing the value
line. Narrow viewports stack label over value rather than truncating
both to a few characters.

Extract the row renderer into settings/config-row.js. settings.js
imports its own stylesheet, which the node test shim cannot parse, so
the rendering logic was untestable where it sat; this mirrors
tasks/task-row.js. Seven tests now cover the two collision bugs
structurally, asserting on per-child text rather than the row's
flattened string so a future layout change cannot pass by merging the
fields back into one node.

Also stop sharing .cfg-rows with the Workflows "Start work" form. A
class owned by the Configuration page meant restyling Configuration
could silently restyle that form; it is now .wf-form, owned by the
feature that uses it.
2026-08-10 03:00:56 +10:00
sam 171e1b2686 feat(config): surface overlay state, shadowed keys, and per-row reset
Three gaps closed, all in the 'your change didn't take effect and
nothing told you' family:

1. MaxRetries joins the reloadable allowlist, and the criterion is
   fixed on reloadableFields: a field is reloadable when EVERY
   consumer re-reads it. MaxRetries is the worked example -- its only
   consumer is the webui maxRetriesFor handler, which re-reads per
   request (api_tasks.go:380,383); nothing in the daemon reads it, so
   warning 'requires restart' was spurious. Chat.Telegram.TokenEnv is
   documented as the counter-example (webui reads it per request but a
   startup-built telegram bot consumes it, so it is not reloadable).
   Pinned by TestChangedNonReloadableFields alongside the comment.

2. Boot-time overlay degradation is now surfaced. config.ReloadStatus
   gains OverlayUnavailable; main.go records the reason when the
   overlay store cannot be opened or its values fail validation, and
   /api/config carries it (merged into LastReload). Cleared by a
   successful dashboard write or reset. The settings page renders a
   warning banner, so a daemon running on file config alone says so
   where the operator is looking, not only in logs.

3. Overlay-shadowed file edits are visible and recoverable.
   ConfigView.Overridden lists the dotted keys the runtime overlay
   currently sets, so the UI marks those rows (their file value is
   shadowed until reset). POST /api/config/reset exposes the
   store's Delete as a per-row reset: it deletes the row and
   republishes file + remaining overlay, which is also the answer to
   'my file edit isn't taking effect'. The dashboard can now remove
   every override it can create.

Verified: task check clean; -race clean on cmd/archied, webui,
infrastructure/configuration; new handler tests cover the reset
200/400/503 paths and the overridden list.
2026-08-10 01:09:05 +10:00
sam fa8a0d6d02 feat(webui): inline config editing on the Configuration page
The dashboard's Configuration page can now change runtime-tunable
settings without hand-editing TOML (issue #348). Scalar rows get an
Edit affordance; Save PATCHes the dotted key to /api/config, which
validates the materialised config before persisting to the runtime
overlay and republishing.

Per the design constraints:
- Structured values (repositories, models, providers -- arrays and
  maps) render read-only with no edit affordance; they are not
  faked as editable.
- Denylisted keys (db_path, work_dir) render explicitly disabled with
  the server's reason from the ConfigView.locked map, instead of a row
  that silently lacks an Edit button.
- Bool fields edit via a select, ints parse client-side so a typo
  fails before a round trip, durations and strings pass through to
  the server which validates them. The server's error text is shown
  inline on a rejected save (validation failure, denylist, disabled
  overlay).
- Enter saves, Escape cancels, Cancel restores the row.

api.configUpdate PATCHes /api/config with {updates: {dotted.key: v}}.

Verified: task check clean; 23 node tests pass; dist rebuilt and
committed in the same change.
2026-08-10 00:57:05 +10:00
sam 4204005ca3 fix(webui): tighten configuration KV row spacing
Each row in the read-only configuration view was ~45px tall but the
text was only ~20px — empty space outweighed content by ~2:1, making
the page hard to scan. The combined effect of `gap: var(--sp-2)` on
the flex container and `padding: var(--sp-2) 0` on each row doubled
the breathing room. Tables on the same page (Repositories, Providers)
already use the target density; configuration rows now match them.

Scope the override to `.cfg-section` descendants because the
Workflows "Start work" form reuses `.cfg-rows` for its input fields
(form.cfg-rows, no .cfg-row children) and would otherwise lose its
8px inter-field gap. The form is unaffected: the override only
matches when an ancestor carries .cfg-section.

Rows go from ~45px to ~25px, with the border carrying the visual
rhythm instead of doubled padding.
2026-08-09 23:18:02 +10:00
sam 61b4b7b0cf refactor(store): replace legacy persistence with SQLite
Task and event persistence now uses a dedicated SQLite sidecar derived from the configured state prefix, matching the independently persisted conversation store. The configured path now means a state-path prefix rather than a database file so fresh SQLite state never attempts to interpret the previous storage format.

Remove the retired implementation and dependency completely, strengthen SQLite migrations and concurrency behavior, restore backend-neutral coverage, and align configuration, operational guidance, UI labels, and deployment documentation with the new storage and host-daemon topology.
2026-08-09 22:27:25 +10:00
sam 472d8d717c feat(config,channels): format-neutral config resolution and truthful channel state
Loader.Resolve() selects TOML/YAML files or a config directory as the
production entry point, replacing the TOML-only Overlay() as the default
path. Add internal/channels.Manager, reporting each adapter's actual
runtime lifecycle (configured/starting/running/degraded/failed) instead of
inferring health from configuration presence alone. Wire channel reload
through a per-adapter seam.

Fixes #55
2026-08-09 01:25:58 +10:00
sam 170fe0250b fix: close the duplicate-work loop and the dead paths around it
Applies the four-reviewer pass over the forge/dashboard-actions work.
The through-line is that several capabilities were wired but inert, and
one of them could cost real work.

DUPLICATE WORK. "Closes #N" was dropped from PR bodies in favour of
LinkBranch, which is sidebar linkage on Gitea and a no-op stub on
GitHub -- neither closes anything, and nothing else did either. So a
merged task left its issue open, labelled and assigned; the next poll
re-enqueued it, and once the dashboard's Clear removed the task row that
became a second implementation and a second PR for work already merged.
reconcilePRs now closes the issue on merge, and a rejected task closes
its issue too. A PR closed without merging deliberately leaves the issue
open: that usually means "try again".

MAX RETRIES. Configured, defaulted and reported by /api/config, and
enforced nowhere -- markDead was unreachable and EffectiveMaxRetries had
no callers, so the dashboard's retry incremented retry_count forever.
The retry action now retires a task to dead at the cap.

DEAD ON ARRIVAL. Tasks() never selected plan or source, so the
"Decision required" panel could not render and chat tasks -- whose issue
number is synthetic -- linked to forge issues that do not exist.

COSMETIC FAILURE, FATAL RESULT. OpenPR failed the whole stage when
LinkBranch errored, so the pull request was never opened and the task
parked; a retry re-links the same branch, which Gitea answers with a
conflict, so every retry parked again. It is best-effort now.

INVISIBLE ACTIONS. Approve/retry/reject wrote store rows and nothing
else, so the timeline and activity stream never showed that a human had
intervened. They emit events now.

Also: store write failures answer 500 rather than 409; the dashboard
surfaces the server's actual reason instead of "409 Conflict"; action
buttons stop propagation (acting on a task no longer also expands it),
disable in flight, keep per-task errors instead of one shared string,
and confirm before rejecting.

Removed: the maybeRetryParked shim and markDead with their now-vacuous
tests, WaitingTasks (no consumers; its tests were rewritten to assert
the same routing through TaskByID), write-only Daemon.Runtime, and
dir/dirs response bloat from /api/skills. skillSource checked workDir
before sharedDir, mislabelling every shared skill when the two are equal.
DefaultRoots now dedupes roots differing only by a trailing separator.

The air build rule claiming to keep ui/dist current never ran -- it
required one file to satisfy include_dir and include_file together, and
ui/ is excluded from the walk. Deleted with the comment that promised it.
task test:ui joins task check and CI; it ran nowhere before, so the
dashboard suite could rot silently.

Docs corrected where they described behaviour that no longer exists:
parks no longer comment on the issue, state labels no longer drive
retries, and forgerpc's doc claimed four proxied methods while listing
three of five.
2026-08-05 03:54:25 +10:00
sam 4d44ef76f5 feat(webui): rebuild the dashboard
The old UI was a single 200-line Go file serving one hand-written HTML
page of task rows. It showed that archied was running and almost nothing
about what it was doing -- skills, workflows, memory, channels, logs and
configuration were all invisible unless you read the source or the
config file.

The dashboard now covers each of those as its own section, built as a
Vite app under ui/ at the repo root: it is a separate artefact from the
Go daemon, not an internal package of it. dist/ is committed so building
archied never needs a Node toolchain, and the !no_ui build tag keeps an
embed-free build available.

Both sides are split by concern rather than by layer -- one Go file per
API area, one folder per UI section with its own CSS -- so a change to
logs cannot disturb tasks.

Pages report consequences, not just state: an empty memory page says
Archie starts every conversation with no recollection of earlier ones,
and the setup checklist names what is missing in plain language instead
of showing a grid of zeroes. Nothing greets by a hardcoded name; the
operator comes from [chat], which is deployment data.

Auth is exposure control, not capability control -- the agent already
holds this user's authority through its own tools. So a loopback bind
needs no token, and only a reachable bind mints one and logs a URL,
which means an instance cannot be exposed merely by omitting config.

Container startup now degrades instead of aborting, for the reason
resolveForge already does: a missing agent image should not deny the
operator chat and the dashboard, and under Restart=on-failure it turns a
recoverable problem into a crash loop with the real error scrolling past.

`task dev` runs the daemon under air and the Vite server together in one
terminal.
2026-08-04 01:45:36 +10:00