Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Commit History
-
feat(corpus): offer the full CAMEL corpus from R2, raise the row ceiling
Follows spec 0010, which shipped only a 999-text sample because the full corpus could not be ingested. CCR_MAX_ROWS goes to 100,000, which was the code default all along; the three docs that variously claimed 20,000 and 50,000 are corrected to agree with it and with each other. That removes the ceiling that made the 57,174-row corpus un-ingestible. The full corpus is served from R2 under examples/, not the repo: 38 MB would ride in the Docker image and the Space repo on every deploy. It is deliberately NOT fetched from Hugging Face at runtime - that dataset returns 401, so fetching it would mean shipping lab credentials in a public app. scripts/upload_example_corpus.py puts it there and prints the row count the catalogue entry has to declare. Selection downloads the master once to parse, then makes the user's copy with a server-side copy_object, so 38 MB does not travel back out through the application for every visitor. Verified against the live bucket: 7.0s fetch, 0.7s parse of 57…88b1ea9 -
feat(corpus): CAMEL as a built-in example corpus [spec 0010]
PI request from 2026-08-19: make the lab's CAMEL corpus the example data on the site so visitors can try CCR without uploading anything. Corpus details from Aliah 2026-09-06. Step 1 now offers an example corpus above the upload control. One click loads it, selects the declared text column, and the run proceeds through the normal ingest path, so nothing downstream changes. The citation and a link to the full dataset sit on the card, and a run on an example writes a corpus_source block into its metadata carrying the citation, source URL and preprocessing note: results produced on someone else's corpus have to stay attributable in the same file as the scores. Ships a 999-text SAMPLE rather than the full corpus, because the full one cannot be the bundled default: 57,174 rows exceeds CCR_MAX_ROWS (50,000 on both deployments) so ingest would refuse it outright, 38 MB against a 156 KB sample_data would ride in the Docker image and the Space repo, and a demo has to finish in seconds on 2 vCP…3a1d713
-
merge: unify lab-org repo history with the deploy repo
The lab repo (Culture-and-Morality-Lab/ccr-platform) and this deploy repo evolved as parallel histories of the same project. This merge makes them one: current code wins every conflicting path; the lab repo's unique content is adopted - design doc, specs 0001-0005, DECISIONS.md, CLAUDE.md, AGENTS.md, evals, and .claude agent tooling (files our code comments have been referencing all along). Stale built assets from the old tree dropped. From here the lab org repo is the canonical remote; identical history is kept on all remotes.5619d79
-
feat: LLM-generated construct items (design note ITEM_GENERATION.md)
Draft questionnaire items for a construct from its name + explanation, for use as CCR item sets when no validated scale exists (PI idea 2026-07-31; decisions 2026-08-05: positively-keyed only, signed-in only, PI-approved prompt v1 and cautionary wording). - POST /api/constructs/generate-items: preview-only into the existing review-and-save flow; 20/day per-user cap (generation_events table) - Providers: Groq free tier (llama-3.3-70b, interim) / Anthropic Haiku (target once billing lands); auto-selected from which key is set - Provenance: Construct.generation_json -> ai_generated in the API, source_type llm_generated + cautionary note in run-metadata snapshots - UI: draft-with-AI section in the custom-construct form (library name-match warning), AI-generated badges in picker/selection/results - Live smoke test: scripts/smoke_test_generation.py (Groq verified)1a28176
-
chore: script to fix PsyEmbedding HF repos' missing 1_Pooling config
Uploads the 1_Pooling/config.json that modules.json references but the four Culture-and-Morality-Lab/psyembedding-* repos never shipped (the reason for the pooling_fallback workaround). Dry-run by default; --write needs lab HF credentials; --verify asserts auto-load == fallback assembly.21ee87e
-
Upload limits: make the byte ceiling configurable and stream-checked
The 25 MB cap was hardcoded, unlike every other limit, and was the wrong axis: embedding cost scales with rows and tokens, not file bytes. On the deployed Space (CCR_MAX_ROWS=20000) it only bound for rows averaging over ~1.3 KB, i.e. long-document corpora - the exact shape the planned chunking feature makes more common. - MAX_UPLOAD_BYTES -> max_upload_bytes(), env-configurable via CCR_MAX_UPLOAD_BYTES, default 50 MB. It is now an OOM/abuse backstop; CCR_MAX_ROWS remains the limit that bounds job cost. - Stream uploads in 1 MB chunks and reject mid-transfer. Previously the whole payload was read into memory *before* the size check, so an oversized upload was fully resident before being refused. Partial temp files are cleaned up on any failure, including client disconnect. - Anonymous byte cap 2 MB -> 5 MB: 200 rows of long documents (200 x 8 KB transcripts ~ 1.6 MB) sat uncomfortably close to the old ceiling. The 200-row cap is unchanged and remains what actually binds f…776393c
-
Sync platform from lab mainline: dev instance ready to deploy
Full feature set: accounts (email/password + feature-flagged Google via Supabase PKCE), anonymous tiers (3 runs/day, delete-after-analysis, 24h purge), saved-run cap, construct upload from CSV/XLSX, structured warnings + language detection, model registry (MiniLM/E5), per-run reproduction scripts, corpus-embedding cache, storage interface (local/ R2), sample-data test kit, MANUAL_TESTING.md. Rights guard: only the 5 original seed constructs ship in this public repo; the imported lab collection stays out pending the redistribution decision. HF remote URL detokenized. 64 tests passing.4b09d2d
-
feat: upload tiers with placeholder sign-in, project archive/delete, no-em-dash rule
- Anonymous caps (2 MB / 500 rows, env-tunable) with sign-in hints; demo name-only session (HMAC cookie) lifts caps; get_current_user() is the Phase 2 swap point for managed auth - Archive/unarchive projects (reversible, Archived sidebar group) - Permanent delete with typed-name confirmation; cascades datasets, runs, uploaded + result files; logged without retaining text (design par. 9) - Fix: job executor recreates after lifespan shutdown (dev reload broke jobs) - Style: em dashes removed across 50 files; rule in CLAUDE.md + edit hook - Tests: 39 total (tiers, tampered cookie, archive toggle, delete cascades)e7712a6 -
Initialize CCR Platform mainline (Culture and Morality Lab)
Seeded from the public demo (Deva-1903/ccr-platform), which stays deployed. Adds the control system around it: - CLAUDE.md + path-scoped rules (.claude/rules/) encoding design-doc §15 architecture rules - 3 review agents (research-validity, test-parity, docs-sync) - 4 commands (/implement-spec, /review-scoring-contract, /run-checks, /log-decision) - Hooks: golden-output protection (PreToolUse block), Python syntax check (PostToolUse) - packages/model_registry: models.yaml (MiniLM default, e5-large-v2, multilingual-E5 with prefix usage_config) + language sets + working validator - packages/construct_library: 5 versioned construct YAMLs + item-hash validator - docs/specs 0001-0005 (Phase 0/1 work), design doc v1.2, DECISIONS/ROADMAP/CHANGELOG - evals/ scaffold with protected expected_outputs Design of record: docs/design/CCR_Platform_Design_Doc_v1.2.docx4d86d33
-
CCR Platform: web platform for Contextualized Construct Representations
Upload a corpus, select or define a validated psychological construct, run CCR analysis with locally-hosted sentence embeddings, inspect per-item loadings and score distributions, export results with a reproducibility record. - FastAPI backend, SQLite, worker-queue jobs with orphan recovery - React dashboard (prebuilt; no Node needed to run) - Tolerant corpus ingestion (encodings, delimiters, caps, warnings) - Seeded construct library with citations; custom constructs - 17 tests via a deterministic embedding backend (no ML deps needed) - Docker deploy for Hugging Face Spaces / Cloud Rund69ace5