Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .ai/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ workers stay route-owned and demand-loaded. Large or attacker-controlled work
uses explicit actions or bounded debounce, input/output limits, timeout,
cancellation, stale-result protection, and disposal on route teardown.

Shared QR recognition lives in the barcode reader service. Normal builds
prefer the browser `BarcodeDetector` and lazily use the local `qr-scanner`
worker only when native QR detection is unavailable. OTP camera capture keeps
permission explicit, validates frame dimensions, decodes one requested frame,
and stops every media track on request, timeout, failure, or unmount.
Standalone compiles this fallback out because its DataLens CSP sets
`worker-src 'none'`; it must never attempt a blob worker there.

The common worker lifecycle is implemented by `src/utils/worker-protocol.ts`,
`src/utils/worker-task.ts`, and `src/utils/bounded-text-task.ts`. Workers validate
both request and response envelopes; replacement, cancellation, timeout, and
Expand Down
6 changes: 6 additions & 0 deletions .ai/FEATURES.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ cron schedules, barcode workflows, JWK/JWKS and asymmetric JWT verification,
OpenAPI inspection, PKCS#12/public PEM inspection, offline GeoIP, and the local
encrypted OTP vault.

QR Decoder & OTP Import and Barcode Generator/Reader share cross-browser local
QR recognition in the normal build: native detection is preferred and Firefox
uses a lazy worker fallback for files and explicit camera frames. The
single-file DataLens build remains native-only because its CSP denies workers;
manual OTP payload parsing remains available there.

Local LLM Playground is the only model-inference tool. It offers fixed
text-only Qwen3.5 Lite 0.8B, Standard 2B, and Quality 4B tiers through local
WebGPU inference with explicit same-origin downloads, per-file parallel
Expand Down
18 changes: 17 additions & 1 deletion .ai/FIXES.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Resolved Engineering State

The approved correctness, security, delivery, persistence, and performance
work is complete as of 2026-08-27.
work is complete as of 2026-09-02.

- Production dependency audit has no known advisory in the approved graph.
- Scoped transitive overrides keep the browser-only Transformers dependency's
Expand All @@ -16,6 +16,22 @@ work is complete as of 2026-08-27.
interleaving aggregate and per-file percentages. Its pinned q4 artifacts are
served same-origin only; Transformers.js remote fallback is disabled and a
focused browser regression rejects Hugging Face runtime traffic.
- QR image reading and OTP camera-frame decoding prefer the native
`BarcodeDetector` where available and use a bounded, lazy local worker
fallback in Firefox. The shared reader retains file, pixel, payload, result,
explicit-permission, five-minute teardown, and media-track cleanup bounds.
Standalone remains native-only because its target CSP denies workers.
- The release dependency graph pins `browserslist` 4.28.7 so the production
audit remains free of the advisories affecting earlier transitive versions.
- The pinned nginx-unprivileged 1.30.4 Alpine 3.24 digest is refreshed after
Trivy exposed fixable OpenSSL and Expat CVEs in the previous immutable image;
the runtime layer explicitly upgrades Expat to the fixed 2.8.4-r0 floor until
that package reaches the pinned base digest.
- E2E route inventory counts unique paths so intentional Newest/Favorites card
duplicates do not look like extra tools; Mermaid cancellation delays its
first lazy-module fixture deterministically. CI runs the complete suite in
three Chromium shards and focused Firefox/WebKit smokes for the shell,
worker-backed conversion, shared QR reader, and camera path.
- Root, subpath, reverse-proxy, security-header, PWA, Firefox, WebKit, Chromium,
and Long Task coverage exists in the repository.
- Storage migrations, quota failure, rollback, and stale-cache cleanup are
Expand Down
33 changes: 19 additions & 14 deletions .ai/HANDOFF.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ The repository may be intentionally dirty; inspect `git status` and never
overwrite unrelated local-fork work. Do not merge, rebase, or cherry-pick
upstream automatically.

