Skip to content

feat(alias)!: externalize the alias CLI into compiled-in command:alias (P14b) - #68

Merged
atrawog merged 4 commits into
mainfrom
feat/p14b-alias-scaffold
Jul 12, 2026
Merged

atrawog merged 4 commits into
mainfrom
feat/p14b-alias-scaffold

Conversation

@atrawog

@atrawog atrawog commented Jul 12, 2026 •

Copy link
Copy Markdown
Contributor

P14b — externalize the charly alias CLI into the compiled-in command:alias candy

The alias half of P14 (the four judged candidates) in the core-minimization program. The
charly alias … CLI moves out of core into candy/plugin-alias (command:alias, compiled
into the default binary) — the command-class analogue of P10's command:vm. Core keeps ZERO
alias-command code.

What moved — the command, not the collector

charly/alias.go held three separable concerns; only the CLI command moved:

  • The charly alias command (AliasCmd + add/install/list/remove/uninstall, the
    wrapper-script helpers, the charly-alias marker, AliasInfo) → candy/plugin-alias.
    Dispatched in-proc via Invoke(OpRun) → kong-parse the AliasCmd tree (mirrors
    command:vm), so handlers own charly's real stdio.
  • The build-time collector (CollectBoxAlias, CollectedAlias), validation regex
    (aliasNameRe), and box-verb (ListAliasesCmd) stay in core (new
    charly/alias_collect.go) — each is a distinct kernel mechanism owned by its own cutover
    (the OCI-label bake → P8b/P14a; the load-time validation → P15; the charly box list-aliases
    box-verb → P15). They are not the command.

Host coupling — the generic HostBuild("cli") reentry, no new seam

add (does the box image exist locally) and install (read the baked ai.opencharly.alias
label) re-run charly box labels … host-side over the same reverse channel the pod/vm
lifecycles use. Every other subcommand is a pure ~/.local/bin wrapper-script op. CliMain
errors (like command:vm) — the canonical placement is compiled-in.

BREAKING

charly alias is now a dynamic command candy (a pass-through Args holder), so its subcommands
are no longer reflected into the out-of-process MCP tool surface (the alias.* tools are
removed) — matching the vm/feature/preempt externalizations. The
charly alias add/install/list/remove/uninstall CLI is fully preserved.

R5 sweep

Deletes charly/alias.go + charly/plugin_command_alias.go + the aliasCommand dedicated
builtin. The 16 plugin_command_*.go files that cited the deleted file are re-pointed to the
promoted canonical plugin_command_ssh.go. Stale command-placement comments in main.go +
cli_model_cmd.go swept. git grep for every moved identifier returns only
candy/plugin-alias.

Tests

charly/alias_test.go split — 7 wrapper-script tests → candy/plugin-alias/alias_test.go;
collector/validation/candy-layer tests → charly/alias_collect_test.go.
provider_command_test.go drops alias from the dedicated-builtin roster, adds
TestCommandCompileIn_AliasInProc (proves the in-proc inprocProvider registration), and
asserts alias.list is now ABSENT from the reflected builtin CLI model.
TestCLIModel_CoversCommands uses ssh.tunnel.spice in alias's place.

C15 residue routing (documented, not silent — CLAUDE.md R2)

