Run 1364 got as far as building and naming the image, then every blob upload
401'd with 'unauthorized: reqPackageAccess'. Forgejo's container routes run
reqPackageAccess(Write), which checks the login token's own scope list for
write:package and rejects a scoped token without it — the token only has to
be scoped, since an unscoped token skips the check. The repo's FORGEJO_TOKEN
secret is such a scoped token.
FORGEJO_/GITHUB_ are reserved secret prefixes, so that name cannot be created
or updated through the API; the workflow now reads REGISTRY_TOKEN instead.
The build has been red since 2026-11-14 (runs 1342+). Every failure is the
registry login step:
Error response from daemon: Get "http://127.0.0.1:3000/v2/": dial tcp
127.0.0.1:3000: connect: connection refused
Forgejo moved off the Pi's docker into k8s, so PUSH_REGISTRY=127.0.0.1:3000
was the job pod's own loopback. Point it at the in-cluster service
forgejo.forgejo.svc.cluster.local:3000 (whitelisted insecure on the runner).
Also:
- runs-on amd64 instead of docker: label docker only exists on the arm64 Pi
runner, whose images the amd64 cluster cannot run.
- drop the job-level permissions block; Forgejo ignores it and flags it with a
pre-execution warning, which was being read as the cause of the failures.
- drop the compose deploy step: it ran docker compose against the dind daemon,
redeploying nothing. Deploys are pinned tags in homek8s apps/base/osint; the
summary now prints the tag to pin.
- tag images amd64-<sha12> (one canonical tag, no :latest drift).
A hit with evidence keeps the meta line and adds a second line: camera
count, the first camera name, and the first headline. A non-empty news
url is an anchor; an empty url stays text. Hits without evidence stay
the one-liner. snapshot_url is never written into the inbox.
Excelsior rows store the feed's CDATA wrapper as the title text, including
the surrounding whitespace. Strip a whole-title wrapper before insert and
again on GET /api/news so existing rows read clean without an UPDATE.
Plain titles and real HTML are unchanged.
/api/health articles.age_s used max(timestamp) with no future-date filter,
so rows ahead of now() reported a negative age. Use the same closed window
as the news list (timestamp <= now(); NULL timestamps are not fresh). If
every non-null timestamp is in the future, age_s is null and ok is false.
GET /api/stats keeps existing counters and adds feeds.vessels.configured
and feeds.fires.configured from non-empty api_keys values only. The stored
value is never returned.
The reduce model returns url="" and save_batch was persisting that blank.
Match each headline to a selected article title and store that article's
url. A null article url or an ambiguous match stores "" — never a guessed
or model-supplied URL.
Camera scrapes still upsert the cameras table. They no longer
JetStream-publish events.camera messages, which the ingester was
inserting as HUD event spam.
The map phase grades every article, but a single wire story arrives from
many station domains with an identical headline (the measured run selected
12 blocks that were only two stories, then produced a ticker with five
summit rows and one FAA row). Dedupe now runs before the threshold/cap, so
SUMMARY_TOP_N buys distinct stories.
- intel.py: pure `dedupe_blocks(blocks, *, similarity, enabled)` plus
`normalize_title` / `title_similarity`. Titles are lowercased, punctuation
flattened and a short digit-free trailing source suffix (" - KCCI",
" | CNN", " — AP") dropped; blocks match on equal normalised titles or
word-set Jaccard / word-sequence difflib ratio >= similarity (default
0.85). Best score wins the group (ties -> earliest), matching is against
the representative only (no transitive chaining), and differing categories
or differing numbers never merge. Blocks now carry their article title.
- summarizer.py: dedupe graded blocks before select_graded() and log
`dedupe 21 -> 9 (kept 9, duplicates 12)`; SUMMARY_DEDUPE=0 skips it,
SUMMARY_DEDUPE_SIMILARITY tunes it. persist_article_scores() still writes
one row per graded article, with duplicates selected=false and
duplicate_of pointing at the surviving article id.
- article_scores.duplicate_of INTEGER NULL in ensure_tables() and alembic
013 (upgrade/downgrade verified against Postgres 16).
- docs/news.md + .env.example document both knobs.
Replaying the observed summary id=6 (21 graded, 9 distinct titles) now keeps
9 and, at min_score=60/top_n=12, selects 2 — the 11 dropped copies that
scored >= 60 are stored selected=false with a duplicate_of pointer.
Two leaks let low-value items reach the operator brief:
- get_recent_news() only bounded the window from below, so event
listings dated days ahead (wiseye.org, +3d/+6d) were re-fetched,
re-graded and re-billed every interval for a week. The window is now
(now - N, now]; NULL timestamps stay excluded as before.
- select_graded() returned ordered[:fallback_top] with no floor, so a
15/100 event listing entered the brief as 'low'. New
SUMMARY_FALLBACK_MIN_SCORE (default 40, clamped 0-100) filters the
fallback set; when nothing clears it the reduce phase gets empty DATA
and writes the empty-brief response. The fallback WARNING now logs the
floor.
Docs: .env.example and docs/news.md document the new knob and window.
The map prompt now grades every article 0-100 against an explicit rubric as
the first line of its block; the summarizer parses Score:, falls back to the
Importance: label when the line is missing, ranks blocks best-first and passes
only score >= SUMMARY_MIN_SCORE (capped at SUMMARY_TOP_N) to the reduce phase.
- new pure helpers in intel.py: parse_map_scores(), select_graded(), join_blocks()
- reduce prompts drop the 'fill the brief with minor incidents and crime'
filler instructions and the 'fill ticker with medium then low' clause
- new article_scores table (ensure_tables + alembic 012) persists every grade
with selected/summary_id/model so thresholds can be tuned from data
- SUMMARY_MIN_SCORE (60), SUMMARY_TOP_N (12), SUMMARY_FALLBACK_TOP (3) env knobs
wiseye.org public-affairs event listings carry pubDate 3-6 days ahead; with
ORDER BY timestamp DESC they pinned the top of the feed for a week and made
the news list look frozen.
- PostgresPipeline drops items whose parsed publish date is >2h in the
future, counts future_dated_dropped (stats + one INFO line per run).
Unparseable dates keep the old behaviour (kept, timestamped now()).
- GET /api/news filters timestamp > now() in the query while still returning
timestamp IS NULL rows; limit/offset/domain/since unchanged.
- docs/news.md documents the guard.
- tests: pipeline drop/keep unit tests, API future-row exclusion + limit.
Behind the cluster's HTTP origin listener Envoy normalizes
X-Forwarded-Proto to http, so _is_https() never fires and the session
cookie was issued without Secure. Add an explicit deploy-time flag:
set_session_cookie() now marks the cookie Secure when the env var is
1/true/yes (case-insensitive, stripped) or the header inference says
https. clear_session_cookie() is unchanged, SameSite stays Lax.
Tests cover flag-over-http, header-without-flag, and the local-dev path;
docs/auth.md and .env.example document the variable.
Adds single-admin authentication to the dashboard. Anonymous visitors get a
read-only site (map + news); the one admin unlocks everything else.
- app/auth.py: deny-by-default ASGI middleware on /api/* with an explicit
public read allowlist; /login page; /api/auth/{login,logout,me}; PBKDF2
password hashing; HMAC-signed HttpOnly SameSite=Lax session cookie (7d,
Secure behind X-Forwarded-Proto: https); 5-fail/15-min per-IP login limit;
Origin/Referer host check on state-changing admin requests.
- Fails closed: missing ADMIN_PASSWORD_HASH or ADMIN_SESSION_SECRET -> admin
routes 403 'admin auth not configured', public site unaffected.
- app/main.py: mounts the middleware + router (6 lines, no per-route decorators).
- app/static/index.html: hides Ingest/API Keys/Settings, the summarizer panel
and geofence write controls until /api/auth/me says admin; adds a discreet
SIGN IN link to /login. CSS gates fail closed without JS.
- tests/test_auth.py: 42 tests (anonymous 401s, login/logout, tampered and
expired cookies, fail-closed, rate limit, CSRF, HUD markup).
- Existing API tests now send an admin session cookie for admin routes.
Public allowlist extends the spec's list with the remaining read-only GETs the
HUD calls (/api/stats, /api/conflicts, /api/place, /api/satellites,
/api/infrastructure, /api/map/gpsjam, /api/map/times, /api/fire-incidents,
/api/fire-perimeters, /api/weather-alerts, /api/storms, /api/geofences/{id}/at)
so an anonymous HUD is not half-broken.
Phone can finish a polygon without double-click. List is mute/go/rename/delete.
Inbox seeds from /api/geofence-alerts and appends WS hits. Watch all fence
ids on /ws/live. Selected-fence DVR uses GET /api/geofences/{id}/at.
Off-viewport clients that send {type:watch_geofences,ids} on /ws/live
still receive geofence_alert; AIS/ADS-B stay viewport-only.
GET /api/geofence-alerts accepts geofence_id/since/until/source_kind.
GET /api/geofences/{id}/at returns CAGG+FIRMS inside the fence at T
(404 if missing, empty lists if DB down). DELETE missing fences 404s.
Reject private/loopback/link-local hosts on POST /api/ingest/rss and
URL-shaped GDELT queries via camera_scraper.is_public_url (HTTP 400).
PATCH /api/sources/{id} only accepts name, url, config, enabled (422 else).
Pin titiler to the Pi-running digest, make workers=1 explicit for
in-memory WS/layer caches, and add PostGIS GIST indexes for events/fires
bbox pans without dropping the existing btree indexes.