* feat(mods): automatic context delegation (ruflo-mods 0.15.0, ADR-522) + release 3.71.0
New contextDelegation option (off | observe | enforce, default off). A
main-loop whole-file Read of a 14-120 KB file for an analysis prompt is
answered by a no-tools haiku $.model.complete on the session's own
credentials. Every quote is checked against the file and the model sees
only the cited passages (the file's own lines) plus how to read the rest.
The real Read always runs first, so a later Edit works (spike: answering
the Read without next(e) breaks Edit); any failure shows the whole file.
Live A/B (real binary, haiku main, 6 repo files 17-83 KB): 6/6 correct
both ways, 6/6 delegated, total cost -22.5% incl. worker, main input
-21.5%, wall +6.5%. First run delegated 0/6: haiku drops indentation in
quotes; the verifier now trims per-line whitespace and relocates up to 3
lines, showing the file's own lines.
Tests: 8 plugin tests, 3 real-binary e2e (extract + Edit, forged quote,
off), CLI parity test vs DEFAULT_CONTEXT_LIMITS and core verdicts. Smoke
step 4 now allows exactly one gated $.model.complete.
Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01MfPHVHXWyvDvDtYMTsA6MP
* ci: keep the claude-code test-kit plugin test out of the vitest ratchet
Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01MfPHVHXWyvDvDtYMTsA6MP
* feat(marketplace): list agentdb and agentic-flow as external plugins (ADR-518)
Adds both upstream Claude Code plugins to the ruflo marketplace as
git-subdir entries pinned to their plugin-v3.1.0 merge commits
(agentdb 401fcb68, agentic-flow 2c86073b). Each runs its own MCP server
pinned to the 3.1.0 package plus a mod guard command.
A real-binary e2e checks out the pinned commit and asserts the mod
answers its own command with zero model requests, with a negative
control the loader refuses. README rows and ADR-518 added.
Co-Authored-By: RuFlo <ruv@ruv.net>
* chore(marketplace): keep \u escapes so the diff only adds the two entries
Co-Authored-By: RuFlo <ruv@ruv.net>
* fix(console): give agentdb and agentic-flow a home section (plugin coverage)
Co-Authored-By: RuFlo <ruv@ruv.net>
* test: run the external-plugin e2e only in the real-binary tier
Co-Authored-By: RuFlo <ruv@ruv.net>
* chore(console): 0.49.8 — plugin map covers agentdb and agentic-flow
Co-Authored-By: RuFlo <ruv@ruv.net>
---------
Co-authored-by: r <r@x>
* feat(learning): run the verified-outcome learning loop on classic hooks for every ruflo project (ADR-512)
Until now only the opt-in ruflo-mods plugin recorded verified turns and showed lessons. Classic hooks
(every `ruflo init` project) now do the same. They replay the session transcript (`transcript_path`)
through the mod's own record and lesson code, bundled into .claude/helpers/learning-loop.cjs:
- route: records the turns that finished, then prints the lessons that fit the new prompt
- session-end: records the rest (PreCompact leaves the open turn open). This runs before the
session-id dedup, which otherwise dropped SessionEnd after a PreCompact. It also starts a
detached `ruflo hooks verified-ingest --quiet`
- one implementation: plugins/ruflo-mods/scripts/build-learning-loop-helper.mjs bundles
hooks/loop/transcript.ts; the bundle is committed, checked in mod-guidance CI, and is a signed
critical helper that helper-refresh installs (manifest re-signed)
- never twice: with its loop on, the mod adds `learning-loop` to RUFLO_MODS_OWNS
- opt-out: .claude-flow/config.json learningLoop.enabled=false, or RUFLO_LEARNING_LOOP=0
Tests: mods-learning-loop-classic (replay matches the mod's records, offsets, the hook-handler run
as a process, end to end classic record -> real ingest -> lesson in route output) and real-binary
contract 6 (pinned claude, mock model, no plugin). ruflo-mods 0.14.0.
Co-Authored-By: RuFlo <ruv@ruv.net>
* docs(adr): ADR-512 cites PR #4604
Co-Authored-By: RuFlo <ruv@ruv.net>
* ci: sign and exclude the classic-loop helper and real-binary test where the other helpers are (ADR-512)
smoke-helper-signing-security copies the critical helpers into its fixture; it now copies
learning-loop.cjs too. The ratchet's default run skips real-binary files, which need the
claude binary (mods-real-binary runs them).
Co-Authored-By: RuFlo <ruv@ruv.net>
* test(mods): give the built-CLI tests the time their children get
vitest's 5s default timed out mods-cli-bin on a loaded CI runner and reported only
STACK_TRACE_ERROR (the timeout error carries the stack of the it() call). Each test runs the
built CLI several times with a 120s child timeout.
Co-Authored-By: RuFlo <ruv@ruv.net>
---------
Co-authored-by: r <r@x>
* test(mods): real-binary test tier with a scripted mock model (ADR-504)
Runs the real `claude` binary headless against a local mock of the
Anthropic Messages API, with ruflo-mods loaded through --plugin-dir in a
throwaway project with its own HOME. No API key, no paid model.
- mock-model.mjs: scripted Messages server (streaming and not), logs
every request; untool'd or unknown requests get a minimal answer.
- run.ts: runner with a minimal child environment, PATH recorders for
dangerous commands, and readers for events, requests and files.
- loads.test.ts (contract 1): with every option on, the heartbeat is
written, /ruflo-mods is registered and answered with no model request.
Negative control: a #4485-shaped copy (second bare session.start) is
refused silently by the real loader and fails those assertions.
- contracts.test.ts (contracts 2-5): verified-success record from a
scripted fix turn; [RUFLO_LESSONS] reaches the request (and not below
the gate); ruflo denies the root delete with its own reason and denies
a listed command the engine allows (which runs without the plugin);
the route block reaches the request (and not without the plugin).
- Excluded from the CLI, v3 and root-ratchet default runs; run with
`npm run test:real-binary`. New CI job mods-real-binary pins Claude
Code 2.1.289 and fails, naming the step, if the binary will not start.
Co-Authored-By: RuFlo <ruv@ruv.net>
* docs(adr): ADR-504 status names PR #4589
Co-Authored-By: RuFlo <ruv@ruv.net>
---------
Co-authored-by: r <r@x>