Preface¶
When writing a mathematical modeling paper, generating a summary or model description in the chat window is usually still far from a submittable paper: data cleaning, EDA, modeling, solving, chapter writing, figures, and typesetting all need to proceed in sequence, with each step leaving verifiable artifacts. The DeepSeek Harness (DSH) plugin can package such steps into an installable, resumable workflow.
dsh-mcmp is a persistent Cordis plugin for DeepSeek Harness, designed as a fully automated pipeline for writing papers for the National College Mathematical Contest in Modeling. After sending a message starting with /loopbegin, it progresses through five stages and twenty-two sub-stages, with a control console, rating-based resolution, and file index keeping the process constrained. Whether it completes normally, errors out, or is aborted, a Final_Paper.md will still be generated.
What This Is¶
The positioning of dsh-mcmp is: to provide a mathematical modeling competition paper writing pipeline within DSH. After inputting the problem statement, it executes through five stages — “Initialization, EDA, Modeling, Writing, and Typesetting” — each containing sub-stages, ultimately producing paper files, stage artifacts, and execution logs.
The repository is located at https://github.com/Aampidy/dsh-mcmp, licensed under MIT. The plugin package is published on npm and can be installed via pnpm dsh plugin --profile web add dsh-mcmp.
Core Features¶
Trigger Method¶
Automatic execution is triggered when the input text starts with /loopbegin. Auxiliary commands like /loopstatus, /loopabort, and /loopreset do not trigger the pipeline; they are only used for viewing, aborting, or resetting.
Five Stages and Twenty-Two Sub-stages¶
The pipeline advances linearly through five stages:
- Initialization
- EDA
- Modeling
- Writing
- Typesetting
These five stages comprise a total of 22 sub-stages. After each sub-stage completes, the result enters the control console for checking before deciding whether to proceed.
Control Console Double Check¶
The control console includes a scanning and validation module and a review and decision module. If scanning validation passes, the process advances; if issues are found, it enters the review and decision module for resolution.
Issues are rated and handled by severity from P0 to P3:
- P0/P1/P2: Stage-level rollback.
- P3: Precision targeted fixes.
Rollback lessons are persisted to ROLLBACK_LESSONS.yaml, which executing Agents read upon startup. Artifact locations, statuses, and dependencies are recorded in FILE_INDEX.yaml.
Failure Handling and Fallback¶
Failures not due to quality issues are retried 3 times with exponential backoff intervals of 5s/10s/20s, and logged to transactions.log. If all retries fail, the process pauses for manual intervention.
The default rollback limit for the same stage is 10 times, configurable within the range of 1 to 99. Reaching the limit will force FORCED_FINAL lock and notify a human. Whether the pipeline completes normally, errors out, or is aborted, a Final_Paper.md is generated.
Progress and Resumption¶
A floating panel in the bottom right corner displays real-time progress, the control console, rollback counts, logs, and output files. Native workflow cards in the chat area also show sub-agent statuses.
The plugin supports resuming from breakpoints and resetting. Sub-stages involving charts can invoke the vision module; if unavailable, they are marked as pending manual confirmation.
Installation and Activation¶
The only way to install the plugin package is:
pnpm dsh plugin --profile web add dsh-mcmp
After installation, configuration lines are automatically registered, so no manual config editing is needed. Then restart the Web service and refresh the page:
pnpm dsh web
Access the following address in your browser; receiving JSON indicates successful activation:
/mcmp-api/state
Related panel API routes are /mcmp-api/state, /mcmp-api/abort, and /mcmp-api/reset.
Upgrade:
pnpm dsh plugin --profile web update dsh-mcmp
Uninstall:
pnpm dsh plugin --profile web remove dsh-mcmp
Typical Usage¶
First, prepare the problem statement. You can paste the complete contest problem into the chat box and send it. Then send the trigger command:
/loopbegin
This starts all 22 sub-stages by default.
To adjust parameters, you can write:
/loopbegin --rollback-limit=5
This changes the rollback limit for the same stage to 5.
If the problem statement is in a file, use:
/loopbegin --from problem.txt
To read the contest problem from the file.
To explicitly override the model, you can write:
/loopbegin --model glm-vision/glm-4.7-Flash
During operation, auxiliary commands can be used:
/loopstatus
/loopabort
/loopreset
/loopstatus checks progress; /loopabort aborts the pipeline, preserving any generated artifacts; /loopreset clears the state and breakpoint resume records.
Use Cases and Considerations¶
Ideal for scenarios where you need to advance a mathematical modeling contest problem into a complete Markdown paper, especially processes that require preserving stage artifacts, rollback records, logs, and index files.
Before using, note:
- The plugin reads problem statements, calls models, and writes files; inspect the source code and the MIT license before installation.
- It runs with the current dsh process permissions, so its execution permissions depend on your dsh environment.
- The npm package does not include the
tests/directory; the test content from the repository is not distributed with the plugin package. - If the pipeline is aborted or encounters an error, a
Final_Paper.mdis still generated, but you should consulttransactions.log,FILE_INDEX.yaml, and the panel logs to determine which artifacts are usable.
The value of dsh-mcmp lies in breaking down mathematical modeling paper writing into a checkable, rollback-capable, and resumable pipeline, rather than just throwing the problem at a model for one-shot generation. More details can be found in the GitHub repository: https://github.com/Aampidy/dsh-mcmp.