diff --git a/.beads/issues.jsonl b/.beads/issues.jsonl index 96be0511c..186aef39b 100644 --- a/.beads/issues.jsonl +++ b/.beads/issues.jsonl @@ -54,7 +54,7 @@ {"_type":"issue","id":"archie-core-1787489595508-2-98c4b849","title":"Playbook binding: matcher + mapping + workflow, editable at runtime","description":"The object that ties it together. A binding is: a matcher (which inbound events does this apply to), a mapping (which fields the workflow receives), and a target agentic workflow.\n\nRuntime-editable is the whole point -- creating or changing a binding must not require a redeploy or a daemon restart. That has real consequences the design must face:\n\n- Bindings are persisted state, not config. They live in the store, not config.toml, because operators create them from the UI while the daemon runs.\n- They need versioning. A binding that starts a task should record WHICH version ran, or a later edit makes historical task provenance a lie.\n- Matcher ambiguity needs a defined resolution: two bindings matching one event either both run, or the more specific wins, or it is an error. Pick one and say so.\n- A binding referencing a workflow that no longer exists must fail visibly at bind time, not at 3am when the event arrives.","status":"closed","priority":1,"issue_type":"feature","created_at":"2026-08-23T12:22:09Z","updated_at":"2026-08-23T22:39:29Z","closed_at":"2026-08-23T22:39:29Z","close_reason":"Duplicate; work tracked under canonical epic","external_ref":"https://github.com/samcharles93/archie-core/issues/565","source_system":"github:https://github.com/samcharles93/archie-core/issues/565:565","metadata":null,"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-1ysw.3","title":"Clean abandoned untracked files on retry","description":"Prepare refresh hard-resets tracked files but retains untracked files; CommitAll later stages and publishes them during the next attempt.","acceptance_criteria":"A regression test proves an untracked file left by an interrupted attempt is absent after retry and cannot appear in ChangedFiles or the next commit; deliberate .git control files remain intact.","status":"closed","priority":1,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-22T11:01:44Z","created_by":"Sam Catlow","updated_at":"2026-08-24T03:11:49Z","started_at":"2026-08-22T11:47:47Z","closed_at":"2026-08-24T03:11:49Z","close_reason":"Retry cleaning was implemented in 0522fb7 (reset + cleanUntracked, covered by TestPrepareRecoversFromADirtyWorktreeOnRetry). Remaining defect fixed in 037ee7c: SkipDir on a .git gitdir *file* aborted the whole walk, so cleaning silently no-opped for linked/adopted worktrees. Regression test TestCleanUntrackedHandlesGitdirFile.","external_ref":"https://github.com/samcharles93/archie-core/issues/591","metadata":null,"dependencies":[{"issue_id":"archie-core-1ysw.3","depends_on_id":"archie-core-1ysw","type":"parent-child","created_at":"2026-08-22T21:01:44Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-1ysw.2","title":"Make worktree directory keys collision-free","description":"Manager.Dir flattens owner and repo with a hyphen, so distinct repositories such as a-b/c and a/b-c share a task directory for equal issue numbers.","acceptance_criteria":"Distinct owner/repo tuples always map to distinct contained paths; sequential and concurrent collision regressions cannot reuse, delete, reset, or push the other repository's clone.","status":"closed","priority":1,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-22T11:01:43Z","created_by":"Sam Catlow","updated_at":"2026-08-24T06:59:58Z","started_at":"2026-08-22T11:44:35Z","closed_at":"2026-08-24T06:59:58Z","close_reason":"Fixed on main: Manager.Dir base64url-encodes owner and repo as separate path components (worktree.go:66-70), so a-b/c and a/b-c no longer collide. legacyDir+migrateLegacy migrate old flattened dirs only on exact origin match. Package tests pass.","external_ref":"https://github.com/samcharles93/archie-core/issues/592","metadata":null,"dependencies":[{"issue_id":"archie-core-1ysw.2","depends_on_id":"archie-core-1ysw","type":"parent-child","created_at":"2026-08-22T21:01:43Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0} -{"_type":"issue","id":"archie-core-t2db.4","title":"Playbook binding: matcher + mapping + workflow, editable at runtime","description":"The object that ties it together. A binding is: a matcher (which inbound events does this apply to), a mapping (which fields the workflow receives), and a target agentic workflow.\n\nRuntime-editable is the whole point -- creating or changing a binding must not require a redeploy or a daemon restart. That has real consequences the design must face:\n\n- Bindings are persisted state, not config. They live in the store, not config.toml, because operators create them from the UI while the daemon runs.\n- They need versioning. A binding that starts a task should record WHICH version ran, or a later edit makes historical task provenance a lie.\n- Matcher ambiguity needs a defined resolution: two bindings matching one event either both run, or the more specific wins, or it is an error. Pick one and say so.\n- A binding referencing a workflow that no longer exists must fail visibly at bind time, not at 3am when the event arrives.","acceptance_criteria":"A binding can be created, edited and disabled from the UI while the daemon runs; a task records the binding version that started it; overlapping matchers resolve by a defined and documented rule; a binding naming a missing workflow is rejected when saved.","notes":"2026-08-22: the draft -\u003e pending_approval -\u003e armed state machine from t2db.5's decision belongs to the binding entity this bead defines, not to a shared package -- 7d5u.3 was narrowed to exclude it since there is exactly one consumer today. Implement the state transitions here.","status":"open","priority":1,"issue_type":"feature","owner":"sam@catlow.tech","created_at":"2026-08-21T13:45:45Z","created_by":"Sam Catlow","updated_at":"2026-08-22T09:25:02Z","external_ref":"https://github.com/samcharles93/archie-core/issues/537","dependencies":[{"issue_id":"archie-core-t2db.4","depends_on_id":"archie-core-t2db","type":"parent-child","created_at":"2026-08-21T23:45:45Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-t2db.4","depends_on_id":"archie-core-t2db.3","type":"blocks","created_at":"2026-08-21T23:45:53Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-t2db.4","depends_on_id":"archie-core-t2db.5","type":"blocks","created_at":"2026-08-21T23:45:53Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":2,"dependent_count":1,"comment_count":0} +{"_type":"issue","id":"archie-core-t2db.4","title":"Playbook binding: matcher + mapping + workflow, editable at runtime","description":"The object that ties it together. A binding is: a matcher (which inbound events does this apply to), a mapping (which fields the workflow receives), and a target agentic workflow.\n\nRuntime-editable is the whole point -- creating or changing a binding must not require a redeploy or a daemon restart. That has real consequences the design must face:\n\n- Bindings are persisted state, not config. They live in the store, not config.toml, because operators create them from the UI while the daemon runs.\n- They need versioning. A binding that starts a task should record WHICH version ran, or a later edit makes historical task provenance a lie.\n- Matcher ambiguity needs a defined resolution: two bindings matching one event either both run, or the more specific wins, or it is an error. Pick one and say so.\n- A binding referencing a workflow that no longer exists must fail visibly at bind time, not at 3am when the event arrives.","acceptance_criteria":"A binding can be created, edited and disabled from the UI while the daemon runs; a task records the binding version that started it; overlapping matchers resolve by a defined and documented rule; a binding naming a missing workflow is rejected when saved.","notes":"2026-08-22: the draft -\u003e pending_approval -\u003e armed state machine from t2db.5's decision belongs to the binding entity this bead defines, not to a shared package -- 7d5u.3 was narrowed to exclude it since there is exactly one consumer today. Implement the state transitions here.","status":"in_progress","priority":1,"issue_type":"feature","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-21T13:45:45Z","created_by":"Sam Catlow","updated_at":"2026-09-02T12:22:48Z","started_at":"2026-09-02T12:22:48Z","lease_expires_at":"2026-09-02T12:27:48Z","heartbeat_at":"2026-09-02T12:22:48Z","external_ref":"https://github.com/samcharles93/archie-core/issues/537","dependencies":[{"issue_id":"archie-core-t2db.4","depends_on_id":"archie-core-t2db","type":"parent-child","created_at":"2026-08-21T23:45:45Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-t2db.4","depends_on_id":"archie-core-t2db.3","type":"blocks","created_at":"2026-08-21T23:45:53Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-t2db.4","depends_on_id":"archie-core-t2db.5","type":"blocks","created_at":"2026-08-21T23:45:53Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":2,"dependent_count":1,"comment_count":0} {"_type":"issue","id":"archie-core-t2db.1","title":"Capture inbound events archie does not yet understand","description":"The precondition for everything else. Today an unrecognised inbound request is rejected; for schema-by-example it must be RECORDED, because you cannot map a payload you have never seen.\n\nAccept, store and retain inbound events with no binding: raw body, headers, source, arrival time, and the identity that sent it. Retention must be bounded -- an open capture endpoint is an unbounded disk write, and this is exactly the kind of surface an attacker fills.\n\nStrong argument for NATS JetStream as the store rather than the in-process events.Bus: durable, replayable, retention-bounded natively, already deployed. Note the constraint though -- internal/infrastructure/eventbus/nats/doc.go states 'when no NATS URL is configured the daemon uses its local SQLite claim flow instead; nothing here is required for single-process operation'. NATS is currently OPTIONAL. Decide deliberately whether capture requires it (making this feature unavailable in single-process deployments) or degrades to SQLite, and record which -- do not let it become a hard dependency by accident.","acceptance_criteria":"An unbound webhook POST is captured and visible rather than rejected; capture is retention-bounded with a documented limit; the single-process (no NATS) behaviour is a deliberate, recorded decision; capture cannot exhaust disk.","notes":"2026-08-22: capture-storage ownership confirmed here (not in 7d5u.3, which was narrowed to storage-agnostic HMAC/rate-limit/redaction mechanics only). This bead's capture path should call webhookguard's redaction before persisting and its rate limiter at the HTTP boundary, but owns its own storage engine and the NATS-vs-SQLite decision.","status":"closed","priority":1,"issue_type":"feature","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-21T13:45:18Z","created_by":"Sam Catlow","updated_at":"2026-08-22T09:25:03Z","started_at":"2026-08-21T16:18:24Z","closed_at":"2026-08-21T18:51:09Z","close_reason":"Built capture storage + endpoint: docs/prds/event-capture-storage.md decides SQLite over NATS JetStream (NATS not unconditionally available pre-7d5u.2, capture's single-writer/single-reader access pattern doesn't need JetStream fan-out/replay). internal/store/captures.go adds captured_events table + InsertCapture (prune-on-write by retention age and row count) + ListCaptures. internal/webui/api_capture.go adds POST /webhooks/capture/{source}, unauthenticated (bypasses requireToken like /healthz), applying webhookguard redaction before persisting and a per-remote-address rate limit + hard body-size cap before that. New [capture] config section with documented defaults. Adversarial self-review (the usual fresh subagent pass hit a session API limit mid-run, so this was a manual re-read with the same checklist) caught and fixed three real bugs before landing: (1) body-size cap silently unenforced when unset -- added a hardcoded fallback floor since it's the only bound on a SINGLE payload's size; (2) rate limiter was keyed by the request's own unregistered source path segment, violating webhookguard.RateLimiter's documented bounded-key-space assumption -- an attacker could rotate the segment to bypass the limit and grow the bucket map unbounded; rekeyed to remote address; (3) retention prune used time.RFC3339Nano, whose variable-width trimmed fractional seconds break lexicographic string comparison in `WHERE received_at \u003c ?` (an exact-second timestamp can sort after a later fractional one) -- switched to fixed-width RFC3339. All three have regression tests verified to fail against the pre-fix code. task check clean, golangci-lint zero new findings repo-wide.","external_ref":"https://github.com/samcharles93/archie-core/issues/538","dependencies":[{"issue_id":"archie-core-t2db.1","depends_on_id":"archie-core-7d5u.4","type":"relates-to","created_at":"2026-08-22T01:01:02Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-t2db.1","depends_on_id":"archie-core-t2db","type":"parent-child","created_at":"2026-08-21T23:45:17Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":2,"comment_count":0} {"_type":"issue","id":"archie-core-t2db.2","title":"Event inspector: see real inbound payloads in the dashboard","description":"The operator-facing half of capture. A live view of recent inbound events: source, arrival time, and the actual payload, pretty-printed and explorable.\n\nThis is the screen that makes the feature feel like magic: you hit 'send test webhook' in the other app, alt-tab to archie, and the event is sitting there. Latency from arrival to visible matters more than it looks -- it is the difference between a design loop and a guessing game.\n\nShow unbound events prominently. An event nothing is listening to is not noise here, it is the queue of integrations waiting to be built.","acceptance_criteria":"Recent inbound events are listed with source, time and full payload; unbound events are distinguishable from bound ones; a newly arrived event appears without a manual refresh; payloads are explorable rather than a wall of text.","status":"closed","priority":1,"issue_type":"feature","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-21T13:45:18Z","created_by":"Sam Catlow","updated_at":"2026-08-22T09:25:04Z","started_at":"2026-08-21T18:57:52Z","closed_at":"2026-08-21T19:17:03Z","close_reason":"GET /api/captures (token-gated, memory/skills-style enabled:false-not-an-error when Captures is nil) plus a new /captures dashboard page: recent captures newest-first, expandable per-row to explore redacted payload/headers pretty-printed. Live updates reuse the existing operator-activity event pipeline (Server.emit -\u003e Events.Publish -\u003e the /events SSE stream) as an invalidation signal, refetching the list rather than merging partial event data. Every row shows an 'Unbound' pill today since no binding model exists yet (t2db.4 wires the real distinction). Frontend follows the tasks/task-row.js precedent: row rendering split into capture-row.js for unit testing without the page's fetch/SSE wiring. Adversarial review (fresh subagent, full pass) found one real severe bug before merge: the live SSE event was embedding the full (up to 256KiB) redacted body/headers into the events table, which has no retention/row-count prune anywhere in the codebase -- silently defeating t2db.1's disk-bound guarantee for an unauthenticated, only-rate-limited endpoint. Fixed: the live event now carries just {id, source} as a pure invalidation signal; the dashboard refetches the authoritative list. Two smaller findings (untested Data[\"id\"] field the frontend's dedup depended on; a received_at precision mismatch between live and REST-fetched copies) were resolved as a side effect of that fix. task check clean, golangci-lint zero new findings.","external_ref":"https://github.com/samcharles93/archie-core/issues/539","dependencies":[{"issue_id":"archie-core-t2db.2","depends_on_id":"archie-core-t2db","type":"parent-child","created_at":"2026-08-21T23:45:17Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-t2db.2","depends_on_id":"archie-core-t2db.1","type":"blocks","created_at":"2026-08-21T23:45:53Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":1,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-t2db.3","title":"Map payload fields by example, from a real captured event","description":"Pick a captured event, click through its payload, and bind JSON paths to named fields the workflow will receive. Schema by example, not schema by specification.\n\nThe hard part is not the happy path, it is drift. A mapping authored against one payload will eventually meet a payload where the path is missing, null, or a different type -- the sending app shipped a change nobody told you about. That must fail LOUDLY and land somewhere the operator sees, not silently pass an empty string into an agent prompt. An agent handed a blank field will confabulate around it, which turns a schema change into an agent doing confident nonsense in a repo.\n\nSupport a preview: given this mapping and this captured event, show exactly what the workflow would receive. Never ship a mapping the operator has not seen resolve against real data.","acceptance_criteria":"Fields are mappable from a captured payload without writing code; a mapping preview resolves against a real event before saving; a missing, null or type-changed path at runtime produces a visible failure rather than an empty value; the failure names the path and the event.","status":"closed","priority":1,"issue_type":"feature","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-21T13:45:18Z","created_by":"Sam Catlow","updated_at":"2026-08-22T09:25:05Z","started_at":"2026-08-22T08:39:40Z","closed_at":"2026-08-22T09:01:53Z","close_reason":"Payload field mapping: domain (internal/domain/mapping), SQLite store (internal/store/mappings.go), HTTP API (internal/webui/api_mapping.go), and dashboard editor (ui/src/mappings) shipped. PRD at docs/prds/payload-field-mapping.md. task check green; adversarial review found 4 issues (stale preview after rename, duplicate field names, hardcoded capture scan window, malformed path silently reinterpreted), all fixed and re-verified.","external_ref":"https://github.com/samcharles93/archie-core/issues/540","dependencies":[{"issue_id":"archie-core-t2db.3","depends_on_id":"archie-core-t2db","type":"parent-child","created_at":"2026-08-21T23:45:18Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-t2db.3","depends_on_id":"archie-core-t2db.1","type":"blocks","created_at":"2026-08-21T23:45:53Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":1,"dependent_count":1,"comment_count":0} @@ -91,7 +91,9 @@ {"_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-b6ew.4","title":"Structured configuration editors: repositories, maps","description":"Repositories currently render as a static read-only table missing AllowConcurrent, MaxRetries, and ReviewEnabled entirely (ReviewEnabled is absent from RepoView in api_config.go, not just unrendered). Add ReviewEnabled to RepoView, and build a dedicated backend-defined editor for the repositories section (and the models/providers maps) so these stop being silently read-only. This is the concrete fix for the allow_concurrent discoverability gap Sam hit, delivered as a typed editor rather than a one-off card patch, since the schema this epic introduces is what should own its shape.","status":"open","priority":2,"issue_type":"feature","owner":"sam@catlow.tech","created_at":"2026-09-02T12:00:46Z","created_by":"Sam Catlow","updated_at":"2026-09-02T12:00:46Z","dependencies":[{"issue_id":"archie-core-b6ew.4","depends_on_id":"archie-core-b6ew","type":"parent-child","created_at":"2026-09-02T12:00:46Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-b6ew.4","depends_on_id":"archie-core-b6ew.2","type":"blocks","created_at":"2026-09-02T12:00:51Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":1,"dependent_count":1,"comment_count":0} +{"_type":"issue","id":"archie-core-b6ew.6","title":"Inline editing for per-repo config fields (allow_concurrent, max_retries, review_enabled)","description":"archie-core-b6ew.4 shipped visibility for AllowConcurrent, MaxRetries, and ReviewEnabled on the repositories card (read-only), which was the concrete discoverability gap Sam hit. Actual inline editing was scoped out of that issue because it hits a real backend limitation discovered while implementing it: the dashboard's PATCH /api/config path (installUpdateConfigHandler in internal/app/archied/bootstrap.go) applies dotted-key updates via overlay.Nest + configuration.ApplyOverlayValues, and overlay.Nest (internal/infrastructure/configuration/overlay/overlay.go:162) only builds nested maps by splitting on '.' -- it has no array-index handling, so a key like 'repos.0.allow_concurrent' cannot be expressed, and Repos is a []config.Repo slice, not a map, so ApplyOverlayValues's YAML-merge-onto-struct approach cannot target one element either.\n\nThis needs either: (a) a dedicated repo-update seam (e.g. a webui handler keyed by owner/name that reads-modifies-writes the Repos slice directly, bypassing the generic dotted-overlay path), or (b) extending overlay.Nest/ApplyOverlayValues to support array indices generically, which is broader-reaching (touches every list-shaped config field, not just Repos) and needs its own design decision about whether index-based overlay keys are stable across a file edit that reorders [[repos]] entries. Option (a) is almost certainly the smaller, safer change -- decide in a short design note before implementing, per this repo's settled-design-first rule, since option (b) has real footguns (index stability) that deserve a deliberate answer, not a guess.","status":"open","priority":2,"issue_type":"feature","owner":"sam@catlow.tech","created_at":"2026-09-02T12:22:53Z","created_by":"Sam Catlow","updated_at":"2026-09-02T12:22:53Z","dependencies":[{"issue_id":"archie-core-b6ew.6","depends_on_id":"archie-core-b6ew","type":"parent-child","created_at":"2026-09-02T12:22:53Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0} +{"_type":"issue","id":"archie-core-c0y4","title":"TelegramConfig gains a bws-capable Token (SecretRef), not just TokenEnv","description":"internal/config/config.go's TelegramConfig only has TokenEnv (a plain OS env var name); it never resolves through secret.Registry the way Forge.Token and Provider.APIKey do (secret.SecretRef{engine,key}), per ARCHITECTURE.md:220-224's own note that TelegramConfig.TokenEnv is one of the older env-only fields kept for backwards compatibility. internal/app/archied/telegram_setup.go:75 does a bare os.Getenv(cfg.Chat.Telegram.TokenEnv), bypassing the secret registry entirely.\n\nThis means a bws-stored Telegram token cannot be referenced directly in config.toml the way [providers.openai].api_key or [forge.token] already can -- the operator has to bridge it into a real process env var by hand (bws secret get ... | export ARCHIE_TELEGRAM_TOKEN=...) instead of writing [chat.telegram.token] = { engine = \"bws\", key = \"...\" }.\n\nFix: add a Token secret.SecretRef field to TelegramConfig, mirroring Forge.Token's shape and resolution path. Keep TokenEnv working as a fallback/legacy path (same pattern documented for Provider.APIKeyEnv vs APIKey) rather than a breaking config change -- resolve Token first if set, fall back to TokenEnv. Update config.example.toml and docs/architecture identity/config docs to show the SecretRef form as the preferred one.","status":"open","priority":2,"issue_type":"feature","owner":"sam@catlow.tech","created_at":"2026-09-02T12:21:10Z","created_by":"Sam Catlow","updated_at":"2026-09-02T12:21:10Z","dependency_count":0,"dependent_count":0,"comment_count":0} +{"_type":"issue","id":"archie-core-b6ew.4","title":"Structured configuration editors: repositories, maps","description":"Repositories currently render as a static read-only table missing AllowConcurrent, MaxRetries, and ReviewEnabled entirely (ReviewEnabled is absent from RepoView in api_config.go, not just unrendered). Add ReviewEnabled to RepoView, and build a dedicated backend-defined editor for the repositories section (and the models/providers maps) so these stop being silently read-only. This is the concrete fix for the allow_concurrent discoverability gap Sam hit, delivered as a typed editor rather than a one-off card patch, since the schema this epic introduces is what should own its shape.","status":"closed","priority":2,"issue_type":"feature","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-09-02T12:00:46Z","created_by":"Sam Catlow","updated_at":"2026-09-02T12:23:52Z","started_at":"2026-09-02T12:21:13Z","closed_at":"2026-09-02T12:23:52Z","close_reason":"Scoped to visibility, not full inline editing -- while implementing, found that the dashboard's PATCH /api/config path (overlay.Nest + configuration.ApplyOverlayValues) has no array-index support, so a per-element update to the Repos slice cannot be expressed as a dotted key today. That's real, separate scope, filed as archie-core-b6ew.6 rather than bolted on.\n\nShipped: RepoView.ReviewEnabled (previously absent from the API entirely, not just unrendered) alongside AllowConcurrent and MaxRetries; the repositories card now shows Concurrent/Max retries/Self-review columns as read-only pills, closing the concrete discoverability gap (Sam couldn't see allow_concurrent without an agent tracing Go source). config.example.toml documents review_enabled, which was undocumented before this. Go test pins ReviewEnabled reaching ConfigView for both a configured and a zero-value repo.","dependencies":[{"issue_id":"archie-core-b6ew.4","depends_on_id":"archie-core-b6ew","type":"parent-child","created_at":"2026-09-02T12:00:46Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-b6ew.4","depends_on_id":"archie-core-b6ew.2","type":"blocks","created_at":"2026-09-02T12:00:51Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":1,"dependent_count":1,"comment_count":0} {"_type":"issue","id":"archie-core-b6ew.5","title":"Schema contract tests: metadata completeness and secret-safety","description":"Assert every field the schema exposes carries type, label, and section; assert restart_required and editable are set deliberately (not zero-value defaults hiding an unreviewed field); assert secrets still never appear (extend the existing TestHandleConfigNeverLeaksSecrets pattern to the schema response); assert the frontend's generic renderer can render the full schema fixture without any field-specific branch (a JS test walking the schema and asserting no field key appears literally in settings.js).","status":"open","priority":2,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-09-02T12:00:46Z","created_by":"Sam Catlow","updated_at":"2026-09-02T12:00:46Z","dependencies":[{"issue_id":"archie-core-b6ew.5","depends_on_id":"archie-core-b6ew","type":"parent-child","created_at":"2026-09-02T12:00:46Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-b6ew.5","depends_on_id":"archie-core-b6ew.3","type":"blocks","created_at":"2026-09-02T12:00:52Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-b6ew.5","depends_on_id":"archie-core-b6ew.4","type":"blocks","created_at":"2026-09-02T12:00:52Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":2,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-b6ew.3","title":"Generic frontend renderer for scalar configuration fields","description":"Replace settings.js's hardcoded row(...) calls for scalar/bool/int/enum/duration fields with a renderer that walks the backend's sections/fields schema and builds the section cards, labels, and edit affordances from the descriptor alone -- the frontend must not know that containers.max_concurrency is an int or which card it belongs in. Structured fields (repositories, models, providers maps) are out of scope here and keep their existing bespoke rendering, tagged type=structured so the generic renderer skips them without special-casing each key.","status":"closed","priority":2,"issue_type":"feature","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-09-02T12:00:45Z","created_by":"Sam Catlow","updated_at":"2026-09-02T12:12:41Z","started_at":"2026-09-02T12:08:25Z","closed_at":"2026-09-02T12:12:41Z","close_reason":"settings.js renders identity/budgets/storage/web cards generically from cfg.schema sections (schemaCards()), replacing identityCard/budgetsCard/storageCard/webCard/pullPolicyLabel -- label, type, description, editability, and options all come from the backend descriptor. config-row.js gained enum edit support (select from opts.options), an editable:false branch distinct from locked rows, and a hint tooltip carrying the field's description. Structured sections (repositories, models \u0026 providers) are unaffected -- still rendered by their existing bespoke functions, reserved for b6ew.4. Not visually verified in a live browser (needs a full daemon+forge+NATS stack); verified via unit tests mirroring the existing config-row.test.js patterns and Go contract tests.","dependencies":[{"issue_id":"archie-core-b6ew.3","depends_on_id":"archie-core-b6ew","type":"parent-child","created_at":"2026-09-02T12:00:45Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-b6ew.3","depends_on_id":"archie-core-b6ew.2","type":"blocks","created_at":"2026-09-02T12:00:50Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":1,"dependent_count":1,"comment_count":0} {"_type":"issue","id":"archie-core-b6ew.1","title":"Backend configuration schema contract: field descriptor types and section metadata","description":"Define the descriptor types (Section, Field, Option) in internal/webui alongside ConfigView -- Key, Label, Description, Section, Type (string|int|bool|duration|enum|structured), Editable, LockedReason, Overridden, Options, RestartRequired. Hand-author one descriptor per existing ConfigView field, grouped into the sections the settings page already renders (identity, repositories, models, providers, budgets, storage, containers, web). No reflection over config.Config -- config.Config is scheduled for dissolution (internal/config/config.go package doc) and every field here is already a deliberate allowlist entry, so this is metadata on fields that already passed the secret-safety allowlist, not a new safety boundary.","status":"closed","priority":2,"issue_type":"feature","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-09-02T12:00:44Z","created_by":"Sam Catlow","updated_at":"2026-09-02T12:05:40Z","started_at":"2026-09-02T12:02:40Z","closed_at":"2026-09-02T12:05:40Z","close_reason":"Added internal/webui/config_schema.go: ConfigFieldType/ConfigField/ConfigSection descriptor types and configFieldDescriptors(), hand-authoring key/label/type/editable/restart_required for every field ConfigView exposes today, grouped into the sections settings.js already renders. RestartRequired sourced from internal/app/archied/reload.go's reloadableFields/reloadableSubFields allowlist. Contract tests pin key completeness, structured-field non-editability, and locked-storage-field non-editability. Not yet wired into GET /api/config -- that's b6ew.2.","dependencies":[{"issue_id":"archie-core-b6ew.1","depends_on_id":"archie-core-b6ew","type":"parent-child","created_at":"2026-09-02T12:00:44Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":1,"comment_count":0} diff --git a/config.example.toml b/config.example.toml index 9e00f5c39..852dbda13 100644 --- a/config.example.toml +++ b/config.example.toml @@ -316,6 +316,9 @@ gate_max_failures = 5 # # [containers].max_concurrency globally. # # persistent_storage = true # reuse a per-repo Docker volume and Git object cache until volume_ttl # # max_retries = 5 # per-repo override of the global max_retries above +# # review_enabled = true # run a fresh adversarial reviewer (no path to the implementer's +# # context) after gates pass and before the PR opens. Default false -- +# # an uncalibrated reviewer that cries wolf is worse than no review. # ── Tools ─────────────────────────────────────────────────────────────────── # Limits on what a tool may return. These bound how much of the context window diff --git a/internal/webui/api_config.go b/internal/webui/api_config.go index 15f1b94dc..e4683eb3f 100644 --- a/internal/webui/api_config.go +++ b/internal/webui/api_config.go @@ -258,6 +258,7 @@ type RepoView struct { PersistentStorage bool `json:"persistent_storage"` AllowConcurrent bool `json:"allow_concurrent"` MaxRetries int `json:"max_retries"` + ReviewEnabled bool `json:"review_enabled"` } // ProviderView is an LLM provider's shape, never its key. APIKeyEnv is the @@ -475,6 +476,7 @@ func reposView(repos []config.Repo) []RepoView { PersistentStorage: r.PersistentStorage, AllowConcurrent: r.AllowConcurrent, MaxRetries: r.MaxRetries, + ReviewEnabled: r.ReviewEnabled, }) } return out diff --git a/internal/webui/api_config_test.go b/internal/webui/api_config_test.go index 2a99e342d..9756e943c 100644 --- a/internal/webui/api_config_test.go +++ b/internal/webui/api_config_test.go @@ -256,6 +256,40 @@ func TestHandleConfigReportsLockedKeys(t *testing.T) { } } +// TestHandleConfigRepoViewIncludesReviewEnabled proves Repo.ReviewEnabled +// reaches the dashboard alongside AllowConcurrent and MaxRetries -- +// previously it was absent from RepoView entirely, not merely unrendered +// (archie-core-b6ew.4). +func TestHandleConfigRepoViewIncludesReviewEnabled(t *testing.T) { + srv := newTestServer(t) + srv.Cfg = config.NewHolder(config.Config{ + Repos: []config.Repo{ + {Owner: "acme", Name: "widget", Base: "main", AllowConcurrent: true, MaxRetries: 3, ReviewEnabled: true}, + {Owner: "acme", Name: "gadget", Base: "main"}, + }, + }) + + req := httptest.NewRequestWithContext(t.Context(), http.MethodGet, "/api/config", nil) + w := httptest.NewRecorder() + srv.Handler().ServeHTTP(w, req) + + var got ConfigView + if err := json.Unmarshal(w.Body.Bytes(), &got); err != nil { + t.Fatalf("decode: %v", err) + } + if len(got.Repositories) != 2 { + t.Fatalf("Repositories = %+v, want 2", got.Repositories) + } + widget := got.Repositories[0] + if !widget.AllowConcurrent || widget.MaxRetries != 3 || !widget.ReviewEnabled { + t.Errorf("widget = %+v, want AllowConcurrent=true MaxRetries=3 ReviewEnabled=true", widget) + } + gadget := got.Repositories[1] + if gadget.AllowConcurrent || gadget.MaxRetries != 0 || gadget.ReviewEnabled { + t.Errorf("gadget = %+v, want all repo-tuning fields at their zero value", gadget) + } +} + // TestHandleConfigIncludesSchemaWithLiveValues proves the schema (archie-core-b6ew.2) // carries the same values as the flat ConfigView fields it is built from, // not a stale or empty catalog. diff --git a/ui/src/settings/settings.js b/ui/src/settings/settings.js index 6cb2f6621..69855de35 100644 --- a/ui/src/settings/settings.js +++ b/ui/src/settings/settings.js @@ -233,14 +233,21 @@ function repositoriesCard(repos) { } return section( "Repositories", - "Each repository Archie polls, and the quality gate a change must pass before it opens a pull request.", + "Each repository Archie polls, and the quality gate a change must pass before it opens a pull request. " + + "Concurrent tasks, retries, and self-review are set per repository in config.toml -- read-only here " + + "until archie-core-b6ew.4's follow-up gives them an inline editor.", el( "div.table-scroll", el( "table.table", el( "thead", - el("tr", ...["Repository", "Base branch", "Ecosystem", "Quality gate", "Protected paths"].map((h) => el("th", h))), + el( + "tr", + ...["Repository", "Base branch", "Ecosystem", "Quality gate", "Protected paths", "Concurrent", "Max retries", "Self-review"].map((h) => + el("th", h), + ), + ), ), el( "tbody", @@ -252,6 +259,9 @@ function repositoriesCard(repos) { el("td", r.ecosystem || "go"), el("td.mono", gateSummary(r.gate)), el("td.mono", r.protect?.length ? r.protect.join(", ") : "—"), + el("td", boolPill(r.allow_concurrent)), + el("td.mono", String(r.max_retries ?? 0)), + el("td", boolPill(r.review_enabled)), ), ), ), @@ -260,6 +270,13 @@ function repositoriesCard(repos) { ); } +// boolPill renders a config flag as the same pill used elsewhere on this +// page (e.g. provider credential status), so "on"/"off" reads consistently +// with the rest of the dashboard rather than as raw true/false text. +function boolPill(value) { + return value ? pill("on", "ok") : pill("off", "idle"); +} + function gateSummary(gate) { if (!gate?.length) return "—"; return gate.map((cmd) => cmd.join(" ")).join(" → ");