Add time_reference and timeref_epochset composite types to V_gamma#15
Open
stevevanhooser wants to merge 1 commit into
Open
Add time_reference and timeref_epochset composite types to V_gamma#15stevevanhooser wants to merge 1 commit into
stevevanhooser wants to merge 1 commit into
Conversation
Two new V_gamma named composite types let any field carry a time value expressed relative to a chosen origin: - timeref_epochset bundles the four-tuple that names an acquisition-clock origin (epochsetname, classname, epoch, clocktype). - time_reference uses a referent_kind discriminator to express the origin as a depended-on document (with anchor_point start or end), an acquisition-clock epoch (nesting timeref_epochset), a UTC wall-clock timestamp (no offset applies), an ontology-anchored developmental stage (nesting ontology_term), or unknown. Document references are routed through the containing schema's _depends_on array, so cascading delete is inherited rather than re-invented. valid_interval is rewritten to two time_reference fields plus matching optional depends_on entries; class_version 1.0.0 -> 2.0.0. treatment and virus_injection gain optional administered_at / injected_at fields plus matching depends_on entries (MINOR bumps). New tag-style companion docs session_occurrence and subject_birth_event let session and subject stay identifier-only while time information lives separately. CURIE registry gains mmusdv and hsapdv prefixes for stage-anchored references. https://claude.ai/code/session_017KhpqmYndDHqzA9UZcUk1Q
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds two new V_gamma named composite types so any field can carry a time value expressed relative to a chosen origin — the existing schemas only supported per-epoch acquisition-clock offsets via the ad-hoc
timeref_struct*shape onvalid_interval.timeref_epochset— the four-tuple that names an acquisition-clock origin (epochsetname,classname,epoch,clocktype).time_reference— a(origin, offset_seconds)pair whereoriginis selected byreferent_kind:document— anchors on a depended-on document withanchor_point(startorend); the actual did_uid lives in the containing schema's_depends_onarray, so cascading delete is inherited rather than re-implemented.acquisition_clock— nests atimeref_epochset.utc— carries an ISO 8601utc_timestamp; no offset applies.ontology_stage— nests anontology_term(e.g.mmusdv:0000037); optionaloffset_secondswithin the stage.unknown— explicit placeholder for wild-caught DOB, unrecorded treatment times, etc.This is also the first V_gamma composite that nests other composites (
epochset→timeref_epochset;stage→ontology_term); the validator looks up nested shapes from the spec by type name.Schema changes
_class_versionschemas/V_gamma/did_schema_meta.jsontimeref_epochsetandtime_referenceto thetypeenumschemas/V_gamma/valid_interval.jsontimeref_structt0,t0,timeref_structt1,t1witht0_reference,t1_reference(time_reference); addt0_referent_id,t1_referent_iddepends_on entries1.0.0 → 2.0.0schemas/V_gamma/treatment.jsonadministered_at+administered_at_referent_id2.0.0 → 2.1.0schemas/V_gamma/virus_injection.jsoninjected_at+injected_at_referent_id1.0.0 → 1.1.0schemas/V_gamma/session_occurrence.jsonsession, carries optionalstarted_at/ended_at)1.0.0schemas/V_gamma/subject_birth_event.jsonsubject, carries requiredoccurred_at)1.0.0schemas/V_gamma/CURIE_lookups_meta.jsonmmusdvandhsapdvdevelopmental-stage prefixes_format_version 1.0.0 → 1.1.0session.jsonandsubject.jsonare intentionally not modified — they remain identifier-only tag documents that other documents can_depends_onbefore time / DOB are known. Time-of-occurrence and birth events live on the new companion docs.Spec / docs
schemas/V_gamma_SPEC.md: addtimeref_epochsetandtime_referenceto the Valid Types table, semantics-of-flags table, type-enum allow-list, and Phase-1 validation list; add full sub-section under Named Composite Types covering required-by-kind table,depends_on_namecross-field invariant,_constraintskeys, and example values for every kind; relax the "sub-field types are primitive" rule to permit nested composites.schemas/V_gamma_notes.md: changelog entries for the new types, thevalid_interval2.0.0 migration, the MINOR bumps ontreatment/virus_injection, the two new tag-style docs, and the CURIE registry bump.Test plan
python3 -m pytest— all 96 tests pass (parametrized across V_beta and V_gamma)tests/test_schemas.pyVALID_TYPES_BY_VERSION["V_gamma"]updated to includetimeref_epochsetandtime_reference, sotest_all_field_types_are_validaccepts the new typesdid_schema_meta.jsonhttps://claude.ai/code/session_017KhpqmYndDHqzA9UZcUk1Q
Generated by Claude Code