Skip to content

chore: maintain security-sensitive UI surfaces - #39350

Closed
myth05 wants to merge 2 commits into
NousResearch:mainfrom
myth05:chore/security-ui-maintenance
Closed

chore: maintain security-sensitive UI surfaces#39350
myth05 wants to merge 2 commits into
NousResearch:mainfrom
myth05:chore/security-ui-maintenance

Conversation

@myth05

@myth05 myth05 commented Jun 4, 2026

Copy link
Copy Markdown

Summary

  • Refresh security-sensitive JS dependency pins/locks across the desktop, TUI, website, and web workspaces, including React Router and DOMPurify remediation coverage.
  • Add launchd file descriptor limits for the macOS gateway service while preserving upstream unconditional KeepAlive behavior.
  • Add a desktop Company Brain trace parser/formatter primitive for future important-answer source/correction gating.
  • Clean up small TypeScript compatibility issues in desktop/TUI/website surfaces.

Verification

  • python -m pytest -o 'addopts=' tests/hermes_cli/test_gateway_service.py::TestLaunchdServiceRecovery::test_launchd_plist_sets_file_descriptor_limits tests/hermes_cli/test_gateway_service.py::TestServiceWorkingDirIsStable::test_launchd_plist_keepalive_unconditional -q
  • (cd apps/desktop && npx vitest run --environment jsdom src/lib/company-brain-trace.test.ts src/components/pane-shell/pane-shell.test.tsx)
  • npm --prefix ui-tui test -- --run packages/hermes-ink/src/utils/execFileNoThrow.test.ts
  • npm --prefix apps/desktop run type-check
  • npm --prefix ui-tui run type-check
  • npm --prefix website run typecheck
  • npm audit --audit-level=moderate --json → 0 vulnerabilities

Notes

  • Full npm --prefix apps/desktop run test:ui -- company-brain-trace.test.ts currently runs the whole desktop src suite because the script includes src; after merging latest main, that broader suite still has unrelated upstream UI test expectation failures. The targeted new/changed desktop tests pass via direct Vitest invocation above.

myth05 added 2 commits June 4, 2026 15:11
- Add DOMPurify overrides and dependency hygiene updates across root, TUI, desktop, and website packages
- Add launchd file descriptor limits for the gateway service
- Add Company Brain trace parsing helpers for future desktop answer gating
- Fix TypeScript compatibility issues in desktop, TUI, and website code
…ntenance

# Conflicts:
#	apps/desktop/package-lock.json
#	hermes_cli/gateway.py
#	package-lock.json
#	ui-tui/package-lock.json
@myth05
myth05 requested a review from a team June 4, 2026 22:20
@myth05

myth05 commented Jun 4, 2026

Copy link
Copy Markdown
Author

CI is currently fork-gated (action_required across workflows), not failing from executed logs.

Local verification completed on the pushed head 5401ca6b84ad6965ef06af014629ecf5bcc66379:

  • python -m pytest -o 'addopts=' tests/hermes_cli/test_gateway_service.py::TestLaunchdServiceRecovery::test_launchd_plist_sets_file_descriptor_limits tests/hermes_cli/test_gateway_service.py::TestServiceWorkingDirIsStable::test_launchd_plist_keepalive_unconditional -q → 2 passed
  • (cd apps/desktop && npx vitest run --environment jsdom src/lib/company-brain-trace.test.ts src/components/pane-shell/pane-shell.test.tsx) → 19 passed
  • npm --prefix ui-tui test -- --run packages/hermes-ink/src/utils/execFileNoThrow.test.ts → 4 passed, 1 skipped
  • npm --prefix apps/desktop run type-check → passed
  • npm --prefix ui-tui run type-check → passed
  • npm --prefix website run typecheck → passed
  • npm audit --audit-level=moderate --json → 0 vulnerabilities

Maintainers: please approve the fork workflows when convenient. Maintainer edits are enabled.

@alt-glitch alt-glitch added type/security Security vulnerability or hardening P3 Low — cosmetic, nice to have dependencies Pull requests that update a dependency file comp/gateway Gateway runner, session dispatch, delivery labels Jun 4, 2026

@austinpickett austinpickett left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This PR bundles four unrelated workstreams under a single "chore: maintain security-sensitive UI surfaces" label, and one of them is speculative dead code. It needs to be split before any part can merge.

