# CODEOWNERS — per-subsystem review ownership
#
# Rules match top-to-bottom; the LAST matching rule wins.
# Layout:
#   1. Default owner
#   2. Explicit @aaddrick assignments grouped by logical role
#      (listed even where redundant, so the intent is visible to
#      future collaborators scanning the file)
#   3. Cowork and Nix overrides at the bottom so they stick
#
# Each listed user must be a repo collaborator (Settings →
# Collaborators) with at least read access, or GitHub silently
# ignores them.

# ---- Default: aaddrick owns anything not explicitly claimed ----
*                                       @aaddrick

# ---- Build orchestration ----
# The top-level dispatcher and shared shell utilities.
/build.sh                               @aaddrick
/scripts/_common.sh                     @aaddrick

# ---- Setup (host detection, dependencies, upstream download) ----
/scripts/setup/                         @aaddrick

# ---- Electron patches / minified JS ----
# The regex-driven patches applied to the unpacked app.asar, plus
# the frame-fix wrapper and native-binding stubs that ride along.
/scripts/patches/_common.sh             @aaddrick
/scripts/patches/app-asar.sh            @aaddrick
/scripts/patches/titlebar.sh            @aaddrick
/scripts/patches/claude-code.sh         @aaddrick
/scripts/frame-fix-wrapper.js           @aaddrick
/scripts/claude-native-stub.js          @aaddrick

# ---- Linux desktop integration ----
# Tray, menu bar, and quick-window behavior on Wayland/X11.
/scripts/patches/tray.sh                @aaddrick
/scripts/patches/quick-window.sh        @aaddrick

# ---- Staging (non-cowork) ----
# Electron copy-out, icon processing, locales, SSH helpers.
/scripts/staging/electron.sh            @aaddrick
/scripts/staging/icons.sh               @aaddrick
/scripts/staging/locales.sh             @aaddrick
/scripts/staging/ssh-helpers.sh         @aaddrick

# ---- Packaging formats (deb, rpm, AppImage) + runtime launcher ----
/scripts/packaging/                     @aaddrick
/scripts/launcher-common.sh             @aaddrick

# ---- Distribution & signing ----
# APT/DNF repo publishing, GPG signing, release automation.
# Most of this lives in workflows — gh-pages branch content isn't
# reachable via CODEOWNERS.
/.github/workflows/                     @aaddrick
/scripts/resolve-download-url.py        @aaddrick

# ---- CI / other GitHub metadata ----
/.github/                               @aaddrick

# ---- Docs & style ----
/README.md                              @aaddrick
/CLAUDE.md                              @aaddrick
/STYLEGUIDE.md                          @aaddrick
/docs/                                  @aaddrick

# ---- Testing & release quality ----
# Integration test suite, artifact validation, flag-parsing tests,
# and the --doctor diagnostic tool. Cowork-specific tests stay with
# @RayCharlizard via the override below.
/tests/                                 @sabiut
/scripts/doctor.sh                      @sabiut
/.github/workflows/test-artifacts.yml   @sabiut
/.github/workflows/test-flags.yml       @sabiut
/.github/workflows/tests.yml            @sabiut

# Shared review — either owner can approve.
# TROUBLESHOOTING is mostly the --doctor user-facing guide; lint
# touches everything, so either maintainer can sign off.
/docs/TROUBLESHOOTING.md                @aaddrick @sabiut
/.github/workflows/shellcheck.yml       @aaddrick @sabiut

#===============================================================================
# Overrides — listed last so their assignments stick against the
# broad globs above (/docs/, /.github/, etc.)
#===============================================================================

# ---- Cowork ----
# Electron-side patching, staging, daemon, and integration tests.
/scripts/patches/cowork.sh              @RayCharlizard
/scripts/staging/cowork-resources.sh    @RayCharlizard
/scripts/cowork-vm-service.js           @RayCharlizard
/tests/cowork-*.bats                    @RayCharlizard
/docs/cowork-*.md                       @RayCharlizard

# ---- Nix ----
/flake.nix                              @typedrat
/flake.lock                             @typedrat
/nix/                                   @typedrat
