chore(beads): close archie-core-ci3, add b4i task

This commit is contained in:
sam committed 2026-08-03 19:07:49 +10:00
1 parent ef8856872c
commit c7f060584b
2 files changed
+3

No files matched your search

+1
View File
@@ -228,3 +228,4 @@
{"id":"int-f1b886821c69a4b52d422bc826c5c153","kind":"field_change","created_at":"2026-07-30T17:47:08.215418355Z","actor":"Sam Catlow","issue_id":"archie-core-6he","extra":{"field":"status","new_value":"closed","old_value":"in_progress","reason":"Telegram confirmation edits now omit nil reply_markup; regression test passes"}}
{"id":"int-a5d387a7885fbe49d1a2b6d910b26fcf","kind":"field_change","created_at":"2026-07-30T22:45:57.584919906Z","actor":"Sam Catlow","issue_id":"archie-core-u4v","extra":{"field":"status","new_value":"closed","old_value":"in_progress","reason":"Built-in BWS and custom secret engines are production-wired; provider SecretRefs resolve safely across root and identity execution paths; full gate and adversarial review pass"}}
{"id":"int-84add6a34b78c40cb9697eef5a9eb109","kind":"field_change","created_at":"2026-07-30T22:48:38.349111694Z","actor":"Sam Catlow","issue_id":"archie-core-u4v","extra":{"field":"status","new_value":"closed","old_value":"open","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"}}
{"id":"int-0028087fab7b1cb24434a6dd79eb9e0e","kind":"field_change","created_at":"2026-08-03T09:02:40.775330657Z","actor":"Sam Catlow","issue_id":"archie-core-ci3","extra":{"field":"status","new_value":"closed","old_value":"in_progress","reason":"Fixed by upgrading NellDB v0.2.5 -> 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."}}
+2
View File
@@ -1,3 +1,5 @@
{"_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":"Implemented 2026-08-03. task check clean, golangci-lint 0 issues, -race clean.\n\n- Message.At added; NellDB nell.TimestampField (_ts) written and read back (was written and discarded).\n- Per-session collection msgCollection(sessionID)='messages:'+sessionID, DocDB cache keyed by session (sdk.New reindexes, so caching matters).\n- Time-ordered collision-free message IDs (UnixNano + atomic counter); SaveMessages no longer keys from i=0.\n- RecentMessages/DeleteRecentMessages use ScanSince(Desc) via newestRows(), which walks the cursor past NellDB's internal 1000-row ScanSince clamp. Without this /compress (DeleteRecentMessages with full count) silently stranded messages.\n- SearchMessages now MessageQuery{Query,Limit,Offset} -\u003e MessagePage{Messages,NextOffset,HasMore,Truncated}, backed by collection-scoped TextSearch over the whole session. Limit is per page. The old 200-message substring window is gone.\n- MessagePage.Truncated surfaces NellDB's MaxTextSearchLimit (1000) ranked-result ceiling instead of reporting it as end-of-results.\n- Session Delete now drops the session's message collection.\n\nAdversarial review pass NOT yet run - required before close per CLAUDE.md.","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-03T03:12:58Z","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}
{"_type":"issue","id":"archie-core-abg.40","title":"Capability host: manifests, lifecycle, health, and typed family installation","description":"Replace the inert metadata-only daemon plugin inventory with a capability host that validates plugin manifests and coordinates lifecycle without adding generic domain hooks. The host owns module identity/API compatibility/dependency ordering/start/health/stop state; typed family registries remain responsible for capability registration. Wire it into archied startup/shutdown and expose status without passing *daemon.Daemon to plugins.","design":"Keep plugin.Plugin exactly Name/Version. Add a validated Manifest and lifecycle vocabulary in internal/plugin plus a Host that manages manifests and lifecycle only. Capability packages receive narrow typed registrars; the host must not become an any-typed service locator. Start in dependency order, roll back a partially failed start, stop in reverse order, isolate panics/errors, and return immutable health snapshots. Preserve existing Yaegi loading through an adapter or manifest synthesis for metadata-only legacy plugins.","acceptance_criteria":"Manifest validation covers stable ID, semantic version, host API compatibility, declared capability kinds, dependencies, permissions, and optional config schema. Duplicate IDs, missing dependencies, cycles, incompatible API versions, and invalid manifests fail deterministically. Host lifecycle tests prove dependency-ordered start, rollback, reverse stop, health aggregation, idempotent shutdown, and panic/error isolation. archied owns one host and starts/stops it. plugin.Plugin remains metadata-only and architecture tests pass. task check and lint are green apart from explicitly identified concurrent baseline failures; fresh adversarial review has no surviving findings.","notes":"Implemented strict manifest validation, dependency-ordered lifecycle, bounded/retryable rollback cleanup, reverse shutdown, health snapshots, legacy metadata adapter, and archied composition. Removed divergent daemon PluginRegistry. TDD focused tests, race tests, lint, formatting, and independent adversarial re-review all pass with zero surviving findings. Repository-wide task check remains separately subject to concurrent gateway work.","status":"closed","priority":0,"issue_type":"feature","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-07-26T05:11:09Z","created_by":"Sam Catlow","updated_at":"2026-07-26T06:38:08Z","started_at":"2026-07-26T05:14:06Z","closed_at":"2026-07-26T06:38:08Z","close_reason":"Capability host, manifest/lifecycle, composition, enforcement tests, and adversarial remediation complete","dependencies":[{"issue_id":"archie-core-abg.40","depends_on_id":"archie-core-abg","type":"parent-child","created_at":"2026-07-26T15:11:08Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":1,"comment_count":0}