Introduction

The DSH plugin mechanism composes profiles, dependency declarations, and bundles into composable capabilities. When actually maintaining a profile, a common problem is: what dependencies are declared, what is locked in pnpm lock, what is in the installed package manifests, and whether the dsh.bundle.patch declared for each package matches up.

dsh-profile-lock-proof generates a content-addressed, machine-readable proof for this boundary. Its scope is narrower than SBOM, CVE scanning, signature verification, or installers: it does not execute packages, does not access the network, does not modify the profile, nor does it return manifest, lockfile, patch, script commands, or secret contents.

What is it

dsh-profile-lock-proof is a DSH plugin maintained by dongsheng123132, MIT licensed, requires Node.js >=22, and is currently version 0.2.0.

It provides a set of CLI commands and DSH/MCP tools for checking whether a profile’s dependency declarations, pnpm lock importers, installed package manifests, and dsh.bundle.patch are consistent as described by an explicit proof manifest.

Version 0.2.0 removes the bundled DSH tool runtime and the default export that was misclassified by stock Cordis Loader; the bundle now exposes host-neutral tool definitions via namespace exports.

Core Capabilities

Proof Content

This plugin generates machine-readable proof covering whether the following are consistent:

  • DSH profile dependency declarations
  • pnpm lock importers
  • Installed package manifests
  • dsh.bundle.patch declared for each package

Dependency specifiers only accept exact semver or github:owner/repo#<40-hex-commit>.

Input and Failure Strategy

The plugin adopts a fail-closed strategy for input evidence:

  • Input paths must be workspace-relative regular files; traversal and symlinks are rejected.
  • The bytes of the profile and lockfile must match the SHA-256 values in the explicit proof manifest.
  • It checks pnpm importer specifiers, installed name/version/package hash, bundle patch path/hash, and missing lifecycle hooks.
  • Evidence that is missing, stale, invalid, mutable, mismatched, or contains lifecycle scripts will cause a failure.

Output and Permissions

The proof output contains only identities, classifications, hashes, status, and disclosures. The report is atomically written to an explicit artifactDir and read back for verification.

The plugin does not execute packages, does not access the network, does not modify the profile, nor does it return manifest, lockfile, patch, script commands, or secret contents.

Installation and Enablement

Install the plugin into a standalone profile and pin a commit:

dsh plugin --profile profile-lock add github:dongsheng123132/dsh-profile-lock-proof#<commit>

Replace <commit> with the 40-character commit to use. It is recommended to check the source code, license, and entry file before installing; this plugin runs with the permissions of the current dsh process.

Typical Usage

The following command checks a proof.json in the workspace root:

dsh-profile-lock-proof inspect --workspace . --manifest proof.json

inspect is used for workspace proof checking.

dsh-profile-lock-proof verify --workspace . --manifest proof.json --artifactDir artifacts

verify is used for verification and allows writing the report to an explicit artifactDir.

Exit code meanings:

  • 0: Verification passed, obtaining a verified proof.
  • 2: Verification or input failed.

MCP / DSH Tools

The plugin provides DSH/MCP tools:

  • dsh_profile_lock_inspect
  • dsh_profile_lock_verify
  • MCP aliases: profile_lock_inspect, profile_lock_verify

The MCP side has lower permissions: it only accepts bounded inline evidence, reads and writes no files, and shares the validation core with the CLI. The DSH/CLI side can only write to an explicit workspace-relative artifactDir and requires atomic write and read-back verification.

Local Self-Check

In the plugin source code repository, the following commands can be run for local verification:

npm ci
npm test
npm run check
npm run smoke:plugin
npm run smoke:mcp
npm run smoke:web-loader # requires DSH_CHECKOUT and isolated DSH_HOME

Applicable Scenarios and Notes

Suitable for the following uses:

  • Need to prove consistency between a DSH profile’s dependency declarations, pnpm lock, and installed packages.
  • Need to generate machine-readable proofs without executing packages, accessing the network, or returning sensitive file contents.
  • Need to install the plugin in a workspace using a fixed commit and review bundle patches.

Please note:

  • It is not an SBOM, CVE scanner, signature verifier, or installer; it only covers the aforementioned consistency boundary.
  • Input files must come from regular files within the workspace; out-of-bounds paths, symlinks, mutable, or content mismatches will fail closed.
  • The plugin runs with the permissions of the current dsh process; check source code, license, and tool behavior before installing.

Related Links

  • GitHub: https://github.com/dongsheng123132/dsh-profile-lock-proof
  • Plugin Directory Page: https://www.skillhub.cn/plugins/dongsheng123132/dsh-profile-lock-proof (Directory page content not verified)