diff --git a/.beads/interactions.jsonl b/.beads/interactions.jsonl index 650f4e58a..3562dade5 100644 --- a/.beads/interactions.jsonl +++ b/.beads/interactions.jsonl @@ -213,3 +213,9 @@ {"id":"int-871cbe9079c586a5d558d0d7fa8906c8","kind":"field_change","created_at":"2026-09-03T10:16:05.744041675Z","actor":"Sam Catlow","issue_id":"archie-core-w1d5","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Resolved by commit 5f2b253 (PR #712); GitHub #710 closed. Stale-open copy recovered from carina during machine sync."}} {"id":"int-c2c340c7837ed536800bf698bc7bb131","kind":"field_change","created_at":"2026-09-04T17:10:44.25920158Z","actor":"Sam Catlow","issue_id":"archie-core-t2db.21","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Implementation complete and gate-verified for its scope. Playbook gains ID (path-relative) + Version (sha256 content hash), populated in loadOne; DispatchInput gains TaskID string carrying TaskEnvelope.IdempotencyKey(), per evidence that the discovery point computes kind/labels before any store.Task row exists. Red-green verified; gofumpt/vet/build/golangci-lint clean for the package. NOTE: task check has 5 lint failures PRE-EXISTING at HEAD in unrelated files (bootstrap.go cyclop/nestif, install_script_test.go noctx, telegram_setup_test.go usetesting) -- not caused by this change. Forced close because the earlier blocked-by: t2db.17 dependency is inverted -- .17 is doc-only sign-off; these are its implementation prereqs, not gated on it."}} {"id":"int-2497b727383994c4c3054eec786c0cd3","kind":"field_change","created_at":"2026-09-04T17:10:44.384814761Z","actor":"Sam Catlow","issue_id":"archie-core-t2db.22","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Implementation complete and gate-verified for its scope. Playbook gains ID (path-relative) + Version (sha256 content hash), populated in loadOne; DispatchInput gains TaskID string carrying TaskEnvelope.IdempotencyKey(), per evidence that the discovery point computes kind/labels before any store.Task row exists. Red-green verified; gofumpt/vet/build/golangci-lint clean for the package. NOTE: task check has 5 lint failures PRE-EXISTING at HEAD in unrelated files (bootstrap.go cyclop/nestif, install_script_test.go noctx, telegram_setup_test.go usetesting) -- not caused by this change. Forced close because the earlier blocked-by: t2db.17 dependency is inverted -- .17 is doc-only sign-off; these are its implementation prereqs, not gated on it."}} +{"id":"int-8c4db26b9679e95af26b89cd1632490e","kind":"field_change","created_at":"2026-09-05T07:10:42.605060915Z","actor":"Sam Catlow","issue_id":"archie-core-t2db.17","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Closed"}} +{"id":"int-f729139e76e6b0d4226fdff3d5362bb6","kind":"field_change","created_at":"2026-09-05T07:10:42.727150517Z","actor":"Sam Catlow","issue_id":"archie-core-t2db.18","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Closed"}} +{"id":"int-26fc72a25e298652228db1f70cc0563d","kind":"field_change","created_at":"2026-09-05T07:10:42.847407876Z","actor":"Sam Catlow","issue_id":"archie-core-1786637496789-265-b052b772","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Closed"}} +{"id":"int-3012b8f41c3c953c4f18dd4e2e76b0b3","kind":"field_change","created_at":"2026-09-05T07:10:42.905693647Z","actor":"Sam Catlow","issue_id":"archie-core-1786637496817-266-06b64a72","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Closed"}} +{"id":"int-d5901488cf1c58c467da4dcf9344d189","kind":"field_change","created_at":"2026-09-05T07:10:42.964960294Z","actor":"Sam Catlow","issue_id":"archie-core-1786637496842-267-8b2984f9","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Closed"}} +{"id":"int-15517157ecb20b071f7d51d82c9fd729","kind":"field_change","created_at":"2026-09-05T07:10:43.024637142Z","actor":"Sam Catlow","issue_id":"archie-core-14cs","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Closed"}} diff --git a/.beads/issues.jsonl b/.beads/issues.jsonl index 70cc7dc8f..2b3bfceba 100644 --- a/.beads/issues.jsonl +++ b/.beads/issues.jsonl @@ -14,11 +14,14 @@ {"_type":"issue","id":"archie-core-1ysw.1","title":"Bind worktree RPC operations to the dispatched task","description":"The sandboxed agent can currently choose owner, repo, issue, base, and branch on worktree RPC requests. The daemon then performs host deletion and credentialed forge operations without correlating the request to the dispatched task or enforcing WorkDir containment.","acceptance_criteria":"Reject traversal and unconfigured or task-mismatched coordinates before any filesystem or forge side effect; derive or validate the permitted branch; regression tests fail on the old behavior and pass on the fix.","status":"closed","priority":0,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-22T11:01:43Z","created_by":"Sam Catlow","updated_at":"2026-08-24T06:59:58Z","started_at":"2026-08-22T11:02:03Z","closed_at":"2026-08-24T06:59:58Z","close_reason":"Fixed on main: worktreerpc now exposes only Push, authorized by an opaque per-dispatch grant issued from the dispatched *store.Task (worktreerpc.go:71-83). Sandbox input no longer selects host path, repo or branch; ValidCoordinates rejects traversal. Package tests pass.","external_ref":"https://github.com/samcharles93/archie-core/issues/589","metadata":null,"dependencies":[{"issue_id":"archie-core-1ysw.1","depends_on_id":"archie-core-1ysw","type":"parent-child","created_at":"2026-08-22T21:01:42Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-1ysw","title":"Repair internal/worktree correctness and trust-boundary defects","description":"Track the concrete worktree-package defects proven by the 2026-08-22 evidence-gated review. Child bugs cover RPC authority/path containment, repository-key isolation, retry/base/diff correctness, push lifecycle, terminal cleanup, cancellation, and branch naming. This epic groups implementation only; each child has its own observable acceptance criteria.","acceptance_criteria":"All child bugs are closed with red-green regression tests, scoped lint passes, and the repository quality gate is clean.","status":"closed","priority":0,"issue_type":"epic","owner":"sam@catlow.tech","created_at":"2026-08-22T11:01:18Z","created_by":"Sam Catlow","updated_at":"2026-08-24T08:16:00Z","closed_at":"2026-08-24T08:16:00Z","close_reason":"All 9 children complete. The P0/P1 trust-boundary and correctness defects (.1 RPC task binding, .2 colliding directory keys, .3 untracked cleanup, .4 fail-closed base resolution, .5 three-dot merge-base semantics) were already fixed on main and reconciled 2026-08-24. The remaining four (.6 push result, .7 no-change worktree leak, .8 commit cancellation, .9 branch naming contract) were implemented this session, merged as 474c31d and its two merge commits, task check green, with an independent adversarial review reporting zero findings.","external_ref":"https://github.com/samcharles93/archie-core/issues/590","dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-t2db.5","title":"Security: an unauthenticated endpoint must not be able to run an agent","description":"P0 within this epic because the feature's own pitch is the threat model: a public intake surface whose output is an agent with tool access and a repo. Get this wrong and a webhook URL is remote code execution with extra steps.\n\nNon-negotiables to design:\n\n- Per-source authentication. A source registers with a secret (HMAC, as internal/channels/webhook already does per route) before its events can trigger anything. Capture-only for unknown senders is acceptable; triggering is not.\n- Human approval before a binding goes live. An operator authoring a binding is a deliberate act; an event arriving is not. Nothing should self-arm.\n- Rate and volume limits per source, so capture cannot be used to exhaust disk or drown the inspector.\n- Payload content is untrusted input flowing into an agent prompt. Treat prompt injection as expected, not exceptional -- the sender controls that text, and the agent has tools. Bound what a playbook-triggered workflow may do.\n- Captured payloads may contain secrets from the sending system. Decide retention, redaction and who can view them; internal/memory/scrubber may already have applicable prior art.\n\nArchie's own principle applies: environmental enforcement over prompt rules. 'The agent should ignore instructions in the payload' is not a control.","acceptance_criteria":"An event from an unauthenticated source can be captured but cannot trigger a workflow; a new binding requires explicit human approval before it arms; per-source rate limits exist; the blast radius of a playbook-triggered workflow is bounded by code rather than by prompt text; retention and visibility of captured payloads is decided and documented.","notes":"2026-08-22: security design decided and documented in docs/prds/webhook-intake-security.md, covering all five non-negotiables from this bead's description:\n1. Per-source auth reuses internal/channels/webhook's existing HMAC-SHA256 scheme; capture accepts unsigned events (visible, marked unauthenticated), only authenticated events can ever match a binding.\n2. Bindings gain a draft -\u003e pending_approval -\u003e armed state machine; any edit to an armed binding drops it back to pending_approval so approval can't be bypassed by editing. Modeled on telegram's existing dangerousAction/pendingApproval flow (dangerous.go/approval.go).\n3. Per-source token-bucket rate limiting (precedent: pairing/store.go's MaxPendingPerPlatform); limit-exceeded is an observable 429, not a silent drop.\n4. Blast radius bounded by the SAME code-level controls every task already gets -- gate, diff_cap_lines, sandboxed container, worktree isolation -- no new relaxation for playbook-triggered work, and payload text is ordinary untrusted prompt input, never a trusted instruction.\n5. 7-day configurable retention on captured payloads; best-effort redaction reusing gateway/stream.go's sensitiveParameterKey heuristic before persisting; visibility gated by the same dashboard auth as every other webui surface.\n\nThis bead's code-level acceptance criteria (capture-can't-trigger, rate limits exist, blast-radius bounded, approval gate) cannot be implemented yet: they constrain t2db.1 (capture), 7d5u.3 (intake family) and t2db.4 (binding), none of which have landed. This document is the contract those beads build against -- do not build any of them without satisfying it. Leaving this bead in_progress rather than closing it; it closes when t2db.1/7d5u.3/t2db.4 land and demonstrably satisfy points 1-5, not before.","status":"closed","priority":0,"issue_type":"feature","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-21T13:45:46Z","created_by":"Sam Catlow","updated_at":"2026-09-02T13:09:39Z","started_at":"2026-08-21T14:51:26Z","closed_at":"2026-09-02T13:09:39Z","close_reason":"Closed","external_ref":"https://github.com/samcharles93/archie-core/issues/536","dependencies":[{"issue_id":"archie-core-t2db.5","depends_on_id":"archie-core-t2db","type":"parent-child","created_at":"2026-08-21T23:45:45Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":1,"comment_count":0} +{"_type":"issue","id":"archie-core-8cda.2","title":"Phase 0: In-process contract seams (modular monolith, no process split)","description":"First phase of the resolved extraction order (open question #1). Still a\nmodular monolith -- no new process, nothing listening on a real port.\nIntroduces, in-process, the seams that make later extraction a swap of\ntransport rather than a rewrite, per open question #3's resolved\nmechanism (multiplexed in-process is the migration default).\n\nScope:\n- A ChatContract interface owned by the Gateway, aligning\n Router/SessionStore/Turns/ModelManager/PersonaRegistry behind it, so\n internal/webui depends on the contract type rather than holding\n *gateway.Router, gateway.SessionStore, *gateway.Turns,\n gateway.ModelManager, and *gateway.PersonaRegistry directly\n (internal/webui/api_chat.go's current ChatService struct, lines 22-26).\n- The ServiceRegistry interface from the discovery research\n (Resolve(service string) []Endpoint; Watch(service string) \u003c-chan\n Event), landed as a real internal package\n (internal/servicediscovery/servicediscovery.go per the research doc's\n citation) -- network-only; it never returns an in-process shim (see\n question #3's resolution part 3).\n- The State Store's already-narrow interfaces (TaskStore, CaptureStore,\n MappingStore, BindingStore, WorkflowStore in\n internal/store/interface.go) ratified as the State Store contract\n surface -- no code change to the interfaces themselves, this is the\n authority decision plus wiring them as wire-safe contracts.\n- For the ChatContract specifically: a wire-safe Go interface (values and\n streams only, no callbacks like Gateway's LLMStreamResponder, no\n *sql.Tx, no leaked object identity), a local in-process adapter (real\n production adapter, not a test fake), a generated gRPC client adapter\n satisfying the same interface via a compile-time assertion (the `var _\n store.WorkflowStore = (*Client)(nil)` idiom, internal/storerpc/storerpc.go:136),\n and a per-contract conformance suite run against both adapters over\n bufconn (the runSessionStoreSuite idiom,\n internal/gateway/sessionstore_conformance_test.go:65).\n- Composition (internal/app wiring), not ServiceRegistry, picks\n mode = \"inproc\" | \"remote\" per service, defaulting to \"inproc\".\n\nDepends on the contract-definition-mechanism issue (buf/proto toolchain)\nsince ChatContract's .proto definition and generated Go land here.\n\nFull reasoning: docs/inspiration/service-decomposition-open-questions-research-2026-09-05.md#1\n(Phase 0 section) and #3 (the six-part mechanism).","acceptance_criteria":"- proto/gateway/v1/ ChatContract .proto definition committed, generated\n Go landed at internal/contracts/gateway/v1/ via the proto toolchain\n from the contract-mechanism issue.\n- ChatContract Go interface defined, wire-safe (no callbacks, no *sql.Tx,\n no object identity leaks).\n- A local adapter satisfying ChatContract that wraps the existing\n Router/SessionStore/Turns/ModelManager/PersonaRegistry in-process, with\n zero serialization.\n- A generated gRPC client adapter satisfying the same ChatContract\n interface, with a compile-time `var _ ChatContract = (*Client)(nil)`\n assertion.\n- A bufconn-based conformance test suite exercising both adapters against\n the same behavioural assertions.\n- internal/webui's ChatService depends on the ChatContract interface type,\n not on gateway.Router/SessionStore/Turns/ModelManager/PersonaRegistry\n structs directly.\n- mode = \"inproc\" | \"remote\" config plumbed through composition wiring,\n defaulting to \"inproc\"; no cmd/archie-gateway binary and nothing\n listening on a real network port yet.\n- ServiceRegistry interface (Resolve/Watch) exists as a real Go interface\n in internal/servicediscovery, even if only a stub/no-op implementation\n backs it at this phase.\n- task check passes; no behavioural change to production traffic (still\n fully in-process).","status":"open","priority":1,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-09-05T06:05:30Z","created_by":"Sam Catlow","updated_at":"2026-09-05T06:05:30Z","dependencies":[{"issue_id":"archie-core-8cda.2","depends_on_id":"archie-core-8cda","type":"parent-child","created_at":"2026-09-05T06:05:30Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-8cda.2","depends_on_id":"archie-core-8cda.1","type":"blocks","created_at":"2026-09-05T06:06:59Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":1,"dependent_count":1,"comment_count":0} +{"_type":"issue","id":"archie-core-8cda.1","title":"Contract-definition mechanism: buf v2 + protoc-gen-go/grpc-go toolchain","description":"Groundwork for all service-decomposition contracts (resolved open\nquestion #2 in docs/prds/service-decomposition.md). Every later phase\n(starting with Phase 0's ChatContract seam) needs this toolchain in place\nbefore it can define a wire contract.\n\nDecision (already made, not open for redesign here): buf v2 driving\nprotoc-gen-go + protoc-gen-go-grpc, targeting grpc-go -- NOT connect-go,\nbecause connect-go's net/http-based client breaks the service-discovery\nresearch's gRPC resolver plumbing for K8s DNS and NATS-KV custom\nresolvers. google.golang.org/grpc becomes a direct dependency (today only\ngoogle.golang.org/protobuf is an indirect one, go.mod:59).\n\nLayout: one committed proto/\u003cservice\u003e/v1/ tree (one buf module, not\nper-service modules), directory name matching the canonical\nservice/registry/DNS/chart name. Generated Go is committed (not\nbuild-time generated) to internal/contracts/\u003cservice\u003e/v1/, produced via\nbuf's managed mode (go_package_prefix) + paths=source_relative, per\ndocs/architecture/dependencies-and-contracts.md:55's per-domain\nwire-contract ownership rule.\n\nVersioning: directory versioning (v1, v2, ...); a breaking change gets a\nnew vN directory, never an in-place edit. Enforced by\n`buf breaking --against '.git#branch=main,subdir=proto'`.\n\nFull reasoning, scratch-verified buf/connect-go toolchain results, and\nthe CI shallow-checkout gotcha: see\ndocs/inspiration/service-decomposition-open-questions-research-2026-09-05.md#2","acceptance_criteria":"- buf v2 config (buf.yaml / buf.gen.yaml) committed at the proto/ tree\n root; protoc-gen-go and protoc-gen-go-grpc wired as buf plugins\n targeting grpc-go.\n- Empty proto/\u003cservice\u003e/v1/ tree scaffolded (at minimum a placeholder or\n the first real service's .proto once Phase 0 needs it) with the\n directory-versioning convention documented.\n- Generated Go lands at internal/contracts/\u003cservice\u003e/v1/ and is committed\n (gofumpt-clean, matching the \"generated assets are LAW\" precedent).\n- New `task proto:generate`, `task proto:lint`, `task proto:check` tasks\n in Taskfile.yml; proto:check regenerates then `git diff --exit-code --\n internal/contracts`.\n- `task proto:generate/lint/check` wired into `task check`, inserted\n after `go fix ./...` and before vet/lint/build.\n- The same proto:lint/proto:check steps (or their direct buf/git-diff\n equivalents) mirrored into .github/workflows/deploy.yml's Quality gate\n step, since CI does not invoke `task check` today -- with fetch-depth:0\n (or an explicit `git fetch origin main`) so `buf breaking --against`\n has a local main ref to diff against.\n- `buf breaking` demonstrably fails the gate on a deliberately introduced\n breaking change (deleted RPC, renamed/removed field) in a smoke test or\n manual verification note.","status":"open","priority":1,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-09-05T06:05:10Z","created_by":"Sam Catlow","updated_at":"2026-09-05T06:05:10Z","dependencies":[{"issue_id":"archie-core-8cda.1","depends_on_id":"archie-core-8cda","type":"parent-child","created_at":"2026-09-05T06:05:10Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":1,"comment_count":0} +{"_type":"issue","id":"archie-core-8cda","title":"Service decomposition: archie-core modularization","description":"archie-core moves from one Go binary (archied) hosting every domain\nin-process to a set of independently deployable services, each exposing\nexactly one typed contract. Consumers depend on the contract; they never\nreach into another service's internal types, session state, or config.\ngRPC is the synchronous transport; NATS remains for asynchronous fan-out\n(status, telemetry) rather than being replaced.\n\nThis is a distribution decision, not a rewrite of Archie's domain model.\nThe six-domain split already approved in docs/architecture/index.md and\ndocs/architecture/organisation.md (Identity, Agent, Messaging, Workflow,\nWork Intake, Plugin) is unchanged; this epic is about how the processes\nrunning that domain logic get packaged, contracted, and discovered.\n\nTarget services (see the PRD's table): UI Service, Gateway Service,\nMessaging Service, Curator Service (optional), Scheduler Service,\nExecution Environment, Runner, State Store.\n\nAll five blocking open questions in the PRD are resolved as of\n2026-09-05: extraction order (Gateway first, then State Store, UI,\nMessaging, Execution/Runner/Scheduler, Curator -- preceded by a Phase 0\ncontract-seams step), contract-definition mechanism (buf v2 +\nprotoc-gen-go/grpc-go), in-process-vs-out-of-process migration mechanism\n(multiplexed in-process is the default, per-service wire-safe contract\ninterfaces with local + gRPC adapters), State Store's contract shape (one\nState Store service, single SQLite, narrow typed contracts, no physical\nper-service database), and Helm chart / Operator ownership (a library\nchart + a core-services chart + a Curator chart/Operator).\n\nFull decision record: docs/prds/service-decomposition.md\nFull resolution detail and reasoning for each question:\ndocs/inspiration/service-decomposition-open-questions-research-2026-09-05.md\n\nFiling this epic satisfies the PRD's \"file a beads epic\" completion\ncriterion only. It does NOT authorize implementation -- the PRD's\ncompletion criteria separately require the captain's explicit go-ahead\ngiven the scale of this change. No implementation work should start\nagainst the child issues below until that go-ahead is given.","status":"open","priority":1,"issue_type":"epic","owner":"sam@catlow.tech","created_at":"2026-09-05T06:04:50Z","created_by":"Sam Catlow","updated_at":"2026-09-05T06:04:50Z","dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-w1d5","title":"Gateway-only release must not rebuild or publish archie-agent","description":"## Bug Description\n\nA gateway-only release (`archied v1.22.0`, runtime skipped) still runs the `Build and push archie-agent` job and pushes `ghcr.io/samcharles93/archie-agent:latest` with `RUNTIME_VERSION=dev` because no `archie/v1.22.0` tag exists. This violates the release process rule that an untouched component must not be rebuilt or published.\n\n## Evidence\n\n- Release target: `archied/v1.22.0` only; `archie-agent` was explicitly skipped.\n- Workflow: `.github/workflows/deploy.yml` unconditionally builds both images.\n- Version resolver uses `RUNTIME_VERSION=dev` when no runtime tag points at HEAD.\n- Tag workflow 33723604418 passed, but rebuilt/pushed the agent image anyway.\n\n## Expected Behavior\n\nA gateway-only release builds and publishes only the archied component. The existing agent image remains unchanged.\n\n## Acceptance Criteria\n\n- Make the deploy workflow component-aware: skip the agent build/push when no `archie/v*` release tag points at HEAD.\n- Preserve full dual-image builds when both component tags are present.\n- Add CI/workflow validation for gateway-only and dual-component releases.\n- Do not publish an agent image stamped `dev` from a gateway-only release.\n","status":"closed","priority":1,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-09-03T06:40:43Z","created_by":"Sam Catlow","updated_at":"2026-09-03T10:16:06Z","closed_at":"2026-09-03T10:16:06Z","close_reason":"Resolved by commit 5f2b253 (PR #712); GitHub #710 closed. Stale-open copy recovered from carina during machine sync.","external_ref":"https://github.com/samcharles93/archie-core/issues/710","labels":["bug","ci","release"],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-n5fz","title":"Migrate existing bindings table for owner and repo columns","description":"## Bug Description\n\nArchied v1.22.0 starts successfully against the existing production task database, but binding listing logs `SQL logic error: no such column: owner`. The database was created/migrated by an earlier release and its `bindings` table has no `owner` or `repo` columns, while current `internal/store/bindings.go` selects/inserts/updates both columns.\n\n## Steps to Reproduce\n\n1. Run archied v1.22.0 against an existing database upgraded from the previous release.\n2. Open the bindings dashboard or call the bindings listing path.\n3. Observe `list bindings failed: SQL logic error: no such column: owner`.\n\n## Expected Behavior\n\nExisting databases migrate forward without data loss, and binding listing/creation/update works after upgrade.\n\n## Actual Behavior\n\nThe daemon stays up, but binding listing fails because the migration does not add the owner/repo columns required by the current binding store.\n\n## Evidence\n\n- Release: archied v1.22.0\n- Production DB: `/home/sam/.local/share/archie/archie.db-tasks.sqlite`\n- `pragma user_version = 2`\n- Existing `bindings` table has columns through `updated_at`, but no `owner` or `repo`.\n- Current code in `internal/store/bindings.go` references `owner` and `repo`.\n\n## Acceptance Criteria\n\n- Add an idempotent migration for owner/repo columns with safe defaults.\n- Preserve existing bindings and make them readable after upgrade.\n- Add regression coverage starting from the pre-owner/repo schema.\n- Verify binding list/create/update paths against both fresh and upgraded databases.\n- Do not reset or delete the production database.\n","status":"closed","priority":1,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-09-03T06:39:09Z","created_by":"Sam Catlow","updated_at":"2026-09-03T10:16:05Z","closed_at":"2026-09-03T10:16:05Z","close_reason":"Resolved by commit 89f48a5 (PR #711); GitHub #709 closed. Stale-open copy recovered from carina during machine sync.","external_ref":"https://github.com/samcharles93/archie-core/issues/709","labels":["bug","migration","release"],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-fwvf","title":"v1.20.0 archied startup panic and schema-unsafe update rollback","description":"## Bug Description\n\nAfter `/update` installed `archied` v1.20.0, the service failed to start. The update watchdog reported `health_check: failed` and rolled the binary back to v1.19.10, but the v1.20.0 binary had already migrated the task database to schema version 2. The rollback binary then entered a restart loop because it only supports schema version 1.\n\nRestoring the matching v1.20.0 daemon did not recover the service: it panics during startup in `(*boot).connectNATS` at `bootstrap.go:366` while dereferencing `cfg.NATS.URL`.\n\n## Steps to Reproduce\n\n1. Run `/update` from the Telegram gateway, selecting archied v1.20.0.\n2. Observe the watchdog health check fail and rollback.\n3. Start the matching v1.20.0 binary against the existing config.\n\n## Expected Behavior\n\nThe released daemon starts successfully with the production config, or returns a clear configuration error. `/update` must not leave the installed binary and persisted task schema at incompatible versions.\n\n## Actual Behavior\n\nThe service is in a systemd restart loop. v1.19.10 reports `store: migrate: database schema version 2 is newer than supported version 1`; v1.20.0 panics with `runtime error: invalid memory address or nil pointer dereference` in `connectNATS` at `bootstrap.go:366`.\n\n## Evidence\n\n- Installed before recovery: `archied 1.19.10`, `archie-agent 1.19.9`\n- Update report: installed daemon/agent `1.20.0`, `health_check: failed`, `rolled_back: true`\n- Task DB: `/home/sam/.local/share/archie/archie.db-tasks.sqlite`, `PRAGMA user_version = 2`\n- v1.20.0 panic: `url := cfg.NATS.URL` in `internal/app/archied/bootstrap.go:366`\n- Current config contains `[nats] url = \"nats://172.19.0.1:4222\"`\n\n## Acceptance Criteria\n\n- Add a regression test covering startup with the production NATS configuration and nil/invalid NATS state.\n- Remove the nil dereference; startup must return a useful error or initialise the required NATS configuration.\n- Make update rollback schema-safe: either verify the candidate before migration, retain/restore compatible state, or prevent rollback to a binary that cannot read the candidate schema.\n- Exercise `/update` or an equivalent installer/restart path and verify `archied.service` reaches active, Telegram gateway starts, NATS connects, and `/version` reports the installed release.\n- Preserve the task database and existing tasks.\n\n## Environment\n\n- Host: carina.srv.catlow.cloud\n- OS: Debian/Linux 6.12.96+deb13-amd64\n- Service: systemd user unit `archied.service`\n- Update path: Telegram `/update`\n","status":"closed","priority":1,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-09-03T04:19:21Z","created_by":"Sam Catlow","updated_at":"2026-09-03T10:16:05Z","closed_at":"2026-09-03T10:16:05Z","close_reason":"Resolved; GitHub #703 closed. Stale-open copy recovered from carina during machine sync.","external_ref":"https://github.com/samcharles93/archie-core/issues/703","labels":["bug","release","update"],"comments":[{"id":"01a06585-1d1b-76bf-833a-71ba15ab0d3d","issue_id":"archie-core-fwvf","author":"Sam Catlow","text":"## Investigation correction\n\nThe panic frame is `setupObservability`, not `connectNATS`. In the released/latest source, `setupObservability` assigns `b.d.Mappings = ms` while `b.d` is still nil; `buildDaemon` runs later in startup. The direct nil dereference is therefore the daemon wiring order, while the schema-unsafe rollback remains the separate update failure.\n\nThe implementation and regression test will cover both paths.","created_at":"2026-09-03T04:26:58Z"}],"dependency_count":0,"dependent_count":0,"comment_count":1} -{"_type":"issue","id":"archie-core-t2db.18","title":"eda: resolve mid-playbook action failure semantics (execution-time gap 1)","description":"Design-investigation ticket, same shape as the idempotency one above -- produces a design-doc resolution, not implementation. Gates multi-action playbooks (t2db.15 is deliberately single-action to avoid needing this). docs/prds/eda-playbook-engine.md's 'Execution-time gap 1' has no default yet and explicitly says a default must be a stated decision, not something nobody chose.\n\nGrounded by a crew investigation pass (2026-09-03, not committed -- content folded in here): read event-sources-and-reactions.md's producer-only/no-veto/no-mutation language, existing internal/domain/workflow stage-failure conventions (does a failing stage stop/wrap/resume?), and the load-collision report shape (drop+log+report to caller) from t2db.9-.12 as the precedent for how a run outcome should be reported.","design":"Decide and write the resolution into eda-playbook-engine.md:\n1. On action N of M failing: stop-on-first-failure (matches this doc's existing anti-clever-recovery bias) vs continue-to-independent-later-actions vs rollback. State which, and why the alternatives were rejected -- don't just restate the doc's existing hedge.\n2. What 'rollback' means (likely: nothing, since a posted forge comment isn't revocable) -- state this explicitly rather than leaving it implied.\n3. Producer-only interaction: decide whether a playbook reacting to its own action's failure by running compensating actions is in scope -- state the boundary explicitly against event-sources-and-reactions.md's producer-only rule.\n4. Condition-failure vs action-failure: J3 (CEL condition eval error -\u003e false, skip, log, continue) is already decided for conditions specifically. State cleanly how this differs from an actual action failure.\n\nSTRONG REUSABLE PRECEDENT FOUND IN THIS CODEBASE (verified directly, 2026-09-03) -- read internal/domain/workflow/workflow.go:294-352 (Run/finish/park) before designing anything new. The existing workflow engine already answers a structurally identical question for its own stages, and the answer is precise, not just 'stop on failure':\n- A real stage error: stop immediately, set ParkReason (which stage, what error), call park() -- status becomes store.StatusParked, requiring human/retry intervention. This IS this codebase's existing 'stop-on-first-failure, log the outcome, report to caller' pattern -- a playbook run failure should almost certainly reuse the SAME park/report shape (or a directly analogous one) rather than inventing new run-outcome semantics.\n- Context cancellation (ctx.Err() != nil, e.g. daemon shutdown mid-stage) is explicitly NOT treated as a failure: the task is left running so existing crash-recovery requeues it; parking here 'would publish a false failure and require manual intervention.' A playbook coordinator dispatching a Module/Workflow action needs the SAME distinction -- a daemon-shutdown interruption mid-action must not be recorded as an action failure, or every restart during a dispatch would falsely mark playbooks as broken.\n- A workflow ending without an explicit terminal outcome is itself parked as 'workflow ended without an outcome (definition bug)' -- i.e. an engine-level invariant violation gets its own distinct, honestly-labeled outcome rather than being silently treated as success. Consider whether a playbook run has an analogous 'must end with X' invariant.\n\nThis means gap 1 may reduce to: 'reuse park()'s three-way distinction (real failure / shutdown interruption / definition-bug) for playbook runs' rather than a from-scratch design -- read the actual code before deciding whether that reduction actually holds or where a playbook run's shape genuinely differs (e.g. playbooks may not have a Store.Transition-shaped persistence target the way a store.Task does -- confirm what a playbook run's own state, if any, actually gets recorded to).","acceptance_criteria":"eda-playbook-engine.md's Execution-time gap 1 section is marked resolved with a stated default (not a list of candidates) and explicit reasoning against event-sources-and-reactions.md's producer-only rule. No code changes required for this ticket to close.","notes":"Proposed resolution drafted 2026-09-03 in docs/prds/eda-playbook-engine.md, commit 99eaa7a -- reuses workflow.Run's existing three-way stage-failure distinction. Explicitly marked 'awaiting Sam's sign-off,' not settled.","status":"open","priority":1,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-09-02T18:12:15Z","created_by":"Sam Catlow","updated_at":"2026-09-02T20:29:55Z","dependencies":[{"issue_id":"archie-core-t2db.18","depends_on_id":"archie-core-t2db","type":"parent-child","created_at":"2026-09-02T18:12:15Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0} -{"_type":"issue","id":"archie-core-t2db.17","title":"eda: resolve idempotency keying for Module/Channel/Forge actions (execution-time gap 2)","description":"Design-investigation ticket (like the CEL question, archie-core-t2db resolution in eda-playbook-engine.md) -- produces a design-doc resolution, NOT implementation. This is the sharper of the two unresolved execution-time gaps named in docs/prds/eda-playbook-engine.md's 'Execution-time gaps' section: workflow-kind actions inherit idempotency for free via TaskEnvelope; channel/forge/module actions with real side effects have no keying scheme, so a redelivered trigger event (internal/eventbus is at-least-once PublishUnique) would double-fire a comment, a message, or a billed image generation.\n\nGrounded by a crew investigation pass (2026-09-03, further-investigation.md, not committed -- content folded into this ticket): read internal/eventbus's PublishUnique key computation and existing dedup surface, TaskEnvelope's idempotency key minting/consumption path, event-sources-and-reactions.md's decided contract (extend it, don't contradict it), and the CEL context surface in internal/domain/eda/expr (event/actions fields available for key derivation).","design":"Design-decide and write into eda-playbook-engine.md:\n1. Granularity: one idempotency key per trigger-event + playbook (whole run dedups) vs per-action key derived from the run key. The doc's stated bias is the former unless a specific action needs finer dedup -- turn that bias into a stated decision.\n2. Where the key lives: does a playbook run get its own envelope/context carrying the key, and how does it reach the target position's invocation (Module.Invoke, a future Channel/Forge call)?\n3. What 'dedup' does on redelivery: is the whole run skipped, or just the already-fired action? What gets recorded?\n\nSTRONG REUSABLE PRECEDENT FOUND IN THIS CODEBASE (verified directly, 2026-09-03) -- do not design a new ledger without reading this first: internal/store/bindings.go already implements exactly this shape for playbook bindings. binding_dispatches table, unique on (binding_id, capture_id), written via RecordDispatch's 'INSERT OR IGNORE' -- a duplicate insert returns the sentinel ErrAlreadyDispatched, which dispatchBindings (internal/daemon/daemon.go:479) treats as a normal 'another cycle raced us' outcome, not an error. This is a proven, tested, at-most-once dispatch guarantee across cycles AND daemon restarts, for the exact same kind of problem (don't re-fire a binding for a capture it already dispatched). The playbook-run idempotency key almost certainly should reuse this exact pattern: a new ledger table (or a generalization of binding_dispatches) keyed on (playbook_id, event_id) or (playbook_id, trigger_event_identity), written with the same INSERT OR IGNORE + sentinel-error convention. Read internal/store/bindings.go:29-61,351-378 and internal/daemon/daemon.go:479-514 before designing anything -- this may reduce gap 2 to 'apply the existing pattern to a new key shape' rather than new design.\n4. Key derivation: a CEL-reachable expression over event fields, or a stable hash of event-identity+playbook-id -- pick one and justify it against the expr package's actual context surface, and against how capture identity is derived today (check what 'capture_id' actually is -- likely a stable hash or row id from the same capture pipeline a playbook trigger would also read).","acceptance_criteria":"eda-playbook-engine.md's Execution-time gap 2 section is marked resolved with a stated decision (not a survey of options) covering granularity, key storage/lookup, redelivery behavior, and key derivation. Consistent with event-sources-and-reactions.md's existing idempotency contract -- explicitly states how it extends rather than contradicts it. No code changes required for this ticket to close.","notes":"Proposed resolution drafted 2026-09-03 in docs/prds/eda-playbook-engine.md, commit 99eaa7a -- reuses internal/store/bindings.go's binding_dispatches ledger shape. Explicitly marked 'awaiting Sam's sign-off,' not settled. Surfaced two concrete prerequisites while drafting: t2db.15's Playbook struct needs an ID/Version (doesn't have one), and DispatchInput needs a task identity threaded through (doesn't have one either) -- both stated honestly as blockers for implementation, not glossed over.","status":"open","priority":1,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-09-02T18:12:13Z","created_by":"Sam Catlow","updated_at":"2026-09-02T20:29:54Z","dependencies":[{"issue_id":"archie-core-t2db.17","depends_on_id":"archie-core-t2db","type":"parent-child","created_at":"2026-09-02T18:12:13Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":3,"comment_count":0} +{"_type":"issue","id":"archie-core-t2db.18","title":"eda: resolve mid-playbook action failure semantics (execution-time gap 1)","description":"Design-investigation ticket, same shape as the idempotency one above -- produces a design-doc resolution, not implementation. Gates multi-action playbooks (t2db.15 is deliberately single-action to avoid needing this). docs/prds/eda-playbook-engine.md's 'Execution-time gap 1' has no default yet and explicitly says a default must be a stated decision, not something nobody chose.\n\nGrounded by a crew investigation pass (2026-09-03, not committed -- content folded in here): read event-sources-and-reactions.md's producer-only/no-veto/no-mutation language, existing internal/domain/workflow stage-failure conventions (does a failing stage stop/wrap/resume?), and the load-collision report shape (drop+log+report to caller) from t2db.9-.12 as the precedent for how a run outcome should be reported.","design":"Decide and write the resolution into eda-playbook-engine.md:\n1. On action N of M failing: stop-on-first-failure (matches this doc's existing anti-clever-recovery bias) vs continue-to-independent-later-actions vs rollback. State which, and why the alternatives were rejected -- don't just restate the doc's existing hedge.\n2. What 'rollback' means (likely: nothing, since a posted forge comment isn't revocable) -- state this explicitly rather than leaving it implied.\n3. Producer-only interaction: decide whether a playbook reacting to its own action's failure by running compensating actions is in scope -- state the boundary explicitly against event-sources-and-reactions.md's producer-only rule.\n4. Condition-failure vs action-failure: J3 (CEL condition eval error -\u003e false, skip, log, continue) is already decided for conditions specifically. State cleanly how this differs from an actual action failure.\n\nSTRONG REUSABLE PRECEDENT FOUND IN THIS CODEBASE (verified directly, 2026-09-03) -- read internal/domain/workflow/workflow.go:294-352 (Run/finish/park) before designing anything new. The existing workflow engine already answers a structurally identical question for its own stages, and the answer is precise, not just 'stop on failure':\n- A real stage error: stop immediately, set ParkReason (which stage, what error), call park() -- status becomes store.StatusParked, requiring human/retry intervention. This IS this codebase's existing 'stop-on-first-failure, log the outcome, report to caller' pattern -- a playbook run failure should almost certainly reuse the SAME park/report shape (or a directly analogous one) rather than inventing new run-outcome semantics.\n- Context cancellation (ctx.Err() != nil, e.g. daemon shutdown mid-stage) is explicitly NOT treated as a failure: the task is left running so existing crash-recovery requeues it; parking here 'would publish a false failure and require manual intervention.' A playbook coordinator dispatching a Module/Workflow action needs the SAME distinction -- a daemon-shutdown interruption mid-action must not be recorded as an action failure, or every restart during a dispatch would falsely mark playbooks as broken.\n- A workflow ending without an explicit terminal outcome is itself parked as 'workflow ended without an outcome (definition bug)' -- i.e. an engine-level invariant violation gets its own distinct, honestly-labeled outcome rather than being silently treated as success. Consider whether a playbook run has an analogous 'must end with X' invariant.\n\nThis means gap 1 may reduce to: 'reuse park()'s three-way distinction (real failure / shutdown interruption / definition-bug) for playbook runs' rather than a from-scratch design -- read the actual code before deciding whether that reduction actually holds or where a playbook run's shape genuinely differs (e.g. playbooks may not have a Store.Transition-shaped persistence target the way a store.Task does -- confirm what a playbook run's own state, if any, actually gets recorded to).","acceptance_criteria":"eda-playbook-engine.md's Execution-time gap 1 section is marked resolved with a stated default (not a list of candidates) and explicit reasoning against event-sources-and-reactions.md's producer-only rule. No code changes required for this ticket to close.","notes":"Proposed resolution drafted 2026-09-03 in docs/prds/eda-playbook-engine.md, commit 99eaa7a -- reuses workflow.Run's existing three-way stage-failure distinction. Explicitly marked 'awaiting Sam's sign-off,' not settled.","status":"closed","priority":1,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-09-02T18:12:15Z","created_by":"Sam Catlow","updated_at":"2026-09-05T07:10:42Z","closed_at":"2026-09-05T07:10:42Z","close_reason":"Closed","dependencies":[{"issue_id":"archie-core-t2db.18","depends_on_id":"archie-core-t2db","type":"parent-child","created_at":"2026-09-02T18:12:15Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0} +{"_type":"issue","id":"archie-core-t2db.17","title":"eda: resolve idempotency keying for Module/Channel/Forge actions (execution-time gap 2)","description":"Design-investigation ticket (like the CEL question, archie-core-t2db resolution in eda-playbook-engine.md) -- produces a design-doc resolution, NOT implementation. This is the sharper of the two unresolved execution-time gaps named in docs/prds/eda-playbook-engine.md's 'Execution-time gaps' section: workflow-kind actions inherit idempotency for free via TaskEnvelope; channel/forge/module actions with real side effects have no keying scheme, so a redelivered trigger event (internal/eventbus is at-least-once PublishUnique) would double-fire a comment, a message, or a billed image generation.\n\nGrounded by a crew investigation pass (2026-09-03, further-investigation.md, not committed -- content folded into this ticket): read internal/eventbus's PublishUnique key computation and existing dedup surface, TaskEnvelope's idempotency key minting/consumption path, event-sources-and-reactions.md's decided contract (extend it, don't contradict it), and the CEL context surface in internal/domain/eda/expr (event/actions fields available for key derivation).","design":"Design-decide and write into eda-playbook-engine.md:\n1. Granularity: one idempotency key per trigger-event + playbook (whole run dedups) vs per-action key derived from the run key. The doc's stated bias is the former unless a specific action needs finer dedup -- turn that bias into a stated decision.\n2. Where the key lives: does a playbook run get its own envelope/context carrying the key, and how does it reach the target position's invocation (Module.Invoke, a future Channel/Forge call)?\n3. What 'dedup' does on redelivery: is the whole run skipped, or just the already-fired action? What gets recorded?\n\nSTRONG REUSABLE PRECEDENT FOUND IN THIS CODEBASE (verified directly, 2026-09-03) -- do not design a new ledger without reading this first: internal/store/bindings.go already implements exactly this shape for playbook bindings. binding_dispatches table, unique on (binding_id, capture_id), written via RecordDispatch's 'INSERT OR IGNORE' -- a duplicate insert returns the sentinel ErrAlreadyDispatched, which dispatchBindings (internal/daemon/daemon.go:479) treats as a normal 'another cycle raced us' outcome, not an error. This is a proven, tested, at-most-once dispatch guarantee across cycles AND daemon restarts, for the exact same kind of problem (don't re-fire a binding for a capture it already dispatched). The playbook-run idempotency key almost certainly should reuse this exact pattern: a new ledger table (or a generalization of binding_dispatches) keyed on (playbook_id, event_id) or (playbook_id, trigger_event_identity), written with the same INSERT OR IGNORE + sentinel-error convention. Read internal/store/bindings.go:29-61,351-378 and internal/daemon/daemon.go:479-514 before designing anything -- this may reduce gap 2 to 'apply the existing pattern to a new key shape' rather than new design.\n4. Key derivation: a CEL-reachable expression over event fields, or a stable hash of event-identity+playbook-id -- pick one and justify it against the expr package's actual context surface, and against how capture identity is derived today (check what 'capture_id' actually is -- likely a stable hash or row id from the same capture pipeline a playbook trigger would also read).","acceptance_criteria":"eda-playbook-engine.md's Execution-time gap 2 section is marked resolved with a stated decision (not a survey of options) covering granularity, key storage/lookup, redelivery behavior, and key derivation. Consistent with event-sources-and-reactions.md's existing idempotency contract -- explicitly states how it extends rather than contradicts it. No code changes required for this ticket to close.","notes":"Proposed resolution drafted 2026-09-03 in docs/prds/eda-playbook-engine.md, commit 99eaa7a -- reuses internal/store/bindings.go's binding_dispatches ledger shape. Explicitly marked 'awaiting Sam's sign-off,' not settled. Surfaced two concrete prerequisites while drafting: t2db.15's Playbook struct needs an ID/Version (doesn't have one), and DispatchInput needs a task identity threaded through (doesn't have one either) -- both stated honestly as blockers for implementation, not glossed over.","status":"closed","priority":1,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-09-02T18:12:13Z","created_by":"Sam Catlow","updated_at":"2026-09-05T07:10:42Z","closed_at":"2026-09-05T07:10:42Z","close_reason":"Closed","dependencies":[{"issue_id":"archie-core-t2db.17","depends_on_id":"archie-core-t2db","type":"parent-child","created_at":"2026-09-02T18:12:13Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":3,"comment_count":0} {"_type":"issue","id":"archie-core-e7bo","title":"fix stale wfextract go:generate directive; audit pluginextract/secretextract drift","description":"Discovered 2026-09-03 while scoping archie-core-t2db.13 (Module position). Two separate, pre-existing issues, unrelated to the playbook engine work -- do not fix as a drive-by inside that ticket.\n\n1. internal/domain/workflow/wfextract/wfextract.go's //go:generate directive still targets 'github.com/samcharles93/archie-core/internal/workflow', a path that has not existed since the domain migration (7e896c9, 2026-08-07 - the package moved to internal/domain/workflow). The committed generated file was hand-patched at some point to import the new path, but the directive itself was never fixed. Net effect: 'go generate ./...' has been broken repo-wide (at least for wfextract) since that migration, silently, for anyone who hasn't tried running it.\n\n2. Running 'go generate ./...' anyway (to see what breaks) also produced real, substantive diffs in internal/plugin/pluginextract and internal/secret/secretextract's generated symbol tables -- new wrapper types (Host, Module) appearing that are NOT in the currently-committed, in-production symbol tables. This means the Yaegi plugin and secret-engine extension surfaces have been running against stale, incomplete generated symbol tables for an unknown period: interpreted plugin/secret-engine code may be unable to reference types it should have access to. This is a latent correctness gap with real blast radius on two extension surfaces, not cosmetic drift.","design":"Two-part fix, do not conflate:\n1. Fix wfextract's directive to point at internal/domain/workflow (matching what the generated file already imports). Verify 'go generate ./internal/domain/workflow/wfextract/...' now succeeds and produces output identical (or intentionally different, documented why) to what's committed.\n2. For pluginextract/secretextract: do NOT blindly regenerate-and-commit. First determine why they're stale (when did plugin.go/secret's Engine gain the types the fresh generation adds -- git log on internal/plugin/plugin.go and internal/secret's engine files vs. when the generated files were last touched) and whether any existing test exercises a Yaegi plugin/secret-engine referencing the missing types (if none does, that's itself a coverage gap worth noting). Regenerate, gofumpt, and add/confirm a test that would have caught the drift, before committing the regenerated symbol tables -- this is a correctness-sensitive change to two live extension surfaces and needs real verification, not a mechanical re-run.","acceptance_criteria":"'go generate ./...' completes without error across the whole repo. wfextract's directive matches its actual package path. pluginextract/secretextract regeneration (if done) is backed by a test demonstrating the previously-missing types are now reachable from interpreted code, and task check passes. No behavior change to existing plugins/secret engines that were already working (regression-tested, not assumed).","status":"closed","priority":1,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-09-02T17:17:42Z","created_by":"Sam Catlow","updated_at":"2026-09-02T17:30:34Z","closed_at":"2026-09-02T17:30:34Z","close_reason":"Fixed and gate-verified as e3a20f6 (pushed to main). wfextract directive now targets internal/domain/workflow; 'go generate ./...' completes repo-wide. All four extract surfaces regenerated; nil-guards re-applied on interface wrappers (documented IMPORTANT note restated in wfextract package doc). Previously-missing symbols proven reachable from interpreted code: wfextract (Forger/Reviewer/Trees/routing loaders) and pluginextract (Host/Module/Manifest/NewHost/HostAPIVersion) via new reachability tests; secretextract exports were current (nil-guard drift only). Red-then-green verified: fresh regen wipes guards -\u003e guard tests panic -\u003e re-apply -\u003e pass. task check clean (113/113 UI, exit 0).","dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-95dj","title":"StageCommitPush discards baseline-fix commits when build makes no changes","description":"Confirmed via carina production logs (task 6, chat-spawned synthetic test task, 2026-09-02). StageBaselineGate (internal/domain/workflow/implement.go:37) found the repo's gate red at the base commit, spent 405,004 tokens/14 iterations genuinely fixing two broken pre-existing tests, and committed the fix locally via tc.Trees.CommitAll (implement.go:104) -- verified passing. plan and build stages then correctly found nothing else to do for the (synthetic, content-free) task. StageCommitPush -\u003e closeNoChangesIssue (steps.go:56) decides 'no changes' purely from tc.BuildNoChanges, which the build AgentStage sets from its own len(res.Changes)==0 (implement.go:176) -- it has zero awareness that StageBaselineGate already committed real changes two stages earlier. Never pushed, never opened a PR; the entire worktree containing a real, gate-verified fix for genuinely broken tests was discarded when the task closed as 'merged: completed -- no changes required'.\n\nCost: 669,421 tokens burned to fix a real bug that then evaporated. This recurs: any task that hits the same red baseline pays the identical tax again since the fix never lands. Evidence a prior incident already happened: an orphaned 'fix: baseline gate repair' commit (e49f3cd) sits on a stale, unmerged branch (fix/441-archied-repos-entries-cant-span-more-than-one-forge) from an earlier occurrence.","design":"Fix direction: either (a) StageBaselineGate sets a flag /flips tc.BuildNoChanges appropriately when it commits, or (b) StageCommitPush's no-changes branch checks the worktree's actual diff against the base branch (tc.Trees, similar to StageDiffCap's ChangedLines) instead of trusting tc.BuildNoChanges alone. Prefer (a): cheaper, and keeps the diff-against-base check (which already exists for StageDiffCap) from being computed twice per task.","acceptance_criteria":"A task whose baseline-fix stage committed real changes, but whose plan/build stages found nothing further to do, still pushes and opens a PR carrying the baseline-fix commit -- it must never be silently discarded. tc.BuildNoChanges (or StageCommitPush's decision) accounts for what StageBaselineGate already committed, not just the build stage's own diff. Regression test reproduces the exact scenario (baseline-fix commits, build stage reports zero changes) and proves a PR opens. task check passes.","status":"closed","priority":1,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-09-02T11:20:48Z","created_by":"Sam Catlow","updated_at":"2026-09-02T14:56:02Z","started_at":"2026-09-02T11:20:51Z","closed_at":"2026-09-02T11:25:53Z","close_reason":"Fixed via a new TaskContext.BaselineFixed flag: StageBaselineGate sets it when its own CommitAll reports a real committed change (implement.go:104-111). The build stage's OnResult only sets BuildNoChanges when its own diff is empty AND BaselineFixed is false (implement.go:177), so a baseline-only fix can no longer be masked as 'no changes'. StageCommitPush itself now calls CommitAll directly and pushes whenever either a new commit was made OR BaselineFixed is true (steps.go), instead of erroring on 'nothing to commit' when the real change already sits on the branch from the baseline-fix commit. Two new regression tests (TestStageCommitPushPushesBaselineFixEvenWithNothingNewToCommit, TestStageBaselineGateSetsBaselineFixedWhenItCommits) plus a guard test that the old empty-tree error still fires without a baseline fix. task check clean.","external_ref":"https://github.com/samcharles93/archie-core/issues/682","dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-s81k","title":"Preserve bound slog attributes in persistent log sinks","description":"PR #650 scopes daemon, Web UI, and curator loggers with slog.Logger.With. internal/logging.FeedHandler.WithAttrs retains those bound attributes for the live feed but does not pass them to the wrapped handler, while Handle forwards the bare slog.Record. As a result, component is present in live Web UI entries but absent from stderr and file JSON; after restart, historical component discovery and filtering cannot see those records. Fix bound-attribute propagation without breaking slog group semantics or duplicating attributes.","acceptance_criteria":"Bound attributes appear in both Feed entries and the wrapped JSON sink; component values survive file persistence and are discoverable and filterable through historical /api/logs reads; regression tests exercise logger.With for both live and persistent paths; task check passes.","status":"closed","priority":1,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-09-02T09:37:55Z","created_by":"Sam Catlow","updated_at":"2026-09-02T09:48:54Z","closed_at":"2026-09-02T09:43:01Z","close_reason":"Fixed: FeedHandler.WithAttrs/WithGroup now propagate to the wrapped handler, matching SystemLogHandler's existing pattern. Added regression test covering both feed and persistent sink.","external_ref":"https://github.com/samcharles93/archie-core/issues/655","dependency_count":0,"dependent_count":0,"comment_count":0} @@ -100,7 +103,9 @@ {"_type":"issue","id":"archie-core-g7tm","title":"telegram: finalize the reply through a live context, matching the error branch","description":"The success path calls live.finalize(turnCtx, reply) with the raw cancellable turn context (telegram.go:582), while the error branch two lines above deliberately uses context.WithoutCancel(turnCtx). If /stop lands during finalize, the rich edit, the plain-text retry, and the split-send fallback all abort with context.Canceled (go-telegram/bot builds requests with NewRequestWithContext), so the authoritative reply is never delivered and the live message keeps the ▌ cursor forever. The reply is persisted to the ledger, so the loss is delivery-level — but the user sees a frozen half-answer.\n\nFailure: a long tool-using turn is /stop-ped as it completes; turnCtx is cancelled mid-finalize; every send fails on the dead context; the chat shows the last live frame with a blinking cursor and no final answer.\n\nFound by code-review of PR #476 (feat/467, merged 98e8dda).","design":"live.finalize(context.WithoutCancel(turnCtx), reply) — the one-liner the error branch already uses. Consider making finalize take a live context internally rather than trusting each caller to remember.","acceptance_criteria":"A /stop landing mid-finalize still delivers the authoritative reply and drops the cursor; a test covers the cancellable-context finalize path.","status":"closed","priority":1,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-14T14:43:08Z","created_by":"Sam Catlow","updated_at":"2026-08-14T15:07:36Z","started_at":"2026-08-14T14:53:28Z","closed_at":"2026-08-14T15:03:28Z","close_reason":"Fixed in internal/channels/telegram/live.go and telegram.go: finalize/abandon strip context cancellation before sending (mirroring each other), ToolCall escapes Markdown metacharacters via bot.EscapeMarkdown, splitLongMessage splits on rune boundaries. All new/changed tests verified red-then-green; task check clean; adversarial review pass found no blocking issues.","external_ref":"https://github.com/samcharles93/archie-core/issues/484","labels":["code-review","streaming","telegram"],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-tb3a","title":"Fix streaming review blockers for inline tool calls","description":"Resolve the four evidence-gated findings in merged inline tool-call streaming: preserve the authoritative Telegram reply when final edits fail; keep Telegram network I/O off the model FullStream consumer and cancellable; correlate tool inputs with results and render a bounded redacted parameter summary; snapshot show_tool_calls per live reply to avoid reload races. Add regression tests for every path and run task check plus lint/race validation.","acceptance_criteria":"Regression tests fail on the merged implementation and pass after the fix. Final edit failure falls back to normal split delivery. Delta and ToolCall callbacks do not wait on Telegram HTTP and stop cancels in-flight rendering. Completed tool events include bounded redacted parameters correlated by tool-call ID. Reload cannot race an in-flight reply's show_tool_calls setting. task check passes, golangci-lint reports no new findings, and focused race tests pass.","notes":"Implemented in worktree /tmp/archie-core-tb3a on branch fix/archie-core-tb3a. Added cancellable async Telegram rendering, final edit failure fallback through normal split delivery, call-ID-correlated bounded conservative parameter summaries, atomic per-reply show_tool_calls snapshots, SSE/UI parameter rendering, rebuilt ui/dist, and regression tests. Validation: GOFLAGS=-buildvcs=false task check passed; golangci-lint --new-from-rev=HEAD ./... reported 0 issues; focused race suite passed; fresh adversarial reviewer reported PASS with zero findings. Plain task check is blocked in linked worktrees by Go VCS stamping exit 128, hence buildvcs override.\n2026-08-24 reconciliation: the close reason's 'worktree left uncommitted' is stale. The work did land on main via ba33527 (Merge pull request #477 from samcharles93/fix/archie-core-tb3a); verified on main: gateway/stream.go sensitiveParameterKey+redactToolParameters, telegram/live.go per-reply showToolCalls snapshot, webui/api_chat.go gating. The /tmp/archie-core-tb3a worktree and its branch are gone, as expected.\n","status":"closed","priority":1,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-13T18:05:35Z","created_by":"Sam Catlow","updated_at":"2026-08-24T07:29:09Z","started_at":"2026-08-13T18:05:39Z","closed_at":"2026-08-13T18:35:26Z","close_reason":"Completed and independently reviewed; worktree left uncommitted per conservative repository policy.","external_ref":"https://github.com/samcharles93/archie-core/issues/485","dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-dzx","title":"Remove duplicate archie-agent safe.directory setup","description":"## Problem\\ncmd/archie-agent/main.go configures git safe.directory inline and then calls markWorktreeSafe, so startup writes the same global git configuration twice.\\n\\n## Scope\\nKeep markWorktreeSafe as the single tested production path and remove the older inline exec.Command block/import. Add regression coverage proving startup wiring has exactly one authoritative safe-directory call.\\n\\n## Acceptance\\n- archie-agent startup invokes markWorktreeSafe exactly once\\n- no second inline safe.directory command remains in main.go\\n- cmd/archie-agent tests and repository quality gate pass","acceptance_criteria":"Single tested safe.directory setup path remains; duplicate inline command is removed; tests and task check pass","notes":"Red proof: TestMainConfiguresWorktreeSafetyOnce failed with 2 setup paths before implementation. Green proof: go test/vet/build ./cmd/archie-agent/... passed; golangci-lint --new-from-rev=HEAD reported 0 issues. Fresh adversarial review found no blockers. Full task check was not run because the working tree contains unrelated in-progress changes and task check rewrites files; scoped package gate used per repository protocol.","status":"closed","priority":1,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-13T16:10:09Z","created_by":"Sam Catlow","updated_at":"2026-08-13T16:13:48Z","started_at":"2026-08-13T16:10:24Z","closed_at":"2026-08-13T16:13:48Z","close_reason":"Removed duplicate inline safe.directory setup; markWorktreeSafe is now the single tested production path","external_ref":"https://github.com/samcharles93/archie-core/issues/470","dependency_count":0,"dependent_count":0,"comment_count":0} -{"_type":"issue","id":"archie-core-14cs","title":"Resolve pre-existing task check gate blockers (lint + jsdom)","description":"Two pre-existing blockers keep the authoritative task check gate red, independently of the progressive-tool-disclosure wiring (issue #167):\n\n1. golangci-lint: 5 issues in files untouched by #167:\n - internal/app/archied/bootstrap.go:316 (cyclop: setupObservability complexity 16 \u003e 15)\n - internal/app/archied/bootstrap.go:405 (nestif)\n - internal/app/archied/telegram_setup_test.go:64 (usetesting: os.Setenv -\u003e t.Setenv)\n - internal/releaseupdate/install_script_test.go:143,160 (noctx: exec.Command -\u003e CommandContext)\n\n All 5 confirmed reproducible on clean main (git stash comparison) and match the documented non-green lint baseline in the archie-build-and-env skill.\n\n2. task test:ui fails because ui/node_modules is not installed (ERR_MODULE_NOT_FOUND: jsdom, declared at ui/package.json:16). Needs npm install before the ui test can run.\n\nBlockers are environmental/baseline, not introduced by the tool-disclosure wiring.\n","status":"open","priority":2,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-09-05T03:25:29Z","created_by":"Sam Catlow","updated_at":"2026-09-05T03:25:29Z","dependency_count":0,"dependent_count":0,"comment_count":0} +{"_type":"issue","id":"archie-core-8cda.4","title":"Phase 2: Extract the State Store Service","description":"Second extraction in the resolved order. Expose internal/store as its own\nservice behind its narrow contracts over gRPC. This generalises the\npattern already in production: internal/storerpc proxies\nstore.WorkflowStore to the archie-agent container over NATS request/reply\ntoday (see resolved open question #4).\n\nPer question #4's resolution: ONE State Store service owns the existing\nsingle SQLite file (archie.db) behind narrow typed contracts (TaskStore,\nCaptureStore, MappingStore, BindingStore, WorkflowStore, BindingDispatcher,\nBindingTaskCreator from internal/store/interface.go). No physical\ndatabase-per-service split -- one store means no distributed-transactions\nproblem, and per the team-topology rule of thumb a solo maintainer gets no\nautonomy benefit from physical isolation. The Gateway's already-separate\nsession SQLite is unaffected and stays Gateway-owned.\n\nMigration path (from the research doc, in order of blast radius):\n1. Ratify internal/store/interface.go's narrow interfaces as the State\n Store contract surface (already true in code; authority decision only).\n2. Generalise internal/storerpc from proxying only WorkflowStore to\n serving the full narrow contract set, and move it from NATS\n request/reply to gRPC (per the PRD, gRPC is the sync transport).\n3. Swap direct internal/store imports in internal/webui,\n internal/domain/workflow, and the intake/binding paths onto the\n contract, starting with low-touch reads (CaptureStore, MappingStore,\n BindingStore), then WorkflowStore, then the TaskStore lifecycle\n surface.\n4. Stand up internal/store as archie-state-store (gRPC server over the\n same archie.db file); delete the in-process imports once every\n consumer speaks the contract.\n\nDepends on Phase 1 (Gateway extraction) per the resolved extraction\norder -- Gateway proves the process-split + gRPC playbook first.\n\nFull reasoning: docs/inspiration/service-decomposition-open-questions-research-2026-09-05.md#4\nand #1 (Phase 2 section).","acceptance_criteria":"- New cmd/archie-state-store binary serving TaskStore, CaptureStore,\n MappingStore, BindingStore, WorkflowStore, BindingDispatcher, and\n BindingTaskCreator over gRPC, all backed by the single existing\n archie.db SQLite file (no physical file split).\n- internal/storerpc generalised (or a successor package) to serve the\n full narrow contract set, migrated from NATS request/reply to gRPC.\n- internal/webui, internal/domain/workflow, and the intake/binding paths\n no longer import internal/store directly -- they call the State Store\n contract.\n- Each contract swap follows the local-adapter + gRPC-adapter +\n bufconn-conformance-suite shape from Phase 0, with a same-commit flip\n to mode = \"remote\" once archie-state-store is standing.\n- The Gateway's own session SQLite is untouched and remains\n Gateway-owned.\n- task check passes; a dashboard/combined view that reads across\n multiple contracts (task/event/capture) still works correctly through\n the new contract calls.","status":"open","priority":2,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-09-05T06:06:01Z","created_by":"Sam Catlow","updated_at":"2026-09-05T06:06:01Z","dependencies":[{"issue_id":"archie-core-8cda.4","depends_on_id":"archie-core-8cda","type":"parent-child","created_at":"2026-09-05T06:06:01Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-8cda.4","depends_on_id":"archie-core-8cda.3","type":"blocks","created_at":"2026-09-05T06:06:59Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":1,"dependent_count":1,"comment_count":0} +{"_type":"issue","id":"archie-core-8cda.3","title":"Phase 1: Extract the Gateway Service","description":"First real process extraction in the resolved extraction order (open\nquestion #1). Stand up archie-gateway as its own binary serving\nChatContract over gRPC, using its existing isolated session SQLite\n(internal/gateway/session_store_sqlite.go) and its existing store\nadapters (the Gateway does not import internal/store today --\nmain.go:139, gateway/tasks.go:44 -- it consumes narrow contracts\nStatusReader/TaskCreator/TaskLister/TaskController/AgentReader that\ninternal/app/archied adapts).\n\nMigrate consumers onto ChatContract over gRPC:\n- UI (internal/webui) stops holding gateway.Router/SessionStore/Turns/\n ModelManager/PersonaRegistry in-process and calls ChatContract instead.\n- Messaging/Telegram's task-action path\n (chatTaskActorAdapter.ApplyChatTaskAction,\n internal/app/archied/main.go:655) stops detouring through webui's\n handleTaskAction HTTP handler (internal/webui/api_tasks.go:136,\n mounted at server.go:294) and calls ChatContract directly.\n\nWhy the Gateway goes first (not the generic \"leaf first\" advice): it is\nalready store-decoupled and already owns isolated session data, making\nit both the stickiest capability (everything routes through it) and the\none with a ready seam -- extracting it first also unblocks UI (the most\nentangled consumer), which is the PRD's ultimate goal. This is also the\noperations dry-run for the gRPC/discovery playbook.\n\nDepends on Phase 0 (the ChatContract seam, local + gRPC adapters, and\nconformance suite must exist and be usable before the network path\nbecomes production).\n\nFull reasoning: docs/inspiration/service-decomposition-open-questions-research-2026-09-05.md#1\n(Phase 1 section).","acceptance_criteria":"- New cmd/archie-gateway binary serving ChatContract over real gRPC\n (using the generated server/client from Phase 0's proto definition).\n- Same-commit deletion of the in-process ChatContract serving path per\n question #3's resolved mechanism (no dual-live window); consumers\n flipped to mode = \"remote\" for ChatContract in that same commit.\n- Gateway's existing session SQLite and store adapters move with it into\n the new binary; no other domain's data moves.\n- internal/webui's chat path calls ChatContract over gRPC; it no longer\n holds gateway.Router/SessionStore/Turns/ModelManager/PersonaRegistry\n struct fields directly (closes verified coupling #2 from the PRD).\n- Messaging/Telegram's task-action path (pause/resume/abandon) calls\n ChatContract directly; the webui HTTP detour\n (chatTaskActorAdapter.ApplyChatTaskAction -\u003e handleTaskAction) is\n removed (closes verified coupling #1 from the PRD).\n- A deployment profile or docs update reflecting the new archie-gateway\n binary (deployments/ per this repo's existing profile conventions).\n- task check passes; the daemon and archie-gateway both build; an\n end-to-end smoke path (chat turn through the new gRPC hop) is\n exercised.","status":"open","priority":2,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-09-05T06:05:46Z","created_by":"Sam Catlow","updated_at":"2026-09-05T06:05:46Z","dependencies":[{"issue_id":"archie-core-8cda.3","depends_on_id":"archie-core-8cda","type":"parent-child","created_at":"2026-09-05T06:05:46Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-8cda.3","depends_on_id":"archie-core-8cda.2","type":"blocks","created_at":"2026-09-05T06:06:59Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":1,"dependent_count":1,"comment_count":0} +{"_type":"issue","id":"archie-core-14cs","title":"Resolve pre-existing task check gate blockers (lint + jsdom)","description":"Two pre-existing blockers keep the authoritative task check gate red, independently of the progressive-tool-disclosure wiring (issue #167):\n\n1. golangci-lint: 5 issues in files untouched by #167:\n - internal/app/archied/bootstrap.go:316 (cyclop: setupObservability complexity 16 \u003e 15)\n - internal/app/archied/bootstrap.go:405 (nestif)\n - internal/app/archied/telegram_setup_test.go:64 (usetesting: os.Setenv -\u003e t.Setenv)\n - internal/releaseupdate/install_script_test.go:143,160 (noctx: exec.Command -\u003e CommandContext)\n\n All 5 confirmed reproducible on clean main (git stash comparison) and match the documented non-green lint baseline in the archie-build-and-env skill.\n\n2. task test:ui fails because ui/node_modules is not installed (ERR_MODULE_NOT_FOUND: jsdom, declared at ui/package.json:16). Needs npm install before the ui test can run.\n\nBlockers are environmental/baseline, not introduced by the tool-disclosure wiring.\n","status":"closed","priority":2,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-09-05T03:25:29Z","created_by":"Sam Catlow","updated_at":"2026-09-05T07:10:43Z","closed_at":"2026-09-05T07:10:43Z","close_reason":"Closed","dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-t2db.22","title":"eda: carry originating task identity on DispatchInput (gap-2 prereq)","description":"Prerequisite for the t2db.17 idempotency resolution. DispatchInput (internal/domain/eda/playbook/playbook.go:187) is {Labels, Kind, Event} with no task identity, so a playbook run cannot derive an event_id for a playbook_dispatches ledger key. Thread the originating task's identity (store.Task.ID, or the TaskEnvelope idempotency key that produced it). IMPORTANT: there is NO production caller of Store.Dispatch today -- DispatchInput is only constructed in tests -- so confirm which identity is actually available at the real Dispatch call site before fixing the field type; do not assume store.Task.ID is available at label/kind classification time (it is not: pollNATS/classify produces the envelope before any task row exists, so the TaskEnvelope.IdempotencyKey string is the identity available there).","design":"Add an identity field to DispatchInput, populated by the (currently nonexistent) production caller. Decide field type against the discovery-path evidence: pollNATS (internal/daemon/daemon.go:844) and the webhook receiver (receiver.go:243) both compute kind/labels from a TaskEnvelope BEFORE any store.Task row exists, and TaskEnvelope.IdempotencyKey() returns 'archie:owner/repo/number' -- so a string identity (the idempotency key) is the available, stable value at the dispatch point, not a store.Task.ID int64. Add a test proving DispatchInput carries it end to end; wire the real production caller only when the coordinator lands.","acceptance_criteria":"DispatchInput carries the originating task's identity (typed as decided against evidence). A test demonstrates the identity is present on the input and reaches the key-derivation path. No production dispatch caller is wired in this ticket (none exists today). task check passes.","status":"closed","priority":2,"issue_type":"task","owner":"sam@catlow.tech","estimated_minutes":30,"created_at":"2026-09-04T17:07:09Z","created_by":"Sam Catlow","updated_at":"2026-09-04T17:10:44Z","closed_at":"2026-09-04T17:10:44Z","close_reason":"Implementation complete and gate-verified for its scope. Playbook gains ID (path-relative) + Version (sha256 content hash), populated in loadOne; DispatchInput gains TaskID string carrying TaskEnvelope.IdempotencyKey(), per evidence that the discovery point computes kind/labels before any store.Task row exists. Red-green verified; gofumpt/vet/build/golangci-lint clean for the package. NOTE: task check has 5 lint failures PRE-EXISTING at HEAD in unrelated files (bootstrap.go cyclop/nestif, install_script_test.go noctx, telegram_setup_test.go usetesting) -- not caused by this change. Forced close because the earlier blocked-by: t2db.17 dependency is inverted -- .17 is doc-only sign-off; these are its implementation prereqs, not gated on it.","dependencies":[{"issue_id":"archie-core-t2db.22","depends_on_id":"archie-core-t2db","type":"parent-child","created_at":"2026-09-04T17:07:09Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-t2db.22","depends_on_id":"archie-core-t2db.17","type":"blocks","created_at":"2026-09-04T17:07:09Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":1,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-t2db.21","title":"eda: thread Playbook ID and Version for idempotency-ledger keying (gap-2 prereq)","description":"Prerequisite for the t2db.17 idempotency resolution. The shipped Playbook struct (internal/domain/eda/playbook/playbook.go) is {Trigger, Actions} with no ID and no Version, so a playbook_dispatches ledger keyed on (playbook_id, playbook_version, event_id) cannot be built. Add ID (stable path-relative identifier) and Version (content hash of the loaded file, recomputed on every load), both populated at load time. Mirror Binding.Version's purpose: pin dispatched-run provenance to the exact definition that was active when it fired.","status":"closed","priority":2,"issue_type":"task","owner":"sam@catlow.tech","estimated_minutes":30,"created_at":"2026-09-04T17:07:01Z","created_by":"Sam Catlow","updated_at":"2026-09-04T17:10:44Z","closed_at":"2026-09-04T17:10:44Z","close_reason":"Implementation complete and gate-verified for its scope. Playbook gains ID (path-relative) + Version (sha256 content hash), populated in loadOne; DispatchInput gains TaskID string carrying TaskEnvelope.IdempotencyKey(), per evidence that the discovery point computes kind/labels before any store.Task row exists. Red-green verified; gofumpt/vet/build/golangci-lint clean for the package. NOTE: task check has 5 lint failures PRE-EXISTING at HEAD in unrelated files (bootstrap.go cyclop/nestif, install_script_test.go noctx, telegram_setup_test.go usetesting) -- not caused by this change. Forced close because the earlier blocked-by: t2db.17 dependency is inverted -- .17 is doc-only sign-off; these are its implementation prereqs, not gated on it.","dependencies":[{"issue_id":"archie-core-t2db.21","depends_on_id":"archie-core-t2db","type":"parent-child","created_at":"2026-09-04T17:07:01Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-t2db.21","depends_on_id":"archie-core-t2db.17","type":"blocks","created_at":"2026-09-04T17:07:01Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":1,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-wdn0","title":"Reconcile beads\u003c-\u003eGitHub issue state after cross-machine sync","description":"After the 2026-09-03 helix/carina reconciliation, bead statuses are authoritative locally but GitHub was never reconciled. Walk closed beads against gh issue list --state all via external_ref and push the differences. Per prior incident notes: bd github push takes ONE id per invocation (multiple ids silently no-op and exit 0), and identical updated_at timestamps make sync skip an issue forever -- close directly with gh issue close in that case.","status":"open","priority":2,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-09-03T12:28:29Z","created_by":"Sam Catlow","updated_at":"2026-09-03T12:28:29Z","dependency_count":0,"dependent_count":0,"comment_count":0} @@ -385,9 +390,9 @@ {"_type":"issue","id":"archie-core-1786637496911-270-7c404435","title":"Verify: Health endpoint: GET /health and GET /health/detailed","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:08Z","updated_at":"2026-08-08T14:48:11Z","closed_at":"2026-08-08T14:48:12Z","external_ref":"https://github.com/samcharles93/archie-core/issues/291","source_system":"github:https://github.com/samcharles93/archie-core/issues/291:291","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-1786637496890-269-ff65f3be","title":"Verify: Readiness probes: multi-check subsystem probe","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:03Z","updated_at":"2026-08-08T14:48:06Z","closed_at":"2026-08-08T14:48:07Z","external_ref":"https://github.com/samcharles93/archie-core/issues/290","source_system":"github:https://github.com/samcharles93/archie-core/issues/290:290","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-1786637496863-268-ac378cff","title":"systemd notify: sd_notify integration with loop-progress sampling","description":"Integrate sd_notify (systemd service notification) to signal readiness and watchdog status. Sample loop progress to periodically send WATCHDOG=1 notifications.","status":"open","priority":2,"issue_type":"task","created_at":"2026-08-08T14:48:00Z","updated_at":"2026-08-08T14:48:00Z","external_ref":"https://github.com/samcharles93/archie-core/issues/289","source_system":"github:https://github.com/samcharles93/archie-core/issues/289:289","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0} -{"_type":"issue","id":"archie-core-1786637496842-267-8b2984f9","title":"Shutdown watchdog: out-of-loop os.Exit backstop","description":"Implement a shutdown watchdog with out-of-loop os.Exit as a backstop. After drain timeout, wait 60s grace period then force-exit to prevent hung processes.","status":"open","priority":2,"issue_type":"task","created_at":"2026-08-08T14:47:57Z","updated_at":"2026-08-08T14:47:57Z","external_ref":"https://github.com/samcharles93/archie-core/issues/288","source_system":"github:https://github.com/samcharles93/archie-core/issues/288:288","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0} -{"_type":"issue","id":"archie-core-1786637496817-266-06b64a72","title":"Drain control: marker file and instantiation epoch","description":"Implement drain control using a .drain_request.json marker file. Validate against instantiation epoch to distinguish stale drain requests from current ones.","status":"open","priority":2,"issue_type":"task","created_at":"2026-08-08T14:47:54Z","updated_at":"2026-08-08T14:47:54Z","external_ref":"https://github.com/samcharles93/archie-core/issues/287","source_system":"github:https://github.com/samcharles93/archie-core/issues/287:287","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0} -{"_type":"issue","id":"archie-core-1786637496789-265-b052b772","title":"Health endpoint: GET /health and GET /health/detailed","description":"Implement GET /health (simple liveness check) and GET /health/detailed (authenticated, returns per-subsystem readiness status with individual probe results).","status":"open","priority":2,"issue_type":"task","created_at":"2026-08-08T14:47:51Z","updated_at":"2026-08-08T14:47:51Z","external_ref":"https://github.com/samcharles93/archie-core/issues/286","source_system":"github:https://github.com/samcharles93/archie-core/issues/286:286","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0} +{"_type":"issue","id":"archie-core-1786637496842-267-8b2984f9","title":"Shutdown watchdog: out-of-loop os.Exit backstop","description":"Implement a shutdown watchdog with out-of-loop os.Exit as a backstop. After drain timeout, wait 60s grace period then force-exit to prevent hung processes.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-08-08T14:47:57Z","updated_at":"2026-09-05T07:10:42Z","closed_at":"2026-09-05T07:10:42Z","close_reason":"Closed","external_ref":"https://github.com/samcharles93/archie-core/issues/288","source_system":"github:https://github.com/samcharles93/archie-core/issues/288:288","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0} +{"_type":"issue","id":"archie-core-1786637496817-266-06b64a72","title":"Drain control: marker file and instantiation epoch","description":"Implement drain control using a .drain_request.json marker file. Validate against instantiation epoch to distinguish stale drain requests from current ones.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-08-08T14:47:54Z","updated_at":"2026-09-05T07:10:42Z","closed_at":"2026-09-05T07:10:42Z","close_reason":"Closed","external_ref":"https://github.com/samcharles93/archie-core/issues/287","source_system":"github:https://github.com/samcharles93/archie-core/issues/287:287","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0} +{"_type":"issue","id":"archie-core-1786637496789-265-b052b772","title":"Health endpoint: GET /health and GET /health/detailed","description":"Implement GET /health (simple liveness check) and GET /health/detailed (authenticated, returns per-subsystem readiness status with individual probe results).","status":"closed","priority":2,"issue_type":"task","created_at":"2026-08-08T14:47:51Z","updated_at":"2026-09-05T07:10:42Z","closed_at":"2026-09-05T07:10:42Z","close_reason":"Closed","external_ref":"https://github.com/samcharles93/archie-core/issues/286","source_system":"github:https://github.com/samcharles93/archie-core/issues/286:286","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-1786637496762-264-b9b31724","title":"Verify: systemd notify: sd_notify integration with loop-progress sampling","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:47:46Z","updated_at":"2026-08-08T14:47:49Z","closed_at":"2026-08-08T14:47:50Z","external_ref":"https://github.com/samcharles93/archie-core/issues/285","source_system":"github:https://github.com/samcharles93/archie-core/issues/285:285","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-1786637496732-263-54b6686b","title":"Readiness probes: multi-check subsystem probe","description":"Implement readiness probes for: state_db (read-only probe), config (parse check), disk usage (\u003c90%), model (configured), and gateway state (connected adapters).","status":"open","priority":2,"issue_type":"task","created_at":"2026-08-08T14:47:43Z","updated_at":"2026-08-08T14:47:43Z","external_ref":"https://github.com/samcharles93/archie-core/issues/284","source_system":"github:https://github.com/samcharles93/archie-core/issues/284:284","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-1786637496703-262-1e49aef1","title":"Operations: readiness probes + drain control + systemd notify","description":"Production operations infrastructure:\n\n1. **Readiness probes**: Multi-check system — state_db (read-only probe), config (parse check), disk (\u003c90%), model (configured), gateway (running/draining + connected count). Return overall ok or degraded.\n2. **Drain control**: Marker file (~/.archie/.drain_request.json) for external drain triggers. Instantiation epoch (boot_id + PID 1 start time) to distinguish restart types.\n3. **Shutdown watchdog**: Out-of-loop os.Exit backstop if shutdown exceeds leash (drain timeout + 60s grace).\n4. **systemd notify**: sd_notify integration — watchdog with loop-progress sampling, ready status on startup.\n\nRef: docs/prds/hermes-gap-analysis.md section 9-10 (readiness.py, drain_control.py, shutdown_watchdog.py, systemd_notify.py)\n\n### Acceptance Criteria\n\nGET /health returns JSON with per-subsystem status. systemd watchdog fires if the event loop stalls. Drain requests initiate graceful shutdown.\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:47:39Z","updated_at":"2026-08-15T12:47:29Z","external_ref":"https://github.com/samcharles93/archie-core/issues/283","source_system":"github:https://github.com/samcharles93/archie-core/issues/283:283","metadata":null,"labels":["enhancement"],"dependency_count":0,"dependent_count":0,"comment_count":0} @@ -652,11 +657,15 @@ {"_type":"issue","id":"archie-core-1786637489857-3-24abe68c","title":"fix(gateway): make /compress failure-safe","description":"applyCompress swallows MessageCount and DeleteRecentMessages errors (allCount, _ := and _, _ =) then deletes all messages BEFORE saving the compressed replacement. A crash or error between the two loses the session's entire history unrecoverably. Add a store-level ReplaceMessages that saves first and deletes the previously-listed IDs after, so the failure mode is recoverable duplicates rather than total loss.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-08-08T14:26:24Z","updated_at":"2026-08-08T15:33:31Z","closed_at":"2026-08-08T15:33:32Z","external_ref":"https://github.com/samcharles93/archie-core/issues/24","source_system":"github:https://github.com/samcharles93/archie-core/issues/24:24","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-1786637489834-2-109e7cab","title":"[BUG] /model \u003cname\u003e asked the router for a doubled model name","description":"The nestif extraction in 651de0a pulled --provider parsing out of parseModelRest into extractProviderFlag, which took the modelParts slice by pointer and appended every non-provider field to it. The caller's own loop then appended the same fields again, so every field of the model name was duplicated: '/model gpt-5.6' resolved to 'gpt-5.6 gpt-5.6' and SetActiveModel rejected it as an unknown model. '/model gpt-5.6 --provider openai' was worse -- the space-separated provider value was no longer consumed with its flag, giving 'gpt-5.6 gpt-5.6 openai'. Direct model switching over Telegram was broken for anything but a bare --refresh or a provider-only switch. Found while auditing 6d4e0be for archie-core-ifi: the naked return in the same function could not be regression-tested until the function produced correct values.\n\n### Design\n\nTwo ways to fix the double append were available. Rejected: keep the helper\nsignature and delete the caller's default-branch append. That restores correct\noutput but leaves the shape intact -- a helper holding a pointer to the\ncaller's accumulator, with two loops over the same fields -- so the next person\nwho adds a field type has the same trap waiting. It also does not fix the\nspace-separated provider value, because the helper returns early on the first\n--provider and never sees the fields after it.\n\nChosen: splitProviderFlag returns (provider, remaining) and is the sole\naccumulator. One loop owns the fields, and there is no shared slice to append\nto twice. The index loop is kept deliberately -- i++ after reading a\nspace-separated value is what removes it with its flag, and converting that to\na range loop is precisely what 651de0a did wrong.\n\nLast --provider wins if repeated, matching the pre-651de0a behaviour rather\nthan the buggy helper's first-wins. Not worth a flag: /model does not document\nrepeating it.\n\n### Acceptance Criteria\n\nparseModelRest returns the model name exactly once for bare names, scope flags, and both --provider spellings, with a regression test asserting field count rather than string equality.","status":"closed","priority":2,"issue_type":"bug","created_at":"2026-08-08T14:26:19Z","updated_at":"2026-08-08T15:34:07Z","closed_at":"2026-08-08T15:34:08Z","external_ref":"https://github.com/samcharles93/archie-core/issues/23","source_system":"github:https://github.com/samcharles93/archie-core/issues/23:23","metadata":null,"labels":["bug"],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-1786637489768-1-2fd8288f","title":"Trigger accounting: curator output must not feed its own trigger","description":"Establish the invariant that work a curator produces does not count toward the condition that schedules the next curator run. The scheduler must explicitly exclude derived curator output from the observation threshold: counting it would inflate the threshold and create a feedback loop, so a curator that writes memories must not thereby schedule itself again.\n\n### Acceptance Criteria\n\nDerived curator output is distinguishable from primary input at the point the trigger is evaluated. A curator that writes memories does not thereby schedule itself again. There is a regression test that would fail if derived output were counted, with the feedback-loop rationale recorded in the test so the guard is not removed as redundant.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-08-08T14:26:17Z","updated_at":"2026-08-15T12:55:20Z","closed_at":"2026-08-15T12:55:20Z","close_reason":"Complete: internal/domain/curator/wake.go WakeOnPrimaryInput forwards only explicitly-passed inputKinds; curator-produced kinds (curator_run, curator_action, curator_error) are structurally excluded, per its own doc comment naming this exact invariant. internal/domain/curator/wake_test.go:11-21 TestWakeOnPrimaryInputForwardsOnlyPrimaryKinds carries the required feedback-loop rationale verbatim ('if derived curator output counted... a curator that writes memories would schedule itself again... This test fails if a derived kind is added to the forwarded set or the filter is removed as redundant') and asserts passCalls/checkCalls stay at 1 after publishing derived-kind events. All three acceptance-criteria clauses satisfied exactly.","external_ref":"https://github.com/samcharles93/archie-core/issues/22","source_system":"github:https://github.com/samcharles93/archie-core/issues/22:22","metadata":null,"labels":["task"],"dependencies":[{"issue_id":"archie-core-1786637489768-1-2fd8288f","depends_on_id":"archie-core-1786637500725-414-9d66a52b","type":"parent-child","created_at":"2026-09-01T15:50:29Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0} +{"_type":"issue","id":"archie-core-8cda.7","title":"Phase 5: Extract Execution Environment + Runner + Scheduler","description":"Fifth extraction in the resolved order -- the heaviest and most\nstore-coupled phase, deliberately placed after the facade (Gateway) and\nthe data seam (State Store) are already proven.\n\nScope, per the PRD's target-services table:\n- Execution Environment: internal/domain/workflow's dispatch paths\n become the execution-dispatch contract, consuming State Store's\n WorkflowStore contract (Phase 2).\n- Runner: internal/container, internal/agentexec, internal/worktree\n become the isolated worktree/container execution service, consuming\n the existing container contract.\n- Scheduler: internal/domain/scheduling + internal/infrastructure/\n cronstore become the cron/ticker contract service.\n\nDepends on Phase 4 (Messaging extraction) per the resolved extraction\norder.\n\nNote: internal/storerpc's NATS path to the archie-agent container is\nexplicitly flagged in question #4's research as an Execution-track\nquestion (\"Migration of the storerpc NATS path... under the PRD the\nExecution/Runner processes are peers too, so the agent's store access\nshould eventually use the same contract\") -- this phase owns deciding\nwhen that moves, not the State Store phase.\n\nFull reasoning: docs/inspiration/service-decomposition-open-questions-research-2026-09-05.md#1\n(Phase 5 section).","acceptance_criteria":"- Execution Environment, Runner, and Scheduler stood up as separable\n services (or a documented decision to combine any of them into one\n binary, if scoping during implementation finds no benefit to a full\n three-way split -- but the contracts must be independently\n addressable).\n- Execution Environment consumes State Store's WorkflowStore contract\n over gRPC rather than importing internal/store directly.\n- The archie-agent container's storerpc NATS access path is either\n migrated onto the same contract-based access or an explicit documented\n decision is recorded for why it stays on NATS for this phase.\n- internal/channels/telegram and other invariants unaffected by this\n phase (container pull policy, NATS JetStream work-queue semantics from\n AGENTS.md remain intact).\n- task check passes; a full task lifecycle (intake -\u003e dispatch -\u003e worktree\n execution -\u003e completion) is exercised end-to-end against the extracted\n services.","status":"open","priority":3,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-09-05T06:06:35Z","created_by":"Sam Catlow","updated_at":"2026-09-05T06:06:35Z","dependencies":[{"issue_id":"archie-core-8cda.7","depends_on_id":"archie-core-8cda","type":"parent-child","created_at":"2026-09-05T06:06:35Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-8cda.7","depends_on_id":"archie-core-8cda.6","type":"blocks","created_at":"2026-09-05T06:07:01Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":1,"dependent_count":1,"comment_count":0} +{"_type":"issue","id":"archie-core-8cda.6","title":"Phase 4: Extract the Messaging Service","description":"Fourth extraction in the resolved order. Telegram/email/webhook adapters\n(internal/channels) become a peer service that calls Gateway's\nChatContract directly -- no UI HTTP detour. Every async channel becomes a\nfirst-class peer, and webui is no longer in any message path (the\nTelegram task-action detour was already closed in Phase 1, but this phase\nmakes Messaging a standalone deployable rather than a package linked into\nthe daemon).\n\nDepends on Phase 3 (UI extraction) per the resolved extraction order.\n\nFull reasoning: docs/inspiration/service-decomposition-open-questions-research-2026-09-05.md#1\n(Phase 4 section) and the PRD's target-services table entry for\nMessaging Service (channel-plugin contract: Telegram, email, Discord,\nTeams, ...).","acceptance_criteria":"- New Messaging Service binary/process hosting the channel-plugin\n contract, wrapping the existing internal/channels adapters (Telegram\n at minimum, per the currently-implemented channel).\n- The Messaging Service calls Gateway's ChatContract directly over gRPC\n for turn dispatch and task actions; no HTTP call into a UI process\n anywhere in the message path.\n- internal/channels/telegram's existing invariants (dropPendingUpdates\n before b.Start, command menu registration to\n default/all_private_chats/all_group_chats) are preserved unchanged in\n the new service.\n- task check passes; a live Telegram round-trip (or equivalent channel\n smoke test) is exercised against the extracted service.","status":"open","priority":3,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-09-05T06:06:23Z","created_by":"Sam Catlow","updated_at":"2026-09-05T06:06:23Z","dependencies":[{"issue_id":"archie-core-8cda.6","depends_on_id":"archie-core-8cda","type":"parent-child","created_at":"2026-09-05T06:06:23Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-8cda.6","depends_on_id":"archie-core-8cda.5","type":"blocks","created_at":"2026-09-05T06:07:00Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":1,"dependent_count":1,"comment_count":0} +{"_type":"issue","id":"archie-core-8cda.5","title":"Phase 3: Extract the UI Service","description":"Third extraction in the resolved order. By this phase UI is finally a\ngenuinely thin client: internal/webui serves the SPA from ui/dist and\ncalls Gateway's ChatContract (Phase 1) and State Store's read contracts\n(Phase 2) instead of holding internal objects or importing internal/store\ndirectly.\n\nThis closes the last verified coupling from the PRD's \"Why this shape\"\nsection: bootstrap.go:1239's shared config.Holder (\"web and the daemon\nmust share ONE Holder\", bootstrap.go:1236, handed to webui at\nbootstrap.go:336). Under this phase each service owns its own\nconfiguration surface -- nothing shares a live in-process struct across a\nservice boundary because there is no longer a shared process for UI.\n\nDepends on Phase 2 (State Store) per the resolved extraction order -- UI\nneeds both ChatContract (Phase 1) and the State Store's read contracts\n(Phase 2) available before it can become a peer rather than an\nin-process consumer.\n\nFull reasoning: docs/inspiration/service-decomposition-open-questions-research-2026-09-05.md#1\n(Phase 3 section) and the PRD's target-services table entry for UI\nService.","acceptance_criteria":"- internal/webui (or a new UI Service binary/process) no longer receives\n the daemon's live config.Holder; it owns its own configuration surface.\n- internal/webui's chat and task paths call Gateway's ChatContract and\n State Store's contracts exclusively -- no remaining direct references\n to gateway.Router/SessionStore/Turns/ModelManager/PersonaRegistry or\n internal/store types.\n- The UI Service can start and serve ui/dist against a remote Gateway and\n State Store with mode = \"remote\" for both contracts.\n- task check and task ui pass; the dashboard's existing pages (tasks,\n logs, health) continue to work end-to-end against the now-remote\n contracts.","status":"open","priority":3,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-09-05T06:06:13Z","created_by":"Sam Catlow","updated_at":"2026-09-05T06:06:13Z","dependencies":[{"issue_id":"archie-core-8cda.5","depends_on_id":"archie-core-8cda","type":"parent-child","created_at":"2026-09-05T06:06:13Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-8cda.5","depends_on_id":"archie-core-8cda.4","type":"blocks","created_at":"2026-09-05T06:07:00Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":1,"dependent_count":1,"comment_count":0} {"_type":"issue","id":"archie-core-mlro","title":"ui: extract duplicated Pill component to ui/src/base/","description":"organisation.md's frontend rule says extract to ui/src/base/ on the second distinct consumer. Pill (a 3-line status-badge component) is already independently duplicated verbatim across 11 files: tasks.jsx, logs.jsx, mapping-editor.jsx, capture-row.jsx, settings.jsx, update-status.jsx, skills.jsx, dashboard.jsx, memory.jsx, channels.jsx, curators.jsx. Pre-existing debt, not introduced by any single feature -- found while building the bindings UI (archie-core-t2db.8), which would have been a 12th copy.","design":"Extract to ui/src/base/pill.jsx, export Pill, update all 11+ call sites to import from there instead of defining locally. Mechanical refactor -- no behavior change, verify with task test:ui.","acceptance_criteria":"ui/src/base/pill.jsx exists and exports Pill; all prior local definitions removed, all call sites import the shared one; task test:ui passes unchanged.","status":"closed","priority":3,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-09-02T18:43:54Z","created_by":"Sam Catlow","updated_at":"2026-09-02T20:25:30Z","closed_at":"2026-09-02T20:25:30Z","close_reason":"Extracted to ui/src/base/pill.jsx, all 12 call sites updated (11 pre-existing + bindings). Verified via task test:ui (120/120) and real browser re-check across all pages given this touches the same rendering path as the earlier Preact regression fix. Commit 2abccf3.","dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-uhtz","title":"skillcurator: nilerr finding at skillcurator.go:110 (pre-existing, unrelated to EDA work)","description":"task check's newly-added lint step (chore(taskfile) 60dde24) surfaced internal/infrastructure/skillcurator/skillcurator.go:110 -- returns nil despite a non-nil error at line 108 (nilerr). This is pre-existing debt, unrelated to any EDA/playbook engine work this session -- different subsystem entirely. Filed separately per this session's established pattern (see archie-core-e7bo) of not drive-by fixing unrelated findings inside an in-progress feature's tickets.","design":"Read the actual code at skillcurator.go:108-110 before fixing -- determine whether swallowing the error there was ever intentional (check git blame/history) or a genuine bug, and fix at the producer per AGENTS.md's Root-Cause Fixes rule rather than just propagating the error blindly if the surrounding contract expects a specific degrade-gracefully shape.","acceptance_criteria":"golangci-lint run ./... reports zero nilerr findings in internal/infrastructure/skillcurator/. Existing skillcurator tests pass; add a test covering the error path if none currently exercises it. task check passes.","status":"closed","priority":3,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-09-02T18:10:22Z","created_by":"Sam Catlow","updated_at":"2026-09-02T18:17:08Z","closed_at":"2026-09-02T18:17:08Z","close_reason":"Investigated per design notes: intentional behavior, not a bug -- confirmed against existing test coverage (skillcurator_test.go's parse-failure-doesn't-abort-batch test). Documented with a scoped nolint explaining why, not a behavior change. Commit pushed to main.","dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-1y6y","title":"Adapt internal/tools/minimax to ai-sdk's video.Provider interface","description":"internal/tools/minimax (the generate_video tool) is a hand-rolled HTTP client (Config/Client/GenerateAndWait against MiniMax's video-generation API) that duplicates functionality ai-sdk already provides generically: video.Provider (Name/GenerateVideo(ctx,req)(resp,error)), core.GenerateVideo, and registry.RegisterVideo/.Video(name) -- the same registration shape chat models and the new image capability use. MiniMax's async submit-then-poll GenerateAndWait fits behind video.Provider's single blocking call fine; nothing about the interface forces synchronous-only backends.\n\nCurrently: not extensible (a second video backend would have to duplicate all the HTTP/poll scaffolding instead of just implementing video.Provider) and not reusable (can't be registered/discovered alongside a future video provider the way chat models and image providers can).\n\nFix: wrap minimax.Client behind an adapter implementing ai-sdk's video.Provider, register it via registry.RegisterVideo instead of the tool holding a bespoke *minimax.Client directly. Keep minimax.Client itself as the low-level HTTP/poll implementation -- only the tool-facing seam changes.","design":"Mirrors the note left on archie-core-1786748942169-3-ae7cfaea for the hosted image provider: adapt ai-sdk's existing provider-agnostic facility instead of a bespoke client. Adapter should preserve GenerateAndWait's polling behavior internally -- video.Provider's synchronous call shape does not require changing MiniMax's async job semantics, only where the polling loop is invoked from.","acceptance_criteria":"minimax.Client (or a thin adapter) implements ai-sdk/video.Provider; the generate_video tool obtains it through the ai-sdk provider registry, not a bespoke config-to-client wiring; existing tests (minimax_test.go, tool_test.go) still pass or are updated for the new seam; task check passes.","status":"open","priority":3,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-09-02T10:36:12Z","created_by":"Sam Catlow","updated_at":"2026-09-02T11:03:52Z","external_ref":"https://github.com/samcharles93/archie-core/issues/681","dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-jkmu","title":"send_file confinement is symlink-blind and re-opens the file after checking it","description":"internal/tools/builtin/confinement.go ResolveReadable applies exactly the read tool's policy (resolvePath + isReadConfined), which is purely lexical: filepath.Abs/Rel, never EvalSymlinks. A symlink inside the workspace pointing at /etc/shadow passes the check, and the telegram sender then opens att.Path with no confinement check of its own, in a different goroutine after the turn. There is also a real TOCTOU window -- prepare stats/opens/closes, SendMedia re-stats and re-opens later.\n\nThe policy is unchanged from the read tool, so this is not a new hole; what changed is the consequence. The read tool caps at 5MB into the operator's own context; send_file ships up to 50MB OUT to a chat. The shell tool has never been confined either, so a model that wants the bytes already has them.\n\nDecide: either resolve symlinks in ResolveReadable (which changes read-tool behaviour too, and may break legitimate symlinked workspaces), or document the caveat explicitly and stop claiming 'sending cannot reach what reading cannot' without it.\n\nFound by adversarial review of 9a45fbb.\n\n## Acceptance Criteria\nEither the symlink case is closed at the resolver, or the limitation is written down where the claim is made (confinement.go doc comment and sendfile package doc).","status":"open","priority":3,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-08-24T15:54:43Z","created_by":"Sam Catlow","updated_at":"2026-08-24T19:49:55Z","external_ref":"https://github.com/samcharles93/archie-core/issues/647","dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-1ysw.8","title":"Honor cancellation before local worktree commits","description":"CommitAll discards its context and can stage and commit after task cancellation.\n\nConfirmed still present on main: `Manager.CommitAll` (internal/worktree/worktree.go:387) takes `_ context.Context` and never reads it. Between entry and `wt.Commit` it performs `AddWithOptions{All: true}` and `wt.Commit`, neither of which is context-aware in go-git, so a task cancelled just before the call still mutates the index and HEAD.\n\n## Steps to Reproduce\n\n1. Prepare a task worktree with uncommitted changes.\n2. Create an already-cancelled context: `ctx, cancel := context.WithCancel(context.Background()); cancel()`.\n3. Call `Manager.CommitAll(ctx, dir, \"msg\")`.\n4. Observe it returns `(true, nil)`: the index was staged and a new commit is on HEAD despite the context being cancelled before the call.\n5. In production this leaves a commit on the task branch for work the operator cancelled, which the subsequent push/PR path can then publish.\n\n## Acceptance Criteria\n\nA pre-canceled context causes no index or HEAD mutation; cancellation is checked between non-context-aware go-git phases where possible, with regression tests.\n","acceptance_criteria":"A pre-canceled context causes no index or HEAD mutation; cancellation is checked between non-context-aware go-git phases where possible, with regression tests.","status":"closed","priority":3,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-22T11:01:48Z","created_by":"Sam Catlow","updated_at":"2026-08-24T08:15:48Z","started_at":"2026-08-24T07:42:10Z","closed_at":"2026-08-24T08:15:48Z","close_reason":"Fixed: CommitAll now takes a live context and checks ctx.Err() before open, worktree, staging, status and commit (worktree.go:398-430), so a pre-cancelled context mutates neither index nor HEAD. Proven red against pre-fix code: 'CommitAll() error = nil, want context canceled' for both a cancelled context and an expired deadline. task check green; fresh adversarial review zero findings.","external_ref":"https://github.com/samcharles93/archie-core/issues/603","dependencies":[{"issue_id":"archie-core-1ysw.8","depends_on_id":"archie-core-1ysw","type":"parent-child","created_at":"2026-08-22T21:01:47Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-0y4v","title":"agent: markWorktreeSafe checks existence, not mount-ness, so a stale dir writes to the operator's gitconfig","description":"markWorktreeSafe gates on os.Stat (existence and dir-ness), not mount-ness, despite the doc comment claiming a 'mount' check so host-mode agents don't write to the operator's own ~/.gitconfig for a path that was never mounted (commit 6b46ea1's stated purpose). A directory that merely exists at /data/worktree (a stale leftover) satisfies the guard and appends safe.directory=/data/worktree to the operator's gitconfig. Low severity — the entry is inert unless a repo exists at that exact path — but the guard's behavior does not match its documented contract, and the exists-but-not-a-mount case is untested.\n\nFailure: a host-mode agent (local-ollama-standalone.toml) on a machine with a leftover /data directory: an extra safe.directory line appears in the operator's ~/.gitconfig, exactly what the guard claims to prevent.","design":"Either implement a real mount check (e.g. /proc/self/mountinfo on Linux) or correct the doc comment to say the guard is existence-based and accept the (inert) entry. Decide which contract is intended.","acceptance_criteria":"Behavior matches the documented contract; the exists-but-not-mounted case is covered by a test, or the doc is corrected.","status":"closed","priority":3,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-14T14:43:38Z","created_by":"Sam Catlow","updated_at":"2026-08-14T15:48:45Z","started_at":"2026-08-14T15:47:55Z","closed_at":"2026-08-14T15:48:45Z","close_reason":"Corrected markSafe's doc comment to match its actual existence-based (not mount-based) check; pinned the exists-but-unmounted case with a new test rather than adding platform-specific mount detection for an inert failure mode. Committed f1d74ab.","external_ref":"https://github.com/samcharles93/archie-core/issues/494","labels":["agent","code-review"],"dependency_count":0,"dependent_count":0,"comment_count":0} +{"_type":"issue","id":"archie-core-8cda.8","title":"Phase 6: Curator Service (optional, last)","description":"Sixth and final phase in the resolved extraction order -- deliberately\nlast, since it is the proof-of-optionality exercise (open question #5),\nnot a load-bearing step for the base fleet.\n\nScope: internal/domain/curator installs as a Gateway plugin (its current\nshape is already a contract/registrar/registry family per the PRD's\ntarget-services table). This phase proves the optional-service\nNotInstalled discovery semantic end to end: an optional service that is\nnot installed must resolve to a distinct NotInstalled outcome, never a\nDown/Unhealthy one (per the ServiceRegistry design in\ndocs/inspiration/service-discovery-research-2026-09-05.md and\ninternal/servicediscovery/servicediscovery.go's ErrNotInstalled).\n\nThe K8s Operator to *deploy* Curator (CRD, controller, RBAC, the\narchie-curator Helm chart) is open question #5's scoping concern and can\nbe built against this phase's contract once it lands -- see the\nresolved-question research's own suggested first issue breakdown\n(Kubebuilder scaffold, reconciler, archie-library chart, archie chart,\nServiceRegistry K8s resolver NotInstalled semantics, end-to-end M1\nassertion) for how that follow-on work should be filed once this phase's\ncontract is settled.\n\nDepends on Phase 5 (Execution/Runner/Scheduler) per the resolved\nextraction order.\n\nFull reasoning: docs/inspiration/service-decomposition-open-questions-research-2026-09-05.md#1\n(Phase 6 section) and #5 (Helm chart / Operator scoping, M1 milestone).","acceptance_criteria":"- Curator Service exposes a curator contract (proto + generated Go) and\n installs as an optional Gateway plugin, following the same\n local-adapter + gRPC-adapter + conformance-suite shape as prior phases.\n- ServiceRegistry.Resolve/Watch for \"curator\" returns a distinct\n NotInstalled outcome (not Down/Unhealthy) when Curator is not\n installed, verified by a test.\n- Installing/uninstalling the Curator Service flips its discovery state\n without requiring a Gateway restart or redeploy (mirrors question #5's\n M1 milestone assertion, even if the K8s Operator itself is filed as\n separate follow-on work).\n- task check passes; existing Curator functionality (whatever\n internal/domain/curator provides today) is preserved through the\n contract boundary.","status":"open","priority":4,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-09-05T06:06:49Z","created_by":"Sam Catlow","updated_at":"2026-09-05T06:06:49Z","dependencies":[{"issue_id":"archie-core-8cda.8","depends_on_id":"archie-core-8cda","type":"parent-child","created_at":"2026-09-05T06:06:49Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-8cda.8","depends_on_id":"archie-core-8cda.7","type":"blocks","created_at":"2026-09-05T06:07:01Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":1,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-3svc","title":"Concurrent send_file uploads in one turn are uncapped","description":"liveReply.Media starts an unbounded mediaWg.Go per attachment. Not a leak (each is bounded by a 30s ctx) and not a memory problem (go-telegram streams via io.Pipe, nothing is buffered), but N send_file calls in one turn start N concurrent multipart uploads against a rate-limited API.\n\nAlso noted: send_file is ClassIdempotent, which makes it ExecParallelSafe. Defensible since the tool only validates and never sends, but minimax is ClassMutating for an equivalent 'produces an outbound artifact' tool -- worth deciding deliberately rather than by accident.\n\nFound by adversarial review of 9a45fbb. internal/channels/telegram/live.go:386.\n\n## Acceptance Criteria\nEither a bound on concurrent media sends per reply, or a recorded decision that the 30s timeout plus Telegram's own rate limiting is sufficient.","status":"open","priority":4,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-08-24T15:54:51Z","created_by":"Sam Catlow","updated_at":"2026-08-24T19:49:56Z","external_ref":"https://github.com/samcharles93/archie-core/issues/648","dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-52f7","title":"telegram: the live-edit answer keeps its turn-start timestamp and can sort before the conversation","description":"The final reply is delivered by editing the message created at the first streamed frame, and editMessageText does not change the message date — so a long tool-using turn's answer is timestamped at turn start, can predate messages sent during the turn, and sorts before the conversation that produced it. Cosmetic and inherent to the watch-the-answer-being-written design (delete-and-resend would flicker and reorder), but it is a visible consequence nothing documents or tests.\n\nFailure: a turn with a two-minute tool phase produces an answer whose timestamp precedes a follow-up user message that references it; chat history ordering places the answer before the conversation that produced it.","design":"Either accept and document the limitation (a comment on liveReply/finalize), or investigate a delete-and-resend on finalize for turns that cross a meaningful time gap. Low priority; a documentation note may be the right fix.","acceptance_criteria":"The timestamp behavior is at least documented (or changed and tested), so it is a known trade-off rather than a surprise.","status":"closed","priority":4,"issue_type":"task","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-14T14:43:38Z","created_by":"Sam Catlow","updated_at":"2026-08-14T15:48:45Z","started_at":"2026-08-14T15:46:50Z","closed_at":"2026-08-14T15:48:45Z","close_reason":"Documented the accepted trade-off on liveReply's doc comment per the design note's preferred option; no behavior change. Committed ed18bfb.","external_ref":"https://github.com/samcharles93/archie-core/issues/495","labels":["code-review","streaming","telegram"],"dependency_count":0,"dependent_count":0,"comment_count":0}