Skip to content

feat(cli): add cairn onboard command for brownfield orphan grouping (#73) - #79

Merged
George-RD merged 1 commit into
devfrom
05-11-feat_cli_add_cairn_onboard_command_for_brownfield_orphan_grouping_73_
May 11, 2026
Merged

feat(cli): add cairn onboard command for brownfield orphan grouping (#73)#79
George-RD merged 1 commit into
devfrom
05-11-feat_cli_add_cairn_onboard_command_for_brownfield_orphan_grouping_73_

Conversation

@George-RD

Copy link
Copy Markdown
Collaborator

No description provided.

@coderabbitai

coderabbitai Bot commented May 11, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 07b0ef4d-10be-43a4-813f-e39ad7c0c447

📥 Commits

Reviewing files that changed from the base of the PR and between 9c2a144 and 6a57ebd.

📒 Files selected for processing (6)
  • src/brownfield/heuristics.rs
  • src/brownfield/mod.rs
  • src/brownfield/onboard.rs
  • src/cli/commands.rs
  • src/cli/mod.rs
  • tests/kernel.rs

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added cairn onboard command to analyze orphaned files, group them by directory, and suggest ignore patterns or blueprint nodes; outputs human-readable reports and JSON including per-cluster suggestions and total orphaned file count.
  • Tests

    • Added an integration test validating grouping, classification, human output, JSON shape, and non-empty ignore/node suggestions.

Walkthrough

This PR adds a brownfield onboard feature: it clusters orphan findings by parent directory, classifies each cluster as an ignore-glob or blueprint-node candidate, renders human or JSON reports, exposes the onboard module, updates heuristics visibility, wires a new cairn onboard CLI command, and adds unit + integration tests.

Changes

Orphan Analysis and Onboarding

Layer / File(s) Summary
Data Models
src/brownfield/onboard.rs
New OnboardReport, OrphanCluster, and ClusterSuggestion types define grouped orphan findings and suggested actions.
Analysis Pipeline
src/brownfield/onboard.rs
analyze filters orphan findings, deduplicates paths, groups by computed parent directory, and computes total_orphaned_files.
Parent Dir & Classification
src/brownfield/onboard.rs
parent_dir computes a directory (default "." for root); classify matches IGNORE_PATTERNS case-insensitively for ancestor-prefix ignores or derives node IDs.
Output Rendering
src/brownfield/onboard.rs
render_human emits conditional "Suggested ignores" and "Suggested blueprint nodes"; render_json emits a JSON envelope with per-cluster objects and aggregated suggestion arrays; capitalize helps format module names.
Module Exposure & Docs
src/brownfield/mod.rs
Adds pub mod onboard; and updates module documentation to describe Phase 9 Brownfield extraction scope.
Heuristics Visibility
src/brownfield/heuristics.rs
path_derived_id visibility changed to pub(crate) to enable reuse by the onboard logic.
CLI Command Wiring
src/cli/commands.rs, src/cli/mod.rs
Adds run_onboard_command which loads the project, runs brownfield::onboard::analyze, and renders human/JSON output; CLI dispatch routes "onboard" to this handler.
Unit & Integration Tests
src/brownfield/onboard.rs, tests/kernel.rs
Unit tests validate grouping, ignore/node classification, JSON shape, and human output; integration test runs cairn onboard on a fixture and checks both human and --json outputs.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 I hopped through orphaned paths in springtime light,

Grouped their homes and named each lost sight.
Globs hush the clutter, nodes find their name,
A blueprint whispers: "Organize, reclaim."
Cheers from a rabbit — tidy code feels right.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 05-11-feat_cli_add_cairn_onboard_command_for_brownfield_orphan_grouping_73_

Comment @coderabbitai help to get the list of available commands and usage tips.

George-RD commented May 11, 2026

Copy link
Copy Markdown
Collaborator Author

@George-RD
George-RD changed the base branch from 05-11-fix_cli_restore_neighbourhood_fix_and_scan_exclusion_tests_lost_in_stack_merge_65_71_ to graphite-base/79 May 11, 2026 10:10
@George-RD
George-RD force-pushed the 05-11-feat_cli_add_cairn_onboard_command_for_brownfield_orphan_grouping_73_ branch from 1245c6d to 6a57ebd Compare May 11, 2026 10:10
@George-RD
George-RD changed the base branch from graphite-base/79 to dev May 11, 2026 10:10
@George-RD
George-RD merged commit 86da8a5 into dev May 11, 2026
1 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant