{"id":51114016,"url":"https://github.com/mlane/deterministic-dependency-reset","last_synced_at":"2026-06-24T20:01:28.295Z","repository":{"id":357934374,"uuid":"1239197730","full_name":"mlane/deterministic-dependency-reset","owner":"mlane","description":"Deterministic Dependency Reset (DDR): A maintenance workflow to eliminate ghost dependencies, resolution bloat, and lockfile drift in npm projects","archived":false,"fork":false,"pushed_at":"2026-05-14T21:39:09.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-14T23:34:02.068Z","etag":null,"topics":["depedency-management","devops","frontend-engineering","javascript","npm","package-lock","performance-optimization"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mlane.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-14T21:26:26.000Z","updated_at":"2026-05-14T21:40:35.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/mlane/deterministic-dependency-reset","commit_stats":null,"previous_names":["mlane/deterministic-dependency-reset"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/mlane/deterministic-dependency-reset","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlane%2Fdeterministic-dependency-reset","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlane%2Fdeterministic-dependency-reset/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlane%2Fdeterministic-dependency-reset/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlane%2Fdeterministic-dependency-reset/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mlane","download_url":"https://codeload.github.com/mlane/deterministic-dependency-reset/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlane%2Fdeterministic-dependency-reset/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34747387,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-24T02:00:07.484Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["depedency-management","devops","frontend-engineering","javascript","npm","package-lock","performance-optimization"],"created_at":"2026-06-24T20:01:27.386Z","updated_at":"2026-06-24T20:01:28.282Z","avatar_url":"https://github.com/mlane.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# The Deterministic Dependency Reset (DDR)\n\n\u003e Your lockfile is not the absolute truth; it is a history of mistakes.\n\n## The Problem: The \"History of Mistakes\"\n\nStandard routines like `npm install` and `npm ci` are fundamentally flawed for long-term project health. They rely on the `package-lock.json` as an absolute truth, but in a long-lived project, that lockfile is rarely truth, it is a history of mistakes.\n\n`npm ci` is a Mirror. It faithfully replicates every drift, every ghost dependency, and every bloated resolution from your lockfile into your build. It doesn't fix a broken state; it scales it.\n\n## The Protocol\n\nRun this sequence to purge \"lock drift\" and re-establish a high-integrity baseline:\n\n```bash\n# 1. The Nuclear Reset: Clear out historical baggage\nrm -rf node_modules package-lock.json;\n\n# 2. Baseline Establishment: Initial resolution\nnpm install;\n\n# 3. The Push: Bump to latest allowed semver ranges\nnpm update;\n\n# 4. The Reconciliation: Nuke the \"dirty\" state created by update\nrm -rf node_modules package-lock.json;\n\n# 5. The Final Truth: One final, vacuum-sealed resolution\nnpm install;\n```\n\nor\n\n```bash\nrm -rf node_modules package-lock.json;npm install;npm update;rm -rf node_modules package-lock.json;npm install;\n```\n\n## Why this beats the Standard\n\n1. The Vacuum Principle\n\n- By nuking the lockfile, you force the package manager to re-calculate the entire dependency graph from a vacuum. This ensures your environment matches your package.json intent, not your historical install baggage.\n\n2. The Logic of the Double Delete\n\n- The genius lies in the second `rm -rf`.\n- **The Update Phase:** `npm update` is an iterative process. It moves dependencies to their latest allowed versions, but it can leave the tree in a \"dirty\" state where metadata (like `dev: true` flags) is inconsistent.\n  - Note: Ensure your `package.json` uses semver ranges (like ^ or ~) that you trust, as this protocol will pull the latest versions allowed by those ranges.\n- **The Reconciliation Phase:** By nuking the state after the update, you force one final, clean-slate resolution. This produces the most efficient, condensed, and verified version of the tree possible.\n\n## What is Lock Drift?\n\nThis protocol doesn't trust the existing state. It forces the package manager to re-calculate the entire graph from a vacuum. It is the only way to ensure that your environment matches your `package.json` requirements while purging years of \"ghost\" sub-dependencies.\n\n## The Golden Rule: Analyze -\u003e Reset -\u003e Verify\n\nThe protocol is only half the battle. You must prove the health of the new state.\n\n1. Analyze Before: Capture bundle size (`vite-bundle-visualizer`) and other metrics like CSS health (wallace-cli).\n2. Reset: Run the DDR Protocol.\n3. Analyze After: Verify the reduction in \"Unique Colors,\" \"Unique Declarations,\" and total Transferred Size.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlane%2Fdeterministic-dependency-reset","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmlane%2Fdeterministic-dependency-reset","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlane%2Fdeterministic-dependency-reset/lists"}