Skip to content

notices(core): persisted in-app notices with backup failures as first producer - #11

Merged
TusanHomichi merged 1 commit into
mainfrom
claude/repo-setup-complete-y2qmmk
Aug 28, 2026
Merged

TusanHomichi merged 1 commit into
mainfrom
claude/repo-setup-complete-y2qmmk

Conversation

@TusanHomichi

@TusanHomichi TusanHomichi commented Aug 28, 2026 •

Copy link
Copy Markdown
Member

Primary Issue

Closes #10

Problem And Outcome

The architecture requires workflow notices to be persisted and shown in the application, never dependent on email — and a failing automatic backup currently reaches only the server log a small center may never read. After merge, backup failures land in every administrator's interface as persisted notices, on plumbing later training-workflow milestones will reuse.

Changes

  • Migration 0003: recipient-scoped notice table (kind, message, created/read instants)
  • Notices service: creation targeted at capability holders with per-recipient dedup (no new notice of a kind while one is unread — a repeatedly failing backup is one unread notice per administrator, not a flood); recipient-scoped listing and mark-read, with the scoping in the queries themselves
  • The backup scheduler now surfaces failures to every manage_users holder in addition to logging
  • HTTP: GET /api/notices, POST /api/notices/{id}/read; a foreign or already-read notice returns a 404 indistinguishable from a missing one
  • Shell: notices panel on the status page with mark-read; unread-count badge in the header

Scope

Verification

  • Listed the exact verification commands run below
  • Added or updated tests when behavior changed — 3 new integration tests: producer dedup lifecycle (fail → suppress → acknowledge → fail again), end-to-end recipient scoping over the API (trainee cannot see or acknowledge an administrator's notice), auth requirement; browser E2E asserts the panel renders
  • Added or updated an ADR when a durable decision changed — none: this implements the architecture document's existing Notifications decision
  • All fixtures and examples are invented; no real agency data
- (web) npm run check   (0 errors, 0 warnings)
- (web) npm run build
- cargo fmt --check
- cargo clippy --workspace --all-targets -- -D warnings
- cargo test --workspace   (38 passed across 8 targets)
- (web) npx playwright test   (full shell lifecycle incl. notices panel, 1 passed)

Review And Merge Notes

  • Review focus: the dedup INSERT…SELECT in notices.rs and the 404-indistinguishability choice for foreign notices
  • User or operator impact: backup failures become visible in the UI; administrators get an unread badge

… producer

Establish the notices mechanism the architecture requires (workflow and
operational events shown in the application, never dependent on email):

- migration 0003: recipient-scoped notice table (kind, message,
  created/read instants)
- notices service: creation for capability holders with per-recipient
  dedup (no new notice of a kind while one is unread), recipient-scoped
  listing and mark-read — scoping lives in the queries, so no path can
  touch another user's notices
- automatic-backup failures now notify every manage_users holder as a
  persisted notice in addition to the log; repeated failures stay at
  one unread notice per administrator until acknowledged
- HTTP: GET /api/notices and POST /api/notices/{id}/read; a foreign or
  already-read notice is a 404 indistinguishable from a missing one
- shell: notices panel on the status page with mark-read, and an
  unread-count badge in the header
- 3 new integration tests (producer dedup lifecycle, end-to-end
  recipient scoping over the API, auth requirement); browser E2E
  asserts the panel

Closes #10
@TusanHomichi
TusanHomichi merged commit c298270 into main Aug 28, 2026
1 check passed
@TusanHomichi
TusanHomichi deleted the claude/repo-setup-complete-y2qmmk branch September 4, 2026 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Milestone 1: persisted in-app notices, with backup failures as the first producer

2 participants