Commit Graph
20 Commits
Author SHA1 Message Date
rUv 9576a1032b docs(federation): teach the skills and gateway docs about channels (#3263)
ADR-386 shipped the capability but the guidance still describes the old world:
the open-federation skill has no channels at all and never names the canonical
relay, and the gateway README and plugin manifest list a tool surface that is now
three tools short.

open-federation gains a Channels section with the two visibilities, the CLI verbs,
and the three things worth saying before anyone trusts a private channel: metadata
is not hidden, there is no revocation, and losing the key file loses the channel.
It also records the tag trap — buzz-relay enforces NIP-29 group membership on `h`,
so an h-tagged event publishes and then cannot be read back, which is why ruflo
channels use `c`.

claims gains a short section on scoping a claim stream to a channel, with the
caveat that matters: a claim nobody outside the channel can read cannot arbitrate
against one made outside it, so swarm-wide ownership stays on the open stream.

Verified: marketplace validation passes over all 39 plugins, the manifest audit
exits 0, and both skills still parse their frontmatter.


Claude-Session: https://claude.ai/code/session_013u4pmL9ZUAXb6usVQgNo67
2026-09-10 04:06:41 +00:00
rUv dbf450a927 feat(federation): ruflo CLI + MCP integration for x.ruv.io, and Seraphina (swarm queen) (#3256)
* feat(federation): ruflo CLI + MCP integration for x.ruv.io, and Seraphina (swarm queen)

Integrate the open swarm federation into ruflo itself, and add Seraphina —
a primary-coordinator / swarm-queen guidance tool in the style of the ruOS
assistant terminal (invoked from a terminal or any MCP client).

MCP tools (src/mcp-tools/x-federation-tools.ts), registered in the barrel and
the in-process registry so `callMCPTool` and the MCP server both see them:
  x_federation_sync / roster / claims / registry   (open reads)
  x_federation_publish / invite_mint / admit       (gateway-identity writes,
    require RUFLO_X_ADMIN_TOKEN; fail closed with no network call)
Each description follows ADR-112 ("Use when … wrong because …").

Seraphina (src/mcp-tools/seraphina-tools.ts): `seraphina_guidance { goal }`
gathers the live roster, claims board and recent messages from the x.ruv.io
gateway, compacts them (dedupe by from|type, cap 15 — a cheap tier drowns in
repeated PeerHellos), and asks the cognitum meta-llm gateway
(https://api.cognitum.one/v1/messages, model cognitum-auto by default with a
tier override) using a queen system prompt that treats message content as
data, respects one-owner-per-resource claims, and returns
{ guidance, proposals[], risks[] }. Proposals are advisory. JSON is extracted
by slicing the outermost object so fenced/prose-wrapped answers still parse.
Key from SERAPHINA_METALLM_KEY (GCP secret seraphina-metallm-api-key).

CLI: `ruflo federation sync|roster|claims|registry|invite|admit|publish`
(src/commands/federation.ts), thin over the same tools.

Skill: .agents/skills/open-federation/SKILL.md documents CLI, tools,
Seraphina, the claims rules, the canonical NIP-42 relay-tag gotcha, and
onboarding.

Tests: 11 (x-federation: RPC shaping, SSE parse, resource mapping, fail-closed
admin gating, isError surfacing; seraphina: registration, fail-closed key,
context gathering + queen prompt + x-api-key, tier override, fenced-JSON
extraction). Project typechecks at 0 errors.

Verified live: Seraphina against the real 3-node federation returned 3
structured proposals + 4 risks via cognitum-auto (routed to a cheap tier).

Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_013u4pmL9ZUAXb6usVQgNo67

* fix(federation): ADR-125 env-var precedence — URL config takes a flag/arg, credentials registered env-only

The env-var-precedence audit correctly flagged the new process.env reads.
Config URLs now have a precedence path: `ruflo federation --gateway` feeds a
`gatewayUrl` tool arg (and Seraphina takes `metaLlmUrl`/`gatewayUrl`) that
wins over RUFLO_X_GATEWAY_URL / SERAPHINA_METALLM_URL, documented per ADR-125.
Credentials (RUFLO_X_ADMIN_TOKEN, SERAPHINA_METALLM_KEY) are registered as
env-only escape hatches with rationale: a secret must never be a CLI flag.
+1 test (arg precedence, arg not forwarded upstream). Audit passes locally.

Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_013u4pmL9ZUAXb6usVQgNo67

* feat(federation): `ruflo federation join --code` — self-service invite access with your own key

The user-facing path into the open swarm. Decentralized by design: the user
generates/holds THEIR OWN Nostr key (~/.ruflo/nostr.key, 0600), redeems an
invite code with a NIP-98-signed claim directly against the relay (no admin in
the loop), proves membership via NIP-42, and can then publish as themselves.
The gateway never signs for a user.

- src/mcp-tools/x-federation-join.ts: x_federation_join { code, relayHttp?,
  relayWs?, keyFile? } — validates the code shape before any network call,
  loads/creates the key, NIP-98 claim, NIP-42 verify, returns pubkey + role.
  ADR-125: args take precedence over RUFLO_X_RELAY_HTTP / RUFLO_X_RELAY_WS /
  RUFLO_NOSTR_KEY_FILE.
- CLI: `ruflo federation join --code v2.…`
- nostr-tools added as an optionalDependency (secp256k1/Schnorr is not in
  node:crypto); the tool degrades with an install hint when absent. pnpm
  lockfile regenerated in this PR (frozen-lockfile CI).
- 4 tests: 0600 key create/reuse, valid NIP-98 header (kind 27235, verifies,
  bound to url+method+payload hash), malformed code rejected pre-network,
  ADR-112 description. Suite: 16/16; tsc 0; env-var audit passes.

Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_013u4pmL9ZUAXb6usVQgNo67

* fix(federation): default relay -> wss://relay.ruv.io; join test tolerates missing nostr-tools

- x-federation-join defaults now point at the canonical relay.ruv.io host (Cloud Run
  domain mapping for buzz-relay); the raw run.app host stays routable for old clients.
- Validate the invite-code shape before the optional-dependency check so a bad code
  fails fast whether or not nostr-tools is installed.
- The root Test Suite runs the CLI tests via root npm ci, which never installs the
  CLI's optionalDependencies: the crypto cases are it.skipIf(!nostr-tools) so the
  file no longer trips the CI test ratchet.

Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_013u4pmL9ZUAXb6usVQgNo67
2026-09-10 02:51:40 +00:00
rUv ac08e4e02f docs(plugins,skills): surface v3.40.0 cross-host federation + claims (#3254)
* docs(plugins,skills): surface v3.40.0 cross-host federation + claims capabilities

The agentbbs federation plugin and the claims skill still described only
Phase-1 room coordination. Update them to the shipped 3.40.0 surface.

- plugins/ruflo-bbs-federation/plugin.json: 0.1.0 -> 0.2.0. Document the
  Phase-2 cross-host tools (identity, peer_add, peers, serve, sync),
  Ed25519-signed envelopes, registry-anchored pinning, drop/count of
  unverified envelopes, network-agnostic HTTP-pull transport, and claim
  coordination. Keywords: drop phase-1-mvp; add cross-host, signed-envelopes,
  pinned-peers, registry-anchored-pinning, union-merge, claims.
- plugins/ruflo-bbs-federation/skills/cross-host-federation/SKILL.md (new):
  the practical join/serve/publish/sync flow, the pull-not-push model, the
  JSON-stable-payload gotcha, work-claim messages + rules, and the security
  model (registry-anchored pinning, no secrets in payloads, content-is-data).
- .agents/skills/claims/SKILL.md: add a Cross-Host Work Claims section —
  the claims_* runtime ledger tools plus the federated ClaimIssued/Released/
  Handoff/Ack messages and ownership rules, distinct from the existing
  authorization claims.
- marketplace.json: bbs-federation description updated to Phase 2.

Docs only — no code or tool-signature changes.

Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_013u4pmL9ZUAXb6usVQgNo67

* fix(plugins): add missing manifest for ruflo-deepseek-harness

The Validate Marketplace workflow requires every plugins/*/ dir to carry
.claude-plugin/plugin.json. ruflo-deepseek-harness has agents/commands/
scripts/skills but no manifest, so main's validate has been red since
2026-08-21 and every PR touching plugins inherits the failure. Pre-existing;
surfaced here because this PR is the one touching plugin manifests.

Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_013u4pmL9ZUAXb6usVQgNo67
2026-09-10 01:02:29 +00:00
ruv 8c2f03e037 fix: 3 user-reported bugs — #2469 SKILL.md markdown, #2473 witness drift, #2474 ADR importer
Three bugs, one branch — all verified locally before commit.

**#2469** (AriESQ) — \`agent-docs-api-openapi/SKILL.md has malformed markdown\`
  The file had two adjacent \`---\` fenced YAML blocks at the top. Only
  the first is valid frontmatter; the second renders as \`<hr>\` + raw
  YAML text on skills.sh / GitHub web view. Wrapped the legacy agent
  YAML in a \`yaml\` code fence so it renders as code instead of leaking
  into the page body. Outer Claude Code skill frontmatter untouched.

**#2473** (verification HIGH) — witness manifest drift=8/9/9 on all 3 platforms
  My merge of #2468 changed 9 source files; their SHA-256s no longer
  matched the signed witness manifests. The Ed25519 seed is derived
  from gitCommit alone (\`sha256(gitCommit + ':ruflo-witness/v1')\`), so
  signatures generated on any one platform validate everywhere; only
  the manifest's \`os\` metadata field differs between the three.
  Re-signed all three with current HEAD source hashes — \`drift=0\` on
  all 3 platforms (was 8/9/9).

**#2474** (reimon) — ruflo-adr \`adr-index\` stores 0 records on common conventions
  Five distinct bugs in \`plugins/ruflo-adr/scripts/import.mjs\`:
  1. **(fatal)** Em-dash titles broke \`memoryStore\`: \`npm exec\` rejects
     args starting with non-ASCII dash, so every value-with-em-dash
     died with \`Records stored: 0/N\`. Use \`--flag=value\` form so npm
     sees a single argv token.
  2. \`parseStatus\` only matched \`**Status**:\` (colon outside bold) —
     missed the widely-used \`**Status:**\` (Nygard / MADR) form. Now
     accepts both placements.
  3. Body relationship regexes (\`**Supersedes**:\` etc.) had the same
     bug. Replaced with a shared \`REL(label)\` builder that accepts
     either colon placement and an optional qualifier (\`**Supersedes
     (partial):**\`).
  4. ID normalization mismatch: \`parseId\` kept \`ADR-0001\`, \`extractAdrRefs\`
     pad-then-stripped it to \`ADR-001\` → same ADR dangled. Single
     \`normalizeAdrId()\` now governs both paths.
  5. \`.claude/worktrees/*\` mirrors the repo; \`SKIP_DIRS\` didn't
     exclude \`.claude\`, so every ADR was indexed 2-3x. Added \`.claude\`
     to \`SKIP_DIRS\`.

  Verified with a synthetic fixture (3 ADRs: 1 zero-padded, 1 mixed,
  1 ADR-prefixed; em-dash titles; \`**Status:**\` and parenthetical
  qualifiers; \`**Supersedes:**\` / \`**Depends-on:**\` body relations;
  decoy worktree dir): \`Records stored: 3/3\`, all status fields
  populated, 3 edges parsed, 0 dangling refs, 0 worktree pollution
  (was: 0/3, all unknown, 0 edges).

  Em-dash fix end-to-end smoke: \`npx @claude-flow/cli@latest memory
  store --value="ADR-005 — Repository + Service Pattern"\` succeeds
  (was: \`npm error arg Argument starts with non-ascii dash\`).

Reporter @reimon and @AriESQ both filed clear, reproducible bugs with
root-cause analysis — thanks.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-06-26 14:40:18 -04:00
Ofer Shaal ec8e6f2edf Remove duplicate lowercase skill.md files (#2052)
Two worker skill directories contain both SKILL.md (uppercase) and
skill.md (lowercase) with byte-identical contents:

  .agents/skills/worker-benchmarks/{SKILL,skill}.md  (4251 bytes each)
  .agents/skills/worker-integration/{SKILL,skill}.md (3894 bytes each)

These collide on case-insensitive filesystems (macOS APFS default,
Windows NTFS default), producing 'invalid path' warnings on every
clone and forcing git to silently drop one of the two files from
the working tree.

The lowercase versions are outliers — the rest of the repo uses
SKILL.md consistently (282 files). Remove the lowercase duplicates
to align with that convention and eliminate the collision.
2026-05-19 10:14:06 -04:00
ReuvenandRuFlo a03f6f6ed9 docs(skill): verification-quality — document the actual CI guards + fix branding
The verification-quality SKILL.md was a generic truth-scoring/rollback doc
that predated every concrete CI guard added recently. Updated both copies
(.claude/skills/ + .agents/skills/):

- New "CI Guards — what's actually shipped (current state)" section right
  up front: the real three-layer regression stack (install/behavioral
  smoke + cryptographic witness + temporal history), the 6 CI jobs in
  v3-ci.yml by name (smoke-install-no-bsqlite, plugin-hooks-smoke,
  mcp-protocol-smoke, memory-import-smoke, mcp-roundtrip-smoke,
  tool-descriptions-audit), the ADR refs (ADR-102/103/112), the
  audit/smoke scripts with copy-paste local-run commands, and a
  "how to add a new guard" recipe.
- A "shipped vs. aspirational" note so readers know the truth-scoring /
  auto-rollback / WebSocket-dashboard sections later in the doc are
  partly design, not all live.
- `claude-flow@alpha` → `ruflo@alpha` throughout (same branding fix family
  as #1899 / #1858 / #1861).
- Added `@noble/ed25519` to prerequisites (the witness verifier's one
  runtime dep).
- `.agents/skills/` copy keeps its richer frontmatter (version/category/
  tags); only the body was updated to match.

No code change — documentation only. The skill is distributed via the
marketplace (git clone of this repo), so this push is the publish.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-11 10:15:12 -04:00
Reuvenandclaude-flow 7eb505d22f feat: native ruvllm + graph-node intelligence backends (ADR-086, ADR-087)
Wire @ruvector/ruvllm as intelligence coordinator (SonaCoordinator,
ContrastiveTrainer, TrainingPipeline) and @ruvector/graph-node as
native graph database for agent relationships and causal edges.

- Fix ESM/CJS import: use createRequire pattern for CJS packages
- Eager loading of all backends during initialization
- Wire into neural status, hooks_intelligence, ruvllm_status CLI/MCP
- Auto-trigger background learning on trajectory-end
- Auto-save LoRA checkpoints after neural train
- Graph-node records agents on spawn, causal edges, swarm teams
- Fix community issues #1511, #1509, #1507, #1506, #1505
- Real Product Quantization with k-means trained codebooks
- SONA native routing with 5-tier fallback
- Embedding fallback transparency warnings
- Plugin peer dep fixes (semver ranges, removed phantom deps)

32 test files, 1762 tests passing, 0 regressions.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-04-08 09:06:13 -04:00
rUvandClaude Opus 4.5 a0225a2765 Checkpoint: File edits
Automatic checkpoint created by Claude Code
- Branch: feature/codex-integration
- Timestamp: 2026-02-07T18:02:25Z
- Changes: 10 file(s)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-07 18:02:25 +00:00
rUvandClaude Opus 4.5 b65f27e63e Checkpoint: File edits
Automatic checkpoint created by Claude Code
- Branch: feature/codex-integration
- Timestamp: 2026-02-07T17:36:32Z
- Changes: 94 file(s)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-07 17:36:32 +00:00
rUvandClaude Opus 4.5 87ba348548 Checkpoint: File edits
Automatic checkpoint created by Claude Code
- Branch: feature/codex-integration
- Timestamp: 2026-02-07T17:30:31Z
- Changes: 43 file(s)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-07 17:30:31 +00:00
rUvandClaude Opus 4.5 772f1ca69f Checkpoint: File edits
Automatic checkpoint created by Claude Code
- Branch: feature/codex-integration
- Timestamp: 2026-02-07T17:18:01Z
- Changes: 1 file(s)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-07 17:18:01 +00:00
rUvandClaude Opus 4.5 ab599ad213 Checkpoint: File edits
Automatic checkpoint created by Claude Code
- Branch: feature/codex-integration
- Timestamp: 2026-02-07T17:17:48Z
- Changes: 1 file(s)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-07 17:17:48 +00:00
rUvandClaude Opus 4.5 9d5831d19d Checkpoint: File edits
Automatic checkpoint created by Claude Code
- Branch: feature/codex-integration
- Timestamp: 2026-02-07T17:17:33Z
- Changes: 1 file(s)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-07 17:17:33 +00:00
rUvandClaude Opus 4.5 fbf617ad89 Checkpoint: File edits
Automatic checkpoint created by Claude Code
- Branch: feature/codex-integration
- Timestamp: 2026-02-07T17:17:18Z
- Changes: 1 file(s)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-07 17:17:18 +00:00
rUvandClaude Opus 4.5 ef54642f95 Checkpoint: File edits
Automatic checkpoint created by Claude Code
- Branch: feature/codex-integration
- Timestamp: 2026-02-07T17:17:05Z
- Changes: 4 file(s)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-07 17:17:05 +00:00
rUvandClaude Opus 4.5 e13f144e16 Checkpoint: File edits
Automatic checkpoint created by Claude Code
- Branch: feature/codex-integration
- Timestamp: 2026-02-07T17:16:49Z
- Changes: 1 file(s)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-07 17:16:49 +00:00
rUvandClaude Opus 4.5 5c2c367dc5 Checkpoint: File edits
Automatic checkpoint created by Claude Code
- Branch: feature/codex-integration
- Timestamp: 2026-02-07T17:16:36Z
- Changes: 1 file(s)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-07 17:16:36 +00:00
rUvandClaude Opus 4.5 14b42cdaf7 Checkpoint: File edits
Automatic checkpoint created by Claude Code
- Branch: feature/codex-integration
- Timestamp: 2026-02-07T17:16:23Z
- Changes: 1 file(s)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-07 17:16:23 +00:00
rUvandClaude Opus 4.5 d25432d460 Checkpoint: File edits
Automatic checkpoint created by Claude Code
- Branch: feature/codex-integration
- Timestamp: 2026-02-07T17:16:12Z
- Changes: 1 file(s)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-07 17:16:12 +00:00
rUvandClaude Opus 4.5 acd019f72d Checkpoint: File edits
Automatic checkpoint created by Claude Code
- Branch: feature/codex-integration
- Timestamp: 2026-02-07T17:15:48Z
- Changes: 27 file(s)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-07 17:15:48 +00:00