fix(mods): engine.create in the validator's form; claude plugin validate passes on Claude Code 2.1.323+ (0.17.1) (#5017)

* fix(mods): engine.create in the validator's form; claude plugin validate passes on Claude Code 2.1.323+ (0.17.1)

hooks/noun.ts returned { ...added, ...beneath } from engine.create. Claude Code
2.1.323 and later refuse that in `claude plugin validate` ("this engine.create
hook is outside its form: a spread of anything but the value of next(e)"), for
0.16.2 and 0.17.0 alike; 2.1.319 accepted it. Reading beneath.ruflo to keep an
earlier step's noun is refused as well ("$.ruflo is used as a value"), so the
hook now returns { ...beneath, ruflo }. No other plugin defines engine.create,
so $.ruflo is unchanged in practice. The mod loaded and ran on those versions
already; only validation failed.

Tests: claude plugin test plugins/ruflo-mods 209/209 before and after;
claude plugin validate fails before, passes after (2.1.323, 2.1.325, 2.1.326);
headless `claude -p --plugin-dir` probe loads it with plugin_errors null.

Co-Authored-By: ruflo <ruv@ruv.net>

* test(mods): smoke.sh expects 0.17.1

Step 1 pins the plugin.json version; the 0.17.1 bump needs it too
(same as the 0.17.0 bump in 1acb1fc98). smoke.sh: 17 passed, 0 failed.

Co-Authored-By: ruflo <ruv@ruv.net>

---------

Co-authored-by: ruflo <ruv@ruv.net>
This commit is contained in:
Mr. Makandruflo authored and GitHub committed 2026-11-17 13:22:25 -05:00
1 parent 8966b06078
commit 07b79edc02
4 files changed
+11 -7

No files matched your search

@@ -1,7 +1,7 @@
{
"name": "ruflo-mods",
"description": "ruflo as a Claude Code mod (function hooks, ADR-404): in-process prompt routing, edit learning signals, tighten-only tool checks from ruflo policy, the cost-tracker budget ladder, a mod trust gate for newly installed mods, and the $.ruflo noun other mods compose their status with. Opt-in and removable: the classic hook-handler hooks stay the default and take every event back whenever the mod is not loaded.",
"version": "0.17.0",
"version": "0.17.1",
"repository": "https://github.com/ruvnet/ruflo",
"author": {
"name": "ruvnet",
+3
View File
@@ -2,6 +2,9 @@
Newest first. One `## <version> — <date>` heading per version, then `feat:`, `fix:`, `breaking:` and `chore:` bullets (ADR-478). Built from git history; older versions: `git log -- plugins/ruflo-mods`.
## 0.17.1 — 2026-11-17
- fix: `claude plugin validate` passes again on Claude Code 2.1.323 and later. `hooks/noun.ts` returned `{ ...added, ...beneath }` from `engine.create`, which the validator refuses ("this engine.create hook is outside its form: a spread of anything but the value of next(e)"); it now returns `{ ...beneath, ruflo }`. No other plugin defines `engine.create`, so `$.ruflo` is unchanged in practice. The mod already loaded and ran on those versions; only validation failed.
## 0.17.0 — 2026-11-11
- feat: `routeJudge` option (off by default, ADR-530). Each prompt is routed by one no-tools haiku completion that must answer with exactly one of the 11 ADR-391 labels; an off-label reply, a refusal, a timeout (4 s) or an error keeps the keyword route, and slash commands and `<…>` envelopes never reach the model. The route carries `reason: "model-judge"` (the vendored `$.ruflo` route contract is unchanged) and the context box says so. On the ADR-391 dev split it agreed with the labels on 70–71 of 84 prompts, against 27 for the keyword table.
+4 -3
View File
@@ -60,8 +60,9 @@ export function registerNoun(on: On, state: ModState) {
snapshot: async () => snapshotOf(state),
}
// Beneath wins: if another step already added `ruflo`, ours never replaces it.
const added = { ruflo }
return { ...added, ...beneath }
// Claude Code's validator (2.1.323+) accepts an engine.create hook only in its form: spread the value of
// next(e), then add this mod's own noun. Reading beneath.ruflo to let an earlier step win is refused too
// ("$.ruflo is used as a value"). No other plugin defines engine.create, so nothing else adds `ruflo`.
return { ...beneath, ruflo }
})
}
+3 -3
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# Structural + security smoke for ruflo-mods v0.17.0 (ADR-404, ADR-447).
# Structural + security smoke for ruflo-mods v0.17.1 (ADR-404, ADR-447).
# Static only: CI has no Claude Code, so the hooks module's behaviour is held
# by v3/@claude-flow/cli/__tests__/mods/*.test.ts and, where function hooks are
# on, by `claude plugin test plugins/ruflo-mods`.
@@ -12,9 +12,9 @@ ok() { printf "PASS\n"; PASS=$((PASS+1)); }
bad() { printf "FAIL: %s\n" "$1"; FAIL=$((FAIL+1)); }
HOOKS="$ROOT/hooks"
step "1. plugin.json declares ruflo-mods 0.17.0"
step "1. plugin.json declares ruflo-mods 0.17.1"
grep -q '"name": "ruflo-mods"' "$ROOT/.claude-plugin/plugin.json" \
&& grep -q '"version": "0.17.0"' "$ROOT/.claude-plugin/plugin.json" && ok || bad "name/version"
&& grep -q '"version": "0.17.1"' "$ROOT/.claude-plugin/plugin.json" && ok || bad "name/version"
step "2. hooks.json names exactly one module and no classic hook commands"
grep -q '"modules": \["./register.ts"\]' "$HOOKS/hooks.json" && ! grep -q '"command"' "$HOOKS/hooks.json" \