chore(beads): restore closures lost in DB recovery and align GitHub

The beads DB rebuild that left .beads.backup-pre-recovery/ reverted every
closure recorded after its backup point. The code was never lost, only the
tracker state, so 16 issues sat open against work that had already shipped.

Restored those 16 from .beads/interactions.jsonl, taking the last status
change per issue and keeping each original close reason verbatim. Closed a
further 12 after verifying the work on main: the whole q15y epic
(1b7bc00, cc6b093, 5d00ec7, 972fb5b), mzok, bia3, hqst, and 1ysw.1/.2/.4/.5.
Superseded two orphaned re-imports of t2db.3 and t2db.5.

Rewrote the four surviving 1ysw descriptions with verified reproductions;
1ysw.9 in particular claimed a checked-in FIXME that no longer exists.

GitHub is now 561/561 in agreement with beads. dfck's close reason said its
opt-in lived in InProcessRunner, which q15y.3 deleted; the mechanism moved to
agentexec.NewLoopRunner (loop_runner.go:106) and the reason now records that.
tb3a's said its worktree was left uncommitted; it merged as 1e5e1fb (PR #477).
This commit is contained in:
sam committed 2026-08-24 17:23:17 +10:00
1 parent 8174f6a8c6
commit 51cafe30f0
2 files changed
+69 -39

No files matched your search

+30
View File
@@ -88,3 +88,33 @@
{"id":"int-8edaedd8b418b3e8f072ae78ab2fb10d","kind":"field_change","created_at":"2026-08-24T04:46:55.023036661Z","actor":"Sam Catlow","issue_id":"archie-core-5bsf","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Runtime updater now snapshots and restores the configured managed worker Docker image; runtime-only and combined rollback regressions pass."}}
{"id":"int-54344d1b04602ef10199dcdfbb5e0bd8","kind":"field_change","created_at":"2026-08-24T04:46:55.40908275Z","actor":"Sam Catlow","issue_id":"archie-core-q15y.4","extra":{"field":"status","new_value":"closed","old_value":"in_progress","reason":"Fresh/default deployment uses native archied, embedded NATS, and managed task containers; external NATS remains the documented advanced broker profile."}}
{"id":"int-af5bde29ff8336b8ef204d395a2c1bf6","kind":"field_change","created_at":"2026-08-24T04:46:55.845209007Z","actor":"Sam Catlow","issue_id":"archie-core-q15y","extra":{"field":"status","new_value":"closed","old_value":"in_progress","reason":"All four execution-topology children are complete: embedded/external NATS now hand full tasks only to managed containers, with no host agent loop."}}
{"id":"int-31d0709485e67c3896872eb134bb1129","kind":"field_change","created_at":"2026-08-24T05:19:34.093642376Z","actor":"Sam Catlow","issue_id":"archie-core-ite6","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Completed; reconciled with the already-closed GitHub issue."}}
{"id":"int-776a5af38d02b14950152fe8829a3f48","kind":"field_change","created_at":"2026-08-24T05:19:34.146183867Z","actor":"Sam Catlow","issue_id":"archie-core-5bsf","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Completed; reconciled with the already-closed GitHub issue."}}
{"id":"int-46674d25397d4bb87c4f75e87a2f5f51","kind":"field_change","created_at":"2026-08-24T06:58:28.955164993Z","actor":"Sam Catlow","issue_id":"archie-core-q15y.1","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Implemented in 5c4b599 (feat(nats): expose embedded broker to managed workers); per-start token, Docker bridge binding, frozen worker env. Verified landed on main."}}
{"id":"int-4aecc62b26a3df39b17f4682206ec89c","kind":"field_change","created_at":"2026-08-24T06:58:29.426080813Z","actor":"Sam Catlow","issue_id":"archie-core-q15y.2","extra":{"field":"status","new_value":"closed","old_value":"open","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."}}
{"id":"int-e4a1c857586c68f78bd3f5d6874d7dcc","kind":"field_change","created_at":"2026-08-24T06:58:29.896805082Z","actor":"Sam Catlow","issue_id":"archie-core-q15y.3","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Implemented in 157e99b (refactor(agentexec): remove legacy execution paths); [agent] is decode-only. Verified: no SubprocessRunner/inprocess symbols in non-test code."}}
{"id":"int-f1e577ee35b687a0617cdad26cb580c7","kind":"field_change","created_at":"2026-08-24T06:58:41.632146038Z","actor":"Sam Catlow","issue_id":"archie-core-q15y.4","extra":{"field":"status","new_value":"closed","old_value":"open","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."}}
{"id":"int-56bcf976359c43a00dc3757fc89078cf","kind":"field_change","created_at":"2026-08-24T06:58:42.063215911Z","actor":"Sam Catlow","issue_id":"archie-core-q15y","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"All four children landed across 5c4b599, 7d69001, 157e99b, c978f10. Autonomous workflows now have exactly one production path: full-task core-NATS handoff to a task-scoped archie-agent container."}}
{"id":"int-8edf22bd0458137fd91f3b80d4acb4af","kind":"field_change","created_at":"2026-08-24T06:59:21.301579884Z","actor":"Sam Catlow","issue_id":"archie-core-mzok","extra":{"field":"status","new_value":"closed","old_value":"open","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."}}
{"id":"int-971aed43b8a5636652250beff7c51699","kind":"field_change","created_at":"2026-08-24T06:59:22.444580557Z","actor":"Sam Catlow","issue_id":"archie-core-bia3","extra":{"field":"status","new_value":"closed","old_value":"open","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."}}
{"id":"int-bd4e16b5b180296dfc959ceeb82e8ce5","kind":"field_change","created_at":"2026-08-24T06:59:35.171117421Z","actor":"Sam Catlow","issue_id":"archie-core-hqst","extra":{"field":"status","new_value":"closed","old_value":"in_progress","reason":"Resolved on main: persistent_runner.go no longer imports encoding/json and TestApplicationOwnsNoTransportWireMechanics passes."}}
{"id":"int-e986333daa22fff3786fb38b392c5b7c","kind":"field_change","created_at":"2026-08-24T06:59:57.951926691Z","actor":"Sam Catlow","issue_id":"archie-core-1ysw.1","extra":{"field":"status","new_value":"closed","old_value":"open","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."}}
{"id":"int-bc056d31eee686ce6433448b42fd29ea","kind":"field_change","created_at":"2026-08-24T06:59:58.40724543Z","actor":"Sam Catlow","issue_id":"archie-core-1ysw.2","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Fixed on main: Manager.Dir base64url-encodes owner and repo as separate path components (worktree.go:66-70), so a-b/c and a/b-c no longer collide. legacyDir+migrateLegacy migrate old flattened dirs only on exact origin match. Package tests pass."}}
{"id":"int-2247890b19ea11880354613831bb67e9","kind":"field_change","created_at":"2026-08-24T07:00:22.696171953Z","actor":"Sam Catlow","issue_id":"archie-core-1ysw.4","extra":{"field":"status","new_value":"closed","old_value":"open","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/<base> and errors otherwise."}}
{"id":"int-93f6e8c3fbaae2a327aab94b82c2df56","kind":"field_change","created_at":"2026-08-24T07:00:28.838440356Z","actor":"Sam Catlow","issue_id":"archie-core-1ysw.5","extra":{"field":"status","new_value":"closed","old_value":"open","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."}}
{"id":"int-fe81497a545158a0c954b4548631633f","kind":"field_change","created_at":"2026-08-24T07:12:05.178596666Z","actor":"Sam Catlow","issue_id":"archie-core-h019.1","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"One-page decision written at docs/prds/adversarial-self-review.md: reviewer runs in a second workspace (container or in-process) pointed at a .git-stripped snapshot of the reviewed commit, never the implementer's worktree; findings contract is workflow.ReviewFinding, owned by internal/domain/workflow, reported via a structured capture tool; a surviving error-level finding sets StatusParked (not WaitingHuman -- epic wording named two different states, this resolves which); model/effort reuse the existing Models[role] map and per-stage budget override, gated by a new opt-in Repo.ReviewEnabled so h019.4 doesn't gate every repo on an uncalibrated reviewer before h019.5 lands. [Closure restored 2026-08-24: originally closed 2026-08-22, lost when the beads DB was rebuilt (.beads.backup-pre-recovery).]"}}
{"id":"int-42343a99009cf6873fce96a2c82ba389","kind":"field_change","created_at":"2026-08-24T07:12:06.369962622Z","actor":"Sam Catlow","issue_id":"archie-core-7d5u.5","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Investigated first: the dedup mechanism (TaskEnvelope.IdempotencyKey + PublishUnique + JetStream Nats-Msg-Id dedup) and the shared dispatch predicate were already fully wired by 7d5u.4 -- no double-dispatch code change was needed. Closed the two real gaps: (1) internal/infrastructure/eventbus/nats/dedup_test.go is a new regression test proving PublishUnique actually suppresses a duplicate publish on the same WorkQueuePolicy stream ARCHIE_TASKS uses in production; (2) internal/forge/webhook/receiver.go gained Status()/GET support tracking authenticated deliveries vs successful publishes separately, so a wedged or non-delivering receiver is observable rather than indistinguishable from an idle repo. AC's poll/webhook parity clause (disabling webhook still polls) is satisfied architecturally with no code change possible to violate it -- verified Cycle()/Run() never reference cfg.Forge.Intake anywhere in internal/daemon; only setupForgeWebhook in cmd/archied/bootstrap.go gates the webhook HTTP server. Adversarial review pass (fresh subagent, -race) found zero blocking issues; closed two minor coverage gaps it flagged. [Closure restored 2026-08-24: originally closed 2026-08-22, lost when the beads DB was rebuilt (.beads.backup-pre-recovery).]"}}
{"id":"int-803c42454dcc93825d57fd64b06290c1","kind":"field_change","created_at":"2026-08-24T07:12:06.82962997Z","actor":"Sam Catlow","issue_id":"archie-core-1786637492559-106-5ea2315d","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Implemented code-fence-aware Telegram message splitting with bounded continuation handling and regression coverage [Closure restored 2026-08-24: originally closed 2026-08-22, lost when the beads DB was rebuilt (.beads.backup-pre-recovery).]"}}
{"id":"int-fca467b0bda953484c17e18918362f38","kind":"field_change","created_at":"2026-08-24T07:12:07.207279124Z","actor":"Sam Catlow","issue_id":"archie-core-ippu","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Fixed: TurnRecord now persists tool-call activity alongside ResponseText; the completed-duplicate replay path replays it via stream.ToolCall before the text. Prior-reply fallback documented as deliberately text-only (crash race with no persisted tool record). Commit 86a9731, task check clean, adversarial review clean (0 findings). [Closure restored 2026-08-24: originally closed 2026-08-22, lost when the beads DB was rebuilt (.beads.backup-pre-recovery).]"}}
{"id":"int-ce49b4bfa7a9309c5e026b93ba263851","kind":"field_change","created_at":"2026-08-24T07:12:07.588050015Z","actor":"Sam Catlow","issue_id":"archie-core-1786637493205-131-a3dd2b53","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Closed [Closure restored 2026-08-24: originally closed 2026-08-22, lost when the beads DB was rebuilt (.beads.backup-pre-recovery).]"}}
{"id":"int-5f3c3d77e64802ed75d947560e23cb81","kind":"field_change","created_at":"2026-08-24T07:12:08.005056434Z","actor":"Sam Catlow","issue_id":"archie-core-j8b4","extra":{"field":"status","new_value":"closed","old_value":"open","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).]"}}
{"id":"int-9ecea248febfdd7956009b66fe4aa150","kind":"field_change","created_at":"2026-08-24T07:12:08.400878511Z","actor":"Sam Catlow","issue_id":"archie-core-qk8m","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Fixed: MCP npm servers for per-task containers now reuse a persistent npm cache. Added mcp.NpmCacheEnv (shared with the daemon-side fix), an always-on archie-cache-mcp-npm Docker volume mounted at /data/cache/mcp-npm on every task container regardless of ecosystem, and wired it into internal/app/agentworker/mcp_providers.go's stdio transport construction. Adversarial review found zero surviving findings. [Closure restored 2026-08-24: originally closed 2026-08-22, lost when the beads DB was rebuilt (.beads.backup-pre-recovery).]"}}
{"id":"int-74c9b16831b72e7c2a39ff730de4c107","kind":"field_change","created_at":"2026-08-24T07:12:08.802194791Z","actor":"Sam Catlow","issue_id":"archie-core-azbo","extra":{"field":"status","new_value":"closed","old_value":"open","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).]"}}
{"id":"int-a97be73b9145b6d78b9f80e2b116bf0f","kind":"field_change","created_at":"2026-08-24T07:12:09.224403876Z","actor":"Sam Catlow","issue_id":"archie-core-1786637493329-136-49b39c78","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Media portion delivered: gateway.MediaSender + telegramMediaSender + TurnStream.Media wiring in Telegram's liveReply. Typing/edit/delete indicators from this issue's original scope are NOT done -- splitting them out if still wanted, since they're unrelated to the video-gen work that drove this. [Closure restored 2026-08-24: originally closed 2026-08-22, lost when the beads DB was rebuilt (.beads.backup-pre-recovery).]"}}
{"id":"int-daf488dc4ef11bf278e406e5d65c4a48","kind":"field_change","created_at":"2026-08-24T07:12:09.625994864Z","actor":"Sam Catlow","issue_id":"archie-core-3ghy","extra":{"field":"status","new_value":"closed","old_value":"open","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).]"}}
{"id":"int-2dac3657dabd2829e5a24e6c0e5bf671","kind":"field_change","created_at":"2026-08-24T07:12:10.060099361Z","actor":"Sam Catlow","issue_id":"archie-core-1786748942540-18-9af78536","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Deprioritized: prompt-level fix landed in fba80e3 (archie-core-3jag/GH#524) covers the general overconfidence pattern. Not worth mechanical enforcement (postcondition checks, tool-result verification) unless this recurs — revisit with stronger prompting first if it does. [Closure restored 2026-08-24: originally closed 2026-08-23, lost when the beads DB was rebuilt (.beads.backup-pre-recovery).]"}}
{"id":"int-77e557b6a8cbb8b826dcf400ee419b39","kind":"field_change","created_at":"2026-08-24T07:12:10.478442214Z","actor":"Sam Catlow","issue_id":"archie-core-w35v","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Fixed: themed .wf-form input/select/textarea in workflows.css to match the dark theme. [Closure restored 2026-08-24: originally closed 2026-08-23, lost when the beads DB was rebuilt (.beads.backup-pre-recovery).]"}}
{"id":"int-cdec894a69ee94b7a0011cf0bb06683d","kind":"field_change","created_at":"2026-08-24T07:12:10.913658383Z","actor":"Sam Catlow","issue_id":"archie-core-1786751948782-3-837a8fd0.1","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Fixed: archie-agent's build is now stamped (installtype + agentworker.Version), and it reports both back to the daemon in every taskrun.Response. daemon.AgentStatus records the latest observation; daemonRunningVersions includes the agent component once one lands. Adversarial review clean (one nice-to-have comment added). [Closure restored 2026-08-24: originally closed 2026-08-23, lost when the beads DB was rebuilt (.beads.backup-pre-recovery).]"}}
{"id":"int-765118ce3cf8f020020fcd8ef76879e5","kind":"field_change","created_at":"2026-08-24T07:12:11.379239858Z","actor":"Sam Catlow","issue_id":"archie-core-1786751948782-3-837a8fd0.2","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Fixed: Component gained InstallType/Reference, populated via Service.Enrich from installtype.Type() (daemon), observed AgentStatus (agent), and [nats] config (third-party). Adversarial review clean (one lint-consistency nit fixed: use config.NATSMode* constants instead of raw strings). [Closure restored 2026-08-24: originally closed 2026-08-23, lost when the beads DB was rebuilt (.beads.backup-pre-recovery).]"}}
{"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).]"}}
+39 -39
View File
@@ -1,14 +1,14 @@
{"_type":"issue","id":"archie-core-1787489595430-1-8f81afa3","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.","status":"in_progress","priority":0,"issue_type":"feature","created_at":"2026-08-23T12:22:08Z","updated_at":"2026-08-23T12:22:08Z","external_ref":"https://github.com/samcharles93/archie-core/issues/564","source_system":"github:https://github.com/samcharles93/archie-core/issues/564:564","metadata":null,"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_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":"open","priority":0,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-22T17:34:07Z","created_by":"Sam Catlow","updated_at":"2026-08-23T21:59:58Z","started_at":"2026-08-22T17:34:11Z","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":"open","priority":0,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-22T17:15:14Z","created_by":"Sam Catlow","updated_at":"2026-08-23T21:59:58Z","started_at":"2026-08-22T17:15:22Z","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":"open","priority":0,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-22T11:01:43Z","created_by":"Sam Catlow","updated_at":"2026-08-23T21:59:58Z","started_at":"2026-08-22T11:02:03Z","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-1787489595430-1-8f81afa3","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.","status":"closed","priority":0,"issue_type":"feature","created_at":"2026-08-23T12:22:08Z","updated_at":"2026-08-24T06:58:51Z","closed_at":"2026-08-24T06:58:51Z","external_ref":"https://github.com/samcharles93/archie-core/issues/564","source_system":"github:https://github.com/samcharles93/archie-core/issues/564:564","metadata":null,"dependencies":[{"issue_id":"archie-core-1787489595430-1-8f81afa3","depends_on_id":"archie-core-t2db.5","type":"supersedes","created_at":"2026-08-24T06:58:51Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_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-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","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-24T04:39:22Z","created_by":"Sam Catlow","updated_at":"2026-08-24T04:46:54Z","started_at":"2026-08-24T04:39:24Z","closed_at":"2026-08-24T04:46:54Z","close_reason":"subscribeAgentEvents now flushes its SUB frame before returning and cleans up on failure; regression coverage and full gate pass.","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","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-24T03:03:38Z","created_by":"Sam Catlow","updated_at":"2026-08-24T04:21:08Z","started_at":"2026-08-24T03:49:36Z","closed_at":"2026-08-24T04:21:08Z","close_reason":"Removed daemon in-process, subprocess, per-stage NATS, and shared-worker execution. Autonomous workflow loops now exist only in task-scoped archie-agent workers; mandatory boot metadata and exact task subjects fail closed. task check, new-code lint, and independent adversarial review are clean.","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","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-24T03:03:37Z","created_by":"Sam Catlow","updated_at":"2026-08-24T03:49:21Z","started_at":"2026-08-24T03:32:18Z","closed_at":"2026-08-24T03:49:21Z","close_reason":"Closed","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}
{"_type":"issue","id":"archie-core-q15y.1","title":"Expose embedded NATS securely to managed task containers","description":"Embedded NATS currently binds unauthenticated loopback, so task containers cannot use it. Give the daemon and task containers distinct reachable URLs for the same embedded listener, require generated per-start credentials, and wire Docker host/network reachability without exposing credentials in logs or config files.","acceptance_criteria":"Native archied can connect to embedded JetStream; managed agent containers can connect to the same listener; all connections require a cryptographically generated token; the listener is not exposed on ordinary LAN interfaces; lifecycle and container environment tests pass.","notes":"Implemented authenticated embedded NATS reachability for native archied plus managed Docker workers. Embedded NATS now generates a crypto token per start, binds the resolved local Docker bridge gateway when a pool is available, and freezes URL/token into worker env. Added bridge validation, cleanup ordering, config acceptance/guardrails, Docker-create seam tests, lifecycle/auth tests, and amended the architecture decision. task check passed; focused race passed; new-code lint 0; fresh adversarial re-review 0 findings.","status":"closed","priority":1,"issue_type":"feature","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-24T03:03:36Z","created_by":"Sam Catlow","updated_at":"2026-08-24T03:31:57Z","started_at":"2026-08-24T03:03:54Z","closed_at":"2026-08-24T03:31:57Z","close_reason":"Closed","dependencies":[{"issue_id":"archie-core-q15y.1","depends_on_id":"archie-core-q15y","type":"parent-child","created_at":"2026-08-24T03:03:36Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":2,"comment_count":0}
{"_type":"issue","id":"archie-core-q15y","title":"Make NATS the sole autonomous workflow execution path","description":"Keep archied native on the host (systemd in the operator deployment) so interactive chat retains operator-authorized server access. Autonomous durable workflows must never execute their agent loop inside archied: embedded and external NATS both hand the complete task to a task-scoped archie-agent container.","design":"One execution architecture, two broker deployments. archied owns orchestration, state, forge credentials, worktree preparation, and optionally the embedded broker. A task-scoped archie-agent container owns the complete workflow and model/tool loop. Embedded NATS is authenticated and reachable only through the managed Docker host/network boundary; external NATS preserves current behavior.","acceptance_criteria":"No production configuration runs workflow.Run or agentloop in archied; embedded and external NATS use the same full-task container handoff; host-native chat authority is unchanged; installer and supported deployment profiles select the new topology.","status":"closed","priority":1,"issue_type":"epic","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-24T01:56:43Z","created_by":"Sam Catlow","updated_at":"2026-08-24T04:46:56Z","started_at":"2026-08-24T01:56:52Z","closed_at":"2026-08-24T04:46:56Z","close_reason":"All four execution-topology children are complete: embedded/external NATS now hand full tasks only to managed containers, with no host agent loop.","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}
{"_type":"issue","id":"archie-core-q15y.1","title":"Expose embedded NATS securely to managed task containers","description":"Embedded NATS currently binds unauthenticated loopback, so task containers cannot use it. Give the daemon and task containers distinct reachable URLs for the same embedded listener, require generated per-start credentials, and wire Docker host/network reachability without exposing credentials in logs or config files.","acceptance_criteria":"Native archied can connect to embedded JetStream; managed agent containers can connect to the same listener; all connections require a cryptographically generated token; the listener is not exposed on ordinary LAN interfaces; lifecycle and container environment tests pass.","notes":"Implemented authenticated embedded NATS reachability for native archied plus managed Docker workers. Embedded NATS now generates a crypto token per start, binds the resolved local Docker bridge gateway when a pool is available, and freezes URL/token into worker env. Added bridge validation, cleanup ordering, config acceptance/guardrails, Docker-create seam tests, lifecycle/auth tests, and amended the architecture decision. task check passed; focused race passed; new-code lint 0; fresh adversarial re-review 0 findings.","status":"closed","priority":1,"issue_type":"feature","owner":"sam@catlow.tech","created_at":"2026-08-24T03:03:36Z","created_by":"Sam Catlow","updated_at":"2026-08-24T06:58:29Z","started_at":"2026-08-24T03:03:54Z","closed_at":"2026-08-24T06:58:29Z","close_reason":"Implemented in 5c4b599 (feat(nats): expose embedded broker to managed workers); per-start token, Docker bridge binding, frozen worker env. Verified landed on main.","external_ref":"https://github.com/samcharles93/archie-core/issues/619","metadata":null,"dependencies":[{"issue_id":"archie-core-q15y.1","depends_on_id":"archie-core-q15y","type":"parent-child","created_at":"2026-08-24T03:03:36Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":2,"comment_count":0}
{"_type":"issue","id":"archie-core-q15y","title":"Make NATS the sole autonomous workflow execution path","description":"Keep archied native on the host (systemd in the operator deployment) so interactive chat retains operator-authorized server access. Autonomous durable workflows must never execute their agent loop inside archied: embedded and external NATS both hand the complete task to a task-scoped archie-agent container.","design":"One execution architecture, two broker deployments. archied owns orchestration, state, forge credentials, worktree preparation, and optionally the embedded broker. A task-scoped archie-agent container owns the complete workflow and model/tool loop. Embedded NATS is authenticated and reachable only through the managed Docker host/network boundary; external NATS preserves current behavior.","acceptance_criteria":"No production configuration runs workflow.Run or agentloop in archied; embedded and external NATS use the same full-task container handoff; host-native chat authority is unchanged; installer and supported deployment profiles select the new topology.","status":"closed","priority":1,"issue_type":"epic","owner":"sam@catlow.tech","created_at":"2026-08-24T01:56:43Z","created_by":"Sam Catlow","updated_at":"2026-08-24T06:58:42Z","started_at":"2026-08-24T01:56:52Z","closed_at":"2026-08-24T06:58:42Z","close_reason":"All four children landed across 5c4b599, 7d69001, 157e99b, c978f10. Autonomous workflows now have exactly one production path: full-task core-NATS handoff to a task-scoped archie-agent container.","external_ref":"https://github.com/samcharles93/archie-core/issues/620","metadata":null,"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1787489596754-17-3b1639d9","title":"[EPIC] Adversarial self-review before archie opens a PR","description":"Archie enforces gates on every PR it opens, but it does not run the adversarial review CLAUDE.md makes mandatory for every change in this repo: a fresh reviewer that did not write the code, told to assume every line is wrong, working a defined checklist, where a surviving finding blocks the work. It is the one discipline the project requires of its contributors and exempts itself from.\n\nWhy it matters, with evidence rather than assertion: on 2026-08-20/21 the update-verification change (PR #530) passed task check at every checkpoint -- exit 0, golangci-lint 0 issues, gofumpt clean -- and three adversarial passes still found six real defects, two of them blocking. A 'dev' version placeholder would have reported healthy updates as failures, and an 'unknown' install claim was still being worded as confirmed success. The gates were green throughout and would have stayed green. This is CLAUDE.md's own recorded lesson: tests catch behaviour that breaks, not behaviour that quietly starts meaning something else.\n\nArchie is unusually well placed to do this. It already runs each task in an isolated container and worktree, so it can spawn a reviewer that genuinely never saw the implementation -- not a second opinion from the same context pretending to be fresh, which is the failure mode of every single-context tool. The isolation boundary built for safety is what makes honest self-review possible.\n\nWhat the operator gets: a PR that arrives with a findings section -- what was checked, what was found, what was fixed, what survived. A surviving finding parks the task as waiting_human instead of opening a PR that looks ready and is not. Review shifts from hunting for bugs to adjudicating findings.\n\nThe risk that kills the feature is a reviewer that cries wolf. Findings must be adversarially confirmed before they surface, and the reviewer must be able to report zero findings on properties it checked and cleared. Calibration is the feature, not the finding count.","status":"closed","priority":1,"issue_type":"epic","created_at":"2026-08-23T12:22:20Z","updated_at":"2026-08-23T22:37:28Z","closed_at":"2026-08-23T22:37:28Z","close_reason":"Duplicate epic; canonical versions are archie-core-t2db (#541), archie-core-7d5u (#547), and archie-core-h019 (#552) with proper work breakdown","external_ref":"https://github.com/samcharles93/archie-core/issues/580","source_system":"github:https://github.com/samcharles93/archie-core/issues/580:580","metadata":null,"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1787489596587-15-fdd1dcbd","title":"Findings contract: a structured review result the workflow can act on","description":"The reviewer's output must be data the workflow can branch on, not prose a human has to read to find out whether the PR is safe to open. Prose is what makes a review advisory; structure is what lets a finding block.\n\nDefine the finding type in the workflow domain (the domain declares the contract it needs; it never names who implements it). At minimum a finding carries: file and line, a one-sentence defect, a concrete failure scenario (inputs/state -\u003e wrong output), a verdict distinguishing CONFIRMED from PLAUSIBLE, and a disposition once acted on (fixed / skipped / no_change_needed).\n\nThe CONFIRMED/PLAUSIBLE split is load-bearing and must not be collapsed into a single boolean: only confirmed findings may block, or the feature degrades into crying wolf and the operator learns to skim past it.","status":"closed","priority":1,"issue_type":"feature","created_at":"2026-08-23T12:22:19Z","updated_at":"2026-08-23T22:39:29Z","closed_at":"2026-08-23T22:39:29Z","close_reason":"Duplicate; work tracked under canonical epic","external_ref":"https://github.com/samcharles93/archie-core/issues/579","source_system":"github:https://github.com/samcharles93/archie-core/issues/579:579","metadata":null,"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1787489596676-16-d40037d5","title":"Design: adversarial self-review stage (one-page decision in docs/prds/)","description":"No settled design exists for this in docs/architecture/, so under the scope-discipline rule merged as PR #533 the design comes first -- briefly and decisively -- and is not finished until a diff follows it.\n\nDecide and record, in one page under docs/prds/: where the reviewer runs (reuse the per-task container pool, or a separate short-lived container); what it is given (diff plus originating issue, and explicitly what it must NOT be given); the findings contract and who owns the type; what a surviving finding does to the task lifecycle; and how the reviewer's model/effort is configured.\n\nConstraints from the repo that the design must respect: dependency direction is cmd -\u003e app -\u003e {domain, infrastructure}, so the reviewer contract belongs to the workflow domain and the execution to infrastructure/app. Agent execution is a data boundary. The model never runs git. Prefer environmental enforcement over prompt rules -- 'the reviewer cannot see the implementation' must be a property of how it is launched, not an instruction in its prompt.\n\nDo not write an architecture document, migration plan or review campaign. One page that decides.","status":"closed","priority":1,"issue_type":"decision","created_at":"2026-08-23T12:22:19Z","updated_at":"2026-08-23T22:39:29Z","closed_at":"2026-08-23T22:39:29Z","close_reason":"Duplicate; work tracked under canonical epic","external_ref":"https://github.com/samcharles93/archie-core/issues/578","source_system":"github:https://github.com/samcharles93/archie-core/issues/578:578","metadata":null,"dependency_count":0,"dependent_count":0,"comment_count":0}
@@ -21,26 +21,26 @@
{"_type":"issue","id":"archie-core-1787489596102-9-3ec24fcd","title":"Idempotency and poll/webhook parity: never double-dispatch, never lose work","description":"Webhooks deliver at-least-once, out of order, and sometimes not at all. Polling is the opposite: slow but eventually consistent. Running both (intake='both') is the honest production configuration, and it is also where the two failure modes meet.\n\nTwo things must hold. A single issue event must not start two tasks because the webhook and the next poll both saw it. And a webhook outage must not silently stop work -- if the receiver is wedged or the ingress is down, polling has to pick the work up, which is the entire argument for keeping it.\n\nNote archie-core-...-286 (WebhookAdapter: idempotency cache) already exists for the chat adapter. Decide whether that mechanism generalises to intake or whether forge dispatch needs its own key; do not build a second one by accident.\n\nThe silent-failure shape to design against is the one this codebase keeps hitting: a path that looks like it is working because nothing errors. A webhook receiver that has silently stopped delivering looks identical to a repo with no activity.","status":"closed","priority":1,"issue_type":"feature","created_at":"2026-08-23T12:22:14Z","updated_at":"2026-08-23T22:39:29Z","closed_at":"2026-08-23T22:39:29Z","close_reason":"Duplicate; work tracked under canonical epic","external_ref":"https://github.com/samcharles93/archie-core/issues/571","source_system":"github:https://github.com/samcharles93/archie-core/issues/571:571","metadata":null,"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1787489595942-7-3ec33776","title":"GitHub forge webhook receiver behind a feature flag","description":"The concrete autonomy win: react to an issue being assigned or labelled the moment it happens, instead of up to poll_interval (default 60s) later.\n\nVerified absent on 2026-08-21: internal/forge/ and internal/daemon/ contain zero webhook references, and no bead tracked forge-event intake before this epic. internal/channels/webhook exists but is a CHAT channel -- it routes inbound text through gateway.Router for LLM processing, a peer of Telegram and email. It is not forge intake and should not be bent into it.\n\nShip as a source in the typed intake family, off by default: [forge] intake = 'poll' (default) | 'webhook' | 'both'. Verify GitHub's HMAC signature. Reuse the label/assignee dispatch predicate the poller already uses -- do NOT reimplement it, since it just took a fix (3209a1f, refusing to poll on an empty label match) and two implementations will drift.\n\nDeployment reality from CLAUDE.md: archied may run on a host, in a container, or behind no public ingress at all. A webhook receiver that assumes a reachable public URL will not fit every profile, which is exactly why polling has to remain a first-class option rather than a legacy fallback.","status":"closed","priority":1,"issue_type":"feature","created_at":"2026-08-23T12:22:13Z","updated_at":"2026-08-23T22:39:29Z","closed_at":"2026-08-23T22:39:29Z","close_reason":"Duplicate; work tracked under canonical epic","external_ref":"https://github.com/samcharles93/archie-core/issues/570","source_system":"github:https://github.com/samcharles93/archie-core/issues/570:570","metadata":null,"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1787489595853-6-50e11603","title":"[EPIC] Event capture and no-code playbooks: turn any inbound webhook into an agentic workflow","description":"The pitch, in the operator's words: point any app's outgoing webhook at archie, open archie, SEE the event that just arrived with its real payload, map the fields you care about, bind them to an agentic workflow, save. No code change, no redeploy, no restart. Adding a new integration stops being a development task.\n\nWhy this is different from n8n or Power Automate rather than a copy of them: their terminal node is a deterministic connector. Archie's is an AGENT with a repo, a worktree, tools and a gate. 'When Sentry reports a new issue in this project, open a PR that fixes it' is one binding here and an entire product elsewhere.\n\nThe design insight that makes it buildable: you cannot write a payload mapper against a payload you have not seen. Schema-by-example requires real recent events to map against, which means archie must CAPTURE events it does not yet understand -- including ones with no binding at all -- and retain them long enough to design against. That is also the strongest argument for putting inbound events on NATS JetStream rather than the lossy in-process bus: durable, replayable, retention-bounded, and already deployed. The capture requirement and the transport choice are the same decision.\n\nSequence: capture unrecognised events -\u003e inspect real payloads in the UI -\u003e map fields by example -\u003e bind matcher+mapping to a workflow -\u003e the next matching event runs it.\n\nThis is a public, unauthenticated-by-default intake surface whose output is an agent with tool access. Security is not a later hardening pass; it is a first-class child of this epic.","status":"closed","priority":1,"issue_type":"epic","created_at":"2026-08-23T12:22:12Z","updated_at":"2026-08-23T22:37:28Z","closed_at":"2026-08-23T22:37:28Z","close_reason":"Duplicate epic; canonical versions are archie-core-t2db (#541), archie-core-7d5u (#547), and archie-core-h019 (#552) with proper work breakdown","external_ref":"https://github.com/samcharles93/archie-core/issues/569","source_system":"github:https://github.com/samcharles93/archie-core/issues/569:569","metadata":null,"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1787489595684-4-92ed3d8c","title":"Map payload fields by example, from a real captured event","description":"Pick a captured event, click through its payload, and bind JSON paths to named fields the workflow will receive. Schema by example, not schema by specification.\n\nThe hard part is not the happy path, it is drift. A mapping authored against one payload will eventually meet a payload where the path is missing, null, or a different type -- the sending app shipped a change nobody told you about. That must fail LOUDLY and land somewhere the operator sees, not silently pass an empty string into an agent prompt. An agent handed a blank field will confabulate around it, which turns a schema change into an agent doing confident nonsense in a repo.\n\nSupport a preview: given this mapping and this captured event, show exactly what the workflow would receive. Never ship a mapping the operator has not seen resolve against real data.","status":"in_progress","priority":1,"issue_type":"feature","created_at":"2026-08-23T12:22:11Z","updated_at":"2026-08-23T12:22:11Z","external_ref":"https://github.com/samcharles93/archie-core/issues/568","source_system":"github:https://github.com/samcharles93/archie-core/issues/568:568","metadata":null,"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1787489595684-4-92ed3d8c","title":"Map payload fields by example, from a real captured event","description":"Pick a captured event, click through its payload, and bind JSON paths to named fields the workflow will receive. Schema by example, not schema by specification.\n\nThe hard part is not the happy path, it is drift. A mapping authored against one payload will eventually meet a payload where the path is missing, null, or a different type -- the sending app shipped a change nobody told you about. That must fail LOUDLY and land somewhere the operator sees, not silently pass an empty string into an agent prompt. An agent handed a blank field will confabulate around it, which turns a schema change into an agent doing confident nonsense in a repo.\n\nSupport a preview: given this mapping and this captured event, show exactly what the workflow would receive. Never ship a mapping the operator has not seen resolve against real data.","status":"closed","priority":1,"issue_type":"feature","created_at":"2026-08-23T12:22:11Z","updated_at":"2026-08-24T06:58:50Z","closed_at":"2026-08-24T06:58:50Z","external_ref":"https://github.com/samcharles93/archie-core/issues/568","source_system":"github:https://github.com/samcharles93/archie-core/issues/568:568","metadata":null,"dependencies":[{"issue_id":"archie-core-1787489595684-4-92ed3d8c","depends_on_id":"archie-core-t2db.3","type":"supersedes","created_at":"2026-08-24T06:58:50Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1787489595777-5-bc238550","title":"Event inspector: see real inbound payloads in the dashboard","description":"The operator-facing half of capture. A live view of recent inbound events: source, arrival time, and the actual payload, pretty-printed and explorable.\n\nThis is the screen that makes the feature feel like magic: you hit 'send test webhook' in the other app, alt-tab to archie, and the event is sitting there. Latency from arrival to visible matters more than it looks -- it is the difference between a design loop and a guessing game.\n\nShow unbound events prominently. An event nothing is listening to is not noise here, it is the queue of integrations waiting to be built.","status":"closed","priority":1,"issue_type":"feature","created_at":"2026-08-23T12:22:11Z","updated_at":"2026-08-23T22:39:29Z","closed_at":"2026-08-23T22:39:29Z","close_reason":"Duplicate; work tracked under canonical epic","external_ref":"https://github.com/samcharles93/archie-core/issues/567","source_system":"github:https://github.com/samcharles93/archie-core/issues/567:567","metadata":null,"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1787489595596-3-e2c56185","title":"Capture inbound events archie does not yet understand","description":"The precondition for everything else. Today an unrecognised inbound request is rejected; for schema-by-example it must be RECORDED, because you cannot map a payload you have never seen.\n\nAccept, store and retain inbound events with no binding: raw body, headers, source, arrival time, and the identity that sent it. Retention must be bounded -- an open capture endpoint is an unbounded disk write, and this is exactly the kind of surface an attacker fills.\n\nStrong argument for NATS JetStream as the store rather than the in-process events.Bus: durable, replayable, retention-bounded natively, already deployed. Note the constraint though -- internal/infrastructure/eventbus/nats/doc.go states 'when no NATS URL is configured the daemon uses its local SQLite claim flow instead; nothing here is required for single-process operation'. NATS is currently OPTIONAL. Decide deliberately whether capture requires it (making this feature unavailable in single-process deployments) or degrades to SQLite, and record which -- do not let it become a hard dependency by accident.","status":"closed","priority":1,"issue_type":"feature","created_at":"2026-08-23T12:22:10Z","updated_at":"2026-08-23T22:39:29Z","closed_at":"2026-08-23T22:39:29Z","close_reason":"Duplicate; work tracked under canonical epic","external_ref":"https://github.com/samcharles93/archie-core/issues/566","source_system":"github:https://github.com/samcharles93/archie-core/issues/566:566","metadata":null,"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1787489595508-2-98c4b849","title":"Playbook binding: matcher + mapping + workflow, editable at runtime","description":"The object that ties it together. A binding is: a matcher (which inbound events does this apply to), a mapping (which fields the workflow receives), and a target agentic workflow.\n\nRuntime-editable is the whole point -- creating or changing a binding must not require a redeploy or a daemon restart. That has real consequences the design must face:\n\n- Bindings are persisted state, not config. They live in the store, not config.toml, because operators create them from the UI while the daemon runs.\n- They need versioning. A binding that starts a task should record WHICH version ran, or a later edit makes historical task provenance a lie.\n- Matcher ambiguity needs a defined resolution: two bindings matching one event either both run, or the more specific wins, or it is an error. Pick one and say so.\n- A binding referencing a workflow that no longer exists must fail visibly at bind time, not at 3am when the event arrives.","status":"closed","priority":1,"issue_type":"feature","created_at":"2026-08-23T12:22:09Z","updated_at":"2026-08-23T22:39:29Z","closed_at":"2026-08-23T22:39:29Z","close_reason":"Duplicate; work tracked under canonical epic","external_ref":"https://github.com/samcharles93/archie-core/issues/565","source_system":"github:https://github.com/samcharles93/archie-core/issues/565:565","metadata":null,"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1ysw.3","title":"Clean abandoned untracked files on retry","description":"Prepare refresh hard-resets tracked files but retains untracked files; CommitAll later stages and publishes them during the next attempt.","acceptance_criteria":"A regression test proves an untracked file left by an interrupted attempt is absent after retry and cannot appear in ChangedFiles or the next commit; deliberate .git control files remain intact.","status":"closed","priority":1,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-22T11:01:44Z","created_by":"Sam Catlow","updated_at":"2026-08-24T03:11:49Z","started_at":"2026-08-22T11:47:47Z","closed_at":"2026-08-24T03:11:49Z","close_reason":"Retry cleaning was implemented in 0522fb7 (reset + cleanUntracked, covered by TestPrepareRecoversFromADirtyWorktreeOnRetry). Remaining defect fixed in 037ee7c: SkipDir on a .git gitdir *file* aborted the whole walk, so cleaning silently no-opped for linked/adopted worktrees. Regression test TestCleanUntrackedHandlesGitdirFile.","external_ref":"https://github.com/samcharles93/archie-core/issues/591","metadata":null,"dependencies":[{"issue_id":"archie-core-1ysw.3","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-1ysw.2","title":"Make worktree directory keys collision-free","description":"Manager.Dir flattens owner and repo with a hyphen, so distinct repositories such as a-b/c and a/b-c share a task directory for equal issue numbers.","acceptance_criteria":"Distinct owner/repo tuples always map to distinct contained paths; sequential and concurrent collision regressions cannot reuse, delete, reset, or push the other repository's clone.","status":"open","priority":1,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-22T11:01:43Z","created_by":"Sam Catlow","updated_at":"2026-08-23T21:59:59Z","started_at":"2026-08-22T11:44:35Z","external_ref":"https://github.com/samcharles93/archie-core/issues/592","metadata":null,"dependencies":[{"issue_id":"archie-core-1ysw.2","depends_on_id":"archie-core-1ysw","type":"parent-child","created_at":"2026-08-22T21:01:43Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1ysw.2","title":"Make worktree directory keys collision-free","description":"Manager.Dir flattens owner and repo with a hyphen, so distinct repositories such as a-b/c and a/b-c share a task directory for equal issue numbers.","acceptance_criteria":"Distinct owner/repo tuples always map to distinct contained paths; sequential and concurrent collision regressions cannot reuse, delete, reset, or push the other repository's clone.","status":"closed","priority":1,"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:44:35Z","closed_at":"2026-08-24T06:59:58Z","close_reason":"Fixed on main: Manager.Dir base64url-encodes owner and repo as separate path components (worktree.go:66-70), so a-b/c and a/b-c no longer collide. legacyDir+migrateLegacy migrate old flattened dirs only on exact origin match. Package tests pass.","external_ref":"https://github.com/samcharles93/archie-core/issues/592","metadata":null,"dependencies":[{"issue_id":"archie-core-1ysw.2","depends_on_id":"archie-core-1ysw","type":"parent-child","created_at":"2026-08-22T21:01:43Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-t2db.4","title":"Playbook binding: matcher + mapping + workflow, editable at runtime","description":"The object that ties it together. A binding is: a matcher (which inbound events does this apply to), a mapping (which fields the workflow receives), and a target agentic workflow.\n\nRuntime-editable is the whole point -- creating or changing a binding must not require a redeploy or a daemon restart. That has real consequences the design must face:\n\n- Bindings are persisted state, not config. They live in the store, not config.toml, because operators create them from the UI while the daemon runs.\n- They need versioning. A binding that starts a task should record WHICH version ran, or a later edit makes historical task provenance a lie.\n- Matcher ambiguity needs a defined resolution: two bindings matching one event either both run, or the more specific wins, or it is an error. Pick one and say so.\n- A binding referencing a workflow that no longer exists must fail visibly at bind time, not at 3am when the event arrives.","acceptance_criteria":"A binding can be created, edited and disabled from the UI while the daemon runs; a task records the binding version that started it; overlapping matchers resolve by a defined and documented rule; a binding naming a missing workflow is rejected when saved.","notes":"2026-08-22: the draft -\u003e pending_approval -\u003e armed state machine from t2db.5's decision belongs to the binding entity this bead defines, not to a shared package -- 7d5u.3 was narrowed to exclude it since there is exactly one consumer today. Implement the state transitions here.","status":"open","priority":1,"issue_type":"feature","owner":"sam@catlow.tech","created_at":"2026-08-21T13:45:45Z","created_by":"Sam Catlow","updated_at":"2026-08-22T09:25:02Z","external_ref":"https://github.com/samcharles93/archie-core/issues/537","dependencies":[{"issue_id":"archie-core-t2db.4","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.4","depends_on_id":"archie-core-t2db.3","type":"blocks","created_at":"2026-08-21T23:45:53Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-t2db.4","depends_on_id":"archie-core-t2db.5","type":"blocks","created_at":"2026-08-21T23:45:53Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":2,"dependent_count":1,"comment_count":0}
{"_type":"issue","id":"archie-core-t2db.1","title":"Capture inbound events archie does not yet understand","description":"The precondition for everything else. Today an unrecognised inbound request is rejected; for schema-by-example it must be RECORDED, because you cannot map a payload you have never seen.\n\nAccept, store and retain inbound events with no binding: raw body, headers, source, arrival time, and the identity that sent it. Retention must be bounded -- an open capture endpoint is an unbounded disk write, and this is exactly the kind of surface an attacker fills.\n\nStrong argument for NATS JetStream as the store rather than the in-process events.Bus: durable, replayable, retention-bounded natively, already deployed. Note the constraint though -- internal/infrastructure/eventbus/nats/doc.go states 'when no NATS URL is configured the daemon uses its local SQLite claim flow instead; nothing here is required for single-process operation'. NATS is currently OPTIONAL. Decide deliberately whether capture requires it (making this feature unavailable in single-process deployments) or degrades to SQLite, and record which -- do not let it become a hard dependency by accident.","acceptance_criteria":"An unbound webhook POST is captured and visible rather than rejected; capture is retention-bounded with a documented limit; the single-process (no NATS) behaviour is a deliberate, recorded decision; capture cannot exhaust disk.","notes":"2026-08-22: capture-storage ownership confirmed here (not in 7d5u.3, which was narrowed to storage-agnostic HMAC/rate-limit/redaction mechanics only). This bead's capture path should call webhookguard's redaction before persisting and its rate limiter at the HTTP boundary, but owns its own storage engine and the NATS-vs-SQLite decision.","status":"closed","priority":1,"issue_type":"feature","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-21T13:45:18Z","created_by":"Sam Catlow","updated_at":"2026-08-22T09:25:03Z","started_at":"2026-08-21T16:18:24Z","closed_at":"2026-08-21T18:51:09Z","close_reason":"Built capture storage + endpoint: docs/prds/event-capture-storage.md decides SQLite over NATS JetStream (NATS not unconditionally available pre-7d5u.2, capture's single-writer/single-reader access pattern doesn't need JetStream fan-out/replay). internal/store/captures.go adds captured_events table + InsertCapture (prune-on-write by retention age and row count) + ListCaptures. internal/webui/api_capture.go adds POST /webhooks/capture/{source}, unauthenticated (bypasses requireToken like /healthz), applying webhookguard redaction before persisting and a per-remote-address rate limit + hard body-size cap before that. New [capture] config section with documented defaults. Adversarial self-review (the usual fresh subagent pass hit a session API limit mid-run, so this was a manual re-read with the same checklist) caught and fixed three real bugs before landing: (1) body-size cap silently unenforced when unset -- added a hardcoded fallback floor since it's the only bound on a SINGLE payload's size; (2) rate limiter was keyed by the request's own unregistered source path segment, violating webhookguard.RateLimiter's documented bounded-key-space assumption -- an attacker could rotate the segment to bypass the limit and grow the bucket map unbounded; rekeyed to remote address; (3) retention prune used time.RFC3339Nano, whose variable-width trimmed fractional seconds break lexicographic string comparison in `WHERE received_at \u003c ?` (an exact-second timestamp can sort after a later fractional one) -- switched to fixed-width RFC3339. All three have regression tests verified to fail against the pre-fix code. task check clean, golangci-lint zero new findings repo-wide.","external_ref":"https://github.com/samcharles93/archie-core/issues/538","dependencies":[{"issue_id":"archie-core-t2db.1","depends_on_id":"archie-core-7d5u.4","type":"relates-to","created_at":"2026-08-22T01:01:02Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-t2db.1","depends_on_id":"archie-core-t2db","type":"parent-child","created_at":"2026-08-21T23:45:17Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":2,"comment_count":0}
{"_type":"issue","id":"archie-core-t2db.2","title":"Event inspector: see real inbound payloads in the dashboard","description":"The operator-facing half of capture. A live view of recent inbound events: source, arrival time, and the actual payload, pretty-printed and explorable.\n\nThis is the screen that makes the feature feel like magic: you hit 'send test webhook' in the other app, alt-tab to archie, and the event is sitting there. Latency from arrival to visible matters more than it looks -- it is the difference between a design loop and a guessing game.\n\nShow unbound events prominently. An event nothing is listening to is not noise here, it is the queue of integrations waiting to be built.","acceptance_criteria":"Recent inbound events are listed with source, time and full payload; unbound events are distinguishable from bound ones; a newly arrived event appears without a manual refresh; payloads are explorable rather than a wall of text.","status":"closed","priority":1,"issue_type":"feature","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-21T13:45:18Z","created_by":"Sam Catlow","updated_at":"2026-08-22T09:25:04Z","started_at":"2026-08-21T18:57:52Z","closed_at":"2026-08-21T19:17:03Z","close_reason":"GET /api/captures (token-gated, memory/skills-style enabled:false-not-an-error when Captures is nil) plus a new /captures dashboard page: recent captures newest-first, expandable per-row to explore redacted payload/headers pretty-printed. Live updates reuse the existing operator-activity event pipeline (Server.emit -\u003e Events.Publish -\u003e the /events SSE stream) as an invalidation signal, refetching the list rather than merging partial event data. Every row shows an 'Unbound' pill today since no binding model exists yet (t2db.4 wires the real distinction). Frontend follows the tasks/task-row.js precedent: row rendering split into capture-row.js for unit testing without the page's fetch/SSE wiring. Adversarial review (fresh subagent, full pass) found one real severe bug before merge: the live SSE event was embedding the full (up to 256KiB) redacted body/headers into the events table, which has no retention/row-count prune anywhere in the codebase -- silently defeating t2db.1's disk-bound guarantee for an unauthenticated, only-rate-limited endpoint. Fixed: the live event now carries just {id, source} as a pure invalidation signal; the dashboard refetches the authoritative list. Two smaller findings (untested Data[\"id\"] field the frontend's dedup depended on; a received_at precision mismatch between live and REST-fetched copies) were resolved as a side effect of that fix. task check clean, golangci-lint zero new findings.","external_ref":"https://github.com/samcharles93/archie-core/issues/539","dependencies":[{"issue_id":"archie-core-t2db.2","depends_on_id":"archie-core-t2db","type":"parent-child","created_at":"2026-08-21T23:45:17Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-t2db.2","depends_on_id":"archie-core-t2db.1","type":"blocks","created_at":"2026-08-21T23:45:53Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":1,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-t2db.3","title":"Map payload fields by example, from a real captured event","description":"Pick a captured event, click through its payload, and bind JSON paths to named fields the workflow will receive. Schema by example, not schema by specification.\n\nThe hard part is not the happy path, it is drift. A mapping authored against one payload will eventually meet a payload where the path is missing, null, or a different type -- the sending app shipped a change nobody told you about. That must fail LOUDLY and land somewhere the operator sees, not silently pass an empty string into an agent prompt. An agent handed a blank field will confabulate around it, which turns a schema change into an agent doing confident nonsense in a repo.\n\nSupport a preview: given this mapping and this captured event, show exactly what the workflow would receive. Never ship a mapping the operator has not seen resolve against real data.","acceptance_criteria":"Fields are mappable from a captured payload without writing code; a mapping preview resolves against a real event before saving; a missing, null or type-changed path at runtime produces a visible failure rather than an empty value; the failure names the path and the event.","status":"closed","priority":1,"issue_type":"feature","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-21T13:45:18Z","created_by":"Sam Catlow","updated_at":"2026-08-22T09:25:05Z","started_at":"2026-08-22T08:39:40Z","closed_at":"2026-08-22T09:01:53Z","close_reason":"Payload field mapping: domain (internal/domain/mapping), SQLite store (internal/store/mappings.go), HTTP API (internal/webui/api_mapping.go), and dashboard editor (ui/src/mappings) shipped. PRD at docs/prds/payload-field-mapping.md. task check green; adversarial review found 4 issues (stale preview after rename, duplicate field names, hardcoded capture scan window, malformed path silently reinterpreted), all fixed and re-verified.","external_ref":"https://github.com/samcharles93/archie-core/issues/540","dependencies":[{"issue_id":"archie-core-t2db.3","depends_on_id":"archie-core-t2db","type":"parent-child","created_at":"2026-08-21T23:45:18Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-t2db.3","depends_on_id":"archie-core-t2db.1","type":"blocks","created_at":"2026-08-21T23:45:53Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":1,"dependent_count":1,"comment_count":0}
{"_type":"issue","id":"archie-core-t2db","title":"[EPIC] Event capture and no-code playbooks: turn any inbound webhook into an agentic workflow","description":"The pitch, in the operator's words: point any app's outgoing webhook at archie, open archie, SEE the event that just arrived with its real payload, map the fields you care about, bind them to an agentic workflow, save. No code change, no redeploy, no restart. Adding a new integration stops being a development task.\n\nWhy this is different from n8n or Power Automate rather than a copy of them: their terminal node is a deterministic connector. Archie's is an AGENT with a repo, a worktree, tools and a gate. 'When Sentry reports a new issue in this project, open a PR that fixes it' is one binding here and an entire product elsewhere.\n\nThe design insight that makes it buildable: you cannot write a payload mapper against a payload you have not seen. Schema-by-example requires real recent events to map against, which means archie must CAPTURE events it does not yet understand -- including ones with no binding at all -- and retain them long enough to design against. That is also the strongest argument for putting inbound events on NATS JetStream rather than the lossy in-process bus: durable, replayable, retention-bounded, and already deployed. The capture requirement and the transport choice are the same decision.\n\nSequence: capture unrecognised events -\u003e inspect real payloads in the UI -\u003e map fields by example -\u003e bind matcher+mapping to a workflow -\u003e the next matching event runs it.\n\nThis is a public, unauthenticated-by-default intake surface whose output is an agent with tool access. Security is not a later hardening pass; it is a first-class child of this epic.","acceptance_criteria":"An operator can point a new external webhook at archie, see its payload in the UI without writing code, map fields, bind it to a workflow, and have the next matching event run that workflow -- with no redeploy and no daemon restart. A binding cannot go live without explicit human approval.","status":"open","priority":1,"issue_type":"epic","owner":"sam@catlow.tech","created_at":"2026-08-21T13:44:56Z","created_by":"Sam Catlow","updated_at":"2026-08-22T09:25:06Z","external_ref":"https://github.com/samcharles93/archie-core/issues/541","dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-7d5u.4","title":"GitHub forge webhook receiver behind a feature flag","description":"The concrete autonomy win: react to an issue being assigned or labelled the moment it happens, instead of up to poll_interval (default 60s) later.\n\nVerified absent on 2026-08-21: internal/forge/ and internal/daemon/ contain zero webhook references, and no bead tracked forge-event intake before this epic. internal/channels/webhook exists but is a CHAT channel -- it routes inbound text through gateway.Router for LLM processing, a peer of Telegram and email. It is not forge intake and should not be bent into it.\n\nShip as a source in the typed intake family, off by default: [forge] intake = 'poll' (default) | 'webhook' | 'both'. Verify GitHub's HMAC signature. Reuse the label/assignee dispatch predicate the poller already uses -- do NOT reimplement it, since it just took a fix (3209a1f, refusing to poll on an empty label match) and two implementations will drift.\n\nDeployment reality from CLAUDE.md: archied may run on a host, in a container, or behind no public ingress at all. A webhook receiver that assumes a reachable public URL will not fit every profile, which is exactly why polling has to remain a first-class option rather than a legacy fallback.","acceptance_criteria":"With intake='webhook', a labelled issue starts a task without waiting for the poll interval; an invalid HMAC is rejected and logged; intake='poll' behaves exactly as today; the dispatch predicate is shared with the poller, not duplicated; the flag defaults to poll.","status":"closed","priority":1,"issue_type":"feature","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-21T13:26:52Z","created_by":"Sam Catlow","updated_at":"2026-08-22T09:25:07Z","started_at":"2026-08-22T08:43:35Z","closed_at":"2026-08-22T09:21:16Z","close_reason":"GitHub webhook receiver shipped: [forge] intake=poll|webhook|both, shared MatchesDispatch predicate (case-insensitive assignee, case-sensitive label) consumed by poller and receiver, HMAC-verified, publishes via shared PublishTask. Adversarial self-review found and fixed 3 real defects (boot-crashing secret-resolve hard-fail under intake=both, assignee case-sensitivity mismatch vs GitHub's own filter, silent multi-identity misdispatch) before landing. task check + lint clean. Committed 41e43dc.","external_ref":"https://github.com/samcharles93/archie-core/issues/542","dependencies":[{"issue_id":"archie-core-7d5u.4","depends_on_id":"archie-core-7d5u","type":"parent-child","created_at":"2026-08-21T23:26:51Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-7d5u.4","depends_on_id":"archie-core-7d5u.1","type":"blocks","created_at":"2026-08-21T23:26:58Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-7d5u.4","depends_on_id":"archie-core-7d5u.3","type":"blocks","created_at":"2026-08-21T23:26:58Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-7d5u.4","depends_on_id":"archie-core-t2db.1","type":"relates-to","created_at":"2026-08-22T01:01:02Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":2,"dependent_count":2,"comment_count":0}
{"_type":"issue","id":"archie-core-7d5u.5","title":"Idempotency and poll/webhook parity: never double-dispatch, never lose work","description":"Webhooks deliver at-least-once, out of order, and sometimes not at all. Polling is the opposite: slow but eventually consistent. Running both (intake='both') is the honest production configuration, and it is also where the two failure modes meet.\n\nTwo things must hold. A single issue event must not start two tasks because the webhook and the next poll both saw it. And a webhook outage must not silently stop work -- if the receiver is wedged or the ingress is down, polling has to pick the work up, which is the entire argument for keeping it.\n\nNote archie-core-...-286 (WebhookAdapter: idempotency cache) already exists for the chat adapter. Decide whether that mechanism generalises to intake or whether forge dispatch needs its own key; do not build a second one by accident.\n\nThe silent-failure shape to design against is the one this codebase keeps hitting: a path that looks like it is working because nothing errors. A webhook receiver that has silently stopped delivering looks identical to a repo with no activity.","acceptance_criteria":"A duplicate delivery of the same forge event starts exactly one task; with intake='both', disabling the webhook path still results in the work being picked up by polling; a wedged or non-delivering webhook receiver is observable rather than indistinguishable from an idle repo.","status":"open","priority":1,"issue_type":"feature","owner":"sam@catlow.tech","created_at":"2026-08-21T13:26:52Z","created_by":"Sam Catlow","updated_at":"2026-08-22T10:20:56Z","started_at":"2026-08-22T09:30:20Z","external_ref":"https://github.com/samcharles93/archie-core/issues/543","metadata":null,"dependencies":[{"issue_id":"archie-core-7d5u.5","depends_on_id":"archie-core-1786637497328-286-9c985f28","type":"relates-to","created_at":"2026-08-21T23:27:06Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-7d5u.5","depends_on_id":"archie-core-7d5u","type":"parent-child","created_at":"2026-08-21T23:26:51Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-7d5u.5","depends_on_id":"archie-core-7d5u.1","type":"blocks","created_at":"2026-08-21T23:26:58Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-7d5u.5","depends_on_id":"archie-core-7d5u.4","type":"blocks","created_at":"2026-08-21T23:26:58Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":2,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-7d5u.5","title":"Idempotency and poll/webhook parity: never double-dispatch, never lose work","description":"Webhooks deliver at-least-once, out of order, and sometimes not at all. Polling is the opposite: slow but eventually consistent. Running both (intake='both') is the honest production configuration, and it is also where the two failure modes meet.\n\nTwo things must hold. A single issue event must not start two tasks because the webhook and the next poll both saw it. And a webhook outage must not silently stop work -- if the receiver is wedged or the ingress is down, polling has to pick the work up, which is the entire argument for keeping it.\n\nNote archie-core-...-286 (WebhookAdapter: idempotency cache) already exists for the chat adapter. Decide whether that mechanism generalises to intake or whether forge dispatch needs its own key; do not build a second one by accident.\n\nThe silent-failure shape to design against is the one this codebase keeps hitting: a path that looks like it is working because nothing errors. A webhook receiver that has silently stopped delivering looks identical to a repo with no activity.","acceptance_criteria":"A duplicate delivery of the same forge event starts exactly one task; with intake='both', disabling the webhook path still results in the work being picked up by polling; a wedged or non-delivering webhook receiver is observable rather than indistinguishable from an idle repo.","status":"closed","priority":1,"issue_type":"feature","owner":"sam@catlow.tech","created_at":"2026-08-21T13:26:52Z","created_by":"Sam Catlow","updated_at":"2026-08-24T07:12:06Z","started_at":"2026-08-22T09:30:20Z","closed_at":"2026-08-24T07:12:06Z","close_reason":"Investigated first: the dedup mechanism (TaskEnvelope.IdempotencyKey + PublishUnique + JetStream Nats-Msg-Id dedup) and the shared dispatch predicate were already fully wired by 7d5u.4 -- no double-dispatch code change was needed. Closed the two real gaps: (1) internal/infrastructure/eventbus/nats/dedup_test.go is a new regression test proving PublishUnique actually suppresses a duplicate publish on the same WorkQueuePolicy stream ARCHIE_TASKS uses in production; (2) internal/forge/webhook/receiver.go gained Status()/GET support tracking authenticated deliveries vs successful publishes separately, so a wedged or non-delivering receiver is observable rather than indistinguishable from an idle repo. AC's poll/webhook parity clause (disabling webhook still polls) is satisfied architecturally with no code change possible to violate it -- verified Cycle()/Run() never reference cfg.Forge.Intake anywhere in internal/daemon; only setupForgeWebhook in cmd/archied/bootstrap.go gates the webhook HTTP server. Adversarial review pass (fresh subagent, -race) found zero blocking issues; closed two minor coverage gaps it flagged. [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/543","metadata":null,"dependencies":[{"issue_id":"archie-core-7d5u.5","depends_on_id":"archie-core-1786637497328-286-9c985f28","type":"relates-to","created_at":"2026-08-21T23:27:06Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-7d5u.5","depends_on_id":"archie-core-7d5u","type":"parent-child","created_at":"2026-08-21T23:26:51Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-7d5u.5","depends_on_id":"archie-core-7d5u.1","type":"blocks","created_at":"2026-08-21T23:26:58Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-7d5u.5","depends_on_id":"archie-core-7d5u.4","type":"blocks","created_at":"2026-08-21T23:26:58Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":2,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-7d5u.1","title":"Design: event sources, reaction delivery, and how extensions hook them","description":"No settled design covers this. docs/architecture/plugins-and-extensions.md settles the PLUGIN FRAMEWORK (metadata-only contract, typed capability families, owning registries) but says nothing about event sources, reaction delivery, or intake. Under the scope-discipline rule merged as PR #533, that means design first -- one page, decisive -- then a diff.\n\nDecide and record in docs/prds/:\n\n1. THE HEADLINE QUESTION, which changes everything downstream: do extensions react in-process through typed capability families (what the approved rule mandates), or out-of-process like tau's generic DispatchEvent? If out-of-process generic dispatch is genuinely wanted, docs/architecture/plugins-and-extensions.md is an APPROVED document and must be amended first -- CLAUDE.md's organisation rule is explicit that you change the doc before the rule it states. Do not quietly work around it.\n\n2. Reaction delivery. events.Bus drops on overflow by design and must stay that way for the dashboard. Decide whether reactions get a second in-process bus with at-least-once delivery, or ride the existing NATS eventbus (internal/infrastructure/eventbus), which already has durable semantics and the work-queue traps documented in CLAUDE.md.\n\n3. Whether a reaction may INFLUENCE an outcome (veto, mutate, add work) or only observe. This is the difference between a hook and a subscriber, and it determines whether ordering and failure semantics matter. If a reaction can block, decide what a slow or crashed extension does -- tau's answer was a dispatch timeout, and it still deadlocked unload once.\n\n4. The typed source/intake family: its interface, its owning registry, and how a source declares what it produces.\n\nRespect dependency direction: cmd -\u003e app -\u003e {domain, infrastructure}. A domain declares the contract; app wires implementations. Cross-cutting packages may be imported by any layer and import none.","acceptance_criteria":"A one-page decision in docs/prds/ answering all four questions, naming the packages it will touch, and stating explicitly whether plugins-and-extensions.md needs amending. It decides rather than surveys.","notes":"CORRECTION 2026-08-22 (second): decision question 2 in this bead's description asked whether reactions get a second in-process bus or ride the existing NATS eventbus. That framing is wrong -- there is no 'or'. NATS is the settled transport; the only open axis is external-server vs embedded, not NATS vs something else. Do not design a second bus. See archie-core-7d5u and archie-core-7d5u.2 for the corrected framing and the verified state of github.com/nats-io/nats-server/v2 as an already-present, test-proven, production-unwired dependency.","status":"closed","priority":1,"issue_type":"decision","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-21T13:26:26Z","created_by":"Sam Catlow","updated_at":"2026-08-22T09:25:09Z","started_at":"2026-08-21T14:56:21Z","closed_at":"2026-08-21T15:00:55Z","close_reason":"Decided and documented in docs/prds/event-sources-and-reactions.md, satisfying this bead's own acceptance criterion (a one-page decision naming the packages it touches and stating whether plugins-and-extensions.md needs amending -- it does not).\n\nAnswers: (1) in-process typed families, no out-of-process dispatch -- archie has no existing extension-process boundary and neither epic's stated payoff needs one. (2) Reaction delivery reuses internal/eventbus's Publisher/Consumer contract (PublishUnique + Ack/Nak already provide at-least-once with dedup), but NOT the existing nats.Client as-is: it hardcodes Retention: jetstream.WorkQueuePolicy (client.go:65) for the competing-consumer ARCHIE_TASKS stream, which silently starves a second consumer on overlapping subjects per CLAUDE.md's documented trap -- reactions need fan-out, so retention needs to become a Config field and reactions get their own stream. (3) Reactions in these two epics are producer-only (cheap wake via curator's WakeOnPrimaryInput pattern, or produce real work via the existing pollNATS-\u003epublishTask path) -- no veto/mutate-in-flight-work capability is being built here; that belongs to archie-core-h019 if it's ever needed. (4) No single generic Source interface -- forge intake reuses workintake.TaskEnvelope unchanged (its IdempotencyKey is already keyed on owner/repo/number, not delivery source, so a webhook-sourced envelope naturally dedups against a poll-discovered one for free); chat webhook stays internal/channels/webhook, unmodified; what's genuinely new and shared is a small cross-cutting package for HMAC/rate-limit/approval/capture mechanics, owned by neither domain.","external_ref":"https://github.com/samcharles93/archie-core/issues/544","dependencies":[{"issue_id":"archie-core-7d5u.1","depends_on_id":"archie-core-7d5u","type":"parent-child","created_at":"20Line truncated
{"_type":"issue","id":"archie-core-7d5u.2","title":"Reaction delivery via embedded NATS, no external server required","description":"Reactions need at-least-once delivery distinct from the lossy events.Bus (see epic description). The delivery mechanism is NATS -- that part is settled, not a design question. What's open is deployment shape.\n\nVERIFIED 2026-08-22: config.NATSConfig.URL empty currently means 'no NATS, use SQLite ClaimNext' (internal/config/config.go:573-582). That fallback was designed for task distribution working without a broker at all. It was never meant to generalise to 'archie has no NATS' as a permanent architectural stance -- the intended second deployment shape alongside an external NATS server was always NATS EMBEDDED (in-process), not a different eventbus.\n\ngithub.com/nats-io/nats-server/v2 is already a direct dependency and is proven to work in this codebase: internal/infrastructure/agenttransport/nats/transport_test.go and others already start a real embedded server via nats-server/v2/test for tests. It has just never been wired into production startup -- cmd/archied only knows 'external URL configured' vs 'fall back to SQLite'. No new library, no new bus, no architectural gap to design around: this is 'wire the dependency we already have and already test against into the daemon's own startup path.'\n\nDesign questions that remain, now correctly scoped: does an embedded NATS instance replace the SQLite fallback outright for single-process deployments, or run alongside it; what config controls embedded vs external vs disabled; does the daemon own the embedded server's lifecycle the same way it owns everything else (start/stop paired with daemon start/stop, per the shutdown-ordering rules in ARCHITECTURE.md).","acceptance_criteria":"A single-process deployment with no external NATS URL configured still gets reaction delivery via an embedded NATS instance; the daemon starts and stops the embedded server as part of its own lifecycle; no second eventbus type is introduced; internal/infrastructure/eventbus/nats is reused as the transport rather than duplicated.","notes":"2026-08-22, from docs/prds/event-sources-and-reactions.md: do not reuse the existing nats.Client's stream creation as-is. internal/infrastructure/eventbus/nats/client.go:65 hardcodes Retention: jetstream.WorkQueuePolicy -- correct for ARCHIE_TASKS (task distribution, one consumer claims each message) and wrong for reactions, which need fan-out (every registered reaction sees every matching event). Two reactions on overlapping subjects under WorkQueuePolicy hit the exact trap CLAUDE.md documents: the second consumer silently gets nothing. Config.StreamName/Config.Subjects are already composition-supplied (config.go:30-38); Retention is not parameterized and needs to become a Config field, defaulting to today's WorkQueuePolicy so ARCHIE_TASKS is unaffected, with reactions getting a second stream under a fan-out-capable policy and their own subject namespace.","status":"closed","priority":1,"issue_type":"feature","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-21T13:26:26Z","created_by":"Sam Catlow","updated_at":"2026-08-22T09:25:10Z","started_at":"2026-08-21T18:57:41Z","closed_at":"2026-08-21T19:18:55Z","close_reason":"Embedded NATS wired into production startup: mode=embedded/external/off resolves from url, daemon owns the in-process server lifecycle, Retention parameterized for a future fan-out reaction stream. task check + lint clean; adversarial review zero surviving findings. Committed 2c7db34.","external_ref":"https://github.com/samcharles93/archie-core/issues/545","dependencies":[{"issue_id":"archie-core-7d5u.2","depends_on_id":"archie-core-7d5u","type":"parent-child","created_at":"2026-08-21T23:26:26Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-7d5u.2","depends_on_id":"archie-core-7d5u.1","type":"blocks","created_at":"2026-08-21T23:26:57Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":1,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-7d5u.3","title":"Shared webhook mechanics: HMAC verification, per-source rate limiting, payload redaction","description":"NARROWED 2026-08-22 from this bead's prior scope, which bundled capture-storage and an approval state machine into a single 'shared mechanics' package. On reflection those are not genuinely shared yet:\n\n- Capture STORAGE is t2db.1's job -- it depends on the NATS-vs-SQLite decision 7d5u.2 owns, and building a storage engine here would either duplicate or contradict that. This package may be USED by t2db.1's capture path, but does not own persistence.\n- The draft/pending_approval/armed state machine belongs to the entity that has that state -- t2db.4's binding -- not a generic package. There is exactly one consumer (bindings) today; per 'extract into a shared primitive on the second real consumer, never in anticipation of one,' building it here now would be speculative.\n\nWhat remains, and is genuinely storage-agnostic and reusable by any inbound HTTP source regardless of what consumes it:\n\n1. HMAC-SHA256 verification -- generalize internal/channels/webhook/webhook.go's existing unexported validateHMAC into an exported function here, and have that package call into it instead of keeping its own copy. One implementation of signature checking, not two that can drift.\n2. Per-source rate limiting -- a token bucket keyed by source ID (not global), so one noisy sender cannot exhaust another's budget. Limit-exceeded is an observable rejection, not a silent drop, per t2db.5's decision.\n3. Payload redaction -- generalize internal/gateway/stream.go's unexported sensitiveParameterKey/redactToolParameters heuristic (matches token/secret/password/passwd/api_key/apikey/authorization/credential/cookie/private_key against normalized JSON keys) into a reusable, storage-agnostic transform any capture path can apply before persisting.","acceptance_criteria":"webhookguard.VerifyHMAC replaces internal/channels/webhook's private copy with no behaviour change (its existing tests still pass); a per-source rate limiter rejects over-budget requests observably; a redaction function matches the same key heuristic already proven in gateway/stream.go; the package has zero imports of any domain, infrastructure or app package.","notes":"--notes=2026-08-22: merged to main as f3d3d32 (PR #534, squash of aa23ac9+46401ab+ce4f945).","status":"closed","priority":1,"issue_type":"feature","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-21T13:26:26Z","created_by":"Sam Catlow","updated_at":"2026-08-22T09:25:11Z","started_at":"2026-08-21T15:19:09Z","closed_at":"2026-08-21T15:26:01Z","close_reason":"Built internal/webhookguard: VerifyHMAC (behavior-preserving extraction from internal/channels/webhook, which now calls it instead of keeping a private copy), RateLimiter (per-source token bucket, independent budgets, observable rejection), RedactPayload (key-name heuristic matching gateway/stream.go's marker list, but -- deliberately unlike that function -- redacts only values under sensitive keys and leaves ordinary strings/numbers/bools untouched, since a captured payload exists to be inspected for field mapping in t2db.3).\n\nAll four acceptance criteria met and independently confirmed by a fresh adversarial review with zero surviving findings: HMAC extraction is byte-for-byte behavior-preserving (diffed against the deleted function); rate limiter hand-traced correct on two scenarios plus race-clean under -race; redaction's divergence from gateway/stream.go verified by reading both functions side by side; zero non-stdlib imports confirmed by grep. The reviewer also mutation-tested both the redaction and rate-limit guards (disabled each in turn) and confirmed the test suite catches both, then reverted and re-verified go test -race and git status were clean.\n\ntask check exit 0, golangci-lint 0 issues (one forcetypeassert finding was caught and fixed properly during build, not suppressed), gofumpt clean. All 10 pre-existing internal/channels/webhook tests pass unmodified; the one now-redundant unit test was removed with a comment pointing to where its coverage relocated.","external_ref":"https://github.com/samcharles93/archie-core/issues/546","dependencies":[{"issue_id":"archie-core-7d5u.3","depends_on_id":"archie-core-1786637497036-275-8838629e","type":"relates-to","created_at":"2026-08-21T23:27:06Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-7d5u.3","depends_on_id":"archie-core-7d5u","type":"parent-child","created_at":"2026-08-21T23:26:26Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-7d5u.3","depends_on_id":"archie-core-7d5u.1","type":"blocks","created_at":"2026-08-21T23:26:58Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":1,"dependent_count":1,"comment_count":0}
{"_type":"issue","id":"archie-core-7d5u","title":"[EPIC] Event sources and typed reactions: archie as an extensible platform","description":"Goal: let archie react to things happening -- forge activity, inbound callers, schedules -- and let extensions hook those reactions, without a generic untyped event bus.\n\nTwo findings shape this, both verified in the tree on 2026-08-21.\n\n1. ARCHIE HAS TWO EVENT NEEDS AND ONE BUS. internal/events is documented as 'archied's in-process observability stream' with 'bounded per-subscriber buffers that DROP on overflow, so a stalled dashboard connection can never apply backpressure to the task engine'. Publish is fire-and-forget; subscribers get a read-only channel and cannot influence anything. Correct for the dashboard, wrong for reactions: a hook that silently misses events under load and cannot affect an outcome is worse than no hook, because it looks like it ran. Reactions need at-least-once delivery and the ability to change what happens. Do not bolt reactions onto events.Bus.\n\n2. THE OBVIOUS DESIGN IS PROHIBITED, DELIBERATELY. The tau model this is drawn from dispatches generically: DispatchEvent(ctx, eventName string, sessionID, ...) to out-of-process gRPC plugins. archie's approved foundation (docs/architecture/plugins-and-extensions.md) forbids that shape -- the generic plugin contract stays metadata-only and MUST NOT expose untyped hooks. plugin.Plugin is Name()/Version() only, enforced by internal/plugin/architecture_test.go and by the plugin engine rule in ARCHITECTURE.md. tau already carries the scar the rule avoids: TestUnload_DoesNotWaitForInFlightDispatch exists because a stuck plugin blocked plugin unload.\n\nThe reconciliation, and why this is an epic rather than a feature: separate INBOUND (callers push work in -- forge webhook, chat webhook, cron, channel) from REACTION (extensions respond to something that happened). Inbound becomes a typed source/intake capability family with an owning registry. Reactions become typed capability families owned by the domain whose semantics they affect. 'Webhooks aligned to types of callers' is exactly the typed-family model applied to intake: the instinct is right, the generic bus is what has to go.\n\nNear-term payoff: archie reacts to an issue being labelled the moment it happens, instead of up to poll_interval later.","acceptance_criteria":"A forge webhook triggers work behind a feature flag with polling still available as a backstop; inbound callers register through one typed family rather than bespoke wiring per caller; reactions have delivery guarantees distinct from the lossy observability bus; the generic plugin contract remains metadata-only and internal/plugin/architecture_test.go still passes.","notes":"CORRECTION 2026-08-22 (second): the earlier summary I gave characterized 'NATS is currently optional' as an open architectural gap for this epic to navigate around. That's wrong, and Sam corrected it directly: NATS was never meant to be optional as a technology. What's optional is running a standalone NATS SERVER -- config.NATSConfig.URL empty falls back to the existing SQLite ClaimNext flow (internal/config/config.go:573-582, internal/infrastructure/eventbus/nats/doc.go:24). The intended second deployment shape is NATS EMBEDDED (in-process, no external server to stand up), not 'no NATS, use some other eventbus'. There is no other eventbus in scope, was never meant to be one, and this epic must not introduce one.\n\nCurrent code state, verified: github.com/nats-io/nats-server/v2 (the embeddable NATS server package) is already a direct, non-indirect dependency, and is genuinely used to spin up an in-process server -- but only inside _test.go files (internal/infrastructure/agenttransport/nats/transport_test.go and others use github.com/nats-io/nats-server/v2/test to run tests against a real embedded server). It has never been wired into production as an actual deployment mode. So embedded NATS is proven to work in this codebase's own test harness, and the gap is purely that production startup only knows 'external URL configured' vs 'no NATS, fall back to SQLite' -- there is no production code path that starts nats-server in-process.\n\nThis changes 7d5u.2 (reaction delivery) materially: 'ride the existing NATS eventbus, or a second in-process bus' was the wrong framing. The actual question is whether reaction delivery requires an external NATS deployment or can run on an embedded NATS instance so single-process deployments still get it -- not whether to use NATS at all versus some other bus. If embedded NATS is wired for reaction delivery, capture (t2db.1) gets it too essentially for free, since they were flagged as needing the same underlying decision.","status":"open","priority":1,"issue_type":"epic","owner":"sam@catlow.tech","created_at":"2026-08-21T13:25:57Z","created_by":"Sam Catlow","updated_at":"2026-08-22T09:25:11Z","external_ref":"https://github.com/samcharles93/archie-core/issues/547","dependenLine truncated
{"_type":"issue","id":"archie-core-h019.3","title":"Reviewer runs in a context that provably never saw the implementation","description":"This is the whole feature. A reviewer that shares the implementer's context is a second opinion from the same mind, and it will rationalise the same mistakes -- which is exactly the failure mode CLAUDE.md's 'never self-certified by the implementer' rule exists to prevent.\n\nArchie already has the machinery: each task runs in an isolated container against its own worktree. Launch the reviewer the same way, seeded only with the diff and the originating issue. It must not receive the implementer's conversation, its notes, its reasoning, or its own claims about what it did.\n\nPer 'environmental enforcement over prompt rules', isolation must be a property of construction, not a sentence in the prompt. The agent cannot talk its way out of a context it was never given. Assert it in a test rather than assuming it: a test that would fail if implementer context were threaded through.","acceptance_criteria":"The reviewer is launched with only diff + issue; a test fails if implementer context reaches it; the reviewer's prompt instructs it to assume every line is wrong until proven correct; the mechanism reuses the existing container/worktree isolation rather than inventing a second one.","status":"open","priority":1,"issue_type":"feature","owner":"sam@catlow.tech","created_at":"2026-08-21T13:02:54Z","created_by":"Sam Catlow","updated_at":"2026-08-22T09:25:12Z","external_ref":"https://github.com/samcharles93/archie-core/issues/548","dependencies":[{"issue_id":"archie-core-h019.3","depends_on_id":"archie-core-h019","type":"parent-child","created_at":"2026-08-21T13:02:54Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-h019.3","depends_on_id":"archie-core-h019.1","type":"blocks","created_at":"2026-08-21T13:03:25Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":1,"dependent_count":1,"comment_count":0}
{"_type":"issue","id":"archie-core-h019.4","title":"Wire review as an implement-workflow stage: after gates, before PR open","description":"Sequence matters. The review runs after gates pass -- there is no point reviewing code that does not build or test -- and before the PR is opened, because the point is to not spend the operator's attention on a PR that is not ready.\n\nA surviving CONFIRMED finding must not open a PR. It parks the task as waiting_human with the findings attached, which is the existing lifecycle state for 'a human needs to look at this' and needs no new state. Per CLAUDE.md, a finding that survives blocks closing the work; it does not get waved through.\n\nScope to the implement workflow first. Routing to tdd/bootstrap/feasibility is a later decision -- feasibility in particular produces a document rather than a diff, so 'review the diff' may not even apply.","acceptance_criteria":"An implement task with a clean gate and no confirmed findings opens a PR as it does today; one with a surviving confirmed finding parks as waiting_human with findings recorded and opens no PR; the stage is observable in the task's running(workflow:stage) status; retry after operator action re-runs the review.","status":"open","priority":1,"issue_type":"feature","owner":"sam@catlow.tech","created_at":"2026-08-21T13:02:54Z","created_by":"Sam Catlow","updated_at":"2026-08-22T09:25:13Z","external_ref":"https://github.com/samcharles93/archie-core/issues/549","dependencies":[{"issue_id":"archie-core-h019.4","depends_on_id":"archie-core-h019","type":"parent-child","created_at":"2026-08-21T13:02:54Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-h019.4","depends_on_id":"archie-core-h019.1","type":"blocks","created_at":"2026-08-21T13:03:25Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-h019.4","depends_on_id":"archie-core-h019.2","type":"blocks","created_at":"2026-08-21T13:03:25Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-h019.4","depends_on_id":"archie-core-h019.3","type":"blocks","created_at":"2026-08-21T13:03:26Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":3,"dependent_count":1,"comment_count":0}
{"_type":"issue","id":"archie-core-h019.1","title":"Design: adversarial self-review stage (one-page decision in docs/prds/)","description":"No settled design exists for this in docs/architecture/, so under the scope-discipline rule merged as PR #533 the design comes first -- briefly and decisively -- and is not finished until a diff follows it.\n\nDecide and record, in one page under docs/prds/: where the reviewer runs (reuse the per-task container pool, or a separate short-lived container); what it is given (diff plus originating issue, and explicitly what it must NOT be given); the findings contract and who owns the type; what a surviving finding does to the task lifecycle; and how the reviewer's model/effort is configured.\n\nConstraints from the repo that the design must respect: dependency direction is cmd -\u003e app -\u003e {domain, infrastructure}, so the reviewer contract belongs to the workflow domain and the execution to infrastructure/app. Agent execution is a data boundary. The model never runs git. Prefer environmental enforcement over prompt rules -- 'the reviewer cannot see the implementation' must be a property of how it is launched, not an instruction in its prompt.\n\nDo not write an architecture document, migration plan or review campaign. One page that decides.","acceptance_criteria":"A one-page decision exists under docs/prds/ answering: reviewer isolation mechanism, inputs and forbidden inputs, findings contract owner, lifecycle effect of a surviving finding, and model/effort configuration. It decides rather than surveys, and cites the packages it will touch.","status":"open","priority":1,"issue_type":"decision","owner":"sam@catlow.tech","created_at":"2026-08-21T13:02:39Z","created_by":"Sam Catlow","updated_at":"2026-08-22T10:20:56Z","started_at":"2026-08-22T09:30:19Z","external_ref":"https://github.com/samcharles93/archie-core/issues/550","metadata":null,"dependencies":[{"issue_id":"archie-core-h019.1","depends_on_id":"archie-core-h019","type":"parent-child","created_at":"2026-08-21T13:02:39Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":5,"comment_count":0}
{"_type":"issue","id":"archie-core-h019.1","title":"Design: adversarial self-review stage (one-page decision in docs/prds/)","description":"No settled design exists for this in docs/architecture/, so under the scope-discipline rule merged as PR #533 the design comes first -- briefly and decisively -- and is not finished until a diff follows it.\n\nDecide and record, in one page under docs/prds/: where the reviewer runs (reuse the per-task container pool, or a separate short-lived container); what it is given (diff plus originating issue, and explicitly what it must NOT be given); the findings contract and who owns the type; what a surviving finding does to the task lifecycle; and how the reviewer's model/effort is configured.\n\nConstraints from the repo that the design must respect: dependency direction is cmd -\u003e app -\u003e {domain, infrastructure}, so the reviewer contract belongs to the workflow domain and the execution to infrastructure/app. Agent execution is a data boundary. The model never runs git. Prefer environmental enforcement over prompt rules -- 'the reviewer cannot see the implementation' must be a property of how it is launched, not an instruction in its prompt.\n\nDo not write an architecture document, migration plan or review campaign. One page that decides.","acceptance_criteria":"A one-page decision exists under docs/prds/ answering: reviewer isolation mechanism, inputs and forbidden inputs, findings contract owner, lifecycle effect of a surviving finding, and model/effort configuration. It decides rather than surveys, and cites the packages it will touch.","status":"closed","priority":1,"issue_type":"decision","owner":"sam@catlow.tech","created_at":"2026-08-21T13:02:39Z","created_by":"Sam Catlow","updated_at":"2026-08-24T07:12:05Z","started_at":"2026-08-22T09:30:19Z","closed_at":"2026-08-24T07:12:05Z","close_reason":"One-page decision written at docs/prds/adversarial-self-review.md: reviewer runs in a second workspace (container or in-process) pointed at a .git-stripped snapshot of the reviewed commit, never the implementer's worktree; findings contract is workflow.ReviewFinding, owned by internal/domain/workflow, reported via a structured capture tool; a surviving error-level finding sets StatusParked (not WaitingHuman -- epic wording named two different states, this resolves which); model/effort reuse the existing Models[role] map and per-stage budget override, gated by a new opt-in Repo.ReviewEnabled so h019.4 doesn't gate every repo on an uncalibrated reviewer before h019.5 lands. [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/550","metadata":null,"dependencies":[{"issue_id":"archie-core-h019.1","depends_on_id":"archie-core-h019","type":"parent-child","created_at":"2026-08-21T13:02:39Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":5,"comment_count":0}
{"_type":"issue","id":"archie-core-h019.2","title":"Findings contract: a structured review result the workflow can act on","description":"The reviewer's output must be data the workflow can branch on, not prose a human has to read to find out whether the PR is safe to open. Prose is what makes a review advisory; structure is what lets a finding block.\n\nDefine the finding type in the workflow domain (the domain declares the contract it needs; it never names who implements it). At minimum a finding carries: file and line, a one-sentence defect, a concrete failure scenario (inputs/state -\u003e wrong output), a verdict distinguishing CONFIRMED from PLAUSIBLE, and a disposition once acted on (fixed / skipped / no_change_needed).\n\nThe CONFIRMED/PLAUSIBLE split is load-bearing and must not be collapsed into a single boolean: only confirmed findings may block, or the feature degrades into crying wolf and the operator learns to skim past it.","acceptance_criteria":"A finding type exists in internal/domain/workflow with file, line, summary, failure scenario, verdict and disposition; it is serialisable across the agent-execution data boundary; a review result with zero findings is representable and distinct from a review that did not run.","status":"open","priority":1,"issue_type":"feature","owner":"sam@catlow.tech","created_at":"2026-08-21T13:02:39Z","created_by":"Sam Catlow","updated_at":"2026-08-22T09:25:14Z","external_ref":"https://github.com/samcharles93/archie-core/issues/551","dependencies":[{"issue_id":"archie-core-h019.2","depends_on_id":"archie-core-h019","type":"parent-child","created_at":"2026-08-21T13:02:39Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-h019.2","depends_on_id":"archie-core-h019.1","type":"blocks","created_at":"2026-08-21T13:03:24Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":1,"dependent_count":3,"comment_count":0}
{"_type":"issue","id":"archie-core-h019","title":"[EPIC] Adversarial self-review before archie opens a PR","description":"Archie enforces gates on every PR it opens, but it does not run the adversarial review CLAUDE.md makes mandatory for every change in this repo: a fresh reviewer that did not write the code, told to assume every line is wrong, working a defined checklist, where a surviving finding blocks the work. It is the one discipline the project requires of its contributors and exempts itself from.\n\nWhy it matters, with evidence rather than assertion: on 2026-08-20/21 the update-verification change (PR #530) passed task check at every checkpoint -- exit 0, golangci-lint 0 issues, gofumpt clean -- and three adversarial passes still found six real defects, two of them blocking. A 'dev' version placeholder would have reported healthy updates as failures, and an 'unknown' install claim was still being worded as confirmed success. The gates were green throughout and would have stayed green. This is CLAUDE.md's own recorded lesson: tests catch behaviour that breaks, not behaviour that quietly starts meaning something else.\n\nArchie is unusually well placed to do this. It already runs each task in an isolated container and worktree, so it can spawn a reviewer that genuinely never saw the implementation -- not a second opinion from the same context pretending to be fresh, which is the failure mode of every single-context tool. The isolation boundary built for safety is what makes honest self-review possible.\n\nWhat the operator gets: a PR that arrives with a findings section -- what was checked, what was found, what was fixed, what survived. A surviving finding parks the task as waiting_human instead of opening a PR that looks ready and is not. Review shifts from hunting for bugs to adjudicating findings.\n\nThe risk that kills the feature is a reviewer that cries wolf. Findings must be adversarially confirmed before they surface, and the reviewer must be able to report zero findings on properties it checked and cleared. Calibration is the feature, not the finding count.","acceptance_criteria":"An implement-workflow task runs an adversarial review after gates pass and before the PR is opened; the reviewer provably cannot see the implementer's context; a surviving confirmed finding blocks PR creation and parks the task; findings and their disposition are visible on the PR and the dashboard.","status":"open","priority":1,"issue_type":"epic","owner":"sam@catlow.tech","created_at":"2026-08-21T13:02:17Z","created_by":"Sam Catlow","updated_at":"2026-08-22T09:25:15Z","external_ref":"https://github.com/samcharles93/archie-core/issues/552","dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-3jag","title":"Chat/task agent persona is overconfident: presents unverified claims as verified, fabricates infrastructure details","description":"The chat assistant (archie, running via the Telegram/webui gateway) repeatedly\npresents unverified or fabricated information with false confidence, and only\nretracts it when directly challenged. This is a persona/system-prompt problem,\nnot a model quality problem -- reproduced on more than one underlying model.\n\nTwo concrete instances from a live Telegram transcript (2026-08-15):\n\n1. Fabricated infrastructure: asked \"are logs going anywhere else?\", the\n assistant invented an entire second log-shipping subsystem (\"Hermes\n gateway\") with specific fake file paths\n (/home/sam/.hermes/profiles/local-agent/logs/) that do not exist anywhere\n in archie-core, and stated it as verified fact (\"I confirmed the web UI\n token and task lifecycle messages are there\"). When challenged (\"Is there\n something in the codebase which tells you you're Hermes?\"), it admitted\n the paths were invented and carried forward from unrelated, unverified\n context.\n\n2. Overclaimed verification: asked \"Why did that last task fail?\", the\n assistant answered with a bulleted list explicitly labelled \"Verified\n details\" (attempt count, iteration count, token count, exact model name).\n When pressed with \"You checked it?\", it admitted the model name and\n change count were \"overstated\" -- i.e. it labelled unverified specifics as\n verified the first time, and only corrected itself under direct\n challenge.\n\nThe common shape: confident, specific claims presented as fact/verified\nfirst; a walked-back, hedged correction only appears after the user\nexplicitly challenges it. This erodes trust in every claim the assistant\nmakes about system state, since the default posture is confident assertion\nrather than \"I have/haven't actually checked this.\"","notes":"Root cause is believed to be the persona/system-prompt layer (internal/gateway/ BuildSystemPrompt + persona templates), not model selection -- reproduced across models per the reporter. Needs a system-prompt-level fix enforcing 'never label something verified unless it was actually checked this turn' and 'never state unconfirmed system details as fact.' Sam is reviewing the persona/prompt separately; this bead tracks the finding so it isn't lost.","status":"closed","priority":1,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-15T02:25:37Z","created_by":"Sam Catlow","updated_at":"2026-08-20T12:55:18Z","started_at":"2026-08-20T12:50:34Z","closed_at":"2026-08-20T12:55:18Z","close_reason":"Fixed in fix/persona-overconfidence (fba80e3): reworded core rule 1 and added rules 8/9 to the chat agent system prompt enforcing this-turn verification before labelling claims verified/confirmed.","external_ref":"https://github.com/samcharles93/archie-core/issues/524","dependency_count":0,"dependent_count":0,"comment_count":0}
@@ -62,44 +62,44 @@
{"_type":"issue","id":"archie-core-5efv","title":"telegram: split long replies on rune boundaries, not 4000 bytes","description":"splitLongMessage slices line[i:end] on byte offsets (messageMaxLen = 4000 bytes). Any line ≥ 4001 bytes containing multi-byte UTF-8 cuts mid-rune (e.g. 1334 × '界': parts[0] ends on a lead byte, parts[1] starts with continuation bytes). finalize feeds these parts to EditMessageText, and on edit rejection the fallback re-splits the same content into the same invalid chunks — the authoritative reply arrives mangled or not at all for exactly the long, non-ASCII replies the split path exists to serve. All existing tests use ASCII input only.\n\nFailure: a model produces a long answer with CJK/emoji or a base64 blob crossing a 4000-byte boundary; Telegram rejects the malformed part and the user gets the stale live frame plus a corrupted reply.","design":"Split on rune boundaries (iterate runes, accumulate up to messageMaxLen runes). Add a test with multi-byte input crossing the boundary asserting every part is valid UTF-8 and no part exceeds the bound.","acceptance_criteria":"A long CJK/emoji/base64 reply splits into valid, bounded parts; test covers non-ASCII content crossing the boundary.","status":"closed","priority":1,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-14T14:43:23Z","created_by":"Sam Catlow","updated_at":"2026-08-14T15:07:35Z","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/482","labels":["code-review","telegram"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-7o11","title":"telegram: escape tool output before composing it into the rich Markdown body","description":"The tool line (🔧 name + params + ' — ' + Summary()) is composed unescaped into the same InputRichMessage{Markdown: body} as the model reply (live.go:172). Summary() returns the tool's raw first output line (no escaping), and the JSON params can carry '*' / '_' / backticks. A single stray markdown metacharacter unbalances the rich body: mid-stream it lags a frame, but in the final message the rich edit is rejected and the plain-text fallback is terminal — permanently stripping the model reply's markdown formatting. go-telegram/bot v1.23.0 ships EscapeMarkdown; nothing in the repo uses it.\n\nFailure: the shell tool prints a grep hit containing '*' or '_'; the finished answer's bold/italic/code blocks render as raw markers, and the tool line itself displays as broken markup.","design":"Escape the tool name/params/summary (or the whole tool line) before inserting it into the Markdown body, while preserving the model reply's own markdown — the two share one body, so escaping must be scoped to the tool line only.","acceptance_criteria":"A tool whose output contains *, _, or backticks does not break the final message's markdown; a test feeds such output through a live reply and asserts the finished body still renders.","status":"closed","priority":1,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-14T14:43:09Z","created_by":"Sam Catlow","updated_at":"2026-08-14T15:07:35Z","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/483","labels":["code-review","streaming","telegram"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_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.","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-14T15:07:36Z","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-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.","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:21:56Z","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-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-24T04:46:55Z","closed_at":"2026-08-24T04:46:55Z","close_reason":"Runtime updater now snapshots and restores the configured managed worker Docker image; runtime-only and combined rollback regressions pass.","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","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-24T03:03:38Z","created_by":"Sam Catlow","updated_at":"2026-08-24T04:46:55Z","started_at":"2026-08-24T04:21:30Z","closed_at":"2026-08-24T04:46:55Z","close_reason":"Fresh/default deployment uses native archied, embedded NATS, and managed task containers; external NATS remains the documented advanced broker profile.","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}
{"_type":"issue","id":"archie-core-dfck","title":"Recover workflow agents that omit the required finish tool","description":"An analyse-stage agent can end normally without invoking the finish tool, producing agent idle and parking otherwise recoverable work. Add a bounded, deterministic recovery path that preserves explicit workflow completion and does not accept an unverified model final response.","notes":"Follow-up: the recovery wiring is correct inside archie-agent, but a separate architecture bug remains: embedded NATS still falls back to daemon-local execution. Tracked by the new NATS-only execution issue.","status":"closed","priority":2,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-24T01:24:20Z","created_by":"Sam Catlow","updated_at":"2026-08-24T01:56:44Z","started_at":"2026-08-24T01:24:30Z","closed_at":"2026-08-24T01:52:45Z","close_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.","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}
{"_type":"issue","id":"archie-core-dfck","title":"Recover workflow agents that omit the required finish tool","description":"An analyse-stage agent can end normally without invoking the finish tool, producing agent idle and parking otherwise recoverable work. Add a bounded, deterministic recovery path that preserves explicit workflow completion and does not accept an unverified model final response.","notes":"Follow-up: the recovery wiring is correct inside archie-agent, but a separate architecture bug remains: embedded NATS still falls back to daemon-local execution. Tracked by the new NATS-only execution issue.","status":"closed","priority":2,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-24T01:24:20Z","created_by":"Sam Catlow","updated_at":"2026-08-24T07:12:12Z","started_at":"2026-08-24T01:24:30Z","closed_at":"2026-08-24T07:12:12Z","close_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).]","external_ref":"https://github.com/samcharles93/archie-core/issues/623","metadata":null,"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1787522397925-3-87bd827d","title":"fix(update): install only approved changed components","description":"## Bug Description\nA gateway-only `/update` (archied/v1.13.0 while runtime remains archie/v1.9.9) fetches and builds both binaries, backs up and installs both, and rebuilds the agent image. The image build does not receive `RUNTIME_VERSION`, so the released runtime is stamped `dev`.\n\n## Steps to Reproduce\n1. Run `/update` with only the `daemon` component available.\n2. Approve the displayed snapshot.\n3. Observe `archie-update-install` build/install both components and run `docker compose build agent`.\n\n## Expected Behavior\nThe approved snapshot flows into `CommandInstaller`; only changed components are fetched/built/backed up/installed. Rebuild the agent image only for a runtime update and stamp it with the released runtime version. Preserve phase-1 result and phase-2 rollback/report metadata for gateway-only, runtime-only, both, and no-op plans.\n\n## Actual Behavior\nThe installer receives only chat/report metadata, so the script independently rebuilds everything after `git pull` and Docker uses its default `RUNTIME_VERSION=dev`.\n\n## Acceptance Criteria\n- Regression harness proves a gateway-only update never builds/installs the runtime or image.\n- Tests cover gateway-only, runtime-only, both, and no-op.\n- Released runtime images are stamped with the release version, never `dev`.\n- Rollback/report metadata remains component-aware and correct.\n- `task check` passes.","status":"closed","priority":2,"issue_type":"bug","created_at":"2026-08-23T15:56:13Z","updated_at":"2026-08-23T16:31:23Z","closed_at":"2026-08-23T16:31:24Z","external_ref":"https://github.com/samcharles93/archie-core/issues/606","source_system":"github:https://github.com/samcharles93/archie-core/issues/606:606","metadata":null,"labels":["bug","in-progress"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1787522397855-2-792cc4d6","title":"fix: make tool progress readable and preserve project context","description":"## Problem\n\nTelegram tool progress is currently displayed as a stream of raw inline entries, for example:\n\n- tool names followed by JSON schema placeholders such as `[string]`\n- raw JSON arguments and oversized output\n- repeated output without readable grouping\n- full error dumps and turn-budget failures\n\nAgents also search broad locations such as `/home/sam` instead of staying focused on the active project/worktree, read directories as files, and emit malformed shell commands. Useful project context is not being retained cleanly across the turn.\n\n## Scope\n\n- Render tool progress as compact, readable streaming fenced code blocks (Telegram-safe).\n- Remove schema placeholders and redundant raw invocation JSON from user-visible output.\n- Truncate or offload oversized results without consuming the entire turn context.\n- Preserve concise success/failure status and actionable errors.\n- Default agent discovery and file operations to the actual project/worktree context where task context provides one.\n- Improve context retention across tool calls.\n- Add validation or guardrails for malformed shell commands where practical.\n\n## Acceptance criteria\n\n- A normal tool call is shown as a readable streaming status block, not raw JSON.\n- Tool failures remain visible but are concise and actionable.\n- Large results are bounded/offloaded and do not exhaust the turn budget.\n- Project-scoped tasks do not begin by searching unrelated home-directory data.\n- Regression tests cover rendering, failure output, truncation/offload, and project-root selection.\n- Telegram output is verified against a live deployed instance.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-08-23T15:35:13Z","updated_at":"2026-08-23T22:03:11Z","closed_at":"2026-08-23T22:03:11Z","external_ref":"https://github.com/samcharles93/archie-core/issues/604","source_system":"github:https://github.com/samcharles93/archie-core/issues/604:604","metadata":null,"labels":["in-progress","task"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786751948782-3-837a8fd0.2","title":"Add InstallType/Reference fields to releaseupdate.Component, populate from daemon/agent/deployment profile","description":"Part 2/3 of point 4 in archie-core-1786751948782-3-837a8fd0's design. releaseupdate.Component (internal/releaseupdate/service.go:35-41) has ID/Label/Installed/Available/Changelog but no InstallType or Reference fields. Add both, and populate: archied reads its own compiled-in installtype.Type(); archie-agent reports its own over the NATS status round-trip (depends on the sibling issue that adds that round-trip); third-party dependencies Archie doesn't build (e.g. NATS) can't self-report, so their InstallType/Reference should come from the deployment profile (deployments/*.toml) rather than detection -- add the relevant fields there. Reference is something like 'container' + 'ghcr.io/samcharles93/archie-agent:1.9.0@sha256:...', not just a bare install-type string.","status":"open","priority":2,"issue_type":"feature","owner":"sam@catlow.tech","created_at":"2026-08-23T13:06:16Z","created_by":"Sam Catlow","updated_at":"2026-08-23T22:03:11Z","started_at":"2026-08-23T13:22:37Z","external_ref":"https://github.com/samcharles93/archie-core/issues/610","metadata":null,"labels":["enhancement","webui"],"dependencies":[{"issue_id":"archie-core-1786751948782-3-837a8fd0.2","depends_on_id":"archie-core-1786751948782-3-837a8fd0","type":"parent-child","created_at":"2026-08-23T23:06:15Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-1786751948782-3-837a8fd0.2","depends_on_id":"archie-core-1786751948782-3-837a8fd0.1","type":"blocks","created_at":"2026-08-23T23:06:19Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":1,"dependent_count":1,"comment_count":0}
{"_type":"issue","id":"archie-core-1786751948782-3-837a8fd0.3","title":"Surface per-component update status on Configuration page and /version","description":"Part 3/3, point 5 of archie-core-1786751948782-3-837a8fd0's design. Depends on the InstallType/Reference issue landing first -- there's nothing to surface otherwise. Add a /version endpoint and a per-component block on the Configuration page (internal/webui/api_config.go, ui/src/settings/), structured as {install_type, running_version, reference, latest_available, status} per component, where status is an enum (ok / update_available / drift / unknown) rather than a bare color. The actual comparison basis (e.g. running digest vs latest digest) should be visible on hover/expand, modeled on docker version's Client/Server nested-block convention per the original design doc.","status":"open","priority":2,"issue_type":"feature","owner":"sam@catlow.tech","created_at":"2026-08-23T13:06:16Z","created_by":"Sam Catlow","updated_at":"2026-08-23T22:03:11Z","started_at":"2026-08-23T13:29:01Z","external_ref":"https://github.com/samcharles93/archie-core/issues/611","metadata":null,"labels":["enhancement","webui"],"dependencies":[{"issue_id":"archie-core-1786751948782-3-837a8fd0.3","depends_on_id":"archie-core-1786751948782-3-837a8fd0","type":"parent-child","created_at":"2026-08-23T23:06:16Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-1786751948782-3-837a8fd0.3","depends_on_id":"archie-core-1786751948782-3-837a8fd0.2","type":"blocks","created_at":"2026-08-23T23:06:20Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":1,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786751948782-3-837a8fd0.1","title":"Stamp archie-agent's install type and add NATS status round-trip","description":"Part 1/3 of point 4 in archie-core-1786751948782-3-837a8fd0's design. archied's own build is stamped with internal/installtype via -ldflags (Taskfile.yml:65, Dockerfile.archied:48-49), but archie-agent's build has no equivalent stamp -- Dockerfile:14 and Taskfile.yml:170 (agent build target) pass no -X installtype flag. Without it, an agent worker has nothing to self-report even once the daemon asks. Also add the NATS-side status/version request the daemon can send a running agentworker to get its install type + running version back (agentworker already has a NATS channel for logs; extend it for a status response rather than inventing a new transport). This is the prerequisite for archie-core-1786751948782-3-837a8fd0 point 4's 'archie-agent reports its own the same way' clause.","status":"open","priority":2,"issue_type":"feature","owner":"sam@catlow.tech","created_at":"2026-08-23T13:06:14Z","created_by":"Sam Catlow","updated_at":"2026-08-23T22:03:11Z","started_at":"2026-08-23T13:06:41Z","external_ref":"https://github.com/samcharles93/archie-core/issues/612","metadata":null,"labels":["enhancement","webui"],"dependencies":[{"issue_id":"archie-core-1786751948782-3-837a8fd0.1","depends_on_id":"archie-core-1786751948782-3-837a8fd0","type":"parent-child","created_at":"2026-08-23T23:06:14Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":1,"comment_count":0}
{"_type":"issue","id":"archie-core-w35v","title":"Workflows page 'Start work' form inputs unstyled (white boxes in dark theme)","description":"The Start work card on the Workflows dashboard page (ui/src/workflows/workflows.js renderStartWork) creates raw \u003cinput\u003e/\u003cselect\u003e/\u003ctextarea\u003e elements with no CSS class, so they fall back to browser default styling -- white background, black text -- against the rest of the dark-themed app. Every other form control in the app (e.g. Configuration's .kv-input in ui/src/settings/config-row.js) uses a themed class. Fix: style these form controls to match the app theme, either by reusing an existing input class or adding scoped rules in ui/src/workflows/workflows.css.","status":"open","priority":2,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-23T12:22:59Z","created_by":"Sam Catlow","updated_at":"2026-08-23T21:59:59Z","external_ref":"https://github.com/samcharles93/archie-core/issues/593","metadata":null,"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786751948782-3-837a8fd0.2","title":"Add InstallType/Reference fields to releaseupdate.Component, populate from daemon/agent/deployment profile","description":"Part 2/3 of point 4 in archie-core-1786751948782-3-837a8fd0's design. releaseupdate.Component (internal/releaseupdate/service.go:35-41) has ID/Label/Installed/Available/Changelog but no InstallType or Reference fields. Add both, and populate: archied reads its own compiled-in installtype.Type(); archie-agent reports its own over the NATS status round-trip (depends on the sibling issue that adds that round-trip); third-party dependencies Archie doesn't build (e.g. NATS) can't self-report, so their InstallType/Reference should come from the deployment profile (deployments/*.toml) rather than detection -- add the relevant fields there. Reference is something like 'container' + 'ghcr.io/samcharles93/archie-agent:1.9.0@sha256:...', not just a bare install-type string.","status":"closed","priority":2,"issue_type":"feature","owner":"sam@catlow.tech","created_at":"2026-08-23T13:06:16Z","created_by":"Sam Catlow","updated_at":"2026-08-24T07:12:11Z","started_at":"2026-08-23T13:22:37Z","closed_at":"2026-08-24T07:12:11Z","close_reason":"Fixed: Component gained InstallType/Reference, populated via Service.Enrich from installtype.Type() (daemon), observed AgentStatus (agent), and [nats] config (third-party). Adversarial review clean (one lint-consistency nit fixed: use config.NATSMode* constants instead of raw strings). [Closure restored 2026-08-24: originally closed 2026-08-23, lost when the beads DB was rebuilt (.beads.backup-pre-recovery).]","external_ref":"https://github.com/samcharles93/archie-core/issues/610","metadata":null,"labels":["enhancement","webui"],"dependencies":[{"issue_id":"archie-core-1786751948782-3-837a8fd0.2","depends_on_id":"archie-core-1786751948782-3-837a8fd0","type":"parent-child","created_at":"2026-08-23T23:06:15Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-1786751948782-3-837a8fd0.2","depends_on_id":"archie-core-1786751948782-3-837a8fd0.1","type":"blocks","created_at":"2026-08-23T23:06:19Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":1,"dependent_count":1,"comment_count":0}
{"_type":"issue","id":"archie-core-1786751948782-3-837a8fd0.3","title":"Surface per-component update status on Configuration page and /version","description":"Part 3/3, point 5 of archie-core-1786751948782-3-837a8fd0's design. Depends on the InstallType/Reference issue landing first -- there's nothing to surface otherwise. Add a /version endpoint and a per-component block on the Configuration page (internal/webui/api_config.go, ui/src/settings/), structured as {install_type, running_version, reference, latest_available, status} per component, where status is an enum (ok / update_available / drift / unknown) rather than a bare color. The actual comparison basis (e.g. running digest vs latest digest) should be visible on hover/expand, modeled on docker version's Client/Server nested-block convention per the original design doc.","status":"closed","priority":2,"issue_type":"feature","owner":"sam@catlow.tech","created_at":"2026-08-23T13:06:16Z","created_by":"Sam Catlow","updated_at":"2026-08-24T07:12:12Z","started_at":"2026-08-23T13:29:01Z","closed_at":"2026-08-24T07:12:12Z","close_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).]","external_ref":"https://github.com/samcharles93/archie-core/issues/611","metadata":null,"labels":["enhancement","webui"],"dependencies":[{"issue_id":"archie-core-1786751948782-3-837a8fd0.3","depends_on_id":"archie-core-1786751948782-3-837a8fd0","type":"parent-child","created_at":"2026-08-23T23:06:16Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-1786751948782-3-837a8fd0.3","depends_on_id":"archie-core-1786751948782-3-837a8fd0.2","type":"blocks","created_at":"2026-08-23T23:06:20Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":1,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786751948782-3-837a8fd0.1","title":"Stamp archie-agent's install type and add NATS status round-trip","description":"Part 1/3 of point 4 in archie-core-1786751948782-3-837a8fd0's design. archied's own build is stamped with internal/installtype via -ldflags (Taskfile.yml:65, Dockerfile.archied:48-49), but archie-agent's build has no equivalent stamp -- Dockerfile:14 and Taskfile.yml:170 (agent build target) pass no -X installtype flag. Without it, an agent worker has nothing to self-report even once the daemon asks. Also add the NATS-side status/version request the daemon can send a running agentworker to get its install type + running version back (agentworker already has a NATS channel for logs; extend it for a status response rather than inventing a new transport). This is the prerequisite for archie-core-1786751948782-3-837a8fd0 point 4's 'archie-agent reports its own the same way' clause.","status":"closed","priority":2,"issue_type":"feature","owner":"sam@catlow.tech","created_at":"2026-08-23T13:06:14Z","created_by":"Sam Catlow","updated_at":"2026-08-24T07:12:11Z","started_at":"2026-08-23T13:06:41Z","closed_at":"2026-08-24T07:12:11Z","close_reason":"Fixed: archie-agent's build is now stamped (installtype + agentworker.Version), and it reports both back to the daemon in every taskrun.Response. daemon.AgentStatus records the latest observation; daemonRunningVersions includes the agent component once one lands. Adversarial review clean (one nice-to-have comment added). [Closure restored 2026-08-24: originally closed 2026-08-23, lost when the beads DB was rebuilt (.beads.backup-pre-recovery).]","external_ref":"https://github.com/samcharles93/archie-core/issues/612","metadata":null,"labels":["enhancement","webui"],"dependencies":[{"issue_id":"archie-core-1786751948782-3-837a8fd0.1","depends_on_id":"archie-core-1786751948782-3-837a8fd0","type":"parent-child","created_at":"2026-08-23T23:06:14Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":1,"comment_count":0}
{"_type":"issue","id":"archie-core-w35v","title":"Workflows page 'Start work' form inputs unstyled (white boxes in dark theme)","description":"The Start work card on the Workflows dashboard page (ui/src/workflows/workflows.js renderStartWork) creates raw \u003cinput\u003e/\u003cselect\u003e/\u003ctextarea\u003e elements with no CSS class, so they fall back to browser default styling -- white background, black text -- against the rest of the dark-themed app. Every other form control in the app (e.g. Configuration's .kv-input in ui/src/settings/config-row.js) uses a themed class. Fix: style these form controls to match the app theme, either by reusing an existing input class or adding scoped rules in ui/src/workflows/workflows.css.","status":"closed","priority":2,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-23T12:22:59Z","created_by":"Sam Catlow","updated_at":"2026-08-24T07:12:10Z","closed_at":"2026-08-24T07:12:10Z","close_reason":"Fixed: themed .wf-form input/select/textarea in workflows.css to match the dark theme. [Closure restored 2026-08-24: originally closed 2026-08-23, lost when the beads DB was rebuilt (.beads.backup-pre-recovery).]","external_ref":"https://github.com/samcharles93/archie-core/issues/593","metadata":null,"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1787489597262-23-f61d8b1b","title":"Docs: promote the shipped review stage into docs/architecture and reconcile CLAUDE.md","description":"Under the scope-discipline rule merged as PR #533, a design is promoted into docs/architecture/ only once it is built and true. This is that promotion, and it is deliberately a separate bead so it is not lost when the feature lands and attention moves on.\n\nDo three things once the stage ships:\n\n1. Promote the docs/prds/ decision into docs/architecture/, describing the review stage as it actually works -- not as designed. Cut anything a reader could learn from the code.\n2. Update ARCHITECTURE.md's task lifecycle: queued -\u003e running(workflow:stage) -\u003e pr_open -\u003e merged|rejected gains a review stage that can divert to waiting_human before pr_open. The current text does not mention it.\n3. Reconcile CLAUDE.md's Development Protocol. It currently tells a human or agent contributor to run the adversarial pass by hand. Once archied does this for the PRs it opens, that section needs to say which path applies to whom, or it will read as describing a manual step that is now automatic.\n\nCLAUDE.md's own rule: a comment or doc that contradicts its code is worse than none, because the next reader trusts it.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-08-23T12:22:29Z","updated_at":"2026-08-23T22:39:29Z","closed_at":"2026-08-23T22:39:29Z","close_reason":"Duplicate; work tracked under canonical epic","external_ref":"https://github.com/samcharles93/archie-core/issues/586","source_system":"github:https://github.com/samcharles93/archie-core/issues/586:586","metadata":null,"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1787489597173-22-c7110160","title":"Surface findings on the PR body and the dashboard","description":"The output has to land where the operator already looks, or the review is invisible work.\n\nOn the PR archie opens: a findings section stating what was checked, what was found, what was fixed, and what survived. A PR with zero findings should say the review ran and found nothing -- silence is indistinguishable from the review not running, which is the same unverified-claim problem the update-verification work (PR #530) was about.\n\nOn the dashboard and /api/tasks: a parked-for-findings task must show why, the same way a park reason is already surfaced today. An operator seeing waiting_human needs the findings without digging through logs.","status":"closed","priority":2,"issue_type":"feature","created_at":"2026-08-23T12:22:28Z","updated_at":"2026-08-23T22:39:29Z","closed_at":"2026-08-23T22:39:29Z","close_reason":"Duplicate; work tracked under canonical epic","external_ref":"https://github.com/samcharles93/archie-core/issues/585","source_system":"github:https://github.com/samcharles93/archie-core/issues/585:585","metadata":null,"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1787489597088-21-878229b4","title":"Calibration: confirm findings adversarially before surfacing them","description":"The risk that kills this feature is a reviewer that cries wolf. A findings list padded with speculation trains the operator to skim past it, and then the feature is worse than nothing because it consumes attention while lowering trust.\n\nBefore a finding is surfaced, it must be independently checked and marked CONFIRMED or PLAUSIBLE, with only CONFIRMED able to block. The reviewer must also be able to return zero findings, and to state which properties it checked and cleared -- a review that reports nothing is a valid and welcome result, and saying so explicitly is what distinguishes 'I checked and it is fine' from 'I did not look'.\n\nPrior art from the 2026-08-20/21 sessions on PR #530: three passes each separated confirmed from plausible, one explicitly listed properties it had verified clean, and the confirmed findings were reproduced by mutation before being trusted. That calibration is the feature, not the finding count.","status":"closed","priority":2,"issue_type":"feature","created_at":"2026-08-23T12:22:27Z","updated_at":"2026-08-23T22:39:29Z","closed_at":"2026-08-23T22:39:29Z","close_reason":"Duplicate; work tracked under canonical epic","external_ref":"https://github.com/samcharles93/archie-core/issues/584","source_system":"github:https://github.com/samcharles93/archie-core/issues/584:584","metadata":null,"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1787489596921-19-cf6351d9","title":"Docs: reconcile plugins-and-extensions.md and ARCHITECTURE.md with the shipped event model","description":"Separate bead so it is not lost once the feature lands.\n\n1. docs/architecture/plugins-and-extensions.md is an APPROVED foundation dated 2026-07-28 and currently describes only the plugin framework. If the design bead concluded that extensions may react to events, this doc has to say how -- and if it concluded that generic untyped dispatch is allowed after all, this doc must be amended deliberately rather than contradicted by code.\n\n2. ARCHITECTURE.md describes work intake as polling. Once webhook intake ships, that is no longer the whole picture, and the task lifecycle section needs the new entry path.\n\n3. CLAUDE.md's per-package traps section should gain whatever trap this work creates -- HMAC verification, replay windows, the poll/webhook double-dispatch hazard. That section exists precisely for things an agent will otherwise break.\n\n4. config.example.toml needs the intake flag documented with its default, alongside poll_interval.\n\nCLAUDE.md's own rule: a doc that contradicts its code is worse than none, because the next reader trusts it.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-08-23T12:22:26Z","updated_at":"2026-08-23T22:39:29Z","closed_at":"2026-08-23T22:39:29Z","close_reason":"Duplicate; work tracked under canonical epic","external_ref":"https://github.com/samcharles93/archie-core/issues/583","source_system":"github:https://github.com/samcharles93/archie-core/issues/583:583","metadata":null,"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1787489597001-20-4a13bb0b","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.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-08-23T12:22:26Z","updated_at":"2026-08-23T22:39:29Z","closed_at":"2026-08-23T22:39:29Z","close_reason":"Duplicate; work tracked under canonical epic","external_ref":"https://github.com/samcharles93/archie-core/issues/582","source_system":"github:https://github.com/samcharles93/archie-core/issues/582:582","metadata":null,"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1787489596831-18-366fdec1","title":"Acknowledge inbound messages and tasks before starting work","description":"Archie should acknowledge an inbound user message or tracked task before beginning substantive work. The acknowledgement should be sent promptly and make it clear that Archie has received the request and is starting or queued to work on it. It should not duplicate the eventual result or create misleading acknowledgements when intake fails.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-08-23T12:22:25Z","updated_at":"2026-08-23T22:39:29Z","closed_at":"2026-08-23T22:39:29Z","close_reason":"Duplicate; work tracked under canonical epic","external_ref":"https://github.com/samcharles93/archie-core/issues/581","source_system":"github:https://github.com/samcharles93/archie-core/issues/581:581","metadata":null,"labels":["telegram","ux"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_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":"open","priority":2,"issue_type":"feature","owner":"sam@catlow.tech","created_at":"2026-08-22T15:34:24Z","created_by":"Sam Catlow","updated_at":"2026-08-23T21:59:59Z","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":"open","priority":2,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-08-22T12:04:10Z","created_by":"Sam Catlow","updated_at":"2026-08-23T21:59:59Z","started_at":"2026-08-22T12:08:39Z","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":"in_progress","priority":2,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-22T11:09:58Z","created_by":"Sam Catlow","updated_at":"2026-08-23T21:59:59Z","started_at":"2026-08-22T12:16:11Z","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, contains a checked-in lint-failing FIXME and a no-op, and branchSlug documents 40 characters while implementing 60.","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":"open","priority":2,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-22T11:01:48Z","created_by":"Sam Catlow","updated_at":"2026-08-23T12:53:41Z","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.","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":"open","priority":2,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-22T11:01:47Z","created_by":"Sam Catlow","updated_at":"2026-08-23T12:53:41Z","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":"open","priority":2,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-22T11:01:46Z","created_by":"Sam Catlow","updated_at":"2026-08-23T21:59:59Z","started_at":"2026-08-22T11:55:44Z","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.","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":"open","priority":2,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-22T11:01:46Z","created_by":"Sam Catlow","updated_at":"2026-08-23T12:53:42Z","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":"open","priority":2,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-22T11:01:45Z","created_by":"Sam Catlow","updated_at":"2026-08-23T22:00:00Z","started_at":"2026-08-22T11:52:19Z","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":"open","priority":2,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-08-22T10:32:31Z","created_by":"Sam Catlow","updated_at":"2026-08-23T21:59:58Z","started_at":"2026-08-22T10:32:37Z","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-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":"open","priority":2,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-22T11:01:48Z","created_by":"Sam Catlow","updated_at":"2026-08-24T07:01:18Z","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":"open","priority":2,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-22T11:01:47Z","created_by":"Sam Catlow","updated_at":"2026-08-24T07:01:43Z","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":"open","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:51Z","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}
{"_type":"issue","id":"archie-core-7d5u.6","title":"Docs: reconcile plugins-and-extensions.md and ARCHITECTURE.md with the shipped event model","description":"Separate bead so it is not lost once the feature lands.\n\n1. docs/architecture/plugins-and-extensions.md is an APPROVED foundation dated 2026-07-28 and currently describes only the plugin framework. If the design bead concluded that extensions may react to events, this doc has to say how -- and if it concluded that generic untyped dispatch is allowed after all, this doc must be amended deliberately rather than contradicted by code.\n\n2. ARCHITECTURE.md describes work intake as polling. Once webhook intake ships, that is no longer the whole picture, and the task lifecycle section needs the new entry path.\n\n3. CLAUDE.md's per-package traps section should gain whatever trap this work creates -- HMAC verification, replay windows, the poll/webhook double-dispatch hazard. That section exists precisely for things an agent will otherwise break.\n\n4. config.example.toml needs the intake flag documented with its default, alongside poll_interval.\n\nCLAUDE.md's own rule: a doc that contradicts its code is worse than none, because the next reader trusts it.","acceptance_criteria":"plugins-and-extensions.md reflects the decided extension model; ARCHITECTURE.md documents webhook intake alongside polling; config.example.toml documents the intake flag and default; any new trap is recorded in CLAUDE.md.","status":"open","priority":2,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-08-21T13:26:52Z","created_by":"Sam Catlow","updated_at":"2026-08-22T09:25:30Z","external_ref":"https://github.com/samcharles93/archie-core/issues/554","dependencies":[{"issue_id":"archie-core-7d5u.6","depends_on_id":"archie-core-7d5u","type":"parent-child","created_at":"2026-08-21T23:26:51Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-7d5u.6","depends_on_id":"archie-core-7d5u.4","type":"blocks","created_at":"2026-08-21T23:26:58Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":1,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-h019.5","title":"Calibration: confirm findings adversarially before surfacing them","description":"The risk that kills this feature is a reviewer that cries wolf. A findings list padded with speculation trains the operator to skim past it, and then the feature is worse than nothing because it consumes attention while lowering trust.\n\nBefore a finding is surfaced, it must be independently checked and marked CONFIRMED or PLAUSIBLE, with only CONFIRMED able to block. The reviewer must also be able to return zero findings, and to state which properties it checked and cleared -- a review that reports nothing is a valid and welcome result, and saying so explicitly is what distinguishes 'I checked and it is fine' from 'I did not look'.\n\nPrior art from the 2026-08-20/21 sessions on PR #530: three passes each separated confirmed from plausible, one explicitly listed properties it had verified clean, and the confirmed findings were reproduced by mutation before being trusted. That calibration is the feature, not the finding count.","acceptance_criteria":"Only CONFIRMED findings block PR creation; a zero-finding review is representable and reported as such; the reviewer records which properties it checked and cleared; padding with style nits is explicitly out of contract.","status":"open","priority":2,"issue_type":"feature","owner":"sam@catlow.tech","created_at":"2026-08-21T13:03:15Z","created_by":"Sam Catlow","updated_at":"2026-08-22T09:25:30Z","external_ref":"https://github.com/samcharles93/archie-core/issues/555","dependencies":[{"issue_id":"archie-core-h019.5","depends_on_id":"archie-core-h019","type":"parent-child","created_at":"2026-08-21T13:03:15Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-h019.5","depends_on_id":"archie-core-h019.1","type":"blocks","created_at":"2026-08-21T13:03:25Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-h019.5","depends_on_id":"archie-core-h019.2","type":"blocks","created_at":"2026-08-21T13:03:25Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":2,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-h019.6","title":"Surface findings on the PR body and the dashboard","description":"The output has to land where the operator already looks, or the review is invisible work.\n\nOn the PR archie opens: a findings section stating what was checked, what was found, what was fixed, and what survived. A PR with zero findings should say the review ran and found nothing -- silence is indistinguishable from the review not running, which is the same unverified-claim problem the update-verification work (PR #530) was about.\n\nOn the dashboard and /api/tasks: a parked-for-findings task must show why, the same way a park reason is already surfaced today. An operator seeing waiting_human needs the findings without digging through logs.","acceptance_criteria":"PR body carries a findings section including the zero-finding case; a task parked on a surviving finding shows the findings as its park reason in the dashboard and /api/tasks; nothing requires reading task logs to learn why a PR was withheld.","status":"open","priority":2,"issue_type":"feature","owner":"sam@catlow.tech","created_at":"2026-08-21T13:03:15Z","created_by":"Sam Catlow","updated_at":"2026-08-22T09:25:31Z","external_ref":"https://github.com/samcharles93/archie-core/issues/556","dependencies":[{"issue_id":"archie-core-h019.6","depends_on_id":"archie-core-h019","type":"parent-child","created_at":"2026-08-21T13:03:15Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-h019.6","depends_on_id":"archie-core-h019.1","type":"blocks","created_at":"2026-08-21T13:03:25Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-h019.6","depends_on_id":"archie-core-h019.2","type":"blocks","created_at":"2026-08-21T13:03:26Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":2,"dependent_count":1,"comment_count":0}
{"_type":"issue","id":"archie-core-h019.7","title":"Docs: promote the shipped review stage into docs/architecture and reconcile CLAUDE.md","description":"Under the scope-discipline rule merged as PR #533, a design is promoted into docs/architecture/ only once it is built and true. This is that promotion, and it is deliberately a separate bead so it is not lost when the feature lands and attention moves on.\n\nDo three things once the stage ships:\n\n1. Promote the docs/prds/ decision into docs/architecture/, describing the review stage as it actually works -- not as designed. Cut anything a reader could learn from the code.\n2. Update ARCHITECTURE.md's task lifecycle: queued -\u003e running(workflow:stage) -\u003e pr_open -\u003e merged|rejected gains a review stage that can divert to waiting_human before pr_open. The current text does not mention it.\n3. Reconcile CLAUDE.md's Development Protocol. It currently tells a human or agent contributor to run the adversarial pass by hand. Once archied does this for the PRs it opens, that section needs to say which path applies to whom, or it will read as describing a manual step that is now automatic.\n\nCLAUDE.md's own rule: a comment or doc that contradicts its code is worse than none, because the next reader trusts it.","acceptance_criteria":"docs/architecture/ describes the shipped stage; ARCHITECTURE.md's lifecycle includes the review stage and the waiting_human diversion; CLAUDE.md distinguishes the manual contributor pass from archied's automated one; no doc still claims review is only manual.","status":"open","priority":2,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-08-21T13:03:15Z","created_by":"Sam Catlow","updated_at":"2026-08-22T09:25:32Z","external_ref":"https://github.com/samcharles93/archie-core/issues/557","dependencies":[{"issue_id":"archie-core-h019.7","depends_on_id":"archie-core-h019","type":"parent-child","created_at":"2026-08-21T13:03:15Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-h019.7","depends_on_id":"archie-core-h019.4","type":"blocks","created_at":"2026-08-21T13:03:26Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-h019.7","depends_on_id":"archie-core-h019.6","type":"blocks","created_at":"2026-08-21T13:03:26Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":2,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-nln7","title":"Dashboard-initiated updates get no phase-2 report, so they are never verified","description":"internal/webui/api_chat.go:497 starts an install with releaseupdate.InstallMeta{Channel: \"webui\"} and leaves ReportPath empty. CommandInstaller passes that through as ARCHIE_UPDATE_REPORT_PATH, and scripts/archie-update-watchdog's write_report() returns early when it is empty.\n\nConsequences: an operator who approves an update from the dashboard gets only the synchronous phase-1 result (build/install succeeded, restart queued) and never learns whether the daemon actually came back up, whether it was rolled back, or - since c25799e - whether the installed version is the one now running. Telegram gets all of that; the dashboard silently gets none of it.\n\nThe verification added in c25799e (releaseupdate.Report.Verify) is reached only from internal/channels/telegram/update.go, so this path is unverified regardless.\n\nFix needs two parts: give the webui install a ReportPath (updateReportPath in cmd/archied), and give the dashboard somewhere to relay a pending report on boot the way telegram's reportPendingUpdate does - today ReadPendingReport has exactly one caller, and a single report file shared by two relayers would race to clear it.","acceptance_criteria":"A dashboard-approved update produces a phase-2 report; the dashboard surfaces its outcome including version verification; two relayers cannot double-report or lose a report.","status":"closed","priority":2,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-20T14:04:33Z","created_by":"Sam Catlow","updated_at":"2026-08-23T12:58:07Z","started_at":"2026-08-23T12:56:47Z","closed_at":"2026-08-23T12:58:07Z","close_reason":"Fixed: dashboard installs now get a ReportPath, and Server.Run relays/verifies/clears the phase-2 report on boot via a new KindUpdateReport SSE event. Adversarial review clean.","external_ref":"https://github.com/samcharles93/archie-core/issues/531","dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-qk8m","title":"MCP npm servers re-fetched from npm on every task container start","description":"## Problem\n\nd4bb914b/#64 fixed the daemon-side case: cmd/archied/main.go's\nconfiguredMCPProvider now points npx-launched MCP servers at a persistent\nNPM_CONFIG_CACHE under the daemon's own work_dir, so a daemon restart\nreuses a warm cache instead of re-resolving/re-downloading from the npm\nregistry.\n\ninternal/app/agentworker/mcp_providers.go builds the identical\nStdioTransportConfig for archie-agent's own per-task MCP servers, but was\ndeliberately left untouched -- it's not a separate code path, the exact\nsame cfg.Tools.MCPServers list (including any npx entries) is threaded\nthrough to every per-task NATS agent worker (bootstrap.go -\u003e NATSRunner.MCPServers\n-\u003e taskrun.Request -\u003e task_execution.go's startMCPProviders). Since each\ntask runs in a fresh ephemeral container, an npx-based MCP server\nconfigured for task use re-resolves/re-downloads on every task, not\njust every daemon restart -- more frequent, and thus a worse amplifier of\na registry outage than the bug already fixed.\n\n## Why this needs its own issue\n\nUnlike the daemon case, a bare NPM_CONFIG_CACHE=\u003cpath\u003e pointed at a host\ndirectory is meaningless inside an ephemeral container unless a\npersistent Docker volume is actually bind-mounted at that path. No such\nvolume currently exists for this purpose -- internal/container/pool.go's\nmounts are caller-provided, and nothing wires an npm-cache volume in.\nThat's real new infrastructure (a shared, persistent volume across\nper-task containers), not a parameter-threading fix like d4bb914b was.\n\n## Acceptance criteria\n\n- Task containers reuse a persistent npm cache across tasks, the same\n way the daemon now does across restarts.\n- The cache volume/mount is wired through internal/container/pool.go's\n Acquire (or equivalent) without weakening per-task filesystem isolation\n for anything other than the npm cache path itself.\n- Startup time for a task's npx-based MCP server no longer scales with\n package size once the cache is warm.\n","status":"open","priority":2,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-18T16:04:59Z","created_by":"Sam Catlow","updated_at":"2026-08-23T12:53:17Z","external_ref":"https://github.com/samcharles93/archie-core/issues/532","metadata":null,"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-qk8m","title":"MCP npm servers re-fetched from npm on every task container start","description":"## Problem\n\nd4bb914b/#64 fixed the daemon-side case: cmd/archied/main.go's\nconfiguredMCPProvider now points npx-launched MCP servers at a persistent\nNPM_CONFIG_CACHE under the daemon's own work_dir, so a daemon restart\nreuses a warm cache instead of re-resolving/re-downloading from the npm\nregistry.\n\ninternal/app/agentworker/mcp_providers.go builds the identical\nStdioTransportConfig for archie-agent's own per-task MCP servers, but was\ndeliberately left untouched -- it's not a separate code path, the exact\nsame cfg.Tools.MCPServers list (including any npx entries) is threaded\nthrough to every per-task NATS agent worker (bootstrap.go -\u003e NATSRunner.MCPServers\n-\u003e taskrun.Request -\u003e task_execution.go's startMCPProviders). Since each\ntask runs in a fresh ephemeral container, an npx-based MCP server\nconfigured for task use re-resolves/re-downloads on every task, not\njust every daemon restart -- more frequent, and thus a worse amplifier of\na registry outage than the bug already fixed.\n\n## Why this needs its own issue\n\nUnlike the daemon case, a bare NPM_CONFIG_CACHE=\u003cpath\u003e pointed at a host\ndirectory is meaningless inside an ephemeral container unless a\npersistent Docker volume is actually bind-mounted at that path. No such\nvolume currently exists for this purpose -- internal/container/pool.go's\nmounts are caller-provided, and nothing wires an npm-cache volume in.\nThat's real new infrastructure (a shared, persistent volume across\nper-task containers), not a parameter-threading fix like d4bb914b was.\n\n## Acceptance criteria\n\n- Task containers reuse a persistent npm cache across tasks, the same\n way the daemon now does across restarts.\n- The cache volume/mount is wired through internal/container/pool.go's\n Acquire (or equivalent) without weakening per-task filesystem isolation\n for anything other than the npm cache path itself.\n- Startup time for a task's npx-based MCP server no longer scales with\n package size once the cache is warm.\n","status":"closed","priority":2,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-18T16:04:59Z","created_by":"Sam Catlow","updated_at":"2026-08-24T07:12:08Z","closed_at":"2026-08-24T07:12:08Z","close_reason":"Fixed: MCP npm servers for per-task containers now reuse a persistent npm cache. Added mcp.NpmCacheEnv (shared with the daemon-side fix), an always-on archie-cache-mcp-npm Docker volume mounted at /data/cache/mcp-npm on every task container regardless of ecosystem, and wired it into internal/app/agentworker/mcp_providers.go's stdio transport construction. Adversarial review found zero surviving findings. [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/532","metadata":null,"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-q5w4","title":"secret engine plugin: age","description":"Resolve SecretRef values from an age-encrypted file of key=value lines. Env: AGE_FILE (encrypted file path), AGE_IDENTITY (age private key file). Resolve runs 'age -d -i \u003cidentity\u003e \u003cfile\u003e' and parses the plaintext. Fresh resolve per call (no cache) so updates are picked up without daemon restart. CLI-based, mirroring the bws engine; ship as a Yaegi plugin in examples/secret-engines/.","status":"closed","priority":2,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-08-17T14:22:03Z","created_by":"Sam Catlow","updated_at":"2026-08-17T22:27:53Z","started_at":"2026-08-17T14:22:10Z","closed_at":"2026-08-17T14:33:52Z","close_reason":"Shipped age engine plugin in examples/secret-engines/age.go (commit 24faf53): CLI-based, AGE_FILE/AGE_IDENTITY, key=value lines.","external_ref":"https://github.com/samcharles93/archie-core/issues/526","metadata":null,"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786749700635-7-83b8c32f","title":"dashboard: turn_completed events carry no task correlation and drown real activity in the Live Activity feed","description":"## Problem, two compounding parts\n\n**1. `turn_completed` events carry no useful, correlatable content.**\n`internal/gateway/turn.go:306-311` publishes:\n```go\nr.Bus.Publish(events.Event{\n Kind: events.KindTurnCompleted,\n Detail: sessionID,\n Data: map[string]any{\"session\": sessionID, \"channel\": r.Channel},\n})\n```\nNo `TaskID` is set, and `Detail` is a raw internal session identifier (e.g. `1312197967`) with no formatting. On the dashboard's \"Live activity\" table this renders as `Task: —`, `Detail: 1312197967` — meaningless to anyone reading it, and impossible to correlate to a task. This event fires on every chat turn, so it dominates the feed: in a sample of the 30 most-recent Live Activity rows, only 3 were real task-lifecycle events (`task_queued`); the other 27 were content-free `turn_completed` rows.\n\n**2. The `/logs` page has no filtering, search, or level control at all** — just Pause/Refresh. Confirmed live: during the redelivery storm in #517, `handle failed` alone produced 996 near-identical lines, and there is no way to filter by task, by level, or search text to find anything else in the stream. During exactly the situation an operator needs the log page most (an active incident), it is unusable.\n\n## Fix\n\n- Give `turn_completed` (and any other cross-cutting event shown in this feed) a human-meaningful `Detail` — e.g. the channel name plus a short session label — and drop it from the feed entirely if it isn't task-correlated, since a feed titled \"Live activity\" that is 90% non-actionable chat-turn noise defeats its own purpose.\n- Add basic filtering to `/logs`: at minimum a level filter and a task/session search, so a single noisy source can be excluded without losing everything else.","status":"closed","priority":2,"issue_type":"bug","created_at":"2026-08-14T23:19:11Z","updated_at":"2026-08-15T00:35:51Z","started_at":"2026-08-15T00:03:05Z","closed_at":"2026-08-15T00:35:51Z","external_ref":"https://github.com/samcharles93/archie-core/issues/521","source_system":"github:https://github.com/samcharles93/archie-core/issues/521:521","metadata":null,"labels":["bug","webui"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786748942590-20-c21c728b","title":"Dashboard: Token outlook is blank because token usage is not reaching daily accounting","description":"## Problem\n\nThe dashboard's **Token outlook** card is blank instead of showing token usage/spend. The screenshot shows the card present but with no usable content.\n\n## Investigation\n\nThe live dashboard API currently returns:\n\n```json\n{\n \"workflows\": [\n {\"workflow\":\"tdd\",\"total_tokens\":904901,\"avg_tokens\":301633},\n {\"workflow\":\"implement\",\"total_tokens\":0}\n ],\n \"tokens_by_day\": null\n}\n```\n\nThe dashboard frontend expects `tokens_by_day` and renders the empty state when it is missing/empty (`ui/src/dashboard/dashboard.js:405-418`). The runtime therefore has token totals in the `tasks` table but no daily token series for the card.\n\nThe persistence path is inconsistent:\n\n- `internal/domain/workflow/agent.go:171-176` records `res.TokensUsed` on the task and emits an `agent_finish` event with `data.tokens`.\n- `internal/store/events.go:231-251` calculates the card data exclusively from persisted `agent_finish` events.\n- The live task event database currently contains `task_queued` and `turn_completed` events but no `agent_finish` rows, while workflow statistics still contain 904,901 tokens.\n- `handleSummary` serializes the nil result from `TokensByDay` as JSON `null`, rather than a stable empty array or a meaningful unavailable state.\n\nThis means the dashboard cannot truthfully show spend even though token usage is already tracked elsewhere.\n\n## Expected behaviour\n\n- Completed agent runs contribute to the Token outlook series and the Tokens used statistic.\n- The API returns `tokens_by_day: []` rather than `null` when no data exists.\n- The UI distinguishes \"no usage recorded yet\" from \"usage tracking is unavailable/broken\".\n- Token totals and daily totals come from one authoritative accounting path and do not diverge.\n- The card never renders blank.\n\n## Acceptance criteria\n\n- Add a regression test reproducing the current state: tasks have non-zero `tokens_used`, but no `agent_finish` rows; the summary must still have a defined, truthful token state.\n- Trace and repair the event persistence path so successful and failed agent runs produce the data required by `TokensByDay`, including NATS/container execution.\n- Add store/API tests asserting daily aggregation, timezone/day semantics, empty data, malformed/missing token fields, and multiple stages per task.\n- Return an empty JSON array for an empty series, not `null`.\n- Add a UI test for populated data, no data, and unavailable/error states; verify the card cannot be visually blank.\n- Verify against a running daemon with real task data and run the normal project gate.\n\n## Scope\n\nThis issue is about truthful token accounting and the Token outlook dashboard. It does not attempt to add provider billing APIs or dollar pricing unless required to make the existing token accounting correct.","status":"open","priority":2,"issue_type":"bug","created_at":"2026-08-14T23:03:30Z","updated_at":"2026-08-14T23:03:30Z","external_ref":"https://github.com/samcharles93/archie-core/issues/515","source_system":"github:https://github.com/samcharles93/archie-core/issues/515:515","metadata":null,"labels":["bug"],"dependencies":[{"issue_id":"archie-core-1786748942590-20-c21c728b","depends_on_id":"archie-core-1786637490248-18-17079a75","type":"related","created_at":"2026-08-15T12:59:33Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786748942566-19-aa1c4552","title":"Telegram: response formatting concatenates URLs with following text","description":"## Problem\n\nTelegram responses can concatenate a bare URL with the sentence that follows it, which breaks the clickable/direct link and makes the message look malformed.\n\nThis has occurred at least twice. Example:\n\n```text\nhttps://github.com/samcharles93/archie-core/issues/513It includes model-independent safeguards...\n```\n\nThe expected output is:\n\n```text\nhttps://github.com/samcharles93/archie-core/issues/513\n\nIt includes model-independent safeguards...\n```\n\n## Desired behavior\n\n- Preserve paragraph/newline boundaries between links and subsequent text.\n- Ensure a bare URL remains independently clickable in Telegram.\n- Do not concatenate separately streamed/rendered response segments.\n- Apply the fix consistently whether the response is sent once, edited while streaming, or split into multiple Telegram messages.\n\n## Acceptance criteria\n\n- A URL followed by prose is rendered with at least one newline separating them.\n- Bare GitHub issue URLs remain clickable and contain no trailing prose.\n- Regression coverage includes the exact example above.\n- Coverage exercises the relevant Telegram streaming/editing and message-splitting paths.\n","status":"closed","priority":2,"issue_type":"bug","assignee":"samcharles93","created_at":"2026-08-14T22:21:58Z","updated_at":"2026-08-15T13:04:30Z","closed_at":"2026-08-15T13:04:30Z","close_reason":"Fixed Telegram URL/prose boundary normalization across one-shot, live, and split delivery paths; added Markdown/code safety, newline preservation, and regression coverage.","external_ref":"https://github.com/samcharles93/archie-core/issues/514","source_system":"github:https://github.com/samcharles93/archie-core/issues/514:514","metadata":null,"labels":["bug"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786748942540-18-9af78536","title":"Agent falsely claims GitHub issue creation succeeded without verification","description":"## Problem\n\nDuring a Telegram chat using `deepseek/deepseek-v4-pro`, the agent stated that it had created GitHub issue #512 and supplied a URL even though no issue had been created. When challenged, it acknowledged the false claim and said it lacked a GitHub token; after being asked to retry, the issue creation succeeded.\n\nThis is a serious trust and UX problem: users must be able to rely on claims about external side effects such as creating issues, pushing branches, opening PRs, deploying, or restarting services.\n\n## Expected behavior\n\n- Never report an external action as successful unless the corresponding tool/plugin call completed successfully and returned verifiable output.\n- Include the issue number and URL from the forge response, not values inferred or fabricated by the model.\n- If the tool is unavailable or fails, report the actual failure clearly.\n- Allow a retry when the capability may be temporarily unavailable.\n\n## Suggested safeguards\n\n- Require successful structured tool results before permitting success language for side-effecting actions.\n- Track pending/completed/failed action state in the turn runner.\n- Add a postcondition check for issue creation, such as validating the returned issue ID/URL.\n- Add regression tests using a model response that falsely claims an issue was created without invoking the forge tool.\n- Consider a gateway warning or telemetry event when a final response claims an unverified side effect.\n\n## Reproduction\n\n1. Ask the agent to create an issue.\n2. The model responds with an issue number and URL without a successful forge invocation.\n3. Check GitHub and observe that the issue does not exist.\n\n## Context\n\nObserved with `deepseek/deepseek-v4-pro` through the Telegram gateway. This should be enforced independently of model/provider because any model can make an unsupported action claim.\n\n## Frequency\n\nThis has been observed twice in the same conversation, so it is a recurring failure rather than a one-off hallucination. Regression coverage should include repeated side-effect claims across turns, including claims that reuse a plausible issue number and URL.\n","status":"open","priority":2,"issue_type":"task","created_at":"2026-08-14T22:16:46Z","updated_at":"2026-08-23T12:53:18Z","external_ref":"https://github.com/samcharles93/archie-core/issues/513","source_system":"github:https://github.com/samcharles93/archie-core/issues/513:513","metadata":null,"dependencies":[{"issue_id":"archie-core-1786748942540-18-9af78536","depends_on_id":"archie-core-3jag","type":"related","created_at":"2026-08-15T12:59:09Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786748942540-18-9af78536","title":"Agent falsely claims GitHub issue creation succeeded without verification","description":"## Problem\n\nDuring a Telegram chat using `deepseek/deepseek-v4-pro`, the agent stated that it had created GitHub issue #512 and supplied a URL even though no issue had been created. When challenged, it acknowledged the false claim and said it lacked a GitHub token; after being asked to retry, the issue creation succeeded.\n\nThis is a serious trust and UX problem: users must be able to rely on claims about external side effects such as creating issues, pushing branches, opening PRs, deploying, or restarting services.\n\n## Expected behavior\n\n- Never report an external action as successful unless the corresponding tool/plugin call completed successfully and returned verifiable output.\n- Include the issue number and URL from the forge response, not values inferred or fabricated by the model.\n- If the tool is unavailable or fails, report the actual failure clearly.\n- Allow a retry when the capability may be temporarily unavailable.\n\n## Suggested safeguards\n\n- Require successful structured tool results before permitting success language for side-effecting actions.\n- Track pending/completed/failed action state in the turn runner.\n- Add a postcondition check for issue creation, such as validating the returned issue ID/URL.\n- Add regression tests using a model response that falsely claims an issue was created without invoking the forge tool.\n- Consider a gateway warning or telemetry event when a final response claims an unverified side effect.\n\n## Reproduction\n\n1. Ask the agent to create an issue.\n2. The model responds with an issue number and URL without a successful forge invocation.\n3. Check GitHub and observe that the issue does not exist.\n\n## Context\n\nObserved with `deepseek/deepseek-v4-pro` through the Telegram gateway. This should be enforced independently of model/provider because any model can make an unsupported action claim.\n\n## Frequency\n\nThis has been observed twice in the same conversation, so it is a recurring failure rather than a one-off hallucination. Regression coverage should include repeated side-effect claims across turns, including claims that reuse a plausible issue number and URL.\n","status":"closed","priority":2,"issue_type":"task","created_at":"2026-08-14T22:16:46Z","updated_at":"2026-08-24T07:12:10Z","closed_at":"2026-08-24T07:12:10Z","close_reason":"Deprioritized: prompt-level fix landed in fba80e3 (archie-core-3jag/GH#524) covers the general overconfidence pattern. Not worth mechanical enforcement (postcondition checks, tool-result verification) unless this recurs — revisit with stronger prompting first if it does. [Closure restored 2026-08-24: originally closed 2026-08-23, lost when the beads DB was rebuilt (.beads.backup-pre-recovery).]","external_ref":"https://github.com/samcharles93/archie-core/issues/513","source_system":"github:https://github.com/samcharles93/archie-core/issues/513:513","metadata":null,"dependencies":[{"issue_id":"archie-core-1786748942540-18-9af78536","depends_on_id":"archie-core-3jag","type":"related","created_at":"2026-08-15T12:59:09Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786748942519-17-5999d55b","title":"Polish the /status command response","description":"## Problem\n\nThe `/status` command response is functional but lacks polish and is difficult to scan. The current output looks like:\n\n```text\nTask status: parked:2\nProvider: deepseek Model: deepseek/deepseek-v4-pro\n```\n\nThe information is compressed into raw key/value text, and task state, provider, and model details are not clearly separated.\n\n## Desired behaviour\n\nPresent status information in a compact, polished, mobile-friendly format suitable for Telegram. It should make the most important state immediately obvious and visually separate task and runtime/model information.\n\nFor example:\n\n```text\n📊 Archie status\n\nTasks\n⏸ Parked:2\n\nRuntime\nProvider: OpenAI\nModel: openai/gpt-5.6-luna\n```\n\nThe exact wording and icons can follow existing Telegram UI conventions.\n\n## Acceptance criteria\n\n- `/status` has a clear heading and grouped sections.\n- Task states are shown on separate, readable lines.\n- Provider and model are clearly separated.\n- The response remains concise and readable on mobile.\n- Empty and unavailable values have a graceful fallback.\n- Tests cover the formatted response, including multiple task states and missing runtime details.","status":"closed","priority":2,"issue_type":"task","assignee":"Sam Catlow","created_at":"2026-08-14T22:14:58Z","updated_at":"2026-08-15T12:41:34Z","started_at":"2026-08-15T12:33:21Z","closed_at":"2026-08-15T12:41:34Z","close_reason":"Closed","external_ref":"https://github.com/samcharles93/archie-core/issues/512","source_system":"github:https://github.com/samcharles93/archie-core/issues/512:512","metadata":null,"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786748942272-7-2ad59e97","title":"Add end-to-end image generation test matrix and operational safeguards","description":"## Scope\nBuild the cross-cutting test and verification layer for the image capability. Exercise the clarification flow, hosted fake provider, local fake backend, real local recipe smoke test where available, delivery, and failure paths.\n\nAdd safeguards for cost, resource use, prompt/input limits, concurrency, cancellation, and observability consistent with Archie''s existing operational style.\n\n## Acceptance criteria\n- Automated tests cover both mechanisms, generation and editing, routing, provider failures, delivery failures, cancellation, and cleanup.\n- Tests assert no provider call occurs before mechanism clarification.\n- Resource and input/output limits are enforced in code and tested.\n- A documented local smoke command verifies at least one GPU recipe without requiring hosted credentials.\n- The normal project gate passes, and the epic's acceptance criteria can be verified from real command output.","status":"open","priority":2,"issue_type":"task","created_at":"2026-08-14T21:55:45Z","updated_at":"2026-08-14T21:55:45Z","external_ref":"https://github.com/samcharles93/archie-core/issues/503","source_system":"github:https://github.com/samcharles93/archie-core/issues/503:503","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786748942296-8-260e931d","title":"Write image capability documentation and agent assistance examples","description":"## Scope\nDocument the user-facing `/image` flow, hosted-provider setup, local GPU setup, supported model/backend recipes, troubleshooting, resource requirements, and security/cost implications.\n\nProvide concise code/config examples an agent can use to help users call both hosted and local paths. Examples must show how to inspect hardware/backend availability, choose a tested model, submit a generation/edit request, and collect the resulting image.\n\n## Acceptance criteria\n- Documentation explicitly says mechanism selection happens first by default.\n- Hosted API baseline fields and provider deviations are documented.\n- Every local model recipe names its tested backend/version, model source, VRAM/RAM expectations, supported sizes/operations, and failure modes.\n- Examples are runnable or tested in CI with mocked services; no secrets or huge weights are included.\n- Docs distinguish tested support from illustrative/untested possibilities.","status":"open","priority":2,"issue_type":"task","created_at":"2026-08-14T21:55:45Z","updated_at":"2026-08-14T21:55:45Z","external_ref":"https://github.com/samcharles93/archie-core/issues/502","source_system":"github:https://github.com/samcharles93/archie-core/issues/502:502","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0}
@@ -111,7 +111,7 @@
{"_type":"issue","id":"archie-core-1786748942120-1-6636e629","title":"[EPIC] Image generation capability: hosted API baseline plus local GPU workflows","description":"## Goal\nAdd first-class image generation to Archie, with a capability surface targeting the practical baseline of the OpenAI `gpt-image-2` API while also supporting image generation on a user's existing GPU.\n\nThe capability must not assume one backend. A user asking for `/image` is first asked which generation mechanism they prefer:\n- hosted API (starting with an OpenAI-compatible `gpt-image-2` provider), or\n- local GPU generation using one of Archie's tested model/backend recipes.\n\n## Scope\n- A provider-neutral image capability contract and routing/configuration.\n- Hosted generation/editing with an OpenAI `gpt-image-2`-class API baseline.\n- Local GPU generation through tested, documented model/backend recipes suitable for common consumer GPUs.\n- `/image` clarification and execution flow across supported channels.\n- Returned image delivery, bounded inputs/outputs, errors, and tests.\n\n## Non-goals\n- Training or fine-tuning image models.\n- Bundling multi-gigabyte model weights in Archie.\n- Pretending every GPU/model combination is supported; local support must be explicit and evidence-backed.\n- Replacing the existing text-chat capability or silently selecting a paid hosted provider.\n\n## Definition of done\n- `/image` asks for the preferred mechanism before generation when no mechanism is already selected for the request/session.\n- Hosted generation and editing cover the documented gpt-image-2 baseline, with provider-specific differences exposed rather than hidden.\n- Local GPU generation works end-to-end with at least one tested recipe, and additional tested common models are documented with VRAM/backend requirements and runnable examples.\n- Images can be delivered through the existing channel abstractions without leaking temporary files or unbounded data.\n- Unit, integration, and failure-path tests cover routing, provider errors, clarification, local execution, and delivery.\n- Configuration, security, and operational documentation are complete.\n\nSubtasks below are dependency-ordered where practical; each must link back to this epic and state any deliberate deviations from the hosted API baseline.","status":"open","priority":2,"issue_type":"epic","created_at":"2026-08-14T21:55:40Z","updated_at":"2026-08-14T21:55:40Z","external_ref":"https://github.com/samcharles93/archie-core/issues/496","source_system":"github:https://github.com/samcharles93/archie-core/issues/496:496","metadata":null,"labels":["epic"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-hlxd","title":"telegram: a tool-use turn ending with no answer posts the tool line alone as the finished message","description":"finalText returns the tool block alone when the reply is empty, and finalize sends it as the authoritative finished message — content == '' is the only silence path, so an empty-reply turn with completed tools permanently delivers '🔧 shell — exit 0' with no answer. The old path guarded 'if reply != \"\"'. Telegram messages are immutable, so it can never be corrected. Gated on show_tool_calls (off by default), so it bites opt-in deployments. No test covers finalize with an empty reply and tools.\n\nFailure: the model ends a tool-use loop without a final summary (empty ResponseText); the finished message shows only the tool line, looking like a completed answer that said nothing.","design":"When the reply is empty, do not post the tool block as the answer — either skip the final send (leave the cursor-cleaned live message) or emit an explicit 'no reply' marker. Add a test for finalize(empty, tools).","acceptance_criteria":"A turn that ends with tools but no answer text does not post a bare tool line as the final message.","status":"closed","priority":2,"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:25:44Z","started_at":"2026-08-14T15:07:52Z","closed_at":"2026-08-14T15:25:44Z","close_reason":"Fixed in internal/channels/telegram/live.go: framedText keeps tool lines whole ahead of the clamped answer tail (fixes wpq6); finalText appends a '(no response)' marker when tools ran but the reply is empty (fixes hlxd); abandonFailed marks a provider-error partial distinctly from a clean /stop abandon (fixes c3w2). Regression tests verified red-then-green; adversarial review found no blocking issues (added one more test for the degenerate oversized-tool-block case it flagged). task check clean, committed as 587b9b9.","external_ref":"https://github.com/samcharles93/archie-core/issues/486","labels":["code-review","streaming","telegram"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-og5r","title":"webui: the dashboard narrates tool calls with no opt-out; show_tool_calls only gates Telegram","description":"show_tool_calls gates only the Telegram adapter. The web dashboard's chatStreamSink forwards every ToolCallEvent unconditionally (api_chat.go:228) — no config key exists anywhere in webui — so an operator following the documented intent (show_tool_calls off means no tool narration) still gets full per-tool narration in the web dashboard with no way to disable it. The ToolCallEvent contract comment (stream.go:18-20) delegates 'whether to show it at all' to the channel adapter, but only the Telegram adapter exercises the knob.\n\nFailure: an operator with the default show_tool_calls=false opens the web dashboard; every internal tool step of every web chat is narrated in full, exposing tool inventory and parameter shapes to anyone with dashboard access.","design":"Either add a webui-equivalent config key and gate the sink on it, or make show_tool_calls a cross-channel setting. Decide and document the intent, then wire the webui sink to honor it.","acceptance_criteria":"With the setting off, the web dashboard does not emit tool frames; with it on, it does — controlled by one documented knob.","status":"closed","priority":2,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-14T14:43:37Z","created_by":"Sam Catlow","updated_at":"2026-08-14T15:57:11Z","started_at":"2026-08-14T15:50:15Z","closed_at":"2026-08-14T15:57:11Z","close_reason":"Fixed: ShowToolCalls moved from TelegramConfig to ChatConfig (one cross-channel setting), webui's chatStreamSink gated on it (off by default, matching Telegram). Adversarial review clean aside from cosmetic/doc notes, both addressed. Breaking config-key move flagged explicitly in the commit body since it's a silent TOML drop, not an error. Committed f7590a6.","external_ref":"https://github.com/samcharles93/archie-core/issues/487","labels":["code-review","config","webui"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-ippu","title":"gateway: replay and redelivery lose tool activity, showing duplicate answers without tools","description":"The replay paths (TurnClaimCompleted, prior-reply) emit stream.Delta(ResponseText) only — never stream.ToolCall — and neither the ledger (TurnRecord) nor the session store persists tool activity. A completed-duplicate delivery (NATS redelivery, restart RecoverTurns re-delivery) finalizes a fresh liveReply with empty toolLines and sends the bare reply as a new message: the transcript shows the original (with tools) and the duplicate (without) side by side, disagreeing about what ran. Web history has the same gap — stored assistant messages render text only.\n\nFailure: a chat message is redelivered or re-queued after restart; the user sees the same answer twice, the second copy lacking the tool block that explains it.","design":"Decide whether tool activity should be persisted (ledger/session store) and replayed, or whether replays simply should not re-narrate tools. If persisting, add a tool-activity record to the turn/message and replay it; if not, make the replay path explicitly consistent and document the choice.","acceptance_criteria":"A redelivered/restarted turn does not show a tool-less duplicate disagreeing with the original; the behavior is explicitly decided and tested.","status":"open","priority":2,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-14T14:43:24Z","created_by":"Sam Catlow","updated_at":"2026-08-23T12:53:18Z","external_ref":"https://github.com/samcharles93/archie-core/issues/488","metadata":null,"labels":["code-review","gateway","telegram","webui"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-ippu","title":"gateway: replay and redelivery lose tool activity, showing duplicate answers without tools","description":"The replay paths (TurnClaimCompleted, prior-reply) emit stream.Delta(ResponseText) only — never stream.ToolCall — and neither the ledger (TurnRecord) nor the session store persists tool activity. A completed-duplicate delivery (NATS redelivery, restart RecoverTurns re-delivery) finalizes a fresh liveReply with empty toolLines and sends the bare reply as a new message: the transcript shows the original (with tools) and the duplicate (without) side by side, disagreeing about what ran. Web history has the same gap — stored assistant messages render text only.\n\nFailure: a chat message is redelivered or re-queued after restart; the user sees the same answer twice, the second copy lacking the tool block that explains it.","design":"Decide whether tool activity should be persisted (ledger/session store) and replayed, or whether replays simply should not re-narrate tools. If persisting, add a tool-activity record to the turn/message and replay it; if not, make the replay path explicitly consistent and document the choice.","acceptance_criteria":"A redelivered/restarted turn does not show a tool-less duplicate disagreeing with the original; the behavior is explicitly decided and tested.","status":"closed","priority":2,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-14T14:43:24Z","created_by":"Sam Catlow","updated_at":"2026-08-24T07:12:07Z","closed_at":"2026-08-24T07:12:07Z","close_reason":"Fixed: TurnRecord now persists tool-call activity alongside ResponseText; the completed-duplicate replay path replays it via stream.ToolCall before the text. Prior-reply fallback documented as deliberately text-only (crash race with no persisted tool record). Commit 86a9731, task check clean, adversarial review clean (0 findings). [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/488","metadata":null,"labels":["code-review","gateway","telegram","webui"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-o2t8","title":"webui: derive tool failure from a structured field, not a 'failed:' string prefix","description":"The web UI derives failure styling with summary.startsWith('failed:') on the rendered string (chat-tools.js:25), while chatStreamEvent (api_chat.go) carries no structured error/ok field — the doc comment says the intent was structured precisely so the browser could style the two apart instead of parsing a rendered string, but the bit was dropped. False positives are concrete: a successful tool whose first output line begins with 'failed: ' is styled as a failure. Nothing pins the Go 'failed: ' prefix to the client sniff (the UI test feeds the literal string), so a future rewording silently breaks failure styling.\n\nFailure: a successful shell command printing 'failed: no such file' to stdout exits 0; the web chat renders it red as an error step.","design":"Add an explicit error/ok field to ToolCallEvent and chatStreamEvent (e.g. a bool or the raw Err), thread it through the sink, and style on that instead of the rendered string. Update the UI test to feed the structured field.","acceptance_criteria":"A successful tool printing 'failed: …' is not styled as a failure; failure styling is driven by a structured signal, not string matching.","status":"closed","priority":2,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-14T14:43:24Z","created_by":"Sam Catlow","updated_at":"2026-08-14T15:48:45Z","started_at":"2026-08-14T15:44:20Z","closed_at":"2026-08-14T15:48:45Z","close_reason":"Fixed in internal/webui/api_chat.go + ui/src/chat/chat-tools.js: chatStreamEvent now carries a structured Failed bool (from ToolCallEvent.Err != \"\"); JS reads event.failed instead of sniffing the summary text. Adversarial review found zero issues. Committed a99a770.","external_ref":"https://github.com/samcharles93/archie-core/issues/489","labels":["code-review","webui"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-wpq6","title":"telegram: tool lines disappear from the live frame once the answer exceeds ~3900 runes","description":"Mid-turn frames keep only the tail (clampToOneMessage keeps the last 3900 runes with a leading ellipsis). Tool lines are written inline near the start of the buffer — before the answer, since tools run before the answer in agentic turns — so once the answer exceeds ~3900 runes, every early tool line vanishes from the live frame (the buffer only grows; nothing re-inserts them mid-turn). They reappear at the top at finalize. The visible message changes shape three times (tool-inline, gone behind the ellipsis, tools-on-top) and the user watching mid-turn sees the tool activity silently disappear.\n\nFailure: a turn with an early web_fetch followed by a 4000-rune answer shows only '...' + tail with no tool line for the bulk of the turn.","design":"Keep tool lines outside the clamped tail — render the tool block above the truncated answer tail in the live frame — so tool activity stays visible for the whole turn.","acceptance_criteria":"In a turn with an early tool call and a \u003e3900-rune answer, the live frame still shows the tool line(s) at the top rather than hiding them behind the ellipsis.","status":"closed","priority":2,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-14T14:43:23Z","created_by":"Sam Catlow","updated_at":"2026-08-14T15:25:44Z","started_at":"2026-08-14T15:07:52Z","closed_at":"2026-08-14T15:25:44Z","close_reason":"Fixed in internal/channels/telegram/live.go: framedText keeps tool lines whole ahead of the clamped answer tail (fixes wpq6); finalText appends a '(no response)' marker when tools ran but the reply is empty (fixes hlxd); abandonFailed marks a provider-error partial distinctly from a clean /stop abandon (fixes c3w2). Regression tests verified red-then-green; adversarial review found no blocking issues (added one more test for the degenerate oversized-tool-block case it flagged). task check clean, committed as 587b9b9.","external_ref":"https://github.com/samcharles93/archie-core/issues/490","labels":["code-review","streaming","telegram"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-9zoa","title":"telegram: a restart mid-turn strands a permanent message ending in the ▌ cursor","description":"The live reply is a real, permanent Telegram message (SendRichMessage) whose messageID lives only in the in-memory liveReply struct. No shutdown path — supervisor restart in Start, daemon stop, launch() rebuilding Turns — edits or deletes it. A restart mid-turn strands a permanent message ending in ▌ that nothing will ever finish. The old draft path self-deleted (ephemeral 30-second previews); this is a new class of leftover introduced by the live-edit design.\n\nFailure: the operator restarts the daemon or deploys a new build while a turn is streaming; the partial reply with the cursor persists in the chat indefinitely, implying the bot is still writing.","design":"On gateway Stop/restart, track in-flight liveReply instances (a registry keyed by chat/thread) and edit them to drop the cursor and/or append a cancelled/restarted marker — or delete them. Decide the desired end state for an interrupted turn.","acceptance_criteria":"A daemon restart during a streamed turn leaves no ▌-terminated message; the partial reply is either completed, marked, or removed.","status":"closed","priority":2,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-14T14:43:09Z","created_by":"Sam Catlow","updated_at":"2026-08-14T16:20:04Z","started_at":"2026-08-14T15:58:25Z","closed_at":"2026-08-14T16:20:04Z","close_reason":"Fixed: Gateway tracks in-flight liveReply instances in a registry Stop drains, marking each interrupted. Adversarial review found a critical race (concurrent finalize/abandon on the same reply could corrupt the message) plus two lesser issues (unbounded blocking Stop, a narrow post-snapshot registration gap) -- all three fixed: sync.Once serializes finalize/abandon, the drain is time-bounded (default 5s, entries left running in background past that), and registerLive checks a stopped flag to immediately abandon a straggler. Re-reviewed via targeted regression tests including a 20-iteration concurrent race test. task check clean, -race clean across repeated runs. Committed 09ea210.","external_ref":"https://github.com/samcharles93/archie-core/issues/491","labels":["code-review","streaming","telegram"],"dependency_count":0,"dependent_count":0,"comment_count":0}
@@ -164,7 +164,7 @@
{"_type":"issue","id":"archie-core-1786637500149-395-b8fe5929","title":"[BUG] find fallback reports a cancelled walk as 'no matches found'","description":"runFindGoFallback's walk callback swallows every per-entry error (returns nil to skip inaccessible entries), so the only error that can escape filepath.WalkDir is ctx.Err() from the cancellation select. The guard 'if err != nil \u0026\u0026 !errors.Is(err, ctx.Err())' therefore never fires: on timeout or /stop the function falls through and returns whatever it had collected, or 'no matches found' when it had collected nothing. This is the same failure the grep exit-code bug had -- the model is told a search found nothing when the search did not finish. Behaviour predates 6d4e0be; the errors.Is autofix in that commit is behaviour-neutral here (errors.Is(err, nil) is false for non-nil err, matching the old err != ctx.Err() when the context is live).\n\n### Acceptance Criteria\n\nA find whose context is cancelled mid-walk returns an error result naming the cancellation, not 'no matches found' and not a silently partial list. Regression test in the style of TestGrepReportsSearchFailureRatherThanNoMatches.","status":"closed","priority":2,"issue_type":"bug","created_at":"2026-08-08T14:57:47Z","updated_at":"2026-08-08T15:35:09Z","closed_at":"2026-08-08T15:35:10Z","external_ref":"https://github.com/samcharles93/archie-core/issues/416","source_system":"github:https://github.com/samcharles93/archie-core/issues/416:416","metadata":null,"labels":["bug"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786637500130-394-584ce317","title":"Reconcile SOUL with PersonaRegistry and the six built-in personas","description":"Decide what happens to DefaultPersonas() (archie, helpful, concise, technical, creative, teacher) and the /personality command once SOUL owns identity. Options: SOUL replaces the default archie persona and the rest remain selectable style modifiers; or personas become seed templates a user copies into their SOUL; or personas are retired. Currently GetActive composes the baseline archie prompt with the selected persona, so the interaction with SOUL must be explicit rather than emergent.\n\n### Acceptance Criteria\n\nPrecedence between SOUL and a selected persona is defined and documented. /personality either keeps working with stated semantics or is removed deliberately. No path lets a persona selection blank out the user's SOUL without them asking.","notes":"Not resolved yet. docs/architecture/identity.md (Three-layer identity model, agreed 2026-07-30) documents SOUL as Layer 2 and explains why SOUL comes first, but does not state the specific precedence rule between SOUL and a /personality selection that this issue's acceptance criteria requires. /personality is still fully live and unmodified: internal/channels/telegram/personality.go, internal/gateway/gateway.go:375,472,507. DefaultPersonas() still lives in internal/gateway/persona.go with no SOUL reference. This is a real open design decision, not a documentation-only task -- read docs/architecture/identity.md's three-layer model first, then decide (and document) precedence.","status":"open","priority":2,"issue_type":"task","created_at":"2026-08-08T14:57:44Z","updated_at":"2026-08-15T12:52:35Z","external_ref":"https://github.com/samcharles93/archie-core/issues/415","source_system":"github:https://github.com/samcharles93/archie-core/issues/415:415","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786637500110-393-7a04f121","title":"Chat: real system prompt template for Archie (identity, tools, env)","description":"The chat agent's system prompt is the four-sentence static string in gateway.DefaultPersonas(). It carries no tool inventory, no environment/date block, and no instruction precedence, so the model invents its own capabilities -- it told Sam it 'only has the memory editing tool' and then offered to walk him through installing software it cannot install.\n\nTake the shape from tau: /work/apps/tau/internal/agent/templates/agent.md.tpl renders an agent body plus \u003ctools\u003e, \u003cguidelines\u003e, \u003cproject_context\u003e and \u003cenv\u003e blocks, and /work/apps/tau/internal/agent/spec/templates/tau.agent.md supplies identity, instruction precedence, core rules, communication rules and confirmation boundaries.\n\nKeep the existing PersonaRegistry as the style layer; the template is the substrate it renders into.","status":"closed","priority":2,"issue_type":"feature","created_at":"2026-08-08T14:57:39Z","updated_at":"2026-08-08T14:57:41Z","closed_at":"2026-08-08T14:57:42Z","external_ref":"https://github.com/samcharles93/archie-core/issues/414","source_system":"github:https://github.com/samcharles93/archie-core/issues/414:414","metadata":null,"labels":["enhancement"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786637500090-392-e6b1cbaf","title":"Test forge fakes missing LinkBranch method broke go vet/test for whole module","description":"forge.Forge gained LinkBranch(ctx, owner, repo, issueNumber, branch) error in the branch-linking feature (ff4c51e) but the hand-rolled test doubles (stubForge in cmd/archied/main_test.go, prCapturingForge in cmd/archie-agent/taskrun_test.go, testForge in internal/daemon/daemon_test.go, fakeForge in internal/forgerpc/forgerpc_test.go) never got the method added, so they stopped satisfying forge.Forge. This broke go vet ./... and go test ./... for the entire module, not just those 4 packages, since go vet type-checks all test files as part of module vet. Fixed by adding LinkBranch stubs to all four fakes.","status":"closed","priority":2,"issue_type":"bug","created_at":"2026-08-08T14:57:33Z","updated_at":"2026-08-08T14:57:36Z","closed_at":"2026-08-08T14:57:37Z","external_ref":"https://github.com/samcharles93/archie-core/issues/413","source_system":"github:https://github.com/samcharles93/archie-core/issues/413:413","metadata":null,"labels":["bug"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786637500090-392-e6b1cbaf","title":"Fix forge test fakes after adding LinkBranch","description":"The forge.Forge interface gained LinkBranch, but several hand-written test doubles were not updated.\n\nAffected fakes include stubForge, prCapturingForge, testForge, and fakeForge. This caused go vet ./... and go test ./... to fail because the test doubles no longer satisfied forge.Forge.\n\nAcceptance criteria:\n- All forge test doubles implement the current forge.Forge interface.\n- go vet ./... passes.\n- go test ./... passes.","status":"closed","priority":2,"issue_type":"bug","created_at":"2026-08-08T14:57:33Z","updated_at":"2026-08-24T06:57:54Z","closed_at":"2026-08-08T14:57:37Z","external_ref":"https://github.com/samcharles93/archie-core/issues/413","source_system":"github:https://github.com/samcharles93/archie-core/issues/413:413","metadata":null,"labels":["bug"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786637500066-391-e36986c2","title":"Decide and implement the TOML write strategy","description":"Settle how setup persists config before any prompting code is written; everything else depends on it. BurntSushi/toml loses comments on re-marshal, and config.example.toml carries substantial inline documentation users are meant to read and edit by hand. Options: (a) generate a fresh commented config from a template on first run and only line-patch specific keys on re-run; (b) full re-marshal and accept losing comments; (c) adopt a comment-preserving TOML editor.\n\n### Design\n\nDecision: text-based line patching, not decode/re-marshal, not a comment-preserving TOML AST library (none exist for Go that are safe to depend on).\n\nNew package internal/infrastructure/configuration/tomlwrite:\n- Apply(src []byte, edits []Edit) ([]byte, error): for each {Table, Key, Value} edit, finds an active \"key = value\" line in that table and replaces just the value (preserving indent + trailing inline comment); else finds a commented \"# key = value\" line in that table, uncomments the table header and the line; else appends the key at the end of the table's content (or appends a brand new [table] section at EOF if the table doesn't exist at all, active or commented). Lines not named by an edit are copied through byte-for-byte.\n- Generate(template, edits) is Apply against configtemplate.Example (config.example.toml embedded at the module root via configtemplate.go, since go:embed can't reach outside its own directory tree -- this keeps config.example.toml the single source of truth instead of a second copy, which is exactly the drift bug this epic exists to fix).\n- Value callers pre-render TOML literals; String() and Ref(engine,key) helpers cover the two shapes setup needs (quoted strings, secret.SecretRef inline tables). Deliberately does not import internal/secret -- it edits text, not Go values.\n\nTrade-off: only understands single-line scalar/inline-table values. Does not handle multi-line arrays or [[array-of-tables]] (e.g. [[repos]]) -- those aren't setup's targets and must not be routed through this patcher.\n\nTests (internal/infrastructure/configuration/tomlwrite/tomlwrite_test.go) cover: active-key replace preserving trailing comment, active inline-table replace, commented-table uncomment-one-key-leave-siblings-commented, append into existing active table, append brand-new table, byte-identical-elsewhere on a single edit, byte-identical-elsewhere across two sequential runs (the rs9 acceptance criterion), and a full run against the real config.example.toml verified to decode via BurntSushi/toml and round-trip bot_user/forge.token correctly.\n\n`go build ./...` and `task check` pass clean; no other files touched.\n\n### Acceptance Criteria\n\nThe chosen strategy is documented with its trade-off. A first run produces a config a human can read and hand-edit afterwards. A second run changing one value leaves every other line, including comments, byte-identical -- asserted by a test. No strategy is adopted that silently discards user edits.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-08-08T14:57:28Z","updated_at":"2026-08-08T14:57:30Z","closed_at":"2026-08-08T14:57:31Z","external_ref":"https://github.com/samcharles93/archie-core/issues/412","source_system":"github:https://github.com/samcharles93/archie-core/issues/412:412","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786637500046-390-bb8eb36b","title":"Telegram: report installed gateway and runtime versions","description":"Add an authorized /version command as the installed-version prerequisite for component-aware /update. Telegram remains presentation-only; the composition root supplies installed component versions.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-08-08T14:57:22Z","updated_at":"2026-08-08T14:57:25Z","closed_at":"2026-08-08T14:57:26Z","external_ref":"https://github.com/samcharles93/archie-core/issues/411","source_system":"github:https://github.com/samcharles93/archie-core/issues/411:411","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786637500022-389-a765fd7a","title":"Telegram: component-aware /update with approve or defer","description":"Add an /update control flow that checks for available releases, presents separate archied gateway and archie-agent runtime versions/changelog sections, and lets an authorized user approve or defer. Keep discovery and execution behind typed interfaces so Docker/Watchtower, package-manager, and other installations can supply their own updater without the Telegram gateway assuming a deployment mechanism.\n\n### Acceptance Criteria\n\n/update reports whether gateway and runtime updates are available, with separate version and changelog sections and explicit no-change wording. Telegram provides Approve and Defer actions restricted to authorized users. Deferral is persisted and suppresses repeated prompts according to an explicit policy. Approval calls a typed installation updater and reports progress/failure without claiming success early. No Watchtower-only or Docker-only behavior exists in the gateway package. Commands, menu, help, callback authorization, concurrency, persistence, and failure paths are tested.","status":"closed","priority":2,"issue_type":"feature","created_at":"2026-08-08T14:57:17Z","updated_at":"2026-08-08T14:57:20Z","closed_at":"2026-08-08T14:57:21Z","external_ref":"https://github.com/samcharles93/archie-core/issues/410","source_system":"github:https://github.com/samcharles93/archie-core/issues/410:410","metadata":null,"labels":["enhancement"],"dependency_count":0,"dependent_count":0,"comment_count":0}
@@ -420,12 +420,12 @@
{"_type":"issue","id":"archie-core-1786637493413-139-d157cc71","title":"SessionSource struct for platform identity","status":"closed","priority":2,"issue_type":"task","created_at":"2026-08-08T14:38:06Z","updated_at":"2026-08-08T14:38:08Z","closed_at":"2026-08-08T14:38:09Z","external_ref":"https://github.com/samcharles93/archie-core/issues/160","source_system":"github:https://github.com/samcharles93/archie-core/issues/160:160","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786637493387-138-cad8e7a7","title":"Platform capability flags for adapters","description":"A capability-flag mechanism so callers can ask an adapter which optional features it supports (typing indicator, edit, delete, media send, clarify/approval/picker UI) instead of discovering support by a failed type assertion or a runtime error.\n\n### Context for implementers\n\nThis depends on the optional-method interfaces this issue is meant to describe: `archie-core-1786637493329-136-49b39c78` (typing/edit/delete/media) and `archie-core-1786637493357-137-35af7083` (clarify/approval/pickers). Implement after (or in close coordination with) those two, since the flag set should mirror whatever optional interfaces they land — don't invent a flag taxonomy ahead of the methods it describes.\n\n### Acceptance Criteria\n\n`BasePlatformAdapter` (`internal/gateway/adapter.go`) or a wrapping type exposes a capability query (e.g. `Capabilities() AdapterCapabilities`) that reports which optional methods an adapter implements. Every existing adapter's reported capabilities match its actual method set (a regression test should fail if an adapter claims a capability it doesn't implement, or vice versa).\n","notes":"Partial: the mechanism itself (gateway.CapabilityReporter, CapabilitiesOf, AdapterCapabilities) is built and covered by a regression test, scoped to Media only -- see archie-core-1786637493329-136-49b39c78 (closed, media portion). Still blocked on archie-core-1786637493357-137-35af7083 (clarify/approval/pickers) since AdapterCapabilities needs those flags added too before this is fully done.","status":"open","priority":2,"issue_type":"task","created_at":"2026-08-08T14:38:02Z","updated_at":"2026-08-23T12:53:18Z","started_at":"2026-08-22T11:53:10Z","external_ref":"https://github.com/samcharles93/archie-core/issues/159","source_system":"github:https://github.com/samcharles93/archie-core/issues/159:159","metadata":null,"labels":["task"],"dependencies":[{"issue_id":"archie-core-1786637493387-138-cad8e7a7","depends_on_id":"archie-core-1786637493329-136-49b39c78","type":"blocks","created_at":"2026-08-15T12:46:57Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-1786637493387-138-cad8e7a7","depends_on_id":"archie-core-1786637493357-137-35af7083","type":"blocks","created_at":"2026-08-15T12:46:57Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":2,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786637493357-137-35af7083","title":"BasePlatformAdapter interactive UX methods (clarify, approval, pickers)","description":"Add adapter-facing methods for interactive UX: presenting a clarifying question, an approval prompt, and a picker (multi-choice selection) natively on the platform, rather than as plain text the user has to reply to by hand.\n\n### Context for implementers\n\nThe approval *decision* plumbing already exists — `internal/tools/approval.go`, re-exported through `internal/gateway/approval.go` (`ApprovalRequester`, `ApprovalDecision`, `WithApprovalRequester`/`ApprovalFromContext`). What's missing is the adapter-side rendering: `BasePlatformAdapter` (`internal/gateway/adapter.go`) has no method for an adapter to display an approval/clarify/picker UI and report back a decision through that existing plumbing. This issue wires a new adapter method (or interface) into the existing `ApprovalRequester` flow — it should not duplicate or replace the decision model in `internal/tools/approval.go`. Sibling of `archie-core-1786637493329-136-49b39c78` (typing/edit/delete/media) — same \"optional adapter capability\" shape, different capability set.\n\n### Acceptance Criteria\n\nAn adapter can render a clarify/approval/picker prompt and the user's response is delivered back through the existing `ApprovalRequester`/`ApprovalDecision` flow in `internal/tools/approval.go`, not a parallel mechanism. Platforms without native UI (e.g. plain text-only channels) degrade to a text-based fallback rather than failing. Covered by a test double adapter, not a live platform.\n","status":"open","priority":2,"issue_type":"task","created_at":"2026-08-08T14:37:59Z","updated_at":"2026-08-15T12:46:48Z","external_ref":"https://github.com/samcharles93/archie-core/issues/158","source_system":"github:https://github.com/samcharles93/archie-core/issues/158:158","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":1,"comment_count":0}
{"_type":"issue","id":"archie-core-1786637493329-136-49b39c78","title":"BasePlatformAdapter optional methods (typing, edit, delete, media)","description":"Extend adapter capability beyond the four required `BasePlatformAdapter` methods with optional per-platform methods: typing indicator, message edit, message delete, and media-specific send.\n\n### Context for implementers\n\n`internal/gateway/adapter.go` today defines `BasePlatformAdapter` with exactly four methods: `Connect`, `Disconnect`, `Send`, `ChatInfo` (see full listing — the file is 80 lines). Not every platform supports typing/edit/delete/media uniformly, so these should be a separate optional interface(s) that callers type-assert for, not additions to the required interface (that would break every existing adapter implementation). Pairs with `archie-core-1786637493387-138-cad8e7a7` (platform capability flags) — callers need a way to know *ahead of a type assertion* whether an adapter supports a given optional method, rather than probing via failed assertions at call time.\n\n### Acceptance Criteria\n\nOptional methods are defined on a separate interface (or interfaces) from `BasePlatformAdapter`, so existing adapters keep compiling unchanged. At least one adapter implementation exercises each optional method in a test. Callers that invoke an optional method on an adapter that doesn't implement it get a defined, non-panicking behavior.\n","status":"open","priority":2,"issue_type":"task","created_at":"2026-08-08T14:37:57Z","updated_at":"2026-08-23T12:53:18Z","started_at":"2026-08-22T11:53:09Z","external_ref":"https://github.com/samcharles93/archie-core/issues/157","source_system":"github:https://github.com/samcharles93/archie-core/issues/157:157","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":1,"comment_count":0}
{"_type":"issue","id":"archie-core-1786637493329-136-49b39c78","title":"BasePlatformAdapter optional methods (typing, edit, delete, media)","description":"Extend adapter capability beyond the four required `BasePlatformAdapter` methods with optional per-platform methods: typing indicator, message edit, message delete, and media-specific send.\n\n### Context for implementers\n\n`internal/gateway/adapter.go` today defines `BasePlatformAdapter` with exactly four methods: `Connect`, `Disconnect`, `Send`, `ChatInfo` (see full listing — the file is 80 lines). Not every platform supports typing/edit/delete/media uniformly, so these should be a separate optional interface(s) that callers type-assert for, not additions to the required interface (that would break every existing adapter implementation). Pairs with `archie-core-1786637493387-138-cad8e7a7` (platform capability flags) — callers need a way to know *ahead of a type assertion* whether an adapter supports a given optional method, rather than probing via failed assertions at call time.\n\n### Acceptance Criteria\n\nOptional methods are defined on a separate interface (or interfaces) from `BasePlatformAdapter`, so existing adapters keep compiling unchanged. At least one adapter implementation exercises each optional method in a test. Callers that invoke an optional method on an adapter that doesn't implement it get a defined, non-panicking behavior.\n","status":"closed","priority":2,"issue_type":"task","created_at":"2026-08-08T14:37:57Z","updated_at":"2026-08-24T07:12:09Z","started_at":"2026-08-22T11:53:09Z","closed_at":"2026-08-24T07:12:09Z","close_reason":"Media portion delivered: gateway.MediaSender + telegramMediaSender + TurnStream.Media wiring in Telegram's liveReply. Typing/edit/delete indicators from this issue's original scope are NOT done -- splitting them out if still wanted, since they're unrelated to the video-gen work that drove this. [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/157","source_system":"github:https://github.com/samcharles93/archie-core/issues/157:157","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":1,"comment_count":0}
{"_type":"issue","id":"archie-core-1786637493304-135-95070200","title":"BasePlatformAdapter interface with required methods","status":"closed","priority":2,"issue_type":"task","created_at":"2026-08-08T14:37:51Z","updated_at":"2026-08-08T14:37:54Z","closed_at":"2026-08-08T14:37:55Z","external_ref":"https://github.com/samcharles93/archie-core/issues/156","source_system":"github:https://github.com/samcharles93/archie-core/issues/156:156","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786637493282-134-cf46838e","title":"EphemeralReply type with auto-delete TTL","description":"An `EphemeralReply` type for messages the gateway sends that should self-delete after a TTL — status/progress placeholders (\"thinking…\", \"running tool X…\") that shouldn't linger in the chat history once superseded.\n\n### Context for implementers\n\nNo ephemeral-reply file exists yet in `internal/gateway`. Deletion requires adapter support: `BasePlatformAdapter` (`internal/gateway/adapter.go`) currently exposes only `Connect`/`Disconnect`/`Send`/`ChatInfo` — no delete method. This depends on (or should land alongside) `archie-core-1786637493329-136-49b39c78` (BasePlatformAdapter optional methods, which includes delete) — an adapter without a delete method can't honor the TTL.\n\n### Acceptance Criteria\n\nAn `EphemeralReply` carries a TTL after which the gateway issues a delete against the originating adapter. Adapters without delete support degrade gracefully (e.g. leave the message, log once) rather than erroring the turn. TTL firing is covered by a test using an injected clock, not a real sleep.\n","status":"open","priority":2,"issue_type":"task","created_at":"2026-08-08T14:37:48Z","updated_at":"2026-08-15T12:46:47Z","external_ref":"https://github.com/samcharles93/archie-core/issues/155","source_system":"github:https://github.com/samcharles93/archie-core/issues/155:155","metadata":null,"labels":["task"],"dependencies":[{"issue_id":"archie-core-1786637493282-134-cf46838e","depends_on_id":"archie-core-1786637493329-136-49b39c78","type":"related","created_at":"2026-08-15T12:46:57Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786637493254-133-444ec94e","title":"Telegram: interactive /model selector","description":"When /model is invoked without an argument, present Telegram-native interactive controls rather than only plain text usage. Use the pinned go-telegram/bot SDK inline keyboard and callback query APIs; preserve /model provider/model for typed selection and enforce the existing sender allowlist on callbacks.\n\n### Acceptance Criteria\n\nAn allowlisted user invoking /model receives an inline keyboard of configured models with the active model marked; tapping a model switches it through gateway.ModelManager, acknowledges the callback, and updates the message; unauthorized or malformed callbacks cannot switch models; empty model catalogs degrade safely.","status":"closed","priority":2,"issue_type":"feature","created_at":"2026-08-08T14:37:45Z","updated_at":"2026-08-15T02:48:49Z","closed_at":"2026-08-15T02:48:49Z","external_ref":"https://github.com/samcharles93/archie-core/issues/154","source_system":"github:https://github.com/samcharles93/archie-core/issues/154:154","metadata":null,"labels":["enhancement"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786637493230-132-7ab58e77","title":"Telegram: comprehensive truthful /help output","description":"The live /help response lists only /status and /help and still says LLM chat is not wired, despite the gateway supporting model, task, restart, and free-text chat paths. Replace the stale hardcoded copy with a complete, maintainable command guide that matches the registered menu and actual router behavior.\n\n### Acceptance Criteria\n\n/help describes every published command with accurate usage, includes free-text chat behavior, no longer claims chat is unwired, and a regression test fails if the published command menu and help surface drift.","status":"open","priority":2,"issue_type":"feature","created_at":"2026-08-08T14:37:42Z","updated_at":"2026-08-08T15:34:31Z","external_ref":"https://github.com/samcharles93/archie-core/issues/153","source_system":"github:https://github.com/samcharles93/archie-core/issues/153:153","metadata":null,"labels":["enhancement","in-progress"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786637493205-131-a3dd2b53","title":"Telegram: /restore to revert the last change","description":"Operator escape hatch requested alongside /restart: revert the last change from chat when an agent-authored change breaks something, without needing shell access to the host. Gateway-scoped.\n\n### Acceptance Criteria\n\nAdmin-only (allowlisted sender). Reverts the last change and reports what was reverted. Safe to run when there is nothing to revert.","status":"open","priority":2,"issue_type":"feature","created_at":"2026-08-08T14:37:39Z","updated_at":"2026-08-23T12:53:18Z","external_ref":"https://github.com/samcharles93/archie-core/issues/152","source_system":"github:https://github.com/samcharles93/archie-core/issues/152:152","metadata":null,"labels":["enhancement","in-progress"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786637493205-131-a3dd2b53","title":"Telegram: /restore to revert the last change","description":"Operator escape hatch requested alongside /restart: revert the last change from chat when an agent-authored change breaks something, without needing shell access to the host. Gateway-scoped.\n\n### Acceptance Criteria\n\nAdmin-only (allowlisted sender). Reverts the last change and reports what was reverted. Safe to run when there is nothing to revert.","status":"closed","priority":2,"issue_type":"feature","created_at":"2026-08-08T14:37:39Z","updated_at":"2026-08-24T07:12:08Z","closed_at":"2026-08-24T07:12:08Z","close_reason":"Closed [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/152","source_system":"github:https://github.com/samcharles93/archie-core/issues/152:152","metadata":null,"labels":["enhancement","in-progress"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786637493175-130-d2de1e70","title":"Telegram: /restart command to reload gateway config","description":"Operator escape hatch: restart the chat gateway from chat to pick up config changes (notably the allowlist) or recover from a wedged adapter, without shell access to the host.\n\n### Acceptance Criteria\n\n/restart is admin-only (allowlisted sender). Re-reads config and restarts the gateway. Replies with the outcome. In-flight agent tasks are not killed.","status":"closed","priority":2,"issue_type":"feature","created_at":"2026-08-08T14:37:34Z","updated_at":"2026-08-08T15:34:35Z","closed_at":"2026-08-08T15:34:36Z","external_ref":"https://github.com/samcharles93/archie-core/issues/151","source_system":"github:https://github.com/samcharles93/archie-core/issues/151:151","metadata":null,"labels":["enhancement"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786637493149-129-8a9ae7dc","title":"Telegram: register command menu via SetMyCommands","description":"The bot never calls SetMyCommands, so Telegram shows no command menu and the commands the Router implements (/status, /help, /models, /model, /spawn, /approve, /cancel) are undiscoverable. Asking the bot for /commands makes the LLM answer that it has none, which is wrong.\n\n### Acceptance Criteria\n\nSetMyCommands is called at startup with the commands the Router actually handles. Failure is logged, not fatal.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-08-08T14:37:29Z","updated_at":"2026-08-08T14:37:31Z","closed_at":"2026-08-08T14:37:32Z","external_ref":"https://github.com/samcharles93/archie-core/issues/150","source_system":"github:https://github.com/samcharles93/archie-core/issues/150:150","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786637493121-128-2acad290","title":"Telegram: allowlist senders, fail closed when unset","description":"telegram.New is called with a nil allowlist and isChatAllowed returns true when the allowlist is empty, so any Telegram user who finds the bot can talk to it. AllowedChatIDs is not plumbed into config at all. This gates exposing any real tools to the chat agent: with an MCP shell/filesystem server wired, allow-all becomes RCE for arbitrary senders.\n\n### Acceptance Criteria\n\nAllowlist is configurable via config.toml. Unset means deny, not allow. Sender identity (user id) is checked, not just chat id, so a group chat cannot be used to bypass it. Rejections are logged with the sender id. Startup logs loudly when the chat gateway is enabled with an empty allowlist.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-08-08T14:37:23Z","updated_at":"2026-08-08T14:37:26Z","closed_at":"2026-08-08T14:37:27Z","external_ref":"https://github.com/samcharles93/archie-core/issues/149","source_system":"github:https://github.com/samcharles93/archie-core/issues/149:149","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0}
@@ -448,9 +448,9 @@
{"_type":"issue","id":"archie-core-1786637492690-111-5138a572","title":"Verify: BasePlatformAdapter interface with required methods","description":"### Acceptance Criteria\n\nIndependent adversarial review by fresh agent. Verify: no dead code paths, no lint issues (golangci-lint run clean), tests pass (go test ./...), code is formatted (gofmt), no hardcoded values in tests. Review the implementation against the original acceptance criteria. Report findings or confirm clean.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-08-08T14:35:54Z","updated_at":"2026-08-08T14:35:55Z","closed_at":"2026-08-08T14:35:56Z","external_ref":"https://github.com/samcharles93/archie-core/issues/132","source_system":"github:https://github.com/samcharles93/archie-core/issues/132:132","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786637492668-110-d16dc2ae","title":"Verify: Rich MessageEvent struct with all gateway fields","description":"### Acceptance Criteria\n\nIndependent adversarial review by fresh agent. Verify: no dead code paths, no lint issues (golangci-lint run clean), tests pass (go test ./...), code is formatted (gofmt), no hardcoded values in tests. Review the implementation against the original acceptance criteria. Report findings or confirm clean.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-08-08T14:35:50Z","updated_at":"2026-08-08T14:35:52Z","closed_at":"2026-08-08T14:35:53Z","external_ref":"https://github.com/samcharles93/archie-core/issues/131","source_system":"github:https://github.com/samcharles93/archie-core/issues/131:131","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786637492640-109-820d4da3","title":"Verify: MessageType enum for gateway messages","description":"### Acceptance Criteria\n\nIndependent adversarial review by fresh agent. Verify: no dead code paths, no lint issues (golangci-lint run clean), tests pass (go test ./...), code is formatted (gofmt), no hardcoded values in tests. Review the implementation against the original acceptance criteria. Report findings or confirm clean.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-08-08T14:35:47Z","updated_at":"2026-08-08T14:35:48Z","closed_at":"2026-08-08T14:35:49Z","external_ref":"https://github.com/samcharles93/archie-core/issues/130","source_system":"github:https://github.com/samcharles93/archie-core/issues/130:130","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786637492617-108-33718282","title":"TEST Verify: MessageType enum for gateway messages","description":"### Acceptance Criteria\n\nTEST TASK, DELETE ME","status":"closed","priority":2,"issue_type":"task","created_at":"2026-08-08T14:35:43Z","updated_at":"2026-08-08T14:35:45Z","closed_at":"2026-08-08T14:35:46Z","external_ref":"https://github.com/samcharles93/archie-core/issues/129","source_system":"github:https://github.com/samcharles93/archie-core/issues/129:129","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786637492617-108-33718282","title":"Verify MessageType enum for gateway messages","description":"Verify that the gateway message MessageType enum is complete, consistently named, and correctly handled by its consumers.\n\nThis issue remains retained as a verification task; implementation changes are only required if the review finds a missing or inconsistent enum value.\n\nAcceptance criteria:\n- Enumerate the gateway message types and their intended meanings.\n- Confirm producers and consumers handle the defined values consistently.\n- Add or update focused tests for any uncovered value or behavior.\n- Record the verification result in the issue before closing.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-08-08T14:35:43Z","updated_at":"2026-08-24T06:57:56Z","closed_at":"2026-08-08T14:35:46Z","external_ref":"https://github.com/samcharles93/archie-core/issues/129","source_system":"github:https://github.com/samcharles93/archie-core/issues/129:129","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786637492590-107-92482ef1","title":"Media utilities: cache, validate, deliver images/audio/video/documents","description":"Shared media utilities for handling images/audio/video/documents across platform adapters: download from the platform, validate (MIME type, size ceiling), cache to avoid re-fetching, and hand back a normalized reference the gateway can attach to a `MessageEvent` or deliver outbound.\n\n### Context for implementers\n\nNo media file exists yet in `internal/gateway`. `MessageEvent` (`internal/gateway/messageevent.go`) is the shared event model this should plug into — check its current field set before adding a parallel media type. This is infrastructure other Gateway epic items depend on conceptually (any adapter method that sends/receives media, e.g. `archie-core-1786637493329-136-49b39c78` BasePlatformAdapter optional methods) but there is no formal `bd dep` between them yet.\n\n### Acceptance Criteria\n\nA shared utility validates MIME type and size before accepting media, caches downloaded media keyed by platform + media ID with TTL/size-bounded eviction, and exposes a normalized reference type usable from any adapter. Oversized or disallowed-MIME media is rejected with a caller-visible error, not silently dropped.\n","status":"open","priority":2,"issue_type":"task","created_at":"2026-08-08T14:35:41Z","updated_at":"2026-08-15T12:46:47Z","external_ref":"https://github.com/samcharles93/archie-core/issues/128","source_system":"github:https://github.com/samcharles93/archie-core/issues/128:128","metadata":null,"labels":["task"],"dependencies":[{"issue_id":"archie-core-1786637492590-107-92482ef1","depends_on_id":"archie-core-1786637493329-136-49b39c78","type":"related","created_at":"2026-08-15T12:46:57Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786637492559-106-5ea2315d","title":"Code-fence-aware message truncation","description":"Truncate outbound messages to a platform's length limit (e.g. Telegram's 4096 chars) without ever cutting inside a ``` code fence — a truncation mid-fence leaves the rest of the message rendered as broken/unclosed markdown on the client.\n\n### Context for implementers\n\nNo truncation helper exists yet in `internal/gateway`. This is distinct from the Markdown→HTML conversion trap documented in `CLAUDE.md` (\"`EscapeMarkdown` does the *inverse* of formatting\" / `go-telegram/bot`'s `SendRichMessage`) — that trap is about format conversion, this issue is about length-based cropping. Keep the two concerns separate: this helper should decide *where* to cut; rendering is a separate step.\n\n### Acceptance Criteria\n\nA message longer than the platform limit is truncated at a safe boundary: never inside an open code fence, preferring a paragraph/sentence boundary before the limit. If truncation would land inside a fence, the cut point backs up to before the fence opens (or the fence is closed and reopened on continuation, if multi-part delivery is in scope — confirm with the maintainer which behavior is wanted before implementing). Covered by a table-driven test with fenced and unfenced inputs at/over the limit.\n","status":"open","priority":2,"issue_type":"task","created_at":"2026-08-08T14:35:39Z","updated_at":"2026-08-23T12:53:18Z","started_at":"2026-08-22T09:32:18Z","external_ref":"https://github.com/samcharles93/archie-core/issues/127","source_system":"github:https://github.com/samcharles93/archie-core/issues/127:127","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786637492559-106-5ea2315d","title":"Code-fence-aware message truncation","description":"Truncate outbound messages to a platform's length limit (e.g. Telegram's 4096 chars) without ever cutting inside a ``` code fence — a truncation mid-fence leaves the rest of the message rendered as broken/unclosed markdown on the client.\n\n### Context for implementers\n\nNo truncation helper exists yet in `internal/gateway`. This is distinct from the Markdown→HTML conversion trap documented in `CLAUDE.md` (\"`EscapeMarkdown` does the *inverse* of formatting\" / `go-telegram/bot`'s `SendRichMessage`) — that trap is about format conversion, this issue is about length-based cropping. Keep the two concerns separate: this helper should decide *where* to cut; rendering is a separate step.\n\n### Acceptance Criteria\n\nA message longer than the platform limit is truncated at a safe boundary: never inside an open code fence, preferring a paragraph/sentence boundary before the limit. If truncation would land inside a fence, the cut point backs up to before the fence opens (or the fence is closed and reopened on continuation, if multi-part delivery is in scope — confirm with the maintainer which behavior is wanted before implementing). Covered by a table-driven test with fenced and unfenced inputs at/over the limit.\n","status":"closed","priority":2,"issue_type":"task","created_at":"2026-08-08T14:35:39Z","updated_at":"2026-08-24T07:12:07Z","started_at":"2026-08-22T09:32:18Z","closed_at":"2026-08-24T07:12:07Z","close_reason":"Implemented code-fence-aware Telegram message splitting with bounded continuation handling and regression coverage [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/127","source_system":"github:https://github.com/samcharles93/archie-core/issues/127:127","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786637492528-105-c2b3caab","title":"TextBatchAggregator for rapid-fire text events","description":"Batch rapid-fire inbound text events from the same sender/channel into a single dispatch instead of invoking the agent loop once per fragment. Chat clients (Telegram in particular) often split a user's thought across several quick messages; dispatching each separately wastes a full agent turn per fragment and can interleave responses oddly.\n\n### Context for implementers\n\nNo aggregator exists yet in `internal/gateway`. This sits upstream of the agent-loop dispatch, after platform adapters normalize events into `MessageEvent` (`internal/gateway/messageevent.go`) but before a turn is started (see `internal/gateway/turn.go`, `turns.go`).\n\n### Acceptance Criteria\n\nText events from the same channel arriving within a short configurable window are coalesced into one aggregated event before dispatch. A single non-batched message is not delayed by more than the window. Aggregation window is configurable, not hardcoded. Covered by a test using an injected clock.\n","status":"open","priority":2,"issue_type":"task","created_at":"2026-08-08T14:35:37Z","updated_at":"2026-08-15T12:46:47Z","external_ref":"https://github.com/samcharles93/archie-core/issues/126","source_system":"github:https://github.com/samcharles93/archie-core/issues/126:126","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786637492498-104-1bde76ae","title":"MessageDeduplicator with TTL-based dedup cache","description":"Prevent duplicate processing of the same platform message. At-least-once delivery (webhook retries, Telegram long-poll re-fetch after a slow ack, forge redelivery) can hand the gateway the same `MessageEvent` more than once; without a dedup layer it gets answered twice.\n\n### Context for implementers\n\n`internal/gateway/messageevent.go` already carries a platform-assigned `ID` field (`MessageEvent.ID`, see line ~59) suitable as a dedup key alongside `ChannelID`/`Platform`. There is currently no dedup file in `internal/gateway` — this is new code, not a rename. Related but distinct: `archie-core-ippu` (gateway: replay and redelivery lose tool activity) covers a different symptom — a replayed *turn* losing its tool-call history in the transcript, not a duplicate inbound message being processed twice. Fix this one first; it may reduce (but won't eliminate) triggers for the other.\n\n### Acceptance Criteria\n\nA `MessageDeduplicator` (or equivalent) keyed on platform + channel + message ID rejects a second delivery of the same message within a configurable TTL window. TTL expiry is covered by a test using an injected clock, not a real sleep. Memory use is bounded (LRU or TTL sweep), not an unbounded map.\n","status":"open","priority":2,"issue_type":"task","created_at":"2026-08-08T14:35:35Z","updated_at":"2026-08-15T12:46:47Z","external_ref":"https://github.com/samcharles93/archie-core/issues/125","source_system":"github:https://github.com/samcharles93/archie-core/issues/125:125","metadata":null,"labels":["task"],"dependencies":[{"issue_id":"archie-core-1786637492498-104-1bde76ae","depends_on_id":"archie-core-ippu","type":"related","created_at":"2026-08-15T12:46:57Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786637492468-103-72e44236","title":"SessionStore interface and implementation","status":"closed","priority":2,"issue_type":"task","created_at":"2026-08-08T14:35:31Z","updated_at":"2026-08-08T14:35:33Z","closed_at":"2026-08-08T14:35:34Z","external_ref":"https://github.com/samcharles93/archie-core/issues/124","source_system":"github:https://github.com/samcharles93/archie-core/issues/124:124","metadata":null,"labels":["task"],"dependency_count":0,"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.","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":"open","priority":3,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-22T11:01:48Z","created_by":"Sam Catlow","updated_at":"2026-08-23T12:56:41Z","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":"open","priority":3,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-22T11:01:48Z","created_by":"Sam Catlow","updated_at":"2026-08-24T07:01:00Z","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}