Commit Graph
574 Commits
Author SHA1 Message Date
sam 63d044603c fix(daemon): refuse to poll on an empty label-trigger match (#529)
GitHub's issues-list API treats an empty label filter as no filter at
all, so dispatch.trigger = "label"/"either" with cfg.Label unset
silently returned every open issue in the repo. A live incident
(GH#445) queued 124 unrelated issues in one poll cycle after
[dispatch.labels] -- a different field mapping task states to their
own labels -- was configured while the actual trigger-match label was
left blank.

pollIssuesWithConfig's "label" branch now refuses to poll and logs an
error when cfg.Label is empty; pollEitherWithConfig skips only the
label-side poll in that case, still returning assignee matches.
validateDispatch rejects the same misconfiguration at config-load
time. A per-identity gap remains: identities have no Label field of
their own and share the root's, so an identity overriding
dispatch.trigger to "label" isn't caught by validation -- only by
the runtime guard, which is why the runtime guard matters even with
validation in place.

Fixes archie-core-1786637501009-424-5b8332dd / GH#445.
2026-08-20 23:19:53 +10:00
sam 8e8f95381d fix(gateway): stop persona from asserting unverified claims as fact (#528)
The chat agent labelled unchecked figures "Verified details" and
fabricated an entire "Hermes gateway" subsystem with invented file
paths, stating both as confirmed fact until directly challenged.

Reword core rule 1 to separate static tool-capability claims (fixed
by the tool list) from dynamic file/memory/action/result claims,
which now must be verified this turn rather than merely "in this
conversation" -- the looser wording let a stale claim be treated as
still verified. Add rules 8 and 9: never label something
verified/confirmed without a this-turn tool check, and never state a
specific system detail (path, subsystem, count, config value) with
confidence unless just retrieved.

Fixes archie-core-3jag / GH#524.
2026-08-20 23:19:34 +10:00
sam 0496dd8c12 fix: restore provider gate and dashboard token accounting
Restores the provider test gate and durable dashboard token accounting.
2026-08-20 21:16:15 +10:00
sam 68c86ead24 chore(release): archied v1.9.11
deploy / gate (push) Failing after 2m16s
deploy / build-and-push (push) Skipped
2026-08-19 02:08:58 +10:00
sam d4e343b694 fix(mcp): persist npx package cache across daemon restarts
config.docker.toml launches MCP servers with `npx -y <pkg>@<version>`,
and the container has no persistent npm cache, so every daemon restart
re-resolved and re-downloaded the package from the registry -- slow,
and it turns a registry outage or a yanked version into a daemon
outage. It directly amplified the crash loop observed on 2026-07-30,
since each restart repeated the whole download.

configuredMCPProvider now points npx-launched servers (matched by base
name, so an absolute-path npx still qualifies) at NPM_CONFIG_CACHE
under the daemon's own persistent work_dir, plus
NPM_CONFIG_PREFER_OFFLINE=true so a warm cache skips the registry
round trip entirely. Does not cover a package's own separate
downloads (e.g. Playwright/Puppeteer fetching a browser binary via
its postinstall script).

Closes archie-core-1786637490923-43-d4bb914b.

The identical, arguably worse instance in
internal/app/agentworker/mcp_providers.go (every per-task ephemeral
container, not just daemon restarts) needs a persistent Docker volume
that doesn't exist yet, so it's filed separately as
archie-core-qk8m rather than folded into this scoped fix.
2026-08-19 02:08:33 +10:00
sam f1b65c0ef9 chore(beads): persist interactions log 2026-08-19 02:08:26 +10:00
sam d8b4075166 chore(release): archied v1.9.10
deploy / gate (push) Failing after 2m23s
deploy / build-and-push (push) Skipped
2026-08-19 01:49:32 +10:00
sam ddd532b824 feat(update): stream live progress and roll back failed updates automatically
The /update command went silent between "starting" and one final message,
gave no version summary, and required manual intervention on failure.

CommandInstaller now streams the installer script's stdout live instead of
buffering it, and parses a structured result (previous/installed versions,
per-component status) from a sentinel line. Because the reference install
script hands the daemon restart off to a detached systemd unit specifically
so restarting archied.service doesn't kill the process that requested the
update, the outcome is reported in two phases: the synchronous build/install
result comes back through Install() itself, and the post-restart health
check/rollback outcome is written by a new watchdog script and relayed by
whichever archied process boots next, via a small JSON handoff file cleared
once relayed.

Also fixes three defects an adversarial review pass found in the first
draft: the caller's request/handler context was passed straight into the
install child process, so a concurrent /restart or a browser disconnect
could SIGKILL it mid binary-copy; Telegram and the web dashboard each
tracked "install in progress" with their own private flag despite sharing
one Service, allowing two installs to race the same .prev backups; and the
watchdog reported rolled_back:true even when no backup existed to restore,
which would have told an operator to stand down while the daemon was still
broken.

internal/webui gains an unauthenticated /healthz the watchdog polls after
restarting archied.
2026-08-19 01:47:29 +10:00
sam 27f3403d14 chore(release): archied v1.9.9 archie v1.9.9
deploy / gate (push) Failing after 2m16s
deploy / build-and-push (push) Skipped
2026-08-18 09:58:42 +10:00
sam cee3f551d6 fix(telegram): drain live renderer in concurrency test 2026-08-18 09:58:42 +10:00
sam 39cdf196d1 chore(beads): persist interactions log 2026-08-18 09:05:34 +10:00
sam 5da1d5d006 fix(agentworker,daemon): reconcile worktree ownership before push
Agent containers run as root (no USER in the Dockerfile, no
userns-remap), so a commit the agent writes to the bind-mounted
worktree lands owned by UID 0 on the host. The daemon then reads
those same loose objects to push, running as its own non-root host
user, and fails with "openat objects/../..: permission denied".

containerEnv() now passes the daemon's own UID/GID as
WORKTREE_UID/WORKTREE_GID. hybridTrees.Push -- the single point
where a commit's objects are handed back for the actual push --
chowns the worktree to that owner first, via os.Lchown so a
legitimately-tracked-but-dangling symlink doesn't abort a push that
would otherwise have succeeded.

Closes archie-core-1786749700606-6-bf6aa32d.
2026-08-18 09:05:31 +10:00
sam 990a7c499c fix(container): stop a cancelled task's container immediately
Release() always slept the configured GracePeriod and always used
Docker's default ~10s graceful SIGTERM-then-SIGKILL timeout, even
when the release was happening because /stop had just cancelled the
task's context. A cancelled task's container -- and the in-flight
generation/tool calls inside it -- could sit doing nothing for up to
GracePeriod+~10s before actually dying, so /stop reported success
while work visibly continued for tens of seconds to a couple minutes.

releaseDecision(ctx, grace) now skips the grace sleep and requests an
immediate SIGKILL (Timeout: 0) when ctx is already cancelled; a live
ctx (normal completion) keeps the original behaviour byte for byte.

Closes archie-core-1786749700580-5-e3878224.
2026-08-18 09:05:21 +10:00
sam 966dd556d5 chore(beads): persist interactions log 2026-08-18 00:39:09 +10:00
sam bc2ef06a6b chore(beads): persist interactions log 2026-08-18 00:35:48 +10:00
sam 5450231b77 chore(beads): record epic close and engine bead lifecycle 2026-08-18 00:33:58 +10:00
sam 80c0d0ebaf feat(secret): add sops, vault/openbao and age engine plugins
CLI-based, env-configured, cache-less engines resolving SecretRef values
through the existing Yaegi plugin surface. Fresh resolve per call, so
values updated in the backend are picked up without daemon restart —
closing the gap that motivated the remote secret-input epic (#504),
whose value-entry web form duplicated the Bitwarden app for bws.

- examples/secret-engines/: sops (SOPS_FILE), vault (VAULT_ADDR/TOKEN,
  key "path/field" or VAULT_SECRET_PATH prefix), age (AGE_FILE/
  AGE_IDENTITY, key=value lines). //go:build ignore keeps them out of
  the Go toolchain; yaegi treats the tag as a comment and loads them.
- enginehost: host-side Run helper registered as a Yaegi symbol. yaegi's
  interpreted os/exec cannot pass env to child processes, so plugins
  shell out through host code; bounded by a 30s timeout like the bws
  engine.
- secret.LoadDir seeds the interpreter with the host environment: yaegi's
  interpreted os package keeps a private env otherwise, and plugin
  os.Getenv would silently see nothing.
- cmd/archied wires enginehost + unrestricted symbols into the engine
  plugin loader, matching skillscript's interpretation posture.
- tests load the real shipped plugin files with fake CLIs on PATH;
  added CONTEXT.md glossary for the remote secret-input vocabulary.
2026-08-18 00:32:57 +10:00
sam fe2edc07dd chore(release): archied v1.9.8 archie v1.9.8
deploy / gate (push) Failing after 3m22s
deploy / build-and-push (push) Skipped
2026-08-17 00:18:24 +10:00
sam 9946fc464b fix(update): isolate service restart handoff 2026-08-17 00:17:41 +10:00
sam 156f100e37 chore(release): archied v1.9.7 archie v1.9.7
deploy / gate (push) Failing after 2m12s
deploy / build-and-push (push) Skipped
2026-08-17 00:05:23 +10:00
sam 16ec8393fe style: apply gofumpt formatting 2026-08-17 00:02:31 +10:00
sam 58524f24d8 chore(release): archied v1.9.6 archie v1.9.6 2026-08-17 00:00:09 +10:00
sam 2b5c67087b fix(update): stamp install type and bound retry backoff 2026-08-16 23:59:48 +10:00
sam 5080be3450 chore(release): archied v1.9.5 archie v1.9.5
deploy / gate (push) Failing after 2m22s
deploy / build-and-push (push) Skipped
2026-08-16 03:14:59 +10:00
sam ff4af61e2b refactor: extract daemon bootstrap into phased wiring 2026-08-16 03:12:18 +10:00
sam 96263071bc refactor(archied): extract config overlay boot helper and thread ctx 2026-08-16 01:38:11 +10:00
sam 7b2c989615 refactor(builtin): split read executor to lower complexity 2026-08-16 01:37:04 +10:00
sam c12bd72f60 style: remove trailing whitespace 2026-08-16 01:28:25 +10:00
sam c36af46605 fix(tests): check type assertions in overlay and gateway tests 2026-08-16 01:24:31 +10:00
sam b7480e9e3c refactor: flatten nested config and tool fallback logic 2026-08-16 01:20:48 +10:00
sam 7b5292c6b5 fix(tools): flatten write overwrite checks 2026-08-16 01:16:22 +10:00
sam 389498428c fix(email): use context-aware test networking 2026-08-16 01:10:48 +10:00
sam 89af556fa0 test: use t.Context() for helper subprocess 2026-08-16 01:08:47 +10:00
sam 40441c7655 fix(tools): document intentional fallback skips 2026-08-15 23:55:21 +10:00
sam 1da24232af fix(tests): add contexts to HTTP test requests 2026-08-15 23:43:55 +10:00
sam 25699ca154 fix(tools): avoid predeclared max names 2026-08-15 23:41:44 +10:00
sam 6329b336fe fix(indexing): remove unused code search test runner 2026-08-15 23:40:23 +10:00
sam df41aa27fb docs(architecture): document memory engine family 2026-08-15 23:38:34 +10:00
sam 0e53485ea1 chore(release): archied v1.9.4 archie v1.9.4
deploy / gate (push) Failing after 3m27s
deploy / build-and-push (push) Skipped
2026-08-15 23:17:43 +10:00
sam c3f0d87787 fix(telegram): preserve URL boundaries in responses
Keep bare GitHub issue and pull-request links separate from following prose across one-shot sends, live edits, and long-message splitting. Preserve Markdown delimiters and newline boundaries while retaining plain-text fallbacks.
2026-08-15 23:09:28 +10:00
sam f0709829c6 feat(gateway): polish /status command response format
Format /status response with clear heading, visual task status icons, canonical lifecycle ordering, and separated runtime details with graceful fallbacks.
2026-08-15 22:43:41 +10:00
sam 34e36adf36 Merge pull request #525 from samcharles93/ratelimit/evict-stale
Ratelimit/evict stale
2026-08-15 22:32:06 +10:00
sam 2897838e6a feat(ratelimit): add window-based stale-entry eviction
EvictStale sweeps the per-key hit map and removes entries whose hits
have all aged out of the sliding window, so a long-lived limiter
driven on a ticker doesn't accumulate one map entry per identity for
the life of the process. The package doc now states the map is
unbounded until something actually calls EvictStale, rather than
claiming it's bounded by a mechanism nothing yet wires up.
2026-08-15 22:25:07 +10:00
sam 6c9d446742 docs: add Beads tracker guidance to CLAUDE.md 2026-08-15 14:12:08 +10:00
sam 2a6ee4cb45 chore(release): archied v1.9.3 archie v1.9.3
deploy / gate (push) Failing after 2m18s
deploy / build-and-push (push) Skipped
2026-08-15 12:53:52 +10:00
sam 20bff1a367 feat(agentexec,workflow): surface tool calls on the task timeline
archie-core-467 wired tool-call visibility into the interactive chat
gateway, but a workflow task's own transcript never showed what its
tools actually did -- only stage/agent-finish events existed, so
there was no way to confirm an agent's summary matched what it really
ran.

Adds a ToolCallReporter, invoked once per completed call from
toolExecute (the single choke point every tool call passes through
before reaching a model), reported via a new ToolSetOptions.OnToolCall
hook. Runner.Run grows a report parameter to carry it in: InProcessRunner
wires it through, since it executes in the same process as its tools;
SubprocessRunner and NATSRunner accept and ignore it, since their tool
calls happen in a different process with nothing here to observe them.

The workflow engine turns each report into a tool_call event on the
task's own Bus (agent.go, implement.go), riding the same NATS
event-forwarding archie-core-518 already built to get container
events onto the daemon's timeline.

Scoped to the central tool registry (read/write/edit/grep/shell/...)
built via BuildToolSet; capture tools (structured finish output) and
run_go_script build their ToolSet entries directly and are not yet
covered.
2026-08-15 12:53:41 +10:00
sam a237a35532 fix(agentworker): back off before refetching a nak'd stage message
On a stage-handle failure, the main loop logged the error, called
Nak (which requests redelivery), and looped straight back into
FetchStage with no delay -- unlike the fetch-error branch three lines
above, which already backs off for a second. A deterministic failure
(a broken gate, a malformed request) therefore refetched and failed
again immediately, flooding the log with one "handle failed" line per
loop iteration instead of per genuine retry -- hundreds of identical
lines within the same second in production.

Adds the same time.Second backoff after Nak.
2026-08-15 12:53:31 +10:00
sam 95ca1cad6d fix(logging): resolve error attrs to their message string, not {}
SystemLogHandler and FeedHandler both json.Marshal Entry.Fields
directly rather than through slog's own JSON handler, so a logged
`error` value went straight into a map[string]any as the raw
interface. encoding/json has no Error()-aware special case, and the
concrete type behind almost every Go error (errors.errorString,
fmt.wrapError, ...) holds only unexported fields, so it marshalled to
`{}` and silently discarded the message everywhere it was logged --
including on every container/system-log line shipped to the daemon
and shown in the webui, which is where this was actually noticed: a
flood of `"err":{}}` with no way to see what had actually failed.

attrValue now resolves an error attr to its .Error() string before it
reaches the map. It also guards against the classic Go footgun where
a non-nil error interface wraps a nil concrete pointer (var e *T; var
err error = e) -- a naive err != nil check would call Error() on a
nil receiver and crash the one thing that must never crash: logging
itself.
2026-08-15 12:53:24 +10:00
sam 824c53b297 fix(webui): scroll selected command into view on keyboard navigation
Arrow-key navigation in the chat composer's command menu updated
aria-selected but never scrolled the option into the visible area, so
selecting past the viewport with the keyboard left the highlighted
item hidden. Mouse scrolling already worked since it doesn't rely on
selection state.
2026-08-15 12:05:52 +10:00
sam 3570f600d4 chore(release): archied v1.9.2 archie v1.9.2
deploy / gate (push) Failing after 3m24s
deploy / build-and-push (push) Skipped
2026-08-15 11:22:35 +10:00