Skip to content

feat(workstation): require targets cardinality on workflow registry - #2135

Merged
gfargo-horizon-agent[bot] merged 1 commit into
mainfrom
agent/coco-674-add-cardinality-contract-single-multi-to
Aug 28, 2026
Merged

feat(workstation): require targets cardinality on workflow registry#2135
gfargo-horizon-agent[bot] merged 1 commit into
mainfrom
agent/coco-674-add-cardinality-contract-single-multi-to

Conversation

@gfargo-horizon-agent

@gfargo-horizon-agent gfargo-horizon-agent Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

What

Makes workflow cardinality (targets: 'single' | 'multi') a required, complete, load-bearing contract on LogInkWorkflowAction, and makes the confirm overlay branch on that declared contract instead of inferring cardinality from resolver output length.

Why

Plane: OSS-674

Note: #1361's multi-select UX already shipped and introduced targets ad-hoc as an optional field, a plural-shaped resolver (ids: string[]), and a pluralizing confirm overlay. What was still missing — and what this PR closes — is the completeness and enforcement half: every registry entry explicitly declaring its cardinality, the type system rejecting entries that don't, and the overlay reading the declared contract rather than guessing from output shape.

How

  • inkWorkflows.ts: targets?:targets: (required), forcing tsc to flag every entry missing it; tagged all 118 previously-untagged entries as targets: 'single' (the existing 4 batch-capable workflows — cherry-pick-commit, delete-branch, force-delete-branch, drop-stash — were already 'multi').
  • overlays.ts: describeConfirmationTarget now resolves the action via getLogInkWorkflowActionById and only takes the plural branch when action.targets === 'multi', so a 'single' workflow can never render a plural summary even if marks are active.
  • Added a completeness test (no entry omits targets), a closed-set test pinning the exact four 'multi' ids, and a resolver-alignment test tying the contract to the batch-selector implementation.
  • Added an overlay regression test proving a 'single' workflow (checkout-branch) keeps its singular confirm line even with marks active on other branches.

Deliberate deviation from the ticket text: resolvePendingItemAction is not rewritten to return LogInkPendingItemAction[]. It already satisfies the underlying need — it returns ids: string[], and the three batch-capable workflows already populate it with N ids via the existing batch selectors. Wrapping that in an outer array would be a no-op refactor touching overlays.ts, useWorkflowAction.ts, sidebar.ts, four surface files, and pendingItemAction.test.ts for no new capability.

Testing

  • build passes (npm run build)
  • tests pass — inkWorkflows.test.ts + overlays.test.ts (55/55), full suite run locally
  • lint clean (npm run lint, 0 errors)
  • CI: pending

🤖 Generated by the harbor agent loop. Reviewed by a human before merge.

Flip LogInkWorkflowAction.targets from optional to required so tsc
enumerates every registry entry missing a single/multi tag, tag the
remaining ~118 entries as targets: 'single', and gate the confirm
overlay's plural branch on the declared contract instead of inferring
cardinality from resolver output length.

Closes OSS-674

@gfargo-horizon-agent gfargo-horizon-agent Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🔎 Agent review (sonnet) — LGTM

REVIEW: LGTM
RESOLVES: full

The PR correctly implements the completeness/enforcement contract: all 122 registry entries now carry an explicit targets field (verified mechanically), exactly the four batch-capable workflows are 'multi', and describeConfirmationTarget now gates the plural branch on the declared contract rather than resolver output length. Tests (55/55), lint (0 errors), and tsc --noEmit all pass, and the deliberate deviation from rewriting resolvePendingItemAction to return an array is well-justified and clearly documented in the PR body.

@gfargo-horizon-agent
gfargo-horizon-agent Bot merged commit 7d19dc5 into main Aug 28, 2026
12 checks passed
@gfargo-horizon-agent
gfargo-horizon-agent Bot deleted the agent/coco-674-add-cardinality-contract-single-multi-to branch August 28, 2026 22:14
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.

0 participants