dshbase

Plugin directory / Developer / dsh-rigorquant

dsh-rigorquant

Verified · install-tested on dsh linxichen

✓ Actively maintained Builds on 1 official DSH packages

View on GitHub ↗ ← Back to plugin directory

3Stars
0Forks
0Open issues
Language
2026-08-23Last push
Cross-platformPlatform

What it does

Adds capability to Deepseek harness to do rigorous quant finance work

Our take
Works — verified, early-stage project

Adds capability to Deepseek harness to do rigorous quant finance work It installs cleanly and boots without issues in our testing. It's early-stage but functional.

“Verified” means our automated CI actually ran dsh plugin add in a clean profile and it booted — nothing more. Feature descriptions and version compatibility are the author’s claims. This is not a security audit and not an endorsement of third-party code.

README

dsh-rigorquant

English | 简体中文

Edgeworth box with contract curve and Pareto optimum

Edgeworth box — hand-drawn in TikZ, no AI-generated imagery

Unattended-within-a-session, long-running empirical/computational mathematics
research
for DeepSeek Harness
— economics, finance, portfolio construction/optimization, simulation,
computational econ/finance.

RigorQuant is an agent preset + bundled skills that turns one DSH session into a
context-isolated multi-agent research lab:

  • J-Space is used integrally across the root persona, every subagent role,
    and plan mode as the inference-time cognitive-control layer (workspace gate,
    ledger, seam refresh, dense inner / clean outer registers).
  • Parallel explorers propose candidate methods (subagent, blank context).
  • A ground-truth track re-derives the analytic closed forms, invariants, and
    bounds for simplified cases — twice, by different means (two independent
    subagent_ground_truth calls).
  • An adversary eliminates routes by counterexample only.
  • A four-part check battery (closed-form equality, exact invariants,
    analytic bounds, statistical hardening) runs BEFORE numerical implementation.
  • A meta-validator (rq_check.py) refuses a PASS whose evidence is missing:
    empty stage outputs, an empty derivations/, a registry with no
    audit-referenced passed route, or deliverables that do not compile. Its
    evidence checks read the audit record, not study.json — a study may not
    vouch for itself.
  • Fixed-seed + LLN conventions for stochastic work.
  • A jacobian MCP escalation lane (opt-in; Lean as a manual external lane)
    settles proof-critical claims before implementation.
  • PASS → auto-implement and proceed; BLOCKED → 3 rounds of the same gap →
    strongest derivation + exact gap; BUDGET → 5 rounds → checkpoint + report.

The operating pattern adapts Shanmu Jin's Crouzeix-conjecture run
(prompt,
Lean audit)
and Terence Tao's blueprint/equational-theories projects to numerical work.
Full design record: docs/architecture.md.

"Unattended", precisely: the framework runs unattended within one live
session. Crossing a session boundary disarms the goal; one human turn
("continue") re-arms it. It does not continue autonomously across restarts.

The research team — and how it works

Six roles, each a separate tool with its own powers and limits. The separation is
enforced by the composition, so the producer never checks its own work — an idea
dies only on a concrete counterexample, never on style or vibes.

Orchestrator

Orchestrator · root persona — fans out the work, synthesizes, and writes the state. Bound by four rules: producer ≠ checker, counterexample-only elimination, seeds always recorded, no handwaved load-bearing claims.


Explorer

Explorer · subagent — blank-context and divergent. Proposes lemmas, equations, constructions, and candidate methods with exact statements. Status reports are rejected.


Oracle

Oracle · subagent_ground_truth — blind (no web, no skills, no delegation, no drafts). Re-derives the load-bearing claims from first principles, twice by different means.


Adversary

Adversary · subagent_adversary — runs the check group and hunts counterexamples. Ends in a verdict: PASS or NEEDS-EDITS.


Literature

Literature · subagent_lit_line · _adversary — a walled citation-graph sweep, then an independent adversary re-retrieves each claim and certifies it's real and current.


Validator

