diff --git a/.beads/interactions.jsonl b/.beads/interactions.jsonl index c6aa855d1..f0c0660d5 100644 --- a/.beads/interactions.jsonl +++ b/.beads/interactions.jsonl @@ -196,3 +196,4 @@ {"id":"int-9bc9541763af71ffbdb351604e477227","kind":"field_change","created_at":"2026-09-02T17:35:28.094046545Z","actor":"Sam Catlow","issue_id":"archie-core-t2db.13","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Implemented and gate-verified as d29c732 (pushed to main). ModuleRegistry (Register/Invoke, strict arg decode, yaegiutil panic recovery) + internal/domain/eda/module/log schema with generated logextract symbols; ModuleDir config wired in bootstrap.go with log-and-abort; examples/modules/log.go operator example proven through the real registry. Playbook YAML action dispatch deliberately deferred (data-flow Q1 unresolved) and recorded in module-position.md. task check clean (113/113 UI, exit 0)."}} {"id":"int-0ae0e3fbcad5c9cc45344d5f64b6abc5","kind":"field_change","created_at":"2026-09-02T18:01:29.431793769Z","actor":"Sam Catlow","issue_id":"archie-core-t2db.14","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Implemented and gate-verified as 33cdece (pushed to main). internal/domain/eda/expr: NewEnv (event+actions roots, DefaultCostLimit 100k), Compile (reject-at-load: syntax/unknown-root/type errors returned), Eval (panic-free, errors returned, ref.Val unwrapped to native). cel.dev/cel-go v0.32.0 direct dep, vetted per resolved doc (no re-vet). 9 tests pass, all verified against real CEL semantics (cost limits accrue on macros; == on missing key is false; unknown root rejected at compile). task check clean (113/113 UI)."}} {"id":"int-f10f375727370c967a2884fbc8e60b70","kind":"field_change","created_at":"2026-09-02T18:06:07.68242224Z","actor":"Sam Catlow","issue_id":"archie-core-t2db.15","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Implemented and gate-verified as 2c2b9b7 (pushed to main). internal/domain/eda/playbook: Load (reject-at-load: 2+ actions, non-workflow position, malformed, bad when compile all fail whole load) + Store.Dispatch (trigger match via workintake kind/labels, CEL when eval, named-workflow registry lookup -- same as Route()'s, no duplicated dispatch). EDAPlaybookDir config field (distinct from PlaybookDirs, documented), bootstrap load-and-abort. workflow.Route()/binding loaders untouched; their suites verified zero-regression. 11 tests + shipped example proving end-to-end; task check clean (113/113 UI). FOLLOW-UP TICKET NEEDED (not in this slice, per design): wire Store.Dispatch into production task intake (daemon.go/pollNATS/publishTask) so real forge-triggered tasks flow through the coordinator instead of only workflow.Route(); plus a separate linter/LSP integration ticket for the expr compile path."}} +{"id":"int-7908617f987c5056730fd95c595c8d7d","kind":"field_change","created_at":"2026-09-02T18:17:08.363568118Z","actor":"Sam Catlow","issue_id":"archie-core-uhtz","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Investigated per design notes: intentional behavior, not a bug -- confirmed against existing test coverage (skillcurator_test.go's parse-failure-doesn't-abort-batch test). Documented with a scoped nolint explaining why, not a behavior change. Commit pushed to main."}} diff --git a/.beads/issues.jsonl b/.beads/issues.jsonl index 73beca98c..18ffc9c34 100644 --- a/.beads/issues.jsonl +++ b/.beads/issues.jsonl @@ -641,7 +641,7 @@ {"_type":"issue","id":"archie-core-1786637489857-3-24abe68c","title":"fix(gateway): make /compress failure-safe","description":"applyCompress swallows MessageCount and DeleteRecentMessages errors (allCount, _ := and _, _ =) then deletes all messages BEFORE saving the compressed replacement. A crash or error between the two loses the session's entire history unrecoverably. Add a store-level ReplaceMessages that saves first and deletes the previously-listed IDs after, so the failure mode is recoverable duplicates rather than total loss.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-08-08T14:26:24Z","updated_at":"2026-08-08T15:33:31Z","closed_at":"2026-08-08T15:33:32Z","external_ref":"https://github.com/samcharles93/archie-core/issues/24","source_system":"github:https://github.com/samcharles93/archie-core/issues/24:24","metadata":null,"labels":["task"],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-1786637489834-2-109e7cab","title":"[BUG] /model \u003cname\u003e asked the router for a doubled model name","description":"The nestif extraction in 651de0a pulled --provider parsing out of parseModelRest into extractProviderFlag, which took the modelParts slice by pointer and appended every non-provider field to it. The caller's own loop then appended the same fields again, so every field of the model name was duplicated: '/model gpt-5.6' resolved to 'gpt-5.6 gpt-5.6' and SetActiveModel rejected it as an unknown model. '/model gpt-5.6 --provider openai' was worse -- the space-separated provider value was no longer consumed with its flag, giving 'gpt-5.6 gpt-5.6 openai'. Direct model switching over Telegram was broken for anything but a bare --refresh or a provider-only switch. Found while auditing 6d4e0be for archie-core-ifi: the naked return in the same function could not be regression-tested until the function produced correct values.\n\n### Design\n\nTwo ways to fix the double append were available. Rejected: keep the helper\nsignature and delete the caller's default-branch append. That restores correct\noutput but leaves the shape intact -- a helper holding a pointer to the\ncaller's accumulator, with two loops over the same fields -- so the next person\nwho adds a field type has the same trap waiting. It also does not fix the\nspace-separated provider value, because the helper returns early on the first\n--provider and never sees the fields after it.\n\nChosen: splitProviderFlag returns (provider, remaining) and is the sole\naccumulator. One loop owns the fields, and there is no shared slice to append\nto twice. The index loop is kept deliberately -- i++ after reading a\nspace-separated value is what removes it with its flag, and converting that to\na range loop is precisely what 651de0a did wrong.\n\nLast --provider wins if repeated, matching the pre-651de0a behaviour rather\nthan the buggy helper's first-wins. Not worth a flag: /model does not document\nrepeating it.\n\n### Acceptance Criteria\n\nparseModelRest returns the model name exactly once for bare names, scope flags, and both --provider spellings, with a regression test asserting field count rather than string equality.","status":"closed","priority":2,"issue_type":"bug","created_at":"2026-08-08T14:26:19Z","updated_at":"2026-08-08T15:34:07Z","closed_at":"2026-08-08T15:34:08Z","external_ref":"https://github.com/samcharles93/archie-core/issues/23","source_system":"github:https://github.com/samcharles93/archie-core/issues/23:23","metadata":null,"labels":["bug"],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-1786637489768-1-2fd8288f","title":"Trigger accounting: curator output must not feed its own trigger","description":"Establish the invariant that work a curator produces does not count toward the condition that schedules the next curator run. The scheduler must explicitly exclude derived curator output from the observation threshold: counting it would inflate the threshold and create a feedback loop, so a curator that writes memories must not thereby schedule itself again.\n\n### Acceptance Criteria\n\nDerived curator output is distinguishable from primary input at the point the trigger is evaluated. A curator that writes memories does not thereby schedule itself again. There is a regression test that would fail if derived output were counted, with the feedback-loop rationale recorded in the test so the guard is not removed as redundant.","status":"closed","priority":2,"issue_type":"task","created_at":"2026-08-08T14:26:17Z","updated_at":"2026-08-15T12:55:20Z","closed_at":"2026-08-15T12:55:20Z","close_reason":"Complete: internal/domain/curator/wake.go WakeOnPrimaryInput forwards only explicitly-passed inputKinds; curator-produced kinds (curator_run, curator_action, curator_error) are structurally excluded, per its own doc comment naming this exact invariant. internal/domain/curator/wake_test.go:11-21 TestWakeOnPrimaryInputForwardsOnlyPrimaryKinds carries the required feedback-loop rationale verbatim ('if derived curator output counted... a curator that writes memories would schedule itself again... This test fails if a derived kind is added to the forwarded set or the filter is removed as redundant') and asserts passCalls/checkCalls stay at 1 after publishing derived-kind events. All three acceptance-criteria clauses satisfied exactly.","external_ref":"https://github.com/samcharles93/archie-core/issues/22","source_system":"github:https://github.com/samcharles93/archie-core/issues/22:22","metadata":null,"labels":["task"],"dependencies":[{"issue_id":"archie-core-1786637489768-1-2fd8288f","depends_on_id":"archie-core-1786637500725-414-9d66a52b","type":"parent-child","created_at":"2026-09-01T15:50:29Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0} -{"_type":"issue","id":"archie-core-uhtz","title":"skillcurator: nilerr finding at skillcurator.go:110 (pre-existing, unrelated to EDA work)","description":"task check's newly-added lint step (chore(taskfile) 60dde24) surfaced internal/infrastructure/skillcurator/skillcurator.go:110 -- returns nil despite a non-nil error at line 108 (nilerr). This is pre-existing debt, unrelated to any EDA/playbook engine work this session -- different subsystem entirely. Filed separately per this session's established pattern (see archie-core-e7bo) of not drive-by fixing unrelated findings inside an in-progress feature's tickets.","design":"Read the actual code at skillcurator.go:108-110 before fixing -- determine whether swallowing the error there was ever intentional (check git blame/history) or a genuine bug, and fix at the producer per AGENTS.md's Root-Cause Fixes rule rather than just propagating the error blindly if the surrounding contract expects a specific degrade-gracefully shape.","acceptance_criteria":"golangci-lint run ./... reports zero nilerr findings in internal/infrastructure/skillcurator/. Existing skillcurator tests pass; add a test covering the error path if none currently exercises it. task check passes.","status":"open","priority":3,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-09-02T18:10:22Z","created_by":"Sam Catlow","updated_at":"2026-09-02T18:10:22Z","dependency_count":0,"dependent_count":0,"comment_count":0} +{"_type":"issue","id":"archie-core-uhtz","title":"skillcurator: nilerr finding at skillcurator.go:110 (pre-existing, unrelated to EDA work)","description":"task check's newly-added lint step (chore(taskfile) 60dde24) surfaced internal/infrastructure/skillcurator/skillcurator.go:110 -- returns nil despite a non-nil error at line 108 (nilerr). This is pre-existing debt, unrelated to any EDA/playbook engine work this session -- different subsystem entirely. Filed separately per this session's established pattern (see archie-core-e7bo) of not drive-by fixing unrelated findings inside an in-progress feature's tickets.","design":"Read the actual code at skillcurator.go:108-110 before fixing -- determine whether swallowing the error there was ever intentional (check git blame/history) or a genuine bug, and fix at the producer per AGENTS.md's Root-Cause Fixes rule rather than just propagating the error blindly if the surrounding contract expects a specific degrade-gracefully shape.","acceptance_criteria":"golangci-lint run ./... reports zero nilerr findings in internal/infrastructure/skillcurator/. Existing skillcurator tests pass; add a test covering the error path if none currently exercises it. task check passes.","status":"closed","priority":3,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-09-02T18:10:22Z","created_by":"Sam Catlow","updated_at":"2026-09-02T18:17:08Z","closed_at":"2026-09-02T18:17:08Z","close_reason":"Investigated per design notes: intentional behavior, not a bug -- confirmed against existing test coverage (skillcurator_test.go's parse-failure-doesn't-abort-batch test). Documented with a scoped nolint explaining why, not a behavior change. Commit pushed to main.","dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-1y6y","title":"Adapt internal/tools/minimax to ai-sdk's video.Provider interface","description":"internal/tools/minimax (the generate_video tool) is a hand-rolled HTTP client (Config/Client/GenerateAndWait against MiniMax's video-generation API) that duplicates functionality ai-sdk already provides generically: video.Provider (Name/GenerateVideo(ctx,req)(resp,error)), core.GenerateVideo, and registry.RegisterVideo/.Video(name) -- the same registration shape chat models and the new image capability use. MiniMax's async submit-then-poll GenerateAndWait fits behind video.Provider's single blocking call fine; nothing about the interface forces synchronous-only backends.\n\nCurrently: not extensible (a second video backend would have to duplicate all the HTTP/poll scaffolding instead of just implementing video.Provider) and not reusable (can't be registered/discovered alongside a future video provider the way chat models and image providers can).\n\nFix: wrap minimax.Client behind an adapter implementing ai-sdk's video.Provider, register it via registry.RegisterVideo instead of the tool holding a bespoke *minimax.Client directly. Keep minimax.Client itself as the low-level HTTP/poll implementation -- only the tool-facing seam changes.","design":"Mirrors the note left on archie-core-1786748942169-3-ae7cfaea for the hosted image provider: adapt ai-sdk's existing provider-agnostic facility instead of a bespoke client. Adapter should preserve GenerateAndWait's polling behavior internally -- video.Provider's synchronous call shape does not require changing MiniMax's async job semantics, only where the polling loop is invoked from.","acceptance_criteria":"minimax.Client (or a thin adapter) implements ai-sdk/video.Provider; the generate_video tool obtains it through the ai-sdk provider registry, not a bespoke config-to-client wiring; existing tests (minimax_test.go, tool_test.go) still pass or are updated for the new seam; task check passes.","status":"open","priority":3,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-09-02T10:36:12Z","created_by":"Sam Catlow","updated_at":"2026-09-02T11:03:52Z","external_ref":"https://github.com/samcharles93/archie-core/issues/681","dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-jkmu","title":"send_file confinement is symlink-blind and re-opens the file after checking it","description":"internal/tools/builtin/confinement.go ResolveReadable applies exactly the read tool's policy (resolvePath + isReadConfined), which is purely lexical: filepath.Abs/Rel, never EvalSymlinks. A symlink inside the workspace pointing at /etc/shadow passes the check, and the telegram sender then opens att.Path with no confinement check of its own, in a different goroutine after the turn. There is also a real TOCTOU window -- prepare stats/opens/closes, SendMedia re-stats and re-opens later.\n\nThe policy is unchanged from the read tool, so this is not a new hole; what changed is the consequence. The read tool caps at 5MB into the operator's own context; send_file ships up to 50MB OUT to a chat. The shell tool has never been confined either, so a model that wants the bytes already has them.\n\nDecide: either resolve symlinks in ResolveReadable (which changes read-tool behaviour too, and may break legitimate symlinked workspaces), or document the caveat explicitly and stop claiming 'sending cannot reach what reading cannot' without it.\n\nFound by adversarial review of 9a45fbb.\n\n## Acceptance Criteria\nEither the symlink case is closed at the resolver, or the limitation is written down where the claim is made (confinement.go doc comment and sendfile package doc).","status":"open","priority":3,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-08-24T15:54:43Z","created_by":"Sam Catlow","updated_at":"2026-08-24T19:49:55Z","external_ref":"https://github.com/samcharles93/archie-core/issues/647","dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-1ysw.8","title":"Honor cancellation before local worktree commits","description":"CommitAll discards its context and can stage and commit after task cancellation.\n\nConfirmed still present on main: `Manager.CommitAll` (internal/worktree/worktree.go:387) takes `_ context.Context` and never reads it. Between entry and `wt.Commit` it performs `AddWithOptions{All: true}` and `wt.Commit`, neither of which is context-aware in go-git, so a task cancelled just before the call still mutates the index and HEAD.\n\n## Steps to Reproduce\n\n1. Prepare a task worktree with uncommitted changes.\n2. Create an already-cancelled context: `ctx, cancel := context.WithCancel(context.Background()); cancel()`.\n3. Call `Manager.CommitAll(ctx, dir, \"msg\")`.\n4. Observe it returns `(true, nil)`: the index was staged and a new commit is on HEAD despite the context being cancelled before the call.\n5. In production this leaves a commit on the task branch for work the operator cancelled, which the subsequent push/PR path can then publish.\n\n## Acceptance Criteria\n\nA pre-canceled context causes no index or HEAD mutation; cancellation is checked between non-context-aware go-git phases where possible, with regression tests.\n","acceptance_criteria":"A pre-canceled context causes no index or HEAD mutation; cancellation is checked between non-context-aware go-git phases where possible, with regression tests.","status":"closed","priority":3,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-22T11:01:48Z","created_by":"Sam Catlow","updated_at":"2026-08-24T08:15:48Z","started_at":"2026-08-24T07:42:10Z","closed_at":"2026-08-24T08:15:48Z","close_reason":"Fixed: CommitAll now takes a live context and checks ctx.Err() before open, worktree, staging, status and commit (worktree.go:398-430), so a pre-cancelled context mutates neither index nor HEAD. Proven red against pre-fix code: 'CommitAll() error = nil, want context canceled' for both a cancelled context and an expired deadline. task check green; fresh adversarial review zero findings.","external_ref":"https://github.com/samcharles93/archie-core/issues/603","dependencies":[{"issue_id":"archie-core-1ysw.8","depends_on_id":"archie-core-1ysw","type":"parent-child","created_at":"2026-08-22T21:01:47Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0}