You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS.md
+8-3Lines changed: 8 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,9 +60,9 @@ go run . -o json
60
60
-**`cmd/reposcan`**: CLI entry point, Cobra command setup, flag parsing, orchestration of the scan→filter→render pipeline
61
61
-**`internal/config`**: Configuration types, validation, defaults, TOML loading. The `Config` struct in `types.go` is the central configuration object
62
62
-**`internal/scan`**: Filesystem walking with `filepath.WalkDir`, directory ignore matching using `doublestar` globs, git repo detection
63
-
-**`internal/vcs`**: VCS provider registry, repository metadata, and worker pool for parallel repo state checking across supported VCS types
63
+
-**`internal/vcs`**: VCS provider registry (`Registry`), `Provider` interface for state checks, `ActionProvider` interface for TUI write operations (fetch/push/pull), and worker pool for parallel repo state checking across supported VCS types
64
64
-**`internal/vcs/git`**: Git provider implementation and Git command wrappers for state checks, push, pull, and fetch operations
65
-
-**`internal/vcs/jj`**: Jujutsu provider implementation for detecting and checking jj repositories
65
+
-**`internal/vcs/jj`**: Jujutsu provider implementation for detecting and checking jj repositories. `commands.go` contains exported jj command wrappers and helpers; `jj.go` holds the `Provider` struct and `CheckRepoState` logic
66
66
-**`internal/render`**: Three render paths:
67
67
-`stdout`: Plain table (using `charmbracelet/lipgloss`) or JSON output
68
68
-`file`: Writes JSON reports to disk
@@ -89,7 +89,7 @@ Built with Bubble Tea (Elm architecture):
89
89
-**Focused Model Pattern**: Different input modes (table navigation, filter text input, help popup) each implement `focusedModel` interface to handle updates and keybindings
90
90
-**Update Flow**: Messages route through focused model → update appropriate state → return new model + commands
-**Git Operations**: TUI can trigger git push/pull/fetch via messages that execute git commands and update state
92
+
-**VCS Operations**: TUI dispatches fetch/push/pull through the `vcs.ActionProvider` interface via the `Registry`, making actions VCS-agnostic. Providers that don't implement `ActionProvider` (e.g., jj for push/pull) surface an "unsupported action" alert. Action results and repo refresh are handled through `vcsActionResultMsg` and `vcsRefreshRepoResultMsg` messages
93
93
94
94
## Important Implementation Notes
95
95
@@ -117,5 +117,10 @@ Tests use standard Go testing:
117
117
- Flag parsing tests in `cmd/reposcan/*_test.go`
118
118
- Scan behavior tests in `internal/scan/scan_test.go`
119
119
- File render tests in `internal/render/file/file_test.go`
120
+
- jj provider tests in `internal/vcs/jj/jj_test.go` (require `jj` and `git` binaries — skipped when unavailable)
121
+
- jj scan integration tests in `internal/scanGenerator_jj_test.go` (end-to-end filter and JSON field tests)
122
+
- VCS registry tests in `internal/vcs/registry_test.go` (ActionProvider dispatch)
123
+
- TUI table/column tests in `internal/render/tui/repostable/ui_test.go`
124
+
- Stdout table rendering tests in `internal/render/stdout/scanReport_test.go`
120
125
121
126
When writing tests, prefer table-driven tests for multiple scenarios.
0 commit comments