Current checkpoint: branch `feat/ai-tools-local-llm-1842`, based on commit
`5395615c0c9537ebf78b20e6c7b275f4ab3fa794`. The branch tip packages the final
approved browser-tool catalog, persistence/UI/performance work, standalone
delivery, and the 2026-08-27 Local LLM same-origin model mirror. Keep the whole
branch together when reviewing or transferring it.
Current checkpoint: the 2026-09-02 Firefox QR maintenance release adds a shared
native-first, local worker fallback for QR files and explicit OTP camera frames
in the normal build. It retains the final approved browser-tool catalog,
persistence/UI/performance work, standalone delivery, and the Local LLM
same-origin model mirror. Standalone deliberately compiles the QR fallback out
because the DataLens CSP denies workers.

## Resume

Expand All @@ -39,8 +40,8 @@ the touched surface.

## Standalone/DataLens

The final artifact is `dist-standalone/it-tools.html`: one 7,994,866-byte file
(7.62 MiB; 7,996,917-byte JSON upload envelope) with 126 tools and no runtime
The final artifact is `dist-standalone/it-tools.html`: one 7,996,206-byte file
(7.63 MiB) with 126 tools and no runtime
network resources. `pnpm test:standalone` rebuilds it from current sources and
runs Chromium, Firefox, and WebKit serially.

Expand Down Expand Up @@ -74,13 +75,17 @@ mirror is intentionally untracked: run `pnpm models:download`, then
`pnpm models:check`, before publishing the normal build. Actual GPU/model
acceptance remains a hardware-manual non-claim.

Green focused gates on 2026-08-27: lint, typecheck, 267 Vitest files / 1,482
tests, production build, all 430 build budgets, 28-file / 4.98 GiB model mirror
completeness check, and four Chromium Local LLM route/privacy/same-origin
smokes. The 2026-08-25 release gates also include a clean production dependency
audit, Docker converter compatibility after security overrides, Firefox/WebKit
route coverage, strict dev runtime, and standalone (4 Node + 6 browser tests;
48/48 included worker paths).
Green focused gates on 2026-09-02: lint, typecheck, 267 Vitest files / 1,484
tests, production build, all 432 build budgets, a clean production dependency
audit, Chromium/Firefox QR file and OTP camera regressions, WebKit QR file
coverage, and standalone (4 Node + 6 browser tests; 48/48 included worker
paths). The 28-file / 4.98 GiB model mirror completeness check and four
Chromium Local LLM route/privacy/same-origin smokes remain the accepted model
release evidence.
GitHub runs the complete E2E suite in three Chromium shards. Focused Firefox
and WebKit jobs cover the shell, worker-backed conversion, shared QR fallback,
and camera path without treating Chromium-only performance and permission APIs
as portable contracts.
The Orca desktop runtime was unavailable after the documented open retry, so
interactive visual/model acceptance was not claimed.

Expand Down
7 changes: 7 additions & 0 deletions .ai/PERFORMANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ excluded from JS/shell build statistics. On the 2026-08-25
production Chromium run, first client-side route readiness was 171 ms with a
0.0 ms longest observed task and no worker/model request before Load.

Firefox QR compatibility is route-owned and demand-loaded. The accepted normal
build adds a 18,129-byte raw / 6.39 kB gzip shared reader module and a
43,954-byte raw / 10.46 kB gzip QR worker; neither enters the 719,149-byte shell
or the 53-file Workbox precache. The standalone compile removes the fallback
entirely and remains a 7,996,206-byte single HTML artifact under the 10 MiB
limit.

## Gates

`.ai/baselines/build-budgets.json` is the sole detailed budget source. It
Expand Down
17 changes: 11 additions & 6 deletions .ai/TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@

## Active approved work

There is no active feature backlog. The approved Local LLM Playground is
implemented in the normal build with Lite 0.8B, Standard 2B, and Quality 4B;
Max, vision, automatic downloads, PWA precaching, and standalone inclusion are
deliberately absent. The three approved q4 tiers are mirrored same-origin from
pinned revisions; runtime Hugging Face fallback is prohibited.
There is no active feature or maintenance backlog. Firefox QR decoding and
explicit camera-frame capture were completed with a shared native-first local
fallback and regression coverage. No unrelated feature work is approved.

