Skip to content

feat: add drift-cli fix, calibrate, validate commands (ADR-100 phase 5b-b)#718

Open
mick-gsk wants to merge 1 commit into
mainfrom
split/576-713b-cli-fix-calibrate-cmds
Open

feat: add drift-cli fix, calibrate, validate commands (ADR-100 phase 5b-b)#718
mick-gsk wants to merge 1 commit into
mainfrom
split/576-713b-cli-fix-calibrate-cmds

Conversation

@mick-gsk
Copy link
Copy Markdown
Owner

@mick-gsk mick-gsk commented May 3, 2026

Split from #576 (ADR-100 monorepo migration). Part of the PR decomposition into atomic, reviewable units.

Copilot AI review requested due to automatic review settings May 3, 2026 17:36
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@mick-gsk mick-gsk closed this May 4, 2026
@mick-gsk mick-gsk deleted the split/576-713b-cli-fix-calibrate-cmds branch May 4, 2026 05:09
@mick-gsk mick-gsk restored the split/576-713b-cli-fix-calibrate-cmds branch May 4, 2026 05:14
@mick-gsk mick-gsk reopened this May 4, 2026
@mick-gsk mick-gsk added release:feature Include this PR under Features in release notes size/XL Diff ≥ 500 lines — consider splitting labels May 4, 2026
@github-actions github-actions Bot added agent-review-requested Agent review was requested automatically lane/standard Fixes and features — standard review path labels May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-review-requested Agent review was requested automatically lane/standard Fixes and features — standard review path release:feature Include this PR under Features in release notes size/XL Diff ≥ 500 lines — consider splitting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants