Login-page gate, notification outbox dispatcher and cron, assignment
proposals/responses, coverage and training-guide updates, plus the generated
training PDFs. Checkpointed from the host before merging the invite-link fix.
Folders were an implementation detail leaking into the event workflow: every
upload needed a folder first and photos were split across pages. Uploads now
land in a single implicit "Photos" folder and the event page renders one
gallery with the uploader and an edited-only download.
🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
Reopen advanced edits from their saved recipe, seed or take over the quick
editor from them, refresh thumbnails after a save, and add an edited-only
download. Also fixes the Lumenroom library collapsing to slivers on large
shoots and documents deploying both containers on a new host.
🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
Event photos can now be opened in Lumenroom, a WebGL2 develop module, from the
photo editor's Advanced button. The dashboard signs a short-lived token scoped
to one user and event; Lumenroom exchanges it, imports the event's photo list
and proxies bytes on demand, so nothing is copied and the temporary catalog
expires with the bridge session. Saving in Lumenroom renders the photo and
writes it back as the event's edited JPEG, with the advanced recipe kept in
event_photos.advanced_edit_json.
Lumenroom is vendored under lumenroom/ and built as a second compose service,
so one clone and `docker compose up -d --build` deploys both apps.
🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
Event photos and videos are now stored only on the NFS/local share named in
Settings -> Media storage. Uploads, photo editing, video processing and the
per-event filing step refuse to run until that share is configured and
writable, so nothing is silently written inside the container. Video
originals, renditions, posters and sidecars share one folder on the share.
Also adds volunteer growth goals with a mentor queue, an admin retention and
storage sweep with a cron entry point, cached gallery thumbnails with
per-folder ZIP downloads, a server-rendered booth-sheet PDF, and in-app
confirm/release for every upcoming assignment.
Service reminders now ignore the one-off event reminder rule, which had been
queueing an extra bogus reminder for each published service.
Generated with Codebuff 🤖
Co-Authored-By: Codebuff <noreply@codebuff.com>
Admins were authoring plain-text lessons, which made illustrated tutorials
and reordering images impossible. Lesson bodies are now sanitized HTML from a
Tiptap editor with alignment, sizing, drag-reorder and alt text, and inline
images reuse the training_resources table so no migration is needed.
Attachments grow to 25 MB, PDFs stream inline, and SVG is rejected because it
can execute as a document. Legacy plain-text bodies are normalized on read.
🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
Blackout / unavailability (ARCHITECTURE §4.7 / §5.3 rule 5 / §5.4):
- src/domain/availability.ts — pure isUnavailable(records, date); a record
covers the date if active and its inclusive range [starts_on, ends_on]
contains it OR its rrule matches. No DB imports.
- src/domain/availability.test.ts — 11 tests named after the rule, incl.
the inclusive-end case (2026-11-21..2026-11-28 covers 11-28).
- src/db/schema.ts — unavailability table: CHECK ends_on >= starts_on,
CHECK span <= 365 days, unique (user_id, starts_on, ends_on) WHERE active.
- src/db/unavailability.ts — list/get/create/update/cancel (soft-delete);
range + rrule validated on write.
- src/app/api/dev/unavailability/route.ts — GET/POST/PATCH; bad range/rrule
-> 400, cancel flips status=cancelled.
- drizzle/0008_needy_stryfe.sql + migration applied to DB on :5433.
date columns stored as strings (mode: string) to match the YYYY-MM-DD
domain; Postgres date is mode-agnostic so the migration is unchanged.
Constraints enforced twice: validateUnavailabilityRange at the API,
chk_unavailability_* at the DB.
.env added to .gitignore (real secret was not ignored; .env.* missed the
bare .env).
Slot materialization (ARCHITECTURE §5.2): for each non-published
instance, plan the seats planSlots() computes and upsert them on
(service_instance_id, role_id, slot_index). onConflictDoNothing makes
it idempotent; published weeks are skipped (owned by the publish flow).
- src/domain/slots.ts: pure planSlots()/planSlotsForRole(); headcount
fills slotIndex 1..N, call_time = start + offset (null if no offset).
- src/domain/slots.test.ts: 5 tests (Audio headcount 2 -> 2 slots with
correct call_time, clamp to 1, null offset, multi-role flatten).
- src/db/slots.ts: materializeSlotsForInstance() + materializeSlots().
- src/app/api/dev/cron/slots/route.ts: GET drives the daily job.
No schema change (slots unique index predates this unit; position_skills
stays deferred to D5). Verified: draft instance + Audio headcount 2 ->
4 seats (Audio x2 + Livestream + Slides), Audio call_time 09:30 EST;
re-run creates 0 rows. Seed restored to canonical 4 instances / 12
slots after testing.
Service instance generation (ARCHITECTURE §5.1): for each active
service, plan instances in the rolling window and upsert on
(service_id, starts_at). onConflictDoNothing makes the whole thing
idempotent — a re-run creates 0 rows, cancelled/published instances
are never touched, past instances are never deleted.
- src/domain/instances.ts: pure planInstances() + windowTarget();
DST-safe instants via localToUtc, no DB imports.
- src/domain/instances.test.ts: 7 tests (window boundary, DST-safe
instants, determinism, biweekly phase, monthly-nth, windowTarget).
- src/db/instances.ts: generateInstances() idempotent upsert;
occurs_on stored as zoned midnight (no UTC-midnight shift).
- src/app/api/dev/cron/instances/route.ts: GET drives the daily job.
No schema change (service_instances unique index predates this unit;
slot materialization stays deferred to D3). Verified: run twice ->
0 created, count unchanged; published instances byte-identical;
generated instances stored as DST-safe UTC instants.
Service template CRUD (create/read/update/deactivate) and the pure
expandRRULE() recurrence expander for the RFC 5545 subset (WEEKLY,
BIWEEKLY via INTERVAL=2, MONTHLY nth weekday).
- src/domain/recurrence.ts: expandRRULE, parseRecurrence,
matchesRecurrence, validateRecurrence. Pure — no DB imports.
- src/domain/recurrence.test.ts: 13 tests, incl. the 5 required
recurrence cases (spring-forward / fall-back Sunday, monthly-nth
across a year boundary, cancelled instance not regenerated,
biweekly phase stable).
- src/db/services.ts + src/app/api/dev/services/route.ts: list/get/
create/update/deactivate; rrule validated on write; deactivate
flips active (never delete); 409 on duplicate name.
No schema change (services table predates this unit). DST stays in
the caller's localToUtc; interval phase anchored to a fixed epoch so
biweekly never drifts.
Adds the append-only skill_assessments history and the verify path, so a
level can only move together with the row recording who moved it, from
what level, and the comfort they saw.
Adds the user_skills record and slider save path so a volunteer can rate
their own comfort without ever moving the verified level, which stays
C3's to write.
Skills composer: category (required) + optional technology + optional
function -> composed name prefill + dedupe_key. Governing rule: a null
technology yields a generic (technology-agnostic) skill; a duplicate
(category, tech, function) is rejected.
Delivered:
- src/domain/skills.ts — pure composeSkillName (no DB, no src/db imports).
Rule: function+technology -> '<fn> on <tech>'; function only -> '<fn>';
technology only -> '<tech>'; neither -> category. Null technology ->
generic skill (name never names a specific piece of gear).
- src/domain/skills.test.ts — 6 tests named after the composition
behaviors.
- src/app/api/dev/skills/compose/route.ts — POST /api/dev/skills/compose
returns { name, dedupeKey } for prefilling the form; writes no row.
The admin edits the name, then submits to POST /api/dev/skills, which
generates slug + dedupe_key and enforces the unique constraint (409 on
duplicate).
No schema change, no migration: the skills table, data-layer CRUD, and
dedupeKey were delivered in B4; C1 adds only the composition rule +
composer endpoint (matching the isPublishable/validateRequirements
domain pattern).
Verification: typecheck lint test (50, +6) build all green; runtime
smoke /tmp/c1.sh (13 checks): compose fn+tech -> '<fn> on <tech>',
compose function-only -> generic, create composed skill (slug frozen,
dedupe_key persisted), duplicate -> 409, null-tech generic skill,
dangling FK -> 400.
Positions (schedulable seats) CRUD + requirements editor. Governing rule:
a position with no is_core skill refuses to save as publishable.
Schema (src/db/schema.ts):
- skills table (B4 prerequisite of position_skills): id, slug (unique),
name, category_id/technology_id/function_id FKs, dedupe_key
(category|technology|function, NULLs -> ''), mentor_min_level (default
'expert'), stale_after_days (default 120), recert_required, sort_order,
active, created_at, updated_at. All FKs ON DELETE RESTRICT.
- position_skills join: position_id, skill_id, weight, required_level,
is_core; PK (position_id, skill_id).
- roles (positions) gained active (default true) + updated_at for
soft-delete/pickers/audit.
Data layer (src/db/positions.ts): list/create/update/deactivate for
positions and skills; getPositionSkills (skills merged into
position_skills in JS); setPositionSkills (replaces the whole set);
dedupeKey() helper.
Domain (src/domain/positions.ts + .test.ts): pure publishability rule —
isPublishable(skills) = has >=1 is_core skill. 8 tests named after the
rule.
API:
- src/app/api/dev/skills/route.ts — GET/POST/PATCH (slug + dedupe_key
generated at create; slug frozen on update).
- src/app/api/dev/positions/route.ts — GET/POST/PATCH (rename/edit or
deactivate via active:false).
- src/app/api/dev/positions/requirements/route.ts — GET (list a
position's requirements) + POST (set requirements; enforces the
publishability gate: published:true with no core skill -> 400).
Migration drizzle/0004_hesitant_ezekiel.sql.
Verification: typecheck ✓ lint ✓ test ✓ (44, +8) build ✓ db:migrate ✓;
runtime smoke /tmp/b4.sh (24 checks) — publish-with-core 200,
publish-without-core 400, weight-out-of-range 400, rename slug frozen,
deactivate hides from picker but row persists.
Decisions: skills table is a B4 prerequisite; requirements editor takes
positionId in the body (Next 15.5.29 rejects an explicitly-typed
{ params: { id } } route-handler second arg); publishability gate lives
in the domain and is enforced in the route; join resolved in JS
(drizzle 0.45.4 exports no join).
Fixes the A4 blocker: /api/dev/complete now establishes the Auth.js session.
Root cause was UntrustedHost (trustHost defaulted false in pnpm start /
production because setEnvDefaults derives it from AUTH_URL, not NEXTAUTH_URL,
and assertConfig checks it before that default applies). Added trustHost: true
to the auth config; rebuilt. Complete response now sets authjs.session-token,
/schedule returns 200, and all 4 e2e shell tests pass.
Also ignores test-results/ artifacts.