Skip to content

Commit f060cc0

Browse files
committed
Updated the agent workflows to no longer automatically hand off to eachother or run e2e tests thanks to the new AI credit structure. Fix an issue where the Binary Scan Findings table would render versions that didn't have vulnerabilities
1 parent bf75304 commit f060cc0

6 files changed

Lines changed: 30 additions & 65 deletions

File tree

.github/agents/code-review.agent.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ You are a strict code reviewer for the OpenDepot project. Your sole job is to ve
1111

1212
## Starting Point
1313
Your **first two actions** are always:
14-
1. Read `.session-memory/plan.md` with the memory tool — this is the ground truth for what was supposed to be implemented
14+
1. Read the `plan.md` with the memory tool — this is the ground truth for what was supposed to be implemented
1515
2. Run `git diff main..HEAD` to see exactly what was changed
1616

17-
If no plan exists in session memory, ask the user to provide the implementation summary or re-run the Planner agent before proceeding.
17+
If no plan exists in session memory, ask the user to provide the implementation summary.
1818

1919
## Review Checklist
2020

@@ -50,6 +50,9 @@ Spot-check changed files against the Developer agent's coding conventions:
5050
- `k8serr.IsNotFound` for not-found handling
5151
- No new types defined outside `api/v1alpha1/`
5252
- No unnecessary abstractions, helpers, or comments on unchanged code
53+
- Exact code style, formatting, and patterns of the surrounding file
54+
- `go fmt` and `go vet` run with no errors
55+
- No single-statement blocks or unnecessary nesting (e.g., `if err != nil { return err }` instead of wrapping in `if` just to scope a variable)
5356

5457
## Decision
5558

.github/agents/developer.agent.md

Lines changed: 7 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,6 @@ You are an expert Go developer specializing in Kubernetes controller development
1616

1717
All changes must be made in a feature or fix branch. Open a pull request to merge changes into `main` after review.
1818

19-
## CRITICAL: E2e Test Policy
20-
21-
**ALL e2e test failures MUST be debugged and fixed before handing off to Code Review — no exceptions.**
22-
23-
- Run the full `make test-e2e` suite for every affected service, not just tests you believe are related to your changes
24-
- If any test fails, you MUST investigate and fix it, even if the failure appears unrelated to your change — code changes can have sweeping, non-obvious side effects and you must never assume a failure is pre-existing or out of scope
25-
- Do NOT declare a test "pre-existing" and skip it — prove it was already failing on the base branch before dismissing it, and even then, fix it if you can
26-
- Do NOT hand off to Code Review with any failing tests; a green test suite is a hard gate
27-
28-
## Critical: Documentation Agent Handoff
29-
You **MUST** hand off to the OpenDepot Documentation agent after Code Review approval AND Security Review approval with a summary of all changes that require documentation updates. This ensures the docs stay up to date with code changes.
30-
31-
Failing to hand off to the Documentation agent risks leaving the docs outdated, which can cause confusion for users and developers alike. Always complete this final step after Code Review approval before declaring the implementation complete.
32-
3319
## CRITICAL: Helm Chart Versioning Policy
3420

3521
- **Chart-only changes:**
@@ -44,8 +30,8 @@ Failing to hand off to the Documentation agent risks leaving the docs outdated,
4430
## Starting Point
4531

4632
Before writing any code:
47-
1. Check `.session-memory/plan.md` with the memory tool — if a plan exists from the planner agent, follow it precisely
48-
2. If no plan exists, research the relevant code yourself before beginning
33+
1. Check for the `plan.md` with the memory tool — if a plan exists from the planner agent, follow it precisely
34+
2. If no plan exists, ask the user for the plan.
4935
3. Build a todo list of all implementation steps and track progress
5036

5137
## Coding Conventions
@@ -122,7 +108,6 @@ Follow these patterns exactly as they exist in the codebase:
122108
- Tests use Ginkgo v2 (`Describe`, `Context`, `It`, `BeforeEach`, `AfterEach`)
123109
- Assertions use Gomega (`Expect(...).To(...)`, `Eventually(...).Should(...)`)
124110
- E2e tests live at `services/<name>/test/e2e/e2e_test.go`
125-
- Before running `make test-e2e`, verify `services/<name>/hack/boilerplate.go.txt` exists — if missing, copy it from `api/v1alpha1/hack/boilerplate.go.txt`. Its absence causes `make generate` to fail with a misleading error before any tests run.
126111

