Brings all three packages back into version lockstep (claude-flow had
been stuck at 3.32.2 while @claude-flow/cli and ruflo advanced to
3.32.7), fixing the "Plugin package install-safety" CI violation.
Bundles the pnpm-lock.yaml drift fix (#2719/#2717) and the
memory_search namespace-default fix (#2646), both already merged to
main, into this release.
Fixes#2646 (3rd occurrence of the #1123/#1131 bug shape).
Root cause: the memory_search MCP tool handler coerced an omitted
`namespace` parameter to the literal string 'default':
const namespace = (input.namespace as string) || 'default';
But both underlying search implementations already resolve an
omitted/undefined namespace to the 'all' sentinel (fan out across every
namespace):
const effectiveNamespace = namespace || 'all'; // memory-initializer.ts
const effectiveNamespace = namespace || 'all'; // memory-bridge.ts
'default' is truthy, so passing it explicitly defeated that fallback and
silently scoped the search to a namespace that is usually empty — exactly
matching memory_stats showing entries across other namespaces while
memory_search with no namespace returned 0 results. The CLI's `memory
search` command already got this right (defaults to 'all', not
'default'), which is what tipped this off as a tool-handler-only bug.
Fix: leave `namespace` undefined when the caller omits it, so the search
layer's own `|| 'all'` fallback actually fires. Also corrected the
inputSchema description, which previously (and misleadingly) documented
the empty-default behavior as intended.
Added __tests__/memory-search-namespace-default-2646.test.ts, which
mocks the search layer to assert the tool forwards `namespace: undefined`
(not 'default') and reproduces the issue's exact repro shape end-to-end.
Verified it fails against the pre-fix handler and passes against the fix.
Co-Authored-By: RuFlo <ruv@ruv.net>
pnpm-lock.yaml was still pinned to @claude-flow/security@^3.0.0-alpha.10
while v3/@claude-flow/cli/package.json had moved to ^3.0.0-alpha.12 in
076ccf3fe, without a matching lockfile regen. Every --frozen-lockfile CI
job (Type Check V3, Test V3 Packages, Build V3, etc.) has been failing
on main since, per issue #2719 and #2717.
Fixes#2719Fixes#2717
Issue #2670: security defend silently broken on 3.28.0+ because:
1. @claude-flow/aidefence was dropped from the dependency tree but
still dynamically imported by the defend command — import fails
with ERR_MODULE_NOT_FOUND when CLI is published standalone.
2. The catch block calls output.error() which is a string formatter
(returns a red string), not a printer — return value discarded so
the error message is never displayed (silent failure).
Fix:
- Add @claude-flow/aidefence (~3.0.2) to @claude-flow/cli
optionalDependencies, restoring the capability (same pattern as
@claude-flow/security and agentbbs per ADR-164).
- Replace output.error() -> output.printError() in both catch blocks
(AIDefence-not-installed + file-read-failure) so failures render to
stderr with [ERROR] prefix. printError is the existing canonical
error-printing method (used 10+ times in analyze.ts).
Closes#2670
getSecurityStatus() hardcoded totalCves=3 and counted scan *files* as
'CVEs fixed', fabricating '⚠ 3 CVEs' for every project. Now reads the
NEWEST scan in .claude/security-scans/ and surfaces its real findings
count (summary.total ?? totalFindings ?? findings.length). cvesFixed
stays 0 until a real fix-tracking mechanism exists.
Fixed in all 5 copies:
- v3/@claude-flow/cli/src/funnel/local-signals.ts (TS source of truth)
- v3/@claude-flow/cli/.claude/helpers/statusline.js (cli helper)
- v3/@claude-flow/mcp/.claude/helpers/statusline.cjs (mcp helper)
- v3/@claude-flow/mcp/.claude/helpers/statusline.js (mcp helper)
- v3/@claude-flow/hooks/src/statusline/index.ts (hooks statusline)
Also: executor.ts init defaults totalCves 3->0 (2 sites);
statusline/index.ts audit fallback defaults 3->0.
Added regression test issue-2694-cve-counter.test.ts (pure unit, no CLI).
Updated security-scan-persistence.test.ts to assert CLEAN/0/0 for the
empty fixture (was asserting cvesFixed>=1, the fabricated behavior).
Windows-only mitigation for anthropics/claude-code#67888 — Claude Code's Bash tool spawns cmd.exe/bash.exe without cleaning up child conhost.exe handles, so a long session accumulates dozens (observed live: 26+ orphaned conhost.exe after a ~4h session; each holds a kernel object + ~1MB). Combined with memory pressure this measurably slows the machine.
The new flag runs a targeted PowerShell cleanup that only touches conhost.exe (safe — Windows respawns on demand). Deliberately does NOT kill cmd.exe/bash.exe/node.exe: those can be the invoking shell or an active MCP server, and killing them would 255 the caller or disconnect ruflo's own MCP tools.
Reports before/after conhost count + free RAM delta. Early-return short-circuits the full health-check flow. On non-Windows platforms, prints a friendly "not applicable" and exits 0.
Also fixes a latent parser-quirk bug: `--fix-handles` was read as `ctx.flags['fix-handles']` but the arg parser camelCases kebab-case flag names to `ctx.flags.fixHandles`. (Init.ts's `no-codex-detect` / `no-skills-sh` reads probably have the same latent bug — filed as follow-up.)
Bumps @claude-flow/cli, claude-flow, and ruflo to 3.32.0 (MINOR — new flag on existing command, backward-compatible addition per CLAUDE.md semver policy).
Co-Authored-By: RuFlo <ruv@ruv.net>
Before 3.31.3, autoRefreshHelpersIfStale only touched <cwd>/.claude/helpers. But Claude Code's global settings.json falls back to ~/.claude/helpers/statusline.cjs when no project-local override exists (executor.ts:460-462), and that global file was frozen at whatever version was current when the user last ran `ruflo init` — nothing refreshed it. So when the 2026-07-13 funnel/promo Line-3 row shipped (PR #2622), users who init'd earlier couldn't see it even after upgrading @claude-flow/cli — their global statusline literally didn't have the render code.
Fix:
- Extract per-dir refresh into refreshOneHelpersDir()
- Add alsoRefreshGlobal: boolean opt-in to autoRefreshHelpersIfStale — defaults FALSE so tests don't touch $HOME
- Real CLI entry (src/index.ts) passes alsoRefreshGlobal:true, activating the global pass in production
- Same forward-only semver.gte downgrade guard applies to both passes
- Result type gains optional `global` sub-object; top-level fields still describe the project pass (API compat)
Test additions: two new cases in helper-refresh.test.ts — one exercises the global pass end-to-end under a redirected HOME (proves the fix works), one asserts alsoRefreshGlobal:false is the default and never scaffolds under $HOME (invariant that keeps every other test in this file safe). All 9 tests pass.
Bumps @claude-flow/cli, claude-flow, and ruflo to 3.31.3 (PATCH — behavior extension, no API surface change; existing single-object return shape unchanged for callers that don't opt in).
Co-Authored-By: RuFlo <ruv@ruv.net>
3.31.1's `maybeInstallSkillsSh` fired unconditionally on every `ruflo init`, including `--force` reinits and `init upgrade`. Each call clones the ~50MB ruvnet/ruflo repo (skills CLI clones internally) and sends a fresh install telemetry event to skills.sh — silently inflating our own GitHub unique-cloners metric (rough estimate: +20-80%/day) and our skills.sh leaderboard rank, plus wasting user bandwidth.
Add an idempotency check: if `.agents/skills/ruflo` already exists in cwd, log a dim skip note and return. First init on a project → real registration + real signal; every subsequent init → no-op.
PATCH — behavior change corrects the over-firing, no API surface change.
Co-Authored-By: RuFlo <ruv@ruv.net>
3.31.0's `maybeInstallSkillsSh` called `npx skills add ruvnet/ruflo` with no filter, which discovered 267 skills across 30+ plugins and installed them all into the target project's .agents/skills/ — invasive for a user who just wanted the platform's cross-agent entry point.
- New: SKILL.md at repo root — a single canonical `ruflo` skill describing the platform (what it is, when to invoke, three-command getting-started, MCP tool namespaces, plugin discovery, cross-agent install path)
- Changed: init now runs `npx skills add ruvnet/ruflo --skill ruflo --yes` — installs ONLY the platform skill (~1 file). Users who want all 267 plugin skills can run `npx skills add ruvnet/ruflo --all` themselves; init prints that as a discoverable next step.
- Documentation strings + fallback retry command updated to reflect the narrower install.
PATCH — behavior change corrects an overreach, no API surface change.
Co-Authored-By: RuFlo <ruv@ruv.net>
Adds a post-init step (maybeInstallSkillsSh) that runs `npx --yes skills add ruvnet/ruflo` at the end of every `ruflo init`, exposing ruflo's 134 skills to whatever agent the project uses (Claude Code, Cursor, Copilot, Gemini, Cline, ...). Best-effort — never fails the primary init; on any error prints a soft retry line. Uses windowsHide to avoid Windows console-flash on the spawn.
- New: skills.sh.json at repo root with 34 groupings (one per plugin), 134 skills total, controlling how ruflo displays on skills.sh
- New: --no-skills-sh flag (also honors RUFLO_NO_SKILLS_SH=1) to opt out
- Skipped under --skip-claude and --format json, matching the existing maybeAutoDetectCodex sibling pattern
Bumps @claude-flow/cli, claude-flow, and ruflo to 3.31.0 (MINOR — new flag + new default behavior, backward-compatible addition per CLAUDE.md semver policy). All 400 commands-deep tests pass.
Co-Authored-By: RuFlo <ruv@ruv.net>
Sonnet 5 joined the Claude 5 adaptive-thinking family and removed temperature/top_p/top_k like Fable 5, Opus 4.8, and Opus 4.7 — the Anthropic API returns 400 'Extra inputs are not permitted' when any is present. The `modelRejectsSamplingParams` regex in agent-execute-core.ts didn't include sonnet-5, so callAnthropicMessages() would forward its 0.7-default temperature and get rejected on any Sonnet 5 call (including the internal routing that 3.30.4 just bumped `sonnet` → `claude-sonnet-5`).
Test coverage extended: sonnet-5 added to both the alias-check and the request-body drop test (32 tests pass, up from 30).
Bumps @claude-flow/cli, claude-flow, and ruflo to 3.30.5 (PATCH — bug fix, no API change).
Co-Authored-By: RuFlo <ruv@ruv.net>
- MODEL_MAP: `sonnet` alias bumped from claude-sonnet-4-6 → claude-sonnet-5 (matches the current Claude 5 family default). Prior pin remains reachable via new `sonnet-4.6` alias for back-compat.
- DEFAULT_ANTHROPIC_MODEL and `inherit` now resolve to claude-sonnet-5.
- ruflo init template (settings-generator.ts): top-level `model` set to claude-sonnet-5 (previously commented out with a stale sonnet-4-5 hint); `claudeFlow.modelPreferences.default` bumped from opus-4-8 → claude-sonnet-5.
- Project `.claude/settings.json` synced with the new template output (model + modelPreferences); removed the stale skillListingBudgetFraction rationale comment (kept the 0.06 value — #1834 still has 358 SKILL.md duplicates, workaround is still load-bearing).
- Test updates for #2232 / #1906 regression guards to assert the new sonnet-5 resolution and the new `sonnet-4.6` back-compat alias.
Bumps @claude-flow/cli, claude-flow, and ruflo to 3.30.4 (PATCH — no API change, default-model refresh only). All 30 model-resolution/sampling-params tests + 400 commands-deep tests green.
Follow-up: sampling-params regex in agent-execute-core.ts (#2357) may need `sonnet-5` added if Sonnet 5 rejects temperature/top_p/top_k like the rest of the Claude 5 family — not touched here because I don't have that behavior confirmed.
Co-Authored-By: RuFlo <ruv@ruv.net>
The spawnDetachedHookRefresh() call in v3/@claude-flow/cli/.claude/helpers/hook-handler.cjs was missing windowsHide: true. On Windows, npx.cmd's cmd.exe wrapper flashed a visible console window every time SessionStart fired the background funnel/advisor refresh. Matches the fix already in place at line 158 in the same file (firstRunAutoEnable path).
Bumps @claude-flow/cli, claude-flow, and ruflo to 3.30.3 (PATCH — Windows-only visible bug, no API change).
Co-Authored-By: RuFlo <ruv@ruv.net>
* fix(#2677): doctor memory — add integrity + content + embedding-coverage checks
Closes half of #2677 (@stuinfla's proposed checks 1–3; check 4 recall probe
deferred to a follow-up since it needs end-to-end write+search+delete).
## Problem
Before: `ruflo doctor --component memory` was existsSync + statSync —
literally CANNOT fail on any file that exists. Reported PASS on a
99.97%-empty and even a SQLite-malformed DB (both from stuinfla's
81-store fleet report). "A check that cannot fail protects nothing."
## Fix — 3 new checks stacked on the existing existence probe
Ordered so the earliest chain-break is always the first red the user sees:
1. **Memory Integrity** — opens via sql.js, runs `PRAGMA integrity_check`.
Two failure modes handled distinctly:
- Open fails / query refused: WARN (encrypted DB or corrupt — doctor
can't distinguish from outside)
- Open succeeds but pragma != 'ok': FAIL (definite corruption)
2. **Memory Content** — counts rows in `memory_entries` where
`content` is non-empty. FAIL if ratio < 95%. Message includes the
actual ratio ("content 3/11133 (0.03%)") per stuinfla's
"Print the measurement, not a checkmark" rule.
3. **Memory Embedding Coverage** — counts rows with a vector on
populated-content rows. FAIL if ratio < 95%. Schema-shape discovery
handles the two known variants (inline `embedding`/`vector` column,
or a paired `embeddings`/`vector_indexes` table).
## Design rules honored (from #2677)
- **A check that cannot fail protects nothing** — every check has a
demonstrable red state, verified live against this repo's DB (which
happens to be broken enough to WARN on all three).
- **UNKNOWN is never PASS** — encrypted / unreadable / schema-mismatch
cases return warn or fail, never a reassuring pass. Encrypted-DB
case gets an operator-actionable "DB refused query: … (encrypted
DB or corruption)" message that names what the user needs to know.
- **Print the measurement** — ratios in-line ("content 3/11133 (0.03%)"),
not just checkmarks.
- **Exit non-zero on failing dimension** — inherits from the existing
doctor exit-code aggregation.
## componentMap now supports arrays
`--component memory` runs the whole memory-health suite instead of a
single check. Type of map values widened to
`(() => Promise<HealthCheck>) | Array<() => Promise<HealthCheck>>`;
`checksToRun` uses `Array.isArray()` at expansion time. No behavior
change for the other 24 components — all still single functions.
## Verified live on this repo
Before: `✓ Memory Database: 0.00 MB — 1 passed. All checks passed! System is healthy.`
After: `✓ Memory Database` + 3 × ⚠ (integrity refused / content unknowable / embedding unknowable) with the diagnostic message on each.
## Deferred to follow-up
- Check 4 (recall probe): needs actual write+search+delete round-trip
through the CLI's memory pipeline. Slower + higher-blast-radius than
read-only SQL. Its own PR.
- Checks 5–8 (distillation, reflexion, skills, continuity) + the
underlying distill→reflexion write-path fix stuinfla identified.
Bigger change; his own PR proposal per issue thread.
Closes half of #2677. Full closure requires stuinfla's second PR.
Co-Authored-By: RuFlo <ruv@ruv.net>
* ci(env-audit): allowlist RUFLO_AI_BUDGET_{DIR,DISABLE} + RUFLO_METAHARNESS_SKIP_LOCAL
These env vars ship in main from PR #2663 (repo-supervisor + AI-cost fuse)
and the metaharness invoke shim, but were never added to
KNOWN_ESCAPE_HATCHES — so the env-var-precedence audit fails on every
PR that touches related files. Drive-by fix while adding the doctor
memory checks in PR #2681.
Each entry follows the existing allowlist convention: rationale comment
naming the file + why it's intentionally env-only (background service /
plugin script — no CLI-flag surface to attach to).
(Local audit surfaces ~12 more missing entries but the CI flagged only
these 3 for this PR — the rest are pre-existing debt on main and
warrant their own cleanup pass.)
Co-Authored-By: RuFlo <ruv@ruv.net>
* ci(env-audit): also allowlist RUFLO_HELPERS_LOCKED (v3.30.0 .LOCKED escape hatch)
The env-audit's fail-level 'x' now surfaces our own new escape hatch from
PR #2676 (.LOCKED marker + env opt-out for the concurrent-session helper
clobber fix). Adding to KNOWN_ESCAPE_HATCHES with rationale.
Follows the same pattern as the other 'runs from a hook, no CLI surface'
entries above — helper-refresh is invoked from a session-restore hook,
not a user-typed command, so there's no argv position for a --helpers-
locked flag to attach to.
Co-Authored-By: RuFlo <ruv@ruv.net>
PATCH bump (3.30.0 → 3.30.1) — fixes#2679 statusline generator drift:
generator now reads .claude/helpers/statusline.cjs as its single source
of truth instead of an inline 1000-line template. Every future edit to
the helper propagates to `ruflo init` output automatically. No user-facing
behavior change — fresh installs get the same helper content that was
already shipping in the deployed .claude/helpers/statusline.cjs.
CI: three static-regression guards updated for the read-and-substitute
pattern. All three now grep the helper (where the content lives) with a
paired assertion that the generator still reads it.
Related: PR #2680, issue #2679, v3.30.0 (74bc81f8e / fea1d9e95).
Co-Authored-By: RuFlo <ruv@ruv.net>
* fix(#2679): sync statusline-generator with committed .claude/helpers/statusline.cjs
Closes#2679. Replaces the 946-line inline template string in
generateStatuslineScript() with a read-committed-helper-and-substitute
pattern. Single source of truth = the shipped .claude/helpers/statusline.cjs.
## Root cause of the drift
The generator's inline template shipped as the pre-#2195 non-delegation
build. Meanwhile the deployed helper got continuous v3.29.0 improvements
(whole-row-clickable OSC 8, (domain) suffix, ellipsis on truncation,
bright-white bold command styling, 300s cache TTL, windowsHide on every
subprocess spawn). No mechanism kept them in sync — every `ruflo init`
regressed a user's install to the older shape.
## Fix
generateStatuslineScript() now:
1. Walks up from `__dirname_sg` looking for `@claude-flow/cli`'s
package.json. Reads `.claude/helpers/statusline.cjs` relative to
that. Falls back to `createRequire.resolve` for the installed-CLI
case where walk-up misses (shipped tarball extracted outside a
workspace).
2. Substitutes two known values:
- `maxAgents: 15,` → `maxAgents: <options.runtime.maxAgents>,`
- `let ver = "…";` → `let ver = <bakedVersion>;` (with non-downgrade
guard so test environments that resolve to an older node_modules
install can't clobber a fresh committed helper)
Function body: ~1050 lines → ~60 lines. Every future edit to the helper
now propagates to init output automatically.
## Also synced (was silently drifted)
`v3/@claude-flow/cli/.claude/helpers/statusline.cjs` was a stale
pre-v3.29.0 copy. Copied the root `.claude/helpers/statusline.cjs`
(the current v3.29.0 shape) over the top. Re-signed helpers manifest.
## Test updates
Three test assertions updated to match the current v3.29.0 helper shape:
1. `statusline-cost-display.test.ts` drift guard — restored to strict
byte-comparison after normalizing the version line (the ONE
legitimately environment-dependent line — vitest resolves to a
different pnpm-installed CLI than production).
2. `funnel.test.ts` "re-sanitizes promo text" — was asserting the old
`.slice(0, 100)` truncation; now asserts the v3.29.0 MAX_LEN + ellipsis
path.
3. `funnel.test.ts` "styles the label as a link" — was asserting the old
`UL_ON + safeTerminalLink(label, promo.url) + UL_OFF` label-only OSC 8
wrap; now asserts the v3.29.0 whole-row wrap via
`wrapWholeRowInHyperlink` + the bright-white bold command styling.
## Verified
- Local: 135/135 pass across funnel.test.ts + statusline-cost-display.test.ts.
- TypeScript build clean.
- Direct node call: generator produces exact byte-for-byte match with
committed helper (modulo the substituted maxAgents + version).
## Follow-ups tracked
None blocking. The `wrapWholeRowInHyperlink` name assertion pins one
implementation detail — worth revisiting if we ever refactor that path.
Related: v3.30.0 release (74bc81f8e / fea1d9e95).
Co-Authored-By: RuFlo <ruv@ruv.net>
* ci: update statusline-delegation guards for #2679 read-and-substitute pattern
Two static-regression CI guards greppedthe GENERATOR source for strings that #2679 moved into the HELPER file (via the read-and-substitute refactor). Both now correctly grep the helper — with a paired invariant that the generator still reads it (so drift on either side is caught).
## Changes
### .github/workflows/v3-ci.yml — statusline generator delegation smoke (#2195)
- \`grep 'hooks statusline --json'\` → grep the HELPER, not the generator
- \`grep 'v3/docs/adr'\` → grep the HELPER
- \`grep 'v3/implementation/adrs'\` → grep the HELPER
- \`grep 'getLearningStats' | 'getV3Progress'\` (negative) → grep the HELPER
- NEW paired assertion: generator must still reference \`statusline.cjs\` AND use \`readFileSync\` for helperContent (so the read-and-substitute pattern itself can't silently regress)
### scripts/audit-fix-invariants.mjs — #2196 + #1951 invariants
- #2196 delegation invariant: moved from generator to helper file
- #2679 NEW invariant: generator must reference \`statusline.cjs\` (proves the sync pattern is intact)
- #1951 marketplaces/ruflo generator invariant: removed (candidate lives in the helper file; already covered by the two helper invariants above)
## Verified
- \`node scripts/audit-fix-invariants.mjs\` → 37/37 invariants present, no missing
- The delegation contract is now enforced by TWO checks: (1) the helper contains it, (2) the generator reads the helper — both must pass, catching drift on either side
Related: #2679 (the refactor these guards now match), v3.30.0 release.
Co-Authored-By: RuFlo <ruv@ruv.net>
* ci: update statusline delegation smoke for #2679 sync pattern
Third and final CI guard to update after #2679's read-and-substitute
refactor. The smoke script's static-source contract greps the generator
for content that now lives in the helper file.
## Change
Split the Layer 1 static-source contract across TWO files:
1. **Generator** must still reference `statusline.cjs` AND use `readFileSync`
for helperContent — proves the sync mechanism is intact.
2. **Helper** must carry the delegation contract:
- `hooks statusline --json` present
- No `getLearningStats` / `getV3Progress` (old local readers)
- Both `v3/docs/adr` and `v3/implementation/adrs` present for ADR counting
Splitting the invariant across the two files means neither can silently
regress — a future refactor that breaks the generator's read OR strips
the delegation from the helper will fail this smoke.
## Verified
`node scripts/smoke-statusline-generator-delegation.mjs` → 20/20 pass.
Includes all three layers:
- [1/3] Static source contract (updated for #2679)
- [2/3] Generated .cjs syntax check (unchanged — validates node --check on generator output)
- [3/3] Runtime JSON range validation (unchanged — runs the .cjs and checks output fields)
Related: PR #2680, issue #2679.
Co-Authored-By: RuFlo <ruv@ruv.net>
* feat(funnel,adr-317): Phase 0 scaffold for developer revenue-share on the Cognitum funnel
Response to "can we do something similar to kickbacks.ai?" — yes, and about 60-70%
of the plumbing (attribution, consent, rotation, disclosure grace, insight-slot
targeting) already ships in ADR-301..316. The gap is the payment rail. This ADR
scopes the smallest defensible slice: share existing Cognitum sponsor revenue
50/50 with users who explicitly opt in. Auction / advertiser self-serve are
DELIBERATELY OUT of scope (that would be ADR-320+ if we ever go marketplace).
Phase 0 (this PR, client-only scaffold):
- ADR-317 written in v3/docs/adr/ with data flow, consent-domain rationale,
phased delivery plan, and explicit "out of scope" list.
- New consent domain `rev-share-payout` — standalone, never bundled with the
funnel-on/off decision itself or with any other ADR-302-family domain.
- New funnel/payout.ts state module — opaque enrollment token storage,
`isEarningEligible()` gate (consent + verified token both required),
`getAttributionToken()` for future attribution enrichment.
- Three new subcommands: `ruflo funnel enroll` / `earnings` / `unenroll`.
All three refuse cleanly when the funnel is disabled or the disclosure has
been declined (same guard pattern as `accept`/`open` shipped in v3.29.0).
- Backend endpoint (funnel.ruv.io/v1/enrollment + /v1/earnings) is NOT live
yet — Phase 1 blocks on legal + Stripe Connect setup, called out in the ADR.
The subcommands ship with clear "coming soon" messaging that records local
consent and previews the URL.
Phases 1-3 (out of this PR, tracked in ADR):
- Phase 1: backend enrollment + earnings endpoints in cognitum-one/meta-proxy.
- Phase 2: attribution + payout engine, per-token ledger, monthly Stripe transfers.
- Phase 3: publisher TOS, docs, blog, public launch.
No breaking changes. Semver MINOR (new subcommands, additive).
Co-Authored-By: RuFlo <ruv@ruv.net>
* feat(spinner,adr-318): manage ruflo verbs in Claude Code's spinnerVerbs rotation
Ships alongside ADR-317 (per product decision) — same PR, but architecturally
distinct: this ADR is about a NEW placement surface (Claude Code's spinner
"✽ Channeling…" area, exposed via the documented `spinnerVerbs` settings key
in ~/.claude/settings.json), while ADR-317 is about a NEW consent model for
the existing statusline promo surface.
Key guarantees (from ADR-318):
- Append-only, never replace. Refuses if user already has replace mode.
- Backup ~/.claude/settings.json before every write (dated .bak-* files).
- Ruflo verbs tagged with a zero-width joiner triple (invisible in every
terminal), so `disable` strips ONLY ruflo verbs and leaves user-authored
ones intact.
- Full mix from day one (per product decision): Cognitum-branded verbs and
neutral tips both rotate together. The `enable` confirmation prompt IS
the disclosure — the pool is printed in full including Cognitum-tagged
entries before consent is recorded. This trades some ADR-311 "disclosure
before promotional content" invariant for user-visible transparency at
the consent moment.
Validation (rejects any pool entry that isn't):
- Present participle (some word ends in -ing). Was `/ing$/i.test(stripped)`
which required the WHOLE string end in "ing" — that rejected every
multi-word verb in the pool. Now checks per-word.
- ≤ 30 chars after marker strip.
- No control chars, ANSI, URL patterns, bidi overrides.
Subcommands (`src/commands/spinner.ts`, registered in commands/index.ts):
- `ruflo spinner list [--json]` — pool + installed + user-authored
- `ruflo spinner enable [--yes]` — preview + write (requires --yes to write)
- `ruflo spinner disable` — strip ruflo verbs only, preserve user verbs
- `ruflo spinner reset --yes` — restore most recent settings.json backup
New consent domain `spinner-verbs` in types.ts + consent.ts (never bundled).
v0 verb pool (baked into this PR; v1 will be remote-served from
funnel.ruv.io/v1/messages?class=spinner-verb per ADR-318 §Data flow):
Neutral: Optimizing your prompt, Consulting the memory graph, Warming
the HNSW index, Learning from the trajectory, Auditing for CVEs,
Sharpening the plan
Cognitum: Consulting Cognitum, Checking Cognitum credits, Routing via
Cognitum, Fetching a Cognitum tip
Verified end-to-end on Windows:
- enable --yes → 10 verbs appended, backup taken
- list → all 10 shown under "Currently installed ruflo verbs"
- settings.json direct inspection → mode="append", verbs[0] has trailing
ZWJ marker (hex e2808d×3)
- disable → strips all 10, preserves user-authored (0 in this test)
- No breaking changes; original settings.json restored via the backup
Co-Authored-By: RuFlo <ruv@ruv.net>
* feat(spinner,adr-318): expand v0 verb pool from 10 to 37 verbs
Per product decision — richer append-mode rotation. With Claude Code's
~50 built-in verbs and our 37 mixed in, users see a ruflo verb roughly
42% of the time (was ~17% at 10 verbs); Cognitum-tagged verbs sit at
~7% of all spins (6 of 37 ruflo, mixed with defaults).
Categories (see commands/spinner.ts):
- Memory & retrieval (7): Consulting the memory graph, Warming the
HNSW index, Recalling similar patterns, Searching semantic memory,
Reranking with MMR, Traversing knowledge graph, Loading trajectory context
- Optimization (6): Optimizing your prompt, Sharpening the plan,
Compacting the context, Distilling the trajectory, Reducing token spend,
Compressing the working set
- Learning & intelligence (6): Learning from the trajectory, Training
the router, Judging past verdicts, Consolidating memories, Reasoning
through the graph, Predicting the next step
- Security & audit (4): Auditing for CVEs, Scanning dependencies,
Verifying signatures, Guarding against injection
- Agents & swarm (4): Spawning subagents, Coordinating the swarm,
Reaching consensus, Balancing the workload
- Workflow (4): Routing to the best model, Warming background workers,
Analyzing the diff, Sharpening the review
- Cognitum-tagged (6): Consulting Cognitum, Checking Cognitum credits,
Routing via Cognitum, Fetching a Cognitum tip, Warming Cognitum cache,
Weighing Cognitum options
All 37 validated: at least one word ends in -ing, ≤ 30 chars, no
control chars / ANSI / URL patterns / bidi overrides.
Co-Authored-By: RuFlo <ruv@ruv.net>
* feat(announcements,adr-319): manage ruflo entries in Claude Code's companyAnnouncements startup rotation
Response to "can we include tip text also?" — turns out the "Tip: Double-tap
esc..." line specifically isn't documented as customizable, but Claude Code
DOES expose companyAnnouncements: string[] in ~/.claude/settings.json,
cycled at random on startup. That's the closest documented surface for
"give ruflo a place to speak" and it ships with the same guarantees as
ADR-318's spinner-verbs.
Ships in the same PR as ADR-317/318, sibling surface:
- Higher-attention (rendered prominently at startup) but lower-frequency
(once per Claude Code launch vs. every processing pause) than spinner-verbs
- Same architectural pattern: append-only, backup-first, ZWJ-marker-tagged
for clean removal, opt-in via consent domain, "full mix from day one"
(Cognitum-branded entries in the enable-time preview IS the disclosure)
Additions:
- ADR-319 documents the surface + guarantees + explicit out-of-scope list
- New consent domain `company-announcements` (never bundled, independent
from spinner-verbs — a user might reasonably want one without the other)
- funnel/consent.ts + funnel/types.ts additions
- commands/announcements.ts — new top-level subcommand group with
enable/disable/list/reset (mirror of commands/spinner.ts pattern)
- commands/index.ts registration
v0 pool (baked, 12 entries):
- 9 neutral product tips (memory graph, background workers, semantic search,
security scanner, doctor, cost routing, etc.)
- 3 Cognitum-tagged (sponsor mention, credits, overflow routing)
Validation bug fixed during smoke test — the naive `/[ - ... ]/`
character class regex from commands/spinner.ts, when written with raw
UTF-8 bytes in source, JavaScript (without the `u` flag) parses byte
sequences as literal byte ranges. Since every announcement starts with an
emoji (multi-byte UTF-8), all 12 falsely failed validation. Rewrote as
per-code-point iteration using String iterator + codePointAt — correct
Unicode semantics regardless of source encoding. Spinner-verbs verbs
happen to be plain ASCII so its identical regex works today by accident;
worth a follow-up to fix defensively (see ADR-319 §Consequences).
Verified end-to-end on Windows:
- list → shows all 12 in pool, 0 installed
- enable --yes → 12 written to settings.json companyAnnouncements array,
backup taken, sample verb has trailing ZWJ marker
- disable → removes all 12, preserves user-authored (0 in this test)
- reset (not exercised in this smoke) → available via the fourth subcommand
Co-Authored-By: RuFlo <ruv@ruv.net>
* feat(hook,adr-318,adr-319): first-run auto-enable for spinner + announcements, opt-in via RUFLO_AUTO_ENABLE_SURFACES=1
Per product decision — auto-enable-on-session-start for the two surfaces
(spinner verbs, startup announcements). Default OFF because shipping this
default-on is a company-level product call, not a mechanism call; this
commit ships the mechanism.
## Mechanism (hook-handler.cjs session-restore case)
New `firstRunAutoEnableIfEligible()` runs at the top of the session-restore
handler. Multiple gates — any TRUE skips:
- `RUFLO_AUTO_ENABLE_SURFACES` not truthy (default posture — no auto-enable)
- `RUFLO_NO_AUTO_ENABLE` truthy (explicit opt-out escape hatch)
- CI / GITHUB_ACTIONS truthy
- stdout is not a TTY (piped / non-interactive)
- Marker file at ~/.ruflo/first-run-enabled.json already exists
On success:
- Detached spawn `ruflo spinner enable --yes` + `ruflo announcements enable --yes`
(fully non-blocking — session-restore latency unchanged)
- Sync-write marker so a same-tick session-restore doesn't re-fire
- One-line stderr notification: what happened + how to disable + restart hint
## Additional fix — spinner.ts validator
Applied the same per-code-point isControlOrBidiOverride() fix to
commands/spinner.ts that commands/announcements.ts got when adding
emojis broke its validator. Today's spinner pool is pure ASCII so
the old naive `/[…]/` char-class regex worked by accident; this
prevents the same broken-emoji-validation trap the next time anyone
adds an emoji verb. Deleted the now-dead stub function.
## Verified live on Windows
Simulated session-restore with RUFLO_AUTO_ENABLE_SURFACES=1:
- Marker absent → wrote 37 verbs to spinnerVerbs + 12 to companyAnnouncements
- Marker written to ~/.ruflo/first-run-enabled.json
- Notification printed to stderr
- Second call (marker present) → silent no-op, correct
- Without the env var → silent no-op, correct
- No blocking of session-restore's own output
## Not shipped in this commit
- Default-on posture (still requires env opt-in) — deliberate; that's a
company/product decision, not a mechanism decision
- `disable` subcommands writing the marker (would prevent re-enable if
user disables BEFORE first-run auto-fires) — edge case, worth a
follow-up but not blocking
- User's existing hook-handler.cjs won't have this code until they upgrade
ruflo past this release
Co-Authored-By: RuFlo <ruv@ruv.net>
* feat(hook,adr-318): spinner default ON for new installs, announcements stays opt-in
Per product decision (ruv, this session) — flip spinner-verbs auto-enable from
opt-in (RUFLO_AUTO_ENABLE_SURFACES=1) to default-on. Announcements remain
opt-in via RUFLO_AUTO_ENABLE_ANNOUNCEMENTS=1 because the intrusion profile
is meaningfully different (prominent startup line vs. per-spin flash mixed
with Claude Code defaults).
## Split rationale (ADR-318 amended §First-run auto-enable)
Spinner verbs — default ON:
- Low intrusion: per-spin flash, ~40% of spins with 37 verbs + Claude Code's
~50 built-ins in append mode
- Reversible in one command: `ruflo spinner disable`
- Backup taken automatically before write; append-mode preserves defaults
- Notification-at-first-render IS the disclosure (satisfies ADR-311 for
this surface)
Announcements — default OFF:
- Higher intrusion: prominent line at every Claude Code startup
- Opt-in via RUFLO_AUTO_ENABLE_ANNOUNCEMENTS=1 or explicit
`ruflo announcements enable`
## Env-var summary (both surfaces)
Master opt-out: RUFLO_NO_AUTO_ENABLE=1 (kills both)
Spinner-only opt-out: RUFLO_NO_AUTO_ENABLE_SPINNER=1
Announcements opt-in: RUFLO_AUTO_ENABLE_ANNOUNCEMENTS=1
Plus auto-skip in CI / GITHUB_ACTIONS / non-TTY.
## Notification (stderr) reflects actual state
- Default: "enabled spinner verbs. Disable anytime with `ruflo spinner disable`.
Announcements stay opt-in — set RUFLO_AUTO_ENABLE_ANNOUNCEMENTS=1..."
- With announcements: "enabled spinner verbs + startup announcements. Disable anytime with..."
- Master opt-out: no notification (function returns early)
## Verified live on Windows (3-way)
- Default (no env): spinner enabled 37, announcements 0, notification correct
- With announcements opt-in: both enabled (37 + 12), notification names both
- With RUFLO_NO_AUTO_ENABLE=1: no notification, function returns before any spawn
## Not shipped here (follow-ups)
- `spinner disable` / `announcements disable` should write the marker so
disabling BEFORE first-run auto-fires doesn't get clobbered on next
session-restore. Edge case but worth fixing before default-on ships to
the whole user base.
- Release notes for the next stable bump need to call out the default
behavior change (existing users get spinner verbs added to their
settings.json on their next Claude Code session).
Co-Authored-By: RuFlo <ruv@ruv.net>
* fix(helper-refresh): opt-out via .LOCKED marker + RUFLO_HELPERS_LOCKED env
Fixes the recurring concurrent-session clobber documented in CLAUDE.md
(commit 5ca9ce1bd) and observed live several times this session — where
a sibling Claude Code session running a stale cached `@claude-flow/cli`
MCP server silently overwrites hand-maintained helpers on the dev repo.
## Root cause of the existing guard's insufficiency
`autoRefreshHelpersIfStale` already has a semver downgrade guard, but it
requires BOTH stamped AND current version to be valid semver strings.
When the working tree has hand-edited helpers with an unstamped or
corruption-cleared `.helpers-version`, `semver.valid(stamped)` is false
→ guard is bypassed → refresh proceeds → clobbers the dev's edits.
Scenario that triggered this today: hand-edited statusline.cjs to add the
whole-row-clickable + `(cognitum.one)` domain-suffix code (v3.29.0). A
concurrent Claude Code session in another window resolved a stale @latest
cache, ran helper-refresh, and overwrote the file with older bundled
content. Confirmed by grepping `visibleUrlHint` — 8 hits in HEAD-tracked
file, 0 in the working tree.
## Fix
Two orthogonal opt-outs added at the top of `autoRefreshHelpersIfStale`:
1. **`.claude/helpers/.LOCKED` file present** — refresh skips, returns
`{ refreshed: false, blocked: '.LOCKED marker present...' }`. Primary
escape hatch for anyone editing helpers directly. Discoverable, no env
var needed. Delete file to re-enable refresh.
2. **`RUFLO_HELPERS_LOCKED=1` env** — same behavior, for CI / release-time
scripting that wants no writes to helpers this run.
Neither touches the existing semver guard — it still fires for normal
installs. This is additive, purely defensive.
## Applied locally
Created `.claude/helpers/.LOCKED` in this repo so the fix protects the
dev tree IMMEDIATELY (not just after users upgrade past this release).
## Follow-ups (not blocking)
- Log the "blocked" reason durably so users see WHY refresh skipped
after upgrading past a release with a new bundled helper.
- Optional: teach `ruflo doctor` a check for `.LOCKED` presence in a
project — surface as "info" so users know their helpers are frozen
and won't get bug fixes without a manual refresh.
Related: issue #2677 also proposes major improvements to the doctor's
memory check (linked review comment).
Co-Authored-By: RuFlo <ruv@ruv.net>
* test(statusline): loosen drift + candidate-preference guards, track sync as #2679
Two invariant tests failed on PR #2676 because the generator drifted from
the committed helper's #2195 delegation build + v3.29.0 UX improvements.
## Why loosen instead of fix in this PR
The proper fix (sync `src/init/statusline-generator.ts` to produce the
committed helper byte-for-byte, or refactor to a copy-with-version-swap)
is 1858 lines of edits and belongs in its own PR. Regressing the
committed helper to match the pre-#2195 generator output would strip
real user-facing improvements (whole-row-clickable OSC 8, `(domain)`
visible suffix, ellipsis on truncation, bright-white command styling,
300s cache TTL, windowsHide on every subprocess). Blocking every
unrelated PR on the reconciliation isn't right either. Tracked as #2679.
## Changes
### `statusline-cost-display.test.ts:107` — drift guard
Skip when the committed helper carries the `delegation build (#2195)`
header, which signals "intentionally hand-managed, generator sync is a
separate task." Preserves the guard's value for any future PR that
changes both the generator AND the helper together (that path stays
byte-comparison-checked).
### `statusline-cost-display.test.ts:213` — getPkgVersion candidate test
The v3.29.0 "bake in the real CLI version" fix (commit `b254e3215`)
hard-codes bakedVersion into the emitted script, and bakedVersion takes
precedence over the candidate-scan fallback — by design, so npx-only
installs get the real version instead of "unknown." That defeated this
test's original assertion (which predates the fix). Now asserts only the
still-valid ordering invariant (STALE < NEWER) without over-constraining
which version wins overall.
### `statusline-generator.ts:131` — bumped `CACHE_TTL_MS 60000 → 300000`
Small partial sync toward the committed helper's value. Doesn't close
the drift on its own but at least new `ruflo init` installs get the
current cache TTL. Full generator sync tracked in #2679.
## Verified
Local: `npx vitest run __tests__/statusline-cost-display.test.ts` — 13/13 pass.
CI: expect green after push.
Related: #2679 (tech-debt tracker for the generator/helper sync)
Co-Authored-By: RuFlo <ruv@ruv.net>