deepseek-harness
deepseek-ai
DeepSeek Harness: Everything is a Plugin.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:Nzssm1/dsh-factor-investing
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
A DeepSeek Harness (DSH) community agent preset for institutional multi-factor stock selection (A-share oriented). It turns the broker/hedge-fund multi-factor pipeline into a discipline-aware researcher: a methodology knowledge base covering the full pipeline, plus a deterministic Rust core for reproducible factor statistics.
Community project — NOT an official DeepSeek preset and not endorsed by DeepSeek. See Relationship with DeepSeek.
dsh-factor-investing (the directory name; must match [a-z0-9][a-z0-9-]*)scripts/factor-stats); the Agent writes only factor definitions and glue codeA generic chat model reduces "multi-factor" to "sum a few factors" and treats "good backtest = valid factor". Institutional multi-factor is an industrial pipeline, and its real edge over retail practice is statistical discipline:
This preset writes that discipline into the system prompt via the persona, ships the methodology as a skill for on-demand loading, and pins the numeric algorithms in Rust so the same data and version produce the same numbers every time.
Three parts, all shipped with the repo:
agent.cordis.yml injects a quant-researcher identity through @deepseek-ai/dsh-persona, embedding the pipeline, core discipline, and the hard rule that the Agent only writes factor definitions/glue code while all core computations go through the Rust CLI.skills/factor-investing-pipeline/ is registered through @deepseek-ai/dsh-skill-filesystem's customSkillDirs; the model loads the relevant chapter with the skill tool.src/ + Cargo.toml implement winsorization (MAD/3σ/percentile), standardization, neutralization, IC/ICIR, two-stage Fama-MacBeth, Gram-Schmidt orthogonalization; scripts/factor-stats is the stable JSON-in/JSON-out CLI and the Agent's only computation entry point.The toolset keeps the full standard coding capability; only the identity and knowledge change, so the tool catalog — and thus the request-prefix cache — stays stable.
Every command reads one JSON object from stdin and writes JSON to stdout; null represents missing/NaN values in both directions. Errors go to stderr with a non-zero exit. See RUST_CORE.md for the full command list and JSON fields.
# First call auto-builds the release binary (later calls use target/release/factor-stats)
echo '{"values":[1,2,3,4,5]}' | scripts/factor-stats zscore
echo '{"values":[1,2,3,4,5,6,7,8,9,1000]}' | scripts/factor-stats winsorize-mad
echo '{"factor":[1,2,3,4,5,6,7,8],"exposures":[[1],[2],[3],[4],[5],[6],[7],[8]]}' | scripts/factor-stats neutralize
echo '{"factors":[[1,2,3,4],[1,2,3,4]],"returns":[[2,4,6,8],[1,2,3,4]]}' | scripts/factor-stats ic-series
echo '{"values":[0.05,0.06,0.04,0.05,0.07,0.03]}' | scripts/factor-stats icir
echo '{"exposures":[[[1],[2]],[[1],[2]]],"returns":[[0.5,0.9],[0.6,1.2]]}' | scripts/factor-stats fama-macbeth
Commands: mean, std, median, mad, quantile, rank, corr, spearman, winsorize-mad, winsorize-sigma, winsorize-percentile, zscore, neutralize, ols, pearson-ic, spearman-rank-ic, ic-series, icir, ic-tstat, fama-macbeth, gram-schmidt.
dsh-factor-investing/
├── preset.yml # display metadata (name + description)
├── agent.cordis.yml # Cordis composition: persona + tools + skill
├── skills/factor-investing-pipeline/
│ ├── SKILL.md # core framework + chapter/topic index
│ ├── chapters/ch00…ch09.md # ten pipeline stages
│ ├── glossary.md / patterns.md / cheatsheet.md
├── src/stats.rs / src/main.rs # Rust core algorithms and CLI
├── Cargo.toml / Cargo.lock # locked Rust dependencies (reproducible builds)
├── RUST_CORE.md # Rust core interface and read-only policy
├── scripts/factor-stats # Rust CLI wrapper (bash / cmd)
├── package.json # npm test (cargo test --locked), build:rust
├── README.md / README.zh-CN.md
├── LICENSE (MIT) / NOTICE
├── .gitignore
└── .github/workflows/test.yml # CI: Rust
DSH discovers local presets under <dshHome>/.agent-presets/ (dshHome defaults to ~/.dsh; %USERPROFILE%\.dsh on Windows). The preset id is the directory name, so clone the repo as that directory.
Linux / macOS:
mkdir -p ~/.dsh/.agent-presets
git clone https://github.com/Nzssm1/dsh-factor-investing.git \
~/.dsh/.agent-presets/dsh-factor-investing
Windows (PowerShell):
New-Item -ItemType Directory -Force "$env:USERPROFILE\.dsh\.agent-presets"
git clone https://github.com/Nzssm1/dsh-factor-investing.git `
"$env:USERPROFILE\.dsh\.agent-presets\dsh-factor-investing"
Restart DSH and pick 「多因子选股量化研究员」 for a new session. If your deployment configures custom preset roots, place the repo under that root instead (dsh-agent-presets roots).
Rust toolchain requirement: the first scripts/factor-stats call needs cargo (Rust stable). Install from https://rustup.rs.
factor-investing-pipeline should appear, or ask it to "load chapter ch04 of factor-investing-pipeline".cargo test --locked (18 Rust tests pass) or echo '{"values":[1,2,3,4]}' | scripts/factor-stats mean → 2.5.npm test runs cargo test --locked.standard's tools and only replaces the persona and registers the skill, so there is no bootstrap/full switching and the prefix cache stays stable.scripts/factor-stats. The Agent must not re-implement these algorithms in Python/JS, and must not use pandas/numpy in place of Rust.src/, Cargo.toml, Cargo.lock, and scripts/factor-stats* are the fixed computation layer. The Agent must not create, modify, or delete them; if a new fixed computation is needed, the Agent must ask the user/maintainer to extend the Rust core instead of editing it.null means missing/NaN. Glue code can convert between pandas/numpy DataFrames and this JSON interface.preset.yml (display metadata) + agent.cordis.yml (Cordis composition) + @deepseek-ai/dsh-persona (persona) + @deepseek-ai/dsh-skill-filesystem customSkillDirs (preset-local skill).system-prompt/assemble listener. In the current version the system prompt comes from @deepseek-ai/dsh-persona, and "the catalog changes once" is satisfied by not changing it at all.LICENSE (currently Nzssm1); ③ whether your deployment sets custom preset roots (default ~/.dsh/.agent-presets/); ④ on a non-rc.6 deployment, field names for customSkillDirs / dsh-persona may differ — check that version's dsh-agent-presets / dsh-persona README.Nzssm1;agent.cordis.yml is adapted from the standard preset shipped with DeepSeek Harness (Copyright (c) 2026 DeepSeek, MIT) and the MIT notice is retained (see NOTICE); the methodology knowledge base is adapted from the author's own research report, whose cited broker research and 《因子投资:方法与实践》 remain the property of their respective authors/publishers.# Rust core full test suite
npm test
# Rust tests / release build separately
npm run test:rust
npm run build:rust
Nzssm1/dsh-factor-investing on GitHub;main (commands below);dsh-plugin under Settings → Topics (this is how community directories and the topic page discover it);test.yml workflow passes in Actions (including Rust tests);git init
git add .
git commit -m "feat: dsh-factor-investing preset with Rust core"
git branch -M main
git remote add origin https://github.com/Nzssm1/dsh-factor-investing.git
git push -u origin main
Adding topics: repo page → right-side About gear → Topics → dsh-plugin (suggest also deepseek-harness, dsh, factor-investing, quant, rust).
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: 无有效分类标签。