Commit Graph
7 Commits
Author SHA1 Message Date
sam cb2e1c25dc fix(gateway): cap task_spawn titles and carry instructions into the body 2026-10-26 18:24:47 +11:00
sam ff424b70ac refactor: testing from the beginning. a journey in 150k lines of tests to none 2026-10-03 21:16:25 +10:00
sam bae53bcb70 feat(pr-review): benchmark live pipeline through generic workflow spawn 2026-09-29 00:35:34 +10:00
sam 48133e68fe feat(logging): cursor pagination and filtering for task_logs
task_logs could only read the newest N entries with no way to walk the
rest, so a task's log beyond the page cap was unreachable and the agent
had no honest way to say what was missing. Add logging.Page -- a
byte-offset cursor over the tail-most 8 MiB scan window -- plus
Query.Since/Until time bounds, and wire the gateway's task_logs tool to
expose level/since/until/after_id with cursor and more_available in the
result.

The reader now reads the scan window into a single in-memory buffer and
walks it by exact slice offsets. Offsets into a contiguous buffer are
trivially correct, which an incremental reader over the file is not:
bufio.Reader buffers ahead, so its underlying file position runs one
buffer past its logical position and cannot be used as a cursor. The
same rewrite removes f.Read in favour of f.ReadAt (full-or-error), since
a silent short read would drop the newest entries and still report
success.

The scan window is a documented hard ceiling: for a log over 8 MiB the
oldest bytes are unreachable by any cursor -- that is what Truncated
reports, and send_file remains the path for a complete archive. The
tool description teaches the model the difference between more_available
(more this call did not return) and truncated (older entries the scan
cap hides).

Closes archie-core-vq92 (#625).
2026-08-26 02:02:36 +10:00
sam 64da3952aa feat(gateway): add task_action chat tool for operator task management
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.
2026-08-25 01:19:21 +10:00
sam e4385ef266 feat(webui,gateway): add /api/tasks/{id}/logs endpoint and task_logs chat tool
Adds two read surfaces for per-task persisted log history so an operator
can answer "why did task N park?" without needing to watch docker ps in
real time — the deployment model documented in CLAUDE.md.

/api/tasks/{id}/logs — built on logging.Tail the same way /api/logs
already is, defaults attempt to the tasks current Attempt from the store.

task_logs chat tool — lets Archie read task logs from Telegram or webui
chat. Identity enforcement matches chatTaskListerAdapter: a model bound
to one identity cannot read another identitys logs, and forge tasks
(empty identity) are denied.

internal/logging: add TaskRegistry.Path() for read-side access without
threading baseDir separately through every caller.

Fixes from adversarial review: strict identity check (no empty-identity
bypass), non-null Entries when disabled, component doc accuracy, and
adapter tests covering the security boundary.

Ref: #455
2026-08-09 19:14:35 +10:00
sam e10cbbc92c refactor: pre-cleanup. 2026-08-06 01:40:15 +10:00