Skip to content

feat(automation): add subtask, comment, notify and link nodes; list ops, dynamic values, new triggers - #713

Merged
pikann merged 5 commits into
masterfrom
feature/enhance-automation-node-feature
Nov 8, 2026
Merged

pikann merged 5 commits into
masterfrom
feature/enhance-automation-node-feature

Conversation

@pikann

@pikann pikann commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Extends the automation engine so common "keep the hierarchy in sync" rules can be built without custom code: close a parent when all its subtasks are done, create subtasks named after the parent when it is created, comment/notify/link on events, and react to more kinds of change.

What's new

Actions

  • create_task: creates a subtask of the target with any task field, templated title/description/custom fields, dynamic values and an optional link to the parent. Idempotent per parent + title; the created task carries origin=automation, so it never re-fires task_created.
  • update_task: tags and assignees can be replaced, added to or removed from (tags_mode / assignees_mode), fields can be cleared (clear), and values can be computed at run time (dynamic: copy from the triggering task, its parent, or today +/- N days).
  • add_comment: posts an automation-authored comment.
  • notify: in-app notification to assignees / reporter / the parent's assignees / named members. Adds an automation notification type and a message column (migration 000081), shown in the notification bell.
  • link_task: links the target to another task (blocks, is_blocked_by, relates_to, duplicates, is_duplicated_by). Existing links are a no-op.

Triggers

field_changed (sprint, dates, title, points, reporter, type, parent, description, custom fields), comment_added, link_added, attachment_added, and child_changed (runs on the parent when a subtask is created or enters a status).

Conditions and targets

  • New siblings target ("all other subtasks of my parent"), so "all siblings done, then close the parent" is one rule.
  • New child_count condition field.
  • Relative date values (now, now+3d, now-1d), so a rule can mean "overdue".
  • Number values entered as text now compare correctly (previously a story_points condition could never match).

UI

  • Field rows get a per-field "how to apply" control (set / add / remove / clear / copy from task / copy from parent / today).
  • Add Action and Add Trigger menus are grouped; forms for all new nodes; all 9 locales.
  • Switching a condition branch's field now clears the old field's value (fixes the task-type value dropdown not showing).

MCP tool docs and the bundled paca-automation skill are updated to match.

Safety / behavior notes

  • Automation-originated events are still skipped by the consumer, so automations never trigger automations. add_comment + comment_added and create_task + task_created do not loop (covered by e2e).
  • notify is deduplicated per recipient.
  • The notifier is wired on the concrete service only (not the Service interface), so existing mocks are unaffected.

Test plan

  • Go unit tests: domain conditions, automation service validation, worker actions / create_task / consumer
  • 16 new Go e2e tests (real Postgres + Valkey + engine) in automation_engine_new_nodes_test.go; the full TestE2EAutomation* suite passes
  • Web component tests for the node config panel (8) and notification bell; i18n parity test
  • Playwright spec apps/e2e/tests/projects/automation-nodes.spec.ts is added but has not been run against the e2e stack yet
  • Not exercised against a real third-party service (no external calls in these nodes)

Notes for reviewers

  • apps/mcp/src/api/views-client.ts and apps/mcp/src/__tests__/tools/view-tools.test.ts contain formatter-only changes unrelated to this feature (accidental biome --write). They can be reverted before merge.
  • Migration 000081 adds a column and a notification type; no data migration.

@pikann pikann changed the title feat(automation): add subtask, comment, notify and link nodes; list o… feat(automation): add subtask, comment, notify and link nodes; list ops, dynamic values, new triggers Nov 8, 2026

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

create_task skips the assignment side effects of the normal task-create path, so assignees of an automation-created subtask are not notified and agent assignees are never started.