A boundary-law assessment of the assigned kernel-manifest residue found none is a clean
atomic P14b move
— each is cross-cutting with an in-flight cutover or is fabric-floor — so
each is routed to its owning cutover (recorded in CHANGELOG/2026.193.1116.md):
retention.go → P15 (coordinated with T-P8b: plugin-build calls the current core prune
under the build-activity lock, leaving retention untouched, so retention→kit is a P15 unit
moved with the host_build_retention.go fold after P14a's labels→spec — not a build-followup);
volume_cp_tags_cmd.go → split P13 (volume/cp) / P15 (list-tags) / retention (invalidate);
shellcollect.go + hooks.go collector-half → P8b/P14a; vnc_helpers.go + transfer.go →
fabric/P15; version.go → stays fabric (binary identity).

Verification (per-tree binary via task build:binary + PATH-prepend; no install)

  • go build + go test ./charly/... ./candy/plugin-alias/... — green (charly 54s).
  • golangci-lint run — 0 issues (both modules); gofmt + golangci-lint fmt clean.
  • charly box validate — exit 0 (the candy's ADE plan + plugin: block).
  • pluginsgen reproducible (a second run is a no-op; TestPluginsGenReproducible green).
  • Fresh-rebuild live smoke (the R10 acceptance for the foreground/teammate scope; the full
    check-commands-local bed gate is the persistent session's):
    charly alias list --dest T            → exit 0
    charly alias add foo <nonexistent>    → HostBuild("cli") reentry fires: inner
      `charly box labels` reports "image not available locally… Run 'charly box pull'",
      outer wraps it → PROVES the in-proc command→host reverse-channel end-to-end. exit 1
    write marker wrapper → alias list shows foo/mybox/mycmd → alias remove foo → gone
    

Assisted-by: Claude (analysed on a live system)

…s (P14b)

The alias half of P14 (core-minimization): the `charly alias …` CLI moves out of
core into candy/plugin-alias (command:alias, compiled-in) — the command-class
analogue of P10's command:vm. Dispatched in-proc via Invoke(OpRun) → kong-parse the
AliasCmd tree; the `add` (image-exists guard) and `install` (read the baked
ai.opencharly.alias label) handlers reach the host over the generic HostBuild("cli")
reentry to `charly box labels …`, so no new host seam is added.

Core keeps only the genuinely-separate alias concerns, each owned by its own cutover:
the build/label collector CollectBoxAlias/CollectedAlias (P8b build engine / P14a OCI
labels) and the validation regex aliasNameRe (P15 OpValidate) relocate to
charly/alias_collect.go; the `charly box list-aliases` box-verb ListAliasesCmd (P15
box-family) stays.

BREAKING: `charly alias` is now a dynamic command candy (a pass-through Args holder),
so its subcommands are no longer reflected into the out-of-process MCP tool surface
(the alias.* tools are removed) — matching the vm/feature/preempt externalizations.
The `charly alias add/install/list/remove/uninstall` CLI is fully preserved.

R5: deletes charly/alias.go + charly/plugin_command_alias.go + the aliasCommand
dedicated builtin; re-points the 16 plugin_command_*.go files that cited the deleted
file to the promoted canonical plugin_command_ssh.go; sweeps stale command-placement
comments in main.go + cli_model_cmd.go.

Also documents the C15 residue routing (retention.go → build-family/P8b-followup,
volume_cp_tags_cmd.go → P13/P15/retention, shellcollect.go + hooks-collector → P8b/P14a,
vnc_helpers.go + transfer.go → fabric/P15, version.go stays fabric) — a boundary-law
assessment found none is a clean atomic P14b move; see CHANGELOG/2026.193.1116.md.

Assisted-by: Claude (analysed on a live system)
Claude-Session: https://claude.ai/code/session_01R8UGGr3ui1959oTb5JuSif
@atrawog

atrawog commented Jul 12, 2026

Copy link
Copy Markdown
Contributor Author

R10 bed gate (persistent session): PASS ✅

charly check run check-commands-local executed on the branch-built binary (worktree charly-wt-p14b @ 2bb64ad, task build:binary + PATH-prepend — the S0-proven per-worktree mechanism, /usr/bin/charly untouched):

charly check run check-commands-local: PASS (steps=5)
bed: check-commands-local
steps: deploy-add ✅ → bring-up-members ✅ → check-live ✅ → update (fresh charly update) ✅ → cleanup ✅
total_seconds: 84
ok: true
exit: 0

Full sequence incl. the fresh-charly update rebuild ran against the FINAL branch code with the compiled-in command:alias active. Combined with the author's pasted verification (go test/lint/fmt/box validate/live HostBuild-reentry smoke), the change-class gate is met.

Assisted-by: Claude (analysed on a live system)

T-P8b confirmed plugin-build calls the CURRENT core prune under the build-activity
lock, leaving retention.go/filelock.go/local_image.go untouched — so retention→kit is
a P15 unit (moved with the host_build_retention.go fold, after P14a's labels→spec),
not a build-followup pure-compute relocation. Team-lead ruled P15 authoritative.

Assisted-by: Claude (documentation reviewed)
Claude-Session: https://claude.ai/code/session_01R8UGGr3ui1959oTb5JuSif
@atrawog

atrawog commented Jul 12, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — APPROVED ✅

Change class: charly Go code + compiled-in command candy (runtime class)
Head validated: 92bd8fe (code cutover 2bb64ad + docs-only CHANGELOG routing 92bd8fe, confirmed all-.md)

Fresh, independent re-derivation — trusted no author claim; re-ran every gate myself.

Independently verified

  • go build + go test ./charly/... ./candy/plugin-alias/... → exit 0.
  • golangci-lint run → 0 issues (charly) + 0 issues (plugin-alias, GOWORK=off); gofmt -l + golangci-lint fmt --diff clean; go vet clean (both modules).
  • charly box validate (branch binary) → exit 0 (accepts the plugin-alias ADE plan + plugin: block).
  • pluginsgen reproducible (regen = no-op; TestPluginsGenReproducible green; plugins_generated.go+go.work clean after regen).
  • R10 bed — cross-checked on-disk .check/check-commands-local/2026.193.1141/summary.yml: 5 steps (deploy-add → bring-up-members → check-live → fresh charly update → cleanup) all ok:true, 84s, ok:true. Ran at 11:41 UTC — between the code commit (11:34) and the docs-only commit (11:44) → the gate ran against the material FINAL Go code (delta-re-gate; +1 commit is all-.md).
  • Reproduced the alias runtime smoke myself on the branch binary: charly alias --help dispatches; charly alias list --dest <tmp> → exit 0; charly alias add foo <nonexistent> fires the HostBuild("cli") reentry (inner charly box labels reports image-not-local, outer wraps it) — proving the in-proc command → host reverse channel end-to-end.
  • R5 grep self-test: plugin_command_alias + aliasCommand → zero hits; every moved identifier lives only in candy/plugin-alias/; the 16 comment re-points → plugin_command_ssh.go done; alias.list asserted absent from the CLI model. Kept-in-core residue (CollectBoxAlias/CollectedAlias/ListAliasesCmd/aliasNameRe) is genuinely wired to core consumers, not orphaned.
  • Boundary law: candy/plugin-alias imports sdk-only (never charly core); the change removes command code from core and adds zero new core capability. Kept residue is documented incomplete-seam routing (R2-compliant), not a silent split.

Checklist: security(T1–T4) ✅ · description ✅ · R7/R10 gate ✅ · tier ✅ · R0 skills(F8) ✅ · R1 zero-warnings ✅ · R2 residue-routing ✅ · R3 ✅ · R4 ✅ · R5 ✅ · R6/R8/R9 ✅ · R10 ✅ · RDD/ADE/SDD ✅ · concurrency(N/A — not a shared-state change) ✅ · hard-cutover ✅ · boundary-law ✅ · disposable-only ✅ · go-gates ✅ · CHANGELOG ✅

Decision: PASS. The charly alias CLI is cleanly externalized into the compiled-in command:alias candy (F8 pattern); core keeps zero alias-command code; the R5 hard cutover is complete; the in-proc dispatch + HostBuild("cli") reentry were reproduced live. Attribution tier analysed on a live system is exactly right — the changed command ran live (not against the fresh bed rebuild, which only proves the alias-compiled-in binary is healthy), so it is correctly not fully tested and validated. Finalizing the merge-time CalVer, squash-merging, and tagging.

Assisted-by: Claude (analysed on a live system)

atrawog added 2 commits July 12, 2026 13:58
Merge-time version stamp applied by the fresh pr-validator: rename the
placeholder CHANGELOG to CHANGELOG/2026.193.1200.md and align its H1 heading.
No code change — the validated P14b cutover rides underneath.

Assisted-by: Claude (analysed on a live system)
Claude-Session: https://claude.ai/code/session_018WkPC1aYyxvQZYGxspXBmH
@atrawog
atrawog merged commit 8264934 into main Jul 12, 2026
@atrawog
atrawog deleted the feat/p14b-alias-scaffold branch July 12, 2026 12:03
github-actions Bot pushed a commit that referenced this pull request Nov 24, 2026
… its output (#1257)

* chore(deps): adopt plugin-build v0.2026328.1 — a failed build carries its output

opencharly/plugin-build#68 merged as v2026.328.0001 (module v0.2026328.1): the build error now

carries the last 60 lines of buildctl's captured output, so a failing step's own ERROR line

reaches the log instead of being discarded with `exit status 1`.

That is the precondition for #1255: once a charly release carries this, a

failing build on this host prints the pacman error that has been invisible, and the base/build

defects behind pod-cdi#14 and the pod-comfyui beds can be diagnosed from the artifact.

go build ./... and go vet ./... pass at the bump; the module's own tests passed in #68.

*Agent: `image-lane-vram` · Claude Code session `739c9baf-e4cc-465c-9028-0a77b9ea7617`*

*Assisted-by: Claude Code deepseek-v4.1-flash:cloud (analysed on a live system)*

* chore(mods): align every lockstep module to the bumped shared pins

The sdk require this change adopts (v0.2026327.1021) is a SHARED pin: the core
module anchors it and every lockstep tools module must carry the same version,
which `tools/gomod-canonical`'s TestContractPinsMatchShared enforces in CI. The
bump moved core's anchor and left three tool modules behind, so the `go` job
went red on the previous head.

`charly task mods-tidy` is the sanctioned verb for exactly this (the control's
own message names it); it adopts the shared pins and tidies every lockstep
module. The result is six files — go.mod and go.sum in generate-packages,
golden-cloudinit and golden-compile — and the control is green:

  $ cd tools/gomod-canonical && GOWORK=off go test -count=1 ./...
  ok  	github.com/opencharly/charly/tools/gomod-canonical	0.003s

*Agent: `image-lane-vram` · Claude Code session `739c9baf-e4cc-465c-9028-0a77b9ea7617`*
*Assisted-by: Claude Code deepseek-v4.1-flash:cloud (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