Agent skill · Audited from source
Trader Portfolio Cg
skill · ruvnet/rufloMIT licenceAudited 26 Sep 2026 · source ef7d4f0535e5
Is it safe? With care — CAUTION, grade B (89/100). We read this skill's source at commit ef7d4f0535e5 and found no filesystem, network or shell access and no hard-coded secrets. The audit raised 4 findings, 0 critical or high. What it does: Mean-variance portfolio optimization via Conjugate Gradient — 40-60× faster than the legacy Neumann path (ADR-126 Phase 3, ADR-123 Wedge 8)
Cite
Cite this page
ModelsAtlas. “Trader Portfolio Cg (ruvnet/ruflo)”. Retrieved 26 Sep 2026. https://modelsatlas.com/skills/ruvnet/trader-portfolio-cg
Trust audit
Audit 0.4.1 · source read 26 Sep 2026
CAUTION means the audit found things worth knowing before you trust this skill. Grade B is shared by 17,406 of 18,389 audited skills.
What the source does
- FilesystemNone observedNo reads or writes in the source
- NetworkNone observedNo outbound calls in the source
- ShellNone observedNo commands run in the source
- DependenciesPinnedNothing floats
- SecretsNone foundNo keys in source
Five audit layers
| Layer | What we check | Result | Findings |
|---|---|---|---|
L0 Provenance | Repo owner, licence, archive status, activity | WARN | 4 |
L1 Static source | Secrets, path traversal, supply chain, hidden code | NA | 0 |
L2 Instructions | Prompt injection, authority framing, hidden directives | PASS | 0 |
L3 Inventory | The files and declarations match the source | PASS | 0 |
L4 Sandbox | Run in isolation and watch behaviour | SKIPPED why | 0 |
Gates applied: no behavioural pass.
Findings (4)
MEDIUMInventory / provenanceinv.symlink · crates
crates
- Why
- link not followed
- Fix
- —
MEDIUMInventory / provenanceinv.symlink · plugin/agents
plugin/agents
- Why
- link not followed
- Fix
- —
MEDIUMInventory / provenanceinv.symlink · plugin/commands
plugin/commands
- Why
- link not followed
- Fix
- —
MEDIUMInventory / provenanceinv.symlink · plugin/skills
plugin/skills
- Why
- link not followed
- Fix
- —
Audit 0.4.1 · source sha ef7d4f0535e5 · 26 Sep 2026Report an issue or request a re-scan
Provenance
Who published it, and what the verdict is pinned to
- Publisherruvnet GitHub userOwner of the repository this skill is read from
- Source folderruvnet/ruflo/plugins/ruflo-neural-trader/skills/trader-portfolio-cgThe exact folder we audited
- LicenceMITAs the repository states it
- Commit pinned for this verdictef7d4f0535e5A new audit runs when the source changes
- Repository statusNot archivedLast push 1 day ago
- Sandboxed runNot runSkills are read, not executed; layer L4 is skipped
What it tells the agent
Full source on GitHub ↗Its description: Mean-variance portfolio optimization via Conjugate Gradient — 40-60× faster than the legacy Neumann path (ADR-126 Phase 3, ADR-123 Wedge 8)
---
name: trader-portfolio-cg
description: Mean-variance portfolio optimization via Conjugate Gradient — 40-60× faster than the legacy Neumann path (ADR-126 Phase 3, ADR-123 Wedge 8)
allowed-tools: Bash Read mcp__ruflo-sublinear__solve mcp__plugin_ruflo-core_ruflo__memory_store mcp__plugin_ruflo-core_ruflo__memory_retrieve mcp__plugin_ruflo-core_ruflo__memory_search mcp__plugin_ruflo-core_ruflo__agentdb_pattern-search
argument-hint: "[--portfolio-id ID] [--tolerance 1e-6]"
---
Solve the mean-variance optimization `Σ · x = μ` via Conjugate Gradient instead of the legacy Neumann series.
**Why CG instead of Neumann (ADR-123 Wedge 8):**
- Neumann series: ~50 μs at n=256 (legacy `npx neural-trader --portfolio optimize`)
- Conjugate Gradient: ~816 ns at n=256 (this skill)
- Measured speedup: 40-60×; parity within 1e-4 on a fixed seed.
The covariance matrix Σ is symmetric positive-definite by construction (it's a Gram matrix on real returns), so CG is provably optimal — it converges in at most n iterations with no preconditioning, and typically far fewer when eigenvalues cluster.
**Disable flag**: set `RUFLO_NEURAL_TRADER_DISABLE_CG=1` to skip the CG path entirely and fall through to step 4's legacy Neumann route. Useful for A/B validation or when an upstream covariance regression breaks SPD.
**Native dispatch flag**: set `RUFLO_SUBLINEAR_NATIVE=1` to force the adapter to attempt the native `mcp__ruflo-sublinear__solve` path even when `globalThis` doesn't expose the tool (e.g. when the harness mounts it via a different transport). On any native-dispatch failure the adapter cleanly falls back to the local JS CG and records `method: 'cg-local'` in the artifact metadata — so the regression is auditable.
Steps:
1. **Ensure neural-trader is available**:
```bash
npm ls neural-trader 2>/dev/null || npm install --ignore-scripts neural-trader
```
2. **Read the current covariance matrix Σ and expected-return vector μ** from neural-trader's portfolio API:
```bash
# Primary path (preferred — clean JSON):
npx neural-trader --portfolio current --json
# Fallback paths if the --json flag is unavailable on the installed version:
npx neural-trader --portfolio current # parse the text output
# OR pull from AgentDB if a prior run stored the matrix there:
```
```text
mcp__plugin_ruflo-core_ruflo__memory_search({ query: "covariance matrix current", namespace: "trading-risk", limit: 1 })
```
The skill expects the response to include `covariance: number[][]` (n × n) and `expectedReturns: number[]` (length n).
3. **Solve Σ · x = μ via the SublinearAdapter** (preferred path) when `RUFLO_NEURAL_TRADER_DISABLE_CG` is unset:
```js
import { sublinearAdapter } from '../../src/sublinear-adapter.mjs';
const result = await sublinearAdapter.solveCG(COVARIANCE, EXPECTED_RETURNS, {
tolerance: 1e-6,
maxIterations: 200,
});
// result.solution — optimal weights (number[])
// result.iterations — CG iterations executed
// result.residual — final ||A·x − b||2
// result.latencyMs — wall-clock latency
// result.method — 'cg-sublinear-native' | 'cg-local' <-- READ THIS
// result.solver — '[email protected]' | 'local-js-cg'
// result.degraded — true if input failed SPD checks (fall back to step 4)
```
The adapter does the dispatch itself: it probes for `mcp__ruflo-sublinear__solve` on `globalThis` (and honours `RUFLO_SUBLINEAR_NATIVE=1` as a manual override), routes through the native kernel when reachable, and falls back transparently to the embedded ~50-LOC JS CG when not. The math is identical either way — CG, dense form, n × n SPD covariance. The operator reads `result.method` to know which backend produced the artifact.
The native MCP tool's wire shape (for direct callers who want to bypass the adapter):
```text
mcp__ruflo-sublinear__solve({
matrix: COVARIANCE,
rhs: EXPECTED_RETURNS,
algorithm: "cg",
tolerance: 1e-6,
maxIterations: 200
})
```
Output:
```ts
{ solution: number[], iterations: number, residual: number }
```
4. **Fallback (legacy Neumann)** — if step 3 reports `degraded: true` (non-SPD input, non-square matrix, MCP error) OR if `RUFLO_NEURAL_TRADER_DISABLE_CG=1`:
```bash
npx neural-trader --portfolio optimize
```
Capture the weights output and tag the artifact metadata with `method: 'neumann-fallback'` and a `reason` field.
5. **Store the optimal weights** to `trading-risk` namespace with full provenance metadata. **Take `method` and `solver` straight from the adapter's result so the operator can verify which backend ran**:
```text
mcp__plugin_ruflo-core_ruflo__memory_store({
key: "portfolio-weights-PORTFOLIO_ID-TIMESTAMP",
namespace: "trading-risk",
value: JSON.stringify({
weights: result.solution, // number[] from step 3 (or weights from step 4 fallback)
method: result.method, // 'cg-sublinear-native' | 'cg-local' | 'neumann-fallback'
solver: result.solver, // '[email protected]' | 'local-js-cg' | 'neural-trader-cli'
iterations: result.iterations,
residual: result.residual,
latencyMs: result.latencyMs,
capturedAt: NEW_DATE_ISO,
reason: FALLBACK_REASON || null
})
})
```
The `trading-risk` namespace is canonical (ADR-126 Phase 1; the five-namespace alignment). Long-lived — no TTL — because portfolio weights are the audit trail Phase 4 will Ed25519-sign.
6. **Cross-check against historical patterns** (optional but recommended):
```text
mcp__plugin_ruflo-core_ruflo__agentdb_pattern-search({
query: "portfolio weights Sharpe regime:CURRENT_REGIME",
namespace: "trading-risk"
})
```
If the new weights differ by more than 30% in any single asset from the historical median, flag for human review before applying. This is a guard-rail, not a hard block.
**Acceptance criteria Excerpt, first 6,000 characters of SKILL.md, verbatim from the audited commit. It is text from someone else’s repository, quoted so you can judge it before your agent reads it.
Install
Pinned to the audited commit ef7d4f0
git clone https://github.com/ruvnet/ruflo git -C ruflo checkout ef7d4f0535e5
The author documents no install command, so this uses the repository directly. Our verdict covers commit ef7d4f0535e5 only.
Works in
The author has not said which agents this skill supports, and we have not tested it in any.
Audit history
Every audit, every source change
- !CAUTION B 89 / 100
first audit · source
ef7d4f0535e5
README badge
For maintainers · shows the latest audit
[](https://modelsatlas.com/skills/ruvnet/trader-portfolio-cg/)
The badge shows our verdict and grade for this skill, and links back to this page. It changes when the audit does.
Similar skills
ruvnet/claude-flow
Quantum-resistant, self-learning version control for AI agents with ReasoningBank intelligence and multi-agent coordination
ruvnet/claude-flow
Train and deploy neural networks in distributed E2B sandboxes with Flow Nexus
ruvnet/claude-flow
Cloud-based AI swarm deployment and event-driven workflow automation with Flow Nexus platform
ruvnet/claude-flow
Comprehensive GitHub release orchestration with AI swarm coordination for automated versioning, testing, deployment, and rollback management
ruvnet/claude-flow
Advanced GitHub Actions workflow automation with AI swarm coordination, intelligent CI/CD pipelines, and comprehensive repository management
ruvnet/claude-flow
Advanced Hive Mind collective intelligence system for queen-led multi-agent coordination with consensus mechanisms and persistent memory
Add this badge to your README
[](https://modelsatlas.com/skills/ruvnet/trader-portfolio-cg/)
<a href="https://modelsatlas.com/skills/ruvnet/trader-portfolio-cg/"><img src="https://modelsatlas.com/skills/ruvnet/trader-portfolio-cg/badge.svg" alt="ModelsAtlas: CAUTION B"></a>
Questions about Trader Portfolio Cg
What does the Trader Portfolio Cg skill do?
Is Trader Portfolio Cg safe to install?
What can Trader Portfolio Cg access on my machine?
How current is this page?
Sources
- github.com/ruvnet/ruflo/tree/main/plugins/ruflo-neural-trader/sk — the audited source at commit ef7d4f0535e5 and every finding aboveObserved · 26 Sep 2026
Spotted something wrong? Report a correction · Methodology
Keep going in your AI
Opens with this page as the source. We add nothing else to the prompt.
- What does the Trader Portfolio Cg skill do?
- Is Trader Portfolio Cg safe to install?
- What can Trader Portfolio Cg access on my machine?