StageBaselineGate captured a failing gate command's full output but
discarded it: a 200-char clip went into a Warn log, and the terminal
error carried only res.Status. A park reason like "go build ./...
fails ... (status: failed)" gave no way to see the actual compiler
error, and the container that had it is already gone (AutoRemove).
Now the park error carries a bounded tail of the real output (tail,
not head, since a failing test's explanation is at the end after
pages of "ok" lines), rune-safe so it can't emit invalid UTF-8 into
a persisted park reason. The three existing byte bounds in this
stage (log line, agent mission, park error) are named and documented
as independently sized rather than left as bare numbers.
Also adds docs/architecture/observability.md, the design doc for the
larger task-observability epic (#450) this fix is the first step of.
Fixes#444
.chat-page previously used min-height: calc(100vh - 5rem), which is a
floor, not a cap. Any dynamic content pushed above .chat-layout (an
error banner, extra status pills, the "Reload Telegram"/"Check
updates" row wrapping to two lines) grew total page height past the
viewport, so the whole page scrolled instead of just
.chat-transcript.
Turn .chat-page into a fixed-height flex column (height, not
min-height, plus overflow: hidden) so it can never grow past its
viewport budget. .chat-page-content, .chat-topbar, .chat-update-panel
and .chat-dangerous-panel become flex children that size to their own
content, and .chat-layout switches from a min-height floor to
flex: 1 1 auto; min-height: 0 so it absorbs whatever space is left
after the topbar/banners, mirroring the minmax(0, 1fr) pattern
.chat-workspace already used internally. .chat-sidebar gains
overflow-y: auto so a long session list scrolls in place rather than
pushing the layout taller.
refreshUpdate() rendered the fetch error's raw message text into a
visible banner on every page load, including a plain "501: Not
Implemented" when chat.telegram.update_check_command is unset -- a
normal "feature not configured" state, not a failure.
Add updateUnavailableMessage() (chat-update-status.js) to branch on
ApiError.status: 501 renders nothing (matching how Channels shows a
calm "not configured" state for an unconfigured channel), any other
error gets a fixed human message instead of the raw fetch text.
Fixes#443
Composer previously required Ctrl/Cmd+Enter to send. Plain Enter now
sends (still yielding to the command-menu's own Enter handling when
it's open); Shift+Enter is left unhandled so the textarea's default
newline behavior applies. Updated the visible hint to match.
send.onclick = sendMessage bound the DOM click handler directly, so every
click invoked sendMessage(event) -- the MouseEvent became `retry`, which
is truthy but has no .turn, and retry?.turn.text threw immediately,
before any UI state changed. The click silently did nothing.
Extracted the retry/composer-text resolution into chat-retry.js's new
resolveTurn(), which only treats an argument as a genuine retry when it
actually carries a turn.text string -- a stray event (or any other
non-conforming truthy value) now falls back to the composer text
instead of crashing. Fixed the call site itself
(send.onclick = () => sendMessage()) as the actual root cause.
Fixes#447
grepBinary() resolves rg from PATH since the embedded binaries were
dropped, but nothing installed it: not the GitHub Actions runner (CI
grep tests fell back to direct search and failed), and not the
archie-agent image (Dockerfile) that runs grep tool calls for sandboxed
tasks. Production was masked by carina's host already having ripgrep
installed system-wide for archied's own tool execution.
Dockerfile.archied is unused by the current deployment (docker-compose
builds only Dockerfile; archied runs on the host under systemd) --
corrected its stale "ripgrep is embedded" comment rather than adding
the package to an image nothing builds from.
GitHub's hosted runner has no gofumpt preinstalled, unlike the
self-hosted Gitea runner this workflow was copied from -- gofumpt -w .
failed with "command not found" on the first run.
Mirrors the existing Gitea deploy workflow's gate (fmt/vet/build/test,
dashboard tests, tag<->changelog check) but publishes to
ghcr.io/samcharles93/{archied,archie-agent} using the built-in
GITHUB_TOKEN. Additive: docker-compose.yml and the carina watchtower
setup are untouched, so production still runs off the Gitea-built
images until that's explicitly cut over.
.gitea/workflows/deploy.yml is removed from this checkout now that the
Gitea remote is gone; the git.catlow.cloud-hosted copy is unaffected
until that repo is pushed to again.
All 416 beads issues (open, in-progress, and closed) are migrated to
GitHub Issues with parent/sub-issue hierarchy preserved; the 66 issues
carrying beads "notes" content had that backfilled as GitHub comments.
The local Dolt DB and .beads/ export were never git-synced (no-git-ops:
true in config.yaml), so this is a clean removal with nothing left
behind on any remote.
Composition root work tying the config resolver, channel manager, log
feed, and executable workflow registry into the running daemon and
dashboard server: web.Channels/LogFeed/Workflows/ConfigProvenance,
channel-reload wiring, TaskStopper for the Stop action, and
SpawnRequest.Body/WorkRequests threading dashboard "Start work" requests
through the same admission path chat uses. Touches all three features at
once because this is where they're composed, not owned by any single one.
Refs #53, #54, #55
Follow-up pieces of the task-controls work: store.InsertEvent factors out
an execer-generic insertEvent so SQLite gets the same zero-time defaulting
ArchiveTask's audit path relies on; gateway tests assert against
taskstate constants instead of magic status strings; the navigation
command bar gets an accessible mobile search toggle.
Refs #53
Add internal/logging.Feed, a logging-owned bounded replay buffer separate
from the persisted task-lifecycle event stream, with a live SSE endpoint.
Expose the executable workflow registry (skillbuild.Catalog) including
zero-run definitions and their origin (builtin vs. installed skill), not
just historical run statistics. Route() now returns an explicit failure
workflow for an unknown pre-assigned workflow name instead of silently
falling through to label-based routing.
Fixes#54
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
Add cancel/stop/approve/reject/retry/abandon/archive to the dashboard task
action matrix, each guarded by an optimistic status check against the
store. Retry accounting (RetryCount, max_retries) is now atomic with the
status transition instead of a separate write. Archive removes a terminal
task's local record with a fail-safe audit event first. Add always-labelled
responsive navigation, mobile Jump-to search, and versioned Setup-complete
dismissal.
Fixes#53
clean.RequestURI() echoed the incoming request's raw path/query straight
into http.Redirect's Location header. A path starting with "//" is treated
by browsers as protocol-relative, so a crafted token-exchange link could
redirect off-host after a legitimate token exchange. sameOriginPath()
collapses any leading "//" before the value is ever used.
Fixes#440
Adds a human-consent gate for tools marked RequiresApproval, exposes
session management as LLM-invokable chat tools, and gives the operator
/delete to retire conversations permanently.
**Tool-approval gate (internal/tools, internal/agentexec)**
- ApprovalRequester contract lives in internal/tools (not gateway) so
agentexec can import it without pulling in the chat-adapter stack.
- ToolSetOptions.Approval wires the approver through to toolExecute.
- BuildToolSetFrom omits RequiresApproval tools when no approver is
configured; dispatch paths (invokeTool, tool_call bridge) refuse
them too, so the invariant holds at every indirection.
- The gate fails closed: only Approved/PermanentlyApproved pass;
an unknown decision value from a faulty approver does not execute.
- Tool-level timeout (2 min) returns a plain error, not a context
cancellation, so the model can report "approval timed out" instead
of the turn aborting.
- BuildApprovalDescription callback lets a tool surface the specific
resource being acted on ("Delete session \"abc123\"") rather than
showing a static tool description.
**Session tools (internal/gateware/session_tools.go)**
- session_list (idempotent), session_resume (mutating), session_title
(mutating), session_delete (mutating + RequiresApproval).
- Scoped to the current platform + channel: GetByChannel replaces
List() so a model in chat A cannot list or manipulate chat B.
- session_title validates the session belongs to this channel before
writing; session_resume/session_delete resolve refs against the
channel-scoped list.
- Shared limit helper extracted to tools.ListLimit.
**Telegram approval adapter (internal/channels/telegram/approval.go)**
- telegramApprover implements ApprovalRequester via the three-button
inline keyboard (Approve/Permanent/Deny). 2-min token expiry.
- Own map + mutex + "approval:" callback prefix — separate from the
dangerous-command system.
- Permanent approval uses exact-match (not prefix) lookup keyed by
action + resource description, so permanently approving "delete
session abc123" only covers that one session, not every call to
session_delete for 24h.
**Session lifecycle**
- /delete <session-id>: removes a session and its history. Refuses
prefixes shorter than 4 chars even when unique. Exact ID wins over
an ambiguous prefix. sessionTracker.forget sweeps every channel+
thread pointing at the deleted session.
- Extracted resolveSessionRef and shortSessionID for /resume and
/delete to share.
**Wiring**
- submitTurn builds the approver onto ctx before the LLM turn.
- chatGenerateOptions reads approver from ctx, passes it through
ToolSetOptions.
- SessionTools built per turn on the current message, combined with
taskTools into a single toolset.
Multi-identity daemon isolation:
- Split runIdentities into per-identity poll loops plus one shared
maintenance-and-drain loop, so reconcilePRs and storage cleanup run in
multi-identity mode and the global max_concurrency / per-repo
serialization holds across identities.
- Make the poll path identity-aware: each identity polls with its own
forge client, bot user, label, trigger, and ack reaction.
- Make allowConcurrentFor task-based and identity-aware via repoFor.
- Roll back storage mounts when container acquisition fails; log
Store.Update failures after branch set.
Container-mode RPC identity routing:
- forgerpc/worktreerpc gain identity-scoped subjects (SubjectFor,
RegisterFor) and identity-carrying clients.
- registerTaskRPCServers registers one server pair per identity (plus
root), so a container-mode task owned by a non-root identity is served
by its own forge client and worktree manager.
Gateway/Telegram:
- LLM-proposed session titles generated in the background after turns
(TitleGenerator + chatTitleGenerator), persisted by the gateway.
- /delete session command with prefix guard and tracker forget.
- Shared session display helpers (shortSessionID, sessionDisplayTitle,
resolveSessionRef).
- Reword docs and comments to drop vague "legacy" qualifiers where they no longer describe deprecation status
- Remove unused code: RecentEvents, MessageEvent.ToLegacy, index setState, stderr redaction tool, telegramOnlyCommands
- Delete or comment out tests covering removed or superseded behavior
NellDB v0.3.0 skips meta:* ids when rebuilding its rev cache on open, so
after any restart the counter Get returned a _rev with no cache entry and
every RMW Put failed with sdk: revision conflict -- task enqueues and
event inserts were permanently broken.
- Counters move to counter:task_id / counter:event_id.
- migrateCounters seeds the new keys from the legacy docs at open; any
read/write/validation failure aborts OpenStore so allocation can never
silently restart at 1. Legacy docs stay in place, skipped by scans.
- isReservedKey matches the counter ids exactly (a counter: prefix rule
would hide every task in a repo owned by "counter").
- Existing counters are validated (next_id >= 1) at open and at allocation.
- EnqueueIssue persists identity, which it previously dropped.
- Tests: reopen regression with exact post-reopen IDs and event
preservation, migration sequence carry-over for both counters,
fail-closed on read/write/invalid values, counter-owned repos,
identity round-trip.
Adversarial review: zero surviving findings.
A completed chat turn is published as turn_completed from the single
responder choke point shared by the telegram and web gateways
(redeliveries return earlier and never emit). The runtime wake path
forwards ONLY primary-input kinds to input-driven curators; curator-
produced activity (curator_run/action/error and any future derived
kinds) never appears on that path, so a curator that writes memories
cannot schedule itself again — the feedback-loop guard, with the
rationale recorded in the regression test so it is not removed as
redundant.
The bus subscription is bounded and dropping, so the wake path can
never backpressure the chat publisher; a dropped event only delays a
run to the next check-in.
internal/curator is a conforming engine family per the strict plugin
engine rule: typed CuratorEngine contract (Lifecycle + domain ops),
owning Registry (registration, discovery, start/health/stop with
failure isolation, reverse-order shutdown, ctx-bounded stop), and a
narrow typed Registrar — each curator receives a capability-filtered
view of the host at Bind, never the daemon.
Runtime: one loop per curator on an injectable clock (fake-clock
testable), best-effort wake nudges with the trigger decision kept in
Check (a dropped nudge only delays to the next check-in, never
corrupts accounting), per-pass timeout and a max-concurrent-passes
slot so curator bursts cannot starve chat turns, per-pass panic
recovery, and bounded shutdown even when a pass ignores cancellation.
curator_run / curator_action / curator_error ride the in-process
event bus so activity stays attributable.
Wired in cmd/archied/main.go (constructed beside memory, Start after
daemon startup, shutdown ordered before memory/LLM teardown) and
exposed as daemon.Daemon.Curators.
internal/infrastructure/configuration/setup.Run drives operator
identity, LLM provider, models, forge, and Telegram chat channel
prompts and returns TOML edits -- not a config.Config. Building a
parallel in-memory representation to validate against was rejected
during design review: it's a second source of truth about the exact
thing (text vs. struct disagreeing) this whole feature exists to stop.
Tests instead render the edits against the real embedded template and
load the result through a real configuration.Loader, proving the
actual defaults/decode/validate path accepts it.
Two boot-time landmines in config.example.toml surfaced by that
approach, both fixed here:
- [providers.openai] ships active with api_key pointed at the bws
engine. cmd/archied/provider_secrets.go resolves every entry in
cfg.Providers at startup, not just the ones [models] references, and
refuses to start the daemon if any fails -- so picking any other
provider (or picking openai but skipping the key) left a config that
wouldn't boot on a machine without the bws CLI installed (the common
case). stepProvider now neutralises providers.openai.api_key to the
zero-value secret ref whenever openai wasn't the actual choice.
- [[repos]] shipped active with a placeholder owner/name that
validates cleanly (owner/name are only checked non-empty) and would
have archied silently polling a repo that doesn't exist. Commented
out in the template with an explanation; setup does not write this
section since tomlwrite cannot target array-of-tables.
TestExampleConfigLoads updated to expect zero repos.
Also: forge and provider secret env-var names are each defined in one
table (forgeToken, cloudProviders) read by both the config edit and
the secret sink, so the two can't name a secret differently -- the
exact bug class this feature exists to close for the installer, tested
directly (TestRun_ForgeTokenKeyMatchesStoredSecretKey compares the
decoded key against the key the secret was actually stored under, not
a hardcoded literal on both sides). Telegram writes chat.telegram.
token_env, not a secret.SecretRef -- TelegramConfig has no such field.
Telegram also requires at least one allowed_user_id: AllowedUserIDs is
deny-by-default, so a bot token with none configured answers nobody,
which reads as broken rather than as the safe default it is.
SecretSink is a caller-supplied sink (Put buffers, Commit persists),
not a return value: Run never hands back plaintext secrets, and the
caller is expected to call Commit only after proving the generated
config loads -- so a validation failure never leaves a secret written
without the config that references it.
Refs archie-core-cbk
archie-core-via. internal/infrastructure/configuration/setup defines
Prompter -- Select, ReadLine, ReadSecret, Confirm, all context-aware --
which is all the setup step logic (to follow) needs from a prompt
surface. No terminal dependency, so steps are testable without a TTY.
internal/infrastructure/terminalprompt.Terminal is the real
implementation, using golang.org/x/term. New refuses construction when
its input isn't a real terminal, with a message naming the problem --
enforcing "a non-TTY invocation fails with a clear message rather than
writing a partial config" at the earliest possible point, rather than
falling back to a plain read that would silently accept piped/scripted
input (ssh, `archied setup < answers.txt`, CI). Terminal satisfies
Prompter structurally; this package does not import that one, so
there's no infrastructure -> infrastructure edge for what Go's type
system already gives for free.
Each blocking read runs in a goroutine raced against ctx.Done(), so
Ctrl+C returns promptly instead of leaving the operator stuck; the
losing goroutine is abandoned on cancellation; term.ReadPassword's own
raw-mode restoration is not interruptible, so an abandoned secret read
can leave the terminal in raw mode until it unblocks on its own --
documented on Terminal.readSecret rather than worked around, since a
cancelled setup command is expected to exit shortly after via its own
signal handling anyway.
Tested by constructing a Terminal directly (bypassing New, same
package) over a plain pipe with an injected readSecret seam -- New's
TTY gate itself is exercised separately against a real os.Pipe(). No
weakening of the production constructor for testability.
Refs archie-core-via
Loader.finalize's decode-then-validate sequence called an unexported
validate(cfg *config.Config), so nothing outside the package -- e.g.
archied setup, which builds a config.Config in memory before writing
it to disk -- could run the same checks. Validate wraps it; Loader now
calls the exported form internally (single call site, no behavior
change).
Documented the sharp edge this alone doesn't solve: Validate doesn't
apply defaults (agent.mode, dispatch.trigger, forge.type all only pass
once defaulted), and defaulting is still an unexported method on
*Loader. A cfg setup builds by hand needs those fields filled in
itself, or -- safer, since it can't drift from the real load path --
setup should render to TOML and load it back through a Loader rather
than call Validate on the in-memory value directly.
Refs archie-core-ewk.1
activeHeaderRe/commentedHeaderRe were anchored with no allowance for a
trailing "# ..." comment on the header line itself. config.example.toml
has four such headers -- "[models] # role -> ...", [indexing], [web],
[notify] -- so Apply never recognised them as table headers at all. An
edit targeting "models" fell through every matching stage and got
appended as a second, duplicate [models] table at EOF, which
BurntSushi/toml then refuses to decode ("Key 'models' has already been
defined").
This is a real blocker for archied setup (archie-core-cbk): the models
step targets exactly this table. Found via plan review before writing
setup itself, rather than by setup's own tests discovering it later --
would have made the failure look like a setup bug rather than the
tomlwrite one it actually is.
Refs archie-core-ewk
--force was advertised in --help, accepted, and inert (FORCE_BUILD was
set and never read -- go build already rebuilds unconditionally).
Removed the flag and its help line rather than fake an up-to-date
check that go build's own cache already makes unnecessary.
Unknown flags fell through the case statement with no default branch
and silently kept every default, so a typo like --no-systmd installed
the systemd service the user asked to skip. Unknown options now print
a diagnostic naming the bad flag and exit 1, per the (a) option agreed
2026-07-30: this is a hand-run interactive installer where typos
dominate and silent wrong behaviour is the worst outcome.
Linger detection grepped for "Linger=no" and treated any other output
-- including a failed or empty `loginctl show-user` from a missing
logind session, a container, or unset $USER aborting under `set -u`
-- as "already enabled" without observing anything. Detection now
requires a positive "Linger=yes" and falls through to enable-linger
(idempotent) in every other case, and uses $(id -un) instead of $USER.
Refs archie-core-bfw, archie-core-c6o, archie-core-utt
Verified manually: bash -n syntax check; a real invocation of an
unknown flag (exits 1, no side effects, before any build/network
step); the linger branch logic exercised in isolation against stubbed
loginctl output for Linger=yes, Linger=no, empty output, and a failing
command. No shell test harness (bats or similar) exists in this repo
yet, so this is direct verification rather than a committed test.
Push previously handed an empty token straight to go-git and let the
push fail with a bare transport/auth error. When a repo is configured
while the forge is disabled (missing credential), that failure surfaced
late -- at push time -- with a message that didn't explain the cause.
Push now checks whether the worktree's origin remote is HTTP(S) (the
only transport that needs a token) before attempting the push, and
fails immediately with a message naming the missing forge.token
configuration. Local/file transports (used by the test double) are
unaffected -- they never needed a token.
Refs archie-core-3fb
The WalkDir callback swallows every per-entry error and returns nil,
so the only error that can escape is ctx.Err() from the cancellation
select. The old guard compared that error against itself and never
fired, so a timeout or /stop fell through to whatever partial matches
had accumulated, or "no matches found" when it had none -- telling the
model a search found nothing when it never finished.
Refs archie-core-ts9
The layering was written down in docs/architecture/organisation.md and
approved, but nothing an agent reads first pointed at it. Reading
internal/ cold shows ~35 packages side by side, so the obvious move is
to add a thirty-sixth -- which is how the flat layout kept regrowing,
and untangling it cost a week.
The section states the four layers and their ownership, names the
dependency direction as the invariant, and explains why the layers stay
under internal/: it is a compiler-enforced visibility boundary, so
hoisting one to the repository root would make Archie's domain types
importable by any dependent module and commit us to API stability on
exactly the code that most needs to keep changing.
Cross-cutting packages get a checkable definition rather than a vibe: a
package that may be imported by any layer and imports none of them.
logging, events, eventbus and taskstate each have zero inward imports
today, which is what lets them sit outside the dependency direction --
they are sinks, never sources. It doubles as the failure test: the
moment one imports a domain type it has become misfiled domain code.
Deliberately no shared/ directory. A directory named for a category
becomes where things go when nobody can say what they are.
Refs archie-core-5d7
Brings the chat surface to the Web UI: /api/chat with its own handlers
and tests, a self-contained ui/src/chat feature folder, and the shared
plumbing to reach the same router Telegram uses.
Includes a dangerous-command approval path (internal/gateway/dangerous.go,
internal/webui/dangerous.go, and the Telegram counterpart) so /rollback
and /stop are gated the same way on both surfaces, persona handling for
web sessions, and release-update formatting split out of the Telegram
service so both can render it.
web_parity_test.go pins that the two surfaces expose the same commands.
Authored in a parallel session; committed here so it lands with the rest
rather than sitting uncommitted while other work builds on top of it.
task check passes with it in place.
Screenshots used while building are gitignored (*.png) rather than
committed, matching the call made on the earlier design reference.
cmd/archied opens nell.OpenStore, not internal/store. Adapter.Transition
and Adapter.Requeue accepted a from status and never read it: they loaded
the document, overwrote the status and put. ErrStaleTransition could not
occur, so every compare-and-swap the callers depend on was absent in
production while passing in tests, which use the SQLite store.
Measured on the adapter: eight concurrent dashboard retries requeued one
task four times; twenty concurrent IncrementRetryCount calls landed a
count of one, so the retry cap added in 170fe02 could be evaded
indefinitely by holding Retry down. The same gap made approve and reject
read-then-write races -- a waiting_human task the daemon had since
claimed could be yanked back to queued and executed twice.
All three now take the adapter's existing mutex and check the guard. A
document store has no conditional update, so read-then-write has to be
serialised; the daemon is a single process, which is where the
concurrency is. No internal caller holds the lock when calling these, so
there is no self-deadlock.
Found by the adversarial review. It is the clearest argument yet for the
conformance-suite pattern: the guarantee was tested only on the backend
nobody runs.
Six defects, four of them introduced by the fixes in dbacb96, 44d43ef,
d5e016e, de1a899 and 4d44ef7. This is the third round in this codebase
where a round of fixes broke something the next round caught.
SANDBOX SILENTLY DROPPED. startContainers degrades a failed container
pool to nil, and the daemon's only test was `if ContainerPool != nil`.
So `containers.enabled = true` plus a missing agent image ran every
task's agent loop in-process, with the daemon's own authority and the
host filesystem -- the one thing [containers] exists to prevent -- while
logging only that containers were disabled. Nil now means two things and
they are distinguished: SandboxRequired parks the task instead. The
daemon still stays up; chat and the dashboard are unaffected.
SUMMARY AT THE WRONG END OF HISTORY. compressedHistory returns [head,
summary, tail], but ordering is by timestamp, not slice position. The
retained messages keep their original timestamps -- that is what
preserves their identity -- so the summary, being new, was clamped to
now and sorted after the tail it was meant to precede. The model read
the recent conversation and was only then told earlier context had been
summarised. Confirmed on both backends: index 23 of 24.
The monotonic clamp belongs to the append path, where an inbound message
must not sort ahead of the one that provoked it. ReplaceMessages is a
rewrite primitive and now honours explicit placement, and the summary
takes a timestamp inside the span it replaces.
A COMPRESSION SUMMARY ANSWERED A QUESTION. Following from the above,
PriorReply saw a bot-attributed record immediately after an unanswered
message and replayed it as the answer: a redelivered question was
"answered" with the compression banner and the model never ran. The
user's question was silently swallowed.
RECENCY STILL DIVERGED. sessionRecency preferred LastActiveAt whenever
set; SQLite used MAX(last_active_at, created_at). Those agree only when
LastActiveAt is the later of the two, so a clock step or an older record
made the caller and the store order the same sessions differently.
LASTACTIVEAT WAS NEVER UPDATED. Touch had no caller, so "resolve the
most recently active session" meant the most recently created one -- an
operator who moved to an older session with /topic and worked there was
dropped back into the newer, abandoned one on restart, which is the bug
d5e016e claimed to fix, with the direction reversed.
/branch WITH NO ACTIVE SESSION PANICKED, slicing an empty parent ID for
its default title. Pre-existing, but reachable: email and webhook call
Route directly without resolving first, and the email path runs in a
goroutine with no recover, so one message took the daemon down.
The sandbox guard has no test. The honest reason is that exercising it
needs a daemon with a forge and worktree the current harness does not
build, and a test that re-states the condition proves nothing -- which
is the same false confidence that let these regressions through.
The dashboard and chat both let an operator approve or refuse work, and
they had drifted. Declining from the dashboard left the task
closed_wont_do; cancelling the same task from chat left it rejected. Two
operators looking at one queue saw different states for the same
decision, and "rejected" -- which reconcilePRs also uses for a pull
request closed without merging -- stopped meaning one thing.
internal/gateway deliberately does not import internal/store, so it kept
a hand-synced copy of the status strings with a comment asking future
editors to keep them aligned. That is the same defect one level down,
and it is how the drift happened.
internal/taskstate is a leaf package with no dependencies holding the
lifecycle vocabulary and the rules for operator actions. gateway, store
and the dashboard all import it, so gateway stays decoupled from store
without a copy, and CheckApprove/CheckRetry/CheckDecline have one
implementation. Declined is named for what it is -- a human said no --
and stays distinct from Rejected, which is something archie observed.
Chat cancel now records Declined. That is the behaviour change: same
decision, same state, whichever surface the operator used.
Rules were preserved rather than tidied while unifying. A parked task
still cannot be declined, which both surfaces already refused, even
though "not terminal" would have allowed it -- widening a rule under
cover of a refactor is how you ship a change nobody reviewed. The
comment says where to change it if that is ever wanted.
TestDashboardAndChatAgreeOnTerminalStates drives both real surfaces
against one store, so this cannot drift apart again without a red test.
Also removes a second rule for the dash-top-standalone class: renderSetup
already reconciles it from the data at the top of every call, and a later
branch cleared it again. Harmless, but it reads as two sources of truth
for one bit of layout state.
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.