Sam Rolfe faed46b494 docs: record accepted Phase 2 decisions (patchright scraper, 2FA)
- §9 Technology: scraper is patchright (headless Playwright); the
  pi-browser-harness gets a Cloudflare 403 managed challenge on the login POST.
- §13 Resolved: add the patchright decision and the 2FA finding (the Compass
  parent login required no two-factor or one-time code during the Phase 2 proof).
- §13 Remaining: Teams two-factor auth is still unverified.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-15 16:49:00 +11:00

Compass / NHS

A school service for Harry and Finn: Compass for the daily schedule and notices, Teams for homework and assignments. It stores what is due per child, puts overdue work first, and tells the family before work is late.

Build spec: AGENTS.md. This repository is at Phase 1 (the skeleton). See §11 of the spec for the phase order.

Status — Phase 1

Built and deployed on .13:

  • Go service, SQLite schema for children, items, scans, notifications, session (internal/store/migrations/001_init.sql).
  • The service's own session login — a signed cookie, not SSO.
  • Server-rendered HTMX shell using the Family Home Lab design tokens (internal/web/static/tokens.css), phone-friendly with dark mode.
  • GET /health.
  • Its own container and port 8792, behind Caddy at school.lab.audasmedia.com.au.

Not built yet (later phases): the Compass login and fetch, parsing, both children's data, the dashboard data, the calendar write, notifications, and the Hub API. It does not scan the school in this phase.

Fail loudly (FR-12)

A missing or failed scan is shown as an explicit warning or error, never as an empty day. The dashboard reads the scans table and shows one of:

  • NO SCAN HAS RUN YET — amber banner.
  • SCAN FAILED — red banner with the failure on record.
  • Last scan completed — green banner.

Layout

cmd/school/                 service entry point
internal/config/            environment configuration
internal/store/             SQLite: schema, migrations, queries
internal/auth/              session login (signed cookies, CSRF)
internal/web/               HTTP handlers, templates, static assets
deploy/                     Caddy snippet, deployment notes, verify script
environment.d/              env example (the real file is gitignored)

Run

cp environment.d/school-service.env.example environment.d/school-service.env
chmod 600 environment.d/school-service.env   # then fill in the secrets
docker compose up -d --build

Generate secrets with the built image:

docker run --rm --entrypoint /app/school compass-teams-nhs/school:0.1.0-phase1 gen-secret
docker run --rm --entrypoint /app/school compass-teams-nhs/school:0.1.0-phase1 hash-password 'the-password'

Note: Docker Compose interpolates $VAR inside env_file. A bcrypt hash contains $, so escape each one as $$ in the env file.

Verify

make verify-phase1

It checks the container is healthy, GET /health returns 200, the login page renders and a session login succeeds, and Caddy serves the public URL.

Rules

  • Read-only against the school. Never post, message, or submit anything.
  • A failed scan must be loud — never report an empty day as "nothing due".
  • School credentials and harness session state are secrets; never commit them.
  • This project has its own folder, container, and port.
Description
Scan Compass and Teams for the boys school schedule and homework.
Readme 1.3 MiB
Languages
Go 80.3%
JavaScript 6.2%
Shell 5.6%
HTML 3.6%
CSS 3.3%
Other 0.9%