From e77f10af195774af4d26c34a3647cc6a074f03c1 Mon Sep 17 00:00:00 2001
From: "Earl Tankard, Jr., Ph.D"
<45021016+primetimetank21@users.noreply.github.com>
Date: Sat, 26 Sep 2026 09:44:55 -0400
Subject: [PATCH 1/3] feat(demo): modernize Phission as a synthetic learning
workspace
Replace the local-mail prototype with a credential-free Reflex demo, typed MIME parsing and scan-result normalization, accessible target-bound interactions, locked setup, and behavioral/browser CI. Preserve the 2023 prototype in Git history without reconstructing unavailable study findings.
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
---
.github/add_github_hooks.sh | 17 -
.github/workflows/python-versions.yml | 73 ++-
.gitignore | 157 +----
.python-version | 1 +
Makefile | 46 +-
README.md | 167 +++---
assets/eye.svg | 1 +
assets/favicon.ico | Bin 15406 -> 0 bytes
assets/styles.css | 802 ++++++++++++++++++++++++++
components/__init__.py | 9 -
components/button.py | 13 -
components/email_panel.py | 462 ---------------
components/input.py | 17 -
components/score_display.py | 117 ----
components/styles.py | 38 --
email_lib/__init__.py | 105 ----
email_lib/get_email_message.py | 34 --
package-lock.json | 101 ++++
package.json | 15 +
panas_calc.py | 55 --
pcconfig.py | 7 -
phishing_lib/__init__.py | 48 --
phission/demo.py | 60 ++
phission/fixtures/benefits.eml | 27 +
phission/fixtures/garden.eml | 16 +
phission/fixtures/library.eml | 19 +
phission/fixtures/parcel.eml | 34 ++
phission/fixtures/urgent.eml | 17 +
phission/models.py | 48 ++
phission/parsing.py | 278 +++++++++
phission/phission.py | 580 ++++++++++++-------
phission/scanning.py | 69 +++
phission/state.py | 151 +++++
phission/styles.py | 16 -
phission_PANAS_results.xlsx | 14 -
pynecone.db | 0
pyproject.toml | 24 +
reflex.lock/bun.lock | 335 +++++++++++
reflex.lock/package.json | 32 +
requirements.txt | 12 -
response_safe_link.json | 30 -
response_suspicious_link.json | 28 -
rxconfig.py | 14 +
tests/browser.mjs | 426 ++++++++++++++
tests/test_build_contract.py | 36 ++
tests/test_html_boundaries.py | 47 ++
tests/test_parsing.py | 208 +++++++
tests/test_privacy.py | 130 +++++
tests/test_scanning.py | 77 +++
tests/test_state.py | 177 ++++++
tts_lib/__init__.py | 24 -
uv.lock | 711 +++++++++++++++++++++++
52 files changed, 4439 insertions(+), 1486 deletions(-)
delete mode 100755 .github/add_github_hooks.sh
create mode 100644 .python-version
create mode 100644 assets/eye.svg
delete mode 100644 assets/favicon.ico
create mode 100644 assets/styles.css
delete mode 100644 components/__init__.py
delete mode 100644 components/button.py
delete mode 100644 components/email_panel.py
delete mode 100644 components/input.py
delete mode 100644 components/score_display.py
delete mode 100644 components/styles.py
delete mode 100644 email_lib/__init__.py
delete mode 100644 email_lib/get_email_message.py
create mode 100644 package-lock.json
create mode 100644 package.json
delete mode 100644 panas_calc.py
delete mode 100644 pcconfig.py
delete mode 100644 phishing_lib/__init__.py
create mode 100644 phission/demo.py
create mode 100644 phission/fixtures/benefits.eml
create mode 100644 phission/fixtures/garden.eml
create mode 100644 phission/fixtures/library.eml
create mode 100644 phission/fixtures/parcel.eml
create mode 100644 phission/fixtures/urgent.eml
create mode 100644 phission/models.py
create mode 100644 phission/parsing.py
create mode 100644 phission/scanning.py
create mode 100644 phission/state.py
delete mode 100644 phission/styles.py
delete mode 100644 phission_PANAS_results.xlsx
delete mode 100644 pynecone.db
create mode 100644 pyproject.toml
create mode 100644 reflex.lock/bun.lock
create mode 100644 reflex.lock/package.json
delete mode 100644 requirements.txt
delete mode 100644 response_safe_link.json
delete mode 100644 response_suspicious_link.json
create mode 100644 rxconfig.py
create mode 100644 tests/browser.mjs
create mode 100644 tests/test_build_contract.py
create mode 100644 tests/test_html_boundaries.py
create mode 100644 tests/test_parsing.py
create mode 100644 tests/test_privacy.py
create mode 100644 tests/test_scanning.py
create mode 100644 tests/test_state.py
delete mode 100644 tts_lib/__init__.py
create mode 100644 uv.lock
diff --git a/.github/add_github_hooks.sh b/.github/add_github_hooks.sh
deleted file mode 100755
index a0146d7..0000000
--- a/.github/add_github_hooks.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/bash
-
-# variables
-pre_commit=".git/hooks/pre-commit"
-pre_push=".git/hooks/pre-push"
-
-# pre-commit
-if [ ! -f $pre_commit ]
-then
- echo "make all" > $pre_commit && chmod +x $pre_commit
-fi
-
-# pre-push
-if [ ! -f $pre_push ]
-then
- echo "make all" > $pre_push && chmod +x $pre_push
-fi
\ No newline at end of file
diff --git a/.github/workflows/python-versions.yml b/.github/workflows/python-versions.yml
index a3f978c..4831671 100644
--- a/.github/workflows/python-versions.yml
+++ b/.github/workflows/python-versions.yml
@@ -1,27 +1,72 @@
-name: Python Versions
+name: Demo checks
on: [push, pull_request]
-jobs:
- build:
+permissions:
+ contents: read
+jobs:
+ check:
runs-on: ubuntu-latest
strategy:
+ fail-fast: false
matrix:
- python-version: ["3.8", "3.9", "3.10"]
-
+ python-version: ["3.13", "3.14"]
+ env:
+ UV_PYTHON: ${{ matrix.python-version }}
+ UV_PYTHON_DOWNLOADS: never
+ UV_CACHE_DIR: ${{ github.workspace }}/.cache/uv
+ REFLEX_DIR: ${{ github.workspace }}/.cache/reflex
+ REFLEX_TELEMETRY_ENABLED: "false"
steps:
- - uses: actions/checkout@v3
- - name: Set up Python ${{ matrix.python-version }}
- uses: actions/setup-python@v4
+ - uses: actions/checkout@v4
+ - uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- - name: Install dependencies
+ - uses: astral-sh/setup-uv@v6
+ with:
+ version: "0.12.19"
+ enable-cache: true
+ - name: Install locked dependencies
+ run: make setup
+ - name: Lint, format check, and behavioral tests
+ run: make check
+ - name: Build production frontend with synthetic data only
+ run: make build
+ - name: Verify frontend lock stability
run: |
- make install
- - name: Lint
+ git diff --exit-code -- reflex.lock .gitignore
+ test -z "$(git status --porcelain --untracked-files=all -- reflex.lock)"
+ - uses: actions/setup-node@v4
+ if: matrix.python-version == '3.13'
+ with:
+ node-version: "22.23.2"
+ cache: npm
+ - name: Install browser-test tooling
+ if: matrix.python-version == '3.13'
run: |
- make lint
- - name: Test
+ npm ci --ignore-scripts
+ npx playwright install --with-deps chromium
+ - name: Production browser and accessibility regressions
+ if: matrix.python-version == '3.13'
+ shell: bash
run: |
- make test
+ mkdir -p .scratch
+ setsid uv run --frozen --no-sync reflex run --env prod --backend-host 127.0.0.1 --frontend-port 3157 > .scratch/server.log 2>&1 &
+ server_pid=$!
+ trap 'kill -- -"$server_pid" 2>/dev/null || true' EXIT
+ curl --fail --silent --retry 30 --retry-connrefused --retry-delay 1 http://127.0.0.1:3157/ > /dev/null
+ kill -0 "$server_pid"
+ PHISSION_URL=http://127.0.0.1:3157 npm run test:browser
+ git diff --exit-code -- reflex.lock
+ test -z "$(git status --porcelain --untracked-files=all -- reflex.lock)"
+ - uses: actions/upload-artifact@v4
+ if: always() && matrix.python-version == '3.13'
+ with:
+ name: phission-browser-evidence
+ path: |
+ .scratch/browser-validation/
+ .scratch/server.log
+ include-hidden-files: true
+ if-no-files-found: ignore
+ retention-days: 30
diff --git a/.gitignore b/.gitignore
index c458c25..eb3c3fa 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,144 +1,27 @@
-# Byte-compiled / optimized / DLL files
+# Local environments, caches, and generated builds
+.venv/
+node_modules/
+.cache/
+.web
+.states
+assets/external/
+.scratch/
__pycache__/
*.py[cod]
-*$py.class
-
-# C extensions
-*.so
-
-# Distribution / packaging
-.Python
-build/
-develop-eggs/
-dist/
-downloads/
-eggs/
-.eggs/
-lib/
-lib64/
-parts/
-sdist/
-var/
-wheels/
-pip-wheel-metadata/
-share/python-wheels/
-*.egg-info/
-.installed.cfg
-*.egg
-MANIFEST
-
-# PyInstaller
-# Usually these files are written by a python script from a template
-# before PyInstaller builds the exe, so as to inject date/other infos into it.
-*.manifest
-*.spec
-
-# Installer logs
-pip-log.txt
-pip-delete-this-directory.txt
-
-# Unit test / coverage reports
-htmlcov/
-.tox/
-.nox/
-.coverage
-.coverage.*
-.cache
-nosetests.xml
-coverage.xml
-*.cover
-*.py,cover
-.hypothesis/
.pytest_cache/
-
-# Translations
-*.mo
-*.pot
-
-# Django stuff:
+.ruff_cache/
+.coverage
+htmlcov/
+*.egg-info/
+frontend.zip
+backend.zip
*.log
-local_settings.py
-db.sqlite3
-db.sqlite3-journal
-
-# Flask stuff:
-instance/
-.webassets-cache
-
-# Scrapy stuff:
-.scrapy
-
-# Sphinx documentation
-docs/_build/
-# PyBuilder
-target/
-
-# Jupyter Notebook
-.ipynb_checkpoints
-
-# IPython
-profile_default/
-ipython_config.py
-
-# pyenv
-.python-version
-
-# pipenv
-# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
-# However, in case of collaboration, if having platform-specific dependencies or dependencies
-# having no cross-platform support, pipenv may install dependencies that don't work, or not
-# install all needed dependencies.
-#Pipfile.lock
-
-# PEP 582; used by e.g. github.com/David-OConnor/pyflow
-__pypackages__/
-
-# Celery stuff
-celerybeat-schedule
-celerybeat.pid
-
-# SageMath parsed files
-*.sage.py
-
-# Environments
+# Never add credentials, private messages, databases, or study data
.env
-.venv
-env/
-venv/
-ENV/
-env.bak/
-venv.bak/
-
-# Spyder project settings
-.spyderproject
-.spyproject
-
-# Rope project settings
-.ropeproject
-
-# mkdocs documentation
-/site
-
-# mypy
-.mypy_cache/
-.dmypy.json
-dmypy.json
-
-# Pyre type checker
-.pyre/
-
-# Next.js Generated files
-.web
-pynecone.db
-
-# Private JSON files
-credentials.json
-token.json
-example_email*.json
-response.json
-email*.json
-
-# Private Survey data
+.env.*
+credentials*.json
+token*.json
+*.db
+*.sqlite*
*.xlsx
-!phission_PANAS_results.xlsx
\ No newline at end of file
diff --git a/.python-version b/.python-version
new file mode 100644
index 0000000..24ee5b1
--- /dev/null
+++ b/.python-version
@@ -0,0 +1 @@
+3.13
diff --git a/Makefile b/Makefile
index 0349d08..8746fff 100644
--- a/Makefile
+++ b/Makefile
@@ -1,15 +1,41 @@
-install:
- ./.github/add_github_hooks.sh
- pip install --upgrade pip &&\
- pip install -r requirements.txt
+UV ?= uv
-format:
- black $$(git ls-files "*.py")
+# Keep downloaded tooling and disposable framework state inside the project.
+export UV_CACHE_DIR := $(CURDIR)/.cache/uv
+export REFLEX_DIR := $(CURDIR)/.cache/reflex
+export XDG_CACHE_HOME := $(CURDIR)/.cache
+export BUN_INSTALL_CACHE_DIR := $(CURDIR)/.cache/bun
+export NPM_CONFIG_CACHE := $(CURDIR)/.cache/npm
+export REFLEX_TELEMETRY_ENABLED := false
+export REFLEX_USE_NPM := false
+export REFLEX_USE_SYSTEM_BUN := false
-lint:
- pylint --disable=R,C $$(git ls-files "*.py")
+.PHONY: setup run test lint format check build frontend-tooling
+
+setup:
+ $(UV) sync --frozen
+ $(UV) run --frozen --no-sync reflex init --name phission --no-agents
+
+# Do not let Reflex silently fall back to npm and replace the Bun lock.
+frontend-tooling:
+ @test -x "$(REFLEX_DIR)/bun/bin/bun" || { echo "Run make setup to install project-local Bun."; exit 1; }
+
+# Production mode serves the UI and Python backend together on loopback port 3000.
+run: frontend-tooling
+ $(UV) run --frozen --no-sync reflex run --env prod --backend-host 127.0.0.1
test:
- echo "No tests required"
+ $(UV) run --frozen --no-sync pytest
+
+lint:
+ $(UV) run --frozen --no-sync ruff check .
+ $(UV) run --frozen --no-sync ruff format --check .
+
+format:
+ $(UV) run --frozen --no-sync ruff format .
+
+check: lint test
-all: install format lint
\ No newline at end of file
+# Produces .web/build/client; the interactive app still needs the Python backend.
+build: frontend-tooling
+ $(UV) run --frozen --no-sync reflex export --frontend-only --no-zip
diff --git a/README.md b/README.md
index 8fa106c..4b333ed 100644
--- a/README.md
+++ b/README.md
@@ -1,78 +1,89 @@
-[](https://github.com/primetimetank21/tank-template/actions/workflows/python-versions.yml)
-
-# Phissi👁n
-## TABLE OF CONTENTS
-- [Overview](#overview)
-- [Goals](#goals)
- - [Application Goals](#application)
- - [Usability Test Goals](#usability-test)
-- [Usability Test Findings](#usability-test-findings)
-- [Usage](#how-to-use)
- - [Installation](#installation)
- - [Important Note](#important-note)
-
-## OVERVIEW
-In this age of technology and information, Cyber Attacks are more common than ever before. So
-many applications in use today ask for personal information, and sometimes users mistakenly
-enter their sensitive credentials in non-legitimate applications. Reference [1] mentions that 91% of
-all cyberattacks begin with some sort of phishing message [1].
-
-Prior to the COVID-19 pandemic, phishing attacks were already common in the workplace
-environment. Now that more people work from home, an increasing amount of communication is
-conducted through digital mediums. With more people on their devices each day (i.e.,
-smartphones, computers, tablets, etc.), users are more prone to Cyber Attacks.
-
-Enter Phissi👁n. Phissi👁n is an application that helps its users make more informed decisions as it
-relates to entering personal information. The aim of this software is to truly aid those that are
-more susceptible to Cyber Attacks, primarily phishing attacks (i.e., older people, non-tech savvy
-individuals, differently-abled individuals, etc.).
-
-Phissi👁n seeks to implement a solution similar to the one mentioned in Reference [1]. It is
-important to note that the authors never actually built this solution out, nor did they survey people
-about their thoughts on the interface (i.e., ease of use, visual satisfaction, etc.). In order to
-differentiate ourselves from these authors, we will use the following questions (and more) as
-guidance:
- - Have you or someone you know ever downloaded malware/installed a virus?
- - Have you ever received a phishing email or text message before? How did you respond?
- - Would software like this actually be useful to you? Why or why not?
-By interacting with the potential users of our application (via questions and surveys), we at
-Phissi👁n hope to create a software that will be continuously used to aid in the fight against Cyber
-Attacks.
-## GOALS
-### APPLICATION
-1. Help all users (i.e., non-tech savvy individuals, visually impaired individuals, etc.) create
-more informed decisions before entering sensitive information.
-1. Increase overall awareness of Cyber Attacks.
-1. Reduce the number of successful Cyber Attacks (primarily phishing attacks).
-
-### USABILITY TEST
-- Observe user activities
- - *What* they click on
- - *Where* they navigate to without any guidance / verbal instruction
- - *How* comfortable are they utilizing a new application
-- Measure user trust with…
- - Artificial Intelligence (AI)
- - *How* it sounds
- - Speech speed
- - Speech enunciation
- - Links within emails
- - *What* they look like
-
-## USABILITY TEST FINDINGS
-- Check out the [Usability Testing](https://docs.google.com/presentation/d/19dAL0NC6uRPZGrvOdltecODBf4TGEM53/edit?usp=sharing&ouid=112236559360518646931&rtpof=true&sd=true) presentation for the results of my semester-long research (for Affective Computing and Human Computer Interaction).
-
-## HOW TO USE
-### INSTALLATION
-1. Clone this repository
- - ```git clone git@github.com:primetimetank21/phission.git```
-1. Navigate to the cloned repository directory and create a virtual environment
- - `cd phission`
- - `python3 -m venv .venv`
-1. Activate the environment and install the requirements
- - `source .venv/bin/activate`
- - `make install`
-1. Start the [Pynecone](https://pynecone.io/) server
- - `pc run`
-
-### Important Note
-- Various API keys are needed in order to properly utilize this tool. For more help on this, please contact Earl Tankard, Jr. via email (earl.tankard@bison.howard.edu).
+# Phission
+
+**A little pause. A clearer perspective.**
+
+Phission is an interactive learning workspace for looking more carefully at email requests and link destinations. This release is a **synthetic-only demo**, not a security product or a live phishing detector.
+
+Choose one of five authored emails, select a link, and explicitly run demo analysis. Every result is **simulated**. No email URL is opened, fetched, or submitted to a service. There is no mailbox connection, credential setup, arbitrary URL input, upload feature, analytics, database, or hidden live-mode switch.
+
+## Run locally
+
+Requirements: [uv](https://docs.astral.sh/uv/), Python **3.13 or 3.14**, and the platform prerequisites in the [Reflex installation guide](https://reflex.dev/docs/getting-started/installation/) (including `unzip` on Linux). Python dependencies are locked in `uv.lock`; Reflex is pinned to **0.9.12**. The generated `reflex.lock/bun.lock` and `reflex.lock/package.json` pin frontend dependencies. `.python-version` selects Python 3.13 by default. This setup is validated on Linux/WSL; native Windows and macOS are not yet verified.
+
+```sh
+make setup # locked Python dependencies + initialize project-local Bun
+make run
+```
+
+Open **http://127.0.0.1:3000**. `make run` builds and serves the frontend and Python backend together in production mode, bound to loopback. Stop it with Ctrl+C. Changes require a restart/rebuild. The Makefile invokes uv with the committed lockfile and keeps the uv cache in `.cache/uv`.
+
+Dependencies and the first frontend build require network downloads. `make setup` initializes Reflex's project-local **Bun 1.4.0**; app builds do not require a separate Node/npm installation. The Makefile selects local Bun and refuses to build if it is missing, preventing silent npm fallback and lock replacement. `rxconfig.py` enables frozen frontend installs; CI also checks that the frontend lock files stay unchanged. The Makefile keeps downloaded tooling and caches under the project’s ignored `.cache/`, with the virtual environment in `.venv/`. Framework telemetry is disabled in `rxconfig.py` and the Makefile. Runtime example analysis itself does not use external services. System fonts and local assets are used; there are no remote fonts, CDNs, or embedded media.
+
+To select Python 3.14 explicitly, use `UV_PYTHON=3.14 make setup` and the same `UV_PYTHON=3.14` prefix on subsequent commands. Do not add API keys or real email to this repository.
+
+## Check and build
+
+After installing dependencies:
+
+```sh
+make check # Ruff lint + formatting check, then pytest
+make test # behavioral tests only
+make format # explicitly apply Ruff formatting
+make build # optimized production frontend in .web/build/client/
+```
+
+Check/test targets do not install dependencies, write Git hooks, or modify source. CI runs checks and a production build on Python 3.13 and 3.14. Tests cover MIME/header/Unicode handling, nested HTML destinations, duplicates and prefix-overlapping links, incomplete coverage, malformed responses, score boundaries including zero, target isolation, loading/empty/error states, and credential-free application import/runtime with outbound connections blocked.
+
+### Browser regressions (optional locally, required in CI)
+
+With `make run` active in one terminal, use a second terminal with **Node 22.23.2+**:
+
+```sh
+npm ci --ignore-scripts
+npx playwright install chromium
+npm run test:browser
+```
+
+Chromium also needs its [platform libraries](https://playwright.dev/docs/browsers#install-system-dependencies). These Node dependencies are **test tooling only**, separate from the app's Bun frontend lock. Set `PHISSION_URL=http://127.0.0.1:3157` if using another local port. The checks cover keyboard navigation, score/unknown/no-links flows, session isolation, responsive widths, four axe accessibility scans, no-JS messaging, nested 404s and attempted external browser requests. Screenshots and JSON evidence go to ignored `.scratch/browser-validation/`; CI retains them as artifacts for 30 days. Automated accessibility checks are not a screen-reader or physical-device audit.
+
+For deliberate dependency updates, regenerate and review both frontend lock files with the pinned Bun/Reflex toolchain, then verify a clean build leaves them unchanged. Do not delete a lock or switch package managers merely to make CI pass.
+
+**This is not a standalone static site.** JavaScript and a running Reflex Python backend/WebSocket connection are required for inbox selection and analysis. An exported frontend alone does not make the demo interactive. Production Reflex 0.9.12 serves both parts on a single port; see the [self-hosting documentation](https://reflex.dev/docs/hosting/self-hosting/) before any separate deployment work. This repository does not provision or deploy a service. Do not use a development server as a public deployment.
+
+## What is real, and what is simulated?
+
+| Real application logic | Authored simulation |
+| -------------------------------------------------------- | ---------------------------------------------------------------- |
+| Standard-library RFC822/MIME parsing | All five emails, names and destinations |
+| Plain text and HTML anchor extraction | Local IPQS-shaped result objects |
+| Validation of provider success and integer score range | Scores, concern levels and unavailable result |
+| Per-session target selection and stale-result prevention | No live reputation lookup or independent phishing classification |
+
+The scenarios include an ordinary workshop notice, an urgent credential lure, a friendly HTML label pointing to a different destination, an unavailable result with an uninspected attachment, and a note without links. Destinations use reserved `.example`/`.test` domains; the recipient uses `example.org`.
+
+A score of **0 is valid**, not an error. Values 0–74 represent a lower signal, 75–84 caution, and 85–100 high concern in this demonstration. These illustrative thresholds are not validated detection performance. A score is **not a probability or a guarantee of safety**. Invalid responses are errors; unavailable results are unknown, not safe. The normalizer accepts already-decoded Python objects and validates them; there is deliberately **no live HTTP/JSON transport adapter**, timeout/retry layer, or provider authentication.
+
+## Architecture and limits
+
+One Python Reflex application; no separate API service, database, queues, or new machine learning.
+
+- `phission/models.py`: typed messages, extracted links, coverage and scan outcomes.
+- `phission/parsing.py`: bounded stdlib MIME parser (256 KB / 100 parts), decoded headers/text, HTML-to-text conversion and HTTP(S) link extraction.
+- `phission/fixtures/` and `phission/demo.py`: fixed synthetic manifest and deterministic, message-and-URL-bound responses. Files load on the inbox event, not on module import.
+- `phission/scanning.py`: success/unknown/error normalization, separate score and cautious guidance.
+- `phission/state.py`: in-memory per-session selection/results. Nothing is persisted to disk; a server restart loses sessions. No deep-link or browser-history routing for message selection.
+- `phission/phission.py` and `assets/styles.css`: one fixed page, semantic controls and responsive reading workspace. No runtime page generation or compilation on inbox actions.
+
+Original email HTML is never rendered. The reading pane shows plain text; extracted destinations and HTML labels are shown separately, as text inside selection buttons. Text is not destructively rewritten to replace URLs. Attachments, embedded messages, image-only content, relative/non-HTTP links, redirects, obfuscated destinations and some malformed content are outside parsing coverage. Partial, unsupported and malformed messages are distinguished from “no HTTP(S) links found.” This bounded parser is not a production email sanitizer or a comprehensive threat detector.
+
+### Accessibility
+
+The interface uses semantic buttons/headings/landmarks, visible keyboard focus, selected-state text, a polite live status region, reduced-motion styling and a mobile back-to-messages link. Message selection moves focus to the reading heading; tab to destinations and use Enter/Space to select and analyze. Warnings use text, not color alone. Original images and HTML are not embedded.
+
+Read-aloud is **not included** in this slice: there is no server speech engine or browser speech service. Browser/OS reading tools and assistive technology may be used independently. JavaScript-disabled users can read the static introduction and limitation text but cannot interact with the demo. Browser, mobile viewport and assistive-technology checks complement the unit tests; those tests alone do not establish accessibility conformance or physical-device support.
+
+## Historical context
+
+The original Phission prototype was built in **2023 for HCI and affective-computing coursework**, including usability testing. The original findings are no longer available. This refresh does not make outcome claims or reinterpret historical survey scores.
+
+The original Gmail/IPQS integrations, server-local speech, Pynecone configuration, database and raw study artifacts are retired from the maintained tree. They are not archived as a second application. The historical source remains available at exact commit [`0ced1f54baccc2ed6abd307d43971e82315c3961`](https://github.com/primetimetank21/phission/tree/0ced1f54baccc2ed6abd307d43971e82315c3961). No history has been rewritten. Reintroducing real mail or live scanning would require a separate security/privacy scope, not an environment-variable toggle.
diff --git a/assets/eye.svg b/assets/eye.svg
new file mode 100644
index 0000000..f7b1115
--- /dev/null
+++ b/assets/eye.svg
@@ -0,0 +1 @@
+
diff --git a/assets/favicon.ico b/assets/favicon.ico
deleted file mode 100644
index 8a93bfa72ad182e4a21385b6daac8106eb16158e..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 15406
zcmeI1X{eP|6o$X6=1^H?2{!4mEF>DV%qEJ+XwD)Eq!1b?3Mm>iiXyZhO%M$blz_D|T2;5xVnUIG6s)LsOQnbRF^BQOt6h11}ph1&XznbQ@9;JgF!iByZ>&u~Ja
zwmxI#nA;U*;QR<41-<__3$^tbGp9Q^Kks=KysOw=-wkJ#Yje88^#sgc4M)PS;Mc|0
zXUv@LFqyy_I0a6JCl_k#GiFYA*q*?_@GNMriwd>%88heK(2s=I;L1X6eLcZ`B)eav
zb|binBDvMVbEXE5g`Q7sv{#_P6&Ot2qppq*ppT4SvmYN^>%
zOsBwioXbn$0>OO8!rlXpg7Ll+u{;_x$6RY7rdCf;
zf9}jL0#`DIZvA*w$uT#_8aao2AIlorXTtt4_H~ZC|BRWF{n~2v6gyCm&lq*Sf%<*l
z^I3~Ne$M)gnG=3THS{-vk15Jp%ek%
+
+--benefits-alternative--
diff --git a/phission/fixtures/garden.eml b/phission/fixtures/garden.eml
new file mode 100644
index 0000000..568e027
--- /dev/null
+++ b/phission/fixtures/garden.eml
@@ -0,0 +1,16 @@
+fRoM: robin@garden.example
+tO: alex@example.org
+sUbJeCt: Thanks for lending a hand
+Date: Tue, 16 Jun 2026 16:00:00 +0000
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf-8
+Content-Transfer-Encoding: 8bit
+
+Hi Alex,
+
+A quick thank-you for helping with the community garden yesterday. The new seedlings look great!
+
+We’ll meet by the blue gate next Saturday at 9 am. Bring gloves if you have them. No forms, payments or sign-ups needed.
+
+See you soon,
+Robin
diff --git a/phission/fixtures/library.eml b/phission/fixtures/library.eml
new file mode 100644
index 0000000..18b4391
--- /dev/null
+++ b/phission/fixtures/library.eml
@@ -0,0 +1,19 @@
+From: Maple Library
+To: Alex Morgan
+Subject: Your Saturday workshop is booked
+Date: Thu, 18 Jun 2026 10:30:00 +0000
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf-8
+Content-Transfer-Encoding: 8bit
+
+Hi Alex,
+
+You’re on the list for our repair café this Saturday at 10 am. Bring one small item and a little curiosity — we’ll provide the tools.
+
+Workshop details: https://library.example/workshops/repair-cafe
+All upcoming events: https://library.example/workshops
+
+There’s nothing to pay and no need to sign in from this email.
+
+See you there,
+The Maple Library team
diff --git a/phission/fixtures/parcel.eml b/phission/fixtures/parcel.eml
new file mode 100644
index 0000000..22d8ec7
--- /dev/null
+++ b/phission/fixtures/parcel.eml
@@ -0,0 +1,34 @@
+From: Parcel Desk
+To: Alex Morgan
+Subject: An update on your delivery
+Date: Wed, 17 Jun 2026 11:20:00 +0000
+MIME-Version: 1.0
+Content-Type: multipart/mixed; boundary="parcel-mixed"
+
+--parcel-mixed
+Content-Type: multipart/alternative; boundary="parcel-text"
+
+--parcel-text
+Content-Type: text/plain; charset=utf-8
+
+Hi Alex,
+
+There’s a new delivery update. You can check the reference here:
+https://parcel.example/track/DEMO-204
+
+If you weren’t expecting a parcel, check directly with the shop using your original order confirmation.
+
+Parcel Desk
+--parcel-text
+Content-Type: text/html; charset=utf-8
+
+
Hi Alex,
There’s a new delivery update.
+Delivery reference
+--parcel-text--
+--parcel-mixed
+Content-Type: application/octet-stream
+Content-Disposition: attachment; filename="demo-receipt.txt"
+Content-Transfer-Encoding: base64
+
+U3ludGhldGljIGF0dGFjaG1lbnQgb25seS4=
+--parcel-mixed--
diff --git a/phission/fixtures/urgent.eml b/phission/fixtures/urgent.eml
new file mode 100644
index 0000000..16e25ee
--- /dev/null
+++ b/phission/fixtures/urgent.eml
@@ -0,0 +1,17 @@
+From: Account Support
+To: Alex Morgan
+Subject: Action required: your account closes today
+Date: Thu, 18 Jun 2026 09:45:00 +0000
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf-8
+
+FINAL NOTICE
+
+Your account will be suspended in 30 minutes unless you confirm your password. Do not contact your usual support team; they cannot prevent this closure.
+
+Confirm your account now:
+https://account-review.test/verify?source=email&step=confirm#account
+
+This request is urgent. Reply with your recovery code if the page does not load.
+
+Account Support
diff --git a/phission/models.py b/phission/models.py
new file mode 100644
index 0000000..1a93487
--- /dev/null
+++ b/phission/models.py
@@ -0,0 +1,48 @@
+"""Small, framework-independent values. Nothing here performs I/O."""
+
+from dataclasses import dataclass
+from enum import StrEnum
+
+
+class ContentStatus(StrEnum):
+ ANALYZED = "analyzed"
+ PARTIAL = "partial"
+ UNSUPPORTED = "unsupported"
+ MALFORMED = "malformed"
+
+
+@dataclass(frozen=True)
+class ExtractedLink:
+ url: str
+ labels: tuple[str, ...] = ()
+
+
+@dataclass(frozen=True)
+class Message:
+ id: str
+ subject: str
+ sender_name: str
+ sender_address: str
+ recipient: str
+ date: str
+ body: str
+ links: tuple[ExtractedLink, ...]
+ content_status: ContentStatus
+ notes: tuple[str, ...] = ()
+
+
+class ScanStatus(StrEnum):
+ SUCCESS = "success"
+ UNKNOWN = "unknown"
+ ERROR = "error"
+
+
+@dataclass(frozen=True)
+class ScanOutcome:
+ message_id: str
+ url: str
+ status: ScanStatus
+ score: int | None
+ title: str
+ explanation: str
+ guidance: str
diff --git a/phission/parsing.py b/phission/parsing.py
new file mode 100644
index 0000000..359416b
--- /dev/null
+++ b/phission/parsing.py
@@ -0,0 +1,278 @@
+"""Bounded RFC822 parsing, not an email renderer or a complete security scanner.
+
+Inspect inline plain text and HTML HTTP(S) anchors without fetching anything.
+Original HTML is never returned. Attachments and other MIME types are not analyzed.
+"""
+
+import re
+import unicodedata
+from email import policy
+from email.message import Message as MimeMessage
+from email.parser import BytesParser
+from email.utils import parseaddr
+from html.parser import HTMLParser
+from urllib.parse import urlsplit
+
+from phission.models import ContentStatus, ExtractedLink, Message
+
+MAX_MESSAGE_BYTES = 256_000
+MAX_PARTS = 100
+URL_PATTERN = re.compile(r"https?://[^\s<>\"']+", re.IGNORECASE)
+BLOCK_TAGS = {
+ "address",
+ "article",
+ "aside",
+ "blockquote",
+ "br",
+ "dd",
+ "div",
+ "dl",
+ "dt",
+ "fieldset",
+ "figcaption",
+ "figure",
+ "footer",
+ "form",
+ "h1",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "h6",
+ "header",
+ "hr",
+ "li",
+ "main",
+ "nav",
+ "ol",
+ "p",
+ "pre",
+ "section",
+ "table",
+ "tbody",
+ "td",
+ "tfoot",
+ "th",
+ "thead",
+ "tr",
+ "ul",
+}
+MEDIA_TAGS = {"img", "picture", "video", "audio", "canvas", "iframe", "object", "svg", "embed"}
+HIDDEN_TAGS = {
+ "script",
+ "style",
+ "head",
+ "template",
+ "iframe",
+ "object",
+ "svg",
+ "canvas",
+ "video",
+ "audio",
+}
+
+
+def plain_text(value: str) -> str:
+ """Remove control/bidi formatting characters; retain ordinary Unicode text."""
+ return "".join(
+ char
+ for char in value.replace("\r\n", "\n").replace("\r", "\n")
+ if char in "\n\t" or not unicodedata.category(char).startswith("C")
+ ).strip()
+
+
+def is_http_url(value: str) -> bool:
+ """Validate syntax only; preserve the exact destination, query and fragment."""
+ if any(c.isspace() or unicodedata.category(c).startswith("C") for c in value):
+ return False
+ try:
+ parsed = urlsplit(value)
+ return bool(
+ parsed.scheme.lower() in {"http", "https"}
+ and parsed.hostname
+ and parsed.port != 0
+ and not any(c in value for c in '<>"\\')
+ )
+ except ValueError:
+ return False
+
+
+def text_urls(text: str) -> list[str]:
+ urls = []
+ for match in URL_PATTERN.finditer(text):
+ url = match.group().rstrip(".,;:!?")
+ for opening, closing in [("(", ")"), ("[", "]"), ("{", "}")]:
+ while url.endswith(closing) and url.count(closing) > url.count(opening):
+ url = url[:-1]
+ if is_http_url(url):
+ urls.append(url)
+ return urls
+
+
+class _HTMLText(HTMLParser):
+ """Keep visible text and anchor destinations, never markup or embedded media."""
+
+ def __init__(self) -> None:
+ super().__init__(convert_charrefs=True)
+ self.text: list[str] = []
+ self.links: list[tuple[str, str]] = []
+ self.hidden: list[str] = []
+ self.anchor: str | None = None
+ self.label: list[str] = []
+ self.omitted_media = False
+
+ def _separator(self) -> None:
+ self.text.append("\n")
+ if self.anchor:
+ self.label.append(" ")
+
+ def _finish_anchor(self) -> None:
+ if self.anchor:
+ self.links.append((self.anchor, plain_text("".join(self.label))))
+ self.anchor = None
+ self.label = []
+
+ def handle_starttag(self, tag: str, attrs: list[tuple[str, str | None]]) -> None:
+ if tag in MEDIA_TAGS:
+ self.omitted_media = True
+ if tag in HIDDEN_TAGS:
+ self._separator()
+ self.hidden.append(tag)
+ if self.hidden:
+ return
+ if tag in BLOCK_TAGS or tag in MEDIA_TAGS:
+ self._separator()
+ if tag == "a":
+ self._finish_anchor()
+ href = dict(attrs).get("href") or ""
+ self.anchor = href if is_http_url(href) else None
+
+ def handle_endtag(self, tag: str) -> None:
+ if self.hidden:
+ if tag == self.hidden[-1]:
+ self.hidden.pop()
+ self._separator()
+ return
+ if tag == "a":
+ self._finish_anchor()
+ if tag in BLOCK_TAGS or tag in MEDIA_TAGS:
+ self._separator()
+
+ def handle_data(self, data: str) -> None:
+ if not self.hidden:
+ self.text.append(data)
+ if self.anchor:
+ self.label.append(data)
+
+ def finish(self) -> tuple[str, list[tuple[str, str]]]:
+ self.close()
+ self._finish_anchor()
+ raw_text = "".join(self.text)
+ # Sanitize display text separately: removing a control character must not
+ # manufacture a different, apparently valid destination for analysis.
+ return plain_text(raw_text), self.links + [(url, "") for url in text_urls(raw_text)]
+
+
+def parse_message(raw: bytes, message_id: str) -> Message:
+ """Return an explicit coverage state even for malformed/unsupported messages.
+
+ Missing headers are harmless. MIME/decoding defects mark partial coverage;
+ one bad message must not prevent the rest of a synthetic inbox from loading.
+ """
+ fallback = Message(
+ id=message_id,
+ subject="Unreadable message",
+ sender_name="Unknown sender",
+ sender_address="Not provided",
+ recipient="Not provided",
+ date="Not provided",
+ body="This message could not be analyzed.",
+ links=(),
+ content_status=ContentStatus.MALFORMED,
+ notes=("Malformed message or demo parsing limit exceeded.",),
+ )
+ if not isinstance(raw, bytes) or not raw or len(raw) > MAX_MESSAGE_BYTES:
+ return fallback
+ try:
+ root = BytesParser(policy=policy.default).parsebytes(raw)
+ notes: list[str] = []
+ destinations: dict[str, list[str]] = {}
+ analyzed = 0
+ parts_seen = 0
+
+ def inspect(part: MimeMessage) -> str:
+ nonlocal analyzed, parts_seen
+ parts_seen += 1
+ if parts_seen > MAX_PARTS:
+ raise ValueError("Too many MIME parts")
+ if part.defects:
+ notes.append("Malformed MIME structure; coverage may be incomplete.")
+ kind = part.get_content_type()
+ if part.get_content_disposition() == "attachment":
+ notes.append("Attachments are not analyzed.")
+ return ""
+ if part.is_multipart() and kind.startswith("multipart/"):
+ children = list(part.iter_parts())
+ bodies = [inspect(child) for child in children]
+ if kind == "multipart/alternative":
+ # Analyze all alternatives, but avoid displaying duplicate bodies.
+ for child, body in zip(children, bodies, strict=True):
+ if child.get_content_type() == "text/plain" and body:
+ return body
+ return next((body for body in bodies if body), "")
+ return "\n\n".join(body for body in bodies if body)
+ if kind not in {"text/plain", "text/html"}:
+ notes.append("Unsupported MIME content is not analyzed.")
+ return ""
+ payload = part.get_payload(decode=True)
+ if not isinstance(payload, bytes):
+ notes.append("A text part could not be decoded.")
+ return ""
+ try:
+ text = payload.decode(part.get_content_charset() or "utf-8")
+ except (UnicodeError, LookupError):
+ notes.append("Some characters could not be decoded reliably.")
+ text = payload.decode("utf-8", errors="replace")
+ if part.defects:
+ notes.append("Malformed transfer encoding; coverage may be incomplete.")
+ if kind == "text/html":
+ html = _HTMLText()
+ html.feed(text)
+ body, links = html.finish()
+ if html.omitted_media:
+ notes.append("Images and embedded media are not analyzed.")
+ if body or links:
+ analyzed += 1
+ else:
+ notes.append("HTML has no readable inline text or supported links.")
+ else:
+ analyzed += 1
+ body = plain_text(text)
+ links = [(url, "") for url in text_urls(text)]
+ for url, label in links:
+ labels = destinations.setdefault(url, [])
+ if label and label not in labels:
+ labels.append(label)
+ return body
+
+ body = inspect(root)
+ sender_name, sender_address = parseaddr(str(root.get("From", "")))
+ status = ContentStatus.ANALYZED
+ if not analyzed:
+ status = ContentStatus.UNSUPPORTED
+ elif notes:
+ status = ContentStatus.PARTIAL
+ return Message(
+ id=message_id,
+ subject=plain_text(str(root.get("Subject", ""))) or "(No subject)",
+ sender_name=plain_text(sender_name or sender_address) or "Unknown sender",
+ sender_address=plain_text(sender_address) or "Not provided",
+ recipient=plain_text(str(root.get("To", ""))) or "Not provided",
+ date=plain_text(str(root.get("Date", ""))) or "Not provided",
+ body=body or "No readable inline text is available.",
+ links=tuple(ExtractedLink(url, tuple(labels)) for url, labels in destinations.items()),
+ content_status=status,
+ notes=tuple(dict.fromkeys(notes)),
+ )
+ except (ValueError, TypeError, UnicodeError, LookupError, RecursionError):
+ return fallback
diff --git a/phission/phission.py b/phission/phission.py
index 29b8197..f687166 100644
--- a/phission/phission.py
+++ b/phission/phission.py
@@ -1,210 +1,388 @@
-# type: ignore
-# pylint: disable=no-member, no-value-for-parameter, redefined-outer-name,fixme
-
-# TODO: style app more!
-# - css and pseudo chakra props: https://chakra-ui.com/docs/styled-system/style-props#pseudo
-
-import pynecone as pc
-from time import sleep
-from email_lib import get_all_messages
-from phishing_lib import get_IPQS
-from tts_lib import tts
-from .styles import app_style, BLACK, WHITE
-from components import email_panel_component
-from components.email_panel import set_email_page_routes
-
-
-# State
-class State(pc.State):
- """The app state."""
-
- # credentials for Gmail API
- user_email: str = "jhnwck2023@gmail.com"
- user_password: str = "password123EZ"
-
- # Gmail API messages
- email_messages: list = []
-
- # index variables
- url: str = ""
- url_display: str = ""
- risk_score: int = None
-
- ipqs: dict = {}
-
- def get_emails(self):
- reloads = 3
- emails = []
- while len(emails) == 0:
- if reloads >= 0:
- try:
- emails = get_all_messages()
- print(f"Length of email_messages: {len(emails)}")
- set_email_page_routes(emails, app)
- self.email_messages = emails
- break
- except Exception as e: # pylint: disable=broad-exception-caught
- print(f"Error in 'get_emails()': {e}")
- finally:
- reloads -= 1
- sleep(5)
- else:
- break
-
- @pc.var
- def display_score(self):
- if len(self.url_display) > 0 and self.risk_score is not None:
- return True
- else:
- return False
-
- @pc.var
- def get_risk_str(self) -> str:
- risk_score = self.risk_score
- if risk_score == 0 or not risk_score:
- return "somewhat safe"
-
- risk_lvl = ""
- if risk_score >= 85:
- risk_lvl = "high risk"
- elif risk_score >= 75:
- risk_lvl = "suspicious"
- else:
- risk_lvl = "somewhat safe"
-
- return risk_lvl
-
- def set_IPQS(self, url: str, mod_link: str):
- self.url = url
- score = get_IPQS(url)
- self.ipqs = score
-
- # TODO: remove this print statement
- print(f"SCORE: {score}")
- self.url_display = mod_link
- if score:
- self.risk_score = score["risk_score"]
- else:
- self.risk_score = -1
-
- def tts_speak(self, text: str, rate: int = 185, voice: str = "english"):
- tts(text, rate=rate, voice=voice)
- print(f"Text: {text}")
-
-
-class EmailPanelState(State):
- text_color: str = WHITE
-
- def set_text_color(self, color: str):
- self.text_color = color
-
- @pc.var
- def number_of_email_messages(self):
- return len(self.email_messages)
-
- @pc.var
- def email_message_subjects(self) -> list:
- if len(self.email_messages) == 0:
- return []
-
- subjects = [email["Subject"] for email in self.email_messages]
- print(f"email_message_subjects:{subjects}")
- return subjects
-
- @pc.var
- def display_email_message_subjects(self):
- if len(self.email_messages) > 0:
- return True
- else:
- return False
-
-
-@pc.route(route="/", title="Phissi👁️n Home")
-def index() -> pc.Component:
- WELCOME_MESSAGE = "Welcome to Phission."
- PURPOSE_MESSAGE = """
- The purpose of this application is to help all users, specifically non-tech savvy individuals,
- visually impaired individuals, et cetera., create more informed decisions as it relates to their emails.
- Phission seeks to increase the overall awareness of Cyber Attacks. We also want to reduce the number of
- successful Cyber Attacks, primarily phishing attacks. Hence the name Phission -- Vision against Phishing
- attacks. Through this prototype, my creator hopes that you, the user, can see the value in an application
- like this. Thanks for your time and have fun!
- """
- INSTRUCTIONS_MESSAGE = """
- This application assumes that you are already logged in and are viewing your emails. By using this tool,
- you are trying to see if there are any potentially dangerous or malicious links that were sent to you via
- email. The panels below will each take you to a different email message in your inbox. Please click on one to get started.
- """
- HELP_MESSAGE = """
- Just about everything in this application is clickable, so click away! Click the 'Purpose of Phission' or 'Instructions'
- buttons and I will share the necessary content.
- """
- return pc.center(
- pc.vstack(
- pc.divider(),
- pc.heading(
- "Welcome to Phissi👁️n!",
- font_size="5em",
- on_click=[
- lambda: State.tts_speak(WELCOME_MESSAGE, 100),
- lambda: State.tts_speak(PURPOSE_MESSAGE, 175),
- lambda: State.tts_speak(
- f"I will now read you the instructions: {INSTRUCTIONS_MESSAGE}",
- 150,
+"""One fixed, data-driven Reflex page. Email HTML and URLs are never rendered as links."""
+
+import reflex as rx
+
+from phission.demo import SCENARIOS
+from phission.models import ExtractedLink, Message
+from phission.state import DemoState as State
+
+HISTORY_URL = (
+ "https://github.com/primetimetank21/phission/tree/0ced1f54baccc2ed6abd307d43971e82315c3961"
+)
+
+
+def eyebrow(text: str) -> rx.Component:
+ return rx.el.p(text, class_name="eyebrow")
+
+
+def message_card(message: rx.Var[Message]) -> rx.Component:
+ return rx.el.li(
+ rx.el.button(
+ rx.el.span(
+ rx.el.span(message.sender_name, class_name="sender-name"),
+ rx.cond(
+ State.selected_id == message.id,
+ rx.el.span("Selected", class_name="selected-tag"),
+ ),
+ class_name="message-card-top",
+ ),
+ rx.el.span(message.subject, class_name="message-subject"),
+ rx.el.span(
+ rx.match(message.id, *SCENARIOS.items(), "Synthetic example"),
+ class_name="message-scenario",
+ ),
+ type="button",
+ class_name="message-card",
+ on_click=[State.select_message(message.id), rx.set_focus("message-heading")],
+ custom_attrs={"aria-pressed": State.selected_id == message.id},
+ )
+ )
+
+
+def inbox() -> rx.Component:
+ return rx.el.aside(
+ rx.el.div(
+ rx.el.div(
+ eyebrow("01 / CHOOSE A MESSAGE"),
+ rx.el.h2("The demo inbox", id="inbox-title", tab_index=-1),
+ ),
+ rx.el.span("5 examples", class_name="count-tag"),
+ class_name="panel-heading inbox-heading",
+ ),
+ rx.el.p("A few familiar situations. A little room to pause.", class_name="muted"),
+ rx.el.ul(rx.foreach(State.messages, message_card), class_name="message-list"),
+ rx.el.div(
+ rx.el.strong("Nothing here is your email."),
+ rx.el.p("These messages were written for this demo. Your inbox is never connected."),
+ class_name="inbox-note",
+ ),
+ class_name="inbox",
+ custom_attrs={"aria-labelledby": "inbox-title"},
+ )
+
+
+def link_choice(link: rx.Var[ExtractedLink], index: rx.Var[int]) -> rx.Component:
+ return rx.el.li(
+ rx.el.button(
+ rx.el.span(
+ rx.el.span("Link ", index + 1, class_name="link-number"),
+ rx.cond(
+ State.selected_url == link.url,
+ rx.el.span("Selected", class_name="selected-tag"),
+ rx.el.span("Select to inspect", class_name="link-action"),
+ ),
+ class_name="link-top",
+ ),
+ rx.el.span(link.url, class_name="url-text"),
+ rx.foreach(
+ link.labels,
+ lambda label: rx.el.span("Label in email: “", label, "”", class_name="link-label"),
+ ),
+ type="button",
+ class_name="link-choice",
+ on_click=State.select_link(link.url),
+ custom_attrs={"aria-pressed": State.selected_url == link.url},
+ ),
+ )
+
+
+def result() -> rx.Component:
+ return rx.el.section(
+ rx.el.div(
+ rx.el.span("SIMULATED RESULT", class_name="eyebrow"),
+ rx.el.span(State.result_score, class_name="score-label"),
+ class_name="result-top",
+ ),
+ rx.el.h4(
+ rx.match(
+ State.result_tone,
+ ("high", rx.icon("triangle-alert", size=22, aria_hidden=True)),
+ ("caution", rx.icon("circle-alert", size=22, aria_hidden=True)),
+ ("unknown", rx.icon("circle-help", size=22, aria_hidden=True)),
+ rx.icon("info", size=22, aria_hidden=True),
+ ),
+ State.result_title,
+ id="result-title",
+ ),
+ rx.el.p("For this destination only", class_name="result-target-label"),
+ rx.el.p(State.selected_url, class_name="url-text result-target"),
+ rx.el.p(State.result_explanation),
+ rx.el.div(
+ rx.el.strong("A sensible next step"),
+ rx.el.p(State.result_guidance),
+ class_name="guidance",
+ ),
+ rx.el.p(
+ "A fixture score is not a probability, a live assessment or a safety guarantee.",
+ class_name="result-disclaimer",
+ ),
+ class_name="result",
+ custom_attrs={
+ "data-tone": State.result_tone,
+ "aria-labelledby": "result-title",
+ },
+ )
+
+
+def inspector() -> rx.Component:
+ return rx.el.section(
+ eyebrow("03 / LOOK AT THE DESTINATION"),
+ rx.el.h3("A closer look at the links", id="links-heading"),
+ rx.el.p(
+ "Select a destination, then reveal its demo result. These controls never "
+ "open the URL or submit it to a service.",
+ class_name="muted",
+ ),
+ rx.el.p(State.coverage, class_name="coverage"),
+ rx.cond(
+ State.links.length() > 0,
+ rx.el.div(
+ rx.el.ul(rx.foreach(State.links, link_choice), class_name="link-list"),
+ rx.el.div(
+ rx.el.button(
+ rx.cond(
+ State.analysis_phase == "loading",
+ "Reading local fixture…",
+ "Run demo analysis",
+ ),
+ type="button",
+ on_click=State.analyze,
+ disabled=(State.selected_url == "") | (State.analysis_phase == "loading"),
+ class_name="primary-button",
),
- lambda: State.tts_speak(
- f"If you missed any of what I just explained, {HELP_MESSAGE}",
- 140,
+ rx.el.p(
+ rx.cond(
+ State.selected_url == "",
+ "Choose a link above to begin.",
+ "Deterministic fixture · no live scan",
+ ),
+ class_name="action-hint",
),
- ],
- color=BLACK,
- # _hover={"cursor": "pointer", "font_size": "5.1em", "color": "#f56e00"},
- _hover={"cursor": "pointer", "font_size": "5.1em", "color": "#FF7704"},
- ),
- pc.button_group(
- pc.button(
- "Help",
- color="white",
- bg="#FF7704",
- _hover={"bg": "#c25700"},
- on_click=[
- lambda: State.tts_speak(HELP_MESSAGE, 185),
- lambda: State.tts_speak(
- "You can also click on the 'Welcome to Phission' (at the top of the screen) to hear everything I have to say!",
- 175,
+ class_name="analysis-action",
+ ),
+ rx.cond(State.result_visible, result()),
+ custom_attrs={"aria-busy": State.analysis_phase == "loading"},
+ ),
+ rx.el.div(
+ rx.el.strong(State.empty_links_title),
+ rx.el.p(
+ "This is not a safety verdict. Requests in the wording, unsupported "
+ "content and attachments can still require caution."
+ ),
+ class_name="empty-links",
+ ),
+ ),
+ class_name="inspector",
+ custom_attrs={"aria-labelledby": "links-heading"},
+ )
+
+
+def reading_pane() -> rx.Component:
+ return rx.el.article(
+ rx.el.a(
+ "← Back to messages",
+ href="#inbox-title",
+ on_click=rx.set_focus("inbox-title"),
+ class_name="back-link",
+ ),
+ eyebrow("02 / READ WITH A LITTLE DISTANCE"),
+ rx.el.h2(State.current_message.subject, id="message-heading", tab_index=-1),
+ rx.cond(
+ State.selected_id != "",
+ rx.el.div(
+ rx.el.dl(
+ rx.el.div(
+ rx.el.dt("From"),
+ rx.el.dd(
+ State.current_message.sender_name,
+ rx.el.span(
+ State.current_message.sender_address,
+ class_name="sender-address",
+ ),
),
- ],
+ ),
+ rx.el.div(rx.el.dt("To"), rx.el.dd(State.current_message.recipient)),
+ class_name="message-meta",
+ ),
+ rx.el.div(
+ rx.el.span("SYNTHETIC EMAIL", class_name="email-caption"),
+ rx.el.p(State.current_message.body, class_name="email-body"),
+ class_name="email-paper",
+ ),
+ rx.el.p(
+ "Plain-text reading view. Original HTML, images and attachments "
+ "are not displayed.",
+ class_name="reading-note",
+ ),
+ inspector(),
+ ),
+ rx.el.p("Choose one of the synthetic messages in the demo inbox."),
+ ),
+ class_name="reading-pane",
+ custom_attrs={"aria-labelledby": "message-heading"},
+ )
+
+
+def unavailable_inbox() -> rx.Component:
+ return rx.el.div(
+ rx.el.h2(
+ rx.match(
+ State.inbox_status,
+ ("loading", "Preparing the demo inbox…"),
+ ("empty", "No examples available"),
+ "The demo inbox could not load",
+ )
+ ),
+ rx.el.p("Only local synthetic fixtures are used. No inbox connection is needed."),
+ rx.cond(
+ State.inbox_status != "loading",
+ rx.el.button(
+ "Load examples again",
+ type="button",
+ on_click=State.load,
+ class_name="primary-button",
+ ),
+ ),
+ class_name="unavailable-inbox",
+ )
+
+
+def about() -> rx.Component:
+ return rx.el.section(
+ rx.el.div(
+ eyebrow("A MOMENT OF CLARITY"),
+ rx.el.h2("A tool for pausing. Not a promise of safety.", id="about-title"),
+ rx.el.p(
+ "A familiar name or a reassuring score can miss the bigger picture. "
+ "Use this workspace to practice checking the destination and the request.",
+ class_name="about-intro",
+ ),
+ ),
+ rx.el.div(
+ rx.el.div(
+ rx.el.span("01", class_name="step-number"),
+ rx.el.h3("Read the request"),
+ rx.el.p("Notice pressure, unexpected payments or requests for secrets."),
+ ),
+ rx.el.div(
+ rx.el.span("02", class_name="step-number"),
+ rx.el.h3("Check the destination"),
+ rx.el.p("A friendly label can hide an unfamiliar address. Compare both."),
+ ),
+ rx.el.div(
+ rx.el.span("03", class_name="step-number"),
+ rx.el.h3("Verify another way"),
+ rx.el.p("Use a known app or contact, rather than trusting an email link."),
+ ),
+ class_name="how-grid",
+ ),
+ rx.el.details(
+ rx.el.summary("What this demo does — and does not do"),
+ rx.el.p(
+ "The MIME parsing, link extraction and response validation are real "
+ "code. The emails and reputation responses are authored fixtures. "
+ "No mailbox access, live detection, uploads, analytics or external "
+ "scanning is available. Not all email formats or threats are covered."
+ ),
+ rx.el.p(
+ "Keyboard controls and readable text are independent of speech. "
+ "Read-aloud is not included in this release; use your browser or "
+ "assistive technology if available. JavaScript and a running Reflex "
+ "server are required for interaction."
+ ),
+ ),
+ id="how-it-works",
+ class_name="about",
+ custom_attrs={"aria-labelledby": "about-title"},
+ )
+
+
+def index() -> rx.Component:
+ return rx.el.div(
+ rx.el.a(
+ "Skip to demo", href="#demo", on_click=rx.set_focus("demo"), class_name="skip-link"
+ ),
+ rx.el.header(
+ rx.el.a(
+ rx.el.img(src="/eye.svg", alt="", width="32", height="32"),
+ rx.el.span("Phission"),
+ href="/",
+ class_name="wordmark",
+ custom_attrs={"aria-label": "Phission home"},
+ ),
+ rx.el.a("How it works ↗", href="#how-it-works", class_name="header-link"),
+ class_name="site-header",
+ ),
+ rx.el.main(
+ rx.el.section(
+ eyebrow("A CLEARER LOOK AT EMAIL"),
+ rx.el.h1("A little pause. ", rx.el.span("A clearer perspective.")),
+ rx.el.p(
+ "An unexpected message doesn’t have to rush you. Practice reading "
+ "the signs and looking closer at links — one email at a time.",
+ class_name="hero-description",
),
- pc.button(
- "Purpose of Phissi👁️n",
- color="white",
- bg="#FF7704",
- _hover={"bg": "#c25700"},
- on_click=lambda: State.tts_speak(PURPOSE_MESSAGE, 175),
+ class_name="hero",
+ ),
+ rx.el.div(
+ rx.el.span("Interactive demo", class_name="demo-badge"),
+ rx.el.p(
+ rx.el.strong("Synthetic emails. No inbox connection."),
+ " Every analysis result is simulated, not live detection.",
),
- pc.button(
- "Instructions",
- color="white",
- bg="#FF7704",
- _hover={"bg": "#c25700"},
- on_click=lambda: State.tts_speak(INSTRUCTIONS_MESSAGE, 150),
+ class_name="demo-notice",
+ ),
+ rx.el.section(
+ rx.el.p(
+ State.notice,
+ role="status",
+ class_name="workspace-status",
+ custom_attrs={"aria-live": "polite", "aria-atomic": "true"},
),
- is_attached=True,
- display="flex",
- ),
- email_panel_component(EmailPanelState),
- pc.divider(),
- # input_component(State),
- # button_component(State),
- spacing="1.5em",
- font_size="1.75em",
- ),
- # vstack formatting
- style=app_style,
+ rx.cond(
+ State.inbox_status == "ready",
+ rx.el.div(inbox(), reading_pane(), class_name="workspace-grid"),
+ unavailable_inbox(),
+ ),
+ id="demo",
+ tab_index=-1,
+ class_name="workspace",
+ custom_attrs={"aria-label": "Interactive synthetic email demo"},
+ ),
+ about(),
+ rx.el.noscript(
+ "This demo needs JavaScript and a running Reflex server. No mailbox "
+ "or scanning service is connected.",
+ ),
+ class_name="page-main",
+ ),
+ rx.el.footer(
+ rx.el.div(
+ rx.el.strong("Phission"),
+ rx.el.p("A learning workspace, not a security product."),
+ ),
+ rx.el.p(
+ "Originally built in 2023 for HCI and affective-computing coursework, "
+ "with usability testing. The original findings are no longer available. ",
+ rx.el.a("View the historical prototype", href=HISTORY_URL),
+ ".",
+ class_name="history-note",
+ ),
+ class_name="site-footer",
+ ),
)
-# Add state and page to the app.
-app = pc.App(state=State)
-app.add_page(index, route="/", on_load=State.get_emails)
-app.compile()
+app = rx.App(
+ stylesheets=["/styles.css"],
+ html_lang="en",
+ head_components=[rx.el.link(rel="icon", href="/eye.svg", type="image/svg+xml")],
+)
+app.add_page(
+ index,
+ route="/",
+ title="Phission — a clearer look at email",
+ description="A synthetic-only workspace for practicing thoughtful email decisions.",
+ on_load=State.load,
+ meta=[{"name": "theme-color", "content": "#f7f8f4"}],
+)
diff --git a/phission/scanning.py b/phission/scanning.py
new file mode 100644
index 0000000..fa5f498
--- /dev/null
+++ b/phission/scanning.py
@@ -0,0 +1,69 @@
+"""Validate IPQS-shaped fixture responses. There is deliberately no HTTP adapter."""
+
+from phission.models import ScanOutcome, ScanStatus
+
+VERIFY_GUIDANCE = (
+ "Pause before sharing information. Open a known app or type a trusted address "
+ "yourself; verify unexpected requests through a contact you already know."
+)
+
+
+def normalize_response(payload: object, message_id: str, url: str) -> ScanOutcome:
+ """A score is an indicator, not a probability or a safety guarantee.
+
+ Only an explicit boolean success and an integer 0–100 count as a usable result.
+ Provider messages are not reflected into the UI (they may contain private data).
+ """
+ if not isinstance(payload, dict) or type(payload.get("success")) is not bool:
+ return ScanOutcome(
+ message_id,
+ url,
+ ScanStatus.ERROR,
+ None,
+ "Result could not be interpreted",
+ "The simulated response has an invalid success field. No score is usable.",
+ VERIFY_GUIDANCE,
+ )
+ if payload["success"] is False:
+ return ScanOutcome(
+ message_id,
+ url,
+ ScanStatus.UNKNOWN,
+ None,
+ "No verdict available",
+ "This fixture simulates an unavailable scan. Missing information is not "
+ "evidence that a destination is safe.",
+ VERIFY_GUIDANCE,
+ )
+ score = payload.get("risk_score")
+ if type(score) is not int or not 0 <= score <= 100:
+ return ScanOutcome(
+ message_id,
+ url,
+ ScanStatus.ERROR,
+ None,
+ "Result could not be interpreted",
+ "The simulated response has an invalid score. No score is usable.",
+ VERIFY_GUIDANCE,
+ )
+ if score >= 85:
+ title = "High concern"
+ explanation = (
+ "This fixture represents a strong warning signal. Urgency, credential "
+ "requests and an unfamiliar destination deserve independent verification."
+ )
+ elif score >= 75:
+ title = "Reasons for caution"
+ explanation = (
+ "This fixture represents a suspicious signal. Compare the actual "
+ "destination with what the message claims before taking any action."
+ )
+ else:
+ title = "Lower signal, not a guarantee"
+ explanation = (
+ "This fixture has a lower reputation score. Even a score of zero does "
+ "not prove a message or destination is safe. Context still matters."
+ )
+ return ScanOutcome(
+ message_id, url, ScanStatus.SUCCESS, score, title, explanation, VERIFY_GUIDANCE
+ )
diff --git a/phission/state.py b/phission/state.py
new file mode 100644
index 0000000..5122dbb
--- /dev/null
+++ b/phission/state.py
@@ -0,0 +1,151 @@
+"""Per-session Reflex state. Fixed message IDs, explicit actions, no persistence."""
+
+import reflex as rx
+
+from phission.demo import analyze_fixture, load_inbox
+from phission.models import ContentStatus, ExtractedLink, Message, ScanOutcome
+
+EMPTY_MESSAGE = Message("", "Choose a message", "", "", "", "", "", (), ContentStatus.UNSUPPORTED)
+
+
+class DemoState(rx.State):
+ messages: list[Message] = []
+ inbox_status: str = "loading"
+ selected_id: str = ""
+ selected_url: str = ""
+ analysis_phase: str = "idle"
+ outcome: ScanOutcome | None = None
+ notice: str = "Loading the synthetic inbox."
+
+ def _clear_analysis(self) -> None:
+ self.selected_url = ""
+ self.analysis_phase = "idle"
+ self.outcome = None
+
+ @rx.event
+ def load(self):
+ self.inbox_status = "loading"
+ self.messages = []
+ self.selected_id = ""
+ self._clear_analysis()
+ self.notice = "Loading the synthetic inbox."
+ yield
+ try:
+ self.messages = load_inbox()
+ except OSError:
+ self.inbox_status = "error"
+ self.notice = "The demo inbox could not load. Try loading the examples again."
+ return
+ if not self.messages:
+ self.inbox_status = "empty"
+ self.notice = "No synthetic examples are available."
+ return
+ self.inbox_status = "ready"
+ self.selected_id = self.messages[0].id
+ self.notice = "Synthetic inbox ready. Choose a message, then a link to inspect."
+
+ @rx.event
+ def select_message(self, message_id: str):
+ self._clear_analysis()
+ if message_id not in {message.id for message in self.messages}:
+ self.selected_id = ""
+ self.notice = "That demo message is unavailable. Choose one from the list."
+ return
+ self.selected_id = message_id
+ self.notice = f"Selected: {self.current_message.subject}."
+
+ @rx.event
+ def select_link(self, url: str):
+ self._clear_analysis()
+ if url not in {link.url for link in self.current_message.links}:
+ self.notice = "That link is not in the selected message."
+ return
+ self.selected_url = url
+ self.notice = "Link selected. Run demo analysis to reveal its simulated result."
+
+ @rx.event
+ def analyze(self):
+ message_id, url = self.selected_id, self.selected_url
+ self.outcome = None
+ if not url or url not in {link.url for link in self.current_message.links}:
+ self.analysis_phase = "idle"
+ self.notice = "Choose a link in this message first."
+ return
+ self.analysis_phase = "loading"
+ self.notice = "Reading the local demo result. No destination is being visited."
+ yield
+ outcome = analyze_fixture(message_id, url)
+ # Keep target binding even if this implementation later becomes asynchronous.
+ if (message_id, url) != (self.selected_id, self.selected_url):
+ return
+ self.outcome = outcome
+ self.analysis_phase = "complete"
+ self.notice = f"Simulated result: {outcome.title}."
+
+ @rx.var
+ def current_message(self) -> Message:
+ return next(
+ (message for message in self.messages if message.id == self.selected_id),
+ EMPTY_MESSAGE,
+ )
+
+ @rx.var
+ def links(self) -> list[ExtractedLink]:
+ return list(self.current_message.links)
+
+ @rx.var
+ def coverage(self) -> str:
+ match self.current_message.content_status:
+ case ContentStatus.ANALYZED:
+ return "Inline text and HTML links inspected. Attachments are never opened."
+ case ContentStatus.PARTIAL:
+ return "Partial coverage. " + " ".join(self.current_message.notes)
+ case ContentStatus.MALFORMED:
+ return "Not analyzed: this message could not be read reliably."
+ case _:
+ return "Not analyzed: this message has no supported inline text."
+
+ @rx.var
+ def empty_links_title(self) -> str:
+ if self.current_message.content_status in {
+ ContentStatus.UNSUPPORTED,
+ ContentStatus.MALFORMED,
+ }:
+ return "Links could not be analyzed"
+ return "No HTTP(S) links found in readable text"
+
+ @rx.var
+ def result_visible(self) -> bool:
+ return bool(
+ self.outcome
+ and self.outcome.message_id == self.selected_id
+ and self.outcome.url == self.selected_url
+ )
+
+ @rx.var
+ def result_title(self) -> str:
+ return self.outcome.title if self.result_visible else ""
+
+ @rx.var
+ def result_explanation(self) -> str:
+ return self.outcome.explanation if self.result_visible else ""
+
+ @rx.var
+ def result_guidance(self) -> str:
+ return self.outcome.guidance if self.result_visible else ""
+
+ @rx.var
+ def result_score(self) -> str:
+ if not self.result_visible or self.outcome.score is None:
+ return "No usable score"
+ return f"Fixture score: {self.outcome.score} / 100"
+
+ @rx.var
+ def result_tone(self) -> str:
+ if not self.result_visible or self.outcome.score is None:
+ return "unknown"
+ if self.outcome.score >= 85:
+ return "high"
+ if self.outcome.score >= 75:
+ return "caution"
+ return "low"
diff --git a/phission/styles.py b/phission/styles.py
deleted file mode 100644
index 834dd4b..0000000
--- a/phission/styles.py
+++ /dev/null
@@ -1,16 +0,0 @@
-app_style = {
- # "padding_top":"10%",
- "height": "100vh",
- "max_width": "100vw",
- "bg": "#172671",
- # "bg": "#172671",
- "overflow": "auto",
-}
-
-RED = "#D0342C"
-ORANGE = "#FF7704"
-DARKENED_ORANGE = "#c25700"
-YELLOW = "#E9D502"
-GREEN = "#4BB543"
-BLACK = "#1B1A2D"
-WHITE = "#FFFFFF"
diff --git a/phission_PANAS_results.xlsx b/phission_PANAS_results.xlsx
deleted file mode 100644
index 73ca24b..0000000
--- a/phission_PANAS_results.xlsx
+++ /dev/null
@@ -1,14 +0,0 @@
-user_id,interested,distressed,excited,upset,strong,guilty,scared,hostile,enthusiastic,proud,irritable,alert,ashamed,inspired,nervous,determined,attentive,jittery,active,afraid,pre_positive_PANAS,pre_negative_PANAS,post_positive_PANAS,post_negative_PANAS
-0,4,1,4,1,3,1,1,1,4,5,1,3,1,5,1,3,5,1,5,1,37.0,23.0,41.0,9.0
-1,5,1,5,1,1,1,1,1,5,5,1,5,1,5,1,5,5,1,4,1,46.0,36.0,45.0,9.0
-2,5,3,4,1,4,1,2,1,4,4,1,4,1,4,1,4,4,1,5,1,27.0,29.0,42.0,12.0
-3,5,1,4,1,4,1,1,1,4,4,2,4,1,4,1,5,4,4,4,1,40.0,19.0,42.0,13.0
-4,4,4,5,1,4,1,1,1,5,1,1,4,1,4,1,5,5,1,5,1,40.0,18.0,42.0,12.0
-5,5,3,5,2,3,1,3,1,3,4,1,4,3,5,2,3,4,3,4,4,40.0,22.0,40.0,19.0
-6,5,2,4,1,1,1,1,1,3,2,1,1,1,5,2,1,4,1,2,1,27.0,10.0,28.0,11.0
-7,4,2,4,2,2,2,2,2,2,3,2,4,1,3,1,1,3,2,1,3,21.0,22.0,27.0,16.0
-8,4,1,4,1,3,1,3,3,4,1,1,4,1,4,1,4,4,1,4,1,29.0,22.0,36.0,13.0
-9,5,1,4,1,3,1,1,1,3,2,1,5,1,2,1,3,4,1,4,1,38.0,11.0,35.0,9.0
-10,5,4,3,1,3,1,4,1,4,3,1,4,1,1,1,1,3,1,1,2,34.0,12.0,28.0,15.0
-11,5,4,5,1,4,1,2,1,4,4,1,3,1,4,2,4,5,2,4,1,36.0,19.0,42.0,15.0
-12,5,2,5,1,3,1,1,1,4,4,1,2,1,4,1,4,4,1,4,1,30.0,20.0,39.0,10.0
diff --git a/pynecone.db b/pynecone.db
deleted file mode 100644
index e69de29..0000000
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 0000000..23c37e8
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,24 @@
+[project]
+name = "phission"
+version = "0.2.0"
+description = "A synthetic-only email and link-reputation learning demo"
+requires-python = ">=3.13,<3.15"
+dependencies = ["reflex==0.9.12"]
+
+[dependency-groups]
+dev = ["pytest>=8.4,<9", "ruff>=0.12,<0.16"]
+
+[tool.uv]
+package = false
+
+[tool.pytest.ini_options]
+testpaths = ["tests"]
+pythonpath = ["."]
+
+[tool.ruff]
+target-version = "py313"
+line-length = 100
+exclude = [".web", ".cache", ".venv"]
+
+[tool.ruff.lint]
+select = ["E", "F", "I", "UP", "B"]
diff --git a/reflex.lock/bun.lock b/reflex.lock/bun.lock
new file mode 100644
index 0000000..d0ce03e
--- /dev/null
+++ b/reflex.lock/bun.lock
@@ -0,0 +1,335 @@
+{
+ "lockfileVersion": 2,
+ "configVersion": 0,
+ "workspaces": {
+ "": {
+ "name": "reflex",
+ "dependencies": {
+ "@react-router/node": "8.4.0",
+ "isbot": "5.2.2",
+ "lucide-react": "1.26.0",
+ "mergician": "2.0.2",
+ "react": "19.2.8",
+ "react-dom": "19.2.8",
+ "react-error-boundary": "6.1.2",
+ "react-helmet": "6.1.0",
+ "react-router": "8.4.0",
+ "socket.io-client": "4.8.3",
+ "sonner": "2.0.8",
+ "universal-cookie": "8.1.2",
+ },
+ "devDependencies": {
+ "@emotion/react": "11.14.0",
+ "@react-router/dev": "8.4.0",
+ "@react-router/fs-routes": "8.4.0",
+ "autoprefixer": "10.5.4",
+ "postcss": "8.5.26",
+ "postcss-import": "17.0.0",
+ "vite": "8.2.2",
+ },
+ },
+ },
+ "packages": {
+ "@babel/code-frame": ["@babel/code-frame@7.29.7", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, ""],
+
+ "@babel/compat-data": ["@babel/compat-data@7.29.7", "", {}, ""],
+
+ "@babel/core": ["@babel/core@7.29.7", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.7", "@babel/helper-compilation-targets": "^7.29.7", "@babel/helper-module-transforms": "^7.29.7", "@babel/helpers": "^7.29.7", "@babel/parser": "^7.29.7", "@babel/template": "^7.29.7", "@babel/traverse": "^7.29.7", "@babel/types": "^7.29.7", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, ""],
+
+ "@babel/generator": ["@babel/generator@7.29.8", "", { "dependencies": { "@babel/parser": "^7.29.8", "@babel/types": "^7.29.8", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, ""],
+
+ "@babel/helper-compilation-targets": ["@babel/helper-compilation-targets@7.29.7", "", { "dependencies": { "@babel/compat-data": "^7.29.7", "@babel/helper-validator-option": "^7.29.7", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" } }, ""],
+
+ "@babel/helper-globals": ["@babel/helper-globals@7.29.7", "", {}, ""],
+
+ "@babel/helper-module-imports": ["@babel/helper-module-imports@7.29.7", "", { "dependencies": { "@babel/traverse": "^7.29.7", "@babel/types": "^7.29.7" } }, ""],
+
+ "@babel/helper-module-transforms": ["@babel/helper-module-transforms@7.29.7", "", { "dependencies": { "@babel/helper-module-imports": "^7.29.7", "@babel/helper-validator-identifier": "^7.29.7", "@babel/traverse": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, ""],
+
+ "@babel/helper-string-parser": ["@babel/helper-string-parser@7.29.7", "", {}, ""],
+
+ "@babel/helper-validator-identifier": ["@babel/helper-validator-identifier@7.29.7", "", {}, ""],
+
+ "@babel/helper-validator-option": ["@babel/helper-validator-option@7.29.7", "", {}, ""],
+
+ "@babel/helpers": ["@babel/helpers@7.29.7", "", { "dependencies": { "@babel/template": "^7.29.7", "@babel/types": "^7.29.7" } }, ""],
+
+ "@babel/parser": ["@babel/parser@7.29.9", "", { "dependencies": { "@babel/types": "^7.29.8" }, "bin": { "parser": "bin/babel-parser.js" } }, ""],
+
+ "@babel/runtime": ["@babel/runtime@7.29.7", "", {}, ""],
+
+ "@babel/template": ["@babel/template@7.29.7", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/parser": "^7.29.7", "@babel/types": "^7.29.7" } }, ""],
+
+ "@babel/traverse": ["@babel/traverse@7.29.8", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.8", "@babel/helper-globals": "^7.29.7", "@babel/parser": "^7.29.8", "@babel/template": "^7.29.7", "@babel/types": "^7.29.8", "debug": "^4.3.1" } }, ""],
+
+ "@babel/types": ["@babel/types@7.29.8", "", { "dependencies": { "@babel/helper-string-parser": "^7.29.7", "@babel/helper-validator-identifier": "^7.29.7" } }, ""],
+
+ "@emotion/babel-plugin": ["@emotion/babel-plugin@11.13.5", "", { "dependencies": { "@babel/helper-module-imports": "^7.16.7", "@babel/runtime": "^7.18.3", "@emotion/hash": "^0.9.2", "@emotion/memoize": "^0.9.0", "@emotion/serialize": "^1.3.3", "babel-plugin-macros": "^3.1.0", "convert-source-map": "^1.5.0", "escape-string-regexp": "^4.0.0", "find-root": "^1.1.0", "source-map": "^0.5.7", "stylis": "4.2.0" } }, ""],
+
+ "@emotion/cache": ["@emotion/cache@11.14.0", "", { "dependencies": { "@emotion/memoize": "^0.9.0", "@emotion/sheet": "^1.4.0", "@emotion/utils": "^1.4.2", "@emotion/weak-memoize": "^0.4.0", "stylis": "4.2.0" } }, ""],
+
+ "@emotion/hash": ["@emotion/hash@0.9.2", "", {}, ""],
+
+ "@emotion/memoize": ["@emotion/memoize@0.9.0", "", {}, ""],
+
+ "@emotion/react": ["@emotion/react@11.14.0", "", { "dependencies": { "@babel/runtime": "^7.18.3", "@emotion/babel-plugin": "^11.13.5", "@emotion/cache": "^11.14.0", "@emotion/serialize": "^1.3.3", "@emotion/use-insertion-effect-with-fallbacks": "^1.2.0", "@emotion/utils": "^1.4.2", "@emotion/weak-memoize": "^0.4.0", "hoist-non-react-statics": "^3.3.1" }, "peerDependencies": { "react": ">=16.8.0" } }, "sha512-O000MLDBDdk/EohJPFUqvnp4qnHeYkVP5B0xEG0D/L7cOKP9kefu2DXn8dj74cQfsEzUqh+sr1RzFqiL1o+PpA=="],
+
+ "@emotion/serialize": ["@emotion/serialize@1.3.3", "", { "dependencies": { "@emotion/hash": "^0.9.2", "@emotion/memoize": "^0.9.0", "@emotion/unitless": "^0.10.0", "@emotion/utils": "^1.4.2", "csstype": "^3.0.2" } }, ""],
+
+ "@emotion/sheet": ["@emotion/sheet@1.4.0", "", {}, ""],
+
+ "@emotion/unitless": ["@emotion/unitless@0.10.0", "", {}, ""],
+
+ "@emotion/use-insertion-effect-with-fallbacks": ["@emotion/use-insertion-effect-with-fallbacks@1.2.0", "", { "peerDependencies": { "react": ">=16.8.0" } }, ""],
+
+ "@emotion/utils": ["@emotion/utils@1.4.2", "", {}, ""],
+
+ "@emotion/weak-memoize": ["@emotion/weak-memoize@0.4.0", "", {}, ""],
+
+ "@jridgewell/gen-mapping": ["@jridgewell/gen-mapping@0.3.13", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.0", "@jridgewell/trace-mapping": "^0.3.24" } }, ""],
+
+ "@jridgewell/remapping": ["@jridgewell/remapping@2.3.5", "", { "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.24" } }, ""],
+
+ "@jridgewell/resolve-uri": ["@jridgewell/resolve-uri@3.1.2", "", {}, ""],
+
+ "@jridgewell/sourcemap-codec": ["@jridgewell/sourcemap-codec@1.6.0", "", {}, ""],
+
+ "@jridgewell/trace-mapping": ["@jridgewell/trace-mapping@0.3.31", "", { "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, ""],
+
+ "@oxc-project/types": ["@oxc-project/types@0.151.0", "", {}, ""],
+
+ "@react-router/dev": ["@react-router/dev@8.4.0", "", { "dependencies": { "@babel/core": "^7.29.7", "@babel/generator": "^7.29.7", "@babel/parser": "^7.29.7", "@babel/traverse": "^7.29.7", "@babel/types": "^7.29.7", "@react-router/node": "8.4.0", "@remix-run/node-fetch-server": "^0.14.1", "babel-dead-code-elimination": "^1.0.12", "chokidar": "^5.0.0", "dedent": "^1.7.2", "es-module-lexer": "^2.1.0", "exit-hook": "5.1.0", "isbot": "^5.1.40", "jsesc": "3.1.0", "lodash": "^4.18.1", "p-map": "^7.0.4", "pathe": "^2.0.3", "picocolors": "^1.1.1", "pkg-types": "^2.3.1", "react-refresh": "^0.18.0", "semver": "^7.8.1", "tinyglobby": "^0.2.16", "valibot": "^1.4.1" }, "peerDependencies": { "@react-router/serve": "^8.4.0", "@vitejs/plugin-rsc": "~0.5.26", "react-router": "^8.4.0", "react-server-dom-webpack": "^19.2.7", "typescript": "^5.1.0 || ^6.0.0 || ^7.0.0", "vite": "^7.0.0 || ^8.0.0", "wrangler": "^4.0.0" }, "optionalPeers": ["@react-router/serve", "@vitejs/plugin-rsc", "react-server-dom-webpack", "typescript", "wrangler"], "bin": { "react-router": "bin.cjs" } }, "sha512-GKznpn6h8c52xGXwtsypD5ZwNiWFSeqoKPdyGq7SfG+T9rFjGO8F0i/R/yECfZqHXaNz1NVmpODuBamBy9FfMg=="],
+
+ "@react-router/fs-routes": ["@react-router/fs-routes@8.4.0", "", { "dependencies": { "minimatch": "^10.2.5" }, "peerDependencies": { "@react-router/dev": "^8.4.0", "typescript": "^5.1.0 || ^6.0.0 || ^7.0.0" }, "optionalPeers": ["typescript"] }, "sha512-CIEYxrapbr6iO589fBmN7/RBJ10H8X/Tl2i7MNkuJZQ9W2Z3wPifPCHv9bFR/+FlmzeLXJlYyHyUgaCkgOIZYg=="],
+
+ "@react-router/node": ["@react-router/node@8.4.0", "", { "dependencies": { "@remix-run/node-fetch-server": "^0.14.1" }, "peerDependencies": { "react-router": "8.4.0", "typescript": "^5.1.0 || ^6.0.0 || ^7.0.0" }, "optionalPeers": ["typescript"] }, "sha512-1teZHtk7XDm1pteQ2Plgtvtjjup5C5sIwFlOMYVIyoOH7X3bId3Qb//kUdbydX6NRIxcGK28UnfZlz4SrD/mkg=="],
+
+ "@remix-run/node-fetch-server": ["@remix-run/node-fetch-server@0.14.1", "", {}, ""],
+
+ "@remix-run/route-pattern": ["@remix-run/route-pattern@0.22.1", "", {}, ""],
+
+ "@rolldown/binding-linux-x64-gnu": ["@rolldown/binding-linux-x64-gnu@1.2.11", "", { "os": "linux", "cpu": "x64" }, ""],
+
+ "@rolldown/binding-linux-x64-musl": ["@rolldown/binding-linux-x64-musl@1.2.11", "", { "os": "linux", "cpu": "x64" }, ""],
+
+ "@rolldown/pluginutils": ["@rolldown/pluginutils@1.0.1", "", {}, ""],
+
+ "@socket.io/component-emitter": ["@socket.io/component-emitter@3.1.2", "", {}, ""],
+
+ "@types/parse-json": ["@types/parse-json@4.0.2", "", {}, ""],
+
+ "autoprefixer": ["autoprefixer@10.5.4", "", { "dependencies": { "browserslist": "^4.28.6", "caniuse-lite": "^1.0.30001806", "fraction.js": "^5.3.4", "picocolors": "^1.1.1", "postcss-value-parser": "^4.2.0" }, "peerDependencies": { "postcss": "^8.1.0" }, "bin": "bin/autoprefixer" }, "sha512-MaU0U/za7N3r6brxD4YB/l4NSrFzLPlANv6wEuQVaIPlD3L4W9rFcQPbL/EilY9BHhHvhfcz3gInDLrEtWT4EA=="],
+
+ "babel-dead-code-elimination": ["babel-dead-code-elimination@1.0.12", "", { "dependencies": { "@babel/core": "^7.23.7", "@babel/parser": "^7.23.6", "@babel/traverse": "^7.23.7", "@babel/types": "^7.23.6" } }, ""],
+
+ "babel-plugin-macros": ["babel-plugin-macros@3.1.0", "", { "dependencies": { "@babel/runtime": "^7.12.5", "cosmiconfig": "^7.0.0", "resolve": "^1.19.0" } }, ""],
+
+ "balanced-match": ["balanced-match@4.0.4", "", {}, ""],
+
+ "baseline-browser-mapping": ["baseline-browser-mapping@2.11.26", "", { "bin": "dist/cli.cjs" }, ""],
+
+ "brace-expansion": ["brace-expansion@5.0.12", "", { "dependencies": { "balanced-match": "^4.0.2" } }, ""],
+
+ "browserslist": ["browserslist@4.29.1", "", { "dependencies": { "baseline-browser-mapping": "^2.11.25", "caniuse-lite": "^1.0.30001810", "electron-to-chromium": "^1.5.438", "node-releases": "^2.0.57", "update-browserslist-db": "^1.3.3" }, "bin": "cli.js" }, ""],
+
+ "callsites": ["callsites@3.1.0", "", {}, ""],
+
+ "caniuse-lite": ["caniuse-lite@1.0.30001812", "", {}, ""],
+
+ "chokidar": ["chokidar@5.0.0", "", { "dependencies": { "readdirp": "^5.0.0" } }, ""],
+
+ "confbox": ["confbox@0.3.1", "", {}, ""],
+
+ "convert-source-map": ["convert-source-map@1.9.0", "", {}, ""],
+
+ "cookie": ["cookie@1.1.1", "", {}, ""],
+
+ "cookie-es": ["cookie-es@3.1.1", "", {}, ""],
+
+ "cosmiconfig": ["cosmiconfig@7.1.0", "", { "dependencies": { "@types/parse-json": "^4.0.0", "import-fresh": "^3.2.1", "parse-json": "^5.0.0", "path-type": "^4.0.0", "yaml": "^1.10.0" } }, ""],
+
+ "csstype": ["csstype@3.2.3", "", {}, ""],
+
+ "debug": ["debug@4.4.3", "", { "dependencies": { "ms": "^2.1.3" } }, ""],
+
+ "dedent": ["dedent@1.7.2", "", { "peerDependencies": { "babel-plugin-macros": "^3.1.0" }, "optionalPeers": ["babel-plugin-macros"] }, ""],
+
+ "detect-libc": ["detect-libc@2.1.2", "", {}, ""],
+
+ "electron-to-chromium": ["electron-to-chromium@1.5.439", "", {}, ""],
+
+ "engine.io-client": ["engine.io-client@6.6.7", "", { "dependencies": { "@socket.io/component-emitter": "~3.1.0", "debug": "~4.4.1", "engine.io-parser": "~5.2.1", "ws": "~8.21.0", "xmlhttprequest-ssl": "~2.1.1" } }, ""],
+
+ "engine.io-parser": ["engine.io-parser@5.2.3", "", {}, ""],
+
+ "error-ex": ["error-ex@1.3.4", "", { "dependencies": { "is-arrayish": "^0.2.1" } }, ""],
+
+ "es-errors": ["es-errors@1.3.0", "", {}, ""],
+
+ "es-module-lexer": ["es-module-lexer@2.3.2", "", {}, ""],
+
+ "escalade": ["escalade@3.2.0", "", {}, ""],
+
+ "escape-string-regexp": ["escape-string-regexp@4.0.0", "", {}, ""],
+
+ "exit-hook": ["exit-hook@5.1.0", "", {}, ""],
+
+ "exsolve": ["exsolve@1.1.1", "", {}, ""],
+
+ "fdir": ["fdir@6.5.0", "", { "peerDependencies": { "picomatch": "^3 || ^4" }, "optionalPeers": ["picomatch"] }, ""],
+
+ "find-root": ["find-root@1.1.0", "", {}, ""],
+
+ "fraction.js": ["fraction.js@5.3.4", "", {}, ""],
+
+ "fsevents": ["fsevents@2.3.3", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="],
+
+ "function-bind": ["function-bind@1.1.2", "", {}, ""],
+
+ "gensync": ["gensync@1.0.0-beta.2", "", {}, ""],
+
+ "hasown": ["hasown@2.0.4", "", { "dependencies": { "function-bind": "^1.1.2" } }, ""],
+
+ "hoist-non-react-statics": ["hoist-non-react-statics@3.3.2", "", { "dependencies": { "react-is": "^16.7.0" } }, ""],
+
+ "import-fresh": ["import-fresh@3.3.1", "", { "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" } }, ""],
+
+ "is-arrayish": ["is-arrayish@0.2.1", "", {}, ""],
+
+ "is-core-module": ["is-core-module@2.17.0", "", { "dependencies": { "hasown": "^2.0.4" } }, ""],
+
+ "isbot": ["isbot@5.2.2", "", {}, "sha512-iQcBXcd+Rv/pkubRyGh2utW2j1oPG5hZY6TUhVPpqK4G+o3IbxpJNx04hgksjc/N7GK5pEorUxDeg31cFgEk/w=="],
+
+ "js-tokens": ["js-tokens@4.0.0", "", {}, ""],
+
+ "jsesc": ["jsesc@3.1.0", "", { "bin": "bin/jsesc" }, ""],
+
+ "json-parse-even-better-errors": ["json-parse-even-better-errors@2.3.1", "", {}, ""],
+
+ "json5": ["json5@2.2.3", "", { "bin": "lib/cli.js" }, ""],
+
+ "lightningcss": ["lightningcss@1.33.0", "", { "dependencies": { "detect-libc": "^2.0.3" }, "optionalDependencies": { "lightningcss-android-arm64": "1.33.0", "lightningcss-darwin-arm64": "1.33.0", "lightningcss-darwin-x64": "1.33.0", "lightningcss-freebsd-x64": "1.33.0", "lightningcss-linux-arm-gnueabihf": "1.33.0", "lightningcss-linux-arm64-gnu": "1.33.0", "lightningcss-linux-arm64-musl": "1.33.0", "lightningcss-linux-x64-gnu": "1.33.0", "lightningcss-linux-x64-musl": "1.33.0", "lightningcss-win32-arm64-msvc": "1.33.0", "lightningcss-win32-x64-msvc": "1.33.0" } }, ""],
+
+ "lightningcss-linux-x64-gnu": ["lightningcss-linux-x64-gnu@1.33.0", "", { "os": "linux", "cpu": "x64" }, ""],
+
+ "lightningcss-linux-x64-musl": ["lightningcss-linux-x64-musl@1.33.0", "", { "os": "linux", "cpu": "x64" }, ""],
+
+ "lines-and-columns": ["lines-and-columns@1.2.4", "", {}, ""],
+
+ "lodash": ["lodash@4.18.1", "", {}, ""],
+
+ "loose-envify": ["loose-envify@1.4.0", "", { "dependencies": { "js-tokens": "^3.0.0 || ^4.0.0" }, "bin": "cli.js" }, ""],
+
+ "lru-cache": ["lru-cache@5.1.1", "", { "dependencies": { "yallist": "^3.0.2" } }, ""],
+
+ "lucide-react": ["lucide-react@1.26.0", "", { "peerDependencies": { "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-raglYVR2+VkMfJL158krjVmE+rV5ST2lzA/KQm1FRSjMHT4MnWaegHxoVEpmc2So3nOEhp9oGejJwAPX8MoAjg=="],
+
+ "mergician": ["mergician@2.0.2", "", {}, "sha512-1GDF4LuMcc7UpE7XitfSm822yDtTxLoOVB+9QFnb3o/+zoMAVKxM67UjvmEXOA7FQnz9209K0ZyHAoD+5Ibe4A=="],
+
+ "minimatch": ["minimatch@10.2.6", "", { "dependencies": { "brace-expansion": "^5.0.8" } }, ""],
+
+ "ms": ["ms@2.1.3", "", {}, ""],
+
+ "nanoid": ["nanoid@3.3.19", "", { "bin": "bin/nanoid.cjs" }, ""],
+
+ "node-releases": ["node-releases@2.0.57", "", {}, ""],
+
+ "object-assign": ["object-assign@4.1.1", "", {}, ""],
+
+ "p-map": ["p-map@7.0.8", "", {}, ""],
+
+ "parent-module": ["parent-module@1.0.1", "", { "dependencies": { "callsites": "^3.0.0" } }, ""],
+
+ "parse-json": ["parse-json@5.2.0", "", { "dependencies": { "@babel/code-frame": "^7.0.0", "error-ex": "^1.3.1", "json-parse-even-better-errors": "^2.3.0", "lines-and-columns": "^1.1.6" } }, ""],
+
+ "path-parse": ["path-parse@1.0.7", "", {}, ""],
+
+ "path-type": ["path-type@4.0.0", "", {}, ""],
+
+ "pathe": ["pathe@2.0.3", "", {}, ""],
+
+ "picocolors": ["picocolors@1.1.1", "", {}, ""],
+
+ "picomatch": ["picomatch@4.0.7", "", {}, ""],
+
+ "pkg-types": ["pkg-types@2.3.3", "", { "dependencies": { "confbox": "^0.3.1", "exsolve": "^1.1.1", "pathe": "^2.0.3" } }, ""],
+
+ "postcss": ["postcss@8.5.26", "", { "dependencies": { "nanoid": "^3.3.17", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" } }, "sha512-u82N74LFzG8ca+dD8puPnplTXoGH4fTPpVGuIbt36G3qvNlkvfD0lEAZSxaly3KX8TS/L1A1gsCEmvKmBcVbkQ=="],
+
+ "postcss-import": ["postcss-import@17.0.0", "", { "dependencies": { "postcss-value-parser": "^4.0.0", "read-cache": "^1.0.0", "resolve": "^1.1.7" }, "peerDependencies": { "postcss": "^8.0.0" } }, "sha512-qzVMJhcq39KweT7Fp0HcjE5YxL5yI854Q3CtufxDuZKO9HLQUp2rptB9+U0MIj3pT1ZEVXoqnpeC1mSkfYuz4Q=="],
+
+ "postcss-value-parser": ["postcss-value-parser@4.2.0", "", {}, ""],
+
+ "prop-types": ["prop-types@15.8.1", "", { "dependencies": { "loose-envify": "^1.4.0", "object-assign": "^4.1.1", "react-is": "^16.13.1" } }, ""],
+
+ "react": ["react@19.2.8", "", {}, "sha512-PWaYA1L/q9u2u7xYQi+Y3L3Yfnie7XyLeaJICV1MGD6LprsBxcAqGjYyr0eY3p+QdsA+x/Irkt4Qif8D63+Sbw=="],
+
+ "react-dom": ["react-dom@19.2.8", "", { "dependencies": { "scheduler": "^0.27.0" }, "peerDependencies": { "react": "^19.2.8" } }, "sha512-rVprimfGBG3DR+Tq0IQG2DT5PxKth1WIGDmj5yPmlzr4YBe7uyE+Du4oVqTDXZSHGGGXRtTJEGSSePyQCMBglQ=="],
+
+ "react-error-boundary": ["react-error-boundary@6.1.2", "", { "peerDependencies": { "react": "^18.0.0 || ^19.0.0" } }, "sha512-3DpCr5HVdZ0caUjYE/kIHBEJN0mNP3ZCgf16c48uJ5TbWjorKVp+YG8W3XqlJ7vJAVNw6wNIImyPXmFydwmyng=="],
+
+ "react-fast-compare": ["react-fast-compare@3.2.2", "", {}, ""],
+
+ "react-helmet": ["react-helmet@6.1.0", "", { "dependencies": { "object-assign": "^4.1.1", "prop-types": "^15.7.2", "react-fast-compare": "^3.1.1", "react-side-effect": "^2.1.0" }, "peerDependencies": { "react": ">=16.3.0" } }, "sha512-4uMzEY9nlDlgxr61NL3XbKRy1hEkXmKNXhjbAIOVw5vcFrsdYbH2FEwcNyWvWinl103nXgzYNlns9ca+8kFiWw=="],
+
+ "react-is": ["react-is@16.13.1", "", {}, ""],
+
+ "react-refresh": ["react-refresh@0.18.0", "", {}, ""],
+
+ "react-router": ["react-router@8.4.0", "", { "dependencies": { "@remix-run/route-pattern": "^0.22.1", "cookie-es": "^3.1.1" }, "peerDependencies": { "react": ">=19.2.7", "react-dom": ">=19.2.7" }, "optionalPeers": ["react-dom"] }, "sha512-JtydAkBvU9UTEe5qNC+POhu+ZBNM7rlKY2IegwXc7Idj7xfRG16x5RZrw3mju+XlqBxfvb2ky9P3jUp9WyWC1g=="],
+
+ "react-side-effect": ["react-side-effect@2.1.2", "", { "peerDependencies": { "react": "^16.3.0 || ^17.0.0 || ^18.0.0" } }, ""],
+
+ "read-cache": ["read-cache@1.0.2", "", {}, ""],
+
+ "readdirp": ["readdirp@5.1.1", "", {}, ""],
+
+ "resolve": ["resolve@1.22.12", "", { "dependencies": { "es-errors": "^1.3.0", "is-core-module": "^2.16.1", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": "bin/resolve" }, ""],
+
+ "resolve-from": ["resolve-from@4.0.0", "", {}, ""],
+
+ "rolldown": ["rolldown@1.2.11", "", { "dependencies": { "@oxc-project/types": "=0.151.0", "@rolldown/pluginutils": "^1.0.0" }, "optionalDependencies": { "@rolldown/binding-android-arm-eabi": "1.2.11", "@rolldown/binding-android-arm64": "1.2.11", "@rolldown/binding-darwin-arm64": "1.2.11", "@rolldown/binding-darwin-x64": "1.2.11", "@rolldown/binding-freebsd-x64": "1.2.11", "@rolldown/binding-linux-arm-gnueabihf": "1.2.11", "@rolldown/binding-linux-arm64-gnu": "1.2.11", "@rolldown/binding-linux-arm64-musl": "1.2.11", "@rolldown/binding-linux-ppc64-gnu": "1.2.11", "@rolldown/binding-linux-s390x-gnu": "1.2.11", "@rolldown/binding-linux-x64-gnu": "1.2.11", "@rolldown/binding-linux-x64-musl": "1.2.11", "@rolldown/binding-openharmony-arm64": "1.2.11", "@rolldown/binding-win32-arm64-msvc": "1.2.11", "@rolldown/binding-win32-x64-msvc": "1.2.11" }, "bin": "bin/cli.mjs" }, ""],
+
+ "scheduler": ["scheduler@0.27.0", "", {}, ""],
+
+ "semver": ["semver@7.8.5", "", { "bin": "bin/semver.js" }, ""],
+
+ "socket.io-client": ["socket.io-client@4.8.3", "", { "dependencies": { "@socket.io/component-emitter": "~3.1.0", "debug": "~4.4.1", "engine.io-client": "~6.6.1", "socket.io-parser": "~4.2.4" } }, "sha512-uP0bpjWrjQmUt5DTHq9RuoCBdFJF10cdX9X+a368j/Ft0wmaVgxlrjvK3kjvgCODOMMOz9lcaRzxmso0bTWZ/g=="],
+
+ "socket.io-parser": ["socket.io-parser@4.2.7", "", { "dependencies": { "@socket.io/component-emitter": "~3.1.0", "debug": "~4.4.1" } }, ""],
+
+ "sonner": ["sonner@2.0.8", "", { "peerDependencies": { "@types/react": "^18.0.0 || ^19.0.0", "react": "^18.0.0 || ^19.0.0 || ^19.0.0-rc", "react-dom": "^18.0.0 || ^19.0.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-UM/ByIoFra8yzV75n1o0Puu0bw5U/9UNnDacrJNspekBewIfsQ3D6ez1nvlWpt7aTsO6rujQtifBpycwIivqlg=="],
+
+ "source-map": ["source-map@0.5.7", "", {}, ""],
+
+ "source-map-js": ["source-map-js@1.2.1", "", {}, ""],
+
+ "stylis": ["stylis@4.2.0", "", {}, ""],
+
+ "supports-preserve-symlinks-flag": ["supports-preserve-symlinks-flag@1.0.0", "", {}, ""],
+
+ "tinyglobby": ["tinyglobby@0.2.17", "", { "dependencies": { "fdir": "^6.5.0", "picomatch": "^4.0.4" } }, ""],
+
+ "universal-cookie": ["universal-cookie@8.1.2", "", { "dependencies": { "cookie": "^1.1.1" } }, "sha512-kcKzTGNsxVytujrYOvQbvh//QyFrA53HrzCGyzh6i9ujCww5gfPrLK0tG+jJD40SIIldiEjBNPPSR8fBMS21GA=="],
+
+ "update-browserslist-db": ["update-browserslist-db@1.3.3", "", { "dependencies": { "escalade": "^3.2.0", "picocolors": "^1.1.1" }, "peerDependencies": { "browserslist": ">= 4.21.0" }, "bin": "cli.js" }, ""],
+
+ "valibot": ["valibot@1.5.0", "", { "peerDependencies": { "typescript": ">=5" }, "optionalPeers": ["typescript"] }, ""],
+
+ "vite": ["vite@8.2.2", "", { "dependencies": { "lightningcss": "^1.33.0", "picomatch": "^4.0.5", "postcss": "^8.5.26", "rolldown": "~1.2.4", "tinyglobby": "^0.2.17" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^20.19.0 || >=22.12.0", "@vitejs/devtools": "^0.4.0 || ^0.5.0", "esbuild": "^0.27.0 || ^0.28.0", "jiti": ">=1.21.0", "less": "^4.0.0", "sass": "^1.70.0", "sass-embedded": "^1.70.0", "stylus": ">=0.54.8", "sugarss": "^5.0.0", "terser": "^5.16.0", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["@types/node", "@vitejs/devtools", "esbuild", "jiti", "less", "sass", "sass-embedded", "stylus", "sugarss", "terser", "tsx", "yaml"], "bin": "bin/vite.js" }, "sha512-cFKLV/PRgAUlIRm5WjMjJ86jrftzpqcgH+Us+DS8mI3CDNiH30Whrz8uHL3+MOLPAgqbMBAqWdAHAphOAM+z/Q=="],
+
+ "ws": ["ws@8.21.3", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": ">=5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, ""],
+
+ "xmlhttprequest-ssl": ["xmlhttprequest-ssl@2.1.2", "", {}, ""],
+
+ "yallist": ["yallist@3.1.1", "", {}, ""],
+
+ "yaml": ["yaml@1.10.3", "", {}, ""],
+
+ "@babel/core/convert-source-map": ["convert-source-map@2.0.0", "", {}, ""],
+
+ "@babel/core/semver": ["semver@6.3.1", "", { "bin": "bin/semver.js" }, ""],
+
+ "@babel/helper-compilation-targets/semver": ["semver@6.3.1", "", { "bin": "bin/semver.js" }, ""],
+ }
+}
diff --git a/reflex.lock/package.json b/reflex.lock/package.json
new file mode 100644
index 0000000..87b7fa4
--- /dev/null
+++ b/reflex.lock/package.json
@@ -0,0 +1,32 @@
+{
+ "name": "reflex",
+ "type": "module",
+ "scripts": {
+ "dev": "react-router dev --host",
+ "export": "react-router build"
+ },
+ "dependencies": {
+ "@react-router/node": "8.4.0",
+ "isbot": "5.2.2",
+ "lucide-react": "1.26.0",
+ "mergician": "2.0.2",
+ "react": "19.2.8",
+ "react-dom": "19.2.8",
+ "react-error-boundary": "6.1.2",
+ "react-helmet": "6.1.0",
+ "react-router": "8.4.0",
+ "socket.io-client": "4.8.3",
+ "sonner": "2.0.8",
+ "universal-cookie": "8.1.2"
+ },
+ "devDependencies": {
+ "@emotion/react": "11.14.0",
+ "@react-router/dev": "8.4.0",
+ "@react-router/fs-routes": "8.4.0",
+ "autoprefixer": "10.5.4",
+ "postcss": "8.5.26",
+ "postcss-import": "17.0.0",
+ "vite": "8.2.2"
+ },
+ "overrides": {}
+}
\ No newline at end of file
diff --git a/requirements.txt b/requirements.txt
deleted file mode 100644
index b441e26..0000000
--- a/requirements.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-black==23.3.0
-pylint==2.17.2
-python-dotenv==0.21.1
-requests==2.28.2
-google-api-python-client==2.80.0
-google-auth-httplib2==0.1.0
-google-auth-oauthlib==1.0.0
-pynecone==0.1.18
-pyttsx3==2.90
-urlextract==1.8.0
-pandas==2.0.1
-openpyxl==3.1.2
\ No newline at end of file
diff --git a/response_safe_link.json b/response_safe_link.json
deleted file mode 100644
index 7669e80..0000000
--- a/response_safe_link.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "message": "Success.",
- "success": true,
- "unsafe": false,
- "domain": "vamoaestudiarmedicina.blogspot.com",
- "ip_address": "142.251.45.225",
- "server": "GSE",
- "content_type": "text/html; charset=UTF-8",
- "status_code": 200,
- "page_size": 32546,
- "domain_rank": 44,
- "dns_valid": true,
- "parking": false,
- "spamming": false,
- "malware": false,
- "phishing": false,
- "suspicious": false,
- "adult": false,
- "risk_score": 0,
- "country_code": "US",
- "category": "Forum",
- "domain_age": {
- "human": "23 years ago",
- "timestamp": 965079538,
- "iso": "2000-07-31T17:38:58-04:00"
- },
- "redirected": false,
- "language_code": "N/A",
- "request_id": "BhjYlk0PYY"
-}
\ No newline at end of file
diff --git a/response_suspicious_link.json b/response_suspicious_link.json
deleted file mode 100644
index 4c448e0..0000000
--- a/response_suspicious_link.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "message": "Success.",
- "success": true,
- "unsafe": false,
- "domain": "goalgoof.com",
- "server": "N/A",
- "content_type": "",
- "status_code": 0,
- "page_size": 0,
- "domain_rank": 0,
- "dns_valid": false,
- "parking": false,
- "spamming": false,
- "malware": false,
- "phishing": false,
- "suspicious": true,
- "adult": false,
- "risk_score": 92,
- "category": "N/A",
- "domain_age": {
- "human": "2 years ago",
- "timestamp": 1611766857,
- "iso": "2021-01-27T12:00:57-05:00"
- },
- "redirected": false,
- "language_code": "N/A",
- "request_id": "BhnkDidG6b"
-}
\ No newline at end of file
diff --git a/rxconfig.py b/rxconfig.py
new file mode 100644
index 0000000..c6f7df3
--- /dev/null
+++ b/rxconfig.py
@@ -0,0 +1,14 @@
+"""Local-only defaults; this release has no live integrations or persistent state."""
+
+import reflex as rx
+from reflex.plugins.sitemap import SitemapPlugin
+
+config = rx.Config(
+ app_name="phission",
+ backend_host="127.0.0.1",
+ state_manager_mode=rx.constants.StateManagerMode.MEMORY,
+ telemetry_enabled=False,
+ show_built_with_reflex=False,
+ frozen_lockfile=True,
+ disable_plugins=[SitemapPlugin],
+)
diff --git a/tests/browser.mjs b/tests/browser.mjs
new file mode 100644
index 0000000..b726666
--- /dev/null
+++ b/tests/browser.mjs
@@ -0,0 +1,426 @@
+import assert from "node:assert/strict";
+import fs from "node:fs/promises";
+import { execFileSync } from "node:child_process";
+import path from "node:path";
+import { chromium } from "playwright";
+import AxeBuilder from "@axe-core/playwright";
+
+// Run against an already-started local production server, never a public inbox.
+const origin = new URL(process.env.PHISSION_URL || "http://127.0.0.1:3000")
+ .origin;
+assert.ok(
+ /^http:\/\/(127\.0\.0\.1|localhost)(:\d+)?$/.test(origin),
+ "Use a loopback HTTP server",
+);
+const out = path.resolve(".scratch/browser-validation");
+await fs.mkdir(out, { recursive: true });
+const report = {
+ startedAt: new Date().toISOString(),
+ url: origin,
+ label: "Local production build, not deployed",
+ checks: [],
+ accessibility: [],
+ requests: [],
+ websockets: [],
+ errors: [],
+ externalAttempts: [],
+ behaviorIssues: [],
+ captures: [],
+};
+report.sourceCommit = execFileSync("git", ["rev-parse", "HEAD"], {
+ encoding: "utf8",
+}).trim();
+report.sourceDirty =
+ execFileSync("git", ["status", "--porcelain"], {
+ encoding: "utf8",
+ }).trim() !== "";
+const browser = await chromium.launch({ headless: true });
+report.browser = browser.version();
+const contexts = [];
+function check(name, condition) {
+ assert.ok(condition, name);
+ report.checks.push(name);
+}
+async function context(options = {}) {
+ const ctx = await browser.newContext({
+ viewport: { width: 1440, height: 1000 },
+ ...options,
+ });
+ contexts.push(ctx);
+ await ctx.route("**/*", (route) => {
+ const u = route.request().url();
+ if (/^https?:/.test(u) && new URL(u).origin !== origin) {
+ report.externalAttempts.push(u);
+ return route.abort();
+ }
+ return route.continue();
+ });
+ ctx.on("request", (r) =>
+ report.requests.push({
+ method: r.method(),
+ url: r.url(),
+ type: r.resourceType(),
+ }),
+ );
+ ctx.on("page", (page) => {
+ page.on("pageerror", (e) => report.errors.push(e.message));
+ page.on("websocket", (ws) => report.websockets.push(ws.url()));
+ });
+ return ctx;
+}
+async function ready(ctx) {
+ const page = await ctx.newPage();
+ const response = await page.goto(origin);
+ check("Root returns HTTP 200", response.status() === 200);
+ await page.locator(".message-card").first().waitFor();
+ check(
+ "Exactly five synthetic messages",
+ (await page.locator(".message-card").count()) === 5,
+ );
+ return page;
+}
+async function select(page, sender) {
+ await page.getByRole("button", { name: new RegExp(sender) }).click();
+ await page.waitForFunction(
+ (name) =>
+ document
+ .querySelector(".message-card[aria-pressed=true]")
+ ?.textContent.includes(name),
+ sender,
+ );
+ await page.waitForFunction(
+ () => document.activeElement?.id === "message-heading",
+ );
+ await page.locator(".result").waitFor({ state: "detached" });
+ check(
+ `Message selection moves focus: ${sender}`,
+ await page
+ .locator("#message-heading")
+ .evaluate((el) => document.activeElement === el),
+ );
+ check(
+ `Result resets on message selection: ${sender}`,
+ (await page.locator(".result").count()) === 0,
+ );
+}
+async function analyze(page, index, title, score) {
+ await page.locator(".link-choice").nth(index).click();
+ await page.waitForFunction(
+ (i) =>
+ document
+ .querySelectorAll(".link-choice")
+ [i]?.getAttribute("aria-pressed") === "true",
+ index,
+ );
+ await page.locator(".result").waitFor({ state: "detached" });
+ await page
+ .getByRole("button", { name: "Run demo analysis", exact: true })
+ .click();
+ await page.getByRole("heading", { name: title, exact: true }).waitFor();
+ await page.getByText(score, { exact: true }).waitFor();
+ check(
+ `Correct result: ${title} (${score})`,
+ (await page.locator(".score-label").innerText()) === score,
+ );
+ const selected = await page
+ .locator(".link-choice[aria-pressed=true] .url-text")
+ .innerText();
+ check(
+ "Verdict stays bound to selected destination",
+ (await page.locator(".result-target").innerText()) === selected,
+ );
+}
+async function axe(page, name) {
+ const results = await new AxeBuilder({ page })
+ .withTags(["wcag2a", "wcag2aa", "wcag21a", "wcag21aa", "wcag22aa"])
+ .analyze();
+ const violations = results.violations.map((v) => ({
+ id: v.id,
+ impact: v.impact,
+ description: v.description,
+ nodes: v.nodes.map((n) => ({
+ target: n.target,
+ summary: n.failureSummary,
+ })),
+ }));
+ report.accessibility.push({
+ name,
+ violations,
+ incomplete: results.incomplete.map((v) => ({
+ id: v.id,
+ nodes: v.nodes.length,
+ })),
+ passes: results.passes.length,
+ });
+ if (violations.length === 0)
+ report.checks.push(`No automated WCAG violations: ${name}`);
+}
+async function capture(page, name, options = { fullPage: true }) {
+ await page.screenshot({ path: `${out}/${name}.png`, ...options });
+ report.captures.push({
+ file: `${name}.png`,
+ url: page.url(),
+ viewport: page.viewportSize(),
+ theme: "light",
+ emulated: true,
+ capturedAt: new Date().toISOString(),
+ });
+}
+try {
+ const desktopContext = await context();
+ const page = await ready(desktopContext);
+ check(
+ "Explicit synthetic notice",
+ await page
+ .getByText("Synthetic emails. No inbox connection.", { exact: true })
+ .isVisible(),
+ );
+ check(
+ "Analysis initially disabled",
+ await page
+ .getByRole("button", { name: "Run demo analysis", exact: true })
+ .isDisabled(),
+ );
+ check(
+ "No active email destination links",
+ (await page.locator('a[href*=".example"], a[href*=".test"]').count()) === 0,
+ );
+ await axe(page, "desktop initial");
+ await capture(page, "desktop-inbox");
+ await analyze(
+ page,
+ 0,
+ "Lower signal, not a guarantee",
+ "Fixture score: 0 / 100",
+ );
+ await capture(page, "desktop-zero");
+ await page.locator(".link-choice").nth(1).click();
+ await page.waitForFunction(() => document.querySelector(".result") === null);
+ check(
+ "Changing links removes prior verdict",
+ (await page.locator(".result").count()) === 0,
+ );
+ await analyze(
+ page,
+ 1,
+ "Lower signal, not a guarantee",
+ "Fixture score: 12 / 100",
+ );
+ await select(page, "Account Support");
+ await analyze(page, 0, "High concern", "Fixture score: 96 / 100");
+ check(
+ "Query and fragment preserved",
+ (await page.locator(".result-target").innerText()) ===
+ "https://account-review.test/verify?source=email&step=confirm#account",
+ );
+ await axe(page, "desktop high concern");
+ await capture(page, "desktop-high");
+ await page.locator(".result").screenshot({ path: `${out}/result-high.png` });
+ const second = await ready(await context());
+ check(
+ "New session has no inherited result",
+ (await second.locator(".result").count()) === 0,
+ );
+ await select(second, "People Team");
+ await analyze(second, 0, "Reasons for caution", "Fixture score: 80 / 100");
+ check(
+ "Independent session leaves first verdict unchanged",
+ (await page.locator("#result-title").innerText()) === "High concern",
+ );
+ await select(page, "Parcel Desk");
+ check(
+ "Attachment boundary is visible",
+ (await page.locator(".coverage").innerText()) ===
+ "Partial coverage. Attachments are not analyzed.",
+ );
+ await analyze(page, 0, "No verdict available", "No usable score");
+ await axe(page, "desktop unknown");
+ await capture(page, "desktop-unknown");
+ await select(page, "robin@garden");
+ check(
+ "No-links state is explicit",
+ await page
+ .getByText("No HTTP(S) links found in readable text", { exact: true })
+ .isVisible(),
+ );
+ check(
+ "No-links state is not a safety claim",
+ await page.getByText(/This is not a safety verdict/).isVisible(),
+ );
+ check(
+ "No analysis button for no-links message",
+ (await page
+ .getByRole("button", { name: "Run demo analysis", exact: true })
+ .count()) === 0,
+ );
+
+ const keyboard = await ready(
+ await context({ viewport: { width: 1280, height: 900 } }),
+ );
+ await keyboard.keyboard.press("Tab");
+ check(
+ "First keyboard target is skip link",
+ (await keyboard.evaluate(() => document.activeElement.textContent)) ===
+ "Skip to demo",
+ );
+ await keyboard.keyboard.press("Enter");
+ await keyboard.waitForFunction(() => document.activeElement.id === "demo");
+ check(
+ "Skip link focuses workspace",
+ (await keyboard.evaluate(() => document.activeElement.id)) === "demo",
+ );
+ await keyboard.keyboard.press("Tab");
+ check(
+ "Keyboard enters message list",
+ await keyboard.evaluate(() =>
+ document.activeElement.classList.contains("message-card"),
+ ),
+ );
+ await keyboard.keyboard.press("Space");
+ await keyboard.waitForFunction(
+ () => document.activeElement?.id === "message-heading",
+ );
+ await keyboard.keyboard.press("Tab");
+ check(
+ "Keyboard reaches link selection",
+ await keyboard.evaluate(() =>
+ document.activeElement.classList.contains("link-choice"),
+ ),
+ );
+ await keyboard.keyboard.press("Space");
+ await keyboard.waitForFunction(
+ () =>
+ document.querySelector(".link-choice")?.getAttribute("aria-pressed") ===
+ "true" && !document.querySelector(".primary-button")?.disabled,
+ );
+ await keyboard.keyboard.press("Tab");
+ await keyboard.keyboard.press("Tab");
+ check(
+ "Keyboard reaches analysis button",
+ (await keyboard.evaluate(() => document.activeElement.textContent)) ===
+ "Run demo analysis",
+ );
+ const focusStyle = await keyboard.evaluate(() => ({
+ style: getComputedStyle(document.activeElement).outlineStyle,
+ width: getComputedStyle(document.activeElement).outlineWidth,
+ }));
+ check(
+ "Visible keyboard focus outline",
+ focusStyle.style === "solid" && parseInt(focusStyle.width) >= 2,
+ );
+ await keyboard.keyboard.press("Enter");
+ await keyboard.getByText("Fixture score: 0 / 100", { exact: true }).waitFor();
+ check(
+ "Keyboard-only analysis completes",
+ (await keyboard.locator("[role=status]").innerText()) ===
+ "Simulated result: Lower signal, not a guarantee.",
+ );
+
+ const mobile = await ready(
+ await context({
+ viewport: { width: 390, height: 844 },
+ isMobile: true,
+ hasTouch: true,
+ reducedMotion: "reduce",
+ }),
+ );
+ await capture(mobile, "mobile-inbox");
+ await select(mobile, "People Team");
+ check(
+ "Deceptive HTML label exposed separately",
+ (await mobile.locator(".link-label").innerText()) ===
+ "Label in email: “Open the staff portal”",
+ );
+ await analyze(mobile, 0, "Reasons for caution", "Fixture score: 80 / 100");
+ await axe(mobile, "mobile caution, reduced motion");
+ await capture(mobile, "mobile-caution");
+ await mobile.locator(".result").scrollIntoViewIfNeeded();
+ await capture(mobile, "mobile-result", { fullPage: false });
+ await mobile
+ .getByRole("link", { name: "← Back to messages", exact: true })
+ .click();
+ await mobile.waitForFunction(
+ () => document.activeElement.id === "inbox-title",
+ );
+ check(
+ "Mobile return link focuses inbox",
+ (await mobile.evaluate(() => document.activeElement.id)) === "inbox-title",
+ );
+ check(
+ "Reduced motion disables card transitions",
+ (await mobile
+ .locator(".message-card")
+ .first()
+ .evaluate((el) => getComputedStyle(el).transitionDuration)) === "0s",
+ );
+ for (const width of [320, 390, 640, 768, 1024, 1440]) {
+ await mobile.setViewportSize({ width, height: 900 });
+ check(
+ `No horizontal overflow at ${width}px`,
+ await mobile.evaluate(
+ () => document.documentElement.scrollWidth <= innerWidth,
+ ),
+ );
+ }
+ await mobile.setViewportSize({ width: 320, height: 800 });
+ await capture(mobile, "narrow-320");
+
+ const nojs = await (await context({ javaScriptEnabled: false })).newPage();
+ const nojsResponse = await nojs.goto(origin);
+ check("No-JS page returns HTTP 200", nojsResponse.status() === 200);
+ check(
+ "No-JS introduction readable",
+ await nojs.getByRole("heading", { level: 1 }).isVisible(),
+ );
+ check(
+ "No-JS limitation explicit",
+ (await nojs.locator("noscript").innerText()) ===
+ "This demo needs JavaScript and a running Reflex server. No mailbox or scanning service is connected.",
+ );
+ const missing = await (await context()).newPage();
+ const notFound = await missing.goto(`${origin}/does-not-exist/nested`);
+ check("Unknown nested route returns HTTP 404", notFound.status() === 404);
+ check("No application JavaScript errors", report.errors.length === 0);
+ check(
+ "No attempted external browser requests",
+ report.externalAttempts.length === 0,
+ );
+ check(
+ "All WebSockets stay on local origin",
+ report.websockets.every((u) => new URL(u).host === new URL(origin).host),
+ );
+ check("No keyboard/navigation issues", report.behaviorIssues.length === 0);
+ check(
+ "All automated accessibility scans passed",
+ report.accessibility.every((r) => r.violations.length === 0),
+ );
+ report.ok = true;
+} catch (error) {
+ report.ok = false;
+ report.failure = error.stack;
+ console.error(error);
+ process.exitCode = 1;
+} finally {
+ for (const ctx of contexts) await ctx.close();
+ await browser.close();
+ report.finishedAt = new Date().toISOString();
+ await fs.writeFile(
+ `${out}/browser-results.json`,
+ JSON.stringify(report, null, 2),
+ );
+ console.log(
+ JSON.stringify(
+ {
+ ok: report.ok,
+ checks: report.checks.length,
+ accessibility: report.accessibility,
+ errors: report.errors,
+ externalAttempts: report.externalAttempts,
+ behaviorIssues: report.behaviorIssues,
+ failure: report.failure,
+ },
+ null,
+ 2,
+ ),
+ );
+}
diff --git a/tests/test_build_contract.py b/tests/test_build_contract.py
new file mode 100644
index 0000000..a406cd2
--- /dev/null
+++ b/tests/test_build_contract.py
@@ -0,0 +1,36 @@
+"""Keep the frontend package-manager choice explicit rather than falling back."""
+
+import subprocess
+from pathlib import Path
+
+from rxconfig import config
+
+ROOT = Path(__file__).resolve().parents[1]
+
+
+def test_frontend_lock_and_config_are_bun_only():
+ assert config.frozen_lockfile is True
+ assert (ROOT / "reflex.lock" / "bun.lock").is_file()
+ assert (ROOT / "reflex.lock" / "package.json").is_file()
+ assert not (ROOT / "reflex.lock" / "package-lock.json").exists()
+
+
+def test_build_preflight_fails_without_local_bun(tmp_path):
+ result = subprocess.run(
+ ["make", "frontend-tooling", f"REFLEX_DIR={tmp_path}"],
+ cwd=ROOT,
+ capture_output=True,
+ text=True,
+ timeout=10,
+ )
+ assert result.returncode != 0
+ assert "Run make setup to install project-local Bun." in result.stdout
+
+
+def test_standard_commands_initialize_and_require_the_local_toolchain():
+ makefile = (ROOT / "Makefile").read_text()
+ assert "reflex init --name phission --no-agents" in makefile
+ assert "export REFLEX_USE_NPM := false" in makefile
+ assert "export REFLEX_USE_SYSTEM_BUN := false" in makefile
+ assert "run: frontend-tooling" in makefile
+ assert "build: frontend-tooling" in makefile
diff --git a/tests/test_html_boundaries.py b/tests/test_html_boundaries.py
new file mode 100644
index 0000000..b339362
--- /dev/null
+++ b/tests/test_html_boundaries.py
@@ -0,0 +1,47 @@
+"""Regressions for content the old plain-text extraction misrepresented."""
+
+import pytest
+
+from phission.models import ContentStatus
+from phission.parsing import parse_message
+
+
+def parse_html(body):
+ return parse_message(f"Content-Type: text/html; charset=utf-8\n\n{body}".encode(), "html")
+
+
+@pytest.mark.parametrize(
+ "body",
+ ['', "", ""],
+)
+def test_visual_only_html_is_not_a_readable_no_links_message(body):
+ message = parse_html(body)
+ assert message.content_status == ContentStatus.UNSUPPORTED
+ assert message.links == ()
+ assert message.notes
+
+
+def test_readable_text_with_uninspected_image_has_partial_coverage():
+ message = parse_html('