feat: add opt-in dashboard Sentry reporting #489

Open
anton wants to merge 1 commit from feat/frontend-sentry into main
Owner

Summary

  • Add opt-in, privacy-preserving Sentry reporting for authenticated dashboard Vue/runtime errors, unhandled rejections and HTTP 5xx responses. Preserve origin/session-generation fencing, final-envelope redaction, IP-inference suppression and rejection deduplication. Related to #377.
  • Use one maintained ~/.config/caution/.env. Generate owner-private, temporary frontend.env, frontend-sentry.env and filtered runtime.env files for each invocation; never shell-source the file or modify it. Public build settings are allowlisted; uploader credentials are excluded from browser assets, build arguments and backend containers.
  • Wire Make and installed systemd consumers through the runtime wrapper, including API preflight and component checks. Regenerate settings on service starts, preserve runtime-overlay precedence, and make the admin AWS fallback parse only literal AWS settings. Install the checkout-independent helper/units during setup and the existing make up sequence, after preparation and before migration/restarts.
  • Build the frontend once, validate its complete retained inventory and public-configuration digest, upload matching private source maps, then package exactly those public assets. The pinned native uploader runs in a disposable container outside the build; no host Node/npm installation is required. Upload errors/signals prevent gateway packaging and rollout. Retained mismatches, corruption, symlinks and public maps fail closed; serve only dist/.

Operator interface

Keep existing backend settings and add these to the same owner-private file:

# ~/.config/caution/.env — owned by the invoking account, chmod 600
VITE_SENTRY_DSN=<frontend-project-dsn>
VITE_SENTRY_ENVIRONMENT=production
SENTRY_ORG=<organization-slug>
SENTRY_PROJECT=<frontend-project-slug>
SENTRY_AUTH_TOKEN=<upload-token>
# Optional for a self-hosted collector; omit for sentry.io:
# SENTRY_URL=https://<self-hosted-sentry>/

Use literal KEY=value syntax: no shell expansion, export, interpreted quoting or inline comments. Use a separate frontend Vue/JavaScript project; the upload project must match the DSN. Make derives release identity from the Git commit. Generated files are temporary and cleaned up; do not hand-edit them.

  • make build-frontend-release: build/validate/upload only; does not replace services or the gateway image.
  • make build-gateway-release: additionally package those exact assets into the gateway image; does not restart services.
  • make up: integrated release and existing rollout sequence. Deployment source guards keep installed services on the canonical ~/.config/caution/.env.
  • FRONTEND_RELEASE_DIR=<retained-export>: validate and re-upload an existing export without rebuilding. Its public settings must match; an older export also needs its original VITE_SENTRY_RELEASE.

No DSN leaves reporting disabled and skips upload and uploader-credential requirements. The combined source is still parsed and must be safe/valid. Explicit dedicated-file overrides remain supported for standalone frontend builds; see frontend/README.md for precedence and private artifact retention.

Verification

Current candidate: e53156d4bf3863871a635ec42c6d07d725df818a, one commit on 1fad41270748eff75de9027b6469b5c4135b7acf. All newly added test files/cases and their Make/npm runner wiring have been removed. Pre-existing tests remain; the only test-file diff is +15 net lines adapting existing component-test fixtures/expectations to the runtime wrapper. Production implementation is unchanged from b588e019466db4b7a1744f30ac7fc5b4570b7e8e.

Completed on the current commit:

TMPDIR=/tmp PYTHONDONTWRITEBYTECODE=1 RUSTUP_TOOLCHAIN=1.96.1 \
  CARGO_TARGET_DIR=/home/tuna/git/platform/target make test
(cd frontend && PATH=/home/tuna/.npm/_npx/52027bd8fc0022aa/node_modules/node/bin:$PATH npm test)
git diff --check HEAD^ HEAD
  • Full make test: 1,437 Rust tests passed, 52 ignored, 89 Python checks passed, and CLI installer tests passed.
  • Original frontend suite: 175 passed, none failed or skipped, on Node 22.23.1.
  • Compared the test inventory against the base: no new test files/cases or dangling test-runner references remain. Production Make recipes and frontend dependency declarations are unchanged by the removal.

Earlier qualification of the unchanged production implementation on b588e019466d included enabled/disabled production-bundle browser checks, container/artifact checks, isolated real-Docker runtime filtering/cleanup, systemd verification, and native-uploader probes against a synthetic local service. Those checks are historical evidence, not reruns on this commit; their dedicated test files are no longer included. No artifacts carrying the current release ID were built in this test-removal revision.

Acceptance boundary

No real-project Sentry upload, ingestion or server-side symbolication was exercised. Before production activation, verify the actual project's privacy settings and perform controlled upload/ingestion/symbolication checks. Synthetic endpoints and intercepted browser traffic do not establish the real collector's processing or access-log behavior.

No live deployment, service restart, full deployment E2E or AWS/Nitro qualification was performed for this revision. The 52 ignored Rust tests remain unrun. No formal forge reviewer approval or remote CI success is claimed. Publication does not merge or deploy this PR.

PR-only scope: 28 files, +1,237/-65 (net +1,172). No new tests, unrelated cleanup or agent-local files.