Validator · rq_check.py + schemas — refuses a PASS with missing evidence. Reads the audit record, never the study's own claims — a study cannot vouch for itself.


The loop, in five moves. Each round is fan-out → ground truth → adversary → synthesize.

  1. Promise — record the original question verbatim, split it into sub-problems with crisp criteria, pick hand-checkable simplified cases, and pin seeds, tolerances and the schema/validator digests.
  2. Fan out — blank-context explorers and literature lines run in parallel; most are never told the favored approach.
  3. Ground-truth it — blind oracles re-derive the load-bearing claims without seeing anyone's draft; two independent derivations for anything the study rests on.
  4. Attack it — the adversary runs the four-gate battery, then hunts counterexamples; divergent tracks are lined up as an adjudication docket.
  5. Certify & ship — the validator checks nothing is missing; the paper and slides are assembled from validated records, never written fresh.

The check battery, run before any numerical implementation: A closed-form equality · B exact invariants · C analytic bounds · D statistical hardening (fixed seed + LLN shrinking ≈ C/√N).

With receipts: in one hard run, 21 errors were caught by a specific mechanism and none by luck (11 of them the orchestrator's own); only 35% of 81 literature claims survived independent verification; and the honesty gate is itself tested — a forged study must fail.

Install

Requires DSH ≥ 0.1.0-rc.7.

One line, everything — the preset, the compute lane, and the plugin (role
model router + its Settings card):

npx dsh-rigorquant
# npx dsh-rigorquant --profile tui     # a profile other than web

From a clone — the same install, from your own working tree. A checkout
installs itself into the profile, so re-run this after editing dsh/ to
refresh the plugin:

git clone https://github.com/linxichen/dsh-rigorquant
cd dsh-rigorquant
./install.sh
# ./install.sh --skill-only     # only the skills, for any preset, no plugin
# ./install.sh --uninstall      # removes everything, plugin included

Plugin only — the same everything, via the ecosystem's bundle path. The
package declares a dsh.bundle manifest whose rows include a boot-sync half
(rq-preset-sync): on the profile's next start it lands the agent preset into
$DSH_HOME/.agent-presets/rigorquant and the compute lane into
$DSH_HOME/share/rigorquant/, so dsh plugin add alone yields a working
distribution (docs/architecture.md Decision 23):

dsh plugin --profile web add dsh-rigorquant

The sync is idempotent (a byte-identical tree is left untouched; derived state
like .venv is never copied or pruned) and keeps same-version local edits to
the installed preset — an upgrade replaces shipped files, exactly like
re-running ./install.sh. There is no uninstall hook in DSH's plugin CLI, so
removal stays explicit (./install.sh --uninstall); if you remove only the
plugin, the synced preset keeps working standalone and simply routes nothing.

Start a new DSH session and pick the RigorQuant preset. Then:

rigorquant: derive and validate a method for [problem], simplified cases
first, before any numerical implementation.

Compute lane (one-time)

The pinned uv lane lives at $DSH_HOME/share/rigorquant/env, placed there by
install.sh or by the plugin's boot-sync row — whichever ran last owns the
anchor, and both land identical bytes (see env/README.md).
The venv itself is never installed: it is derived state, provisioned
lazily inside the anchor by the first uv run --frozen --project <env_lane>
(subsequent runs are instant; --frozen honors the committed lockfile). The
jacobian escalation lane ships disabled and pinned ([email protected]):
enable the mcp-jacobian row, and the framework asks for approval before any
one-time provisioning (npx -y [email protected] upgrade, or the Lean toolchain
via the skill's scripts/provision-lean.sh). See mcp/jacobian.md.

Role-routed models (rq-model-router)

The bundled plugin routes each RigorQuant role to its own model + reasoning
effort, with one fallback per role. Configure it in Settings → Plugins →
RigorQuant model routing
: the last saved selection persists (settings user
layer). Shipped defaults:

Role Primary Fallback
Ground-truth oracle deepseek-v4-pro @ high deepseek-v4-flash @ low
Adversary deepseek-v4-pro @ high deepseek-v4-flash @ low
Root, explorers, literature roles inherit (root follows the chatbox picker)

On a terminal primary failure (no adapter / HTTP 4xx) the role degrades to its
fallback for one forced retry, and recovers on the next success or after 10
minutes. Untagged agents (other presets, workflow workers, forks) are never
touched. Requires DSH ≥ 0.1.0-rc.7 (self-registered plugin settings). Design
record: docs/architecture.md Decision 16.

Repository layout

package.json                dsh.bundle manifest (dsh plugin add support)
cordis.patch.yml            bundle patch: skills layer + rq-model-router +
                            rq-preset-sync rows
dsh/                        host halves (rq-model-router router + rq-preset-sync
                            boot-sync) and the Plugins-tab card
agent-presets/rigorquant/   preset composition + persona + bundled skills
  skills/rigorquant/        SKILL.md + references/ + scripts/ + schemas/
  .../scripts/rq_check.py   the meta-validator (single canonical copy)
  .../schemas/              study.json + registry.json JSON Schemas, which the
                            validator loads — so schema and checker cannot drift
env/                        pinned uv compute lane (sympy/cvxpy/hypothesis/…)
mcp/jacobian.md             escalation lane wiring
docs/architecture.md        grilled decision record + sources
tests/                      the validator's test suite (see Testing below)
studies/                    one study folder per task (Mode B; a checkout's own
                            live studies — not shipped in the npm bundle)

Testing

The validator has a test suite, and its centrepiece is a forged study — empty
derivations, empty stage outputs, a one-line adversary report, and a paper whose
body reads "This paper says nothing." It must FAIL. A framework whose honesty
gate is not itself tested is a framework that certifies whatever it is handed.

uv sync --frozen --project env
uv run --frozen --project env python -m pytest tests/ -q

tests/test_repo_consistency.py covers the other half: one validator, one
schema, documented commands that resolve, and layout blocks that match the
filesystem. That is the defect class this repository actually produces.

What a green validator means: nothing declared is missing, and the
deliverables build. It does not mean the mathematics is right — that stays with
the check battery, the independent ground-truth track, and the adversary.

Studies

A study is one self-contained rigorquant task with an identical folder
structure everywhere: durable deliverables at the study root (study.json,
STUDY.md, registry.json, journal.md, derivations/, audits/,
artifacts/) are meant to be committed; all scratch lives in a gitignored
interim/. Two modes, implied by location:

  • One study per repostudy.json at the repo root.
  • Multiple studies per repostudies/<slug>/study.json; the roster is
    studies/*/study.json.

Intake detects an existing study and continues it silently; a new study asks
one question (mode + slug) and never asks again. See
docs/architecture.md §12.

Publishing

This repo is a community DSH plugin distribution (bundle + preset + skill
form): it declares a dsh.bundle manifest in package.json, is tagged
dsh-plugin, and is discoverable by
the ecosystem's topic-based indexes — see
dsh-find-plugins and the
awesome-deepseek-harness
list for the conventions.

MIT License.

Install

🧩 Let your agent install it (recommended)

Install the catalog once, then DeepSeek Harness can find and install any plugin from this site automatically:

dsh plugin add dshbase-catalog

Then say "install dsh-rigorquant for me" — your agent finds it in the directory and installs it. Docs: dshbase-catalog · verified packs.

This plugin is GitHub source (not published to npm) — install it straight from the repo:

Web profile:

dsh plugin --profile web add github:linxichen/dsh-rigorquant

Headless (CLI) profile:

dsh plugin --profile headless add github:linxichen/dsh-rigorquant

Test report

Verified: L1 install + L2 load + L3 runtime from GitHub source on dsh 0.1.0-rc.6.

Security: not yet scanned — our daily static scan will cover it shortly.

Share this badge

More in Developer

Browse all 7789 plugins →