rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:linxichen/dsh-rigorquant
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
English | 简体中文
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:
explorer-<n>, blank
context).offgrid-<n>) works off the grid when a route
must be isolated: raw model intelligence plus compute tools (sympy, numpy,
mpmath, Lean checkers) — no web, no literature, no other agents' results.doublechecker-<n> teammates).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.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.
Eight roles around one hub, each a teammate the orchestrator creates with its own persona and tool budget. The orchestrator is the only role that sees every report — a teammate cannot message another teammate, list the roster, or read the whole board — so the separation is enforced rather than agreed, and the producer never checks its own work: an idea dies only on a concrete counterexample, never on style or vibes.
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-<n> — blank-context and divergent. Proposes lemmas, equations, constructions, and candidate methods with exact statements. Status reports are rejected.
OffGridThinker · offgrid-<n> — the off-grid lane. Raw model intelligence plus the pinned compute lane (sympy, numpy, mpmath, cvxpy, hypothesis, jax; Lean checkers when provisioned) — and nothing else: no web, no skills, no delegation, no other agents' results. Its own agent, not an Explorer variant: isolation is the identity.
DoubleChecker · doublechecker-<n> — blind (no web, no skills, no delegation, no drafts). Re-derives the load-bearing claims from first principles, twice by different means.
Adversary · adversary-<n> — runs the check group and hunts counterexamples. Ends in a verdict: PASS or NEEDS-EDITS.
Literature · lit-line-<n> · lit-adversary-<n> — a walled citation-graph sweep, then an independent adversary re-retrieves each claim and certifies it's real and current.
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.
Document adversary · doc-adversary-<n> — an independent agent that audits each finished deliverable for self-completeness (the thing 90% of AI-generated writing drops): every jargon term, symbol, and abbreviation the document uses must be defined in the artifact itself or the audience spec's symbol registry. Returns VERDICT: PASS / VERDICT: NEEDS-EDITS; a NEEDS-EDITS is a blocking gap the validator refuses a PASS without.
A study runs on the harness's own Agent Teams surface, so there is no custom
panel to learn: while a RigorQuant session runs, the session header's team
action opens the roster (name, role, status) and the round's task board
with its blocking edges — the two things to watch. The roster's model column
shows the member's model selection, not the model rq-model-router routes
its requests to (Decision 16), so read a role's route off the Plugins →
dsh-rigorquant card, never off the roster. Each teammate is a row there:
open one and its own conversation opens, so you can read a derivation or
an audit while it runs (steering it is the ordinary conversation, and it
breaks that teammate's blank context — documented, not prevented).
The topology is hub-and-spoke, and the guards enforce it rather than asking: a teammate's message reaches the orchestrator or nowhere, a teammate cannot list the roster or the whole board, it cannot change its working directory (the brief names the one it writes in), and it may read or update only a task no other teammate owns (the one its brief names, which it claims).
The orchestrator creates each teammate with the standard subagent tool and an
explicit <role>-<n> name — the name is the Role: it fixes the persona, the
tool budget and the model tier, and the guard refuses a spawn whose name does
not parse as <role>-<n> and refuses subagent_fork outright. It messages a
teammate with send_message({agent, message}), reads the roster from
list_agents rows of {name, status, description} (where inactive does not
mean done) and reads task ownership from the board's owner name.
Attribution. The hero banner (
docs/figs/agent-team-hero.svg) is reworked from the hero graphic of dsh-agent-teams by NanmiCoder (程序员阿江 / Relakkes) — Copyright (c) 2026, MIT License. The role portraits are this repo's owndocs/figs/assets.
The loop, in five moves. Each round is fan-out → ground truth → adversary → synthesize.
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.
Requires DSH >=0.2.2-rc.3 — an open floor (Decision 28,
docs/adr/0005-rigorquant-on-dsh-0.2.2.md). The floor is the core this
release was validated on; every core at or above it is admitted, and the floor
moves only when a release is validated on a newer one. 0.8.0 is the last
release for the 0.2.1-rc.2 harness: nothing is backported, so stay on 0.8.0
if you cannot move the harness yet. (0.7.0 was the last release for
0.2.0-rc.2, and 0.6.1 for 0.1.7-rc.2, for the same reason.)
The floor is not a formality, and it is not a ceiling either. 0.8.0 declared
>=0.2.1-rc.2 <0.2.2-0, whose -0 sentinel excluded every 0.2.2 prerelease:
DSH's compatibility gate read that as "incompatible" on 0.2.2-rc.3 and refused
to mount the bundle until an operator granted an exact-version exemption and
accepted a warning about crashes and data loss. A ceiling cannot tell a core
that will break the plugin from a core that did not exist when the release was
cut, so it announced the same warning at every future core. This release keeps
one bound — the floor — and retires the ceiling by policy.
Agent Teams is no longer a card you switch on. DSH 0.2.2 mounts the team service from its base bundle, and the plugin arms Team for a RigorQuant Session when that Session starts — your other presets are untouched. This release adds, pins, enables and configures no Team bundle, and it performs no profile migration (below).
Install. The plugin manager is the only mechanism (Decision 29):
dsh plugin add dsh-rigorquant
# or: dsh plugin --profile <name> add dsh-rigorquant # another profile
The same operation is on the Plugins page. The package declares its
bundle, the rigorquant preset and a boot-sync row, so that one command is
the whole distribution: at the profile's next start the sync lands the
compute lane (below). There is no separate installer, no second script and no
second distribution path.
Uninstall is the plugin manager's too:
dsh plugin remove dsh-rigorquant
Nothing runs afterwards: the plugin CLI has no uninstall hook. The shared
lane at $DSH_HOME/share/rigorquant remains — it is study evidence (a
study's study.json records that path), not plugin state — so removing the
plugin cannot break the record of a finished study.
Upgrading from 0.8.0 — or from any earlier release — is one cutover, done before the first 0.2.2-rc.3 boot. First finish or archive the RigorQuant studies in progress: resuming a session started on the previous core is not promised, because the subagent catalog now persists payload version 3 and releases before that change cannot open sessions that create subagents after upgrading. Then:
Stop dsh (every running process, the web app included).
Install the harness at the validated floor, naming the version or the tag:
npm i -g @deepseek-ai/dsh@0.2.2-rc.3
# or: npm i -g @deepseek-ai/dsh@next
Do not install unqualified: npm's latest dist-tag still points at
0.2.2-rc.1, below this release's floor, so an unqualified install lands
on a core the loader refuses the bundle on.
No migration runs for releases ≤0.8.0. Upgrade the plugin with the
plugin manager — dsh plugin remove dsh-rigorquant then
dsh plugin add dsh-rigorquant, or the Plugins page. A profile patch left
over from 0.8.0 — a marked block naming dsh-rigorquant in
$DSH_HOME/profiles/<profile>/cordis.patch.yml — is yours to clear:
delete the block between its BEGIN and END markers before the first
boot, because 0.2.2-rc.3's team service rejects the three agent-team
keys it contains. The core removes the retired Team bundle from the
profile itself. Routes you saved on a 0.8.0 profile stay in the profile
patch; a route saved on an older release is not ported — set it again on
the routing card.
Start the web app and pick RigorQuant in the new-session picker. If the picker is missing, switch Coding Tools back on in General Settings: it is the picker's only gate, on by default, and off only if you or Desktop onboarding switched it off.
There is no pre-flight version check anywhere in this distribution: the
loader's own compatibility gate reads engines.dsh, refuses a core below the
floor, and admits every core above it. The release states the core it was
exercised on (0.2.2-rc.3); nothing else does.
The bundle card itself carries native display metadata: locale/en.json and
locale/zh.json give the Plugins page and the Settings plugin inventory a
title and description, and icon.svg gives them artwork — read from the
manifest without activating the plugin.
The preset also pins five native limits (Decision 27,
docs/token-efficiency.md): skill-catalog descriptions at 160 characters,
read at 24 KiB and 1,200 lines, glob at 60 results and grep at 120
matches, the goal's blocked-round threshold at 3, and injected workspace
instructions at 8 KiB from AGENTS.md only. They are row configuration —
there is no custom code behind any of them — and each is bounded where it
enters the prompt rather than after the fact.
Capacity is a study's live-teammate pool of 12, pinned by the bundle
patch's subagent override (the base service's maxActiveSubagents), and
the pool bounds concurrency, never the study's lifetime count:
a settled teammate frees its slot for the next.
Over the pool a spawn raises ACTIVATION_LIMIT_REACHED, which nothing but a
teammate finishing clears — the round checkpoints and ends the turn as a
BUDGET outcome rather than retrying in a loop.
The package declares a dsh.bundle manifest that declares the rigorquant
preset itself, and one of its rows is a boot-sync half (rq-lane-sync): on
the profile's next start it lands the compute lane into
$DSH_HOME/share/rigorquant/, so dsh plugin add dsh-rigorquant alone yields
a working distribution (docs/architecture.md Decisions 22 and 25). The plugin
arms Team per Session itself, and it migrates nothing: an operator coming
from 0.8.0 or earlier upgrades by removing and adding the plugin, clearing a
leftover 0.8.0 profile block (above), and re-selecting any route an older
release kept in settings.yaml.
The sync is idempotent (a byte-identical tree is left untouched; derived state
like .venv is never copied or pruned). It also removes the directory preset
that releases before 0.6.0 copied under $DSH_HOME, but only when that copy's
.rq-sync.json says this package put it there. There is no uninstall hook in
DSH's plugin CLI and this distribution ships none: dsh plugin remove dsh-rigorquant is the whole uninstall, and the shared lane stays (it is
study evidence, not plugin state).
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.
Four harness facts a research deployment should decide on. None of them is RigorQuant's own machinery, and installing RigorQuant changes none of them:
The DeepSeek session log is on by default. The base bundle mounts
session-log-deepseek with enabled: true: each session's canonical event
log goes up as request metadata to the official DeepSeek API — no model-input
tokens, but the whole run leaves the machine. To turn it off, overlay the row
in the profile's user patch
($DSH_HOME/profiles/<profile>/cordis.patch.yml) and restart the profile —
changes land at the next start:
- id: session-log-deepseek
config:
enabled: false
The goal-round driver is the harness's, and it is already mounted. The
goal service and goal-round-driver are host-plane rows of the shipped base
bundle (@deepseek-ai/dsh-base); the preset re-mounts only the human
/goal command and the model-facing goal tool, which the web bundle
disables at the host plane. Nothing in this repo ships, mounts or arms the
round driver: "unattended" is a native contract, and crossing a session
boundary still disarms the goal until one human turn re-arms it (Decision
10).
The workspace-changes card is the human-visible witness of an edit. The
web bundle's workspace-changes row records each top-level turn's changed
files from git working-tree snapshots and renders the changed-files card
under that turn, so an edit that lands after a verdict is visible exactly
where and when it happened — what the frozen-write rule of Decision 19 needs
a human to be able to see. Certification itself reads the study record,
never the session (docs/architecture.md Decision 19).
Scheduled tasks are neither used nor guarded. DSH 0.2.0 keeps scheduled tasks in an opt-in experimental bundle, which a standard profile does not mount. RigorQuant does not use them, and its per-call guards do not cover them: a scheduled task you install and enable yourself runs outside the team's hub-and-spoke rules.
Each study carries its own pinned uv lane. The plugin's boot-sync row places
a template at $DSH_HOME/share/rigorquant/env (see
env/README.md). At intake
the orchestrator copies its pyproject.toml and uv.lock into the study's
env/, commits them with the record, and builds the venv once under the
study's gitignored interim/ (venv and uv cache both live there, which is
also the only place the workspace-write sandbox lets them go). A clone of
the study therefore rebuilds the exact environment even after a later
release replaces the template, and a study that needs another package adds
it to its own lane. The validator refuses a PASS without the study's
env/uv.lock. Budget about 1 GB per live study for the venv and cache,
deleted at close-out: the sandbox keeps studies from sharing a uv cache. The
jacobian escalation lane is pinned (jacobian@0.12.0) and is no preset
row: it mounts at runtime. When a claim needs it, the orchestrator calls
rq_escalate without asking, into itself or into a teammate it names, and
the jacobian tools appear from the next request until the session ends. The
framework still asks for approval before any one-time provisioning
(npx -y jacobian@0.12.0 upgrade, or the Lean toolchain via the skill's
scripts/provision-lean.sh). See mcp/jacobian.md.
The bundled plugin gives each RigorQuant role a model + reasoning-effort
policy, with one fallback per role. Role identity comes from the teammate's
subagent-tree name (<role>-<n>; the Lead is the orchestrator) — the router
carries the shipped tier matrix itself (DoubleChecker and adversary default to
deepseek-v4-pro @ high) and overlays a saved route on top.
Configure routes in Plugins → dsh-rigorquant (the bundle's own page,
under its description): only Save writes, a saved route is the router row's
own config in the profile's cordis.patch.yml and applies from the next
request, and leaving the page drops staged edits. Shipped defaults:
| Role | Primary | Fallback |
|---|---|---|
| DoubleChecker | deepseek-v4-pro @ high |
deepseek-flash @ low |
| Adversary | deepseek-v4-pro @ high |
deepseek-flash @ low |
| Root, explorers, OffGridThinker, literature/document roles | inherit (root follows the chatbox picker) | — |
On a terminal primary failure (no adapter / HTTP 4xx, including the official
quota response 1308 / “Usage limit reached”) the role degrades to its
fallback for one forced retry, and recovers on the next success or after 10
minutes. An agent with no live subagent-tree identity (another preset, an
unnamed session, or a teammate outside a RigorQuant team) is never touched.
Signed in with a DeepSeek account only? The harness splits DeepSeek into
deepseek-official (API key) and deepseek-account (account sign-in). When
the official route is not routable (no API key) and the account route is, the
shipped defaults above move to the same model ids on deepseek-account, and
those requests are billed to your account quota, not to an API key. A route
you saved yourself is never moved. Design record:
docs/architecture.md Decisions 16 and 25.
package.json dsh.bundle manifest (dsh plugin add support)
cordis.patch.yml bundle patch: skill layer + rq-model-router +
rq-team + rq-lane-sync rows
dsh/ host halves (role router, team composition and
per-call guard, boot-sync) + one persona file per
role, and the web client bundle (routing card)
agent-presets/
rigorquant.patch.yml the declared `rigorquant` preset (persona + child rows)
rigorquant/skills/ bundled 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
docs/figs/agent-team-hero.svg hero banner, reworked from the
dsh-agent-teams hero graphic (see the credit above)
tests/ the validator's test suite (see Testing below)
studies/ one folder per study (Mode B; a checkout's own
live studies — not shipped in the npm bundle)
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
The composition is validated against the installed harness: the probes
resolve it from RQ_HARNESS_MODULES, else from the dsh on PATH. On a machine
with no harness, or with a core this release does not support, those checks say
which case it is and skip — and one test pins the refusal itself, so a green
run can never be read as a validation against the wrong core. To verify a
release, install its target core (or point RQ_HARNESS_MODULES at that
install's @deepseek-ai directory) and re-run the command above.
The checked-in hook at .githooks/pre-commit runs the
same full suite under coverage and refuses a commit when the shipped validator
(rq_check.py) drops below 95% line coverage. Enable the checked-in hook
once in a git checkout:
git config core.hooksPath .githooks
The validator is a subprocess, so coverage is deliberately explicit rather
than plugin magic: RQ_COVERAGE=1 makes tests/conftest.py::run_check invoke
coverage run --parallel; the hook combines those child data files and applies
coverage report --fail-under=95. CI runs the identical gate. Bypass one
commit only with Git's standard git commit --no-verify.
tests/test_repo_consistency.py covers the other half: one validator, one
schema, documented commands that resolve, layout blocks that match the
filesystem, and one word per concept across the tracked docs. 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.
A study is the assignment: one self-contained piece of work with an
identical folder structure everywhere. Its durable deliverables
(study.json, STUDY.md, registry.json, journal.md, derivations/,
audits/, artifacts/) sit at the study root and are meant to be committed;
all scratch lives in a gitignored interim/. Two modes, implied by location:
study.json at the repo root.studies/<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.
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.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek。