Contract summary
PRODUCT-CONTRACT.md at the workspace root fixes every name the seven surfaces must agree on. Names change
there first, then in code. This page condenses it for orientation; the contract wins wherever they differ.
Taxonomy
- Brand: Trovensa only. Descriptor “Agentic intelligence for drug development.” Tagline “From evidence to progress.” Bare product names inside the app and the docs; the marketing prefix belongs to the site and the deck.
- Products, in order and all
designed:evidenceEvidence,plansPlans,reviewReview,progressProgress. Iconssource,modules,review,program. Entry routes/evidence/questions,/plans/plans,/review/findings,/progress/overview. - Pillars: CONTEXT (evidence), CONTINUITY (plans, progress), RECORD (review). Stages:
discovery,preclinical,clinical,manufacturing. - Status vocabulary:
available,preview,designed,planned,roadmap. Mock data carriesillustrative = trueand an “Illustrative” label. Agent output is “agent-generated” or “proposed”.
Tenancy and identity
- Organization -> Program; scope kinds
organdprogram; every scoped record carriesorganization_id,program_id,stage_id. New organisations get programdefault; the seed addstrv-101. - Permission catalog: 72 strings (org 13, program 13, evidence 13, plans 14, review 10, progress 9) pinned in
api/app/auth/permissions.py, mirrored inweb/lib/auth/permissions.tsand the permissions page; compared byweb/scripts/check-permissions-sync.mjs. - Personas: 10 (
org_owner,org_admin,org_member,org_auditor,program_owner,program_lead,scientist,quality_reviewer,manufacturing_specialist,viewer), version 1, seeded by migration0001and re-seeded at API start-up. - Identity: bearer JWT. Production RS256 from the identity provider with pinned issuer and audience; development and tests HS256 with
kid: dev, accepted only whenAPP_ENVisdevortest. Web: MSAL whenNEXT_PUBLIC_AUTH_CLIENT_IDis set, otherwiseNEXT_PUBLIC_DEV_TOKEN; bridge route/auth/bridge.
API
- Prefix
/api/v1; program routes/programs/{program_id}/...; org routes/orgs/current/.... Router order:health,me,permissions,personas,providers,orgs,programs,connections,agent_runs,evidence,plans,review,progress,legacy. - Route count: 117 designed (recounted with
make routes-check;api/scripts/designed-routes.json). Migration0001creates 32 tables. - Errors: RFC 7807 problem+json with
request_id;ERROR_TYPE_BASE = https://console.trovensa.com/errors;403carriespermission. Enums aretextplus a named CHECK;alembic checkstays clean. - Settings fields:
app_env,log_level,database_url,cors_origins,permissions_cache_ttl_seconds,public_api_base_url,auth_issuer,auth_audience,auth_jwks_url,dev_token_secret,secrets_prefix,worker_concurrency,sync_poll_seconds,agent_runtime_url,agent_runtime_arn,agent_model_id,feature_agent_runs.
DTO families
| Family | DTOs |
|---|---|
| Envelope and identity | Page[T], MeOut (ProgramAccessOut), PermissionOut, PersonaOut, UserOut, OrganizationOut, ProgramOut, GroupOut, RoleAssignmentOut, AuditEventOut |
| Connections and runs | ProviderOut, ConnectionOut, SyncRunOut, AgentRunOut, AgentEventOut |
| Evidence | QuestionOut, SourceOut, SourceLinkOut, FindingOut, HypothesisOut, HypothesisDecision, GapOut, EvidenceAgentRunCreate |
| Plans | ResearchPlanOut, ProtocolOut, ExperimentOut, ReportOut, ToolOut, ToolInvocationOut, TransitionRequest, ApproveRequest, PlansAgentRunCreate |
| Review | SopOut, CheckOut, ReviewFindingOut, ReviewDecision, DeviationOut |
| Progress | MilestoneOut, DependencyOut, OpenItemOut, ApprovalOut, ApprovalDecision, ProgressOverviewOut |
Every *Out carries id, created_at, updated_at; each family has the matching *Create and
*Update where the route exists. The as-built deltas add id, timestamps and organization_id to
UserOut and AgentEventOut, and ToolInvocationCreate accepts input only.
Web
Route tree /, /sign-in, /auth/bridge, /api/health, /p/[slug]/home, the four product trees, /p/[slug]/setup/{overview,connections,members,roles,agent-runs,audit} and /org/{settings,programs,users,groups,roles,audit}. Redirects 308: /p/<slug> to /p/<slug>/home, /org to /org/settings. Cookies last_program and shell_panel; theme key theme. Hooks useProgram().can(perm) and useHasOrgPermission(perm); no role checks.
Hosts, ports and ownership
| Role | Host (design target) | Local |
|---|---|---|
| site | trovensa.com | static server on 4300 |
| docs | docs.trovensa.com | static server on 4310 |
| web | console.trovensa.com | http://localhost:3100 |
| api | api.trovensa.com | http://localhost:8100 (database 5434) |
Frozen after phase 0: the contract, forge.config.json, shared/**, api/app/auth/{permissions,personas}.py, web/lib/{content,routes}.ts, web/lib/auth/permissions.ts, web/lib/api/{types,endpoints}.ts, the three token files, site/lib/content.ts, web/scripts/check-permissions-sync.mjs. Writers: api-core, api-products, web-shell, web-products, site, docs (everything in docs/ except app/globals.css), agent, deck, infra. Section 9 records the as-built deltas after each integration step.
Source: PRODUCT-CONTRACT.md, forge.config.json, api/app/auth/permissions.py, api/app/auth/personas.py, api/app/main.py, api/app/config.py, api/scripts/designed-routes.json, web/lib/routes.ts