From 71da312f0a0d4472f17bdb0faad565b33017dabb Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Thu, 3 Sep 2026 03:01:30 +1000 Subject: [PATCH] chore(beads): close t2db.11, record t2db.12 lint-tool slice --- .beads/interactions.jsonl | 1 + .beads/issues.jsonl | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.beads/interactions.jsonl b/.beads/interactions.jsonl index 9aaa22088..a74e933f9 100644 --- a/.beads/interactions.jsonl +++ b/.beads/interactions.jsonl @@ -190,3 +190,4 @@ {"id":"int-421fa6d2e329722271b29c6cc06e8aed","kind":"field_change","created_at":"2026-09-02T14:24:02.790015963Z","actor":"Sam Catlow","issue_id":"archie-core-v9gv.3","extra":{"field":"status","new_value":"closed","old_value":"open"}} {"id":"int-3662b2644b20858f97cfe68e35970ee1","kind":"field_change","created_at":"2026-09-02T16:35:43.782983144Z","actor":"Sam Catlow","issue_id":"archie-core-t2db.9","extra":{"field":"status","new_value":"closed","old_value":"in_progress","reason":"kindWorkflows YAML override shipped, task check green"}} {"id":"int-0522bb088937b3f0516dccfa59016dbc","kind":"field_change","created_at":"2026-09-02T16:46:13.808391215Z","actor":"Sam Catlow","issue_id":"archie-core-t2db.10","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Implemented and gate-verified as 93a5f3a (pushed to main)."}} +{"id":"int-782836fd0b2fcbfe670ee2d3ce83eb5a","kind":"field_change","created_at":"2026-09-02T16:57:50.536391547Z","actor":"Sam Catlow","issue_id":"archie-core-t2db.11","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Implemented and gate-verified as 3e7fe00 (pushed to main). PlaybookDirs is a list per ticket correction; cross-source collision rule exercised by new load path."}} diff --git a/.beads/issues.jsonl b/.beads/issues.jsonl index b9caea436..63d2da19a 100644 --- a/.beads/issues.jsonl +++ b/.beads/issues.jsonl @@ -91,8 +91,8 @@ {"_type":"issue","id":"archie-core-g7tm","title":"telegram: finalize the reply through a live context, matching the error branch","description":"The success path calls live.finalize(turnCtx, reply) with the raw cancellable turn context (telegram.go:582), while the error branch two lines above deliberately uses context.WithoutCancel(turnCtx). If /stop lands during finalize, the rich edit, the plain-text retry, and the split-send fallback all abort with context.Canceled (go-telegram/bot builds requests with NewRequestWithContext), so the authoritative reply is never delivered and the live message keeps the ▌ cursor forever. The reply is persisted to the ledger, so the loss is delivery-level — but the user sees a frozen half-answer.\n\nFailure: a long tool-using turn is /stop-ped as it completes; turnCtx is cancelled mid-finalize; every send fails on the dead context; the chat shows the last live frame with a blinking cursor and no final answer.\n\nFound by code-review of PR #476 (feat/467, merged 98e8dda).","design":"live.finalize(context.WithoutCancel(turnCtx), reply) — the one-liner the error branch already uses. Consider making finalize take a live context internally rather than trusting each caller to remember.","acceptance_criteria":"A /stop landing mid-finalize still delivers the authoritative reply and drops the cursor; a test covers the cancellable-context finalize path.","status":"closed","priority":1,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-14T14:43:08Z","created_by":"Sam Catlow","updated_at":"2026-08-14T15:07:36Z","started_at":"2026-08-14T14:53:28Z","closed_at":"2026-08-14T15:03:28Z","close_reason":"Fixed in internal/channels/telegram/live.go and telegram.go: finalize/abandon strip context cancellation before sending (mirroring each other), ToolCall escapes Markdown metacharacters via bot.EscapeMarkdown, splitLongMessage splits on rune boundaries. All new/changed tests verified red-then-green; task check clean; adversarial review pass found no blocking issues.","external_ref":"https://github.com/samcharles93/archie-core/issues/484","labels":["code-review","streaming","telegram"],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-tb3a","title":"Fix streaming review blockers for inline tool calls","description":"Resolve the four evidence-gated findings in merged inline tool-call streaming: preserve the authoritative Telegram reply when final edits fail; keep Telegram network I/O off the model FullStream consumer and cancellable; correlate tool inputs with results and render a bounded redacted parameter summary; snapshot show_tool_calls per live reply to avoid reload races. Add regression tests for every path and run task check plus lint/race validation.","acceptance_criteria":"Regression tests fail on the merged implementation and pass after the fix. Final edit failure falls back to normal split delivery. Delta and ToolCall callbacks do not wait on Telegram HTTP and stop cancels in-flight rendering. Completed tool events include bounded redacted parameters correlated by tool-call ID. Reload cannot race an in-flight reply's show_tool_calls setting. task check passes, golangci-lint reports no new findings, and focused race tests pass.","notes":"Implemented in worktree /tmp/archie-core-tb3a on branch fix/archie-core-tb3a. Added cancellable async Telegram rendering, final edit failure fallback through normal split delivery, call-ID-correlated bounded conservative parameter summaries, atomic per-reply show_tool_calls snapshots, SSE/UI parameter rendering, rebuilt ui/dist, and regression tests. Validation: GOFLAGS=-buildvcs=false task check passed; golangci-lint --new-from-rev=HEAD ./... reported 0 issues; focused race suite passed; fresh adversarial reviewer reported PASS with zero findings. Plain task check is blocked in linked worktrees by Go VCS stamping exit 128, hence buildvcs override.\n2026-08-24 reconciliation: the close reason's 'worktree left uncommitted' is stale. The work did land on main via ba33527 (Merge pull request #477 from samcharles93/fix/archie-core-tb3a); verified on main: gateway/stream.go sensitiveParameterKey+redactToolParameters, telegram/live.go per-reply showToolCalls snapshot, webui/api_chat.go gating. The /tmp/archie-core-tb3a worktree and its branch are gone, as expected.\n","status":"closed","priority":1,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-13T18:05:35Z","created_by":"Sam Catlow","updated_at":"2026-08-24T07:29:09Z","started_at":"2026-08-13T18:05:39Z","closed_at":"2026-08-13T18:35:26Z","close_reason":"Completed and independently reviewed; worktree left uncommitted per conservative repository policy.","external_ref":"https://github.com/samcharles93/archie-core/issues/485","dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-dzx","title":"Remove duplicate archie-agent safe.directory setup","description":"## Problem\\ncmd/archie-agent/main.go configures git safe.directory inline and then calls markWorktreeSafe, so startup writes the same global git configuration twice.\\n\\n## Scope\\nKeep markWorktreeSafe as the single tested production path and remove the older inline exec.Command block/import. Add regression coverage proving startup wiring has exactly one authoritative safe-directory call.\\n\\n## Acceptance\\n- archie-agent startup invokes markWorktreeSafe exactly once\\n- no second inline safe.directory command remains in main.go\\n- cmd/archie-agent tests and repository quality gate pass","acceptance_criteria":"Single tested safe.directory setup path remains; duplicate inline command is removed; tests and task check pass","notes":"Red proof: TestMainConfiguresWorktreeSafetyOnce failed with 2 setup paths before implementation. Green proof: go test/vet/build ./cmd/archie-agent/... passed; golangci-lint --new-from-rev=HEAD reported 0 issues. Fresh adversarial review found no blockers. Full task check was not run because the working tree contains unrelated in-progress changes and task check rewrites files; scoped package gate used per repository protocol.","status":"closed","priority":1,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-13T16:10:09Z","created_by":"Sam Catlow","updated_at":"2026-08-13T16:13:48Z","started_at":"2026-08-13T16:10:24Z","closed_at":"2026-08-13T16:13:48Z","close_reason":"Removed duplicate inline safe.directory setup; markWorktreeSafe is now the single tested production path","external_ref":"https://github.com/samcharles93/archie-core/issues/470","dependency_count":0,"dependent_count":0,"comment_count":0} -{"_type":"issue","id":"archie-core-t2db.12","title":"workflow: CI lint for playbook directory collisions","description":"Fourth slice of docs/prds/eda-playbook-engine.md. The design doc's collision handling has two layers: a linter for pre-merge, same-tree collisions, and the runtime detect-log-report path for cross-source collisions only visible at daemon startup (t2db.9/.10/.11). Only the runtime path exists so far. This ticket adds the CI/dev-time linter half, so most collisions never reach the runtime path at all -- matching the doc's own stated intent that the startup path should be rare in practice, not routine.\n\nDepends on archie-core-t2db.11 (multiple playbook directories) landing first, since a linter checking one directory in isolation can't demonstrate the cross-directory case the doc cares about -- though it should also catch within-a-single-directory duplicates, which is the more common real case.","design":"Reuse the exact validation LoadKindWorkflowsYAML/LoadLabelWorkflowsYAML (and t2db.11's directory merge) already perform -- do not write a second, parallel validation path. The linter is a thin CLI entrypoint (likely a Taskfile target, e.g. 'task lint:playbooks') that calls the same loader functions against a configured or path-argument set of directories and reports load errors in a lint-friendly format (file:line-ish, or at minimum file+key), exiting non-zero on any collision. No new schema or validation logic -- this ticket is packaging existing validation as a pre-merge check, not writing new rules.","acceptance_criteria":"A Taskfile target (or equivalent) runs the linter against one or more playbook directories and exits non-zero with a clear message when two files bind the same label/kind. Exits 0 cleanly on a valid set of directories. Reuses LoadKindWorkflowsYAML/LoadLabelWorkflowsYAML/the t2db.11 merge logic directly -- no duplicated validation rules. Documented in RELEASING.md or Taskfile.yml comments so it's discoverable. task check passes (the new lint target does not need to be part of task check itself unless that's the natural integration point -- decide during implementation, not a hard requirement here).","status":"open","priority":2,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-09-02T16:56:44Z","created_by":"Sam Catlow","updated_at":"2026-09-02T16:56:44Z","dependencies":[{"issue_id":"archie-core-t2db.12","depends_on_id":"archie-core-t2db","type":"parent-child","created_at":"2026-09-02T16:56:44Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0} -{"_type":"issue","id":"archie-core-t2db.11","title":"workflow: generalize routing/label files to multiple playbook directories","description":"Third slice of docs/prds/eda-playbook-engine.md, completing open question #2. Generalizes the single-file workflow_routing_file / workflow_labels_file config fields (t2db.9, t2db.10) into a LIST of configured playbook directories, loaded at daemon startup alongside the existing single-file fields for backward compatibility. This is what makes the design doc's collision-handling rule (drop + log + report to caller, no auto-arbitration) load-bearing: a single file has nothing to collide with, so the rule has never actually been exercised in production code yet.\n\nCorrected 2026-09-03 (Sam): must be a list of directories, not one directory -- a single playbook_dir field would contradict supporting multiple independently-maintained playbook sources, which the PRD's own Dedup section already assumes ('independently-sourced playbook directories collide'). Scope directories by the existing Repo (owner/name) concept already in Config.Repos, NOT by org/tenant -- org-keying would require an auth/identity model archie does not have yet. That is a separate, later decision, not something to half-build here.","design":"Follow the existing once-at-startup lifecycle (SetKindWorkflows/SetLabelWorkflows pattern) rather than inventing new state management. Config gains a list field (e.g. PlaybookDirs []string, or a PlaybookDir field on the existing Repo struct if directories should tie to a specific configured repo rather than being globally pooled -- decide based on whether playbooks are meant to be repo-scoped or operator-global). A loader reads every *.yaml file across all configured directories, applying the same per-file validation LoadLabelWorkflowsYAML already does, then merges bindings across all sources -- a binding for the same label/kind declared by two different sources is the collision case: drop both, log which sources/label collided, return the error to the caller (do not start the daemon on a routing collision). Single-file fields (workflow_routing_file, workflow_labels_file) remain supported unchanged as an additional, independent input alongside the directory list, not replaced by it.","acceptance_criteria":"Config supports a LIST of playbook directories (not a single path), empty/unset by default (no behavior change for existing configs). Loading two directories with a colliding label binding is a reported load failure, not a silent pick-one. Loading multiple non-colliding directories merges cleanly and Route() honours the merged bindings. Existing workflow_routing_file/workflow_labels_file continue to work unchanged when no directories are configured. Org/tenant scoping is explicitly out of scope and not attempted. task check passes.","status":"open","priority":2,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-09-02T16:50:18Z","created_by":"Sam Catlow","updated_at":"2026-09-02T16:53:35Z","dependencies":[{"issue_id":"archie-core-t2db.11","depends_on_id":"archie-core-t2db","type":"parent-child","created_at":"2026-09-02T16:50:18Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0} +{"_type":"issue","id":"archie-core-t2db.12","title":"workflow: standalone playbook lint/LSP tool (gopls-shaped)","description":"Fourth slice of docs/prds/eda-playbook-engine.md. The design doc's collision handling has two layers: a linter for pre-merge, same-tree collisions, and the runtime detect-log-report path for cross-source collisions only visible at daemon startup (t2db.9/.10/.11). Only the runtime path exists so far.\n\nCorrected 2026-09-03 (Sam): not a Taskfile target wrapping existing functions -- a small standalone CLI binary shaped like gopls: one tool, multiple invocation modes. A one-shot 'lint' mode ships in this ticket; the design doc's LSP requirement (author-time hover/completion/inline errors) is a later mode of the SAME binary, not a separate tool, so the two can never validate a playbook YAML differently -- one schema source, one binary, two entrypoints into it (matches gopls's own check-vs-serve split).\n\nDepends on archie-core-t2db.11 (multiple playbook directories) landing first, since a linter checking one directory in isolation can't demonstrate the cross-directory case the doc cares about -- though it should also catch within-a-single-directory duplicates, which is the more common real case.","design":"New cmd/\u003cname\u003e binary (e.g. cmd/archie-playbooks), per organisation.md's cmd/ rule: CLI flag parsing and entry-point routing only, no domain wiring in cmd/ itself. Actual validation logic stays in internal/domain/workflow (reuse LoadKindWorkflowsYAML/LoadLabelWorkflowsYAML/t2db.11's directory merge directly -- no second, parallel validation path). This ticket implements only the lint subcommand/mode; structure the binary's command dispatch so an 'lsp'/'serve' subcommand can be added later without restructuring (e.g. a small subcommand table from the start, even with one entry), matching gopls's shape rather than assuming a single-purpose CLI that gets bolted onto later.","acceptance_criteria":"A new cmd/ binary exists with a lint subcommand/mode that runs against one or more playbook directories and exits non-zero with a clear message when two files bind the same label/kind; exits 0 cleanly on a valid set. Reuses existing loader/merge logic directly -- no duplicated validation rules. Binary's command structure has an explicit seam for adding an LSP/serve mode later (does not need to be built yet). Documented (README or Taskfile.yml comment) so it's discoverable. task check passes.","status":"open","priority":2,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-09-02T16:56:44Z","created_by":"Sam Catlow","updated_at":"2026-09-02T16:58:38Z","dependencies":[{"issue_id":"archie-core-t2db.12","depends_on_id":"archie-core-t2db","type":"parent-child","created_at":"2026-09-02T16:56:44Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0} +{"_type":"issue","id":"archie-core-t2db.11","title":"workflow: generalize routing/label files to multiple playbook directories","description":"Third slice of docs/prds/eda-playbook-engine.md, completing open question #2. Generalizes the single-file workflow_routing_file / workflow_labels_file config fields (t2db.9, t2db.10) into a LIST of configured playbook directories, loaded at daemon startup alongside the existing single-file fields for backward compatibility. This is what makes the design doc's collision-handling rule (drop + log + report to caller, no auto-arbitration) load-bearing: a single file has nothing to collide with, so the rule has never actually been exercised in production code yet.\n\nCorrected 2026-09-03 (Sam): must be a list of directories, not one directory -- a single playbook_dir field would contradict supporting multiple independently-maintained playbook sources, which the PRD's own Dedup section already assumes ('independently-sourced playbook directories collide'). Scope directories by the existing Repo (owner/name) concept already in Config.Repos, NOT by org/tenant -- org-keying would require an auth/identity model archie does not have yet. That is a separate, later decision, not something to half-build here.","design":"Follow the existing once-at-startup lifecycle (SetKindWorkflows/SetLabelWorkflows pattern) rather than inventing new state management. Config gains a list field (e.g. PlaybookDirs []string, or a PlaybookDir field on the existing Repo struct if directories should tie to a specific configured repo rather than being globally pooled -- decide based on whether playbooks are meant to be repo-scoped or operator-global). A loader reads every *.yaml file across all configured directories, applying the same per-file validation LoadLabelWorkflowsYAML already does, then merges bindings across all sources -- a binding for the same label/kind declared by two different sources is the collision case: drop both, log which sources/label collided, return the error to the caller (do not start the daemon on a routing collision). Single-file fields (workflow_routing_file, workflow_labels_file) remain supported unchanged as an additional, independent input alongside the directory list, not replaced by it.","acceptance_criteria":"Config supports a LIST of playbook directories (not a single path), empty/unset by default (no behavior change for existing configs). Loading two directories with a colliding label binding is a reported load failure, not a silent pick-one. Loading multiple non-colliding directories merges cleanly and Route() honours the merged bindings. Existing workflow_routing_file/workflow_labels_file continue to work unchanged when no directories are configured. Org/tenant scoping is explicitly out of scope and not attempted. task check passes.","status":"closed","priority":2,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-09-02T16:50:18Z","created_by":"Sam Catlow","updated_at":"2026-09-02T16:57:50Z","closed_at":"2026-09-02T16:57:50Z","close_reason":"Implemented and gate-verified as 3e7fe00 (pushed to main). PlaybookDirs is a list per ticket correction; cross-source collision rule exercised by new load path.","dependencies":[{"issue_id":"archie-core-t2db.11","depends_on_id":"archie-core-t2db","type":"parent-child","created_at":"2026-09-02T16:50:18Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-t2db.10","title":"feat(workflow): route arbitrary forge labels to workflows via playbook YAML","description":"Second slice of docs/prds/eda-playbook-engine.md, complementing the kind-\u003eworkflow layer (WorkflowRoutingFile): the label vocabulary itself becomes playbook data. A label outside the closed bug/feature/bootstrap kind set (e.g. security) dispatches to a registered workflow from an optional WorkflowLabelsFile, instead of falling through to triage.\n\n- LabelWorkflows + LoadLabelWorkflowsYAML/SetLabelWorkflows in internal/domain/workflow/routing.go, mirroring the kind layer's once-at-startup lifecycle. The closed Kind/NATS-subject set is untouched; the map only extends binding authority for labels the kind layer does not own.\n- Collision rule per design doc: a label owned by the kind set, an empty label, an empty workflow name, or a duplicate binding is a reported load failure (dropped, logged, error returned to the caller) -- the schema defines what is accepted; nothing is silently arbitrated by schema/version.\n- Route() precedence: explicit t.Workflow -\u003e arbitrary-label binding -\u003e kind binding -\u003e triage -\u003e implement -\u003e default.\n- Config: WorkflowLabelsFile (workflow_labels_file), wired at boot alongside WorkflowRoutingFile; documented in config.example.toml.\n- PRD: records this slice's decisions (single-file shape, collision rule, precedence) so later slices stay anchored.\n\nCommitted as 93a5f3a and pushed to main.","design":"Follows the EDA playbook engine design doc (docs/prds/eda-playbook-engine.md). Open question 2 (config field shape) partially resolved: single file (workflow_labels_file) mirroring WorkflowRoutingFile and SkillsDir's single-path precedent; a directory remains open and larger. Data-flow/condition syntax (Q1), mid-run failure semantics and idempotency (design gaps 1-2) are explicitly out of this slice's scope per the PRD phasing -- they land with Module/Channel/Forge action kinds.","acceptance_criteria":"1. An issue labelled with an arbitrary label (not bug/feature/bootstrap) routes to the workflow bound in workflow_labels_file.\n2. No workflow_labels_file configured: kind-only routing unchanged (backward compatible).\n3. Colliding/empty/kind-owned labels in the file produce a reported load error, not silent arbitration.\n4. Route() precedence: explicit t.Workflow \u003e arbitrary-label binding \u003e kind binding \u003e triage \u003e implement \u003e default.\n5. task check is green; tests cover dispatch, collision, empties, nil-restore, and precedence.","status":"closed","priority":2,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-09-02T16:45:33Z","created_by":"Sam Catlow","updated_at":"2026-09-02T16:46:28Z","closed_at":"2026-09-02T16:46:14Z","close_reason":"Implemented and gate-verified as 93a5f3a (pushed to main).","external_ref":"https://github.com/samcharles93/archie-core/issues/701","dependencies":[{"issue_id":"archie-core-t2db.10","depends_on_id":"archie-core-t2db","type":"parent-child","created_at":"2026-09-02T16:45:33Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-t2db.9","title":"workflow: make kind-to-workflow routing YAML-overridable","description":"First slice of the EDA playbook engine (docs/prds/eda-playbook-engine.md): make workflow/routing.go's kindWorkflows map overridable from an optional YAML file, so which workflow runs for an intake Kind is data instead of a Go literal. labelKinds/NATS subjects are explicitly out of scope for this slice (closed subject-per-kind question deferred).","acceptance_criteria":"Route() accepts an optional KindWorkflows override; a YAML file with the same shape as the built-in map overrides it; absent file/nil override falls back to today's hardcoded defaults unchanged; config gains an optional path field; task check passes.","status":"closed","priority":2,"issue_type":"task","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-09-02T16:32:45Z","created_by":"Sam Catlow","updated_at":"2026-09-02T16:46:28Z","started_at":"2026-09-02T16:32:50Z","closed_at":"2026-09-02T16:35:44Z","close_reason":"kindWorkflows YAML override shipped, task check green","external_ref":"https://github.com/samcharles93/archie-core/issues/702","dependencies":[{"issue_id":"archie-core-t2db.9","depends_on_id":"archie-core-t2db","type":"parent-child","created_at":"2026-09-02T16:32:45Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-v9gv.2","title":"Refactor hyperscript el() usage to Preact JSX","status":"closed","priority":2,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-09-02T13:37:19Z","created_by":"Sam Catlow","updated_at":"2026-09-02T14:56:07Z","closed_at":"2026-09-02T14:24:02Z","external_ref":"https://github.com/samcharles93/archie-core/issues/683","dependencies":[{"issue_id":"archie-core-v9gv.2","depends_on_id":"archie-core-v9gv","type":"parent-child","created_at":"2026-09-02T13:37:19Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0}