Skip to content

feat(help): show settable fields with types in create/update --help and get noun - #523

Merged
BlueLabelscotch merged 6 commits into
mainfrom
feat/mutable-help
Nov 20, 2026
Merged

BlueLabelscotch merged 6 commits into
mainfrom
feat/mutable-help

Conversation

@BlueLabelscotch

Copy link
Copy Markdown
Collaborator

Part 2 of #508 / #439 (core only). Stacked on #522.

Agents had to run --list-fields to learn which fields --set accepts and their value shapes.

  • create / update --help (commands with --set) get a block of that verb's settable fields with their type; scoped fields are tagged:
    Settable fields (--set, --del):
      name       scalar
      is_public  bool  (create only)
    
    When the command has no long, the short text is kept above the block.
  • get noun replaces (editable) with (editable: create, update; <type>). Verbs listed are the noun's create/update commands that accept --set and where the field is writable; it falls back to (editable) when none do.
  • spec.FieldDef.TypeLabel() gives the type (scalar when unset); --list-fields uses it too.
  • get module is unchanged.

Checked by building the binary: update repository --help, create repository --help, update feature_flag --help and get noun repository. No spec uses mutable_on yet, so (create only) is covered by unit tests, not a real command.

Tests: help-block test with a scoped field and a command without --set; get noun note test; go test ./pkg/... ./modules/... passes.

Not decided: the block is always printed, so a noun with many mutable fields (e.g. fme) gets a long help.

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Deep Code Review Agent🐛

Review completed with 5 suggestions.

Reviewed commit: 31cf0bd

Comment thread pkg/registry/registry.go
if !cs.BuiltinFlags.Set || (cs.Verb != VerbCreate && cs.Verb != VerbUpdate) {
return cs.Long
}
noun := cs.FullNoun()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Deep Code Review Agent🐛

cs.FullNoun() returns loadtest:from_json and loadtest:from_template, but the registry stores their fields under loadtest. Both create variants accept the base noun’s --set fields at runtime yet omit the new help block because the lookup returns no noun.

Severity: medium


🤖 Was this useful? React with 👍 or 👎

Comment thread pkg/registry/registry.go
if cs.FieldsNoun != "" {
noun = cs.FieldsNoun
}
fields := MutableFieldsFor(r.GetNoun(noun), cs.Verb)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Deep Code Review Agent🐛

The noun schema is not the input contract for commands that build their own request bodies: create pr --help omits is_draft even though createPRBodyFn reads it, and advertises --del even though that function ignores deletions. Likewise, update loadtest_run --help labels target_users and spawn_rate as scalar even though its body expressions require an integer and a float, respectively.

Severity: medium


🤖 Was this useful? React with 👍 or 👎

Comment thread pkg/registry/registry.go
Use: use,
Short: cs.Short,
Long: cs.Long,
Long: r.longWithSettableFields(cs),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Deep Code Review Agent🐛

buildAliasCmd still uses cs.Long, so update repo --help omits the field list that update repository --help shows, even though both aliases accept the same fields.

Severity: low


🤖 Was this useful? React with 👍 or 👎

}
var verbs []string
for _, v := range []string{"create", "update"} {
if nc := cmdByVerb[v]; nc != nil && nc.cs.BuiltinFlags.Set && f.MutableOnVerb(v) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Deep Code Review Agent🐛

editableNote sees only bare create and update entries, and GetNounHandler only supplies fields from bare get and list commands. For get noun repo_settings, that means the output lists create repo_settings:aicr and update repo_settings:aicr but shows none of their writable fields or types, such as connector_path and system_prompt.

Severity: medium


🤖 Was this useful? React with 👍 or 👎

Comment thread pkg/registry/registry.go
return cmd
}

// longWithSettableFields appends the settable-fields block to the help of a

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Deep Code Review Agent🐛

The longWithSettableFields comment repeats the function name and its guard rather than documenting a non-obvious constraint, which the Comments section of AGENTS.md asks us to avoid. Other locations where this applies: pkg/registry/fields.go:183 and modules/core/mgmt/nouns_verbs.go:114.

Severity: low


🤖 Was this useful? React with 👍 or 👎

@BlueLabelscotch
BlueLabelscotch changed the base branch from feat/mutable-on to main November 20, 2026 17:35
@BlueLabelscotch
BlueLabelscotch merged commit 15672cb into main Nov 20, 2026
1 check passed
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.

1 participant