Edit the binding filter in the canvas bind panel #145
Notifications
Due Date
No due date set.
Blocks
Reference: sam/archie#145
Reference in new issue
Block a user
Goal
BindEvent edits the CEL filter and shows whether the selected capture is admitted.
Evidence
ui/src/workflows/BindEvent.vue passes the existing filter through with no field.
Rules
Read CLAUDE.md. Do only what the Goal and Stop when need. File anything else you notice as a bead; do not fix it. Run
task checkonce at the end; if it fails twice on the same problem, comment on this bead and stop.Stop when
Then commit (Conventional Commits, scoped by package),
bd closethis bead and stop.Imported from beads
archie-core-bdb5.13· GitHub #1374 · type feature · priority P3 · created 2026-10-05archie's PRD is ready -- awaiting your go/no-go.
PRD — Edit the binding filter in the canvas bind panel (issue #145)
Problem
The canvas Start node's bind panel (
WorkflowEditor.vue:495→TriggerSettings.vue:31→ui/src/workflows/BindEvent.vue) round-trips the binding filter untouched (BindEvent.vue:221:filter: props.binding?.filter ?? ""). There is no filter field and no whole-binding verdict — only per-field resolve results. Dispatch compiles the filter and records"filtered"on exclusion (internal/daemon/daemon.go:644-651); binding save refuses one that does not compile (internal/webui/bindings.go:362). So an operator editing from the canvas saves blind. "Shows whether the selected capture is admitted" is not UI-only: CEL evaluation exists only server-side (internal/domain/binding/filter.go:23,51);ui/package.jsonhas no CEL library.Proposed solution
Extend the existing preview route rather than add one.
internal/webui/mappings.go:mappingPreviewRequest(:234) gainsFilter string \json:"filter"`;handleMappingPreview(:239) runsbinding.CompileFilter(req.Filter, req.Fields)after the existingmapping.Resolve. Compile error → 200 withfilter_error(inline while typing, not 400); compiles → 200 withadmittedfromf.Admits(values)`. Filter empty → neither key, response unchanged. Evaluation errors mean excluded, as at dispatch.ui/src/lib/api.ts:386:mappingPreview(captureId, fields, filter = "").ui/src/mappings/state.ts:62:Previewgainsadmitted?: boolean,filter_error?: string.ui/src/workflows/BindEvent.vue:filterref frombinding.filter; the watch (:133) becomes[fields, captureId, filter](existing 250 ms debounce covers typing); the!fields.value.lengthhalf of the early return (:135) goes; staleness becomes a generation counter instead ofid === captureId.value(:142); a Filter section after Inputs with the destructiveAlertforfilter_errorand onetext-ok/text-warnline for admitted/excluded;blockersgains a compile blocker so Save is disabled whilefilter_erroris set (save()PATCHes the mapping before the binding, so a refused filter would leave the mapping rewritten);save()sendsfilter.value.trim().e2e/checks/workflow-bind-filter.cjs: new check driving new source + posted capture →pr-review(only shipped workflow with declared inputs) → filterpr_number > 100(Excluded) →< 100(Admitted) → typo (compile error, Save disabled) → save → assert trigger row andGET /api/bindingscarries the filter → delete infinally.Acceptance criteria
Preview accepts optional
filterand returnsadmitted/filter_error/ unchanged shape; semantics identical to dispatch (same function, same field list, same values); filter field shown and saved; verdict within ~250 ms, distinct admitted/excluded states, inline compile message, nothing when empty; no stale response overwrites a newer one; Save disabled while the filter does not compile; no console/page error andtask checkpluspnpm run typecheckpass; the Playwright check passes againsttask e2e:up.Non-goals
No verdict in the
/bindingsdialog (BindingEditor.vue:200-209, separate bead); no client-side CEL, new dependency, new endpoint, or change to dispatch/internal/domain/binding; no fix for filter-only parameters being unreachable; no preservation of filter-only mapping fields; no header-based filters.Files and estimated diff
internal/webui/mappings.go~15,ui/src/lib/api.ts~3,ui/src/mappings/state.ts~4,ui/src/workflows/BindEvent.vue~35,e2e/checks/workflow-bind-filter.cjs~55 → ~110 lines. Right at AGENTS.md's "past about 100 lines, stop and assess" line; assessed — a new endpoint or client CEL is larger and duplicates server semantics.Known limitations to file as beads
mappingFields(bind-event.ts:34) rebuilds the mapping from declared inputs plus the repository path andsave()PATCHes it, so a binding like the seedede2e-binding(fieldtitle, workflowfeasibilitywith no inputs) failsCompileFilterat save. The new field at least names it before Save.mapping.Mapping.Validaterefuses it./bindingsdialog.Risks
Preview is a filter verdict, not a dispatch simulation — it does not check
m.EventTypeID == c.EventType; accept and note in a handler comment. The e2e check cannot reuse the seededissue-openedtype (schema from its example lacksissue.number), hence a fresh source and capture. Add a### archie-uiline under## [Unreleased]inCHANGELOG.md(newsgen skips Unreleased, sodocs/newsstays untouched). Two commits scoped by package (feat(webui),feat(ui)),task checkonce, thenbd close.Verification
Read this run:
BindEvent.vue,bind-event.ts,bindings/binding-draft.ts,BindingEditor.vue,mappings/state.ts,workflow-triggers.ts,TriggerSettings.vue,internal/webui/mappings.go,bindings.go,authorization_surfaces_test.go,internal/domain/binding/{filter,binding,inputs}.go,internal/domain/mapping/mapping.go,internal/domain/eventtype/eventtype.go,daemon.go:590-807,e2e/{README.md,seed.sh,run.cjs},e2e/checks/org-schedule-trigger.cjs,pr-review.yaml,Taskfile.yml,Newsgensources,ui/package.json, AGENTS.md/CLAUDE.md. Not verified: exact cel-go error strings, the two limitation chains by execution, and whether Node/pnpm/Chromium exist here (preflight reported only Go 1.27.3;e2e/node_modulesabsent), so the Playwright stop-condition may not be producible in this environment.Decide in chat or on the dashboard.
Closed: goes against the product plan in epic #1977. Bindings are replaced by triggers (#1978), and the canvas becomes a place to review and inspect rather than the main authoring path.