Skip to content

Commit 2b02e17

Browse files
committed
docs(agents): clarify vcs provider interfaces and expand test documentation
1 parent 357c6a0 commit 2b02e17

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

AGENTS.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ go run . -o json
6060
- **`cmd/reposcan`**: CLI entry point, Cobra command setup, flag parsing, orchestration of the scan→filter→render pipeline
6161
- **`internal/config`**: Configuration types, validation, defaults, TOML loading. The `Config` struct in `types.go` is the central configuration object
6262
- **`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
6464
- **`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
6666
- **`internal/render`**: Three render paths:
6767
- `stdout`: Plain table (using `charmbracelet/lipgloss`) or JSON output
6868
- `file`: Writes JSON reports to disk
@@ -89,7 +89,7 @@ Built with Bubble Tea (Elm architecture):
8989
- **Focused Model Pattern**: Different input modes (table navigation, filter text input, help popup) each implement `focusedModel` interface to handle updates and keybindings
9090
- **Update Flow**: Messages route through focused model → update appropriate state → return new model + commands
9191
- **View**: Composed vertically: header → body (table + optional filter/details) → footer (keybindings)
92-
- **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
9393

9494
## Important Implementation Notes
9595

@@ -117,5 +117,10 @@ Tests use standard Go testing:
117117
- Flag parsing tests in `cmd/reposcan/*_test.go`
118118
- Scan behavior tests in `internal/scan/scan_test.go`
119119
- 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`
120125

121126
When writing tests, prefer table-driven tests for multiple scenarios.

0 commit comments

Comments
 (0)