What's actually in here (14 files, +754/-327)

  1. Dependency pin/lock refreshes (root package.json/package-lock.json + website + web + ui-tui + desktop) — legitimate security intent (React Router, DOMPurify), but see conflicts below.
  2. launchd file-descriptor limits in hermes_cli/gateway.py — plausibly useful, but unrelated to "UI surfaces."
  3. 🔴 apps/desktop/src/lib/company-brain-trace.ts — a new trace parser/formatter primitive. It is imported nowhere (I checked: only its own test references it), and the PR description states it's "for future important-answer source/correction gating." This is speculative infrastructure with no current consumer — we don't merge hooks/primitives until something actually uses them.
  4. pane-shell.tsx — a resize-behavior change (drops the pane.resizable guard on widthOverride), unrelated to security; plus misc TS cleanups in tui/website.

Blocking issues

  • Speculative code (#3) should be dropped from this PR entirely. If the Company Brain gating feature is coming, land the primitive with its consumer in a dedicated feature PR.
  • Conflicts: mergeable: CONFLICTING/DIRTY. The root package.json/package-lock.json edits also overlap several in-flight lockfile PRs — #44024 (@types/node, approved), #44197 (icons-pack, approved), and #39450 (website/whatsapp-bridge audit). These can't all merge independently; the dep work here should be reconciled with those rather than duplicating them.
  • Misleading label: a "chore" touching gateway.py service config, adding a new desktop primitive, and changing pane resize behavior isn't a chore.

Ask

Please split into focused PRs, each rebased on current main:

  1. The dependency/lock refresh — but coordinate with #44024 / #44197 / #39450 so it's only the net-new remediation, not a re-do of what's already approved.
  2. The launchd FD-limit change (its own fix(gateway) PR with the test you already wrote).
  3. Drop company-brain-trace.ts until it has a real consumer.
    The pane-shell tweak, if intentional, belongs in whichever UI PR actually needs it. Happy to fast-track the launchd and dep pieces once separated.

@myth05

myth05 commented Jun 11, 2026

Copy link
Copy Markdown
Author

Thanks, Austin. Split out the launchd piece into a focused PR from current main:

It contains only hermes_cli/gateway.py plus the existing focused test. Verified locally:

uv sync --extra dev
uv run --extra dev python -m pytest -o 'addopts=' tests/hermes_cli/test_gateway_service.py::TestLaunchdServiceRecovery::test_launchd_plist_sets_file_descriptor_limits tests/hermes_cli/test_gateway_service.py::TestServiceWorkingDirIsStable::test_launchd_plist_keepalive_unconditional -q\n# 2 passed\n```\n\nI am not carrying over the Company Brain primitive or pane-shell tweak. I am leaving the dependency work out of this split until it can be reconciled against #44024 / #44197 / #39450 instead of redoing their lockfile changes.

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the security-maintenance work. The remaining useful pieces need to stay split rather than landing as this bundle.

Problems

  • apps/desktop/src/lib/company-brain-trace.ts has no production consumer in this PR: its only added import is its own test, while the body describes future gating. AGENTS.md:98-101 rejects speculative infrastructure without a concrete consumer.
  • The execFileNoThrow typing change is already on current main in 4ce9caed0 (ui-tui/packages/hermes-ink/src/utils/execFileNoThrow.ts:1,35,37), and React Router was already remediated in 46c16b928 (apps/desktop/package.json:103, web/package.json:34).
  • The dependency work is not wholly obsolete: current website/package-lock.json:9311 still resolves DOMPurify 3.4.2, so any website remediation must be regenerated against current lockfiles.

Suggested changes

  • Keep the launchd limits in focused PR #44357.
  • Drop the unconsumed Company Brain parser and its tests.
  • Re-scope remaining dependency work to unresolved current-main packages; retain the pane-shell change only as a separately justified desktop fix.

Automated hermes-sweeper review.

@@ -0,0 +1,108 @@
export interface CompanyBrainCorrection {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please remove this parser from this PR. The diff adds no production import or consumer—only its own test—and the stated use is future gating; AGENTS.md:98-101 rejects speculative infrastructure without a concrete consumer.

@@ -1,4 +1,4 @@
import { spawn } from 'child_process'
import { spawn, type ChildProcess, type StdioOptions } from 'child_process'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This exact ChildProcess/StdioOptions typing change is already present on current main in commit 4ce9caed0 (fix(tui): type execFileNoThrow stdio/ChildProcess). Omit it from any salvage.

@teknium1 teknium1 added sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 14, 2026
@myth05

myth05 commented Jul 15, 2026

Copy link
Copy Markdown
Author

Closing this broad PR as superseded after maintainer review. The useful launchd file-descriptor change was split into focused PR #44357. I am dropping the unconsumed Company Brain parser and pane-shell change, and I will not carry forward the stale/overlapping dependency edits. Any future dependency remediation will be regenerated as a separate focused PR from current main.

@myth05 myth05 closed this Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery dependencies Pull requests that update a dependency file P3 Low — cosmetic, nice to have sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data type/security Security vulnerability or hardening

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants