Skip to content

feat(kaizen): kaizen upgrade lists and applies the migrations a repo still needs (4.3.0) - #44

Merged
Lingelo merged 4 commits into
mainfrom
ccr-8ab01603-apdrcp
Oct 21, 2026
Merged

Lingelo merged 4 commits into
mainfrom
ccr-8ab01603-apdrcp

Conversation

@Lingelo

@Lingelo Lingelo commented Oct 21, 2026

Copy link
Copy Markdown
Owner

Summary

S1 of the plan docs/plans/2026-10-21-0700-feat-kaizen-upgrade-plan.md (included). Until now, each change a repository needed after a Kaizen update was signalled somewhere else (config, two doctor checks) or nowhere.

kaizen upgrade [--apply] [--json] — scripts/upgrade.mjs, a registry of migrations, each detected from the repository's state (never a stored version: fresh clones and hand-fixed repos get the right answer):

Migration Since --apply
learnings-folder 2.0.0 by hand: git mv <docs>/solutions <docs>/learnings
marketplace-dojo 3.1.0 adds kaizen@dojo; the old kaizen@<other> key is left to the team (listed as a manual step)
profile-names 3.4.0 rewrites the "profile" value only, in config.json and config.local.json
kaizen-ops 4.0.0 enables kaizen-ops@dojo for clones (not when enabled in any settings)
hook-lookup 4.1.2 refreshes the CLI lookup line of Kaizen's hooks (refreshHookLookups, extracted from installGitHooks: never installs or wires hooks)

--apply lists the files to commit and is idempotent. Nothing pending outside a Kaizen repo.

Evals (run on 4.2.0 before this work): 33/33 green after fixing three that followed behaviour changed by design — constitution-create (headless draft: 3 to 6 evidence-backed articles + AI policy; now also checks draft status and evidence lines), review-models (auth.js raised the cycle to critical, all opus as designed: fixture now a non-risk file, check against the effective profile), review-evidence (18-line branch = light review without agents: a test file takes it past 20 lines).

Kaizen 4.3.0: README and CLI reference, CHANGELOG, CLAUDE.md. S2 (4.4.0) will surface pending migrations in doctor/help/setup and add the CHANGELOG contract.

Test plan

  • node --test plugins/kaizen/tests/*.test.mjs plugins/kaizen-ops/tests/*.test.mjs → 219 pass, 0 fail
  • tests/upgrade.test.mjs: AE1 (old repo lists profile-names, kaizen-ops, hook-lookup), AE2 (applied in place, spacing and team hook line kept, idempotent), AE3 (learnings folder manual, untouched; custom docs_root), marketplace-dojo (old key kept), negative and fixed-by-hand cases, user-level kaizen-ops, foreign hooks
  • node plugins/kaizen/evals/run.mjs → 33/33 (the three fixed scenarios rerun for real)
  • plan check on the plan ✔
  • CI: 6 jobs (Ubuntu/macOS/Windows × Node 18/22)

Generated by Claude Code

…writes

Since the draft rule (48e1c8e), /kaizen:constitution without anyone to answer
writes a draft of 3 to 6 evidence-backed articles plus the AI policy; the eval
still required 5 to 9. It now checks 4 to 7 articles, the draft status and an
evidence line per article.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012iZk6aQ3fhJy4jrZhfWtaf
…w threshold

review-models compared reviewer models to the base profile, but src/auth.js
raised the cycle to critical (every reviewer on opus, as designed): the file is
now a non-risk report export, and the check uses the effective profile.
review-evidence's branch was 18 lines, a light review that launches no
reviewer by design: a test file takes it past 20 lines.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012iZk6aQ3fhJy4jrZhfWtaf
…still needs (4.3.0)

S1 of docs/plans/2026-10-21-0700-feat-kaizen-upgrade-plan.md. A registry of
migrations (learnings-folder 2.0.0, marketplace-dojo 3.1.0, profile-names 3.4.0,
kaizen-ops 4.0.0, hook-lookup 4.1.2), each detected from the repository's state;
`kaizen upgrade` lists them with version, reason, files and manual steps, and
`--apply` runs the automatable ones with targeted edits, never removing the
team's settings, listing the files to commit, idempotent.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012iZk6aQ3fhJy4jrZhfWtaf
@Lingelo
Lingelo merged commit d12c298 into main Oct 21, 2026
6 checks 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.

2 participants