Lockdrift

io.github.CloudCorpRecords由 GitHub 帳號 CloudCorpRecords 發布v0.1.0更新於 Nov 6, 2026

Lockfile versus package.json drift auditor for a repo or monorepo.

已驗證STDIO僅桌面開發者工具

概覽

AI 產生的概覽

Lockdrift 比對 package.json 與 package-lock.json 並回報相依性漂移,讓助理稽核儲存庫或 monorepo 的鎖定檔一致性。

可以做什麼
  • 比對 package.json 文件與其 package-lock.json,回傳 IN-SYNC 或 DRIFT 結論及逐項相依性清單。
  • 回報已宣告但鎖定檔中缺少的相依性、鎖定版本不符合宣告範圍的相依性,以及鎖定檔中仍有但已不再宣告的套件。
  • 辨識缺少或無法解析的鎖定檔,並同時支援 v2/v3 與 v1 鎖定檔格式。
適用情境
適合在檢查 JavaScript 或 TypeScript 儲存庫的鎖定檔是否過期時使用,例如有人改了 package.json 卻沒有重新安裝,或在建置、發佈前核對 monorepo 中的各個套件。
執行需求
以本機程序透過 stdio 執行,可用 npx 執行 npm 套件,或以 Docker 映像執行。不需要帳號、API 金鑰、環境變數或網路存取,比對完全在本機完成。
安裝前請注意
它只比對記錄的範圍,不解析 semver,也不連線套件來源,因此結論反映的是文字層面的範圍漂移,而非可安裝的版本。此工具以字串形式接收兩個檔案的完整內容,這些文件會傳給助理。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Lockdrift,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

lockdrift

Has the lockfile drifted from the manifest? lockdrift compares the dependency ranges a package.json declares against the ranges recorded in package-lock.json and reports every difference, sorted by name:

  • missing_from_lockfile — declared in the manifest, absent from the lockfile (someone edited package.json and never reinstalled)
  • version_mismatch — present in both, but the recorded ranges disagree
  • extra_in_lockfile — recorded in the lockfile but no longer declared

Lockfile v2/v3 (the root packages[""] entry) and v1 (the top-level dependencies map) are both supported. The comparison is of the recorded ranges — lockdrift reports recorded drift; it does not resolve semver or talk to a registry. Pure local computation: no network, no configuration.

CLI

bash
npx @reneturcios/lockdrift check package.json package-lock.jsonnpx @reneturcios/lockdrift --version

Output is the report as JSON, e.g. {"in_sync": false, "drift_count": 1, "drift": [{"name": "zod", "kind": "version_mismatch", "declared_in": "dependencies", "package_json_range": "^3", "lockfile_range": "^2"}]}.

Exit codes: 0 on success (drift is a result, not an error), 1 on a runtime error (unreadable or invalid file), 2 on a usage error.

MCP server

bash
npx -y @reneturcios/lockdrift mcp

MCP client config:

json
{  "mcpServers": {    "lockdrift": {      "command": "npx",      "args": ["-y", "@reneturcios/lockdrift", "mcp"]    }  }}

Tools

  • check_lockfile_drift — Compare a package.json against its package-lock.json and report drift.
    • package_json (string, required) — the package.json document, as a JSON string
    • lockfile_json (string, required) — the package-lock.json document, as a JSON string

Docker

bash
docker run -i ghcr.io/cloudcorprecords/lockdriftdocker run --rm -v "$PWD:/w" ghcr.io/cloudcorprecords/lockdrift check /w/package.json /w/package-lock.json

Development

bash
npm installnpm run build   # tsc -> dist/npm test        # tsx --test test/*.test.ts (pure local, no network)npm run dev     # run the CLI from source

License

MIT — Copyright (c) 2026 Rene Turcios

來源:README.md,提交 f18fa1e

工具

1

check_lockfile

Check a package.json against its package-lock.json: dependencies with no lock entry, locked versions that do not satisfy the declared range (exact, caret, tilde, and >= ranges), packages locked but not declared, and a missing or unparsable lockfile. Verdict IN-SYNC or DRIFT with per-dependency evidence.

輸入參數path必填

版本歷史

1
  1. v0.1.0最新Oct 30, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分