Skip to content

ref(jay): improve jay command architecture (#415)#418

Merged
plastikfan merged 1 commit intomainfrom
ref/improve-jay-architecture
Mar 23, 2026
Merged

ref(jay): improve jay command architecture (#415)#418
plastikfan merged 1 commit intomainfrom
ref/improve-jay-architecture

Conversation

@plastikfan
Copy link
Copy Markdown
Contributor

@plastikfan plastikfan commented Mar 23, 2026

Summary by CodeRabbit

  • Refactor

    • Reorganized package structure for improved code organization
    • Refactored UI event system to report node visitations and traversal completions through event-based callbacks
    • Enhanced traversal orchestration architecture with new coordinator for improved execution flow
  • Chores

    • Consolidated module import paths for consistency
    • Updated text formatting (em dashes to hyphens) in documentation and output

@plastikfan plastikfan self-assigned this Mar 23, 2026
@plastikfan plastikfan added the refactor Refactor code label Mar 23, 2026
@plastikfan plastikfan linked an issue Mar 23, 2026 that may be closed by this pull request
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 23, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

The PR implements a significant architectural refactoring: relocating the locale package under src/, renaming the cfg package to bedrock, introducing a new controller package with a Coordinator for orchestrating traversals, establishing a new event-based report package, and refactoring command execution to delegate to the coordinator while updating UI callbacks from direct callbacks to event-driven notifications.

Changes

Cohort / File(s) Summary
Locale package relocation
src/agenor/.../*.go, src/agenor/internal/.../ (multiple), src/agenor/pref/facade.go, src/agenor/scaffold.go, src/agenor/synchronise.go, src/agenor/internal/filtering/.../*.go (multiple), src/agenor/internal/kernel/.../*.go (multiple), src/agenor/internal/persist/.../*.go, src/internal/third/bus/broker.go, src/locale/messages-errors_test.go, src/cmd/jay/CLAUDE.md
Updated import paths from github.com/snivilised/jaywalk/locale to github.com/snivilised/jaywalk/src/locale across ~35 files (production code, tests, and documentation).
Package rename: cfg → bedrock
src/app/bedrock/bedrock_suite_test.go, src/app/bedrock/doc.go, src/app/bedrock/fixtures_test.go, src/app/bedrock/flags.go, src/app/bedrock/flags_test.go, src/app/bedrock/helpers_test.go, src/app/bedrock/loader.go, src/app/bedrock/loader_test.go, src/app/bedrock/types.go, src/app/bedrock/validate.go, src/app/bedrock/validate_test.go
Renamed Go package from cfg to bedrock across all bedrock module files; updated test packages from cfg_test to bedrock_test; updated error message prefixes in loader; updated all test imports/usages to reference bedrock instead of cfg.
New controller package
src/app/controller/coordinator.go, src/app/controller/dispatch.go, src/app/controller/requests.go
Introduced new controller package with Coordinator type (New, ExecutePrime, ExecuteResume methods), request structures (Request, PrimeRequest, ResumeRequest), node dispatch handler (handleNode, executeAction, executePipeline stubs), and traversal orchestration via shared execute method.
New report package
src/app/report/doc.go, src/app/report/report-defs.go
Introduced new report package defining event-based types for UI rendering: DisplayEvent, NeutralEvent, ActionEvent, PipelineEvent, and Traversal structures with embedded node/error context and traversal metrics.
UI refactoring: event model
src/app/ui/manager.go, src/app/ui/linear.go, src/app/ui/manager_test.go
Replaced Manager interface callback model (OnNode, Info/Warn/Error) with event-based methods (OnNodeEvent, OnActionEvent, OnPipelineEvent, OnComplete); updated linear implementation to format output from events; updated tests to verify new event handlers.
Command infrastructure refactoring
src/app/command/bootstrap.go, src/app/command/run-cmd.go, src/app/command/walk-cmd.go, src/app/command/options.go, src/app/command/param-sets.go
Updated bootstrap to create/store coordinator, change config type to bedrock.Config, delegate traversal to coordinator; refactored run-cmd and walk-cmd to build requests, resolve options/strategies, and call coordinator.ExecutePrime/ExecuteResume; added new options.go with buildOptions and resolveResumeStrategy helper functions; reformatted import style in param-sets.go.
Minor updates
scripts/nolint-revive-ginkgo-tests.sh, tools/inspect/main.go
Updated em dashes to hyphens in shell script output message and CLI usage/comment text.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

The changes span multiple heterogeneous concerns: widespread import relocations (~35 files), complete package rename with cascading updates (cfg → bedrock), three new packages with non-trivial orchestration logic (controller, report), significant command flow refactoring (run-cmd/walk-cmd), and UI interface redesign. Review requires careful verification of import consistency, package naming coherence, coordinator integration correctness, and event model implementation across ui/linear.

Possibly related issues

  • Architectural improvements to jay command #415: The architectural refactoring of command orchestration (new coordinator/request patterns, event-based UI, control flow restructuring) directly implements the improvements proposed in this issue.

Possibly related PRs

  • chore: update claude file #416: Both PRs update src/cmd/jay/CLAUDE.md documentation with related content changes (bedrock and src/locale reference updates).

Poem

🐰 Hark! The locale hops to src/'s bright embrace,
While cfg dons the badge of bedrock's grace,
A Coordinator springs forth to orchestrate the dance,
Events bloom where callbacks stood—a grand enhancement!
The UI whispers softly now, in reports so fine.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 62.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'ref(jay): improve jay command architecture' accurately summarizes the main objective of this pull request, which involves significant refactoring of the jay/command architecture including package reorganization, import path updates, and introduction of new controller/report packages.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 ref/improve-jay-architecture

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@plastikfan plastikfan merged commit a4ab0f2 into main Mar 23, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Refactor code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Architectural improvements to jay command

1 participant