DeepSeek Harness DSH Audit Workbench Plugin

Introduction

DeepSeek Harness (DSH) adopts a “everything is a plugin” architecture, providing modular extension capabilities for agent developers. In financial/accounting scenarios, handling journal vouchers, cash flow statements, counterparty accounts, and journal entries often involves repetitive data cleaning, classification, and review work—tasks that are time-consuming and error-prone when done manually. The DSH Audit Workbench plugin (dsh-auditor) is a localized accounting analysis toolkit designed specifically for this purpose, targeting finance professionals and accounting firms. It offers a complete workflow covering journal voucher cleaning, cash flow statement preparation, counterparty account analysis, and journal entry testing.

Overview

dsh-auditor is a DSH workflow plugin whose primary interface is the “Audit Workbench.” It groups features by data layer: Journal Voucher Processing (Counterparty Account Analysis → Cleaning → Cash Flow Statement Preparation / Journal Entry Testing, where all four share the same ledger) and Cost Calculation (procurement details, independent of the ledger). Within the same layer, a shared dataset and state machine are used; review is handled by the current session’s agent, and data never leaves the local machine.

Core Features

Journal Voucher Cleaning

  • Business bucket classification by the model: vouchers are classified into 24 business buckets (registry contains 33 items, including expense sub-bucket folding and sentinel buckets).
  • Model-based judgment: fine-tuned on BGE-large (summary + 187-dimensional account toggle), with no keyword tables, no PMI, and no weighted fusion.
  • Hard constraints for four types of mechanical vouchers: period-end closing entries, internal fund transfers, FX gains/losses, and employee advances—determined programmatically.
  • Confidence and review checklist: probability scores calibrated by temperature into high/medium/low tiers; details include “sheet count within group”—the larger the count, the higher the sampling priority.
  • Deduplication before inference: L1 exact match → L2 digit-stripped match → L3 similarity ≥ 0.95.
  • Unknown account list: accounts that cannot be mapped to the standard chart of accounts after normalization are output as JSON for alias table maintenance.
  • Traceable bucket changes: review overrides are written to decisions/*.json (idempotency key + rationale + timestamp), and the output marks “Judgment Source = Review Override.”

Cash Flow Statement Preparation

  • Relies solely on shared classification: no model loading, no hard rules; cash flow and cleaning business classifications are always consistent.
  • Direction determined by account, not amount: Cash and bank balances on the debit side = cash inflow, credit side = cash outflow (negative debit = reversal of inflow); red-letter vouchers will not be misjudged.
  • Items determined by bucket: bucket → candidate items → filtered by direction; if multiple remain, the first-level account serves as the tiebreaker; if still unresolved, marked as “Pending Review.”
  • Two AI review checkpoints: review business classification (including high-confidence vouchers where “bucket and cash direction don’t match”) → review unresolved entries.
  • Can link to existing cleaning tasks: the same ledger is not reclassified or re-reviewed; after upstream bucket changes, resuming triggers recalculation.
  • One file, two statements: Cash Flow Statement (aggregated by item) / Cash and Bank Vouchers (full voucher + item); the full ledger classification lives in the cleaning output to avoid duplication; auto-switches to CSV when exceeding 50,000 rows.

Journal Entry Anomaly Detection

  • Automatic classification into 9 major business groups: procurement, sales, payroll, production, R&D, assets, treasury, tax, and other.
  • Cross-group distance matrix calculation: quantifies the degree of association between business groups to identify cross-module anomalies.
  • Anomaly risk scoring: combines cross-module scores, intra-module scores, and materiality levels.
  • Account fund flow visualization: interactive network graph displaying fund flows between accounts.
  • Materiality configuration: Pareto analysis filters out small-value vouchers to focus on key items.

Counterparty Account Analysis

  • Identification of 5 entry structure types: 1 debit 1 credit, 1 debit m credits, multiple debits and credits, all-debit all-credit, and special entries.
  • Exhaustive computation for multi-debit multi-credit entries: smart pruning algorithm for efficient computation of all feasible combinations.
  • Occam’s score ranking: selects the optimal solution based on the principle of simplicity.
  • Online solution preview: view and select solutions directly in the web interface.
  • Batch export: supports downloading results in Excel format.

Bank Statement Matching

  • Intelligent field recognition: automatically identifies standard columns in journal vouchers/bank statements, with manual mapping correction supported.
  • Account-to-statement pairing: intelligently pairs corresponding bank statement files by sub-account.
  • Multi-level matching engine: 1-to-1 exact match → bidirectional aggregation funnel → backtracking/DP solver → aggressive aggregation fallback.
  • Similarity filtering: cosine similarity on company names to filter for unique matches, with dual tolerance on amount and date.
  • Diagnostic panel: counterparty account analysis, sub-account monthly distribution, and reconciliation process details.
  • Monthly variance: overview of income and expenditure differences between journal vouchers and bank statements by account/month.
  • Result export: one-click download of matched/unreconciled item details in Excel.

Utilities

  • Excel data extraction: batch cross-file extraction of specified columns, with fuzzy header matching and auto-mapping; dual engine (Pandas / Polars + fastexcel).
  • Batch file organization: generates a file inventory Excel, then batch moves/copies/renames based on the inventory.
  • Excel format conversion: xls↔xlsx, csv/html→xlsx batch conversion; full folder conversion (preserving directory hierarchy).
  • PDF index number generation: prints red index numbers in the top-right corner of each page (filename + page number/total pages), with web preview.
  • PDF merge/split/convert: batch PDF merging, step-based splitting, image/Excel to PDF (Word to PDF requires local Word installation).

Installation & Activation

  1. Open DSH and go to “Plugins → Add Plugin.”
  2. Enter dsh-auditor (an npm package, available since version 0.1.8).
  3. After installation, open “Audit Workbench” → “Environment Setup.”
  4. Complete the six steps from top to bottom: Python interpreter → virtual environment → base dependencies → CPU-version torch → model file → base BGE.
  5. Engine and model are stored in %LOCALAPPDATA%\dsh-auditor\engine; the venv is stored in %LOCALAPPDATA%\dsh-auditor\venv.

Method 2: Manual Installation

  1. Environment requirements: Python 3.11 ~ 3.13 (3.13 recommended); a virtual environment is advised.
  2. Clone the project and create a virtual environment:
git clone <repository-url>
cd Accounting-Entry-Test
python -m venv venv
venv\Scripts\Activate.ps1   # Windows
source venv/bin/activate     # macOS/Linux
  1. Install base dependencies (Aliyun mirror for faster access in China):
pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
  1. Install model dependencies (CPU-version torch) + two models:
pip install torch --index-url https://download.pytorch.org/whl/cpu
pip install -r requirements-nn.txt -i https://mirrors.aliyun.com/pypi/simple/
modelscope download daijiaoshou/hajishou-V2.0 --local_dir core/nn/_storage
python -c "from core.nn.model_loader import resolve_model_dir; print(resolve_model_dir('BAAI/bge-large-zh-v1.5'))"
  1. Launch: install dsh_plugin/journal-workbench into DSH, then upload the ledger, run features, review, and download results from the “Audit Workbench.”

Typical Usage

Four Features Chained into a Pipeline

The sequence is “Counterparty Account Analysis → Journal Voucher Cleaning → Cash Flow Statement / Journal Entry Testing,” where each step automatically picks up the output of the previous one:

  1. Counterparty Account Analysis: exhaustive computation for multi-debit multi-credit entries, generating counterparty account solutions.
  2. Journal Voucher Cleaning: on top of the counterparty results, performs business bucket classification, deduplication, confidence scoring, and review.
  3. Cash Flow Statement / Journal Entry Testing: based on the cleaned classification and counterparty accounts, generates the cash flow statement and anomaly detection results.

AI Review

  • Program execution, AI review, and downstream recalculation are interleaved: each actor="ai" stage only produces a to-do list (reviews/<stage>.request.json) and then pauses.
  • Review is executed by the agent, not by clicking a button to call a completion API; tasks run in the DSH background—closing the page does not stop the process. You can click “■ Stop” in the top-right corner of the feature page.
  • Using the workbench (left sidebar): upload, view stages, manually adjust a few entries, and download; using the command line: journal (equivalent to journal.bat).

Applicable Scenarios & Notes

  • Suitable for: finance professionals, accounting firms, and agent developers who need to handle journal vouchers, cash flow statements, counterparty account analysis, and journal entry testing.
  • Note: the plugin runs with the current DSH process permissions; it is recommended to review the source code and license before installation; the training model is only needed by developers and requires a GPU.

In Summary

The DSH Audit Workbench plugin provides a localized, traceable, and reviewable workflow solution for financial scenarios through journal voucher cleaning, cash flow statement preparation, counterparty account analysis, and journal entry testing. For more details, see the plugin directory page and the GitHub repository.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye