-
Notifications
You must be signed in to change notification settings - Fork 1
db and some more research #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
01f7c9b
3738a1c
06ab72f
785e8e1
bbfdb11
774fa1c
bd9c37e
8f72ca7
1b44213
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| DATABASE_URL=postgresql://driftlock:driftlock@localhost:5432/driftlock |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -4,11 +4,11 @@ | |||||
|
|
||||||
| # DriftLock | ||||||
|
|
||||||
| **Dependabot for API changes.** | ||||||
| **Self-maintaining APIs.** | ||||||
|
|
||||||
| Your vendor renames a field. Your code breaks silently. You find out at 2am. | ||||||
| API providers announce changes. DriftLock applies them to your codebase. | ||||||
|
|
||||||
| DriftLock notices the change before you do, opens a PR with the fix, and you review and merge. | ||||||
| When Stripe ships a breaking change or a new feature, DriftLock scans your codebase, identifies affected usages, and opens a PR with the fix. | ||||||
|
|
||||||
| [Website](https://driftlock.dev) · [Discord](https://discord.gg/driftlock) · [Issues](https://github.com/nerdev-co/DriftLock/issues) | ||||||
|
|
||||||
|
|
@@ -22,35 +22,50 @@ DriftLock notices the change before you do, opens a PR with the fix, and you rev | |||||
|
|
||||||
| --- | ||||||
|
|
||||||
| ## Why DriftLock | ||||||
| ```mermaid | ||||||
| flowchart LR | ||||||
| A[Vendor API Changes] --> B[DriftLock] | ||||||
| B --> C[Find Affected Code] | ||||||
| C --> D[Understand API Diff] | ||||||
| D --> E[Generate Fix] | ||||||
| E --> F[Pull Request] | ||||||
| F --> G[You Review & Merge] | ||||||
| ``` | ||||||
|
|
||||||
| You already use Dependabot for dependency updates. Renovate for version bumps. CodeRabbit for AI review. | ||||||
| --- | ||||||
|
|
||||||
| But when Stripe renames `charge.amount` to `charge.value` — nothing catches it. | ||||||
| ## Why DriftLock | ||||||
|
|
||||||
| Changelogs don't get read. Docs drift from reality. SDK migration guides sit in bookmarks you'll never open. **30%+ of downtime at a major cloud provider was traced to unnoticed external API changes.** | ||||||
| API communication is broken. Breaking changes ship with little warning. Useful features quietly launch and go unnoticed. Changelogs don't get read. | ||||||
|
|
||||||
| The cost always lands on you — the consumer — not the vendor who made the change. | ||||||
| The cost always lands on you (the consumer), not the vendor who made the change. | ||||||
|
|
||||||
| DriftLock fills the gap: it watches your actual API usage, compares it against what the vendor's API _actually returns_ today, and opens a PR when they diverge. No vendor cooperation. No spec publication. No manual doc-checking. | ||||||
| DriftLock makes APIs self-maintaining. When a vendor changes something, your codebase updates automatically. You review the PR and merge. No manual scanning. No migration guides. No 2am pages. | ||||||
|
|
||||||
| --- | ||||||
|
|
||||||
| ## How it works | ||||||
|
|
||||||
| ```text | ||||||
| Install GitHub App → Discover call sites → Classify tests → | ||||||
| Probe sandbox → Diff specs → Open PR → Report coverage | ||||||
| ```mermaid | ||||||
| flowchart LR | ||||||
| A[Install GitHub App] --> B[Discover Call Sites] | ||||||
| B --> C[Classify Tests] | ||||||
| C --> D[Probe API] | ||||||
| D --> E[Diff API Shapes] | ||||||
| E --> F[Generate Fix PR] | ||||||
| F --> G[Review & Merge] | ||||||
| ``` | ||||||
|
|
||||||
| | Step | What happens | | ||||||
| | ------------ | ------------------------------------------------------------- | | ||||||
| | **Discover** | Static analysis finds every `stripe.*` call in your codebase | | ||||||
| | **Classify** | Identifies which tests hit real sandbox vs. mocked | | ||||||
| | **Probe** | Runs your tests, captures actual request/response shapes | | ||||||
| | **Diff** | Compares new snapshot against previous — shape change = drift | | ||||||
| | **Fix** | Opens a PR with the diff and a suggested fix | | ||||||
| | **Report** | Shows which call sites are monitored, blind, or untested | | ||||||
| | Step | What happens | | ||||||
| | ------------ | -------------------------------------------------------- | | ||||||
| | **Discover** | Static analysis finds every API call in your codebase | | ||||||
| | **Classify** | Identifies which tests hit real sandbox vs. mocked | | ||||||
| | **Probe** | Runs your tests, captures actual request/response shapes | | ||||||
| | **Diff** | Compares current shapes against target version | | ||||||
| | **Fix** | Opens PRs with the diffs and suggested fixes | | ||||||
| | **Report** | Shows which call sites are monitored, blind, or untested | | ||||||
|
|
||||||
| The goal: when Stripe ships a change, your codebase updates automatically. You just review and merge. | ||||||
|
|
||||||
| --- | ||||||
|
|
||||||
|
|
@@ -76,21 +91,49 @@ driftlock fix ./repo | |||||
|
|
||||||
| ## What you're used to vs. what DriftLock does | ||||||
|
|
||||||
| | Today | With DriftLock | | ||||||
| | -------------------------------------- | --------------------------------------- | | ||||||
| | Read changelogs manually (you don't) | Automated drift detection | | ||||||
| | Find out when prod breaks | Get a PR before it breaks | | ||||||
| | "Something changed, no idea what" | "Field X renamed to Y on this endpoint" | | ||||||
| | Fix it yourself, hope you got it right | Suggested fix, ready to merge | | ||||||
| | No idea which tests are real | Coverage report per call site | | ||||||
| | Today | With DriftLock | | ||||||
| | -------------------------------------- | -------------------------------------- | | ||||||
| | Avoid upgrades because they're tedious | Automated codebase scanning | | ||||||
| | Manually find affected call sites | All affected calls found automatically | | ||||||
| | Copy-paste migration guide changes | Fix diffs generated and ready to merge | | ||||||
| | Weeks to upgrade, so you put it off | Minutes to review a PR | | ||||||
| | Stuck on old versions | Stay current with minimal effort | | ||||||
|
|
||||||
| --- | ||||||
|
|
||||||
| ## Why not Renovate / Dependabot? | ||||||
|
|
||||||
| They update the version number in `package.json`. They don't change your code. | ||||||
|
|
||||||
| When `stripe.charges.create({ amount: 100 })` needs to become `stripe.charges.create({ value: 100 })`, Renovate doesn't touch that. DriftLock does. | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Replace the Stripe migration example. Stripe’s Charges API requires Use a provider-neutral example-When `stripe.charges.create({ amount: 100 })` needs to become `stripe.charges.create({ value: 100 })`, Renovate doesn't touch that. DriftLock does.
+When a provider changes a request field, Renovate doesn't touch that. DriftLock does.📝 Committable suggestion
Suggested change
🤖 Prompt for AI AgentsSource: MCP tools |
||||||
|
|
||||||
| | Renovate | DriftLock | | ||||||
| | --------------------- | --------------------------- | | ||||||
| | Bumps version | Updates your code | | ||||||
| | Handles `npm install` | Handles call site migration | | ||||||
| | Dependency management | Code migration | | ||||||
|
|
||||||
| --- | ||||||
|
|
||||||
| ## Why not just semver? | ||||||
|
|
||||||
| Semver is a convention, not a guarantee. Many APIs don't follow it strictly. And even when they do, upgrading major versions means manually finding and fixing every affected call site — which is why teams avoid it. | ||||||
|
|
||||||
| DriftLock works regardless of versioning scheme. It monitors the actual API surface, not the version number. | ||||||
|
|
||||||
| --- | ||||||
|
|
||||||
| ## Why not just test coverage? | ||||||
|
|
||||||
| High test coverage helps — if your tests aren't mocked. Most are. DriftLock classifies which tests actually hit the real API vs. which just mock the response. You can't catch API drift with mocked tests. | ||||||
|
|
||||||
| --- | ||||||
|
|
||||||
| ## First target: Stripe | ||||||
|
|
||||||
| Stripe has mature test mode, huge installed base, predictable API versioning, and plenty of design partners. | ||||||
| Stripe has mature test mode, huge installed base, and plenty of teams stuck on old API versions. First vendor — not the only one. | ||||||
|
|
||||||
| Support for Twilio, Shopify, and others is on the roadmap. | ||||||
| Twilio, Shopify, and others are on the roadmap. | ||||||
|
|
||||||
| --- | ||||||
|
|
||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🤖 get_repo_knowledge executed:
get_repo_knowledge nerdev-co/DriftLock /tmp/coderabbit-repo-knowledge/nerdev-co-driftlock-47cd0c10/architectureLength of output: 16456
🏁 Script executed:
Repository: nerdev-co/DriftLock
Length of output: 44395
🏁 Script executed:
Repository: nerdev-co/DriftLock
Length of output: 44082
Align the published workflow with the implemented CLI.
These claims describe automatic vendor-change intake, call-site discovery, test classification, sandbox shape capture, API-shape diffing, and PR creation as available. The current code does not provide this end-to-end workflow:
TypeScriptExtractoronly handles TypeScriptstripe.*calls.SandboxRunnerreturns an emptytrafficCapturedlist, and the CLI disables network access.diffreports Git file changes throughGitTracker; it does not compare API snapshots.fixcommand exits with “Fix generation is not yet available.”Agent.generateFixaccepts an existingDriftEventand call-site context, but the CLI does not connect it to a workflow.BLUEPRINT.mdlists GitHub PR generation as a future implementation step, anddocs/architecture.mdlists new-feature discovery as out of scope for v1.Rewrite the claims in
README.mdanddocs/yc-application.mdas roadmap behavior, or limit them to the implemented analyze, test, and Git-change commands.📍 Affects 2 files
README.md#L11-L11(this comment)README.md#L61-L65docs/yc-application.md#L9-L9🤖 Prompt for AI Agents