getHNSWIndex({ forceRebuild: true }) only skipped the in-memory cache.
It still reopened hnsw.index and, when that file and its metadata
already held entries, returned them without reading SQLite. So
`memory search --build-hnsw` and `embeddings index rebuild` kept
deleted and stale vectors while reporting a rebuild.
A forced rebuild now ignores the persisted metadata, loads from SQLite
and saves the new metadata. The load also orders by updated_at DESC
before LIMIT 10000, so the cap keeps the newest rows.
Claude Code loads .mcp.json and then every plugin.json#mcpServers entry (a .json path, an inline map, or an array of either), but the marketplace-trust scan read only .mcp.json, so a server declared in the manifest skipped the mcp-command and unpinned-package checks. Scan each declared entry, and report one that points outside the plugin, is missing, is not JSON, or is a bundle or URL as high, like plugin.json#hooks (#5115).
The 2026-07-28 server/discover response copied the legacy capability object, including tools.listChanged: true. The stdio dispatchers have no subscriptions/listen handler, so a modern client that negotiated the revision opened a notification stream and repeatedly received 'Method not found: subscriptions/listen' (#5145).\n\n- Project discovery capabilities without listChanged, copying each capability object rather than mutating the caller's object.\n- Keep legacy initialize byte-equivalent: it still returns the original capabilities.\n- Do not fabricate a subscription handler; the static catalogue simply stops advertising a stream this server does not serve.\n\nRegression: discovery drops listChanged for tools/resources/prompts, legacy initialize keeps it, and the input object is unchanged. The new case fails against the pre-change source; the focused protocol suite passes.
* fix(cost-tracker): price Fable sessions instead of recording $0
modelTier() only knew haiku, sonnet and opus, so a Fable model id fell
through to `unknown`, and costForUsage() priced that tier at 0. track.mjs
wrote those sessions to the cost-tracking namespace with cost_usd 0 and
session.mjs showed them as free, although data/prices.json has Fable
rates. Add a `fable` tier derived from that entry, like the other three.
Closes#5121
* chore(cost-tracker): 0.31.4 for the Fable pricing fix (#5121)
Co-Authored-By: RuFlo <ruv@ruv.net>
---------
Co-authored-by: Ayham Joumran <140757050+AyhamJo7@users.noreply.github.com>
Co-authored-by: r <r@x>
searchEntries() fell back to a sql.js scan with LIMIT 1000 and no
ORDER BY, so past 1000 live rows the newest entries were never scored.
Read newest first with the bridge's search window, as #5084 did for
`embeddings search`.
* dream(security): enforce allowShell/allowNetwork/allowFileWrite in MCP policy enforcer
.harness/mcp-policy.json declares allowShell/allowNetwork/allowFileWrite:
false, but policy-enforcer.ts never read them -- decorative, on the false
premise that shell/network/filesystem access isn't reachable from this
MCP server's own tool surface. Two independent dream-cycle research
passes tonight traced the real handlers: terminal_execute (execSync),
http_fetch (raw network), hooks_fast-apply/hooks_codemod (direct
writeFileSync) all perform these operations directly inside their own
MCP tool handlers, contradicting that premise.
Adds a small, explicitly-traced MCP_TOOL_CAPABILITY table and
checkCapabilityAllowed(), wired into evaluateToolCall(), to deny calls to
those four tools when the corresponding flag is explicitly false and
RUFLO_MCP_ENFORCE_POLICY=1 is set. A tool outside the table, or a flag
left undefined, keeps today's behavior unchanged. Corrects the matching
false claim in mcp-policy.json's $comment/rationale and the module's own
docstring; regenerates manifest.json's sha256 per .harness/README.md's
documented procedure.
Scoped to the four tools traced end-to-end tonight -- the broader surface
found during research (github_* exec paths, browser_* execFileSync, more
fetch()/writeFileSync call sites, and the separate HTTP/WebSocket
dispatcher that never calls this enforcement module at all) is disclosed
as follow-up, not fixed here.
Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01ReiDH2qNAWsw4W8Gror5vV
* dream(security): #5126 add 2026-11-26 research gist
Research gist for tonight's Dream Cycle (DEEP=security, SCAN=intelligence,swarm):
MCP policy allowShell/allowNetwork/allowFileWrite decorative-enforcement gap,
competitor comparison, hypothesis, evaluation receipt, independent adversarial
critique, Darwin skip rationale, witness, and scan findings (intelligence SONA
EWC inert for 3/5 modes; swarm PBFT leader-impersonation gap in byzantine.ts).
gh gist create unavailable (GH_TOKEN invalid, no gist MCP tool) -- committed
in-repo per established precedent since 2026-09-30.
Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01ReiDH2qNAWsw4W8Gror5vV
* dream(security): #5126 update LEDGER for 2026-11-26
Appends tonight's row (security, #5126/#5127, ACCEPT) and a note confirming
the 2026-11-25 ledger-append gap is the same recurring cosmetic STEP 25 issue
flagged by several prior nights, not a pipeline failure (branch/PR #5112/#5113
both verified to exist via list_pull_requests).
Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01ReiDH2qNAWsw4W8Gror5vV
---------
Co-authored-by: Claude <noreply@anthropic.com>
start always used port 3000 unless --port was passed: the flag fell back to
the default before the config lookup, the --port option had a parser
default, and the lookup read mcp.serverPort while init writes mcp.port.
Use --port, then numeric mcp.port, then mcp.serverPort, then 3000.
Fixes#5106
Co-authored-by: Lenin Mookiah <2639584+leninworld@users.noreply.github.com>
The marketplace-trust scanner read hooks only from hooks/hooks.json, while Claude Code takes the file from .claude-plugin/plugin.json#hooks. A plugin that renamed its hooks file escaped both the command-hook risk scan and the loaded-module walk; its listed modules, including ones under tests/ or outside the plugin, went unreported (#5115).\n\n- Resolve the hooks source the way the host does: a string path inside the plugin, an inline hooks object, or the default hooks/hooks.json.\n- A declared path outside the plugin, missing, non-regular or invalid JSON is a high finding, never a silent skip.\n- Run scanHooksJson and scanLoadedModules on the resolved file, resolving modules against its directory and citing that file in findings.\n- Keep the generic hooks/ module walk as coverage beyond the manifest.\n\nRegression tests compare a renamed hooks file against the default layout, cover command hooks, inline hooks, outside/missing paths and invalid JSON. All five cases fail on the pre-change source and pass with the fix.
* fix(security): linear-time channel-guard role scan, unguessable MCP session ids
- channel-guard (cli, shipped) and channel-guard-worker (hooks): the
role-shift regex `(^|\n)\s*(system|...)` was quadratic on newline runs
(CodeQL js/polynomial-redos #256): 400k newlines took about a minute.
`[^\S\n]*` can't cross a newline, so the scan is linear. Leading blank
lines before a first role marker still count as the preamble.
- legal-contracts extractKeyTerms: `\d+\s*(days?...)` and `\d+%` were
quadratic on digit runs (CodeQL #325); `(?<!\d)` anchors them.
- shared/mcp and v3/mcp SessionManager: replace timestamp + Math.random()
session ids with randomUUID(), matching @claude-flow/mcp.
Co-Authored-By: RuFlo <ruv@ruv.net>
* revert shared/mcp session-manager change (needs its own leaf publish; follow-up)
Co-Authored-By: RuFlo <ruv@ruv.net>
---------
Co-authored-by: r <r@x>
memory_import_claude matched frontmatter and ## headings with \n only, so a
CRLF memory file kept its frontmatter in the stored content, used the file
name as the key and kept each section's heading line. Accept \r?\n, as the
auto-memory bridge already does for the same files.
Fixes#5101
Co-authored-by: Lenin Mookiah <2639584+leninworld@users.noreply.github.com>
* dream(swarm): remove dead @ruvector/core native-probe from QLearningRouter
initialize() dynamically imported '@ruvector/core' hoping for a native
createQLearning() backend, but route()/update() never read the resulting
engine back -- the probe was dead state regardless of which package it
targeted. Confirmed: @ruvector/core is not a dependency here and isn't
installed anywhere reachable from this package; even the real published
package exports no createQLearning; @claude-flow/neural's createQLearning
(the only real, working implementation in this monorepo) uses an
incompatible trajectory-batch API. Removes the probe, documents why
useNative stays a permanent false, and adds a discriminating test.
Deferred twice before (2026-10-29, 2026-11-14) under the "wrong package"
framing; tonight's research found the deeper bug: no package swap could
ever have mattered, since nothing downstream consulted the result.
Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01ReiDH56dzD6yHijgXUzVdB
* docs(dream-cycle): add 2026-11-24 swarm SOTA report + witness
Research gist for tonight's dream cycle (DEEP=swarm, SCAN=ruview-
integration,ruvector-integration). Witness computed over this file with
Candidate commit/Gist SHA-256/Witness stamp held at PENDING, concatenated
with the session commit, per the documented verifier procedure.
Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01ReiDH56dzD6yHijgXUzVdB
* docs(dream-cycle): append 2026-11-24 ledger row (#5096, #5097)
Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01ReiDH56dzD6yHijgXUzVdB
---------
Co-authored-by: Claude <noreply@anthropic.com>
#5067's mod-side fix screens the task and verifier before writing, but the CLI ingest still accepted legacy or hostile records: a secret in task/verifier evidence, ledger evidence, or a token-shaped file name could be stored and later cited as a lesson.\n\n- parseRecord() rejects a task carrying a recognised secret shape and redacts verifier.command before it reaches SONA feedback or lessons.\n- readLedger() redacts stored evidence and re-verify check names.\n- buildLessons() drops secret-shaped keywords and redacts evidence again at build time.\n- The CLI lessonFile() rejects a token-shaped path; the mod-side copy is bundled into the signed learning-loop.cjs, so its matching screen remains a follow-up requiring the maintainer re-sign.\n- Added regression coverage for a synthetic GitHub token in task, verifier command, ledger evidence, lesson keyword/evidence, and CLI file anchors.
parseLcov compared raw '\n'-split lines, so on CRLF input end_of_record
never matched: the last record was dropped and paths kept a trailing '\r'.
Trim each line and flush a record left open at the end of the input, as
commands/coverage-reader.ts already does.
Fixes#5093
Co-authored-by: Lenin Mookiah <2639584+leninworld@users.noreply.github.com>
* fix(security): untrusted package execution in metaharness bin lookup
The metaharness bin resolver walked up node_modules from the MCP server's
working directory, so a project that ships its own node_modules/metaharness
had that package's bin run by score/genome/mcp-scan/threat-model and the
other metaharness tools. Resolve only from ruflo's own install tree
(fromCwd:false), as _darwin.mjs and _redblue.mjs already do, and fall back
to the pinned cache install. Extend test-no-tool-time-npx.mjs Phase 5.
Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01MfPHVFtykqWwFzN42pqGmY
* fix(security): path traversal in agenticow MCP tools
agenticow_* handlers accepted any absolute memory path from tool input and
created or overwrote <path> and <path>.agenticow.json there. Paths from MCP
input now go through resolveToolMemoryPath, which requires both files to
resolve inside the project (real parent directory, no symlinked or
executable target) via containedWritePath. The local CLI keeps its ability
to name any path. Add agenticow-path-containment.test.ts.
Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01MfPHVFtykqWwFzN42pqGmY
* chore(plugins): bump ruflo-metaharness to 0.5.4 for the bin lookup fix
Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01MfPHVFtykqWwFzN42pqGmY
---------
Co-authored-by: Claude <noreply@anthropic.com>
- fix(system): system_health reports persisted swarm state (#5087, fixes#2967)
- fix(cli): a subcommand's own --format choices shadow the global ones (#5083)
- fix(embeddings): embeddings search scores the newest rows (#5084)
Co-authored-by: r <r@x>
The candidate SELECT used LIMIT 1000 with no ORDER BY, so on a store
with more than 1000 embedded rows SQLite returned the oldest-inserted
1000 and the newest entries were never scored (#2982's root cause,
fixed in the memory bridge but not in this command, which reads
memory.db directly). Order by updated_at DESC and use the bridge's
search window (10000, CLAUDE_FLOW_SEARCH_WINDOW).
validateFlags checked a subcommand's --format against both its own
choices and the global text/json/table choices, so every
subcommand-specific value failed: `process monitor` exited 1 on its own
default `dashboard`, and `session export --format yaml`,
`analyze dependencies --format dot` and `performance metrics --format
prometheus` could not be selected. A command's own option now shadows
the global one of the same name, as it already does for parsing and
defaults.
The swarm check in system_health was a fixed 'unknown' entry even after
swarm_init persisted a running swarm. Read the persisted state through
loadSwarmStore(): running swarms are healthy, no swarm stays advisory
(unknown), and a corrupt store is a warning.
Fixes#2967
Co-authored-by: Lenin Mookiah <2639584+leninworld@users.noreply.github.com>
The two hero images, Explore ruPro and Try the interactive demo all
pointed at untagged cognitum.one URLs, so a ruPro waitlist lead could
not be traced to the link that brought it in (cognitum-one/website#1536).
Each now carries utm_source=github, utm_medium=readme and a distinct
utm_campaign. The demo tags sit before the #demo fragment, where the
site can read them.
Republishes 3.80.3's content. The 3.80.3 CI publish uploaded all three
archives, but npm never stored their SLSA provenance bundles (the registry
origin serves only the publish attestation), so ADR-545 left them on
release-3-80-3 and latest stayed at 3.80.2.
Carries #5079 (#5086), #5081 (#5082, neural 3.1.2) and #5085.
Co-authored-by: r <r@x>
- doctor Version Freshness compares against latest, not frozen alpha (#5079, #5086)
- ReasoningBank excludes contradicted memories at retrieval via @claude-flow/neural 3.1.2 (#5081, #5082)
Co-authored-by: r <r@x>
Tool-time npx calls resolve packages from a ruflo-owned prefix instead of the opened project; metaharness MCP file arguments stay inside the project; daemon stop only signals a validated ruflo process. Release 3.80.3 (helpers manifest re-signed).
Co-Authored-By: claude-flow <ruv@ruv.net>
* dream(memory): #5081 ReasoningBank never enforces its own contradiction-exclusion flag
detectContradictions() marks the lower-quality side of a contradicting
memory pair consolidated=true ("to exclude from retrieval"), but
retrieve()/retrieveByContent() never checked that flag. Add the filter
in both read paths; byte-identical for any entry never flagged.
Independently corroborated by two research roles (external-literature
review and pure code review) before either saw the other's output, and
independently reproduced by a fresh-context adversarial critic. 184/184
full @claude-flow/neural suite, tsc clean, 0 regressions. Darwin skipped
(binary guard, no tunable parameter, precedent: 2026-11-14).
Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01ReiDH5LxSysCuj75KkPYiu
* docs(dream-cycle): fill in 2026-11-23 gist witness block
Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01ReiDH5LxSysCuj75KkPYiu
* docs(dream-cycle): append 2026-11-23 ledger row (#5081/#5082)
Also records direct verification of the 2026-11-19..22 no-run gap and
that #4973/#4983/#5012/#5034 were batch-integrated via #5041 (merged
2026-11-19), not rejected.
Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01ReiDH5LxSysCuj75KkPYiu
* fix(neural): skip consolidated memories while gathering candidates (#5081)
Filtering after candidate selection let an HNSW hit list made only of
consolidated entries return nothing instead of falling back to brute force,
and counted it as an HNSW retrieval.
Co-Authored-By: RuFlo <ruv@ruv.net>
* chore(neural): publish 3.1.2 and pin it (#5081)
The ReasoningBank fix lives in a non-bundled leaf; @claude-flow/neural 3.1.2 is
published standalone so the train carries it.
Co-Authored-By: RuFlo <ruv@ruv.net>
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: r <r@x>
doctor asked npm for @claude-flow/cli@alpha, frozen at 3.75.2 since ADR-513, so
every version from 3.75.2 on reported "up to date". Query @latest, the tag its
fix advice installs. The federation fix advice installed the frozen @alpha
(1.0.3; latest is 1.0.7); point it at @latest too.
Co-authored-by: r <r@x>
Fixes since 3.80.1:
- #5076: a crash between creating and writing the policy state lock left an
empty state.lock that failed every MCP tool call (Codex's guidance_brain and
memory_search included) with policy-state-lock-timeout. The lock is now
published whole with link(), and a stuck lock names its cause and path.
- #5077: Codex parsed the hook handler's `[INFO]`/`[OK]` reports as JSON
("invalid user prompt submit JSON output"); under a Codex payload the
handler now emits hook JSON (additionalContext) or nothing on stdout.
Re-signed helpers.manifest.json.
Co-authored-by: r <r@x>
* fix(policy): never leave an empty state.lock; say how to recover a stuck one
acquireLock created state.lock and then wrote its owner into it. A process
that died in between (a reboot, SIGKILL, OOM) left an empty lock that names
no owner, so it can never be reclaimed: every MCP tool call, Codex's
guidance_brain and memory_search included, waited 5 s and failed with a
bare policy-state-lock-timeout. Seen live: a 0-byte lock from a previous
boot blocked the project for five days.
- The owner is written to a private temp file first and link() publishes
the lock whole (EEXIST when held, never follows a symlink). Windows and
filesystems without hard links keep create-then-write, which now removes
its own lock if the write fails.
- A timeout against an owner that can never be identified (empty, unreadable,
another host, an earlier boot, another PID namespace) now says which, its
age, and the path to remove. A live owner keeps the bare message, which the
console retries.
- Unknown owners are still never taken over automatically.
Co-Authored-By: RuFlo <ruv@ruv.net>
* test(mcp-tools-deep): give the in-memory fs fake linkSync for the atomic lock
Co-Authored-By: RuFlo <ruv@ruv.net>
---------
Co-authored-by: r <r@x>
* fix(hooks): keep Codex hook stdout valid JSON (invalid user prompt submit JSON output)
Codex reads a hook's stdout as hook JSON when it starts with `{` or `[`.
hook-handler.cjs reports in lines like `[INFO] Routing task` and
`[OK] Edit recorded`, so under Codex every UserPromptSubmit failed with
"invalid user prompt submit JSON output", and PostToolUse/SubagentStop the
same way. #3163 fixed this for auto-memory's Stop hook only.
Under a Codex payload (it carries turn_id, as in #3163) the handler now
collects what it logs and writes it once at exit: as
hookSpecificOutput.additionalContext for UserPromptSubmit and SessionStart,
so the routing report still reaches the model, and on stderr for every other
event, leaving stdout empty. Claude Code payloads are unchanged. pre-bash
keeps its own blocking protocol. Same change in the generated fallback.
Co-Authored-By: RuFlo <ruv@ruv.net>
* chore(helpers): re-sign the helper manifest for the Codex stdout change
Co-Authored-By: RuFlo <ruv@ruv.net>
---------
Co-authored-by: r <r@x>
* feat(console): native vector pictures on surfaces that draw Svg (ADR-546, 0.51.0)
On Claude Code Desktop, the editor and the mobile app, the swarm graph, cost
gauge, activity/burn sparklines and the BBS neon titles are drawn as native,
interactive SVG (isInteractive) instead of the terminal's cells written as SVG:
pulsing busy nodes, traffic along edges, a sweeping gauge with ladder ticks,
draw-in sparklines, hover tooltips on every node/sample/tick. Motion is CSS only
(none at fps 0 or under reduced motion). Settings -> UI -> Desktop pictures
(rich|cells, saved). The terminal is unchanged.
Security: data only through escapeXml or finite numbers, colours only as
validated hex attributes, constant stylesheet, no script/link/image/
foreignObject/external url(), capped at 131072 chars with a cell fallback.
Tests: tests/vector-pictures.spec.ts (pure, hostile inputs, size cap, motion
gating, determinism, build cost), tests/desktop-rich.test.ts (kit e2e on the
desktop and terminal surfaces in all three looks, setting persistence).
Co-Authored-By: RuFlo <ruv@ruv.net>
* fix(console): gate desktop vectors on host version, fit to pane, loop-only motion (ADR-546)
- Draw the vector pictures only on hosts that take Text `weight` (2.1.299+), past
the 2.1.289 types that declare Svg `height`/`isInteractive`; an older engine
refuses a tree with an unknown prop, so it keeps the cell pictures.
- Never draw a vector wider than the cell picture it replaces (the BBS title is
fitted beside the nav icons); the viewBox scales it down.
- Drop the draw-in/fade/sweep entrance animations: a sparkline or gauge whose
data ticks is a new document each time, so they replayed on every tick. Only
looping motion remains (pulse, edge traffic, flicker).
- Tests: a 2.1.289 host gets cells; the BBS title fits at 110 and 64 columns.
Co-Authored-By: RuFlo <ruv@ruv.net>
---------
Co-authored-by: r <r@x>
Below ~90 columns the auto nav style fell back to three-letter codes
(Msn, Ovr, Wfl) and below ~70 to bare icons, so the nav was hard to read
at the widths a dock usually has. auto now always uses the full form; a
group row that does not fit wraps, shared evenly over its lines. brief
and icons remain selectable in Settings. Console 0.50.3.
Co-authored-by: r <r@x>
getInstalledVersion() resolved <pkg>/package.json with paths: [process.cwd()]
and loaded it with require(). A package's exports map can point
./package.json at a .js file, so a node_modules/@claude-flow/security (or
embeddings, integration, testing) committed to a cloned repository ran inside
the CLI on the startup update check of almost any command.
Resolve from the CLI's own install only and read the file with JSON.parse,
so nothing is executed. Adds update-checker-cwd-hijack.test.ts (fails on
3.80.0, passes here); the 4755 opt-in test now also mocks the file read.
Release 3.80.1 (helpers manifest re-signed).
Co-authored-by: r <r@x>
* fix(x-gateway): single-use invites, invite revocation, ordered sync cursor (#5029, #5030)
#5029
- mintInvite and federation_invite_mint default to max_uses 1 (was 25);
maxUses/ttlSecs must be positive integers.
- New legacy-only, admin-only federation_invite_revoke: revokes by code or id
via buzz-relay POST /api/invites/revoke (block/buzz#9680). Admission is
decided by the relay, so revocation lives there; a relay build without the
route answers 404 and the tool reports "unsupported". Withheld from the
directory profiles because it accepts an invite code.
- CLI: x_federation_invite_revoke passthrough; mint/--uses text says default 1.
#5030
- federation_sync returns next_cursor and accepts since_cursor. The relay
exposes no receive-order sequence, so the cursor carries a window floor plus
48-bit prefixes of the ids already delivered inside it. Each call reads the
whole window (full NIP-01 pages are narrowed by `until` bisection, because
`limit` keeps the newest events) and delivers unseen events oldest first by
(created_at, id). Same-second events and late arrivals within 300 s are
delivered exactly once. A timed-out read hands the same cursor back.
- The cursor is decoded as hostile input: length cap, strict shape, lookback
clamped to 30 days, bound to the type filter.
- No-cursor calls keep the old window read and relay filter.
- CLI: since_cursor in the x_federation_sync schema; `federation sync --cursor`.
Gateway package 0.9.2 -> 0.10.0, plugin 0.10.6 -> 0.11.0.
Co-Authored-By: RuFlo <ruv@ruv.net>
* fix(x-gateway): judge sync completeness on the raw relay page; compact cursor
buzz-relay applies `limit` in SQL before it matches #t/#k in Rust
(handlers/req.rs filter_fully_pushable), so a short #t-filtered page does not
prove a window complete. Cursor reads now send only kinds/since/until/limit,
match the swarm tag and type locally, and judge completeness on the raw count.
A no-cursor read cannot prove completeness either, so its next_cursor keeps the
whole requested window and remembers what was returned.
The cursor encodes delivered ids as delta-coded seconds, so the largest cursor
the gateway can emit (2000 ids in distinct seconds) fits the schema cap, and
any type string the tool accepts round-trips. Tests: the fake relay applies
limit before tag matching and carries non-swarm traffic; a property test pins
the cursor size bound.
Co-Authored-By: RuFlo <ruv@ruv.net>
* test(ci): list the new x-gateway node:test files in the root ratchet baseline
invite-admin and sync-cursor import nostr-tools, which only the plugin's own
`npm test` installs (157/157 pass there), like the other x-gateway suites.
Co-Authored-By: RuFlo <ruv@ruv.net>
---------
Co-authored-by: r <r@x>
On Darwin, os.freemem() counts only free and speculative pages. The kernel
keeps reclaimable file cache on the inactive queue, so an idle Mac reads as a
few percent "free" and the worker daemon defers almost every worker.
The memory gate now measures available memory on Darwin from vm_stat as
(free + speculative + inactive) x page size, clamped to totalmem, with the
page size read from vm_stat's own header (16 KiB on Apple Silicon). Purgeable
pages are not added because they already sit on other queues. Linux and
Windows keep os.freemem() unchanged.
vm_stat runs without a shell, with a 1 s timeout; concurrent checks share one
probe and results are cached for 5 s. If the probe fails the gate falls back
to os.freemem() and logs that once per daemon. Threshold defaults are not
changed.
Refs #2935
Co-authored-by: Lenin Mookiah <2639584+leninworld@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The sql.js fallbacks behind memory_search and memory_search_unified took
memory.db.lock and could migrate the schema on every call (via
ensureSchemaColumns), opened and wrote hnsw.index, and wrote
rabitq.meta.json when a search built the RaBitQ pre-filter.
- readOnlySchemaError(): probes PRAGMA table_info on the loaded image, no lock;
a store that needs migrating is refused with an error naming the fix.
- searchEntries: uses the probe, searches an HNSW index only if this process
already opened one, and builds RaBitQ in memory without its meta file.
- listEntries({ readOnly: true }): no lock, no migration, no native-handle
release; memory_search_unified passes it. Other listEntries callers keep
the migrating path.
Co-authored-by: r <r@x>
* fix(learning-loop): help/list runs are not verifiers; never store part of a secret
An edit followed by a test command that only printed help or listed tests
(`npm test --help`, `npx vitest list`, `npx jest --listTests`,
`pytest --collect-only`, `cargo test --no-run`, `go test -list .`) was
recorded as verified-success: classify() matched the command head and
ignored the rest, and those commands exit 0 without running a check.
- classify(): a verifier segment whose bash words ask for help, version,
a listing, a config dump, a dry run or a compile-only build is not a
verifier; `vitest list` / `cargo nextest list` likewise. Words are split
as bash does, so a quoted argument that contains `--help` (a test-name
pattern) still verifies. A command with a shell comment is refused:
`npm run build # && npm test` ran only the build.
- Verifier evidence is screened for secret shapes; a command carrying one
keeps its kind and outcome and is stored as `[redacted]`. Evidence reaches
SONA feedback, the ledger and learned lessons.
- taskText() screened only the first 300 characters, after the cut, so a
key the cut split was stored in part (`ghp_ABCDEFGHIJKLMNO`). It now
screens the kept text plus 1 KiB, cuts at a word boundary so a long key
(JWT) is dropped whole, and reads at most 64 KiB of the prompt
(32M-character prompt: ~6 ms, against ~1.4 s unbounded).
Regenerated both learning-loop.cjs copies. helpers.manifest.json needs a
maintainer re-sign for the new bytes.
Co-Authored-By: Ruflo & AQE
Claude-Session: https://claude.ai/code/session_01GLQCdgnsuwts6j51rwcqgB
* fix(learning-loop): per-runner no-run flags, raw screening, SONA skips [redacted] (0.17.5)
Third adversarial review of #5068:
- More commands that exit 0 without a check are not verifiers: tsc -v,
--listFilesOnly, -b --dry, --init; eslint -v, --env-info; vitest/jest
-v; make -n/-q (and clusters); go test -c/-n; dotnet test -t; pytest
--fixtures/--markers/--setup-plan; npm/pnpm/yarn/bun --if-present.
Flags are read for the program actually run (past npx, pnpm exec,
python -m, uv/poetry run), so `pytest -v` stays a run and
`jest --testNamePattern vitest list` is not taken for `vitest list`.
- Bash removes a backslash-newline outright; classify() now joins without
a space (`--ver\<newline>sion` is --version). An escaped space no longer
starts a word, so `a\ #b` is not a comment.
- shellWords()/hasComment() move to hooks/loop/words.ts; narrows() uses
them, so a partly quoted --passWithNoTests still taints (ADR-503).
- Evidence and task text are screened as given as well as normalised: a
line separator or control character inside a key hid it from the
folded screen. A kept key-block header ("-----BEGIN") is refused.
- Ingest counts a task stored as [redacted] and never trains SONA with
it (it learned `coder:redacted`).
- ruflo-mods 0.17.5 with a CHANGELOG entry (version-bump check).
Every guard is covered: reverting any one of the 12 fails a test.
Co-Authored-By: Ruflo & AQE
Claude-Session: https://claude.ai/code/session_01GLQCdgnsuwts6j51rwcqgB
* chore(helpers): re-sign helpers.manifest.json for the rebuilt learning-loop.cjs (#5067)
Rebuilt learning-loop.cjs from source with build-learning-loop-helper.mjs;
the bytes match the committed bundle (sha256 0a39ee1d50d3349d...).
Co-Authored-By: RuFlo <ruv@ruv.net>
---------
Co-authored-by: r <r@x>
Co-authored-by: RuFlo <ruv@ruv.net>