codegen: add endpoint grouper with agent-first naming (PRINFRA-121) - #13
Merged
somanshreddy merged 1 commit intoApr 1, 2026
Conversation
Collaborator
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced Mar 31, 2026
somanshreddy
force-pushed
the
03-31-codegen_add_endpoint_grouper_and_subcommand_naming_algorithm
branch
from
March 31, 2026 18:29
803d72a to
1ac674a
Compare
PRINFRA-121 CLI M1: OpenAPI codegen pipeline
Build the code generation pipeline that reads Scope
Mapping Rules
Acceptance Criteria
|
somanshreddy
force-pushed
the
03-31-codegen_add_openapi_spec_parser
branch
from
March 31, 2026 19:41
5b95564 to
735c417
Compare
somanshreddy
force-pushed
the
03-31-codegen_add_endpoint_grouper_and_subcommand_naming_algorithm
branch
from
March 31, 2026 19:41
1ac674a to
612f394
Compare
somanshreddy
force-pushed
the
03-31-codegen_add_openapi_spec_parser
branch
from
March 31, 2026 20:08
735c417 to
3511ac2
Compare
somanshreddy
force-pushed
the
03-31-codegen_add_endpoint_grouper_and_subcommand_naming_algorithm
branch
from
March 31, 2026 20:08
612f394 to
16bd8ed
Compare
somanshreddy
changed the base branch from
03-31-codegen_add_openapi_spec_parser
to
graphite-base/13
March 31, 2026 20:59
somanshreddy
force-pushed
the
graphite-base/13
branch
from
March 31, 2026 20:59
3511ac2 to
ee89581
Compare
somanshreddy
force-pushed
the
03-31-codegen_add_endpoint_grouper_and_subcommand_naming_algorithm
branch
from
March 31, 2026 20:59
16bd8ed to
b29c389
Compare
somanshreddy
changed the base branch from
graphite-base/13
to
03-31-codegen_add_overrides_system_for_group_renames_skip_patterns_positional_promotions
March 31, 2026 20:59
somanshreddy
force-pushed
the
03-31-codegen_add_endpoint_grouper_and_subcommand_naming_algorithm
branch
from
March 31, 2026 21:06
b29c389 to
f03c006
Compare
somanshreddy
force-pushed
the
03-31-codegen_add_overrides_system_for_group_renames_skip_patterns_positional_promotions
branch
from
March 31, 2026 21:07
ee89581 to
15e4901
Compare
somanshreddy
force-pushed
the
03-31-codegen_add_endpoint_grouper_and_subcommand_naming_algorithm
branch
from
March 31, 2026 21:25
f03c006 to
cfec8dd
Compare
somanshreddy
force-pushed
the
03-31-codegen_add_overrides_system_for_group_renames_skip_patterns_positional_promotions
branch
from
March 31, 2026 21:25
15e4901 to
cae4380
Compare
somanshreddy
force-pushed
the
03-31-codegen_add_endpoint_grouper_and_subcommand_naming_algorithm
branch
2 times, most recently
from
March 31, 2026 21:41
868657e to
2c83785
Compare
somanshreddy
force-pushed
the
03-31-codegen_add_overrides_system_for_group_renames_skip_patterns_positional_promotions
branch
from
March 31, 2026 21:55
cae4380 to
9e4f567
Compare
somanshreddy
force-pushed
the
03-31-codegen_add_endpoint_grouper_and_subcommand_naming_algorithm
branch
from
March 31, 2026 21:55
2c83785 to
21f7dfa
Compare
somanshreddy
force-pushed
the
03-31-codegen_add_overrides_system_for_group_renames_skip_patterns_positional_promotions
branch
from
March 31, 2026 21:58
9e4f567 to
89d91d3
Compare
somanshreddy
force-pushed
the
03-31-codegen_add_endpoint_grouper_and_subcommand_naming_algorithm
branch
2 times, most recently
from
March 31, 2026 22:02
c337bb8 to
5a7da12
Compare
somanshreddy
force-pushed
the
03-31-codegen_add_overrides_system_for_group_renames_skip_patterns_positional_promotions
branch
2 times, most recently
from
March 31, 2026 22:04
1a1881e to
545c7f1
Compare
somanshreddy
force-pushed
the
03-31-codegen_add_endpoint_grouper_and_subcommand_naming_algorithm
branch
from
March 31, 2026 22:04
5a7da12 to
a4d0678
Compare
somanshreddy
force-pushed
the
03-31-codegen_add_endpoint_grouper_and_subcommand_naming_algorithm
branch
from
April 1, 2026 04:27
45caa51 to
fd011ae
Compare
somanshreddy
force-pushed
the
03-31-codegen_add_overrides_system_for_group_renames_skip_patterns_positional_promotions
branch
from
April 1, 2026 04:27
b240371 to
18f3382
Compare
somanshreddy
force-pushed
the
03-31-codegen_add_endpoint_grouper_and_subcommand_naming_algorithm
branch
from
April 1, 2026 04:39
fd011ae to
791edee
Compare
somanshreddy
force-pushed
the
03-31-codegen_add_overrides_system_for_group_renames_skip_patterns_positional_promotions
branch
2 times, most recently
from
April 1, 2026 06:41
5a3e6ad to
b08f6d2
Compare
somanshreddy
force-pushed
the
03-31-codegen_add_endpoint_grouper_and_subcommand_naming_algorithm
branch
from
April 1, 2026 06:41
791edee to
61e9e49
Compare
somanshreddy
force-pushed
the
03-31-codegen_add_endpoint_grouper_and_subcommand_naming_algorithm
branch
4 times, most recently
from
April 1, 2026 07:23
19c3f69 to
a61cb00
Compare
somanshreddy
force-pushed
the
03-31-codegen_add_overrides_system_for_group_renames_skip_patterns_positional_promotions
branch
from
April 1, 2026 07:26
b08f6d2 to
6e8db51
Compare
somanshreddy
force-pushed
the
03-31-codegen_add_endpoint_grouper_and_subcommand_naming_algorithm
branch
from
April 1, 2026 07:26
a61cb00 to
0a34434
Compare
somanshreddy
force-pushed
the
03-31-codegen_add_overrides_system_for_group_renames_skip_patterns_positional_promotions
branch
from
April 1, 2026 07:41
6e8db51 to
ef458e1
Compare
somanshreddy
force-pushed
the
03-31-codegen_add_endpoint_grouper_and_subcommand_naming_algorithm
branch
2 times, most recently
from
April 1, 2026 07:42
23a6763 to
f6691d3
Compare
somanshreddy
marked this pull request as ready for review
April 1, 2026 08:04
somanshreddy
force-pushed
the
03-31-codegen_add_overrides_system_for_group_renames_skip_patterns_positional_promotions
branch
from
April 1, 2026 17:01
ef458e1 to
89e818b
Compare
somanshreddy
force-pushed
the
03-31-codegen_add_endpoint_grouper_and_subcommand_naming_algorithm
branch
from
April 1, 2026 17:02
f6691d3 to
57dd9f1
Compare
jrusso1020
approved these changes
Apr 1, 2026
Collaborator
Author
Merge activity
|
somanshreddy
changed the base branch from
03-31-codegen_add_overrides_system_for_group_renames_skip_patterns_positional_promotions
to
graphite-base/13
April 1, 2026 19:17
Groups parsed endpoints by OpenAPI tag, derives group names (lowercase, singularized, overrides applied), derives subcommand names from path suffix + HTTP method (list/get/create/delete/update/nested-action). Routes path params to ArgSpec, query params to FlagSpec, body fields to FlagSpec. Applies positional promotions from overrides. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
somanshreddy
force-pushed
the
03-31-codegen_add_endpoint_grouper_and_subcommand_naming_algorithm
branch
from
April 1, 2026 19:18
57dd9f1 to
34911cf
Compare
somanshreddy
deleted the
03-31-codegen_add_endpoint_grouper_and_subcommand_naming_algorithm
branch
April 1, 2026 19:19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Takes an OpenAPI spec and produces
command.Groups— CLI command definitions grouped by name. This is the core of the codegen pipeline.Naming algorithm
Derives CLI command names from URL path structure. No hardcoded maps or word classification.
Steps:
{params}→ positional argsx-cli-action: truein the OpenAPI spec skip the terminal verb. This flag is an extension (likex-cli-visible) set by the API team on RPC-style action endpoints where the last path segment is already a verb — without it,POST .../stopwould producestop create. The codegen reads the flag; the spec annotations are tracked in PRINFRA-145.Common case — standard CRUD:
Edge case — nested action endpoint:
Automation
Of every generated command, the following is fully automatic from the spec:
The only manual inputs are:
x-cli-visiblein the spec — 15 v1/v2 endpoints excluded (set by API team)x-cli-actionin the spec — 3 action endpoints where the path segment is the verb (set by API team)examples.yamlin the CLI repo — curated usage examples for every commandOther responsibilities
x-cli-visibleSource: "file"flags that route toinv.FilePath-d/--data)-d,--help,--version)Design decisions
sessions,endpoints,proofreads)Testing
11 tests covering: hidden endpoint filtering, group name singularization, terminal verbs, query flags, complex field skipping, path args, pagination, multipart with Source:"file", examples, x-cli-action, sub-group naming.
Files
codegen/grouper.go— GroupEndpoints, buildSpec, deriveCommandName, schema/pagination/multipart helperscodegen/grouper_test.go— 11 testscodegen/testdata/test_spec.yaml— test OpenAPI spec (videos, avatars, assets, action and hidden endpoints)