chore(beads): add event sources and typed reactions epic

Epic archie-core-7d5u with six children: the gating design decision, reaction
delivery, the typed intake family, a GitHub forge webhook receiver behind a
feature flag, idempotency/poll parity, and the docs reconciliation. Linked to
the existing WebhookAdapter beads so intake work is not duplicated.

Only the design bead is ready; the rest are gated behind it.
This commit is contained in:
sam committed 2026-08-21 23:27:31 +10:00
1 parent 99b0da4e35
commit 66bd59b441
1 file changed
+16 -9
+16 -9
View File
@@ -1,11 +1,17 @@
{"_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-21T13:02:54Z","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-21T13:02:54Z","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-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":"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-21T13:26:52Z","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":"{}"}],"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-21T13:26:52Z","dependencies":[{"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":"{}"},{"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":"{}"}],"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.","status":"open","priority":1,"issue_type":"decision","owner":"sam@catlow.tech","created_at":"2026-08-21T13:26:26Z","created_by":"Sam Catlow","updated_at":"2026-08-21T13:26:26Z","dependencies":[{"issue_id":"archie-core-7d5u.1","depends_on_id":"archie-core-7d5u","type":"parent-child","created_at":"2026-08-21T23:26:25Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":4,"comment_count":0}
{"_type":"issue","id":"archie-core-7d5u.2","title":"Reaction delivery that does not silently drop","description":"internal/events is the observability stream and must stay lossy: its doc comment records that bounded buffers DROP on overflow specifically so a stalled dashboard cannot apply backpressure to the task engine. That property is correct and load-bearing -- do not change it.\n\nReactions need the opposite guarantee. Build (or adopt) the delivery path decided in the design bead: at-least-once, with an explicit answer for what happens when a consumer is slow, crashed, or absent.\n\nThe failure this prevents is the one PR #530 was about in a different guise: a system that appears to have done something it did not. A dropped reaction is invisible -- nothing errors, the extension simply never ran, and the operator has no way to tell that from 'the extension ran and chose to do nothing'. Whatever the mechanism, it must be possible to distinguish those two cases after the fact.","acceptance_criteria":"Reactions are delivered at-least-once under a slow consumer; a dropped or undelivered reaction is observable rather than silent; internal/events retains its drop-on-overflow behaviour and its existing tests still pass; the two paths are not conflated in one type.","status":"open","priority":1,"issue_type":"feature","owner":"sam@catlow.tech","created_at":"2026-08-21T13:26:26Z","created_by":"Sam Catlow","updated_at":"2026-08-21T13:26:26Z","dependencies":[{"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":"{}"},{"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":"{}"}],"dependency_count":1,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-7d5u.3","title":"Typed intake family: one registry for every kind of inbound caller","description":"Today each inbound path is wired bespoke. internal/channels/webhook is an HTTP server with per-route HMAC that routes text into gateway.Router for LLM processing; forge work arrives only by polling; cron is tracked separately (archie-core-...-249). Nothing gives them a common shape, so every new caller means new wiring in the composition root.\n\nIntroduce the typed source/intake capability family from the design: an interface a source implements, an owning registry that registers and returns the source type (the shape internal/plugin/architecture_test.go already enforces for engine families), and a declaration of what each source produces.\n\nThis is the 'align webhooks to types of callers' idea made concrete. A forge webhook, a chat webhook, a cron tick and a channel message are all sources; what differs is what they produce, not how they are wired.\n\nExisting webhook adapter work (archie-core-...-275 and children: HMAC server, declarative filters, prompt templates, script transforms, idempotency cache) should be reconciled with this family rather than duplicated -- check those beads before building.","acceptance_criteria":"A source registry exists with a typed contract and family owner; at least two sources are registered through it; adding a source requires no bespoke composition-root wiring; internal/plugin/architecture_test.go still passes.","status":"open","priority":1,"issue_type":"feature","owner":"sam@catlow.tech","created_at":"2026-08-21T13:26:26Z","created_by":"Sam Catlow","updated_at":"2026-08-21T13:26:26Z","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.","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-21T13:25:57Z","dependency_count":0,"dependent_count":0,"comment_count":0}
{"_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-21T13:02:54Z","dependencies":[{"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":"{}"},{"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":"{}"}],"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-21T13:02:54Z","dependencies":[{"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.3","type":"blocks","created_at":"2026-08-21T13:03:26Z","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","type":"parent-child","created_at":"2026-08-21T13:02:54Z","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-21T13:02:39Z","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-21T13:02:39Z","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.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-21T13:02:39Z","dependencies":[{"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":"{}"},{"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":"{}"}],"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-21T13:02:17Z","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}
{"_type":"issue","id":"archie-core-1786756970855-1-72466b33","title":"worktree: retry fails on a dirty worktree left by an interrupted prior attempt","description":"## Problem\n\n`Manager.refresh` (`internal/worktree/worktree.go`) checks out the task's branch without `Force` before hard-resetting to base. If a prior attempt left uncommitted local changes in the worktree — a killed container, or a stage that edits files before ever reaching a commit — go-git's default checkout (`MergeReset` mode) can refuse to reconcile them, even when HEAD is already on the correct branch and the target commit hasn't moved.\n\nThat failure was then compounded by the fallback: the code assumed any checkout failure meant \"the branch doesn't exist yet in this worktree\" and retried with `Create: true`, which fails differently (and much more confusingly) since the branch *does* exist:\n\n```\ncheckout branch feat/1000000000000000-fix-github-issue-514-telegram-response-formatting-concatenat:\na branch named \"refs/heads/feat/1000000000000000-fix-github-issue-514-telegram-response-formatting-concatenat\" already exists\n```\n\n## Evidence\n\nReproduced directly against the actual broken worktree on a live deployment: `git status` showed a modified tracked file and an untracked file left over from an interrupted attempt, HEAD already correctly on the task branch. Retrying the task hit exactly the error above and parked again with the same unhelpful message, on every retry, since nothing about the state changes between attempts.\n\n## Fix\n\nAdd `Force: true` to both checkout attempts in `refresh`. This is safe unconditionally: `refresh` hard-resets to the base commit a few lines later regardless of what checkout leaves behind, so there is no scenario where discarding the working tree's local state here is wrong.\n\nRegression test: `TestPrepareRecoversFromADirtyWorktreeOnRetry` reproduces the exact production error (modified tracked file + untracked file, branch already checked out) and confirms retry now succeeds and correctly restores the tracked file to its base content.","status":"closed","priority":1,"issue_type":"bug","created_at":"2026-08-15T01:22:16Z","updated_at":"2026-08-15T01:22:38Z","closed_at":"2026-08-15T01:22:39Z","external_ref":"https://github.com/samcharles93/archie-core/issues/523","source_system":"github:https://github.com/samcharles93/archie-core/issues/523:523","metadata":null,"labels":["bug"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786751948782-3-837a8fd0","title":"Embed install-type at build time; verify updates against actual running state, not installer exit code","description":"## Problem\n\n`/update` and `/version` currently trust whatever the operator's external `update_check_command`/`update_install_command` reports (`internal/releaseupdate/command.go`). Nothing verifies that the reported version actually matches what's running. This already produced a false success: `/update` reported `archied`/`archie-agent` both updated to `v1.9.0` (the release containing the #468 fix), and a task run immediately after still hit the exact pre-fix failure — see #468 and #511 for the full evidence trail.\n\nSeparately, Archie ships in multiple install shapes (systemd-managed binary, Docker container via compose, possibly others). Nothing today tells the update mechanism which shape a given running component actually is, so a wrong-path update (e.g. attempting a container-style update against a systemd-managed process) is possible and would currently fail silently or claim success incorrectly.\n\n## Design (researched against prior art: restic, Tailscale, Docker/kubectl version output)\n\n**1. Stamp install type at build/release time — never probe for it at runtime.**\nAdd a small cross-cutting `internal/installtype` package: `var channel = \"unknown\"`, read via `Channel() string`. Stamp the real value per release artifact with `-ldflags \"-X .../installtype.channel=systemd\"` (native binary build) or `=container` (Docker image build) — one line per build target in the existing release pipeline, since `archied` and `archie-agent` are already built as separate artifacts for their respective channels.\n\nPrecedent: restic strips its `self-update` subcommand entirely via a build tag for distro-packaged builds — the wrong path isn't just mislabeled, it's absent. Tailscale, despite runtime-detecting almost everything else, treats Docker as an unconditional \"no self-update, manage via image tag\" — even the most sophisticated self-updater in this survey doesn't try to be clever about containers.\n\n**2. Fail closed, never guess.** The `/update` dispatcher must refuse to proceed if `installtype.Channel() == \"unknown\"` or doesn't match what the install/check command expects, with a clear operator-facing message. No fallback path.\n\n**3. Verify after, don't trust the exit code.** After `Installer.Install` returns success, re-check the *actual* running reference (binary path + hash, or container image digest) against the target version, and only then report success to the user. This is the concrete fix for the false-success bug. Tailscale's `confirm()` does the equivalent version comparison before/after in its own updater.\n\n**4. Extend `releaseupdate.Component`** (`internal/releaseupdate/service.go`) with `InstallType string` and `Reference string` fields (e.g. `\"container\"`, `\"ghcr.io/samcharles93/archie-agent:1.9.0@sha256:...\"`), populated by each component: `archied` reads its own compiled-in value; `archie-agent` reports its own the same way (already has a channel back to the daemon over NATS for logs — extend for a status/version response); third-party dependencies Archie doesn't build (e.g. NATS) can't self-report, so their `InstallType`/`Reference` comes from the deployment profile (`deployments/*.toml`) rather than detection.\n\n**5. Surface per-component status** on the Configuration page and in `/version`, structured as one block per component: `{install_type, running_version, reference, latest_available, status}`, where `status` is an enum (`ok` / `update_available` / `drift` / `unknown`) — not a bare color, with the actual comparison (e.g. running digest vs. latest digest) visible on hover/expand. Modeled on `docker version`'s Client/Server nested-block convention, which `kubectl version` independently converged on too.\n\n## Relates to\n\n- #468 (the fix this update-verification gap let slip through undetected)\n- #511 (update command UX — this issue is the underlying mechanism that makes accurate progress/success reporting possible; #511 shouldn't report a nicer-looking version of a still-unverified claim)","notes":"2026-08-21: design point 3 committed as c25799e on branch fix/522-verify-update-took-effect (not pushed).\n\nReport.Verify(running) partitions every claimed component into Confirmed/Drift/Unverified. Ground truth is the relaying process's own compiled-in gatewayVersion. Telegram now has three wordings: confirmed, 'could not confirm which version is actually running', and 'Update did NOT take effect' with per-component detail. Placeholders 'unknown' (watchdog default) and 'dev' (unstamped build) are unverifiable, never versions. Agent stays Unverified by design and is named as unchecked in the success message.\n\nGate: task check exit 0, golangci-lint 0 issues, gofumpt clean. Three adversarial review passes; all findings fixed. Regression tests proven to fail againstLine truncated
{"_type":"issue","id":"archie-core-1786751948782-3-837a8fd0","title":"Embed install-type at build time; verify updates against actual running state, not installer exit code","description":"## Problem\n\n`/update` and `/version` currently trust whatever the operator's external `update_check_command`/`update_install_command` reports (`internal/releaseupdate/command.go`). Nothing verifies that the reported version actually matches what's running. This already produced a false success: `/update` reported `archied`/`archie-agent` both updated to `v1.9.0` (the release containing the #468 fix), and a task run immediately after still hit the exact pre-fix failure — see #468 and #511 for the full evidence trail.\n\nSeparately, Archie ships in multiple install shapes (systemd-managed binary, Docker container via compose, possibly others). Nothing today tells the update mechanism which shape a given running component actually is, so a wrong-path update (e.g. attempting a container-style update against a systemd-managed process) is possible and would currently fail silently or claim success incorrectly.\n\n## Design (researched against prior art: restic, Tailscale, Docker/kubectl version output)\n\n**1. Stamp install type at build/release time — never probe for it at runtime.**\nAdd a small cross-cutting `internal/installtype` package: `var channel = \"unknown\"`, read via `Channel() string`. Stamp the real value per release artifact with `-ldflags \"-X .../installtype.channel=systemd\"` (native binary build) or `=container` (Docker image build) — one line per build target in the existing release pipeline, since `archied` and `archie-agent` are already built as separate artifacts for their respective channels.\n\nPrecedent: restic strips its `self-update` subcommand entirely via a build tag for distro-packaged builds — the wrong path isn't just mislabeled, it's absent. Tailscale, despite runtime-detecting almost everything else, treats Docker as an unconditional \"no self-update, manage via image tag\" — even the most sophisticated self-updater in this survey doesn't try to be clever about containers.\n\n**2. Fail closed, never guess.** The `/update` dispatcher must refuse to proceed if `installtype.Channel() == \"unknown\"` or doesn't match what the install/check command expects, with a clear operator-facing message. No fallback path.\n\n**3. Verify after, don't trust the exit code.** After `Installer.Install` returns success, re-check the *actual* running reference (binary path + hash, or container image digest) against the target version, and only then report success to the user. This is the concrete fix for the false-success bug. Tailscale's `confirm()` does the equivalent version comparison before/after in its own updater.\n\n**4. Extend `releaseupdate.Component`** (`internal/releaseupdate/service.go`) with `InstallType string` and `Reference string` fields (e.g. `\"container\"`, `\"ghcr.io/samcharles93/archie-agent:1.9.0@sha256:...\"`), populated by each component: `archied` reads its own compiled-in value; `archie-agent` reports its own the same way (already has a channel back to the daemon over NATS for logs — extend for a status/version response); third-party dependencies Archie doesn't build (e.g. NATS) can't self-report, so their `InstallType`/`Reference` comes from the deployment profile (`deployments/*.toml`) rather than detection.\n\n**5. Surface per-component status** on the Configuration page and in `/version`, structured as one block per component: `{install_type, running_version, reference, latest_available, status}`, where `status` is an enum (`ok` / `update_available` / `drift` / `unknown`) — not a bare color, with the actual comparison (e.g. running digest vs. latest digest) visible on hover/expand. Modeled on `docker version`'s Client/Server nested-block convention, which `kubectl version` independently converged on too.\n\n## Relates to\n\n- #468 (the fix this update-verification gap let slip through undetected)\n- #511 (update command UX — this issue is the underlying mechanism that makes accurate progress/success reporting possible; #511 shouldn't report a nicer-looking version of a still-unverified claim)","notes":"2026-08-21: design point 3 committed as c25799e on branch fix/522-verify-update-took-effect (not pushed).\n\nReport.Verify(running) partitions every claimed component into Confirmed/Drift/Unverified. Ground truth is the relaying process's own compiled-in gatewayVersion. Telegram now has three wordings: confirmed, 'could not confirm which version is actually running', and 'Update did NOT take effect' with per-component detail. Placeholders 'unknown' (watchdog default) and 'dev' (unstamped build) are unverifiable, never versions. Agent stays Unverified by design and is named as unchecked in the success message.\n\nGate: task check exit 0, golangci-lint 0 issues, gofumpt clean. Three adversarial review passes; all findings fixed. Regression tests proven to fail againstLine truncated
{"_type":"issue","id":"archie-core-1786749700606-6-bf6aa32d","title":"agent containers: push fails with 'permission denied' reading .git/objects, distinct from #468","description":"## Problem\n\nTask `#445` (daemon: label dispatch trigger) parked at the `commit-push` stage with:\n\n```\npush fix/445-daemon-label-dispatch-trigger-with-empty-label-matches-every:\ngetting wanted object 295b030cc6face20f8a377e94076922c460576c1:\nopenat objects/29/5b030cc6face20f8a377e94076922c460576c1: permission denied\n```\n\nThis is a different failure mode than #468 (git's \"dubious ownership\" ownership *check*, resolved by `safe.directory`). Here git gets *past* whatever ownership check applies and fails on an actual filesystem permission bit when reading a loose object from the bind-mounted worktree's `.git/objects/`.\n\n## Why this is probably not fixed by #468\n\n`safe.directory` only tells git to trust a repo it doesn't own — it does not change the actual read/write permission bits on the files. If the object file was written by a process running as a different UID than the archie-agent container's process (e.g. daemon-side `worktree` package operations running as the host user, vs. the container process), a straightforward `openat ... permission denied` on a specific loose object is consistent with a UID mismatch on the bind mount that `safe.directory` does nothing for.\n\nNeither `Dockerfile` nor `docker-compose.yml` sets a `USER`/`user:` for the agent image, so the container should be running as root by default — worth confirming whether the deployment actually runs it as root (Docker `userns-remap` would explain root-inside behaving as an unprivileged UID on the host, which would produce exactly this symptom).\n\n## Ask\n\nConfirm the UID the archie-agent process actually runs as versus the UID that owns files under the worktree's `.git/objects/` on the host, and fix the mismatch (consistent UID, or `chown`/`chmod` the bind mount appropriately before handing it to the container).","status":"closed","priority":1,"issue_type":"bug","assignee":"Sam Catlow","created_at":"2026-08-14T23:18:58Z","updated_at":"2026-08-17T22:40:02Z","started_at":"2026-08-17T22:27:08Z","closed_at":"2026-08-17T22:40:02Z","close_reason":"Confirmed root cause: agent containers run as root (no USER in Dockerfile, no userns-remap anywhere in docker-compose.yml/internal/container/pool.go), so a commit the agent writes to the bind-mounted worktree lands owned by UID 0 on the host. The daemon later reads those same loose objects to push, running as its own non-root host user -- 'openat objects/../..: permission denied'. Fixed: containerEnv() now passes the daemon's own os.Getuid()/os.Getgid() as WORKTREE_UID/WORKTREE_GID; hybridTrees.Push (the single choke point before the push RPC) chowns the worktree back to that owner first. Adversarial review (fresh subagent) found one real bug in the first pass -- chownTree used os.Chown, which follows symlinks and fails on a legitimately-tracked-but-dangling symlink, which would have aborted a push that would otherwise have succeeded (worse than the original bug). Fixed with os.Lchown plus a regression test proving it against a dangling symlink. Full task check clean; all other review findings (full-tree walk cost, minor test-hygiene notes) were judged non-blocking by the reviewer.","external_ref":"https://github.com/samcharles93/archie-core/issues/520","source_system":"github:https://github.com/samcharles93/archie-core/issues/520:520","metadata":null,"labels":["bug"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786749700580-5-e3878224","title":"/stop does not kill an in-flight archie-agent NATS worker or its container — task keeps running","description":"## This is the most important finding from today's investigation.\n\n`/stop` is meant to be an emergency brake. It is not one: it reported success (\"🛑 Stopped task(s) #5\") while the task kept running, kept burning tokens, and kept flooding the logs with errors for at least the next 20+ minutes.\n\n## Root cause\n\n`/stop` → `Gateway.stopRunningTasks` → `router.Controller.StopRunning` (`internal/gateway/tasks.go:227`) → `Daemon.CancelRunningTasks` (`internal/daemon/running.go:114`) → `runningTasks.stopAll`, which cancels a `context.CancelFunc` registered in an in-process map (`internal/daemon/running.go:36-52`, populated by `Daemon.process` at `internal/daemon/daemon.go:800`).\n\nThat context governs only `archied`'s own orchestration goroutine for the task. In the NATS-dispatched execution model (`internal/app/agentworker`), the actual work happens in a **separate process** — the archie-agent worker — that pulled a stage request off NATS and is running it inside `handleSingleStageRequest` / `runMainLoopWithDelay` (`internal/app/agentworker/stage_loop.go`), driven by its own top-level context that has no connection whatsoever to the daemon's per-task cancel registry. Cancelling the daemon-side context does not reach it. There is currently no signal, subject, or mechanism by which `archied` can tell an already-dispatched archie-agent worker to stop.\n\nThis matches what was observed live: task `#1000000000000001` was reported stopped, remained `Working` in the dashboard 20+ minutes later, and its log showed 996 `handle failed err={}` entries in the minutes after the stop request — the worker was still very much alive and looping.\n\n## Expected behavior\n\n`/stop` (and task Cancel generally) should be a hard kill for both halves of the execution:\n1. `archied`'s own orchestration (already works, via the existing context cancellation).\n2. The archie-agent worker actually doing the work for that task.\n\n## Suggested fix\n\nContainers are per-task and Docker-managed by the daemon regardless of deployment shape (`internal/container/pool.go`). The most reliable \"dead in its tracks\" mechanism is for `/stop`/`Cancel` to kill the task's container directly via the Docker client the pool already holds, rather than relying on context propagation across a process boundary that current code has no way to cross. A NATS-side alternative (publish a cancellation event on a per-task subject that `stage_loop.go`'s loop checks between fetch and ack, or have the daemon revoke the task lease so the worker's next `Ack`/`Respond` fails) is a secondary/defense-in-depth improvement, but killing the container is what actually guarantees the work stops.\n\n## Related\n\nThe redelivery-storm behavior after a stop/nak (#517) and the swallowed error detail (#516) both make this worse in practice — an operator watching the logs after `/stop` sees hundreds of contentless error lines with no way to tell whether the stop is taking effect.","status":"closed","priority":1,"issue_type":"bug","assignee":"Sam Catlow","created_at":"2026-08-14T23:18:46Z","updated_at":"2026-08-17T22:38:57Z","started_at":"2026-08-17T14:31:11Z","closed_at":"2026-08-17T22:38:57Z","close_reason":"Root cause found after Sam confirmed live testing still showed the task's in-flight tool calls/generation continuing tens of seconds to ~2 minutes after /stop reported success. internal/container/pool.go Release() always slept the configured GracePeriod and always used Docker's default ~10s graceful SIGTERM-then-SIGKILL timeout, even when the release was happening because the task's context had just been cancelled by /stop -- so a cancelled task's container (and the in-flight work inside it) could sit doing nothing for up to GracePeriod+~10s before actually dying. Fixed with a new releaseDecision(ctx, grace) helper: a cancelled ctx now skips the grace sleep entirely and requests an immediate SIGKILL (ContainerStopOptions.Timeout=0) instead of a graceful wait; a live ctx (normal completion) keeps the original behaviour byte-for-byte. Red-then-green with 3 new unit tests (internal/container/pool_test.go), task check clean, adversarially reviewed by a fresh subagent with zero blocking findings -- context-chain trace, Docker Timeout=0 semantics, and struct-equivalence for the unchanged path were all independently verified against the moby client source.","external_ref":"https://github.com/samcharles93/archie-core/issues/519","source_system":"github:https://github.com/samcharles93/archie-core/issues/519:519","metadata":null,"labels":["bug","gateway"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786749700549-4-d2331d9d","title":"dashboard: task timeline shows 'No events yet' for every task regardless of status or stage","description":"## Problem\n\nEvery task's expanded timeline on `/tasks` reads \"No events yet — This task has not recorded any transitions,\" regardless of status or how far the task progressed. Confirmed live across a `Working` task and multiple `Parked` tasks at different stages:\n\n- `#1000000000000001` — Working, implement/baseline, 20+ minutes in\n- `#1000000000000000` — Parked at implement/baseline (go build/VCS-stamp failure)\n- `#445` — Parked at tdd/commit-push (git push permission error)\n\nAll three show the identical empty-timeline message. This isn't isolated to the currently-stuck task — the timeline feature appears non-functional for the whole deployment, which means the dashboard's per-task \"what actually happened\" view (the thing an operator reaches for first when a task needs attention) carries no information at all.\n\n## Impact\n\nCombined with the logging defect in #516 (errors serialize to `{}`), this leaves an operator with almost no way to diagnose a stuck or parked task from the dashboard — no timeline, and the log detail that does exist is empty.\n\n## Ask\n\nFind where task transition events are supposed to be written (`store.Transition`, `d.emit(events.Event{...})`, etc.) versus what the timeline UI/API actually queries, and reconcile — either events aren't being persisted for these tasks, or the timeline endpoint is querying the wrong key/table.","status":"closed","priority":1,"issue_type":"bug","created_at":"2026-08-14T23:17:17Z","updated_at":"2026-08-15T00:35:51Z","started_at":"2026-08-15T00:03:04Z","closed_at":"2026-08-15T00:35:51Z","external_ref":"https://github.com/samcharles93/archie-core/issues/518","source_system":"github:https://github.com/samcharles93/archie-core/issues/518:518","metadata":null,"labels":["bug","webui"],"dependency_count":0,"dependent_count":0,"comment_count":0}
@@ -24,9 +30,10 @@
{"_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-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-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-21T13:26:52Z","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-21T13:03:15Z","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-21T13:03:15Z","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-21T13:03:15Z","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-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-21T13:03:15Z","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.2","type":"blocks","created_at":"2026-08-21T13:03:26Z","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":"{}"}],"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-21T13:03:15Z","dependencies":[{"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":"{}"},{"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":"{}"}],"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":"open","priority":2,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-20T14:04:33Z","created_by":"Sam Catlow","updated_at":"2026-08-21T11:57:53Z","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-21T11:57:53Z","external_ref":"https://github.com/samcharles93/archie-core/issues/532","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}
@@ -54,7 +61,7 @@
{"_type":"issue","id":"archie-core-tje.1","title":"Extract archie-agent task subscription concern","description":"## Problem\\nmain.go owns boot task discovery and taskrun subscription selection in addition to process composition.\\n\\n## Scope\\nMove bootTaskID and subscribeTaskRuns into a concern-named cmd/archie-agent source file, preserving dedicated-container versus shared-queue behavior and existing tests.\\n\\n## Acceptance\\n- boot brief parsing and taskrun subscription selection are outside main.go\\n- behavior and logging remain unchanged\\n- focused tests and task check pass","acceptance_criteria":"Subscription concern is outside main.go with unchanged behavior; tests and task check pass","notes":"Implementation and validation are complete in /tmp/archie-core-agent-cleanup on branch refactor/archie-agent-main-cleanup, but delivery is pending: changes are uncommitted, not integrated into the target branch, and not pushed. Do not close until those delivery steps are complete.\n Validation completed: task subscription focused tests and fresh review clean.\nDelivered on review branch refactor/archie-agent-main-cleanup at de242f8; pending PR review/merge.","status":"closed","priority":2,"issue_type":"task","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-13T16:10:44Z","created_by":"Sam Catlow","updated_at":"2026-08-14T14:53:09Z","started_at":"2026-08-13T17:25:20Z","closed_at":"2026-08-14T14:53:09Z","close_reason":"Merged to main in PR #480 at 52738f5; implementation commit de242f8 passed task check, race tests, lint, and independent review","external_ref":"https://github.com/samcharles93/archie-core/issues/471","dependencies":[{"issue_id":"archie-core-tje.1","depends_on_id":"archie-core-tje","type":"parent-child","created_at":"2026-08-13T16:10:44Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-tje.2","title":"Extract archie-agent stage fetch loop","description":"## Problem\\nmain.go contains the stageBus contract and fetch-handle-ack loop, obscuring startup composition.\\n\\n## Scope\\nMove stageBus and runMainLoop into a stage-loop concern file without changing ack, nak, retry, cancellation, or shutdown semantics.\\n\\n## Acceptance\\n- stage loop is outside main.go\\n- all error and cancellation paths remain covered\\n- focused tests and task check pass","acceptance_criteria":"Stage loop is outside main.go with ack/nak/cancellation behavior preserved; tests and task check pass","notes":"Implementation and validation are complete in /tmp/archie-core-agent-cleanup on branch refactor/archie-agent-main-cleanup, but delivery is pending: changes are uncommitted, not integrated into the target branch, and not pushed. Do not close until those delivery steps are complete.\n Validation completed: stage-loop path tests, race tests, lint, task check, and fresh review clean.\nDelivered on review branch refactor/archie-agent-main-cleanup at de242f8; pending PR review/merge.","status":"closed","priority":2,"issue_type":"task","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-13T16:10:44Z","created_by":"Sam Catlow","updated_at":"2026-08-14T14:53:09Z","started_at":"2026-08-13T17:33:26Z","closed_at":"2026-08-14T14:53:09Z","close_reason":"Merged to main in PR #480 at 52738f5; implementation commit de242f8 passed task check, race tests, lint, and independent review","external_ref":"https://github.com/samcharles93/archie-core/issues/472","dependencies":[{"issue_id":"archie-core-tje.2","depends_on_id":"archie-core-tje","type":"parent-child","created_at":"2026-08-13T16:10:44Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-tje.3","title":"Extract archie-agent MCP provider lifecycle","description":"## Problem\\nmain.go contains MCP transport selection, provider startup/discovery, registry population, and cleanup alongside process wiring.\\n\\n## Scope\\nMove mcpProviderSet, startMCPProviders, and cleanup into an MCP-provider concern file. Preserve optional-provider failure isolation and transport behavior.\\n\\n## Acceptance\\n- MCP provider lifecycle is outside main.go\\n- optional failures and cleanup semantics remain unchanged and tested\\n- task check passes","acceptance_criteria":"MCP lifecycle is outside main.go with failure isolation and cleanup preserved; tests and task check pass","notes":"Implementation and validation are complete in /tmp/archie-core-agent-cleanup on branch refactor/archie-agent-main-cleanup, but delivery is pending: changes are uncommitted, not integrated into the target branch, and not pushed. Do not close until those delivery steps are complete.\n Validation completed: MCP lifecycle tests, lint, task check, and fresh review clean.\nDelivered on review branch refactor/archie-agent-main-cleanup at de242f8; pending PR review/merge.","status":"closed","priority":2,"issue_type":"task","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-13T16:10:44Z","created_by":"Sam Catlow","updated_at":"2026-08-14T14:53:09Z","started_at":"2026-08-13T17:04:26Z","closed_at":"2026-08-14T14:53:09Z","close_reason":"Merged to main in PR #480 at 52738f5; implementation commit de242f8 passed task check, race tests, lint, and independent review","external_ref":"https://github.com/samcharles93/archie-core/issues/473","dependencies":[{"issue_id":"archie-core-tje.3","depends_on_id":"archie-core-tje","type":"parent-child","created_at":"2026-08-13T16:10:44Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":1,"comment_count":0}
{"_type":"issue","id":"archie-core-tje.4","title":"Extract archie-agent stage request handling","description":"## Problem\\nmain.go decodes, executes, and responds to single-stage requests in the same file as process startup.\\n\\n## Scope\\nMove handle and its request/response orchestration into a stage-handler concern file after the MCP lifecycle seam is available. Preserve reply-address validation, provider setup, response encoding, and logging.\\n\\n## Acceptance\\n- stage request handling is outside main.go\\n- decode, reply, provider, execution, encode, and publish error paths remain covered\\n- task check passes","acceptance_criteria":"Stage request handling is outside main.go with all boundary error semantics preserved; tests and task check pass","notes":"Implementation and validation are complete in /tmp/archie-core-agent-cleanup on branch refactor/archie-agent-main-cleanup, but delivery is pending: changes are uncommitted, not integrated into the target branch, and not pushed. Do not close until those delivery steps are complete.\n Validation completed: single-stage boundary/MCP assembly tests, task check, and fresh review clean.\nDelivered on review branch refactor/archie-agent-main-cleanup at de242f8; pending PR review/merge.","status":"closed","priority":2,"issue_type":"task","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-13T16:10:44Z","created_by":"Sam Catlow","updated_at":"2026-08-14T14:53:09Z","started_at":"2026-08-13T17:41:10Z","closed_at":"2026-08-14T14:53:09Z","close_reason":"Merged to main in PR #480 at 52738f5; implementation commit de242f8 passed task check, race tests, lint, and independent review","external_ref":"https://github.com/samcharles93/archie-core/issues/474","dependencies":[{"issue_id":"archie-core-tje.4","depends_on_id":"archie-core-tje","type":"parent-child","created_at":"2026-08-13T16:10:45Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-tje.4","depends_on_id":"archie-core-tje.3","type":"blocks","created_at":"2026-08-13T16:10:54Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":1,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-tje.4","title":"Extract archie-agent stage request handling","description":"## Problem\\nmain.go decodes, executes, and responds to single-stage requests in the same file as process startup.\\n\\n## Scope\\nMove handle and its request/response orchestration into a stage-handler concern file after the MCP lifecycle seam is available. Preserve reply-address validation, provider setup, response encoding, and logging.\\n\\n## Acceptance\\n- stage request handling is outside main.go\\n- decode, reply, provider, execution, encode, and publish error paths remain covered\\n- task check passes","acceptance_criteria":"Stage request handling is outside main.go with all boundary error semantics preserved; tests and task check pass","notes":"Implementation and validation are complete in /tmp/archie-core-agent-cleanup on branch refactor/archie-agent-main-cleanup, but delivery is pending: changes are uncommitted, not integrated into the target branch, and not pushed. Do not close until those delivery steps are complete.\n Validation completed: single-stage boundary/MCP assembly tests, task check, and fresh review clean.\nDelivered on review branch refactor/archie-agent-main-cleanup at de242f8; pending PR review/merge.","status":"closed","priority":2,"issue_type":"task","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-13T16:10:44Z","created_by":"Sam Catlow","updated_at":"2026-08-14T14:53:09Z","started_at":"2026-08-13T17:41:10Z","closed_at":"2026-08-14T14:53:09Z","close_reason":"Merged to main in PR #480 at 52738f5; implementation commit de242f8 passed task check, race tests, lint, and independent review","external_ref":"https://github.com/samcharles93/archie-core/issues/474","dependencies":[{"issue_id":"archie-core-tje.4","depends_on_id":"archie-core-tje.3","type":"blocks","created_at":"2026-08-13T16:10:54Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-tje.4","depends_on_id":"archie-core-tje","type":"parent-child","created_at":"2026-08-13T16:10:45Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":1,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-tje","title":"Decompose cmd/archie-agent main.go by concern","description":"## Problem\\ncmd/archie-agent/main.go is 430 lines and mixes process startup, task subscription selection, stage-loop execution, MCP provider lifecycle, and request handling. This makes unrelated changes collide and obscures the composition boundary.\\n\\n## Scope\\nTrack small behavior-preserving extractions into concern-named files within cmd/archie-agent. Keep main.go focused on flags, startup ordering, construction, shutdown, and invoking the worker loop. No new packages or architecture changes.\\n\\n## Acceptance\\n- child tasks move one concern at a time with tests unchanged or improved\\n- main.go retains process-level input and composition only\\n- each child passes task check and fresh adversarial review","acceptance_criteria":"All child extractions complete; main.go contains process input and composition only; task check passes","notes":"Implementation and validation are complete in /tmp/archie-core-agent-cleanup on branch refactor/archie-agent-main-cleanup, but delivery is pending: changes are uncommitted, not integrated into the target branch, and not pushed. Do not close until those delivery steps are complete.\n Validation already completed: main.go reduced 430→136 lines; package tests/race/vet/build/lint pass; full task check passes; final fresh adversarial review reported zero findings.\nCorrected architecture migration pushed for review at commit de242f81c1b6309cdc984ded8e2f01fad89097b9 on branch refactor/archie-agent-main-cleanup. Rebased onto origin/main 58eae75. Focused tests, race, changed-line lint, full task check, and final independent review all pass. Keep in_progress until PR merge.","status":"closed","priority":2,"issue_type":"epic","owner":"sam@catlow.tech","created_at":"2026-08-13T16:10:24Z","created_by":"Sam Catlow","updated_at":"2026-08-14T14:53:09Z","started_at":"2026-08-13T17:57:45Z","closed_at":"2026-08-14T14:53:09Z","close_reason":"Merged to main in PR #480 at 52738f5; implementation commit de242f8 passed task check, race tests, lint, and independent review","external_ref":"https://github.com/samcharles93/archie-core/issues/475","dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786637501304-434-efae0b99","title":"agent containers: git dubious-ownership causes all gates to fail","description":"## Problem\n\nAgent containers bind-mount the worktree from the host at `/data/worktree`, where the owning UID differs from the container user's UID. Git refuses to operate in such directories (\"fatal: detected dubious ownership in repository\"), and the Go toolchain calls git for VCS status during `go build`/`go test`/`go vet`.\n\nThis means every gate — baseline gate, build gate, TDD repro gate — fails immediately, before any real work begins. Agents burn tokens trying to fix the environment instead of working on the assigned issue.\n\n## Evidence\n\n- Task for issue #441 burned 557K tokens across 29 iterations and parked with `gate_failed_final` — the agent never reached the actual multi-forge fix\n- `go build` within the container fails with `error obtaining VCS status: exit status 128`\n- The agent's uncommitted `build_test.go` recognized the real cause: \"A pre-existing git dubious-ownership issue causes the build to fail\"\n\n## Fix\n\nAdd `git config --global --add safe.directory /data/worktree` at archie-agent startup. The worktree mount path is always `/data/worktree` (storage.WorktreeMountDir). The command is best-effort: if git isn't installed, the agent logs a warning and continues — it remains usable for repos without gate commands.\n\n## Files\n\n- `cmd/archie-agent/main.go`: run git safe.directory config after logger init","status":"closed","priority":2,"issue_type":"bug","created_at":"2026-08-12T04:38:10Z","updated_at":"2026-08-15T12:57:37Z","closed_at":"2026-08-15T12:57:37Z","close_reason":"Fixed: internal/infrastructure/agentgit/safety.go's MarkSafe adds the mounted worktree to git's global safe.directory list, and it is wired into the actual agent-container startup path -- internal/app/agentworker/worker.go:63,84 calls dependencies.markSafe(ctx, workDir, log) unconditionally in run(), before NATS connect and before any gate executes. Confirmed by grep this is the only non-test call site (worker.go), so it isn't dead/unwired code. go test ./internal/infrastructure/agentgit/... and ./internal/app/agentworker/... -race -count=1 both pass, including worker_test.go coverage that exercises the run() path with markSafe wired in. This matches the exact fix archie-core-1786749700606-6-bf6aa32d already describes as done ('#468 ... resolved by safe.directory').","external_ref":"https://github.com/samcharles93/archie-core/issues/468","source_system":"github:https://github.com/samcharles93/archie-core/issues/468:468","metadata":null,"labels":["bug"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786637501270-433-dc1a0bc2","title":"Telegram gateway: show tool calls inline during chat turns","description":"The Telegram chat agent returns only the final answer. The user cannot see which tools are being called, their parameters, or their results. This makes debugging agent behavior (hallucinations, wrong tool choices, footguns like `systemctl stop` vs `restart`) impossible from the chat side.\n\n## Desired behavior\n\nAfter each tool call completes, the gateway sends a compact inline message showing the tool name and a one-line summary of the result, before the next tool call or final answer. Similar to how Hermes surfaces tool calls in Telegram.\n\nExample format:\n```\n🔧 memory_edit — added entry\n🔧 terminal — systemctl --user stop archied (exit 0)\n🔧 terminal — systemctl --user start archied (exit 0)\n```\n\nThen the final answer.\n\n## Scope\n\n`internal/channels/telegram/` only. Behind a config flag `[chat.telegram] show_tool_calls = true` so it can be toggled.\n\n## Technical approach\n\nCurrently the call chain is:\n\n```\nsubmitTurn → router.RouteStream(turnCtx, gm, draft.onDelta)\n → r.LLMStream(ctx, msg, onDelta)\n → TurnRunner.Run(ctx, msg, onDelta)\n → prepared.Generate(ctx, req, onDelta)\n```\n\nOnly `onDelta` (text streaming) is threaded through. Tool calls happen inside `Generate` but there's no callback back to the gateway.\n\n### What needs to change\n\n1. **Add a tool-call observer callback** — either extend `LLMStreamResponder` signature or add a separate `OnToolCall` field to `gateway.Router` struct, plumbing it through `TurnRunner` → `TurnModel`/`PreparedTurnModel.Generate` so model providers can report tool invocations\n\n2. **Model provider integration** — the chat turn model (`cmd/archied/chat_turn_model.go`) and any provider-specific `Generate` implementations need to call the observer when a tool is executed, passing tool name + result summary\n\n3. **Telegram gateway wiring** — in `submitTurn` (`internal/channels/telegram/telegram.go`), if `show_tool_calls` config is true, wire the observer to send a compact inline message via `sendMessage` before the final reply\n\n4. **Config plumbing** — add `ShowToolCalls bool` to the Telegram gateway config struct and read it from `[chat.telegram] show_tool_calls` in `telegram_setup.go`\n\n### Key files\n\n| File | Role |\n|------|------|\n| `internal/gateway/gateway.go` | `RouteStream`, `Router` struct (add observer field) |\n| `internal/gateway/turn.go` | `TurnRunner.Run`, `PreparedTurnModel.Generate` signature |\n| `cmd/archied/chat_turn_model.go` | Model provider `Generate` — where tool calls execute |\n| `internal/channels/telegram/telegram.go` | `submitTurn` — wire observer + send messages |\n| `cmd/archied/telegram_setup.go` | Config reading + gateway construction |\n","status":"closed","priority":2,"issue_type":"feature","created_at":"2026-08-12T04:20:52Z","updated_at":"2026-08-14T15:07:34Z","closed_at":"2026-08-14T15:07:34Z","external_ref":"https://github.com/samcharles93/archie-core/issues/467","source_system":"github:https://github.com/samcharles93/archie-core/issues/467:467","metadata":null,"labels":["enhancement"],"dependency_count":0,"dependent_count":0,"comment_count":0}
@@ -204,7 +211,7 @@
{"_type":"issue","id":"archie-core-1786637497395-289-8308ccd7","title":"Verify: WebhookAdapter: declarative filters","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:49:28Z","updated_at":"2026-08-08T14:49:30Z","closed_at":"2026-08-08T14:49:31Z","external_ref":"https://github.com/samcharles93/archie-core/issues/310","source_system":"github:https://github.com/samcharles93/archie-core/issues/310:310","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786637497373-288-22cb0426","title":"Verify: WebhookAdapter: HTTP server with per-route HMAC validation","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:49:23Z","updated_at":"2026-08-08T14:49:25Z","closed_at":"2026-08-08T14:49:26Z","external_ref":"https://github.com/samcharles93/archie-core/issues/309","source_system":"github:https://github.com/samcharles93/archie-core/issues/309:309","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786637497353-287-96a3e24c","title":"MS Graph webhook adapter: validationToken handshake","description":"Implement MS Graph webhook adapter with validationToken handshake for subscription verification, clientState verification, and CIDR IP allowlisting.","notes":"Not started. internal/channels/webhook/webhook.go has no MS-Graph-specific handling at all -- no validationToken query-param echo, no clientState check, no CIDR allowlist. This is likely a separate RouteConfig variant or a dedicated handler function, since MS Graph's subscription-verification handshake (echo validationToken as text/plain on subscribe) doesn't fit the existing POST-body-in/HMAC-out flow.","status":"open","priority":2,"issue_type":"task","created_at":"2026-08-08T14:49:20Z","updated_at":"2026-08-15T12:51:54Z","external_ref":"https://github.com/samcharles93/archie-core/issues/308","source_system":"github:https://github.com/samcharles93/archie-core/issues/308:308","metadata":null,"labels":["task"],"dependencies":[{"issue_id":"archie-core-1786637497353-287-96a3e24c","depends_on_id":"archie-core-1786637497036-275-8838629e","type":"related","created_at":"2026-08-15T12:52:04Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786637497328-286-9c985f28","title":"WebhookAdapter: idempotency cache","description":"Implement TTL-based idempotency cache to deduplicate retried webhook deliveries. Cache based on webhook event ID and route.","notes":"Not started. No cache of any kind in internal/channels/webhook/webhook.go. Needs a webhook event ID (route-scoped) -\u003e TTL cache; most platforms send a stable delivery/event ID header (e.g. GitHub's X-GitHub-Delivery) usable as the key. Related to the gateway-level archie-core-1786637492498-104-1bde76ae (MessageDeduplicator) which solves the same class of problem one layer up -- check whether one mechanism can serve both before building a second cache.","status":"open","priority":2,"issue_type":"task","created_at":"2026-08-08T14:49:17Z","updated_at":"2026-08-15T12:51:54Z","external_ref":"https://github.com/samcharles93/archie-core/issues/307","source_system":"github:https://github.com/samcharles93/archie-core/issues/307:307","metadata":null,"labels":["task"],"dependencies":[{"issue_id":"archie-core-1786637497328-286-9c985f28","depends_on_id":"archie-core-1786637492498-104-1bde76ae","type":"related","created_at":"2026-08-15T12:52:03Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-1786637497328-286-9c985f28","depends_on_id":"archie-core-1786637497036-275-8838629e","type":"related","created_at":"2026-08-15T12:52:04Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786637497328-286-9c985f28","title":"WebhookAdapter: idempotency cache","description":"Implement TTL-based idempotency cache to deduplicate retried webhook deliveries. Cache based on webhook event ID and route.","notes":"Not started. No cache of any kind in internal/channels/webhook/webhook.go. Needs a webhook event ID (route-scoped) -\u003e TTL cache; most platforms send a stable delivery/event ID header (e.g. GitHub's X-GitHub-Delivery) usable as the key. Related to the gateway-level archie-core-1786637492498-104-1bde76ae (MessageDeduplicator) which solves the same class of problem one layer up -- check whether one mechanism can serve both before building a second cache.","status":"open","priority":2,"issue_type":"task","created_at":"2026-08-08T14:49:17Z","updated_at":"2026-08-15T12:51:54Z","external_ref":"https://github.com/samcharles93/archie-core/issues/307","source_system":"github:https://github.com/samcharles93/archie-core/issues/307:307","metadata":null,"labels":["task"],"dependencies":[{"issue_id":"archie-core-1786637497328-286-9c985f28","depends_on_id":"archie-core-1786637492498-104-1bde76ae","type":"related","created_at":"2026-08-15T12:52:03Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-1786637497328-286-9c985f28","depends_on_id":"archie-core-1786637497036-275-8838629e","type":"related","created_at":"2026-08-15T12:52:04Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-1786637497328-286-9c985f28","depends_on_id":"archie-core-7d5u.5","type":"relates-to","created_at":"2026-08-21T23:27:06Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786637497299-285-f4780816","title":"WebhookAdapter: deliver_only mode","description":"Implement deliver_only mode that skips agent processing and directly renders the prompt template as a deliverable (e.g. plain text, HTML, JSON response).","notes":"Not started, despite the package doc comment's claim: webhook.go:1-3 says 'Outbound delivery is not supported (deliver-only mode)' but handleWebhook() (webhook.go:120-183) unconditionally calls router.Route -- there is no branch that skips the agent and renders the template directly. RouteConfig.DeliverTo==\"origin\" only controls where the agent's reply goes, it doesn't skip the agent. Either the doc comment is aspirational (fix by implementing this issue) or describes a different, unbuilt code path -- don't trust the comment over the code.","status":"open","priority":2,"issue_type":"task","created_at":"2026-08-08T14:49:14Z","updated_at":"2026-08-15T12:51:54Z","external_ref":"https://github.com/samcharles93/archie-core/issues/306","source_system":"github:https://github.com/samcharles93/archie-core/issues/306:306","metadata":null,"labels":["task"],"dependencies":[{"issue_id":"archie-core-1786637497299-285-f4780816","depends_on_id":"archie-core-1786637497036-275-8838629e","type":"related","created_at":"2026-08-15T12:52:04Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786637497271-284-573ca138","title":"WebhookAdapter: prompt templates with dot-notation","description":"Implement prompt template system with dot-notation variable interpolation ({pull_request.title}, {__raw__}) for building dynamic prompts from webhook payloads.","notes":"Partially done: internal/channels/webhook/webhook.go:243-264 extractText() does single-field dot-notation extraction (RouteConfig.Template = \"issue.title\"), not multi-variable interpolation. This issue wants a template string with multiple {field.path} placeholders plus a {__raw__} escape hatch -- extractText needs to become a real interpolation pass (parse placeholders, resolve each dot-path, substitute), not a single-path lookup. RouteConfig.Template's meaning would change from 'the one field to extract' to 'a template string' -- update its doc comment in the same change.","status":"open","priority":2,"issue_type":"task","created_at":"2026-08-08T14:49:10Z","updated_at":"2026-08-15T12:51:54Z","external_ref":"https://github.com/samcharles93/archie-core/issues/305","source_system":"github:https://github.com/samcharles93/archie-core/issues/305:305","metadata":null,"labels":["task"],"dependencies":[{"issue_id":"archie-core-1786637497271-284-573ca138","depends_on_id":"archie-core-1786637497036-275-8838629e","type":"related","created_at":"2026-08-15T12:52:04Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786637497242-283-03662140","title":"WebhookAdapter: script transforms","description":"Support external script transforms per route. Allow bash/python scripts to transform incoming webhook payloads before processing.","notes":"Not started. No script/transform hook exists in internal/channels/webhook/webhook.go. Would sit between body read and text extraction in handleWebhook() (webhook.go:120-183), likely as a RouteConfig field naming an external command, invoked via os/exec on the raw body before extractText.","status":"open","priority":2,"issue_type":"task","created_at":"2026-08-08T14:49:07Z","updated_at":"2026-08-15T12:51:54Z","external_ref":"https://github.com/samcharles93/archie-core/issues/304","source_system":"github:https://github.com/samcharles93/archie-core/issues/304:304","metadata":null,"labels":["task"],"dependencies":[{"issue_id":"archie-core-1786637497242-283-03662140","depends_on_id":"archie-core-1786637497036-275-8838629e","type":"related","created_at":"2026-08-15T12:52:04Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0}
@@ -215,7 +222,7 @@
{"_type":"issue","id":"archie-core-1786637497115-278-6a6e0b24","title":"Verify: WebhookAdapter: prompt templates with dot-notation","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:48:43Z","updated_at":"2026-08-08T14:48:46Z","closed_at":"2026-08-08T14:48:47Z","external_ref":"https://github.com/samcharles93/archie-core/issues/299","source_system":"github:https://github.com/samcharles93/archie-core/issues/299:299","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786637497095-277-8f046e5a","title":"Verify: WebhookAdapter: script transforms","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:48:38Z","updated_at":"2026-08-08T14:48:41Z","closed_at":"2026-08-08T14:48:42Z","external_ref":"https://github.com/samcharles93/archie-core/issues/298","source_system":"github:https://github.com/samcharles93/archie-core/issues/298:298","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786637497066-276-35fe7db3","title":"WebhookAdapter: HTTP server with per-route HMAC validation","description":"Implement WebhookAdapter as an HTTP server supporting per-route HMAC validation: GitHub X-Hub-Signature-256, GitLab X-Gitlab-Token, and a generic V2 timestamp-bound HMAC scheme.","notes":"Partially done: internal/channels/webhook/webhook.go:186-196 validateHMAC() implements GitHub-style HMAC-SHA256 (X-Hub-Signature-256/X-Signature-256, sha256= prefix). Missing: GitLab's X-Gitlab-Token (static token compare, not HMAC -- different validation path entirely) and the generic V2 timestamp-bound replay-protected scheme. Extend validateHMAC/handleWebhook to dispatch by scheme rather than assuming GitHub's format.","status":"open","priority":2,"issue_type":"task","created_at":"2026-08-08T14:48:35Z","updated_at":"2026-08-15T12:51:54Z","external_ref":"https://github.com/samcharles93/archie-core/issues/297","source_system":"github:https://github.com/samcharles93/archie-core/issues/297:297","metadata":null,"labels":["task"],"dependencies":[{"issue_id":"archie-core-1786637497066-276-35fe7db3","depends_on_id":"archie-core-1786637497036-275-8838629e","type":"related","created_at":"2026-08-15T12:52:04Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786637497036-275-8838629e","title":"Webhook platform: generic inbound adapter with HMAC + filters + templates","description":"Generic webhook platform adapter:\n\n1. **HTTP server**: Receives POSTs from external services (GitHub, GitLab, Stripe, etc.). Per-route configuration.\n2. **HMAC validation**: GitHub (X-Hub-Signature-256), GitLab (X-Gitlab-Token), Svix/AgentMail, generic V2 (timestamp-bound replay protection), legacy V1.\n3. **Declarative filters**: all/any/not, field resolution (dot-notation), equals/contains/regex, in_file.\n4. **Script transforms**: External bash/python scripts per route that transform or filter payloads.\n5. **Prompt templates**: Dot-notation template rendering from webhook payloads ({pull_request.title}).\n6. **deliver_only mode**: Skip agent, render prompt as deliverable message (push notifications at zero LLM cost).\n7. **Idempotency cache**: TTL-based dedup of webhook retries.\n\nRef: docs/prds/hermes-gap-analysis.md (webhook.py, webhook_filters.py, msgraph_webhook.py)\n\n### Acceptance Criteria\n\nA GitHub webhook lands on /webhooks/github, passes HMAC validation, renders a prompt from the PR payload, and the agent responds. Duplicate deliveries are deduped.\n","notes":"docs/prds/hermes-gap-analysis.md (referenced above) was intentionally deleted in commit 65aa5b4 ('chore: cleanup', 2026-07-28) after it had already spawned this and ~14 sibling beads issues from its 60 identified gaps — it is not a broken link to restore. This issue's description is the surviving record of its slice of that analysis.\nFoundation exists: internal/channels/webhook/webhook.go (264 lines, tested in webhook_test.go) already implements the HTTP server, single-scheme HMAC validation (GitHub-style X-Hub-Signature-256/X-Signature-256 with sha256= prefix), single-field dot-notation extraction (extractText), and always-route-to-agent dispatch. Still missing, per sub-issue: GitLab/V2 HMAC schemes (275/276), declarative filters (282), script transforms (283), multi-variable {field} interpolation vs current single-path extraction (284), an actual deliver_only skip-agent branch -- current code always calls router.Route (285), idempotency cache (286), MS Graph validationToken handshake (287). Extend this file/package, don't create a parallel one.","status":"open","priority":2,"issue_type":"feature","created_at":"2026-08-08T14:48:32Z","updated_at":"2026-08-15T12:51:54Z","external_ref":"https://github.com/samcharles93/archie-core/issues/296","source_system":"github:https://github.com/samcharles93/archie-core/issues/296:296","metadata":null,"labels":["enhancement"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786637497036-275-8838629e","title":"Webhook platform: generic inbound adapter with HMAC + filters + templates","description":"Generic webhook platform adapter:\n\n1. **HTTP server**: Receives POSTs from external services (GitHub, GitLab, Stripe, etc.). Per-route configuration.\n2. **HMAC validation**: GitHub (X-Hub-Signature-256), GitLab (X-Gitlab-Token), Svix/AgentMail, generic V2 (timestamp-bound replay protection), legacy V1.\n3. **Declarative filters**: all/any/not, field resolution (dot-notation), equals/contains/regex, in_file.\n4. **Script transforms**: External bash/python scripts per route that transform or filter payloads.\n5. **Prompt templates**: Dot-notation template rendering from webhook payloads ({pull_request.title}).\n6. **deliver_only mode**: Skip agent, render prompt as deliverable message (push notifications at zero LLM cost).\n7. **Idempotency cache**: TTL-based dedup of webhook retries.\n\nRef: docs/prds/hermes-gap-analysis.md (webhook.py, webhook_filters.py, msgraph_webhook.py)\n\n### Acceptance Criteria\n\nA GitHub webhook lands on /webhooks/github, passes HMAC validation, renders a prompt from the PR payload, and the agent responds. Duplicate deliveries are deduped.\n","notes":"docs/prds/hermes-gap-analysis.md (referenced above) was intentionally deleted in commit 65aa5b4 ('chore: cleanup', 2026-07-28) after it had already spawned this and ~14 sibling beads issues from its 60 identified gaps — it is not a broken link to restore. This issue's description is the surviving record of its slice of that analysis.\nFoundation exists: internal/channels/webhook/webhook.go (264 lines, tested in webhook_test.go) already implements the HTTP server, single-scheme HMAC validation (GitHub-style X-Hub-Signature-256/X-Signature-256 with sha256= prefix), single-field dot-notation extraction (extractText), and always-route-to-agent dispatch. Still missing, per sub-issue: GitLab/V2 HMAC schemes (275/276), declarative filters (282), script transforms (283), multi-variable {field} interpolation vs current single-path extraction (284), an actual deliver_only skip-agent branch -- current code always calls router.Route (285), idempotency cache (286), MS Graph validationToken handshake (287). Extend this file/package, don't create a parallel one.","status":"open","priority":2,"issue_type":"feature","created_at":"2026-08-08T14:48:32Z","updated_at":"2026-08-15T12:51:54Z","external_ref":"https://github.com/samcharles93/archie-core/issues/296","source_system":"github:https://github.com/samcharles93/archie-core/issues/296:296","metadata":null,"labels":["enhancement"],"dependencies":[{"issue_id":"archie-core-1786637497036-275-8838629e","depends_on_id":"archie-core-7d5u.3","type":"relates-to","created_at":"2026-08-21T23:27:06Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786637497009-274-3b7c3bb9","title":"Verify: API server: OpenAI-compatible REST endpoint for sessions and runs","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:48:27Z","updated_at":"2026-08-08T14:48:29Z","closed_at":"2026-08-08T14:48:30Z","external_ref":"https://github.com/samcharles93/archie-core/issues/295","source_system":"github:https://github.com/samcharles93/archie-core/issues/295:295","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786637496982-273-2078b865","title":"API server: OpenAI-compatible REST endpoint for sessions and runs","description":"OpenAI-compatible REST API for external tool integration:\n\n1. **Chat Completions**: POST /v1/chat/completions — stateless, with X-Hermes-Session-Id for continuity.\n2. **Responses API**: POST /v1/responses — stateful via previous_response_id.\n3. **Sessions**: CRUD + fork for session management.\n4. **Runs**: POST /v1/runs (returns run_id immediately), GET /v1/runs/{id} (status), GET /v1/runs/{id}/events (SSE stream), POST /v1/runs/{id}/approval and /stop (resolve or interrupt).\n5. **Models**: GET /v1/models — list configured models.\n6. **Health**: GET /health (simple), GET /health/detailed (authenticated readiness).\n\nThis enables Open WebUI, LobeChat, and other OpenAI-compatible frontends to use archie-core as a backend.\n\nRef: docs/prds/hermes-gap-analysis.md (api_server.py)\n\n### Acceptance Criteria\n\ncurl -X POST /v1/chat/completions with a model and messages returns a streaming response. Sessions persist across requests via session ID. Runs can be stopped mid-execution.\n","notes":"docs/prds/hermes-gap-analysis.md (referenced above) was intentionally deleted in commit 65aa5b4 ('chore: cleanup', 2026-07-28) after it had already spawned this and ~14 sibling beads issues from its 60 identified gaps — it is not a broken link to restore. This issue's description is the surviving record of its slice of that analysis.","status":"open","priority":2,"issue_type":"feature","created_at":"2026-08-08T14:48:24Z","updated_at":"2026-08-15T12:47:29Z","external_ref":"https://github.com/samcharles93/archie-core/issues/294","source_system":"github:https://github.com/samcharles93/archie-core/issues/294:294","metadata":null,"labels":["enhancement"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1786637496953-272-2c7c1c68","title":"Verify: Shutdown watchdog: out-of-loop os.Exit backstop","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:48:19Z","updated_at":"2026-08-08T14:48:21Z","closed_at":"2026-08-08T14:48:22Z","external_ref":"https://github.com/samcharles93/archie-core/issues/293","source_system":"github:https://github.com/samcharles93/archie-core/issues/293:293","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0}