Skip to content

feat: sync compact_columns with the cortex registry - #9

Merged
monazhu merged 3 commits into
mainfrom
feat/compact-columns-registry-guard
Aug 12, 2026
Merged

monazhu merged 3 commits into
mainfrom
feat/compact-columns-registry-guard

Conversation

@monazhu

@monazhu monazhu commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Closes DS-1046 — https://linear.app/cognitive3d/issue/DS-1046

Mirrors CognitiveVR/cognitive3dpy#34 (DS-1045), which lands the same guard on the Python package.

Problem

compact_columns (R/sessions.R) is a hand-curated list copied from the Python package. This repo has no schema-sync machinery, so it drifts from the cortex field registry with nothing to catch it. The drift turned out to be larger than the ticket recorded: ten entries name keys the registry marks deprecated: true, not two. Eight of them were retired from the Python compact list some time ago and never mirrored here.

Changes

  • R/registry.R records the registry keys flagged deprecated or sunsetted, with helpers that convert them to cleaned column names. The lists are hand-maintained and dated, since there is no sync script — yaml moves into Suggests so the suite can verify them against the registry itself.
  • compact_columns goes from 57 to 47 columns. Removed: app_performance, immersion_score, orientation_score, ergonomics_score, boundary_score, controller_events_score, controller_engagement_score, dynamic_engagement_score, battery_efficiency, standing_percentage. Added c3d_metric_components_posture_standing_percentage, which replaced standing_percentage upstream — new sessions carry only the posture trio, and the same-named StarRocks column is a melder compatibility alias rather than a contract.
  • c3d_metrics_average_fps stays. Melder intends to delete the emission but the org dashboard tile still reads it, so the registry deliberately keeps it active; noted inline.
  • tests/testthat/test-compact-columns.R fails on duplicates or on any compact column the registry has deprecated or sunsetted, with lifecycle_exceptions as the escape hatch for a documented retention. A fourth test cross-checks R/registry.R against slicer_fields.yaml so the hand-maintained lists cannot silently go stale — it skips when no cvr-cortex checkout is present, which is the case in CI.
  • test-sessions.R read controller_engagement_score out of compact output and would have gone red; it now reads it from full mode, and a new test asserts the dropped columns still come back with compact = FALSE.

Verification

  • testthat::test_local()417 passed, 0 failed, 0 skipped across 7 files
  • Registry cross-check ran locally against the real slicer_fields.yaml and matched both lists exactly
  • Guard confirmed non-vacuous: injecting c3d_metrics_immersion_score into the list produces FAIL 1 with the intended message

Note for reviewers

This is the user-visible half of the change: default compact output loses ten columns. All of that data is still returned by compact = FALSE. Unlike the Python package, this one has no deprecation-warning machinery, so dropped columns disappear silently rather than warning first — worth deciding whether that is acceptable or whether a warning layer should follow.

🤖 Generated with Claude Code

R/registry.R records the raw registry keys marked deprecated or sunsetted
in cvr-cortex (features/slicer/slicer_fields.yaml), plus helpers that
convert them to cleaned column names.

This package has no schema-sync machinery, so the lists are maintained by
hand and dated. yaml moves into Suggests so the test suite can verify them
against the registry whenever a cvr-cortex checkout is available.

Refs DS-1046
compact_columns carried ten keys the registry marks deprecated:
app_performance, immersion_score, orientation_score, ergonomics_score,
boundary_score, controller_events_score, controller_engagement_score,
dynamic_engagement_score, battery_efficiency, and standing_percentage.
Eight of them were already absent from the sibling Python package's
compact list, so this also restores parity between the two.

c3d_metric_components_posture_standing_percentage takes the place of
standing_percentage, which it replaced upstream — new sessions carry only
the posture_* trio, and the same-named StarRocks column is a melder
compatibility alias rather than a contract.

battery_efficiency has no single successor: it is superseded by a drain
rate computed from battery_drain_sum and battery_drain_time_millis.

c3d_metrics_average_fps stays. Melder intends to delete the emission but
the org dashboard tile still reads it, so the registry deliberately keeps
it active; noted inline so it is not removed by mistake.

Compact output goes from 57 to 47 columns. Everything dropped is still
returned by compact = FALSE.

Refs DS-1046
test-compact-columns.R fails if compact_columns contains a duplicate or a
key the registry has deprecated or sunsetted, with lifecycle_exceptions as
the escape hatch for a documented retention. A fourth test cross-checks
R/registry.R against slicer_fields.yaml itself, so the hand-maintained
lists cannot silently go stale; it skips when no cvr-cortex checkout is
present, which is the case in CI.

test-sessions.R reads controller_engagement_score from full mode now that
it is no longer curated into compact, and asserts that the other dropped
columns still come back with compact = FALSE.

Refs DS-1046
@monazhu
monazhu merged commit 4889d53 into main Aug 12, 2026
6 checks passed
@monazhu
monazhu deleted the feat/compact-columns-registry-guard branch August 12, 2026 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants