Files
compass_teams_nhs/docker-compose.yml
Sam Rolfe 207a4978a9 Phase 4: per-child sessions, scan both children, items separated
Fetch and parse Harry and Finn with a stored Compass session per child and
store every item against the right children.id.

- cmd/school/session.go + internal/store/session.go: read and write the
  per-child harness session state in the SQLite `session` table. `show`
  prints metadata only; the state is never printed.
- scripts/compass-fetch-patchright.mjs: reuse the stored session, refresh it
  after login, resolve the child's userId from the parent page by name, and
  keep the shared calendar out of the per-child run (it would leak the
  eldest's timetable into the younger child).
- scripts/scan-compass.sh + make scan: scan one child or both; restore the
  session, fetch, persist the session, then parse. A failing child is
  recorded in `scans` with ok = 0 and the script exits non-zero (FR-12).
- cmd/school/scan.go: `school scan record` writes a fetch failure to the
  scans table. cmd/school/items.go: `school items purge` removes rows that a
  shared page stored against the wrong child.
- internal/store/store_test.go: prove items and sessions are separated by
  child. docs/phase-4-both-children-notes.md; README + image tag 0.3.0-phase4.

Live evidence: Harry 70 tasks / 1 message / 35 events (6 overdue); Finn
42 tasks / 1 message / 0 events (2 overdue). Finn's subjects are Year 7,
Harry's are Year 11. Both sessions stored.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-15 17:40:52 +11:00

41 lines
1.1 KiB
YAML

# Compass / NHS — its own image, own container, own port (8792).
# Deploy on .13: cd /home/sam/paseo/projects/compass_teams_nhs && docker compose up -d --build
#
# Secrets live in environment.d/school-service.env (gitignored), never here.
name: compass-teams-nhs
services:
school:
build:
context: .
args:
VERSION: "0.3.0-phase4"
image: compass-teams-nhs/school:0.3.0-phase4
container_name: compass-teams-nhs
restart: unless-stopped
env_file:
- environment.d/school-service.env
ports:
- "8792:8792"
volumes:
- compass-teams-nhs-data:/data
healthcheck:
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:8792/health"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
# .13 has every default Docker address pool subnetted out (many projects),
# so this single-container service uses the host's default bridge and does
# not create a project network. The port is published above.
network_mode: bridge
volumes:
compass-teams-nhs-data: