Repository navigation
feat(proto,spec): F-CLI-NEST — declared subcommand catalogs for command-class plugins - #72
Conversation
…nd-class plugins ProvidedCapability gains an optional `subcommands` field (name+help pairs) a class="command" capability can declare over Describe, so the host can build a REAL nested Kong grammar (restoring `--help` fidelity) and synthesize per-subcommand CLI-model leaves (restoring MCP tool discoverability) in place of the opaque single-level pass-through holder every command-class capability otherwise gets. Additive: a capability declaring no subcommands keeps today's flat holder byte-for-byte. sdk.KongSubcommands(v any) derives the catalog directly from an existing Kong-tagged grammar struct (name:/help:/hidden: tags, falling back to Kong's own kebab-cased field name when name: is absent) instead of requiring a hand-duplicated list — RDD-spiked live against kong.New to confirm a value-carrying `cmd:"<value>"` tag is never read as a name, only its presence matters. Paired with the charly-repo cutover that consumes this field to fix two pre-existing main regressions the check-charly-selftest-pod bed surfaced: `charly check --help` showing only a generic placeholder, and the `box.list.boxes` MCP tool having silently disappeared. Assisted-by: Claude Sonnet 5 (fully tested and validated)
pr-validator — CHANGES REQUESTED ❌Change class: Environment: isolated worktree at PR head Checklist
Independent re-derivation performed (not taken on the author's word)Proto regeneration — independently reproduced, not trusted: ran Comments considered: none (PR carries zero comments). Cross-PR interactions considered: none open — PR #72 is the only open PR in Consumer-caveat (charly-main vs sdk-main) noted, not re-litigated: per the assignment, this PR's own gate is the sdk-standalone battery (no charly-main consumer-compile gate applies, per the tracked W9 staging gap, task #40). Confirmed this PR introduces no new breakage to the existing plugin-API surface (no modified/removed existing exported signatures outside the mechanical proto regen). DecisionFAIL. The mechanism ( Fix: Assisted-by: Claude Code Anthropic Claude Sonnet 5 (analysed on a live system) |
kongDefaultFieldName's one-line func body was not gofmt-canonical (gofmt wraps a multi-statement-looking single return onto its own line for a named func in this style). Caught by the fresh pr-validator on PR #72 — reproduced locally with `gofmt -l .`, confirmed PR-introduced (clean on base b24b168), fixed with `gofmt -w`. Assisted-by: Claude Sonnet 5 (fully tested and validated)
Cross-PR coordination notice (from the opencharly/charly#146 validation)sdk#73 (feat(agent): add CUE-generated control plane SDK) has MERGED to sdk main as 76df6c0 (tag v0.2026200.1312). A prior phase-one review of the chain noted a protobuf field-number conflict between this PR and #73: the merged main now assigns No action needed from #146; flagging so the rebase is planned rather than discovered at merge time. Assisted-by: Kimi Code Moonshot Kimi K3 (analysed on a live system) |
The npm @anthropic-ai/claude-code package regressed upstream into a thin launcher that defers its native-binary download to first runtime, breaking `claude --version` in hermetic (offline) image builds (baseline-confirmed pre-existing on main). Switch to the official native installer (curl -fsSL https://claude.ai/install.sh | bash) and relocate the resulting binary to /usr/local/bin, since anything a candy installs under ${HOME} at build time is shadowed by the deploy-time home-volume mount. Sweeps the same path fix into hermes-full/openclaw-full, whose composed checks asserted the old path, and bumps version: on all three content-changed candies (claude-code 2026.198.2107; hermes-full/openclaw-full 2026.200.1600). Deletes candy/claude-code/package.json and drops require: [nodejs] (the native binary needs no node). Sibling skill-claim sweep landed in the owning repo as opencharly/marketplace#93 (merged d47ec55, tag v2026.200.1559): claude-code/nodejs/kimi/forgecode/ hermes/openclaw-desktop skills synced to the native-installer reality. R10: charly box validate exit 0 (zero warnings) on the final tree; check-openclaw-full-pod PASS 12/12 twice on disk (author 2026.200.1317, fresh-validator serial 2026.200.1546); check-charly-selftest-pod baseline carries only the 2 known F-CLI-NEST defects owned by opencharly/sdk#72. Round-2 delta re-gate: version:-metadata-only, runtime content identical to the bed-tested tree. Assisted-by: Claude Code Anthropic Claude Sonnet 5 (fully tested and validated)
…ne conflict resolution) Resolved the 3 real conflicts (proto/plugin.proto, proto/plugin.pb.go, schema.go) by porting F-CLI-NEST's CLISubcommand message + subcommands field (proto field 12) into the new CUE-sourced protocol/schema/plugin.cue alongside main's command_model_json (field 13, no collision), then regenerating via `task wire:gen` instead of hand-merging the generated proto output. schema.go's ProvidedCapability keeps both Subcommands ([]CLISubcommand) and CommandModel (*spec.CLIModel). climodel.go, plugin_grpc.pb.go, and spec/cue_types_gen.go auto-merged cleanly. Assisted-by: Claude Code Anthropic Claude Sonnet 5 (fully tested and validated)
Assisted-by: Claude Code (Anthropic Claude Sonnet 5; documentation reviewed)
pr-validator — APPROVED ✅Change class: Environment: superproject-rooted validator ( Checklist
Comments considered
Cross-PR interactions considered
DecisionPASS. Independently re-derived every claim at the actual final head (the post-merge-conflict-resolution commit, not the round-2 head the PR body's evidence predates): the standalone build/vet/test/gofmt/lint battery is genuinely green, the proto regeneration is a byte-for-byte reproducible no-op, the SDD CUE-source mandate is honored (and the concurrent field-number conflict flagged by another PR's validator was correctly resolved by porting onto the new CUE-sourced transport pipeline rather than hand-patching generated output), and the change is purely additive with no architecture, duplication, or workaround violations. Proceeding to finalize the merge-time CalVer, merge, and tag. Assisted-by: Claude Code Anthropic Claude Sonnet 5 (fully tested and validated) |
pr-validator — addendum (status re-verification)Between posting my Phase-1 verdict comment and posting the Per this validator's authoritative-head-SHA rule, the
This delta strictly IMPROVES compliance (fixes an attribution-trailer format Assisted-by: Claude Code Anthropic Claude Sonnet 5 (fully tested and validated) |
pr-validator merge-time version stamp for PR #72 (F-CLI-NEST) — CHANGELOG/<placeholder>.md renamed to the merge-time CalVer per git-workflow's CalVer-generated-at-merge rule. Assisted-by: Claude Code (Anthropic Claude Sonnet 5; fully tested and validated)
Summary of changes
Adds an optional
subcommandsfield (repeated CLISubcommand, name+help pairs)to the
ProvidedCapabilityproto message, so aclass="command"plugin canDECLARE a one-level-deep CLI subcommand catalog over Describe. Threaded through:
sdk/proto/plugin.proto: newCLISubcommand{name, help}message + thesubcommandsfield onProvidedCapability(field 12). Regeneratedproto/plugin.pb.go+proto/plugin_grpc.pb.goviatask proto:gen.sdk/schema.go: SDK-facingCLISubcommandtype +ProvidedCapability.Subcommands []CLISubcommand, wired intoBuildCapabilities(marshals to the proto field).sdk/kong_reflect.go(new):KongSubcommands(v any) []CLISubcommand— derivesthe catalog directly from an EXISTING Kong-tagged grammar struct (a field's
name:/help:/hidden:tags), instead of requiring a hand-duplicated list.Falls back to Kong's own kebab-cased field name when
name:is absent —RDD-spiked live against
kong.New(a throwaway program) to confirm avalue-carrying
cmd:"<value>"tag is NEVER read as the command's dispatchedname by Kong; only the key's PRESENCE matters. Without this spike I would have
shipped a wrong assumption (see
kong_reflect_test.go'sTestKongSubcommands,which encodes the exact case this caught: a field tagged
cmd:"list-ai"withno separate
name:tag dispatches aslist-agent, notlist-ai).This is purely additive: a capability that sets no
Subcommandsgets today'sbehavior byte-for-byte (an empty proto
repeatedfield marshals/unmarshals to anil slice with zero wire-size cost).
Paired with a charly-repo cutover (opens after this merges, gitlink repointed to
the merged SHA per B2) that consumes this field to fix two pre-existing
mainregressions the
check-charly-selftest-podbed surfaced:charly check --helpshowing only a generic out-of-process placeholder instead of its real subcommand
grammar, and the
box.list.boxesMCP tool having silently disappeared fromcharly __cli-modelreflection. Full RCA lives in that PR / its CHANGELOG entry.Change class
charly-or-sdk Go(sdk contract module only — no charly/candy files in this PR).How R10-tested — exact gate, commands, and pasted output
of its own (per
/charly-check:check, its consumer — the paired charly PR —carries the
charly check run check-charly-selftest-podR10 gate). This PR'sgate is: standalone build + full test suite (
GOWORK=off) + the protoregeneration reproducibility check.
the consuming charly PR runs
check-charly-selftest-podand is the runtimeproof this field actually restores the two target behaviors).
equivalent proof is
task proto:genregeneratingproto/plugin.pb.gocleanlyfrom the edited
.protoandgo build/go testpassing against that freshlygenerated output (pasted below).
KongSubcommandsis exercisedby
TestKongSubcommands(positive case: explicitname:, kebab-case fallback,hidden-field skip) and
TestKongSubcommands_NonStruct(defensive nil path);BuildCapabilities's newSubcommandsmarshal loop is exercised transitively byevery existing
BuildCapabilitiestest plus the paired charly PR's livesdk.KongSubcommands(&CheckCmd{})call (verified there via a rebuilt binary'sreal
charly check --help/charly __cli-modeloutput, pasted in that PR).Round 2 (head
7649d36) — every command below was RE-RUN from this exact head,right after the fix commit, from
sdk/as cwd. Round 1 shipped a gofmt claimthat did not match the pushed tree (
kong_reflect.go'skongDefaultFieldNameone-liner) — that was a real evidence-discipline failure, caught by the fresh
validator; fixed with
gofmt -w kong_reflect.go, one append commit(
7649d36), pushed fast-forward. Round 2's output below is genuine, notrecalled/assumed:
Round 1 (head
fadc303, superseded — kept for the record):(the proto regeneration step above was NOT re-run in round 2 — the
.protofile is unchanged since round 1, only
kong_reflect.gowas gofmt'd, so thegenerated
proto/*.pb.gofiles are untouched and remain reproducible from theunchanged
.protosource.)Branch rebased (while still unpushed — legal per the no-force-push-after-first-push
rule) onto current
sdkmain (b24b168, the just-merged W9/K1CandyReader/CandyModel producer leg) before the first push; the round-2 fix
commit above was appended (never amended/rebased) on top of the already-pushed
history.
Attribution tier
fully tested and validated— standalone build/test/vet/gofmt clean, the newcode's own tests executed (including the RDD-spike-derived case), reproducible
proto regeneration confirmed.
Harness rulebook compliance
/charly-internals:go(schema→spec generation,task cue:genrecipe) and
/charly-internals:plugin(the per-plugin Describe/capabilitycontract) loaded before touching
sdk/proto/plugin.protoandsdk/schema.go.proactively — it caught a wrong naming assumption before it shipped.
go build/go vet/go test/gofmtall clean, zero warnings.KongSubcommandsis the SINGLE derivation mechanism aconsumer reflects an EXISTING Kong struct through, rather than each consumer
hand-writing its own name-derivation logic; it replicates Kong's own algorithm
exactly (spiked) rather than inventing a parallel one.
this diff.
additive); N/A for the grep self-test.
no force-push, no reset of shared history).
its own; the paired charly PR carries the runtime (R7) gate.
dependency introduced.
new field/function DOES ship dedicated test coverage that would fail without
this change (
TestKongSubcommands,TestKongSubcommands_NonStruct).cmd-tag-naming assumption was PROVEN, notassumed, via a live throwaway
kong.Newspike beforekong_reflect.gowaswritten against it (see Summary). ADE: N/A (no candy in this repo). SDD: the
new proto field is a hand-maintained TRANSPORT schema addition (per this repo's
own documented SDD exception for
plugin.proto— the gRPC transport contract,not a CUE-migratable ingress/wire schema);
task proto:genregenerated cleanlyand reproducibly, confirmed by re-running it against the edited
.proto(nostale generated bytes committed).
charly core; this field is a generic Envelope addition (capability metadata
every command-class plugin MAY declare), naming no concrete kind.
performed by this PR.
gofmt -l .empty,go vetclean,go test ./...green (pasted above).golangci-lintnot separately re-run for thisnarrow addition beyond the standard build/vet/test/fmt gates (no lint config
changes; existing repo lint gate applies unchanged).
CHANGELOG/2026.198.2144.mdstaged (placeholder CalVer — thepr-validator finalizes it at merge).
Assisted-by: Claude Code (Anthropic Claude Sonnet 5; fully tested and validated)