feat: sync compact session columns with the cortex registry - #34
Merged
Merged
Conversation
sync_schema.py now collects the `deprecated` and `sunsetted` flags the registry already publishes (session + event, fields + properties) and emits them as DEPRECATED_KEYS / SUNSETTED_KEYS frozensets. _schema.py exposes them normalized as DEPRECATED_REGISTRY_COLUMNS and SUNSETTED_REGISTRY_COLUMNS. This gives the package a generated view of registry lifecycle state that tracks cortex on every schema sync, without moving per-consumer curation into the shared registry. Refs DS-1045
SESSIONS_COMPACT_COLUMNS carried two keys the registry marks deprecated: - c3d.metrics.standing_percentage — retired compute, replaced by c3d.metric_components.posture_standing_percentage. New sessions carry only the posture_* trio; the same-named StarRocks column is a melder compatibility alias, and the ES path has no alias at all. The replacement column takes its place in compact output. - c3d.metrics.battery_efficiency — superseded by a drain rate, which has no single successor key. Removed without a replacement column; callers who need it can compute it from battery_drain_sum and battery_drain_time_millis with compact=False. Both keep their DEPRECATED_PROPERTIES entries, so they still emit a DeprecationWarning and remain in non-compact output and empty frames. c3d.metrics.average_fps stays: melder wants to delete the emission but the org dashboard tile still reads it, so the registry status is deliberately active. Noted inline so it is not "cleaned up" by mistake. Refs DS-1045
Fails CI when a compact column resolves to no known field/property, or to a key the registry has marked deprecated or sunsetted. Derived columns (API flags, package-computed fields) are allowlisted with reasons, and deliberate retentions go in _LIFECYCLE_EXCEPTIONS — empty today. A stale-exception test keeps that list honest. Closes the loop with the schema-sync workflow: a cortex registry change regenerates the lifecycle sets on the PR branch, and this test turns red if the curated list no longer agrees with it. Refs DS-1045
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.
Closes DS-1045 — https://linear.app/cognitive3d/issue/DS-1045
Problem
SESSIONS_COMPACT_COLUMNSis a hand-curated list feeding thecompact=Truedefault ofc3d_sessions(). It is not generated byscripts/sync_schema.py(that covers Polars type mappings only), so it drifts from the cortex registry. Two keys in it were retired upstream — three, once every entry was checked.Approach
The ticket offered two options: move curation into
slicer_fields.yamland generate the list, or keep the list local and validate it. This PR takes the second.The registry already publishes what we need —
deprecated(consumers should stop reading the key) andsunsetted(no shipping SDK emits it). Adding acompactattribute would instead push one package's presentation choice into a registry shared by dash2, cvr-analyst, melder, and the MCP server, and would need a second attribute to preserve the list's grouping. Validation keeps curation local and still fails loudly on drift.Changes
scripts/sync_schema.pycollects the two lifecycle flags across session/event fields and properties, emittingDEPRECATED_KEYSandSUNSETTED_KEYS(23 each) into_schema_generated.py._schema.pyexposes them normalized asDEPRECATED_REGISTRY_COLUMNS/SUNSETTED_REGISTRY_COLUMNS.DeprecationWarningon use, still present in non-compact output and empty frames:c3d_metrics_standing_percentage— retired compute;c3d_metric_components_posture_standing_percentagereplaces it in the list.c3d_metrics_battery_efficiency— not flagged in the ticket; superseded by a drain rate with no single successor key, so it is removed without a replacement column. Callers can compute it frombattery_drain_sumandbattery_drain_time_milliswithcompact=False.c3d_metrics_average_fpsis unchanged. Melder intends to delete the emission, but the org dashboard tile still reads it and the registry status is deliberately active (decision recorded 2026-07-29). Noted inline so it is not "cleaned up" later.tests/test_compact_columns.pyfails when a column resolves to nothing, or resolves to a deprecated/sunsetted key. Nine derived columns — API flags and package-computed fields — are allowlisted with reasons; deliberate retentions go in_LIFECYCLE_EXCEPTIONS, empty today and kept honest by a stale-exception test.This closes the loop with
schema-sync.yml: a cortex registry change regenerates the lifecycle sets onto the PR branch, and the guard test turns red if the curated list no longer agrees.Verification
uv run pytest tests/ -q→ 240 passeduv run ruff check src/ tests/→ clean, matching CI scopeNote for reviewers
Default compact output loses two columns. The data is unchanged and still reachable with
compact=False, which is why this is typedfeat:rather than a breaking change — the same treatment previous compact-list deprecations got in this repo.Sibling PR for the R package: CognitiveVR/cognitive3dr#9 (DS-1046).
🤖 Generated with Claude Code