From bbcbe3153d7e327c92314c82a44320e2cf5e6ac0 Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Tue, 25 Aug 2026 01:51:04 +1000 Subject: [PATCH] chore(beads): file transcript findings -- logging, log pagination, env block, /status vs /tasks, transcript replay, silent action failures, intercom epic --- .beads/interactions.jsonl | 2 ++ .beads/issues.jsonl | 14 ++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.beads/interactions.jsonl b/.beads/interactions.jsonl index e26b14d6a..0d65cae9f 100644 --- a/.beads/interactions.jsonl +++ b/.beads/interactions.jsonl @@ -124,3 +124,5 @@ {"id":"int-997fffb13822c36e05730e69110d7602","kind":"field_change","created_at":"2026-08-24T08:15:48.90789093Z","actor":"Sam Catlow","issue_id":"archie-core-1ysw.9","extra":{"field":"status","new_value":"closed","old_value":"in_progress","reason":"Fixed: precedence is now title-first via parseTitlePrefix with a labels fallback and 'feat' default; the strings.TrimSuffix(prefix, \"\") no-op is gone; the dead body parameter is removed from archieBranch and its call site (worktree.go:131); branchSlug's doc now says 60, matching the implementation. go fix later modernised parseTitlePrefix to strings.Cut -- verified equivalent (Cut splits on the first separator; ok mirrors idx != -1). Verified by inspection rather than a red run, since the signature change prevents compiling the tests against pre-fix code. task check green; fresh adversarial review zero findings."}} {"id":"int-01f64138504555374b1349cc30e94c40","kind":"field_change","created_at":"2026-08-24T08:15:59.810530521Z","actor":"Sam Catlow","issue_id":"archie-core-1ysw","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"All 9 children complete. The P0/P1 trust-boundary and correctness defects (.1 RPC task binding, .2 colliding directory keys, .3 untracked cleanup, .4 fail-closed base resolution, .5 three-dot merge-base semantics) were already fixed on main and reconciled 2026-08-24. The remaining four (.6 push result, .7 no-change worktree leak, .8 commit cancellation, .9 branch naming contract) were implemented this session, merged as 474c31d and its two merge commits, task check green, with an independent adversarial review reporting zero findings."}} {"id":"int-df896cababb907b14b094c56b928ebd3","kind":"field_change","created_at":"2026-08-24T09:15:55.715496686Z","actor":"Sam Catlow","issue_id":"archie-core-h019.2","extra":{"field":"status","new_value":"closed","old_value":"in_progress","reason":"Implemented: workflow.ReviewFinding + ReviewReport in internal/domain/workflow/review_findings.go, merged 53bb841. The domain owns the type; gate.Finding was used as a shape precedent only, not reused, so the review contract is not coupled to the Yaegi gate's evolution. Blocking requires Verdict==confirmed AND Level==error, so a PLAUSIBLE finding never blocks however severe it claims to be. ReviewStatus makes 'ran and found nothing' structurally distinct from 'never ran' -- Passed() is false for a zero-value report, and the distinction does not rest on nil-vs-empty-slice. JSON round-trip covered; Line 0 is preserved (no omitempty) for whole-file findings. Review found and fixed a duplicate package doc comment and a redundant ReviewBlocking/BlockingReviewFindings alias pair. task check green. Fresh adversarial review clean across 8 dimensions; I independently mutation-tested the blocking rule: dropping the verdict check fails 5 tests (incl. plausible_error_MUST_NOT_block) and dropping the level check fails 5 more, so the tests genuinely pin both halves."}} +{"id":"int-bc45db099eb63b2e22f27449984fd770","kind":"field_change","created_at":"2026-08-24T15:42:47.277649102Z","actor":"Sam Catlow","issue_id":"archie-core-0dic","extra":{"field":"status","new_value":"closed","old_value":"in_progress","reason":"Closed"}} +{"id":"int-6ef69a7ebb781fb99529e52ef038cdaf","kind":"field_change","created_at":"2026-08-24T15:43:19.639842603Z","actor":"Sam Catlow","issue_id":"archie-core-absb","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"send_file tool plus upload-by-reader delivery; commit 9a45fbb"}} diff --git a/.beads/issues.jsonl b/.beads/issues.jsonl index 04da02078..3632bed42 100644 --- a/.beads/issues.jsonl +++ b/.beads/issues.jsonl @@ -4,8 +4,10 @@ {"_type":"issue","id":"archie-core-1ysw.1","title":"Bind worktree RPC operations to the dispatched task","description":"The sandboxed agent can currently choose owner, repo, issue, base, and branch on worktree RPC requests. The daemon then performs host deletion and credentialed forge operations without correlating the request to the dispatched task or enforcing WorkDir containment.","acceptance_criteria":"Reject traversal and unconfigured or task-mismatched coordinates before any filesystem or forge side effect; derive or validate the permitted branch; regression tests fail on the old behavior and pass on the fix.","status":"closed","priority":0,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-22T11:01:43Z","created_by":"Sam Catlow","updated_at":"2026-08-24T06:59:58Z","started_at":"2026-08-22T11:02:03Z","closed_at":"2026-08-24T06:59:58Z","close_reason":"Fixed on main: worktreerpc now exposes only Push, authorized by an opaque per-dispatch grant issued from the dispatched *store.Task (worktreerpc.go:71-83). Sandbox input no longer selects host path, repo or branch; ValidCoordinates rejects traversal. Package tests pass.","external_ref":"https://github.com/samcharles93/archie-core/issues/589","metadata":null,"dependencies":[{"issue_id":"archie-core-1ysw.1","depends_on_id":"archie-core-1ysw","type":"parent-child","created_at":"2026-08-22T21:01:42Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-1ysw","title":"Repair internal/worktree correctness and trust-boundary defects","description":"Track the concrete worktree-package defects proven by the 2026-08-22 evidence-gated review. Child bugs cover RPC authority/path containment, repository-key isolation, retry/base/diff correctness, push lifecycle, terminal cleanup, cancellation, and branch naming. This epic groups implementation only; each child has its own observable acceptance criteria.","acceptance_criteria":"All child bugs are closed with red-green regression tests, scoped lint passes, and the repository quality gate is clean.","status":"closed","priority":0,"issue_type":"epic","owner":"sam@catlow.tech","created_at":"2026-08-22T11:01:18Z","created_by":"Sam Catlow","updated_at":"2026-08-24T08:16:00Z","closed_at":"2026-08-24T08:16:00Z","close_reason":"All 9 children complete. The P0/P1 trust-boundary and correctness defects (.1 RPC task binding, .2 colliding directory keys, .3 untracked cleanup, .4 fail-closed base resolution, .5 three-dot merge-base semantics) were already fixed on main and reconciled 2026-08-24. The remaining four (.6 push result, .7 no-change worktree leak, .8 commit cancellation, .9 branch naming contract) were implemented this session, merged as 474c31d and its two merge commits, task check green, with an independent adversarial review reporting zero findings.","external_ref":"https://github.com/samcharles93/archie-core/issues/590","dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-t2db.5","title":"Security: an unauthenticated endpoint must not be able to run an agent","description":"P0 within this epic because the feature's own pitch is the threat model: a public intake surface whose output is an agent with tool access and a repo. Get this wrong and a webhook URL is remote code execution with extra steps.\n\nNon-negotiables to design:\n\n- Per-source authentication. A source registers with a secret (HMAC, as internal/channels/webhook already does per route) before its events can trigger anything. Capture-only for unknown senders is acceptable; triggering is not.\n- Human approval before a binding goes live. An operator authoring a binding is a deliberate act; an event arriving is not. Nothing should self-arm.\n- Rate and volume limits per source, so capture cannot be used to exhaust disk or drown the inspector.\n- Payload content is untrusted input flowing into an agent prompt. Treat prompt injection as expected, not exceptional -- the sender controls that text, and the agent has tools. Bound what a playbook-triggered workflow may do.\n- Captured payloads may contain secrets from the sending system. Decide retention, redaction and who can view them; internal/memory/scrubber may already have applicable prior art.\n\nArchie's own principle applies: environmental enforcement over prompt rules. 'The agent should ignore instructions in the payload' is not a control.","acceptance_criteria":"An event from an unauthenticated source can be captured but cannot trigger a workflow; a new binding requires explicit human approval before it arms; per-source rate limits exist; the blast radius of a playbook-triggered workflow is bounded by code rather than by prompt text; retention and visibility of captured payloads is decided and documented.","notes":"2026-08-22: security design decided and documented in docs/prds/webhook-intake-security.md, covering all five non-negotiables from this bead's description:\n1. Per-source auth reuses internal/channels/webhook's existing HMAC-SHA256 scheme; capture accepts unsigned events (visible, marked unauthenticated), only authenticated events can ever match a binding.\n2. Bindings gain a draft -\u003e pending_approval -\u003e armed state machine; any edit to an armed binding drops it back to pending_approval so approval can't be bypassed by editing. Modeled on telegram's existing dangerousAction/pendingApproval flow (dangerous.go/approval.go).\n3. Per-source token-bucket rate limiting (precedent: pairing/store.go's MaxPendingPerPlatform); limit-exceeded is an observable 429, not a silent drop.\n4. Blast radius bounded by the SAME code-level controls every task already gets -- gate, diff_cap_lines, sandboxed container, worktree isolation -- no new relaxation for playbook-triggered work, and payload text is ordinary untrusted prompt input, never a trusted instruction.\n5. 7-day configurable retention on captured payloads; best-effort redaction reusing gateway/stream.go's sensitiveParameterKey heuristic before persisting; visibility gated by the same dashboard auth as every other webui surface.\n\nThis bead's code-level acceptance criteria (capture-can't-trigger, rate limits exist, blast-radius bounded, approval gate) cannot be implemented yet: they constrain t2db.1 (capture), 7d5u.3 (intake family) and t2db.4 (binding), none of which have landed. This document is the contract those beads build against -- do not build any of them without satisfying it. Leaving this bead in_progress rather than closing it; it closes when t2db.1/7d5u.3/t2db.4 land and demonstrably satisfy points 1-5, not before.","status":"in_progress","priority":0,"issue_type":"feature","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-21T13:45:46Z","created_by":"Sam Catlow","updated_at":"2026-08-22T09:25:01Z","started_at":"2026-08-21T14:51:26Z","external_ref":"https://github.com/samcharles93/archie-core/issues/536","dependencies":[{"issue_id":"archie-core-t2db.5","depends_on_id":"archie-core-t2db","type":"parent-child","created_at":"2026-08-21T23:45:45Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":1,"comment_count":0} -{"_type":"issue","id":"archie-core-440c","title":"Dashboard mutations 403 behind a TLS-terminating reverse proxy: Origin check ignores X-Forwarded-Proto","description":"Every operator action from the dashboard -- Stop, Cancel, Retry, Approve, Reject, Abandon, Archive -- fails with HTTP 403 in the production deployment. Observed 2026-08-24: `POST https://archie.catlow.cloud/api/tasks/3/action` returned 403 in 7ms with a 30-byte body. This left the operator with no way to stop a running task from the web UI at all.\n\n## Root cause\n\n`authorizeTaskMutation` (internal/webui/api_tasks.go:197-221) derives the expected Origin scheme from the daemon's OWN connection:\n\n wantScheme := \"http\"\n if r.TLS != nil {\n wantScheme = \"https\"\n }\n ...\n if ... || !strings.EqualFold(u.Scheme, wantScheme) || !strings.EqualFold(u.Host, r.Host) {\n http.Error(w, \"cross-origin mutation refused\", http.StatusForbidden)\n\narchied runs behind a reverse proxy that terminates TLS (confirmed: archie.catlow.cloud redirects to auth.catlow.cloud for forward auth, and the request was HTTP/2 to the proxy). The daemon therefore receives a PLAIN HTTP connection, so `r.TLS == nil` and `wantScheme == \"http\"`, while the browser correctly sends `Origin: https://archie.catlow.cloud`. Scheme mismatch -\u003e 403 on every mutation.\n\n`X-Forwarded-Proto` is never consulted anywhere in the codebase (`grep -rn 'X-Forwarded' internal/webui/ internal/config/` returns nothing).\n\n## Evidence the body confirms which branch fired\n\nThere are exactly two 403 paths in this handler. Their response bodies differ in length:\n- \"missing CSRF header\\n\" = 20 bytes\n- \"cross-origin mutation refused\\n\" = 30 bytes\n\nThe observed response was 30 B, so the Origin comparison is what rejected it, NOT the CSRF header. The dashboard is sending X-Archie-CSRF correctly.\n\n## Why this is P1\n\nIt is a total loss of the operator control surface in the supported deployment shape. It also removes the documented remedy for other faults: archie-core-0dic leaves a stopped task's row reading `running`, and `Parked`'s retry action is the stated recovery for a review that fails closed (docs/prds/adversarial-self-review.md section 4) -- both assume dashboard actions work.\n\nNote the deployment model is explicitly plural (CLAUDE.md \"Deployment model\": several supported shapes, systemd is not required), so \"runs behind a proxy\" is a first-class configuration, not an edge case.\n\n## Steps to Reproduce\n\n1. Serve archied behind any TLS-terminating reverse proxy (nginx, Caddy, Traefik, or a forward-auth proxy such as Authelia), with the daemon listening on plain HTTP.\n2. Load the dashboard over https and press Stop on a running task.\n3. Observe `POST /api/tasks/\u003cid\u003e/action` -\u003e 403, body \"cross-origin mutation refused\".\n4. The same build works when reached directly over http, or over https terminated by the daemon itself, which is why this does not reproduce in local development.\n\n## Acceptance Criteria\n\nDashboard mutations succeed when archied is behind a TLS-terminating reverse proxy; the effective scheme is derived from X-Forwarded-Proto (and the effective host from X-Forwarded-Host where applicable) ONLY when the request arrives from a trusted proxy, configured explicitly -- an unconditional trust of these headers would let any client forge the Origin check and defeat the CSRF protection this function exists to provide; direct (non-proxied) deployments keep their current strict behaviour; tests cover proxied-https, direct-http, direct-https, and a spoofed X-Forwarded-Proto from an untrusted source; the config surface and its default are documented in config.example.toml and the deployment profiles.\n","notes":"CONFIRMED LIVE against production 2026-08-25 via Playwright, signed in as the operator.\n\nReproduced the dashboard's own Stop request from the loaded page:\n\n fetch('/api/tasks/3/action', {method:'POST',\n headers:{'X-Archie-CSRF':'1','Content-Type':'application/json'},\n body:'{\"action\":\"stop\"}'})\n\nResult: status 403, body exactly \"cross-origin mutation refused\\n\" (30 bytes), with location.origin = https://archie.catlow.cloud and location.protocol = https:.\n\nThis settles which of the two 403 branches fires. The request carried a correct X-Archie-CSRF header and same-origin credentials, so it passed the CSRF check and was rejected by the Origin comparison in authorizeTaskMutation. Combined with the deployment shape (archie.catlow.cloud 302s to auth.catlow.cloud for forward auth, so TLS terminates at the proxy and the daemon sees plain HTTP), the scheme comparison is the failing term: browser Origin scheme 'https' vs the daemon's computed wantScheme 'http' from r.TLS == nil.\n\nThe dashboard confirms the operator impact at the same time: the header reads '1 running' and task #3 is still listed as running (that stale row is archie-core-0dic, a separate defect). So in production the operator currently cannot stop task #3 from either surface -- the web UI is 403'd by this bug, and chat /stop leaves the row reading running via 0dic.\n\nRelated UX gap worth its own bead rather than folding in here: the only user-visible signal was a console error, 'Failed to load resource: the server responded with a status of 403'. The dashboard surfaced nothing actionable in the UI itself, which is why this went unnoticed until devtools were opened.\nDEPLOYMENT CONFIRMED from /work/infra/automation (Ansible):\n\nroles/traefik/templates/archie.yml.j2 defines router 'archie-webui' on the 'websecure' entrypoint with 'tls: certresolver', i.e. Traefik terminates TLS. roles/traefik/defaults/main.yml:17-18 give:\n traefik_archie_webui_domain: archie.catlow.cloud\n traefik_archie_webui_backend_url: http://10.36.25.188:8484 \u003c-- PLAIN HTTP\n\nSo archied receives a plain-HTTP request and computes wantScheme='http', while the browser sends Origin: https://archie.catlow.cloud. That is the whole bug.\n\nTwo details that make the fix precise and low-risk:\n\n1. Only the SCHEME term fails. Traefik forwards the original Host by default (passHostHeader), so u.Host == r.Host already matches. The Origin check does not need host rewriting for this deployment -- honouring the forwarded scheme is sufficient. Keep X-Forwarded-Host support optional/secondary rather than assuming it is needed.\n\n2. The header archied needs is ALREADY ARRIVING. Traefik sets X-Forwarded-Proto: https on proxied requests by default. Nothing in the infrastructure has to change; archied simply never reads it. That also means the fix is verifiable against this exact deployment without an infra edit.\n\nAuth context, for whoever implements: the same router injects 'Authorization: Bearer \u003ctoken\u003e' via the archie-webui-token middleware, behind authelia@docker forward auth. So the trusted-proxy boundary is well defined here -- requests reaching :8484 have already passed Traefik. Whatever trust configuration is added must still DEFAULT to not trusting X-Forwarded-* , because an operator running archied directly exposed would otherwise let any client forge Origin and defeat the CSRF protection entirely.","status":"open","priority":1,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-24T15:41:32Z","created_by":"Sam Catlow","updated_at":"2026-08-24T15:42:56Z","dependency_count":0,"dependent_count":0,"comment_count":0} -{"_type":"issue","id":"archie-core-0dic","title":"Stopped tasks stay 'running' forever: terminal writes ride the cancelled context","description":"/stop reports success and genuinely does stop the container, but the task row is never updated, so the dashboard, /status and task_list all show the task as running indefinitely. Observed 2026-08-24: task #3 was stopped and was still displayed as running the following day.\n\n## Root cause\n\n`Daemon.runViaAgent` (internal/daemon/daemon.go:1010-1100) writes its terminal state with the SAME context that was just cancelled, and discards the result:\n\n reply, err := d.requestTaskRun(ctx, task.ID, data) // returns ctx.Err() on /stop\n if err != nil {\n _ = d.Store.Transition(ctx, task.ID, store.StatusRunning, store.StatusParked, \"taskrun request failed: \"+err.Error())\n\n`store.Transition` writes through `tx.ExecContext(ctx, ...)` (internal/store/store.go:358-365), so on a cancelled context the write fails immediately and the `_ =` throws the error away. The row stays `running` with nothing left to correct it.\n\nThere are SIX such writes in runViaAgent (grant unavailable, grant failed, encode failed, request failed, decode failed, run failed). Every one is unreachable in exactly the situation it exists for -- cancellation -- because cancellation is what invalidates the context it writes with.\n\n`cleanupTerminalTaskWorktree` (daemon.go:897) has the same defect: it re-reads via `d.Store.TaskByID(ctx, ...)` and returns early on error, so a cancelled task also skips worktree cleanup.\n\n## Why the container is NOT the problem\n\n`Pool.Release` already gets this right and is the precedent for the fix: it detaches deliberately with `context.WithTimeout(context.WithoutCancel(ctx), 10*time.Second)` and documents why -- \"the most important reason a task is on its way out is that it was cancelled... Teardown is cleanup, so it gets its own deadline rather than inheriting the caller's cancellation.\" So teardown works; only state recording is broken.\n\n## Contributing factor\n\n`StoreTaskController.StopRunning` (internal/gateway/tasks.go:227) deliberately writes no terminal state, documented as \"A stopped task unwinds through its own error paths and lands wherever that leaves it, usually parked\". That assumption is now false: the unwind path cannot record anything, so nothing lands. Note `CancelChatTask` (the /cancel path) DOES write state explicitly and is unaffected.\n\n## Steps to Reproduce\n\n1. Start an autonomous task so it reaches `running` with a live archie-agent container.\n2. Issue `/stop` from chat (or Stop from the dashboard).\n3. Observe the container is stopped and removed by Pool.Release.\n4. Observe the task row is still `status = running` in the store, in `task_list`, in `/status` and on the dashboard.\n5. Wait: nothing ever corrects it. Only a daemon restart re-queues it, via the crash-recovery path that re-queues tasks left `running`.\n\n## Acceptance Criteria\n\nTerminal state writes on the cancellation path use a context that survives cancellation (`context.WithoutCancel`, with its own timeout, mirroring Pool.Release); their errors are logged rather than discarded; a stopped task reaches a terminal state observable in the store, task_list and the dashboard without a daemon restart; cleanupTerminalTaskWorktree also runs for a cancelled task; a regression test cancels a task mid-run and asserts the row is no longer `running`, and fails against the current code.\n","notes":"Timeline correction: the task was observed still 'running' roughly ONE HOUR after /stop, not a day (an earlier note said a day; that was inferred wrongly from a date rollover). An hour is if anything stronger evidence, since no plausible refresh interval covers it.\n\nChronology correction: the agent's pre-/stop task_list reading 'still marked running' is NOT evidence of this bug -- nothing had stopped the task at that point, so it was reporting correctly. The genuine evidence is (a) the row still 'running' an hour after /stop, and (b) the code path itself, which predicts exactly that and was found by reading runViaAgent rather than from the transcript.\n\nScope note: this bug explains a stale ROW only. It does not explain a still-live container, because container.Pool.Release deliberately detaches from the cancelled context and does tear down. If a container is ever found alive after /stop, that is a SEPARATE defect, not this one.","status":"closed","priority":1,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-24T15:22:19Z","created_by":"Sam Catlow","updated_at":"2026-08-24T15:42:47Z","started_at":"2026-08-24T15:31:34Z","closed_at":"2026-08-24T15:42:47Z","close_reason":"Closed","dependency_count":0,"dependent_count":0,"comment_count":0} +{"_type":"issue","id":"archie-core-vq92","title":"task_logs truncates at 50KB with no pagination, so full logs are unreachable","description":"The task_logs chat tool caps its response at 50 KB and offers no way to fetch the rest. An operator asking the agent to retrieve or archive a task's logs gets a silently clipped window, and the agent has no mechanism to page past it. Observed 2026-08-24: asked to save a full transcript and agent logs, the agent could only produce a partial archive and had to document the truncation as a limitation rather than satisfy the request.\n\nThe failure compounds with archie-core-p1bl (errors logging as `{}`): a truncated log of uninformative errors leaves an operator with nothing at all, precisely when a task is stuck.\n\n## What is needed\n\nTruncation itself is legitimate -- a tool result must be bounded, and unbounded log text would blow the model's context. The defect is that truncation is TERMINAL: there is no continuation, no offset/cursor, no way to narrow the window, and the caller cannot tell how much was lost.\n\nEstablish first where the cap is applied (the task_logs tool in internal/gateway/task_tools.go and whatever log reader it calls in internal/logging -- note internal/logging owns the on-disk format end to end and internal/webui parses nothing, per CLAUDE.md, so the reader is the right place for range support).\n\nDesign points to decide:\n- A cursor or offset so successive calls walk the whole log, rather than always returning the same head or tail.\n- Filters that make bounded retrieval useful rather than merely possible: by level (errors only), by time range, by stage.\n- The response must state explicitly that it was truncated and how much remains, so the agent can report honestly instead of implying completeness.\n- Consider whether bulk retrieval belongs in a tool result at all, or whether the right answer for \"save the full logs\" is to write the file and deliver it via the new send_file path (archie-core-absb), keeping the tool result small.\n\n## Acceptance Criteria\n\nAn operator can obtain a task's complete logs through the agent, by paging or by file delivery; a truncated response says so and reports what remains rather than ending silently; level and time-range filtering exist so a bounded call can still answer a specific question; the cap remains enforced so no single response can exhaust the model's context; tests cover a log larger than the cap and assert that repeated calls retrieve all of it without gaps or duplication.\n","status":"open","priority":1,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-24T15:48:15Z","created_by":"Sam Catlow","updated_at":"2026-08-24T15:50:10Z","external_ref":"https://github.com/samcharles93/archie-core/issues/625","dependency_count":0,"dependent_count":0,"comment_count":0} +{"_type":"issue","id":"archie-core-p1bl","title":"Task logs serialise errors to an empty object, destroying diagnostics","description":"Error values in task logs sometimes render as an empty JSON object, so the one field that says WHY something failed carries no information. Observed in production task logs 2026-08-24, in the same stream:\n\n {\"time\":\"...\",\"level\":\"ERROR\",\"message\":\"handle failed\",\"fields\":{\"err\":{}}}\n {\"time\":\"...\",\"level\":\"ERROR\",\"message\":\"handle failed\",\"fields\":{\"err\":\"stage re…\"}}\n\nSame message, same field, two different encodings -- one useful, one useless. The empty-object form is what an operator hits when diagnosing a stuck task, which is exactly when the log is the only evidence available.\n\n## Likely mechanism (to be confirmed, not assumed)\n\n`{}` is what encoding/json produces for a struct with no exported fields. A custom error type (a struct implementing `error` via a value or pointer receiver, with all fields unexported) marshals to `{}` rather than to its Error() string, because encoding/json does not consult the error interface. Errors that happen to be `*errors.errorString` or `fmt.Errorf` results go through a different path and survive as text.\n\nStart at internal/logging (attrs.go and its tests already reference a \"handle failed\" record, so the attribute handling is there) and establish where an `error` attribute is converted for the JSONL sink. The fix is to render errors through their Error() string -- and, where the error carries structured context worth keeping, to do so ADDITIONALLY rather than instead.\n\n## Why P1\n\nSam's words: \"LOGGING! ... this is another critical requirement.\" Diagnosis of every other defect depends on it. Two separate investigations this week were slowed by log output that recorded that something failed without recording what.\n\nNote this compounds archie-core-1ysw-era debugging and the parked-task investigation: an operator seeing `{\"err\":{}}` has strictly less information than one seeing no log line at all, because the empty object implies the error was captured.\n\n## Steps to Reproduce\n\n1. Arrange for a code path that logs a custom error type (unexported fields) as an `err` attribute.\n2. Read the task's JSONL log via the dashboard, /api logs, or the task_logs tool.\n3. Observe `\"err\":{}` where the message should be.\n4. Compare with a path that logs a fmt.Errorf value and observe `\"err\":\"...\"` in the same file.\n\n## Acceptance Criteria\n\nEvery error logged as an attribute renders its Error() text in the JSONL sink regardless of the concrete error type; a custom error type with only unexported fields is covered by a test asserting the message survives; structured context on an error is preserved in addition to, never instead of, the message; a regression test fails against the current encoder; no log line can report an error as an empty object.\n","status":"open","priority":1,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-24T15:47:44Z","created_by":"Sam Catlow","updated_at":"2026-08-24T15:50:11Z","external_ref":"https://github.com/samcharles93/archie-core/issues/626","dependency_count":0,"dependent_count":0,"comment_count":0} +{"_type":"issue","id":"archie-core-440c","title":"Dashboard mutations 403 behind a TLS-terminating reverse proxy: Origin check ignores X-Forwarded-Proto","description":"Every operator action from the dashboard -- Stop, Cancel, Retry, Approve, Reject, Abandon, Archive -- fails with HTTP 403 in the production deployment. Observed 2026-08-24: `POST https://archie.catlow.cloud/api/tasks/3/action` returned 403 in 7ms with a 30-byte body. This left the operator with no way to stop a running task from the web UI at all.\n\n## Root cause\n\n`authorizeTaskMutation` (internal/webui/api_tasks.go:197-221) derives the expected Origin scheme from the daemon's OWN connection:\n\n wantScheme := \"http\"\n if r.TLS != nil {\n wantScheme = \"https\"\n }\n ...\n if ... || !strings.EqualFold(u.Scheme, wantScheme) || !strings.EqualFold(u.Host, r.Host) {\n http.Error(w, \"cross-origin mutation refused\", http.StatusForbidden)\n\narchied runs behind a reverse proxy that terminates TLS (confirmed: archie.catlow.cloud redirects to auth.catlow.cloud for forward auth, and the request was HTTP/2 to the proxy). The daemon therefore receives a PLAIN HTTP connection, so `r.TLS == nil` and `wantScheme == \"http\"`, while the browser correctly sends `Origin: https://archie.catlow.cloud`. Scheme mismatch -\u003e 403 on every mutation.\n\n`X-Forwarded-Proto` is never consulted anywhere in the codebase (`grep -rn 'X-Forwarded' internal/webui/ internal/config/` returns nothing).\n\n## Evidence the body confirms which branch fired\n\nThere are exactly two 403 paths in this handler. Their response bodies differ in length:\n- \"missing CSRF header\\n\" = 20 bytes\n- \"cross-origin mutation refused\\n\" = 30 bytes\n\nThe observed response was 30 B, so the Origin comparison is what rejected it, NOT the CSRF header. The dashboard is sending X-Archie-CSRF correctly.\n\n## Why this is P1\n\nIt is a total loss of the operator control surface in the supported deployment shape. It also removes the documented remedy for other faults: archie-core-0dic leaves a stopped task's row reading `running`, and `Parked`'s retry action is the stated recovery for a review that fails closed (docs/prds/adversarial-self-review.md section 4) -- both assume dashboard actions work.\n\nNote the deployment model is explicitly plural (CLAUDE.md \"Deployment model\": several supported shapes, systemd is not required), so \"runs behind a proxy\" is a first-class configuration, not an edge case.\n\n## Steps to Reproduce\n\n1. Serve archied behind any TLS-terminating reverse proxy (nginx, Caddy, Traefik, or a forward-auth proxy such as Authelia), with the daemon listening on plain HTTP.\n2. Load the dashboard over https and press Stop on a running task.\n3. Observe `POST /api/tasks/\u003cid\u003e/action` -\u003e 403, body \"cross-origin mutation refused\".\n4. The same build works when reached directly over http, or over https terminated by the daemon itself, which is why this does not reproduce in local development.\n\n## Acceptance Criteria\n\nDashboard mutations succeed when archied is behind a TLS-terminating reverse proxy; the effective scheme is derived from X-Forwarded-Proto (and the effective host from X-Forwarded-Host where applicable) ONLY when the request arrives from a trusted proxy, configured explicitly -- an unconditional trust of these headers would let any client forge the Origin check and defeat the CSRF protection this function exists to provide; direct (non-proxied) deployments keep their current strict behaviour; tests cover proxied-https, direct-http, direct-https, and a spoofed X-Forwarded-Proto from an untrusted source; the config surface and its default are documented in config.example.toml and the deployment profiles.\n","notes":"CONFIRMED LIVE against production 2026-08-25 via Playwright, signed in as the operator.\n\nReproduced the dashboard's own Stop request from the loaded page:\n\n fetch('/api/tasks/3/action', {method:'POST',\n headers:{'X-Archie-CSRF':'1','Content-Type':'application/json'},\n body:'{\"action\":\"stop\"}'})\n\nResult: status 403, body exactly \"cross-origin mutation refused\\n\" (30 bytes), with location.origin = https://archie.catlow.cloud and location.protocol = https:.\n\nThis settles which of the two 403 branches fires. The request carried a correct X-Archie-CSRF header and same-origin credentials, so it passed the CSRF check and was rejected by the Origin comparison in authorizeTaskMutation. Combined with the deployment shape (archie.catlow.cloud 302s to auth.catlow.cloud for forward auth, so TLS terminates at the proxy and the daemon sees plain HTTP), the scheme comparison is the failing term: browser Origin scheme 'https' vs the daemon's computed wantScheme 'http' from r.TLS == nil.\n\nThe dashboard confirms the operator impact at the same time: the header reads '1 running' and task #3 is still listed as running (that stale row is archie-core-0dic, a separate defect). So in production the operator currently cannot stop task #3 from either surface -- the web UI is 403'd by this bug, and chat /stop leaves the row reading running via 0dic.\n\nRelated UX gap worth its own bead rather than folding in here: the only user-visible signal was a console error, 'Failed to load resource: the server responded with a status of 403'. The dashboard surfaced nothing actionable in the UI itself, which is why this went unnoticed until devtools were opened.\nDEPLOYMENT CONFIRMED from /work/infra/automation (Ansible):\n\nroles/traefik/templates/archie.yml.j2 defines router 'archie-webui' on the 'websecure' entrypoint with 'tls: certresolver', i.e. Traefik terminates TLS. roles/traefik/defaults/main.yml:17-18 give:\n traefik_archie_webui_domain: archie.catlow.cloud\n traefik_archie_webui_backend_url: http://10.36.25.188:8484 \u003c-- PLAIN HTTP\n\nSo archied receives a plain-HTTP request and computes wantScheme='http', while the browser sends Origin: https://archie.catlow.cloud. That is the whole bug.\n\nTwo details that make the fix precise and low-risk:\n\n1. Only the SCHEME term fails. Traefik forwards the original Host by default (passHostHeader), so u.Host == r.Host already matches. The Origin check does not need host rewriting for this deployment -- honouring the forwarded scheme is sufficient. Keep X-Forwarded-Host support optional/secondary rather than assuming it is needed.\n\n2. The header archied needs is ALREADY ARRIVING. Traefik sets X-Forwarded-Proto: https on proxied requests by default. Nothing in the infrastructure has to change; archied simply never reads it. That also means the fix is verifiable against this exact deployment without an infra edit.\n\nAuth context, for whoever implements: the same router injects 'Authorization: Bearer \u003ctoken\u003e' via the archie-webui-token middleware, behind authelia@docker forward auth. So the trusted-proxy boundary is well defined here -- requests reaching :8484 have already passed Traefik. Whatever trust configuration is added must still DEFAULT to not trusting X-Forwarded-* , because an operator running archied directly exposed would otherwise let any client forge Origin and defeat the CSRF protection entirely.","status":"open","priority":1,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-24T15:41:32Z","created_by":"Sam Catlow","updated_at":"2026-08-24T15:50:12Z","external_ref":"https://github.com/samcharles93/archie-core/issues/627","dependency_count":0,"dependent_count":0,"comment_count":0} +{"_type":"issue","id":"archie-core-0dic","title":"Stopped tasks stay 'running' forever: terminal writes ride the cancelled context","description":"/stop reports success and genuinely does stop the container, but the task row is never updated, so the dashboard, /status and task_list all show the task as running indefinitely. Observed 2026-08-24: task #3 was stopped and was still displayed as running the following day.\n\n## Root cause\n\n`Daemon.runViaAgent` (internal/daemon/daemon.go:1010-1100) writes its terminal state with the SAME context that was just cancelled, and discards the result:\n\n reply, err := d.requestTaskRun(ctx, task.ID, data) // returns ctx.Err() on /stop\n if err != nil {\n _ = d.Store.Transition(ctx, task.ID, store.StatusRunning, store.StatusParked, \"taskrun request failed: \"+err.Error())\n\n`store.Transition` writes through `tx.ExecContext(ctx, ...)` (internal/store/store.go:358-365), so on a cancelled context the write fails immediately and the `_ =` throws the error away. The row stays `running` with nothing left to correct it.\n\nThere are SIX such writes in runViaAgent (grant unavailable, grant failed, encode failed, request failed, decode failed, run failed). Every one is unreachable in exactly the situation it exists for -- cancellation -- because cancellation is what invalidates the context it writes with.\n\n`cleanupTerminalTaskWorktree` (daemon.go:897) has the same defect: it re-reads via `d.Store.TaskByID(ctx, ...)` and returns early on error, so a cancelled task also skips worktree cleanup.\n\n## Why the container is NOT the problem\n\n`Pool.Release` already gets this right and is the precedent for the fix: it detaches deliberately with `context.WithTimeout(context.WithoutCancel(ctx), 10*time.Second)` and documents why -- \"the most important reason a task is on its way out is that it was cancelled... Teardown is cleanup, so it gets its own deadline rather than inheriting the caller's cancellation.\" So teardown works; only state recording is broken.\n\n## Contributing factor\n\n`StoreTaskController.StopRunning` (internal/gateway/tasks.go:227) deliberately writes no terminal state, documented as \"A stopped task unwinds through its own error paths and lands wherever that leaves it, usually parked\". That assumption is now false: the unwind path cannot record anything, so nothing lands. Note `CancelChatTask` (the /cancel path) DOES write state explicitly and is unaffected.\n\n## Steps to Reproduce\n\n1. Start an autonomous task so it reaches `running` with a live archie-agent container.\n2. Issue `/stop` from chat (or Stop from the dashboard).\n3. Observe the container is stopped and removed by Pool.Release.\n4. Observe the task row is still `status = running` in the store, in `task_list`, in `/status` and on the dashboard.\n5. Wait: nothing ever corrects it. Only a daemon restart re-queues it, via the crash-recovery path that re-queues tasks left `running`.\n\n## Acceptance Criteria\n\nTerminal state writes on the cancellation path use a context that survives cancellation (`context.WithoutCancel`, with its own timeout, mirroring Pool.Release); their errors are logged rather than discarded; a stopped task reaches a terminal state observable in the store, task_list and the dashboard without a daemon restart; cleanupTerminalTaskWorktree also runs for a cancelled task; a regression test cancels a task mid-run and asserts the row is no longer `running`, and fails against the current code.\n","notes":"Timeline correction: the task was observed still 'running' roughly ONE HOUR after /stop, not a day (an earlier note said a day; that was inferred wrongly from a date rollover). An hour is if anything stronger evidence, since no plausible refresh interval covers it.\n\nChronology correction: the agent's pre-/stop task_list reading 'still marked running' is NOT evidence of this bug -- nothing had stopped the task at that point, so it was reporting correctly. The genuine evidence is (a) the row still 'running' an hour after /stop, and (b) the code path itself, which predicts exactly that and was found by reading runViaAgent rather than from the transcript.\n\nScope note: this bug explains a stale ROW only. It does not explain a still-live container, because container.Pool.Release deliberately detaches from the cancelled context and does tear down. If a container is ever found alive after /stop, that is a SEPARATE defect, not this one.","status":"closed","priority":1,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-24T15:22:19Z","created_by":"Sam Catlow","updated_at":"2026-08-24T15:50:13Z","started_at":"2026-08-24T15:31:34Z","closed_at":"2026-08-24T15:42:47Z","close_reason":"Closed","external_ref":"https://github.com/samcharles93/archie-core/issues/628","dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-ite6","title":"Flush daemon task-event subscription before accepting worker events","description":"cmd/archied.subscribeAgentEvents registers a core-NATS wildcard subscription but returns before flushing the SUB frame. A task worker can publish immediately and lose its first event; TestSubscribeAgentEventsDropsUnparseableMessages exposes the race under full-suite load.","acceptance_criteria":"subscribeAgentEvents flushes the NATS connection before returning; flush failure unsubscribes the just-created subscription; a regression test proves a publisher can deliver immediately after subscription setup.","status":"closed","priority":1,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-24T04:39:22Z","created_by":"Sam Catlow","updated_at":"2026-08-24T05:19:34Z","started_at":"2026-08-24T04:39:24Z","closed_at":"2026-08-24T05:19:34Z","close_reason":"Completed; reconciled with the already-closed GitHub issue.","external_ref":"https://github.com/samcharles93/archie-core/issues/616","metadata":null,"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-q15y.3","title":"Remove legacy inprocess subprocess and single-stage agent execution","description":"The configuration and worker still expose daemon inprocess, per-stage subprocess, and single-stage NATS execution paths. Remove those production choices and keep the agent-loop runner owned only by the full-task archie-agent worker.","acceptance_criteria":"agent.mode no longer selects inprocess/subprocess/nats production behavior; cmd/archied and internal/daemon cannot construct an agent loop runner; legacy SubprocessRunner and single-stage worker paths are deleted or proven test-only; architecture tests enforce worker-only ownership.","status":"closed","priority":1,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-24T03:03:38Z","created_by":"Sam Catlow","updated_at":"2026-08-24T06:58:30Z","started_at":"2026-08-24T03:49:36Z","closed_at":"2026-08-24T06:58:30Z","close_reason":"Implemented in 157e99b (refactor(agentexec): remove legacy execution paths); [agent] is decode-only. Verified: no SubprocessRunner/inprocess symbols in non-test code.","external_ref":"https://github.com/samcharles93/archie-core/issues/617","metadata":null,"dependencies":[{"issue_id":"archie-core-q15y.3","depends_on_id":"archie-core-q15y","type":"parent-child","created_at":"2026-08-24T03:03:38Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-q15y.3","depends_on_id":"archie-core-q15y.2","type":"blocks","created_at":"2026-08-24T03:03:52Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":1,"dependent_count":1,"comment_count":0} {"_type":"issue","id":"archie-core-q15y.2","title":"Use full-task NATS handoff for every autonomous workflow","description":"daemon.process currently runs workflow.Run locally unless a container pool exists, and NATS mode without containers uses per-stage requests. Make full-task taskrun request/reply the only production workflow path for both embedded and external brokers.","acceptance_criteria":"daemon.process never calls workflow.Run; every workflow task is sent once through the taskrun subject to a dedicated managed worker; task state/RPC/event behavior remains correct; regression tests fail against the old local branch.","notes":"Implemented full-task-only autonomous dispatch: archied parks before worktree access when the managed container pool or task transport is unavailable, acquires exactly one task-scoped worker, and sends exactly one full-task request. Removed daemon-local workflow execution state and persisted daemon-side park details atomically as Task.ParkReason. task check passes; scoped lint is clean; fresh adversarial re-review has zero findings.","status":"closed","priority":1,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-24T03:03:37Z","created_by":"Sam Catlow","updated_at":"2026-08-24T06:58:29Z","started_at":"2026-08-24T03:32:18Z","closed_at":"2026-08-24T06:58:29Z","close_reason":"Implemented in 7d69001 (fix(daemon): require full-task worker handoff); daemon.process parks instead of running locally. Verified: no workflow.Run in internal/daemon non-test code, enforced by daemon/architecture_test.go:75.","external_ref":"https://github.com/samcharles93/archie-core/issues/618","metadata":null,"dependencies":[{"issue_id":"archie-core-q15y.2","depends_on_id":"archie-core-q15y","type":"parent-child","created_at":"2026-08-24T03:03:37Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-q15y.2","depends_on_id":"archie-core-q15y.1","type":"blocks","created_at":"2026-08-24T03:03:51Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":1,"dependent_count":2,"comment_count":0} @@ -66,8 +68,12 @@ {"_type":"issue","id":"archie-core-g7tm","title":"telegram: finalize the reply through a live context, matching the error branch","description":"The success path calls live.finalize(turnCtx, reply) with the raw cancellable turn context (telegram.go:582), while the error branch two lines above deliberately uses context.WithoutCancel(turnCtx). If /stop lands during finalize, the rich edit, the plain-text retry, and the split-send fallback all abort with context.Canceled (go-telegram/bot builds requests with NewRequestWithContext), so the authoritative reply is never delivered and the live message keeps the ▌ cursor forever. The reply is persisted to the ledger, so the loss is delivery-level — but the user sees a frozen half-answer.\n\nFailure: a long tool-using turn is /stop-ped as it completes; turnCtx is cancelled mid-finalize; every send fails on the dead context; the chat shows the last live frame with a blinking cursor and no final answer.\n\nFound by code-review of PR #476 (feat/467, merged 98e8dda).","design":"live.finalize(context.WithoutCancel(turnCtx), reply) — the one-liner the error branch already uses. Consider making finalize take a live context internally rather than trusting each caller to remember.","acceptance_criteria":"A /stop landing mid-finalize still delivers the authoritative reply and drops the cursor; a test covers the cancellable-context finalize path.","status":"closed","priority":1,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-14T14:43:08Z","created_by":"Sam Catlow","updated_at":"2026-08-14T15:07:36Z","started_at":"2026-08-14T14:53:28Z","closed_at":"2026-08-14T15:03:28Z","close_reason":"Fixed in internal/channels/telegram/live.go and telegram.go: finalize/abandon strip context cancellation before sending (mirroring each other), ToolCall escapes Markdown metacharacters via bot.EscapeMarkdown, splitLongMessage splits on rune boundaries. All new/changed tests verified red-then-green; task check clean; adversarial review pass found no blocking issues.","external_ref":"https://github.com/samcharles93/archie-core/issues/484","labels":["code-review","streaming","telegram"],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-tb3a","title":"Fix streaming review blockers for inline tool calls","description":"Resolve the four evidence-gated findings in merged inline tool-call streaming: preserve the authoritative Telegram reply when final edits fail; keep Telegram network I/O off the model FullStream consumer and cancellable; correlate tool inputs with results and render a bounded redacted parameter summary; snapshot show_tool_calls per live reply to avoid reload races. Add regression tests for every path and run task check plus lint/race validation.","acceptance_criteria":"Regression tests fail on the merged implementation and pass after the fix. Final edit failure falls back to normal split delivery. Delta and ToolCall callbacks do not wait on Telegram HTTP and stop cancels in-flight rendering. Completed tool events include bounded redacted parameters correlated by tool-call ID. Reload cannot race an in-flight reply's show_tool_calls setting. task check passes, golangci-lint reports no new findings, and focused race tests pass.","notes":"Implemented in worktree /tmp/archie-core-tb3a on branch fix/archie-core-tb3a. Added cancellable async Telegram rendering, final edit failure fallback through normal split delivery, call-ID-correlated bounded conservative parameter summaries, atomic per-reply show_tool_calls snapshots, SSE/UI parameter rendering, rebuilt ui/dist, and regression tests. Validation: GOFLAGS=-buildvcs=false task check passed; golangci-lint --new-from-rev=HEAD ./... reported 0 issues; focused race suite passed; fresh adversarial reviewer reported PASS with zero findings. Plain task check is blocked in linked worktrees by Go VCS stamping exit 128, hence buildvcs override.\n2026-08-24 reconciliation: the close reason's 'worktree left uncommitted' is stale. The work did land on main via ba33527 (Merge pull request #477 from samcharles93/fix/archie-core-tb3a); verified on main: gateway/stream.go sensitiveParameterKey+redactToolParameters, telegram/live.go per-reply showToolCalls snapshot, webui/api_chat.go gating. The /tmp/archie-core-tb3a worktree and its branch are gone, as expected.\n","status":"closed","priority":1,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-13T18:05:35Z","created_by":"Sam Catlow","updated_at":"2026-08-24T07:29:09Z","started_at":"2026-08-13T18:05:39Z","closed_at":"2026-08-13T18:35:26Z","close_reason":"Completed and independently reviewed; worktree left uncommitted per conservative repository policy.","external_ref":"https://github.com/samcharles93/archie-core/issues/485","dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-dzx","title":"Remove duplicate archie-agent safe.directory setup","description":"## Problem\\ncmd/archie-agent/main.go configures git safe.directory inline and then calls markWorktreeSafe, so startup writes the same global git configuration twice.\\n\\n## Scope\\nKeep markWorktreeSafe as the single tested production path and remove the older inline exec.Command block/import. Add regression coverage proving startup wiring has exactly one authoritative safe-directory call.\\n\\n## Acceptance\\n- archie-agent startup invokes markWorktreeSafe exactly once\\n- no second inline safe.directory command remains in main.go\\n- cmd/archie-agent tests and repository quality gate pass","acceptance_criteria":"Single tested safe.directory setup path remains; duplicate inline command is removed; tests and task check pass","notes":"Red proof: TestMainConfiguresWorktreeSafetyOnce failed with 2 setup paths before implementation. Green proof: go test/vet/build ./cmd/archie-agent/... passed; golangci-lint --new-from-rev=HEAD reported 0 issues. Fresh adversarial review found no blockers. Full task check was not run because the working tree contains unrelated in-progress changes and task check rewrites files; scoped package gate used per repository protocol.","status":"closed","priority":1,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-13T16:10:09Z","created_by":"Sam Catlow","updated_at":"2026-08-13T16:13:48Z","started_at":"2026-08-13T16:10:24Z","closed_at":"2026-08-13T16:13:48Z","close_reason":"Removed duplicate inline safe.directory setup; markWorktreeSafe is now the single tested production path","external_ref":"https://github.com/samcharles93/archie-core/issues/470","dependency_count":0,"dependent_count":0,"comment_count":0} -{"_type":"issue","id":"archie-core-8s7v","title":"[EPIC] Intercom: let the chat agent talk to running agents, the curator, and peers","description":"Today the chat agent can only observe autonomous work -- list tasks, read logs -- and act on it as an outsider through coarse verbs (spawn, stop). It cannot TALK to a running agent. An operator who can see a task going wrong has no way to say \"stop guessing, the config lives at X\" without killing the task and starting over, losing everything the agent had already worked out. Archie should behave like a living system whose parts can address each other, not a set of isolated processes with a dashboard bolted on.\n\n## Prior art: pi-intercom\n\nPi ships `pi-intercom`, which solves this shape for Pi sessions on one machine and is worth reading before designing (/home/sam/.pi/agent/npm/node_modules/pi-intercom; skills/pi-intercom/SKILL.md is the usage guide). Its model:\n\n- Sessions take names (`/name planner`, `/name worker-backend`) and address each other by name.\n- `send` -- fire-and-forget notification. Task assignment, status, notice.\n- `ask` -- BLOCKS until the target replies, with a timeout. The blocking form is the interesting one: it lets a worker stop and get a decision instead of guessing.\n- `reply` -- answers an inbound ask, threaded automatically.\n- `pending` -- lists unresolved inbound asks, i.e. who is waiting on you.\n- `list` -- connected sessions and their state (idle / thinking / tool), for discovering targets.\n- Its use cases map directly onto archie: planner-to-worker delegation, context and findings handoff, blocking clarification, subagent escalation (`need_decision`, `interview_request`), cross-project coordination.\n\n## What is genuinely different here\n\nDo NOT copy pi-intercom's transport. It ships its own local IPC broker (broker/broker.ts, a socket server with framing, spawn and runtime-claim logic) because Pi has no message bus. **Archie already has one**: NATS, with per-task subjects already defined in internal/agentexec/subjects.go (archie.agent.\u003cid\u003e.system and .events) and a request/reply pattern already used by taskrun, forgerpc, storerpc and worktreerpc. Building a second broker alongside it would be the \"two parallel abstractions\" mistake this repo already made once with gateway.BasePlatformAdapter.\n\nSo the real design questions are:\n1. Does agent-directed messaging ride the existing per-task subjects, or does it need its own contract and subject family? Note CLAUDE.md's recorded NATS traps -- work-queue retention forbids overlapping consumers, and reply inboxes are core-NATS-only and are not stream subjects.\n2. What is addressable? Running tasks have ids. The curator, channels and the daemon itself do not have a uniform identity for this purpose. An address space has to be decided before verbs are.\n3. How does a BLOCKING ask work against an agent that is mid-model-call? A worker is not sitting in a receive loop; it is inside an agentloop turn. Delivering a message it will actually notice, without corrupting the turn, is the hard part -- and is where this stops being a transport problem.\n4. Authorization: an operator messaging their own task is fine. Cross-identity messaging is not, and multi-identity deployments are supported (deployments/multi-forge-github-gitea.toml). Whatever the gateway's task tools enforce for identity scoping, this must enforce too.\n5. Does an inbound operator message become part of the agent's context permanently, or a one-shot injection? This decides whether it can be used to steer a task or only to interrupt it.\n\n## Relationship to existing work\n\n- Overlaps archie-core-absb (agent cannot send local files) only in spirit: both are about the agent being able to communicate outward.\n- The curator (internal/domain/curator) is a natural second participant after running tasks.\n- Any design here should be checked against docs/architecture/organisation.md: the domain declares the contract it needs; the transport implements it.\n\n## Success Criteria\n\nAn operator can address a running agent from chat and have it receive the message without the task being killed and restarted; a blocking ask returns the agent's answer or times out cleanly; participants are discoverable with their current state; messaging is identity-scoped so one identity cannot address another's work; the mechanism reuses the existing NATS transport rather than introducing a second broker; a design decision is recorded in docs/prds/ before implementation, per CLAUDE.md's scope discipline.\n","status":"open","priority":2,"issue_type":"epic","owner":"sam@catlow.tech","created_at":"2026-08-24T15:35:57Z","created_by":"Sam Catlow","updated_at":"2026-08-24T15:35:57Z","dependency_count":0,"dependent_count":0,"comment_count":0} -{"_type":"issue","id":"archie-core-absb","title":"Agent cannot send local files: Telegram delivery is URL-fetch only","description":"The agent can produce a file on the host -- a log dump, a screenshot, a written archive, a diff -- and has no way to deliver it to the operator. Asked to send a saved transcript, it replied with a \"Download the archive\" link twice; nothing arrived either time, and it had no signal that anything had failed.\n\n## Why video works and files do not\n\n`telegramMediaSender.dispatch` (internal/channels/telegram/media.go:97) builds every attachment as:\n\n file := \u0026models.InputFileString{Data: att.URL}\n\n`InputFileString` tells Telegram to FETCH the given URL itself. That works for the existing media path because those attachments are remote-hosted -- MiniMax returns a public URL for a generated video, which is what `MultimodalResult.URLs` was added for. It cannot work for anything produced locally: a daemon-host path like /home/sam/archive.md is not a URL Telegram can fetch, so the send silently does nothing useful.\n\nThe `case \"document\"` branch (media.go:124-127) already calls `bot.SendDocument`, so the routing exists. Only the file SOURCE is wrong.\n\n## What is needed\n\nA way for the agent to send a LOCAL file as an attachment -- documents, logs, screenshots, images, any media -- not a link. The go-telegram/bot SDK supports upload via a reader (`models.InputFileUpload` with an io.Reader) as an alternative to `InputFileString`; the sender needs to choose between fetch-by-URL and upload-by-reader based on whether the attachment is remote or local.\n\nExplicitly NOT the fix: exposing an external/public URL for local files. That trades a missing feature for a hosting and access-control problem.\n\n## Constraints to respect\n\n- Telegram enforces upload size limits (50 MB for documents via the Bot API at time of writing); exceeding them must produce a clear error to the operator, not a silent drop.\n- The file tools are workspace-confined unless `[chat] unrestricted_filesystem = true`. Sending must not become a way around whatever confinement is configured -- resolve and check the path under the same policy the read tool applies.\n- A failed send must surface as a failure the agent can see and report. The current defect is not that the agent lied; it is that success and silent non-delivery are indistinguishable to it.\n\n## Acceptance Criteria\n\nThe agent can send a local file through Telegram and the operator receives it as an attachment; local and remote attachments both work, choosing upload-by-reader or fetch-by-URL as appropriate; a send that fails (too large, unreadable, outside the configured confinement) returns an error the agent surfaces rather than reporting success; existing remote-URL media delivery is unchanged and still covered by tests.\n","status":"open","priority":2,"issue_type":"feature","owner":"sam@catlow.tech","created_at":"2026-08-24T15:32:07Z","created_by":"Sam Catlow","updated_at":"2026-08-24T15:32:07Z","dependency_count":0,"dependent_count":0,"comment_count":0} +{"_type":"issue","id":"archie-core-h3lg","title":"Dashboard swallows failed operator actions, showing nothing in the UI","description":"When an operator action fails, the dashboard surfaces nothing. Pressing Stop on a running task issued POST /api/tasks/3/action, received 403, and the only evidence anywhere was a browser console line: \"Failed to load resource: the server responded with a status of 403\". The page itself showed no error, no toast, no change of state -- the button simply appeared to do nothing.\n\nThis is how archie-core-440c (every dashboard mutation 403s behind a TLS-terminating reverse proxy) went unnoticed: the operator pressed Stop, saw nothing happen, and reasonably concluded the task was unstoppable rather than that the request had been refused. The bug was only found by opening devtools.\n\nConfirmed live 2026-08-25 while signed in to the production dashboard.\n\n## Why this is its own bead\n\n440c fixes the 403. This bead fixes the fact that ANY failed action is invisible -- a 500, a store failure, a refused state transition, an expired session -- and each of those has its own way of going wrong. Fixing only 440c leaves the next failure equally silent.\n\nNote internal/webui/api_tasks.go already returns distinguishable, human-readable failures (\"missing CSRF header\", \"cross-origin mutation refused\", \"runtime task control is unavailable\"). The server side is doing its job; the client discards it.\n\n## What is needed\n\n- A failed action tells the operator it failed, in the UI, with the server's reason where one is given.\n- The distinction that matters most: refused (403, bad state, not permitted) versus broken (5xx, network). The operator's next move differs -- the first is \"you cannot do that\", the second is \"try again or check the daemon\".\n- A 401 or an expired forward-auth session should prompt re-authentication rather than reading as a generic failure, since the deployment sits behind Authelia.\n- The optimistic UI must not show an action as applied when it was refused.\n\nPer CLAUDE.md the frontend is one folder per feature under ui/src/\u003cfeature\u003e with shared primitives in ui/src/base -- error surfacing used by more than one feature belongs in base, extracted on the SECOND real consumer, not in anticipation. Remember ui/dist is committed: run `task ui` and commit the rebuilt output in the same change.\n\n## Steps to Reproduce\n\n1. Load the dashboard in a deployment where mutations fail (any 440c-affected proxied deployment reproduces it directly).\n2. Press Stop, Retry, Abandon or Archive on a task.\n3. Observe the request fails in devtools while the page reports nothing.\n\n## Acceptance Criteria\n\nA failed operator action is reported in the dashboard with the server's reason where supplied; refused and broken failures are distinguishable to the operator; an authentication failure prompts re-auth rather than a generic error; no optimistic state change survives a failed request; dashboard tests cover a refused action, a server error and a network failure; ui/dist is rebuilt and committed.\n","status":"open","priority":2,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-24T15:49:18Z","created_by":"Sam Catlow","updated_at":"2026-08-24T15:50:15Z","external_ref":"https://github.com/samcharles93/archie-core/issues/629","dependency_count":0,"dependent_count":0,"comment_count":0} +{"_type":"issue","id":"archie-core-kkeg","title":"No byte-for-byte conversation replay: transcripts cannot be exported or examined","description":"Asked to save a complete transcript -- \"everything. My messages, yours, tools everything. Also save the agents logs\" -- the agent could not. It produced a summary archive and honestly documented the limitation: no chat export exists, and the task-log responses were clipped at the tool's 50 KB cap.\n\nSam's requirement: \"we should be able to receive and view and examine byte-for-byte replays of an entire transcript. exactly the commands run, the results received for those commands, the user messages, agent responses, EVERYTHING.\"\n\n## What exists and what does not\n\ninternal/gateway has session tooling -- session_list, session_resume, session_title, session_delete -- so sessions are already first-class and persisted (the turn ledger backs /gateway's replay of completed-duplicate turns, and archie-core-ippu made tool activity part of that record). What is missing is retrieval: nothing exposes a session's full contents for export or examination.\n\nEstablish first exactly what is persisted per turn today, because the answer determines whether this is an export feature or a capture feature. If tool ARGUMENTS and full tool RESULTS are not currently retained -- only rendered summaries -- then byte-for-byte replay requires changing what is written, not just adding a reader. That distinction is the main open question and should be settled before design.\n\n## Requirements\n\n- Fidelity: user messages, agent responses, every tool call with its arguments, and every tool result, in order, with timestamps. Not a rendered summary, and not the truncated preview the chat UI shows.\n- Retrieval: usable for a whole session, not capped at a tool-result size limit. Bulk delivery almost certainly belongs on the send_file path (archie-core-absb) rather than in a tool result -- write the file, deliver the file.\n- Examination, not just download: an operator should be able to inspect a replay in the dashboard, which is where the event inspector already lives.\n- Honesty: if anything is unavailable (rotated, compacted, never captured), the export must say so explicitly rather than presenting a partial record as complete. The agent got this right by hand; the mechanism should guarantee it.\n\n## Constraints\n\n- Transcripts contain secrets by nature -- tool arguments carry tokens, results carry file contents. internal/memory/scrubber and gateway/stream.go's sensitiveParameterKey are existing prior art for redaction and should be reused rather than reimplemented. Decide explicitly whether an export is redacted, raw, or offers both, and who may request one.\n- Retention: a full-fidelity record is large. Decide what is kept and for how long, consistent with the 7-day payload retention already decided for captured events.\n\n## Acceptance Criteria\n\nAn operator can export a complete session transcript containing user messages, agent responses, tool calls with arguments and tool results with content, in order and timestamped; the export is delivered as a file rather than clipped into a tool result; a replay can be examined in the dashboard; anything missing from the record is stated explicitly in the export; redaction policy is decided, documented and applied; tests cover a session larger than any tool-result cap and assert no gaps or reordering.\n","status":"open","priority":2,"issue_type":"feature","owner":"sam@catlow.tech","created_at":"2026-08-24T15:48:56Z","created_by":"Sam Catlow","updated_at":"2026-08-24T15:50:16Z","external_ref":"https://github.com/samcharles93/archie-core/issues/630","dependency_count":0,"dependent_count":0,"comment_count":0} +{"_type":"issue","id":"archie-core-wp9s","title":"/status and /tasks have the wrong division of labour","description":"Sam's words: \"/status is fucking annoying. I'm invoking an actual status update, receiving minor information as well as shit I can get elsewhere. What's worse is that the /tasks command is meant to be for viewing the running agents, not /status.\"\n\nObserved 2026-08-24, the entire output of /status was:\n\n Tasks Parked: 2\n Runtime Provider: OpenAI Model: openai/gpt-5.6-luna\n\nTwo problems in one screen. It answers the question /tasks should own (what work is in flight), and it answers it thinly -- a count, with no task identity, no stage, no age, nothing actionable. Everything else it shows is static configuration available elsewhere. Later in the same session /status reported \"Running: 1\" for a task that was stuck in a failure loop and going nowhere, which is the specific case where a bare count actively misleads.\n\n## The division of labour to restore\n\n- `/tasks` owns WORK: what is running, what is parked and why, what needs the operator. This is the live view of the agents, and it is where task identity, workflow, stage, attempt and age belong.\n- `/status` owns HEALTH: is the daemon well. Broker connectivity, provider reachability, channel state, container pool, queue depth, last poll, version. The things an operator checks when something feels wrong and which are NOT visible elsewhere in chat.\n\nNeither should be a thin duplicate of the other, and neither should pad itself with static config the operator already knows.\n\n## Related, decide together\n\narchie-core-624 (task_action chat tool) adds operator verbs for tasks. /tasks is the natural surface for discovering the ids those verbs act on, so the two should be designed as one flow: see the work, then act on it. Check what internal/gateway/task_tools.go already returns before adding a new query path -- ChatTaskSummary may already carry most of what /tasks should show.\n\n## Steps to Reproduce\n\n1. Run /status in chat with tasks parked and one running.\n2. Observe a parked/running COUNT plus provider and model, with no way to identify or act on any task.\n3. Run /tasks and observe the overlap.\n\n## Acceptance Criteria\n\n/tasks shows the live work with enough identity and state to act on it (id, title, status, workflow/stage, age) and is the documented way to view running agents; /status reports daemon health that is not obtainable elsewhere in chat and does not duplicate the task list; a task that is running but not progressing is distinguishable from one making progress; the command descriptions registered with the platform match what each actually does.\n","status":"open","priority":2,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-24T15:48:33Z","created_by":"Sam Catlow","updated_at":"2026-08-24T15:50:17Z","external_ref":"https://github.com/samcharles93/archie-core/issues/631","dependency_count":0,"dependent_count":0,"comment_count":0} +{"_type":"issue","id":"archie-core-8qpa","title":"Chat agent does not know its own repository or workspace, wasting turns rediscovering them","description":"Asked to raise a GitHub issue, the agent spent roughly eight tool calls working out where it lives: `pwd`, a `find` over /home/sam/projects returning 139 lines, `git remote -v`, a grep over RELEASING.md returning 92 lines, and a failed `read` of a README that does not exist. It eventually located the repository and filed the issue correctly, but every one of those calls was rediscovering a fact the daemon already knows.\n\nSam's words: \"Yep, thats frustrating AF!\"\n\n## Why this is worth fixing structurally\n\nIt is not only slow and expensive. It is a correctness risk: an agent that has to guess which checkout it is looking at can act on the wrong one, and on this host more than one archie-core checkout exists. It also degrades every task that begins with orientation rather than work.\n\n## What to do\n\ninternal/gateway/BuildSystemPrompt renders templates/archie.md.tpl, which already carries an `\u003cenv\u003e` block. Per CLAUDE.md that template is the single place instruction precedence, core rules and the `\u003ctools\u003e`/`\u003cenv\u003e` blocks live -- personas are the STYLE layer only, so this belongs in the template, never in a persona string.\n\nPut the facts the daemon already holds into `\u003cenv\u003e`: the configured workspace path, the repositories under management with their forge and default branch, and the identity in use. Configuration is the source of truth ([repos] entries, chat.workspace); do not have the prompt claim anything the daemon cannot confirm, and do not hardcode paths.\n\nNote the same rule that governs `\u003ctools\u003e` applies here: the block must be built from what the daemon actually has, because a prompt that names a repository the agent cannot reach is worse than silence -- the model will confidently act on it.\n\n## Acceptance Criteria\n\nThe chat agent knows its workspace path, managed repositories and identity without probing the filesystem; the block is rendered from live configuration rather than hardcoded; an empty or unconfigured value renders as explicitly unknown rather than as a plausible-looking default; a task that previously required filesystem archaeology to orient completes without it; tests assert the block reflects configuration and omits nothing the daemon knows.\n","status":"open","priority":2,"issue_type":"feature","owner":"sam@catlow.tech","created_at":"2026-08-24T15:48:15Z","created_by":"Sam Catlow","updated_at":"2026-08-24T15:50:17Z","external_ref":"https://github.com/samcharles93/archie-core/issues/632","dependency_count":0,"dependent_count":0,"comment_count":0} +{"_type":"issue","id":"archie-core-8s7v","title":"[EPIC] Intercom: let the chat agent talk to running agents, the curator, and peers","description":"Today the chat agent can only observe autonomous work -- list tasks, read logs -- and act on it as an outsider through coarse verbs (spawn, stop). It cannot TALK to a running agent. An operator who can see a task going wrong has no way to say \"stop guessing, the config lives at X\" without killing the task and starting over, losing everything the agent had already worked out. Archie should behave like a living system whose parts can address each other, not a set of isolated processes with a dashboard bolted on.\n\n## Prior art: pi-intercom\n\nPi ships `pi-intercom`, which solves this shape for Pi sessions on one machine and is worth reading before designing (/home/sam/.pi/agent/npm/node_modules/pi-intercom; skills/pi-intercom/SKILL.md is the usage guide). Its model:\n\n- Sessions take names (`/name planner`, `/name worker-backend`) and address each other by name.\n- `send` -- fire-and-forget notification. Task assignment, status, notice.\n- `ask` -- BLOCKS until the target replies, with a timeout. The blocking form is the interesting one: it lets a worker stop and get a decision instead of guessing.\n- `reply` -- answers an inbound ask, threaded automatically.\n- `pending` -- lists unresolved inbound asks, i.e. who is waiting on you.\n- `list` -- connected sessions and their state (idle / thinking / tool), for discovering targets.\n- Its use cases map directly onto archie: planner-to-worker delegation, context and findings handoff, blocking clarification, subagent escalation (`need_decision`, `interview_request`), cross-project coordination.\n\n## What is genuinely different here\n\nDo NOT copy pi-intercom's transport. It ships its own local IPC broker (broker/broker.ts, a socket server with framing, spawn and runtime-claim logic) because Pi has no message bus. **Archie already has one**: NATS, with per-task subjects already defined in internal/agentexec/subjects.go (archie.agent.\u003cid\u003e.system and .events) and a request/reply pattern already used by taskrun, forgerpc, storerpc and worktreerpc. Building a second broker alongside it would be the \"two parallel abstractions\" mistake this repo already made once with gateway.BasePlatformAdapter.\n\nSo the real design questions are:\n1. Does agent-directed messaging ride the existing per-task subjects, or does it need its own contract and subject family? Note CLAUDE.md's recorded NATS traps -- work-queue retention forbids overlapping consumers, and reply inboxes are core-NATS-only and are not stream subjects.\n2. What is addressable? Running tasks have ids. The curator, channels and the daemon itself do not have a uniform identity for this purpose. An address space has to be decided before verbs are.\n3. How does a BLOCKING ask work against an agent that is mid-model-call? A worker is not sitting in a receive loop; it is inside an agentloop turn. Delivering a message it will actually notice, without corrupting the turn, is the hard part -- and is where this stops being a transport problem.\n4. Authorization: an operator messaging their own task is fine. Cross-identity messaging is not, and multi-identity deployments are supported (deployments/multi-forge-github-gitea.toml). Whatever the gateway's task tools enforce for identity scoping, this must enforce too.\n5. Does an inbound operator message become part of the agent's context permanently, or a one-shot injection? This decides whether it can be used to steer a task or only to interrupt it.\n\n## Relationship to existing work\n\n- Overlaps archie-core-absb (agent cannot send local files) only in spirit: both are about the agent being able to communicate outward.\n- The curator (internal/domain/curator) is a natural second participant after running tasks.\n- Any design here should be checked against docs/architecture/organisation.md: the domain declares the contract it needs; the transport implements it.\n\n## Success Criteria\n\nAn operator can address a running agent from chat and have it receive the message without the task being killed and restarted; a blocking ask returns the agent's answer or times out cleanly; participants are discoverable with their current state; messaging is identity-scoped so one identity cannot address another's work; the mechanism reuses the existing NATS transport rather than introducing a second broker; a design decision is recorded in docs/prds/ before implementation, per CLAUDE.md's scope discipline.\n","notes":"Provenance correction 2026-08-25: this bead's description says 'Pi ships pi-intercom'. That is WRONG and Sam corrected it -- pi-intercom is a THIRD-PARTY PLUGIN written by a different developer solving their own problem, not a Pi feature and not endorsed by Pi. Weigh it accordingly: it is one developer's solution worth reading for its verb vocabulary (send/ask/reply/pending/list) and for the blocking-ask idea, not a reference implementation carrying Pi's design authority. The architectural judgement in this bead stands unchanged: do NOT adopt its broker, because archie already has NATS.","status":"open","priority":2,"issue_type":"epic","owner":"sam@catlow.tech","created_at":"2026-08-24T15:35:57Z","created_by":"Sam Catlow","updated_at":"2026-08-24T15:50:18Z","external_ref":"https://github.com/samcharles93/archie-core/issues/633","dependency_count":0,"dependent_count":0,"comment_count":0} +{"_type":"issue","id":"archie-core-absb","title":"Agent cannot send local files: Telegram delivery is URL-fetch only","description":"The agent can produce a file on the host -- a log dump, a screenshot, a written archive, a diff -- and has no way to deliver it to the operator. Asked to send a saved transcript, it replied with a \"Download the archive\" link twice; nothing arrived either time, and it had no signal that anything had failed.\n\n## Why video works and files do not\n\n`telegramMediaSender.dispatch` (internal/channels/telegram/media.go:97) builds every attachment as:\n\n file := \u0026models.InputFileString{Data: att.URL}\n\n`InputFileString` tells Telegram to FETCH the given URL itself. That works for the existing media path because those attachments are remote-hosted -- MiniMax returns a public URL for a generated video, which is what `MultimodalResult.URLs` was added for. It cannot work for anything produced locally: a daemon-host path like /home/sam/archive.md is not a URL Telegram can fetch, so the send silently does nothing useful.\n\nThe `case \"document\"` branch (media.go:124-127) already calls `bot.SendDocument`, so the routing exists. Only the file SOURCE is wrong.\n\n## What is needed\n\nA way for the agent to send a LOCAL file as an attachment -- documents, logs, screenshots, images, any media -- not a link. The go-telegram/bot SDK supports upload via a reader (`models.InputFileUpload` with an io.Reader) as an alternative to `InputFileString`; the sender needs to choose between fetch-by-URL and upload-by-reader based on whether the attachment is remote or local.\n\nExplicitly NOT the fix: exposing an external/public URL for local files. That trades a missing feature for a hosting and access-control problem.\n\n## Constraints to respect\n\n- Telegram enforces upload size limits (50 MB for documents via the Bot API at time of writing); exceeding them must produce a clear error to the operator, not a silent drop.\n- The file tools are workspace-confined unless `[chat] unrestricted_filesystem = true`. Sending must not become a way around whatever confinement is configured -- resolve and check the path under the same policy the read tool applies.\n- A failed send must surface as a failure the agent can see and report. The current defect is not that the agent lied; it is that success and silent non-delivery are indistinguishable to it.\n\n## Acceptance Criteria\n\nThe agent can send a local file through Telegram and the operator receives it as an attachment; local and remote attachments both work, choosing upload-by-reader or fetch-by-URL as appropriate; a send that fails (too large, unreadable, outside the configured confinement) returns an error the agent surfaces rather than reporting success; existing remote-URL media delivery is unchanged and still covered by tests.\n","status":"closed","priority":2,"issue_type":"feature","owner":"sam@catlow.tech","created_at":"2026-08-24T15:32:07Z","created_by":"Sam Catlow","updated_at":"2026-08-24T15:50:19Z","closed_at":"2026-08-24T15:43:20Z","close_reason":"send_file tool plus upload-by-reader delivery; commit 9a45fbb","external_ref":"https://github.com/samcharles93/archie-core/issues/634","dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-1787583419901-1-85796c0b","title":"Allow parked agent jobs to be closed or archived","description":"## Problem\nParked agent jobs remain visible indefinitely, but the task-management interface currently exposes no action to close or archive them. This leaves stale jobs in the active job history and requires manual cleanup outside the normal workflow.\n\n## Observed behavior\nThe following old jobs are parked and cannot be closed through the available task-management actions:\n\n- Job #1 — `daemon: label dispatch trigger with empty label matches every open issue`\n- Job #2 — `archied: [[repos]] entries can't span more than one forge`\n\nThe interface can list and inspect parked jobs, but provides no close/archive operation.\n\n## Expected behavior\nProvide an explicit operation for a parked job, such as:\n\n- `close` when the job is definitively finished or no longer actionable;\n- `archive` when it should be removed from the active job list while retaining history;\n- optionally `reopen` if a parked job needs to be resumed.\n\nThe operation should persist the state, be reflected in task listings, and retain the job logs and audit history.\n\n## Acceptance criteria\n- A user can close or archive a parked job from the supported task-management interface/API.\n- The operation is idempotent and reports a clear error for invalid state transitions.\n- Closed/archived jobs no longer appear among active or parked jobs by default, while remaining queryable.\n- Existing logs, attempts, and failure details remain accessible.\n- Tests cover closing, archiving, reopening (if supported), and repeated operations.\n","status":"open","priority":2,"issue_type":"bug","assignee":"samcharles93","created_at":"2026-08-24T13:44:17Z","updated_at":"2026-08-24T13:48:20Z","external_ref":"https://github.com/samcharles93/archie-core/issues/624","source_system":"github:https://github.com/samcharles93/archie-core/issues/624:624","metadata":null,"labels":["agent","bug","ux"],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-5bsf","title":"Rollback the managed agent image when a runtime update fails health checks","description":"The runtime update path rebuilds the Docker image, but scripts/archie-update-watchdog only restores the unused host archie-agent binary. A failed health check can report a rollback while the task-container image remains on the failed runtime. Design and implement image-reference preservation/restoration for the configured managed worker image, with tests for runtime-only and combined updates.","acceptance_criteria":"A failed runtime-only update restores the prior worker image before restarting archied; a combined update restores both daemon and worker image atomically; update tests prove the configured managed image, not a host worker binary, is the rollback target.","status":"closed","priority":2,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-24T04:37:24Z","created_by":"Sam Catlow","updated_at":"2026-08-24T05:19:34Z","closed_at":"2026-08-24T05:19:34Z","close_reason":"Completed; reconciled with the already-closed GitHub issue.","external_ref":"https://github.com/samcharles93/archie-core/issues/621","metadata":null,"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-q15y.4","title":"Make native archied embedded NATS and managed containers the default deployment","description":"Supported examples and install.sh currently generate agent.mode=inprocess and treat external Compose NATS as the container path. Migrate the default operator experience to native archied plus embedded NATS plus managed task containers, while keeping external NATS as the advanced broker option.","acceptance_criteria":"Fresh install produces the supported NATS-only container topology; systemd runs native archied; interactive host chat authority is unchanged; no Compose NATS service is required for embedded mode; external NATS profile remains documented and load-tested.","status":"closed","priority":2,"issue_type":"feature","owner":"sam@catlow.tech","created_at":"2026-08-24T03:03:38Z","created_by":"Sam Catlow","updated_at":"2026-08-24T06:58:42Z","started_at":"2026-08-24T04:21:30Z","closed_at":"2026-08-24T06:58:42Z","close_reason":"Implemented in c978f10 (feat(deployment): default to managed NATS workers). Verified: no agent.mode/inprocess remains in install.sh, deployments/*.toml or config.example.toml; deployment_contract_test.go added to enforce it.","external_ref":"https://github.com/samcharles93/archie-core/issues/622","metadata":null,"dependencies":[{"issue_id":"archie-core-q15y.4","depends_on_id":"archie-core-q15y","type":"parent-child","created_at":"2026-08-24T03:03:38Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-q15y.4","depends_on_id":"archie-core-q15y.1","type":"blocks","created_at":"2026-08-24T03:03:52Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-q15y.4","depends_on_id":"archie-core-q15y.2","type":"blocks","created_at":"2026-08-24T03:03:53Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-q15y.4","depends_on_id":"archie-core-q15y.3","type":"blocks","created_at":"2026-08-24T03:03:53Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":3,"dependent_count":0,"comment_count":0}