Feelcouch ProjectsHandbook · v1.47.0

Guides

Identity 2.0 experience audit

v1.22.1 corrects participant lifecycle/baseline writes, welcome privacy copy, the second-reminder query horizon and malformed-timezone fallback. The full gate passed346tests with no skips, and26route UIchecks were repeated. Expiry/catch-up, diary history and PDF semantics remain open decisions. See current acceptance status.

Audit date: 2026-09-30. Scope: FC-CHK-002, FC-DIARY-001, FC-DASH-001, FC-FAC-002, FC-EXP-001, FC-BOT-007 and FC-CBT-001 against platform-docs/guides/identity-2.md and the corresponding files under platform-docs/tasks/. This is an implementation audit, not evidence that every configuration and Telegram delivery was exercised in production.

Verdict

The daily score, diary, baseline dashboard, facilitator participant card and published PDF have real implementations. The principal participant flows worked in the disposable local database. The current completion labels nevertheless hide server authorization and reminder edge cases. Guided Socratic chains remain explicitly deferred; existing general-purpose workbooks and experiments do not establish completion of FC-CBT-001.

Requirement coverage

Task Implemented evidence Remaining qualification
FC-CHK-002 app/actions/daily-mood.ts validates integer 0–10 and upserts one row per participant/local day. app/(app)/checkin/page.tsx presents daily mood above weekly check-in. components/participant/notification-settings.tsx and app/actions/notifications.ts persist participant-selected time and opt-out. lib/reminders.ts defaults to 20:00, checks today's mood and deduplicates by local date. Writes do not enforce membership/course lifecycle or the baseline gate. Invalid timezones are not handled in local-day calculation. Already queued reminders are not reconsidered when mood is later saved.
FC-DIARY-001 lib/queries/diary.ts validates four required fields, each at most 2,000 characters. app/actions/diary.ts scopes updates/deletes to the author. app/(app)/diary/page.tsx groups newest entries by date and provides create/edit/delete/privacy controls. Facilitator and report readers use the shared privacy query. Author UI has no read-only lifecycle check, and server writes have no lifecycle/baseline check. The list silently caps at 200 entries. Day grouping uses the server's locale date, not the participant timezone.
FC-DASH-001 app/(app)/layout.tsx supplies shared Telegram identity header. app/(app)/today/page.tsx shows active baseline values or the reviewing placeholder and daily/weekly series while retaining previous content. components/participant/progress-charts.tsx renders six SVG charts, fewer-than-two-points empty states, token colors and .draw animation; app/globals.css disables meaningful animation for reduced motion. Plain SVG replaces the proposed Recharts client component without losing the core display. X positions use sample index, so gaps in recorded days/weeks are visually compressed.
FC-FAC-002 app/f/participants/[id]/page.tsx calls requireParticipantManager before loading detail and exposes consent/date/version/health fields, baseline links/options/notes, shared diary, mood and weekly charts. app/actions/baseline-values.ts checks manager access, validates options and writes an audit record transactionally. Baseline mutations use a read-access manager guard rather than the existing writable manager guard. Current tests inspect guard order and pure validators; they do not execute a cross-group or non-manager action against a database.
FC-EXP-001 lib/final-report.ts assembles baseline result links, active indicator values, daily mood, all five weekly scales, shared diary, journey and observations. lib/final-report-pdf.ts embeds licensed Cyrillic fonts and draws vector charts. app/actions/final-report.ts saves/publishes/unpublishes and enqueues a publication notification. app/api/reports/final/[participantId]/route.ts permits owner only after publication and authorized managers for preview. app/(app)/space/page.tsx offers the published download. Diary section exports complete shared entries rather than a computed summary. Published reports are rendered from current data/texts at download time; saving text on an already published report changes its published output immediately. These are product decisions needing explicit clarification, not missing PDF sections.
FC-BOT-007 lib/reminders.ts enqueues separate first/second notification types with separate dedupe keys, meeting link interpolation and configurable zero-to-disable second window. components/facilitator/bot-settings-form.tsx edits the second window, and app/actions/bot-settings.ts persists it. Existing session editing supports the meeting URL. The second window is omitted from the query horizon. The task's 50-minute case says second only, but the implementation and test expect first plus second. Quiet-hour deferral can outlive the meeting.
FC-CBT-001 components/participant/workbook-runner.tsx supports ordered question steps, draft autosave and submission. content/workbook/definitions.ts includes automatic thought and alternative hypothesis fields. content/program/experiment.ts, components/participant/experiment-flow.tsx and app/actions/experiment.ts implement plan/prediction/fear and actual result/insight/limits/next-step. No dedicated, reviewed Socratic question-chain content or acceptance plan was found. FC-CBT-001 says P2, files/tests undecided and everything out of scope until replanned. Existing infrastructure makes it feasible, but it is not a shipped guided CBT feature.

Prioritized gaps

P1: enforce participant lifecycle and baseline authorization at writes

requireConsentedParticipant() in lib/auth/current-user.ts verifies account and legal acceptance only. Both saveDailyMood() and diary create/edit/delete call it and then mutate their tables. They do not check an active membership in an active course or whether baseline submission is complete. The daily mood page visually disables its control through ctx.canWrite, but this is not a server guard; the diary form stays editable. This conflicts with the visible completed/archived read-only promise and bypasses the Point A gate through direct action invocation.