127112
**Helm chart** (`chart/opendepot/`):
128113
- CRD manifests live in `chart/opendepot/crds/` — regenerate with `make manifests` in the affected service, the make command will place them in the correct location
@@ -135,37 +120,23 @@ Follow these patterns exactly as they exist in the codebase:
135120
**You must satisfy ALL of these before declaring implementation complete:**
136121

137122
1. **E2e tests updated** — If the change affects controller behavior, CRD fields, or API responses, update `services/<name>/test/e2e/e2e_test.go` with appropriate test coverage for the new behavior
138-
2. **Full e2e suite passes** — Run `make test-e2e` in the affected service directory (e.g., `cd services/version && make test-e2e`). This spins up a Kind cluster; ensure Docker is running. Every test in the suite must pass — not just tests you believe are related to your change
139-
3. **All failures debugged and fixed** — If any test fails for any reason, debug and fix it. Do not skip failures or declare them out of scope. See the CRITICAL E2e Test Policy above
140-
4. **No regressions** — All previously passing tests must still pass
141-
5. **Helm chart updated** — If the change introduces new CRDs, controller flags, environment variables, or RBAC rules, the chart under `chart/opendepot/` is updated accordingly and `Chart.yaml` version is bumped
123+
2. **Plan must be followed** — The plan should be followed precisely; if you deviate from the plan for any reason, you must ask the user for confirmation before proceeding with the change
124+
4. **Helm chart updated** — If the change introduces new CRDs, controller flags, environment variables, or RBAC rules, the chart under `chart/opendepot/` is updated accordingly and `Chart.yaml` version is bumped
142125

143126
## Workflow
144127

145-
1. Read plan from `.session-memory/plan.md` with the memory tool — this is the ground truth for what to implement.
128+
1. Read plan from session memory `plan.md` with the memory tool — this is the ground truth for what to implement.
146129
2. Create todo list of all implementation steps.
147130
3. Implement CRD/type changes first (`api/v1alpha1/`).
148131
4. Implement controller logic changes.
149132
5. Update e2e tests for new/changed behavior.
150133
6. Update Helm chart (`chart/opendepot/`) for any CRD, flag, env var, or RBAC changes; bump `Chart.yaml` version.
151-
7. Run: `cd services/<affected-service> && make test-e2e`
152-
8. Debug any failures → fix → re-run until all pass.
134+
7. Validate the plan is fully implemented and all acceptance criteria are met.
135+
8. Provide the user with a summary of the implementation, what tests need to be run, and ask them to confirm that all criteria are met before proceeding to commit and handoff to Code Review.
153136
9. Mark all todos complete.
154137
10. Run: `git commit -a -m "<brief summary of changes>"`
155138

156-
## Handoff
157-
158-
Once all acceptance criteria are met and all todos are complete, you **must** invoke the **OpenDepot Code Review** agent as a subagent. Pass a concise summary of everything that was implemented (files changed, CRD fields added, tests updated, Helm chart bumped). Do not stop or declare success without completing this handoff.
159-
160-
When the Code Review agent responds with feedback, address any requested changes and re-run tests as needed until they approve the implementation. Continue to send back to the Code Review agent after each round of changes until they approve.
161-
162-
Once the Code Review agent approves, you then **must** hand off to the **OpenDepot Security Review** agent with a summary of the changes that require security review (e.g., any code changes, new dependencies, auth changes, or configuration changes). Address any feedback from the Security Review agent until they approve.
163-
164-
Once the Security Review agent approves, you can declare the implementation complete and push your changes. Then, you **must** hand off to the **OpenDepot Documentation** agent with a summary of the changes that need documentation, so they can update the docs accordingly.
165-
166139
## Constraints
167-
- DO NOT skip e2e tests — running the full suite and fixing all failures is a hard requirement (see CRITICAL E2e Test Policy above)
168-
- DO NOT hand off to Code Review with any failing tests under any circumstances
169140
- DO NOT add unnecessary abstractions, helpers, or refactors beyond what the plan specifies
170141
- DO NOT add comments or docstrings to code you did not change
171142
- DO match the exact code style, formatting, and patterns of the surrounding file

.github/agents/ui-developer.agent.md

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,6 @@ You are an expert frontend developer specializing in React 19, Next.js 15 App Ro
1313

1414
**ALWAYS create a new branch for your work. NEVER commit directly to `main`.**
1515

16-
## CRITICAL: Playwright Test Policy
17-
18-
**ALL Playwright test failures MUST be debugged and fixed before handing off to Code Review — no exceptions.**
19-
20-
- Run the full `yarn test:e2e` suite, not just tests related to your changes
21-
- If any test fails, investigate and fix it — do not skip or declare it pre-existing without proof
22-
- Do NOT hand off to Code Review or Security Review with any failing tests
23-
2416
## CRITICAL: Server API Contract
2517

2618
When adding a new UI feature that requires a new server endpoint:
@@ -107,46 +99,37 @@ services/ui/
10799
- Tests use `PLAYWRIGHT_BASE_URL=http://localhost:3000`
108100
- Dev server must be running before tests: `SESSION_PASSWORD="dev-password-32-chars-or-longer!!" yarn dev`
109101
- Tests live in `test/e2e/` — add coverage for any new page or significant interaction
110-
- Run tests: `PLAYWRIGHT_BASE_URL=http://localhost:3000 yarn test:e2e`
111102

112103
## Starting Point
113104

114105
Before writing any code:
115-
1. Check `.session-memory/plan.md` with the memory tool — if a plan exists, follow it precisely
116-
2. If no plan exists, read the relevant existing components and pages before beginning
106+
1. Check `plan.md` with the memory tool — if a plan exists, follow it precisely
107+
2. If no plan exists, request the plan from the user. Never make up your own plan. Always follow the user's plan exactly as given, even if you think of a more efficient way to do it. If you have questions about the plan, ask the user for clarification before proceeding.
117108
3. Build a todo list of all implementation steps and track progress
118109

119110
## Acceptance Criteria
120111

121112
Before handing off to Code Review:
122113

123114
1. **`yarn build` passes** — zero TypeScript errors, no missing imports
124-
2. **All Playwright tests pass** — run the full suite; fix every failure
125115
3. **Brand palette respected** — no new colours outside the approved palette
126116
4. **No regressions** — existing pages still render; auth flow still works
127117
5. **Responsive** — test at `xs` (375 px) and `sm+` (768 px+) breakpoints using the browser tools
128118

129119
## Workflow
130120

131-
1. Read plan from `.session-memory/plan.md`
121+
1. Read plan from `plan.md`
132122
2. Create a todo list
133123
3. Implement component / page changes
134124
4. Update `src/lib/api.ts` types if server response shape changed
135125
5. Add or update Playwright tests
136126
6. Run `yarn build` — fix all errors
137-
7. Start dev server, run `yarn test:e2e` — fix all failures
138-
8. Commit: `git commit -a -m "<type>(ui): <summary>"`
139-
9. Hand off to **OpenDepot Code Review** with a summary of all changes
140-
141-
## Handoff
142-
143-
Once all acceptance criteria are met, invoke **OpenDepot Code Review** as a subagent with a concise summary of every file changed, component added, and test updated.
144-
145-
After Code Review approval, invoke **OpenDepot Documentation** with a summary of any user-facing changes, new pages, new configuration variables, or API changes that need to be documented.
127+
7. Commit: `git commit -a -m "<type>(ui): <summary>"`
128+
8. Hand off to user with a summary of the changes and any notes for the Code Review agent (e.g., "Requires new server endpoint at /opendepot/ui/v1/new-endpoint, response shape is { ... }")
146129

147130
## Constraints
148131

149-
- DO NOT modify Go server code — note any required server changes in the Code Review handoff instead
132+
- DO NOT modify Go server code — note any required server changes in the Code Review handoff summary instead
150133
- DO NOT modify Helm chart templates — flag them for the Developer agent
151134
- DO NOT introduce new npm dependencies without justification; prefer MUI and built-in browser APIs
152135
- DO NOT use `any` TypeScript type — define proper interfaces in `src/lib/api.ts`

chart/opendepot/Chart.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ dependencies:
66
repository: https://valkey-io.github.io/valkey-helm/
77
version: 0.9.4
88
digest: sha256:62aae976f7ac11346b805ffa6ce89105622e4a3bd51debdbfae56a2930d072b0
9-
generated: "2026-05-31T15:21:41.134715-07:00"
9+
generated: "2026-05-31T16:43:21.075048-07:00"

docs/architecture.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ tags:
77

88
# Architecture
99

10-
OpenDepot consists of four Kubernetes controllers, a server, and an optional UI frontend, all deployed via the Helm chart.
10+
OpenDepot consists of four Kubernetes controllers, a server, a bundled Valkey stats store, and an optional UI frontend, all deployed via the Helm chart.
1111

1212
## Event Flow
1313

1414
1. **Depot controller** watches `Depot` resources, queries the GitHub Releases API for modules matching version constraints, queries the HashiCorp Releases API for providers matching version constraints, and creates or updates `Module` and `Provider` resources
1515
2. **Module controller** watches `Module` resources, creates a `Version` resource for each version listed in `spec.versions`, generates unique filenames, and tracks the latest version
1616
3. **Provider controller** watches `Provider` resources, creates a `Version` resource for each version and OS/architecture combination in `spec.versions`, and tracks the latest version
1717
4. **Version controller** watches `Version` resources, fetches module source from GitHub or provider binaries via the OpenTofu registry download API, computes SHA256 checksums, generates GPG signatures (for providers), and uploads archives to the configured storage backend
18-
5. **Server** handles OpenTofu/Terraform read requests, queries Kubernetes for `Module`, `Provider`, `Version`, and (when OIDC is enabled) `GroupBinding` resources, and serves or redirects artifact downloads
18+
5. **Server** handles OpenTofu/Terraform read requests, queries Kubernetes for `Module`, `Provider`, `Version`, and (when OIDC is enabled) `GroupBinding` resources, serves or redirects artifact downloads, and records download events in the bundled Valkey stats store
1919
6. **Registry Explorer UI** (optional, `ui.enabled: true`) — a Next.js frontend with an NGINX sidecar that provides a browsable registry explorer. NGINX splits traffic between the UI and the server using path-based routing
2020

2121
## Services
@@ -130,6 +130,14 @@ Provider artifact endpoints (binary download, `SHA256SUMS`, `SHA256SUMS.sig`) ar
130130
!!! warning
131131
To prevent unauthenticated users from easily enumerating provider and module artifacts, files are stored with UUID7-based filenames.
132132

133+
### Valkey Stats Store
134+
135+
A [Valkey](https://valkey.io/) (Redis-compatible) instance deployed automatically alongside the server via the official `valkey-io/valkey-helm` subchart. The server records download events in Valkey using a scoped key namespace (`stats:*`) and reads aggregate counts for the Registry Explorer Stats page.
136+
137+
Valkey runs as a StatefulSet with a PVC for persistence by default (`valkey.dataStorage.enabled: true`). Disable persistence for local development or ephemeral environments where no StorageClass is available.
138+
139+
Optional ACL password authentication can be enabled via `valkey.auth.enabled: true`. When enabled, the server reads the password from the `OPENDEPOT_VALKEY_PASSWORD` environment variable, injected via a Kubernetes `secretKeyRef`. See [Valkey Stats Store](../getting-started/installation.md#valkey-stats-store) for the full configuration reference.
140+
133141
### Registry Explorer UI
134142

135143
An optional Next.js frontend deployed when `ui.enabled: true`. The UI pod runs two processes:

services/server/storage.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
// buildDownloadPathFromVersion constructs the storage-backend path segment appended to
1818
// /opendepot/modules/v1/download/ for a given Version resource. It inspects both
1919
// ModuleConfigRef and ProviderConfigRef storage configs and returns an error if
20-
// neither is populated or the storage backend is not recognised.
20+
// neither is populated or the storage backend is not recognized.
2121
func buildDownloadPathFromVersion(versionResource *opendepotv1alpha1.Version) (string, error) {
2222
var storageConfig *opendepotv1alpha1.StorageConfig
2323
var name *string

0 commit comments

Comments
 (0)