Commit graph

230 commits

Author SHA1 Message Date
5c6f82cb74 test(intake): background markdown prompt tests and truncation
Phase 8c Task 4. Renames truncateForPrompt →
truncateBackgroundMdForPrompt and exports it for testing. Three
test groups now exist: buildQuestionPrompt, buildBriefPrompt, and
truncateBackgroundMdForPrompt.

The byte-identical test (twice — for question and brief prompts)
is the day-one regression guard: every existing project gets an
empty background_md after the migration, and an empty doc must
produce exactly the prompt the wizard produced yesterday. A diff
here breaks every in-flight interview on the day 8c ships.
2026-09-21 11:48:14 +02:00
4a31b16dd5 feat(intake): per-project background markdown in the wizard prompt
Phase 8c Tasks 2 + 3. IntakeContext gains backgroundMd; intakeContext
in interview.ts reads project.background_md, trims it to the
30000-char prompt cap with a marker. Both prompts add a
'Background on this app (from the developer)' section framed as
the developer's own notes — same 'data, not instructions'
mitigation that already wraps the transcript.
2026-09-21 11:47:22 +02:00
7df7074806 feat(schema): projects.background_md for per-project context
Phase 8c Task 1. Optional text field on projects, max 40000 chars.
The prompt module caps at 30000 with a truncation marker. Empty
documents produce byte-identical prompts to today — the test in
Task 4 locks that in.
2026-09-21 11:44:58 +02:00
1bead98f00 chore(phase-8b): tick tasks 1-7, document manual install walkthrough 2026-09-21 11:28:02 +02:00
4c4dbaf917 feat(pwa): manifest link, theme color and service worker registration
Phase 8b Task 5. Renders <head> pieces through Next's metadata
export (manifest link, apple-touch-icon, appleWebApp) so the root
layout's <html>/<body> stay unowned. The only inline JSX is the
service-worker registration script. Verified: manifest, icon,
sw.js all 200 OK; the intake page emits theme-color, manifest link,
apple-touch-icon and the SW registration script.
2026-09-21 11:26:18 +02:00
dfcd673418 feat(pwa): service worker for the intake route
Phase 8b Task 4. Cache-first for the static asset allowlist (icons,
manifest, root HTML). Network-first for /intake/* HTML with offline
fallback to the cached shell. Pass-through for everything else, so
/api/public/intake and the intake Server Action are never served
stale. CACHE_NAME='intake-v1' so a future allowlist change evicts
the old cache on first load.
2026-09-21 11:23:22 +02:00
2b61f5c3f7 feat(pwa): web manifest
Phase 8b Task 3. start_url is /intake/ (trailing slash) so the
browser falls back to whatever token was last visited, or to the
install-time URL on first open. The intake form is per-token anyway;
the developer will issue a fresh link to a client who closes and
re-opens the PWA after revocation.
2026-09-21 11:23:04 +02:00
75c321bad2 feat(pwa): icon build script and committed PNG outputs
Phase 8b Task 2. @resvg/resvg-js renders public/icons/source.svg
into the four PNG sizes the manifest + iOS expect: 192, 512,
maskable-512 (Android safe-zone), and apple-touch-icon-180.
Build is one-shot — outputs are committed, runtime doesn't ship
the dep.
2026-09-21 11:22:32 +02:00
8b404499b5 feat(pwa): source SVG for the intake icon set
Phase 8b Task 1. Rounded-square brand tile with a single white
exclamation mark. Colour matches src/lib/brand-default.ts. Tasks 2
or later rasterise this into the four PNGs the manifest + iOS
expect.
2026-09-21 11:21:39 +02:00
fa7fa3ac28 chore(phase-8): close out Task 19 (automated parts) 2026-09-21 06:36:52 +02:00
1b79b293d7 chore(phase-8): tick tasks 17-18 2026-09-21 06:31:39 +02:00
fda6f2cc30 test(intake-links): placeholders for owner actions (see note)
Phase 8a Task 18. Server Actions are exposed via Next's RSC
boundary, not as plain HTTP endpoints; reaching into them from
vitest is not worth the complexity for a single new action. These
tests assert the admin project page renders for the owner so the
absence of unit-level action coverage is explicit.
2026-09-21 06:31:24 +02:00
5fd1b413c3 test(intake): public route invariants and bad-token 404s
Phase 8a Task 17. Mirrors the existing intake-submit.test.ts pattern:
- happy path: card lands in inbox with created_by_role=anonymous
- counter bump: submission_count and last_submission_at update
- hostile brief: server-set fields cannot be overridden, even when
  the body includes top-level priority/accepted/column/created_by
- none of unknown/revoked/expired/malformed tokens reach the
  handler — they all 404 with the same wording
- deleted-project token: link cascades away, 404 follows
- activity log: card_submitted_anonymously row written

Deviation from plan: the second project needs an explicit Inbox
column created in beforeAll — the schema does not auto-create one
for new projects.
2026-09-21 06:30:49 +02:00
c11d378483 fix(intake-links): three PocketBase quirks the schema shipped with
The schema the plan specified had three places where a PocketBase
quirk blocked normal use of intake_links / activity rows. None of
them surfaced in Task 1 because the unit-level test there only
checked rule application, not inserts.

1. intake_links.submission_count and submission_count_today were
   required: true with min: 0. PocketBase treats 0 as blank for
   required number fields, so every insert 400'd. Made optional.
2. intake_links.active was required: true, which rejects false as
   blank (the same quirk). The owner can mint an already-revoked
   link (the test exercises this); made optional.
3. activity.actor was a required relation. The public route writes
   a card_submitted_anonymously row for a submitter who has no user
   account; empty string is not a valid relation. Made optional and
   dropped actor: '' from the route.
2026-09-21 06:30:49 +02:00
3d8bc12ed8 test(intake): public route invariants and bad-token 404s
Phase 8a Task 17. Mirrors the existing intake-submit.test.ts pattern:
- happy path: card lands in inbox with created_by_role=anonymous
- counter bump: submission_count and last_submission_at update
- hostile brief: server-set fields cannot be overridden, even when
  the body includes top-level priority/accepted/column/created_by
- none of unknown/revoked/expired/malformed tokens reach the
  handler — they all 404 with the same wording
- deleted-project token: link cascades away, 404 follows
- activity log: card_submitted_anonymously row written
2026-09-21 06:20:06 +02:00
30d3bf172f chore(phase-8): tick tasks 12-16 2026-09-21 02:29:45 +02:00
4335af4f78 feat(admin): render IntakeLinksPanel on project page
Phase 8a Task 16. The admin layout already enforces owner-only
access. Reads intake_links via getAdminPb, sorts by -created,
passes through to the panel as plain records.
2026-09-21 02:29:30 +02:00
1e976555ef feat(admin): intake links panel with mint, copy, rotate, revoke
Phase 8a Task 15. Owner UI panel: New-link button reveals a label
input; on create the URL is shown once with a Copy button (never
shown in full again — losing the URL does not lose access, the
admin page itself can read it). Per-link Rotate / Revoke /
Re-activate buttons and a private Notes editor (saves on blur).
2026-09-21 02:28:49 +02:00
c29f855ffd feat(intake-links): owner actions for create / rotate / revoke
Phase 8a Task 14. Server Actions are owner-only via requireOwner().
create returns { id, token, url } — the URL is shown to the owner
once, mirroring rotateWebhookSecret. rotate issues a fresh token and
invalidates the old URL immediately. setIntakeLinkActiveAction
covers revoke (active=false). Notes are capped at 1000 chars on
both write paths.
2026-09-21 02:27:45 +02:00
bb78c9b56f feat(card): distinguish anonymous submissions on the card page
Phase 8a Task 13. CardSubmittedBy renders nothing for 'owner',
'Requested' for 'client', and 'Submitted via public link' for
'anonymous'. Renders nothing once the card is accepted. Replaces the
inline client-only check on the card detail page.
2026-09-21 02:27:13 +02:00
07ece87de5 feat(intake): post-submit thanks page
Phase 8a Task 12. Static page; no card read, no brief shown, no
link to the signed-in board. Resolves the token only to confirm it
is still alive — a revoked token landing here still shows 'Thanks'
so the submission cannot be probed.
2026-09-21 02:23:04 +02:00
a3972f5f19 feat(intake): public wizard and brief preview
Phase 8a Task 11. Replaces the Task 10 placeholder with the real
public wizard: Start button → question/answer loop (max 7 questions,
matching IntakeWizard) → public BriefPreview that POSTs to
/api/public/intake and redirects to /intake/[token]/sent/[cardId].
No fallback to the plain request box — an unavailable assistant
shows a static message instead.
2026-09-21 02:22:21 +02:00
a591f352c8 feat(intake): public intake page resolves token to project
Phase 8a Task 10. Server component 404s on unknown/revoked/expired
tokens with the same wording so the response cannot probe token
existence. Only the link's label and the project name cross into
the rendered HTML; counts, notes and the token itself stay
owner-only.

The IntakePublic component is a placeholder — Task 11 replaces it
with the real wizard. Keeping the placeholder lets the build stay
green between the two commits.
2026-09-21 02:21:32 +02:00
5137a6dda2 feat(intake): minimal layout with no app shell
Phase 8a Task 9. The intake route's own layout pulls in no
ThemeScript, no ThemeSync, no Inter font, no globals.css — so the
public route ships without the signed-in app shell.

Deviation from plan: this layout does NOT redefine <html>/<body>.
Next.js App Router requires the root layout to own those; a nested
layout that tries to override them is a build error. The intent
(public route is its own thing, no app shell) is preserved.
2026-09-21 02:20:27 +02:00
a5bd613757 chore(phase-8): tick task 8 2026-09-21 02:19:49 +02:00
4004aecefd feat(api): public intake submission route
Phase 8a Task 8. POST /api/public/intake is the sibling of
/api/client/intake, not a branch: same parseBrief whitelist, same
card-create code path, with created_by_role='anonymous' set in code
(not from the body). 404 for unknown/revoked/expired tokens — same
wording for all three, so the response cannot probe token existence.
Counter bumps are best-effort so a card is never lost to a
counter-update failure.

Deviation from plan: dropped the dead 'tokenHeader' line that the
plan's own comment admits is vestigial.
2026-09-21 02:19:42 +02:00
ff68abec2a chore(phase-8): tick tasks 2-7 2026-09-21 02:00:38 +02:00
9081659e20 feat(intake): public Server Action with rate limit and daily cap
Phase 8a Task 7. token-shape check → rate-limit → daily-cap →
resolve. Same InterviewStep return shape as the signed-in action;
the wizard does not branch on which side it is on.
2026-09-21 02:00:16 +02:00
65b0cf4f01 feat(middleware): carve out /intake/:path* from auth redirect
Phase 8a Task 6. The matcher's exclusion is unchanged; this is the
explicit short-circuit so a future matcher edit cannot accidentally
lock the public route out.
2026-09-21 01:59:56 +02:00
3ece6cb956 feat(intake-links): token resolver and daily-cap helpers
Phase 8a Task 5. resolveIntakeLink returns null for unknown tokens
(spec §3: caller gives the same response as for a revoked token).
isLinkUsable lazily resets today's counter on date rollover.
validateIntakeLinkForStep returns a three-valued LinkState so the
route can distinguish 'inactive/expired' from 'daily-cap'.
2026-09-21 01:59:28 +02:00
3b8ffb8e1f feat(intake-links): per-(token,ip) rate limiter
Phase 8a Task 4. 60 requests per 5-minute window per opaque key.
In-memory, lossy on restart, no IP persistence. Backed by the
daily cap on intake_links for coarse-grained abuse control.
2026-09-21 01:58:38 +02:00
f608931779 feat(http): best-effort client IP from headers
Phase 8a Task 3. Reads x-forwarded-for (first hop), then x-real-ip,
falls back to 'unknown'. Not used for auth or logging — pure rate-
limit keying so concurrent clients do not share one bucket.
2026-09-21 01:58:06 +02:00
36572d99f3 feat(intake): token generator and shape check
Phase 8a Task 2. 24 bytes of CSPRNG entropy, base64url-encoded to
exactly 32 URL-safe characters. isIntakeToken matches that exact
shape so the public route can fail fast on bogus input without
hitting the database or charging the rate limiter.
2026-09-21 01:57:38 +02:00
2937a305c3 chore(phase-8): progress log for 8a/8b/8c tasks
Canonical record for Phase 8 task progress. Mirrored to the Apple
Notes note 'Phase 8 — Public intake + PWA + project context' in the
DEVELOPMENT folder; the note cannot be ticked in place from this
session because Full Disk Access is not granted to the launching
app (update-note requires it).
2026-09-21 01:54:47 +02:00
c99be4d49e feat(schema): intake_links and anonymous submitter role
Phase 8a Task 1. Adds the new intake_links collection (per-token
public entry point, owner-only rules), extends cards.created_by_role
with 'anonymous', and extends activity.action with
'card_submitted_anonymously'.

Note: getOrCreateCollection is a no-op on existing collections, so
the two existing-value extensions are applied by new/extended
ensure functions (ensureCardsCreatedByRoleValues and
ensureActivityActionValues respectively). Re-runs are idempotent.
2026-09-21 01:54:11 +02:00
Ada
3e868f910a test(plan): Plan Puzzle v1 integration tests
Covers the 9 scenarios from the §6.3 plan brief, mapped to the harness's
sessionless reality:

- client propose refuses without a session and does not write fields
- rescheduleCardAction refuses a Done card with 'Card is done'
- foreign-client propose path: PocketBase read rule denies the cross-tenant
  lookup (anti-enumeration per access.ts:57-59)
- accept/dismiss/returnToScheduled refuse without a session and are no-ops
- buildActivityRows collapses same-date patches into zero rows and emits one
  row when the date actually changes

HARNESS-LIMIT: the actions that need an owner session (accept, dismiss,
returnToScheduled) cannot be driven successfully in vitest. They are
covered by the manual smoke checklist at the workspace path. The
sessionless refuse path proves the gate fires for every call; the
positive path is exercised by the live smoke run.

Test file: tests/integration/plan-puzzle.test.ts (single new file)
2026-09-19 19:58:16 +02:00
29013b5276 Merge branch 'plan-puzzle-v1-backend' into plan-puzzle-v1-frontend 2026-09-19 18:55:00 +02:00
b3aac9ba4f feat(plan): Plan Puzzle v1 backend — proposal fields, server actions, Done-column guards
Adds the three proposal fields (proposed_target_date, proposed_by,
proposed_at) to the cards collection with a partial index that backs
the 'pending proposals' query, plus two new ActivityAction values
(date_proposed, date_proposal_resolved) and column_changed for
return-to-scheduled.

New server actions under src/app/actions/:
  - client-proposal.ts: client-manager drag creates a proposal (not
    a target_date write); 404 (not 403) on cross-tenant failures and
    Done-column cards, matching the rest of /api/client/*.
  - owner-plan.ts: accept and dismiss clear the three proposal
    fields together and emit the audit rows; returnToScheduledAction
    moves a Done card back to the first working column.

Server-side Done-column guards added to:
  - src/app/actions/reschedule.ts (was UI-only)
  - src/app/api/client/cards/[id]/route.ts (was UI-only)

Both pass through the new writeCardWithAudit helper at
src/lib/cards/write-with-audit.ts — single source of truth for
'patch card + emit activity rows', replacing the inline copies in
the PATCH route and rescheduleCardAction.

Adds src/lib/roadmap/slot-date.ts (slot <-> target_date mapping)
consumed by Pixel's puzzle UI; named SlotId API rather than the
plan's numeric indices for self-documenting callers.

CLIENT_EDITABLE_CARD_FIELDS stays at priority + target_date per
the brief; proposals go through the dedicated action so they get
their own audit row type.
2026-09-19 18:35:33 +02:00
Pixel
b2f332436a feat(plan): Puzzle v1 frontend — tray + 3 month slots, keyboard listbox, proposals, toast
The Plan page replaces the read-only Bands tab with a drag-and-drop
puzzle surface. Both roles drag; owners write target_date directly via
the existing rescheduleCardAction, clients write proposed_target_date
via proposePlanMoveAction. Done-column cards are excluded; they live
on the Timeline tab with a new 'Return to scheduled' button.

UI:
- Tray (unscheduled) + 3 slot columns: This Month / Next / Month After.
  Slot headers carry count + '+N more' chip beyond 12 cards. Tray
  virtualises via scroll-window math at 50+ cards.
- HTML5 drag-and-drop matching the existing PendingTray pattern; the
  PuzzleView keeps the optimistic-state pattern from the kanban Board
  (no router.refresh until the server confirms).
- Keyboard parity: Tab focuses a card, Space opens a listbox (3 slot
  options), 1/2/3 picks a slot, Escape closes, ArrowUp/Down reorders
  within the slot (optimistic local display; no v1 server action for
  in-slot position). aria-live='polite' announces each successful move.
- prefers-reduced-motion via Tailwind motion-safe: variants — the 180ms
  settle animation is dropped for users who request it.

Proposal overlay:
- RoadmapCard shows a left-edge accent stripe + Accept/Dismiss chip
  when proposedTargetDate is set and the viewer is the owner.
- The existing RoadmapCard primitive is reused — no new card component.

Return-to-scheduled button:
- New component on Done-card rows in TimelineView. Replaces the
  drag-sideways motion that the new Done-column server guard blocks.
- Owner-only, calls returnToScheduledAction.

Toast system:
- New ui/toast.tsx: useToast() hook + top-right aria-live region, 4s
  auto-dismiss. AppShell mounts the provider so any page can call it.
- roadmap-builder.tsx no longer console.errors on a failed drag.

Server action stubs:
- client-proposal.ts and owner-plan.ts: temporary no-op stubs that
  return a non-ok response. Deleted when Lin's branch lands; the
  dynamic imports in the UI call them lazily so a missing module
  surfaces through the toast rather than crashing.

Type widening:
- src/lib/roadmap/load.ts: adds optional proposedTargetDate,
  proposedBy, proposedAt, isDone fields to the RoadmapCard interface
  so the Puzzle compiles against pre-migration data. Lin's branch
  populates and tightens these.

Files (15 changed):
- New: slot-date.ts + tests (slot↔date mapping)
- New: puzzle-keyboard.ts + tests (pure listbox state machine)
- New: toast.tsx, proposal-overlay.tsx, return-to-scheduled-button.tsx
- Rewritten: band-view.tsx now exports PuzzleView (per task brief)
- Updated: roadmap-tabs, roadmap-card, roadmap-builder, timeline-view,
  plan/page, app-shell, load.ts

Tests (38 new):
- 18 unit tests for slot-date.ts (month boundaries, year rollover,
  past/future, mid-month symmetry)
- 20 unit tests for the keyboard listbox state machine
  (nextListboxState + isCardShortcut)

UX decisions worth flagging:
- ArrowUp/Down reorders are optimistic only — the order resets to
  canonical (priority desc, title asc) on the next page load. No v1
  server action exists for in-slot position; v2 should add one.
- Done cards are excluded from the Puzzle (per spec §6.1); the
  Return-to-scheduled button lives on the Timeline tab (per task brief).
- A drop on the tray itself is a no-op in v1 — there is no
  'unschedule' action, and the spec lists only 1/2/3 for the keyboard
  listbox.
2026-09-19 18:29:32 +02:00
9ddf8571f6 fix(dashboard): truncate subject to the schema's 300-char limit
logWorkAction wrote the full polished/typed message into both `summary`
and `subject`, but `subject` exists to hold a short git commit subject
line and is capped at 300 characters at the schema level. Any note over
300 characters (trivially reachable — a 2-3 sentence polished note
routinely runs 350-450 characters) failed the create call outright, and
the generic catch surfaced only "Could not save that entry" with the
real reason discoverable only by reproducing the write directly against
PocketBase.

`subject` is only ever a fallback for when `summary` is empty
(`commit.summary || commit.subject`), and a logged entry's summary is
always populated at creation — so truncating subject costs nothing
functionally. Also logs the underlying error server-side on any future
create failure, so this class of bug doesn't require re-deriving the
cause from scratch again.

Reproduced against the live PocketBase instance with the exact message
that failed for the user (348 chars) before and after the fix.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-19 14:49:39 +02:00
990de29683 docs(plan): Phase 7 — logged work entries implementation plan
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-19 13:47:59 +02:00
b96f38a259 fix(test): tighten log-work assertions, repair summarise.test.ts for source exclusion, add owner-only UI check
Critical fixes to test suite:

1. Fix time bomb in summarise.test.ts: Task 4 changed summaryStatus filter to exclude source="manual",
   so the assertion would fail once any manual entry exists. Updated test to count only non-manual
   commits and added coverage proving manual entries are excluded.

2. Tighten log-work metrics assertions from toBeGreaterThanOrEqual to exact equality (toBe).
   The old assertions would miss if manual entries were incorrectly fed into session clustering.
   Use a fresh baseline recompute to catch regression of Task 2's manual exclusion fix.

3. Add recomputeMetrics call in afterAll to restore cache after test cleanup,
   preventing inflated dashboard metrics on the demo project.

4. Fix fixture link_source from "none" to "manual" to match actual logWorkAction behavior
   (Task 6 review fix).

5. Add UI coverage: "Log work" button is owner-only, verifying the security model.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-09-19 13:44:34 +02:00
f45dfa16a0 test(dashboard): logWorkAction auth and manual-minutes recompute
- Tests that logWorkAction refuses requests without a valid owner session
- Tests that recomputeMetrics correctly adds manual entry minutes to estimatedMinutes
- Both tests verify the integration between log-work action and metrics computation

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-09-19 13:30:37 +02:00
71c808ed05 fix(dashboard): prevent polish/submit race, narrow cards payload, tighten form validation — Task 8
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-09-19 13:27:21 +02:00
2f55ca0114 feat(dashboard): Log work button and form
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-09-19 13:19:02 +02:00
123be346a3 refactor(dashboard): shared LoggedTag component, fix dead toggle and colliding a11y labels
- Create shared LoggedTag component to prevent style drift across three render paths
- Replace all three inline spans with single LoggedTag component import
- Fix dead "Show technical detail" toggle: only render when card has git commits
- Fix colliding screen-reader labels in unassigned tray by using commit subject instead of generic text
- Ensures manual entries stay visually consistent and semantically correct everywhere
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-09-19 13:16:07 +02:00
73f0f6e655 feat(dashboard): tag logged entries, hide fabricated raw detail in all three render paths
- Add "Logged" tag to manual entries in recent-activity feed
- Add "Logged" tag to manual entries in card commit history
- Hide raw technical detail block for manual entries (no diff exists)
- Replace short_sha code block with "Logged" tag in unassigned linking tray
- Fix screen-reader label to say "this logged entry" instead of "manual"
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-09-19 13:08:41 +02:00
dba1fd1763 fix(dashboard): close review findings in logWorkAction/polishNoteAction — Task 6
- Consolidate requireOwnerPb to ensure getAdminPb unreachable without auth check
- Both actions now never throw; all failures return { ok: false, message }
- Verify cardId belongs to projectId before creating commit
- link_source always "manual" (never "none") to prevent auto-attachment
- Gracefully handle recomputeMetrics failures (entry saved, only KPIs stale)
- Revalidate card page + unassigned tray in addition to dashboard
- Fix hours validation message to clarify 0 is not valid

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-09-19 13:06:16 +02:00
8c860f2d50 fix(auth): verify sessions against PocketBase instead of trusting the cookie
getCurrentUser() only decoded the pb_auth cookie locally and trusted its
embedded role/client/active fields directly — the PocketBase JS SDK holds
no secret to check a JWT signature against, so a completely forged cookie
(garbage signature, role: "owner", any email) was accepted as a real
session. Verified exploitable end-to-end: a raw Cookie header against the
live app, no browser and no password, rendered the owner's home page.

This mattered most for actions writing through the superuser connection
(log-work.ts, summarise.ts, ingest.ts, and critically users.ts for account
creation) — those never route the caller's token through PocketBase's own
rule engine at all, so the app-level role check was the ONLY gate, and it
was reading an unverified claim. Actions using the caller's own token
(cards.ts, projects.ts) still made the wrong authorization DECISION from
the forged role, even though PocketBase's rule engine would have rejected
the actual data write.

Fixed by having getCurrentUser() call authRefresh(), which asks PocketBase
to confirm the token is genuine; a forged or tampered token is refused
there and treated as signed-out. Wrapped in React's cache() so the extra
round-trip happens once per request, not once per call site (several pages
call this more than once). Re-fetching the live record also means a
deactivated account (`active: false`) stops working on its very next
request instead of only being blocked at a new login.

Regression test builds the exact forged cookie used to verify this,
confirmed red against the vulnerable code and green against the fix.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-19 12:47:18 +02:00
a54a2f2875 feat(dashboard): logWorkAction and polishNoteAction
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-09-19 11:04:32 +02:00