The project side of the frozen Hub contract
(central_ai_llm_master/docs/ask-contract.md), on this service's own port:
GET /capabilities the routing topics the Hub reads, project "compass_nhs"
POST /ask one short, read-only answer about a child's school work
POST /notify accept the contract's notification shape, deliver via Apprise
All three require the shared bearer token SCHOOL_HUB_TOKEN; with no token they
answer 503. GET /health now also carries "ok": true and "hub_api".
/ask answers deterministically (no model on the path) from the stored Compass
items, reusing dashboard.Classify so the answer and the dashboard never
disagree. It is one short sentence, for example "Harry has 8 school events
today from 8:55am to 6:00pm and 6 overdue tasks", with the buckets in `data`.
It reads only, enforced by a Reader interface with no write method and by
TestHubAskReadsOnly.
Fail loudly (FR-12): a missing or failed scan is never an empty day. /ask says
due work is unknown, and an answer older than 36 hours carries a stale warning.
Permission follows the contract: a parent may ask about any child; anyone else
only about themselves.
/notify follows the house interpretation already used by internet_use_control:
the contract shape is accepted and delivered to the named person, recorded in
notifications with scope "hub". An unknown person is refused, not misdelivered.
Live proof on .13 (deploy/verify-phase8.sh):
/health 200, ok true
/capabilities 200, project compass_nhs; unsigned 401
/ask 200, the sentence above, duration 1ms
/notify 400 on a bad level (auth proven, nothing sent), then 200 with
a real delivery to Sam on email and WhatsApp
The live Hub registration (HUB_PROJECTS + HUB_PROJECT_COMPASS_NHS_TOKEN +
hub restart) is a change to a running family service and is pending approval.
Co-Authored-By: Paperclip <noreply@paperclip.ing>
41 lines
1.1 KiB
YAML
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.6.0-phase8"
|
|
image: compass-teams-nhs/school:0.6.0-phase8
|
|
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:
|