track.tuturuuu.com, apps/track) is the private workspace time-tracking
app. Its timer, session history, requests, and management areas share workspace
identity and permissions with the platform.
A reliable tracking workflow
Start the session in the intended workspace, verify the running state, and review the saved session after stopping. History and analytics describe stored records; the live elapsed display is a local presentation of running state. A request or edit can have its own approval/access constraints. An app’s summary is not evidence that a pending mutation or offline edit has synchronized. The native timer has additional device behavior documented under Mobile timer. Web and mobile share domain concepts, but background execution, offline recovery, and shell navigation are platform-specific. Calendar scheduling and Tasks progress remain distinct from recorded actual work time.Access and maintenance
Track resolves the actor through its app session, then checks workspace access and permissions. Time histories, requests, and management pages are noindex. The public Track description is served by Web’s product page.Linked sessions on time requests
A time request may link an existing session (linkedSessionId); approving the
request then updates that session in place instead of creating a new one. The
link is accepted only when the session belongs to the same workspace and to the
user filing the request, and it is checked before the request is written. A
foreign, cross-workspace, or unknown session is rejected with 400 Invalid linked session. The Web and Track request routes share one validator,
isOwnedLinkedSession in the existing request route helpers,
covered by linked-session.test.ts beside each route.
Task and category references on time requests
Like the linked-session rule above, a request’staskId and categoryId are
copied onto the session created when the request is approved, so both must
belong to the request’s workspace: a task through its list and board
(ws_id), a category through its own ws_id. They are checked before the
request is written, in both the Web and Track routes, by
validateRequestReferences in @tuturuuu/utils/time-tracking-reference. A
foreign, unknown, or malformed reference is rejected with 400 Invalid task or
400 Invalid category, and a failed lookup returns 500. The tests are
reference-validation.test.ts beside each route. PATCH and PUT on a request
do not accept these fields.
The database enforces the same boundaries as defense in depth: a category guard
on public.time_tracking_sessions (sessions already guard tasks), and task and
category guards on private.time_tracking_requests. Approving or rejecting a
request only touches a linked session that belongs to the request’s workspace
and user. The guards cover new writes only; existing mismatches are counted, not
modified, by apps/database/scripts/time-tracking-reference-mismatch-count.sql.
Use the Track route reference to locate
handlers, and Data fetching to extend a
shared client contract rather than adding app-local raw browser API calls.
Time-tracking bypass writers, both break-pause overloads and the workspace
aggregate statistics RPC accept only the service role. Product routes retain
actor, workspace and permission checks before invoking these RPCs. The database
packet is apps/database/supabase/tests/time-task-rpc-scoping.sql.
Linked sessions on time requests must belong to the request owner and the
request workspace. Track and the retained Web handlers reject mismatched links
before approval or rejection. Route coverage lives in each app’s
time-tracking/requests/linked-session.test.ts.
Native Start candidate
Track’s retained App Router pages compile through the shared Start bridge RSC adapter. Generate the candidate withnode scripts/start-bridge-codemod/cli.mjs track --apply and rerun the
generator instead of editing marked generated files. bun run --cwd apps/track type-check:cloudflare checks the native entry; build:cloudflare runs the
real Vite+ build on an admitted build host. Production stays on Vercel until an
explicit cutover PR.
The Worker serves Track at track.tuturuuu.com only. The apex /track path
and every unlisted host return 404 before the proxy, pages, APIs or network
access run. A staging Worker admits extra hostnames through the
TUTURUUU_STAGING_HOSTS var (comma-separated *.workers.dev or
*.tuturuuu.com names; anything else is dropped), never from request headers.
Every response carries the Next build’s production headers (X-Robots-Tag
from Track’s SEO policy, frame-ancestors 'none' and X-Frame-Options: DENY
except on the framable WebGL asset path, HSTS). A response’s own CSP is kept,
but frame-ancestors 'none' replaces any ancestor directive in each of its
policies. It also sends nosniff and
Referrer-Policy: strict-origin-when-cross-origin. Every dynamic response is
Cache-Control: private, no-store, max-age=0, replacing any policy a handler
set; only GET/HEAD of hashed assets and public files keep their caching. GET/HEAD /api/build-info is public on both builds: the proxy skips session work and
removes cookies and Authorization before the handler runs. The Worker uses
global_fetch_strictly_public. Covered by
apps/track/src/start-bridge-config.test.ts, apps/track/src/proxy.test.ts,
the emitted Worker gate and the signed-in root browser gate
(apps/track/cloudflare/root-browser.profile.mjs: signed-in / and /vi
land on the personal timer in English and Vietnamese).