Skip to content

feat(guard): add policy profile dashboard#137

Open
michiosw wants to merge 1 commit into
feat/eng-339-policyconfigfrom
feat/eng-340-policy-profile-ui
Open

feat(guard): add policy profile dashboard#137
michiosw wants to merge 1 commit into
feat/eng-339-policyconfigfrom
feat/eng-340-policy-profile-ui

Conversation

@michiosw
Copy link
Copy Markdown
Contributor

Summary

  • explain the user-facing change
  • link the issue or context if relevant

Verification

  • go test ./...
  • go test -race ./...
  • go vet ./...
  • buf generate if protobuf or generated code changed

Release notes

  • conventional commit title matches semver intent

Copy link
Copy Markdown
Contributor Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link
Copy Markdown
Contributor Author

Screenshot 2026-05-16 at 13.16.48.png

@michiosw michiosw force-pushed the feat/eng-340-policy-profile-ui branch from 5f5dafc to 0ad854d Compare May 16, 2026 11:42
@michiosw michiosw force-pushed the feat/eng-339-policyconfig branch from 7e91e3c to bf88194 Compare May 16, 2026 11:42
@michiosw michiosw marked this pull request as ready for review May 16, 2026 11:44
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 16, 2026

Greptile Summary

This PR adds a policy profile dashboard for Guard. The main changes are:

  • New GET and POST API routes for policy profile state.
  • A React/Vite dashboard with session activity, event inspection, and profile cards.
  • Policy profile persistence through policyconfig.Store.
  • Rebuilt embedded dashboard assets and frontend build configuration.

Confidence Score: 2/5

This should be fixed before merging.

  • Profile activation can report success without changing future guard decisions.
  • Session event polling can show activity for the wrong selected session.
  • Existing events can keep stale details after polling returns updated data.

internal/guard/app/server/server.go, web/guard-dashboard/src/App.tsx, and web/guard-dashboard/src/dashboard/helpers.ts.

Important Files Changed

Filename Overview
internal/guard/app/server/server.go Adds policy profile endpoints and store wiring, but activated profiles are not connected to decision evaluation.
web/guard-dashboard/src/App.tsx Adds polling and dashboard state orchestration, with stale request and policy-load failure edge cases.
web/guard-dashboard/src/dashboard/helpers.ts Adds display helpers and equality checks, including an event comparison that can suppress real updates.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  UI[Dashboard profile card] --> POST[POST /api/policy/profile]
  POST --> Store[policyconfig.Store ActivateProfile]
  Store --> Files[guard/policy active.json]
  Hooks[Hook event] --> Runtime[guardHookRuntime]
  Runtime --> Provider[RiskPolicyProvider]
  Provider --> Legacy[risk.DecideRisk]
  Store -. not read by decisions .-> Provider
Loading

Reviews (1): Last reviewed commit: "feat(guard): redesign dashboard UI" | Re-trigger Greptile

Comment thread internal/guard/app/server/server.go
Comment thread web/guard-dashboard/src/App.tsx
Comment thread web/guard-dashboard/src/dashboard/helpers.ts Outdated
Comment thread web/guard-dashboard/src/App.tsx
Comment thread internal/guard/app/server/server.go Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0ad854d79e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/guard/app/server/server.go
@michiosw michiosw force-pushed the feat/eng-340-policy-profile-ui branch 2 times, most recently from af1d7c5 to cd47d83 Compare May 16, 2026 11:57
@michiosw michiosw force-pushed the feat/eng-339-policyconfig branch from bf88194 to bf0bed6 Compare May 16, 2026 11:57
@michiosw michiosw requested a review from hasandemirkiran May 16, 2026 11:57
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cd47d83e2c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/guard/app/server/server.go
@michiosw michiosw force-pushed the feat/eng-340-policy-profile-ui branch from cd47d83 to df813e0 Compare May 16, 2026 12:04
@michiosw michiosw force-pushed the feat/eng-340-policy-profile-ui branch from df813e0 to a4c65a3 Compare May 17, 2026 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant