The Project class manages project-level metadata for survey research
projects. It can initialize from a local or remote DESCRIPTION file (Git),
or create an empty project when no DESCRIPTION is provided. Fields include
client information, survey registry, and storage references (S3, Drive, Git).
Public fields
DESCRIPTIONA loaded DESCRIPTION object, a local file path, or a git path.
projectCharacter. Project ID; if
NULL, taken fromDESCRIPTION$get("Name").titleCharacter. Human-readable project title; taken from
DESCRIPTION$get("Title").created_onDate. Creation date; taken from
DESCRIPTION$get("Date")or defaults toSys.Date().last_modifiedPOSIXct. Timestamp of the last write; set automatically by
dl_project_write().schema_versionInteger. Version of the
Projectstructure this object was built with; set automatically. Used bydl_project_rehydrate()to detect projects that need migrating to the current class.project_typeCharacter. Either "client" or "internal". Default is "client".
clientCharacter. The immediate client, taken from
DESCRIPTION$get("Client")if available.end_clientCharacter. The end client (for projects done on behalf of another agency).
industryCharacter. The project's industry (e.g., "CPG", "Finance", "Tech").
regionCharacter. The region or market scope of the project (e.g., "US", "EU", "Global").
git_pathCharacter. Full git path to the project's source, e.g. "packages/g6tr.projects/vignettes/2025-08-01_fever".
monorepo_pathCharacter. Path to the project's S3 prefix (from
DESCRIPTION$get("cloudfs.s3")).google_drive_idCharacter. Google Drive folder ID (ID only, not a URL).
google_drive_r_idCharacter. Google Drive subfolder ID for R outputs (from
DESCRIPTION$get("cloudfs.drive")).vector_store_idCharacter. OpenAI vector store ID holding the project's Workspace context (Drive documents, SOW, survey, emails, notes, ...).
surveysA tibble with attached surveys and metadata.
documentsA named list registering key project documents (survey, sow, analysis_context, ...). Each entry is a list with
name,url, anddrive_id. Only pointers are stored — the content lives in the vector store. Populate viadl_project_attach_document().linksA list of relevant project links. Reserved keys ("Google Drive", "Google Drive/R", "Crunch", "Crunch Dataset") are regenerated from fields by
sync_links(); other keys are user-attached viadl_project_attach_link().crunchA list of Crunch-related project information (
project,dataset,metadata).modelsA list of models-related project information.
notesCharacter. Free-form project notes.
otherA list containing additional project objects.
Methods
Project$new()
Initialize a Project instance.
The DESCRIPTION argument can be:
A local path to a DESCRIPTION file.
A Git path (e.g.
"packages/genie"), which will be fetched viadownload_desc_from_git().NULL, in which case an empty project is created with default values.
Usage
Project$new(DESCRIPTION = "DESCRIPTION")Project$normalize_drive_ids()
Coerce the Google Drive fields to bare IDs. Accepts either a folder ID or a
full Drive URL for google_drive_id / google_drive_r_id and stores the ID.
Project$sync_links()
Regenerate the reserved auto-links in links from the current field values
(Google Drive folders and Crunch project/dataset URLs). User-attached links
are preserved.
Project$wrap_up()
Prepare the project for writing: normalize Drive IDs, refresh auto-links,
and stamp last_modified. Called by dl_project_write() before serializing.