Reviewed changes

  • New triggers — field_changed (validated against the recorded task fields), comment_added, link_added, attachment_added, and child_changed (fires on the parent for a created or status-changed subtask).
  • New actions — create_task (templated, idempotent per parent + exact title, dynamic fields, optional link), link_task, add_comment, and notify with the new automation notification type, message column/migration, and bell rendering.
  • update_task extensions — list set/add/remove modes, clear, and run-time dynamic values, all materialized per run without mutating stored config.
  • Conditions and targets — child_count, the siblings target, relative date values (now, now+3d), and numeric-string comparisons.
  • Frontend — config-panel editors for every new node, operation dropdown per field, grouped palettes, and i18n keys across all locales.
  • Tests — Go unit/e2e coverage for the engine, plus Playwright and vitest coverage for the builder.

Verification in this run: affected Go packages pass go test; apps/web passes tsc -b and the targeted vitest suites.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

The follow-up commit 5167ecd2 closes out the four findings from the previous review; I re-checked each fix against the surrounding code and found no new issues.

  • create_task assignment and autofill parity — applyCreateTask now records the action-set fields via RecordUserSetFields and publishes one PublishAssignmentChanged per resolved assignee with SystemActorUserID, matching update_task and the HTTP create path.
  • add_comment fan-out — the comment is now stored and published through the new AddSystemComment path, so it lands on task.comment.added with the automation origin preserved; realtime and plugins see it and the self-trigger guard still skips it.
  • Config panel description — added to FIELD_UPDATE_ORDER so an update_task node round-trips its stored description, with a regression test.
  • paca-automation.md recipe — the "close the parent when all subtasks are done" guidance now recommends child_changed + children and spells out why status_changed + siblings fails for single-child parents.

Verification in this run: affected Go packages pass go build/go test; gofmt and biome check are clean on the changed files.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

The new event-text notice is bypassable in two ways: padded placeholders like {{ event.title }} skip the check, and a long event value can push the trailing notice past sanitizeAgentMessage's 4000-char cap.

Reviewed changes

The third commit 396d03b follows the approved 5167ecd review. It reverts the accidental MCP formatter edits, tightens notify error handling, and adds a prompt-injection notice to trigger_ai_agent messages.

  • MCP formatter revert — the accidental formatter changes in apps/mcp/src/api/views-client.ts and apps/mcp/src/__tests__/tools/view-tools.test.ts are reverted, so the PR no longer carries unrelated MCP edits.
  • Notify error handling — applyNotify now collects per-recipient errors, continues notifying the remaining recipients, and returns errors.Join; NotifyAutomation now propagates a real member lookup error instead of swallowing it.
  • Agent message safety — renderAgentMessage appends an untrusted-event notice to trigger_ai_agent messages whose template uses {{event.*}}, but the check and placement leave gaps covered in the inline comment.

Verification in this run: go test ./internal/worker/... ./internal/service/notification/... ./internal/service/automation/... passes; gofmt -l is clean on the changed Go files. The MCP changes are formatter-only reverts, and the Playwright spec remains unrun.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

Commit ab96e739 closes out the remaining finding from the prior incremental review: the untrusted-event notice was bypassable through padded placeholders and truncatable by the prompt sanitizer, and both gaps are fixed.

  • Placeholder-aware detection — added vartemplate.HasEventVars, whose regex mirrors the renderer's optional padding, replacing the literal {{event. substring check.
  • Notice placement — the notice is now prepended, so sanitizeAgentMessage's head-keeping 4000-rune cap cannot drop it on either the direct or task-bound agent path.
  • Regression test — TestRenderAgentMessage_EventNotice covers both {{event.title}} and {{ event.title }}, asserts the notice survives sanitizing a 5000-char event value, and checks non-event templates are untouched.

Verification in this run: go test ./internal/worker/... ./internal/pkg/vartemplate/... passes; gofmt -l is clean on the changed files.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏

@pikann
pikann merged commit 91beacc into master Nov 8, 2026
9 checks passed
@pikann
pikann deleted the feature/enhance-automation-node-feature branch November 8, 2026 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant