Skip to content

fix(command): restore nested CLI grammar for check/box-list (F-CLI-NEST) - #160

Merged
atrawog merged 5 commits into
mainfrom
fix/oop-command-grammar
Jul 20, 2026
Merged

atrawog merged 5 commits into
mainfrom
fix/oop-command-grammar

Conversation

@atrawog

@atrawog atrawog commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Summary of changes

Consumes sdk#72 (F-CLI-NEST, merged as sdk main commit 3ea39b11c6288347800dd6fdc23cd2e861c76ca2,
tag v0.2026201.542) to fix two pre-existing main regressions in the out-of-process command
grammar that were blocking two in-flight cutovers' R10 gates:

  • charly check --help printed a generic "check (out-of-process command plugin) / Arguments:
    [ ...]" placeholder instead of listing its real subcommands (box/live/feature/run/…).
  • charly __cli-model (and therefore charly mcp serve's MCP tool generation) never saw a
    box.list.boxes leaf, so the MCP tool an agent needs to enumerate boxes vanished with no
    replacement.

Root cause: every class="command" capability's Kong grammar collapses to an opaque single-level
pass-through holder (*struct{ Args []string }) — true by design since command externalization
began (vm/secrets/mcp/udev/alias), but this silently regressed for check
(candy/plugin-check) and box's list word (candy/plugin-box) when they moved off a static core
Kong struct: both used to be real, typed subcommand trees reflected correctly into
charly __cli-model and Kong's own --help, and lost that fidelity with no replacement.

Fix (F-CLI-NEST): a class="command" capability may now DECLARE a one-level-deep subcommand
catalog over Describe (sdk.ProvidedCapability.Subcommands). When it does:

  • externalCommandHolder builds a REAL nested Kong grammar (a named cmd:"" child per declared
    entry, each still ending in its own pass-through Args leaf) instead of the flat holder.
  • resolveCommandDispatch (charly/provider_command_external.go, replacing the bare table lookup
    in main.go) resolves the one extra path token Kong now renders back to the registered dispatch
    entry + the selected child's name.
  • buildCLIModel (charly/cli_model_cmd.go) folds declaring capabilities into the reflected CLI
    model via a new declaringCommandHolders helper, so charly __cli-model (and MCP tool
    generation) sees a check.live / box.list.boxes leaf per entry.
  • A capability that declares nothing keeps today's flat holder byte-for-byte — zero behavior
    change for vm/secrets/mcp/udev/alias.

candy/plugin-check derives its catalog via the new sdk.KongSubcommands(&CheckCmd{}) reflection
helper (single source of truth: CheckCmd's own Kong tags, never hand-duplicated).
candy/plugin-box hand-declares its list word's catalog (boxes/candies/routes/services/targets/
volumes/aliases/tags) — dispatchList has no real Kong struct to reflect over.

Also fixed in the same cutover (blocking — this cutover's own change breaks it otherwise):
charly/main_freshness.go's shouldRefuseUnstamped special-cased check rendering as exactly
"check <args>"; F-CLI-NEST makes it render one token deeper ("check run <args>",
"check box <args>", …), which would have silently disabled the R9 stale-binary refusal gate for
check run. Fixed to match on the first path token.

Concrete edits:

  • candy/plugin-box/plugin.go — declares boxListSubcommands on the "list" word's capability.
  • candy/plugin-check/plugin.go — declares sdk.KongSubcommands(&CheckCmd{}) on the "check" word.
  • charly/main.go — resolveCommandDispatch replaces the bare extCmdTable[...] lookup.
  • charly/main_freshness.go — shouldRefuseUnstamped/checkSubcommandIsRun match the first path
    token instead of an exact "check <args>" compare.
  • charly/plugin_provider_common.go — capMeta.subcmds + declaredSubcommands() carrier method.
  • charly/provider_command_external.go — the nested-holder shape (nestedSubcommandType),
    commandSubcommandCarrier, resolveCommandDispatch, the dispatchCommand/dispatchInProcCommand/
    dispatchExternalCommand/externalCommandArgs/externalCommandExecPlan signature threading of
    the resolved subcommand name.
  • charly/cli_model_cmd.go — declaringCommandHolders folds declaring capabilities' holders into
    the reflected CLI model built by sdk.BuildCLIModel (this call itself came from main's
    concurrent sdk#73 CommandModel/CUE-generated-protocol cutover — merged in, see below).
  • Test coverage: charly/cli_model_cmd_test.go, charly/main_stamped_test.go,
    charly/provider_command_external_test.go, charly/provider_command_test.go.
  • sdk gitlink → 3ea39b11c6288347800dd6fdc23cd2e861c76ca2 (tag v0.2026201.542);
    charly/go.mod require bumped to match (in-tree resolution rides the replace directive; the
    require is staged for out-of-tree consumers per B2).
  • CHANGELOG/2026.198.2144.md — placeholder CalVer entry (pr-validator finalizes the merge-time
    version).

Merge conflict note (this branch was rebased onto main after main gained the federated
control-plane cutover, 56b1a6b, which independently added sdk#73's CommandModel/CUE-generated
protocol pipeline touching the SAME 3 files):

  • charly/plugin_provider_common.go — capMeta struct field-list conflict. Kept BOTH: this
    cutover's subcmds []sdk.CLISubcommand (proto field 12) and main's commandModel *spec.CLIModel / commandModelJSON []byte (proto field 13). The rest of buildCapMeta/
    liftCapabilities merged automatically (disjoint code regions).
  • charly/cli_model_cmd.go — main rewrote buildCLIModel to call the new
    sdk.BuildCLIModel(&modelCLI, "charly", CharlyVersion(), "") (the kong-reflection walk —
    kongLeafToModelLeaf/kongValueToArg/leafPath/etc — relocated wholesale into sdk, R3,
    alongside the CommandModel work). Resolved by keeping main's sdk.BuildCLIModel call and
    folding this cutover's declaringCommandHolders output into modelCLI.Plugins/
    modelCLI.Box.Plugins before that call; the now-dead local kong-reflection helpers were dropped
    (confirmed unreferenced elsewhere by go build ./... succeeding); declaringCommandHolders
    itself was kept (main has no equivalent).
  • charly/cli_model_cmd_test.go — two independent new tests (this cutover's
    TestBuildCLIModel_CheckAndBoxList; main's TestCLIModel_CoversAgentControlPlane) — kept
    both, no overlap.
  • Coexistence of both proto fields (12 and 13) proven by TestBuildCLIModel_CheckAndBoxList +
    TestCLIModel_CoversAgentControlPlane + TestCommandProviders_ExtractedReachMCP all passing
    together (pasted below).

Change class

charly-or-sdk Go (cross-repo: sdk lands first per B2 — already merged as 3ea39b1 /
v0.2026201.542 before this PR was opened; this PR is the charly consumer leg only).

How R10-tested — exact gate, commands, and pasted output

  • The gate for this change class: a cross-cutting CLI-dispatch/grammar change — the disposable
    bed roster whose kind matches the touched code path, run by the persistent orchestrator session
    against a fresh rebuild of this branch.
  • Eval beds run — the EXACT beds + per-bed results:
    • check-sidecar-pod | pod | ok | 12 steps | 486s — image-build/check-image/deploy-add/config/
      start/check-live/feature-run/update/feature-run-rebuild/cleanup all PASS. Every charly
      invocation in the run drives the reworked grammar construction + status/deploy dispatch.
    • check-charly-vm | vm | ok | 8 steps | 312s — vm-build/vm-create/deploy-add/check-live/
      update(152s fresh rebuild)/cleanup all PASS. The worktree-built opencharly-git was
      pacman-installed in a disposable Arch VM and charly version ran in-guest — a fresh-install
      proof of the new binary, not just a compile.
    • Both beds ran against the same binary this PR's HEAD produces (charly version = 2026.201.0600
      at the time of my local proof below; the beds' own fresh rebuild re-derives the stamp from
      their own build moment — see each bed's .check/<bed>/<calver>/summary.yml).
  • Fresh rebuild: task build:binary succeeded with zero go.work.sum drift; charly version
    → 2026.201.0600; both eval beds above additionally rebuilt fresh as part of their own update
    step (the VM bed's rebuild alone took 152s).
  • Did the CHANGED code path execute live? Yes — both the success path (real nested --help,
    real __cli-model leaves, real dispatch through the nested holder for box list boxes /
    check list) AND the freshness-guard scoping edge (check box <missing-image> still reaches the
    real error path, unaffected by the fix) executed live, pasted below.
  • Concurrency: N/A — this change does not touch the loader/discover walk, deploy ledger,
    podman store, resource arbiter, VM/pod lifecycle, or a build lock; it only changes Kong grammar
    construction + CLI-model reflection, both process-local and side-effect-free.
$ task build:binary
task: [build:binary] mkdir -p bin candy/charly/bin
task: [build:binary] cd charly && GOWORK=off go run ./internal/pluginsgen -root .. -config charly/charly.yml -out charly/plugins_generated.go -gowork go.work
task: [build:binary] CALVER=$(bash pkg/arch/calver.sh)
cd charly && go build -ldflags "-X main.BuildCalVer=${CALVER}" -o ../bin/.charly.next .
task: [build:binary] mv bin/.charly.next bin/charly
task: [build:binary] cp bin/charly candy/charly/bin/charly

$ ./bin/charly version
2026.201.0600

$ cd charly && go test ./...
ok  	github.com/opencharly/charly/charly	99.500s
ok  	github.com/opencharly/charly/charly/internal/pluginsgen	0.009s

$ cd charly && go test ./... -run 'TestBuildCLIModel_CheckAndBoxList|TestCLIModel_CoversAgentControlPlane|TestCLIModel_CoversCommands|TestCommandProviders_ExtractedReachMCP|TestShouldRefuseUnstamped|TestExternalCommandHolder_DeclaredSubcommands|TestExternalCommandExecPlan_NestedCheckCommand' -v
--- PASS: TestCLIModel_CoversCommands (0.02s)
--- PASS: TestBuildCLIModel_CheckAndBoxList (0.03s)
--- PASS: TestCLIModel_CoversAgentControlPlane (0.02s)
--- PASS: TestShouldRefuseUnstamped (0.00s)
--- PASS: TestExternalCommandExecPlan_NestedCheckCommand (0.00s)
--- PASS: TestExternalCommandHolder_DeclaredSubcommands (0.00s)
--- PASS: TestCommandProviders_ExtractedReachMCP (0.02s)
PASS

$ cd candy/plugin-box && GOWORK=off go build ./... && GOWORK=off go test ./...
ok  	github.com/opencharly/charly/candy/plugin-box	0.006s

$ cd candy/plugin-check && GOWORK=off go build ./... && GOWORK=off go test ./...
ok  	github.com/opencharly/charly/candy/plugin-check	0.005s

$ gofmt -l charly/ candy/plugin-box/ candy/plugin-check/
(empty)

$ cd charly && go vet ./...
(clean)

$ cd charly && golangci-lint run
0 issues.

$ task cue:gen
cue:gen: regenerated spec/{cue_types_gen.go,vocab_gen.go,version_gen.go}
... (all plugin params regenerated)
cue:gen: regenerated sdk/spec + plugin params
$ git status --short   # after cue:gen
(clean — no drift)

$ ./bin/charly check --help
Usage: charly check <command> [flags]
Commands:
  check box [<args> ...]         Pure-box check (disposable container, build-scope checks)
  check live [<args> ...]        Full-stack check against a running deployment
  check feature [<args> ...]     Run a running deployment's baked plan as acceptance tests; ...
  check run [<args> ...]         Run a disposable check bed (R10 sequence) or an iterate: entity ...
  check sync-credential [<args> ...]  Copy AI credentials into a score's target.
  check scope [<args> ...]       AI-facing: print the active iteration's scope.yml.
  check last-tag [<args> ...]    AI-facing: print the prior iteration's image tag.
  check self-evaluate [<args> ...]  AI-facing: re-run the in-scope plan live.
  check list [<args> ...]        List past runs under .check/.
  check report [<args> ...]      Print a past result-<calver>.yml.
  check note [<args> ...]        Persistent NOTES.md memory (read/append).
  check list-agent [<args> ...]  List configured agents.
  (run-local correctly absent — hidden:"" honored)

$ ./bin/charly box list --help
Usage: charly box list <command>
Commands:
  box list boxes [<args> ...]      List enabled boxes
  box list candies [<args> ...]    List every scanned candy
  box list targets [<args> ...]    List build targets in dependency order
  box list services [<args> ...]   List candies that trigger an init system
  box list routes [<args> ...]     List candies that declare a route
  box list volumes [<args> ...]    List candies' declared volumes
  box list aliases [<args> ...]    List candies' declared aliases
  box list tags [<args> ...]       List an image's tags in local podman storage

$ ./bin/charly __cli-model | python3 -c "..."   # leaf-path presence check
box.list.boxes -> FOUND, box.list.candies -> FOUND, box.list.tags -> FOUND
check.box -> FOUND, check.live -> FOUND, check.run -> FOUND
check.run-local -> absent (correct, hidden)

$ ./bin/charly box list boxes
check-k8s-deploy-app [testing]        (real dispatch, not just grammar)

$ ./bin/charly check list
No runs found under .check/.          (real dispatch through nested holder)

$ ./bin/charly check box nonexistent-image
charly: error: command "check": image not found in local storage: nonexistent-image
(freshness guard correctly did NOT block this — shouldRefuseUnstamped scoping stays "check run"-only)

Attribution tier

fully tested and validated — both disposable eval beds PASS at zero warnings against a fresh
rebuild (one a pod deploy, one a from-scratch pacman VM install of the built package), and every
new/changed code path (the nested holder construction, resolveCommandDispatch, the CLI-model
fold, the freshness-guard scoping fix) executed live against the fresh binary, pasted above.

Assisted-by: Claude Code (Anthropic Claude Sonnet 5; fully tested and validated)

Harness rulebook compliance

  • R0 skills: loaded /charly-internals:git-workflow (the WIP-landing sequence + B1/B2 flow)
    and /charly-internals:go (source map, sdk generation pipeline, module-verification-by-class)
    before touching any code or committing.
  • R1 RCA + zero warnings: every conflict, stale submodule checkout, and the stray uncommitted
    pkg/arch pkgver bump were root-caused before resolving (see conflict note above); full battery
    (build/test/vet/lint/cue:gen) is at zero warnings, pasted above.
  • R2 no out-of-scope: the plugin-http/plugin-port fakeCC test-build failures are
    pre-existing, same signature, unrelated to this diff (confirmed via standalone go test), and
    are already tracked as their own thematic-batch task — not folded into this cutover, not silently
    ignored either.
  • R3 no duplication: candy/plugin-check's catalog is DERIVED via sdk.KongSubcommands from
    CheckCmd's own Kong tags (never hand-duplicated); the nested-holder-vs-flat-holder logic is one
    shared code path (externalCommandHolder) branching on whether subcommands were declared, not a
    parallel implementation.
  • R4 no workaround: no sleep/retry/magic-number/env-shim anywhere in the diff; the
    resolveCommandDispatch two-step lookup (try full path, then drop the last token) is a
    documented, tested algorithm, not an ad-hoc string hack.
  • R5 hard cutover + grep: no identifier was removed by this cutover's own changes (all
    touched-function signatures gained a parameter rather than being renamed/removed); the merge
    absorbed main's own unrelated relocation of the kong-reflection helpers into sdk, confirmed
    complete by go build ./... succeeding (no dangling reference). No transitional/dual-mode path
    in the final code.
  • R6 git safety: ran git status + inspected submodule diffs before every submodule sync
    (pkg/arch, plugins, box/cachyos) and before discarding the stray uncommitted pkg/arch
    pkgver bump (confirmed it was a trivial build byproduct, not in-progress work, before
    discarding).
  • R7 runtime gate: yes — both disposable beds above are the end-to-end runtime gate, not just
    go test.
  • R8 artifact invariants: N/A — this change does not touch Containerfile generation or OCI
    labels.
  • R9 binary == source + deps: task build:binary rebuilt from this source; charly version
    matches; the VM bed additionally proves a fresh pacman -U install of the built package works
    end-to-end. No new runtime OS dependency introduced.
  • R10 disposable + coverage: both eval beds are disposable: true targets, fresh rebuild, zero
    warnings; new test coverage (TestBuildCLIModel_CheckAndBoxList,
    TestExternalCommandHolder_DeclaredSubcommands, plus updated
    TestCommandProviders_ExtractedReachMCP/TestShouldRefuseUnstamped) would FAIL on pre-fix code
    (the old assertion literally required check.box to be ABSENT — the exact regression this fixes).
  • RDD / ADE / SDD: RDD — an RDD spike (live kong.New) caught a latent Kong tag-vs-name bug
    before shipping (documented in the CHANGELOG); the composition-at-latest-versions risk (this
    leg's Go code against main's concurrently-landed sdk#73 CommandModel work) was proven by the
    live coexistence test run above, not a doc read. ADE: N/A (no candy plan:/description:
    touched). SDD: N/A (no .cue schema touched by this leg; sdk#72's own schema change landed and
    was proven in its own PR).
  • Hard cutover: this branch carries 4 commits (WIP freeze → merge → go.mod bump → CHANGELOG
    finalize) that will squash to one atomic commit on main; no Phase-2/TODO/deferred work left in
    this leg's scope.
  • Kernel/plugin boundary law: N/A for the placement question (no new capability, no
    core/plugin boundary crossed) — this changes only the HOST-SIDE generic Kong-grammar-construction
    • CLI-model-reflection MECHANISM (clause M: kind-blind, dispatched by declared-subcommand
      PRESENCE, never by a specific command word), consulting each plugin's DECLARED catalog (clause D:
      sdk.ProvidedCapability.Subcommands) rather than hardcoding per-command knowledge.
  • Disposable-only autonomy: both eval beds ran on disposable: true targets only.
  • Clean architecture + Go gates: gofmt -l empty, golangci-lint run = 0 issues, go vet
    clean, go test ./... green (all pasted above).
  • CHANGELOG: CHANGELOG/2026.198.2144.md staged (placeholder CalVer; pr-validator finalizes
    the merge-time version).

Assisted-by: Claude Code (Anthropic Claude Sonnet 5; fully tested and validated)

atrawog added 4 commits July 20, 2026 07:49
Consumes sdk#72's ProvidedCapability.Subcommands to fix two check-charly-selftest-pod
bed regressions: `charly check --help` showed a generic out-of-process placeholder
instead of the real subcommand grammar, and box.list.boxes vanished from the
charly __cli-model MCP reflection. WIP commit — battery + live proof pending.

Assisted-by: Claude Code (Anthropic Claude Sonnet 5; syntax check only)
# Conflicts:
#	charly/cli_model_cmd.go
#	charly/cli_model_cmd_test.go
#	charly/plugin_provider_common.go
Matches the sdk gitlink repoint to the merged F-CLI-NEST tip
(3ea39b11c6288347800dd6fdc23cd2e861c76ca2); in-tree resolution rides the
replace directive, but B2 stages the require for out-of-tree consumers.

Assisted-by: Claude Code (Anthropic Claude Sonnet 5; syntax check only)
…mer fix

Name the two actual disposable-bed R10 gates (check-sidecar-pod,
check-charly-vm) that proved this fix on a fresh rebuild, replacing the stale
check-charly-selftest-pod bed-name reference (that bed does not exist on this
tree's roster). Both beds PASS at zero warnings, confirming the fresh-rebuild
binary in both a pod deploy and a from-scratch pacman VM install.

Assisted-by: Claude Code (Anthropic Claude Sonnet 5; fully tested and validated)
@atrawog

atrawog commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — APPROVED ✅

Change class: charly + candy/plugin-check + candy/plugin-box Go (runtime), paired with an already-merged sdk proto/schema change (sdk#72 → 3ea39b11 / v0.2026201.542, verified an ancestor of sdk's real origin/main).

Head verified: b6dedd0573d8b3851694f0db8e9d6616df569613 (via git ls-remote, matches worktree HEAD).

Checklist (independently re-run/re-derived, not taken from the author's word):

# Item Verdict
0 Security & anti-tampering (T1–T4) PASS — diff matches description exactly (no scope mismatch), no secrets/exfiltration/new endpoints, no weakened guardrail, sdk gitlink bump verified ancestor of sdk's real main + real tag v0.2026201.542, no embedded directive aimed at the validator
1 Description completeness PASS — full template: summary, exact R10 gate/beds/pasted output, attribution tier w/ proof, full R0–R10+pillars section each with a concrete HOW
2 Change-class gate matches evidence PASS — cross-cutting CLI-dispatch/grammar change; ran check-sidecar-pod (pod) + check-charly-vm (vm), the two beds whose kind matches the touched surface (CLI dispatch is exercised by every charly invocation in both beds). No dry-run/rebuild-alone fraud — I re-ran the full battery myself, fresh, below
3 Attribution tier vs proof PASS — fully tested and validated justified: I independently rebuilt fresh (task build:binary, zero go.work.sum drift), re-ran go test ./... (97.7s, green), gofmt/go vet/golangci-lint run (0 issues), task cue:gen (clean git status, no drift), and drove the actual CLI live (--help, __cli-model, real dispatch) myself — see pasted output below
4 R0 skills honored PASS — loaded git-workflow, go, plugin skills by path; change is the "prescan-dispatch" in-core M-mechanism per the kernel/plugin boundary law, generalized via a DECLARED per-capability catalog (sdk.ProvidedCapability.Subcommands) rather than hardcoded per-word branching — matches /charly-internals:plugin's resolve-to-envelope/data-driven pattern
5 R1 RCA + zero warnings PASS — RCA documented in CHANGELOG (Kong grammar collapse mechanism); zero warnings across my own full battery (build/test/vet/lint/cue:gen)
6 R2 no pre-existing/out-of-scope split PASS — verified candy/plugin-http/candy/plugin-port fakeCC build failures are identical on current main (superproject root, HEAD 5f173df, tested standalone), untouched by this diff (0 files in plugin-http/plugin-port in the diff), and tracked as its own thematic-batch task (orchestrator task board #10) — not silently ignored, not folded in
7 R3 no duplication PASS — candy/plugin-check's catalog is DERIVED via sdk.KongSubcommands(&CheckCmd{}) reflection (single source, never hand-duplicated); the nested-vs-flat holder logic is one shared code path branching on catalog presence
8 R4 no ad-hoc workaround PASS — no sleep/retry/magic-number/env-shim; resolveCommandDispatch's two-step lookup is a documented, unit-tested algorithm
9 R5 hard cutover + grep PASS — no identifier removed (every touched signature gained a parameter); no transitional/dual-mode path in final code; merge-conflict fold (dual capMeta fields, sdk.BuildCLIModel coexistence) verified by my own test run — TestBuildCLIModel_CheckAndBoxList + TestCLIModel_CoversAgentControlPlane + TestCommandProviders_ExtractedReachMCP all green together
10 R6/R8/R9 R6 N/A-clean (no destructive action in this diff); R8 N/A (no Containerfile/OCI label surface touched); R9 PASS — rebuilt binary's version/content verified (strings marker for resolveCommandDispatch/declaringCommandHolders present in the built binary), VM bed independently pacman-installed + charly version in-guest per its summary.yml
11 R10 disposable/fresh-rebuild/coverage PASS — cross-checked both bed summaries on disk: .check/check-sidecar-pod/2026.201.0604/summary.yml (12 steps incl. bring-up/cleanup-members, ok: true, total_seconds: 486) and .check/check-charly-vm/2026.201.0605/summary.yml (8 steps, ok: true, total_seconds: 312) — both exist, both match the PR's claimed step-counts/durations exactly, no failed step, no contradiction. New coverage (TestBuildCLIModel_CheckAndBoxList, TestExternalCommandHolder_DeclaredSubcommands) would fail on pre-fix code (the old assertion literally required check.box ABSENT)
12 RDD/ADE/SDD PASS — RDD: live kong.New spike caught a real Kong tag-vs-name bug pre-ship (documented); ADE N/A (no candy plan/description touched); SDD N/A for this leg (no .cue touched here — the wire type sdk.CLISubcommand is sdk's own CUE-generated addition, validated in sdk#72's own PR) — I re-ran task cue:gen myself: clean, zero drift, TestGenReproducible + TestPluginsGenReproducible both green
13 Concurrency + anti-cheat N/A — no shared-state path (loader/discover walk, deploy ledger, podman store, resource arbiter, VM/pod lifecycle, build lock) touched; confirmed by reading the diff — this only changes Kong grammar construction + CLI-model reflection, process-local and side-effect-free
14 Hard cutover — one atomic commit PASS — 4 branch commits (WIP freeze → main-merge → go.mod bump → CHANGELOG finalize) will squash to ONE main commit; no Phase-2/TODO left in scope
15 ARCHITECTURE GATE PASS — see per-item trace + placement verdict below
16 Disposable-only autonomy PASS — both eval beds are disposable: true targets only
17 Clean architecture + Go gates PASS — I independently ran gofmt -l charly/ candy/plugin-box/ candy/plugin-check/ (empty), go vet ./... (clean), golangci-lint run ./... with an isolated GOLANGCI_LINT_CACHE (0 issues), go test ./... (green, 97.7s), plus GOWORK=off go build/test in both touched candy modules (green)
18 CHANGELOG PASS — CHANGELOG/2026.198.2144.md: filename matches ^\d{4}\.\d{3}\.\d{4}\.md$, H1 byte-equals # 2026.198.2144 — …, placeholder CalVer confirmed absent from main (no matching file, no v2026.198.2144 tag)

Architecture gate — per-item trace (staged charly/*.go)

All touched core files are already on the #118 RED kernel-manifest floor allowlist (verified by reading #118's diff directly) — this PR adds zero new charly/*.go files, so it cannot grow or shrink that gate's residue count:

  • cli_model_cmd.go (floor: M — __cli-model host seam) — adds declaringCommandHolders, a generic fold keyed on catalog-PRESENCE (data-driven), not a hardcoded word. No alias, no new kit import (only pre-existing github.com/alecthomas/kong).
  • main.go (floor: B — Kong parse/dispatch spine) — resolveCommandDispatch replaces a bare table lookup with the same generalized mechanism. No alias/kit import.
  • main_freshness.go (floor: D — binary freshness data) — shouldRefuseUnstamped retains a pre-existing hardcoded "check" literal (present before this PR at exact-match granularity; this PR only widens the match to a prefix so the fix doesn't regress the freshness guard). Not newly introduced or grown by this diff — flagged as existing inventory, non-blocking for this narrowly-scoped bugfix.
  • plugin_provider_common.go (floor: M — plugin loading / shared provider wiring) — adds subcmds field + declaredSubcommands(), a generic per-capability data carrier. No alias/kit import.
  • provider_command_external.go (floor: M — external command dispatch) — commandSubcommandCarrier, resolveCommandDispatch, externalCommandHolder, nestedSubcommandType, passthroughArgsType are all generic/data-driven off sdk.CLISubcommand; no hardcoded word anywhere in this file's new code. No alias/kit import.
  • cli_model_cmd_test.go, main_stamped_test.go, provider_command_external_test.go, provider_command_test.go — test files, N/A.

No *Legacy*-named identifier introduced. No new/grown charly/*_aliases.go. No new charly/ import of an sdk mechanism kit (kit/deploykit/buildkit/loaderkit/vmshared) — all sdk.* references are the pre-existing root sdk package import, extended to one more field/type it already ships.

placement: CORRECT — this generalizes an already-approved in-core M-mechanism (prescan-dispatch / CLI grammar construction) to be DATA-driven (a capability opts in via Subcommands) instead of requiring future per-word kernel branching — a move consistent with, not counter to, the boundary law's direction.

My own battery (independent re-run, fresh)

$ task build:binary   (fresh, zero go.work.sum drift)
$ ./bin/charly version → 2026.201.0614
$ cd charly && go test ./...  → ok (97.692s), ok (pluginsgen)
$ gofmt -l charly/ candy/plugin-box/ candy/plugin-check/  → (empty)
$ go vet ./...  → clean
$ golangci-lint run ./... (isolated GOLANGCI_LINT_CACHE)  → 0 issues
$ task cue:gen  → clean git status (no drift)
$ go test -run 'TestBuildCLIModel_CheckAndBoxList|TestCLIModel_CoversAgentControlPlane|TestCLIModel_CoversCommands|TestCommandProviders_ExtractedReachMCP|TestShouldRefuseUnstamped|TestExternalCommandHolder_DeclaredSubcommands|TestExternalCommandExecPlan_NestedCheckCommand' -v  → all PASS
$ (sdk) go test ./spec/... -run TestGenReproducible -v  → PASS
$ (charly/internal/pluginsgen) TestPluginsGenReproducible → PASS
$ GOWORK=off go build/test ./... in candy/plugin-box, candy/plugin-check → ok
$ ./bin/charly check --help  → real nested subcommand list (box/live/feature/run/…), run-local correctly hidden
$ ./bin/charly box list --help  → real nested subcommand list (boxes/candies/targets/…)
$ ./bin/charly __cli-model  → box.list.boxes/candies/tags FOUND, check.box/live/feature/run FOUND, check.run-local absent (correct)
$ ./bin/charly box list boxes  → real dispatch: "check-k8s-deploy-app [testing]"
$ ./bin/charly check list  → real dispatch: "No runs found under .check/."
$ ./bin/charly check box nonexistent-image-zzz  → real box-check error path (freshness guard correctly unaffected)
$ (candy/plugin-http) go test ./...  → SAME fakeCC/ResolveClusterContext build failure on main HEAD 5f173df — confirmed pre-existing, untouched by this diff
$ .check/check-sidecar-pod/2026.201.0604/summary.yml  → ok: true, 12 steps, total_seconds: 486 (matches claim)
$ .check/check-charly-vm/2026.201.0605/summary.yml  → ok: true, 8 steps, total_seconds: 312 (matches claim)
$ git ls-remote https://github.com/opencharly/charly refs/heads/fix/oop-command-grammar → b6dedd05... (matches worktree HEAD)
$ (sdk) merge-base --is-ancestor 3ea39b11... origin/main → true; tag v0.2026201.542 → 3ea39b11... (verified genuine)

Comments considered: none — the PR carries zero comments.

Cross-PR interactions considered:

  • #159 (fix/agent-config-drift-repair, OPEN, BLOCKED) — both PRs bump charly/go.mod's sdk require + the sdk gitlink. Verified: #159's pin (9b29e8b4) is a descendant of #160's pin (3ea39b1) and both are on sdk's real main. This is verified-non-blocking for #160 itself (no effect on this PR's own correctness/build), but it is the exact "Gitlink ANCESTOR bump" scenario /charly-internals:git-workflow documents (gh pr update-branch will report #159 CONFLICTING once #160 merges, needing the manual local-merge-then-verify-forward recovery, not a plain update-branch) — posting a coordination comment on #159 so its author/validator isn't surprised by that recovery step.
  • #118 (feat/p16-kernel-manifest-gate, OPEN, intentionally RED, merges LAST) — checked its diff directly: cli_model_cmd.go, main.go, main_freshness.go, plugin_provider_common.go, provider_command_external.go are ALL already on its kernelFloor allowlist. #160 adds zero new charly/*.go files, so it cannot change #118's residue/floor counts. verified-non-blocking, no coordination needed.

Decision: PASS. Every rule I can independently verify checks out — fresh rebuild, full battery, both bed summaries cross-checked on disk against the PR's exact claims, live CLI behavior re-driven myself, architecture/placement correct with zero new alias/kit-import surface, CHANGELOG format compliant, attribution tier earned. Proceeding to Phase 3 (CalVer finalization, merge, tag).

Assisted-by: Claude Code (Anthropic Claude Sonnet 5; fully tested and validated)

Assisted-by: Claude Code (Anthropic Claude Sonnet 5; fully tested and validated)
@atrawog
atrawog merged commit 09172e1 into main Jul 20, 2026
@atrawog
atrawog deleted the fix/oop-command-grammar branch July 20, 2026 06:32
@atrawog

atrawog commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — merge + tag outcome

  • Status re-posted on finalized head 7ffb72a (post-CalVer-rewrite): success — ALLOWED, zero denials (superproject-rooted, standard permissions.allow POST rule).
  • gh pr merge 160 --squash --delete-branch: ALLOWED — merged as 09172e1218cd2c666f890494a4c31a82190ef567, feat/oop-command-grammar deleted.
  • Tagged v2026.201.0629 on the merged HEAD, pushed, verified: git cat-file -t v2026.201.0629 → tag; git ls-remote --tags origin v2026.201.0629 → non-empty.
  • Verified the merged commit's sdk gitlink: git ls-tree 09172e1 -- sdk → 3ea39b11c6288347800dd6fdc23cd2e861c76ca2 (matches the validated pin).
  • CHANGELOG/2026.201.0629.md is the final filename; H1 byte-equals # 2026.201.0629 — ….

Verdict: PASS → merged (squash) as 09172e1218cd2c666f890494a4c31a82190ef567, tagged v2026.201.0629.

Assisted-by: Claude Code (Anthropic Claude Sonnet 5; fully tested and validated)

atrawog added a commit that referenced this pull request Jul 20, 2026
…er-cone

Merges origin/main (09172e1, PR #160 — restores nested CLI grammar for
check/box-list, touching cli_model_cmd.go/main.go/main_freshness.go/
plugin_provider_common.go/provider_command_external.go/candy/plugin-box/
candy/plugin-check) into feat/w9-loader-cone. Clean auto-merge, one real
conflict: charly/go.mod's sdk require version (HEAD's v0.2026200.1312 vs
main's v0.2026201.542) — resolved to v0.2026201.636, matching the sdk
gitlink bump below. None of #160's touched files overlap the W9 retype's
surface (layers.go/unified.go/resolved_project_host.go/render_baked_metadata.go).

sdk gitlink -> db63ef1 (sdk#75 merged main, tag v0.2026201.636) — the
CandyReader agent/terminal-profile accessors this cutover's render_baked_metadata.go
fix depends on are now landed upstream, so the previous local-only pin is
replaced by the real merged+tagged commit.

Verified: task build:binary (2026.201.0620, zero go.work.sum drift); charly
go test ./... 114.7s green; gofmt/vet/golangci-lint clean; GOWORK=off go mod
verify clean; superproject task cue:gen no-op beyond untouched submodule
pointer noise; charly box validate exit 0. candy/plugin-http and
candy/plugin-port fakeCC fixture failures reproduced with the identical
signature (*fakeCC missing ResolveClusterContext) already tracked as
pre-existing/unrelated (task #10's thematic batch) — confirmed untouched
by this merge, not fixed here.

Assisted-by: Claude Code (Anthropic Claude Sonnet 5; analysed on a live system)
atrawog added a commit that referenced this pull request Jul 20, 2026
…ft-repair

Update-branch recovery after #160 landed mid-validation
(09172e1, F-CLI-NEST consumer of sdk#72). Overlap with this cutover:
charly/go.mod + the sdk gitlink. Resolved descendant-wins per
/charly-internals:git-workflow: sdk gitlink fast-forwards to 9b29e8b
(sdk#74, tag v0.2026201.603, descendant of #160's 3ea39b1) and the go.mod
require stays at v0.2026201.603. Delta re-gate (non-empty overlap) follows:
rebuild + go test/vet/gofmt/golangci-lint + check-builder-vm re-run.

Assisted-by: Kimi Code (Moonshot K3; analysed on a live system)
atrawog added a commit that referenced this pull request Jul 20, 2026
…ne-local scratch paths

Repo-configuration validation failed on a pristine clone of main, two
build/check inputs silently depended on machine-local scratch state, and the
venue builder tarball name was a concurrency hazard. Five fixes, one theme
(repo tooling/config hygiene):

- .agents/skills developer profile re-synced to the plugins gitlink
  (v2026.200.1901): committed the 292-link profile incl. the previously
  untracked charly-automation--agent link, so plugins/setup <kimi|codex>
  --check developer passes on a fresh clone.
- scripts/validate-agent-config.py required terms now pin the current
  build:binary temp-output + atomic-promote contract (-o ../bin/.charly.next,
  mv bin/.charly.next bin/charly) instead of the stale -o ../bin/charly.
- taskfiles/Cue.yml bootstrap-cue no longer prefers /tmp/cue-rdd/cue (an
  RDD-spike scratch binary that silently won over the checksum-verified
  pinned download); sdk/bin/cue fallback + verified download are the only
  sources (sdk-side residue removed in opencharly/sdk#74).
- check-k3s-vm bed kv-charly-version invokes ${CHARLY_BIN} version directly
  (the /tmp/charly-build probe prefix was never populated on any host).
- runVenueHomeArtifactBuilder's venue transfer tarball now carries the host
  staging dir's unique MkdirTemp suffix (venueBuilderTarName), closing the
  two-concurrent-same-candy-deploys collision; covered by
  TestVenueBuilderTarNameUniquePerScope.
- sdk gitlink bumped to the merged sdk#74 squash 9b29e8b (tag
  v0.2026201.603; delta also carries the independently merged sdk#72
  F-CLI-NEST); charly/go.mod require bumped to v0.2026201.603.

Fresh pr-validator: independently re-ran the full gate (plugins/setup x3,
validate-agent-config.py, gate_test.py 35/35, gofmt/go vet/go test,
golangci-lint 0 issues, task build:binary + content marker, box validate,
cue:gen no-op, edited bootstrap-cue live), corrected the PR's "no bed can
exercise the venue naming" claim by running the matching disposable bed
itself (charly check run check-builder-vm PASS steps=10/236s on the branch
head), recovered the mid-validation landing of #160 via a descendant-wins
update-branch merge, and re-ran the non-empty-overlap delta re-gate on the
merged tree (full battery + check-builder-vm PASS steps=10/278s) — zero
warnings throughout.

Assisted-by: Kimi Code (Moonshot K3; fully tested and validated)
atrawog added a commit that referenced this pull request Aug 14, 2026
…ted file

.claude/settings.json's hook wiring is GENERATED by `charly marketplace
generate` (candy/plugin-marketplace/emit_hooks.go: mergeSettings drops the
plugin-owned hook entries and rebuilds them from the hook entities). Deleting
the block from the generated file alone left candy/charly-hooks/charly.yml
still declaring `trigger: PreToolUse` on both gates, so the next regeneration
would have restored the wiring — the cutover was not durable.

Drop `trigger:`/`matcher:` from the pre-commit-gate and pre-push-gate hook
entities, adopting the AUX form already used by gitcmd/gate-test: the scripts
are still emitted to .claude/hooks/, but no PreToolUse entry is wired.
.reasonix/settings.json is hand-maintained (the generator writes .claude/
only), so the other harness keeps its wiring.

Verified: regeneration yields settings.json with no hooks key and is
idempotent on a second run; both scripts still emitted; .reasonix PreToolUse
length still 2.

Also corrects the CHANGELOG, which named plugins PR #156 (an unrelated
cutover) instead of #160 (merge 3fa8ed9b, this PR's gitlink target), and still
claimed the docs-only class and `documentation reviewed` tier that the prior
review round rejected.

Assisted-by: Claude Code Anthropic Claude Opus 5 (1M context) (fully tested and validated)
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