From 17ea3c48079c70cb607aea88c19f0e27c0093395 Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Fri, 28 Aug 2026 22:24:49 +1000 Subject: [PATCH] chore: beads interactions and issues --- .beads/interactions.jsonl | 1 + .beads/issues.jsonl | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.beads/interactions.jsonl b/.beads/interactions.jsonl index 760e8aece..ad6b85583 100644 --- a/.beads/interactions.jsonl +++ b/.beads/interactions.jsonl @@ -139,3 +139,4 @@ {"id":"int-ff379eca588df2a11fc3bf5121a7cc18","kind":"field_change","created_at":"2026-08-25T15:05:25.362400545Z","actor":"Sam Catlow","issue_id":"archie-core-440c","extra":{"field":"status","new_value":"closed","old_value":"in_progress","reason":"Shipped in 16f9456: explicitly configured trusted forwarded headers drive effective Origin validation, with direct/proxied/spoofed regression coverage; included in archied v1.18.0."}} {"id":"int-d61ab877d6ab666df299085a52ca1c75","kind":"field_change","created_at":"2026-08-25T16:02:24.011512716Z","actor":"Sam Catlow","issue_id":"archie-core-vq92","extra":{"field":"status","new_value":"closed","old_value":"in_progress","reason":"task_logs cursor pagination, level/time filters, and honest truncation reporting"}} {"id":"int-6578329d076c7da3806f4c446f2dfe20","kind":"field_change","created_at":"2026-08-27T14:31:41.48495579Z","actor":"Sam Catlow","issue_id":"archie-core-1786637489932-6-1f803e02","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Wired GET /api/curators (names, health, last-run, recent actions) backed by a new bounded in-memory activity tracker in internal/domain/curator, plus a Curators dashboard page at ui/src/curators/."}} +{"id":"int-ca5043a35866779a1ff6969afe4b98d3","kind":"field_change","created_at":"2026-08-28T10:59:18.865497151Z","actor":"Sam Catlow","issue_id":"archie-core-1786637496320-249-be6d9a20.1","extra":{"field":"status","new_value":"closed","old_value":"in_progress","reason":"Slice 1 of cron/scheduling epic landed: per-profile JSON store with cross-process flock, merge-semantic Update, version-stamped schema, ErrCorruptFile on truncated files, ErrUnsupportedSchema on forward versions. Implements scheduling.JobSource so the ticker engine can poll it without knowing the file layout. Adversarial review applied: deep-copy Get/List, pool validation in Create/Update, ErrScheduleUnsupported on Once MarkRun, 0o600 file mode, SetEscapeHTML(false) for operator-readable files, fsync before rename for durability, ErrClosed sentinel after Close, real cross-process flock test via os/exec. task check green."}} diff --git a/.beads/issues.jsonl b/.beads/issues.jsonl index 0d36e44a4..979301a13 100644 --- a/.beads/issues.jsonl +++ b/.beads/issues.jsonl @@ -83,7 +83,7 @@ {"_type":"issue","id":"archie-core-1786637496320-249-be6d9a20.4","title":"Cron lifecycle guard: reject dangerous commands at job creation","description":"Slice 4 of the cron/scheduling epic (archie-core-1786637496320-249-be6d9a20). The epic's third acceptance criterion verbatim: 'Dangerous commands are rejected at creation time.'\n\nGuards both runners from the previous slice: ChatCourier (whose body could include shell-shaped payloads) and WorkflowTask (whose shell-step is a documented footgun). Rejection happens at job creation, not at tick time, so a refused job is visible in the store with a refusal reason and never reaches the ticker engine.","acceptance_criteria":"- Rejects job specs whose target body includes any of: `archied` restart, `systemctl`, `launchctl`, `pkill`, `mkfs`, `dd`, `shutdown`, `reboot`.\n- Rejection reason is recorded on the refused job and surfaced through the gateway / dashboard; the job is not written to the store.\n- One named rejection function both the CLI and gateway paths call, so adding a new dangerous token does not require touching every UI surface.\n- False positives are deliberate — the list over-broadens then narrows by operator feedback. Cost of accepting a dangerous command vastly exceeds the cost of a refused one.","status":"open","priority":2,"issue_type":"feature","owner":"sam@catlow.tech","created_at":"2026-08-27T14:34:40Z","created_by":"Sam Catlow","updated_at":"2026-08-27T14:34:40Z","labels":["enhancement"],"dependencies":[{"issue_id":"archie-core-1786637496320-249-be6d9a20.4","depends_on_id":"archie-core-1786637496320-249-be6d9a20","type":"parent-child","created_at":"2026-08-27T14:34:40Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-1786637496320-249-be6d9a20.4","depends_on_id":"archie-core-1786637496320-249-be6d9a20.1","type":"blocks","created_at":"2026-08-27T14:35:44Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":1,"dependent_count":1,"comment_count":0} {"_type":"issue","id":"archie-core-1786637496320-249-be6d9a20.3","title":"Cron blueprints: parameterised templates with typed slots and form schemas","description":"Slice 3 of the cron/scheduling epic (archie-core-1786637496320-249-be6d9a20). The authoring surface: predefined templates with typed slots (time, enum, text, weekdays — each with their validators) that gate the gateway and CLI creation forms.\n\nDaily status summary is the headline blueprint. An author without a blueprint can still create a job directly, but the gateway form is the recommended surface for non-trivial jobs.","acceptance_criteria":"- A small registry of built-in blueprints (daily-status-summary at minimum; weekday-pickable and time-pickable are sufficient for headline coverage) exposed to gateway and CLI form renderers.\n- Typed slot definitions (`time`, `enum`, `text`, `weekdays`) with a generated form schema suitable for the gateway chat-form surface.\n- Template renderer fills slots from a validated values map; missing or wrong-typed slots reject the job at creation, not at next tick.\n- Adding a new blueprint is data, not code, and the gateway / CLI form reflect added blueprints without a rebuild.","status":"open","priority":2,"issue_type":"feature","owner":"sam@catlow.tech","created_at":"2026-08-27T14:34:38Z","created_by":"Sam Catlow","updated_at":"2026-08-27T14:34:38Z","labels":["enhancement"],"dependencies":[{"issue_id":"archie-core-1786637496320-249-be6d9a20.3","depends_on_id":"archie-core-1786637496320-249-be6d9a20","type":"parent-child","created_at":"2026-08-27T14:34:38Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-1786637496320-249-be6d9a20.3","depends_on_id":"archie-core-1786637496320-249-be6d9a20.1","type":"blocks","created_at":"2026-08-27T14:35:42Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":1,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-1786637496320-249-be6d9a20.2","title":"Cron delivery runner + router: dispatch due jobs to chat/task targets","description":"Slice 2 of the cron/scheduling epic (archie-core-1786637496320-249-be6d9a20). Implements `scheduling.Runner` and the router that picks one runner per job kind.\n\nWithout this slice, the ticker engine has no work to dispatch. Concrete target types to ship: ChatCourier (sends a templated message through the existing channel-agnostic `channels.Channel` gateway, so the channel choice stays the operator's, not the cron's) and WorkflowTask (submits a `workintake` envelope so the existing task lifecycle owns scheduling, retries, gates, and PR opening).\n\nJob store is a hard prerequisite. Composition wiring and lifecycle guard block the wiring slice, not this one.","acceptance_criteria":"- At least two `Runner` implementations: `ChatCourier` (renders the job's templated body through the channel layer) and `WorkflowTask` (submits a `workintake` envelope carrying the cron identity and body so the existing workflow domain runs the rest).\n- A `Router` that maps `Job.Kind` to a Runner; an unrecognised kind emits `KindJobError` `phase=\"dispatch\"` and is otherwise a no-op — refused at the gate, not silently dropped.\n- Every Runner honours `ctx.Done()` so the engine's bounded shutdown actually drains in flight.\n- The epic's headline scenario ('daily status summary') is exercisable end-to-end through the ChatCourier runner with a hard-coded template; the blueprints slice replaces this with parameterisation.","status":"open","priority":2,"issue_type":"feature","owner":"sam@catlow.tech","created_at":"2026-08-27T14:34:35Z","created_by":"Sam Catlow","updated_at":"2026-08-27T14:34:35Z","labels":["enhancement"],"dependencies":[{"issue_id":"archie-core-1786637496320-249-be6d9a20.2","depends_on_id":"archie-core-1786637496320-249-be6d9a20","type":"parent-child","created_at":"2026-08-27T14:34:35Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-1786637496320-249-be6d9a20.2","depends_on_id":"archie-core-1786637496320-249-be6d9a20.1","type":"blocks","created_at":"2026-08-27T14:35:43Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":1,"dependent_count":1,"comment_count":0} -{"_type":"issue","id":"archie-core-1786637496320-249-be6d9a20.1","title":"Cron job store: per-profile JSON with cross-process file locking","description":"Slice 1 of the cron/scheduling epic (archie-core-1786637496320-249-be6d9a20). Implements the durable job store: one JSON file per profile at the conventional path, CRUD operations, and cross-process file locking so a CLI edit and a daemon writer don't corrupt each other.\n\nThe ticker engine (internal/domain/scheduling) consumes this through its `JobSource` interface. The store's only contract with the engine is `Due(ctx, now) -\u003e ([]Job, error)` — the engine applies no schedule arithmetic of its own, so the store owns cron expressions, fixed intervals, and catch-up windows.","acceptance_criteria":"- One JSON file at the conventional per-profile path (`\u003cconfig_dir\u003e/cron/jobs.json` or equivalent). Schema is durable and version-stamped for forward compatibility.\n- Create / read / update / delete by job ID with merge semantics that preserve fields not in the patch.\n- Cross-process file lock (`flock` or OS equivalent) makes concurrent CLI+daemon writers serial; last-writer-wins is documented as the conflict policy.\n- Implements `scheduling.JobSource` so the ticker engine can poll it without knowing the file layout or format.\n- A truncated/partial-write file is not a panic: open returns an explicit error the engine surfaces as `phase=\"source\" KindJobError` rather than crashing the loop.","status":"in_progress","priority":2,"issue_type":"feature","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-27T14:34:32Z","created_by":"Sam Catlow","updated_at":"2026-08-28T10:36:06Z","started_at":"2026-08-28T10:36:06Z","lease_expires_at":"2026-08-28T10:41:06Z","heartbeat_at":"2026-08-28T10:36:06Z","labels":["enhancement"],"dependencies":[{"issue_id":"archie-core-1786637496320-249-be6d9a20.1","depends_on_id":"archie-core-1786637496320-249-be6d9a20","type":"parent-child","created_at":"2026-08-27T14:34:32Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":4,"comment_count":0} +{"_type":"issue","id":"archie-core-1786637496320-249-be6d9a20.1","title":"Cron job store: per-profile JSON with cross-process file locking","description":"Slice 1 of the cron/scheduling epic (archie-core-1786637496320-249-be6d9a20). Implements the durable job store: one JSON file per profile at the conventional path, CRUD operations, and cross-process file locking so a CLI edit and a daemon writer don't corrupt each other.\n\nThe ticker engine (internal/domain/scheduling) consumes this through its `JobSource` interface. The store's only contract with the engine is `Due(ctx, now) -\u003e ([]Job, error)` — the engine applies no schedule arithmetic of its own, so the store owns cron expressions, fixed intervals, and catch-up windows.","acceptance_criteria":"- One JSON file at the conventional per-profile path (`\u003cconfig_dir\u003e/cron/jobs.json` or equivalent). Schema is durable and version-stamped for forward compatibility.\n- Create / read / update / delete by job ID with merge semantics that preserve fields not in the patch.\n- Cross-process file lock (`flock` or OS equivalent) makes concurrent CLI+daemon writers serial; last-writer-wins is documented as the conflict policy.\n- Implements `scheduling.JobSource` so the ticker engine can poll it without knowing the file layout or format.\n- A truncated/partial-write file is not a panic: open returns an explicit error the engine surfaces as `phase=\"source\" KindJobError` rather than crashing the loop.","status":"closed","priority":2,"issue_type":"feature","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-27T14:34:32Z","created_by":"Sam Catlow","updated_at":"2026-08-28T10:59:19Z","started_at":"2026-08-28T10:36:06Z","closed_at":"2026-08-28T10:59:19Z","close_reason":"Slice 1 of cron/scheduling epic landed: per-profile JSON store with cross-process flock, merge-semantic Update, version-stamped schema, ErrCorruptFile on truncated files, ErrUnsupportedSchema on forward versions. Implements scheduling.JobSource so the ticker engine can poll it without knowing the file layout. Adversarial review applied: deep-copy Get/List, pool validation in Create/Update, ErrScheduleUnsupported on Once MarkRun, 0o600 file mode, SetEscapeHTML(false) for operator-readable files, fsync before rename for durability, ErrClosed sentinel after Close, real cross-process flock test via os/exec. task check green.","labels":["enhancement"],"dependencies":[{"issue_id":"archie-core-1786637496320-249-be6d9a20.1","depends_on_id":"archie-core-1786637496320-249-be6d9a20","type":"parent-child","created_at":"2026-08-27T14:34:32Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":4,"comment_count":0} {"_type":"issue","id":"archie-core-h019.8","title":"Operator-triggered PR review with selectable reviewer model","description":"Expose the reviewer as a channel-neutral application capability that can review an existing pull request on operator request. The Web UI should offer a Review PR action as one adapter; chat/Telegram and future channels must invoke the same command rather than duplicating review behavior. The operator can configure or select the reviewer model independently from planner/builder models. Reuse the reviewer epic's fresh-context, read-only snapshot, structured findings, calibration, and visibility contracts.","acceptance_criteria":"A channel-neutral review command accepts a repository and PR identity, launches the approved isolated reviewer path, and returns/persists structured findings; Web UI exposes Review PR; at least one non-Web-UI channel can invoke the same command; reviewer model is configurable independently with a safe default; authorization and duplicate/concurrent review behavior are deterministic; findings and review status are visible without requiring raw logs.","status":"open","priority":2,"issue_type":"feature","owner":"sam@catlow.tech","created_at":"2026-08-24T18:08:58Z","created_by":"Sam Catlow","updated_at":"2026-08-24T18:09:03Z","external_ref":"https://github.com/samcharles93/archie-core/issues/636","dependencies":[{"issue_id":"archie-core-h019.8","depends_on_id":"archie-core-h019","type":"parent-child","created_at":"2026-08-24T18:08:58Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-atv2","title":"liveReply fallback lines appended after finalize are never rendered","description":"A media delivery that fails AFTER doFinalize has run appends its fallback line to l.toolLines and calls requestRender(), but stopRendering() has already closed renderDone and the renderer goroutine has exited. requestRender is a non-blocking send into a cap-1 channel with no consumer, so the line is dropped and the finalized Telegram message stands unchanged.\n\nMedia is fire-and-forget with a 30s budget while the turn's text finishes far earlier, so this is the NORMAL case for a large upload: a 40MB document that 400s or times out reports 'could not send x' into a slice nothing reads. Pre-dates the local-file work (URL fallbacks have the same hole) but archie-core-absb's guarantee that non-delivery is always visible depends on it.\n\nFound by adversarial review of 9a45fbb. internal/channels/telegram/live.go:419-437 with :498-532.\n\n## Acceptance Criteria\nA media failure occurring after the live reply has finalized still reaches the user -- e.g. as its own follow-up message rather than an edit to a message nothing re-renders. Covered by a test that finalizes first and fails the send second.","status":"open","priority":2,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-24T15:54:42Z","created_by":"Sam Catlow","updated_at":"2026-08-24T19:49:41Z","external_ref":"https://github.com/samcharles93/archie-core/issues/646","dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-h3lg","title":"Dashboard swallows failed operator actions, showing nothing in the UI","description":"When an operator action fails, the dashboard surfaces nothing. Pressing Stop on a running task issued POST /api/tasks/3/action, received 403, and the only evidence anywhere was a browser console line: \"Failed to load resource: the server responded with a status of 403\". The page itself showed no error, no toast, no change of state -- the button simply appeared to do nothing.\n\nThis is how archie-core-440c (every dashboard mutation 403s behind a TLS-terminating reverse proxy) went unnoticed: the operator pressed Stop, saw nothing happen, and reasonably concluded the task was unstoppable rather than that the request had been refused. The bug was only found by opening devtools.\n\nConfirmed live 2026-08-25 while signed in to the production dashboard.\n\n## Why this is its own bead\n\n440c fixes the 403. This bead fixes the fact that ANY failed action is invisible -- a 500, a store failure, a refused state transition, an expired session -- and each of those has its own way of going wrong. Fixing only 440c leaves the next failure equally silent.\n\nNote internal/webui/api_tasks.go already returns distinguishable, human-readable failures (\"missing CSRF header\", \"cross-origin mutation refused\", \"runtime task control is unavailable\"). The server side is doing its job; the client discards it.\n\n## What is needed\n\n- A failed action tells the operator it failed, in the UI, with the server's reason where one is given.\n- The distinction that matters most: refused (403, bad state, not permitted) versus broken (5xx, network). The operator's next move differs -- the first is \"you cannot do that\", the second is \"try again or check the daemon\".\n- A 401 or an expired forward-auth session should prompt re-authentication rather than reading as a generic failure, since the deployment sits behind Authelia.\n- The optimistic UI must not show an action as applied when it was refused.\n\nPer CLAUDE.md the frontend is one folder per feature under ui/src/\u003cfeature\u003e with shared primitives in ui/src/base -- error surfacing used by more than one feature belongs in base, extracted on the SECOND real consumer, not in anticipation. Remember ui/dist is committed: run `task ui` and commit the rebuilt output in the same change.\n\n## Steps to Reproduce\n\n1. Load the dashboard in a deployment where mutations fail (any 440c-affected proxied deployment reproduces it directly).\n2. Press Stop, Retry, Abandon or Archive on a task.\n3. Observe the request fails in devtools while the page reports nothing.\n\n## Acceptance Criteria\n\nA failed operator action is reported in the dashboard with the server's reason where supplied; refused and broken failures are distinguishable to the operator; an authentication failure prompts re-auth rather than a generic error; no optimistic state change survives a failed request; dashboard tests cover a refused action, a server error and a network failure; ui/dist is rebuilt and committed.\n","status":"open","priority":2,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-24T15:49:18Z","created_by":"Sam Catlow","updated_at":"2026-08-24T15:50:15Z","external_ref":"https://github.com/samcharles93/archie-core/issues/629","dependency_count":0,"dependent_count":0,"comment_count":0}