dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
找出被浪费的 GitHub Actions 运行时间,并提出小而可审查的工作流补丁;任何修改都需要明确批准,并提供用于分析规则、历史上限、存储和成本估算的 DSH 设置页面。
Find wasted GitHub Actions runner time and propose small, reviewable patches.
Status: alpha, published on npm as dsh-ci-diet@0.2.0. The contracts, specification, analysis engine, patch engine, CLI, DSH plugin tools, and a self-contained HTML report are implemented and tested. The DSH Web client screens are still open.
CI Diet reads two things and compares them:
gh api calls.From that it reports where runner minutes are spent and which findings are safe to turn into a small YAML edit. Every finding carries an evidence level (observed, inferred, static) and a coverage state per rule.
Rule · Finds · Plan in v0.1 CD001 · PR runs superseded by a newer commit · patch: concurrency CD002 · Overlapping triggers · explanation only CD003 · Heavy checks on docs-only changes · explanation only CD004 · Oversized matrices · explanation only CD005 · Jobs without timeout-minutes · patch: timeout-minutes CD008 · Long artifact retention · patch: retention-days
The rule set is deliberately small. A rule ships only after it passes a quality gate measured on real repositories, because a noisy rule is worse than a missing one. CD003 and CD005 are implemented but disabled by default until that gate passes (see ADR-13).
with no network access still gets the static scan.
diff, approve it explicitly, and apply it to your working tree.
Cost output keeps four separate values and never mixes them:
Field · Meaning observedRunnerSeconds · What the run records actually say modeledRoundedMinutes · Per-job minutes, rounded up the way billing does listPriceUsd · Converted at the snapshot list price actualBilledUsd · Always null until we can prove otherwise
Every report embeds the pricing snapshot it used (with a content hash), so a number can be reproduced later. If the snapshot cannot be verified, the report is not shipped.
npm install --global dsh-ci-diet
dsh plugin --profile web add dsh-ci-dietThe plugin adds one disabled loader entry; enable networkEnabled only if you want history sync. Installing the package globally is optional: npx dsh-ci-diet runs the same CLI, and the DSH plugin only needs the package in the profile. Release tags are on GitHub; the matching npm version is 0.2.0.
ci-diet scan --cwd . # static scan, no network
ci-diet sync --network # read GitHub Actions history for this checkout
ci-diet plan --rule CD001 --workflow .github/workflows/ci.yml \
--claims ci-only,replace-safe
ci-diet approve --plan <planId> --confirm <digest tail>
ci-diet apply --plan <planId> # rewrites only the planned byte range
ci-diet revert --change <changeId> # restores the backed-up bytesplan refuses to write when the finding is not patch-eligible, when coverage does not allow a write, or when the policy snapshot a rule depends on is stale. CD005 needs --job and --minutes; CD008 needs --job and --step, plus --claims artifact-purpose:temporary,consumer-min-days:7. Nothing is committed, pushed, or applied without the explicit approve step.
ci-diet report # text summary of the latest stored report
ci-diet report --format html --out report.html
ci-diet diagnose # explain job-name attribution and collection coverage
ci-diet prune # drop expired reports, plans, and cache entriesThe HTML file is self-contained: inline CSS, no scripts, no external requests. It is read-only, so approvals stay in the CLI where the digest and nonce checks live.
diagnose reads the latest stored history and reports how many GitHub job names resolved to workflow keys, which matrix jobs expanded, and which collection caps left a coverage axis incomplete. It is read-only and works offline; --require-complete exits 3 when any axis is incomplete.
It also lists advisory cache hygiene hints: a dependency install with no cache, and a literal cache key that cannot follow the lockfile. The frozen contract has no cache rule id, so hints never become findings or patches.
Pushing a tag that matches the version in package.json triggers .github/workflows/publish.yml:
git tag v0.2.0
git push origin v0.2.0The workflow compares the tag with package.json (node scripts/check-release-tag.mjs), runs the same checks as CI, refuses to overwrite an already published version, and then publishes with npm trusted publishing. It uses GitHub OIDC (id-token: write) and no npm token, so the package's trusted publisher must name publish.yml for this repository.
^22.19.0 || >=24.0.0gh CLI, optional, only for execution history>=0.2.1-rc.2 =0.2.2-rc.1 <0.3.0-0, optional, only forthe plugin tools
bun install
node scripts/test-core.mjs
node scripts/gen-types.mjs --check
node scripts/sync-contracts.mjs --check
bun run typecheck
bun run lint
bun run test:docsRun the tests with Node so the published entry points stay Node-compatible; Bun is used for dependency management only.
src/core workflow parsing, rules, savings, patch engine
src/adapters github, git, storage
src/dsh host and client plugin code
src/cli command line entry
src/shared i18n and small shared helpers
contracts JSON Schemas, imported from the frozen design pack
examples sample records and evaluation vectors
docs/spec normative product specification
scripts contract and documentation checks
tests/unit fast checks that need no networkEnglish is the default and the source of truth for message keys. The CLI, the HTML report, and DSH tool text ship in English, Korean, Simplified Chinese, Hindi, Spanish, and French; every dictionary is complete, so a missing key is a type error. Regional tags resolve by language (hi-IN, es-MX, fr-CA), and Chinese variants that are not Simplified fall back to English.
Language selection is an explicit --lang, then the DSH locale preference, then LC_ALL/LC_MESSAGES/LANG, then English. Reports are stored in English and translated only when displayed: rule ids, error codes, enum values, paths, digests, and numbers stay untranslated, and the HTML report sets its lang attribute to the selected locale. DSH tool descriptions are captured at plugin load, so changing the DSH language preference needs a reload. Public documentation is English, with a Korean README mirror.
MIT