feat: add drift-cli fix, calibrate, validate commands (ADR-100 phase 5b-b)#718
Open
mick-gsk wants to merge 1 commit into
Open
feat: add drift-cli fix, calibrate, validate commands (ADR-100 phase 5b-b)#718mick-gsk wants to merge 1 commit into
mick-gsk wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a set of new drift-cli commands intended to support “ADR-100 phase 5b-b” by expanding agent/CI workflows around validation, calibration, repair planning, and verification.
Changes:
- Introduces multiple new CLI command modules (e.g.,
verify,validate,calibrate,fix-plan,init,patch,preset,feedback). - Adds interactive/audit tooling for suppressions and scaffolding/onboarding utilities (
init,setup). - Adds self-analysis / self-improvement loop commands for drift’s own repo.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/drift-cli/src/drift_cli/commands/verify.py | Adds drift verify binary verdict command (rich/json output). |
| packages/drift-cli/src/drift_cli/commands/validate_cmd.py | Adds drift validate preflight JSON validation command. |
| packages/drift-cli/src/drift_cli/commands/suppress.py | Adds drift suppress group: list/audit/interactive suppression management. |
| packages/drift-cli/src/drift_cli/commands/setup.py | Adds deprecated interactive config generator (drift setup) used by init --interactive. |
| packages/drift-cli/src/drift_cli/commands/self_improve.py | Adds hidden DSOL self-improvement commands (run/ledger/apply/close). |
| packages/drift-cli/src/drift_cli/commands/self_analyze.py | Adds drift self self-analysis command for drift repo. |
| packages/drift-cli/src/drift_cli/commands/preset.py | Adds drift preset discovery/list/show for built-in + plugin presets. |
| packages/drift-cli/src/drift_cli/commands/patch_cmd.py | Adds drift patch transactional protocol (begin/check/commit). |
| packages/drift-cli/src/drift_cli/commands/init_cmd.py | Adds drift init scaffolding for config/CI/hooks/MCP/editor snippets. |
| packages/drift-cli/src/drift_cli/commands/fix_plan.py | Adds drift fix-plan planning + dismissal/apply/dry-run + progress output. |
| packages/drift-cli/src/drift_cli/commands/feedback.py | Adds drift feedback commands: mark/summary/import/push. |
| packages/drift-cli/src/drift_cli/commands/config_cmd.py | Adds drift config inspection/validate/show/schema utilities. |
| packages/drift-cli/src/drift_cli/commands/completions.py | Adds shell completion generator command. |
| packages/drift-cli/src/drift_cli/commands/calibrate.py | Adds drift calibrate commands (run/explain/status/reset + effort calibration). |
Comment on lines
+74
to
+76
| if [ "${{DRIFT_SKIP_CHECK:-0}}" = "1" ]; then | ||
| echo ">>> [drift] WARN: drift check skipped (DRIFT_SKIP_CHECK=1)" | ||
| exit 0 |
Comment on lines
+540
to
+546
| " [dim]macOS merge target: " | ||
| "~/Library/Application Support/Claude/claude_desktop_config.json[/dim]" | ||
| ) | ||
| console.print( | ||
| " [dim]macOS merge target: " | ||
| "~/Library/Application Support/Claude/claude_desktop_config.json[/dim]" | ||
| ) |
Comment on lines
+104
to
+105
| console.print(f" Declared files: {', '.join(files)}") | ||
| console.print(f" Next step: drift patch check --task-id {task_id}") |
Comment on lines
+48
to
+60
| special_ops = [ | ||
| bool(dismiss_task_id), | ||
| show_dismissed, | ||
| reset_dismissed, | ||
| do_apply, | ||
| dry_run, | ||
| ] | ||
| if sum(1 for enabled in special_ops if enabled) > 1: | ||
| mutually_exclusive = [bool(dismiss_task_id), show_dismissed, reset_dismissed] | ||
| if sum(1 for e in mutually_exclusive if e) > 1: | ||
| raise click.UsageError( | ||
| "Use only one of --dismiss, --show-dismissed, or --reset at a time" | ||
| ) |
Comment on lines
+38
to
+43
| "--output", | ||
| "-o", | ||
| type=click.Path(path_type=Path), | ||
| default=None, | ||
| help="Write JSON output to a file instead of stdout.", | ||
| ) |
|
|
||
| import click | ||
|
|
||
| _SHELLS = ("bash", "zsh", "fish") |
Comment on lines
+19
to
+21
| """Generate shell completion script for drift. | ||
|
|
||
| Supported shells: bash, zsh, fish, powershell. |
Comment on lines
+109
to
+111
| for sig, weight in sorted(p.weights.items(), key=lambda x: x[1], reverse=True): | ||
| bar = "█" * int(weight * 50) + "░" * (10 - int(weight * 50)) | ||
| console.print(f" {bar} {weight:.3f} {sig}") |
Comment on lines
+170
to
+178
| calibrated_at = _parse_iso_ts(calibrated_at_raw) | ||
|
|
||
| pending_marks = len(events) | ||
| if calibrated_at is not None: | ||
| pending_marks = 0 | ||
| for event in events: | ||
| event_ts = _parse_iso_ts(getattr(event, "timestamp", "")) | ||
| if event_ts is not None and event_ts > calibrated_at: | ||
| pending_marks += 1 |
Comment on lines
+355
to
+361
| if custom_weights: | ||
| data["weights"] = custom_weights | ||
|
|
||
| _atomic_write_text( | ||
| actual_config, | ||
| yaml.dump(data, default_flow_style=False, allow_unicode=True, sort_keys=False), | ||
| ) |
| "5": "Monorepo / multiple projects", | ||
| } | ||
|
|
||
| _PROJECT_TYPES = _PROJECT_TYPES_DE # backward-compat alias |
| "3": "No, I write everything myself", | ||
| } | ||
|
|
||
| _AI_USAGE = _AI_USAGE_DE # backward-compat alias |
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Split from #576 (ADR-100 monorepo migration). Part of the PR decomposition into atomic, reviewable units.