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: CHANGELOG.md
+30-1Lines changed: 30 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,35 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6
6
7
7
## [Unreleased]
8
8
9
+
### Added
10
+
11
+
-**Operator UI — comprehensive writer + operator dashboard** at `/operator/` (`OPERATOR_UI_ENABLED=true`). Five tabs (Overview, Webhooks, Audit, Workflows, System), sticky status bar, dark mode, keyboard shortcuts, shareable URLs, and a writer/operator mode toggle persisted to localStorage.
12
+
-**GitHub PAT authentication** — users sign in with their personal access token; role is derived from their permission on `OPERATOR_AUTH_REPO` (admin/maintain → operator, write/triage/read → writer). Operator actions (replay, release, AI settings) require an explicit admin or maintain grant, since most writers have `write` on the auth repo. Replay additionally enforces read access on the source repo for that specific delivery.
13
+
-**AI rule suggester** — paste a source path and desired target state, receive a suggested workflow rule with self-verification via the in-process `PatternMatcher`. Two providers supported:
14
+
-**Anthropic (hosted)** — default for Cloud Run. API key loaded from Secret Manager via `ANTHROPIC_API_KEY_SECRET_NAME`. No infra required; operators switch between Haiku / Sonnet / Opus from the UI.
15
+
-**Ollama (local)** — for dev or self-hosted deployments. UI manages connection, model pulls, deletes, and active-model switching without a redeploy.
16
+
-**Writer-facing features** — workflow browser with per-rule coverage, PR lookup by URL, recent copies feed, file match tester (with clear button and Python-style `(?P<name>)` regex translation for in-browser use), PR timeline, and in-app help overlay.
17
+
-**Per-delivery log viewer** — context-tagged ring buffer captures logs per webhook delivery, surfaced in an audit drawer alongside the trace and outcome summary.
18
+
-**Audit event enrichment** — `processed_ok` traces now include destination repo(s), files matched / uploaded / failed, and commit SHA.
19
+
-**Startup banner** — Operator UI, auth repo, AI model, and AI base URL are now surfaced when the app boots (local and Cloud Run).
20
+
21
+
### Changed
22
+
23
+
-**MongoDB audit logging enabled in production** — the Cloud Run deploy previously forced `AUDIT_ENABLED=false`; it is now `true`, aligning with the v0.3.0 "enabled by default" change.
24
+
-**Operator auth hardened** — token-based auth (`OPERATOR_UI_TOKEN`) removed entirely; GitHub PAT is the only supported mechanism. `OPERATOR_UI_ENABLED=true` now requires `OPERATOR_AUTH_REPO` at config load (validated in `validateOperatorAuth`).
25
+
-**`createPullRequest` skipped for empty commits** — `commitFilesToBranch` now returns an `errTreeUnchanged` sentinel so `addFilesViaPR` no longer calls the GitHub PR API with an unchanged tree (previously 422'd).
26
+
-**MongoDB driver v2 ObjectID decoding** — audit reads set `ObjectIDAsHexString: true` to avoid "error decoding key `_id`" on queries.
27
+
28
+
### Fixed
29
+
30
+
-**gosec G107 / G704 SSRF findings** — GitHub API URL construction in `services/operator_auth.go` now validates path components against strict RE2-compatible whitelists (`ghUsernameRe`, `ghRepoNameRe`) and escapes them with `url.PathEscape` before request construction; `slack_notifier.go``#nosec` annotation extended to cover `NewRequestWithContext`.
31
+
-**Keyboard-shortcut overlay wouldn't close** — `.help-bg[hidden]` now wins over the base `display:flex`.
32
+
-**File match tester returned no matches for Java files** — JavaScript `RegExp` does not support Python-style `(?P<name>)` named groups; the tester now rewrites `(?P<` → `(?<` before compilation.
33
+
34
+
### Security
35
+
36
+
-**Token auth removed** — the operator UI no longer accepts a shared bearer token; all access is per-user via GitHub PAT with repo-scoped permission checks.
37
+
9
38
## [v0.3.1] - 2026-04-30
10
39
11
40
### Fixed
@@ -14,7 +43,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
14
43
15
44
### Security
16
45
17
-
-**Removed accidentally committed secrets and config files** from the repository.
46
+
-**Removed unneeded config files** from the repository.
-**Thread-Safe** - Concurrent webhook processing with proper state management
31
31
32
+
### Operator UI
33
+
-**Web dashboard at `/operator/`** - Five-tab UI (Overview, Webhooks, Audit, Workflows, System) with dark mode, keyboard shortcuts, and shareable URLs
34
+
-**GitHub PAT authentication** - Users sign in with their personal access token; role is derived from their permission on a configured auth repo (`admin`/`maintain` → operator, `write`/`triage`/`read` → writer)
35
+
-**Per-repo replay authorization** - Replay requires the caller's PAT to have read access to the source repo of the webhook being replayed
-**AI rule suggester** - Paste a source/target pair; get a generated copier rule self-verified against the in-process pattern matcher. Two providers: [Anthropic](https://www.anthropic.com/) (hosted, default in prod via the Grove Foundry APIM gateway) or [Ollama](https://ollama.com) (local, for dev)
38
+
32
39
## 🚀 Quick Start
33
40
34
41
### Prerequisites
@@ -385,6 +392,47 @@ Get performance metrics:
385
392
curl http://localhost:8080/metrics
386
393
```
387
394
395
+
## Operator UI
396
+
397
+
The operator UI is a web dashboard served from `/operator/` for diagnosing webhook processing, replaying failed deliveries, browsing workflows, and generating copier rules with AI assistance.
398
+
399
+
### Enabling the UI
400
+
401
+
Set the required env vars:
402
+
403
+
```yaml
404
+
OPERATOR_UI_ENABLED: "true"
405
+
OPERATOR_AUTH_REPO: "your-org/some-repo" # user permissions here determine role
406
+
OPERATOR_REPO_SLUG: "your-org/some-repo" # optional; enables audit-row deep links
407
+
```
408
+
409
+
**Startup fails** if `OPERATOR_UI_ENABLED=true` without `OPERATOR_AUTH_REPO` — this prevents an accidentally-open operator UI.
410
+
411
+
### Authentication and roles
412
+
413
+
Each user authenticates with their own **GitHub Personal Access Token**. Paste the PAT into the sign-in prompt; the server checks the user's permission on `OPERATOR_AUTH_REPO` and assigns a role:
`write`maps to writer (not operator) so typical docs contributors with repo write access can't replay deliveries or cut releases — those need an explicit `admin` / `maintain` grant.
422
+
423
+
On top of the role, **replay is repo-scoped**: the user's PAT must also have read access to the source repo of the webhook being replayed.
424
+
425
+
### AI rule suggester
426
+
427
+
The operator UI includes an LLM-backed helper that takes a source/target file pair and returns a generated copier workflow rule, self-verified against the in-process pattern matcher before display.
428
+
429
+
Two providers are supported via `LLM_PROVIDER`:
430
+
431
+
- **`anthropic`** (default in Cloud Run): calls the Anthropic Messages API. For MongoDB deployments this routes through the Grove Foundry APIM gateway — set `LLM_BASE_URL=https://grove-gateway-prod.azure-api.net/grove-foundry-prod/anthropic` and load the gateway key from Secret Manager via `ANTHROPIC_API_KEY_SECRET_NAME`.
432
+
- **`ollama`** (default for local dev): runs against a local Ollama instance at `http://localhost:11434`. Connect, pull models, and switch the active model from the UI's System → AI settings panel without a redeploy.
433
+
434
+
Smoke-test the LLM provider end-to-end with [`cmd/test-llm`](cmd/test-llm/README.md).
435
+
388
436
## Audit Logging
389
437
390
438
When enabled, all operations are logged to MongoDB:
@@ -598,4 +646,6 @@ See [DEPLOYMENT.md](./docs/DEPLOYMENT.md) for the complete deployment and rollba
598
646
599
647
-**[Config Validator](cmd/config-validator/README.md)** - CLI tool for validating configs
600
648
-**[Test Webhook](cmd/test-webhook/README.md)** - CLI tool for testing webhooks
649
+
-**[Test PEM](cmd/test-pem/README.md)** - CLI tool for verifying the GitHub App private key
650
+
-**[Test LLM](cmd/test-llm/README.md)** - CLI tool for smoke-testing the AI rule suggester's LLM provider
601
651
-**[Scripts](scripts/README.md)** - Helper scripts for deployment, testing, and releases
Smoke-test the operator UI's LLM client against the configured provider.
4
+
5
+
## Purpose
6
+
7
+
Verify end-to-end that:
8
+
9
+
- The provider URL and API key are reachable from your machine
10
+
- Auth headers are accepted (direct Anthropic API or APIM-fronted gateway)
11
+
- The active model responds to a real rule-suggester prompt and returns valid JSON
12
+
13
+
Useful after rotating `ANTHROPIC_API_KEY`, changing `LLM_BASE_URL`, or pointing at a new gateway.
14
+
15
+
## Build
16
+
17
+
```bash
18
+
go build -o test-llm ./cmd/test-llm
19
+
```
20
+
21
+
## Usage
22
+
23
+
```bash
24
+
./test-llm [-env <path>] [-timeout <duration>]
25
+
```
26
+
27
+
The tool reads standard env vars — `LLM_PROVIDER`, `LLM_BASE_URL`, `LLM_MODEL`, `ANTHROPIC_API_KEY` — from the process environment. Use `-env` to load a `.env`-style file first. Inline env vars on the command line override file values.
0 commit comments