Files
Marius van Niekerk b85eae5a79 feat: adopt Go 1.27 JSON v2 semantics (#1475)
Moves AgentsView to Go 1.27 and adopts native `encoding/json/v2`
behavior
throughout. This is a clean migration with no JSON v1 compatibility or
checkpoint fallback paths.

Typed Huma routes now share JSON v2 request and response semantics with
the
rest of the application. OpenAPI continues to describe token usage as
arbitrary JSON. JSONL rewrite paths retain untouched values as raw JSON,
so
large integers stay exact, while stored map output is deterministic
where bytes
define artifact identity.

The Go 1.27 audit also adopts generic methods, assignment-context
inference,
promoted fields in struct literals, `errors.AsType`, and related
standard-library simplifications. Build images, local tooling,
documentation,
and reviewer guidance now require Go 1.27. golangci-lint is pinned to
v2.13.0,
which can analyze the new language level.
2026-08-21 15:27:56 -07:00
..

Screenshot Pipeline

Generates screenshots for the docs site using Playwright inside Docker.

Prerequisites

  • Docker
  • agentsview source at ~/code/agentsview (override with AGENTSVIEW_SRC)
  • A sessions database at ~/.agentsview/sessions.db (override with SOURCE_DB)
  • The screenshot extractor keeps approved public projects from the newest 60-day session window (override with SCREENSHOT_HISTORY_DAYS)
  • Optional local-only screenshot scrub terms via line-separated files. The extractor redacts the current HOME path to ~. By default it also reads both ~/.config/agentsview-docs/screenshot-blocked-terms.txt and the canonical private terms file at ~/.config/kenn/private-terms.txt (or KENN_PRIVATE_TERMS_FILE). Override the screenshot-specific path with SCREENSHOT_BLOCKED_TERMS_FILE, or append terms with SCREENSHOT_BLOCKED_TERMS.

Run all screenshots

./screenshots/run.sh

Output goes to docs/assets/generated/screenshots/.

Run a single screenshot

Pass --grep with the test name:

./screenshots/run.sh --grep "session filters active"

Any extra arguments are forwarded to npx playwright test inside the container.

How it works

  1. Assembles a Docker build context with the agentsview source, sessions database, and test files
  2. Builds a multi-stage Docker image:
    • Stage 1 (builder): Compiles the agentsview Go binary with frontend assets
    • Stage 2 (db): Extracts a reduced database with screenshot-safe projects
    • Stage 3 (playwright): Installs Playwright + Chromium + PostgreSQL, copies binary and DB
  3. Runs the container, which:
    • Starts PostgreSQL and pushes test data from two simulated machines
    • Starts agentsview on port 8090 (SQLite mode, for most screenshots)
    • Starts agentsview pg serve on port 8091 (PG mode, for machine label screenshots)
    • Executes the Playwright tests against both servers
  4. Screenshots are written to the mounted /output volume (docs/assets/generated/screenshots/)

Stages 1 and 2 are cached by Docker, so re-runs after test file changes are fast.

Configuration

Viewport: 1440x900, dark mode, America/Chicago timezone. See playwright.config.ts.

Test file

All tests live in tests/screenshots.spec.ts. Each test navigates to a UI state and calls snap(page, 'name') or snapEl(locator, 'name') to capture a PNG.