Skip to content

feat(sdk): phase card reads, create_card phase_id/title, get_pipe inventory#281

Merged
adriannoes merged 4 commits into
feat/card-phase-erg/1-preflight-plannersfrom
feat/card-phase-erg/2-sdk-phase-and-pipe
Jun 11, 2026
Merged

feat(sdk): phase card reads, create_card phase_id/title, get_pipe inventory#281
adriannoes merged 4 commits into
feat/card-phase-erg/1-preflight-plannersfrom
feat/card-phase-erg/2-sdk-phase-and-pipe

Conversation

@adriannoes

@adriannoes adriannoes commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

During agent-seeding of the Analytics pipe (306996636), agents used execute_graphql and introspect_type / search_schema when first-class tools lacked card/phase workflows. Spec: .cursor/dev-planning/specs/archive/card-phase-ergonomics/

Stack replacing closed #277. Merge prior PRs in the stack before this one.

Depends on: #280


Objective

SDK + facade for the GraphQL capabilities agents used via raw queries:

  • get_phase_cards, get_phase_cards_count, get_phase_allowed_move_targets
  • create_card(..., phase_id=, title=) on CreateCardInput
  • get_pipe selects cards_count on workflow phases (single GraphQL round trip)

Improvements

  • No more phase { cards_count } / createCard escape hatches for these reads/writes.
  • get_phase(phase_id) returns {phase_id, phase_name, cards_count}; get_phase_cards_count delegates to it.
  • Start-form intake stays on public fields: start_form_fields + startFormPhaseId (no start_form_phase node — private API).

Review follow-up

Addresses @gbrlcustodio review (2026-06-09): dropped pipe_inventory enrichment and renamed get_phase_cards_count_payloadget_phase.

…entory

Expose get_phase_cards, get_phase_cards_count, get_phase_allowed_move_targets;
extend create_card with phase_id and CreateCardInput.title; enrich get_pipe
with start_form_phase and per-phase cards_count.
Comment thread packages/sdk/src/pipefy_sdk/services/pipe_service.py Outdated
Comment thread packages/sdk/src/pipefy_sdk/services/pipe_service.py Outdated
Address review on #281: get_pipe no longer surfaces the private start-form
phase or adds an extra GraphQL round trip; cards_count stays on workflow
phases via GET_PIPE_QUERY. Rename get_phase_cards_count_payload to get_phase
with get_phase_cards_count delegating to it.
adriannoes added a commit that referenced this pull request Jun 9, 2026
Align PR #282 with SDK review on #281: call client.get_phase instead of
get_phase_cards_count_payload; document start-form phase id via
startFormPhaseId, not start_form_phase.
@adriannoes

Copy link
Copy Markdown
Collaborator Author

Thanks @gbrlcustodio — both points addressed in 9ef6586, with stack PRs #282#285 updated to match.

start_form_phase / get_pipe: dropped the enrichment entirely. get_pipe is a single GET_PIPE_QUERY again; pipe_inventory.py removed. Only load-bearing change is cards_count on workflow phases. Start-form intake stays on start_form_fields / startFormPhaseId.

get_phase rename: get_phase_cards_count_payloadget_phase; get_phase_cards_count delegates. get_phase_fields left separate. MCP/CLI now call client.get_phase.

Holding merge until we get another review pass on the stack.

Comment thread packages/sdk/src/pipefy_sdk/queries/pipe_queries.py Outdated
Align query and private helper names with get_phase, which returns the
full phase row (id, name, cards_count), not a count-only projection.
adriannoes added a commit that referenced this pull request Jun 10, 2026
Align PR #282 with SDK review on #281: call client.get_phase instead of
get_phase_cards_count_payload; document start-form phase id via
startFormPhaseId, not start_form_phase.
@adriannoes

Copy link
Copy Markdown
Collaborator Author

Thanks @gbrlcustodio — addressed in 4fdab2c: renamed GET_PHASE_CARDS_COUNT_QUERYGET_PHASE_QUERY, GraphQL op GetPhase, and _fetch_phase_cards_count_row_fetch_phase_row to match the get_phase surface.

Comment thread packages/sdk/tests/services/test_pipe_service.py Outdated
Remove test that mocked get_phase and asserted internal delegation;
observable contract is already covered by test_get_phase_cards_count_returns_native_scalar.
@adriannoes

Copy link
Copy Markdown
Collaborator Author

All review feedback on this PR is addressed:

  • @gbrlcustodiostart_form_phase enrichment dropped (9ef6586); get_phase_cards_count_payloadget_phase with GET_PHASE_QUERY / _fetch_phase_row rename (4fdab2c). Threads resolved.
  • @Danielmoraisg — removed the delegation wiring test; contract coverage stays on test_get_phase_cards_count_returns_native_scalar (6fba81c).

SDK unit tests green locally (927 passed, -m "not integration"). Ready for merge into feat/card-phase-erg/1-preflight-planners.

@adriannoes adriannoes merged commit 9e6811a into feat/card-phase-erg/1-preflight-planners Jun 11, 2026
adriannoes added a commit that referenced this pull request Jun 11, 2026
feat: card-phase ergonomics stack (SDK, MCP, CLI, docs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants