nisse-review: repository patterns, and the wall checked every round #153

Merged
dev-agent merged 1 commits from review-repo-patterns into main 2026-10-16 22:15:28 +00:00
Collaborator

Found at bring-up: nisse-review started "reading no repositories". Gitea's /user/repos leaves out a public repository's Read collaborators, so dev/nisse never appeared, even after nisse-review was added as a Read collaborator. Settled with the operator: option (a), the configuration decides for public repositories.

Changes

  • repositories holds patterns: dev/nisse, dev/*, */*. They're matched against every repository the account can read, public ones included: an organization's (or user's) list for owner/*, Gitea's search for */*. Unset, it uses /user/repos as before. A configured repository it can't read is left out, with an access.unreadable oplog line; an unknown owner gets access.no_owner. Patterns that aren't owner/name are config errors.
  • The read-only wall (R3) is checked every round, not only at startup. If push or admin is granted while it runs, the scheduler raises AccessRefused and nisse-review exits 3 instead of reviewing on.
  • nisse-core GiteaClient: GiteaNotFound (a GiteaError) for 404s, owner_repositories(owner) (/orgs/…/repos, then /users/…/repos) and visible_repositories() (/repos/search).
  • Docs: R1 and R3 in the architecture, the M7.3 notes in the plan, and the example config.

Tests

  • Patterns reach public repositories missing from /user/repos, and a round picks up only the matching ones.
  • An unreadable configured repository and an unknown owner are left out and logged.
  • Write access granted mid-run stops the round, with nothing reviewed.
  • Pattern validation in the config.
  • Gitea: the org-then-user fallback, the search listing, and a 404 raising GiteaNotFound.
  • Mutant: dropping the per-round check fails the mid-run test.

After merge, I'll restart the bring-up with repositories: ["dev/*"].

🤖 Generated with Claude Code

https://claude.ai/code/session_01J5Utyfzw7gF7UhjRDEtjTk

Found at bring-up: nisse-review started "reading no repositories". Gitea's `/user/repos` leaves out a public repository's Read collaborators, so `dev/nisse` never appeared, even after `nisse-review` was added as a Read collaborator. Settled with the operator: option (a), the configuration decides for public repositories. **Changes** - **`repositories` holds patterns:** `dev/nisse`, `dev/*`, `*/*`. They're matched against every repository the account can read, public ones included: an organization's (or user's) list for `owner/*`, Gitea's search for `*/*`. Unset, it uses `/user/repos` as before. A configured repository it can't read is left out, with an `access.unreadable` oplog line; an unknown owner gets `access.no_owner`. Patterns that aren't `owner/name` are config errors. - **The read-only wall (R3) is checked every round,** not only at startup. If push or admin is granted while it runs, the scheduler raises `AccessRefused` and nisse-review exits 3 instead of reviewing on. - **nisse-core `GiteaClient`:** `GiteaNotFound` (a `GiteaError`) for 404s, `owner_repositories(owner)` (`/orgs/…/repos`, then `/users/…/repos`) and `visible_repositories()` (`/repos/search`). - **Docs:** R1 and R3 in the architecture, the M7.3 notes in the plan, and the example config. **Tests** - Patterns reach public repositories missing from `/user/repos`, and a round picks up only the matching ones. - An unreadable configured repository and an unknown owner are left out and logged. - Write access granted mid-run stops the round, with nothing reviewed. - Pattern validation in the config. - Gitea: the org-then-user fallback, the search listing, and a 404 raising `GiteaNotFound`. - Mutant: dropping the per-round check fails the mid-run test. After merge, I'll restart the bring-up with `repositories: ["dev/*"]`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01J5Utyfzw7gF7UhjRDEtjTk
dev-agent added 1 commit 2026-10-16 21:41:54 +00:00
nisse-review: repository patterns, and the wall checked every round
CI / checks (push) Skipped
CI / checks (pull_request) Successful in 1m56s
CI / e2e (pull_request) Successful in 9m52s
2139ddd05c
At bring-up, nisse-review read no repositories: Gitea's /user/repos leaves
out a public repository's Read collaborators, so dev/nisse never showed up.
`repositories` now holds patterns (dev/nisse, dev/*, */*) matched against
every repository the account can read, public ones included (an
organization's or user's list, or the instance's search); unset, it is
/user/repos as before. A configured repository it can't read is left out
with an oplog line.

The read-only wall (R3) is checked every round, not only at startup: an
account granted push or admin while running stops (exit 3) rather than
review on.

nisse-core's Gitea client gains GiteaNotFound for 404s, owner_repositories
and visible_repositories.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J5Utyfzw7gF7UhjRDEtjTk
dongar approved these changes 2026-10-16 21:49:23 +00:00
dev-agent merged commit 86f899006a into main 2026-10-16 22:15:28 +00:00
dev-agent deleted branch review-repo-patterns 2026-10-16 22:15:28 +00:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dev/nisse#153