Skip to content

feat(workflow-executor): PRD-553 apply build-time filters on 1–n Load Related Record#1690

Open
Scra3 wants to merge 4 commits into
feature/prd-552-backward-compat-load-relatedfrom
feature/prd-553-executor-filters-load-related
Open

feat(workflow-executor): PRD-553 apply build-time filters on 1–n Load Related Record#1690
Scra3 wants to merge 4 commits into
feature/prd-552-backward-compat-load-relatedfrom
feature/prd-553-executor-filters-load-related

Conversation

@Scra3

@Scra3 Scra3 commented Jun 21, 2026

Copy link
Copy Markdown
Member

Context

Filter half of PRD-553 (executor), stacked on #1688. Applies the build-time filter the editor sets on a 1–n relation, narrowing the candidate records.

What

  • preRecordedArgs.filters added to the executor step-definition schema (z.unknown().optional() — trusted build config, forwarded verbatim; the agent validates it).
  • Threaded through GetRelatedDataQuery → adapter → agent-client SelectOptions.filters on the 1–n list fetch (fetchRelatedData). The agent-client already supports filters; this is pure wiring.
  • xToOne untouched: it goes through getSingleRelatedData (no list to filter) → 1–1 relations never receive a filter, per PRD.
  • Port stays agnostic (filters?: unknown); the adapter casts to the agent-client type at the single call site.

Tests

+1 executor test: HasMany with preRecordedArgs.filtersgetRelatedData called with that filters. 1085/1085 pass.

Base = PRD-552 branch (stacked). Retarget on merge.

fixes PRD-553

🤖 Generated with Claude Code

Note

Apply build-time filters to 1–n Load Related Record step execution

  • Adds an optional filters field to LoadRelatedRecordStepDefinitionSchema.preRecordedArgs in step-definition.ts, accepted as z.unknown() and validated by the agent.
  • Extends GetRelatedDataQuery in agent-port.ts with an optional filters?: unknown field and forwards it through AgentClientAgentPort.getRelatedData to the agent client's relation().list() call.
  • Updates load-related-record-step-executor.ts to include preRecordedArgs.filters in the getRelatedData payload when present.
  • Behavioral Change: related record candidates for 1–n steps will now be filtered at fetch time when filters are defined, changing the returned rows compared to the previous unfiltered behavior.

Macroscope summarized d4a72ec.

… Record (PRD-553)

Thread preRecordedArgs.filters (a trusted build-time conditionTree) through GetRelatedDataQuery
into the agent-client's SelectOptions.filters on the 1–n list fetch (fetchRelatedData). xToOne
goes through getSingleRelatedData (no list to filter), so it's untouched. The port stays agnostic
(filters?: unknown); the adapter casts to the agent-client type at the single call site. The agent
validates the filter at query time.

fixes PRD-553

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@linear-code

linear-code Bot commented Jun 21, 2026

Copy link
Copy Markdown

PRD-553

…th (PRD-553 review)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@qltysh

qltysh Bot commented Jun 21, 2026

Copy link
Copy Markdown

Qlty


Coverage Impact

This PR will not change total coverage.

🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

Comment thread packages/workflow-executor/src/adapters/agent-client-agent-port.ts Outdated
Comment thread packages/workflow-executor/src/executors/load-related-record-step-executor.ts Outdated
Comment thread packages/workflow-executor/src/ports/agent-port.ts Outdated
alban bertolini and others added 2 commits June 22, 2026 11:50
Remove inline comments flagged in PR review.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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