-
Notifications
You must be signed in to change notification settings - Fork 5
feat(desktop): add river policy workbench and hushd eval hardening #64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
apps/desktop/src/features/forensics/policy-workbench/PolicyWorkbenchPanel.tsx
Outdated
Show resolved
Hide resolved
apps/desktop/src/features/forensics/policy-workbench/PolicyWorkbenchPanel.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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: 3152a5ee47
ℹ️ 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".
apps/desktop/src/features/forensics/policy-workbench/PolicyWorkbenchPanel.tsx
Show resolved
Hide resolved
|
Addressed review feedback in commit 008c5f5:\n\n- Prevented dirty-draft overwrite on reconnect: auto-reload now skips when draft is dirty and requires explicit reload.\n- Fixed in-flight save race: save uses snapshot + preserves newer draft edits if the draft changed while save was pending; editor is read-only during save.\n- Fixed network target mapping for IPv6: bare IPv6 is treated as host-only (default port) and bracketed IPv6 host:port parsing is covered.\n- Fixed update response hash to return canonical engine policy hash (not raw request YAML hash).\n\nValidation run:\n- Desktop: tsc, eslint, vitest (PolicyWorkbenchPanel/mapping/state tests)\n- hushd: cargo test -p hushd --test integration test_update_policy_returns_canonical_policy_hash\n |
|
Follow-up correction: in the prior note, the API route reference should read PUT /api/v1/policy (canonical policy hash fix), and it has been validated with the new hushd integration test. |
|
@codex review |
There was a problem hiding this 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: 008c5f5a78
ℹ️ 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".
|
Addressed latest Codex review comment in commit 2e2bee4.
Validation run:
|
|
@codex review |
There was a problem hiding this 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: 2e2bee4e6d
ℹ️ 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".
apps/desktop/src/features/forensics/policy-workbench/PolicyWorkbenchPanel.tsx
Outdated
Show resolved
Hide resolved
apps/desktop/src/features/forensics/policy-workbench/PolicyWorkbenchPanel.tsx
Show resolved
Hide resolved
|
Addressed latest open review comments in commit 3d1f74f (reload confirmation, stale load response suppression, loadError cleanup after save, and removal of unused PolicyWorkbenchError export).\n\nValidation run:\n- desktop tsc\n- desktop eslint (touched files)\n- vitest: PolicyWorkbenchPanel/state/mapping + policyWorkbenchClient tests (18 passing)\n\n@codex review |
There was a problem hiding this 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: 3d1f74f704
ℹ️ 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".
apps/desktop/src/features/forensics/policy-workbench/PolicyWorkbenchPanel.tsx
Show resolved
Hide resolved
apps/desktop/src/features/forensics/policy-workbench/PolicyWorkbenchPanel.tsx
Show resolved
Hide resolved
apps/desktop/src/features/forensics/policy-workbench/PolicyWorkbenchPanel.tsx
Outdated
Show resolved
Hide resolved
apps/desktop/src/features/forensics/policy-workbench/PolicyWorkbenchPanel.tsx
Outdated
Show resolved
Hide resolved
|
Addressed the remaining five review findings in commit
Also added targeted regressions in Local verification:
All review threads are resolved; CI is running on this commit. @codex review |
There was a problem hiding this 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: edd69df607
ℹ️ 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".
apps/desktop/src/features/forensics/policy-workbench/mapping.ts
Outdated
Show resolved
Hide resolved
|
Completed another pass:
Local validation:
All currently open review threads are resolved again. @codex review |
There was a problem hiding this 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: c6e95b06d6
ℹ️ 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".
apps/desktop/src/features/forensics/policy-workbench/PolicyWorkbenchPanel.tsx
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
|
Addressed latest hash-format review in commit
Validation run:
@codex review |
There was a problem hiding this 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: c55c3a23f6
ℹ️ 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".
apps/desktop/src/features/forensics/policy-workbench/mapping.ts
Outdated
Show resolved
Hide resolved
|
Addressed the remaining command parsing review item in commit
Validation run:
@codex review |
There was a problem hiding this 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: 29a313a823
ℹ️ 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".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
apps/desktop/src/features/forensics/policy-workbench/PolicyWorkbenchPanel.tsx
Show resolved
Hide resolved
|
Addressed the latest 3 review findings in commit
Added/updated regressions:
Validation run:
@codex review |
There was a problem hiding this 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: 0eca3f50db
ℹ️ 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".
apps/desktop/src/features/forensics/policy-workbench/mapping.ts
Outdated
Show resolved
Hide resolved
|
Addressed the URL default-port mapping review item in commit
Validation run:
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
|
Addressed the engine-swap ordering issue in commit
Validation run:
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
apps/desktop/src/features/forensics/policy-workbench/PolicyWorkbenchPanel.tsx
Show resolved
Hide resolved
|
Implemented PR1 + PR2 in commit
Validation run:
Next slice would be PR3: wire signing + notarization secrets and CI notarization/stapling. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
apps/desktop/src/features/forensics/policy-workbench/PolicyWorkbenchPanel.tsx
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
apps/desktop/src/features/forensics/policy-workbench/PolicyWorkbenchPanel.tsx
Show resolved
Hide resolved
apps/desktop/src/features/forensics/policy-workbench/PolicyWorkbenchPanel.tsx
Outdated
Show resolved
Hide resolved
|
Addressed the remaining open review threads and runtime regression in commits What was fixed:
Validation run:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| <div className="flex items-center gap-2"> | ||
| <GlowButton | ||
| data-testid="policy-test-run" | ||
| disabled={isRunningTest || !testForm.target.trim()} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Run Test button not disabled when daemon disconnected
Low Severity
The "Run Test" button's disabled prop only checks isRunningTest || !testForm.target.trim() but does not check connected, unlike the Save button which correctly uses !connected || !dirty || state.isSaving. A disconnected user can click "Run Test," triggering a network request that will fail. The runPolicyTest callback also omits a connected guard, unlike handleSave and validateYaml.
Additional Locations (1)
| normalized_version?: string; | ||
| } | ||
| export type PolicyEvalModel = PolicyEvalResponse; | ||
| export type PolicySaveModel = PolicySaveResult; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exported type aliases unused outside defining file
Low Severity
PolicyLoadModel, PolicyValidationModel, PolicyEvalModel, and PolicySaveModel are exported but never imported anywhere in the codebase. They exist only as return-type aliases on PolicyWorkbenchClient methods. Consumers reference the methods' return types implicitly through inference rather than importing these named aliases, making them dead exports that add noise to the module surface.
|
Follow-up update:
Local checks rerun:
|


Summary
Testing
Note
Medium Risk
Touches policy enforcement-adjacent APIs and desktop policy-editing flows; mistakes could lead to incorrect validation/save behavior or operational regressions, though changes are gated by auth scopes and a feature flag.
Overview
Adds an integrated Policy Workbench to the Desktop Forensics River view, providing in-place policy YAML load/edit/validate/save and canonical
PolicyEventtest execution with history, dirty-draft UX protections, and feature-flag rollout controls.Extends
hushdwithPOST /api/v1/policy/validate, enrichesGET /api/v1/policyresponses withsource+schemametadata, and returns canonicalpolicy_hashon policy update/reload/bundle update; integration tests add regression coverage for eval-surface edge cases (path traversal targets, userinfo-spoofed hosts, private-IP egress).Updates desktop plumbing to support both Tauri invoke bridge commands (
policy_load/policy_validate/policy_eval_event/policy_save) and direct HTTP viaHushdClient(including wrapping/api/v1/evalpayloads under{ event }), modernizes routing to a data router with navigation blocking on dirty drafts, and adds a manual GitHub Actions workflow to build/upload unsigned macOS.dmg/.appartifacts with checksums.Written by Cursor Bugbot for commit aee4292. This will update automatically on new commits. Configure here.