Use the shared participant-content/lifecycle authorization boundary before writes, with a deliberate policy for personal diary changes after course completion. Add behavior tests for blocked/exited membership, archived/completed group and an unfinished baseline. Do not infer authorization from the disabled UI.

saveBaselineValue() likewise uses requireParticipantManager() rather than requireWritableParticipantManager() from lib/auth/access.ts. Decide whether baseline correction after completion is an intended exception; otherwise enforce the documented read-only boundary there as well. Final-report editing after the course may legitimately remain available because the report is a finalization workflow.

P1: correct contradictory first-visit privacy copy

components/participant/welcome.tsx displays i18n/catalogs/v1/ru.json key onboardP.w1Body, which promises records are visible only to the participant. Shared diary entries, workbook answers and weekly check-ins are shown to the facilitator. The diary introduction correctly explains its privacy toggle, but the first-visit promise contradicts that explanation. Align the welcome message with actual visibility and keep a narrow explicit promise for entries marked private-to-self. Check both catalogs and tenant-authored informed-consent copy; editing a catalog does not update an uploaded legal PDF.

P1: fix second-window horizon and define overdue reminder behavior

enqueueDueReminders() selects sessions within max(sessionReminderHours, workbookReminderHours) and excludes sessionReminderSecondHours, although the UI allows a second window up to 168 hours. Setting the second window above both other windows therefore prevents its intended early delivery. Include every enabled session window in the horizon.

dueReminders() emits first, second and workbook reminders for a session 50 minutes away with default settings. In normal uninterrupted operation the first and workbook keys were already deduplicated; after downtime or a newly created late session, all can be first-time sends. The FC-BOT-007 specification explicitly expects only the second session reminder in that scenario, while tests/security/reminders.test.ts expects both. Resolve the contract and add a catch-up scenario rather than claiming the specification and current test agree.

lib/notification-dispatch.ts defers reminders during quiet hours without checking that their meeting/date is still relevant when delivery resumes. A night meeting can already be over when the morning reminder is sent. Likewise a daily mood reminder may remain queued after the participant fills that day. Revalidate the semantic expiry at delivery; preserve quiet-hour retry safety for still relevant messages.

P1: isolate malformed timezone failures

localDayParts() constructs Intl.DateTimeFormat directly. saveDailyMood(), the check-in page and dueCheckinReminders() do not catch an invalid profile timezone. In the enqueue loop, one malformed timezone can abort all daily/session work for the tick. The dispatch quiet-hours helper already falls back to Europe/Moscow, so creation/read paths and delivery disagree. Validate at preference writes and share consistent fallback behavior at reads.

P2: make report publication and summary semantics explicit

The required PDF sections are present and private entries are filtered twice: SQL privateToSelf: false and assembly filtering. The phrase diary summary does not currently mean an aggregate or concise digest: the PDF prints every shared entry's four fields. Confirm that literal export is acceptable to the owner.

Publication sets publishedAt, but it does not freeze the report. Subsequent save updates both text fields while retaining publication status, and subsequent participant activity also changes the next downloaded PDF. Specify whether the published document is a live view or an immutable edition; add revision behavior only if the owner requires it. There is no evidence here of a requirement for AI-generated summaries.

P2: avoid silently losing historical diary visibility

app/(app)/diary/page.tsx loads at most 200 entries with no pagination or indication of truncation. A ten-week participant making several entries per day can exceed that count. The facilitator and PDF readers load all shared entries, so the author may be unable to edit older entries still exposed there. Provide pagination or a clear older-entries affordance.

P2: finish CBT content as a separately planned task

Do not present general workbook questions as a complete Socratic chain. Obtain owner-approved question sequences, completion rules and examples; represent them through existing versioned workbook content. Reuse the experiment workflow for micro-experiments. Only add a new step type if the approved content needs one.

Verification and limits

  • Earlier disposable local UI runs exercised participant diary create/edit/delete, daily mood persistence and checkout keyboard behavior successfully.
  • The corrected extra browser run on the stable local build passed 8/8 checks at 390 and 1280 pixels: all ten template selections, notification time/toggle persistence, settled facilitator layout, mobile More focus/escape behavior, participant-card navigation and valid PDF preview (HTTP 200, 37,521 bytes).
  • The two settled facilitator screenshots showed no gray overlays, card/header collisions or horizontal overflow. These establish representative layout, not clinical/content correctness or every accessibility interaction.
  • tests/security/final-report.test.ts covers private diary exclusion, unauthenticated/other-participant denial, unpublished-owner denial and authorized manager preview. Tests establish basic PDF identity, not visual correctness of every long-document page or link.
  • tests/security/diary.test.ts covers validation and scope/filter construction; it does not execute server actions against another participant's data.
  • tests/security/daily-mood.test.ts covers local dates and due/opt-out/already-filled rules. It does not cover malformed IANA timezone or queued-reminder expiry.
  • This audit used source inspection plus the previously completed local browser evidence. It performed no production mutation or external notification delivery.