task check's go fix pass rewrote the test helper to Go 1.26's generic
new(v) and marked it //go:fix inline. Committed from the gate rather than
left dirty in the tree.
Origin validation compared the request's Origin against the daemon's own
direct connection: scheme from r.TLS, host from r.Host. Behind a TLS-
terminating reverse proxy the browser sends Origin: https://host while the
daemon sees a plain HTTP connection, so every dashboard mutation was
refused as cross-origin.
Taking X-Forwarded-Proto/-Host unconditionally would be worse than the bug:
any client can set them, so an exposed daemon would let an attacker forge
the scheme half of the CSRF check. They are honoured only when
web.trust_forwarded_headers is explicitly enabled, which is off by default
and documented as safe only behind a proxy that overwrites or strips
untrusted forwarded headers.
authorizeTaskMutation becomes a method because the decision now depends on
server configuration; its three call sites move with it.
Follow-up to 0b2398f, which claimed non-delivery is never silent and that
oversized files fail visibly. Both claims had gaps.
chatStreamSink.Media skipped any attachment with an empty URL, exactly as
liveReply.Media used to. The tool registry is shared between the Telegram
and dashboard chat setups, so send_file is offered on the dashboard too:
the model announced a sent file, the sink dropped the event, and nothing
reached the transcript. The dashboard cannot upload at all, so the fix is
to REPORT the file as undeliverable and name where it is on the host,
rather than to stay quiet. The skip was right while media meant a hosted
URL; it stopped being right when a host path could arrive here.
send_file applied one 50MB ceiling to every type while the sender enforces
10MB for photos, so an 11-50MB image passed the early check, was reported
sent, and was rejected by a layer the model cannot see. The early check is
now per-type and mirrors the sender's limits.
MediaType called every image/* an image, but a photo endpoint rejects
image/svg+xml and image/tiff outright. Photo-safe formats are now an
explicit set, so an svg goes as a document and arrives, which is what the
"unrecognised means document" reasoning intended all along.
Also tests the readability probe's own error path (mode 0000), which was
the one case it exists for and the one case not covered; verified it fails
with the probe removed.
Remaining review findings are filed, not fixed: fallback lines appended
after the live reply finalizes are dropped by a stopped renderer
(archie-core-atv2), confinement is symlink-blind and re-opens after
checking (archie-core-jkmu), and concurrent uploads are uncapped
(archie-core-3svc).
The agent could produce a file -- a transcript, a log dump, a screenshot --
and had no way to hand it over. Asked to send one it offered a "download"
link; nothing arrived and it had no signal that anything had failed. The
defect was not that it lied: success and silent non-delivery were
indistinguishable to it.
Three places made a local file undeliverable, and each is fixed here:
- liveReply.Media skipped any attachment with an empty URL, so a local
file was dropped before it ever reached a sender.
- telegramMediaSender built every attachment as models.InputFileString,
which tells Telegram to FETCH the string as a URL. A host path is not
fetchable, so the send did nothing while reporting success. It now
chooses by what the attachment carries: URL -> fetch, Path -> upload
via models.InputFileUpload over an open file.
- Nothing let the agent ask for a send at all. New send_file tool
(internal/tools/sendfile) validates the file and returns a
MultimodalResult naming it; the turn's channel delivers it.
Meaning changes, called out because the names did not:
- MediaAttachment gains Path, the alternative to URL. Exactly one is
meaningful for an outbound send.
- tools.MultimodalResult.URLs used to mean remote-hosted media only; it
now means media this result wants delivered, which may be local. JSON
name unchanged so existing producers keep working.
- errNoURL is now errNoSource: having neither source, not having no URL,
is what makes an attachment undeliverable.
Failures are visible at every layer, which is the actual fix. send_file
errors on an absent, irregular, unreadable, oversized or confinement-
refused path, so the model sees it and can report it. The sender checks
Telegram's ceilings (10 MB photos, 50 MB otherwise) before the request and
reports the real size rather than leaving a 400 nobody reads. A delivery
that still fails now appends "could not send <name>" to the reply instead
of an empty link, which read as a delivered file.
Exposing a public URL for local files was explicitly rejected: it trades a
missing feature for a hosting and access-control problem.
send_file resolves paths through builtin.ResolveReadable -- the read tool's
own policy, exported rather than reimplemented -- so sending cannot reach
what reading cannot, whatever [chat] unrestricted_filesystem is set to.
When an operator stopped a running task via chat /stop or the dashboard
Stop button, the task's context was cancelled. Container teardown
correctly completed (as Pool.Release detached its context), but terminal
state recording in Daemon.runViaAgent and worktree cleanup in
Daemon.cleanupTerminalTaskWorktree executed using the same cancelled
context. Consequently, SQLite transactions in store.Transition failed
immediately and errors were discarded, leaving the task row in 'running'
indefinitely until a daemon restart.
Extract parkRunningTask in internal/daemon/daemon.go to perform guarded
state transitions (store.StatusRunning -> store.StatusParked) using a
detached context (context.WithoutCancel) with a bounded 10-second timeout.
Update cleanupTerminalTaskWorktree to also use a detached 10-second
context for looking up the task status. Check transition errors and log
warnings for unexpected database failures while suppressing expected
ErrStaleTransition returns when workers have already completed. Add
comprehensive table-driven regression tests covering task cancellation,
worktree cleanup, and logging behavior.
Adds the task_action tool to internal/gateway/task_tools.go and wires it via
chatTaskActorAdapter in cmd/archied. This enables operators in chat to execute
lifecycle actions (abandon, archive, retry, stop, cancel, approve, reject) on
tasks using the same action path and state machine as the dashboard.
Enforces identity scoping so an instance cannot mutate another identity's
tasks, verifies status permissions via internal/taskstate, and classifies the
tool as mutating with required human approval.
Section 1 of the adversarial self-review decision was superseded on
2026-08-24: it assumed daemon-owned in-process execution and a daemon-side
second Pool.Acquire, both removed by archie-core-q15y. It is now re-decided
rather than merely marked dead, so the document is Active again.
The reviewer is an agent.Subagent run from inside the task-scoped worker.
ai-sdk v0.1.22 is already pinned, so this needs no SDK bump, and it adds no
host executor, no second container acquire and no nested container lifecycle
-- the open question the supersession left.
Subagent.Run passes Prompt and never populates Messages, so conversation
isolation is a construction fact rather than prompt text. It does NOT give
filesystem isolation: the sub-agent shares the parent's process, working
directory and credentials, so the .git-stripped snapshot survives from the
original design and is load-bearing, and the reviewer's toolset must be
read-only, rooted at the snapshot, and must exclude the worktreerpc
publication grant -- otherwise a reviewer could push the branch it exists to
block. Run() not Tool(), so the implementer cannot elect to review itself.
Findings return through a closure-captured tool because Run yields only text,
and are read even when Run errors, since captured findings survive.
Also decides fail-closed: a review that fails to RUN parks the task rather
than opening an unreviewed PR. ReviewEnabled is opt-in, so an operator who
turned the gate on wants the gate. This is why h019.2 models "ran and found
nothing" separately from "did not run" -- collapsing them would make an
outage indistinguishable from a clean review.
h019.3 is unblocked and rewritten with the construction rules. h019.4's
description said the task parks as waiting_human, contradicting section 4's
decision of StatusParked; corrected, and the fail-closed rule added.
Delete the redundant package doc comment from review_findings.go to preserve
workflow.go as the single canonical package comment, and consolidate the
package-level decision function to a single ReviewBlocking export mirroring
gate.Blocking.
Define the ReviewFinding and ReviewReport domain types, enums (verdict,
level, category, disposition, status), and pure decision functions for
adversarial review stages.
Enforces the load-bearing rule that only confirmed error findings may
block workflow execution; plausible findings, regardless of severity,
never block. Explicitly models the distinction between an unexecuted
review stage (ReviewStatusNotRun) and one that completed with zero
findings (ReviewStatusCompleted), ensuring data boundaries across JSON
are robust and unambiguous.
strings.Index plus slicing becomes strings.Cut. Semantics are unchanged:
Cut splits on the first separator, so before/after equal the previous
title[:idx] and title[idx+1:], and ok mirrors idx != -1.
Tasks completing with BuildNoChanges transitioned directly to StatusMerged
without opening a pull request, bypassing the only production worktree
cleanup path inside reconcilePRs (which only queries StatusPROpen tasks).
As a result, every no-change task leaked a full git clone on disk.
Clean up the identity-correct worktree on terminal non-PR completions:
- In daemon.process, invoke cleanupTerminalTaskWorktree using the task's
identity-resolved worktree manager when the task reaches a terminal
status (Merged/Rejected/ClosedWontDo) with PRNumber == 0.
- Ensure parked tasks and open-PR tasks retain their worktrees for
post-mortem triage and PR reconciliation respectively.
- Add lifecycle regression tests in internal/daemon/terminal_cleanup_test.go.
Fix three distinct bugs in worktree operations:
- Push post-publication metadata failure no longer reports a push error after successful ref publication; errors recording upstream tracking are logged as warnings via Manager.Log/slog.Default().
- CommitAll honours context cancellation and deadline expiration before and between go-git staging and committing phases, preventing unintended index or HEAD mutations.
- Align branch naming precedence by deriving conventional commit prefixes from issue titles first before falling back to labels and defaulting to feat; remove dead parameters and TrimSuffix no-op; align branchSlug documentation and boundary limit to 60 characters.
The beads DB rebuild that left .beads.backup-pre-recovery/ reverted every
closure recorded after its backup point. The code was never lost, only the
tracker state, so 16 issues sat open against work that had already shipped.
Restored those 16 from .beads/interactions.jsonl, taking the last status
change per issue and keeping each original close reason verbatim. Closed a
further 12 after verifying the work on main: the whole q15y epic
(1b7bc00, cc6b093, 5d00ec7, 972fb5b), mzok, bia3, hqst, and 1ysw.1/.2/.4/.5.
Superseded two orphaned re-imports of t2db.3 and t2db.5.
Rewrote the four surviving 1ysw descriptions with verified reproductions;
1ysw.9 in particular claimed a checked-in FIXME that no longer exists.
GitHub is now 561/561 in agreement with beads. dfck's close reason said its
opt-in lived in InProcessRunner, which q15y.3 deleted; the mechanism moved to
agentexec.NewLoopRunner (loop_runner.go:106) and the reason now records that.
tb3a's said its worktree was left uncommitted; it merged as 1e5e1fb (PR #477).
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.
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.
Autonomous tasks no longer execute workflow stages inside archied; missing worker capability parks before worktree preparation.
A transition to parked now atomically makes its detail the task park reason, so daemon-side failures remain visible in task APIs and the dashboard.
Pre-existing code `task fmt` rewrites on every run: a manual clamp to
`max`, and a `strings.Split` range to `strings.SplitSeq`. Both are
semantically identical; committing them keeps the gate from reporting a
dirty tree on unrelated work.
Adds internal/domain/scheduling, the timing half of the cron/scheduling
epic (archie-core-1786637496320-249-be6d9a20): a tick loop that asks a
JobSource what is due at a configurable cadence and dispatches each due
job to the pool it declares.
The package owns *when* a scheduled job runs and nothing else. The job
store, blueprints and delivery routing are separate issues in that epic,
so the engine declares the two contracts it needs from them (JobSource,
Runner) and names no implementation. That is what lets the timing
behaviour be tested against a fake clock with no store, no NATS and no
model.
Behaviour worth stating explicitly, because each is load-bearing:
- The source is authoritative about what is due. The engine applies no
schedule arithmetic of its own, so cron expressions, fixed intervals
and catch-up windows stay the store's decision.
- A job never overlaps itself. While a run is queued or in flight, later
ticks reporting the same ID are skipped rather than stacked, so a job
slower than the interval runs back-to-back instead of fanning out.
- The pools do not interfere: a blocked sequential job cannot delay a
parallel one, and a saturated parallel cap cannot delay the sequential
worker. They share only the tick.
- An empty Pool means sequential, not parallel. Wrongly serialising a
job costs latency; wrongly parallelising one costs correctness.
- Every failure is contained and reported: source error, job error, job
panic and job timeout each emit an event and leave the loop running.
- Stop drains gracefully. Run contexts descend from Background rather
than the loop context, so halting the loop stops new work without
yanking the context out from under a run already in progress; the
caller's deadline is what eventually cancels those.
- An engine is single-use. Restarting after Stop is refused because Stop
leaves the dropped backlog and the claims of runs it did not wait for
behind, and a restart would re-run stale queued jobs while permanently
suppressing the claimed ones.
internal/events gains job_run/job_error: a scheduled run has no task and
no chat turn behind it, so without those kinds a job that fired, stalled
or failed is invisible everywhere.
cleanUntracked returned filepath.SkipDir for the ".git" entry
unconditionally. On a non-directory, SkipDir skips the remaining
entries of the *parent* directory -- at the worktree root that is the
rest of the walk. A repository whose .git is a gitdir pointer file
(a linked worktree, or a clone adopted by migrateLegacy) therefore had
cleaning silently no-op, and CommitAll staged and published the
previous attempt's abandoned untracked files onto the task branch.
Suppress descent only for the directory shape; the pointer file is
skipped as an ordinary tracked-path miss would be, and left intact.
Refs archie-core-1ysw.3
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
Build selected components from a temporary worktree at the exact approved tag commit instead of the moving branch tip. Validate release version inputs and require combined component tags to resolve to the same source commit.\n\nRefs #606
Carry the revalidated update snapshot through the installer contract so the shell adapter receives an explicit per-component plan. Build, back up, install, and roll back only selected components, and pass the runtime release version into agent image builds.\n\nCovers gateway-only, runtime-only, combined, and no-op updates.\n\nRefs #606\nBead: archie-core-462t