Skip to content

refactor(architecture): establish application boundaries - #624

Merged
benvinegar merged 3 commits into
mainfrom
refactor/architecture-phase-1-2
Jul 28, 2026
Merged

refactor(architecture): establish application boundaries#624
benvinegar merged 3 commits into
mainfrom
refactor/architecture-phase-1-2

Conversation

@benvinegar

Copy link
Copy Markdown
Member

Summary

  • establish src/app/ as the small executable-composition boundary and share session bootstrap work between startup and UI reloads
  • group VCS helpers under src/core/vcs/ and move the shared Shiki theme catalog into core
  • document source ownership/dependency direction and enforce the core-to-UI import boundary

Validation

  • bun run typecheck
  • bun run lint
  • bun test ./src ./packages ./scripts ./test/cli ./test/session (1,638 passed, 9 skipped)
  • targeted PTY chrome tests for menus and file filtering (3 passed)
  • tmux UI smoke coverage for Git and Jujutsu working-copy diffs

Notes

passively refreshes direct files after an atomic save remains failing on a clean origin/main worktree; it is pre-existing and unrelated to this refactor.

This PR description was generated by Pi using OpenAI GPT-5

@vercel

vercel Bot commented Jul 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hunk-web Ready Ready Preview Jul 28, 2026 3:29pm

Request Review

@greptile-apps

greptile-apps Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Establishes a dedicated application-composition boundary and consolidates startup/reload bootstrapping.

  • Moves startup composition into src/app/ and shares extension, VCS, theme, configuration, and changeset initialization between initial launch and session reloads.
  • Groups VCS implementation helpers under src/core/vcs/ and relocates the shared Shiki theme catalog into src/core/.
  • Documents source ownership and adds a test preventing core modules from importing the UI layer.

Confidence Score: 5/5

The PR appears safe to merge; no concrete behavioral, build, import, or security regressions were identified.

The shared bootstrap preserves the prior launch and reload ordering, moved-module consumers resolve through their new paths, and the architecture boundary is reinforced without altering the underlying VCS or theme implementations.

Important Files Changed

Filename Overview
src/app/sessionBootstrap.ts Centralizes the extension-aware VCS resolution, changeset loading and transformation, theme collection, and session bootstrap fields previously duplicated across launch and reload.
src/app/startup.ts Moves startup composition out of core and delegates shared session initialization while preserving terminal cleanup and startup-notice assembly.
src/ui/AppHost.tsx Replaces the duplicated reload bootstrap pipeline with the shared application service while retaining reload registration, notices, and remount behavior.
scripts/source-boundaries.test.ts Adds a repository check preventing relative imports from core into the UI rendering layer.
src/core/themeCatalog.ts Relocates the unchanged shared Shiki theme catalog from the UI layer into core ownership.
src/core/vcs/git.ts Relocates Git implementation helpers under the VCS namespace with corresponding relative-import updates.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    Main[src/main.tsx] --> Startup[src/app/startup.ts]
    Startup --> Bootstrap[src/app/sessionBootstrap.ts]
    Reload[src/ui/AppHost.tsx] --> Bootstrap
    Bootstrap --> Config[src/core/config.ts]
    Bootstrap --> Extensions[src/extensions]
    Bootstrap --> Loaders[src/core/loaders.ts]
    Loaders --> VCS[src/core/vcs]
    Bootstrap --> UI[src/ui]
    Core[src/core] -. prohibited import .-> UI
Loading

Reviews (1): Last reviewed commit: "chore(release): add empty changeset" | Re-trigger Greptile

@benvinegar
benvinegar merged commit 7ababc3 into main Jul 28, 2026
17 of 18 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