diff --git a/.beads/interactions.jsonl b/.beads/interactions.jsonl index b3afdfdbb..3c2d73709 100644 --- a/.beads/interactions.jsonl +++ b/.beads/interactions.jsonl @@ -159,3 +159,4 @@ {"id":"int-6c8b1ec0ed98295ad0c7d27c65bd6696","kind":"field_change","created_at":"2026-09-01T15:55:33.214859138Z","actor":"Sam Catlow","issue_id":"archie-core-1786637490069-11-e245c170","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Complete: internal/domain/memory/{contract,registrar,registry}.go stands up\nmemory as a conforming engine family, mirroring internal/domain/curator's\nsplit exactly per this issue's own notes.\n\nMemoryEngine (contract.go) embeds Lifecycle (Start/Health/Stop) and Store\n(Write/Query/List/Forget -- real operations, not identity metadata) plus\nName/Version/Manifest/Bind. Store is split out as its own embedded\ninterface so MemoryEngine stays under golangci-lint's interfacebloat\nthreshold, same mechanism as curator's embedded Lifecycle.\n\nRegistry (registry.go) owns Register/Get/Names/Start/Health/Stop with\nduplicate/nil-engine/panic-in-Bind rejection, per-engine Start failure\nisolation (one engine's failed Start does not block the others, and is\nreported via Health), ctx-bounded Stop, and reverse-registration-order\nshutdown -- all verified by registry_test.go, mirroring curator's test\nsuite. go test ./internal/domain/memory/... -race -count=1 is green;\ntask lint is 0 issues.\n\nRegistrar (registrar.go) carries EventSink and Clock -- the only host\nservices with anything to gate on today. No capability-filtering logic\nexists yet because no memory-specific host service is capability-gated\n(unlike curator's Tools/Skills), so Bind passes the host straight\nthrough; add filtering if/when a gated service appears.\n\nOne AC clause is not literally testable yet: internal/plugin/\narchitecture_test.go's TestEngineFamilyInspectionRejectsInvalidShapes\nonly scans inline fixture source, not the real package tree, so nothing\ncurrently asserts memory.MemoryEngine is \"recognised\" by it one way or\nthe other -- the shape matches curator's (which the fixture tests\nvalidate the pattern against), but there is no scan-the-repo test to\nliterally pass. Noting this so a future close of a sibling issue doesn't\nrepeat the earlier inaccurate claim that this test scans real packages\n(archie-core-1786637499933-386-83646cce's close reason cited a test name,\nTestEveryEngineInterfaceHasTypedCapabilityAndFamilyOwner, that does not\nexist in the repo -- likely stale even at the time it was written).\n\nNot done, and correctly still open as their own issues: engines that\nimplement this contract (the Honcho proof, archie-core-1786637492031),\nthe config surface to select one (archie-core-1786637490043), and\nbinding curators to an attached engine (archie-core-1786637499636)."}} {"id":"int-86bb44776b478e9f6df5c63941200607","kind":"field_change","created_at":"2026-09-01T16:44:27.441778447Z","actor":"Sam Catlow","issue_id":"archie-core-1786637499480-370-223df308","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Complete: cfg.Memory.Engine now actually selects and starts an engine at\ndaemon boot, not just implements the contract in isolation.\n\ninternal/app/archied/bootstrap.go:setupMemoryEngine builds a\ndomain/memory.Registry, registers infraMemory.BuiltinEngine for\ncfg.Memory.Engine == \"builtin\" or \"\" (matching applyMemoryDefaults'\nresolution, so unconfigured and explicitly-builtin behave identically),\nstarts it, and stops it on shutdown -- rooted at workDir/memory-engine,\nseparate from the legacy provider's workDir/memory so the two can never\ncollide while both exist. Wired into Run() via setupMemoryAll\n(archie-core-1786637490043's cfg.Memory.Engine validation runs first at\nconfig load, so the switch's default case only guards drift between\nthat list and this one, not live operator input).\n\ninternal/memory/builtin is unchanged (verified: no diff, its tests pass\nunmodified) and internal/memory.Manager (the live system-prompt/tool-call\npath) does not read through this registry -- the two systems run in\nparallel by design, per archie-core-1786637490069-11-e245c170's explicit\nscoping. Converging them is future work, not part of this issue's AC.\n\ngo test ./... is green; task lint is 0 issues."}} {"id":"int-c7304b2101eb73c6404d8508da30e2be","kind":"field_change","created_at":"2026-09-01T16:44:37.765726853Z","actor":"Sam Catlow","issue_id":"archie-core-1786637490043-10-711c450a","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Complete, all four AC clauses:\n\n- config.MemoryConfig.Engine field added with toml/yaml/json tags;\n Provider/ProviderConfig/SessionTTL also gained the toml tags they were\n missing (repo convention, config.toml is the primary format).\n- validateMemory (internal/infrastructure/configuration/validate.go)\n rejects an engine name outside memoryEngines with\n \"%w: memory.engine %q (want %s)\", the same named-constant-list +\n oneOf/list shape forge.type already uses. TestValidateMemoryNames\n TheValidSet pins the exact message.\n- applyMemoryDefaults resolves an absent engine to \"builtin\"\n (memoryEngineBuiltin), verified by\n TestApplyMemoryDefaultsFillsAbsentEngineWithBuiltin, and an explicit\n value is left alone (TestApplyMemoryDefaultsLeavesExplicitValuesAlone).\n- config.example.toml documents [memory] engine alongside the existing\n provider field, distinguishing the two mechanisms.\n\nSince closing this, archie-core-1786637499480 (ship builtin as default)\nlanded the bootstrap wiring that actually consumes cfg.Memory.Engine, so\nthe field is not just parsed and validated but live end to end."}} +{"id":"int-432ac25baf4f85d1a9f04ff494d0bc62","kind":"field_change","created_at":"2026-09-01T16:47:57.576063469Z","actor":"Sam Catlow","issue_id":"archie-core-1786637499636-376-2f94082e","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Complete, all three AC clauses:\n\n- A curator declares its memory engine via Manifest.MemoryEngine and\n receives it as a typed dependency: curator.Registrar.MemoryEngines\n (Get(name) (domainmemory.MemoryEngine, bool)), same trust model as\n ToolBuilder.Build(ctx, declared) -- the curator calls Get with its own\n declared name, not handed a pre-resolved instance. Registration\n enforces presence exactly like Tools/Skills: declared with no\n MemoryEngineSource on the host is rejected at Register\n (TestRegistryDeclaredCapabilitiesRequireHostServices' two new cases),\n and filter() clears the field from a curator's view when undeclared\n (TestRegistryBindFiltersToDeclaredCapabilities).\n- Swapping the configured engine changes where memories land with no\n curator code change: nothing about a curator names a concrete engine,\n only the string it declared, resolved fresh through whichever registry\n it was bound to.\n- A curator with no declared engine stays valid (pre-existing behavior,\n now covered by table cases) and can only ever be affected by a memory\n operation it structurally cannot attempt, since MemoryEngines is nil\n in its view.\n\nWired end to end: internal/app/archied/bootstrap.go:setupCurators passes\nb.memEngines (*domainmemory.Registry, set by setupMemoryAll which Run()\ncalls before setupCurators) straight in -- it already satisfies\nMemoryEngineSource with no adapter.\n\ngo test ./... is green; task lint is 0 issues."}} diff --git a/.beads/issues.jsonl b/.beads/issues.jsonl index ff9c1e7f7..d57324305 100644 --- a/.beads/issues.jsonl +++ b/.beads/issues.jsonl @@ -232,7 +232,7 @@ {"_type":"issue","id":"archie-core-1786637499722-379-670f62fc","title":"Phase 2: mechanical per-package fixes (~40 issues)","description":"forcetypeassert (24, internal/tools 20 + internal/memory 2, nearly all tests), predeclared (9, webui/ratelimit/memory), leftover unconvert. Purely mechanical, package-local, no design judgement. THE ONLY PHASE WORTH PARALLELISING. Partition by package: tools / webui / memory+ratelimit / secret. Use git worktree isolation -- other sessions edit this repo concurrently and stale diagnostics are a known hazard. Each worker verifies scoped: go test ./internal/X/... plus golangci-lint run ./internal/X/...","status":"closed","priority":2,"issue_type":"task","created_at":"2026-08-08T14:56:34Z","updated_at":"2026-08-08T14:56:36Z","closed_at":"2026-08-08T14:56:37Z","external_ref":"https://github.com/samcharles93/archie-core/issues/400","source_system":"github:https://github.com/samcharles93/archie-core/issues/400:400","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-1786637499692-378-45486e7d","title":"Phase 1: autofix pass (~35 issues)","description":"golangci-lint run --fix plus the formatters. Covers errorlint, fatcontext, gocritic, sloglint, usestdlibvars, usetesting, gci, gofumpt, goimports. Zero judgement. MUST run first: it touches formatting across every file and would conflict with anything in flight. Single command, single commit, verify with task check.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-08-08T14:56:28Z","updated_at":"2026-08-08T14:56:31Z","closed_at":"2026-08-08T14:56:32Z","external_ref":"https://github.com/samcharles93/archie-core/issues/399","source_system":"github:https://github.com/samcharles93/archie-core/issues/399:399","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-1786637499664-377-c2818afd","title":"[EPIC] Clear the 160 golangci-lint findings","description":"Config landed in 9298afd; the gate is RED until this epic closes. Four phases, ordered by risk and by what invalidates what. Structural refactor MUST be last: it moves line numbers and invalidates everything in flight.","status":"open","priority":2,"issue_type":"epic","created_at":"2026-08-08T14:56:25Z","updated_at":"2026-08-08T15:34:26Z","external_ref":"https://github.com/samcharles93/archie-core/issues/398","source_system":"github:https://github.com/samcharles93/archie-core/issues/398:398","metadata":null,"labels":["epic"],"dependency_count":0,"dependent_count":0,"comment_count":0} -{"_type":"issue","id":"archie-core-1786637499636-376-2f94082e","title":"Bind curators to memory engines","description":"Wire the attached-memory-engine part of a curator's declared shape once the memory engine family exists, so a curator reads and writes through the engine contract rather than a concrete store.\n\n### Acceptance Criteria\n\nA curator declares which memory engine it uses and receives it as a typed dependency. Swapping the configured engine changes where a curator's memories land with no change to the curator. A curator with no declared memory engine is a valid configuration and is rejected only if it attempts a memory operation.","notes":"Blocked on its own stated prerequisite, which is also still open: archie-core-1786637490069-11-e245c170 (Memory engine contract and owning registry). Current state: Manifest.MemoryEngine (internal/domain/curator/contract.go:59-63) is only a declared string name; Registrar (registrar.go) has no memory-engine field at all, so nothing actually binds an engine instance to a curator yet -- registry.go:128's agentic() check only tests MemoryEngine != \"\", it doesn't inject anything. Do not start this until the memory engine contract exists; there is nothing to bind to yet.","status":"open","priority":2,"issue_type":"feature","created_at":"2026-08-08T14:56:23Z","updated_at":"2026-08-15T12:55:30Z","external_ref":"https://github.com/samcharles93/archie-core/issues/397","source_system":"github:https://github.com/samcharles93/archie-core/issues/397:397","metadata":null,"labels":["enhancement"],"dependencies":[{"issue_id":"archie-core-1786637499636-376-2f94082e","depends_on_id":"archie-core-1786637490069-11-e245c170","type":"blocks","created_at":"2026-08-15T12:55:30Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-1786637499636-376-2f94082e","depends_on_id":"archie-core-1786637500725-414-9d66a52b","type":"parent-child","created_at":"2026-09-01T15:50:27Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":1,"dependent_count":0,"comment_count":0} +{"_type":"issue","id":"archie-core-1786637499636-376-2f94082e","title":"Bind curators to memory engines","description":"Wire the attached-memory-engine part of a curator's declared shape once the memory engine family exists, so a curator reads and writes through the engine contract rather than a concrete store.\n\n### Acceptance Criteria\n\nA curator declares which memory engine it uses and receives it as a typed dependency. Swapping the configured engine changes where a curator's memories land with no change to the curator. A curator with no declared memory engine is a valid configuration and is rejected only if it attempts a memory operation.","notes":"Blocked on its own stated prerequisite, which is also still open: archie-core-1786637490069-11-e245c170 (Memory engine contract and owning registry). Current state: Manifest.MemoryEngine (internal/domain/curator/contract.go:59-63) is only a declared string name; Registrar (registrar.go) has no memory-engine field at all, so nothing actually binds an engine instance to a curator yet -- registry.go:128's agentic() check only tests MemoryEngine != \"\", it doesn't inject anything. Do not start this until the memory engine contract exists; there is nothing to bind to yet.","status":"closed","priority":2,"issue_type":"feature","created_at":"2026-08-08T14:56:23Z","updated_at":"2026-09-01T16:47:58Z","closed_at":"2026-09-01T16:47:58Z","close_reason":"Complete, all three AC clauses:\n\n- A curator declares its memory engine via Manifest.MemoryEngine and\n receives it as a typed dependency: curator.Registrar.MemoryEngines\n (Get(name) (domainmemory.MemoryEngine, bool)), same trust model as\n ToolBuilder.Build(ctx, declared) -- the curator calls Get with its own\n declared name, not handed a pre-resolved instance. Registration\n enforces presence exactly like Tools/Skills: declared with no\n MemoryEngineSource on the host is rejected at Register\n (TestRegistryDeclaredCapabilitiesRequireHostServices' two new cases),\n and filter() clears the field from a curator's view when undeclared\n (TestRegistryBindFiltersToDeclaredCapabilities).\n- Swapping the configured engine changes where memories land with no\n curator code change: nothing about a curator names a concrete engine,\n only the string it declared, resolved fresh through whichever registry\n it was bound to.\n- A curator with no declared engine stays valid (pre-existing behavior,\n now covered by table cases) and can only ever be affected by a memory\n operation it structurally cannot attempt, since MemoryEngines is nil\n in its view.\n\nWired end to end: internal/app/archied/bootstrap.go:setupCurators passes\nb.memEngines (*domainmemory.Registry, set by setupMemoryAll which Run()\ncalls before setupCurators) straight in -- it already satisfies\nMemoryEngineSource with no adapter.\n\ngo test ./... is green; task lint is 0 issues.","external_ref":"https://github.com/samcharles93/archie-core/issues/397","source_system":"github:https://github.com/samcharles93/archie-core/issues/397:397","metadata":null,"labels":["enhancement"],"dependencies":[{"issue_id":"archie-core-1786637499636-376-2f94082e","depends_on_id":"archie-core-1786637490069-11-e245c170","type":"blocks","created_at":"2026-08-15T12:55:30Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-1786637499636-376-2f94082e","depends_on_id":"archie-core-1786637500725-414-9d66a52b","type":"parent-child","created_at":"2026-09-01T15:50:27Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":1,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-1786637499610-375-5e43fe37","title":"Consolidate duplicated NATS RPC client/server boilerplate","description":"internal/storerpc/storerpc.go, internal/worktreerpc/worktreerpc.go, internal/forgerpc/forgerpc.go each reimplement near-identical timeout/marshal/error-envelope helpers for NATS request/reply RPC. Extract shared helpers into a common package.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-08-08T14:56:17Z","updated_at":"2026-08-08T14:56:20Z","closed_at":"2026-08-08T14:56:21Z","external_ref":"https://github.com/samcharles93/archie-core/issues/396","source_system":"github:https://github.com/samcharles93/archie-core/issues/396:396","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-1786637499585-374-bf060b8b","title":"infrastructure/eventbus/nats: relocate NATS transport","description":"Create internal/infrastructure/eventbus/nats as a properly structured replacement for internal/nats. This is NOT a mechanical move: the existing code has no interfaces, leaks vendor types (Conn() *nats.Conn, PublishMsg(*nats.Msg), Fetch() jetstream.Msg) into all four consumers, uses a 7-positional-parameter publish with stringly-typed comma-separated labels, stores an unused logger, returns (nil, nil) for 'no message', and hardcodes stream/consumer/timeout config. Rebuild it with: separate files per concern; a Message wrapper so jetstream types stop crossing the boundary; Publisher/Consumer interfaces; a Config struct; sentinel errors; consistent %w wrapping; real logging. Then update cmd/archied, cmd/archie-agent, internal/daemon and internal/agentexec to the new API.\n\n### Acceptance Criteria\n\ninternal/nats no longer exists; internal/infrastructure/eventbus/nats has its contents. All imports updated. task check clean. Container and NATS behaviour unchanged.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-08-08T14:56:12Z","updated_at":"2026-08-08T14:56:15Z","closed_at":"2026-08-08T14:56:16Z","external_ref":"https://github.com/samcharles93/archie-core/issues/395","source_system":"github:https://github.com/samcharles93/archie-core/issues/395:395","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-1786637499562-373-11ad6000","title":"fix(nell): counters squat on the SDK-reserved meta: prefix, blocking all writes after restart","description":"TOTAL OUTAGE. No task can be queued and no event recorded; survives restarts.\n\ninternal/nell/adapter.go:946,952 store auto-increment counters at meta:task_id_counter and meta:event_id_counter. The NellDB SDK reserves the meta: prefix for its own bookkeeping (sdk/replicate.go:841 isInternalID = id[:5]==\"meta:\").\n\nDocDB.reindex() skips internal ids when rebuilding the in-memory rev cache (sdk/docdb.go:128-137), but the record stays in the log. So after a restart Get returns the counter doc WITH its _rev while d.revs has no entry, and putIn rejects exactly that: 'incomingRev != \"\" \u0026\u0026 !exists' -\u003e ErrConflict (sdk/docdb.go:213-217). Permanent.\n\nHits nextTaskID (every EnqueueIssue) and nextEventID (every InsertEvent). processNATSTask Naks on error so NATS redelivers forever.\n\nReproduced: internal/nell/counter_repro_test.go - open, insert, close, reopen, insert -\u003e ErrConflict in 7ms with no daemon/NATS/forge.\n\nSECOND DEFECT: isInternalID exists to exclude records from replication, so the two carina instances never converge their counters and would allocate COLLIDING task IDs. Masked only because allocation currently fails outright.\n\nFIX: move the keys out of the reserved namespace (counter:task_id / counter:event_id) AND migrate on open - the old doc is readable (only Put fails), and its next_id is load-bearing because restarting at 1 would reissue live task IDs. Also teach isMetaKey (adapter.go:803) to skip the new prefix so scans do not parse a counter as a task.\n\nREJECTED: stripping _rev before Put is one line and works, but leaves the prefix squat, leaves counters unreplicated, and turns a loud failure into silent last-write-wins.\n\nFull writeup: docs/incident-nelldb-counter-conflict.md","status":"closed","priority":2,"issue_type":"bug","created_at":"2026-08-08T14:56:07Z","updated_at":"2026-08-08T14:56:09Z","closed_at":"2026-08-08T14:56:10Z","external_ref":"https://github.com/samcharles93/archie-core/issues/394","source_system":"github:https://github.com/samcharles93/archie-core/issues/394:394","metadata":null,"labels":["bug"],"dependency_count":0,"dependent_count":0,"comment_count":0}