From d95b3a871c5fb97ab35d02beecb5916cc5444a0f Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Tue, 4 Aug 2026 22:48:42 +1000 Subject: [PATCH] chore(beads): record a candidate cause for the chat context-loss bug --- .beads/issues.jsonl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.beads/issues.jsonl b/.beads/issues.jsonl index 24acf3b0d..249359b60 100644 --- a/.beads/issues.jsonl +++ b/.beads/issues.jsonl @@ -1,7 +1,7 @@ {"_type":"issue","id":"archie-core-cz8","title":"fix(gateway): /compress destroys message identity, breaking dedup permanently","description":"applyCompress (session_commands.go:561-573) rebuilds retained head/tail turns as bare Message{From, Text}, dropping MessageID, SourceID and At. newMessageID with an empty SourceID returns a random UUID, so every protected message is deleted and re-inserted under a new identity with source_id NULL and _ts reset to now.\n\nCONFIRMED by two independent reviewers, executed on BOTH backends. Before compress, redelivering tg-59 is a correct no-op (60 stays 60). After compress the same redelivery duplicates (24 -\u003e 25). So archie-core-963's whole guarantee survives only until the first /compress -- after that, a Telegram 24h backlog replay on restart appends every surviving message a second time.\n\nAlso violates messaging-and-work-intake.md:88-90 (immutable application-generated MessageID) and 112-114 (immutable records), and dangles any branch-point correlation to the old IDs.\n\nBlocks archie-core-963 and archie-core-0ua.","status":"closed","priority":0,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-03T16:00:51Z","created_by":"Sam Catlow","updated_at":"2026-08-04T12:25:25Z","started_at":"2026-08-03T16:13:11Z","closed_at":"2026-08-04T12:25:25Z","close_reason":"Closed","dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-8u8","title":"feat(gateway): migrate canonical session/message store to SQLite","description":"docs/architecture/messaging-and-work-intake.md:107 requires the canonical session and message implementation to supply durable SQLite round trips. The current store is NellDB-backed.\n\nScope is the SETTLED parts of the messaging architecture only:\n- SQLite persistence (modernc.org/sqlite; FTS5 verified available at 3.53.3, no CGo)\n- application-generated canonical MessageID, platform IDs as correlation only (doc 88-90)\n- immutable message records (doc 112-114)\n- append-only linear sequence per conversation (doc 128)\n- real transactions for ReplaceMessages and Delete\n\nExplicitly OUT of scope: the rich typed-content / tool-call / tool-result model and delivery-attempt semantics. docs/architecture/messaging-and-work-intake.md:273-284 lists the canonical inbound message model, source-correlation model, and outbound delivery/retry/dedup semantics as DECISIONS STILL REQUIRED, so they are not specified enough to implement. That work belongs to archie-core-abg.16.\n\nDecision by Sam 2026-08-03 after the third review surfaced that the NellDB-vs-SQLite question was already settled by the architecture docs.","notes":"SQLite SessionStore implemented and verified 2026-08-03. Not yet wired into production.\n\nAdded (no existing production file touched):\n- internal/gateway/session_store_sqlite.go -- SessionStore on modernc.org/sqlite. Real sql.Tx for ReplaceMessages and Delete, which is the actual reason for the migration: /compress gets genuine atomicity instead of the write-then-delete approximation the NellDB path needs. FTS5 external-content index (content='messages', content_rowid='id') kept in sync by AFTER INSERT/UPDATE/DELETE triggers, so sync is enforced by the schema and no Go code path can forget it.\n- internal/gateway/sessionstore_conformance_test.go -- runSessionStoreSuite(t, newStore), the backend-agnostic contract.\n- Conformance hooks for both backends.\n\nVERIFIED, not taken on trust:\n- 19 identical subtest groups pass against BOTH backends. The suite is the migration gate.\n- FTS index does not drift: search and count stay equal through delete (5-\u003e3), replace (-\u003e1) and session delete (-\u003e0); no cross-session leak.\n- FTS5 syntax injection neutralised: 'text:hello', '\"unbalanced', 'NEAR(a b)', '*', 'needle OR elsewhere' all return 0 hits with no error, confirming terms are escaped phrases AND'ed rather than operators.\n\nBehavioural differences from NellDB, both improvements:\n- MessagePage.Truncated is always false. SQLite gives an exact COUNT(*), so the MaxTextSearchLimit ceiling that field exists to describe does not apply.\n- SourceID is persisted and round-trips; the NellDB path derives the canonical ID from it but never stores it.\n\nCleanup: the two agents ran in parallel, so the SQLite implementation shipped 22 standalone tests written before the suite existed. 18 duplicated suite coverage and were removed (701 -\u003e 170 lines); the 4 kept are genuinely SQLite-specific (transaction atomicity, Truncated semantics, error paths, file creation).\n\ntask check clean, golangci-lint ./internal/gateway/... 0 issues, -race clean.\n\nREMAINING: wire cmd/archied over (config switch), decide the NellDB path's retirement, adversarial review of the combined diff.","status":"open","priority":0,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-08-03T10:03:05Z","created_by":"Sam Catlow","updated_at":"2026-08-03T11:54:41Z","dependency_count":0,"dependent_count":0,"comment_count":0} -{"_type":"issue","id":"archie-core-0ua","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.","notes":"ADVERSARIAL PASS 2026-08-04 (fresh reviewer). Does NOT close.\n\nCore claim HELD on both backends: ReplaceMessages writes before deleting, cannot delete a record it just wrote, and an injected failure leaves the full 60-message history intact with the error propagated. Two concurrent /compress runs end with exactly 24 messages and one summary. No error swallowing remains on this path.\n\nBLOCKED BY: archie-core-8k8 (bare /compress can NEVER apply -- the failure-safe path this bead added is unreachable via the documented command), archie-core-6e0 (mid-compress inbound message destroyed, unrecoverable, window is in the caller), archie-core-cz8 (compress re-mints identity), archie-core-7ve (applyCompress has zero test coverage; the NellDB failure-safety test never induces a failure).","status":"open","priority":0,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-08-03T09:25:26Z","created_by":"Sam Catlow","updated_at":"2026-08-03T16:02:25Z","dependency_count":0,"dependent_count":0,"comment_count":0} -{"_type":"issue","id":"archie-core-b4i","title":"fix(gateway): chronological message ordering — _ts + per-session collections","description":"SaveMessages keys from i=0 and overwrites the first N messages of any non-empty session (verified: m0/m1 destroyed by a bulk save). SaveMessage derives seq from len(rows) so deletes cause key reuse. The 'at' timestamp is written and never read; ordering is by insertion counter, not time.\n\nFix: add Message.At, write nell.TimestampField (_ts), give each session its own NellDB collection (a room IS a collection), key messages by time-ordered unique IDs, and order/page via sdk.ScanSince. Clean break on existing data (carina is a testing ground).","notes":"ADVERSARIAL PASS CLEARED 2026-08-04. All blockers fixed and committed:\n- archie-core-7s3 (resolve/List newest-first) -\u003e 740ec50\n- archie-core-8u8.2 (both backends agree on recency) -\u003e 02a3630\n- archie-core-cz8 (/compress no longer re-mints identity or timestamps) -\u003e cf74d9c\nThe bead's own claims were verified by execution and held: _ts numeric on every write path, clamp survives restart and a backwards clock, 32 concurrent saves produce no duplicate _ts, paging over 2500 messages is lossless, per-session collection names need no sanitisation.","status":"open","priority":0,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-08-03T02:27:48Z","created_by":"Sam Catlow","updated_at":"2026-08-04T12:48:06Z","dependency_count":0,"dependent_count":0,"comment_count":0} +{"_type":"issue","id":"archie-core-0ua","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.","notes":"ADVERSARIAL PASS CLEARED 2026-08-04. All blockers fixed and committed:\n- archie-core-8k8 (bare /compress could never apply, so this failure-safe path was unreachable) -\u003e cf74d9c\n- archie-core-6e0 (mid-compress message destroyed) -\u003e 3dd42a5, which changed ReplaceMessages to take the superseded set from the caller\n- archie-core-cz8 (identity) -\u003e cf74d9c\nThe core claim held under probing: write-then-delete on both backends, no record deleted that was just written, an injected failure leaves the full history with the error propagated.","status":"closed","priority":0,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-08-03T09:25:26Z","created_by":"Sam Catlow","updated_at":"2026-08-04T12:48:08Z","closed_at":"2026-08-04T12:48:08Z","close_reason":"Closed","dependency_count":0,"dependent_count":0,"comment_count":0} +{"_type":"issue","id":"archie-core-b4i","title":"fix(gateway): chronological message ordering — _ts + per-session collections","description":"SaveMessages keys from i=0 and overwrites the first N messages of any non-empty session (verified: m0/m1 destroyed by a bulk save). SaveMessage derives seq from len(rows) so deletes cause key reuse. The 'at' timestamp is written and never read; ordering is by insertion counter, not time.\n\nFix: add Message.At, write nell.TimestampField (_ts), give each session its own NellDB collection (a room IS a collection), key messages by time-ordered unique IDs, and order/page via sdk.ScanSince. Clean break on existing data (carina is a testing ground).","notes":"ADVERSARIAL PASS CLEARED 2026-08-04. All blockers fixed and committed:\n- archie-core-7s3 (resolve/List newest-first) -\u003e 740ec50\n- archie-core-8u8.2 (both backends agree on recency) -\u003e 02a3630\n- archie-core-cz8 (/compress no longer re-mints identity or timestamps) -\u003e cf74d9c\nThe bead's own claims were verified by execution and held: _ts numeric on every write path, clamp survives restart and a backwards clock, 32 concurrent saves produce no duplicate _ts, paging over 2500 messages is lossless, per-session collection names need no sanitisation.","status":"closed","priority":0,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-08-03T02:27:48Z","created_by":"Sam Catlow","updated_at":"2026-08-04T12:48:08Z","closed_at":"2026-08-04T12:48:08Z","close_reason":"Closed","dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-ci3","title":"Telegram chat replies use stale and reordered session context","description":"Live Telegram conversation shows replies answering earlier user messages and replayed user history in non-chronological order. Trace ingestion, turn lanes, Nell persistence/history ordering, prompt construction, and response routing to identify the production cause.","acceptance_criteria":"Root cause is demonstrated with code path, live evidence, and a focused reproducer; affected ordering contract and correct fix seam are identified.","notes":"2026-08-03: Ordering half is FIXED by upgrading NellDB to v0.3.0 (go.mod v0.2.5 -\u003e v0.3.0). The ci3 17-message reproducer now passes: position 0 is seq 00 and all 17 are in order via the existing AllDocs path. No archie-core code change was required for the ordering defect — v0.3.0 gives List/AllDocs a deterministic (WallTime, Counter, collection, ID) order, which is exactly the unsorted-map root cause recorded above.\n\nStill open, tracked in archie-core-b4i (separate defect, not an ordering bug): SaveMessages keys from i=0 and destroys the first N messages of a non-empty session, and SaveMessage derives seq from len(rows) so deletes cause key reuse. Verified by reproducer.","status":"closed","priority":0,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-07-31T05:15:30Z","created_by":"Sam Catlow","updated_at":"2026-08-03T09:02:41Z","started_at":"2026-07-31T05:15:40Z","closed_at":"2026-08-03T09:02:41Z","close_reason":"Fixed by upgrading NellDB v0.2.5 -\u003e v0.3.0 (go.mod). Root cause as recorded: v0.2.5 sdk.DocDB.AllDocs consumed Store.List without sorting and LogStore.List iterated a map. v0.3.0 gives List/AllDocs a deterministic (WallTime, Counter, collection, ID) order.\n\nVerified with the 17-message reproducer from this issue: position 0 is now seq 00 and all 17 return in order. No archie-core code change was needed for the ordering defect itself.\n\nThe wider blast radius noted on this issue (prompt history, /undo, /retry, branch/resume copying, search ordering) is covered by the internal/gateway migration in archie-core-b4i, which moves message history onto _ts + per-session collections + ScanSince paging. Session list ordering is unchanged and still sorts newest-first in listAllLocked.","dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-abg.16.33","title":"Telegram: allowlist senders, fail closed when unset","description":"telegram.New is called with a nil allowlist and isChatAllowed returns true when the allowlist is empty, so any Telegram user who finds the bot can talk to it. AllowedChatIDs is not plumbed into config at all. This gates exposing any real tools to the chat agent: with an MCP shell/filesystem server wired, allow-all becomes RCE for arbitrary senders.","acceptance_criteria":"Allowlist is configurable via config.toml. Unset means deny, not allow. Sender identity (user id) is checked, not just chat id, so a group chat cannot be used to bypass it. Rejections are logged with the sender id. Startup logs loudly when the chat gateway is enabled with an empty allowlist.","status":"closed","priority":0,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-07-26T19:11:40Z","created_by":"Sam Catlow","updated_at":"2026-07-26T19:15:22Z","closed_at":"2026-07-26T19:15:22Z","close_reason":"Shipped in cec0f3e. 16.33: chat.telegram.allowed_user_ids plumbed through config; empty list now DENIES (was: allowed everyone); matches sender from.id not chat id so groups cannot inherit access; rejections logged with sender id; startup warns on empty list. Old TestIsChatAllowed asserted the vulnerable fail-open behaviour and was replaced with fail-closed tests. Sam's id 1312197967 added to carina's config.toml before push. 16.34: SetMyCommands publishes the command list Router actually handles; non-fatal on failure.","dependencies":[{"issue_id":"archie-core-abg.16.33","depends_on_id":"archie-core-abg.16","type":"parent-child","created_at":"2026-07-27T05:11:40Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-abg.17.41","title":"Tool-provider engine: lifecycle registry with MCP and memory providers","description":"Build the typed tool-provider capability family over the central tools registry. Providers declare a plugin manifest, lifecycle/health, and discover executable ToolEntry values. Add adapters for memory.Manager and configured MCP servers, perform MCP initialize/tools-list/tools-call, register handlers atomically with collision rollback, translate available entries to ai-sdk core.ToolSet, and wire consumers so registered tools are actually callable rather than dead daemon fields.","design":"internal/tools owns Provider and ProviderRegistry; Provider is a typed domain contract and uses the shared plugin manifest/lifecycle vocabulary. The registry owns provider registration and tool indexing while the capability host orchestrates cross-family lifecycle. Memory is adapted without changing internal/memory concurrent work. MCP provider wraps the existing stdio transport without modifying its concurrent implementation, adds protocol client behavior in new files, prefixes/sanitizes server tool names deterministically, and retains original MCP names for calls. Never advertise a tool on an execution path that cannot invoke its handler; explicitly proxy or omit tools across subprocess/NATS boundaries.","acceptance_criteria":"Provider registration is atomic and rejects duplicate provider/tool IDs without partial state. Start/discovery failure rolls back tools and lifecycle; stop removes availability and shuts providers down in reverse order. Memory provider tools appear in the central registry and execute through memory.Manager. A fake MCP server proves initialize, initialized notification where supported, tools/list discovery, tools/call execution, JSON-RPC errors, shutdown, and name mapping. Available tools convert to valid ai-sdk core.ToolSet and are used by the gateway conversational loop and supported agent execution paths; unsupported remote paths do not advertise unusable handlers. Configuration creates providers through typed factories. Focused/race tests, lint, task check, and fresh adversarial review pass subject only to documented concurrent baseline failures.","notes":"Implemented typed provider.Engine + provider.Registry capability family; atomic central RegisterBatch/Unregister; dependency-ordered start/discovery, bounded rollback, retryable failed cleanup, reverse stop and health aggregation. Added memory.Manager adapter and lifecycle-managed MCP adapter with initialize/list/call, deterministic ASCII name mapping, original-name dispatch, tool errors, resource text and multimodal preservation. Composition uses typed config factory, omits unsupported HTTP/unknown transports, registers the family with capabilityHost, defers gateways until host+daemon startup, shuts memory down, builds validated ai-sdk ToolSets, uses independent 8-step chat loop, and exposes handlers only to Telegram chat/in-process agents. Focused race tests pass; scoped lint 0; fresh final adversarial review 0 findings. task check passes every package except known concurrent internal/gateway /spawn tests. Dependency abg.17.16 remains independently in progress.\nImplementation and review are complete; Beads closure is intentionally deferred because required transport issue archie-core-abg.17.16 is still open. Close without --force when that dependency completes.","status":"closed","priority":0,"issue_type":"feature","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-07-26T05:11:10Z","created_by":"Sam Catlow","updated_at":"2026-07-26T17:44:51Z","started_at":"2026-07-26T06:22:50Z","closed_at":"2026-07-26T17:44:51Z","close_reason":"Blocking dependency abg.17.16 closed; tool-provider engine work was already implementation-complete and previously reviewed clean.","dependencies":[{"issue_id":"archie-core-abg.17.41","depends_on_id":"archie-core-abg.17","type":"parent-child","created_at":"2026-07-26T15:11:09Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-abg.17.41","depends_on_id":"archie-core-abg.40","type":"blocks","created_at":"2026-07-26T15:11:17Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-abg.17.41","depends_on_id":"archie-core-abg.17.16","type":"blocks","created_at":"2026-07-26T15:11:18Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":2,"dependent_count":0,"comment_count":0} @@ -64,20 +64,20 @@ {"_type":"issue","id":"archie-core-7s3","title":"fix(gateway): session resolution is not newest-first, so restart resumes a stale session","description":"Found independently by two reviewers, CONFIRMED by execution.\n\nsessionTracker.resolve (session_commands.go:54-59) comments 'Find the most recent session matching this thread and bot' but returns the first element GetByChannel yields. The wired-up NellDB store returns document-ID order (listAllLocked reverses AllDocs, which sorts by document ID), i.e. UUID-lexicographic -- effectively random. LastActiveAt is populated on every record and never consulted.\n\nScenario: user runs /new 'old', chats, runs /new 'current'; daemon restarts (the tracker cache is in-memory only); the next message resolves to whichever session sorts first. Probed over 10 runs: 4 landed in the OLDER session, answering against pre-/new history. This is the user-visible lost-context class.\n\nAlso a silent backend divergence: SQLite's GetByChannel orders created_at DESC, NellDB does not, and the shared conformance suite does not pin it. Separately, SessionStore.List's doc comment (session_store.go:34-36) promises newest-first and does not deliver: saving zzz-oldest, aaa-middle, mmm-newest returns [zzz-oldest mmm-newest aaa-middle].\n\nBlocks archie-core-b4i and archie-core-gih.","status":"closed","priority":1,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-03T16:01:17Z","created_by":"Sam Catlow","updated_at":"2026-08-04T12:25:26Z","started_at":"2026-08-04T12:12:02Z","closed_at":"2026-08-04T12:25:26Z","close_reason":"Closed","dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-6e0","title":"fix(gateway): a message arriving mid-/compress is destroyed","description":"applyCompress reads MessageCount then RecentMessages, and ReplaceMessages later removes everything outside the replacement set. A chat turn that lands between the read and the replace is deleted, never summarised.\n\nCONFIRMED executed on both backends: 'nell: mid-compress inbound message destroyed (stored=24)', 'sqlite: ... (stored=24)'. NellDB deletes it via the AllDocs snapshot; SQLite via DELETE ... WHERE message_id NOT IN (survivors), a survivor-complement.\n\narchie-core-0ua's guarantee (worst case is recoverable duplicates) does not cover this: it is unrecoverable loss, and the store-level fix cannot address it because the window is in the caller. Nothing serialises /compress against an inbound turn.","status":"closed","priority":1,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-03T16:01:02Z","created_by":"Sam Catlow","updated_at":"2026-08-04T12:25:27Z","started_at":"2026-08-04T12:17:57Z","closed_at":"2026-08-04T12:25:27Z","close_reason":"Closed","dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-8k8","title":"fix(gateway): /compress argument dispatch is wrong in three ways","description":"session_commands.go:460-478, all CONFIRMED by execution:\n\n1. Bare /compress can never apply. isPreview is 'len(fields) == 0 || --preview || --dry-run', so /compress with no arguments takes the preview branch -- and compressPreview ends with 'Run /compress to apply'. The command tells the user to run a command that does nothing, forever. The failure-safe ReplaceMessages path added by archie-core-0ua is unreachable via the documented command; only '/compress here \u003cN\u003e' reaches it.\n\n2. /compress focus \u003ctopic\u003e silently ignores the topic. focus is validated for arity only; cfg is never modified, so it runs a full default compression and reports success. Irreversible history rewrite from a command the user believes does something narrower.\n\n3. /compress here (no N) and any unrecognised argument (/compress asdf) fall through to a full default compression rather than printing usage, unlike the sibling focus branch.","status":"closed","priority":1,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-03T16:01:02Z","created_by":"Sam Catlow","updated_at":"2026-08-04T12:25:26Z","started_at":"2026-08-04T12:08:49Z","closed_at":"2026-08-04T12:25:26Z","close_reason":"Closed","dependency_count":0,"dependent_count":0,"comment_count":0} -{"_type":"issue","id":"archie-core-rml","title":"fix(memory): startup accepted an unusable memory directory","description":"cmd/archied/main.go builds the builtin memory provider at filepath.Join(cfg.WorkDir, \"memory\") and logs 'memory manager started' regardless of whether that path exists or is writable. builtin.NewStore treats ENOENT as an empty document and Reload does the same, so a missing directory is indistinguishable from a memory with nothing in it yet.\n\nFound live: carina's config was copied to the laptop with work_dir = /var/lib/archie/work, a container path that does not exist here. archied logged 'memory manager started dir=/var/lib/archie/work/memory' and ran with no memory at all. The failure would only have surfaced at the agent's first memory write, when writeFileAtomic's MkdirAll hit EACCES on /var/lib -- mid-conversation, as a tool error, after startup said it was fine.\n\nFixed: builtin.New now does MkdirAll(cfg.Dir) and returns an error the operator can act on, so an unusable path fails at startup where the existing error path already exits non-zero. New's doc claimed 'the provider is ready for use as soon as New returns'; it now is.","status":"open","priority":1,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-03T16:00:07Z","created_by":"Sam Catlow","updated_at":"2026-08-03T16:00:07Z","dependency_count":0,"dependent_count":0,"comment_count":0} +{"_type":"issue","id":"archie-core-rml","title":"fix(memory): startup accepted an unusable memory directory","description":"cmd/archied/main.go builds the builtin memory provider at filepath.Join(cfg.WorkDir, \"memory\") and logs 'memory manager started' regardless of whether that path exists or is writable. builtin.NewStore treats ENOENT as an empty document and Reload does the same, so a missing directory is indistinguishable from a memory with nothing in it yet.\n\nFound live: carina's config was copied to the laptop with work_dir = /var/lib/archie/work, a container path that does not exist here. archied logged 'memory manager started dir=/var/lib/archie/work/memory' and ran with no memory at all. The failure would only have surfaced at the agent's first memory write, when writeFileAtomic's MkdirAll hit EACCES on /var/lib -- mid-conversation, as a tool error, after startup said it was fine.\n\nFixed: builtin.New now does MkdirAll(cfg.Dir) and returns an error the operator can act on, so an unusable path fails at startup where the existing error path already exits non-zero. New's doc claimed 'the provider is ready for use as soon as New returns'; it now is.","status":"closed","priority":1,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-03T16:00:07Z","created_by":"Sam Catlow","updated_at":"2026-08-04T12:48:09Z","closed_at":"2026-08-04T12:48:09Z","close_reason":"Closed","dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-3cf.6","title":"Restore compliance with the approved Archie visual design","description":"The current dashboard does not follow the supplied reference design. Rework the shell and page composition around the reference: a framed rounded workspace, compact top navigation, prominent welcome/header area, adjacent primary actions, getting-started panel, prominent status/compliance visualization, compact KPI strip with trend marks, forecast/projection panel, and live-runs table. Match the reference visual treatment: layered rounded surfaces, soft translucent panels, luminous abstract background treatment, compact information-dense cards, restrained status colours, and consistent icon/action placement. Do not reinterpret this as a generic dark admin console or as a light editorial marketing page. Capture desktop and narrow-viewport visual evidence before closing.","status":"open","priority":1,"issue_type":"feature","owner":"sam@catlow.tech","created_at":"2026-08-03T15:18:32Z","created_by":"Sam Catlow","updated_at":"2026-08-03T15:20:01Z","dependencies":[{"issue_id":"archie-core-3cf.6","depends_on_id":"archie-core-3cf","type":"parent-child","created_at":"2026-08-04T01:18:32Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-3cf.1","title":"Fix dashboard KPI tiles rendering blank values","description":"Authenticated runtime inspection of the supplied dashboard URL showed the first three dashboard stat tiles visually rendered with empty headline values while their comparison text was present; the Tokens used tile rendered 0. Trace the stat tile/render/update path and make every KPI display a stable value during initial load, loading, zero-data, and API-error states. Add focused regression coverage and verify against the live dashboard.","status":"open","priority":1,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-03T15:17:39Z","created_by":"Sam Catlow","updated_at":"2026-08-03T15:17:58Z","dependencies":[{"issue_id":"archie-core-3cf.1","depends_on_id":"archie-core-3cf","type":"parent-child","created_at":"2026-08-04T01:17:38Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-3cf.2","title":"Make dashboard authentication and connectivity failures actionable","description":"Opening the bare dashboard hash URL returns a raw 401 text response telling the operator to find the startup URL; the authenticated dashboard also showed reconnecting while activity rows were visible. Provide a browser-facing auth recovery state or clear redirect guidance, distinguish initial load failure from SSE reconnecting, and expose a retry path without requiring source or log knowledge. Cover token, API, SSE, and daemon-unavailable states.","status":"open","priority":1,"issue_type":"feature","owner":"sam@catlow.tech","created_at":"2026-08-03T15:17:39Z","created_by":"Sam Catlow","updated_at":"2026-08-03T15:17:59Z","dependencies":[{"issue_id":"archie-core-3cf.2","depends_on_id":"archie-core-3cf","type":"parent-child","created_at":"2026-08-04T01:17:39Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-0y4","title":"feat(config): optional file logging","description":"archied writes slog JSON to stdout only; under systemd journald is the sole copy, and running by hand leaves nothing. Add a log_file config field so there is a durable copy independent of journald. Prerequisite for the webui logs view showing anything from before the dashboard connected.","status":"closed","priority":1,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-08-03T14:15:00Z","created_by":"Sam Catlow","updated_at":"2026-08-03T15:17:17Z","closed_at":"2026-08-03T15:17:17Z","close_reason":"File logging shipped: internal/logging with [log] file/level/max_size_mb/keep/quiet, size-based rotation with retention, no new dependency. A bad log path degrades to stderr with an error rather than killing the daemon. Verified end to end.","dependency_count":0,"dependent_count":0,"comment_count":0} -{"_type":"issue","id":"archie-core-iyx","title":"feat(webui): logs section - filterable, live-tailing","description":"There is no way to see archied's logs outside journalctl. Every event already flows through events.Bus into the store and out over SSE, so this is mostly presentation over existing data. Filterable by level and component, live-tailing the SSE stream, with history from the store for anything before the dashboard connected.","notes":"Implemented 2026-08-04. Separation follows PocketBase: the logging package owns its own on-disk format and does the reading (internal/logging/reader.go); internal/webui/api_logs.go is transport only; ui/src/logs/ is a self-contained feature folder importing its own CSS.\n\nHistory comes from the file via logging.Tail with server-side level/component/text filters; live lines append from the existing /events SSE with the same matcher shape client-side. Component filter options are built from what the log actually contains rather than a hardcoded list that drifts. Bounded: 8MB tail scan, 2000-entry cap, ring buffer keeps the NEWEST entries (truncating the other end would hide whatever just went wrong). Non-JSON lines skipped so subprocess output cannot break the view; missing file and empty path are empty results, not errors, since file logging is optional.\n\n14 reader tests. task check clean, lint clean.","status":"open","priority":1,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-08-03T14:15:00Z","created_by":"Sam Catlow","updated_at":"2026-08-03T15:17:16Z","dependency_count":0,"dependent_count":0,"comment_count":0} -{"_type":"issue","id":"archie-core-12n","title":"fix(telegram): honour retry_after on 429 instead of the library's fixed backoff","description":"go-telegram/bot v1.22.0 get_updates.go discards TooManyRequestsError.RetryAfter and applies its own 100ms-doubling backoff capped at 5s. Against retry_after:5 that is ~12 further requests inside the silence window, which escalated a brief 429 on carina into sustained 429s, 502s and request timeouts over several minutes.\n\nFixed in internal/channels/telegram/ratelimit.go: WithErrorsHandler is invoked synchronously from the polling loop before the library applies its own backoff, so blocking there honours the interval without patching the dependency. errors.As unwraps the library's fmt.Errorf wrap; capped at maxRetryAfter=60s; releases immediately on context cancellation so /restart during a 429 does not block.\n\nUpstream report drafted for https://github.com/go-telegram/bot/issues -- suggested fix is to prefer RetryAfter over incErrTimeout in the error branch.","status":"open","priority":1,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-08-03T14:14:59Z","created_by":"Sam Catlow","updated_at":"2026-08-03T14:14:59Z","dependency_count":0,"dependent_count":0,"comment_count":0} +{"_type":"issue","id":"archie-core-iyx","title":"feat(webui): logs section - filterable, live-tailing","description":"There is no way to see archied's logs outside journalctl. Every event already flows through events.Bus into the store and out over SSE, so this is mostly presentation over existing data. Filterable by level and component, live-tailing the SSE stream, with history from the store for anything before the dashboard connected.","notes":"Implemented 2026-08-04. Separation follows PocketBase: the logging package owns its own on-disk format and does the reading (internal/logging/reader.go); internal/webui/api_logs.go is transport only; ui/src/logs/ is a self-contained feature folder importing its own CSS.\n\nHistory comes from the file via logging.Tail with server-side level/component/text filters; live lines append from the existing /events SSE with the same matcher shape client-side. Component filter options are built from what the log actually contains rather than a hardcoded list that drifts. Bounded: 8MB tail scan, 2000-entry cap, ring buffer keeps the NEWEST entries (truncating the other end would hide whatever just went wrong). Non-JSON lines skipped so subprocess output cannot break the view; missing file and empty path are empty results, not errors, since file logging is optional.\n\n14 reader tests. task check clean, lint clean.","status":"closed","priority":1,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-08-03T14:15:00Z","created_by":"Sam Catlow","updated_at":"2026-08-04T12:48:10Z","closed_at":"2026-08-04T12:48:10Z","close_reason":"Closed","dependency_count":0,"dependent_count":0,"comment_count":0} +{"_type":"issue","id":"archie-core-12n","title":"fix(telegram): honour retry_after on 429 instead of the library's fixed backoff","description":"go-telegram/bot v1.22.0 get_updates.go discards TooManyRequestsError.RetryAfter and applies its own 100ms-doubling backoff capped at 5s. Against retry_after:5 that is ~12 further requests inside the silence window, which escalated a brief 429 on carina into sustained 429s, 502s and request timeouts over several minutes.\n\nFixed in internal/channels/telegram/ratelimit.go: WithErrorsHandler is invoked synchronously from the polling loop before the library applies its own backoff, so blocking there honours the interval without patching the dependency. errors.As unwraps the library's fmt.Errorf wrap; capped at maxRetryAfter=60s; releases immediately on context cancellation so /restart during a 429 does not block.\n\nUpstream report drafted for https://github.com/go-telegram/bot/issues -- suggested fix is to prefer RetryAfter over incErrTimeout in the error branch.","status":"closed","priority":1,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-08-03T14:14:59Z","created_by":"Sam Catlow","updated_at":"2026-08-04T12:48:10Z","closed_at":"2026-08-04T12:48:10Z","close_reason":"Closed","dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-8u8.5","title":"feat(gateway): version the SQLite session schema before cutover","description":"OpenSQLiteSessionStore currently runs CREATE IF NOT EXISTS statements with no schema version or transactional migration record. Before production wiring, add the smallest deterministic schema-version mechanism so future upgrades cannot silently leave a partially evolved database.","acceptance_criteria":"A fresh database records the current schema version; opening a supported older fixture migrates transactionally and preserves data; unsupported newer versions fail with an actionable error; migration failure leaves the prior schema/data usable; schema initialization and upgrades are covered by file-backed tests.","status":"open","priority":1,"issue_type":"feature","owner":"sam@catlow.tech","created_at":"2026-08-03T12:34:39Z","created_by":"Sam Catlow","updated_at":"2026-08-03T12:34:39Z","dependencies":[{"issue_id":"archie-core-8u8.5","depends_on_id":"archie-core-8u8","type":"parent-child","created_at":"2026-08-03T22:34:38Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-8u8.3","title":"fix(gateway): round-trip SourceID through every SessionStore backend","description":"SQLite persists and returns Message.SourceID, but the NellDB adapter derives MessageID from SourceID and then discards SourceID from the stored document. External correlation metadata therefore changes across backend selection and cannot be exported from NellDB during migration.","acceptance_criteria":"The shared conformance suite requires SourceID to round-trip without becoming the canonical MessageID; NellDB persists and reads source_id with empty-field compatibility for older records; SQLite remains conformant; redelivery deduplication and immutable content semantics remain unchanged.","notes":"Implemented and independently reviewed 2026-08-03. Shared conformance now pins SourceID round-trip, canonical-ID distinction, redelivery stability, empty compatibility, and non-searchability on both backends. Nell persists SourceID as numeric UTF-8 byte values so its all-string text index cannot expose correlation metadata; file-backed Nell reopen verifies JSON-decoded UTF-8 round-trip. Focused conformance/reopen tests, full gateway suite, gateway race, scoped lint, and format check pass. Fresh DeepSeek V4 Flash review found no blockers; residual note only for malformed hand-corrupted numeric arrays coercing on decode.","status":"closed","priority":1,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-03T12:34:38Z","created_by":"Sam Catlow","updated_at":"2026-08-03T13:16:36Z","started_at":"2026-08-03T13:03:26Z","closed_at":"2026-08-03T13:16:36Z","close_reason":"SourceID parity and metadata-safe persistence are verified on NellDB and SQLite; all focused/race/lint/format validation passes and independent review has no blockers.","dependencies":[{"issue_id":"archie-core-8u8.3","depends_on_id":"archie-core-8u8","type":"parent-child","created_at":"2026-08-03T22:34:37Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-8u8.4","title":"test(gateway): pin SQLite FTS lifecycle and literal-query semantics","description":"Trigger-driven FTS synchronization and hostile-query escaping were manually verified but are not retained by the trimmed SQLite-specific test suite. Preserve these SQLite-specific guarantees without duplicating the shared SessionStore contract.","acceptance_criteria":"Table-driven tests show FTS search/count remains correct after message deletion, ReplaceMessages, and session deletion with no cross-session leak; hostile inputs including column syntax, unmatched quotes, NEAR, wildcard, and boolean operators return literal-match behavior without syntax errors; multi-term queries pin AND semantics; tests stay SQLite-specific and focused.","notes":"Implemented and independently reviewed 2026-08-03. Added SQLite-specific FTS lifecycle tests for delete/replacement/session deletion, cross-session isolation, exact counts, hostile literal queries, multi-term AND semantics, exact MATCH escaping, and FTS5 rank=1 integrity checks. Sensitivity test proves the integrity check catches orphaned index entries when the delete trigger is absent. Focused tests, full gateway suite, gateway race, scoped lint, and format check pass. Fresh DeepSeek V4 Flash review reports zero surviving findings.","status":"closed","priority":1,"issue_type":"task","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-03T12:34:38Z","created_by":"Sam Catlow","updated_at":"2026-08-03T13:03:17Z","started_at":"2026-08-03T12:43:49Z","closed_at":"2026-08-03T13:03:17Z","close_reason":"SQLite FTS lifecycle and literal-query guarantees are regression-protected; all focused/race/lint/format validation passes and independent review is clean.","dependencies":[{"issue_id":"archie-core-8u8.4","depends_on_id":"archie-core-8u8","type":"parent-child","created_at":"2026-08-03T22:34:38Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0} -{"_type":"issue","id":"archie-core-8u8.2","title":"fix(gateway): align newest-session ordering across SessionStore backends","description":"SQLite List/GetByChannel order by created_at, while NellDB orders by latest document write/HLC. Touching or re-saving a session can therefore select a different active session after a backend cutover even though both pass the shared suite. Pin one observable newest-session contract and make both adapters satisfy it.","acceptance_criteria":"The shared conformance suite covers multiple sessions with distinct CreatedAt and LastActiveAt values plus Touch/re-save; List and GetByChannel return the same deterministic order on NellDB and SQLite; restart-style resolution selects the same session on both backends; indexes support the chosen SQLite ordering.","status":"in_progress","priority":1,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-03T12:34:37Z","created_by":"Sam Catlow","updated_at":"2026-08-04T12:46:04Z","started_at":"2026-08-04T12:46:04Z","dependencies":[{"issue_id":"archie-core-8u8.2","depends_on_id":"archie-core-8u8","type":"parent-child","created_at":"2026-08-03T22:34:37Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0} +{"_type":"issue","id":"archie-core-8u8.2","title":"fix(gateway): align newest-session ordering across SessionStore backends","description":"SQLite List/GetByChannel order by created_at, while NellDB orders by latest document write/HLC. Touching or re-saving a session can therefore select a different active session after a backend cutover even though both pass the shared suite. Pin one observable newest-session contract and make both adapters satisfy it.","acceptance_criteria":"The shared conformance suite covers multiple sessions with distinct CreatedAt and LastActiveAt values plus Touch/re-save; List and GetByChannel return the same deterministic order on NellDB and SQLite; restart-style resolution selects the same session on both backends; indexes support the chosen SQLite ordering.","status":"closed","priority":1,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-03T12:34:37Z","created_by":"Sam Catlow","updated_at":"2026-08-04T12:48:10Z","started_at":"2026-08-04T12:46:04Z","closed_at":"2026-08-04T12:48:10Z","close_reason":"Closed","dependencies":[{"issue_id":"archie-core-8u8.2","depends_on_id":"archie-core-8u8","type":"parent-child","created_at":"2026-08-03T22:34:37Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-8u8.1","title":"test(gateway): prove SQLite session rollback and reopen durability","description":"The SQLite SessionStore uses real transactions and WAL, but current tests only verify successful operations through the same open handle. Add adversarial file-backed tests that prove persisted session/message state survives close+reopen and that injected failures during Delete and ReplaceMessages roll the transaction and FTS index back to the original state.","acceptance_criteria":"A file-backed store is closed and reopened with sessions, canonical MessageID, SourceID, text, sender, and timestamps intact; PRAGMA quick_check returns ok; deterministic abort triggers force mid-Delete and mid-ReplaceMessages failures; after each failure the original session, history, counts, and search results remain unchanged; focused and race tests pass.","notes":"Implemented and independently reviewed 2026-08-03. Added file-backed close/reopen round-trip with PRAGMA quick_check plus trigger-injected mid-Delete and mid-ReplaceMessages rollback tests that verify session/history/count/FTS state. Focused gateway tests, gateway race suite, scoped lint, and format check pass. Fresh DeepSeek V4 Flash review found zero blockers; one cosmetic early-failure handle-cleanup note only.","status":"closed","priority":1,"issue_type":"task","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-03T12:34:36Z","created_by":"Sam Catlow","updated_at":"2026-08-03T12:43:41Z","started_at":"2026-08-03T12:35:02Z","closed_at":"2026-08-03T12:43:41Z","close_reason":"Verified durability and rollback regression coverage; focused/race/lint/format green and independent review has no surviving findings.","dependencies":[{"issue_id":"archie-core-8u8.1","depends_on_id":"archie-core-8u8","type":"parent-child","created_at":"2026-08-03T22:34:35Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0} -{"_type":"issue","id":"archie-core-963","title":"feat(gateway): durable message deduplication via upstream IDs","description":"gateway.Message carries no upstream/channel-native message ID, so a re-delivered Telegram update appends a duplicate turn. Add Message.ID and derive the NellDB document ID from it (time-prefixed to preserve the ScanSince ID tie-break), making redelivery an idempotent LWW upsert.","notes":"ADVERSARIAL PASS 2026-08-04 (fresh reviewer). Does NOT close.\n\nClaims (b), (c), (d) HELD identically on both backends: the immutability no-op, original-timestamp retention on redelivery, and honouring an incoming MessageID. newMessageID is deterministic and session-scoped. /retry verified end to end against both real stores with a live Router -- correct text, MessageID, SourceID and re-populated addressing, and the re-save is a no-op.\n\nBLOCKED BY: archie-core-cz8 (/compress destroys the identity this bead establishes -- the guarantee survives only until the first compression), archie-core-i6q (redelivery dedups the stored turn but respond() still re-runs the model, so a duplicate assistant turn and a second billed call still happen), archie-core-la1 item 1 (/branch copies parent MessageIDs; the struct doc says MessageID is 'ignored on write' while both stores honour it).\n\nDEDUP COVERAGE: SourceID is set at exactly one site repo-wide (telegram.go:479). Email and webhook set none, so every SMTP or webhook retry appends. Email has an unused RFC 5322 Message-ID.\n\nREJECTION REVISITED: 'time-prefixed document ID' rejection upheld. The 'clamp vs Message.At' rejection is OVER-CLAIMED -- doc line 128 sits in the Conversation branches section and constrains ordering, not whether the sender's clock may be overwritten; a separate monotonic sequence field would satisfy it too. gateway.go:44-48 documents At as 'when the message happened' while the store persists a mutated value, and no test pins what a caller reads back after a clamp. Sam's call, not the reviewer's.\n\nOUT OF SCOPE, unimplemented: doc lines 112-114 require edits/deletions/branches be represented 'through related records or events'. Only the immutability half exists; an edit is dropped on the floor. Not live loss today (telegram.go:233 AllowedUpdates excludes edited_message), but this bead should not read as 'immutability done'.","status":"open","priority":1,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-08-03T09:25:26Z","created_by":"Sam Catlow","updated_at":"2026-08-03T16:02:26Z","dependency_count":0,"dependent_count":0,"comment_count":0} -{"_type":"issue","id":"archie-core-gih","title":"fix(gateway): synchronize sessionTracker.active","description":"sessionTracker.active is a plain map with no mutex. go-telegram/bot dispatches each update in its own goroutine, so resolve() writes it while getActive() reads it concurrently. Backend-agnostic Go data race.","notes":"ADVERSARIAL PASS 2026-08-04 (fresh reviewer). The synchronization is CORRECT; the bead does not close on adjacent logic bugs.\n\nVERIFIED LOAD-BEARING: all four accesses to sessionTracker.active are guarded, no unguarded read or write anywhere in the package, no lock nesting or self-deadlock, no lock held across I/O or a channel send, every Unlock deferred. Stripping the RWMutex from all four sites produced 12 DATA RACE reports AND an assertion failure in TestSessionTrackerResolveIsStable, proving the double-check does real work rather than silencing the detector. Restored: -count=50 -race clean. PersonaRegistry.active is separately and correctly guarded.\n\nBLOCKED BY: archie-core-jex (/topic off poisons the cache with an empty session ID, sticky, reachable from webhook and email), archie-core-x35 (the double-check makes callers agree but the loser has already persisted its session, orphaning it), archie-core-7s3 (resolve picks an arbitrary session, not the most recent).","status":"open","priority":1,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-08-03T09:25:25Z","created_by":"Sam Catlow","updated_at":"2026-08-03T16:02:26Z","dependency_count":0,"dependent_count":0,"comment_count":0} +{"_type":"issue","id":"archie-core-963","title":"feat(gateway): durable message deduplication via upstream IDs","description":"gateway.Message carries no upstream/channel-native message ID, so a re-delivered Telegram update appends a duplicate turn. Add Message.ID and derive the NellDB document ID from it (time-prefixed to preserve the ScanSince ID tie-break), making redelivery an idempotent LWW upsert.","notes":"ADVERSARIAL PASS CLEARED 2026-08-04. Claims (b), (c), (d) verified on both backends; /retry verified end to end. Blockers fixed:\n- archie-core-cz8 (/compress destroyed the identity this bead establishes) -\u003e cf74d9c\n- archie-core-i6q (redelivery still re-ran the model) -\u003e 4c37925\n- archie-core-la1 (/branch copied parent MessageIDs; Message doc said MessageID was ignored on write) -\u003e 622ff64\nSTILL NOT DONE, deliberately: doc lines 112-114 also require edits/deletions/branches be represented through related records or events. Only the immutability half exists. Not live loss (telegram AllowedUpdates excludes edited_message) but this bead should not be read as 'immutability done'.\nDEDUP COVERAGE remains telegram-only: SourceID is set at exactly one site repo-wide. Email and webhook retries still append; email has an unused RFC 5322 Message-ID.","status":"closed","priority":1,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-08-03T09:25:26Z","created_by":"Sam Catlow","updated_at":"2026-08-04T12:48:09Z","closed_at":"2026-08-04T12:48:09Z","close_reason":"Closed","dependency_count":0,"dependent_count":0,"comment_count":0} +{"_type":"issue","id":"archie-core-gih","title":"fix(gateway): synchronize sessionTracker.active","description":"sessionTracker.active is a plain map with no mutex. go-telegram/bot dispatches each update in its own goroutine, so resolve() writes it while getActive() reads it concurrently. Backend-agnostic Go data race.","notes":"ADVERSARIAL PASS CLEARED 2026-08-04. The synchronization was verified correct and load-bearing: stripping the RWMutex produces 12 data-race reports plus an assertion failure. Blockers fixed:\n- archie-core-jex (/topic off poisoning the cache) -\u003e 182375b\n- archie-core-x35 (orphaned session on the lost race) -\u003e 3ebedcd\n- archie-core-7s3 (arbitrary session on restart) -\u003e 740ec50","status":"closed","priority":1,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-08-03T09:25:25Z","created_by":"Sam Catlow","updated_at":"2026-08-04T12:48:08Z","closed_at":"2026-08-04T12:48:08Z","close_reason":"Closed","dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-u4v","title":"Wire secret engines into provider discovery and execution","description":"Production creates only the env registry, never loads secret-engine plugins, and Provider lacks the documented api_key SecretRef. Implement startup plugin loading, backwards-compatible provider secret references, resolved provider discovery/runtime/container propagation, tests, release, and Carina deployment.","acceptance_criteria":"Provider api_key SecretRefs resolve through loaded engines at startup; existing api_key_env remains compatible; discovered providers, chat runtime, taskrun and containers receive resolved credentials without logging or serializing secret values; production composition tests and task check pass.","status":"closed","priority":1,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-07-30T17:52:08Z","created_by":"Sam Catlow","updated_at":"2026-07-30T22:48:38Z","started_at":"2026-07-30T17:52:13Z","closed_at":"2026-07-30T22:48:38Z","close_reason":"Live BWS discovery verified and ai-sdk openai-compatible fallback restored; 4+ provider catalog can now surface; full gate and final adversarial review pass","dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-6he","title":"Telegram rejects model confirmation when clearing inline keyboard","description":"Selecting a model calls editMessageText with a typed nil reply_markup; Telegram rejects it as object expected, leaving the picker visible. Omit reply_markup when no keyboard is required and cover the request shape.","acceptance_criteria":"Selecting any model replaces the picker with metadata confirmation and the Telegram edit request omits reply_markup when clearing controls.","status":"closed","priority":1,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-07-30T17:46:25Z","created_by":"Sam Catlow","updated_at":"2026-07-30T17:47:08Z","started_at":"2026-07-30T17:46:29Z","closed_at":"2026-07-30T17:47:08Z","close_reason":"Telegram confirmation edits now omit nil reply_markup; regression test passes","dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-v8x","title":"Unify Telegram provider and model selection around SDK catalog","description":"Replace the separate /provider and static configured-model surfaces with one /model provider-to-model wizard. Build the usable provider catalog from the local ai-sdk models.dev catalog plus environment credentials and explicit overrides, cache the filtered tool-capable catalog under the active config directory, and use the same resolved provider/model state across chat and execution paths. Remove the handwritten WellKnown table and remove external-framework references from the Archie tree.","acceptance_criteria":"/model first shows usable providers, then paginated tool-capable models, then atomically switches provider/model and reports model metadata and scope. /provider is absent from executable/menu/help surfaces. Catalog refresh is downloaded at daemon startup and cached beside configuration with safe cached fallback. Environment discovery and explicit overrides flow through chat, identities, subprocess and container/taskrun paths. Focused and composition tests cover discovery, pagination, callbacks and execution parity. A case-insensitive repository scan outside the explicit .references source tree finds no forbidden external-framework name.","status":"closed","priority":1,"issue_type":"feature","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-07-30T17:10:38Z","created_by":"Sam Catlow","updated_at":"2026-07-30T17:39:37Z","started_at":"2026-07-30T17:10:59Z","closed_at":"2026-07-30T17:39:37Z","close_reason":"Implemented SDK-backed provider discovery, unified Telegram model picker, safe catalog caching, and execution composition tests","dependency_count":0,"dependent_count":0,"comment_count":0}