Skip to content

feat(cli): skip public-API generation for hand-written contracts#1391

Merged
Chase J (chajac) merged 1 commit into
mainfrom
generator-skip-list
Jul 15, 2026
Merged

feat(cli): skip public-API generation for hand-written contracts#1391
Chase J (chajac) merged 1 commit into
mainfrom
generator-skip-list

Conversation

@chajac

@chajac Chase J (chajac) commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Overview of Changes

The public-API command generator mints one CLI command per contract in @qawolf/api-contracts. The flow.list contract (new in 0.2.0) is already served by the hand-written qawolf flows list --remote, so generating it would create a duplicate command surface for the same endpoint.

This adds a skip mechanism: buildCommandSpecs accepts a skipContractNames set, and the composite root declares handWrittenContractNames (currently flow.list) in src/commands/publicApi/index.ts. Skipping happens before spec building, so a hand-written contract never needs to be expressible as generated flags, and no empty namespace group command is created. AGENTS.md and the domain structure rule doc now document the skip list as the mechanism behind "never register the same endpoint both ways".

Testing

bun run typecheck
bun run lint
bun run format:check
bun run knip
bun run test
bun run build

New coverage: commandSpecs.test.ts proves a skipped contract produces no spec (using an intentionally flag-unmappable input to pin the skip-before-build behavior), and commands/publicApi/index.test.ts proves a flow.list contract in the tree registers no flow command while siblings still register.

Checklist

  • Changes follow the code style of this project
  • Self-review completed
  • Tests added/updated (or not applicable)
  • No breaking changes (or described below)

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title follows Conventional Commits, uses an allowed type and scope, and clearly describes the skip behavior change.
Description check ✅ Passed The description matches the template with overview, testing commands, and a completed checklist; the optional issue link is the only missing piece.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch generator-skip-list

Comment @coderabbitai help to get the list of available commands.

@chajac
Chase J (chajac) merged commit b3eda35 into main Jul 15, 2026
6 checks passed
@chajac
Chase J (chajac) deleted the generator-skip-list branch July 15, 2026 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants