Standalone DeepSeek Harness plugin repository (dsh-data-quality): deterministic TypeScript data profiling / cleaning / verification for the agent harness, built as the full three-layer capability seam (Service Definition / local Provider / three model tool Consumers) with durable report storage and adaptive session events.
ctx.dataQualityService Definition (src/service.ts) —DataQualityService extends Service, registered underdataQuality. Exposes the frozen cross-plugin contract:verifyCitations(request: CitationCheckRequest): Promise<CitationCheckResult>— the byte-stable cross-plugin contract (§6.2 of the plugin spec), change only with an ecosystem migration.profileDataset,cleanDataset,verifyDataset— the internal report pipeline used by the tools.
- Local deterministic Provider (
src/provider-local.ts) — no I/O in the engines, no clock (injectednow/freshness), no RNG; TypeScriptprivatefields only (ECMA#fields throw on cordis' proxied service receiver). - Consumers (
src/tools/*.ts) —data_profile,data_clean,data_verifydefineTools; all computation via the service;workspaceOf(exec)mirrors the official fs tools' session-cwd rule.
src/dataset.ts— workspace-confined path resolution, size/row guards, hand-rolled CSV/TSV/JSON/JSONL parsers, deterministic systematic sampling, strict scalar parsers (Cell = JsonValue).src/profile.ts— row/column counts, inferred types, missing rates, unique counts, numeric distribution (min/max/mean/median/p25/p75), IQR outlier counts, mixed-type suspicion notes, duplicate-row counts, text rendering.src/clean.ts— six rule kinds, exactly the spec's list:dedupe(column group),fill-missing(constant/mean/median/forward),coerce-type(number/date/boolean with failure counts),normalize-unit(万/亿-style factor map),trim,map-values(enum mapping withelse: keep|missing).src/verify.ts— seven rule kinds, exactly the spec's list:not-null,unique,range,regex,enum,cross-column,freshness(date column vsasOf, default injected clock) — pluscheckCitations/parseLocator/walkLocatorand the four verification states (verified/mismatch/not-found/unverifiable).
src/store.ts—data_qualitystorage domain (zod record schema, version 1, tablereports), deterministic report keyYYYYMMDDHHmmssSSS-<kind>-<8-hex-sha256>.src/events.ts—data-quality/profile|clean|verifyin theSessionEventMapdeclaration merge. Adaptive append gate: known vocabulary → plain append; unknown vocabulary → probe the unboundappendsource for anignorablemarker and only then append with{ ignorable: true }; otherwise skip (the storage-domain report is always the durable copy). This is required because the rc.6Session.appendhas noignorableflag and no plugin event-registration surface exists, so an unknown appended type makes the persistence coordinator refuse the session log on restore.src/config.ts— Schemastery schema + explicitresolveConfig(no hidden?? default); numeric bounds fail loud at mount.
| Tool | Input | Output |
|---|---|---|
data_profile |
dataset path, sample? | row/column counts, per-column cards (type, missing, unique, numeric stats, notes), duplicate rows, reportKey |
data_clean |
dataset path, rules[], output path (optional, workspace-confined) | cleaned rows, per-rule audit log (affected rows), reportKey |
data_verify |
dataset path, rules[], evidence cap | verdict passed, per-rule pass/fail with evidence rows, reportKey |
| Key | Default | Notes |
|---|---|---|
enabled |
true |
master switch |
maxRows |
200000 |
row guard, fail loud |
maxFileSizeMB |
64 |
file size guard, fail loud |
defaultTolerance |
1e-9 |
numeric comparison relative tolerance |
evidenceRowLimit |
20 |
evidence rows per failed verify rule |
allowedExtensions |
.csv .tsv .json .jsonl |
dataset file extensions |
workspaceRoot |
'' |
service-level citation checks resolve here; tools resolve in the session workspace |
storeReports |
true |
persist reports to the data_quality storage domain |
All knobs are documented in the five-language README configuration tables and mirrored in cordis.patch.yml with inline comments.
pnpm run typecheck PASS tsc -p tsconfig.json --noEmit && tsc -p tsconfig.test.json --noEmit
pnpm run typecheck:ci PASS tsc -p tsconfig.ci.json --noEmit (published 0.1.0-rc.6 peers)
pnpm test PASS 112 tests / 8 files (clean 22, verify 28, dataset 25, plugin 10, citations 9, profile 8, events 6, config 4)
pnpm run build PASS lib/index.js 82.82 kB; fix-dts rewrote 11 files / 37 specifiers
pnpm run verify:self-contained PASS all dependency specs resolve from the registry
pnpm run verify:artifacts PASS syntax + ESM import + plugin face + no .ts leftovers + bundle patch present
pnpm run verify:readme-sync PASS all 5 READMEs share section structure and config keys
pnpm run pack:check PASS dsh-data-quality-0.1.0.tgz (lib/index.js + lib/types + cordis.patch.yml + READMEs + src)
pnpm run test:coverage thresholds (statements 90 / branches 80 / functions 90 / lines 90) pass.
-
Loader runner (
node scripts/loader-runner.mjs .tmp/loader-smoke/cordis.yml fixtures) — boots a realContext+ vendored Loader with the Include builtin against the real storage seam (dsh-storage + dsh-storage-json + dsh-storage-domain), dsh-system-prompt, dsh-tools, and the BUILTlib/index.jsbundle withworkspaceRoot= fixtures dir. Keyless three-tool chain over the dirty fixture:DSH_LOADER_RESULT {"tools":["data_profile","data_clean","data_verify"],"profileRows":10,"profileColumns":6,"cleanOutputRows":8,"verifyPassed":false,"citationStatus":"verified"}profile 10 rows / 6 columns; clean (trim → dedupe → normalize-unit → coerce-type) drops 2 duplicate rows (8 out); verify
passed:falseis the correct verdict (the fixture's missingholding_valueon FUND005 failsrange— evidence flows);verifyCitationsresolves a cited value from the CSV →verified. -
dsh-test-drive isolated install matrix (preferred path, run 2026-08-20) — programmatic drive of the dsh-test-drive pipeline (
D:\deepseek-harness\Project\Plugins\dsh-test-drive\, realLocalSubprocessRuntime→ realdshCLI + pnpm) against this checkout:verdict: pass install pass dsh plugin add <checkout> ok (exit 0, allowBuildsNeeded: false) config pass patchEffective: true, layers: ["dsh-data-quality"], full bundle patch visible in --dump-config smoke boot-ok booted without loader failures; MISSING_CREDENTIAL (no API key) proves the tree mounted capability skipped disabled by config and no per-drive spec (requires DEEPSEEK_API_KEY) uninstall pass dsh plugin remove ok (exit 0) cleanup pass owned temp root quarantined and removed isolation hostHomeTouched: false, tempDshHome/tempWorkspace/tempStore: true -
Real dsh CLI temp-profile install (earlier session, recorded here):
dsh plugin --profile dq add @deepseek-ai/dsh-base@0.1.0-rc.6 @deepseek-ai/dsh-headless@0.1.0-rc.6 ./dsh-data-quality-0.1.0.tgz→ install succeeds;--dump-configshows the bundle patch merging the storage rows +dsh-data-qualityrow; keyless headless exits withMISSING_CREDENTIAL(a pending service would hang to timeout instead);dsh plugin removereverts cleanly.
d5e1c7b docs: record v0.1.0 release status
d9201d2 chore(release): 0.1.0
f2f95b7 fix: release script stamps a first release whose version is already set
3261e77 chore: keep loader-runner output byproduct untracked
433f9d4 docs: completion summary
6f9c4e5 docs: five-language READMEs and repo policy files
90ae5ed ci: ci/compat/release workflow trio
daca96f build: self-contained prepare/verify/release scripts and loader-runner smoke
8ad596d test: real-service vitest suite (112 specs) plus dirty-data fixtures
2048c6e feat: data_profile/data_clean/data_verify tools and plugin entry with fail-loud config
be634cd feat: ctx.dataQuality seam (frozen verifyCitations contract, local provider, storage domain, adaptive session events)
0be188f feat: deterministic dataset layer and pure engines (profile/clean/verify)
d6af7b6 chore: project scaffold (package manifest, tsconfig trio, build/test config)
- Session events are adaptive, not unconditional. The spec requires a
SessionEventMapmerge for model-visible content; that merge exists (src/events.ts). On rc.6 hosts the append surface has noignorableflag and no plugin event-registration surface, so appending an unknowndata-quality/*type would make the persistence coordinator refuse the session log on restore. The gate appends only when the host knows the vocabulary or supports the ignorable marker, and fails safe to skipping; the storage-domain report remains the durable record. (The original SUMMARY predated this refinement; the current code is authoritative.) - Rule names match the spec verbatim. The six clean rules (
dedupe,fill-missing,coerce-type,normalize-unit,trim,map-values) and seven verify rules (not-null,unique,range,regex,enum,cross-column,freshness) use the spec's kebab-case names. An earlier SUMMARY draft described an intermediate snake_case rule set; the shipped code never shipped those names. - Render shape is text, not a table. The spec suggests a "generic + table render"; the tools use
generictools with a human-readable text summary inoutput.render(tables are ill-suited to the variable-width evidence rows). Semantics unchanged: canonical JSON inoutput.schema, human text inoutput.render. workspaceRootadded for the service plane. Tool calls always resolve inside the session workspace (spec).verifyCitationshas no session, so aworkspaceRootconfig (default: process launch directory) anchors service-level checks; it is fixed at provider construction.- Extra config keys
enabled/storeReports. Both default on and are settable from cordis.yml — additions to, not replacements of, the spec's five keys. MAX_CELL_TEXT(120 chars) is a display-safety invariant, not a tunable; documented in AGENTS.md.- Push/publish did not happen in the development session. The spec forbids push and publish here;
d9201d2/d5e1c7brecord the release session's stamp/status work, and the remote (PerryLink/dsh-data-quality) plus npm (dsh-data-quality@0.1.0, published 2026-08-19T13:54Z) were populated by that release session.
- 13 conventional commits on
main, tagv0.1.0, working tree clean. Remote:github.com/PerryLink/dsh-data-quality(pushed by the release session). - npm registry:
dsh-data-quality@0.1.0published 2026-08-19T13:54Z (latest= 0.1.0); the earlier "npm publish skipped (no NPM_TOKEN)" note is superseded — the release session closed that gap. dsh-data-quality-0.1.0.tgzis gitignored and reproducible viapnpm pack.
- Session events are best-effort on pre-rc.7 hosts: on a host whose append lacks the
ignorablemarker,data-quality/*events are skipped rather than risking log-restore refusal; the storage-domain report remains the durable record. Revisit when the harness exposes a real plugin event-registration surface. - No fuzzy/LLM-based cleaning: rule semantics are strictly deterministic by design; a future
data_cleanrule kind could delegate fuzzy matching to an LLM tool as an opt-in. workspaceRootis process-start-time: the provider caches the resolved root at construction; a runtime configuration change requires remounting the plugin.- Numeric parsing is strict: locale-formatted numbers (
"1,234.56") and currency strings are text untilcoerce-type/normalize-unitrun. - Cross-column date comparison uses epoch fallback: strings that do not parse as numbers fall back to
Date.parse; unparseable pairs fall back to strict string equality (only for==/!=). - Evidence rows are truncated by
MAX_CELL_TEXT(120 chars).
Add one row to the Project/Plugins overview roster: dsh-data-quality — ctx.dataQuality three-layer seam (deterministic profiling/cleaning/verification) with data_profile / data_clean / data_verify tools; v0.1.0 on npm since 2026-08-19.
The chain was executed (2026-08-20) as far as the session's capabilities allow:
- Community feedback check — DONE: GitHub API audit shows
PerryLink/dsh-data-qualityhas 0 open/0 closed issues, 0 stars; no feedback to fold in before the next release. - Standard item B (community engineering) — DONE: all 8 GitHub topics are set (
dsh,dsh-plugin,deepseek-harness,cordis,data-quality,data-cleaning,data-profiling,data-verification— mirror ofpackage.jsonkeywords); five-language READMEs passverify:readme-sync;THIRD_PARTY_NOTICES.mdcurrent. The Project/Plugins overview (D:\deepseek-harness\Project\Plugins\README.md) now listsdsh-data-qualityunder "已发布 GitHub + npm" (30 projects / 13 published). - Standard item A (ecosystem delivery) — npm closed (
dsh-data-quality@0.1.0, 2026-08-19T13:54Z). Ecosystem catalog submission is BLOCKED: community catalogs exist (awesome-dsh-plugins/awesome-dsh-pluginset al., none listing this plugin yet) but submitting requires GitHub write credentials — noghCLI and noGH_TOKEN/GITHUB_TOKENin this session; a release session with credentials should open the catalog PR. - Standard item C (publish upload) — CLOSED for 0.1.0: tag
v0.1.0, GitHub Release (2026-08-19T13:45Z), npm publish (2026-08-19T13:54Z).mainsynced to origin (d669a19). For the next version:node scripts/release.mjs <x.y.z>(stamps CHANGELOG, re-runs the gate, commits + tags, never pushes), then push —release.ymlpublishes to npm with provenance and creates the GitHub Release from the stamped CHANGELOG section (needs theNPM_TOKENsecret configured on the repo).