Repository navigation
Upgrade the admin UI to Next.js 16.4.5 and React 19 (fixes #2) - #5
Merged
Merged
Conversation
Owner-approved: Next 16.4.5 as a security-release exception, a nightly hydration stress pass in CI, Tremor kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- next / eslint-config-next 16.4.5 (security release, owner-approved exception to the two-week rule), react / react-dom 19.3.1, types 19.3.0. - Native flat ESLint config; four commented inline disables for the new react-hooks/set-state-in-effect rule; Tremor kept with a peer allowance. - middleware.ts -> proxy.ts (Node runtime); tsconfig.json and next-env.d.ts as rewritten by `next build`. - New `make hydration-stress` check (services/admin-ui/scripts) and a nightly 4 x 10 pass in the CI stack job. - Issue #2: 0 hydration errors in 1,680 stressed loads on Next 16 vs 34 in 560 on 15.5.29; the e2e reload workaround is removed (3 green e2e runs). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner-approved 2026-11-12: default mode none, API keys dev-only, Keycloak bundled in the same workload, pre-registered MCP clients for Entra ID, public/internal/confidential:<domain> classifications. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- OPENCG__AUTH__MODE (none | oidc) in every service; OIDC access tokens validated against one issuer's JWKS (RS256/ES256, iss/aud/exp/nbf, 60 s skew); identity only from the token in oidc mode. - OPA (1.21.4) decides every retrieval candidate (one batched call, before the token budget) and every API action, in both modes; fails closed with 503 policy_unavailable. Policies, data and tests in infra/opa/. - Append-only opencg.access_audit_log (denials and allowed writes, in the write's transaction); auth_method and per-candidate policy decisions on retrieval audit rows; real actor on graph audit rows. - MCP server is an OAuth protected resource; the shared-password OAuth stopgap is removed. Admin UI signs in with code + PKCE and Valkey sessions; the password gate is removed. Removed settings refuse startup. - Bundled Keycloak (26.8.1) in the same compose project, Postgres-backed, dev users only in dev/test. API keys only when OPENCG__ENVIRONMENT=dev. - Ingestion classification (CLI and API) and requested_by. - Smoke and e2e run in oidc mode by default (OPENCG_TEST_AUTH_MODE), and in CI's stack and observability jobs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
8 of 9 tasks
The root .gitignore's data/ rule excluded infra/opa/data/opencg.json, so CI's opa check failed with 'stat data: no such file or directory'. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PrabS-EM
approved these changes
Nov 23, 2026
PrabS-EM
left a comment
Collaborator
There was a problem hiding this comment.
Approving. The upgrade is clean: exact version pins, the middleware.ts → proxy.ts rename is mechanical, and the hydration stress numbers are convincing.
One note: Tremor runs on React 19 through a peer-dependency allowance, and that's the main compatibility risk. Please keep an eye on the nightly hydration stress run and the / and /graph pages after merge. The live-stack CI jobs (stack, observability) were skipped because this PR targets #4's branch. Please confirm they pass once it's retargeted to main.
camilobern
approved these changes
Nov 23, 2026
# Conflicts: # CHANGELOG.md # Makefile
- Refuse any OPENCG__*/KC_* variable still holding a dev-only-* value from
.env.example outside OPENCG__ENVIRONMENT=dev/test, in every service and
the Keycloak entrypoint (names only, never values).
- A configured tenant claim is now required (401 token_invalid without
it); /audit/recent and /audit/{id} are scoped to the caller's tenant.
- /readyz (pipeline and ingestion) checks the tables and columns from
060_audit_cost.sql and 070_access_audit.sql and names the script.
- entitle.run fails closed (PolicyUnavailable) on a missing decision.
- Guard registered with scope="function": the fallback access-audit
write finishes before the response, so a failed write is a 500.
Spec deltas, tasks (section 14), OPERATIONS, .env.example and CHANGELOG
updated. The overlay-port fix is on add-observability-stack, merged in.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… defaults
Must-fix findings from a full review of the PR's code:
- GET /entities and /entities/{id} now apply opencg.entitlement (shared
with /search/vector): readers no longer see confidential rows, and a
denied entity is a 404.
- OPA runs with --authorization=basic (policies/system_authz.rego allows
only decision queries and /health), and its host port is always
loopback: its API no longer accepts policy or data writes.
- Compose defaults OPENCG__ENVIRONMENT to production, as the services do.
- The admin UI refuses cross-origin writes to /api/** in both modes.
- Admin UI refresh keeps a session another instance already rotated,
ends it only on invalid_grant, and survives brief IdP outages.
Also: issuer matched exactly as configured (trailing slash), unused auth
glue removed, entitle skips OPA for an empty candidate list. Spec deltas,
tasks (section 15, with three follow-ups), OPERATIONS and CHANGELOG updated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add OIDC identity and OPA entitlement; remove the shared-password stopgaps
With add-identity-and-opa merged into this branch, CI's stack job runs every service in oidc mode, so the nightly stress run's browsers landed on the Keycloak sign-in page and failed every night with a misleading 'no seed data' message. The script now reuses the signed-in alice session that make e2e saves (or STORAGE_STATE), defaults BASE_URL to localhost like e2e so that session's cookie applies, and names the sign-in redirect when it has no session. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Issue #2: an intermittent production React hydration error (#418) under concurrent load. It was root-caused to the React canary bundled with Next 15.5.29, and the two app-level fixes caused hung client navigations. Next 16 removes it.
Hydration stress results (
make hydration-stress):OpenSpec change
openspec/changes/upgrade-admin-ui-next-16/. The owner approved it on 2026-11-12, with these decisions:stackjob.Changes:
next/eslint-config-next16.4.5;react/react-dom19.3.1;@types/react*19.3.0 (all pinned exactly). Rootengines.nodeis now>=20.9.0.react-hooks/set-state-in-effectrule (GraphExplorer×2,ConceptSearch,ThemeToggle); rendering is unchanged.middleware.ts→proxy.ts, which now runs on the Node runtime; its test is renamed too.tsconfig.jsonandnext-env.d.tsare committed asnext buildrewrites them, so builds leave the tree clean.services/admin-ui/scripts/hydration-stress.cjs+make hydration-stress, documented in OPERATIONS.Checklist
openspec validate upgrade-admin-ui-next-16 --strict, and was agreed before implementationtasks.mdis updatedmake ci-staticpasses (including the Storybook build)make smokepasses against a live stackmake e2epasses 3 consecutive runs (21/21) without the workaround.envfiles or real credentials in the diffManual check:
/(Tremor cards and chart) and the/graphmap render in light and dark themes with no console errors.🤖 Generated with Claude Code