Skip to content

feat(candy): kimi — Moonshot Kimi Code CLI candy + agent catalog entry - #145

Merged
atrawog merged 2 commits into
mainfrom
feat/kimi-candy
Jul 18, 2026
Merged

atrawog merged 2 commits into
mainfrom
feat/kimi-candy

Conversation

@atrawog

@atrawog atrawog commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Summary of changes

Adds the Moonshot Kimi Code CLI as a first-class AI-CLI citizen, mirroring the
existing claude-code/codex/gemini integration exactly: one candy, one root
agent: catalog entry, one owning skill (landed via plugins#90).

  • candy/kimi/charly.yml + candy/kimi/package.json (new) — the candy:
    require: [nodejs], package.json pinning @moonshot-ai/kimi-code, installed
    globally under NPM_CONFIG_PREFIX (~/.npm-global) by the npm multistage
    builder. Three baked deterministic check: steps: the
    ~/.npm-global/bin/kimi binary, the unpacked scoped package under
    ~/.npm-global/lib/node_modules/@moonshot-ai/kimi-code, and
    kimi --version printing a semantic version.
  • charly.yml — new kimi: agent: catalog entry beside claude/codex/gemini:
    kimi -p "${PROMPT}" (verified live: -p rejects both --yolo and
    --auto, so plain prompt mode), kimi --version probe, optional
    ~/.kimi-code/credentials/kimi-code.json credential mount. Deliberately no
    output_format: the harness's stream-json runner-event parsing is the
    Claude wire format.
  • README.md — the kind: agent catalog enumeration names kimi.
  • plugins gitlink 7bd6300 → 9ab9b98 — the owning skill
    coder/skills/kimi (plugins#90, merged, tag v2026.199.2234).
  • .agents/skills/charly-coder--kimi + .agents/skills/.charly-profile.json —
    generator-owned skill link (developer profile now 290 skills).
  • CHANGELOG/2026.199.2359.md — dated entry (placeholder CalVer; the
    validator finalizes the merge-time version).

Out of scope (named next batch): composing kimi into
hermes-full/openclaw-full and the coder boxes — their @github pins
require the candy tag this PR creates; that is charly box reconcile
follow-up scope across the box submodules.

Change class

candy/box-config (new candy + agent entity + README enumeration +
documentation-gitlink bump)

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

  • The gate for this change class: charly box validate pre-flight, then —
    because no committed bed composes the new candy — the matrix's fallback R7
    sequence on a disposable deploy: build → charly check box → deploy →
    charly check live → fresh charly update. Executed as ONE
    charly check run check-kimi-candy-pod (a transient disposable bed whose
    fixture image directly composes check-keepalive + kimi on
    quay.io/fedora/fedora:43 with builder: {npm: fedora.fedora-builder});
    the transient entities were removed after the passing run (per-candy beds
    are not kept; kimi gains its permanent composing bed in the metalayer
    follow-up).
  • Eval beds run — the EXACT beds + per-bed results:
    check-kimi-candy-pod | pod | ok | 12 steps | 525s — on worktree binary
    ./bin/charly version 2026.199.2121 (R9: task build:binary from this
    tree), shared run-calver .check/check-kimi-candy-pod/2026.199.2234/.
  • Fresh rebuild: yes — the bed's update step (102s) is the R10
    fresh-rebuild leg (image rebuild → check → redeploy), plus
    feature-run-rebuild; summary.yml below, zero warnings.
  • Did the CHANGED code path execute live? Yes — the candy installed
    through the npm multistage (FROM ghcr.io/opencharly/fedora-builder:2026.199.2232 AS kimi-npm-build), all three baked checks ran at build scope AND live in
    the deployed container, plus an explicit runtime kimi --version probe
    (kimi-version-live). The kimi: agent entity is validated statically by
    charly box validate (plugin #AgentInput schema); harness scoring with the
    kimi runner is not exercised by this class's gate (no iterate: bed selects
    it — same as the codex/gemini entries).
  • Concurrency: N/A — no loader/ledger/store/arbiter surface touched
    (config-only addition; the bed ran alone).
$ ./bin/charly check run check-kimi-candy-pod        # run calver 2026.199.2234
charly check run check-kimi-candy-pod: PASS (steps=12)

$ cat .check/check-kimi-candy-pod/2026.199.2234/summary.yml
bed: check-kimi-candy-pod
calver: 2026.199.2234
steps:
  - {name: image-build,   duration_seconds: 259, ok: true}
  - {name: check-image,   duration_seconds: 20,  ok: true}
  - {name: deploy-add,    duration_seconds: 40,  ok: true}
  - {name: config,        duration_seconds: 9,   ok: true}
  - {name: start,         duration_seconds: 18,  ok: true}
  - {name: bring-up-members, duration_seconds: 0, ok: true}
  - {name: check-live,    duration_seconds: 28,  ok: true}
  - {name: feature-run,   duration_seconds: 22,  ok: true}
  - {name: update,        duration_seconds: 102, ok: true}
  - {name: feature-run-rebuild, duration_seconds: 23, ok: true}
  - {name: cleanup,       duration_seconds: 3,   ok: true}
  - {name: cleanup-members, duration_seconds: 0, ok: true}
total_seconds: 525
ok: true

# kimi candy checks — check-image (build scope) and check-live (deployed container):
PASS  check the kimi binary is installed into the npm global bin directory            [plan:candy:kimi:0]  ok
PASS  check the @moonshot-ai/kimi-code scoped package is unpacked under the npm global lib directory  [plan:candy:kimi:1]  ok
PASS  check running kimi --version exits cleanly and prints a semantic version        [plan:candy:kimi:2]  exit=0
# check-image total: 22 steps: 19 passed, 0 failed, 3 skipped (verify-mode skips)

$ ./bin/charly box validate            # EXIT=0, zero errors/warnings
$ ./plugins/setup kimi   --check developer   # EXIT=0 — developer (25 plugins, 290 repo-native skills)
$ ./plugins/setup claude --check developer   # EXIT=0
$ ./plugins/setup codex  --check developer   # EXIT=0 — developer (25 plugins, 290 repo-native skills)

$ cd charly && go vet ./... && go test ./...   # ok github.com/opencharly/charly/charly 92.066s (tree-hygiene; no Go change)
$ task build:binary && ./bin/charly version    # 2026.199.2121

RCA'd gate discoveries (zero warnings required honesty about the failures
along the way — all root-caused, none suppressed): (1) ad-hoc
bundle add <name> <ref> [--add-candy] pod deploys never connect the
out-of-process deploy-pod provider — loadDeployPlugins scopes providers to
plugin words from AUTHORED deploy nodes; (2) the add_candy overlay path
emits an empty npm builder ref (FROM AS kimi-npm-build, exit 125) when the
base image declares no builder:. Both are pre-existing product gaps noted
for a future core batch — the sanctioned authored-bed path is the correct
vehicle, used here. Also: kimi -p rejects --yolo/--auto (probed live),
which set the agent command shape.

Attribution tier

fully tested and validated — the changed runtime path (the candy's install +
all its checks) executed live on a fresh rebuild through the complete R7
sequence at zero warnings, and the change is config/candy/docs only.

Harness rulebook compliance — state HOW each is satisfied (or N/A — <reason>)

  • R0 skills: Loaded before authoring: /charly-image:layer (candy
    authoring, npm workflow, mandatory version/plan), /charly-check:check
    (R10 matrix — the candy-config gate), /charly-core:deploy (bundle add /
    add_candy semantics), /charly-coder:gemini (sibling pattern source).
  • R1 RCA + zero warnings: Five failures root-caused en route (missing
    sdk/pkg submodules in the worktree; two bundle add provider-gap probes;
    overlay exit 125 → empty BuilderRef) — each RCA'd before the next step;
    final gate at zero warnings. No "flake/environmental" anywhere.
  • R2 no out-of-scope: The two product gaps discovered are recorded in the
    changelog + this body as future-batch candidates (they pre-date this change
    and have a sanctioned alternative path). Nothing else deferred.
  • R3 no duplication: The candy mirrors the sibling npm-cli pattern via the
    SHARED npm multistage builder; no copied install logic (the package.json
    detection path is the single mechanism).
  • R4 no workaround: The overlay failure was not patched around — the
    vehicle moved to the sanctioned authored-bed path; no sleeps/retries/shims.
  • R5 hard cutover + grep: Nothing removed. git grep check-kimi-candy
    after the transient-bed removal: 0 references. Sibling enumerations swept:
    all claude-code/codex/gemini metalayer listings stay true (kimi not
    composed there yet); README agent catalog updated in-diff.
  • R6 git safety: Append-only feature branch; transient entities added and
    removed pre-commit (final diff carries only the shipped change); worktree
    status inspected before commit; plugins feat branch deleted only after the
    merged-squash SHA was recorded.
  • R7 runtime gate: Full R7 sequence ran (build → check box → deploy →
    check live → fresh update) — pasted above, not just go test.
  • R8 artifact invariants: The composed image carries the candy's baked
    plan (the three checks execute from the image's own plan — see check-image
    output) and the standard ai.opencharly.* labels (visible in the build
    log); the overlay Containerfile emission was inspected during RCA
    (.build/overlay-check-kimi-candy-pod/Containerfile).
  • R9 binary == source + deps: task build:binary from this tree;
    ./bin/charly version = 2026.199.2121; no new runtime OS deps
    (pkg/arch/PKGBUILD untouched).
  • R10 disposable + coverage: Ran on disposable: true only, fresh
    rebuild, zero warnings; the shipped coverage that fails without the change:
    the candy's three baked checks (absent the candy, no kimi steps exist) plus
    the developer-profile skill count 289→290 asserted by the setup drift
    checks.
  • RDD / ADE / SDD: RDD: npm package shape probed live
    (npm view @moonshot-ai/kimi-code → 0.27.0, bin: {kimi: dist/main.mjs});
    kimi -p flag rejection probed live; builder resolution proven by
    box generate BEFORE the build (concrete FROM ghcr.io/opencharly/fedora-builder:2026.199.2232). ADE: candy has
    description: + 3 deterministic check: steps; charly box validate
    passes. SDD: N/A — no .cue change.
  • Hard cutover: ONE atomic commit; no TODO/deferred; the approved plan
    executed as written (vehicle RCA documented).
  • Kernel/plugin boundary law: N/A — no core/sdk change (candy + config
    only).
  • Disposable-only autonomy: The only destroy/rebuild was the bed's own
    disposable lifecycle (plus its teardown cleanup, verified: no leftover
    container/quadlet/deploy record).
  • Clean architecture + Go gates: No Go change; go vet + go test ./...
    green from charly/ (tree hygiene), binary rebuilt (above).
  • CHANGELOG: CHANGELOG/2026.199.2359.md staged (placeholder CalVer — the
    pr-validator finalizes it).

Assisted-by: Kimi Code Moonshot Kimi K3 (fully tested and validated)

atrawog added 2 commits July 19, 2026 00:45
candy/kimi installs the Kimi Code CLI globally via npm (@moonshot-ai/kimi-code,
require nodejs — the claude-code/codex/gemini npm-global pattern), with three
baked checks: the ~/.npm-global/bin/kimi binary, the unpacked scoped package,
kimi --version printing a semver. The root charly.yml gains the fourth agent:
catalog entry (kimi -p "${PROMPT}", optional credentials/kimi-code.json
mount; no output_format — the harness's stream-json parsing is Claude-wire).
README's agent catalog names it; the plugins gitlink bumps to 9ab9b98
(plugins#90, the owning skill coder/skills/kimi) and .agents/skills gains the
generator-owned charly-coder--kimi link (290 skills).

R10 (candy-config class): charly box validate clean; transient
check-kimi-candy-pod bed → PASS (12 steps, 525s): fresh npm-multistage image
build, baked checks at build scope, live kimi --version in the deployed
container, fresh-update rebuild. Bed removed after the run.

Assisted-by: Kimi Code Moonshot Kimi K3 (fully tested and validated)
…tover

Assisted-by: Kimi Code Moonshot Kimi K3 (fully tested and validated)
@atrawog

atrawog commented Jul 18, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — APPROVED ✅

Change class: candy/box-config (new candy + agent: catalog entity + README enumeration + all-documentation plugins gitlink bump)

Bound head SHA: d29e8969f9f6a0b02fff5493c8204f7bfbd7e2b7 (author change 6c4f3e7 + validator merge-time CalVer commit; bound via git ls-remote, not gh pr view).

Checklist (every rule; N/A carries a one-line reason)

  • [PASS] 0. Security & anti-tampering (T1–T4): no exfiltration/secrets, no obfuscation, no embedded directives aimed at the validator; scope matches the description exactly (8 files, all accounted for); no guardrail files touched (hooks/rulebook/validator spec/branch protection untouched). Supply chain: one new npm dependency @moonshot-ai/kimi-code installed by the shared npm multistage builder — byte-pattern-identical to the sibling @anthropic-ai/claude-code / @openai/codex / @google/gemini-cli candies (all "*"); the package was installed and executed live in my own bed re-run.
  • [PASS] 1. Description complete: filled template — real per-file summary, change class, exact gate + pasted bed output, attribution tier, and every rule answered with HOW (no bare ticks).
  • [PASS] 2. Change-class gate matches evidence: the matrix row for candy config is pre-flight charly box validate + a bed that composes the candy, else the fallback R7 sequence on a disposable deploy. I verified no committed bed composes kimi (git grep over committed beds; the candy's own skill states the same), so the fallback is the correct gate — and I re-ran it myself (below).
  • [PASS] 3. Attribution tier justified: I certify fully tested and validated — the ceiling this class's clean gate earns; my own independent run of the complete sequence (fresh rebuild legs included) passed at zero warnings.
  • [PASS] 4. R0 skills honored: spot-checked against protected-main skill text — /charly-image:layer (the candy follows the documented package.json + require: [nodejs] npm recipe verbatim, incl. the scalar-command: shorthand), /charly-check:check (correct matrix row), /charly-internals:git-workflow (placeholder CalVer for the validator to finalize), /charly-coder:kimi (consistent with the diff).
  • [PASS] 5. R1 — RCA on every failure/warning; ZERO warnings: my gate run produced zero warnings (only Note:-level local-shadow lines + plugin DEBUG). One anomaly surfaced in my re-run and received a full RCA — see "Validator RCA" below. The author's two RCA'd gate discoveries (provider scoping on ad-hoc bundle add; empty overlay npm builder ref) were independently assessed: precise mechanisms named, both in code paths this PR neither touches nor depends on.
  • [PASS] 6. R2 — no out-of-scope split: the two pre-existing product gaps + my resolver finding are recorded with root mechanisms and routed to a named future core batch; each is provably separable (the gate passes without touching them). The metalayer-composition follow-up is dependency-ordered (B6): it needs the candy tag this merge creates, so it cannot be in this PR.
  • [PASS] 7. R3 — no duplication: the candy installs through the ONE shared npm multistage builder mechanism; package.json mirrors the sibling pattern with zero copied install logic.
  • [PASS] 8. R4 — no ad-hoc workarounds: no sleeps/retries/magic numbers/shims in the diff; the gate ran through the sanctioned authored-bed path.
  • [PASS] 9. R5 — hard cutover + grep self-test: nothing removed (pure addition). git grep check-kimi-candy HEAD → only the dated CHANGELOG narrative (allowed history). All kimi hits outside the 8 files are pre-existing and unrelated (the Kimi harness work from the base commit, the kimi-k2.5:cloud Ollama model name, the harness validator script). Transient bed entities verified absent from the committed tree.
  • [PASS] 10. R6/R8/R9: R6 — tree inspected before/after every mutation; my transient bed entities were added and removed, final git status clean at the PR head. R8 — the composed image carries the full ai.opencharly.* label set (candy_version: {"kimi":"2026.199.2359",...}, builder.use: {"npm":"fedora.fedora-builder"}, env_candy, path_append, baked plan) — verified via podman image inspect on the per-run-tagged build; the baked plan executes from the image itself. R9 — ./bin/charly version = 2026.199.2121, no charly/*.go newer than the binary (PR touches no Go); no new runtime OS deps.
  • [PASS] 11. R10 — disposable-only, fresh-rebuild, zero-warning, coverage-that-fails-without-it: bed is disposable: true; the update step is the fresh-rebuild leg; shipped coverage = the candy's three baked checks (absent the candy no kimi steps exist) + the developer-profile 290-skill drift check (re-run by me: plugins/setup kimi --check developer → EXIT 0, 290 skills). Author's on-disk summary cross-checked (matches the PR body byte-for-byte) — and I re-ran everything myself regardless (below).
  • [PASS] 12. RDD/ADE/SDD: RDD — npm package shape + kimi -p flag behavior probed live by the author, and the whole composition re-proven live by me. ADE — candy ships non-empty description: + 3 deterministic check: steps; charly box validate EXIT 0 (re-run by me on the committed tree). SDD — N/A, no .cue/proto/generated surface touched.
  • [PASS] 13. Concurrency mandate + anti-cheat: N/A — config-only addition, no loader/ledger/store/arbiter surface; single-bed gate is the matrix-correct roster for this class. No forbidden framing relied upon.
  • [PASS] 14. Hard cutover — one atomic commit: the PR is exactly one author commit; no TODO/Phase-2 in scope; plan executed as written.
  • [PASS] 15. ARCHITECTURE GATE — placement: placement: CORRECT — a new AI-CLI capability lands exactly where the boundary law puts it: a candy (capability layer) + a declarative agent: catalog entry + docs; nothing leaked into core/sdk. Per-item trace: no charly/*.go staged → no alias/kit-import/boundary items to trace (trace vacuously empty).
  • [PASS] 16. Disposable-only autonomy: all destroy/rebuild happened on the disposable: true bed only; teardown verified (no leftover container/quadlet/deploy record — re-verified by me after my own run).
  • [PASS] 17. Clean architecture + Go gates: N/A — no Go change (author's go vet/go test tree-hygiene run noted; the class matrix requires no Go gate for this diff).
  • [PASS] 18. CHANGELOG present: CHANGELOG/2026.199.2359.md placeholder staged; finalized to merge-time CalVer by me (Phase 4).

My independent R10 re-run (validator's own evidence, not the author's)

$ ./bin/charly box validate                                   # EXIT=0, zero errors/warnings
$ ./bin/charly version                                        # 2026.199.2121 (fresh vs charly/*.go)
# transient bed entities recreated verbatim in charly.yml (removed afterward; tree back at PR head)
$ ./bin/charly check run check-kimi-candy-pod                 # EXIT=0
charly check run check-kimi-candy-pod: PASS (steps=12)

$ cat .check/check-kimi-candy-pod/2026.199.2256/summary.yml
bed: check-kimi-candy-pod  calver: 2026.199.2256  total_seconds: 394  ok: true
  image-build 134s ok | check-image 20s ok | deploy-add 41s ok | config 9s ok | start 18s ok
  bring-up-members 0s ok | check-live 24s ok | feature-run 23s ok | update 101s ok
  feature-run-rebuild 22s ok | cleanup 4s ok | cleanup-members 0s ok

# kimi coverage (build scope AND live in the deployed container):
PASS plan:candy:kimi:0  ~/.npm-global/bin/kimi exists
PASS plan:candy:kimi:1  ~/.npm-global/lib/node_modules/@moonshot-ai/kimi-code/package.json exists
PASS plan:candy:kimi:2  kimi --version exits 0, semantic version
PASS kimi-version-live  (runtime probe inside the deployed container)

Validator RCA (one anomaly in my own re-run — verified-non-blocking): my bed's check-image step initially resolved ghcr.io/opencharly/check-kimi-candy-pod:2026.199.2242 — a stale deploy-alias overlay left in the local store by the author's run — instead of my fresh per-run fixture tag. Root cause (traced through sdk/kit/local_image.go): ResolveLocalImageRef ranks label candidates by content label-CalVer, tiebroken by tag CalVer; per-run fixture tags (<bed>-<runCalver>) fail ExtractCalVerTag (non-numeric first segment → "" → sort last), while leftover <deploy>:<calver> overlay aliases inherit the base's ai.opencharly.box label and carry parseable CalVer tags, so a stale alias outranks a fresh fixture. The stale image was content-identical (built from the same PR tree), and every other leg of my run — fresh fixture build, deploy, check-live against my container, the update fresh-rebuild leg — ran genuinely fresh. I then removed the two stale alias tags and re-ran the affected leg: charly check box check-kimi-candy-img → resolved my fresh post-update overlay …:2026.199.2302, all 22 steps PASS, EXIT 0. Pre-existing resolver behavior, untouched by and unrelated to this PR's content; recorded here as a candidate for the named future core batch (per-run tag shape vs ExtractCalVerTag, or bed teardown of overlay tags). No retry-to-green: one RCA, one targeted re-proof of the single compromised leg.

Phase 4 finalization: merge-time CalVer 2026.199.2315 (uniqueness-guarded: no v2026.199.2315 tag, no same-named CHANGELOG on main; origin/main unchanged at 8754530, not BEHIND). git mv CHANGELOG/2026.199.2359.md CHANGELOG/2026.199.2315.md + H1 rewrite, self-verified (head -1 byte-equals # 2026.199.2315 — \kimi` candy + `kimi` agent entity), pushed as append-only commit d29e896. **Re-gate decision: NOT required** — exact reason: git diff 6c4f3e7..d29e896 -- . ':!CHANGELOG'` is empty; the delta is the mechanical docs-only CalVer rename, so the runtime content validated by the R10 run is byte-identical at the final head.

Comments considered: none (the PR carries no comments).

Cross-PR interactions considered: charly#143 (candy/claude-code, candy/hermes-full, candy/openclaw-full, own CHANGELOG) — none-found (zero file overlap); charly#118 (charly/kernel_manifest_floor_test.go, own CHANGELOG) — none-found; plugins#88 (plugins-repo skill docs, different repo from this gitlink bump — no conflict either direction) — none-found. All verified by per-PR file lists, not by title.

Decision: PASS. Every applicable rule verified from the diff plus my own re-runs; the complete candy/box-config gate (pre-flight validate + full R7 sequence on a disposable bed + fresh-rebuild leg) executed green at zero warnings on my own invocation; the final head differs from the validated head only by the mechanical CalVer rename.

Assisted-by: Kimi Code Moonshot Kimi K3 (fully tested and validated)

@atrawog
atrawog merged commit a1f834a into main Jul 18, 2026
@atrawog
atrawog deleted the feat/kimi-candy branch July 18, 2026 23:18
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