## Summary - Add opt-in, privacy-preserving Sentry reporting for authenticated dashboard Vue/runtime errors, unhandled rejections and HTTP 5xx responses. Preserve origin/session-generation fencing, final-envelope redaction, IP-inference suppression and rejection deduplication. Related to #377. - Use **one maintained `~/.config/caution/.env`**. Generate owner-private, temporary `frontend.env`, `frontend-sentry.env` and filtered `runtime.env` files for each invocation; never shell-source the file or modify it. Public build settings are allowlisted; uploader credentials are excluded from browser assets, build arguments and backend containers. - Wire Make and installed systemd consumers through the runtime wrapper, including API preflight and component checks. Regenerate settings on service starts, preserve runtime-overlay precedence, and make the admin AWS fallback parse only literal AWS settings. Install the checkout-independent helper/units during setup and the existing `make up` sequence, after preparation and before migration/restarts. - Build the frontend once, validate its complete retained inventory and public-configuration digest, upload matching private source maps, then package exactly those public assets. The pinned native uploader runs in a disposable container outside the build; no host Node/npm installation is required. Upload errors/signals prevent gateway packaging and rollout. Retained mismatches, corruption, symlinks and public maps fail closed; serve only `dist/`. ## Operator interface Keep existing backend settings and add these to the same owner-private file: ```dotenv # ~/.config/caution/.env — owned by the invoking account, chmod 600 VITE_SENTRY_DSN=<frontend-project-dsn> VITE_SENTRY_ENVIRONMENT=production SENTRY_ORG=<organization-slug> SENTRY_PROJECT=<frontend-project-slug> SENTRY_AUTH_TOKEN=<upload-token> # Optional for a self-hosted collector; omit for sentry.io: # SENTRY_URL=https://<self-hosted-sentry>/ ``` Use literal `KEY=value` syntax: no shell expansion, `export`, interpreted quoting or inline comments. Use a separate frontend Vue/JavaScript project; the upload project must match the DSN. Make derives release identity from the Git commit. Generated files are temporary and cleaned up; do not hand-edit them. - `make build-frontend-release`: build/validate/upload only; does not replace services or the gateway image. - `make build-gateway-release`: additionally package those exact assets into the gateway image; does not restart services. - `make up`: integrated release and existing rollout sequence. Deployment source guards keep installed services on the canonical `~/.config/caution/.env`. - `FRONTEND_RELEASE_DIR=<retained-export>`: validate and re-upload an existing export without rebuilding. Its public settings must match; an older export also needs its original `VITE_SENTRY_RELEASE`. No DSN leaves reporting disabled and skips upload and uploader-credential requirements. The combined source is still parsed and must be safe/valid. Explicit dedicated-file overrides remain supported for standalone frontend builds; see `frontend/README.md` for precedence and private artifact retention. ## Verification Current candidate: `e53156d4bf3863871a635ec42c6d07d725df818a`, **one commit** on `1fad41270748eff75de9027b6469b5c4135b7acf`. All newly added test files/cases and their Make/npm runner wiring have been removed. Pre-existing tests remain; the only test-file diff is **+15 net lines** adapting existing component-test fixtures/expectations to the runtime wrapper. Production implementation is unchanged from `b588e019466db4b7a1744f30ac7fc5b4570b7e8e`. Completed on the current commit: ```sh TMPDIR=/tmp PYTHONDONTWRITEBYTECODE=1 RUSTUP_TOOLCHAIN=1.96.1 \ CARGO_TARGET_DIR=/home/tuna/git/platform/target make test (cd frontend && PATH=/home/tuna/.npm/_npx/52027bd8fc0022aa/node_modules/node/bin:$PATH npm test) git diff --check HEAD^ HEAD ``` - Full `make test`: **1,437 Rust tests passed, 52 ignored**, **89 Python checks passed**, and CLI installer tests passed. - Original frontend suite: **175 passed**, none failed or skipped, on Node 22.23.1. - Compared the test inventory against the base: no new test files/cases or dangling test-runner references remain. Production Make recipes and frontend dependency declarations are unchanged by the removal. Earlier qualification of the unchanged production implementation on `b588e019466d` included enabled/disabled production-bundle browser checks, container/artifact checks, isolated real-Docker runtime filtering/cleanup, systemd verification, and native-uploader probes against a synthetic local service. Those checks are historical evidence, not reruns on this commit; their dedicated test files are no longer included. No artifacts carrying the current release ID were built in this test-removal revision. ## Acceptance boundary No real-project Sentry upload, ingestion or server-side symbolication was exercised. Before production activation, verify the actual project's privacy settings and perform controlled upload/ingestion/symbolication checks. Synthetic endpoints and intercepted browser traffic do not establish the real collector's processing or access-log behavior. No live deployment, service restart, full deployment E2E or AWS/Nitro qualification was performed for this revision. The 52 ignored Rust tests remain unrun. No formal forge reviewer approval or remote CI success is claimed. Publication does not merge or deploy this PR. PR-only scope: **28 files, +1,237/-65 (net +1,172)**. No new tests, unrelated cleanup or agent-local files.
anton force-pushed feat/frontend-sentry from 60a4ccaae1 to 6c8637c362 2026-10-21 00:37:59 +00:00 Compare
anton changed title from WIP: feat: add opt-in dashboard Sentry reporting to feat: add opt-in dashboard Sentry reporting 2026-10-21 00:39:09 +00:00
anton force-pushed feat/frontend-sentry from 6c8637c362 to fd84366bca 2026-10-21 01:55:08 +00:00 Compare
anton force-pushed feat/frontend-sentry from fd84366bca to b588e01946 2026-10-21 04:59:09 +00:00 Compare
anton force-pushed feat/frontend-sentry from b588e01946 to 70956fe213 2026-10-21 05:44:12 +00:00 Compare
anton force-pushed feat/frontend-sentry from 70956fe213 to e53156d4bf 2026-10-21 06:52:14 +00:00 Compare
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feat/frontend-sentry:feat/frontend-sentry
git switch feat/frontend-sentry
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
public/platform!489
No description provided.