The approved Local LLM Playground remains implemented in the normal build with
Lite 0.8B, Standard 2B, and Quality 4B; Max, vision, automatic downloads, PWA
precaching, and standalone inclusion are deliberately absent. The three
approved q4 tiers are mirrored same-origin from pinned revisions; runtime
Hugging Face fallback is prohibited.

Do not invent additional tools or revive removed upstream lists.

Expand Down Expand Up @@ -34,4 +38,5 @@ privacy defaults, worker limits/cancellation, and build budgets intact.
No upstream application code or design is approved for adaptation. The local
implementation consumes exact Apache-2.0 `@huggingface/transformers` 4.2.0 and
the three fixed Qwen3.5 ONNX model repositories; integration code and UI remain
local-fork work.
local-fork work. Firefox QR compatibility uses exact MIT `qr-scanner` 1.4.2 as
a lazy normal-build dependency; the integration and UI remain local-fork work.
29 changes: 23 additions & 6 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,28 @@ permissions:

jobs:
test:
timeout-minutes: 10
name: ${{ matrix.label }}
timeout-minutes: 20
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shard: [1/3, 2/3, 3/3]
include:
- label: Chromium 1/3
project: chromium
arguments: --shard=1/3
- label: Chromium 2/3
project: chromium
arguments: --shard=2/3
- label: Chromium 3/3
project: chromium
arguments: --shard=3/3
- label: Firefox smoke
project: firefox
arguments: src/cross-browser-smoke.e2e.spec.ts src/tools/qr-decoder-otp-import/qr-decoder-otp-import.e2e.spec.ts src/tools/barcode-generator-reader/barcode-generator-reader.e2e.spec.ts
- label: WebKit smoke
project: webkit
arguments: src/cross-browser-smoke.e2e.spec.ts src/tools/qr-decoder-otp-import/qr-decoder-otp-import.e2e.spec.ts src/tools/barcode-generator-reader/barcode-generator-reader.e2e.spec.ts
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
with:
Expand Down Expand Up @@ -48,12 +65,12 @@ jobs:
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ hashFiles('pnpm-lock.yaml', '**/playwright.config.ts') }}
key: ${{ runner.os }}-playwright-${{ matrix.project }}-${{ hashFiles('pnpm-lock.yaml', '**/playwright.config.ts') }}
restore-keys: |
${{ runner.os }}-playwright-
${{ runner.os }}-playwright-${{ matrix.project }}-

- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps
run: pnpm exec playwright install --with-deps ${{ matrix.project }}

- name: Run Playwright tests
run: pnpm run test:e2e --shard=${{ matrix.shard }}
run: pnpm run test:e2e --project=${{ matrix.project }} ${{ matrix.arguments }}
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ RUN --mount=type=cache,id=pnpm-store,target=/pnpm/store \
case "$BASE_URL" in /|/*/) ;; *) echo 'BASE_URL must start and end with /' >&2; exit 1 ;; esac && \
pnpm build

FROM nginxinc/nginx-unprivileged:1.30.4-alpine3.24@sha256:44e36330f74d4f3a1d4e222acca9e23b401fb87811a7597024502bb759c4dd49 AS production-stage
FROM nginxinc/nginx-unprivileged:1.30.4-alpine3.24@sha256:45ce1e2e699234253d1def7baa96218a5d00b498d1ba0cbb1a17b6bdf73d1351 AS production-stage

USER root
RUN apk add --no-cache --upgrade 'libexpat>=2.8.4-r0'

ENV NGINX_PORT=8080

Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"@babel/runtime": "7.29.7",
"@huggingface/transformers>sharp": "0.35.0",
"brace-expansion": "1.1.18",
"browserslist": "4.28.7",
"composerize-ts>deepmerge-ts": "8.0.2",
"fast-uri": "3.1.5",
"ip-address": "10.5.0",
Expand Down Expand Up @@ -134,6 +135,7 @@
"pinia": "^2.0.34",
"pkijs": "3.4.0",
"plausible-tracker": "^0.3.8",
"qr-scanner": "1.4.2",
"qrcode": "^1.5.1",
"randexp": "^0.5.3",
"saxen": "11.1.1",
Expand Down
Loading
Loading