#3614 shipped ruflo-console on main, so `ruflo init` and `ruflo mods install`
now install it like ruflo-mods and ruflo-swarm. A marketplace clone without
it is stale (a doctor failure with the exact repair), never "pending".
- MOD_PLUGINS: ruflo-console@ruflo required: true.
- `ruflo mods install` points at /ruflo (and /ruflo mods) instead of /ruflo-mods.
- ADR-406 catalog: the source scan now reads `$.command.registerCommand`, and
the engine parser splits a `command=a|b` matcher into its names and treats
`command=?` (a matcher chosen at run time) as naming nothing, deferring to
the source scan for that plugin. Without this, regenerating after #3614
either failed schema validation (`ruflo|ruflo-console`, `?`) or dropped the
five /ruflo-swarm-* commands. Regenerated: 241 -> 243 entries (+/ruflo,
+/ruflo-console), none removed; the console's catalog copy is synced.
- Tests and the e2e-mods-init script now expect ruflo-console installed.
Co-Authored-By: RuFlo <ruv@ruv.net>
- mods uninstall runs `claude plugin uninstall <id> --scope <scope>` for
exactly the plugins ruflo installed (absent before, enabled by ruflo;
recorded as claudeInstalled in install.json), then removes exactly the
settings keys it added. A plugin installed before is never uninstalled.
- mods install --source local [--marketplace-path <dir>]: declares the
ruflo marketplace as a directory source (a ruflo checkout), adds it, and
installs nothing, so the plugins load live from the working tree.
Verified on 2.1.287 in an isolated config: loads with no install record,
and an edit shows on the next run. Doctor reports the source type and
warns when the project's declared source differs from the known one.
- The repair honours the marketplace the settings file declares.
- Init output, README and ADR state exactly what loads: ruflo-swarm's
commands/skills/agents without function hooks, its host-command mod with
them; the first trusted start clones github.com/ruvnet/ruflo; headless -p
on a fresh config loads nothing; refuse-risky + modTrustAllow as opt-in
hardening (modTrust stays observe). Claude Code's re-serialization of
settings.json is reported, never fought.
- e2e: live load is `claude -p "/ruflo-mods"` behind RUFLO_E2E_LIVE=1 with
CLAUDE_CODE_OAUTH_TOKEN or ANTHROPIC_API_KEY; no credential file copied,
nothing printed; adds the --source local and uninstall scenarios.
Co-Authored-By: RuFlo <ruv@ruv.net>
- ruflo init enables the mods by default (--no-mods opts out) in the
committed .claude/settings.json: enabledPlugins for MOD_PLUGINS
(ruflo-mods, ruflo-swarm, ruflo-console), extraKnownMarketplaces.ruflo and
CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1, then refreshes the marketplace and
`claude plugin install`s each plugin at project scope (--no-plugin-install
skips; skipped under VITEST/CI; manual commands printed on failure).
- ruflo init upgrade --mods applies the same merge + install to an existing
project; --add-missing and --settings imply it. Never clobbers: only absent
keys are added (a plugin set to false stays false and is never installed,
since `claude plugin install` would flip it), each addition is reported.
- MOD_PLUGINS is the one list; `required: false` marks a plugin not yet in
the marketplace (ruflo-console): reported as pending, never a failure.
- Install record v2 per settings file; v1 (3.50.0) records are read; mods
uninstall reverses exactly what was added in every file.
- Detection corrected from live evidence: an interactive trusted session
loads plugins straight from the marketplace clone with no install record,
so the clone decides. A stale clone (the field report, reproduced live:
"Unknown command: /ruflo-mods") fails doctor; no clone yet is a warning.
- scripts/e2e-mods-init.sh: built CLI + real claude, isolated HOME and
CLAUDE_CONFIG_DIR per scenario; E2E_LIVE=1 adds a live tmux session.
- ADR-404 Amendment 1, with where the "safe default" argument stops
(ruflo-swarm's commands/skills load regardless; modTrust stays observe).
Co-Authored-By: RuFlo <ruv@ruv.net>
Resolves .claude-plugin/marketplace.json and scripts/ci-test-baseline.txt
after #3608/#3607 merged: both sides appended entries, so the resolution
keeps both (ruflo-mods + ruflo-ruos marketplace entries; all baseline blocks).
Co-Authored-By: RuFlo <ruv@ruv.net>
From the ruOS lane's live e2e of ADR-105 (fleet 64261be):
- 400 (e.g. a Lite machine target) maps to invalid-input, never retried
- DELETE 200 ends the job cancelled with exit 143 and keeps prior output;
the adapter drains output for up to 15 s after a cancel and reports
cancelled as stopped, never failed (exec-poll: a runner we killed is
stopped, not lost)
- ADR-405: ruOS validated the contract live; ruflo's JobsApiTransport is
contract-tested against it, not called live by ruflo
Co-Authored-By: RuFlo <ruv@ruv.net>
ruos-desktop #380 (fleet 64261be) is live. Contract deltas applied:
- POST 202 new / 200 idempotent_replay (reuse job_id) / 409 same key with a
different request = client bug, surfaced, never retried / 429 cap with no
server queue -> swarm-side backoff; timeout_secs clamped to 21600
- GET with wait_ms=20000 long-poll (adapter skips its own sleep, guarded
against instant answers); 503 retried 1s/2s/4s; running=true while queued
- exited carries any exit code: only 0 is completed
- tests mock the exact live codes and fields; ADR-405 says JobsApi is
contract-tested against the live spec but not exercised live (no
control-scoped token; would need spend approval)
Co-Authored-By: RuFlo <ruv@ruv.net>
A module's name is its manifest's own word: a Claude-written mod calling
itself 'ruflo-mods' walked past the gate under refuse-risky. The gate now
has no self-exemption (a module only judges those admitted after it) and
modTrustAllow matches the loader-keyed provenance (name@marketplace).
fs.write joins the risky calls (any path: settings/hooks persistence).
Segments lose ANSI CSI/OSC sequences, not just their ESC byte.
Kit 16/16 on 2.1.287 (inline provenance is <name>@claude-plugin-test);
vitest 99/99.
Co-Authored-By: RuFlo <ruv@ruv.net>
Correction: 2.1.282 needs CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1 (live: 'not
turned on' without it); the earlier 'loads unset' observation was on the
already-upgraded 2.1.287 binary. 2.1.287 loads by default; on both the
server-side rollout switch can hold mods off.
Co-Authored-By: RuFlo <ruv@ruv.net>
ruflo-mods landed the flat segment API (#3608, ADR-404). The ruflo-ruos mod
reads only .claude-flow/ruos/hosts.json and sets $.ruflo.segment({id:'ruos',
text}) on session start, each prompt and every 15 s; try/catch, no feature
detection, no network, no $.ruos dependency. Vendored $.ruflo type with a
parity test; claude plugin validate + 3 claude plugin tests pass; smoke runs
them when the claude CLI is present. CI baseline lists the two new test files.
Co-Authored-By: RuFlo <ruv@ruv.net>
- .claude-plugin/marketplace.json: ruflo-ruos entry, must land with the
plugin dir (validate-marketplace checks the source exists)
- ADR-405: deferred mod part uses the flat contract
$.ruflo.segment({id:'ruos', text}) and $.ruos.* (try/catch, vendored types)
Co-Authored-By: RuFlo <ruv@ruv.net>
- every remote command gets a fresh 64-bit nonce; markers print as
RUOS<nonce>_NAME via printf 'RUOS%s_NAME' '<nonce>', so the token never
appears in the command or its desktop_exec echo; parsers accept only
whole lines with that command's nonce (test replays raw echoes that
contain every marker name)
- test that poll command + 2 KiB slice fit the ~4 KiB cap, echo counted
- pid file holds digits only; audit hash masks the nonce (stable)
- scripts/ci-test-baseline.txt: the 6 node:test files (run by smoke.sh)
that root vitest reports as 'No test suite found' (lead-authorized)
- hosts.json heartbeatAt is ISO for the swarm pane (#3607)
Co-Authored-By: RuFlo <ruv@ruv.net>
- generateHookHandler() carries the same RUFLO_MODS_OWNS handshake, so a
helper written by the refresh fallback still hands route/post-edit over
- isMissing matches ENOENT only: a misread error must fail the guard
closed, never read as 'no policy'
- doctor: the server-side rollout switch decides whether the mod loads
(observed live: loads with the enable variable unset while served on, not
with it set while served off); the variable is reported, never sufficient
- bin-level tests for init --mods, doctor --component mods, mods status
- ADR: live-run evidence, final counts; README: where options are read
Co-Authored-By: RuFlo <ruv@ruv.net>
Live E2E on rUv's Work Desktop (2026-10-01) found that desktop_exec echoes
the command it ran and head-caps stdout at ~4 KiB:
- strip the exec frame and match every marker as a whole line (the echo
contains the marker names and would always false-match)
- poll slices drop to 2 KiB
Design rules from the ruOS lane:
- JobTransport with ExecPollTransport (now) and JobsApiTransport (ADR-105,
feature-detected; run id = idempotency key; 404 never retried; capacity
backoff), adaptive 1s->10s polling, attach to re-read after a restart
- fleet MCP is stateless and the only external transport; SSH :2222 is
in-tenant only; credentials from env or @cognitum/ruos file, redacted;
read-only tokens degrade with insufficient-scope
- never issue desktop_delete/secret_delete (runtime guard + static test)
- llm_route_get before launch; per-run audit record; Lite browsers filtered;
128-bit run ids; 23:00 stopAt recorded in swarm state; deploy read-only
- ADR-405 updated incl. TOFU accepted risk and live evidence
Co-Authored-By: RuFlo <ruv@ruv.net>
- hosts.json is read-merge-write: discovery keeps agent placements and a
run keeps the other hosts; finished agents are removed
- poll reports runner liveness (kill -0); a dead runner without an exit
code fails fast instead of waiting out the timeout
- only whole base64 quanta are decoded, so a truncated tool result never
advances the offset past bytes it did not deliver
- the 23:00 auto-stop window applies to cloud desktops only
Co-Authored-By: RuFlo <ruv@ruv.net>
The npx fallback in execBrowserCommand set shell: process.platform === 'win32'
so cmd.exe could resolve npx.cmd. Its safety comment assumed hard-coded
arguments, but fill values, eval scripts and selectors now flow through it, so
on Windows hosts without a global agent-browser those values were shell syntax.
Resolve the npm shims to the process behind them (native .exe or node <entry>,
and node <npm>/bin/npx-cli.js for the fallback) and spawn with an argv array.
.cmd and .bat targets are refused, bin paths that escape the package are
rejected, and an unresolvable launcher reports the install hint instead of
falling back to a shell. POSIX behaviour is unchanged.
Tests fail on the previous implementation; a static guard fails if a shell
option is reintroduced.
Co-Authored-By: RuFlo <ruv@ruv.net>
* docs(adr): ADR-389..391 — router: refresh the helper, use the real embedder, change defaults only on a measured win
ADR-389: add router.js to CRITICAL_HELPERS + re-sign, so installed copies get
the word-boundary fix (#3401); today they are frozen at first write.
ADR-390: hooks_route embeds patterns and tasks with the local MiniLM chain
(generateLocalEmbedding), hash embedder as the reported fallback.
ADR-391: frozen, labelled 150-200 prompt corpus; A/B/C/D (current, MiniLM,
typesafe-hash, typesafe-onnx); ADR-150-style AND-gate for promotion.
Co-Authored-By: RuFlo <ruv@ruv.net>
* feat(init): refresh router.js as a critical helper on upgrade (ADR-389, #3401)
Installed copies of .claude/helpers/router.js never received the #2257
word-boundary fix: helper-refresh only re-copies CRITICAL_HELPERS and
router.js was not on the list, so an April substring router kept routing
"sync and review latest issues" to tester.
- helper-refresh.ts: add router.js to CRITICAL_HELPERS; generator
fallback also emits it (generateAgentRouter).
- sign-helpers.mjs / verify-helpers.mjs / executor.ts executeUpgrade /
smoke-helper-signing-security.mjs: keep their copies of the list in sync.
- New test: stale April router.js is replaced by the package copy via the
signed refresh path (throwaway key), after which the prompt no longer
routes to tester.
helpers.manifest.json is NOT re-signed here. Until it is, verify-helpers
fails ("manifest has no entry for router.js") and the production refresh
is fail-closed blocked for all helpers.
Co-Authored-By: RuFlo <ruv@ruv.net>
* bench(router): ADR-391 labelled evaluation corpus (197 prompts, frozen)
Blind-labelled corpus for comparing routing candidates: 11 labels incl. none,
64 adversarial trap cases, deterministic stratified dev/test split (i%5 in
{0,2} -> dev), dependency-free validator that recomputes the split and prints
the sha256. Frozen at sha256 b0c1923b2813b61907304dff56c53d199b709797bfb9600a7c1f496cf0c0bf04.
Co-Authored-By: RuFlo <ruv@ruv.net>
* feat(hooks): ADR-390 — semantic router can use the real MiniLM embedder
hooks_route compared tasks with pattern keywords using a character hash
(generateSimpleEmbedding), which measures spelling, not meaning. This adds a
router-embedder abstraction (src/ruvector/router-embedder.ts):
- embedForRouter(texts, kind) -> { vectors, embedder: 'minilm'|'hash', reason? }
- MiniLM path uses generateLocalEmbedding ONLY (never the bridge-first
generateEmbedding, #2312). backend !== 'onnx', a throw, or a non-384-d
vector degrades EVERY text in the call to the hash, with a reason.
- Selection: CLAUDE_FLOW_ROUTER_EMBEDDER=minilm|hash; DEFAULT_ROUTER_EMBEDDER
stays 'hash' until ADR-391's benchmark decides.
getSemanticRouter builds both the native VectorDb and pure-JS indexes from one
embedder, records which one actually built the index, embeds the query with
that same embedder, rebuilds when the requested embedder changes, and shares
one in-flight build between concurrent callers. If the query fails on MiniLM
after a MiniLM index was built, the index is rebuilt with the hash so the two
spaces never mix. hooks_route results gain `embedder` (+ `embedderReason` when
degraded); existing fields are unchanged.
routeTaskForBench(task, { embedder }) is an internal, bench-only entry that
runs the same local path as hooks_route (skipping the AgentDB pre-route and
the opt-in typesafe wrapper) for ADR-391.
Co-Authored-By: RuFlo <ruv@ruv.net>
* chore(audit): register CLAUDE_FLOW_ROUTER_EMBEDDER as a known env escape hatch
ADR-390's router embedder selector is process-lifetime MCP router state, like
CLAUDE_FLOW_DISABLE_NATIVE_ROUTER; the ADR-391 bench passes the embedder
explicitly rather than through a CLI flag.
Co-Authored-By: RuFlo <ruv@ruv.net>
* bench(router): ADR-391 first run — no candidate promoted; fix typesafe-router test (e)
Benchmark (run-bench.mjs) on the frozen 197-prompt corpus
(sha256 b0c1923b…), test split n=113:
A current (hash) 25.7% acc, p95 1.06 ms
B MiniLM (ADR-390) 36.3% acc, p95 6.21 ms (+10.6 pts, +485% p95)
C typesafe hash 26.5% acc, p95 1.20 ms
D typesafe onnx 29.2% acc, p95 8.35 ms (raw pick 44.3%, gated to 5.6%)
No candidate passes the ADR-391 AND-gate (B fails the relative latency
bound), so DEFAULT_ROUTER_EMBEDDER stays 'hash' and typesafe stays opt-in.
Receipt committed under benchmarks/router/results/. ADR-391 gains a Results
section with the findings (structural ceiling: no pattern returns
researcher/reviewer/none; latency criterion mis-specified for a ~1 ms base;
typesafe gate too tight) as owner decisions, not applied.
ADR-389 -> Implemented; ADR-390 -> Implemented as opt-in; ADR-391 -> Implemented.
typesafe-router test (e) was red on main since #3402 made the keyword
fallback word-bounded: it still asserted the old "latest"->tester fallback.
It now asserts the typesafe override and that a legacy fallback is kept.
Co-Authored-By: RuFlo <ruv@ruv.net>
acquireLock() records {pid, acquiredAt} in .claude-flow/policy/state.lock
but only ever reclaimed a lock by mtime age (LOCK_STALE_MS = 30 s). Every
MCP tool call, reads included, passes through authorizeMcpTool() ->
withPolicyTransaction() -> acquireLock(). When a server is killed inside a
transaction (SIGKILL, OOM, or a default-action SIGTERM: the bin/cli.js
stdio loop installs no handler), its finally block never releases the
lock, so each call on a fresh server waited LOCK_WAIT_MS and failed with
policy-state-lock-timeout until the orphan aged past 30 s: five 5 s
failures after every such crash.
Reclaim the lock at once when its owner is provably gone:
- The lock now also records host, platform and, on Linux, PID namespace
and kernel boot id. The pid is trusted only when every field matches
the reader's, because a sandboxed CLI (bwrap --unshare-pid), a
container, another kernel boot or another machine sees ESRCH for a live
owner. host alone is not an identity: two machines sharing a directory
can report the same hostname, and every Linux init PID namespace has
the same inode (PROC_PID_INIT_INO).
- Only ESRCH counts as dead (EPERM and any other error mean alive), and
the pid must be a number, an integer, and in 1..2^31-1 (process.kill
coerces a numeric string).
- The lock is read only if it is a small regular file (lstat, then
O_NOFOLLOW|O_NONBLOCK, fstat, at most 1 KiB), so a symlinked FIFO or
device cannot block the event loop.
- After the probe the lock is re-read and must be byte for byte the one
that was read, so a lock that changed hands during the probe is not
deleted. Comparing dev/ino/ctime instead is unsound on Linux: ext4
reuses a freed inode number at once, and before kernel 6.13 two files
created in one clock tick share a ctime. Replaying the handover on a
non-multigrain ext3 mount, the stat triple deleted the live new owner's
lock in 192 of 200 runs; the byte comparison in 0 of 200.
Every other lock, including one written by an older version, keeps the
30 s mtime rule. ADR-324's lock paragraph is updated to match.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KTedGmPKpEdArVBMMn3JaP
Proposed. Root cause: `ruflo swarm start` (commands/swarm.ts:588-672) never
executes the objective — it prints a plan, calls MCP swarm_init, writes
state.json, prints "execution happens via claude -p / hive-mind spawn --claude"
and returns. Nothing invokes those, so the console's Swarms deploy sets up
coordination then finishes with no work, no artifacts, nothing to find/use/deploy
(agents are registry rows with no process).
Decision: swarm start becomes a streaming, steerable, long-horizon agentic
orchestrator that WIRES existing ruflo primitives (the nested-* / research-agent
recursive-fan-out pattern, claude -p, MCP tools, AgentDB memory, self-learning
hooks, hive-mind raft consensus, agentbbs federation, horizon-tracker) instead of
deferring. Streams NDJSON per-agent (works over the console SSE /run today); a
file-inbox session channel carries real-time guidance; a structured final
overview names artifacts + where to find/run/deploy them.
Hard dependencies stated: agents can't run without the ADR-069 per-tenant LLM
key (prerequisite for the console path); real-time steering needs a bidirectional
channel (file-inbox now, WebSocket later). Increments I1-I4 + an acceptance test.
ADR-387 records why a relaying design is impossible (buzz-relay refuses any
EVENT whose pubkey differs from the NIP-42 identity), where the signing key
lives and why it is in ruv-dev rather than cognitum, and the three custody
omissions that are each enforced by a test.
ADR-388 records OAuth as an ADDITIVE credential on the federation's front door —
reads stay open and adminToken keeps working, because closing either would
strand every agent already connected. It also records why swarm:* rather than
federation:* (audience pinning is the control; scope names are a UX contract,
correcting an overstatement in console migration 0029), and why the resource
accepts dcr- audiences.
Both ADRs carry a section on what the work cost: bugs that read as working code
— a 301-second hanging GET, a log that could not tell 'no credential' from
'credential refused', a required adminToken that made OAuth writes impossible,
a read-back verifier using an unadmitted key, and a client-existence probe that
returned the same answer whether or not the client existed.
Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_013u4pmL9ZUAXb6usVQgNo67
Coordination on x.ruv.io was one flat topic: every member read every message,
and there was no way to keep a stream separate — or confidential — without
standing up another relay tenant.
Channels are one tag on the existing events, in two visibilities:
public c=pub:<name> plaintext, any relay member reads it
private c=prv:<16 hex> NIP-44 v2 ciphertext, k=enc hides the message type
The private channel key is generated client-side and cached at
~/.ruflo/channels.json (0600). Access is granted by sealing that key to a
member's pubkey over ECDH and publishing it as a ChannelGrant only they can
open. The gateway holds no channel keys and cannot decrypt — a hosted gateway
that encrypted on your behalf would be a custodian of every private channel on
the service, which is the thing worth not building.
Not hidden, and said so in the ADR: the relay sees that a channel exists, its
opaque id, who published and when. There is no revocation either; removing
someone means rotating the channel.
The channel tag is 'c', not the obvious 'h'. buzz-relay already implements
NIP-29-style server-side group membership on : an h-tagged event publishes
fine and the matching REQ comes back CLOSED "restricted: not a channel member",
so the author cannot read back their own message. Measured every other
single-letter tag against the live relay — c/d/g/l/m/r/x/y/z are all indexed and
unrestricted.
Surfaces: gateway channel_list / channel_sync / channel_publish (public only,
admin-gated) + ruv://swarm/channels; client x_federation_channel_{create,grant,
accept,publish,read,list} and 'ruflo federation channel --action ...'.
Verified: gateway 12/12, CLI 11/11, and a live two-key E2E on wss://relay.ruv.io
— grantee reads the plaintext, an outsider key cannot decrypt, the ciphertext
does not contain the secret, and the gateway's own channel_sync returns
encrypted:true. Deployed as ruflo-x-gateway-00008-s6n.
Claude-Session: https://claude.ai/code/session_013u4pmL9ZUAXb6usVQgNo67
The receipt and anchor-record schemas accepted any length of base64
(^[A-Za-z0-9+/]+={0,2}$), so oversized garbage passed structural
validation. An Ed25519 signature is exactly 64 bytes — 88 base64
characters with two padding chars — so the pattern is now
^[A-Za-z0-9+/]{86}==$, consistent with the fixed-width contentId and
seedHex patterns elsewhere in the schemas. The promotion-commit schema
carries no signature field (commits are unsigned in ADR-322C) and is
unchanged.
All four example fixtures re-validated against the tightened schemas
with Ajv 2020 strict; a 4KB-garbage-signature negative control is now
rejected.
Co-Authored-By: claude-flow <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_012Jib2gQyJpqCoo2xYAbb4X
Closes the gap raised by ruflo#3069: ADR-322C required independent
statistical recomputation but specified only the bootstrap seed, not the
generator it drives. A verifier could not reproduce a receipt's statistics
from the document - the only way to recompute correctly was to read
flywheel-receipt.ts, which is a copy rather than an independent check.
Appends an "Update (2026-08-19)" section per this repo's ADR convention
(ADR-380) rather than editing the text above. It makes normative: the LCG
and its constants, the seeding rule and exact byte slice, the resampling
procedure and draw order, the quantile rule, tie/edge cases, and the
scale-12 decimal encoding the statistics must reproduce byte-for-byte. It
also records the ledger divergence (flat unsigned commits[] on main vs the
content-addressed segments and signed head the ADR describes, with
flywheel-ledger-head/v1 unused), the disabled projection path, and that
strictness is versioned.
Acceptance is demonstrated, not asserted: conformance/recompute_reference.py
is written only from the amendment prose, in a different language from the
reference implementation, and reproduces the fixture exactly.
Adds receipt-bootstrap-reference.example.json because the existing example
turned out not to discriminate - its deltas take two distinct values, so a
wrong seed slice, wrong byte order, or entirely different LCG constants all
yield the same 2.5th percentile. The new fixture has heterogeneous deltas
and separates all three.
Records one defect found while building it (gap G5): createFlywheelReceipt
computes statistics from full-precision means while storing scale-12
strings, so a receipt whose mean needs more than twelve decimals fails its
own verifyFlywheelReceipt. Reproduced at mean 0.7687083333333332. Existing
fixtures use exactly-representable means, which is why it was not caught.
Co-Authored-By: claude-flow <ruv@ruv.net>
Makes ADR-322C's verification protocol consumable as a cross-repo
witness/promotion contract without reading ruflo source, for
ruvnet/rvm#35, ruvnet/autogenous#10, and ruvnet/RuVector#840.
Extraction only - no new decisions. Every normative statement cites
ADR-322/322A/322C/381 or the implementing source. Adds:
- v3/docs/spec/witness-receipt-contract.md: record types, JCS
canonicalization, identity derivation, signature construction with
domain prefixes byte-exact, evidence grades, step-by-step verification,
versioning, and the per-epoch alpha-ledger caveat.
- v3/docs/spec/schemas/: draft 2020-12 schemas for the receipt and
promotion commit, plus a PROPOSED-EXTENSION anchor record.
- v3/docs/spec/examples/: fixtures generated by running
flywheel-receipt.ts itself, so the signature and content IDs are real.
- v3/docs/spec/conformance-checklist.md: testable criteria for consumers.
Four gaps between ADR-322C and main are recorded rather than papered over:
the bootstrap PRNG lives only in source (G1); the signed ledger head under
ruflo/flywheel-ledger-head/v1 is specified but unimplemented, the chain is
an unsigned SHA-256 chain (G2); verifyFlywheelReceipt has no unknown-field
whitelist, so a producer-emitted unknown field verifies - the schemas'
additionalProperties:false is the only enforcement (G3); and Flywheel
projection stays disabled (G4).
Co-Authored-By: claude-flow <ruv@ruv.net>
Adds v3/crates/ruflo-watermark: a self-contained, model-agnostic crate for
LLM text watermarking (generation + detection) in the SynthID-Text / Aaronson
family, plus a robustness-evaluation harness and a governed un-marked path.
Schemes (all keyed on token id so detection needs no candidate set):
- Tournament (SynthID-Text, Nature 2024) — strong, mildly distortionary.
- TournamentNd — key-averaged non-distortionary (measured <0.3% drift).
- Gumbel (Aaronson/Kuditipudi exponential-min) — per-instance distortion-free.
Detection: closed-form (Binomial/Gamma) z/p with a stable erfc + log10 tail;
plus bayes.rs (exact Gamma-tail + Higher Criticism for short/sparse texts);
plus align.rs self-sync detector that closes the indel-robustness gap (the real
failure was repeated-context masking desync in low-entropy text, not the
position lock — measured, documented honestly).
evolve.rs: a Darwin/flywheel-methodology tuner (bounded gens x children, frozen
fitness, retained lineage, no auto-promotion) for the alignment detector, with
held-out re-evaluation to de-bias the winner's-curse in the promotion check
(a fix prompted by ADR-384's own adversarial review).
robustness.rs: substitution/deletion/insertion/paraphrase attacks + an adaptive
worst-case attack (proven to beat uniform editing at equal budget). Measurement
only — reports detection statistics, never laundered text.
unmarked.rs: authorized un-marked GENERATION (never post-hoc stripping) — an
unforgeable authorization MAC, mandatory provenance disclosure to finish, and a
loud audit record on undisclosed abandonment. Structurally cannot target
third-party marked text.
WASM bindings (--features wasm), criterion benches, 46 tests. Deliberately does
NOT include a watermark-removal/laundering tool.
Docs: ADR-383 (this crate) and ADR-384 (generalized bounded-evolution
methodology with error-control proof, from a multi-agent design workflow).
Claude-Session: https://claude.ai/code/session_01VYDa3Hah5VJLS2ceEuTLKz
* fix(proxy): disclose what enabling cloud routing actually decides, and let users pin a tier
Closes the terminal half of cognitum-one/meta-proxy#43 M5b, and adds the
`routing_mode` control ruflo never had.
meta-proxy ADR-321 rev-2 (shipped v0.6.0, #43 M2) applies tier selection to
ALL Cloud traffic. Before it, a deliberately configured Cloud plane forwarded
the client's own model name -- and since Claude Code names a frontier model by
default, every request was served at the top tier with no ceiling and no proxy
daily cap. Difficulty-routing all Cloud traffic is the fix for that defect, not
a regression, and it deliberately does not touch Passthrough or Local: those
are the user's own subscription and their own backend.
But ruflo never told anyone. `ruflo proxy config --cloud` said only that
prompts go to api.cognitum.one "and forwarded to the selected provider" -- so a
user could enable cloud routing still believing their model choice held. #43
M5a fixed the Developer Console selector; M5b ("equivalent disclosure to any
terminal flow that explicitly activates Cloud") is this command, and it was
still open.
The disclosure now answers the three things activating Cloud actually decides,
each of which has a different answer than the plane being left:
- who processes the prompt (Cognitum, server-side)
- who pays (the Cognitum account -- NOT the user's own Claude subscription,
which is what Passthrough uses and is unaffected)
- which model runs (the plane picks a tier per prompt rather than honoring
the requested model)
`--routing-mode <auto|low|mid|high>` is rev-2's escape hatch. The console got a
control for it in meta-proxy#52; ruflo had none, so a ruflo user was stuck on
auto with no way to disagree -- and the scorer reads prompt SHAPE, not task
difficulty, so a short-but-hard prompt can under-escalate.
Setting a tier must never activate Cloud (ADR-321 Revision 3 keeps the plane
choice and this Cloud-only setting as separate controls), so `--routing-mode`
alone writes only `routing_mode`, asks for no consent it does not need, and
says the setting is inert until Cloud is on. `--routing-mode` with
`--local-only` is refused rather than silently resolved, and an unconfirmed
`--cloud` still writes nothing at all.
Wire values confirmed against meta-proxy's `RoutingMode` enum (`src/config.rs`,
same `#[serde(rename_all = "snake_case")]` treatment as `DataPlane`), and
`#[serde(default)]` there means an existing config that omits the field keeps
working and reads as auto. An unrecognized value already in the file reports as
auto rather than being echoed back, matching the proxy's own
degrade-to-safe-default behavior.
ADR-304 records both, and drops its inline copy of the disclosure text -- that
copy had already fallen behind the shipped string, and a reader could not tell
which was real. #43 M3 (a Cloud tier ceiling and daily cap) stays open upstream
as a product decision, so the disclosure makes no claim about caps either way.
Test: 9 proxy test files, 68 tests, all passing (was 56).
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(proxy): make the subscription plane reachable again after cloud routing
`--local-only` was the only exit from the cloud plane, and it writes
`default_data_plane = "local"` -- the user's own Ollama/vLLM/SGLang backend.
`passthrough`, which is meta-proxy's own default AND the plane that uses the
user's own Claude subscription, was unreachable from this command by design
("passthrough is never written", ADR-304's 07-16 addendum).
So the undo we advertised was wrong. A user on passthrough who followed our own
disclosure -- "Disable anytime: ruflo proxy config --local-only" -- landed on a
THIRD state they never chose, pointed at a local backend that may not be
installed. Two consequences, neither visible:
1. Their Claude subscription stops being used at all. That is the same harm
cognitum-one/meta-proxy#51 closed on the login path ("silently switches a
user away from Passthrough -- their own Claude subscription"), reached
through a different door.
2. Automatic quota failover silently stops applying. meta-proxy gates it on
the plane (`src/routing.rs`: `automatic_eligible =
cfg.default_data_plane == DataPlane::Passthrough`) because Passthrough is
the only plane that sees Anthropic's own rate-limit headers (ADR-320). A
user parked on `local` is opted out of ADR-321 entirely and is never told.
The no-flag report papered over the difference, printing one line -- "Cloud
routing is OFF -- requests never leave this machine (or use your own Claude
subscription on Passthrough)" -- for two planes that do not behave alike.
`--local-only` keeps its meaning exactly; the flag name and ADR-304 both
promise a local backend, and silently retargeting it would just be a second
surprise. Instead:
- `--passthrough` is added, writing `default_data_plane = "passthrough"` and
revoking cloud-routing consent the same way `--local-only` does.
- The disclosure names both exits instead of presenting one as THE undo.
- `--cloud` reads the plane it is leaving before overwriting it and prints
the command to restore it. That read is the only moment ruflo knows where
the user was, and it beats persisting a "previous plane" that could go
stale against a hand-edited TOML.
- `--local-only` now says the Claude subscription is not used on that plane,
and how to choose it instead.
- The no-flag report describes each plane distinctly and calls out the
ADR-321 failover consequence while on `local`.
- Plane flags are mutually exclusive -- more than one is refused rather than
resolved by precedence, since any precedence would discard something the
user explicitly asked for.
No default changes: a user who never runs this command is on passthrough,
exactly as before. ADR-304 records the decision and supersedes its own
"passthrough is never written" claim.
Test: 9 proxy test files, 80 tests, all passing (was 68).
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(proxy): correct disclosure's who-pays claim (post-merge reapply)
Same fix as on #2927 — the disclosure asserted Passthrough "is the plane
in effect until you turn this on", which is false whenever the user is
already on --local-only. Reapplying after merging main (which already
had this fix on the pre-passthrough disclosure text) since this branch's
own commit still carried the original wording.
Co-Authored-By: RuFlo <ruv@ruv.net>
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: ruv <ruv@ruv.net>
* fix(proxy): disclose what enabling cloud routing actually decides, and let users pin a tier
Closes the terminal half of cognitum-one/meta-proxy#43 M5b, and adds the
`routing_mode` control ruflo never had.
meta-proxy ADR-321 rev-2 (shipped v0.6.0, #43 M2) applies tier selection to
ALL Cloud traffic. Before it, a deliberately configured Cloud plane forwarded
the client's own model name -- and since Claude Code names a frontier model by
default, every request was served at the top tier with no ceiling and no proxy
daily cap. Difficulty-routing all Cloud traffic is the fix for that defect, not
a regression, and it deliberately does not touch Passthrough or Local: those
are the user's own subscription and their own backend.
But ruflo never told anyone. `ruflo proxy config --cloud` said only that
prompts go to api.cognitum.one "and forwarded to the selected provider" -- so a
user could enable cloud routing still believing their model choice held. #43
M5a fixed the Developer Console selector; M5b ("equivalent disclosure to any
terminal flow that explicitly activates Cloud") is this command, and it was
still open.
The disclosure now answers the three things activating Cloud actually decides,
each of which has a different answer than the plane being left:
- who processes the prompt (Cognitum, server-side)
- who pays (the Cognitum account -- NOT the user's own Claude subscription,
which is what Passthrough uses and is unaffected)
- which model runs (the plane picks a tier per prompt rather than honoring
the requested model)
`--routing-mode <auto|low|mid|high>` is rev-2's escape hatch. The console got a
control for it in meta-proxy#52; ruflo had none, so a ruflo user was stuck on
auto with no way to disagree -- and the scorer reads prompt SHAPE, not task
difficulty, so a short-but-hard prompt can under-escalate.
Setting a tier must never activate Cloud (ADR-321 Revision 3 keeps the plane
choice and this Cloud-only setting as separate controls), so `--routing-mode`
alone writes only `routing_mode`, asks for no consent it does not need, and
says the setting is inert until Cloud is on. `--routing-mode` with
`--local-only` is refused rather than silently resolved, and an unconfirmed
`--cloud` still writes nothing at all.
Wire values confirmed against meta-proxy's `RoutingMode` enum (`src/config.rs`,
same `#[serde(rename_all = "snake_case")]` treatment as `DataPlane`), and
`#[serde(default)]` there means an existing config that omits the field keeps
working and reads as auto. An unrecognized value already in the file reports as
auto rather than being echoed back, matching the proxy's own
degrade-to-safe-default behavior.
ADR-304 records both, and drops its inline copy of the disclosure text -- that
copy had already fallen behind the shipped string, and a reader could not tell
which was real. #43 M3 (a Cloud tier ceiling and daily cap) stays open upstream
as a product decision, so the disclosure makes no claim about caps either way.
Test: 9 proxy test files, 68 tests, all passing (was 56).
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(proxy): correct disclosure's who-pays claim for --local-only users
The disclosure text asserted "[Passthrough] is the plane in effect until
you turn this on" — false whenever default_data_plane is already "local"
(i.e. exactly a --local-only user considering re-enabling cloud routing).
Reword to state Passthrough is the proxy's default and what the user's
Claude subscription is used by, without claiming it's necessarily the
plane currently in effect.
Co-Authored-By: RuFlo <ruv@ruv.net>
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: ruv <ruv@ruv.net>
* fix(proxy): bump pinned meta-proxy release 0.4.0 -> 0.7.3
`DEFAULT_PROXY_RELEASE` had not moved in six meta-proxy releases, so
`ruflo proxy install` shipped a binary predating every fix since v0.4.0:
- require explicit Cognitum Cloud routing consent (#60) first in v0.7.0
- handle --help before binding (#74/#76) first in v0.7.2
- --help/--version win from any argv position (#85) first in v0.7.3
- reload live daemon config on login/logout (#28) first in v0.4.1
- pin the Linux glibc floor to 2.28 (#66) first in v0.7.1
The consent one matters most: the install disclosure promises cloud
routing is "never enabled by install alone", but the commit that
separated authentication from routing consent landed in v0.7.0 — after
the pinned build.
The --version regression is directly observable on 0.4.0: the binary
starts the daemon, writes the token file and binds 127.0.0.1:11435,
where meta-proxy's own source documents --version as side-effect-free
("no server, no I/O"). Any probe silently leaves a listener running.
Also stop hardcoding the version in proxy.ts's example text. That string
was written as a literal rather than interpolating the constant, so the
advertised version could — and did — drift from the installed one. Both
tests now read the pin from the module for the same reason; asserting a
literal means every bump needs hand-edited test expectations.
Verified on Windows x64: `ruflo proxy install --release 0.7.3 --yes`
installs with signature + checksum verification intact, and `--version`
then prints and exits with no process left running and no port bound.
Test: 9 proxy test files, 56 tests, all passing.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(proxy): surface pin drift to already-installed users
Bumping DEFAULT_PROXY_RELEASE only changed what a NEW install receives.
Someone who had already run `proxy install` on 0.4.0 got no signal that
anything moved: `proxy status` reported installation as a boolean, and
`proxy update` required an explicit --release, so reaching a newer binary
meant already knowing its version number. The fixes that motivated the bump
therefore reached only the users who did not yet have the problem.
ProxyStatus now carries `version`, read from the install manifest install.ts
already writes. `proxy status` prints it, the console guidance names the gap
and the command that closes it, and `proxy update` defaults to the pin the
same way `install` does. Updating stays explicit and user-initiated.
The version is read from the manifest, never by executing the binary:
releases before v0.7.2 start the server and bind a port on ANY invocation,
so a `--version` probe against an old build leaves a listener running --
precisely the state this check exists to detect. A missing or malformed
manifest reports "unknown", never "up to date".
Also corrects two stale claims this change makes load-bearing:
- proxy/lifecycle.ts's header asserted as fact that the binary "takes no
CLI flags -- no --version/--help, any invocation just starts the server"
(confirmed 2026-07-16). v0.7.2 handles --help before binding and v0.7.3
makes --help/--version win from any argv position. Left as-is, the next
reader concludes no version handshake is possible.
- ADR-307 still described the pin as v0.4.0 -- a fourth copy of the literal
this PR is de-duplicating, and the one a reviewer reads to decide what
the pin should be. It now names no version at all and points at the
constant, plus records the drift-surfacing behavior.
Test: 9 proxy test files, 64 tests, all passing (was 56).
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(metaharness): repair dependency contract + strict sequential promotion evidence
Item 1 — dependency & compatibility repair (the contract was silently broken):
- @metaharness/darwin ^0.8.3, @metaharness/flywheel ^0.1.10, and
@metaharness/radio ^0.1.0 are now explicit optionalDependencies of
@claude-flow/cli (optional PEER deps are never auto-installed, so a clean
ruflo install shipped with zero MetaHarness packages on disk)
- check-metaharness-pins.mjs now searches dependencies, optionalDependencies,
AND peerDependencies; UNDECLARED and PEER-ONLY (for installable pins) are
fatal drift instead of silently passing; radio added to the watch list;
--require-installed asserts the real published symbol contracts
(RefineMutator, withSequentialEvidence, RadioBus, ...)
- new scripts/metaharness-clean-install-test.mjs: installs the declared
ranges into a pristine temp dir and asserts every advertised export;
wired as a MANDATORY clean-install job in metaharness-ci.yml
- doctor: new "MetaHarness declared packages" check FAILS (not warns) when a
declared optional dep does not resolve at runtime; --component metaharness
now runs upstream + declared-deps + integration checks
- MH_DARWIN_PIN bumped 0.8.0 → 0.8.3 in lock-step with the declared range
Item 2 — strict promotion evidence at the transaction authority:
- receipts now carry task-level pairedOutcomes (taskId + per-task baseline/
candidate scores) behind heldOutDeltas; verifyFlywheelReceipt refuses rows
that cannot reproduce their aggregate; evaluateFlywheelCandidate populates
them; pre-existing receipts still verify byte-identically
- new flywheel-sequential-evidence.ts: anytime-valid e-process over
discordant paired outcomes (testing-by-betting) composed with per-candidate
alpha allocation (alpha_k = alpha_total * 6/(pi^2 k^2)), so the family-wise
false-promotion probability across an ADAPTIVE candidate stream is bounded
by alpha_total = 5%
- promoteFlywheelCandidate requires paired evidence by DEFAULT — aggregate-
only receipts are refused, never silently downgraded (the upstream
withSequentialEvidence fallback hole); explicit
--allow-aggregate-evidence / allowAggregateEvidence escape hatch for
pre-upgrade receipts; alpha spend is persisted per receiptId in the
transaction state (looking spends alpha; retries reuse their index)
- acceptance test: 1,000 null-improvement streams (20 adaptive candidates x
40 worst-case discordant pairs) — measured family-wise false promotion
0.6%, within the <=5% budget
Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01FKWLVWewYaWmcUg2q8Y9wy
* chore: gitignore node-compile-cache build artifact
Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01FKWLVWewYaWmcUg2q8Y9wy
* fix(ci): satisfy #2561 guard, dep-overlap audit, and smoke contract for metaharness optional deps
Three CI failures from the dependency-contract repair, three fixes:
- tilde-pin @metaharness/{darwin,flywheel,radio} (~0.8.3 / ~0.1.10 / ~0.1.0)
per the ADR-150 anti-caret rule enforced by smoke step 17z73 — upstream is
unstable, tilde absorbs patches but never minors
- remove the three from peerDependencies/peerDependenciesMeta: an entry in
BOTH optionalDependencies and peerDependencies crashes npm 11.x arborist
on dedupe (#1147/#2018 dep-overlap audit); optionalDependencies alone is
the declaration that actually installs
- update the #2561 cold-startup guard per its own escape clause: budget
8 → 10 and drop @metaharness/darwin from the forbidden list — that entry
dated from the pre-0.8 heavy-tree era; darwin@0.8.3 is 1.8M unpacked with
ZERO dependencies and no lifecycle scripts (all three packages combined:
2.3M, 753ms cold install into an empty dir, measured 2026-08-10; the
clean-install CI job re-verifies on every pin change)
- smoke.sh 17h now accepts the componentMap ARRAY form
('metaharness': [checkMetaharness, ...]) introduced with the
declared-packages doctor check
Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01FKWLVWewYaWmcUg2q8Y9wy
* fix(ci): remove apostrophe that broke the single-quoted guard script
The #2561 guard runs as `node -e '...'` inside bash; an apostrophe in a
comment ("guard's") terminated the quoted string and bash tried to execute
the next // comment line (exit 126, '//: Is a directory'). Verified by
executing the extracted run block end-to-end: all three checks OK, exit 0.
Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01FKWLVWewYaWmcUg2q8Y9wy
* feat(flywheel): ADR-381 — alpha-stream governance, reset epochs, accept/v2+seq
Completes the sequential-evidence governance PR #2956 opened:
ADR-381 (new) records the decisions:
- the ADR-322 promotion ledger IS the alpha stream (per project root) —
receipt lineageIds default to fresh UUIDs and cannot scope the control
- evidence epochs: resetSequentialEvidence({confirm, reason}) archives the
spend into an append-only sequentialResets audit trail, EXPIRES every
outstanding evaluated receipt (fresh-data enforcement — old-epoch
evidence cannot be replayed against a reopened budget), and increments
evidenceEpoch; surfaced as `flywheel evidence-reset --reason … --confirm`
(CLI) and the metaharness_flywheel MCP op, both behind the same policy
gate as promotion
- accept/v2+seq: the ADR-176 generations loop now decides each bundle with
a third conjunct — the e-process over the bundle's own embedded per-task
holdout at alpha_k for its position in the attempts stream — with the
full verdict recorded in the bundle and independently replayed by
verifyReceiptBundle (v1 bundles keep v1 semantics; versions pin per
bundle); flywheelStatus surfaces next test index / threshold / minimum
pairs / remaining budget so exhaustion reads as plateau, not mystery
- two-layer pre-flight: evaluateFlywheelCandidate annotates (never blocks)
when the promotion holdout cannot clear the next threshold on a perfect
sweep; promoteFlywheelCandidate refuses size-inviable receipts BEFORE
allocating an alpha index — sample size is ancillary, so the refusal
looks at no evidence and spends no budget
Tests: reset semantics (archive/expire/epoch/fresh-promote), alpha-free
size refusal vs alpha-spending e-process refusal, v2 promote/reject/replay
including tamper + index-shopping detection, v1 compat, helper math
anchors (min pairs = 9 at test 1), budget monotonicity. 82 tests green
across the eight affected suites; tsc build clean.
Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01FKWLVWewYaWmcUg2q8Y9wy
* fix(flywheel): close 3 concurrency/epoch gaps in ADR-381 sequential evidence
Code review of this PR found three real correctness bugs that can silently
violate the <=5% family-wise false-promotion guarantee that is the PR's own
core deliverable:
- flywheel-transaction.ts: resetSequentialEvidence's "fresh data only"
guarantee only expired receipts already registered at reset time; a
receipt whose evidence predates a reset but is registered afterward was
silently admitted into the new, cheaper epoch (index shopping). Now
tracks evidenceEpochStartedAt and promoteFlywheelCandidate refuses any
receipt whose payload.issuedAt predates it, before allocating an alpha
index.
- harness-flywheel-generations.ts: the daemon generations loop computed its
sequential-evidence testIndex via an unlocked loadAttempts(root).length+1
read before appending. Two overlapping runFlywheelGeneration calls on the
same root could be assigned the same test index and spend the same
alpha_k twice. The read-index -> build-bundle -> append critical section
now runs under the same O_EXCL lock pattern flywheel-transaction.ts
already uses.
- harness-flywheel.ts: evaluateFlywheelCandidate's sequentialPreflight
(backing the `promotable` flag) was computed from an unlocked snapshot
taken before the async retrieval/scoring work, so it could go stale by
the time promoteFlywheelCandidate allocates the real index under its own
lock. Moved to the latest possible read (after receipt registration) to
minimize the window; documented as advisory, since promoteFlywheelCandidate
remains the sole authority.
Added a regression test for the epoch-boundary refusal and a concurrency
test proving two racing generations get distinct sequential test indices.
Co-Authored-By: RuFlo <ruv@ruv.net>
---------
Co-authored-by: Claude <noreply@anthropic.com>
The SLIM maintainers confirmed (agntcy/slim#1916) they've moved off
uniffi-bindgen-react-native onto @ubjs/core/@ubjs/node (compiled output,
not raw TypeScript) in the alpha dist-tag (2.0.0-alpha.4+), not yet
promoted to latest.
Verified live: a real server bring-up + client connect + graceful
shutdown against @agntcy/slim-bindings@2.0.0-alpha.5 succeeds under
plain Node with zero errors — no ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING.
Verified detectAgntcyRuntime() itself (not a mock) now returns
configured: true when RUFLO_AGNTCY_SLIM_ENDPOINT is set, exactly as its
existing graceful-degradation design predicted it would once the
upstream bug was fixed — zero logic changes needed to that function.
Pinned to the exact alpha version (not a caret range — deliberate for
a pre-release channel) rather than latest, until the fix is promoted.
Added detectAgntcyRuntime()'s optional packageName parameter so the
"package genuinely not installed" fallback path stays covered by a
real regression test now that the real package resolves.
pnpm-lock.yaml regenerated (scoped to this one dependency).
* fix(agntcy): correct SLIM package name to the real @agntcy/slim-bindings
ADR-380's original scaffold guessed a placeholder package name
(@claude-flow/agntcy) and concluded no SLIM SDK existed anywhere — that
check only tried guessed names. The real SLIM Node.js bindings are
published as @agntcy/slim-bindings (v1.4.1 stable), documented for exactly
this plain-Node use case.
It currently fails to load, but for a specific, verified, upstream reason
rather than "doesn't exist": a transitive dependency
(uniffi-bindgen-react-native) ships raw, uncompiled TypeScript as its
package.json "main" with no build output and no exports field — works
inside a bundler (Metro, its primary React Native use case), not plain
Node require/import. Reproduced and confirmed the exact failure
(ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING, not MODULE_NOT_FOUND) via a
real install in isolation. Filed upstream:
- agntcy/slim#1916 (downstream impact — their own README's plain-Node
example is currently broken)
- jhugman/uniffi-bindgen-react-native#422 (root cause)
detectAgntcyRuntime()'s existing graceful-degradation design already
handles this correctly with zero logic changes needed: its catch-all
branch (anything other than MODULE_NOT_FOUND) surfaces the real error and
falls back to local transport — verified this is exactly what happens
today. Once the upstream packaging bug is fixed, this same code path
starts succeeding with no changes needed here.
Added @agntcy/slim-bindings to optionalDependencies (real package now,
matching ADR-150's optional-only rule ADR-380 §1 follows).
* docs(adr): ADR-380 update section — correct the false 'no packages exist' claim
Documents both real corrections in-place (this repo's convention for a
still-Proposed ADR) rather than silently rewriting history: real
@agntcy/slim-bindings and agntcy-dir packages exist; Directory is now
live-integrated; SLIM is blocked by a specific, filed, upstream packaging
bug, not a missing SDK. Synced to the plugin-bundled copy.
* fix(ci): regenerate v3/pnpm-lock.yaml for the new @agntcy/slim-bindings optionalDependency
'pnpm install --frozen-lockfile' (what CI actually runs) failed after the
previous commit's hand-edit to package.json, since pnpm-lock.yaml was never
regenerated: ERR_PNPM_OUTDATED_LOCKFILE, cascading into ~20 unrelated-looking
CI job failures (every job that installs deps first).
Used a scoped 'pnpm install @agntcy/slim-bindings --lockfile-only --save-optional'
(not a full lockfile regeneration) specifically to avoid an unrelated,
pre-existing issue: @claude-flow/codex is pinned to 3.0.3 in package.json but
only 3.0.2 is actually published, which breaks a full-tree re-resolution but
doesn't block a scoped single-package update. Verified 'pnpm install
--frozen-lockfile' now succeeds cleanly from the correct v3/ workspace root
(the one CI's failing jobs were actually running from — this repo has two
separate pnpm workspaces, root and v3/, and I'd initially checked the wrong
one). As a side effect, the frozen-lockfile install's postinstall step
rebuilt @claude-flow/security's stale dist/, which also cleared the
pre-existing 19 unrelated tsc errors noted throughout this session's earlier
verification passes — tsc --noEmit is now fully clean, not just clean of
agntcy-related errors.
* docs(adr): ADR-378/379/380 — npm trusted publishing, statusline segments, AGNTCY runtime integration
Renumbered from the original 322/323/324 (chosen when this branch was
based on an older main) — origin/main has since merged real, Accepted
ADRs at those numbers (322=metaharness-flywheel-integration,
323=typed-memory-provenance, 324=agentic-policy-engine-codex-swarm).
Content unchanged from the original commit, only the numbers and
filenames moved to the next free slot after ADR-377.
ADR-378: npm Trusted Publishing (OIDC) for CI/CD release automation,
replacing the standing NPM_TOKEN class with per-run short-lived
tokens; pairs GCP WIF for the helpers-signing-secret fetch instead of
a static service-account key.
ADR-379: optional context/session/week usage segments and extra
statusline tip lines for .claude/helpers/statusline.cjs, following
the existing CONFIG.hideCost toggle precedent; session/week/effort
default OFF pending a stdin-schema verification spike.
ADR-380: AGNTCY/Outshift runtime integration (SLIM transport, CASA
enforcement, IOC Layer 9 coordination events) as an optional,
removable augmentation per ADR-150's pattern. Companion to metaharness
repo ADR-237 (agent/adr-237-agntcy-outshift-integration branch), which
owns the build-time half (identity, OASF export, observability).
* feat(agntcy): ADR-380 scaffolding — CASA envelope, SLIM/IOC CLI verbs, Rust crate
Renumbered from the original ADR-324 (origin/main has since merged a
real, unrelated, Accepted ADR-324 — see the companion docs commit).
Content and behavior unchanged; only the ADR number/filename and every
in-file reference to it moved to ADR-380.
Implements the buildable-now portion of ADR-380 (AGNTCY/Outshift
runtime integration) as optional, removable augmentation per ADR-150's
pattern. No AGNTCY/SLIM/Outshift npm or crates.io packages exist yet
under any plausible name (verified live) — every network touchpoint is
a clearly-logged stub gated behind explicit config, never a fake
success.
- plugins/ruflo-agntcy/: CASA envelope schema (Zod) + deterministic
compiler + enforcement gate (checkAuthorization, deny-by-default) +
bypass-attempt tests; Ed25519-signed CASA decision receipts
(.swarm/casa-receipts.jsonl); AGNTCY OTel span attribute constants
this repo owns (coordination.episode, authorization.decision).
- v3/@claude-flow/cli/src/commands/agntcy/: `ruflo transport use slim`,
`ruflo agent publish`, `ruflo swarm join <namespace>` — wired into
the top-level command registry and into agent.ts/swarm.ts's existing
subcommand arrays (merged alongside main's concurrently-added
pheromoneCommand); all exit 0 with a clear message when AGNTCY/SLIM
isn't configured (RUFLO_AGNTCY_SLIM_ENDPOINT unset).
- v3/crates/ruflo-agntcy/: Rust CasaEnvelope + check_authorization
mirroring the TS enforcement logic exactly, LocalTransport (real,
working, in-process) + SlimTransport stub behind a non-default
`slim` Cargo feature. Added to the workspace; also fixed a
pre-existing `cargo check` blocker (v3/plugins/gastown-bridge's
nested [workspace] table conflicting with the parent workspace) by
moving it from `members` to `exclude`.
Adversarial security review (as ADR-380 §3 requires before trusting
this gate) found and this commit fixes two real bugs in the first
pass:
- enforce.ts trusted the erased TS type instead of validating its own
input — a non-array `allow`/`deny` collapsed `.includes()` into
JS's substring-match overload, and a malformed `now`/`expires_at`
silently skipped the expiry check instead of failing closed.
checkAuthorization now runs CasaEnvelopeSchema.safeParse() on entry,
requires an explicit timezone offset on all timestamps, and treats
any unparseable timestamp as expired.
- compile.ts's keyword table matched bare "push"/"publish"/"release"/
"deploy" with no contextual gate, false-permissively granting
git.push/deployment.create for objectives like "push notification
integration" or "review the release notes". Patterns now require a
co-occurring contextual noun (git/commit/branch for push;
service/app/production/version/etc. for deploy).
Deferred to a follow-up pass (documented, not silently dropped):
plugins/ruflo-agntcy has no package.json yet (this repo's plugins/
ruflo-* convention is Claude Code plugin content, not an npm
workspace package — unlike @metaharness/agntcy's sibling-package
convention on the metaharness side), so no optionalDependencies entry
was added anywhere; adding one now would reference a package shape
that doesn't exist and break installs.
Companion: metaharness repo ADR-237 (agent/adr-237-agntcy-outshift-
integration branch) — build-time half of this integration.
* docs(agntcy): fix stale companion-ADR cross-reference (metaharness ADR-237 -> ADR-240)
Metaharness's own numbering collided too (ADR-237 was already taken by
evals-math-live-gsm8k-fast-domain on their main) and got renumbered to
ADR-240 — this repo's references to it were stale.
* fix(agntcy): add missing allowed-tools frontmatter to agntcy-status skill
CI's fleet-wide SKILL.md frontmatter audit correctly flagged this —
no implicit 'all tools' is allowed. Scoped to Read since this is a
scaffolding stub (not yet implemented) that will only ever need to
inspect local package.json/config state, never execute commands.
Recovers a fully-written, never-merged dream-cycle proposal from the
abandoned branch dream/2026-07-01-security (issue #2516) — the bot wrote
the ADR and SOTA report but never opened a PR for this night, so it sat
undiscovered outside the 49-PR backlog cleared in #2871.
Six 2026 Grade A papers establish that AgentDB's retrieval and write
paths have zero certified defenses: SMSR proves 93-100% poisoning ASR
without a certified defense (0% with one); indirect prompt injection
achieves near-100% retrieval success once a poisoned entry is written.
ADR-165 (CVE-1-5) covers input validation and plugin signing but not
this path.
Renumbered ADR-180 -> ADR-377 (180 was already reused by the bot's own
autopilot once and is not the current next-free slot after #2871).
Tracking issue with phased implementation plan: (filled in after merge)
The dream-cycle bot has opened a research proposal draft PR nightly since
2026-05-29. None had ever been merged (tracked in #2324), so each night's
run guessed ADR numbers against a stale view of main and collided
repeatedly — ADR-147 alone was independently claimed by 4 different
proposals (#2304, #2310, #2317, plus a README-only PR #2278), and ADR-179
by another 4 (#2617, #2624, #2631, #2656, plus README-only #2642).
This consolidates the SOTA research reports and ADR proposal text from
all 49 open dream-cycle drafts into a single reviewable change:
- 43 ADR proposals renumbered sequentially into ADR-334 through ADR-376
(first-opened-first-numbered), with self-referencing ADR-N mentions
inside each file updated to match
- 4 branches that contained only a SOTA report with no ADR proposal
(#2368, #2382, #2430, #2607) carried over as-is
- 2 branches that only added a README index row for an ADR file they
didn't otherwise include (#2278 for ADR-147, #2642 for ADR-179) are
superseded by the real ADR-147/179 claimants above and dropped
- v3/docs/adr/README.md gets one clean set of index rows instead of 43
individually conflicting ones
All ADRs land as Proposed — none of this is an implementation decision,
just clearing 2 months of unreviewed nightly research out of PR limbo so
it can actually be read. The original 49 PRs are closed with a pointer
to this commit.
Closes#2224, #2242, #2249, #2255, #2266, #2278, #2304, #2310, #2317, #2333, #2344, #2363, #2368, #2379, #2382, #2394, #2402, #2420, #2430, #2436, #2457, #2463, #2472, #2479, #2486, #2496, #2511, #2527, #2537, #2560, #2577, #2598, #2607, #2617, #2624, #2631, #2642, #2656, #2665, #2702, #2716, #2728, #2740, #2753, #2761, #2764, #2769, #2779, #2793