Spaces:
Sleeping
Sleeping
Commit History
-
Bump v2.0 effective date 2026-07-07 -> 2026-07-08 (full 30-day notice)
Tengo Gzirishvili +1: Claude Opus 4.8The user notice now goes out 2026-06-08, so move the effective date one day to 2026-07-08 to keep the >=30-day advance-notice commitment exact. Updates the aggregation gate constant in both aggregate.py and outcomes.py (the functional gate), the in-app policy-notice banner, and the dating in code/migration comments. Legal docs, emails, and the landing privacy/terms pages updated in their respective trees. Tests: 315 passing (gate tests track the constant symbolically). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>a0ee590 -
Security hardening: RLS-as-user, rate limiting, headers, PII + endpoint cleanup
Tengo Gzirishvili +1: Claude Opus 4.8Defense-in-depth pass so a single mistake or leak can't expose user data: - RLS enforcement: per-user reads/writes now run AS THE USER (anon apikey + the requester's verified JWT) so Postgres RLS enforces row isolation — a forgotten user_id=eq. filter can no longer leak another user's rows. New _user_pgrst_headers() with graceful fallback to the service key when SUPABASE_ANON_KEY is unset (reversible rollout). Background workers and the genuine cross-user aggregates keep the service key. - user_id chokepoint: reject any JWT whose `sub` isn't a UUID (closes PostgREST filter-injection via a crafted sub at the single entry point). - Rate limiting: in-process per-(client,rule) sliding window on /api/* with 429 + Retry-After; bounded memory, fail-open, env escape hatch. - Security headers: X-Content-Type-Options, Referrer-Policy, Permissions-Policy, HSTS, and CSP frame-ancestors allowlisting turingdna.com (iframe-safe). - PII minimization: store only a /24-anonymized IP + s…702b153
-
feat: unified outcomes framework — tool-agnostic capture + aggregate + calibrate
Tengo Gzirishvili +1: Claude Opus 4.8The platform-wide version of the DE flywheel so the moat isn't DE-only. One tool-tagged layer any tool plugs into via a ToolSpec; privacy/gating identical for all. - dee/core/outcomes.py: generic engine (ToolSpec registry, within-design standardize, k-anonymity, EFFECTIVE_DATE gate, Prior with blend/serialize). DE registered as first consumer, delegating to the proven aggregate.py — verified DE-through-framework == aggregate.py exactly. - migration 0009_outcomes.sql: generic public.outcomes (tool-tagged, owner RLS, TTL) + public.outcome_priors (tool, feature_key; service-role; CHECK n_users>=3). Leaves the live DE tables (de_outcomes/mutation_priors) untouched. - auth.py: save/list_outcomes, list_all_outcomes_grouped(tool), get/replace_outcome_priors(tool). - server.py: POST /api/outcomes, GET /api/outcomes/<tool>/<design_id>, admin GET /api/admin/priors/<tool> + POST /api/admin/rebuild-priors/<tool> (date-gated). 8 new tests (genericity via synthetic spec, k-anon, gate, …674bee6 -
feat: cross-user aggregate prior (the data moat) — built, run gated to 2026-07-07
Tengo Gzirishvili +1: Claude Opus 4.8Pools wet-lab outcomes ACROSS users into a de-identified substitution-effect prior that nudges round-1 designs. Aggregated-only per the v2.0 policy; nothing attributable to a person. - dee/core/aggregate.py: pool by amino-acid substitution TYPE (positions are protein-specific, so only type generalizes); standardize within each library before pooling (no assay scale/raw value survives); k-anonymity floor of >=3 DISTINCT users; execution gated to EFFECTIVE_DATE (2026-07-07). Folds in via apply_global_prior (additive, same as the per-user surrogate). numpy-only. - migration 0008_mutation_priors.sql: server-only table (RLS, no policies), CHECK(n_users>=3) k-anon guard at the DB layer too. (USER must run it.) - auth.py: list_all_de_outcomes_grouped (the only cross-user read; service-role, pulls just mutations+value), get/replace_mutation_priors. - server.py: admin-token-gated GET /api/admin/mutation-priors + POST /api/admin/rebuild-priors (date-gated → 423 before effective da…3317015
-
Learning flywheel v1: Directed-Evolution active-learning loop (DBTL)
Tengo Gzirishvili +1: Claude Opus 4.8The first durable-moat feature: TuringDNA learns from a researcher's wet-lab results to design a smarter next round, on data no competitor has. Scoped to Directed Evolution (the only tool with quantitative per-variant fitness). Surrogate (dee/core/active_learning.py): additive ridge over single-site effects with the ESM-2 ΔLL as the prior — y ≈ b + w_prior·ΣΔLL + Σβ_m. Fit closed-form in numpy (no sklearn/scipy needed) on the user's measured variants; β shrinks unseen mutations to the prior; an exploration bonus rewards under-tested positions. Plugs straight into the existing additive SA: round 2 re-runs evolve() with per-mutation score = w_prior·ΔLL + β + κ·uncertainty. Numpy-tested: measured data overrides a misleading prior (Spearman 0.77), 0 labels → pure prior, <4 → honest fallback. Backend: migration 0007_de_outcomes.sql (USER RUNS IT); auth.py save/list/cleanup_de_outcomes; /api/de/outcomes (POST/GET) + /api/de/round2 (score WT → fit surrogate → evolve adjusted pool → assemble…26914b4
-
Retention 90→45 days + live auto-delete countdown in the saved hub
Tengo Gzirishvili +1: Claude Opus 4.8- TTL: FREE_LIBRARY_TTL_DAYS default 90 → 45 (one constant; applies to all four per-user tables — libraries, crispr_designs, plasmids, primer_analyses — for newly saved items). Updated all "90 day(s)" copy across the engine (auth.js trial modal, docs, members-only modal, saved-hub subtitle) and the 0006 migration comment. - Saved hub: each row now shows a live "44d 23:59:58 left" countdown to auto-deletion, ticking every second while the panel is open (interval cleared on close). <24h flags urgent; null expires_at (future pro plans) shows "kept". All four list endpoints already return expires_at. Mobile: the countdown + download wrap below the label, no overflow. Verified live in preview: countdown decrements, urgent state, "kept" state, timer stops on close, zero console errors. Bump cache-busters to v=20260605-ttl. (Landing privacy page retention 90→45 edited too — manual Hostinger upload.) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>94b29e6 -
Unified "My designs" hub: save every tool, not just CRISPR
Tengo Gzirishvili +1: Claude Opus 4.8"My designs" was CRISPR-only; plasmids lived in a separate list and primer/ evolution results couldn't be saved. Now it's one hub with a section per tool. Backend: - migration 0006_primer_analyses.sql (user runs it) — per-user table mirroring crispr_designs (owner-only RLS, 90-day expires_at). - auth.py: save/list/get/delete_primer_analysis (+ lazy cleanup); list_libraries and library_csv_url (signed, owner-checked) reusing the existing public.libraries + Storage bucket from DE auto-save. - server.py: /api/primers/{save,analyses,analyses/<id> GET+DELETE} and per-user /api/library + /api/library/<id>/download — all sign-in gated + owner-guarded. Frontend: - New #savedModal unified hub (Plasmids · CRISPR · Primer sets · Evolution libraries); each tool registers a reopen fn on window.TDSaved. navMyDesigns, the CRISPR "My designs" button, and the Plasmid "My plasmids" button all open it. - Primer Analysis gains a Save button; evolution libraries list with Download CSV (sign…1ee54b6
-
Plasmid Studio (M1+M2): import/annotate/map + restriction/digest + library
Tengo Gzirishvili +1: Claude Opus 4.8New "Plasmid" tool — a Benchling/SnapGene-style plasmid design studio, built on primitives we already had (Biopython GenBank I/O + 1,088 REBASE enzymes, ORF detection, Supabase per-user save). Sign-in gated like CRISPR / the Primer Picker; per-user library from day one. Core (dee/core/plasmid.py, fully unit-tested): - parse_plasmid: GenBank / FASTA / raw DNA → one normalized model {name, sequence, topology, gc, length, features[]}. - auto_annotate: ORF detection + curated motif library (T7/T3/SP6/M13/lac/His) when a record has no features; GenBank features kept as-is. - build_genbank / build_fasta export. - restriction_analysis: per-enzyme cut sites over the common set (or any), circular-aware, classified single/double/multi/non-cutters. - digest: combined cut positions → fragment sizes (circular wraps the origin). API (server.py, sign-in gated): /api/plasmid/import, /restriction, /digest, /export, plus the library: /save, /library (list), /library/<id> (get/delete). auth.py: s…be23b1b
-
Add M4 Supabase migration (crispr_designs) for the user to run
Tengo Gzirishvili +1: Claude Opus 4.8Not deployed (lives outside dee/, not copied into the image). The save & revisit feature (M4) needs this table + RLS applied first. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>6128fac