Skip to content

feat: card-phase ergonomics (inventory, create_card phase_id, review fixes)#277

Closed
adriannoes wants to merge 6 commits into
mainfrom
feat/card-phase-ergonomics
Closed

feat: card-phase ergonomics (inventory, create_card phase_id, review fixes)#277
adriannoes wants to merge 6 commits into
mainfrom
feat/card-phase-ergonomics

Conversation

@adriannoes
Copy link
Copy Markdown
Collaborator

@adriannoes adriannoes commented Jun 3, 2026

This work closes gaps identified while agent-seeding the Analytics pipe (306996636) during the chaos-pipe exercise. Agents had to fall back to execute_graphql, and sometimes introspect_type / search_schema, because first-class MCP tools did not cover common card/phase workflows—even though the GraphQL API and parts of the SDK already supported them.

What agents did with raw GraphQL (and why)

Need Typical escape hatch Gap before this PR
Create a card in an orphan / non–start-form phase createCard + CreateCardInput.phase_id via execute_graphql; introspect_type("CreateCardInput") create_card had no phase_id; post-create update_card for title
Inventory cards per phase phase { cards_count }, phase { cards(first) } No MCP get_phase_cards_count / get_phase_cards; get_cards has no phase filter
Move cards safely move_card_to_phase when destination ∈ allowed set No proactive get_phase_allowed_move_targets tool (SDK existed; not exposed)
Pipe structure for seeding Multiple get_pipe + ad-hoc phase queries Start form not visible as start_form_phase; no cards_count on workflow phases
Labels create_label("red") failed; API expects hex (#RGB / #RRGGBB)
Reports filtered by phase Raw filter attempts ReportCardsFilter shape easy to get wrong (top-level current_phase rejected by API)

What already worked without GraphQL

create_phase, field/condition setup, automations/AI agents (inactive), move_card_to_phase when the graph allowed it, get_pipe / get_phase_fields, and create_card on the start form with skip_elicitation.

Goal

Let agents seed, audit, and move cards on the happy path using dedicated SDK + MCP + CLI surfaces (parity in docs/parity.md), without raw GraphQL for these flows. Phase transition graph editing stays UI-only (documented).


Summary

  • SDK: get_pipe inventory enrichment (start_form_phase, per-phase cards_count), phase card reads/counts, create_card with phase_id/title, #RGB label colors, and ReportCardsFilter preflight planner.
  • MCP: get_phase_cards, get_phase_cards_count, get_phase_allowed_move_targets, create_card(phase_id=…); report filter preflight on all filter-accepting mutations; docstring discovery hints for start_form_phase.id.
  • CLI: Parity for phase inventory, --phase-id / --first validation, shared report-filter and page-size helpers.
  • Review follow-up (F1–F7): Fix false title_warning, expand label hex and report preflight coverage, validate phase_id, clamp phase cards --first, service-level get_pipe hard-fail test, README/marketplace metadata for pipefy/ai-toolkit.
  • Docs/skills: docs/parity.md, MCP reference, pipefy-pipes-and-cards skill workflow (Seed pipe across phases; prefer dedicated tools over execute_graphql).

Test plan

  • uv run ruff check . / ruff format --check .
  • uv run pytest packages/sdk/tests -m "not integration" (936 passed)
  • uv run pytest packages/mcp/tests -m "not integration" (1361 passed, CI dummy PIPEFY_* env)
  • uv run pytest packages/cli/tests -m "not integration" (318 passed)
  • uv run pytest tests/test_parity.py -m "not integration" (154 passed)
  • uv run python .github/workflows/scripts/lint_skill_refs.py
  • CI green on this PR

…ers)

Extend create_card with phase_id and title on CreateCardInput; add get_phase_cards,
get_phase_allowed_move_targets plumbing, get_pipe inventory fields, and pure planners
for label hex validation and ReportCardsFilter preflight.
…ort preflight

Register get_phase_allowed_move_targets, get_phase_cards_count, and get_phase_cards;
extend create_card with phase_id, title on CreateCardInput, and merged start-form plus
phase field filtering; enrich get_pipe; validate label colors and report filters before GraphQL.
…x, report filter

Add phase allowed-moves, cards-count, and cards subcommands; wire card create --phase-id
and --fields JSON; validate label colors and report filter shape at the CLI boundary.
Document new phase tools, create_card phase_id, get_pipe enrichment, label hex rules,
and ReportCardsFilter examples; update parity matrix, README tool guidance, and CHANGELOG.
…se workflows

Extend pipefy-pipes-and-cards with seed-across-phases workflow and tool-first table;
update reports and api-fallback skills for ReportCardsFilter and Tier 1 tools.
Resolve false create_card title_warning, accept #RGB label colors,
validate phase_id and ReportCardsFilter on all MCP/CLI paths, clamp
phase cards --first, and lock get_pipe hard-fail at the service boundary.
@adriannoes adriannoes self-assigned this Jun 3, 2026
@adriannoes adriannoes added the enhancement New feature or request label Jun 3, 2026
@adriannoes
Copy link
Copy Markdown
Collaborator Author

Closing in favor of a stacked review (6 smaller PRs) — same net diff as this branch, easier to review per layer.

Stack (merge order):

  1. Planners (SDK)
  2. SDK phase reads + get_pipe inventory + create_card adapter
  3. MCP/CLI phase inventory tools
  4. MCP/CLI create_card(phase_id)
  5. Report filter preflight + CLI label hex
  6. Docs + skills

Backup tag: backup/pr-277-feat-card-phase-ergonomics on the original branch.

New PRs will be linked in a follow-up comment once opened.

@adriannoes
Copy link
Copy Markdown
Collaborator Author

Stacked replacement PRs (merge in order)

# PR Layer
1 #280 SDK planners
2 #281 SDK phase + pipe inventory
3 #282 MCP/CLI phase tools
4 #283 MCP/CLI create_card(phase_id)
5 #284 Report preflight + CLI label
6 #285 Docs + skills

Net diff matches feat/card-phase-ergonomics / tag backup/pr-277-feat-card-phase-ergonomics.

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.

1 participant