diff --git a/.beads/interactions.jsonl b/.beads/interactions.jsonl index c21cbff4a..b742a7d7b 100644 --- a/.beads/interactions.jsonl +++ b/.beads/interactions.jsonl @@ -119,3 +119,7 @@ {"id":"int-4cf7ad8912f5fbf96dd4111ba46d9f9a","kind":"field_change","created_at":"2026-08-24T07:12:11.82615813Z","actor":"Sam Catlow","issue_id":"archie-core-1786751948782-3-837a8fd0.3","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Fixed: GET /api/version + Configuration-page 'Update status' card, sourced from the InstallType/Reference/RunningVersions plumbing landed in .1/.2. Adversarial review found one real bug (Installed=='' with Available set incorrectly returned update_available instead of unknown) and one test gap (present-but-empty running-version map entry) -- both fixed, tests added, all green. [Closure restored 2026-08-24: originally closed 2026-08-23, lost when the beads DB was rebuilt (.beads.backup-pre-recovery).]"}} {"id":"int-24dfa19bb0c13eba84871d83d412520b","kind":"field_change","created_at":"2026-08-24T07:12:12.273422399Z","actor":"Sam Catlow","issue_id":"archie-core-dfck","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"SDK v0.1.22 provides one bounded forced-finish recovery; Archie opts in through InProcessRunner. Focused test, task check, module verification, and independent adversarial review passed. Re-verified 2026-08-24: the opt-in moved from the deleted InProcessRunner to agentexec.NewLoopRunner (loop_runner.go:106 CompletionForceFinish), which is what the archie-agent worker constructs; ai-sdk still v0.1.22. [Closure restored 2026-08-24: originally closed 2026-08-24, lost when the beads DB was rebuilt (.beads.backup-pre-recovery).]"}} {"id":"int-33653ae0f02479da575ee2b075218ac6","kind":"field_change","created_at":"2026-08-24T07:59:38.613969236Z","actor":"Sam Catlow","issue_id":"archie-core-1ysw.7","extra":{"field":"status","new_value":"closed","old_value":"in_progress","reason":"Closed"}} +{"id":"int-e5c0464ce6117a2013ccdccf67829c46","kind":"field_change","created_at":"2026-08-24T08:15:46.802569084Z","actor":"Sam Catlow","issue_id":"archie-core-1ysw.6","extra":{"field":"status","new_value":"closed","old_value":"in_progress","reason":"Fixed: recordUpstream extracted from Push (worktree.go:465); a post-publication config failure is now a logged warning and Push returns success once the remote ref is published. Manager gained an optional Log field with a slog.Default() fallback. Verified by inspection rather than a red run -- the test uses the new Log field so it cannot compile against the pre-fix code. task check green; fresh adversarial review (independent, did not write the code) zero findings."}} +{"id":"int-07bcd93041cf024404279b55497e4f4a","kind":"field_change","created_at":"2026-08-24T08:15:48.462601908Z","actor":"Sam Catlow","issue_id":"archie-core-1ysw.8","extra":{"field":"status","new_value":"closed","old_value":"in_progress","reason":"Fixed: CommitAll now takes a live context and checks ctx.Err() before open, worktree, staging, status and commit (worktree.go:398-430), so a pre-cancelled context mutates neither index nor HEAD. Proven red against pre-fix code: 'CommitAll() error = nil, want context canceled' for both a cancelled context and an expired deadline. task check green; fresh adversarial review zero findings."}} +{"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."}} diff --git a/.beads/issues.jsonl b/.beads/issues.jsonl index 9cdb638ff..ad185d4bc 100644 --- a/.beads/issues.jsonl +++ b/.beads/issues.jsonl @@ -2,7 +2,7 @@ {"_type":"issue","id":"archie-core-mzok","title":"Make ClaimTurn insert-race regression deterministic under CI","description":"GitHub deploy run 32587841233 failed after the gateway compile fix because TestClaimTurnConcurrentInsertRaceNeverReturnsAnError launched 200 concurrent SQLite claims and exhausted its immediate retry loop with SQLITE_BUSY. The test's stated target is the two-connection same-turn insert race, not unrelated global write-lock saturation.","acceptance_criteria":"The regression still races two independent stores over the same turn ID; unrelated cross-trial SQLite contention cannot exhaust retries; repeated focused runs, task check, and diff-scoped lint pass; fresh adversarial review has zero surviving findings.","status":"closed","priority":0,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-22T17:34:07Z","created_by":"Sam Catlow","updated_at":"2026-08-24T06:59:21Z","started_at":"2026-08-22T17:34:11Z","closed_at":"2026-08-24T06:59:21Z","close_reason":"Already fixed on main: session_store_sqlite_claimturn_race_test.go now runs the 100 trials serially (two stores racing one turn ID per trial) with bounded SQLITE_BUSY retries, instead of 200 concurrent claims. Verified: -count=3 passes.","external_ref":"https://github.com/samcharles93/archie-core/issues/587","metadata":null,"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-bia3","title":"Fix merged gateway capability contract blocking GitHub deploy","description":"PR #560 removed the dead BasePlatformAdapter while PR #561 independently added adapter_capabilities.go and tests that still depend on it. Both branches passed alone, but merged main no longer compiles, so deploy.yml cannot publish the intended video-generation release.","acceptance_criteria":"internal/gateway compiles without BasePlatformAdapter; live Telegram media delivery and capability reporting remain covered; task check and lint pass; a fresh adversarial review has zero surviving findings.","status":"closed","priority":0,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-22T17:15:14Z","created_by":"Sam Catlow","updated_at":"2026-08-24T06:59:22Z","started_at":"2026-08-22T17:15:22Z","closed_at":"2026-08-24T06:59:22Z","close_reason":"Already fixed on main: BasePlatformAdapter has zero references repo-wide, adapter_capabilities.go + tests stand alone. Verified: go build ./... clean, gateway capability tests pass.","external_ref":"https://github.com/samcharles93/archie-core/issues/588","metadata":null,"dependency_count":0,"dependent_count":0,"comment_count":0} {"_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":"open","priority":0,"issue_type":"epic","owner":"sam@catlow.tech","created_at":"2026-08-22T11:01:18Z","created_by":"Sam Catlow","updated_at":"2026-08-23T12:53:21Z","external_ref":"https://github.com/samcharles93/archie-core/issues/590","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-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} @@ -82,10 +82,10 @@ {"_type":"issue","id":"archie-core-3ghy","title":"Wire generate_video (MiniMax) tool end-to-end","description":"Implemented the MiniMax text-to-video generation tool and wired it through the media-delivery pipeline built for this: tool -\u003e tools.MultimodalResult -\u003e drainChatStream detection -\u003e gateway.TurnStream.Media -\u003e gateway.MediaSender (Telegram delivers inline; webui falls back to a link).\n\n## What shipped\n- internal/tools/minimax: API client (create+poll against MiniMax's v2/video_generation and v2/query/video_generation/{id}), a builtin tools.ToolEntry (generate_video), fully test-first with an injected-clock poll loop (no real sleep in tests).\n- internal/tools: extended tools.MultimodalResult with a URLs []MediaRef field, for tool results whose media lives at a remote hosted URL rather than local bytes (the existing Files field).\n- cmd/archied/telegram_setup.go: drainChatStream now detects a MultimodalResult in a tool result's Output and calls turn.Media(...) per URL, alongside the existing turn.ToolCall(...) reporting.\n- internal/config: MinimaxConfig (off by default, unlike web_fetch -- this spends real API credits per call), api_key via the existing secret.SecretRef pattern.\n- cmd/archied/bootstrap.go: registerMinimaxTool -- only registers the tool once an API key actually resolves, matching the 'do not advertise a broken capability' pattern web_fetch already uses.\n- config.example.toml: documented [tools.minimax].\n\n## Scope deliberately left out (by explicit instruction: URL-only, get it working first)\n- Image-to-video (image_url content items) -- text-to-video only.\n- Local byte/file upload delivery path -- URL-only, matches gateway.MediaSender's current URL-only design.\n- Email/webhook channel delivery -- only Telegram implements gateway.MediaSender today; other channels have no inline media path, and webui falls back to a text link (see archie-core-1786748942243-6-f109697e for the still-open 'deliver generated images through channel and web abstractions' work).\n- No OpenAI video provider -- only MiniMax implemented, per this issue's scope. A second provider should follow the same tool-package shape (internal/tools/\u003cprovider\u003e) if wanted.\n- No spend guard / approval gate on the tool despite it costing real credits per call (classified ClassMutating, not RequiresApproval) -- flagged in tool.go's doc comment as a candidate follow-up if usage shows it's needed.","acceptance_criteria":"task check passes; go test ./... green except the pre-existing unrelated internal/app/agentworker architecture-test failure; golangci-lint clean on every touched package; config.example.toml documents [tools.minimax].","status":"closed","priority":2,"issue_type":"feature","owner":"sam@catlow.tech","created_at":"2026-08-22T15:34:24Z","created_by":"Sam Catlow","updated_at":"2026-08-24T07:12:10Z","closed_at":"2026-08-24T07:12:10Z","close_reason":"Shipped and verified: task check equivalent (fmt/vet/build/test/lint) is clean across every touched package, red-then-green throughout. See the issue description for what's in scope and what's explicitly deferred. [Closure restored 2026-08-24: originally closed 2026-08-22, lost when the beads DB was rebuilt (.beads.backup-pre-recovery).]","external_ref":"https://github.com/samcharles93/archie-core/issues/594","metadata":null,"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-azbo","title":"Remove dead BasePlatformAdapter interface from internal/gateway","description":"`gateway.BasePlatformAdapter` (internal/gateway/adapter.go, Connect/Disconnect/Send/ChatInfo) is implemented by nothing outside its own test stub. It landed in commit bc1caf6 alongside the Session types and was never wired.\n\nEvery live channel instead implements `channels.Channel` (= `gateway.Gateway`: Name/Start/Stop, plus ConfigSchema/ValidateConfig) -- asserted at internal/channels/telegram/telegram.go:1229, internal/channels/email/email.go:389, internal/channels/webhook/webhook.go:224. So the repo carries two parallel channel abstractions and the newer one is inert.\n\nIt also has an internal contradiction that is likely why it was never implemented: the doc comment says the daemon instantiates 'one adapter per active bot identity x platform' (adapter.go:59) but `ChatInfo(ctx) (ChatInfo, error)` is documented as 'static metadata about the conversation a platform adapter is connected to' (adapter.go:36-38) with no chat argument. Telegram's Gateway is a single instance serving many chats, so ChatInfo(ctx) has no single answer. Send(ctx, MessageEvent) is fine for both models since MessageEvent carries ChannelID; ChatInfo is the part that only makes sense per-conversation.\n\nOutbound delivery is assigned to the not-yet-built `internal/domain/messaging` by docs/architecture/migration-decisions.md section 2, so this interface should not be revived in place -- it should be deleted and its intent re-expressed there.\n\n## Scope\n\n- Delete BasePlatformAdapter and its test stub from internal/gateway/adapter.go / adapter_test.go.\n- Keep SendResult and ChatInfo structs if domain/messaging or the media work still wants them; they are separable from the interface.\n- Decouple gateway.CapabilitiesOf from BasePlatformAdapter (it currently takes one) so the capability mechanism survives the removal.\n\n## Acceptance criteria\n\n- BasePlatformAdapter no longer exists; `task check` passes.\n- No behaviour change: nothing implemented it, so nothing should need rewiring.\n- Any type retained from adapter.go has at least one live consumer, or is removed too.","notes":"Discovery confirmed CapabilitiesOf is absent from the current checkout and gateway history. SendResult and ChatInfo have no live consumers, so all three legacy declarations are removed. Red test: TestLegacyPlatformAdapterTypesAreRemoved failed on BasePlatformAdapter, ChatInfo, and SendResult before deletion; gateway package suite passes after deletion. Full task check currently reaches one unrelated pre-existing failure: internal/app/agentworker TestApplicationOwnsNoTransportWireMechanics reports persistent_runner.go imports JSON wire encoding.","status":"closed","priority":2,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-08-22T12:04:10Z","created_by":"Sam Catlow","updated_at":"2026-08-24T07:12:09Z","started_at":"2026-08-22T12:08:39Z","closed_at":"2026-08-24T07:12:09Z","close_reason":"Removed the unwired BasePlatformAdapter, SendResult, ChatInfo, and their test-only stub. CapabilitiesOf is absent from the current checkout/history. Gateway and worktree tests pass. task check passes all packages except the pre-existing tracked agentworker architecture failure archie-core-hqst. [Closure restored 2026-08-24: originally closed 2026-08-22, lost when the beads DB was rebuilt (.beads.backup-pre-recovery).]","external_ref":"https://github.com/samcharles93/archie-core/issues/595","metadata":null,"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-hqst","title":"TestApplicationOwnsNoTransportWireMechanics fails: persistent_runner.go imports encoding/json","description":"internal/app/agentworker/architecture_test.go's TestApplicationOwnsNoTransportWireMechanics fails on main (pre-existing, unrelated to archie-core-qk8m): persistent_runner.go imports encoding/json, tripping the check that agentworker's app layer owns no transport wire mechanics. Introduced by e351581 (feat(storage): persist agent project state). Confirmed via git stash that this fails identically with none of the mcp-npm-cache changes applied.","status":"closed","priority":2,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-22T11:09:58Z","created_by":"Sam Catlow","updated_at":"2026-08-24T06:59:35Z","started_at":"2026-08-22T12:16:11Z","closed_at":"2026-08-24T06:59:35Z","close_reason":"Resolved on main: persistent_runner.go no longer imports encoding/json and TestApplicationOwnsNoTransportWireMechanics passes.","external_ref":"https://github.com/samcharles93/archie-core/issues/596","metadata":null,"dependency_count":0,"dependent_count":0,"comment_count":0} -{"_type":"issue","id":"archie-core-1ysw.9","title":"Align branch naming behavior, API, tests, and documentation","description":"branchPrefix ignores title and body despite the documented title-prefix contract, and branchSlug documents 40 characters while implementing 60.\n\nRe-verified against main (internal/worktree/worktree.go). Three of the four original defects remain; the checked-in FIXME is already gone.\n\n- `archieBranch` (line 610-612) documents \"conventional commit prefix from the issue title when possible, falls back to labels\", but `branchPrefix(title, body, labels)` (line 632) switches only on `labels` and returns \"feat\" otherwise. `title` and `body` are dead parameters.\n- `strings.TrimSuffix(prefix, \"\")` (line 616) is a no-op: TrimSuffix with an empty suffix always returns its input, so the guard it appears to express does nothing.\n- `branchSlug`'s doc comment (line 652-653) says \"max 40 chars\"; the implementation breaks at `b.Len() \u003e= 60` (line 662).\n- No FIXME or TODO remains in the file.\n\n## Steps to Reproduce\n\n1. Call `archieBranch(12, \"fix: crash on empty payload\", \"\", \"\")` with no labels.\n2. Expected per the doc comment: prefix `fix` derived from the title. Actual: `feat/12-fix-crash-on-empty-payload` — the title prefix is ignored and also left duplicated in the slug, because the strip branch only fires when `prefix` already matches the title.\n3. Call `archieBranch(12, \"\u003ctitle of 80+ characters\u003e\", \"\", \"bug\")` and observe the slug runs to 60 characters, not the 40 the doc comment promises.\n\n## Acceptance Criteria\n\nThe chosen title/label precedence is explicit and tested for unlabeled and conflicting inputs; dead parameters and the TrimSuffix no-op are removed; slug documentation and boundary tests agree with the implemented limit; scoped lint passes.\n","acceptance_criteria":"The chosen title/label precedence is explicit and tested for unlabeled and conflicting inputs; dead parameters and no-op residue are removed; slug documentation and boundary tests agree with 60; scoped lint passes.","status":"in_progress","priority":2,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-22T11:01:48Z","created_by":"Sam Catlow","updated_at":"2026-08-24T07:42:11Z","started_at":"2026-08-24T07:42:11Z","lease_expires_at":"2026-08-24T07:47:11Z","heartbeat_at":"2026-08-24T07:42:11Z","external_ref":"https://github.com/samcharles93/archie-core/issues/597","dependencies":[{"issue_id":"archie-core-1ysw.9","depends_on_id":"archie-core-1ysw","type":"parent-child","created_at":"2026-08-22T21:01:48Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0} +{"_type":"issue","id":"archie-core-1ysw.9","title":"Align branch naming behavior, API, tests, and documentation","description":"branchPrefix ignores title and body despite the documented title-prefix contract, and branchSlug documents 40 characters while implementing 60.\n\nRe-verified against main (internal/worktree/worktree.go). Three of the four original defects remain; the checked-in FIXME is already gone.\n\n- `archieBranch` (line 610-612) documents \"conventional commit prefix from the issue title when possible, falls back to labels\", but `branchPrefix(title, body, labels)` (line 632) switches only on `labels` and returns \"feat\" otherwise. `title` and `body` are dead parameters.\n- `strings.TrimSuffix(prefix, \"\")` (line 616) is a no-op: TrimSuffix with an empty suffix always returns its input, so the guard it appears to express does nothing.\n- `branchSlug`'s doc comment (line 652-653) says \"max 40 chars\"; the implementation breaks at `b.Len() \u003e= 60` (line 662).\n- No FIXME or TODO remains in the file.\n\n## Steps to Reproduce\n\n1. Call `archieBranch(12, \"fix: crash on empty payload\", \"\", \"\")` with no labels.\n2. Expected per the doc comment: prefix `fix` derived from the title. Actual: `feat/12-fix-crash-on-empty-payload` — the title prefix is ignored and also left duplicated in the slug, because the strip branch only fires when `prefix` already matches the title.\n3. Call `archieBranch(12, \"\u003ctitle of 80+ characters\u003e\", \"\", \"bug\")` and observe the slug runs to 60 characters, not the 40 the doc comment promises.\n\n## Acceptance Criteria\n\nThe chosen title/label precedence is explicit and tested for unlabeled and conflicting inputs; dead parameters and the TrimSuffix no-op are removed; slug documentation and boundary tests agree with the implemented limit; scoped lint passes.\n","acceptance_criteria":"The chosen title/label precedence is explicit and tested for unlabeled and conflicting inputs; dead parameters and no-op residue are removed; slug documentation and boundary tests agree with 60; scoped lint passes.","status":"closed","priority":2,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-22T11:01:48Z","created_by":"Sam Catlow","updated_at":"2026-08-24T08:15:49Z","started_at":"2026-08-24T07:42:11Z","closed_at":"2026-08-24T08:15:49Z","close_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.","external_ref":"https://github.com/samcharles93/archie-core/issues/597","dependencies":[{"issue_id":"archie-core-1ysw.9","depends_on_id":"archie-core-1ysw","type":"parent-child","created_at":"2026-08-22T21:01:48Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-1ysw.7","title":"Clean no-change worktrees at terminal completion","description":"BuildNoChanges transitions directly to merged without a PR, bypassing the only production worktree cleanup path and leaking a full clone.\n\nConfirmed still present on main. `closeNoChangesIssue` (internal/domain/workflow/steps.go:67-77) sets `Outcome{Status: store.StatusMerged}` directly, with no worktree removal. The only two production callers of `worktree.Manager.Cleanup` are internal/daemon/daemon.go:769 and :788, both inside the PR-state polling loop that transitions out of `StatusPROpen`. A task that reaches `merged` without ever opening a PR never enters that loop, so its clone is never removed.\n\n## Steps to Reproduce\n\n1. Dispatch a task whose builder stage completes with `StatusPassed` but produces no diff, so `implement.go:166` sets `tc.BuildNoChanges = true`.\n2. Let `StageCommitPush` run: it takes the `BuildNoChanges` branch, closes the issue, and sets the outcome to `merged`.\n3. Observe the task row reaches `merged` with no PR number, so the daemon's `PRState` polling loop never sees it.\n4. Inspect the workspace root: `\u003cwork_dir\u003e/\u003cbase64(owner)\u003e/\u003cbase64(repo)\u003e/issue-\u003cn\u003e/` still contains the full clone.\n5. Repeat for further no-change tasks and watch the directory count grow unbounded — nothing else removes them.\n\n## Acceptance Criteria\n\nBoth direct and container no-change completion remove the identity-correct worktree while parked worktrees remain available; lifecycle regression tests cover the terminal path.\n","acceptance_criteria":"Both direct and container no-change completion remove the identity-correct worktree while parked worktrees remain available; lifecycle regression tests cover the terminal path.","status":"closed","priority":2,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-22T11:01:47Z","created_by":"Sam Catlow","updated_at":"2026-08-24T07:59:39Z","started_at":"2026-08-24T07:42:10Z","closed_at":"2026-08-24T07:59:39Z","close_reason":"Closed","external_ref":"https://github.com/samcharles93/archie-core/issues/598","dependencies":[{"issue_id":"archie-core-1ysw.7","depends_on_id":"archie-core-1ysw","type":"parent-child","created_at":"2026-08-22T21:01:46Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-1ysw.5","title":"Preserve three-dot failure semantics without a merge base","description":"patch silently computes a direct tree diff when base and HEAD have no merge base, contradicting its three-dot contract and corrupting diff-cap and gate inputs.","acceptance_criteria":"Unrelated histories return a clear error from Diff, ChangedFiles, and ChangedLines; shared-history merge-base behavior remains covered.","status":"closed","priority":2,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-22T11:01:46Z","created_by":"Sam Catlow","updated_at":"2026-08-24T07:00:29Z","started_at":"2026-08-22T11:55:44Z","closed_at":"2026-08-24T07:00:29Z","close_reason":"Fixed on main: patch() now errors with 'no common ancestor' when MergeBase returns no bases (worktree.go:498-501) instead of falling back to a direct tree diff, so Diff/ChangedFiles/ChangedLines all fail closed on unrelated histories.","external_ref":"https://github.com/samcharles93/archie-core/issues/599","metadata":null,"dependencies":[{"issue_id":"archie-core-1ysw.5","depends_on_id":"archie-core-1ysw","type":"parent-child","created_at":"2026-08-22T21:01:45Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0} -{"_type":"issue","id":"archie-core-1ysw.6","title":"Do not report push failure after successful publication","description":"Push publishes the remote ref before writing unused local upstream metadata, then returns local config errors as if publication failed.\n\nConfirmed still present on main: `Manager.Push` (internal/worktree/worktree.go:414-449) completes `r.PushContext` successfully, then calls `r.Config()` / `r.SetConfig(cfg)` to record branch upstream. Either of those returns `read repo config: %w` or `record branch upstream: %w` from `Push`, so a caller sees a push failure for a branch that is already published on the forge.\n\n## Steps to Reproduce\n\n1. Prepare a task worktree and commit a change so there is a branch to publish.\n2. Make the local repository config unwritable or unreadable after the remote is reachable (e.g. `chmod 000 \u003cworktree\u003e/.git/config`, or a `.git/config` the go-git config parser rejects).\n3. Call `Manager.Push(ctx, dir, branch)`.\n4. Observe the remote branch exists on the forge, but `Push` returns `record branch upstream: ...` (or `read repo config: ...`).\n5. The daemon treats that error as a failed publication and parks the task, even though the PR branch is live.\n\n## Acceptance Criteria\n\nA post-publication metadata failure cannot park the task as an unsuccessful push; tests verify the remote ref and returned result remain consistent.\n","acceptance_criteria":"A post-publication metadata failure cannot park the task as an unsuccessful push; tests verify the remote ref and returned result remain consistent.","status":"in_progress","priority":2,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-22T11:01:46Z","created_by":"Sam Catlow","updated_at":"2026-08-24T07:42:09Z","started_at":"2026-08-24T07:42:09Z","lease_expires_at":"2026-08-24T07:47:09Z","heartbeat_at":"2026-08-24T07:42:09Z","external_ref":"https://github.com/samcharles93/archie-core/issues/600","dependencies":[{"issue_id":"archie-core-1ysw.6","depends_on_id":"archie-core-1ysw","type":"parent-child","created_at":"2026-08-22T21:01:46Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0} +{"_type":"issue","id":"archie-core-1ysw.6","title":"Do not report push failure after successful publication","description":"Push publishes the remote ref before writing unused local upstream metadata, then returns local config errors as if publication failed.\n\nConfirmed still present on main: `Manager.Push` (internal/worktree/worktree.go:414-449) completes `r.PushContext` successfully, then calls `r.Config()` / `r.SetConfig(cfg)` to record branch upstream. Either of those returns `read repo config: %w` or `record branch upstream: %w` from `Push`, so a caller sees a push failure for a branch that is already published on the forge.\n\n## Steps to Reproduce\n\n1. Prepare a task worktree and commit a change so there is a branch to publish.\n2. Make the local repository config unwritable or unreadable after the remote is reachable (e.g. `chmod 000 \u003cworktree\u003e/.git/config`, or a `.git/config` the go-git config parser rejects).\n3. Call `Manager.Push(ctx, dir, branch)`.\n4. Observe the remote branch exists on the forge, but `Push` returns `record branch upstream: ...` (or `read repo config: ...`).\n5. The daemon treats that error as a failed publication and parks the task, even though the PR branch is live.\n\n## Acceptance Criteria\n\nA post-publication metadata failure cannot park the task as an unsuccessful push; tests verify the remote ref and returned result remain consistent.\n","acceptance_criteria":"A post-publication metadata failure cannot park the task as an unsuccessful push; tests verify the remote ref and returned result remain consistent.","status":"closed","priority":2,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-22T11:01:46Z","created_by":"Sam Catlow","updated_at":"2026-08-24T08:15:47Z","started_at":"2026-08-24T07:42:09Z","closed_at":"2026-08-24T08:15:47Z","close_reason":"Fixed: recordUpstream extracted from Push (worktree.go:465); a post-publication config failure is now a logged warning and Push returns success once the remote ref is published. Manager gained an optional Log field with a slog.Default() fallback. Verified by inspection rather than a red run -- the test uses the new Log field so it cannot compile against the pre-fix code. task check green; fresh adversarial review (independent, did not write the code) zero findings.","external_ref":"https://github.com/samcharles93/archie-core/issues/600","dependencies":[{"issue_id":"archie-core-1ysw.6","depends_on_id":"archie-core-1ysw","type":"parent-child","created_at":"2026-08-22T21:01:46Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-1ysw.4","title":"Fail refresh when the configured base cannot resolve","description":"Prepared worktrees currently swallow every resolveBase error and report successful refresh against stale history.","acceptance_criteria":"Prepared-worktree refresh returns a contextual error for a missing, renamed, or invalid base; fresh and reused Prepare paths have consistent tests.","status":"closed","priority":2,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-22T11:01:45Z","created_by":"Sam Catlow","updated_at":"2026-08-24T07:00:23Z","started_at":"2026-08-22T11:52:19Z","closed_at":"2026-08-24T07:00:23Z","close_reason":"Fixed on main: prepared-worktree refresh now returns the resolveBase error instead of swallowing it (worktree.go:253-258, 'a missing base is configuration or repository drift and must fail closed'); resolveBase tries the qualified remote ref then origin/\u003cbase\u003e and errors otherwise.","external_ref":"https://github.com/samcharles93/archie-core/issues/601","metadata":null,"dependencies":[{"issue_id":"archie-core-1ysw.4","depends_on_id":"archie-core-1ysw","type":"parent-child","created_at":"2026-08-22T21:01:44Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-j8b4","title":"Implement persistent session memory and plugin storage","description":"Replace the PRD section 3 placeholder in internal/storage/storage.go with the specified persistent storage behavior for session.jsonl, memory.jsonl, and plugins.","status":"closed","priority":2,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-08-22T10:32:31Z","created_by":"Sam Catlow","updated_at":"2026-08-24T07:12:08Z","started_at":"2026-08-22T10:32:37Z","closed_at":"2026-08-24T07:12:08Z","close_reason":"Implemented persistent session transcript, cross-session memory, and staged plugin storage [Closure restored 2026-08-24: originally closed 2026-08-22, lost when the beads DB was rebuilt (.beads.backup-pre-recovery).]","external_ref":"https://github.com/samcharles93/archie-core/issues/602","metadata":null,"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-t2db.6","title":"Docs: document playbooks, bindings and the intake threat model","description":"Separate so it is not lost when the feature lands.\n\n- The playbook/binding model in docs/architecture/: what a binding is, where it is persisted, how matchers resolve, how versioning works.\n- The threat model, written down plainly: this is a public intake surface that can start agents. Record what protects it and what does not.\n- ARCHITECTURE.md task lifecycle: a task started by a playbook binding has a different provenance from a forge-issue task, and the lifecycle section should say so.\n- Operator docs: how to point an external app at archie and build a first playbook, end to end.\n\nCLAUDE.md's rule: a doc that contradicts its code is worse than none.","acceptance_criteria":"The binding model and threat model are documented in docs/architecture/; ARCHITECTURE.md covers playbook-originated tasks; there is an end-to-end operator walkthrough for building a first playbook.","status":"open","priority":2,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-08-21T13:45:46Z","created_by":"Sam Catlow","updated_at":"2026-08-22T09:25:29Z","external_ref":"https://github.com/samcharles93/archie-core/issues/553","dependencies":[{"issue_id":"archie-core-t2db.6","depends_on_id":"archie-core-t2db","type":"parent-child","created_at":"2026-08-21T23:45:45Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-t2db.6","depends_on_id":"archie-core-t2db.4","type":"blocks","created_at":"2026-08-21T23:45:53Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":1,"dependent_count":0,"comment_count":0} @@ -556,6 +556,6 @@ {"_type":"issue","id":"archie-core-1786637489857-3-24abe68c","title":"fix(gateway): make /compress failure-safe","description":"applyCompress swallows MessageCount and DeleteRecentMessages errors (allCount, _ := and _, _ =) then deletes all messages BEFORE saving the compressed replacement. A crash or error between the two loses the session's entire history unrecoverably. Add a store-level ReplaceMessages that saves first and deletes the previously-listed IDs after, so the failure mode is recoverable duplicates rather than total loss.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-08-08T14:26:24Z","updated_at":"2026-08-08T15:33:31Z","closed_at":"2026-08-08T15:33:32Z","external_ref":"https://github.com/samcharles93/archie-core/issues/24","source_system":"github:https://github.com/samcharles93/archie-core/issues/24:24","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-1786637489834-2-109e7cab","title":"[BUG] /model \u003cname\u003e asked the router for a doubled model name","description":"The nestif extraction in 651de0a pulled --provider parsing out of parseModelRest into extractProviderFlag, which took the modelParts slice by pointer and appended every non-provider field to it. The caller's own loop then appended the same fields again, so every field of the model name was duplicated: '/model gpt-5.6' resolved to 'gpt-5.6 gpt-5.6' and SetActiveModel rejected it as an unknown model. '/model gpt-5.6 --provider openai' was worse -- the space-separated provider value was no longer consumed with its flag, giving 'gpt-5.6 gpt-5.6 openai'. Direct model switching over Telegram was broken for anything but a bare --refresh or a provider-only switch. Found while auditing 6d4e0be for archie-core-ifi: the naked return in the same function could not be regression-tested until the function produced correct values.\n\n### Design\n\nTwo ways to fix the double append were available. Rejected: keep the helper\nsignature and delete the caller's default-branch append. That restores correct\noutput but leaves the shape intact -- a helper holding a pointer to the\ncaller's accumulator, with two loops over the same fields -- so the next person\nwho adds a field type has the same trap waiting. It also does not fix the\nspace-separated provider value, because the helper returns early on the first\n--provider and never sees the fields after it.\n\nChosen: splitProviderFlag returns (provider, remaining) and is the sole\naccumulator. One loop owns the fields, and there is no shared slice to append\nto twice. The index loop is kept deliberately -- i++ after reading a\nspace-separated value is what removes it with its flag, and converting that to\na range loop is precisely what 651de0a did wrong.\n\nLast --provider wins if repeated, matching the pre-651de0a behaviour rather\nthan the buggy helper's first-wins. Not worth a flag: /model does not document\nrepeating it.\n\n### Acceptance Criteria\n\nparseModelRest returns the model name exactly once for bare names, scope flags, and both --provider spellings, with a regression test asserting field count rather than string equality.","status":"closed","priority":2,"issue_type":"bug","created_at":"2026-08-08T14:26:19Z","updated_at":"2026-08-08T15:34:07Z","closed_at":"2026-08-08T15:34:08Z","external_ref":"https://github.com/samcharles93/archie-core/issues/23","source_system":"github:https://github.com/samcharles93/archie-core/issues/23:23","metadata":null,"labels":["bug"],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-1786637489768-1-2fd8288f","title":"Trigger accounting: curator output must not feed its own trigger","description":"Establish the invariant that work a curator produces does not count toward the condition that schedules the next curator run. The scheduler must explicitly exclude derived curator output from the observation threshold: counting it would inflate the threshold and create a feedback loop, so a curator that writes memories must not thereby schedule itself again.\n\n### Acceptance Criteria\n\nDerived curator output is distinguishable from primary input at the point the trigger is evaluated. A curator that writes memories does not thereby schedule itself again. There is a regression test that would fail if derived output were counted, with the feedback-loop rationale recorded in the test so the guard is not removed as redundant.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-08-08T14:26:17Z","updated_at":"2026-08-15T12:55:20Z","closed_at":"2026-08-15T12:55:20Z","close_reason":"Complete: internal/domain/curator/wake.go WakeOnPrimaryInput forwards only explicitly-passed inputKinds; curator-produced kinds (curator_run, curator_action, curator_error) are structurally excluded, per its own doc comment naming this exact invariant. internal/domain/curator/wake_test.go:11-21 TestWakeOnPrimaryInputForwardsOnlyPrimaryKinds carries the required feedback-loop rationale verbatim ('if derived curator output counted... a curator that writes memories would schedule itself again... This test fails if a derived kind is added to the forwarded set or the filter is removed as redundant') and asserts passCalls/checkCalls stay at 1 after publishing derived-kind events. All three acceptance-criteria clauses satisfied exactly.","external_ref":"https://github.com/samcharles93/archie-core/issues/22","source_system":"github:https://github.com/samcharles93/archie-core/issues/22:22","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0} -{"_type":"issue","id":"archie-core-1ysw.8","title":"Honor cancellation before local worktree commits","description":"CommitAll discards its context and can stage and commit after task cancellation.\n\nConfirmed still present on main: `Manager.CommitAll` (internal/worktree/worktree.go:387) takes `_ context.Context` and never reads it. Between entry and `wt.Commit` it performs `AddWithOptions{All: true}` and `wt.Commit`, neither of which is context-aware in go-git, so a task cancelled just before the call still mutates the index and HEAD.\n\n## Steps to Reproduce\n\n1. Prepare a task worktree with uncommitted changes.\n2. Create an already-cancelled context: `ctx, cancel := context.WithCancel(context.Background()); cancel()`.\n3. Call `Manager.CommitAll(ctx, dir, \"msg\")`.\n4. Observe it returns `(true, nil)`: the index was staged and a new commit is on HEAD despite the context being cancelled before the call.\n5. In production this leaves a commit on the task branch for work the operator cancelled, which the subsequent push/PR path can then publish.\n\n## Acceptance Criteria\n\nA pre-canceled context causes no index or HEAD mutation; cancellation is checked between non-context-aware go-git phases where possible, with regression tests.\n","acceptance_criteria":"A pre-canceled context causes no index or HEAD mutation; cancellation is checked between non-context-aware go-git phases where possible, with regression tests.","status":"in_progress","priority":3,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-22T11:01:48Z","created_by":"Sam Catlow","updated_at":"2026-08-24T07:42:10Z","started_at":"2026-08-24T07:42:10Z","lease_expires_at":"2026-08-24T07:47:10Z","heartbeat_at":"2026-08-24T07:42:10Z","external_ref":"https://github.com/samcharles93/archie-core/issues/603","dependencies":[{"issue_id":"archie-core-1ysw.8","depends_on_id":"archie-core-1ysw","type":"parent-child","created_at":"2026-08-22T21:01:47Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0} +{"_type":"issue","id":"archie-core-1ysw.8","title":"Honor cancellation before local worktree commits","description":"CommitAll discards its context and can stage and commit after task cancellation.\n\nConfirmed still present on main: `Manager.CommitAll` (internal/worktree/worktree.go:387) takes `_ context.Context` and never reads it. Between entry and `wt.Commit` it performs `AddWithOptions{All: true}` and `wt.Commit`, neither of which is context-aware in go-git, so a task cancelled just before the call still mutates the index and HEAD.\n\n## Steps to Reproduce\n\n1. Prepare a task worktree with uncommitted changes.\n2. Create an already-cancelled context: `ctx, cancel := context.WithCancel(context.Background()); cancel()`.\n3. Call `Manager.CommitAll(ctx, dir, \"msg\")`.\n4. Observe it returns `(true, nil)`: the index was staged and a new commit is on HEAD despite the context being cancelled before the call.\n5. In production this leaves a commit on the task branch for work the operator cancelled, which the subsequent push/PR path can then publish.\n\n## Acceptance Criteria\n\nA pre-canceled context causes no index or HEAD mutation; cancellation is checked between non-context-aware go-git phases where possible, with regression tests.\n","acceptance_criteria":"A pre-canceled context causes no index or HEAD mutation; cancellation is checked between non-context-aware go-git phases where possible, with regression tests.","status":"closed","priority":3,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-22T11:01:48Z","created_by":"Sam Catlow","updated_at":"2026-08-24T08:15:48Z","started_at":"2026-08-24T07:42:10Z","closed_at":"2026-08-24T08:15:48Z","close_reason":"Fixed: CommitAll now takes a live context and checks ctx.Err() before open, worktree, staging, status and commit (worktree.go:398-430), so a pre-cancelled context mutates neither index nor HEAD. Proven red against pre-fix code: 'CommitAll() error = nil, want context canceled' for both a cancelled context and an expired deadline. task check green; fresh adversarial review zero findings.","external_ref":"https://github.com/samcharles93/archie-core/issues/603","dependencies":[{"issue_id":"archie-core-1ysw.8","depends_on_id":"archie-core-1ysw","type":"parent-child","created_at":"2026-08-22T21:01:47Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-0y4v","title":"agent: markWorktreeSafe checks existence, not mount-ness, so a stale dir writes to the operator's gitconfig","description":"markWorktreeSafe gates on os.Stat (existence and dir-ness), not mount-ness, despite the doc comment claiming a 'mount' check so host-mode agents don't write to the operator's own ~/.gitconfig for a path that was never mounted (commit 6b46ea1's stated purpose). A directory that merely exists at /data/worktree (a stale leftover) satisfies the guard and appends safe.directory=/data/worktree to the operator's gitconfig. Low severity — the entry is inert unless a repo exists at that exact path — but the guard's behavior does not match its documented contract, and the exists-but-not-a-mount case is untested.\n\nFailure: a host-mode agent (local-ollama-standalone.toml) on a machine with a leftover /data directory: an extra safe.directory line appears in the operator's ~/.gitconfig, exactly what the guard claims to prevent.","design":"Either implement a real mount check (e.g. /proc/self/mountinfo on Linux) or correct the doc comment to say the guard is existence-based and accept the (inert) entry. Decide which contract is intended.","acceptance_criteria":"Behavior matches the documented contract; the exists-but-not-mounted case is covered by a test, or the doc is corrected.","status":"closed","priority":3,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-14T14:43:38Z","created_by":"Sam Catlow","updated_at":"2026-08-14T15:48:45Z","started_at":"2026-08-14T15:47:55Z","closed_at":"2026-08-14T15:48:45Z","close_reason":"Corrected markSafe's doc comment to match its actual existence-based (not mount-based) check; pinned the exists-but-unmounted case with a new test rather than adding platform-specific mount detection for an inert failure mode. Committed f1d74ab.","external_ref":"https://github.com/samcharles93/archie-core/issues/494","labels":["agent","code-review"],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-52f7","title":"telegram: the live-edit answer keeps its turn-start timestamp and can sort before the conversation","description":"The final reply is delivered by editing the message created at the first streamed frame, and editMessageText does not change the message date — so a long tool-using turn's answer is timestamped at turn start, can predate messages sent during the turn, and sorts before the conversation that produced it. Cosmetic and inherent to the watch-the-answer-being-written design (delete-and-resend would flicker and reorder), but it is a visible consequence nothing documents or tests.\n\nFailure: a turn with a two-minute tool phase produces an answer whose timestamp precedes a follow-up user message that references it; chat history ordering places the answer before the conversation that produced it.","design":"Either accept and document the limitation (a comment on liveReply/finalize), or investigate a delete-and-resend on finalize for turns that cross a meaningful time gap. Low priority; a documentation note may be the right fix.","acceptance_criteria":"The timestamp behavior is at least documented (or changed and tested), so it is a known trade-off rather than a surprise.","status":"closed","priority":4,"issue_type":"task","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-14T14:43:38Z","created_by":"Sam Catlow","updated_at":"2026-08-14T15:48:45Z","started_at":"2026-08-14T15:46:50Z","closed_at":"2026-08-14T15:48:45Z","close_reason":"Documented the accepted trade-off on liveReply's doc comment per the design note's preferred option; no behavior change. Committed ed18bfb.","external_ref":"https://github.com/samcharles93/archie-core/issues/495","labels":["code-review","streaming","telegram"],"dependency_count":0,"dependent_count":0,"comment_count":0}